@overlordai/server 1.0.59 → 1.0.61

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 (105) hide show
  1. package/database/migrations/002-task-type.sql +2 -0
  2. package/dist/adapters/lark/lark-message.parser.d.ts +1 -0
  3. package/dist/adapters/lark/lark-message.parser.d.ts.map +1 -1
  4. package/dist/adapters/lark/lark-message.parser.js +9 -0
  5. package/dist/adapters/lark/lark-message.parser.js.map +1 -1
  6. package/dist/adapters/slack/slack-message.parser.d.ts.map +1 -1
  7. package/dist/adapters/slack/slack-message.parser.js +9 -0
  8. package/dist/adapters/slack/slack-message.parser.js.map +1 -1
  9. package/dist/database/repositories/task.repository.d.ts +2 -0
  10. package/dist/database/repositories/task.repository.d.ts.map +1 -1
  11. package/dist/database/repositories/task.repository.js +6 -2
  12. package/dist/database/repositories/task.repository.js.map +1 -1
  13. package/dist/database/repositories/workspace.repository.d.ts +2 -0
  14. package/dist/database/repositories/workspace.repository.d.ts.map +1 -1
  15. package/dist/database/repositories/workspace.repository.js +21 -0
  16. package/dist/database/repositories/workspace.repository.js.map +1 -1
  17. package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
  18. package/dist/dispatcher/dispatcher.service.js +1 -0
  19. package/dist/dispatcher/dispatcher.service.js.map +1 -1
  20. package/dist/dispatcher/scheduler.service.d.ts +3 -1
  21. package/dist/dispatcher/scheduler.service.d.ts.map +1 -1
  22. package/dist/dispatcher/scheduler.service.js +22 -2
  23. package/dist/dispatcher/scheduler.service.js.map +1 -1
  24. package/dist/dispatcher/task-creation.service.d.ts.map +1 -1
  25. package/dist/dispatcher/task-creation.service.js +2 -0
  26. package/dist/dispatcher/task-creation.service.js.map +1 -1
  27. package/dist/main.js.map +1 -1
  28. package/dist/web/frame-handlers/progress.handler.d.ts +3 -1
  29. package/dist/web/frame-handlers/progress.handler.d.ts.map +1 -1
  30. package/dist/web/frame-handlers/progress.handler.js +7 -1
  31. package/dist/web/frame-handlers/progress.handler.js.map +1 -1
  32. package/dist/web/task.controller.d.ts +2 -0
  33. package/dist/web/task.controller.d.ts.map +1 -1
  34. package/dist/web/worker-channel.gateway.d.ts +2 -1
  35. package/dist/web/worker-channel.gateway.d.ts.map +1 -1
  36. package/dist/web/worker-channel.gateway.js +5 -3
  37. package/dist/web/worker-channel.gateway.js.map +1 -1
  38. package/package.json +4 -4
  39. package/public/assets/{AccessTokensPage-CUQDQyQ5.js → AccessTokensPage-DcOzH6vQ.js} +1 -1
  40. package/public/assets/{AdminPage-ChDIUX_3.js → AdminPage-DjzkTi-Z.js} +1 -1
  41. package/public/assets/{ApiReferencePage-DFFhnxAn.js → ApiReferencePage-Cn1nZmYJ.js} +1 -1
  42. package/public/assets/{AuditLogPage-X3KImiZ3.js → AuditLogPage-CkE1EJZh.js} +1 -1
  43. package/public/assets/{BindPlatformPage-ByhQZ5qX.js → BindPlatformPage-DYNztOnJ.js} +1 -1
  44. package/public/assets/{BotManage-BCCGabIK.js → BotManage-B4YAKqEk.js} +1 -1
  45. package/public/assets/{CliReferencePage-BmEVf_Yf.js → CliReferencePage-DyfbBqGH.js} +1 -1
  46. package/public/assets/{DeveloperManage-959Sec6Y.js → DeveloperManage-DgwZWjLh.js} +1 -1
  47. package/public/assets/EditProjectPage-DjGCEool.js +2 -0
  48. package/public/assets/{EmptyState-BQqxSE6p.js → EmptyState-C7-kuf8X.js} +1 -1
  49. package/public/assets/{HomePage-CO4wRT0y.js → HomePage-CWYmPB1e.js} +1 -1
  50. package/public/assets/{InfoRow-DGKqWvsB.js → InfoRow-DGZv5P3m.js} +1 -1
  51. package/public/assets/{LandingPage-DP9U6Iea.js → LandingPage-ZuEWmIZL.js} +1 -1
  52. package/public/assets/{LoginPage-OLBwEvXt.js → LoginPage-ZN3nJzEX.js} +1 -1
  53. package/public/assets/{MetricBar-D8u403eM.js → MetricBar-CH5ccxZr.js} +1 -1
  54. package/public/assets/{NotFoundPage-DA9fVgox.js → NotFoundPage-DkoNgmQ4.js} +1 -1
  55. package/public/assets/{OnboardingGuide-BgPC4aiz.js → OnboardingGuide-dk4OyOgV.js} +1 -1
  56. package/public/assets/{PipelineEditorPage-Ra4MjS17.js → PipelineEditorPage-CtUnQDef.js} +1 -1
  57. package/public/assets/{ProfilePage-BWGufJ03.js → ProfilePage-B0CWDm55.js} +1 -1
  58. package/public/assets/{ProjectDetailPage-CLqYqqVX.js → ProjectDetailPage-BbOgUrnR.js} +1 -1
  59. package/public/assets/{ProjectListPage-CitoAwwH.js → ProjectListPage-CtGknAYM.js} +1 -1
  60. package/public/assets/{task-constants-Bj_lR7bu.js → PtyTerminal-C28RQ62I.js} +4 -4
  61. package/public/assets/{QuickAuth-dOCzSE_V.js → QuickAuth-8eT76fKz.js} +1 -1
  62. package/public/assets/{RemoveMemberConfirmDialog-D-rvX20k.js → RemoveMemberConfirmDialog-Ctyx8n2a.js} +1 -1
  63. package/public/assets/{Select-CdRjIJm4.js → Select-8MUED_Fj.js} +1 -1
  64. package/public/assets/{SettingsPage-DHa6WOhU.js → SettingsPage-CXDXq71S.js} +1 -1
  65. package/public/assets/{Skeleton-CEc5RMQi.js → Skeleton-B0x9oN6a.js} +1 -1
  66. package/public/assets/{SkillPage-D0lNlB7o.js → SkillPage-CeTlmMdA.js} +1 -1
  67. package/public/assets/{TaskDetailPage-LdLghDpk.js → TaskDetailPage-jyeOPtsb.js} +2 -2
  68. package/public/assets/TaskListPage-DMYTWhw_.js +1 -0
  69. package/public/assets/{TaskStatusBadge-xZ7FBWZw.js → TaskStatusBadge-yU5DIpkP.js} +1 -1
  70. package/public/assets/TerminalHomePage-D3Z-uJUx.js +16 -0
  71. package/public/assets/{TokenManage-DP0iub57.js → TokenManage-NYgoI8yJ.js} +1 -1
  72. package/public/assets/{TotpSetupPage-VeqXwL5k.js → TotpSetupPage-lw418pBO.js} +1 -1
  73. package/public/assets/{WorkerDetailPage-BOn7z8cR.js → WorkerDetailPage-CF7FWzQn.js} +1 -1
  74. package/public/assets/{WorkerListPage-P1hVwXGG.js → WorkerListPage-Dd6P84ye.js} +1 -1
  75. package/public/assets/{WorkerSetupGuidePage-m-ZneK_i.js → WorkerSetupGuidePage-dRLxcC1D.js} +1 -1
  76. package/public/assets/{arrow-left-DGmTxTQH.js → arrow-left-D3hlGpFa.js} +1 -1
  77. package/public/assets/{arrow-right-CTOYnmu3.js → arrow-right-DbRiIkn5.js} +1 -1
  78. package/public/assets/{bot-BKKWb03w.js → bot-DJcm4TDu.js} +1 -1
  79. package/public/assets/{chevron-right-CKEZOJqX.js → chevron-right-Cz1_0u26.js} +1 -1
  80. package/public/assets/{copy-Ca3klMOV.js → copy-BSpogfAn.js} +1 -1
  81. package/public/assets/{external-link-smb8Si2G.js → external-link-BYnHDfTq.js} +1 -1
  82. package/public/assets/{index-CqnL6hX8.js → index-C5ry7bCb.js} +3 -3
  83. package/public/assets/index-DBZN6iTO.css +1 -0
  84. package/public/assets/{key-uv0MVCos.js → key-B7y18xnM.js} +1 -1
  85. package/public/assets/{loader-circle-knGZUOVM.js → loader-circle-j2WCDelv.js} +1 -1
  86. package/public/assets/{pencil-zZY9INFY.js → pencil-CkuHyqYU.js} +1 -1
  87. package/public/assets/{plus-CypZlZSj.js → plus-DETa4kg0.js} +1 -1
  88. package/public/assets/{rotate-ccw-CV1EIcxQ.js → rotate-ccw-oPqSTHU8.js} +1 -1
  89. package/public/assets/{scroll-text-mAU4OFrg.js → scroll-text--ZQgIRbt.js} +1 -1
  90. package/public/assets/{settings-BZyNzgEB.js → settings-COdENdI-.js} +1 -1
  91. package/public/assets/{status-colors-BXL4VDNh.js → status-colors-C_xltR1x.js} +1 -1
  92. package/public/assets/task-constants-BisV3uAk.js +1 -0
  93. package/public/assets/{trash-2-BJ5q4Wkp.js → trash-2-BLxwKGg4.js} +1 -1
  94. package/public/assets/{useFetch-CJla7_79.js → useFetch-CKA2R0HW.js} +1 -1
  95. package/public/assets/{users-DBFmGr_S.js → users-Cm06VaAm.js} +1 -1
  96. package/public/assets/{wifi-DZo2oi08.js → wifi-CoOrgHWP.js} +1 -1
  97. package/public/assets/{zap-CDX3UpIX.js → zap-CZBm69SW.js} +1 -1
  98. package/public/index.html +2 -2
  99. package/public/sw.js +1 -1
  100. package/public/assets/EditProjectPage-DiVkK33D.js +0 -2
  101. package/public/assets/TaskListPage-BjPRD6v8.js +0 -1
  102. package/public/assets/TerminalHomePage-cz_7HYVr.js +0 -16
  103. package/public/assets/index-BS0Fbx5V.css +0 -1
  104. package/public/assets/task.store-Bldcjv9A.js +0 -1
  105. /package/public/assets/{task-constants-Beg8tuEN.css → PtyTerminal-Beg8tuEN.css} +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-DP9U6Iea.js","assets/arrow-right-CTOYnmu3.js","assets/zap-CDX3UpIX.js","assets/bot-BKKWb03w.js","assets/users-DBFmGr_S.js","assets/copy-Ca3klMOV.js","assets/HomePage-CO4wRT0y.js","assets/TaskStatusBadge-xZ7FBWZw.js","assets/status-colors-BXL4VDNh.js","assets/Skeleton-CEc5RMQi.js","assets/OnboardingGuide-BgPC4aiz.js","assets/chevron-right-CKEZOJqX.js","assets/date-BdNtiQTP.js","assets/string-B39tzdVK.js","assets/useFetch-CJla7_79.js","assets/TerminalHomePage-cz_7HYVr.js","assets/task.store-Bldcjv9A.js","assets/task-constants-Bj_lR7bu.js","assets/task-constants-Beg8tuEN.css","assets/Select-CdRjIJm4.js","assets/plus-CypZlZSj.js","assets/wifi-DZo2oi08.js","assets/TaskListPage-BjPRD6v8.js","assets/EmptyState-BQqxSE6p.js","assets/TaskDetailPage-LdLghDpk.js","assets/arrow-left-DGmTxTQH.js","assets/rotate-ccw-CV1EIcxQ.js","assets/external-link-smb8Si2G.js","assets/loader-circle-knGZUOVM.js","assets/WorkerListPage-P1hVwXGG.js","assets/MetricBar-D8u403eM.js","assets/WorkerSetupGuidePage-m-ZneK_i.js","assets/key-uv0MVCos.js","assets/settings-BZyNzgEB.js","assets/WorkerDetailPage-BOn7z8cR.js","assets/InfoRow-DGKqWvsB.js","assets/trash-2-BJ5q4Wkp.js","assets/ProjectListPage-CitoAwwH.js","assets/ProjectDetailPage-CLqYqqVX.js","assets/RemoveMemberConfirmDialog-D-rvX20k.js","assets/pencil-zZY9INFY.js","assets/EditProjectPage-DiVkK33D.js","assets/PipelineEditorPage-Ra4MjS17.js","assets/ProfilePage-BWGufJ03.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-CUQDQyQ5.js","assets/CliReferencePage-BmEVf_Yf.js","assets/QuickAuth-dOCzSE_V.js","assets/ApiReferencePage-DFFhnxAn.js","assets/SkillPage-D0lNlB7o.js","assets/AdminPage-ChDIUX_3.js","assets/scroll-text-mAU4OFrg.js","assets/DeveloperManage-959Sec6Y.js","assets/BotManage-BCCGabIK.js","assets/TokenManage-DP0iub57.js","assets/AuditLogPage-X3KImiZ3.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-ZuEWmIZL.js","assets/arrow-right-DbRiIkn5.js","assets/zap-CZBm69SW.js","assets/bot-DJcm4TDu.js","assets/users-Cm06VaAm.js","assets/copy-BSpogfAn.js","assets/HomePage-CWYmPB1e.js","assets/TaskStatusBadge-yU5DIpkP.js","assets/status-colors-C_xltR1x.js","assets/Skeleton-B0x9oN6a.js","assets/OnboardingGuide-dk4OyOgV.js","assets/chevron-right-Cz1_0u26.js","assets/date-BdNtiQTP.js","assets/string-B39tzdVK.js","assets/useFetch-CKA2R0HW.js","assets/TerminalHomePage-D3Z-uJUx.js","assets/task-constants-BisV3uAk.js","assets/PtyTerminal-C28RQ62I.js","assets/PtyTerminal-Beg8tuEN.css","assets/Select-8MUED_Fj.js","assets/plus-DETa4kg0.js","assets/wifi-CoOrgHWP.js","assets/TaskListPage-DMYTWhw_.js","assets/EmptyState-C7-kuf8X.js","assets/TaskDetailPage-jyeOPtsb.js","assets/arrow-left-D3hlGpFa.js","assets/rotate-ccw-oPqSTHU8.js","assets/external-link-BYnHDfTq.js","assets/loader-circle-j2WCDelv.js","assets/WorkerListPage-Dd6P84ye.js","assets/MetricBar-CH5ccxZr.js","assets/WorkerSetupGuidePage-dRLxcC1D.js","assets/key-B7y18xnM.js","assets/settings-COdENdI-.js","assets/WorkerDetailPage-CF7FWzQn.js","assets/InfoRow-DGZv5P3m.js","assets/trash-2-BLxwKGg4.js","assets/ProjectListPage-CtGknAYM.js","assets/ProjectDetailPage-BbOgUrnR.js","assets/RemoveMemberConfirmDialog-Ctyx8n2a.js","assets/pencil-CkuHyqYU.js","assets/EditProjectPage-DjGCEool.js","assets/PipelineEditorPage-CtUnQDef.js","assets/ProfilePage-B0CWDm55.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-DcOzH6vQ.js","assets/CliReferencePage-DyfbBqGH.js","assets/QuickAuth-8eT76fKz.js","assets/ApiReferencePage-Cn1nZmYJ.js","assets/SkillPage-CeTlmMdA.js","assets/AdminPage-DjzkTi-Z.js","assets/scroll-text--ZQgIRbt.js","assets/DeveloperManage-DgwZWjLh.js","assets/BotManage-B4YAKqEk.js","assets/TokenManage-NYgoI8yJ.js","assets/AuditLogPage-CkE1EJZh.js"])))=>i.map(i=>d[i]);
2
2
  var Xy=Object.defineProperty;var Im=u=>{throw TypeError(u)};var Vy=(u,r,s)=>r in u?Xy(u,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[r]=s;var Xe=(u,r,s)=>Vy(u,typeof r!="symbol"?r+"":r,s),_s=(u,r,s)=>r.has(u)||Im("Cannot "+s);var U=(u,r,s)=>(_s(u,r,"read from private field"),s?s.call(u):r.get(u)),It=(u,r,s)=>r.has(u)?Im("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(u):r.set(u,s),Zt=(u,r,s,o)=>(_s(u,r,"write to private field"),o?o.call(u,s):r.set(u,s),s),be=(u,r,s)=>(_s(u,r,"access private method"),s);var Pm=(u,r,s,o)=>({set _(f){Zt(u,r,f,s)},get _(){return U(u,r,o)}});(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function s(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(f){if(f.ep)return;f.ep=!0;const m=s(f);fetch(f.href,m)}})();function Qy(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var ys={exports:{}},ei={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -218,8 +218,8 @@ Please change the parent <Route path="${L}"> to <Route path="${L==="/"?"*":`${L}
218
218
  *
219
219
  * This source code is licensed under the ISC license.
220
220
  * See the LICENSE file in the root directory of this source tree.
221
- */const rb=je("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),gh=u=>{let r;const s=new Set,o=(p,j)=>{const k=typeof p=="function"?p(r):p;if(!Object.is(k,r)){const M=r;r=j??(typeof k!="object"||k===null)?k:Object.assign({},r,k),s.forEach(X=>X(r,M))}},f=()=>r,x={setState:o,getState:f,getInitialState:()=>g,subscribe:p=>(s.add(p),()=>s.delete(p))},g=r=u(o,f,x);return x},ob=(u=>u?gh(u):gh),sb=u=>u;function cb(u,r=sb){const s=ju.useSyncExternalStore(u.subscribe,ju.useCallback(()=>r(u.getState()),[u,r]),ju.useCallback(()=>r(u.getInitialState()),[u,r]));return ju.useDebugValue(s),s}const vh=u=>{const r=ob(u),s=o=>cb(r,o);return Object.assign(s,r),s},Wu=(u=>u?vh(u):vh),zu="overlord-access-token",Cu="overlord-refresh-token",We={getAccessToken(){return localStorage.getItem(zu)},setAccessToken(u){localStorage.setItem(zu,u)},getRefreshToken(){return localStorage.getItem(Cu)},setRefreshToken(u){localStorage.setItem(Cu,u)},setTokens(u,r){localStorage.setItem(zu,u),localStorage.setItem(Cu,r)},clearTokens(){localStorage.removeItem(zu),localStorage.removeItem(Cu)},parseToken(u){try{const r=u.split(".")[1];return JSON.parse(atob(r))}catch{return null}},hasScope(u,r){const s=We.parseToken(u);return s?s.scope===r:!1},isExpired(u){const r=We.parseToken(u);return!r||typeof r.exp!="number"?!0:Date.now()/1e3>r.exp-30}};function Ts(u){const r=We.parseToken(u);if(!r)return null;const s=r.name??"";return{id:r.sub,username:s,display_name:s,role:r.role}}const xa=Wu((u,r)=>({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1,initializing:!0,initialize:()=>{const s=We.getAccessToken();s&&!We.isExpired(s)?u({accessToken:s,user:Ts(s),requireTotpSetup:We.hasScope(s,"totp_setup"),initializing:!1}):We.getRefreshToken()?r().refresh().catch(()=>{We.clearTokens()}).finally(()=>{u({initializing:!1})}):u({initializing:!1})},login:async s=>{var m;const o=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!o.ok){const h=await o.json().catch(()=>({message:"Login failed"})),x=((m=h.error)==null?void 0:m.message)??h.message??"Login failed";throw new Error(x)}const f=await o.json();if(f.totpSetup){We.setAccessToken(f.accessToken),u({accessToken:f.accessToken,user:null,requireTotpSetup:!0});return}We.setTokens(f.accessToken,f.refreshToken),u({accessToken:f.accessToken,user:Ts(f.accessToken),requireTotpSetup:!1,sessionExpired:!1})},logout:()=>{const s=We.getRefreshToken();s&&fetch("/api/auth/logout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:s})}).catch(()=>{}),We.clearTokens(),u({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1})},refresh:(()=>{let s=null;return async()=>s||(s=(async()=>{const o=We.getRefreshToken();if(!o)throw We.clearTokens(),u({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!0}),new Error("No refresh token");const f=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:o})});if(!f.ok)throw We.clearTokens(),u({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!0}),new Error("Refresh failed");const m=await f.json();We.setTokens(m.accessToken,m.refreshToken),u({accessToken:m.accessToken,user:Ts(m.accessToken)})})().finally(()=>{s=null}),s)})(),setSessionExpired:s=>{u({sessionExpired:s})}})),$0={QUEUED:"QUEUED",ASSIGNED:"ASSIGNED",RUNNING:"RUNNING",SUSPENDED:"SUSPENDED",COMPLETED:"COMPLETED",FAILED:"FAILED",CANCELLED:"CANCELLED"},W0={ONLINE:"online",OFFLINE:"offline",DRAINING:"draining",DECOMMISSIONED:"decommissioned"},Ph={DEVELOPER:"developer",LEAD:"lead",ADMIN:"admin"},F0={MAINTAINER:"maintainer",MEMBER:"member"},I0={CLAUDE:"claude",CURSOR:"cursor",CODEX:"codex",CUSTOM:"custom"},P0={ACTIVE:"active",USED:"used",REVOKED:"revoked",EXPIRED:"expired"},e1={GITLAB:"gitlab",GITHUB:"github",GITEA:"gitea"},t1={ACTIVE:"active",DISABLED:"disabled"},a1={ACTIVE:"active"},l1={IDLE:"IDLE",STARTING:"STARTING",CONNECTED:"CONNECTED",EXPIRED:"EXPIRED",CLOSING:"CLOSING",CLOSED:"CLOSED"};function fb(){return xa(u=>{var r;return((r=u.user)==null?void 0:r.role)===Ph.ADMIN})??!1}const ep="overlord-sidebar-collapsed";function db(){try{return localStorage.getItem(ep)==="true"}catch{return!1}}const mb=Wu((u,r)=>({sidebarCollapsed:db(),toggleSidebar:()=>{const s=!r().sidebarCollapsed;try{localStorage.setItem(ep,String(s))}catch{}u({sidebarCollapsed:s})}}));class hb{constructor(){Xe(this,"ws",null);Xe(this,"reconnectAttempts",0);Xe(this,"maxReconnectAttempts",15);Xe(this,"reconnectTimer",null);Xe(this,"disposed",!1);Xe(this,"authenticated",!1);Xe(this,"eventHandlers",new Set);Xe(this,"statusHandlers",new Set)}onEvent(r){return this.eventHandlers.add(r),()=>this.eventHandlers.delete(r)}onStatus(r){return this.statusHandlers.add(r),()=>this.statusHandlers.delete(r)}get isConnected(){var r;return this.authenticated&&((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN}connect(){var f,m;if(this.disposed||((f=this.ws)==null?void 0:f.readyState)===WebSocket.OPEN||((m=this.ws)==null?void 0:m.readyState)===WebSocket.CONNECTING)return;const r=We.getAccessToken();if(!r||We.isExpired(r))return;const o=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/events`;this.notifyStatus("connecting"),this.authenticated=!1,this.ws=new WebSocket(o),this.ws.onopen=()=>{var x,g;const h=We.getAccessToken();h?(x=this.ws)==null||x.send(JSON.stringify({type:"auth",token:h})):(g=this.ws)==null||g.close()},this.ws.onmessage=h=>{var x;if(typeof h.data=="string")try{const g=JSON.parse(h.data);if(g.type==="auth_ok"){this.authenticated=!0,this.reconnectAttempts=0,this.notifyStatus("connected");return}if(g.type==="auth_error"){(x=this.ws)==null||x.close();return}if(g.type==="event")for(const p of this.eventHandlers)try{p(g)}catch{}}catch{}},this.ws.onclose=()=>{this.authenticated=!1,this.notifyStatus("disconnected"),this.scheduleReconnect()},this.ws.onerror=()=>{var h;(h=this.ws)==null||h.close()}}disconnect(){var r;this.clearReconnectTimer(),this.authenticated=!1,(r=this.ws)==null||r.close(),this.ws=null}dispose(){this.disposed=!0,this.disconnect(),this.eventHandlers.clear(),this.statusHandlers.clear()}reconnect(){this.disconnect(),this.reconnectAttempts=0,this.connect()}scheduleReconnect(){if(this.disposed||this.reconnectAttempts>=this.maxReconnectAttempts)return;const r=Math.min(1e3*2**this.reconnectAttempts,3e4);this.reconnectAttempts++,this.reconnectTimer=setTimeout(()=>{this.disposed||this.connect()},r)}clearReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}notifyStatus(r){for(const s of this.statusHandlers)try{s(r)}catch{}}}const Ou=new hb,pb=Wu(u=>({status:"disconnected",lastEvent:null,eventSeq:0,taskSeq:0,workerSeq:0,init:()=>{const r=Ou.onEvent(o=>{const f=o.event==="task_status_changed"||o.event==="task_created",m=o.event==="worker_status_changed";u(h=>({lastEvent:o,eventSeq:h.eventSeq+1,...f&&{taskSeq:h.taskSeq+1},...m&&{workerSeq:h.workerSeq+1}}))}),s=Ou.onStatus(o=>{u({status:o})});return Ou.connect(),()=>{r(),s(),Ou.disconnect()}}})),tp="overlord-theme";function _b(){try{const u=localStorage.getItem(tp);if(u==="light"||u==="dark"||u==="system")return u}catch{}return"dark"}function bh(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const ap=Wu(u=>{const r=_b(),s=r==="system"?bh():r;return{theme:r,resolved:s,setTheme:o=>{localStorage.setItem(tp,o);const f=o==="system"?bh():o;u({theme:o,resolved:f})},setResolved:o=>{u({resolved:o})}}}),yb={common:{cancel:"cancel",confirm:"confirm",save:"save",delete:"delete",edit:"edit",create:"create",copy:"copy",copied:"copied",close:"close",back:"back",back_to_site:"back to site",go_back:"go_back",go_home:"go_home",dismiss:"dismiss",retry:"retry",loading:"// loading...",processing:"processing...",creating:"creating...",saving:"saving...",updating:"updating...",verifying:"verifying...",signing_in:"signing in...",just_now:"just now",never:"never",previous:"previous",next:"next",error:"error",success:"success",failed:"failed",active:"active",inactive:"inactive",enabled:"enabled",disabled:"disabled",showing_entries:"showing {start}-{end} of {total}",no_results:"no results found",runtime_error:"// runtime_error",an_unexpected_error_occurred:"an unexpected error occurred",reload:"reload",not_found:"404",page_not_found:"// page_not_found",the_page_does_not_exist:"the page you are looking for does not exist or has been moved.",not_found_terminal_error:"error: requested not found - page does not exist",not_set:"not set",view_all:"view_all",discard:"discard",save_changes:"save_changes",add:"add",remove:"remove",search:"search",actions:"actions",name:"name",status:"status",role:"role",description:"description",type:"type",created_at:"created_at",ago:"{time} ago",m_ago:"{n}m ago",h_ago:"{n}h ago",d_ago:"{n}d ago",navigation:"// navigation",docs_section:"// docs",admin_section:"// admin",overlord:"overlord",logout:"logout",logout_title:"// logout",logout_message:"are you sure you want to log out?",log_out:"log out",profile:"profile",search_placeholder:"search",search_input_placeholder:"search tasks, workers, projects...",no_search_results:'// no results for "{query}"',navigate_hint:"navigate",select_hint:"select",close_hint:"close",notifications:"notifications",mark_all_read:"mark all read",no_notifications:"// no notifications",mark_as_read:"mark as read",switch_to_light:"switch to light mode",switch_to_dark:"switch to dark mode",light_mode:"light mode",dark_mode:"dark mode",dismiss_notification:"dismiss",breadcrumb_terminal:"terminal",breadcrumb_terminal_sub:"active sessions",breadcrumb_dashboard:"dashboard",breadcrumb_dashboard_sub:"active overview",breadcrumb_tasks:"tasks",breadcrumb_tasks_sub:"queue management",breadcrumb_workers:"workers",breadcrumb_workers_sub:"fleet status",breadcrumb_projects:"projects",breadcrumb_projects_sub:"repository index",breadcrumb_admin:"admin",breadcrumb_admin_sub:"system control",breadcrumb_profile:"profile",breadcrumb_profile_sub:"user settings",breadcrumb_access_tokens:"access_tokens",breadcrumb_access_tokens_sub:"personal api tokens",breadcrumb_docs:"docs",breadcrumb_docs_sub:"documentation",breadcrumb_docs_cli:"docs",breadcrumb_docs_cli_sub:"cli",breadcrumb_docs_api:"docs",breadcrumb_docs_api_sub:"api",breadcrumb_docs_skill:"docs",breadcrumb_docs_skill_sub:"skill",error_default_title:"something went wrong",error_default_message:"an unexpected error occurred. please try again."},auth:{sign_in:"sign in",username:"username",enter_username:"enter username",password:"password",enter_password:"enter password",ai_powered_development_system:"// ai-powered development system",username_and_password_required:"username and password are required.",login_failed:"login failed",invalid_totp_code:"invalid totp code",two_factor_verification:"// 2fa verification",enter_totp_code:"enter your totp code",please_enter_valid_6_digit_code:"please enter a valid 6-digit code.",session_expired:"session_expired",session_expired_message:"// your session has expired. please log in again.",go_to_login:"go_to_login",totp_setup_title:"2fa_setup",totp_setup_subtitle:"// scan the qr code with your authenticator app",scan_with_authenticator:"scan this qr code with your authenticator app (google authenticator, authy, etc.)",manual_entry_key:"manual_entry_key",enter_verification_code:"enter the 6-digit verification code from your authenticator app",verification_code:"verification code",enter_6_digit_code:"enter 6-digit code",verify_and_enable:"verify_and_enable",totp_setup_complete:"2fa setup complete",totp_setup_complete_login_again:"2fa setup complete! please log in again.",totp_setup_failed:"verification failed. please try again.",totp_setup_footer:"// you must complete this setup before accessing the application",totp_manual_entry:"// or enter this key manually",verify:"verify",initializing:"// initializing...",failed_to_init_totp:"failed to initialize totp setup"},dashboard:{title:"dashboard",subtitle:"// system overview",active_tasks:"active_tasks",queued_tasks:"queued_tasks",online_workers:"online_workers",completed_today:"completed_today",task_success_rate:"> task_success_rate",last_7_days:"last 7 days",recent_tasks:"> recent_tasks",no_tasks_yet:"// no tasks yet",worker_status:"> worker_status",no_workers_registered:"// no workers registered",recent_activity:"> recent_activity",no_recent_activity:"// no recent activity",daily_breakdown_not_available:"// daily breakdown not available",slots:"slots",online:"online",idle:"idle",offline:"offline"},tasks:{title:"tasks",subtitle:"// queue management",create_task:"create_task",new_task:"new_task",task_description:"task_description",describe_task_placeholder:"describe the development task in detail...",project:"project",select_project:"select project...",target_worker:"target_worker (optional)",any_able:"any able",assign_developer:"assign_developer (admin only)",select_developer:"select developer...",search_tasks:"search_tasks...",id:"id",description_col:"description",status_col:"status",project_col:"project",assignee:"assignee",worker:"worker",time:"time",stage:"stage",no_tasks_found:"no_tasks_found",try_adjusting_search:"try adjusting your search query",create_first_task:"create your first task to get started",tab_all:"all",tab_running:"running",tab_queued:"queued",tab_completed:"completed",tab_failed:"failed",tab_cancelled:"cancelled",status_queued:"queued",status_assigned:"assigned",status_running:"running",status_suspended:"suspended",status_completed:"completed",status_failed:"failed",status_cancelled:"cancelled",similar_task_exists:"a similar task already exists.",confirm_create_similar:"are you sure you want to create this task?",view_existing:"view_existing",force_create:"force_create",cancel_task:"cancel",retry_task:"retry",cursor_tunnel:"cursor_tunnel",skip_stage:"skip stage",take_over:"take_over",release_control:"release_control",connected:"connected",disconnected:"disconnected",connecting:"connecting",terminal:"terminal",pipeline_tab:"pipeline",logs:"logs",task_not_found:"// task_not_found",task_does_not_exist:"this task does not exist or has been deleted.",back_to_tasks:"back_to_tasks",task_detail_subtitle:"#{id} {desc}",cancel_task_title:"cancel_task",task_cancelled:"task cancelled.",failed_to_cancel_task:"failed to cancel task.",task_retried:"task has been retried.",failed_to_retry_task:"failed to retry task.",retry_mr_title:"retry_mr",retry_mr_confirm:"retry creating the merge request for task #{id}?",mr_retry_submitted:"mr retry submitted.",failed_to_retry_mr:"failed to retry mr.",activity_log:"> activity_log",pipeline_section:"> pipeline",no_pipeline:"// no pipeline configured",no_activity:"// no activity yet",confirm_stage:"confirm_stage",confirm_stage_message:'confirm execution of stage "{name}"? this will proceed with the pipeline.',stage_confirmed:"stage confirmed.",failed_to_confirm_stage:"failed to confirm stage.",loading_task:"// loading task...",task_suspended_banner:"// task suspended — waiting for user confirmation",pending_confirmation:"> pending_confirmation",pipeline_requires_confirmation:"the pipeline requires confirmation before proceeding.",confirm_and_proceed:"confirm_and_proceed",confirm_failed:"failed to confirm stage",reject:"reject",pty_terminal:"// pty terminal",view_terminal:"switch to terminal tab",restore_auto:"restore auto",requesting_takeover:"requesting...",pipeline_stages:"// pipeline stages",task_info:"> task_info",stage_timeline:"> stage_timeline",workspace_section:"> workspace",no_worker_assigned:"// no worker assigned",no_output:"// no output",pty_output:"> pty_output",stage_progress:"> stage_progress",task_logs:"> task_logs",search_logs:"search logs...",no_log_entries:"// no log entries",prev:"prev",cursor_tunnel_section:"> cursor_tunnel",auto_pipeline:"auto_pipeline",auto_mode:"auto_mode",manual_takeover:"manual_takeover",takeover_denied:"takeover_denied",requesting_takeover_ellipsis:"requesting_takeover...",take_over_label:"take over",release_label:"release",create_task_page_title:"// create_task",create_task_page_subtitle:"// submit a new task for processing",form_project_label:"project",form_description_label:"description",form_description_placeholder:"describe the task for the ai agent...",form_worker_preference:"worker_preference",form_worker_placeholder:"optional: worker id or name (--on)",form_worker_hint:"leave empty for automatic worker selection.",form_agent_type:"agent_type",form_agent_type_placeholder:"default (from project config)",form_select_project:"select a project",form_create_task:"create task",project_and_description_required:"project and description are required.",failed_to_create_task:"failed to create task.",tunnel_idle:"idle",tunnel_starting:"starting...",tunnel_connected:"connected",tunnel_expired:"expired",tunnel_closing:"closing...",tunnel_start:"start",tunnel_open_in_cursor:"open_in_cursor",tunnel_header:"> cursor_tunnel",tunnel_copied:"// copied to clipboard",tunnel_waiting:"// waiting for connection url...",tunnel_start_button:"> start_tunnel",tunnel_starting_button:"// starting...",tunnel_stopping:"// stopping...",tunnel_cancel:"> cancel",tunnel_open_cursor:"> open_in_cursor",tunnel_open_vscode:"> open_in_vscode",tunnel_stop:"> stop_tunnel",tunnel_restart:"> restart_tunnel",tunnel_copy_url:"copy url",tunnel_expires_hm:"expires in {h}h {m}m",tunnel_expires_m:"expires in {m}m",dedup_title:"> similar_task_exists",dedup_description:"// a similar task was found that may already address your request",dedup_create_anyway:"create anyway",stage_choose_option:"// choose an option",stage_your_response:"your_response",stage_type_answer:"type your answer...",stage_submitting:"submitting...",stage_continue:"continue",stage_submit:"submit",cancel_task_message:"are you sure you want to cancel task #{id}? this will terminate the running agent and cannot be undone.",cancel_task_confirm_label:"cancel task",retry_title:"retry_task",retry_confirm_label:"retry",retry_message_with_mr:"task #{id} has an existing mr ({url}). retrying will create a new attempt on the same branch. continue?",retry_message_without_mr:"are you sure you want to retry task #{id}? this will create a new execution attempt."},workers:{title:"workers",subtitle:"// fleet status",fleet:"fleet",setup_guide:"setup_guide",all_statuses:"all",register_worker:"register_worker",no_workers_found:"no_workers_found",no_workers_registered:"no workers have registered yet",try_changing_status_filter:"try changing the status filter",view_setup_guide:"view_setup_guide",online:"online",offline:"offline",draining:"draining",cpu:"cpu",mem:"mem",disk:"disk",tasks_slots:"tasks: {active}/{max} slots",back_to_workers:"back_to_workers",drain:"drain",undrain:"undrain",last_heartbeat:"last_heartbeat: {time}",resource_usage:"> resource_usage",connection_info:"> connection_info",capabilities:"> capabilities",current_tasks:"> current_tasks",no_capabilities:"// no capabilities reported",no_running_tasks:"// no running tasks",host:"host",port:"port",os:"os",cpu_model:"cpu_model",cpu_cores:"cpu_cores",memory:"memory",total_slots:"total_slots",confirm_drain:"drain_worker",confirm_drain_message:'drain worker "{name}"? it will finish current tasks but accept no new ones.',worker_drained:"worker drain initiated.",worker_undrained:"worker undrain initiated.",failed_to_update_worker:"failed to update worker status.",worker_setup_title:"worker_setup_guide",worker_setup_subtitle:"// register a new worker with overlord",step_1_title:"01. generate a registration token",step_1_desc:"generate a one-time registration token from the admin panel.",step_2_title:"02. install the worker cli",step_2_desc:"install the overlord worker cli on the target worker.",step_3_title:"03. register the worker",step_3_desc:"run the register command with your token and server url.",step_4_title:"04. start the worker",step_4_desc:"start the worker daemon. it will connect to overlord and begin accepting tasks.",generate_token:"generate_token",worker_token_modal_title:"worker_registration_token",worker_token_modal_message:"// copy this token now. it will not be shown again.",loading_worker:"// loading worker...",worker_not_found:"// worker not found",draining_warning:"// this worker is draining — no new tasks will be assigned",draining_active_tasks:"active tasks will continue to run until completion",active_tasks:"> active_tasks",no_active_tasks:"// no active tasks on this worker",worker_info:"> worker_info",unknown:"unknown",n_a:"n/a",id:"id",description:"description",stage:"stage",no_capabilities_short:"// no capabilities",slots:"slots",status_label:"status",undrain_worker_title:"> undrain_worker",drain_worker_title:"> drain_worker",undrain_confirm:"are you sure you want to undrain {name}? the worker will start accepting new tasks again.",drain_confirm:"are you sure you want to drain {name}? running tasks will complete, but no new tasks will be assigned until the worker is undrained.",decommission:"decommission",decommission_title:"> decommission_worker",decommission_confirm:'permanently decommission "{name}"? active tasks will be failed or re-queued, and the worker will be disconnected. this cannot be undone.',decommissioned:"decommissioned",worker_id:"worker_id",setup_header_desc:"// follow these steps to add a new worker to your overlord cluster.",prerequisites:"// prerequisites",prereq_machine:"linux or macos machine with at least 2 cpu cores and 4gb ram",prereq_node:"node.js 18+ and pnpm installed",prereq_git:"git installed (2.25+)",prereq_network:"network access to the overlord server",prereq_token:"admin-generated worker registration token",step_generate_token:"generate_worker_token",step_generate_token_desc:"// create a one-time registration token from the admin panel. each token can register exactly one worker.",go_to_token_management:"go_to_token_management",step_install_worker:"install_worker_package",step_install_worker_desc:"// install the overlord worker package globally via npm.",step_configure_env:"configure_environment",step_configure_env_desc:"// create a .env file in ~/.overlord-worker/ or set environment variables.",env_host:"overlord server address (required)",env_worker_token:"one-time registration token (required for first run)",env_worker_name:"display name (defaults to hostname)",env_workspace_root:"task workspace directory (defaults to ~/.overlord-worker/workspaces)",env_max_slots:"max concurrent tasks (defaults to 2)",step_start_worker:"start_worker",step_start_worker_desc:"// start the worker process. it will register with the server and begin accepting tasks.",or_run_as_service:"// or run as a system service for auto-restart:",setup_wizard_option:"// option a: interactive setup wizard (recommended)",manual_config_option:"// option b: manual configuration",start_note_setup_wizard:"// if you used the setup wizard, the worker may already be running.",step_verify_connection:"verify_connection",step_verify_connection_desc:'// once the worker connects, it will appear in the workers list with a "healthy" status.',verify_how_to:"// how to verify:",verify_check_workers:"check the workers page for your new worker",verify_status:'status should show "healthy" within 30 seconds',verify_capabilities:"worker capabilities are auto-detected on first heartbeat",last_heartbeat_label:"last_heartbeat",worker_version:"worker_version",reg_title:"// worker_registration",reg_subtitle:"> register a new worker node",reg_step_generate_token:"generate_token",reg_step_install_worker:"install_worker",reg_step_waiting_activation:"waiting_activation",reg_step_activated:"activated",reg_click_to_generate:"// click to generate a one-time registration token",reg_token_generated:"// token generated successfully",reg_install_command:"// install cli & worker:",reg_run_setup:"// run setup on worker:",reg_running_installation:"// running installation on target worker",reg_installed_wait:"i've installed → wait for activation",reg_listening_for_worker:"listening for worker connection...",reg_worker_connected:"// worker connected",reg_waiting_for_worker:"// waiting for worker to connect...",reg_worker_activated:"worker {name} activated!",reg_worker_registered:"// worker successfully registered",reg_done:"done",reg_completed:"// completed"},projects:{title:"projects",subtitle:"// repository index",create_project:"create_project",no_projects_yet:"no_projects_yet",create_first_project:"create your first project to get started",key:"key",name:"name",repository:"repository",agent:"agent",project_info:"> project_info",repo_url:"repo_url",default_branch:"default_branch",git_platform:"git_platform",agent_type:"agent_type",max_turns:"max_turns",allowed_tools:"allowed_tools",default_project:"default_project",tasks_count:"tasks",last_activity:"last_activity",members:"> members",developer:"developer",role:"role",added_at:"added_at",add_member:"add_member",remove_member:"remove_member",remove_member_confirm:"remove {name} from this project?",member_added:"member added.",member_removed:"member removed.",failed_to_add_member:"failed to add member.",member_already_exists:"this developer is already a member of this project.",failed_to_remove_member:"failed to remove member.",pipeline:"> pipeline",add_stage:"+ add_stage",recent_tasks:"> recent_tasks",no_recent_tasks:"// no recent tasks",edit_project:"edit project",delete_project:"delete_project",delete_project_confirm:'delete project "{name}"? this cannot be undone.',project_deleted:"project deleted.",failed_to_delete_project:"failed to delete project.",project_name:"project_name",project_name_placeholder:"my awesome project",project_key:"project_key",project_key_placeholder:"my-project",project_key_hint:"// unique identifier (lowercase, alphanumeric, hyphens)",ssh_url:"ssh_url",ssh_url_placeholder:"git@github.com:org/repo.git",ssh_url_hint:"// optional — workers prefer ssh for git operations",repo_url_placeholder:"https://github.com/org/repo.git",main:"main",github:"github",gitlab:"gitlab",gitea:"gitea",claude:"claude",cursor:"cursor",codex:"codex",custom:"custom",tools_placeholder:"tool1, tool2, ...",add_project_desc:"// add a new project to overlord",project_created:"project created.",failed_to_create_project:"failed to create project.",update_project_desc:"// update project configuration",save_changes:"save_changes",basic_info:"> basic_info",agent_config:"> agent_config",security:"> security",pipeline_section:"> pipeline",edit_pipeline:"> edit_pipeline",pty_output_filter:"pty_output_filter",workspace_root:"workspace_root",agent_command:"agent_command",member_role:"member",maintainer_role:"maintainer",select_developer:"select developer...",select_role:"select role...",adding:"adding...",project_not_found:"// project not found",back_to_projects:"back to projects",no_members_yet:"// no members yet",no_tasks_for_project:"// no tasks for this project yet",no_pipeline_configured:"// no pipeline configured",confirm_label:"confirm",id:"id",description:"description",status:"status",created:"created",project_saved:"project saved",failed_to_save_project:"failed to save project",invalid_pipeline_json:"invalid pipeline json",setup_commands:"setup_commands",post_command:"post_command",environment:"> environment",add_member_title:"// add_member",edit_project_title:"edit project"},pipeline:{title:"pipeline_editor",subtitle:"-- {key}",save:"save",cancel:"cancel",json_toggle:"json",add_stage:"add_stage",stage_properties:"> stage_properties",stage_name:"stage_name",timeout:"timeout",confirm_required:"confirm_required",on_failure:"on_failure",goto:"goto",max_loops:"max_loops",stop:"stop",no_stages:"// no stages defined",select_stage:"// select a stage to edit properties",saved:"pipeline saved",failed_to_save:"failed to save pipeline",failed_to_load:"failed to load pipeline.",loading_pipeline:"// loading pipeline...",unnamed:"unnamed",editing:"// editing: {name}",name:"name",on_failure_section:"// on_failure",goto_stage:"goto_stage",up:"up",down:"down",failed_to_load_project:"failed to load project",delete_stage:"delete stage"},profile:{title:"profile",subtitle:"// user settings",profile_info:"> profile_info",username:"username",git_name:"git_name",git_email:"git_email",status:"status",created_at:"created_at",edit_git_info:"edit_git_info",change_password:"> change_password",current_password:"current_password",new_password:"new_password",confirm_password:"confirm_password",current_password_required:"current password is required.",new_password_required:"new password is required.",passwords_do_not_match:"new passwords do not match.",password_changed:"password changed successfully.",failed_to_change_password:"failed to change password.",update_password:"update_password",two_factor_auth:"> two-factor_authentication",two_fa_enabled:"2fa is enabled",two_fa_not_setup:"2fa is not set up",regenerate_2fa_warning:`// regenerating 2fa will invalidate your current authenticator app setup.
221
+ */const rb=je("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),gh=u=>{let r;const s=new Set,o=(p,j)=>{const k=typeof p=="function"?p(r):p;if(!Object.is(k,r)){const M=r;r=j??(typeof k!="object"||k===null)?k:Object.assign({},r,k),s.forEach(X=>X(r,M))}},f=()=>r,x={setState:o,getState:f,getInitialState:()=>g,subscribe:p=>(s.add(p),()=>s.delete(p))},g=r=u(o,f,x);return x},ob=(u=>u?gh(u):gh),sb=u=>u;function cb(u,r=sb){const s=ju.useSyncExternalStore(u.subscribe,ju.useCallback(()=>r(u.getState()),[u,r]),ju.useCallback(()=>r(u.getInitialState()),[u,r]));return ju.useDebugValue(s),s}const vh=u=>{const r=ob(u),s=o=>cb(r,o);return Object.assign(s,r),s},Wu=(u=>u?vh(u):vh),zu="overlord-access-token",Cu="overlord-refresh-token",We={getAccessToken(){return localStorage.getItem(zu)},setAccessToken(u){localStorage.setItem(zu,u)},getRefreshToken(){return localStorage.getItem(Cu)},setRefreshToken(u){localStorage.setItem(Cu,u)},setTokens(u,r){localStorage.setItem(zu,u),localStorage.setItem(Cu,r)},clearTokens(){localStorage.removeItem(zu),localStorage.removeItem(Cu)},parseToken(u){try{const r=u.split(".")[1];return JSON.parse(atob(r))}catch{return null}},hasScope(u,r){const s=We.parseToken(u);return s?s.scope===r:!1},isExpired(u){const r=We.parseToken(u);return!r||typeof r.exp!="number"?!0:Date.now()/1e3>r.exp-30}};function Ts(u){const r=We.parseToken(u);if(!r)return null;const s=r.name??"";return{id:r.sub,username:s,display_name:s,role:r.role}}const xa=Wu((u,r)=>({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1,initializing:!0,initialize:()=>{const s=We.getAccessToken();s&&!We.isExpired(s)?u({accessToken:s,user:Ts(s),requireTotpSetup:We.hasScope(s,"totp_setup"),initializing:!1}):We.getRefreshToken()?r().refresh().catch(()=>{We.clearTokens()}).finally(()=>{u({initializing:!1})}):u({initializing:!1})},login:async s=>{var m;const o=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!o.ok){const h=await o.json().catch(()=>({message:"Login failed"})),x=((m=h.error)==null?void 0:m.message)??h.message??"Login failed";throw new Error(x)}const f=await o.json();if(f.totpSetup){We.setAccessToken(f.accessToken),u({accessToken:f.accessToken,user:null,requireTotpSetup:!0});return}We.setTokens(f.accessToken,f.refreshToken),u({accessToken:f.accessToken,user:Ts(f.accessToken),requireTotpSetup:!1,sessionExpired:!1})},logout:()=>{const s=We.getRefreshToken();s&&fetch("/api/auth/logout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:s})}).catch(()=>{}),We.clearTokens(),u({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1})},refresh:(()=>{let s=null;return async()=>s||(s=(async()=>{const o=We.getRefreshToken();if(!o)throw We.clearTokens(),u({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!0}),new Error("No refresh token");const f=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:o})});if(!f.ok)throw We.clearTokens(),u({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!0}),new Error("Refresh failed");const m=await f.json();We.setTokens(m.accessToken,m.refreshToken),u({accessToken:m.accessToken,user:Ts(m.accessToken)})})().finally(()=>{s=null}),s)})(),setSessionExpired:s=>{u({sessionExpired:s})}})),$0={QUEUED:"QUEUED",ASSIGNED:"ASSIGNED",RUNNING:"RUNNING",SUSPENDED:"SUSPENDED",COMPLETED:"COMPLETED",FAILED:"FAILED",CANCELLED:"CANCELLED"},W0={ONLINE:"online",OFFLINE:"offline",DRAINING:"draining",DECOMMISSIONED:"decommissioned"},Ph={DEVELOPER:"developer",LEAD:"lead",ADMIN:"admin"},F0={MAINTAINER:"maintainer",MEMBER:"member"},I0={CLAUDE:"claude",CURSOR:"cursor",CODEX:"codex",CUSTOM:"custom"},P0={ACTIVE:"active",USED:"used",REVOKED:"revoked",EXPIRED:"expired"},e1={GITLAB:"gitlab",GITHUB:"github",GITEA:"gitea"},t1={ACTIVE:"active",DISABLED:"disabled"},a1={ACTIVE:"active"},l1={IDLE:"IDLE",STARTING:"STARTING",CONNECTED:"CONNECTED",EXPIRED:"EXPIRED",CLOSING:"CLOSING",CLOSED:"CLOSED"};function fb(){return xa(u=>{var r;return((r=u.user)==null?void 0:r.role)===Ph.ADMIN})??!1}const ep="overlord-sidebar-collapsed";function db(){try{return localStorage.getItem(ep)==="true"}catch{return!1}}const mb=Wu((u,r)=>({sidebarCollapsed:db(),toggleSidebar:()=>{const s=!r().sidebarCollapsed;try{localStorage.setItem(ep,String(s))}catch{}u({sidebarCollapsed:s})}}));class hb{constructor(){Xe(this,"ws",null);Xe(this,"reconnectAttempts",0);Xe(this,"maxReconnectAttempts",15);Xe(this,"reconnectTimer",null);Xe(this,"disposed",!1);Xe(this,"authenticated",!1);Xe(this,"eventHandlers",new Set);Xe(this,"statusHandlers",new Set)}onEvent(r){return this.eventHandlers.add(r),()=>this.eventHandlers.delete(r)}onStatus(r){return this.statusHandlers.add(r),()=>this.statusHandlers.delete(r)}get isConnected(){var r;return this.authenticated&&((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN}connect(){var f,m;if(this.disposed||((f=this.ws)==null?void 0:f.readyState)===WebSocket.OPEN||((m=this.ws)==null?void 0:m.readyState)===WebSocket.CONNECTING)return;const r=We.getAccessToken();if(!r||We.isExpired(r))return;const o=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/events`;this.notifyStatus("connecting"),this.authenticated=!1,this.ws=new WebSocket(o),this.ws.onopen=()=>{var x,g;const h=We.getAccessToken();h?(x=this.ws)==null||x.send(JSON.stringify({type:"auth",token:h})):(g=this.ws)==null||g.close()},this.ws.onmessage=h=>{var x;if(typeof h.data=="string")try{const g=JSON.parse(h.data);if(g.type==="auth_ok"){this.authenticated=!0,this.reconnectAttempts=0,this.notifyStatus("connected");return}if(g.type==="auth_error"){(x=this.ws)==null||x.close();return}if(g.type==="event")for(const p of this.eventHandlers)try{p(g)}catch{}}catch{}},this.ws.onclose=()=>{this.authenticated=!1,this.notifyStatus("disconnected"),this.scheduleReconnect()},this.ws.onerror=()=>{var h;(h=this.ws)==null||h.close()}}disconnect(){var r;this.clearReconnectTimer(),this.authenticated=!1,(r=this.ws)==null||r.close(),this.ws=null}dispose(){this.disposed=!0,this.disconnect(),this.eventHandlers.clear(),this.statusHandlers.clear()}reconnect(){this.disconnect(),this.reconnectAttempts=0,this.connect()}scheduleReconnect(){if(this.disposed||this.reconnectAttempts>=this.maxReconnectAttempts)return;const r=Math.min(1e3*2**this.reconnectAttempts,3e4);this.reconnectAttempts++,this.reconnectTimer=setTimeout(()=>{this.disposed||this.connect()},r)}clearReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}notifyStatus(r){for(const s of this.statusHandlers)try{s(r)}catch{}}}const Ou=new hb,pb=Wu(u=>({status:"disconnected",lastEvent:null,eventSeq:0,taskSeq:0,workerSeq:0,init:()=>{const r=Ou.onEvent(o=>{const f=o.event==="task_status_changed"||o.event==="task_created",m=o.event==="worker_status_changed";u(h=>({lastEvent:o,eventSeq:h.eventSeq+1,...f&&{taskSeq:h.taskSeq+1},...m&&{workerSeq:h.workerSeq+1}}))}),s=Ou.onStatus(o=>{u({status:o})});return Ou.connect(),()=>{r(),s(),Ou.disconnect()}}})),tp="overlord-theme";function _b(){try{const u=localStorage.getItem(tp);if(u==="light"||u==="dark"||u==="system")return u}catch{}return"dark"}function bh(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const ap=Wu(u=>{const r=_b(),s=r==="system"?bh():r;return{theme:r,resolved:s,setTheme:o=>{localStorage.setItem(tp,o);const f=o==="system"?bh():o;u({theme:o,resolved:f})},setResolved:o=>{u({resolved:o})}}}),yb={common:{cancel:"cancel",confirm:"confirm",save:"save",delete:"delete",edit:"edit",create:"create",copy:"copy",copied:"copied",close:"close",back:"back",back_to_site:"back to site",go_back:"go_back",go_home:"go_home",dismiss:"dismiss",retry:"retry",loading:"// loading...",processing:"processing...",creating:"creating...",saving:"saving...",updating:"updating...",verifying:"verifying...",signing_in:"signing in...",just_now:"just now",never:"never",previous:"previous",next:"next",error:"error",success:"success",failed:"failed",active:"active",inactive:"inactive",enabled:"enabled",disabled:"disabled",showing_entries:"showing {start}-{end} of {total}",no_results:"no results found",runtime_error:"// runtime_error",an_unexpected_error_occurred:"an unexpected error occurred",reload:"reload",not_found:"404",page_not_found:"// page_not_found",the_page_does_not_exist:"the page you are looking for does not exist or has been moved.",not_found_terminal_error:"error: requested not found - page does not exist",not_set:"not set",view_all:"view_all",discard:"discard",save_changes:"save_changes",add:"add",remove:"remove",search:"search",actions:"actions",name:"name",status:"status",role:"role",description:"description",type:"type",created_at:"created_at",ago:"{time} ago",m_ago:"{n}m ago",h_ago:"{n}h ago",d_ago:"{n}d ago",navigation:"// navigation",docs_section:"// docs",admin_section:"// admin",overlord:"overlord",logout:"logout",logout_title:"// logout",logout_message:"are you sure you want to log out?",log_out:"log out",profile:"profile",search_placeholder:"search",search_input_placeholder:"search tasks, workers, projects...",no_search_results:'// no results for "{query}"',navigate_hint:"navigate",select_hint:"select",close_hint:"close",notifications:"notifications",mark_all_read:"mark all read",no_notifications:"// no notifications",mark_as_read:"mark as read",switch_to_light:"switch to light mode",switch_to_dark:"switch to dark mode",light_mode:"light mode",dark_mode:"dark mode",dismiss_notification:"dismiss",breadcrumb_terminal:"terminal",breadcrumb_terminal_sub:"active sessions",breadcrumb_dashboard:"dashboard",breadcrumb_dashboard_sub:"active overview",breadcrumb_tasks:"tasks",breadcrumb_tasks_sub:"queue management",breadcrumb_workers:"workers",breadcrumb_workers_sub:"fleet status",breadcrumb_projects:"projects",breadcrumb_projects_sub:"repository index",breadcrumb_admin:"admin",breadcrumb_admin_sub:"system control",breadcrumb_profile:"profile",breadcrumb_profile_sub:"user settings",breadcrumb_access_tokens:"access_tokens",breadcrumb_access_tokens_sub:"personal api tokens",breadcrumb_docs:"docs",breadcrumb_docs_sub:"documentation",breadcrumb_docs_cli:"docs",breadcrumb_docs_cli_sub:"cli",breadcrumb_docs_api:"docs",breadcrumb_docs_api_sub:"api",breadcrumb_docs_skill:"docs",breadcrumb_docs_skill_sub:"skill",error_default_title:"something went wrong",error_default_message:"an unexpected error occurred. please try again."},auth:{sign_in:"sign in",username:"username",enter_username:"enter username",password:"password",enter_password:"enter password",ai_powered_development_system:"// ai-powered development system",username_and_password_required:"username and password are required.",login_failed:"login failed",invalid_totp_code:"invalid totp code",two_factor_verification:"// 2fa verification",enter_totp_code:"enter your totp code",please_enter_valid_6_digit_code:"please enter a valid 6-digit code.",session_expired:"session_expired",session_expired_message:"// your session has expired. please log in again.",go_to_login:"go_to_login",totp_setup_title:"2fa_setup",totp_setup_subtitle:"// scan the qr code with your authenticator app",scan_with_authenticator:"scan this qr code with your authenticator app (google authenticator, authy, etc.)",manual_entry_key:"manual_entry_key",enter_verification_code:"enter the 6-digit verification code from your authenticator app",verification_code:"verification code",enter_6_digit_code:"enter 6-digit code",verify_and_enable:"verify_and_enable",totp_setup_complete:"2fa setup complete",totp_setup_complete_login_again:"2fa setup complete! please log in again.",totp_setup_failed:"verification failed. please try again.",totp_setup_footer:"// you must complete this setup before accessing the application",totp_manual_entry:"// or enter this key manually",verify:"verify",initializing:"// initializing...",failed_to_init_totp:"failed to initialize totp setup"},dashboard:{title:"dashboard",subtitle:"// system overview",active_tasks:"active_tasks",queued_tasks:"queued_tasks",online_workers:"online_workers",completed_today:"completed_today",task_success_rate:"> task_success_rate",last_7_days:"last 7 days",recent_tasks:"> recent_tasks",no_tasks_yet:"// no tasks yet",worker_status:"> worker_status",no_workers_registered:"// no workers registered",recent_activity:"> recent_activity",no_recent_activity:"// no recent activity",daily_breakdown_not_available:"// daily breakdown not available",slots:"slots",online:"online",idle:"idle",offline:"offline"},tasks:{title:"tasks",subtitle:"// queue management",create_task:"create_task",new_task:"new_task",task_description:"task_description",describe_task_placeholder:"describe the development task in detail...",project:"project",select_project:"select project...",task_type:"type",branch_slug:"branch name (optional)",branch_slug_placeholder:"auto-generated from description",target_worker:"target_worker (optional)",any_able:"any able",assign_developer:"assign_developer (admin only)",select_developer:"select developer...",search_tasks:"search_tasks...",id:"id",description_col:"description",status_col:"status",project_col:"project",assignee:"assignee",worker:"worker",time:"time",stage:"stage",no_tasks_found:"no_tasks_found",try_adjusting_search:"try adjusting your search query",create_first_task:"create your first task to get started",tab_all:"all",tab_running:"running",tab_queued:"queued",tab_completed:"completed",tab_failed:"failed",tab_cancelled:"cancelled",status_queued:"queued",status_assigned:"assigned",status_running:"running",status_suspended:"suspended",status_completed:"completed",status_failed:"failed",status_cancelled:"cancelled",similar_task_exists:"a similar task already exists.",confirm_create_similar:"are you sure you want to create this task?",view_existing:"view_existing",force_create:"force_create",cancel_task:"cancel",retry_task:"retry",cursor_tunnel:"cursor_tunnel",skip_stage:"skip stage",take_over:"take_over",release_control:"release_control",connected:"connected",disconnected:"disconnected",connecting:"connecting",terminal:"terminal",pipeline_tab:"pipeline",logs:"logs",task_not_found:"// task_not_found",task_does_not_exist:"this task does not exist or has been deleted.",back_to_tasks:"back_to_tasks",task_detail_subtitle:"#{id} {desc}",cancel_task_title:"cancel_task",task_cancelled:"task cancelled.",failed_to_cancel_task:"failed to cancel task.",task_retried:"task has been retried.",failed_to_retry_task:"failed to retry task.",retry_mr_title:"retry_mr",retry_mr_confirm:"retry creating the merge request for task #{id}?",mr_retry_submitted:"mr retry submitted.",failed_to_retry_mr:"failed to retry mr.",activity_log:"> activity_log",pipeline_section:"> pipeline",no_pipeline:"// no pipeline configured",no_activity:"// no activity yet",confirm_stage:"confirm_stage",confirm_stage_message:'confirm execution of stage "{name}"? this will proceed with the pipeline.',stage_confirmed:"stage confirmed.",failed_to_confirm_stage:"failed to confirm stage.",loading_task:"// loading task...",task_suspended_banner:"// task suspended — waiting for user confirmation",pending_confirmation:"> pending_confirmation",pipeline_requires_confirmation:"the pipeline requires confirmation before proceeding.",confirm_and_proceed:"confirm_and_proceed",confirm_failed:"failed to confirm stage",reject:"reject",pty_terminal:"// pty terminal",view_terminal:"switch to terminal tab",restore_auto:"restore auto",requesting_takeover:"requesting...",pipeline_stages:"// pipeline stages",task_info:"> task_info",stage_timeline:"> stage_timeline",workspace_section:"> workspace",no_worker_assigned:"// no worker assigned",no_output:"// no output",pty_output:"> pty_output",stage_progress:"> stage_progress",task_logs:"> task_logs",search_logs:"search logs...",no_log_entries:"// no log entries",prev:"prev",cursor_tunnel_section:"> cursor_tunnel",auto_pipeline:"auto_pipeline",auto_mode:"auto_mode",manual_takeover:"manual_takeover",takeover_denied:"takeover_denied",requesting_takeover_ellipsis:"requesting_takeover...",take_over_label:"take over",release_label:"release",create_task_page_title:"// create_task",create_task_page_subtitle:"// submit a new task for processing",form_project_label:"project",form_description_label:"description",form_description_placeholder:"describe the task for the ai agent...",form_worker_preference:"worker_preference",form_worker_placeholder:"optional: worker id or name (--on)",form_worker_hint:"leave empty for automatic worker selection.",form_agent_type:"agent_type",form_agent_type_placeholder:"default (from project config)",form_select_project:"select a project",form_create_task:"create task",project_and_description_required:"project and description are required.",failed_to_create_task:"failed to create task.",tunnel_idle:"idle",tunnel_starting:"starting...",tunnel_connected:"connected",tunnel_expired:"expired",tunnel_closing:"closing...",tunnel_start:"start",tunnel_open_in_cursor:"open_in_cursor",tunnel_header:"> cursor_tunnel",tunnel_copied:"// copied to clipboard",tunnel_waiting:"// waiting for connection url...",tunnel_start_button:"> start_tunnel",tunnel_starting_button:"// starting...",tunnel_stopping:"// stopping...",tunnel_cancel:"> cancel",tunnel_open_cursor:"> open_in_cursor",tunnel_open_vscode:"> open_in_vscode",tunnel_stop:"> stop_tunnel",tunnel_restart:"> restart_tunnel",tunnel_copy_url:"copy url",tunnel_expires_hm:"expires in {h}h {m}m",tunnel_expires_m:"expires in {m}m",dedup_title:"> similar_task_exists",dedup_description:"// a similar task was found that may already address your request",dedup_create_anyway:"create anyway",stage_choose_option:"// choose an option",stage_your_response:"your_response",stage_type_answer:"type your answer...",stage_submitting:"submitting...",stage_continue:"continue",stage_submit:"submit",cancel_task_message:"are you sure you want to cancel task #{id}? this will terminate the running agent and cannot be undone.",cancel_task_confirm_label:"cancel task",retry_title:"retry_task",retry_confirm_label:"retry",retry_message_with_mr:"task #{id} has an existing mr ({url}). retrying will create a new attempt on the same branch. continue?",retry_message_without_mr:"are you sure you want to retry task #{id}? this will create a new execution attempt."},workers:{title:"workers",subtitle:"// fleet status",fleet:"fleet",setup_guide:"setup_guide",all_statuses:"all",register_worker:"register_worker",no_workers_found:"no_workers_found",no_workers_registered:"no workers have registered yet",try_changing_status_filter:"try changing the status filter",view_setup_guide:"view_setup_guide",online:"online",offline:"offline",draining:"draining",cpu:"cpu",mem:"mem",disk:"disk",tasks_slots:"tasks: {active}/{max} slots",back_to_workers:"back_to_workers",drain:"drain",undrain:"undrain",last_heartbeat:"last_heartbeat: {time}",resource_usage:"> resource_usage",connection_info:"> connection_info",capabilities:"> capabilities",current_tasks:"> current_tasks",no_capabilities:"// no capabilities reported",no_running_tasks:"// no running tasks",host:"host",port:"port",os:"os",cpu_model:"cpu_model",cpu_cores:"cpu_cores",memory:"memory",total_slots:"total_slots",confirm_drain:"drain_worker",confirm_drain_message:'drain worker "{name}"? it will finish current tasks but accept no new ones.',worker_drained:"worker drain initiated.",worker_undrained:"worker undrain initiated.",failed_to_update_worker:"failed to update worker status.",worker_setup_title:"worker_setup_guide",worker_setup_subtitle:"// register a new worker with overlord",step_1_title:"01. generate a registration token",step_1_desc:"generate a one-time registration token from the admin panel.",step_2_title:"02. install the worker cli",step_2_desc:"install the overlord worker cli on the target worker.",step_3_title:"03. register the worker",step_3_desc:"run the register command with your token and server url.",step_4_title:"04. start the worker",step_4_desc:"start the worker daemon. it will connect to overlord and begin accepting tasks.",generate_token:"generate_token",worker_token_modal_title:"worker_registration_token",worker_token_modal_message:"// copy this token now. it will not be shown again.",loading_worker:"// loading worker...",worker_not_found:"// worker not found",draining_warning:"// this worker is draining — no new tasks will be assigned",draining_active_tasks:"active tasks will continue to run until completion",active_tasks:"> active_tasks",no_active_tasks:"// no active tasks on this worker",worker_info:"> worker_info",unknown:"unknown",n_a:"n/a",id:"id",description:"description",stage:"stage",no_capabilities_short:"// no capabilities",slots:"slots",status_label:"status",undrain_worker_title:"> undrain_worker",drain_worker_title:"> drain_worker",undrain_confirm:"are you sure you want to undrain {name}? the worker will start accepting new tasks again.",drain_confirm:"are you sure you want to drain {name}? running tasks will complete, but no new tasks will be assigned until the worker is undrained.",decommission:"decommission",decommission_title:"> decommission_worker",decommission_confirm:'permanently decommission "{name}"? active tasks will be failed or re-queued, and the worker will be disconnected. this cannot be undone.',decommissioned:"decommissioned",worker_id:"worker_id",setup_header_desc:"// follow these steps to add a new worker to your overlord cluster.",prerequisites:"// prerequisites",prereq_machine:"linux or macos machine with at least 2 cpu cores and 4gb ram",prereq_node:"node.js 18+ and pnpm installed",prereq_git:"git installed (2.25+)",prereq_network:"network access to the overlord server",prereq_token:"admin-generated worker registration token",step_generate_token:"generate_worker_token",step_generate_token_desc:"// create a one-time registration token from the admin panel. each token can register exactly one worker.",go_to_token_management:"go_to_token_management",step_install_worker:"install_worker_package",step_install_worker_desc:"// install the overlord worker package globally via npm.",step_configure_env:"configure_environment",step_configure_env_desc:"// create a .env file in ~/.overlord-worker/ or set environment variables.",env_host:"overlord server address (required)",env_worker_token:"one-time registration token (required for first run)",env_worker_name:"display name (defaults to hostname)",env_workspace_root:"task workspace directory (defaults to ~/.overlord-worker/workspaces)",env_max_slots:"max concurrent tasks (defaults to 2)",step_start_worker:"start_worker",step_start_worker_desc:"// start the worker process. it will register with the server and begin accepting tasks.",or_run_as_service:"// or run as a system service for auto-restart:",setup_wizard_option:"// option a: interactive setup wizard (recommended)",manual_config_option:"// option b: manual configuration",start_note_setup_wizard:"// if you used the setup wizard, the worker may already be running.",step_verify_connection:"verify_connection",step_verify_connection_desc:'// once the worker connects, it will appear in the workers list with a "healthy" status.',verify_how_to:"// how to verify:",verify_check_workers:"check the workers page for your new worker",verify_status:'status should show "healthy" within 30 seconds',verify_capabilities:"worker capabilities are auto-detected on first heartbeat",last_heartbeat_label:"last_heartbeat",worker_version:"worker_version",reg_title:"// worker_registration",reg_subtitle:"> register a new worker node",reg_step_generate_token:"generate_token",reg_step_install_worker:"install_worker",reg_step_waiting_activation:"waiting_activation",reg_step_activated:"activated",reg_click_to_generate:"// click to generate a one-time registration token",reg_token_generated:"// token generated successfully",reg_install_command:"// install cli & worker:",reg_run_setup:"// run setup on worker:",reg_running_installation:"// running installation on target worker",reg_installed_wait:"i've installed → wait for activation",reg_listening_for_worker:"listening for worker connection...",reg_worker_connected:"// worker connected",reg_waiting_for_worker:"// waiting for worker to connect...",reg_worker_activated:"worker {name} activated!",reg_worker_registered:"// worker successfully registered",reg_done:"done",reg_completed:"// completed"},projects:{title:"projects",subtitle:"// repository index",create_project:"create_project",no_projects_yet:"no_projects_yet",create_first_project:"create your first project to get started",key:"key",name:"name",repository:"repository",agent:"agent",project_info:"> project_info",repo_url:"repo_url",default_branch:"default_branch",git_platform:"git_platform",agent_type:"agent_type",max_turns:"max_turns",allowed_tools:"allowed_tools",default_project:"default_project",tasks_count:"tasks",last_activity:"last_activity",members:"> members",developer:"developer",role:"role",added_at:"added_at",add_member:"add_member",remove_member:"remove_member",remove_member_confirm:"remove {name} from this project?",member_added:"member added.",member_removed:"member removed.",failed_to_add_member:"failed to add member.",member_already_exists:"this developer is already a member of this project.",failed_to_remove_member:"failed to remove member.",pipeline:"> pipeline",add_stage:"+ add_stage",recent_tasks:"> recent_tasks",no_recent_tasks:"// no recent tasks",edit_project:"edit project",delete_project:"delete_project",delete_project_confirm:'delete project "{name}"? this cannot be undone.',project_deleted:"project deleted.",failed_to_delete_project:"failed to delete project.",project_name:"project_name",project_name_placeholder:"my awesome project",project_key:"project_key",project_key_placeholder:"my-project",project_key_hint:"// unique identifier (lowercase, alphanumeric, hyphens)",ssh_url:"ssh_url",ssh_url_placeholder:"git@github.com:org/repo.git",ssh_url_hint:"// optional — workers prefer ssh for git operations",repo_url_placeholder:"https://github.com/org/repo.git",main:"main",github:"github",gitlab:"gitlab",gitea:"gitea",claude:"claude",cursor:"cursor",codex:"codex",custom:"custom",tools_placeholder:"tool1, tool2, ...",add_project_desc:"// add a new project to overlord",project_created:"project created.",failed_to_create_project:"failed to create project.",update_project_desc:"// update project configuration",save_changes:"save_changes",basic_info:"> basic_info",agent_config:"> agent_config",security:"> security",git_token:"> git_token",git_token_label:"git_token",git_token_hint:"// personal access token for git operations (push, clone, etc.)",git_token_set:"set_token",git_token_clear:"clear_token",git_token_saved:"git token saved.",git_token_cleared:"git token cleared.",git_token_failed:"failed to update git token.",pipeline_section:"> pipeline",edit_pipeline:"> edit_pipeline",pty_output_filter:"pty_output_filter",workspace_root:"workspace_root",agent_command:"agent_command",member_role:"member",maintainer_role:"maintainer",select_developer:"select developer...",select_role:"select role...",adding:"adding...",project_not_found:"// project not found",back_to_projects:"back to projects",no_members_yet:"// no members yet",no_tasks_for_project:"// no tasks for this project yet",no_pipeline_configured:"// no pipeline configured",confirm_label:"confirm",id:"id",description:"description",status:"status",created:"created",project_saved:"project saved",failed_to_save_project:"failed to save project",invalid_pipeline_json:"invalid pipeline json",setup_commands:"setup_commands",post_command:"post_command",environment:"> environment",add_member_title:"// add_member",edit_project_title:"edit project"},pipeline:{title:"pipeline_editor",subtitle:"-- {key}",save:"save",cancel:"cancel",json_toggle:"json",add_stage:"add_stage",stage_properties:"> stage_properties",stage_name:"stage_name",timeout:"timeout",confirm_required:"confirm_required",on_failure:"on_failure",goto:"goto",max_loops:"max_loops",stop:"stop",no_stages:"// no stages defined",select_stage:"// select a stage to edit properties",saved:"pipeline saved",failed_to_save:"failed to save pipeline",failed_to_load:"failed to load pipeline.",loading_pipeline:"// loading pipeline...",unnamed:"unnamed",editing:"// editing: {name}",name:"name",on_failure_section:"// on_failure",goto_stage:"goto_stage",up:"up",down:"down",failed_to_load_project:"failed to load project",delete_stage:"delete stage"},profile:{title:"profile",subtitle:"// user settings",profile_info:"> profile_info",username:"username",git_name:"git_name",git_email:"git_email",status:"status",created_at:"created_at",edit_git_info:"edit_git_info",change_password:"> change_password",current_password:"current_password",new_password:"new_password",confirm_password:"confirm_password",current_password_required:"current password is required.",new_password_required:"new password is required.",passwords_do_not_match:"new passwords do not match.",password_changed:"password changed successfully.",failed_to_change_password:"failed to change password.",update_password:"update_password",two_factor_auth:"> two-factor_authentication",two_fa_enabled:"2fa is enabled",two_fa_not_setup:"2fa is not set up",regenerate_2fa_warning:`// regenerating 2fa will invalidate your current authenticator app setup.
222
222
  you will need to set up 2fa again on your next login.`,regenerate_2fa:"regenerate_2fa",regenerating:"regenerating...",access_tokens:"access_tokens",access_tokens_desc:"// manage personal access tokens for cli & api",git_info_updated:"git info updated.",failed_to_update_git_info:"failed to update git info.",two_fa_reset:"2fa has been reset. please set up your authenticator again on next login.",failed_to_regenerate_2fa:"failed to regenerate 2fa.",failed_to_load_profile:"failed to load profile.",unable_to_load_profile:"// unable to load profile information",personal_settings:"// personal settings",password_length_10_20:"password must be between 10 and 20 characters.",password_hint_10_20:"// 10-20 characters, letters, numbers, and special characters",current_totp_code:"current_totp_code",totp_code_placeholder:"6-digit code",totp_code_required:"please enter your current 6-digit totp code to regenerate 2fa.",two_fa_regenerated:"2fa regenerated. you will need to set it up again on next login.",totp_code_invalid:"invalid totp code or failed to regenerate 2fa.",platform_accounts:"platform accounts",not_linked:"not linked",bind_hint:'send "bind" to the bot in lark or slack to link your account.'},access_tokens:{title:"access_tokens",subtitle:"// personal access tokens",create_token:"create_token",no_tokens:"no_personal_access_tokens",create_token_desc:"create a token to authenticate with the cli or api",copy_token_warning:"// copy your token now. you will not be able to see it again.",token_name:"token_name",token_name_placeholder:"my-cli-token",expires_in:"expires_in",days_30:"30 days",days_90:"90 days",days_365:"365 days",no_expiry:"no expiry",token_created:"token created.",failed_to_create_token:"failed to create token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",failed_to_load_tokens:"failed to load tokens.",revoke:"revoke",revoke_token:"revoke_token",last_used:"last_used",expires_at:"expires_at",token:"token",created:"created",expires:"expires",revoke_confirm:'are you sure you want to revoke "{name}"? this action cannot be undone.',create_personal_access_token:"// create personal access token",tokens_authenticate_desc:"// tokens authenticate the ov cli and api requests",revoke_token_title:"// revoke token",token_label_required:"token label is required."},admin:{title:"admin",subtitle:"// system control",tab_developers:"developers",tab_bots:"bots",tab_tokens:"worker_tokens",tab_audit_logs:"audit_logs",tab_settings:"settings",developers_title:"admin / developers",developers_subtitle:"// developer account management",create_developer:"create_developer",search_developers:"search developers...",no_matching_developers:"no_matching_developers",no_developers_found:"no_developers_found",try_adjusting_search:"try adjusting your search query",username:"username",display_name:"display_name",role:"role",status:"status",two_fa_status:"2fa_status",dev_name:"dev_name",totp:"totp",reset_2fa:"reset 2fa",deactivate:"deactivate",activate:"activate",create_developer_title:"create_developer",create_developer_desc:"// add a new developer account",edit_developer_title:"edit_developer",edit_developer_desc:"// update developer account settings",developer_created:"developer created.",developer_updated:"developer updated.",failed_to_create_developer:"failed to create developer",failed_to_update_developer:"failed to update developer",confirm_reset_2fa:'reset 2fa for "{name}"? they will need to set up 2fa again on next login.',two_fa_reset:"2fa has been reset.",failed_to_reset_2fa:"failed to reset 2fa",confirm_deactivate:'deactivate "{name}"? they will not be able to log in.',confirm_activate:'activate "{name}"?',developer_deactivated:"developer deactivated.",developer_activated:"developer activated.",failed_to_update_status:"failed to update developer status.",create_first_developer:"create your first developer to get started",all_fields_required:"all fields are required.",password_length_error:"password must be between 10 and 20 characters.",password_complexity_error:"password must contain at least one letter, one digit, and one special character.",password_hint:"// must be 10-20 characters with letters, digits, and special characters.",display_name_required:"display name is required.",demote_self_warning:"you are about to demote yourself from admin. the system must have at least one admin. please verify another admin exists before proceeding.",demote_self_inline_warning:"// warning: you are demoting yourself from admin. ensure at least one other admin exists.",lark_uid:"lark open_id",slack_uid:"slack user_id",platform_accounts:"platform accounts",reset_2fa_confirm_message:"are you sure you want to reset two-factor authentication for",reset_2fa_audit_note:"// the user will be required to set up 2fa again on their next login. this action is recorded in the audit log.",resetting:"resetting...",bots_title:"admin / bots",bots_subtitle:"// bot instance management",create_bot:"create_bot",no_bots_configured:"no_bots_configured",add_bot_desc:"add a bot instance to enable chat integrations with lark or slack",bot_name:"bot_name",platform:"platform",app_id:"app_id",lark:"lark",slack:"slack",delete_bot:"delete_bot",delete_bot_confirm:'delete bot "{name}"? this cannot be undone.',bot_deleted:"bot deleted.",failed_to_delete_bot:"failed to delete bot.",bot_created:"bot created.",failed_to_create_bot:"failed to create bot",chat_bindings:"chat_bindings",chat_bindings_subtitle:"// all integrations",no_chat_bindings:"// no chat bindings configured",chat_id:"chat_id",chat_name:"chat_name",project:"project",bot:"bot",edit_bot:"edit_bot",name_and_app_id_required:"name and app id are required.",app_secret_required:"app secret is required for new bots.",app_secret:"app_secret",app_secret_keep_current:"app_secret (leave empty to keep current)",webhook_url_optional:"webhook_url (optional)",lark_feishu:"lark_(feishu)",failed_to_update_bot:"failed to update bot",no_chat_bindings_for_bot:"// no chat bindings configured for this bot.",add_chat_binding_desc:"// add chat binding",add_binding:"add_binding",failed_to_add_binding:"failed to add binding",tokens_title:"admin / worker_tokens",tokens_subtitle:"// worker registration token management",generate_token:"generate_token",no_worker_tokens:"no_worker_tokens",generate_token_desc:"generate a token to register a new worker",label:"label",purpose:"purpose",expires_at:"expires_at",token_generated:"token generated.",failed_to_generate_token:"failed to generate token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",revoke_token:"revoke_token",revoke_token_confirm:'revoke token "{label}"? this cannot be undone.',show_revoked:"show revoked",hide_revoked:"hide revoked",audit_title:"admin / audit_logs",audit_subtitle:"// system activity audit trail",all_actions:"all_actions",filter_by_user:"filter by user...",no_audit_entries:"no_audit_log_entries",audit_logs_appear:"audit logs will appear here as actions are performed in the system",timestamp:"timestamp",user_id:"user_id",action:"action",resource:"resource",detail:"detail",ip:"ip",action_login:"login",action_logout:"logout",action_create:"create",action_update:"update",action_delete:"delete",action_revoke:"revoke",action_reset_2fa:"reset_2fa",action_generate_token:"generate_token",showing_entries:"showing {count} entries",revoke:"revoke",generate_worker_token_title:"> generate_worker_token",create_one_time_token:"// create a one-time registration token",label_identifies_worker:"// identifies which worker this token is for",generating:"generating...",generate:"generate",worker_registered:"> worker_registered",worker_token_generated:"> worker_token_generated",run_command_desc:"// run this command on the target machine to register the worker",token_shown_once:"// this token will only be shown once. copy the command before closing.",setup_command:"setup command",waiting_for_worker:"// waiting for worker to register...",token_not_yet_used:"// token not yet used. the worker can still register later using this token.",worker_registered_success:"// worker registered successfully",worker:"worker",copied_wait_for_worker:"copied — wait_for_worker",close_worker_can_register:"close // worker can still register",view_worker:"view_worker",label_required:"label is required.",settings_title:"admin / settings",settings_subtitle:"// global system configuration",save_settings:"save_settings",settings_saved:"settings saved",failed_to_save_settings:"failed to save settings",loading_settings:"// loading settings...",scheduling:"> scheduling",heartbeat:"> heartbeat",output:"> output",defaults:"> defaults",max_concurrent_tasks:"max_concurrent_tasks_per_worker",max_concurrent_tasks_desc:"// maximum number of tasks a single worker can run simultaneously",task_timeout:"task_timeout_minutes",task_timeout_desc:"// auto-cancel tasks after this many minutes of inactivity",heartbeat_interval:"heartbeat_interval_seconds",heartbeat_interval_desc:"// expected interval between worker heartbeats",worker_offline_threshold:"worker_offline_threshold_seconds",worker_offline_threshold_desc:"// mark worker offline after missing heartbeats for this duration",default_agent_type:"default_agent_type",default_agent_type_desc:"// default agent type for new projects",server_url:"server_url",server_url_desc:"// public server url used in worker setup instructions",chat_binding_title:"// chat_bindings — {name}",chat_binding_no_bindings:"// no chat bindings configured for this bot.",chat_binding_add:"// add chat binding",chat_binding_id_placeholder:"platform chat/group id",chat_binding_name_placeholder:"display name for the chat",chat_binding_select_project:"select project...",chat_binding_all_fields_required:"all fields are required.",chat_binding_adding:"adding...",pat_label_required:"label is required.",pat_failed_to_generate:"failed to generate token",pat_label_placeholder:"e.g. build-server-03"},landing:{overlord:"overlord",version_badge:"self-hosted · bring your own subscriptions and machines",hero_line1:"turn your subscriptions / machines into",hero_turn_your:"turn your",hero_into:"into",hero_word_subscriptions:"subscriptions",hero_word_machines:"machines",hero_highlight:"a dev team that never sleeps.",hero_desc:"dispatch coding tasks across your machine fleet. ai agents execute in parallel — you watch, jump in, or come back to finished pull requests.",get_started:"get started",read_docs:"read docs",how_it_works:"how it works",three_steps:"from task description to merged pull request.",step_n:"step {n}",step_define:"connect your fleet",step_define_desc:"register your machines as workers. each one runs ai agents — claude code, cursor, codex — using your existing subscriptions.",step_dispatch:"send a task",step_dispatch_desc:"describe what you want from slack, lark, cli, or the web dashboard. overlord finds the best available machine and starts the ai agent automatically.",step_monitor:"watch or walk away",step_monitor_desc:"live terminal streams agent output to your browser. jump in to guide the agent, or come back later to a finished pull request.",everything_you_need:"everything you need",complete_platform:"self-hosted. your machines, your ai subscriptions, your control.",feature_terminal:"real-time pty terminal",feature_terminal_desc:"stream live agent output directly in the browser. full xterm.js integration with scrollback and search.",feature_multi_agent:"multi-agent support",feature_multi_agent_desc:"first-class support for claude code, cursor, and codex. route tasks to the right agent automatically.",feature_routing:"smart task routing",feature_routing_desc:"intelligent scheduling across your machine fleet. tasks land on the best available worker every time.",feature_pipeline:"pipeline automation",feature_pipeline_desc:"chain tasks into multi-stage pipelines. build, test, and deploy in one continuous flow.",feature_collab:"team collaboration",feature_collab_desc:"project-level permissions, audit logs, and shared dashboards. keep your whole team in sync.",feature_pool:"pool subscriptions, maximize value",feature_pool_desc:"every team member's ai subscription goes into a shared pool — everyone can use any seat. no idle subscriptions, no duplicate costs. the bigger your team, the more you save.",feature_trigger:"trigger from everywhere",feature_trigger_desc:"slack message, lark bot, cli command, or web dashboard — create tasks from whatever tool you already use. phone, laptop, tablet, it all works.",feature_remote:"code from anywhere",feature_remote_desc:"on the bus, at a café, or away from your desk — dispatch tasks from your phone or laptop and your fleet keeps coding. come back to finished pull requests.",feature_security:"secure by design",feature_security_desc:"totp two-factor auth, scoped api tokens, and full audit trail. enterprise-ready from day one.",install_title:"get up and running",install_desc:"three components, three commands. deploy in minutes.",install_command:"npm install -g @overlordai/developer-cli",setup_step_1_title:"deploy the server",setup_step_1_desc:"install overlord and start the central server. it manages all tasks, authentication, and real-time communication.",setup_step_1_command:`npm install -g @overlordai/cli @overlordai/server
223
223
  overlord install`,setup_step_1_link:"installation guide",setup_step_2_title:"register workers",setup_step_2_desc:"set up worker machines that execute tasks. each worker runs ai agents in isolated workspaces with full git integration.",setup_step_2_command:`npm install -g @overlordai/cli @overlordai/worker
224
224
  overlord setup worker`,setup_step_2_link:"worker setup guide",setup_step_3_title:"connect as developer",setup_step_3_desc:"install the developer cli to create tasks, attach to running sessions, and monitor progress from your terminal.",setup_step_3_command:`npm install -g @overlordai/developer-cli
225
- ov login https://overlord.yourdomain.com`,setup_step_3_link:"development workflow",go_to_app:"open app",documentation:"documentation",api:"api",copy_install_command:"copy install command"},docs:{cli_reference:"cli",cli_subtitle:"// command-line tools",api_reference:"api",api_subtitle:"// rest api endpoints",quick_start:"// quick start",developer_cli:"developer cli (ov)",admin_cli:"admin cli (overlord)",authentication:"// authentication",usage:"usage",flags:"flags",example:"example",request_body:"request body",response:"response",quick_start_with_token:"// quick start with your token",replace_token_hint:"// replace <your-token> with the actual token value from your access tokens page",cli_tools_desc:"// overlord provides two cli tools: {ov} (developer cli) and {overlord} (admin/ops cli)",api_base_url_desc:"// base url: {url} · all endpoints return json · auth via bearer token in authorization header"},onboarding:{getting_started:"// getting started",completed_count:"{done}/{total} completed",dismiss:"dismiss",all_done:"all set! you're ready to go.",admin_create_project_title:"create your first project",admin_create_project_desc:"set up a project with a git repo and pipeline",admin_register_worker_title:"register a worker",admin_register_worker_desc:"generate a token and set up a worker to run tasks",admin_create_developer_title:"create a developer account",admin_create_developer_desc:"add team members who can create and monitor tasks",admin_configure_bot_title:"configure a chat bot",admin_configure_bot_desc:"register a Lark or Slack bot to enable task management via chat",admin_first_task_title:"create your first task",admin_first_task_desc:"verify the full pipeline works end-to-end",lead_view_projects_title:"view your projects",lead_view_projects_desc:"check the projects assigned to you",lead_configure_pipeline_title:"configure a pipeline",lead_configure_pipeline_desc:"set up stages for your project workflow",lead_add_member_title:"add a team member",lead_add_member_desc:"invite developers to your project",lead_first_task_title:"create your first task",lead_first_task_desc:"submit a task and watch it execute",dev_install_cli_title:"install the ov cli",dev_install_cli_desc:"npm install -g @overlordai/developer-cli",dev_setup_cli_title:"run ov setup",dev_setup_cli_desc:"connect to the server and authenticate",dev_link_chat_title:"link your chat account",dev_link_chat_desc:'send "bind" to the bot in Lark or Slack to connect your account',dev_view_projects_title:"explore projects",dev_view_projects_desc:"browse available projects and their pipelines",dev_first_task_title:"create your first task",dev_first_task_desc:"submit a task via web or cli",go_to_projects:"go to projects",go_to_workers:"go to workers",go_to_tasks:"go to tasks",go_to_bots:"manage bots",manage_developers:"manage developers",cli:"cli",setup_guide:"setup guide"},bind:{title:"// link platform account",linking:"linking your account...",success:"account linked successfully!",success_detail:"your {platform} account has been connected. you can now use bot commands.",error:"failed to link account",invalid_token:'this link is invalid or has expired. send "bind" to the bot again to get a new link.',back_to_home:"go to dashboard",no_token:"no bind token provided."},terminal_home:{title:"terminal",select_project:"project...",all_projects:"all projects",task_description_placeholder:"describe the task...",new_task:"new task",no_active_tasks:"no active tasks",create_task_hint:"create a task using the bar above to get started"}};function gb(u,r){const s=r.split(".");let o=u;for(const f of s){if(o==null||typeof o!="object")return r;o=o[f]}return typeof o=="string"?o:r}function vb(u,r){return r?u.replace(/\{(\w+)\}/g,(s,o)=>r[o]!=null?String(r[o]):`{${o}}`):u}function Lu(u,r){return vb(gb(yb,u),r)}function ta(){return{t:v.useCallback((r,s)=>Lu(r,s),[])}}function lp(){const{theme:u,setTheme:r}=ap(),{t:s}=ta(),o=u==="dark"||u==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function f(){r(o?"light":"dark")}return _.jsx("button",{onClick:f,className:"flex items-center gap-1.5 rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]","aria-label":s(o?"common.switch_to_light":"common.switch_to_dark"),title:s(o?"common.light_mode":"common.dark_mode"),children:o?_.jsx(ib,{size:16}):_.jsx(eb,{size:16})})}class Ns extends Error{constructor(s,o,f){const m=s.status||s.status===0?s.status:"",h=s.statusText??"",x=`${m} ${h}`.trim(),g=x?`status code ${x}`:"an unknown error";super(`Request failed with ${g}: ${o.method} ${o.url}`);Xe(this,"response");Xe(this,"request");Xe(this,"options");this.name="HTTPError",this.response=s,this.request=o,this.options=f}}class np extends Error{constructor(s){let o="Non-error value was thrown";try{typeof s=="string"?o=s:s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&(o=s.message)}catch{}super(o);Xe(this,"name","NonError");Xe(this,"value");this.value=s}}class Rs extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new np(s.cause):void 0;super(s!=null&&s.code?`Forced retry: ${s.code}`:"Forced retry",o?{cause:o}:void 0);Xe(this,"name","ForceRetryError");Xe(this,"customDelay");Xe(this,"code");Xe(this,"customRequest");this.customDelay=s==null?void 0:s.delay,this.code=s==null?void 0:s.code,this.customRequest=s==null?void 0:s.request}}const xh=(()=>{let u=!1,r=!1;const s=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(s&&o)try{r=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return u&&!r})(),bb=typeof globalThis.AbortController=="function",ip=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",xb=typeof globalThis.ReadableStream=="function",Sb=typeof globalThis.FormData=="function",up=["get","post","put","patch","head","delete"],Eb={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},js=2147483647,kb=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,rp=Symbol("stop");class op{constructor(r){Xe(this,"options");this.options=r}}const wb=u=>new op(u),Tb={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Rb={next:!0},jb={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Ab=u=>{if(!u)return 0;if(u instanceof FormData){let r=0;for(const[s,o]of u)r+=kb,r+=new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length,r+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return r}if(u instanceof Blob)return u.size;if(u instanceof ArrayBuffer)return u.byteLength;if(typeof u=="string")return new TextEncoder().encode(u).length;if(u instanceof URLSearchParams)return new TextEncoder().encode(u.toString()).length;if("byteLength"in u)return u.byteLength;if(typeof u=="object"&&u!==null)try{const r=JSON.stringify(u);return new TextEncoder().encode(r).length}catch{return 0}return 0},sp=(u,r,s)=>{let o,f=0;return u.pipeThrough(new TransformStream({transform(m,h){if(h.enqueue(m),o){f+=o.byteLength;let x=r===0?0:f/r;x>=1&&(x=1-Number.EPSILON),s==null||s({percent:x,totalBytes:Math.max(r,f),transferredBytes:f},o)}o=m},flush(){o&&(f+=o.byteLength,s==null||s({percent:1,totalBytes:Math.max(r,f),transferredBytes:f},o))}}))},zb=(u,r)=>{if(!u.body)return u;if(u.status===204)return new Response(null,{status:u.status,statusText:u.statusText,headers:u.headers});const s=Math.max(0,Number(u.headers.get("content-length"))||0);return new Response(sp(u.body,s,r),{status:u.status,statusText:u.statusText,headers:u.headers})},Cb=(u,r,s)=>{if(!u.body)return u;const o=Ab(s??u.body);return new Request(u,{duplex:"half",body:sp(u.body,o,r)})},yl=u=>u!==null&&typeof u=="object",Nu=(...u)=>{for(const r of u)if((!yl(r)||Array.isArray(r))&&r!==void 0)throw new TypeError("The `options` argument must be an object");return $s({},...u)},cp=(u={},r={})=>{const s=new globalThis.Headers(u),o=r instanceof globalThis.Headers,f=new globalThis.Headers(r);for(const[m,h]of f.entries())o&&h==="undefined"||h===void 0?s.delete(m):s.set(m,h);return s};function Du(u,r,s){return Object.hasOwn(r,s)&&r[s]===void 0?[]:$s(u[s]??[],r[s]??[])}const fp=(u={},r={})=>({beforeRequest:Du(u,r,"beforeRequest"),beforeRetry:Du(u,r,"beforeRetry"),afterResponse:Du(u,r,"afterResponse"),beforeError:Du(u,r,"beforeError")}),Ob=(u,r)=>{const s=new URLSearchParams;for(const o of[u,r])if(o!==void 0)if(o instanceof URLSearchParams)for(const[f,m]of o.entries())s.append(f,m);else if(Array.isArray(o))for(const f of o){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");s.append(String(f[0]),String(f[1]))}else if(yl(o))for(const[f,m]of Object.entries(o))m!==void 0&&s.append(f,String(m));else{const f=new URLSearchParams(o);for(const[m,h]of f.entries())s.append(m,h)}return s},$s=(...u)=>{let r={},s={},o={},f;const m=[];for(const h of u)if(Array.isArray(h))Array.isArray(r)||(r=[]),r=[...r,...h];else if(yl(h)){for(let[x,g]of Object.entries(h)){if(x==="signal"&&g instanceof globalThis.AbortSignal){m.push(g);continue}if(x==="context"){if(g!=null&&(!yl(g)||Array.isArray(g)))throw new TypeError("The `context` option must be an object");r={...r,context:g==null?{}:{...r.context,...g}};continue}if(x==="searchParams"){g==null?f=void 0:f=f===void 0?g:Ob(f,g);continue}yl(g)&&x in r&&(g=$s(r[x],g)),r={...r,[x]:g}}yl(h.hooks)&&(o=fp(o,h.hooks),r.hooks=o),yl(h.headers)&&(s=cp(s,h.headers),r.headers=s)}return f!==void 0&&(r.searchParams=f),m.length>0&&(m.length===1?r.signal=m[0]:ip?r.signal=AbortSignal.any(m):r.signal=m.at(-1)),r},Nb=u=>up.includes(u)?u.toUpperCase():u,Db=["get","put","head","delete","options","trace"],Mb=[408,413,429,500,502,503,504],Ub=[413,429,503],Sh={limit:2,methods:Db,statusCodes:Mb,afterStatusCodes:Ub,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:u=>.3*2**(u-1)*1e3,jitter:void 0,retryOnTimeout:!1},qb=(u={})=>{if(typeof u=="number")return{...Sh,limit:u};if(u.methods&&!Array.isArray(u.methods))throw new Error("retry.methods must be an array");if(u.methods&&(u.methods=u.methods.map(s=>s.toLowerCase())),u.statusCodes&&!Array.isArray(u.statusCodes))throw new Error("retry.statusCodes must be an array");const r=Object.fromEntries(Object.entries(u).filter(([,s])=>s!==void 0));return{...Sh,...r}};class Ds extends Error{constructor(s){super(`Request timed out: ${s.method} ${s.url}`);Xe(this,"request");this.name="TimeoutError",this.request=s}}async function Hb(u,r,s,o){return new Promise((f,m)=>{const h=setTimeout(()=>{s&&s.abort(),m(new Ds(u))},o.timeout);o.fetch(u,r).then(f).catch(m).then(()=>{clearTimeout(h)})})}async function Lb(u,{signal:r}){return new Promise((s,o)=>{r&&(r.throwIfAborted(),r.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(m),o(r.reason)}const m=setTimeout(()=>{r==null||r.removeEventListener("abort",f),s()},u)})}const Bb=(u,r)=>{const s={};for(const o in r)Object.hasOwn(r,o)&&!(o in jb)&&!(o in Tb)&&(!(o in u)||o in Rb)&&(s[o]=r[o]);return s},Yb=u=>u===void 0?!1:Array.isArray(u)?u.length>0:u instanceof URLSearchParams?u.size>0:typeof u=="object"?Object.keys(u).length>0:typeof u=="string"?u.trim().length>0:!!u;function Gb(u){return u instanceof Ns||(u==null?void 0:u.name)===Ns.name}function Xb(u){return u instanceof Ds||(u==null?void 0:u.name)===Ds.name}var Zu,dp,Kt,Bt,ut,V,$a,Pt,gl,ie,Bu,mp,Ms,Yu,Ja,Us,hp,ii,Gu,qs;const ui=class ui{constructor(r,s={}){It(this,ie);Xe(this,"request");It(this,Kt);It(this,Bt,0);It(this,ut);It(this,V);It(this,$a);It(this,Pt);It(this,gl);var f,m,h;if(Zt(this,ut,r),Zt(this,V,{...s,headers:cp(U(this,ut).headers,s.headers),hooks:fp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Nb(s.method??U(this,ut).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:qb(s.retry),throwHttpErrors:s.throwHttpErrors??!0,timeout:s.timeout??1e4,fetch:s.fetch??globalThis.fetch.bind(globalThis),context:s.context??{}}),typeof U(this,ut)!="string"&&!(U(this,ut)instanceof URL||U(this,ut)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(U(this,V).prefixUrl&&typeof U(this,ut)=="string"){if(U(this,ut).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");U(this,V).prefixUrl.endsWith("/")||(U(this,V).prefixUrl+="/"),Zt(this,ut,U(this,V).prefixUrl+U(this,ut))}bb&&ip&&(Zt(this,Pt,U(this,V).signal??U(this,ut).signal),Zt(this,Kt,new globalThis.AbortController),U(this,V).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Kt).signal]):U(this,Kt).signal),xh&&(U(this,V).duplex="half"),U(this,V).json!==void 0&&(U(this,V).body=((m=(f=U(this,V)).stringifyJson)==null?void 0:m.call(f,U(this,V).json))??JSON.stringify(U(this,V).json),U(this,V).headers.set("content-type",U(this,V).headers.get("content-type")??"application/json"));const o=s.headers&&new globalThis.Headers(s.headers).has("content-type");if(U(this,ut)instanceof globalThis.Request&&(Sb&&U(this,V).body instanceof globalThis.FormData||U(this,V).body instanceof URLSearchParams)&&!o&&U(this,V).headers.delete("content-type"),this.request=new globalThis.Request(U(this,ut),U(this,V)),Yb(U(this,V).searchParams)){const g="?"+(typeof U(this,V).searchParams=="string"?U(this,V).searchParams.replace(/^\?/,""):new URLSearchParams(be(h=ui,Zu,dp).call(h,U(this,V).searchParams)).toString()),p=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,g);this.request=new globalThis.Request(p,U(this,V))}if(U(this,V).onUploadProgress){if(typeof U(this,V).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!xh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=be(this,ie,qs).call(this,this.request,U(this,V).body??void 0)}}static create(r,s){var h,x,g;const o=new ui(r,s),f=async()=>{var j,k,M,X,B,q,H,L,I,J,he,pe;if(typeof U(o,V).timeout=="number"&&U(o,V).timeout>js)throw new RangeError(`The \`timeout\` option cannot be greater than ${js}`);await Promise.resolve();let p=await be(j=o,ie,hp).call(j);for(const de of U(o,V).hooks.afterResponse){const W=be(k=o,ie,Ms).call(k,p.clone());let $;try{$=await de(o.request,be(M=o,ie,ii).call(M),W,{retryCount:U(o,Bt)})}catch(Pe){throw be(X=o,ie,Ja).call(X,W),be(B=o,ie,Ja).call(B,p),Pe}if($ instanceof op)throw be(q=o,ie,Ja).call(q,W),be(H=o,ie,Ja).call(H,p),new Rs($.options);const ue=$ instanceof globalThis.Response?$:p;W!==ue&&be(L=o,ie,Ja).call(L,W),p!==ue&&be(I=o,ie,Ja).call(I,p),p=ue}if(be(J=o,ie,Ms).call(J,p),!p.ok&&(typeof U(o,V).throwHttpErrors=="function"?U(o,V).throwHttpErrors(p.status):U(o,V).throwHttpErrors)){let de=new Ns(p,o.request,be(he=o,ie,ii).call(he));for(const W of U(o,V).hooks.beforeError)de=await W(de,{retryCount:U(o,Bt)});throw de}if(U(o,V).onDownloadProgress){if(typeof U(o,V).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!xb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const de=p.clone();return be(pe=o,ie,Ja).call(pe,p),zb(de,U(o,V).onDownloadProgress)}return p},m=be(h=o,ie,Us).call(h,f).finally(()=>{var j,k;const p=U(o,$a);be(j=o,ie,Yu).call(j,(p==null?void 0:p.body)??void 0),be(k=o,ie,Yu).call(k,o.request.body??void 0)});for(const[p,j]of Object.entries(Eb))p==="bytes"&&typeof((g=(x=globalThis.Response)==null?void 0:x.prototype)==null?void 0:g.bytes)!="function"||(m[p]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||j);const k=await m;if(p==="json"){if(k.status===204)return"";const M=await k.text();return M===""?"":s.parseJson?s.parseJson(M):JSON.parse(M)}return k[p]()});return m}};Zu=new WeakSet,dp=function(r){return r&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof URLSearchParams)?Object.fromEntries(Object.entries(r).filter(([,s])=>s!==void 0)):r},Kt=new WeakMap,Bt=new WeakMap,ut=new WeakMap,V=new WeakMap,$a=new WeakMap,Pt=new WeakMap,gl=new WeakMap,ie=new WeakSet,Bu=function(){const r=U(this,V).retry.delay(U(this,Bt));let s=r;U(this,V).retry.jitter===!0?s=Math.random()*r:typeof U(this,V).retry.jitter=="function"&&(s=U(this,V).retry.jitter(r),(!Number.isFinite(s)||s<0)&&(s=r));const o=U(this,V).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,s)},mp=async function(r){if(Pm(this,Bt)._++,U(this,Bt)>U(this,V).retry.limit)throw r;const s=r instanceof Error?r:new np(r);if(s instanceof Rs)return s.customDelay??be(this,ie,Bu).call(this);if(!U(this,V).retry.methods.includes(this.request.method.toLowerCase()))throw r;if(U(this,V).retry.shouldRetry!==void 0){const o=await U(this,V).retry.shouldRetry({error:s,retryCount:U(this,Bt)});if(o===!1)throw r;if(o===!0)return be(this,ie,Bu).call(this)}if(Xb(r)&&!U(this,V).retry.retryOnTimeout)throw r;if(Gb(r)){if(!U(this,V).retry.statusCodes.includes(r.response.status))throw r;const o=r.response.headers.get("Retry-After")??r.response.headers.get("RateLimit-Reset")??r.response.headers.get("X-RateLimit-Retry-After")??r.response.headers.get("X-RateLimit-Reset")??r.response.headers.get("X-Rate-Limit-Reset");if(o&&U(this,V).retry.afterStatusCodes.includes(r.response.status)){let f=Number(o)*1e3;Number.isNaN(f)?f=Date.parse(o)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const m=U(this,V).retry.maxRetryAfter??f;return f<m?f:m}if(r.response.status===413)throw r}return be(this,ie,Bu).call(this)},Ms=function(r){return U(this,V).parseJson&&(r.json=async()=>U(this,V).parseJson(await r.text())),r},Yu=function(r){r&&r.cancel().catch(()=>{})},Ja=function(r){be(this,ie,Yu).call(this,r.body??void 0)},Us=async function(r){try{return await r()}catch(s){const o=Math.min(await be(this,ie,mp).call(this,s),js);if(U(this,Bt)<1)throw s;if(await Lb(o,U(this,Pt)?{signal:U(this,Pt)}:{}),s instanceof Rs&&s.customRequest){const f=U(this,V).signal?new globalThis.Request(s.customRequest,{signal:U(this,V).signal}):new globalThis.Request(s.customRequest);be(this,ie,Gu).call(this,f)}for(const f of U(this,V).hooks.beforeRetry){const m=await f({request:this.request,options:be(this,ie,ii).call(this),error:s,retryCount:U(this,Bt)});if(m instanceof globalThis.Request){be(this,ie,Gu).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===rp)return}return be(this,ie,Us).call(this,r)}},hp=async function(){var s;(s=U(this,Kt))!=null&&s.signal.aborted&&(Zt(this,Kt,new globalThis.AbortController),U(this,V).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Kt).signal]):U(this,Kt).signal,this.request=new globalThis.Request(this.request,{signal:U(this,V).signal}));for(const o of U(this,V).hooks.beforeRequest){const f=await o(this.request,be(this,ie,ii).call(this),{retryCount:U(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){be(this,ie,Gu).call(this,f);break}}const r=Bb(this.request,U(this,V));return Zt(this,$a,this.request),this.request=U(this,$a).clone(),U(this,V).timeout===!1?U(this,V).fetch(U(this,$a),r):Hb(U(this,$a),r,U(this,Kt),U(this,V))},ii=function(){if(!U(this,gl)){const{hooks:r,...s}=U(this,V);Zt(this,gl,Object.freeze(s))}return U(this,gl)},Gu=function(r){Zt(this,gl,void 0),this.request=be(this,ie,qs).call(this,r)},qs=function(r,s){return!U(this,V).onUploadProgress||!r.body?r:Cb(r,U(this,V).onUploadProgress,s??U(this,V).body??void 0)},It(ui,Zu);let Qu=ui;/*! MIT License © Sindre Sorhus */const Hs=u=>{const r=(s,o)=>Qu.create(s,Nu(u,o));for(const s of up)r[s]=(o,f)=>Qu.create(o,Nu(u,f,{method:s}));return r.create=s=>Hs(Nu(s)),r.extend=s=>(typeof s=="function"&&(s=s(u??{})),Hs(Nu(u,s))),r.stop=rp,r.retry=wb,r},Eh=Hs();let Mu=null;const Xu=Eh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[u=>{const r=xa.getState().accessToken;r&&u.headers.set("Authorization",`Bearer ${r}`)}],afterResponse:[async(u,r,s)=>{if(s.status===401&&!u.headers.has("X-Retry-After-Refresh")){Mu||(Mu=xa.getState().refresh().finally(()=>{Mu=null}));try{await Mu}catch{throw s}const o=xa.getState().accessToken;return o&&u.headers.set("Authorization",`Bearer ${o}`),u.headers.set("X-Retry-After-Refresh","1"),Eh(u,r)}}]}}),Vb=3e4;function Qb(u){if(u.link)return u.link;const r=(u.title+" "+u.body).match(/task\s*#?(\d+)/i);if(r)return`/tasks/${r[1]}`;const s=(u.title+" "+u.body).match(/worker\s+(\S+)/i);return s?`/workers/${s[1]}`:null}function pp(){const u=Fa(),[r,s]=v.useState([]),[o,f]=v.useState(0),[m,h]=v.useState(!1),[x,g]=v.useState(!1),p=v.useRef(null),{t:j}=ta(),k=v.useRef(async()=>{try{g(!0);const q=(await Xu.get("web/notifications",{searchParams:{limit:"20"}}).json()).data,H=q.filter(L=>!L.isRead).length;s(L=>L.length===q.length&&L.every((I,J)=>I.id===q[J].id&&I.isRead===q[J].isRead)?L:q),f(L=>L===H?L:H)}catch{}finally{g(!1)}});v.useEffect(()=>{k.current();const B=setInterval(()=>k.current(),Vb);return()=>clearInterval(B)},[]),v.useEffect(()=>{function B(q){p.current&&!p.current.contains(q.target)&&h(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);async function M(B){try{await Xu.post(`web/notifications/${B}/read`),s(q=>q.map(H=>H.id===B?{...H,isRead:!0}:H)),f(q=>Math.max(0,q-1))}catch{}}async function X(){try{await Xu.post("web/notifications/read-all"),s(B=>B.map(q=>({...q,isRead:!0}))),f(0)}catch{}}return _.jsxs("div",{className:"relative",ref:p,children:[_.jsxs("button",{type:"button",onClick:()=>h(B=>!B),"aria-label":j("common.notifications"),className:"relative inline-flex items-center justify-center rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]",children:[_.jsx(Bv,{size:16}),o>0&&_.jsx("span",{className:"absolute right-0 top-0 flex h-3 min-w-3 items-center justify-center rounded-full bg-[var(--destructive)] px-0.5 text-[8px] font-semibold leading-none text-white",children:o})]}),m&&_.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-[min(320px,calc(100vw-2rem))] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[_.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[_.jsx("span",{className:"text-sm font-semibold",children:j("common.notifications")}),o>0&&_.jsxs("button",{type:"button",onClick:X,"aria-label":j("common.mark_all_read"),className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[_.jsx(Yv,{className:"h-3.5 w-3.5"}),j("common.mark_all_read")]})]}),_.jsx("div",{className:"max-h-80 overflow-y-auto",children:x&&r.length===0?_.jsx("div",{className:"flex justify-center py-8",children:_.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):r.length===0?_.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[_.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),_.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:j("common.no_notifications")})]}):r.map(B=>{const q=Qb(B);return _.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${q?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${B.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{q&&(B.isRead||M(B.id),h(!1),u(q))},children:[_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsx("p",{className:"text-sm font-medium",children:B.title}),_.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:B.body}),_.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(B.createdAt).toLocaleString()})]}),!B.isRead&&_.jsx("button",{type:"button",onClick:H=>{H.stopPropagation(),M(B.id)},"aria-label":j("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:_.jsx(Gv,{className:"h-3.5 w-3.5"})})]},B.id)})})]})]})}function Zb(u){return{tasks:u.tasks.map(r=>({type:"task",id:r.id,title:`#${r.id} ${r.description}`,subtitle:`${r.status} · ${r.project_key}`})),workers:(u.workers??[]).map(r=>({type:"worker",id:r.id,title:r.name,subtitle:`${r.hostname} · ${r.status}`})),projects:u.projects.map(r=>({type:"project",id:r.key,title:r.name,subtitle:r.repository}))}}const Kb=300,kh={tasks:nb,workers:Fh,projects:Jv},Jb={tasks:"tasks",workers:"workers",projects:"projects"};function _p({renderTrigger:u}={}){const[r,s]=v.useState(""),[o,f]=v.useState({tasks:[],workers:[],projects:[]}),[m,h]=v.useState(!1),[x,g]=v.useState(!1),[p,j]=v.useState(0),k=v.useRef(null),M=v.useRef(null),X=v.useRef(void 0),B=v.useRef(void 0),q=Fa(),{t:H}=ta(),L=v.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),I=v.useCallback(async $=>{var Pe;if(!$.trim()){f({tasks:[],workers:[],projects:[]});return}(Pe=B.current)==null||Pe.abort();const ue=new AbortController;B.current=ue;try{h(!0);const Je=await Xu.get("web/search",{searchParams:{q:$},signal:ue.signal}).json();f(Zb(Je)),j(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{ue.signal.aborted||h(!1)}},[]);v.useEffect(()=>(X.current&&clearTimeout(X.current),X.current=setTimeout(()=>I(r),Kb),()=>{X.current&&clearTimeout(X.current)}),[r,I]),v.useEffect(()=>{function $(ue){ue.key==="/"&&!x&&!(ue.target instanceof HTMLInputElement||ue.target instanceof HTMLTextAreaElement)&&(ue.preventDefault(),g(!0)),ue.key==="Escape"&&x&&(ue.preventDefault(),J())}return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[x]),v.useEffect(()=>{x&&setTimeout(()=>{var $;return($=M.current)==null?void 0:$.focus()},50)},[x]);function J(){g(!1),s(""),f({tasks:[],workers:[],projects:[]}),j(0)}function he($){switch(J(),$.type){case"task":q(`/tasks/${$.id}`);break;case"worker":q(`/workers/${$.id}`);break;case"project":q(`/projects/${$.id}`);break}}function pe($){$.key==="ArrowDown"?($.preventDefault(),j(ue=>Math.min(ue+1,L.length-1))):$.key==="ArrowUp"?($.preventDefault(),j(ue=>Math.max(ue-1,0))):$.key==="Enter"&&L[p]&&($.preventDefault(),he(L[p]))}const de=L.length>0;let W=0;return _.jsxs(_.Fragment,{children:[u?u(()=>g(!0)):_.jsxs("button",{type:"button",onClick:()=>g(!0),className:"flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:[_.jsx(Wh,{className:"h-3.5 w-3.5"}),_.jsx("span",{children:H("common.search_placeholder")}),_.jsx("kbd",{className:"ml-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[11px] text-[var(--text-muted)]",children:"/"})]}),x&&_.jsx("div",{ref:k,className:"fixed inset-0 z-[100] flex items-start justify-center pt-4 md:pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:$=>{$.target===k.current&&J()},children:_.jsxs("div",{className:"mx-3 w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl sm:mx-4 md:mx-0",children:[_.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[_.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),_.jsx("input",{ref:M,type:"text",placeholder:H("common.search_input_placeholder"),value:r,onChange:$=>s($.target.value),onKeyDown:pe,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),m&&_.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),_.jsx("div",{className:"max-h-[50vh] overflow-y-auto sm:max-h-[60vh] md:max-h-[400px]",children:r.trim()&&!de&&!m?_.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:H("common.no_search_results",{query:r})}):Object.keys(kh).map($=>{const ue=o[$];if(ue.length===0)return null;const Pe=kh[$],Je=W;return W+=ue.length,_.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[_.jsx(Pe,{className:"h-3 w-3"}),_.jsx("span",{className:"text-[11px] lowercase tracking-wider",children:Jb[$]})]}),ue.map((qe,At)=>{const rt=Je+At,De=rt===p;return _.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${De?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>he(qe),onMouseEnter:()=>j(rt),children:[_.jsx("span",{className:`text-xs ${De?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:De?">":" "}),_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsx("p",{className:"truncate text-sm",children:qe.title}),qe.subtitle&&_.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",children:qe.subtitle})]})]},`${qe.type}-${qe.id}`)})]},$)})}),_.jsxs("div",{className:"hidden items-center gap-4 border-t border-[var(--border)] px-4 py-2 md:flex",children:[_.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↑↓"})," ",H("common.navigate_hint")]}),_.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↵"})," ",H("common.select_hint")]}),_.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"esc"})," ",H("common.close_hint")]})]})]})})]})}const $b={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"},wh="confirm-dialog-title";function Th(u){return Array.from(u.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))}function Wb({isOpen:u,onClose:r,onConfirm:s,title:o,message:f,confirmVariant:m="danger",isLoading:h,...x}){const{t:g}=ta(),p=x.confirmLabel??g("common.confirm"),j=x.cancelLabel??g("common.cancel"),k=v.useRef(null),M=v.useRef(null),X=$b[m];v.useEffect(()=>{if(!u)return;M.current=document.activeElement;const q=requestAnimationFrame(()=>{if(k.current){const H=Th(k.current);H.length>0&&H[0].focus()}});return()=>{var H;cancelAnimationFrame(q),(H=M.current)==null||H.focus()}},[u]);const B=v.useCallback(q=>{if(q.key==="Tab"&&k.current){const H=Th(k.current);if(H.length===0)return;const L=H[0],I=H[H.length-1];q.shiftKey?document.activeElement===L&&(q.preventDefault(),I.focus()):document.activeElement===I&&(q.preventDefault(),L.focus())}},[]);return u?_.jsx("div",{onClick:r,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"max(1rem, 10vh)",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:_.jsxs("div",{ref:k,role:"dialog","aria-modal":"true","aria-labelledby":wh,onClick:q=>q.stopPropagation(),onKeyDown:B,style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem"},children:[_.jsx("div",{style:{marginBottom:"1.25rem"},children:_.jsxs("div",{id:wh,style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[_.jsx(Ih,{style:{width:"1rem",height:"1rem"}}),o]})}),_.jsx("div",{style:{marginBottom:"1.25rem"},children:_.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f})}),_.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[_.jsx("button",{type:"button",onClick:r,disabled:h,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",cursor:h?"not-allowed":"pointer",opacity:h?.7:1,transition:"color 0.15s, border-color 0.15s"},children:j}),_.jsx("button",{type:"button",onClick:s,disabled:h,style:{flex:1,padding:"0.5rem",backgroundColor:X,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:h?"not-allowed":"pointer",opacity:h?.7:1},children:h?g("common.processing"):p})]})]})}):null}const yp=v.createContext({setActions:()=>{}});function n1(u){const{setActions:r}=v.useContext(yp);v.useEffect(()=>(r(u),()=>r(null)),[u,r])}const gp=v.createContext({setSubtitle:()=>{}});function i1(u){const{setSubtitle:r}=v.useContext(gp);v.useEffect(()=>(r(u),()=>r(null)),[u,r])}const Fb=[{to:"/home",label:"terminal",icon:Js},{to:"/tasks",label:"tasks",icon:$h},{to:"/dashboard",label:"dashboard",icon:Jh},{to:"/workers",label:"workers",icon:Fh},{to:"/projects",label:"projects",icon:$v},{to:"/access-tokens",label:"access_tokens",icon:Fv}],Ib=[{to:"/docs/cli",label:"cli",icon:Js},{to:"/docs/api",label:"api",icon:Kv},{to:"/docs/skill",label:"skill",icon:lb}],Pb=[{to:"/admin",label:"admin",icon:ab}],e0=[{to:"/home",label:"terminal",icon:Js},{to:"/tasks",label:"tasks",icon:$h},{to:"/dashboard",label:"dashboard",icon:Jh}],Uu={"/home":{title:"common.breadcrumb_terminal",subtitle:"common.breadcrumb_terminal_sub"},"/dashboard":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/workers":{title:"common.breadcrumb_workers",subtitle:"common.breadcrumb_workers_sub"},"/projects":{title:"common.breadcrumb_projects",subtitle:"common.breadcrumb_projects_sub"},"/admin":{title:"common.breadcrumb_admin",subtitle:"common.breadcrumb_admin_sub"},"/profile":{title:"common.breadcrumb_profile",subtitle:"common.breadcrumb_profile_sub"},"/access-tokens":{title:"common.breadcrumb_access_tokens",subtitle:"common.breadcrumb_access_tokens_sub"},"/docs":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_sub"},"/docs/cli":{title:"common.breadcrumb_docs_cli",subtitle:"common.breadcrumb_docs_cli_sub"},"/docs/api":{title:"common.breadcrumb_docs_api",subtitle:"common.breadcrumb_docs_api_sub"},"/docs/skill":{title:"common.breadcrumb_docs_skill",subtitle:"common.breadcrumb_docs_skill_sub"}};function t0(u){const{t:r}=ta();if(Uu[u]){const o=Uu[u];return{title:r(o.title),subtitle:r(o.subtitle)}}const s="/"+u.split("/").filter(Boolean)[0];if(Uu[s]){const o=Uu[s],f=u.split("/").filter(Boolean).slice(1).join(" / ");return{title:r(o.title),subtitle:f||r(o.subtitle)}}return{title:u.slice(1).replace(/\//g," // ")||"home"}}function a0(u,r){return u==="/home"?r==="/home":u==="/dashboard"?r==="/dashboard":r.startsWith(u)}function l0(){const u=yt(),{t:r}=ta(),s={terminal:r("terminal_home.title"),dashboard:r("dashboard.title"),tasks:r("tasks.title"),workers:r("workers.title")};return _.jsxs("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)] md:hidden",style:{height:60,paddingTop:8,paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:[e0.map(({to:o,label:f,icon:m})=>{const h=a0(o,u.pathname);return _.jsxs(Ks,{to:o,className:"flex flex-1 flex-col items-center gap-1",children:[_.jsx(m,{size:18,className:h?"text-[var(--accent)]":"text-[var(--text-muted)]"}),_.jsx("span",{className:`text-[11px] lowercase ${h?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),_.jsx(_p,{renderTrigger:o=>_.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[_.jsx(Wh,{size:18,className:"text-[var(--text-muted)]"}),_.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:r("common.search_placeholder")})]})})]})}function n0(){const u=Fa(),{t:r}=ta();return _.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:"calc(56px + env(safe-area-inset-top, 0px))",minHeight:"calc(56px + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)"},children:[_.jsxs("button",{onClick:()=>u("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[_.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",children:_.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),_.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",children:r("common.overlord")})]}),_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx("button",{onClick:()=>u("/profile"),className:"p-2 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]","aria-label":r("common.profile"),children:_.jsx(ub,{size:18})}),_.jsx(pp,{}),_.jsx(lp,{})]})]})}function As({label:u,items:r,collapsed:s}){return _.jsxs("div",{className:"mt-4 first:mt-0",children:[!s&&_.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:u}),r.map(({to:o,label:f,icon:m})=>_.jsx(Ks,{to:o,className:({isActive:h})=>`flex items-center text-sm lowercase transition-colors ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${h?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:h})=>_.jsxs(_.Fragment,{children:[_.jsx(m,{size:14,style:{flexShrink:0}}),!s&&_.jsx("span",{children:h?`> ${f}`:` ${f}`})]})},o))]})}function i0(){const{user:u,logout:r}=xa(),s=Fa(),[o,f]=v.useState(!1),m=fb(),{t:h}=ta(),{sidebarCollapsed:x,toggleSidebar:g}=mb();function p(){r(),s("/login")}return _.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)] transition-[width,min-width] duration-300 overflow-hidden",style:{width:x?56:240,minWidth:x?56:240,backgroundColor:"var(--bg-card)"},children:[_.jsx("div",{className:"flex items-center px-5",style:{height:48},children:_.jsxs("button",{onClick:()=>s("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[_.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{flexShrink:0},children:_.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),!x&&_.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)"},children:h("common.overlord")})]})}),_.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[_.jsx(As,{label:h("common.navigation"),items:Fb,collapsed:x}),_.jsx(As,{label:h("common.docs_section"),items:Ib,collapsed:x}),m&&_.jsx(As,{label:h("common.admin_section"),items:Pb,collapsed:x})]}),_.jsx("div",{className:`px-3 py-1 ${x?"flex justify-center":""}`,children:_.jsx("button",{onClick:g,className:"flex items-center justify-center w-full py-1.5 rounded-[4px] text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)] hover:bg-[var(--accent)]/5","aria-label":x?"expand sidebar":"collapse sidebar",children:x?_.jsx(Vv,{size:14}):_.jsx(Xv,{size:14})})}),_.jsx("div",{className:"border-t border-[var(--border)] p-3",children:_.jsxs("div",{className:`flex items-center py-2 ${x?"justify-center":"gap-3 px-3"}`,children:[_.jsx("button",{onClick:()=>s("/profile"),className:"flex h-7 w-7 items-center justify-center text-xs font-bold text-black transition-opacity hover:opacity-80",style:{backgroundColor:"var(--accent)",borderRadius:4,flexShrink:0},title:h("common.profile"),children:((u==null?void 0:u.username)??"u")[0].toUpperCase()}),!x&&_.jsxs(_.Fragment,{children:[_.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:h("common.profile"),children:[_.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(u==null?void 0:u.username)??"user"}),_.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(u==null?void 0:u.role)??"user"})]}),_.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":h("common.log_out"),children:_.jsx(Pv,{size:14})})]})]})}),_.jsx(Wb,{isOpen:o,onClose:()=>f(!1),onConfirm:p,title:h("common.logout_title"),message:h("common.logout_message"),confirmLabel:h("common.logout"),confirmVariant:"warning"})]})}function u0({headerActions:u,subtitleOverride:r}){const s=yt(),{title:o,subtitle:f}=t0(s.pathname),m=r??f;return _.jsxs("header",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5",style:{height:48,minHeight:48,backgroundColor:"var(--bg-card)"},children:[_.jsxs("div",{className:"text-sm lowercase",children:[_.jsx("span",{style:{color:"var(--text-primary)"},children:o}),m&&_.jsxs("span",{style:{color:"var(--text-muted)"},children:[" ","// ",m]})]}),_.jsxs("div",{className:"flex items-center gap-3",children:[u,_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(_p,{}),_.jsx(pp,{}),_.jsx(lp,{})]})]})]})}function r0(){const[u,r]=v.useState(null),[s,o]=v.useState(null),m=yt().pathname==="/home";return v.useEffect(()=>pb.getState().init(),[]),_.jsxs("div",{className:"flex font-mono",style:{height:"100dvh",minHeight:"100vh"},children:[_.jsx(i0,{}),_.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[_.jsx(n0,{}),_.jsx(u0,{headerActions:u,subtitleOverride:s}),_.jsx("main",{className:m?"flex-1 overflow-hidden bg-[var(--bg-primary)] pb-[calc(60px+env(safe-area-inset-bottom,0px))] md:pb-0":"flex-1 overflow-auto bg-[var(--bg-primary)] p-4 pb-[calc(60px+env(safe-area-inset-bottom,0px)+0.5rem)] md:p-6 md:pb-6",children:_.jsx(yp.Provider,{value:{setActions:r},children:_.jsx(gp.Provider,{value:{setSubtitle:o},children:_.jsx(tv,{})})})}),_.jsx(l0,{})]})]})}function Rh(u){var s;const r=(s=u.state)==null?void 0:s.from;return r?{from:r}:{from:{pathname:u.pathname,search:u.search}}}function li({children:u,requireAdmin:r=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:m}=xa(),h=yt();if(m)return _.jsx("div",{className:"flex h-screen items-center justify-center",children:_.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})});if(!s)return _.jsx(ni,{to:"/login",state:Rh(h),replace:!0});if(f){const x=Rh(h);return h.pathname!=="/totp-setup"&&h.pathname!=="/bind"?_.jsx(ni,{to:"/totp-setup",state:x,replace:!0}):h.pathname==="/bind"?(sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(x.from)),_.jsx(ni,{to:"/totp-setup",state:x,replace:!0})):_.jsx(_.Fragment,{children:u})}return r&&(o==null?void 0:o.role)!==Ph.ADMIN?_.jsx(ni,{to:"/home",replace:!0}):_.jsx(_.Fragment,{children:u})}function o0({children:u}){const{theme:r,resolved:s,setResolved:o}=ap();return v.useEffect(()=>{if(r!=="system"){o(r);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const m=h=>o(h.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[r,o]),v.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),_.jsx(_.Fragment,{children:u})}class s0 extends v.Component{constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}render(){var r;return this.state.hasError?_.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8 font-mono",children:[_.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Lu("common.runtime_error")}),_.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((r=this.state.error)==null?void 0:r.message)||Lu("common.an_unexpected_error_occurred")}),_.jsxs("button",{onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[_.jsx(tb,{className:"h-3.5 w-3.5"}),Lu("common.reload")]})]}):this.props.children}}function c0({isOpen:u}){const r=Fa(),{logout:s,setSessionExpired:o}=xa(),{t:f}=ta();function m(){s(),o(!1),r("/login")}return u?_.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[_.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),_.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:_.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[_.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:_.jsx(Iv,{className:"h-7 w-7 text-[var(--warning)]"})}),_.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),_.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),_.jsx("button",{type:"button",className:"w-full rounded-[4px] bg-[var(--accent)] px-3 py-2.5 text-xs font-medium text-black hover:opacity-90 transition-opacity",onClick:m,children:f("auth.go_to_login")})]})})]}):null}const jh=5;let ba=[];const Ls=new Set;function vp(){Ls.forEach(u=>u())}function f0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(u,r,s=4e3){const o=f0();return ba=[...ba,{id:o,variant:u,message:r,duration:s}],ba.length>jh&&(ba=ba.slice(ba.length-jh)),vp(),o}Wa.success=(u,r)=>Wa("success",u,r);Wa.error=(u,r)=>Wa("error",u,r);Wa.warning=(u,r)=>Wa("warning",u,r);Wa.info=(u,r)=>Wa("info",u,r);function d0(u){ba=ba.filter(r=>r.id!==u),vp()}function m0(){const[,u]=v.useState(0);return v.useEffect(()=>{const r=()=>u(s=>s+1);return Ls.add(r),()=>{Ls.delete(r)}},[]),ba}const h0={success:{icon:Qv,borderColor:"var(--accent)"},error:{icon:Zv,borderColor:"var(--destructive)"},warning:{icon:Ih,borderColor:"var(--warning)"},info:{icon:Wv,borderColor:"var(--info)"}};function p0({item:u}){const r=h0[u.variant],s=r.icon,{t:o}=ta(),f=v.useCallback(()=>d0(u.id),[u.id]);return v.useEffect(()=>{if(!u.duration)return;const m=setTimeout(f,u.duration);return()=>clearTimeout(m)},[u.duration,f]),_.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${r.borderColor}`},role:"alert",children:[_.jsx(s,{className:"h-4 w-4 shrink-0",style:{color:r.borderColor}}),_.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:u.message}),_.jsx("button",{onClick:f,className:"shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]","aria-label":o("common.dismiss_notification"),children:_.jsx(rb,{className:"h-3.5 w-3.5"})})]})}function _0(){const u=m0();return u.length===0?null:_.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-[9999] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2",children:u.map(r=>_.jsx("div",{className:"pointer-events-auto",children:_.jsx(p0,{item:r})},r.id))})}const y0=v.lazy(()=>Ce(()=>import("./LandingPage-DP9U6Iea.js"),__vite__mapDeps([0,1,2,3,4,5]))),g0=v.lazy(()=>Ce(()=>import("./LoginPage-OLBwEvXt.js"),[])),v0=v.lazy(()=>Ce(()=>import("./TotpSetupPage-VeqXwL5k.js"),[])),b0=v.lazy(()=>Ce(()=>import("./NotFoundPage-DA9fVgox.js"),[])),x0=v.lazy(()=>Ce(()=>import("./HomePage-CO4wRT0y.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),S0=v.lazy(()=>Ce(()=>import("./TerminalHomePage-cz_7HYVr.js"),__vite__mapDeps([15,16,17,18,10,11,19,8,12,14,20,2,21]))),E0=v.lazy(()=>Ce(()=>import("./TaskListPage-BjPRD6v8.js"),__vite__mapDeps([22,16,7,8,12,13,19,5,23,9,20]))),k0=v.lazy(()=>Ce(()=>import("./TaskDetailPage-LdLghDpk.js"),__vite__mapDeps([24,16,17,18,12,19,8,25,26,27,28]))),w0=v.lazy(()=>Ce(()=>import("./WorkerListPage-P1hVwXGG.js"),__vite__mapDeps([29,8,30,31,32,33,21,5,28,19,23,9,14,20]))),T0=v.lazy(()=>Ce(()=>import("./WorkerDetailPage-BOn7z8cR.js"),__vite__mapDeps([34,12,8,35,30,14,36,25]))),R0=v.lazy(()=>Ce(()=>import("./WorkerSetupGuidePage-m-ZneK_i.js"),__vite__mapDeps([31,32,33,21]))),j0=v.lazy(()=>Ce(()=>import("./ProjectListPage-CitoAwwH.js"),__vite__mapDeps([37,19,23,9,12,14,20]))),A0=v.lazy(()=>Ce(()=>import("./ProjectDetailPage-CLqYqqVX.js"),__vite__mapDeps([38,39,19,12,8,35,14,40,36,20]))),z0=v.lazy(()=>Ce(()=>import("./EditProjectPage-DiVkK33D.js"),__vite__mapDeps([41,19,39,20]))),C0=v.lazy(()=>Ce(()=>import("./PipelineEditorPage-Ra4MjS17.js"),__vite__mapDeps([42,19,13]))),O0=v.lazy(()=>Ce(()=>import("./ProfilePage-BWGufJ03.js"),__vite__mapDeps([43,44,35,14]))),N0=v.lazy(()=>Ce(()=>import("./BindPlatformPage-ByhQZ5qX.js"),[])),D0=v.lazy(()=>Ce(()=>import("./AccessTokensPage-CUQDQyQ5.js"),__vite__mapDeps([45,19,23,9,12,14,20,5,36]))),M0=v.lazy(()=>Ce(()=>import("./CliReferencePage-BmEVf_Yf.js"),__vite__mapDeps([46,47,5,20]))),U0=v.lazy(()=>Ce(()=>import("./ApiReferencePage-DFFhnxAn.js"),__vite__mapDeps([48,47,5,20]))),q0=v.lazy(()=>Ce(()=>import("./SkillPage-D0lNlB7o.js"),__vite__mapDeps([49,27,5]))),H0=v.lazy(()=>Ce(()=>import("./AdminPage-ChDIUX_3.js"),__vite__mapDeps([50,4,3,51,33]))),L0=v.lazy(()=>Ce(()=>import("./DeveloperManage-959Sec6Y.js"),__vite__mapDeps([52,19,44,23,9,14,8,20,4,40,26]))),B0=v.lazy(()=>Ce(()=>import("./BotManage-BCCGabIK.js"),__vite__mapDeps([53,19,36,20,23,9,14,8,3,40]))),Y0=v.lazy(()=>Ce(()=>import("./TokenManage-DP0iub57.js"),__vite__mapDeps([54,32,5,27,23,9,14,8,20]))),G0=v.lazy(()=>Ce(()=>import("./AuditLogPage-X3KImiZ3.js"),__vite__mapDeps([55,19,23,9,51,11]))),X0=v.lazy(()=>Ce(()=>import("./SettingsPage-DHa6WOhU.js"),[]));function V0(){return _.jsx("div",{className:"flex h-full items-center justify-center",children:_.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function Q0(){const u=xa(r=>r.sessionExpired);return _.jsxs(o0,{children:[_.jsx(_0,{}),_.jsx(s0,{children:_.jsxs(jv,{children:[_.jsx(c0,{isOpen:u}),_.jsx(v.Suspense,{fallback:_.jsx(V0,{}),children:_.jsxs(lv,{children:[_.jsx(xe,{path:"/",element:_.jsx(y0,{})}),_.jsx(xe,{path:"/login",element:_.jsx(g0,{})}),_.jsx(xe,{path:"/totp-setup",element:_.jsx(li,{children:_.jsx(v0,{})})}),_.jsx(xe,{path:"/bind",element:_.jsx(li,{children:_.jsx(N0,{})})}),_.jsxs(xe,{element:_.jsx(li,{children:_.jsx(r0,{})}),children:[_.jsx(xe,{path:"/home",element:_.jsx(S0,{})}),_.jsx(xe,{path:"/dashboard",element:_.jsx(x0,{})}),_.jsx(xe,{path:"/tasks",element:_.jsx(E0,{})}),_.jsx(xe,{path:"/tasks/:id",element:_.jsx(k0,{})}),_.jsx(xe,{path:"/workers",element:_.jsx(w0,{})}),_.jsx(xe,{path:"/workers/setup",element:_.jsx(li,{requireAdmin:!0,children:_.jsx(R0,{})})}),_.jsx(xe,{path:"/workers/:id",element:_.jsx(T0,{})}),_.jsx(xe,{path:"/projects",element:_.jsx(j0,{})}),_.jsx(xe,{path:"/projects/:key",element:_.jsx(A0,{})}),_.jsx(xe,{path:"/projects/:key/edit",element:_.jsx(z0,{})}),_.jsx(xe,{path:"/projects/:key/pipeline",element:_.jsx(C0,{})}),_.jsx(xe,{path:"/profile",element:_.jsx(O0,{})}),_.jsx(xe,{path:"/access-tokens",element:_.jsx(D0,{})}),_.jsx(xe,{path:"/docs/cli",element:_.jsx(M0,{})}),_.jsx(xe,{path:"/docs/api",element:_.jsx(U0,{})}),_.jsx(xe,{path:"/docs/skill",element:_.jsx(q0,{})}),_.jsxs(xe,{path:"/admin",element:_.jsx(li,{requireAdmin:!0,children:_.jsx(H0,{})}),children:[_.jsx(xe,{index:!0,element:_.jsx(ni,{to:"developers",replace:!0})}),_.jsx(xe,{path:"developers",element:_.jsx(L0,{})}),_.jsx(xe,{path:"bots",element:_.jsx(B0,{})}),_.jsx(xe,{path:"tokens",element:_.jsx(Y0,{})}),_.jsx(xe,{path:"audit-logs",element:_.jsx(G0,{})}),_.jsx(xe,{path:"settings",element:_.jsx(X0,{})})]})]}),_.jsx(xe,{path:"*",element:_.jsx(b0,{})})]})})]})})]})}xa.getState().initialize();tg.createRoot(document.getElementById("root")).render(_.jsx(v.StrictMode,{children:_.jsx(Q0,{})}));export{I0 as A,P0 as B,Gv as C,Ph as D,Ks as E,t1 as F,e1 as G,Ns as H,Zv as I,a1 as J,Fv as K,Qh as L,ni as N,tv as O,F0 as P,ju as R,Fh as S,lp as T,W0 as W,rb as X,ta as a,Js as b,je as c,ab as d,Fa as e,yt as f,Xu as g,fb as h,pb as i,_ as j,Wu as k,$0 as l,i1 as m,n1 as n,Wh as o,$h as p,l1 as q,v as r,Wb as s,Wa as t,xa as u,K0 as v,Qv as w,Ih as x,tb as y,J0 as z};
225
+ ov login https://overlord.yourdomain.com`,setup_step_3_link:"development workflow",go_to_app:"open app",documentation:"documentation",api:"api",copy_install_command:"copy install command"},docs:{cli_reference:"cli",cli_subtitle:"// command-line tools",api_reference:"api",api_subtitle:"// rest api endpoints",quick_start:"// quick start",developer_cli:"developer cli (ov)",admin_cli:"admin cli (overlord)",authentication:"// authentication",usage:"usage",flags:"flags",example:"example",request_body:"request body",response:"response",quick_start_with_token:"// quick start with your token",replace_token_hint:"// replace <your-token> with the actual token value from your access tokens page",cli_tools_desc:"// overlord provides two cli tools: {ov} (developer cli) and {overlord} (admin/ops cli)",api_base_url_desc:"// base url: {url} · all endpoints return json · auth via bearer token in authorization header"},onboarding:{getting_started:"// getting started",completed_count:"{done}/{total} completed",dismiss:"dismiss",all_done:"all set! you're ready to go.",admin_create_project_title:"create your first project",admin_create_project_desc:"set up a project with a git repo and pipeline",admin_register_worker_title:"register a worker",admin_register_worker_desc:"generate a token and set up a worker to run tasks",admin_create_developer_title:"create a developer account",admin_create_developer_desc:"add team members who can create and monitor tasks",admin_configure_bot_title:"configure a chat bot",admin_configure_bot_desc:"register a Lark or Slack bot to enable task management via chat",admin_first_task_title:"create your first task",admin_first_task_desc:"verify the full pipeline works end-to-end",lead_view_projects_title:"view your projects",lead_view_projects_desc:"check the projects assigned to you",lead_configure_pipeline_title:"configure a pipeline",lead_configure_pipeline_desc:"set up stages for your project workflow",lead_add_member_title:"add a team member",lead_add_member_desc:"invite developers to your project",lead_first_task_title:"create your first task",lead_first_task_desc:"submit a task and watch it execute",dev_install_cli_title:"install the ov cli",dev_install_cli_desc:"npm install -g @overlordai/developer-cli",dev_setup_cli_title:"run ov setup",dev_setup_cli_desc:"connect to the server and authenticate",dev_link_chat_title:"link your chat account",dev_link_chat_desc:'send "bind" to the bot in Lark or Slack to connect your account',dev_view_projects_title:"explore projects",dev_view_projects_desc:"browse available projects and their pipelines",dev_first_task_title:"create your first task",dev_first_task_desc:"submit a task via web or cli",go_to_projects:"go to projects",go_to_workers:"go to workers",go_to_tasks:"go to tasks",go_to_bots:"manage bots",manage_developers:"manage developers",cli:"cli",setup_guide:"setup guide"},bind:{title:"// link platform account",linking:"linking your account...",success:"account linked successfully!",success_detail:"your {platform} account has been connected. you can now use bot commands.",error:"failed to link account",invalid_token:'this link is invalid or has expired. send "bind" to the bot again to get a new link.',back_to_home:"go to dashboard",no_token:"no bind token provided."},terminal_home:{title:"terminal",select_project:"project...",all_projects:"all projects",task_description_placeholder:"describe the task...",new_task:"new task",no_active_tasks:"no active tasks",create_task_hint:"create a task using the bar above to get started"}};function gb(u,r){const s=r.split(".");let o=u;for(const f of s){if(o==null||typeof o!="object")return r;o=o[f]}return typeof o=="string"?o:r}function vb(u,r){return r?u.replace(/\{(\w+)\}/g,(s,o)=>r[o]!=null?String(r[o]):`{${o}}`):u}function Lu(u,r){return vb(gb(yb,u),r)}function ta(){return{t:v.useCallback((r,s)=>Lu(r,s),[])}}function lp(){const{theme:u,setTheme:r}=ap(),{t:s}=ta(),o=u==="dark"||u==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function f(){r(o?"light":"dark")}return _.jsx("button",{onClick:f,className:"flex items-center gap-1.5 rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]","aria-label":s(o?"common.switch_to_light":"common.switch_to_dark"),title:s(o?"common.light_mode":"common.dark_mode"),children:o?_.jsx(ib,{size:16}):_.jsx(eb,{size:16})})}class Ns extends Error{constructor(s,o,f){const m=s.status||s.status===0?s.status:"",h=s.statusText??"",x=`${m} ${h}`.trim(),g=x?`status code ${x}`:"an unknown error";super(`Request failed with ${g}: ${o.method} ${o.url}`);Xe(this,"response");Xe(this,"request");Xe(this,"options");this.name="HTTPError",this.response=s,this.request=o,this.options=f}}class np extends Error{constructor(s){let o="Non-error value was thrown";try{typeof s=="string"?o=s:s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&(o=s.message)}catch{}super(o);Xe(this,"name","NonError");Xe(this,"value");this.value=s}}class Rs extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new np(s.cause):void 0;super(s!=null&&s.code?`Forced retry: ${s.code}`:"Forced retry",o?{cause:o}:void 0);Xe(this,"name","ForceRetryError");Xe(this,"customDelay");Xe(this,"code");Xe(this,"customRequest");this.customDelay=s==null?void 0:s.delay,this.code=s==null?void 0:s.code,this.customRequest=s==null?void 0:s.request}}const xh=(()=>{let u=!1,r=!1;const s=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(s&&o)try{r=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return u&&!r})(),bb=typeof globalThis.AbortController=="function",ip=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",xb=typeof globalThis.ReadableStream=="function",Sb=typeof globalThis.FormData=="function",up=["get","post","put","patch","head","delete"],Eb={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},js=2147483647,kb=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,rp=Symbol("stop");class op{constructor(r){Xe(this,"options");this.options=r}}const wb=u=>new op(u),Tb={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Rb={next:!0},jb={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Ab=u=>{if(!u)return 0;if(u instanceof FormData){let r=0;for(const[s,o]of u)r+=kb,r+=new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length,r+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return r}if(u instanceof Blob)return u.size;if(u instanceof ArrayBuffer)return u.byteLength;if(typeof u=="string")return new TextEncoder().encode(u).length;if(u instanceof URLSearchParams)return new TextEncoder().encode(u.toString()).length;if("byteLength"in u)return u.byteLength;if(typeof u=="object"&&u!==null)try{const r=JSON.stringify(u);return new TextEncoder().encode(r).length}catch{return 0}return 0},sp=(u,r,s)=>{let o,f=0;return u.pipeThrough(new TransformStream({transform(m,h){if(h.enqueue(m),o){f+=o.byteLength;let x=r===0?0:f/r;x>=1&&(x=1-Number.EPSILON),s==null||s({percent:x,totalBytes:Math.max(r,f),transferredBytes:f},o)}o=m},flush(){o&&(f+=o.byteLength,s==null||s({percent:1,totalBytes:Math.max(r,f),transferredBytes:f},o))}}))},zb=(u,r)=>{if(!u.body)return u;if(u.status===204)return new Response(null,{status:u.status,statusText:u.statusText,headers:u.headers});const s=Math.max(0,Number(u.headers.get("content-length"))||0);return new Response(sp(u.body,s,r),{status:u.status,statusText:u.statusText,headers:u.headers})},Cb=(u,r,s)=>{if(!u.body)return u;const o=Ab(s??u.body);return new Request(u,{duplex:"half",body:sp(u.body,o,r)})},yl=u=>u!==null&&typeof u=="object",Nu=(...u)=>{for(const r of u)if((!yl(r)||Array.isArray(r))&&r!==void 0)throw new TypeError("The `options` argument must be an object");return $s({},...u)},cp=(u={},r={})=>{const s=new globalThis.Headers(u),o=r instanceof globalThis.Headers,f=new globalThis.Headers(r);for(const[m,h]of f.entries())o&&h==="undefined"||h===void 0?s.delete(m):s.set(m,h);return s};function Du(u,r,s){return Object.hasOwn(r,s)&&r[s]===void 0?[]:$s(u[s]??[],r[s]??[])}const fp=(u={},r={})=>({beforeRequest:Du(u,r,"beforeRequest"),beforeRetry:Du(u,r,"beforeRetry"),afterResponse:Du(u,r,"afterResponse"),beforeError:Du(u,r,"beforeError")}),Ob=(u,r)=>{const s=new URLSearchParams;for(const o of[u,r])if(o!==void 0)if(o instanceof URLSearchParams)for(const[f,m]of o.entries())s.append(f,m);else if(Array.isArray(o))for(const f of o){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");s.append(String(f[0]),String(f[1]))}else if(yl(o))for(const[f,m]of Object.entries(o))m!==void 0&&s.append(f,String(m));else{const f=new URLSearchParams(o);for(const[m,h]of f.entries())s.append(m,h)}return s},$s=(...u)=>{let r={},s={},o={},f;const m=[];for(const h of u)if(Array.isArray(h))Array.isArray(r)||(r=[]),r=[...r,...h];else if(yl(h)){for(let[x,g]of Object.entries(h)){if(x==="signal"&&g instanceof globalThis.AbortSignal){m.push(g);continue}if(x==="context"){if(g!=null&&(!yl(g)||Array.isArray(g)))throw new TypeError("The `context` option must be an object");r={...r,context:g==null?{}:{...r.context,...g}};continue}if(x==="searchParams"){g==null?f=void 0:f=f===void 0?g:Ob(f,g);continue}yl(g)&&x in r&&(g=$s(r[x],g)),r={...r,[x]:g}}yl(h.hooks)&&(o=fp(o,h.hooks),r.hooks=o),yl(h.headers)&&(s=cp(s,h.headers),r.headers=s)}return f!==void 0&&(r.searchParams=f),m.length>0&&(m.length===1?r.signal=m[0]:ip?r.signal=AbortSignal.any(m):r.signal=m.at(-1)),r},Nb=u=>up.includes(u)?u.toUpperCase():u,Db=["get","put","head","delete","options","trace"],Mb=[408,413,429,500,502,503,504],Ub=[413,429,503],Sh={limit:2,methods:Db,statusCodes:Mb,afterStatusCodes:Ub,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:u=>.3*2**(u-1)*1e3,jitter:void 0,retryOnTimeout:!1},qb=(u={})=>{if(typeof u=="number")return{...Sh,limit:u};if(u.methods&&!Array.isArray(u.methods))throw new Error("retry.methods must be an array");if(u.methods&&(u.methods=u.methods.map(s=>s.toLowerCase())),u.statusCodes&&!Array.isArray(u.statusCodes))throw new Error("retry.statusCodes must be an array");const r=Object.fromEntries(Object.entries(u).filter(([,s])=>s!==void 0));return{...Sh,...r}};class Ds extends Error{constructor(s){super(`Request timed out: ${s.method} ${s.url}`);Xe(this,"request");this.name="TimeoutError",this.request=s}}async function Hb(u,r,s,o){return new Promise((f,m)=>{const h=setTimeout(()=>{s&&s.abort(),m(new Ds(u))},o.timeout);o.fetch(u,r).then(f).catch(m).then(()=>{clearTimeout(h)})})}async function Lb(u,{signal:r}){return new Promise((s,o)=>{r&&(r.throwIfAborted(),r.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(m),o(r.reason)}const m=setTimeout(()=>{r==null||r.removeEventListener("abort",f),s()},u)})}const Bb=(u,r)=>{const s={};for(const o in r)Object.hasOwn(r,o)&&!(o in jb)&&!(o in Tb)&&(!(o in u)||o in Rb)&&(s[o]=r[o]);return s},Yb=u=>u===void 0?!1:Array.isArray(u)?u.length>0:u instanceof URLSearchParams?u.size>0:typeof u=="object"?Object.keys(u).length>0:typeof u=="string"?u.trim().length>0:!!u;function Gb(u){return u instanceof Ns||(u==null?void 0:u.name)===Ns.name}function Xb(u){return u instanceof Ds||(u==null?void 0:u.name)===Ds.name}var Zu,dp,Kt,Bt,ut,V,$a,Pt,gl,ie,Bu,mp,Ms,Yu,Ja,Us,hp,ii,Gu,qs;const ui=class ui{constructor(r,s={}){It(this,ie);Xe(this,"request");It(this,Kt);It(this,Bt,0);It(this,ut);It(this,V);It(this,$a);It(this,Pt);It(this,gl);var f,m,h;if(Zt(this,ut,r),Zt(this,V,{...s,headers:cp(U(this,ut).headers,s.headers),hooks:fp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Nb(s.method??U(this,ut).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:qb(s.retry),throwHttpErrors:s.throwHttpErrors??!0,timeout:s.timeout??1e4,fetch:s.fetch??globalThis.fetch.bind(globalThis),context:s.context??{}}),typeof U(this,ut)!="string"&&!(U(this,ut)instanceof URL||U(this,ut)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(U(this,V).prefixUrl&&typeof U(this,ut)=="string"){if(U(this,ut).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");U(this,V).prefixUrl.endsWith("/")||(U(this,V).prefixUrl+="/"),Zt(this,ut,U(this,V).prefixUrl+U(this,ut))}bb&&ip&&(Zt(this,Pt,U(this,V).signal??U(this,ut).signal),Zt(this,Kt,new globalThis.AbortController),U(this,V).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Kt).signal]):U(this,Kt).signal),xh&&(U(this,V).duplex="half"),U(this,V).json!==void 0&&(U(this,V).body=((m=(f=U(this,V)).stringifyJson)==null?void 0:m.call(f,U(this,V).json))??JSON.stringify(U(this,V).json),U(this,V).headers.set("content-type",U(this,V).headers.get("content-type")??"application/json"));const o=s.headers&&new globalThis.Headers(s.headers).has("content-type");if(U(this,ut)instanceof globalThis.Request&&(Sb&&U(this,V).body instanceof globalThis.FormData||U(this,V).body instanceof URLSearchParams)&&!o&&U(this,V).headers.delete("content-type"),this.request=new globalThis.Request(U(this,ut),U(this,V)),Yb(U(this,V).searchParams)){const g="?"+(typeof U(this,V).searchParams=="string"?U(this,V).searchParams.replace(/^\?/,""):new URLSearchParams(be(h=ui,Zu,dp).call(h,U(this,V).searchParams)).toString()),p=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,g);this.request=new globalThis.Request(p,U(this,V))}if(U(this,V).onUploadProgress){if(typeof U(this,V).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!xh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=be(this,ie,qs).call(this,this.request,U(this,V).body??void 0)}}static create(r,s){var h,x,g;const o=new ui(r,s),f=async()=>{var j,k,M,X,B,q,H,L,I,J,he,pe;if(typeof U(o,V).timeout=="number"&&U(o,V).timeout>js)throw new RangeError(`The \`timeout\` option cannot be greater than ${js}`);await Promise.resolve();let p=await be(j=o,ie,hp).call(j);for(const de of U(o,V).hooks.afterResponse){const W=be(k=o,ie,Ms).call(k,p.clone());let $;try{$=await de(o.request,be(M=o,ie,ii).call(M),W,{retryCount:U(o,Bt)})}catch(Pe){throw be(X=o,ie,Ja).call(X,W),be(B=o,ie,Ja).call(B,p),Pe}if($ instanceof op)throw be(q=o,ie,Ja).call(q,W),be(H=o,ie,Ja).call(H,p),new Rs($.options);const ue=$ instanceof globalThis.Response?$:p;W!==ue&&be(L=o,ie,Ja).call(L,W),p!==ue&&be(I=o,ie,Ja).call(I,p),p=ue}if(be(J=o,ie,Ms).call(J,p),!p.ok&&(typeof U(o,V).throwHttpErrors=="function"?U(o,V).throwHttpErrors(p.status):U(o,V).throwHttpErrors)){let de=new Ns(p,o.request,be(he=o,ie,ii).call(he));for(const W of U(o,V).hooks.beforeError)de=await W(de,{retryCount:U(o,Bt)});throw de}if(U(o,V).onDownloadProgress){if(typeof U(o,V).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!xb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const de=p.clone();return be(pe=o,ie,Ja).call(pe,p),zb(de,U(o,V).onDownloadProgress)}return p},m=be(h=o,ie,Us).call(h,f).finally(()=>{var j,k;const p=U(o,$a);be(j=o,ie,Yu).call(j,(p==null?void 0:p.body)??void 0),be(k=o,ie,Yu).call(k,o.request.body??void 0)});for(const[p,j]of Object.entries(Eb))p==="bytes"&&typeof((g=(x=globalThis.Response)==null?void 0:x.prototype)==null?void 0:g.bytes)!="function"||(m[p]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||j);const k=await m;if(p==="json"){if(k.status===204)return"";const M=await k.text();return M===""?"":s.parseJson?s.parseJson(M):JSON.parse(M)}return k[p]()});return m}};Zu=new WeakSet,dp=function(r){return r&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof URLSearchParams)?Object.fromEntries(Object.entries(r).filter(([,s])=>s!==void 0)):r},Kt=new WeakMap,Bt=new WeakMap,ut=new WeakMap,V=new WeakMap,$a=new WeakMap,Pt=new WeakMap,gl=new WeakMap,ie=new WeakSet,Bu=function(){const r=U(this,V).retry.delay(U(this,Bt));let s=r;U(this,V).retry.jitter===!0?s=Math.random()*r:typeof U(this,V).retry.jitter=="function"&&(s=U(this,V).retry.jitter(r),(!Number.isFinite(s)||s<0)&&(s=r));const o=U(this,V).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,s)},mp=async function(r){if(Pm(this,Bt)._++,U(this,Bt)>U(this,V).retry.limit)throw r;const s=r instanceof Error?r:new np(r);if(s instanceof Rs)return s.customDelay??be(this,ie,Bu).call(this);if(!U(this,V).retry.methods.includes(this.request.method.toLowerCase()))throw r;if(U(this,V).retry.shouldRetry!==void 0){const o=await U(this,V).retry.shouldRetry({error:s,retryCount:U(this,Bt)});if(o===!1)throw r;if(o===!0)return be(this,ie,Bu).call(this)}if(Xb(r)&&!U(this,V).retry.retryOnTimeout)throw r;if(Gb(r)){if(!U(this,V).retry.statusCodes.includes(r.response.status))throw r;const o=r.response.headers.get("Retry-After")??r.response.headers.get("RateLimit-Reset")??r.response.headers.get("X-RateLimit-Retry-After")??r.response.headers.get("X-RateLimit-Reset")??r.response.headers.get("X-Rate-Limit-Reset");if(o&&U(this,V).retry.afterStatusCodes.includes(r.response.status)){let f=Number(o)*1e3;Number.isNaN(f)?f=Date.parse(o)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const m=U(this,V).retry.maxRetryAfter??f;return f<m?f:m}if(r.response.status===413)throw r}return be(this,ie,Bu).call(this)},Ms=function(r){return U(this,V).parseJson&&(r.json=async()=>U(this,V).parseJson(await r.text())),r},Yu=function(r){r&&r.cancel().catch(()=>{})},Ja=function(r){be(this,ie,Yu).call(this,r.body??void 0)},Us=async function(r){try{return await r()}catch(s){const o=Math.min(await be(this,ie,mp).call(this,s),js);if(U(this,Bt)<1)throw s;if(await Lb(o,U(this,Pt)?{signal:U(this,Pt)}:{}),s instanceof Rs&&s.customRequest){const f=U(this,V).signal?new globalThis.Request(s.customRequest,{signal:U(this,V).signal}):new globalThis.Request(s.customRequest);be(this,ie,Gu).call(this,f)}for(const f of U(this,V).hooks.beforeRetry){const m=await f({request:this.request,options:be(this,ie,ii).call(this),error:s,retryCount:U(this,Bt)});if(m instanceof globalThis.Request){be(this,ie,Gu).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===rp)return}return be(this,ie,Us).call(this,r)}},hp=async function(){var s;(s=U(this,Kt))!=null&&s.signal.aborted&&(Zt(this,Kt,new globalThis.AbortController),U(this,V).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Kt).signal]):U(this,Kt).signal,this.request=new globalThis.Request(this.request,{signal:U(this,V).signal}));for(const o of U(this,V).hooks.beforeRequest){const f=await o(this.request,be(this,ie,ii).call(this),{retryCount:U(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){be(this,ie,Gu).call(this,f);break}}const r=Bb(this.request,U(this,V));return Zt(this,$a,this.request),this.request=U(this,$a).clone(),U(this,V).timeout===!1?U(this,V).fetch(U(this,$a),r):Hb(U(this,$a),r,U(this,Kt),U(this,V))},ii=function(){if(!U(this,gl)){const{hooks:r,...s}=U(this,V);Zt(this,gl,Object.freeze(s))}return U(this,gl)},Gu=function(r){Zt(this,gl,void 0),this.request=be(this,ie,qs).call(this,r)},qs=function(r,s){return!U(this,V).onUploadProgress||!r.body?r:Cb(r,U(this,V).onUploadProgress,s??U(this,V).body??void 0)},It(ui,Zu);let Qu=ui;/*! MIT License © Sindre Sorhus */const Hs=u=>{const r=(s,o)=>Qu.create(s,Nu(u,o));for(const s of up)r[s]=(o,f)=>Qu.create(o,Nu(u,f,{method:s}));return r.create=s=>Hs(Nu(s)),r.extend=s=>(typeof s=="function"&&(s=s(u??{})),Hs(Nu(u,s))),r.stop=rp,r.retry=wb,r},Eh=Hs();let Mu=null;const Xu=Eh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[u=>{const r=xa.getState().accessToken;r&&u.headers.set("Authorization",`Bearer ${r}`)}],afterResponse:[async(u,r,s)=>{if(s.status===401&&!u.headers.has("X-Retry-After-Refresh")){Mu||(Mu=xa.getState().refresh().finally(()=>{Mu=null}));try{await Mu}catch{throw s}const o=xa.getState().accessToken;return o&&u.headers.set("Authorization",`Bearer ${o}`),u.headers.set("X-Retry-After-Refresh","1"),Eh(u,r)}}]}}),Vb=3e4;function Qb(u){if(u.link)return u.link;const r=(u.title+" "+u.body).match(/task\s*#?(\d+)/i);if(r)return`/tasks/${r[1]}`;const s=(u.title+" "+u.body).match(/worker\s+(\S+)/i);return s?`/workers/${s[1]}`:null}function pp(){const u=Fa(),[r,s]=v.useState([]),[o,f]=v.useState(0),[m,h]=v.useState(!1),[x,g]=v.useState(!1),p=v.useRef(null),{t:j}=ta(),k=v.useRef(async()=>{try{g(!0);const q=(await Xu.get("web/notifications",{searchParams:{limit:"20"}}).json()).data,H=q.filter(L=>!L.isRead).length;s(L=>L.length===q.length&&L.every((I,J)=>I.id===q[J].id&&I.isRead===q[J].isRead)?L:q),f(L=>L===H?L:H)}catch{}finally{g(!1)}});v.useEffect(()=>{k.current();const B=setInterval(()=>k.current(),Vb);return()=>clearInterval(B)},[]),v.useEffect(()=>{function B(q){p.current&&!p.current.contains(q.target)&&h(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);async function M(B){try{await Xu.post(`web/notifications/${B}/read`),s(q=>q.map(H=>H.id===B?{...H,isRead:!0}:H)),f(q=>Math.max(0,q-1))}catch{}}async function X(){try{await Xu.post("web/notifications/read-all"),s(B=>B.map(q=>({...q,isRead:!0}))),f(0)}catch{}}return _.jsxs("div",{className:"relative",ref:p,children:[_.jsxs("button",{type:"button",onClick:()=>h(B=>!B),"aria-label":j("common.notifications"),className:"relative inline-flex items-center justify-center rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]",children:[_.jsx(Bv,{size:16}),o>0&&_.jsx("span",{className:"absolute right-0 top-0 flex h-3 min-w-3 items-center justify-center rounded-full bg-[var(--destructive)] px-0.5 text-[8px] font-semibold leading-none text-white",children:o})]}),m&&_.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-[min(320px,calc(100vw-2rem))] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[_.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[_.jsx("span",{className:"text-sm font-semibold",children:j("common.notifications")}),o>0&&_.jsxs("button",{type:"button",onClick:X,"aria-label":j("common.mark_all_read"),className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[_.jsx(Yv,{className:"h-3.5 w-3.5"}),j("common.mark_all_read")]})]}),_.jsx("div",{className:"max-h-80 overflow-y-auto",children:x&&r.length===0?_.jsx("div",{className:"flex justify-center py-8",children:_.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):r.length===0?_.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[_.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),_.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:j("common.no_notifications")})]}):r.map(B=>{const q=Qb(B);return _.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${q?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${B.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{q&&(B.isRead||M(B.id),h(!1),u(q))},children:[_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsx("p",{className:"text-sm font-medium",children:B.title}),_.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:B.body}),_.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(B.createdAt).toLocaleString()})]}),!B.isRead&&_.jsx("button",{type:"button",onClick:H=>{H.stopPropagation(),M(B.id)},"aria-label":j("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:_.jsx(Gv,{className:"h-3.5 w-3.5"})})]},B.id)})})]})]})}function Zb(u){return{tasks:u.tasks.map(r=>({type:"task",id:r.id,title:`#${r.id} ${r.description}`,subtitle:`${r.status} · ${r.project_key}`})),workers:(u.workers??[]).map(r=>({type:"worker",id:r.id,title:r.name,subtitle:`${r.hostname} · ${r.status}`})),projects:u.projects.map(r=>({type:"project",id:r.key,title:r.name,subtitle:r.repository}))}}const Kb=300,kh={tasks:nb,workers:Fh,projects:Jv},Jb={tasks:"tasks",workers:"workers",projects:"projects"};function _p({renderTrigger:u}={}){const[r,s]=v.useState(""),[o,f]=v.useState({tasks:[],workers:[],projects:[]}),[m,h]=v.useState(!1),[x,g]=v.useState(!1),[p,j]=v.useState(0),k=v.useRef(null),M=v.useRef(null),X=v.useRef(void 0),B=v.useRef(void 0),q=Fa(),{t:H}=ta(),L=v.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),I=v.useCallback(async $=>{var Pe;if(!$.trim()){f({tasks:[],workers:[],projects:[]});return}(Pe=B.current)==null||Pe.abort();const ue=new AbortController;B.current=ue;try{h(!0);const Je=await Xu.get("web/search",{searchParams:{q:$},signal:ue.signal}).json();f(Zb(Je)),j(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{ue.signal.aborted||h(!1)}},[]);v.useEffect(()=>(X.current&&clearTimeout(X.current),X.current=setTimeout(()=>I(r),Kb),()=>{X.current&&clearTimeout(X.current)}),[r,I]),v.useEffect(()=>{function $(ue){ue.key==="/"&&!x&&!(ue.target instanceof HTMLInputElement||ue.target instanceof HTMLTextAreaElement)&&(ue.preventDefault(),g(!0)),ue.key==="Escape"&&x&&(ue.preventDefault(),J())}return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[x]),v.useEffect(()=>{x&&setTimeout(()=>{var $;return($=M.current)==null?void 0:$.focus()},50)},[x]);function J(){g(!1),s(""),f({tasks:[],workers:[],projects:[]}),j(0)}function he($){switch(J(),$.type){case"task":q(`/tasks/${$.id}`);break;case"worker":q(`/workers/${$.id}`);break;case"project":q(`/projects/${$.id}`);break}}function pe($){$.key==="ArrowDown"?($.preventDefault(),j(ue=>Math.min(ue+1,L.length-1))):$.key==="ArrowUp"?($.preventDefault(),j(ue=>Math.max(ue-1,0))):$.key==="Enter"&&L[p]&&($.preventDefault(),he(L[p]))}const de=L.length>0;let W=0;return _.jsxs(_.Fragment,{children:[u?u(()=>g(!0)):_.jsxs("button",{type:"button",onClick:()=>g(!0),className:"flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:[_.jsx(Wh,{className:"h-3.5 w-3.5"}),_.jsx("span",{children:H("common.search_placeholder")}),_.jsx("kbd",{className:"ml-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[11px] text-[var(--text-muted)]",children:"/"})]}),x&&_.jsx("div",{ref:k,className:"fixed inset-0 z-[100] flex items-start justify-center pt-4 md:pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:$=>{$.target===k.current&&J()},children:_.jsxs("div",{className:"mx-3 w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl sm:mx-4 md:mx-0",children:[_.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[_.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),_.jsx("input",{ref:M,type:"text",placeholder:H("common.search_input_placeholder"),value:r,onChange:$=>s($.target.value),onKeyDown:pe,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),m&&_.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),_.jsx("div",{className:"max-h-[50vh] overflow-y-auto sm:max-h-[60vh] md:max-h-[400px]",children:r.trim()&&!de&&!m?_.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:H("common.no_search_results",{query:r})}):Object.keys(kh).map($=>{const ue=o[$];if(ue.length===0)return null;const Pe=kh[$],Je=W;return W+=ue.length,_.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[_.jsx(Pe,{className:"h-3 w-3"}),_.jsx("span",{className:"text-[11px] lowercase tracking-wider",children:Jb[$]})]}),ue.map((qe,At)=>{const rt=Je+At,De=rt===p;return _.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${De?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>he(qe),onMouseEnter:()=>j(rt),children:[_.jsx("span",{className:`text-xs ${De?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:De?">":" "}),_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsx("p",{className:"truncate text-sm",children:qe.title}),qe.subtitle&&_.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",children:qe.subtitle})]})]},`${qe.type}-${qe.id}`)})]},$)})}),_.jsxs("div",{className:"hidden items-center gap-4 border-t border-[var(--border)] px-4 py-2 md:flex",children:[_.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↑↓"})," ",H("common.navigate_hint")]}),_.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↵"})," ",H("common.select_hint")]}),_.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"esc"})," ",H("common.close_hint")]})]})]})})]})}const $b={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"},wh="confirm-dialog-title";function Th(u){return Array.from(u.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))}function Wb({isOpen:u,onClose:r,onConfirm:s,title:o,message:f,confirmVariant:m="danger",isLoading:h,...x}){const{t:g}=ta(),p=x.confirmLabel??g("common.confirm"),j=x.cancelLabel??g("common.cancel"),k=v.useRef(null),M=v.useRef(null),X=$b[m];v.useEffect(()=>{if(!u)return;M.current=document.activeElement;const q=requestAnimationFrame(()=>{if(k.current){const H=Th(k.current);H.length>0&&H[0].focus()}});return()=>{var H;cancelAnimationFrame(q),(H=M.current)==null||H.focus()}},[u]);const B=v.useCallback(q=>{if(q.key==="Tab"&&k.current){const H=Th(k.current);if(H.length===0)return;const L=H[0],I=H[H.length-1];q.shiftKey?document.activeElement===L&&(q.preventDefault(),I.focus()):document.activeElement===I&&(q.preventDefault(),L.focus())}},[]);return u?_.jsx("div",{onClick:r,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"max(1rem, 10vh)",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:_.jsxs("div",{ref:k,role:"dialog","aria-modal":"true","aria-labelledby":wh,onClick:q=>q.stopPropagation(),onKeyDown:B,style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem"},children:[_.jsx("div",{style:{marginBottom:"1.25rem"},children:_.jsxs("div",{id:wh,style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[_.jsx(Ih,{style:{width:"1rem",height:"1rem"}}),o]})}),_.jsx("div",{style:{marginBottom:"1.25rem"},children:_.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f})}),_.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[_.jsx("button",{type:"button",onClick:r,disabled:h,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",cursor:h?"not-allowed":"pointer",opacity:h?.7:1,transition:"color 0.15s, border-color 0.15s"},children:j}),_.jsx("button",{type:"button",onClick:s,disabled:h,style:{flex:1,padding:"0.5rem",backgroundColor:X,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:h?"not-allowed":"pointer",opacity:h?.7:1},children:h?g("common.processing"):p})]})]})}):null}const yp=v.createContext({setActions:()=>{}});function n1(u){const{setActions:r}=v.useContext(yp);v.useEffect(()=>(r(u),()=>r(null)),[u,r])}const gp=v.createContext({setSubtitle:()=>{}});function i1(u){const{setSubtitle:r}=v.useContext(gp);v.useEffect(()=>(r(u),()=>r(null)),[u,r])}const Fb=[{to:"/home",label:"terminal",icon:Js},{to:"/tasks",label:"tasks",icon:$h},{to:"/dashboard",label:"dashboard",icon:Jh},{to:"/workers",label:"workers",icon:Fh},{to:"/projects",label:"projects",icon:$v},{to:"/access-tokens",label:"access_tokens",icon:Fv}],Ib=[{to:"/docs/cli",label:"cli",icon:Js},{to:"/docs/api",label:"api",icon:Kv},{to:"/docs/skill",label:"skill",icon:lb}],Pb=[{to:"/admin",label:"admin",icon:ab}],e0=[{to:"/home",label:"terminal",icon:Js},{to:"/tasks",label:"tasks",icon:$h},{to:"/dashboard",label:"dashboard",icon:Jh}],Uu={"/home":{title:"common.breadcrumb_terminal",subtitle:"common.breadcrumb_terminal_sub"},"/dashboard":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/workers":{title:"common.breadcrumb_workers",subtitle:"common.breadcrumb_workers_sub"},"/projects":{title:"common.breadcrumb_projects",subtitle:"common.breadcrumb_projects_sub"},"/admin":{title:"common.breadcrumb_admin",subtitle:"common.breadcrumb_admin_sub"},"/profile":{title:"common.breadcrumb_profile",subtitle:"common.breadcrumb_profile_sub"},"/access-tokens":{title:"common.breadcrumb_access_tokens",subtitle:"common.breadcrumb_access_tokens_sub"},"/docs":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_sub"},"/docs/cli":{title:"common.breadcrumb_docs_cli",subtitle:"common.breadcrumb_docs_cli_sub"},"/docs/api":{title:"common.breadcrumb_docs_api",subtitle:"common.breadcrumb_docs_api_sub"},"/docs/skill":{title:"common.breadcrumb_docs_skill",subtitle:"common.breadcrumb_docs_skill_sub"}};function t0(u){const{t:r}=ta();if(Uu[u]){const o=Uu[u];return{title:r(o.title),subtitle:r(o.subtitle)}}const s="/"+u.split("/").filter(Boolean)[0];if(Uu[s]){const o=Uu[s],f=u.split("/").filter(Boolean).slice(1).join(" / ");return{title:r(o.title),subtitle:f||r(o.subtitle)}}return{title:u.slice(1).replace(/\//g," // ")||"home"}}function a0(u,r){return u==="/home"?r==="/home":u==="/dashboard"?r==="/dashboard":r.startsWith(u)}function l0(){const u=yt(),{t:r}=ta(),s={terminal:r("terminal_home.title"),dashboard:r("dashboard.title"),tasks:r("tasks.title"),workers:r("workers.title")};return _.jsxs("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)] md:hidden",style:{height:60,paddingTop:8,paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:[e0.map(({to:o,label:f,icon:m})=>{const h=a0(o,u.pathname);return _.jsxs(Ks,{to:o,className:"flex flex-1 flex-col items-center gap-1",children:[_.jsx(m,{size:18,className:h?"text-[var(--accent)]":"text-[var(--text-muted)]"}),_.jsx("span",{className:`text-[11px] lowercase ${h?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),_.jsx(_p,{renderTrigger:o=>_.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[_.jsx(Wh,{size:18,className:"text-[var(--text-muted)]"}),_.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:r("common.search_placeholder")})]})})]})}function n0(){const u=Fa(),{t:r}=ta();return _.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:"calc(56px + env(safe-area-inset-top, 0px))",minHeight:"calc(56px + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)"},children:[_.jsxs("button",{onClick:()=>u("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[_.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",children:_.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),_.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",children:r("common.overlord")})]}),_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx("button",{onClick:()=>u("/profile"),className:"p-2 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]","aria-label":r("common.profile"),children:_.jsx(ub,{size:18})}),_.jsx(pp,{}),_.jsx(lp,{})]})]})}function As({label:u,items:r,collapsed:s}){return _.jsxs("div",{className:"mt-4 first:mt-0",children:[!s&&_.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:u}),r.map(({to:o,label:f,icon:m})=>_.jsx(Ks,{to:o,className:({isActive:h})=>`flex items-center text-sm lowercase transition-colors ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${h?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:h})=>_.jsxs(_.Fragment,{children:[_.jsx(m,{size:14,style:{flexShrink:0}}),!s&&_.jsx("span",{children:h?`> ${f}`:` ${f}`})]})},o))]})}function i0(){const{user:u,logout:r}=xa(),s=Fa(),[o,f]=v.useState(!1),m=fb(),{t:h}=ta(),{sidebarCollapsed:x,toggleSidebar:g}=mb();function p(){r(),s("/login")}return _.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)] transition-[width,min-width] duration-300 overflow-hidden",style:{width:x?56:240,minWidth:x?56:240,backgroundColor:"var(--bg-card)"},children:[_.jsx("div",{className:"flex items-center px-5",style:{height:48},children:_.jsxs("button",{onClick:()=>s("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[_.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{flexShrink:0},children:_.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),!x&&_.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)"},children:h("common.overlord")})]})}),_.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[_.jsx(As,{label:h("common.navigation"),items:Fb,collapsed:x}),_.jsx(As,{label:h("common.docs_section"),items:Ib,collapsed:x}),m&&_.jsx(As,{label:h("common.admin_section"),items:Pb,collapsed:x})]}),_.jsx("div",{className:`px-3 py-1 ${x?"flex justify-center":""}`,children:_.jsx("button",{onClick:g,className:"flex items-center justify-center w-full py-1.5 rounded-[4px] text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)] hover:bg-[var(--accent)]/5","aria-label":x?"expand sidebar":"collapse sidebar",children:x?_.jsx(Vv,{size:14}):_.jsx(Xv,{size:14})})}),_.jsx("div",{className:"border-t border-[var(--border)] p-3",children:_.jsxs("div",{className:`flex items-center py-2 ${x?"justify-center":"gap-3 px-3"}`,children:[_.jsx("button",{onClick:()=>s("/profile"),className:"flex h-7 w-7 items-center justify-center text-xs font-bold text-black transition-opacity hover:opacity-80",style:{backgroundColor:"var(--accent)",borderRadius:4,flexShrink:0},title:h("common.profile"),children:((u==null?void 0:u.username)??"u")[0].toUpperCase()}),!x&&_.jsxs(_.Fragment,{children:[_.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:h("common.profile"),children:[_.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(u==null?void 0:u.username)??"user"}),_.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(u==null?void 0:u.role)??"user"})]}),_.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":h("common.log_out"),children:_.jsx(Pv,{size:14})})]})]})}),_.jsx(Wb,{isOpen:o,onClose:()=>f(!1),onConfirm:p,title:h("common.logout_title"),message:h("common.logout_message"),confirmLabel:h("common.logout"),confirmVariant:"warning"})]})}function u0({headerActions:u,subtitleOverride:r}){const s=yt(),{title:o,subtitle:f}=t0(s.pathname),m=r??f;return _.jsxs("header",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5",style:{height:48,minHeight:48,backgroundColor:"var(--bg-card)"},children:[_.jsxs("div",{className:"text-sm lowercase",children:[_.jsx("span",{style:{color:"var(--text-primary)"},children:o}),m&&_.jsxs("span",{style:{color:"var(--text-muted)"},children:[" ","// ",m]})]}),_.jsxs("div",{className:"flex items-center gap-3",children:[u,_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(_p,{}),_.jsx(pp,{}),_.jsx(lp,{})]})]})]})}function r0(){const[u,r]=v.useState(null),[s,o]=v.useState(null),m=yt().pathname==="/home";return v.useEffect(()=>pb.getState().init(),[]),_.jsxs("div",{className:"flex font-mono",style:{height:"100dvh",minHeight:"100vh"},children:[_.jsx(i0,{}),_.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[_.jsx(n0,{}),_.jsx(u0,{headerActions:u,subtitleOverride:s}),_.jsx("main",{className:m?"flex-1 overflow-hidden bg-[var(--bg-primary)] pb-[calc(60px+env(safe-area-inset-bottom,0px))] md:pb-0":"flex-1 overflow-auto bg-[var(--bg-primary)] p-4 pb-[calc(60px+env(safe-area-inset-bottom,0px)+0.5rem)] md:p-6 md:pb-6",children:_.jsx(yp.Provider,{value:{setActions:r},children:_.jsx(gp.Provider,{value:{setSubtitle:o},children:_.jsx(tv,{})})})}),_.jsx(l0,{})]})]})}function Rh(u){var s;const r=(s=u.state)==null?void 0:s.from;return r?{from:r}:{from:{pathname:u.pathname,search:u.search}}}function li({children:u,requireAdmin:r=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:m}=xa(),h=yt();if(m)return _.jsx("div",{className:"flex h-screen items-center justify-center",children:_.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})});if(!s)return _.jsx(ni,{to:"/login",state:Rh(h),replace:!0});if(f){const x=Rh(h);return h.pathname!=="/totp-setup"&&h.pathname!=="/bind"?_.jsx(ni,{to:"/totp-setup",state:x,replace:!0}):h.pathname==="/bind"?(sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(x.from)),_.jsx(ni,{to:"/totp-setup",state:x,replace:!0})):_.jsx(_.Fragment,{children:u})}return r&&(o==null?void 0:o.role)!==Ph.ADMIN?_.jsx(ni,{to:"/home",replace:!0}):_.jsx(_.Fragment,{children:u})}function o0({children:u}){const{theme:r,resolved:s,setResolved:o}=ap();return v.useEffect(()=>{if(r!=="system"){o(r);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const m=h=>o(h.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[r,o]),v.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),_.jsx(_.Fragment,{children:u})}class s0 extends v.Component{constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}render(){var r;return this.state.hasError?_.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8 font-mono",children:[_.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Lu("common.runtime_error")}),_.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((r=this.state.error)==null?void 0:r.message)||Lu("common.an_unexpected_error_occurred")}),_.jsxs("button",{onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[_.jsx(tb,{className:"h-3.5 w-3.5"}),Lu("common.reload")]})]}):this.props.children}}function c0({isOpen:u}){const r=Fa(),{logout:s,setSessionExpired:o}=xa(),{t:f}=ta();function m(){s(),o(!1),r("/login")}return u?_.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[_.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),_.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:_.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[_.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:_.jsx(Iv,{className:"h-7 w-7 text-[var(--warning)]"})}),_.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),_.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),_.jsx("button",{type:"button",className:"w-full rounded-[4px] bg-[var(--accent)] px-3 py-2.5 text-xs font-medium text-black hover:opacity-90 transition-opacity",onClick:m,children:f("auth.go_to_login")})]})})]}):null}const jh=5;let ba=[];const Ls=new Set;function vp(){Ls.forEach(u=>u())}function f0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(u,r,s=4e3){const o=f0();return ba=[...ba,{id:o,variant:u,message:r,duration:s}],ba.length>jh&&(ba=ba.slice(ba.length-jh)),vp(),o}Wa.success=(u,r)=>Wa("success",u,r);Wa.error=(u,r)=>Wa("error",u,r);Wa.warning=(u,r)=>Wa("warning",u,r);Wa.info=(u,r)=>Wa("info",u,r);function d0(u){ba=ba.filter(r=>r.id!==u),vp()}function m0(){const[,u]=v.useState(0);return v.useEffect(()=>{const r=()=>u(s=>s+1);return Ls.add(r),()=>{Ls.delete(r)}},[]),ba}const h0={success:{icon:Qv,borderColor:"var(--accent)"},error:{icon:Zv,borderColor:"var(--destructive)"},warning:{icon:Ih,borderColor:"var(--warning)"},info:{icon:Wv,borderColor:"var(--info)"}};function p0({item:u}){const r=h0[u.variant],s=r.icon,{t:o}=ta(),f=v.useCallback(()=>d0(u.id),[u.id]);return v.useEffect(()=>{if(!u.duration)return;const m=setTimeout(f,u.duration);return()=>clearTimeout(m)},[u.duration,f]),_.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${r.borderColor}`},role:"alert",children:[_.jsx(s,{className:"h-4 w-4 shrink-0",style:{color:r.borderColor}}),_.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:u.message}),_.jsx("button",{onClick:f,className:"shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]","aria-label":o("common.dismiss_notification"),children:_.jsx(rb,{className:"h-3.5 w-3.5"})})]})}function _0(){const u=m0();return u.length===0?null:_.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-[9999] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2",children:u.map(r=>_.jsx("div",{className:"pointer-events-auto",children:_.jsx(p0,{item:r})},r.id))})}const y0=v.lazy(()=>Ce(()=>import("./LandingPage-ZuEWmIZL.js"),__vite__mapDeps([0,1,2,3,4,5]))),g0=v.lazy(()=>Ce(()=>import("./LoginPage-ZN3nJzEX.js"),[])),v0=v.lazy(()=>Ce(()=>import("./TotpSetupPage-lw418pBO.js"),[])),b0=v.lazy(()=>Ce(()=>import("./NotFoundPage-DkoNgmQ4.js"),[])),x0=v.lazy(()=>Ce(()=>import("./HomePage-CWYmPB1e.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),S0=v.lazy(()=>Ce(()=>import("./TerminalHomePage-D3Z-uJUx.js"),__vite__mapDeps([15,16,17,18,10,11,19,8,12,14,20,2,21]))),E0=v.lazy(()=>Ce(()=>import("./TaskListPage-DMYTWhw_.js"),__vite__mapDeps([22,16,7,8,12,13,19,5,23,9,20]))),k0=v.lazy(()=>Ce(()=>import("./TaskDetailPage-jyeOPtsb.js"),__vite__mapDeps([24,16,17,18,12,19,8,25,26,27,28]))),w0=v.lazy(()=>Ce(()=>import("./WorkerListPage-Dd6P84ye.js"),__vite__mapDeps([29,8,30,31,32,33,21,5,28,19,23,9,14,20]))),T0=v.lazy(()=>Ce(()=>import("./WorkerDetailPage-CF7FWzQn.js"),__vite__mapDeps([34,12,8,35,30,14,36,25]))),R0=v.lazy(()=>Ce(()=>import("./WorkerSetupGuidePage-dRLxcC1D.js"),__vite__mapDeps([31,32,33,21]))),j0=v.lazy(()=>Ce(()=>import("./ProjectListPage-CtGknAYM.js"),__vite__mapDeps([37,19,23,9,12,14,20]))),A0=v.lazy(()=>Ce(()=>import("./ProjectDetailPage-BbOgUrnR.js"),__vite__mapDeps([38,39,19,12,8,35,14,40,36,20]))),z0=v.lazy(()=>Ce(()=>import("./EditProjectPage-DjGCEool.js"),__vite__mapDeps([41,19,39,20]))),C0=v.lazy(()=>Ce(()=>import("./PipelineEditorPage-CtUnQDef.js"),__vite__mapDeps([42,19,13]))),O0=v.lazy(()=>Ce(()=>import("./ProfilePage-B0CWDm55.js"),__vite__mapDeps([43,44,35,14]))),N0=v.lazy(()=>Ce(()=>import("./BindPlatformPage-DYNztOnJ.js"),[])),D0=v.lazy(()=>Ce(()=>import("./AccessTokensPage-DcOzH6vQ.js"),__vite__mapDeps([45,19,23,9,12,14,20,5,36]))),M0=v.lazy(()=>Ce(()=>import("./CliReferencePage-DyfbBqGH.js"),__vite__mapDeps([46,47,5,20]))),U0=v.lazy(()=>Ce(()=>import("./ApiReferencePage-Cn1nZmYJ.js"),__vite__mapDeps([48,47,5,20]))),q0=v.lazy(()=>Ce(()=>import("./SkillPage-CeTlmMdA.js"),__vite__mapDeps([49,27,5]))),H0=v.lazy(()=>Ce(()=>import("./AdminPage-DjzkTi-Z.js"),__vite__mapDeps([50,4,3,51,33]))),L0=v.lazy(()=>Ce(()=>import("./DeveloperManage-DgwZWjLh.js"),__vite__mapDeps([52,19,44,23,9,14,8,20,4,40,26]))),B0=v.lazy(()=>Ce(()=>import("./BotManage-B4YAKqEk.js"),__vite__mapDeps([53,19,36,20,23,9,14,8,3,40]))),Y0=v.lazy(()=>Ce(()=>import("./TokenManage-NYgoI8yJ.js"),__vite__mapDeps([54,32,5,27,23,9,14,8,20]))),G0=v.lazy(()=>Ce(()=>import("./AuditLogPage-CkE1EJZh.js"),__vite__mapDeps([55,19,23,9,51,11]))),X0=v.lazy(()=>Ce(()=>import("./SettingsPage-CXDXq71S.js"),[]));function V0(){return _.jsx("div",{className:"flex h-full items-center justify-center",children:_.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function Q0(){const u=xa(r=>r.sessionExpired);return _.jsxs(o0,{children:[_.jsx(_0,{}),_.jsx(s0,{children:_.jsxs(jv,{children:[_.jsx(c0,{isOpen:u}),_.jsx(v.Suspense,{fallback:_.jsx(V0,{}),children:_.jsxs(lv,{children:[_.jsx(xe,{path:"/",element:_.jsx(y0,{})}),_.jsx(xe,{path:"/login",element:_.jsx(g0,{})}),_.jsx(xe,{path:"/totp-setup",element:_.jsx(li,{children:_.jsx(v0,{})})}),_.jsx(xe,{path:"/bind",element:_.jsx(li,{children:_.jsx(N0,{})})}),_.jsxs(xe,{element:_.jsx(li,{children:_.jsx(r0,{})}),children:[_.jsx(xe,{path:"/home",element:_.jsx(S0,{})}),_.jsx(xe,{path:"/dashboard",element:_.jsx(x0,{})}),_.jsx(xe,{path:"/tasks",element:_.jsx(E0,{})}),_.jsx(xe,{path:"/tasks/:id",element:_.jsx(k0,{})}),_.jsx(xe,{path:"/workers",element:_.jsx(w0,{})}),_.jsx(xe,{path:"/workers/setup",element:_.jsx(li,{requireAdmin:!0,children:_.jsx(R0,{})})}),_.jsx(xe,{path:"/workers/:id",element:_.jsx(T0,{})}),_.jsx(xe,{path:"/projects",element:_.jsx(j0,{})}),_.jsx(xe,{path:"/projects/:key",element:_.jsx(A0,{})}),_.jsx(xe,{path:"/projects/:key/edit",element:_.jsx(z0,{})}),_.jsx(xe,{path:"/projects/:key/pipeline",element:_.jsx(C0,{})}),_.jsx(xe,{path:"/profile",element:_.jsx(O0,{})}),_.jsx(xe,{path:"/access-tokens",element:_.jsx(D0,{})}),_.jsx(xe,{path:"/docs/cli",element:_.jsx(M0,{})}),_.jsx(xe,{path:"/docs/api",element:_.jsx(U0,{})}),_.jsx(xe,{path:"/docs/skill",element:_.jsx(q0,{})}),_.jsxs(xe,{path:"/admin",element:_.jsx(li,{requireAdmin:!0,children:_.jsx(H0,{})}),children:[_.jsx(xe,{index:!0,element:_.jsx(ni,{to:"developers",replace:!0})}),_.jsx(xe,{path:"developers",element:_.jsx(L0,{})}),_.jsx(xe,{path:"bots",element:_.jsx(B0,{})}),_.jsx(xe,{path:"tokens",element:_.jsx(Y0,{})}),_.jsx(xe,{path:"audit-logs",element:_.jsx(G0,{})}),_.jsx(xe,{path:"settings",element:_.jsx(X0,{})})]})]}),_.jsx(xe,{path:"*",element:_.jsx(b0,{})})]})})]})})]})}xa.getState().initialize();tg.createRoot(document.getElementById("root")).render(_.jsx(v.StrictMode,{children:_.jsx(Q0,{})}));export{I0 as A,P0 as B,Gv as C,Ph as D,Ks as E,t1 as F,e1 as G,Ns as H,Zv as I,a1 as J,Fv as K,Qh as L,ni as N,tv as O,F0 as P,ju as R,Fh as S,lp as T,W0 as W,rb as X,ta as a,Js as b,je as c,ab as d,Fa as e,yt as f,Xu as g,fb as h,pb as i,_ as j,Wu as k,$0 as l,i1 as m,n1 as n,Wh as o,$h as p,l1 as q,v as r,Wb as s,Wa as t,xa as u,K0 as v,Qv as w,Ih as x,tb as y,J0 as z};