@overlordai/server 1.0.130 → 1.0.131

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 (84) hide show
  1. package/package.json +4 -4
  2. package/public/assets/{AccessTokensPage-CZ_Yavhf.js → AccessTokensPage-B1G2-mUi.js} +1 -1
  3. package/public/assets/{AdminPage-BlGfVUEg.js → AdminPage-BfQmSXQa.js} +1 -1
  4. package/public/assets/{AgentCliPage-CQpk2Yo_.js → AgentCliPage-D7QPKJpY.js} +1 -1
  5. package/public/assets/{ApiReferencePage-DsFA13KQ.js → ApiReferencePage-DIYFxzq0.js} +1 -1
  6. package/public/assets/{ArchitecturePage-DDc-vReK.js → ArchitecturePage-DZqBL3l7.js} +1 -1
  7. package/public/assets/{AuditLogPage-BLTNLR9x.js → AuditLogPage-BGxaXcKz.js} +1 -1
  8. package/public/assets/{BindPlatformPage-DLQdiRFL.js → BindPlatformPage-rtjDTUn-.js} +1 -1
  9. package/public/assets/{BotIntegrationPage-D6-XQG0r.js → BotIntegrationPage-DhApmTBA.js} +1 -1
  10. package/public/assets/{BotManage-DRTJDHW6.js → BotManage-Db0KRZ8H.js} +1 -1
  11. package/public/assets/{BotSetupPage-ByjmKjXY.js → BotSetupPage-BKSV06rk.js} +1 -1
  12. package/public/assets/{ChangelogPage-n7yRBO_5.js → ChangelogPage-C3gSpp3g.js} +1 -1
  13. package/public/assets/{CliReferencePage-B6gTsb4v.js → CliReferencePage-ejyySCuq.js} +1 -1
  14. package/public/assets/{DeploymentPage-CWhXb1UF.js → DeploymentPage-Cq1gui8d.js} +1 -1
  15. package/public/assets/{DevWorkflowPage-nTHhaHVz.js → DevWorkflowPage-CqU3wVnM.js} +1 -1
  16. package/public/assets/{DeveloperManage-APQbY_-q.js → DeveloperManage-CpSvUtkr.js} +1 -1
  17. package/public/assets/{DeveloperSetupPage-Bq-eKaT0.js → DeveloperSetupPage-bXuJM2eH.js} +1 -1
  18. package/public/assets/{DocsIndexPage-CzA83ol_.js → DocsIndexPage-D_GPFyTY.js} +1 -1
  19. package/public/assets/{DocsLayout-Du6H0AOl.js → DocsLayout-BY6F_ywj.js} +1 -1
  20. package/public/assets/{DocsPrimitives-CtwiZVPN.js → DocsPrimitives-DX-7e1im.js} +1 -1
  21. package/public/assets/{EditProjectPage-IRTaCyfg.js → EditProjectPage-D0JZ_TKw.js} +1 -1
  22. package/public/assets/{EmptyState-BBNo8OWr.js → EmptyState-mJyWr5uH.js} +1 -1
  23. package/public/assets/{EnvVariablesPage-CY6bnuuq.js → EnvVariablesPage-fLXzba5e.js} +1 -1
  24. package/public/assets/HomePage-kOecxD0_.js +1 -0
  25. package/public/assets/{InfoRow-BZWqE07x.js → InfoRow-Y1sU0G2n.js} +1 -1
  26. package/public/assets/{InstallationPage-BvBVyGkY.js → InstallationPage-BI1eTsYg.js} +1 -1
  27. package/public/assets/{LandingPage-CP_wXo09.js → LandingPage-B29hFr5l.js} +1 -1
  28. package/public/assets/{LocalDevelopmentPage-BxVqnOjh.js → LocalDevelopmentPage-DKZu2NH2.js} +1 -1
  29. package/public/assets/{LoginPage-Dfe5P2Mc.js → LoginPage-DxhouRBW.js} +1 -1
  30. package/public/assets/{MetricBar-LoaKP4Qj.js → MetricBar-eTMDxsUA.js} +1 -1
  31. package/public/assets/{NotFoundPage-CZ6vHhxQ.js → NotFoundPage-C0EcsleR.js} +1 -1
  32. package/public/assets/{OnboardingGuide-BH1zjho_.js → OnboardingGuide-Da2v37e-.js} +1 -1
  33. package/public/assets/{PermissionsPage-C89LUwtR.js → PermissionsPage-gn5TccJJ.js} +1 -1
  34. package/public/assets/{PipelineConfigPage-C2XugReU.js → PipelineConfigPage-Dpg_1f8s.js} +1 -1
  35. package/public/assets/{PipelineEditorPage-BF3eMSCM.js → PipelineEditorPage-EWSpEJ5f.js} +1 -1
  36. package/public/assets/{ProfilePage-DKKDCTx9.js → ProfilePage-DELsbzEP.js} +1 -1
  37. package/public/assets/{ProjectDetailPage-Bi-3DLgA.js → ProjectDetailPage-CNiRP1xl.js} +1 -1
  38. package/public/assets/{ProjectListPage-DznwqHll.js → ProjectListPage-CYcEgWyH.js} +1 -1
  39. package/public/assets/{PtyTerminal-WrI_RZpQ.js → PtyTerminal-BnlhlDB0.js} +1 -1
  40. package/public/assets/{QuickAuth-BBWmkwhA.js → QuickAuth-BJjb8FUv.js} +1 -1
  41. package/public/assets/{RemoveMemberConfirmDialog-DmCxvpwQ.js → RemoveMemberConfirmDialog-DTCM7tSO.js} +1 -1
  42. package/public/assets/{Select-9vDFfmjq.js → Select-DqguHTDG.js} +1 -1
  43. package/public/assets/{SettingsPage-C1av7piJ.js → SettingsPage-DZJf1o-J.js} +1 -1
  44. package/public/assets/{Skeleton-02wlyIbW.js → Skeleton-D6Pa0ZVm.js} +1 -1
  45. package/public/assets/{SkillPage-DqvIM6pJ.js → SkillPage-BvcpkVCR.js} +1 -1
  46. package/public/assets/{TaskDetailPage-CdkjfSWn.js → TaskDetailPage-Bj7vrwv0.js} +1 -1
  47. package/public/assets/{TaskListPage-C9R3EahV.js → TaskListPage-wY64PBlG.js} +1 -1
  48. package/public/assets/{TaskStatusBadge-EkExDX2H.js → TaskStatusBadge-mCwzxB1W.js} +1 -1
  49. package/public/assets/{TerminalHomePage-DSB_fbDP.js → TerminalHomePage-DmYjzI7b.js} +1 -1
  50. package/public/assets/{TokenManage-CvFjNduI.js → TokenManage-CyUVin7L.js} +1 -1
  51. package/public/assets/{Tooltip-M6jDD740.js → Tooltip-BPOc-WnR.js} +1 -1
  52. package/public/assets/{TotpSetupPage-BQmRtycf.js → TotpSetupPage-DjccU57R.js} +1 -1
  53. package/public/assets/{WorkerDetailPage-DIlJMx4z.js → WorkerDetailPage-CE4-kfOS.js} +1 -1
  54. package/public/assets/{WorkerListPage-DbjJDQp5.js → WorkerListPage-C0rAZuEy.js} +1 -1
  55. package/public/assets/{WorkerOperationsPage-B3KV1JvF.js → WorkerOperationsPage-B3P0RNCo.js} +1 -1
  56. package/public/assets/{WorkerSetupGuidePage-BpTJlpJ_.js → WorkerSetupGuidePage-m-iSn-iM.js} +1 -1
  57. package/public/assets/{WorkerSetupPage-CcByT6so.js → WorkerSetupPage-CLOruE6A.js} +1 -1
  58. package/public/assets/{arrow-left-BGperOFX.js → arrow-left-PTRz8m1_.js} +1 -1
  59. package/public/assets/{arrow-right-DNHRd8Z9.js → arrow-right-DZEEeomG.js} +1 -1
  60. package/public/assets/{bot-5Lo_gqmx.js → bot-DO5AEPZ9.js} +1 -1
  61. package/public/assets/{chevron-left-DSXFZLMV.js → chevron-left-xzCRCgCf.js} +1 -1
  62. package/public/assets/{chevron-right-Dfp83tFY.js → chevron-right-BbeAvkMB.js} +1 -1
  63. package/public/assets/{copy-CPx_B7OW.js → copy-DS3maJzX.js} +1 -1
  64. package/public/assets/{download-Bbj-oFLZ.js → download-CAQcL8_2.js} +1 -1
  65. package/public/assets/{external-link-DIUbaHQ2.js → external-link-FvIHStgA.js} +1 -1
  66. package/public/assets/{git-fork-CL2HOg0X.js → git-fork-BP1TgVm_.js} +1 -1
  67. package/public/assets/{index-B10YHYT-.js → index-CbvYIryv.js} +2 -2
  68. package/public/assets/{key-DpWySYfP.js → key-BvFrEADj.js} +1 -1
  69. package/public/assets/{loader-circle-8E2jyEy9.js → loader-circle-BMEwIEOC.js} +1 -1
  70. package/public/assets/{pencil-DL5_zTMe.js → pencil-BqFS4_42.js} +1 -1
  71. package/public/assets/{plus-4UtzNPHG.js → plus-DD4TjVZi.js} +1 -1
  72. package/public/assets/{rotate-ccw-6luto6QE.js → rotate-ccw-DPfDjC5H.js} +1 -1
  73. package/public/assets/{scroll-text-BqltO3x-.js → scroll-text-Cdl7phHH.js} +1 -1
  74. package/public/assets/{settings-DQW5ib_a.js → settings-CsNMSeUW.js} +1 -1
  75. package/public/assets/{status-colors-hJddxJDA.js → status-colors-DzMGFhKZ.js} +1 -1
  76. package/public/assets/{task-constants-DQs0yKJe.js → task-constants-DmpuTnwm.js} +1 -1
  77. package/public/assets/{trash-2-DZDM_1D_.js → trash-2-Dyd_X4uS.js} +1 -1
  78. package/public/assets/{useFetch-BCJSyxgw.js → useFetch-Czyzp06l.js} +1 -1
  79. package/public/assets/{users-DFhrcJQ0.js → users-Cok9LpO-.js} +1 -1
  80. package/public/assets/{wifi-rj7m9aYe.js → wifi-U3S68mli.js} +1 -1
  81. package/public/assets/{workflow-D_3K4Ohp.js → workflow-CbWymCow.js} +1 -1
  82. package/public/index.html +1 -1
  83. package/public/sw.js +1 -1
  84. package/public/assets/HomePage-DSD_C6l7.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e}from"./index-B10YHYT-.js";import{I as s,a as t}from"./DocsPrimitives-CtwiZVPN.js";import"./copy-CPx_B7OW.js";function l(){return e.jsx("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// overview"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"each machine that will execute tasks needs the overlord worker package installed. workers connect to the server via websocket, receive task assignments, manage git workspaces, and run ai agents in pty terminals."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// installation"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"on each worker machine:"}),e.jsx(s,{code:"npm install -g @overlordai/cli @overlordai/worker"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// interactive setup"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"run the setup wizard:"}),e.jsx(s,{code:"overlord setup worker"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the wizard prompts for:"}),e.jsxs("ol",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsxs("li",{children:["1. ",e.jsx("span",{className:"text-[var(--accent)]",children:"server url"})," — the overlord server address (e.g., ",e.jsx("code",{className:"text-[var(--text-muted)]",children:"https://overlord.yourdomain.com"})," or ",e.jsx("code",{className:"text-[var(--text-muted)]",children:"http://localhost:9000"}),")"]}),e.jsxs("li",{children:["2. ",e.jsx("span",{className:"text-[var(--accent)]",children:"registration token"})," — a one-time token generated in admin → settings → tokens"]}),e.jsxs("li",{children:["3. ",e.jsx("span",{className:"text-[var(--accent)]",children:"machine name"})," — a display name for this worker"]}),e.jsxs("li",{children:["4. ",e.jsx("span",{className:"text-[var(--accent)]",children:"max slots"})," — maximum number of concurrent tasks (default: 2)"]})]}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["the wizard writes configuration to ",e.jsx("code",{className:"text-[var(--accent)]",children:"~/.overlord-worker/.env"})," and starts the worker service."]})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:"// each worker needs its own unique registration token. generate one per machine in admin → settings → tokens (web dashboard)."})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// web ui guided setup"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["alternatively, open ",e.jsx("code",{className:"text-[var(--accent)]",children:"https://your-server/workers/setup"})," in a browser. the page provides step-by-step instructions with the exact commands to run on the worker machine."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// what the worker does"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"once running, the worker:"}),e.jsxs("ul",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsx("li",{children:"— connects to the server via websocket (auto-reconnects on failure)"}),e.jsx("li",{children:"— registers with the one-time token on first run, then uses jwt for subsequent connections"}),e.jsx("li",{children:"— sends heartbeats every 30 seconds with cpu, memory, and disk usage"}),e.jsxs("li",{children:["— reports installed agent capabilities (",e.jsx("code",{className:"text-[var(--accent)]",children:"claude"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"codex"}),")"]}),e.jsx("li",{children:"— receives task assignments and creates isolated git worktrees"}),e.jsx("li",{children:"— spawns pty terminals running the configured ai agent"}),e.jsx("li",{children:"— streams terminal output back to the server in real time"}),e.jsx("li",{children:"— manages cursor remote tunnels for workspace access"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// configuration"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["worker configuration is stored in ",e.jsx("code",{className:"text-[var(--accent)]",children:"~/.overlord-worker/.env"}),":"]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"variable"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"default"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"description"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_HOST"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:"server url (required)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_WORKER_TOKEN"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:"one-time registration token"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_WORKER_NAME"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"hostname"}),e.jsx("td",{className:"px-3 py-2",children:"display name"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_WORKSPACE_ROOT"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"~/.overlord-worker/workspaces"}),e.jsx("td",{className:"px-3 py-2",children:"task workspace directory"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_MAX_SLOTS"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"2"}),e.jsx("td",{className:"px-3 py-2",children:"max concurrent tasks"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_DATA_DIR"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"~/.overlord-worker"}),e.jsx("td",{className:"px-3 py-2",children:"config and jwt storage"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_SSH_KEY_PATH"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:"ssh key for git operations"})]})]})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// non-interactive mode"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["for automation or ci, pass ",e.jsx("code",{className:"text-[var(--accent)]",children:"--server"})," and ",e.jsx("code",{className:"text-[var(--accent)]",children:"--token"})," as cli flags. non-interactive mode activates automatically when both are provided:"]}),e.jsx(t,{code:`overlord setup worker \\
1
+ import{j as e}from"./index-CbvYIryv.js";import{I as s,a as t}from"./DocsPrimitives-DX-7e1im.js";import"./copy-DS3maJzX.js";function l(){return e.jsx("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// overview"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"each machine that will execute tasks needs the overlord worker package installed. workers connect to the server via websocket, receive task assignments, manage git workspaces, and run ai agents in pty terminals."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// installation"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"on each worker machine:"}),e.jsx(s,{code:"npm install -g @overlordai/cli @overlordai/worker"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// interactive setup"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"run the setup wizard:"}),e.jsx(s,{code:"overlord setup worker"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the wizard prompts for:"}),e.jsxs("ol",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsxs("li",{children:["1. ",e.jsx("span",{className:"text-[var(--accent)]",children:"server url"})," — the overlord server address (e.g., ",e.jsx("code",{className:"text-[var(--text-muted)]",children:"https://overlord.yourdomain.com"})," or ",e.jsx("code",{className:"text-[var(--text-muted)]",children:"http://localhost:9000"}),")"]}),e.jsxs("li",{children:["2. ",e.jsx("span",{className:"text-[var(--accent)]",children:"registration token"})," — a one-time token generated in admin → settings → tokens"]}),e.jsxs("li",{children:["3. ",e.jsx("span",{className:"text-[var(--accent)]",children:"machine name"})," — a display name for this worker"]}),e.jsxs("li",{children:["4. ",e.jsx("span",{className:"text-[var(--accent)]",children:"max slots"})," — maximum number of concurrent tasks (default: 2)"]})]}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["the wizard writes configuration to ",e.jsx("code",{className:"text-[var(--accent)]",children:"~/.overlord-worker/.env"})," and starts the worker service."]})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:"// each worker needs its own unique registration token. generate one per machine in admin → settings → tokens (web dashboard)."})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// web ui guided setup"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["alternatively, open ",e.jsx("code",{className:"text-[var(--accent)]",children:"https://your-server/workers/setup"})," in a browser. the page provides step-by-step instructions with the exact commands to run on the worker machine."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// what the worker does"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"once running, the worker:"}),e.jsxs("ul",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsx("li",{children:"— connects to the server via websocket (auto-reconnects on failure)"}),e.jsx("li",{children:"— registers with the one-time token on first run, then uses jwt for subsequent connections"}),e.jsx("li",{children:"— sends heartbeats every 30 seconds with cpu, memory, and disk usage"}),e.jsxs("li",{children:["— reports installed agent capabilities (",e.jsx("code",{className:"text-[var(--accent)]",children:"claude"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"codex"}),")"]}),e.jsx("li",{children:"— receives task assignments and creates isolated git worktrees"}),e.jsx("li",{children:"— spawns pty terminals running the configured ai agent"}),e.jsx("li",{children:"— streams terminal output back to the server in real time"}),e.jsx("li",{children:"— manages cursor remote tunnels for workspace access"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// configuration"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["worker configuration is stored in ",e.jsx("code",{className:"text-[var(--accent)]",children:"~/.overlord-worker/.env"}),":"]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"variable"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"default"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"description"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_HOST"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:"server url (required)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_WORKER_TOKEN"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:"one-time registration token"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_WORKER_NAME"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"hostname"}),e.jsx("td",{className:"px-3 py-2",children:"display name"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_WORKSPACE_ROOT"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"~/.overlord-worker/workspaces"}),e.jsx("td",{className:"px-3 py-2",children:"task workspace directory"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_MAX_SLOTS"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"2"}),e.jsx("td",{className:"px-3 py-2",children:"max concurrent tasks"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_DATA_DIR"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"~/.overlord-worker"}),e.jsx("td",{className:"px-3 py-2",children:"config and jwt storage"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_SSH_KEY_PATH"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:"ssh key for git operations"})]})]})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// non-interactive mode"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["for automation or ci, pass ",e.jsx("code",{className:"text-[var(--accent)]",children:"--server"})," and ",e.jsx("code",{className:"text-[var(--accent)]",children:"--token"})," as cli flags. non-interactive mode activates automatically when both are provided:"]}),e.jsx(t,{code:`overlord setup worker \\
2
2
  --server https://overlord.yourdomain.com \\
3
3
  --token ovw_1_abc123 \\
4
4
  --name worker-01 \\
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-B10YHYT-.js";/**
1
+ import{c as e}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as r}from"./index-B10YHYT-.js";/**
1
+ import{c as r}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-B10YHYT-.js";/**
1
+ import{c as t}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-B10YHYT-.js";/**
1
+ import{c as e}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-B10YHYT-.js";/**
1
+ import{c as t}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-B10YHYT-.js";/**
1
+ import{c}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-B10YHYT-.js";/**
1
+ import{c as o}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-B10YHYT-.js";/**
1
+ import{c as a}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-B10YHYT-.js";/**
1
+ import{c}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-CP_wXo09.js","assets/arrow-right-DNHRd8Z9.js","assets/bot-5Lo_gqmx.js","assets/workflow-D_3K4Ohp.js","assets/users-DFhrcJQ0.js","assets/copy-CPx_B7OW.js","assets/HomePage-DSD_C6l7.js","assets/TaskStatusBadge-EkExDX2H.js","assets/status-colors-hJddxJDA.js","assets/Skeleton-02wlyIbW.js","assets/OnboardingGuide-BH1zjho_.js","assets/chevron-right-Dfp83tFY.js","assets/date-RFA7-ZGs.js","assets/useFetch-BCJSyxgw.js","assets/Tooltip-M6jDD740.js","assets/TerminalHomePage-DSB_fbDP.js","assets/task-constants-DQs0yKJe.js","assets/PtyTerminal-WrI_RZpQ.js","assets/PtyTerminal-Beg8tuEN.css","assets/Select-9vDFfmjq.js","assets/plus-4UtzNPHG.js","assets/rotate-ccw-6luto6QE.js","assets/wifi-rj7m9aYe.js","assets/TaskListPage-C9R3EahV.js","assets/git-fork-CL2HOg0X.js","assets/EmptyState-BBNo8OWr.js","assets/chevron-left-DSXFZLMV.js","assets/TaskDetailPage-CdkjfSWn.js","assets/arrow-left-BGperOFX.js","assets/external-link-DIUbaHQ2.js","assets/loader-circle-8E2jyEy9.js","assets/WorkerListPage-DbjJDQp5.js","assets/MetricBar-LoaKP4Qj.js","assets/WorkerSetupGuidePage-BpTJlpJ_.js","assets/key-DpWySYfP.js","assets/download-Bbj-oFLZ.js","assets/settings-DQW5ib_a.js","assets/WorkerDetailPage-DIlJMx4z.js","assets/InfoRow-BZWqE07x.js","assets/trash-2-DZDM_1D_.js","assets/ProjectListPage-DznwqHll.js","assets/ProjectDetailPage-Bi-3DLgA.js","assets/RemoveMemberConfirmDialog-DmCxvpwQ.js","assets/pencil-DL5_zTMe.js","assets/EditProjectPage-IRTaCyfg.js","assets/PipelineEditorPage-BF3eMSCM.js","assets/ProfilePage-DKKDCTx9.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-CZ_Yavhf.js","assets/CliReferencePage-B6gTsb4v.js","assets/QuickAuth-BBWmkwhA.js","assets/ApiReferencePage-DsFA13KQ.js","assets/SkillPage-DqvIM6pJ.js","assets/DocsPrimitives-CtwiZVPN.js","assets/DocsLayout-Du6H0AOl.js","assets/InstallationPage-BvBVyGkY.js","assets/DeveloperSetupPage-Bq-eKaT0.js","assets/WorkerSetupPage-CcByT6so.js","assets/BotSetupPage-ByjmKjXY.js","assets/LocalDevelopmentPage-BxVqnOjh.js","assets/DeploymentPage-CWhXb1UF.js","assets/PipelineConfigPage-C2XugReU.js","assets/DevWorkflowPage-nTHhaHVz.js","assets/EnvVariablesPage-CY6bnuuq.js","assets/ArchitecturePage-DDc-vReK.js","assets/AgentCliPage-CQpk2Yo_.js","assets/DocsIndexPage-CzA83ol_.js","assets/AdminPage-BlGfVUEg.js","assets/scroll-text-BqltO3x-.js","assets/DeveloperManage-APQbY_-q.js","assets/BotManage-DRTJDHW6.js","assets/TokenManage-CvFjNduI.js","assets/AuditLogPage-BLTNLR9x.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-B29hFr5l.js","assets/arrow-right-DZEEeomG.js","assets/bot-DO5AEPZ9.js","assets/workflow-CbWymCow.js","assets/users-Cok9LpO-.js","assets/copy-DS3maJzX.js","assets/HomePage-kOecxD0_.js","assets/TaskStatusBadge-mCwzxB1W.js","assets/status-colors-DzMGFhKZ.js","assets/Skeleton-D6Pa0ZVm.js","assets/OnboardingGuide-Da2v37e-.js","assets/chevron-right-BbeAvkMB.js","assets/date-RFA7-ZGs.js","assets/useFetch-Czyzp06l.js","assets/Tooltip-BPOc-WnR.js","assets/TerminalHomePage-DmYjzI7b.js","assets/task-constants-DmpuTnwm.js","assets/PtyTerminal-BnlhlDB0.js","assets/PtyTerminal-Beg8tuEN.css","assets/Select-DqguHTDG.js","assets/plus-DD4TjVZi.js","assets/rotate-ccw-DPfDjC5H.js","assets/wifi-U3S68mli.js","assets/TaskListPage-wY64PBlG.js","assets/git-fork-BP1TgVm_.js","assets/EmptyState-mJyWr5uH.js","assets/chevron-left-xzCRCgCf.js","assets/TaskDetailPage-Bj7vrwv0.js","assets/arrow-left-PTRz8m1_.js","assets/external-link-FvIHStgA.js","assets/loader-circle-BMEwIEOC.js","assets/WorkerListPage-C0rAZuEy.js","assets/MetricBar-eTMDxsUA.js","assets/WorkerSetupGuidePage-m-iSn-iM.js","assets/key-BvFrEADj.js","assets/download-CAQcL8_2.js","assets/settings-CsNMSeUW.js","assets/WorkerDetailPage-CE4-kfOS.js","assets/InfoRow-Y1sU0G2n.js","assets/trash-2-Dyd_X4uS.js","assets/ProjectListPage-CYcEgWyH.js","assets/ProjectDetailPage-CNiRP1xl.js","assets/RemoveMemberConfirmDialog-DTCM7tSO.js","assets/pencil-BqFS4_42.js","assets/EditProjectPage-D0JZ_TKw.js","assets/PipelineEditorPage-EWSpEJ5f.js","assets/ProfilePage-DELsbzEP.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-B1G2-mUi.js","assets/CliReferencePage-ejyySCuq.js","assets/QuickAuth-BJjb8FUv.js","assets/ApiReferencePage-DIYFxzq0.js","assets/SkillPage-BvcpkVCR.js","assets/DocsPrimitives-DX-7e1im.js","assets/DocsLayout-BY6F_ywj.js","assets/InstallationPage-BI1eTsYg.js","assets/DeveloperSetupPage-bXuJM2eH.js","assets/WorkerSetupPage-CLOruE6A.js","assets/BotSetupPage-BKSV06rk.js","assets/LocalDevelopmentPage-DKZu2NH2.js","assets/DeploymentPage-Cq1gui8d.js","assets/PipelineConfigPage-Dpg_1f8s.js","assets/DevWorkflowPage-CqU3wVnM.js","assets/EnvVariablesPage-fLXzba5e.js","assets/ArchitecturePage-DZqBL3l7.js","assets/AgentCliPage-D7QPKJpY.js","assets/DocsIndexPage-D_GPFyTY.js","assets/AdminPage-BfQmSXQa.js","assets/scroll-text-Cdl7phHH.js","assets/DeveloperManage-CpSvUtkr.js","assets/BotManage-Db0KRZ8H.js","assets/TokenManage-CyUVin7L.js","assets/AuditLogPage-BGxaXcKz.js"])))=>i.map(i=>d[i]);
2
2
  var Ig=Object.defineProperty;var Pm=i=>{throw TypeError(i)};var Pg=(i,u,s)=>u in i?Ig(i,u,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[u]=s;var Ve=(i,u,s)=>Pg(i,typeof u!="symbol"?u+"":u,s),gs=(i,u,s)=>u.has(i)||Pm("Cannot "+s);var q=(i,u,s)=>(gs(i,u,"read from private field"),s?s.call(i):u.get(i)),Pt=(i,u,s)=>u.has(i)?Pm("Cannot add the same private member more than once"):u instanceof WeakSet?u.add(i):u.set(i,s),Kt=(i,u,s,o)=>(gs(i,u,"write to private field"),o?o.call(i,s):u.set(i,s),s),ke=(i,u,s)=>(gs(i,u,"access private method"),s);var eh=(i,u,s,o)=>({set _(f){Kt(i,u,f,s)},get _(){return q(i,u,o)}});(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.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 _ of m.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&o(_)}).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 ey(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var ys={exports:{}},ti={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -239,4 +239,4 @@ overlord install`,setup_step_1_link:"installation guide",setup_step_2_title:"reg
239
239
  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
240
240
  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",docs_nav_getting_started:"// getting started",docs_nav_guides:"// guides",docs_nav_reference:"// reference",docs_nav_other:"// other",docs_installation:"installation",docs_developer_setup:"developer setup",docs_worker_setup:"worker setup",docs_bot_setup:"bot setup",docs_local_dev:"local development",docs_worker_ops:"worker operations",docs_deployment:"deployment",docs_bot_integration:"bot integration",docs_pipeline:"pipeline config",docs_dev_workflow:"dev workflow",docs_cli:"cli reference",docs_api:"api reference",docs_skill:"skill reference",docs_permissions:"permissions & roles",docs_env_vars:"environment variables",docs_architecture:"architecture",docs_changelog:"changelog",docs_menu:"docs menu",docs_back:"< back",docs_all_title:"// all documentation",docs_all_subtitle:"browse all guides, references, and resources",docs_desc_installation:"install overlord server and cli tools",docs_desc_developer_setup:"set up your local development environment",docs_desc_worker_setup:"register and configure worker machines",docs_desc_bot_setup:"connect lark or slack bots to overlord",docs_desc_local_dev:"run and debug overlord locally",docs_desc_worker_ops:"manage worker lifecycle and monitoring",docs_desc_deployment:"deploy overlord to production servers",docs_desc_bot_integration:"interactive cards, adapter pattern, troubleshooting",docs_desc_pipeline:"define multi-stage task pipelines",docs_desc_dev_workflow:"git workflow, branching, and merge requests",docs_desc_cli:"cli command reference",docs_desc_api:"http api endpoint reference",docs_desc_skill:"custom skill definitions and configuration",docs_desc_permissions:"roles, access control, and authorization",docs_desc_env_vars:"environment variables for server and worker",docs_desc_architecture:"system architecture and component overview",docs_desc_changelog:"version history and release notes",docs_agent_cli:"agent cli",docs_desc_agent_cli:"claude, cursor, and codex cli integration and flag mapping"},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."},pwa_install:{title:"overlord://install",command:"overlord --install",desc_1:"add to home screen for standalone app experience",desc_2:"works offline · full-screen · instant launch",install:"y — install",skip:"n — skip",ios_command:"install --manual",ios_step_1:"tap share button in safari toolbar",ios_step_2:'scroll down → tap "add to home screen"',ios_step_3:'tap "add" to confirm'},pwa_update:{message:"new version available",reload:"reload"},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",confirm_create_title:"create task",confirm_create_message:`create a [{taskType}] task in project [{projectKey}]?
241
241
 
242
- "{description}"`}};function jb(i,u){const s=u.split(".");let o=i;for(const f of s){if(o==null||typeof o!="object")return u;o=o[f]}return typeof o=="string"?o:u}function Rb(i,u){return u?i.replace(/\{(\w+)\}/g,(s,o)=>u[o]!=null?String(u[o]):`{${o}}`):i}function Br(i,u){return Rb(jb(Tb,i),u)}function Vt(){return{t:g.useCallback((u,s)=>Br(u,s),[])}}function cp(){const{theme:i,setTheme:u}=sp(),{t:s}=Vt(),o=i==="dark"||i==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function f(){u(o?"light":"dark")}return h.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?h.jsx(_b,{size:16}):h.jsx(fb,{size:16})})}class Ns extends Error{constructor(s,o,f){const m=s.status||s.status===0?s.status:"",_=s.statusText??"",b=`${m} ${_}`.trim(),y=b?`status code ${b}`:"an unknown error";super(`Request failed with ${y}: ${o.method} ${o.url}`);Ve(this,"response");Ve(this,"request");Ve(this,"options");this.name="HTTPError",this.response=s,this.request=o,this.options=f}}class fp 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);Ve(this,"name","NonError");Ve(this,"value");this.value=s}}class Rs extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new fp(s.cause):void 0;super(s!=null&&s.code?`Forced retry: ${s.code}`:"Forced retry",o?{cause:o}:void 0);Ve(this,"name","ForceRetryError");Ve(this,"customDelay");Ve(this,"code");Ve(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 Sh=(()=>{let i=!1,u=!1;const s=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(s&&o)try{u=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return i=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return i&&!u})(),Ab=typeof globalThis.AbortController=="function",dp=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",zb=typeof globalThis.ReadableStream=="function",Ob=typeof globalThis.FormData=="function",mp=["get","post","put","patch","head","delete"],Cb={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},As=2147483647,Db=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,hp=Symbol("stop");class pp{constructor(u){Ve(this,"options");this.options=u}}const Nb=i=>new pp(i),Mb={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},Ub={next:!0},qb={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},Lb=i=>{if(!i)return 0;if(i instanceof FormData){let u=0;for(const[s,o]of i)u+=Db,u+=new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length,u+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return u}if(i instanceof Blob)return i.size;if(i instanceof ArrayBuffer)return i.byteLength;if(typeof i=="string")return new TextEncoder().encode(i).length;if(i instanceof URLSearchParams)return new TextEncoder().encode(i.toString()).length;if("byteLength"in i)return i.byteLength;if(typeof i=="object"&&i!==null)try{const u=JSON.stringify(i);return new TextEncoder().encode(u).length}catch{return 0}return 0},_p=(i,u,s)=>{let o,f=0;return i.pipeThrough(new TransformStream({transform(m,_){if(_.enqueue(m),o){f+=o.byteLength;let b=u===0?0:f/u;b>=1&&(b=1-Number.EPSILON),s==null||s({percent:b,totalBytes:Math.max(u,f),transferredBytes:f},o)}o=m},flush(){o&&(f+=o.byteLength,s==null||s({percent:1,totalBytes:Math.max(u,f),transferredBytes:f},o))}}))},Hb=(i,u)=>{if(!i.body)return i;if(i.status===204)return new Response(null,{status:i.status,statusText:i.statusText,headers:i.headers});const s=Math.max(0,Number(i.headers.get("content-length"))||0);return new Response(_p(i.body,s,u),{status:i.status,statusText:i.statusText,headers:i.headers})},Bb=(i,u,s)=>{if(!i.body)return i;const o=Lb(s??i.body);return new Request(i,{duplex:"half",body:_p(i.body,o,u)})},yn=i=>i!==null&&typeof i=="object",Dr=(...i)=>{for(const u of i)if((!yn(u)||Array.isArray(u))&&u!==void 0)throw new TypeError("The `options` argument must be an object");return Ws({},...i)},gp=(i={},u={})=>{const s=new globalThis.Headers(i),o=u instanceof globalThis.Headers,f=new globalThis.Headers(u);for(const[m,_]of f.entries())o&&_==="undefined"||_===void 0?s.delete(m):s.set(m,_);return s};function Nr(i,u,s){return Object.hasOwn(u,s)&&u[s]===void 0?[]:Ws(i[s]??[],u[s]??[])}const yp=(i={},u={})=>({beforeRequest:Nr(i,u,"beforeRequest"),beforeRetry:Nr(i,u,"beforeRetry"),afterResponse:Nr(i,u,"afterResponse"),beforeError:Nr(i,u,"beforeError")}),Yb=(i,u)=>{const s=new URLSearchParams;for(const o of[i,u])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(yn(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,_]of f.entries())s.append(m,_)}return s},Ws=(...i)=>{let u={},s={},o={},f;const m=[];for(const _ of i)if(Array.isArray(_))Array.isArray(u)||(u=[]),u=[...u,..._];else if(yn(_)){for(let[b,y]of Object.entries(_)){if(b==="signal"&&y instanceof globalThis.AbortSignal){m.push(y);continue}if(b==="context"){if(y!=null&&(!yn(y)||Array.isArray(y)))throw new TypeError("The `context` option must be an object");u={...u,context:y==null?{}:{...u.context,...y}};continue}if(b==="searchParams"){y==null?f=void 0:f=f===void 0?y:Yb(f,y);continue}yn(y)&&b in u&&(y=Ws(u[b],y)),u={...u,[b]:y}}yn(_.hooks)&&(o=yp(o,_.hooks),u.hooks=o),yn(_.headers)&&(s=gp(s,_.headers),u.headers=s)}return f!==void 0&&(u.searchParams=f),m.length>0&&(m.length===1?u.signal=m[0]:dp?u.signal=AbortSignal.any(m):u.signal=m.at(-1)),u},Gb=i=>mp.includes(i)?i.toUpperCase():i,Vb=["get","put","head","delete","options","trace"],Xb=[408,413,429,500,502,503,504],Qb=[413,429,503],kh={limit:2,methods:Vb,statusCodes:Xb,afterStatusCodes:Qb,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:i=>.3*2**(i-1)*1e3,jitter:void 0,retryOnTimeout:!1},Zb=(i={})=>{if(typeof i=="number")return{...kh,limit:i};if(i.methods&&!Array.isArray(i.methods))throw new Error("retry.methods must be an array");if(i.methods&&(i.methods=i.methods.map(s=>s.toLowerCase())),i.statusCodes&&!Array.isArray(i.statusCodes))throw new Error("retry.statusCodes must be an array");const u=Object.fromEntries(Object.entries(i).filter(([,s])=>s!==void 0));return{...kh,...u}};class Ms extends Error{constructor(s){super(`Request timed out: ${s.method} ${s.url}`);Ve(this,"request");this.name="TimeoutError",this.request=s}}async function Kb(i,u,s,o){return new Promise((f,m)=>{const _=setTimeout(()=>{s&&s.abort(),m(new Ms(i))},o.timeout);o.fetch(i,u).then(f).catch(m).then(()=>{clearTimeout(_)})})}async function Jb(i,{signal:u}){return new Promise((s,o)=>{u&&(u.throwIfAborted(),u.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(m),o(u.reason)}const m=setTimeout(()=>{u==null||u.removeEventListener("abort",f),s()},i)})}const $b=(i,u)=>{const s={};for(const o in u)Object.hasOwn(u,o)&&!(o in qb)&&!(o in Mb)&&(!(o in i)||o in Ub)&&(s[o]=u[o]);return s},Wb=i=>i===void 0?!1:Array.isArray(i)?i.length>0:i instanceof URLSearchParams?i.size>0:typeof i=="object"?Object.keys(i).length>0:typeof i=="string"?i.trim().length>0:!!i;function Fb(i){return i instanceof Ns||(i==null?void 0:i.name)===Ns.name}function Ib(i){return i instanceof Ms||(i==null?void 0:i.name)===Ms.name}var Kr,vp,Jt,Bt,rt,Q,$a,ea,vn,oe,Yr,bp,Us,Gr,Ja,qs,xp,ii,Vr,Ls;const ri=class ri{constructor(u,s={}){Pt(this,oe);Ve(this,"request");Pt(this,Jt);Pt(this,Bt,0);Pt(this,rt);Pt(this,Q);Pt(this,$a);Pt(this,ea);Pt(this,vn);var f,m,_;if(Kt(this,rt,u),Kt(this,Q,{...s,headers:gp(q(this,rt).headers,s.headers),hooks:yp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Gb(s.method??q(this,rt).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:Zb(s.retry),throwHttpErrors:s.throwHttpErrors??!0,timeout:s.timeout??1e4,fetch:s.fetch??globalThis.fetch.bind(globalThis),context:s.context??{}}),typeof q(this,rt)!="string"&&!(q(this,rt)instanceof URL||q(this,rt)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(q(this,Q).prefixUrl&&typeof q(this,rt)=="string"){if(q(this,rt).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");q(this,Q).prefixUrl.endsWith("/")||(q(this,Q).prefixUrl+="/"),Kt(this,rt,q(this,Q).prefixUrl+q(this,rt))}Ab&&dp&&(Kt(this,ea,q(this,Q).signal??q(this,rt).signal),Kt(this,Jt,new globalThis.AbortController),q(this,Q).signal=q(this,ea)?AbortSignal.any([q(this,ea),q(this,Jt).signal]):q(this,Jt).signal),Sh&&(q(this,Q).duplex="half"),q(this,Q).json!==void 0&&(q(this,Q).body=((m=(f=q(this,Q)).stringifyJson)==null?void 0:m.call(f,q(this,Q).json))??JSON.stringify(q(this,Q).json),q(this,Q).headers.set("content-type",q(this,Q).headers.get("content-type")??"application/json"));const o=s.headers&&new globalThis.Headers(s.headers).has("content-type");if(q(this,rt)instanceof globalThis.Request&&(Ob&&q(this,Q).body instanceof globalThis.FormData||q(this,Q).body instanceof URLSearchParams)&&!o&&q(this,Q).headers.delete("content-type"),this.request=new globalThis.Request(q(this,rt),q(this,Q)),Wb(q(this,Q).searchParams)){const y="?"+(typeof q(this,Q).searchParams=="string"?q(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ke(_=ri,Kr,vp).call(_,q(this,Q).searchParams)).toString()),p=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,y);this.request=new globalThis.Request(p,q(this,Q))}if(q(this,Q).onUploadProgress){if(typeof q(this,Q).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Sh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=ke(this,oe,Ls).call(this,this.request,q(this,Q).body??void 0)}}static create(u,s){var _,b,y;const o=new ri(u,s),f=async()=>{var w,k,N,Y,L,H,B,U,K,X,ue,ce;if(typeof q(o,Q).timeout=="number"&&q(o,Q).timeout>As)throw new RangeError(`The \`timeout\` option cannot be greater than ${As}`);await Promise.resolve();let p=await ke(w=o,oe,xp).call(w);for(const _e of q(o,Q).hooks.afterResponse){const F=ke(k=o,oe,Us).call(k,p.clone());let W;try{W=await _e(o.request,ke(N=o,oe,ii).call(N),F,{retryCount:q(o,Bt)})}catch(Pe){throw ke(Y=o,oe,Ja).call(Y,F),ke(L=o,oe,Ja).call(L,p),Pe}if(W instanceof pp)throw ke(H=o,oe,Ja).call(H,F),ke(B=o,oe,Ja).call(B,p),new Rs(W.options);const se=W instanceof globalThis.Response?W:p;F!==se&&ke(U=o,oe,Ja).call(U,F),p!==se&&ke(K=o,oe,Ja).call(K,p),p=se}if(ke(X=o,oe,Us).call(X,p),!p.ok&&(typeof q(o,Q).throwHttpErrors=="function"?q(o,Q).throwHttpErrors(p.status):q(o,Q).throwHttpErrors)){let _e=new Ns(p,o.request,ke(ue=o,oe,ii).call(ue));for(const F of q(o,Q).hooks.beforeError)_e=await F(_e,{retryCount:q(o,Bt)});throw _e}if(q(o,Q).onDownloadProgress){if(typeof q(o,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!zb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const _e=p.clone();return ke(ce=o,oe,Ja).call(ce,p),Hb(_e,q(o,Q).onDownloadProgress)}return p},m=ke(_=o,oe,qs).call(_,f).finally(()=>{var w,k;const p=q(o,$a);ke(w=o,oe,Gr).call(w,(p==null?void 0:p.body)??void 0),ke(k=o,oe,Gr).call(k,o.request.body??void 0)});for(const[p,w]of Object.entries(Cb))p==="bytes"&&typeof((y=(b=globalThis.Response)==null?void 0:b.prototype)==null?void 0:y.bytes)!="function"||(m[p]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||w);const k=await m;if(p==="json"){if(k.status===204)return"";const N=await k.text();return N===""?"":s.parseJson?s.parseJson(N):JSON.parse(N)}return k[p]()});return m}};Kr=new WeakSet,vp=function(u){return u&&typeof u=="object"&&!Array.isArray(u)&&!(u instanceof URLSearchParams)?Object.fromEntries(Object.entries(u).filter(([,s])=>s!==void 0)):u},Jt=new WeakMap,Bt=new WeakMap,rt=new WeakMap,Q=new WeakMap,$a=new WeakMap,ea=new WeakMap,vn=new WeakMap,oe=new WeakSet,Yr=function(){const u=q(this,Q).retry.delay(q(this,Bt));let s=u;q(this,Q).retry.jitter===!0?s=Math.random()*u:typeof q(this,Q).retry.jitter=="function"&&(s=q(this,Q).retry.jitter(u),(!Number.isFinite(s)||s<0)&&(s=u));const o=q(this,Q).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,s)},bp=async function(u){if(eh(this,Bt)._++,q(this,Bt)>q(this,Q).retry.limit)throw u;const s=u instanceof Error?u:new fp(u);if(s instanceof Rs)return s.customDelay??ke(this,oe,Yr).call(this);if(!q(this,Q).retry.methods.includes(this.request.method.toLowerCase()))throw u;if(q(this,Q).retry.shouldRetry!==void 0){const o=await q(this,Q).retry.shouldRetry({error:s,retryCount:q(this,Bt)});if(o===!1)throw u;if(o===!0)return ke(this,oe,Yr).call(this)}if(Ib(u)&&!q(this,Q).retry.retryOnTimeout)throw u;if(Fb(u)){if(!q(this,Q).retry.statusCodes.includes(u.response.status))throw u;const o=u.response.headers.get("Retry-After")??u.response.headers.get("RateLimit-Reset")??u.response.headers.get("X-RateLimit-Retry-After")??u.response.headers.get("X-RateLimit-Reset")??u.response.headers.get("X-Rate-Limit-Reset");if(o&&q(this,Q).retry.afterStatusCodes.includes(u.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=q(this,Q).retry.maxRetryAfter??f;return f<m?f:m}if(u.response.status===413)throw u}return ke(this,oe,Yr).call(this)},Us=function(u){return q(this,Q).parseJson&&(u.json=async()=>q(this,Q).parseJson(await u.text())),u},Gr=function(u){u&&u.cancel().catch(()=>{})},Ja=function(u){ke(this,oe,Gr).call(this,u.body??void 0)},qs=async function(u){try{return await u()}catch(s){const o=Math.min(await ke(this,oe,bp).call(this,s),As);if(q(this,Bt)<1)throw s;if(await Jb(o,q(this,ea)?{signal:q(this,ea)}:{}),s instanceof Rs&&s.customRequest){const f=q(this,Q).signal?new globalThis.Request(s.customRequest,{signal:q(this,Q).signal}):new globalThis.Request(s.customRequest);ke(this,oe,Vr).call(this,f)}for(const f of q(this,Q).hooks.beforeRetry){const m=await f({request:this.request,options:ke(this,oe,ii).call(this),error:s,retryCount:q(this,Bt)});if(m instanceof globalThis.Request){ke(this,oe,Vr).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===hp)return}return ke(this,oe,qs).call(this,u)}},xp=async function(){var s;(s=q(this,Jt))!=null&&s.signal.aborted&&(Kt(this,Jt,new globalThis.AbortController),q(this,Q).signal=q(this,ea)?AbortSignal.any([q(this,ea),q(this,Jt).signal]):q(this,Jt).signal,this.request=new globalThis.Request(this.request,{signal:q(this,Q).signal}));for(const o of q(this,Q).hooks.beforeRequest){const f=await o(this.request,ke(this,oe,ii).call(this),{retryCount:q(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ke(this,oe,Vr).call(this,f);break}}const u=$b(this.request,q(this,Q));return Kt(this,$a,this.request),this.request=q(this,$a).clone(),q(this,Q).timeout===!1?q(this,Q).fetch(q(this,$a),u):Kb(q(this,$a),u,q(this,Jt),q(this,Q))},ii=function(){if(!q(this,vn)){const{hooks:u,...s}=q(this,Q);Kt(this,vn,Object.freeze(s))}return q(this,vn)},Vr=function(u){Kt(this,vn,void 0),this.request=ke(this,oe,Ls).call(this,u)},Ls=function(u,s){return!q(this,Q).onUploadProgress||!u.body?u:Bb(u,q(this,Q).onUploadProgress,s??q(this,Q).body??void 0)},Pt(ri,Kr);let Zr=ri;/*! MIT License © Sindre Sorhus */const Hs=i=>{const u=(s,o)=>Zr.create(s,Dr(i,o));for(const s of mp)u[s]=(o,f)=>Zr.create(o,Dr(i,f,{method:s}));return u.create=s=>Hs(Dr(s)),u.extend=s=>(typeof s=="function"&&(s=s(i??{})),Hs(Dr(i,s))),u.stop=hp,u.retry=Nb,u},Eh=Hs();let Mr=null;const Xr=Eh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[i=>{const u=xa.getState().accessToken;u&&i.headers.set("Authorization",`Bearer ${u}`)}],afterResponse:[async(i,u,s)=>{if(s.status===401&&!i.headers.has("X-Retry-After-Refresh")){Mr||(Mr=xa.getState().refresh().finally(()=>{Mr=null}));try{await Mr}catch{throw s}const o=xa.getState().accessToken;return o&&i.headers.set("Authorization",`Bearer ${o}`),i.headers.set("X-Retry-After-Refresh","1"),Eh(i,u)}}]}}),Pb=3e4;function e0(i){if(i.link)return i.link;const u=(i.title+" "+i.body).match(/task\s*#?(\d+)/i);if(u)return`/tasks/${u[1]}`;const s=(i.title+" "+i.body).match(/worker\s+(\S+)/i);return s?`/workers/${s[1]}`:null}function Sp(){const i=Fa(),[u,s]=g.useState([]),[o,f]=g.useState(0),[m,_]=g.useState(!1),[b,y]=g.useState(!1),p=g.useRef(null),{t:w}=Vt(),k=g.useRef(async()=>{try{y(!0);const H=(await Xr.get("web/notifications",{searchParams:{limit:"20"}}).json()).data,B=H.filter(U=>!U.isRead).length;s(U=>U.length===H.length&&U.every((K,X)=>K.id===H[X].id&&K.isRead===H[X].isRead)?U:H),f(U=>U===B?U:B)}catch{}finally{y(!1)}});g.useEffect(()=>{k.current();const L=setInterval(()=>k.current(),Pb);return()=>clearInterval(L)},[]),g.useEffect(()=>{function L(H){p.current&&!p.current.contains(H.target)&&_(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);async function N(L){try{await Xr.post(`web/notifications/${L}/read`),s(H=>H.map(B=>B.id===L?{...B,isRead:!0}:B)),f(H=>Math.max(0,H-1))}catch{}}async function Y(){try{await Xr.post("web/notifications/read-all"),s(L=>L.map(H=>({...H,isRead:!0}))),f(0)}catch{}}return h.jsxs("div",{className:"relative",ref:p,children:[h.jsxs("button",{type:"button",onClick:()=>_(L=>!L),"aria-label":w("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:[h.jsx($v,{size:16}),o>0&&h.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&&h.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:[h.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[h.jsx("span",{className:"text-sm font-semibold",children:w("common.notifications")}),o>0&&h.jsxs("button",{type:"button",onClick:Y,"aria-label":w("common.mark_all_read"),className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[h.jsx(Wv,{className:"h-3.5 w-3.5"}),w("common.mark_all_read")]})]}),h.jsx("div",{className:"max-h-80 overflow-y-auto",children:b&&u.length===0?h.jsx("div",{className:"flex justify-center py-8",children:h.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):u.length===0?h.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[h.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),h.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:w("common.no_notifications")})]}):u.map(L=>{const H=e0(L);return h.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${H?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${L.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{H&&(L.isRead||N(L.id),_(!1),i(H))},children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"truncate text-sm font-medium",title:L.title,children:L.title}),h.jsx("p",{className:"truncate text-xs text-[var(--text-secondary)]",title:L.body,children:L.body}),h.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(L.createdAt).toLocaleString()})]}),!L.isRead&&h.jsx("button",{type:"button",onClick:B=>{B.stopPropagation(),N(L.id)},"aria-label":w("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:h.jsx(Fv,{className:"h-3.5 w-3.5"})})]},L.id)})})]})]})}function t0(i){return i&&i.trim().length>0?i:null}function kp(i,u=50){return t0(i.name)??Wh(i.description,u)}function a0(i){return i.description}function Ep(i){return`#${i.id} ${a0(i)}`}function V1(i,u=100){return{text:`#${i.id} ${kp(i,u)}`,title:Ep(i)}}function n0(i){return{tasks:i.tasks.map(u=>({type:"task",id:u.id,title:`#${u.id} ${kp(u)}`,subtitle:`${u.status} · ${u.project_key}`,hoverTitle:Ep(u)})),workers:(i.workers??[]).map(u=>({type:"worker",id:u.id,title:u.name,subtitle:`${u.hostname} · ${u.status}`})),projects:i.projects.map(u=>({type:"project",id:u.key,title:u.name,subtitle:u.repository}))}}const l0=300,wh={tasks:pb,workers:ap,projects:nb},i0={tasks:"tasks",workers:"workers",projects:"projects"};function wp({renderTrigger:i}={}){const[u,s]=g.useState(""),[o,f]=g.useState({tasks:[],workers:[],projects:[]}),[m,_]=g.useState(!1),[b,y]=g.useState(!1),[p,w]=g.useState(0),k=g.useRef(null),N=g.useRef(null),Y=g.useRef(void 0),L=g.useRef(void 0),H=Fa(),{t:B}=Vt(),U=g.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),K=g.useCallback(async W=>{var Pe;if(!W.trim()){f({tasks:[],workers:[],projects:[]});return}(Pe=L.current)==null||Pe.abort();const se=new AbortController;L.current=se;try{_(!0);const Je=await Xr.get("web/search",{searchParams:{q:W},signal:se.signal}).json();f(n0(Je)),w(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{se.signal.aborted||_(!1)}},[]);g.useEffect(()=>(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>K(u),l0),()=>{Y.current&&clearTimeout(Y.current)}),[u,K]),g.useEffect(()=>{function W(se){se.key==="/"&&!b&&!(se.target instanceof HTMLInputElement||se.target instanceof HTMLTextAreaElement)&&(se.preventDefault(),y(!0)),se.key==="Escape"&&b&&(se.preventDefault(),X())}return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[b]),g.useEffect(()=>{b&&setTimeout(()=>{var W;return(W=N.current)==null?void 0:W.focus()},50)},[b]);function X(){y(!1),s(""),f({tasks:[],workers:[],projects:[]}),w(0)}function ue(W){switch(X(),W.type){case"task":H(`/tasks/${W.id}`);break;case"worker":H(`/workers/${W.id}`);break;case"project":H(`/projects/${W.id}`);break}}function ce(W){W.key==="ArrowDown"?(W.preventDefault(),w(se=>Math.min(se+1,U.length-1))):W.key==="ArrowUp"?(W.preventDefault(),w(se=>Math.max(se-1,0))):W.key==="Enter"&&U[p]&&(W.preventDefault(),ue(U[p]))}const _e=U.length>0;let F=0;return h.jsxs(h.Fragment,{children:[i?i(()=>y(!0)):h.jsxs("button",{type:"button",onClick:()=>y(!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:[h.jsx(tp,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:B("common.search_placeholder")}),h.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:"/"})]}),b&&h.jsx("div",{ref:k,className:"fixed inset-0 z-[100] flex items-start justify-center pt-[calc(var(--safe-area-top,0px)+16px)] md:pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:W=>{W.target===k.current&&X()},children:h.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:[h.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[h.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),h.jsx("input",{ref:N,type:"text",placeholder:B("common.search_input_placeholder"),value:u,onChange:W=>s(W.target.value),onKeyDown:ce,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),m&&h.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),h.jsx("div",{className:"max-h-[50vh] overflow-y-auto sm:max-h-[60vh] md:max-h-[400px]",children:u.trim()&&!_e&&!m?h.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:B("common.no_search_results",{query:u})}):Object.keys(wh).map(W=>{const se=o[W];if(se.length===0)return null;const Pe=wh[W],Je=F;return F+=se.length,h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[h.jsx(Pe,{className:"h-3 w-3"}),h.jsx("span",{className:"text-[11px] lowercase tracking-wider",children:i0[W]})]}),se.map((Ce,At)=>{const ut=Je+At,Me=ut===p;return h.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${Me?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>ue(Ce),onMouseEnter:()=>w(ut),children:[h.jsx("span",{className:`text-xs ${Me?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:Me?">":" "}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"truncate text-sm",title:Ce.hoverTitle??Ce.title,children:Ce.title}),Ce.subtitle&&h.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",title:Ce.subtitle,children:Ce.subtitle})]})]},`${Ce.type}-${Ce.id}`)})]},W)})}),h.jsxs("div",{className:"hidden items-center gap-4 border-t border-[var(--border)] px-4 py-2 md:flex",children:[h.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[h.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↑↓"})," ",B("common.navigate_hint")]}),h.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[h.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↵"})," ",B("common.select_hint")]}),h.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[h.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"esc"})," ",B("common.close_hint")]})]})]})})]})}const r0={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"};function Th(i){return Array.from(i.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))}function u0({isOpen:i,onClose:u,onConfirm:s,title:o,message:f,confirmLabel:m,cancelLabel:_,confirmVariant:b="danger",isLoading:y,children:p}){const{t:w}=Vt(),k=g.useId(),N=m??w("common.confirm"),Y=_??w("common.cancel"),L=g.useRef(null),H=g.useRef(null),B=r0[b];g.useEffect(()=>{if(!i)return;H.current=document.activeElement;const K=requestAnimationFrame(()=>{if(L.current){const X=Th(L.current);X.length>0&&X[0].focus()}});return()=>{var X;cancelAnimationFrame(K),(X=H.current)==null||X.focus()}},[i]);const U=g.useCallback(K=>{if(K.key==="Escape"){u();return}if(K.key==="Tab"&&L.current){const X=Th(L.current);if(X.length===0)return;const ue=X[0],ce=X[X.length-1];K.shiftKey?document.activeElement===ue&&(K.preventDefault(),ce.focus()):document.activeElement===ce&&(K.preventDefault(),ue.focus())}},[u]);return i?h.jsx("div",{onClick:u,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:h.jsxs("div",{ref:L,role:"dialog","aria-modal":"true","aria-labelledby":k,onClick:K=>K.stopPropagation(),onKeyDown:U,style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem"},children:[h.jsx("div",{style:{marginBottom:"1.25rem"},children:h.jsxs("div",{id:k,style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[h.jsx(np,{style:{width:"1rem",height:"1rem"}}),o]})}),h.jsxs("div",{style:{marginBottom:"1.25rem"},children:[h.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f}),p]}),h.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[h.jsx("button",{type:"button",onClick:u,disabled:y,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:y?"not-allowed":"pointer",opacity:y?.7:1,transition:"color 0.15s, border-color 0.15s"},children:Y}),h.jsx("button",{type:"button",onClick:s,disabled:y,style:{flex:1,padding:"0.5rem",backgroundColor:B,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:y?"not-allowed":"pointer",opacity:y?.7:1},children:y?w("common.processing"):N})]})]})}):null}const jh="overlord-pwa-install-dismissed";function o0(){const i=navigator.userAgent;return/iP(hone|od|ad)/.test(i)&&/WebKit/.test(i)&&!/(CriOS|FxiOS|OPiOS|mercury)/.test(i)}function s0(){return navigator.standalone===!0||window.matchMedia("(display-mode: standalone)").matches}function c0(){const{t:i}=Vt(),[u,s]=g.useState("hidden"),[o,f]=g.useState(!1),m=g.useRef(null),_=g.useRef(void 0);g.useEffect(()=>{if(s0()||localStorage.getItem(jh)||window.innerWidth>=768)return;const p=k=>{k.preventDefault(),m.current=k};window.addEventListener("beforeinstallprompt",p);const w=setTimeout(()=>s("visible"),1e3);return()=>{window.removeEventListener("beforeinstallprompt",p),clearTimeout(w),clearTimeout(_.current)}},[]);function b(){localStorage.setItem(jh,"1"),s("dismissing"),_.current=setTimeout(()=>s("hidden"),200)}async function y(){if(m.current){await m.current.prompt();const{outcome:p}=await m.current.userChoice;p==="accepted"&&b(),m.current=null}else o0()&&f(!0)}return u==="hidden"?null:h.jsx("div",{className:`fixed bottom-4 left-4 right-4 z-40 md:hidden ${u==="dismissing"?"animate-slide-down":"animate-slide-up"}`,role:"dialog","aria-label":i("pwa_install.title"),children:h.jsxs("div",{className:"overflow-hidden rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--accent)]/20 bg-[var(--accent)]/[0.06] px-3 py-1.5",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-[var(--accent)]"}),h.jsx("span",{className:"text-[9px] font-medium text-[var(--accent)]",children:i("pwa_install.title")})]}),h.jsx("button",{onClick:b,className:"p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:h.jsx(lp,{size:14})})]}),h.jsx("div",{className:"px-3.5 py-3",children:o?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[h.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",i("pwa_install.ios_command")]}),h.jsx("div",{className:"mt-2.5 flex flex-col gap-2.5",children:[i("pwa_install.ios_step_1"),i("pwa_install.ios_step_2"),i("pwa_install.ios_step_3")].map((p,w)=>h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] bg-[var(--accent)]/[0.08]",children:h.jsx("span",{className:"text-xs font-semibold text-[var(--accent)]",children:w+1})}),h.jsxs("span",{className:"text-[10px] leading-snug text-[var(--text-secondary)]",children:[w===0&&h.jsx(db,{size:12,className:"mr-1 inline-block align-text-bottom text-[var(--text-muted)]"}),p]})]},w))})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[h.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",i("pwa_install.command")]}),h.jsxs("div",{className:"mt-1.5 text-[10px] leading-relaxed text-[var(--text-secondary)]",children:["→ ",i("pwa_install.desc_1"),h.jsx("br",{}),"→ ",i("pwa_install.desc_2")]}),h.jsxs("div",{className:"mt-2.5 flex gap-2",children:[h.jsx("button",{onClick:y,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:i("pwa_install.install")}),h.jsx("button",{onClick:b,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[10px] text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:i("pwa_install.skip")})]})]})})]})})}function f0(){const{t:i}=Vt(),[u,s]=g.useState(!1);return g.useEffect(()=>{if(!("serviceWorker"in navigator))return;let o=!1,f=null,m=null,_=null,b=null;function y(){o||s(!0)}navigator.serviceWorker.addEventListener("controllerchange",y);function p(k){if(f=k,k.waiting){s(!0);return}_=()=>{const N=k.installing;N&&(m=N,b=()=>{N.state==="installed"&&navigator.serviceWorker.controller&&(o||s(!0))},N.addEventListener("statechange",b))},k.addEventListener("updatefound",_)}navigator.serviceWorker.getRegistration().then(k=>{k&&!o&&p(k)});const w=setInterval(()=>{navigator.serviceWorker.getRegistration().then(k=>{!k||o||(k.update().catch(()=>{}),k.waiting&&s(!0))})},3e4);return()=>{o=!0,clearInterval(w),navigator.serviceWorker.removeEventListener("controllerchange",y),f&&_&&f.removeEventListener("updatefound",_),m&&b&&m.removeEventListener("statechange",b)}},[]),u?h.jsx("div",{className:"animate-slide-up fixed bottom-20 left-4 right-4 z-50 md:bottom-4 md:left-auto md:right-4 md:w-80",children:h.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] px-3.5 py-3 shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[h.jsx(ep,{size:14,className:"shrink-0 text-[var(--accent)]"}),h.jsx("span",{className:"flex-1 text-[10px] text-[var(--text-secondary)]",children:i("pwa_update.message")}),h.jsx("button",{onClick:()=>window.location.reload(),className:"shrink-0 rounded-[4px] bg-[var(--accent)] px-3 py-1 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:i("pwa_update.reload")})]})}):null}const Ur=64,d0=96,Rh=32;function m0({children:i,className:u}){const s=g.useRef(null),o=g.useRef(0),f=g.useRef("idle"),[m,_]=g.useState(0),[b,y]=g.useState("idle"),p=g.useCallback(U=>{f.current=U,y(U)},[]),w=g.useCallback(()=>{const U=s.current;return U?U.scrollTop<=0:!0},[]),k=g.useCallback(U=>{if(!w()){o.current=0;return}o.current=U.touches[0].clientY},[w]),N=g.useCallback(U=>{if(f.current==="refreshing"||o.current===0)return;const X=U.touches[0].clientY-o.current;if(X<=0){f.current!=="idle"&&(_(0),p("idle"));return}if(!w())return;U.preventDefault();const ue=Math.min(X*.5,d0);_(ue),p(ue>=Ur?"ready":"pulling")},[w,p]),Y=g.useCallback(()=>{f.current!=="refreshing"&&(f.current==="ready"?(p("refreshing"),_(Ur),setTimeout(()=>{window.location.reload()},300)):(_(0),p("idle")),o.current=0)},[p]);g.useEffect(()=>{const U=s.current;if(U)return U.addEventListener("touchstart",k,{passive:!0}),U.addEventListener("touchmove",N,{passive:!1}),U.addEventListener("touchend",Y,{passive:!0}),()=>{U.removeEventListener("touchstart",k),U.removeEventListener("touchmove",N),U.removeEventListener("touchend",Y)}},[k,N,Y]);const L=Math.min(m/Ur,1),H=b==="refreshing"?0:m/Ur*180,B=m>0||b==="refreshing";return h.jsxs("div",{ref:s,className:u,style:{overscrollBehaviorY:"contain"},children:[B&&h.jsx("div",{className:"pointer-events-none flex items-center justify-center md:hidden",style:{height:m,transition:b==="idle"?"height 200ms ease-out":void 0},children:h.jsx("div",{className:"flex items-center justify-center rounded-full bg-[var(--bg-card)] border border-[var(--border)]",style:{width:Rh,height:Rh,opacity:L,transition:b==="idle"?"opacity 200ms ease-out":void 0},children:b==="refreshing"?h.jsxs("svg",{width:16,height:16,viewBox:"0 0 16 16",className:"animate-spin",style:{color:"var(--accent)"},children:[h.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),h.jsx("path",{d:"M8 2a6 6 0 0 1 6 6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}):h.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16",style:{color:b==="ready"?"var(--accent)":"var(--text-muted)",transform:`rotate(${H}deg)`,transition:"color 150ms"},children:h.jsx("path",{d:"M8 3v8M5 8l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),i]})}const Tp=g.createContext({setActions:()=>{}});function X1(i){const{setActions:u}=g.useContext(Tp);g.useEffect(()=>(u(i),()=>u(null)),[i,u])}const jp=g.createContext({setSubtitle:()=>{}});function Q1(i){const{setSubtitle:u}=g.useContext(jp),s=typeof i=="string"?i:(i==null?void 0:i.text)??null,o=typeof i=="string"?i:(i==null?void 0:i.title)??(i==null?void 0:i.text)??null;g.useEffect(()=>s?(u(o&&o!==s?{text:s,title:o}:s),()=>u(null)):(u(null),()=>u(null)),[s,o,u])}const h0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:Ph},{to:"/dashboard",label:"dashboard",icon:Ih},{to:"/workers",label:"workers",icon:ap},{to:"/projects",label:"projects",icon:lb},{to:"/access-tokens",label:"tokens",icon:rb}],p0=[{to:"/docs/cli",label:"cli",icon:$s},{to:"/docs/api",label:"api",icon:ab},{to:"/docs/bot",label:"bot",icon:cb},{to:"/docs/skill",label:"skill",icon:hb},{to:"/docs/all",label:"all",icon:ub}],_0=[{to:"/admin",label:"admin",icon:mb}],g0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:Ph},{to:"/dashboard",label:"dashboard",icon:Ih}],qr={"/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_tokens",subtitle:"common.breadcrumb_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"},"/docs/bot":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_bot_sub"},"/docs/all":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_all_sub"}};function y0(i){const{t:u}=Vt();if(qr[i]){const o=qr[i];return{title:u(o.title),subtitle:u(o.subtitle)}}const s="/"+i.split("/").filter(Boolean)[0];if(qr[s]){const o=qr[s],f=i.split("/").filter(Boolean).slice(1).join(" / ");return{title:u(o.title),subtitle:f||u(o.subtitle)}}return{title:i.slice(1).replace(/\//g," // ")||"home"}}function v0(i,u){return i==="/home"?u==="/home":i==="/dashboard"?u==="/dashboard":u.startsWith(i)}function b0(){const i=gt(),{t:u}=Vt(),s={terminal:u("terminal_home.title"),dashboard:u("dashboard.title"),tasks:u("tasks.title"),workers:u("workers.title")};return h.jsxs("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)]",style:{height:48,paddingTop:4},children:[g0.map(({to:o,label:f,icon:m})=>{const _=v0(o,i.pathname);return h.jsxs(Js,{to:o,className:"flex flex-1 flex-col items-center gap-1",children:[h.jsx(m,{size:18,className:_?"text-[var(--accent)]":"text-[var(--text-muted)]"}),h.jsx("span",{className:`text-[11px] lowercase ${_?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),h.jsx(wp,{renderTrigger:o=>h.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[h.jsx(tp,{size:18,className:"text-[var(--text-muted)]"}),h.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:u("common.search_placeholder")})]})})]})}function x0(){const i=Fa(),{t:u}=Vt();return h.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:[h.jsxs("button",{onClick:()=>i("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[h.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",children:h.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),h.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",children:u("common.overlord")})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{onClick:()=>i("/profile"),className:"p-2 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]","aria-label":u("common.profile"),children:h.jsx(gb,{size:18})}),h.jsx(Sp,{}),h.jsx(cp,{})]})]})}function zs({label:i,items:u,collapsed:s}){return h.jsxs("div",{className:"mt-4 first:mt-0",children:[!s&&h.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:i}),u.map(({to:o,label:f,icon:m})=>h.jsx(Js,{to:o,className:({isActive:_})=>`flex items-center text-sm lowercase transition-colors ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${_?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:_})=>h.jsxs(h.Fragment,{children:[h.jsx(m,{size:14,style:{flexShrink:0}}),!s&&h.jsx("span",{children:_?`> ${f}`:` ${f}`})]})},o))]})}function S0(){const{user:i,logout:u}=xa(),s=Fa(),[o,f]=g.useState(!1),m=xb(),{t:_}=Vt(),{sidebarCollapsed:b,toggleSidebar:y}=kb();function p(){u(),s("/login")}return h.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)] transition-[width,min-width] duration-300 overflow-hidden",style:{width:b?56:240,minWidth:b?56:240,backgroundColor:"var(--bg-card)"},children:[h.jsx("div",{className:"flex items-center px-5",style:{height:48},children:h.jsxs("button",{onClick:()=>s("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[h.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{flexShrink:0},children:h.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),!b&&h.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)"},children:_("common.overlord")})]})}),h.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[h.jsx(zs,{label:_("common.navigation"),items:h0,collapsed:b}),h.jsx(zs,{label:_("common.docs_section"),items:p0,collapsed:b}),m&&h.jsx(zs,{label:_("common.admin_section"),items:_0,collapsed:b})]}),h.jsx("div",{className:`px-3 py-1 ${b?"flex justify-center":""}`,children:h.jsx("button",{onClick:y,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":b?"expand sidebar":"collapse sidebar",children:b?h.jsx(Pv,{size:14}):h.jsx(Iv,{size:14})})}),h.jsx("div",{className:"border-t border-[var(--border)] p-3",children:h.jsxs("div",{className:`flex items-center py-2 ${b?"justify-center":"gap-3 px-3"}`,children:[h.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:_("common.profile"),children:((i==null?void 0:i.username)??"u")[0].toUpperCase()}),!b&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:_("common.profile"),children:[h.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(i==null?void 0:i.username)??"user"}),h.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(i==null?void 0:i.role)??"user"})]}),h.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":_("common.log_out"),children:h.jsx(sb,{size:14})})]})]})}),h.jsx(u0,{isOpen:o,onClose:()=>f(!1),onConfirm:p,title:_("common.logout_title"),message:_("common.logout_message"),confirmLabel:_("common.logout"),confirmVariant:"warning"})]})}function k0({headerActions:i,subtitleOverride:u}){const s=gt(),{title:o,subtitle:f}=y0(s.pathname),m=u??f,_=typeof m=="string"?m:m==null?void 0:m.text,b=typeof m=="string"?m:(m==null?void 0:m.title)??(m==null?void 0:m.text);return h.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:[h.jsxs("div",{className:"text-sm lowercase",children:[h.jsx("span",{style:{color:"var(--text-primary)"},children:o}),_&&h.jsxs("span",{style:{color:"var(--text-muted)"},title:b,children:[" ","// ",Wh(_,40)]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[i,h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(wp,{}),h.jsx(Sp,{}),h.jsx(cp,{})]})]})]})}function E0(){const[i,u]=g.useState(null),[s,o]=g.useState(null),f=gt(),m=f.pathname==="/home",_=/^\/tasks\/\d+$/.test(f.pathname),b=f.pathname.startsWith("/docs");return g.useEffect(()=>up.getState().init(),[]),h.jsxs("div",{className:"fixed inset-x-0 top-0 flex w-full overflow-hidden font-mono md:flex-row",style:{height:"var(--app-height, 100dvh)",minHeight:"var(--app-height, 100dvh)"},children:[h.jsx(S0,{}),h.jsxs("div",{"data-testid":"app-main-column",className:"flex min-h-0 flex-1 flex-col overflow-hidden pb-[calc(48px+var(--safe-area-bottom,0px))] md:pb-0",children:[h.jsx(x0,{}),!b&&h.jsx(k0,{headerActions:i,subtitleOverride:s}),h.jsx(m0,{className:m||_?"min-h-0 flex-1 overflow-hidden bg-[var(--bg-primary)]":"min-h-0 flex-1 overflow-auto bg-[var(--bg-primary)] p-4 pb-6 md:p-6 md:pb-6",children:h.jsx(Tp.Provider,{value:{setActions:u},children:h.jsx(jp.Provider,{value:{setSubtitle:o},children:h.jsx(cv,{})})})}),h.jsx(c0,{}),h.jsx(f0,{}),h.jsx("div",{className:"safe-area-bottom-fill fixed inset-x-0 bottom-0 z-30 bg-[var(--bg-card)] md:hidden",children:h.jsx(b0,{})})]})]})}function Ah(i){var s;const u=(s=i.state)==null?void 0:s.from;return u?{from:u}:{from:{pathname:i.pathname,search:i.search}}}function li({children:i,requireAdmin:u=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:m}=xa(),_=gt();if(m)return h.jsx("div",{className:"flex h-screen items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})});if(!s)return h.jsx(ll,{to:"/login",state:Ah(_),replace:!0});if(f){const b=Ah(_);return _.pathname!=="/totp-setup"&&_.pathname!=="/bind"?h.jsx(ll,{to:"/totp-setup",state:b,replace:!0}):_.pathname==="/bind"?(sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(b.from)),h.jsx(ll,{to:"/totp-setup",state:b,replace:!0})):h.jsx(h.Fragment,{children:i})}return u&&(o==null?void 0:o.role)!==ip.ADMIN?h.jsx(ll,{to:"/home",replace:!0}):h.jsx(h.Fragment,{children:i})}function w0({children:i}){const{theme:u,resolved:s,setResolved:o}=sp();return g.useEffect(()=>{if(u!=="system"){o(u);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const m=_=>o(_.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[u,o]),g.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),h.jsx(h.Fragment,{children:i})}class T0 extends g.Component{constructor(u){super(u),this.state={hasError:!1,error:null}}static getDerivedStateFromError(u){return{hasError:!0,error:u}}render(){var u;return this.state.hasError?h.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8 font-mono",children:[h.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Br("common.runtime_error")}),h.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((u=this.state.error)==null?void 0:u.message)||Br("common.an_unexpected_error_occurred")}),h.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:[h.jsx(ep,{className:"h-3.5 w-3.5"}),Br("common.reload")]})]}):this.props.children}}function j0({isOpen:i}){const u=Fa(),{logout:s,setSessionExpired:o}=xa(),{t:f}=Vt();function m(){s(),o(!1),u("/login")}return i?h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),h.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:h.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[h.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:h.jsx(ob,{className:"h-7 w-7 text-[var(--warning)]"})}),h.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),h.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),h.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 zh=5;let ba=[];const Bs=new Set;function Rp(){Bs.forEach(i=>i())}function R0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(i,u,s=4e3){const o=R0();return ba=[...ba,{id:o,variant:i,message:u,duration:s}],ba.length>zh&&(ba=ba.slice(ba.length-zh)),Rp(),o}Wa.success=(i,u)=>Wa("success",i,u);Wa.error=(i,u)=>Wa("error",i,u);Wa.warning=(i,u)=>Wa("warning",i,u);Wa.info=(i,u)=>Wa("info",i,u);function A0(i){ba=ba.filter(u=>u.id!==i),Rp()}function z0(){const[,i]=g.useState(0);return g.useEffect(()=>{const u=()=>i(s=>s+1);return Bs.add(u),()=>{Bs.delete(u)}},[]),ba}const O0={success:{icon:eb,borderColor:"var(--accent)"},error:{icon:tb,borderColor:"var(--destructive)"},warning:{icon:np,borderColor:"var(--warning)"},info:{icon:ib,borderColor:"var(--info)"}};function C0({item:i}){const u=O0[i.variant],s=u.icon,{t:o}=Vt(),f=g.useCallback(()=>A0(i.id),[i.id]);return g.useEffect(()=>{if(!i.duration)return;const m=setTimeout(f,i.duration);return()=>clearTimeout(m)},[i.duration,f]),h.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${u.borderColor}`},role:"alert",children:[h.jsx(s,{className:"h-4 w-4 shrink-0",style:{color:u.borderColor}}),h.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:i.message}),h.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:h.jsx(lp,{className:"h-3.5 w-3.5"})})]})}function D0(){const i=z0();return i.length===0?null:h.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:i.map(u=>h.jsx("div",{className:"pointer-events-auto",children:h.jsx(C0,{item:u})},u.id))})}const N0=g.lazy(()=>ne(()=>import("./LandingPage-CP_wXo09.js"),__vite__mapDeps([0,1,2,3,4,5]))),M0=g.lazy(()=>ne(()=>import("./LoginPage-Dfe5P2Mc.js"),[])),U0=g.lazy(()=>ne(()=>import("./TotpSetupPage-BQmRtycf.js"),[])),q0=g.lazy(()=>ne(()=>import("./NotFoundPage-CZ6vHhxQ.js"),[])),L0=g.lazy(()=>ne(()=>import("./HomePage-DSD_C6l7.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),H0=g.lazy(()=>ne(()=>import("./TerminalHomePage-DSB_fbDP.js"),__vite__mapDeps([15,16,17,18,10,11,19,8,12,13,20,21,22]))),B0=g.lazy(()=>ne(()=>import("./TaskListPage-C9R3EahV.js"),__vite__mapDeps([23,16,7,8,12,14,24,19,5,25,9,20,26,11]))),Y0=g.lazy(()=>ne(()=>import("./TaskDetailPage-CdkjfSWn.js"),__vite__mapDeps([27,16,17,18,12,19,8,14,28,21,24,29,30]))),G0=g.lazy(()=>ne(()=>import("./WorkerListPage-DbjJDQp5.js"),__vite__mapDeps([31,8,32,33,34,35,36,22,5,30,19,25,9,13,20]))),V0=g.lazy(()=>ne(()=>import("./WorkerDetailPage-DIlJMx4z.js"),__vite__mapDeps([37,12,8,38,32,13,14,39,28]))),X0=g.lazy(()=>ne(()=>import("./WorkerSetupGuidePage-BpTJlpJ_.js"),__vite__mapDeps([33,34,35,36,22]))),Q0=g.lazy(()=>ne(()=>import("./ProjectListPage-DznwqHll.js"),__vite__mapDeps([40,19,25,9,12,13,20]))),Z0=g.lazy(()=>ne(()=>import("./ProjectDetailPage-Bi-3DLgA.js"),__vite__mapDeps([41,42,19,14,12,8,38,13,43,39,20]))),K0=g.lazy(()=>ne(()=>import("./EditProjectPage-IRTaCyfg.js"),__vite__mapDeps([44,19,42,20]))),J0=g.lazy(()=>ne(()=>import("./PipelineEditorPage-BF3eMSCM.js"),__vite__mapDeps([45,19]))),$0=g.lazy(()=>ne(()=>import("./ProfilePage-DKKDCTx9.js"),__vite__mapDeps([46,47,38,13]))),W0=g.lazy(()=>ne(()=>import("./BindPlatformPage-DLQdiRFL.js"),[])),F0=g.lazy(()=>ne(()=>import("./AccessTokensPage-CZ_Yavhf.js"),__vite__mapDeps([48,19,25,9,12,13,20,5,39]))),I0=g.lazy(()=>ne(()=>import("./CliReferencePage-B6gTsb4v.js"),__vite__mapDeps([49,50,5,20]))),P0=g.lazy(()=>ne(()=>import("./ApiReferencePage-DsFA13KQ.js"),__vite__mapDeps([51,50,5,20]))),e1=g.lazy(()=>ne(()=>import("./SkillPage-DqvIM6pJ.js"),__vite__mapDeps([52,53,5,29]))),t1=g.lazy(()=>ne(()=>import("./DocsLayout-Du6H0AOl.js"),__vite__mapDeps([54,28]))),a1=g.lazy(()=>ne(()=>import("./InstallationPage-BvBVyGkY.js"),__vite__mapDeps([55,53,5]))),n1=g.lazy(()=>ne(()=>import("./DeveloperSetupPage-Bq-eKaT0.js"),__vite__mapDeps([56,53,5]))),l1=g.lazy(()=>ne(()=>import("./WorkerSetupPage-CcByT6so.js"),__vite__mapDeps([57,53,5]))),i1=g.lazy(()=>ne(()=>import("./BotSetupPage-ByjmKjXY.js"),__vite__mapDeps([58,53,5]))),r1=g.lazy(()=>ne(()=>import("./LocalDevelopmentPage-BxVqnOjh.js"),__vite__mapDeps([59,53,5]))),u1=g.lazy(()=>ne(()=>import("./WorkerOperationsPage-B3KV1JvF.js"),[])),o1=g.lazy(()=>ne(()=>import("./DeploymentPage-CWhXb1UF.js"),__vite__mapDeps([60,53,5]))),Oh=g.lazy(()=>ne(()=>import("./BotIntegrationPage-D6-XQG0r.js"),[])),s1=g.lazy(()=>ne(()=>import("./PipelineConfigPage-C2XugReU.js"),__vite__mapDeps([61,53,5]))),c1=g.lazy(()=>ne(()=>import("./DevWorkflowPage-nTHhaHVz.js"),__vite__mapDeps([62,53,5]))),f1=g.lazy(()=>ne(()=>import("./PermissionsPage-C89LUwtR.js"),[])),d1=g.lazy(()=>ne(()=>import("./EnvVariablesPage-CY6bnuuq.js"),__vite__mapDeps([63,53,5]))),m1=g.lazy(()=>ne(()=>import("./ArchitecturePage-DDc-vReK.js"),__vite__mapDeps([64,53,5]))),h1=g.lazy(()=>ne(()=>import("./ChangelogPage-n7yRBO_5.js"),[])),p1=g.lazy(()=>ne(()=>import("./AgentCliPage-CQpk2Yo_.js"),__vite__mapDeps([65,53,5]))),_1=g.lazy(()=>ne(()=>import("./DocsIndexPage-CzA83ol_.js"),__vite__mapDeps([66,35,2,3,36]))),g1=g.lazy(()=>ne(()=>import("./AdminPage-BlGfVUEg.js"),__vite__mapDeps([67,4,2,68,36]))),y1=g.lazy(()=>ne(()=>import("./DeveloperManage-APQbY_-q.js"),__vite__mapDeps([69,19,47,25,9,13,8,20,4,43,21]))),v1=g.lazy(()=>ne(()=>import("./BotManage-DRTJDHW6.js"),__vite__mapDeps([70,19,53,5,39,20,25,9,13,8,2,43]))),b1=g.lazy(()=>ne(()=>import("./TokenManage-CvFjNduI.js"),__vite__mapDeps([71,34,5,29,25,9,13,8,20]))),x1=g.lazy(()=>ne(()=>import("./AuditLogPage-BLTNLR9x.js"),__vite__mapDeps([72,19,25,9,68,26,11]))),S1=g.lazy(()=>ne(()=>import("./SettingsPage-C1av7piJ.js"),[]));function k1(){return h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function E1(){const i=xa(u=>u.sessionExpired);return h.jsxs(w0,{children:[h.jsx(D0,{}),h.jsx(T0,{children:h.jsxs(qv,{children:[h.jsx(j0,{isOpen:i}),h.jsx(g.Suspense,{fallback:h.jsx(k1,{}),children:h.jsxs(dv,{children:[h.jsx(ee,{path:"/",element:h.jsx(N0,{})}),h.jsx(ee,{path:"/login",element:h.jsx(M0,{})}),h.jsx(ee,{path:"/totp-setup",element:h.jsx(li,{children:h.jsx(U0,{})})}),h.jsx(ee,{path:"/bind",element:h.jsx(li,{children:h.jsx(W0,{})})}),h.jsxs(ee,{element:h.jsx(li,{children:h.jsx(E0,{})}),children:[h.jsx(ee,{path:"/home",element:h.jsx(H0,{})}),h.jsx(ee,{path:"/dashboard",element:h.jsx(L0,{})}),h.jsx(ee,{path:"/tasks",element:h.jsx(B0,{})}),h.jsx(ee,{path:"/tasks/:id",element:h.jsx(Y0,{})}),h.jsx(ee,{path:"/workers",element:h.jsx(G0,{})}),h.jsx(ee,{path:"/workers/setup",element:h.jsx(li,{requireAdmin:!0,children:h.jsx(X0,{})})}),h.jsx(ee,{path:"/workers/:id",element:h.jsx(V0,{})}),h.jsx(ee,{path:"/projects",element:h.jsx(Q0,{})}),h.jsx(ee,{path:"/projects/:key",element:h.jsx(Z0,{})}),h.jsx(ee,{path:"/projects/:key/edit",element:h.jsx(K0,{})}),h.jsx(ee,{path:"/projects/:key/pipeline",element:h.jsx(J0,{})}),h.jsx(ee,{path:"/profile",element:h.jsx($0,{})}),h.jsx(ee,{path:"/access-tokens",element:h.jsx(F0,{})}),h.jsxs(ee,{path:"/docs",element:h.jsx(t1,{}),children:[h.jsx(ee,{index:!0,element:h.jsx(ll,{to:"cli",replace:!0})}),h.jsx(ee,{path:"cli",element:h.jsx(I0,{})}),h.jsx(ee,{path:"api",element:h.jsx(P0,{})}),h.jsx(ee,{path:"bot",element:h.jsx(Oh,{})}),h.jsx(ee,{path:"all",element:h.jsx(_1,{})}),h.jsx(ee,{path:"skill",element:h.jsx(e1,{})}),h.jsx(ee,{path:"installation",element:h.jsx(a1,{})}),h.jsx(ee,{path:"developer-setup",element:h.jsx(n1,{})}),h.jsx(ee,{path:"worker-setup",element:h.jsx(l1,{})}),h.jsx(ee,{path:"bot-setup",element:h.jsx(i1,{})}),h.jsx(ee,{path:"local-development",element:h.jsx(r1,{})}),h.jsx(ee,{path:"worker-operations",element:h.jsx(u1,{})}),h.jsx(ee,{path:"deployment",element:h.jsx(o1,{})}),h.jsx(ee,{path:"bot-integration",element:h.jsx(Oh,{})}),h.jsx(ee,{path:"pipeline-config",element:h.jsx(s1,{})}),h.jsx(ee,{path:"dev-workflow",element:h.jsx(c1,{})}),h.jsx(ee,{path:"permissions",element:h.jsx(f1,{})}),h.jsx(ee,{path:"env-variables",element:h.jsx(d1,{})}),h.jsx(ee,{path:"architecture",element:h.jsx(m1,{})}),h.jsx(ee,{path:"agent-cli",element:h.jsx(p1,{})}),h.jsx(ee,{path:"changelog",element:h.jsx(h1,{})})]}),h.jsxs(ee,{path:"/admin",element:h.jsx(li,{requireAdmin:!0,children:h.jsx(g1,{})}),children:[h.jsx(ee,{index:!0,element:h.jsx(ll,{to:"developers",replace:!0})}),h.jsx(ee,{path:"developers",element:h.jsx(y1,{})}),h.jsx(ee,{path:"bots",element:h.jsx(v1,{})}),h.jsx(ee,{path:"tokens",element:h.jsx(b1,{})}),h.jsx(ee,{path:"audit-logs",element:h.jsx(x1,{})}),h.jsx(ee,{path:"settings",element:h.jsx(S1,{})})]})]}),h.jsx(ee,{path:"*",element:h.jsx(q0,{})})]})})]})})]})}function w1(i){var u,s;return((u=i.matchMedia)==null?void 0:u.call(i,"(display-mode: standalone)").matches)===!0||((s=i.navigator)==null?void 0:s.standalone)===!0}function T1(i){var s,o;const u=((s=i.navigator)==null?void 0:s.userAgent)??"";return/iPhone|iPad|iPod/i.test(u)||/Macintosh/i.test(u)&&(((o=i.navigator)==null?void 0:o.maxTouchPoints)??0)>1}function j1(i){const u=i.activeElement;if(!(u instanceof HTMLElement))return!1;const s=u.tagName;return u.isContentEditable||s==="INPUT"||s==="TEXTAREA"||s==="SELECT"}function R1(i){const u=i.screen;if(!u)return null;const s=Math.round(u.width),o=Math.round(u.height);return i.innerHeight>=i.innerWidth?Math.max(s,o):Math.min(s,o)}function A1(i=window,u=document){const s=u.documentElement,o=i.visualViewport??null;let f=-1;const m=()=>{const _=Math.round((o==null?void 0:o.height)??0),b=Math.round(i.innerHeight);let y=_>0?_:b;if(w1(i)&&T1(i)&&!j1(u)){const p=R1(i);p!==null&&(y=Math.max(y,b,p))}y!==f&&(f=y,s.style.setProperty("--app-height",`${y}px`))};return m(),i.addEventListener("resize",m),i.addEventListener("orientationchange",m),o==null||o.addEventListener("resize",m),()=>{i.removeEventListener("resize",m),i.removeEventListener("orientationchange",m),o==null||o.removeEventListener("resize",m)}}xa.getState().initialize();A1(window,document);const z1=window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0;if(z1){document.documentElement.classList.add("pwa-standalone");const i=window.matchMedia("(prefers-color-scheme: dark)").matches,u=localStorage.getItem("overlord-theme"),s=u==="dark"||u!=="light"&&i;document.body.style.backgroundColor=s?"#171717":"#FFFFFF",new MutationObserver(()=>{const o=document.documentElement.classList.contains("dark");document.body.style.backgroundColor=o?"#171717":"#FFFFFF"}).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})}cy.createRoot(document.getElementById("root")).render(h.jsx(g.StrictMode,{children:h.jsx(E1,{})}));export{Js as $,C1 as A,D1 as B,Fv as C,ip as D,eb as E,q1 as F,H1 as G,Ns as H,np as I,U1 as J,ep as K,Jh as L,cb as M,ll as N,uy as O,c0 as P,Wh as Q,Rr as R,ap as S,cp as T,rb as U,sb as V,M1 as W,lp as X,L1 as Y,ab as Z,hb as _,Vt as a,cv as a0,B1 as a1,Y1 as a2,tb as a3,$s as b,xe as c,mb as d,ub as e,Fa as f,gt as g,Xr as h,xb as i,h as j,up as k,kp as l,Ep as m,a0 as n,Fr as o,N1 as p,Q1 as q,g as r,V1 as s,Wa as t,xa as u,u0 as v,X1 as w,tp as x,Ph as y,G1 as z};
242
+ "{description}"`}};function jb(i,u){const s=u.split(".");let o=i;for(const f of s){if(o==null||typeof o!="object")return u;o=o[f]}return typeof o=="string"?o:u}function Rb(i,u){return u?i.replace(/\{(\w+)\}/g,(s,o)=>u[o]!=null?String(u[o]):`{${o}}`):i}function Br(i,u){return Rb(jb(Tb,i),u)}function Vt(){return{t:g.useCallback((u,s)=>Br(u,s),[])}}function cp(){const{theme:i,setTheme:u}=sp(),{t:s}=Vt(),o=i==="dark"||i==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function f(){u(o?"light":"dark")}return h.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?h.jsx(_b,{size:16}):h.jsx(fb,{size:16})})}class Ns extends Error{constructor(s,o,f){const m=s.status||s.status===0?s.status:"",_=s.statusText??"",b=`${m} ${_}`.trim(),y=b?`status code ${b}`:"an unknown error";super(`Request failed with ${y}: ${o.method} ${o.url}`);Ve(this,"response");Ve(this,"request");Ve(this,"options");this.name="HTTPError",this.response=s,this.request=o,this.options=f}}class fp 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);Ve(this,"name","NonError");Ve(this,"value");this.value=s}}class Rs extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new fp(s.cause):void 0;super(s!=null&&s.code?`Forced retry: ${s.code}`:"Forced retry",o?{cause:o}:void 0);Ve(this,"name","ForceRetryError");Ve(this,"customDelay");Ve(this,"code");Ve(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 Sh=(()=>{let i=!1,u=!1;const s=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(s&&o)try{u=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return i=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return i&&!u})(),Ab=typeof globalThis.AbortController=="function",dp=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",zb=typeof globalThis.ReadableStream=="function",Ob=typeof globalThis.FormData=="function",mp=["get","post","put","patch","head","delete"],Cb={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},As=2147483647,Db=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,hp=Symbol("stop");class pp{constructor(u){Ve(this,"options");this.options=u}}const Nb=i=>new pp(i),Mb={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},Ub={next:!0},qb={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},Lb=i=>{if(!i)return 0;if(i instanceof FormData){let u=0;for(const[s,o]of i)u+=Db,u+=new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length,u+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return u}if(i instanceof Blob)return i.size;if(i instanceof ArrayBuffer)return i.byteLength;if(typeof i=="string")return new TextEncoder().encode(i).length;if(i instanceof URLSearchParams)return new TextEncoder().encode(i.toString()).length;if("byteLength"in i)return i.byteLength;if(typeof i=="object"&&i!==null)try{const u=JSON.stringify(i);return new TextEncoder().encode(u).length}catch{return 0}return 0},_p=(i,u,s)=>{let o,f=0;return i.pipeThrough(new TransformStream({transform(m,_){if(_.enqueue(m),o){f+=o.byteLength;let b=u===0?0:f/u;b>=1&&(b=1-Number.EPSILON),s==null||s({percent:b,totalBytes:Math.max(u,f),transferredBytes:f},o)}o=m},flush(){o&&(f+=o.byteLength,s==null||s({percent:1,totalBytes:Math.max(u,f),transferredBytes:f},o))}}))},Hb=(i,u)=>{if(!i.body)return i;if(i.status===204)return new Response(null,{status:i.status,statusText:i.statusText,headers:i.headers});const s=Math.max(0,Number(i.headers.get("content-length"))||0);return new Response(_p(i.body,s,u),{status:i.status,statusText:i.statusText,headers:i.headers})},Bb=(i,u,s)=>{if(!i.body)return i;const o=Lb(s??i.body);return new Request(i,{duplex:"half",body:_p(i.body,o,u)})},yn=i=>i!==null&&typeof i=="object",Dr=(...i)=>{for(const u of i)if((!yn(u)||Array.isArray(u))&&u!==void 0)throw new TypeError("The `options` argument must be an object");return Ws({},...i)},gp=(i={},u={})=>{const s=new globalThis.Headers(i),o=u instanceof globalThis.Headers,f=new globalThis.Headers(u);for(const[m,_]of f.entries())o&&_==="undefined"||_===void 0?s.delete(m):s.set(m,_);return s};function Nr(i,u,s){return Object.hasOwn(u,s)&&u[s]===void 0?[]:Ws(i[s]??[],u[s]??[])}const yp=(i={},u={})=>({beforeRequest:Nr(i,u,"beforeRequest"),beforeRetry:Nr(i,u,"beforeRetry"),afterResponse:Nr(i,u,"afterResponse"),beforeError:Nr(i,u,"beforeError")}),Yb=(i,u)=>{const s=new URLSearchParams;for(const o of[i,u])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(yn(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,_]of f.entries())s.append(m,_)}return s},Ws=(...i)=>{let u={},s={},o={},f;const m=[];for(const _ of i)if(Array.isArray(_))Array.isArray(u)||(u=[]),u=[...u,..._];else if(yn(_)){for(let[b,y]of Object.entries(_)){if(b==="signal"&&y instanceof globalThis.AbortSignal){m.push(y);continue}if(b==="context"){if(y!=null&&(!yn(y)||Array.isArray(y)))throw new TypeError("The `context` option must be an object");u={...u,context:y==null?{}:{...u.context,...y}};continue}if(b==="searchParams"){y==null?f=void 0:f=f===void 0?y:Yb(f,y);continue}yn(y)&&b in u&&(y=Ws(u[b],y)),u={...u,[b]:y}}yn(_.hooks)&&(o=yp(o,_.hooks),u.hooks=o),yn(_.headers)&&(s=gp(s,_.headers),u.headers=s)}return f!==void 0&&(u.searchParams=f),m.length>0&&(m.length===1?u.signal=m[0]:dp?u.signal=AbortSignal.any(m):u.signal=m.at(-1)),u},Gb=i=>mp.includes(i)?i.toUpperCase():i,Vb=["get","put","head","delete","options","trace"],Xb=[408,413,429,500,502,503,504],Qb=[413,429,503],kh={limit:2,methods:Vb,statusCodes:Xb,afterStatusCodes:Qb,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:i=>.3*2**(i-1)*1e3,jitter:void 0,retryOnTimeout:!1},Zb=(i={})=>{if(typeof i=="number")return{...kh,limit:i};if(i.methods&&!Array.isArray(i.methods))throw new Error("retry.methods must be an array");if(i.methods&&(i.methods=i.methods.map(s=>s.toLowerCase())),i.statusCodes&&!Array.isArray(i.statusCodes))throw new Error("retry.statusCodes must be an array");const u=Object.fromEntries(Object.entries(i).filter(([,s])=>s!==void 0));return{...kh,...u}};class Ms extends Error{constructor(s){super(`Request timed out: ${s.method} ${s.url}`);Ve(this,"request");this.name="TimeoutError",this.request=s}}async function Kb(i,u,s,o){return new Promise((f,m)=>{const _=setTimeout(()=>{s&&s.abort(),m(new Ms(i))},o.timeout);o.fetch(i,u).then(f).catch(m).then(()=>{clearTimeout(_)})})}async function Jb(i,{signal:u}){return new Promise((s,o)=>{u&&(u.throwIfAborted(),u.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(m),o(u.reason)}const m=setTimeout(()=>{u==null||u.removeEventListener("abort",f),s()},i)})}const $b=(i,u)=>{const s={};for(const o in u)Object.hasOwn(u,o)&&!(o in qb)&&!(o in Mb)&&(!(o in i)||o in Ub)&&(s[o]=u[o]);return s},Wb=i=>i===void 0?!1:Array.isArray(i)?i.length>0:i instanceof URLSearchParams?i.size>0:typeof i=="object"?Object.keys(i).length>0:typeof i=="string"?i.trim().length>0:!!i;function Fb(i){return i instanceof Ns||(i==null?void 0:i.name)===Ns.name}function Ib(i){return i instanceof Ms||(i==null?void 0:i.name)===Ms.name}var Kr,vp,Jt,Bt,rt,Q,$a,ea,vn,oe,Yr,bp,Us,Gr,Ja,qs,xp,ii,Vr,Ls;const ri=class ri{constructor(u,s={}){Pt(this,oe);Ve(this,"request");Pt(this,Jt);Pt(this,Bt,0);Pt(this,rt);Pt(this,Q);Pt(this,$a);Pt(this,ea);Pt(this,vn);var f,m,_;if(Kt(this,rt,u),Kt(this,Q,{...s,headers:gp(q(this,rt).headers,s.headers),hooks:yp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Gb(s.method??q(this,rt).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:Zb(s.retry),throwHttpErrors:s.throwHttpErrors??!0,timeout:s.timeout??1e4,fetch:s.fetch??globalThis.fetch.bind(globalThis),context:s.context??{}}),typeof q(this,rt)!="string"&&!(q(this,rt)instanceof URL||q(this,rt)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(q(this,Q).prefixUrl&&typeof q(this,rt)=="string"){if(q(this,rt).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");q(this,Q).prefixUrl.endsWith("/")||(q(this,Q).prefixUrl+="/"),Kt(this,rt,q(this,Q).prefixUrl+q(this,rt))}Ab&&dp&&(Kt(this,ea,q(this,Q).signal??q(this,rt).signal),Kt(this,Jt,new globalThis.AbortController),q(this,Q).signal=q(this,ea)?AbortSignal.any([q(this,ea),q(this,Jt).signal]):q(this,Jt).signal),Sh&&(q(this,Q).duplex="half"),q(this,Q).json!==void 0&&(q(this,Q).body=((m=(f=q(this,Q)).stringifyJson)==null?void 0:m.call(f,q(this,Q).json))??JSON.stringify(q(this,Q).json),q(this,Q).headers.set("content-type",q(this,Q).headers.get("content-type")??"application/json"));const o=s.headers&&new globalThis.Headers(s.headers).has("content-type");if(q(this,rt)instanceof globalThis.Request&&(Ob&&q(this,Q).body instanceof globalThis.FormData||q(this,Q).body instanceof URLSearchParams)&&!o&&q(this,Q).headers.delete("content-type"),this.request=new globalThis.Request(q(this,rt),q(this,Q)),Wb(q(this,Q).searchParams)){const y="?"+(typeof q(this,Q).searchParams=="string"?q(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ke(_=ri,Kr,vp).call(_,q(this,Q).searchParams)).toString()),p=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,y);this.request=new globalThis.Request(p,q(this,Q))}if(q(this,Q).onUploadProgress){if(typeof q(this,Q).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Sh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=ke(this,oe,Ls).call(this,this.request,q(this,Q).body??void 0)}}static create(u,s){var _,b,y;const o=new ri(u,s),f=async()=>{var w,k,N,Y,L,H,B,U,K,X,ue,ce;if(typeof q(o,Q).timeout=="number"&&q(o,Q).timeout>As)throw new RangeError(`The \`timeout\` option cannot be greater than ${As}`);await Promise.resolve();let p=await ke(w=o,oe,xp).call(w);for(const _e of q(o,Q).hooks.afterResponse){const F=ke(k=o,oe,Us).call(k,p.clone());let W;try{W=await _e(o.request,ke(N=o,oe,ii).call(N),F,{retryCount:q(o,Bt)})}catch(Pe){throw ke(Y=o,oe,Ja).call(Y,F),ke(L=o,oe,Ja).call(L,p),Pe}if(W instanceof pp)throw ke(H=o,oe,Ja).call(H,F),ke(B=o,oe,Ja).call(B,p),new Rs(W.options);const se=W instanceof globalThis.Response?W:p;F!==se&&ke(U=o,oe,Ja).call(U,F),p!==se&&ke(K=o,oe,Ja).call(K,p),p=se}if(ke(X=o,oe,Us).call(X,p),!p.ok&&(typeof q(o,Q).throwHttpErrors=="function"?q(o,Q).throwHttpErrors(p.status):q(o,Q).throwHttpErrors)){let _e=new Ns(p,o.request,ke(ue=o,oe,ii).call(ue));for(const F of q(o,Q).hooks.beforeError)_e=await F(_e,{retryCount:q(o,Bt)});throw _e}if(q(o,Q).onDownloadProgress){if(typeof q(o,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!zb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const _e=p.clone();return ke(ce=o,oe,Ja).call(ce,p),Hb(_e,q(o,Q).onDownloadProgress)}return p},m=ke(_=o,oe,qs).call(_,f).finally(()=>{var w,k;const p=q(o,$a);ke(w=o,oe,Gr).call(w,(p==null?void 0:p.body)??void 0),ke(k=o,oe,Gr).call(k,o.request.body??void 0)});for(const[p,w]of Object.entries(Cb))p==="bytes"&&typeof((y=(b=globalThis.Response)==null?void 0:b.prototype)==null?void 0:y.bytes)!="function"||(m[p]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||w);const k=await m;if(p==="json"){if(k.status===204)return"";const N=await k.text();return N===""?"":s.parseJson?s.parseJson(N):JSON.parse(N)}return k[p]()});return m}};Kr=new WeakSet,vp=function(u){return u&&typeof u=="object"&&!Array.isArray(u)&&!(u instanceof URLSearchParams)?Object.fromEntries(Object.entries(u).filter(([,s])=>s!==void 0)):u},Jt=new WeakMap,Bt=new WeakMap,rt=new WeakMap,Q=new WeakMap,$a=new WeakMap,ea=new WeakMap,vn=new WeakMap,oe=new WeakSet,Yr=function(){const u=q(this,Q).retry.delay(q(this,Bt));let s=u;q(this,Q).retry.jitter===!0?s=Math.random()*u:typeof q(this,Q).retry.jitter=="function"&&(s=q(this,Q).retry.jitter(u),(!Number.isFinite(s)||s<0)&&(s=u));const o=q(this,Q).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,s)},bp=async function(u){if(eh(this,Bt)._++,q(this,Bt)>q(this,Q).retry.limit)throw u;const s=u instanceof Error?u:new fp(u);if(s instanceof Rs)return s.customDelay??ke(this,oe,Yr).call(this);if(!q(this,Q).retry.methods.includes(this.request.method.toLowerCase()))throw u;if(q(this,Q).retry.shouldRetry!==void 0){const o=await q(this,Q).retry.shouldRetry({error:s,retryCount:q(this,Bt)});if(o===!1)throw u;if(o===!0)return ke(this,oe,Yr).call(this)}if(Ib(u)&&!q(this,Q).retry.retryOnTimeout)throw u;if(Fb(u)){if(!q(this,Q).retry.statusCodes.includes(u.response.status))throw u;const o=u.response.headers.get("Retry-After")??u.response.headers.get("RateLimit-Reset")??u.response.headers.get("X-RateLimit-Retry-After")??u.response.headers.get("X-RateLimit-Reset")??u.response.headers.get("X-Rate-Limit-Reset");if(o&&q(this,Q).retry.afterStatusCodes.includes(u.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=q(this,Q).retry.maxRetryAfter??f;return f<m?f:m}if(u.response.status===413)throw u}return ke(this,oe,Yr).call(this)},Us=function(u){return q(this,Q).parseJson&&(u.json=async()=>q(this,Q).parseJson(await u.text())),u},Gr=function(u){u&&u.cancel().catch(()=>{})},Ja=function(u){ke(this,oe,Gr).call(this,u.body??void 0)},qs=async function(u){try{return await u()}catch(s){const o=Math.min(await ke(this,oe,bp).call(this,s),As);if(q(this,Bt)<1)throw s;if(await Jb(o,q(this,ea)?{signal:q(this,ea)}:{}),s instanceof Rs&&s.customRequest){const f=q(this,Q).signal?new globalThis.Request(s.customRequest,{signal:q(this,Q).signal}):new globalThis.Request(s.customRequest);ke(this,oe,Vr).call(this,f)}for(const f of q(this,Q).hooks.beforeRetry){const m=await f({request:this.request,options:ke(this,oe,ii).call(this),error:s,retryCount:q(this,Bt)});if(m instanceof globalThis.Request){ke(this,oe,Vr).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===hp)return}return ke(this,oe,qs).call(this,u)}},xp=async function(){var s;(s=q(this,Jt))!=null&&s.signal.aborted&&(Kt(this,Jt,new globalThis.AbortController),q(this,Q).signal=q(this,ea)?AbortSignal.any([q(this,ea),q(this,Jt).signal]):q(this,Jt).signal,this.request=new globalThis.Request(this.request,{signal:q(this,Q).signal}));for(const o of q(this,Q).hooks.beforeRequest){const f=await o(this.request,ke(this,oe,ii).call(this),{retryCount:q(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ke(this,oe,Vr).call(this,f);break}}const u=$b(this.request,q(this,Q));return Kt(this,$a,this.request),this.request=q(this,$a).clone(),q(this,Q).timeout===!1?q(this,Q).fetch(q(this,$a),u):Kb(q(this,$a),u,q(this,Jt),q(this,Q))},ii=function(){if(!q(this,vn)){const{hooks:u,...s}=q(this,Q);Kt(this,vn,Object.freeze(s))}return q(this,vn)},Vr=function(u){Kt(this,vn,void 0),this.request=ke(this,oe,Ls).call(this,u)},Ls=function(u,s){return!q(this,Q).onUploadProgress||!u.body?u:Bb(u,q(this,Q).onUploadProgress,s??q(this,Q).body??void 0)},Pt(ri,Kr);let Zr=ri;/*! MIT License © Sindre Sorhus */const Hs=i=>{const u=(s,o)=>Zr.create(s,Dr(i,o));for(const s of mp)u[s]=(o,f)=>Zr.create(o,Dr(i,f,{method:s}));return u.create=s=>Hs(Dr(s)),u.extend=s=>(typeof s=="function"&&(s=s(i??{})),Hs(Dr(i,s))),u.stop=hp,u.retry=Nb,u},Eh=Hs();let Mr=null;const Xr=Eh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[i=>{const u=xa.getState().accessToken;u&&i.headers.set("Authorization",`Bearer ${u}`)}],afterResponse:[async(i,u,s)=>{if(s.status===401&&!i.headers.has("X-Retry-After-Refresh")){Mr||(Mr=xa.getState().refresh().finally(()=>{Mr=null}));try{await Mr}catch{throw s}const o=xa.getState().accessToken;return o&&i.headers.set("Authorization",`Bearer ${o}`),i.headers.set("X-Retry-After-Refresh","1"),Eh(i,u)}}]}}),Pb=3e4;function e0(i){if(i.link)return i.link;const u=(i.title+" "+i.body).match(/task\s*#?(\d+)/i);if(u)return`/tasks/${u[1]}`;const s=(i.title+" "+i.body).match(/worker\s+(\S+)/i);return s?`/workers/${s[1]}`:null}function Sp(){const i=Fa(),[u,s]=g.useState([]),[o,f]=g.useState(0),[m,_]=g.useState(!1),[b,y]=g.useState(!1),p=g.useRef(null),{t:w}=Vt(),k=g.useRef(async()=>{try{y(!0);const H=(await Xr.get("web/notifications",{searchParams:{limit:"20"}}).json()).data,B=H.filter(U=>!U.isRead).length;s(U=>U.length===H.length&&U.every((K,X)=>K.id===H[X].id&&K.isRead===H[X].isRead)?U:H),f(U=>U===B?U:B)}catch{}finally{y(!1)}});g.useEffect(()=>{k.current();const L=setInterval(()=>k.current(),Pb);return()=>clearInterval(L)},[]),g.useEffect(()=>{function L(H){p.current&&!p.current.contains(H.target)&&_(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);async function N(L){try{await Xr.post(`web/notifications/${L}/read`),s(H=>H.map(B=>B.id===L?{...B,isRead:!0}:B)),f(H=>Math.max(0,H-1))}catch{}}async function Y(){try{await Xr.post("web/notifications/read-all"),s(L=>L.map(H=>({...H,isRead:!0}))),f(0)}catch{}}return h.jsxs("div",{className:"relative",ref:p,children:[h.jsxs("button",{type:"button",onClick:()=>_(L=>!L),"aria-label":w("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:[h.jsx($v,{size:16}),o>0&&h.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&&h.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:[h.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[h.jsx("span",{className:"text-sm font-semibold",children:w("common.notifications")}),o>0&&h.jsxs("button",{type:"button",onClick:Y,"aria-label":w("common.mark_all_read"),className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[h.jsx(Wv,{className:"h-3.5 w-3.5"}),w("common.mark_all_read")]})]}),h.jsx("div",{className:"max-h-80 overflow-y-auto",children:b&&u.length===0?h.jsx("div",{className:"flex justify-center py-8",children:h.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):u.length===0?h.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[h.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),h.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:w("common.no_notifications")})]}):u.map(L=>{const H=e0(L);return h.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${H?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${L.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{H&&(L.isRead||N(L.id),_(!1),i(H))},children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"truncate text-sm font-medium",title:L.title,children:L.title}),h.jsx("p",{className:"truncate text-xs text-[var(--text-secondary)]",title:L.body,children:L.body}),h.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(L.createdAt).toLocaleString()})]}),!L.isRead&&h.jsx("button",{type:"button",onClick:B=>{B.stopPropagation(),N(L.id)},"aria-label":w("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:h.jsx(Fv,{className:"h-3.5 w-3.5"})})]},L.id)})})]})]})}function t0(i){return i&&i.trim().length>0?i:null}function kp(i,u=50){return t0(i.name)??Wh(i.description,u)}function a0(i){return i.description}function Ep(i){return`#${i.id} ${a0(i)}`}function V1(i,u=100){return{text:`#${i.id} ${kp(i,u)}`,title:Ep(i)}}function n0(i){return{tasks:i.tasks.map(u=>({type:"task",id:u.id,title:`#${u.id} ${kp(u)}`,subtitle:`${u.status} · ${u.project_key}`,hoverTitle:Ep(u)})),workers:(i.workers??[]).map(u=>({type:"worker",id:u.id,title:u.name,subtitle:`${u.hostname} · ${u.status}`})),projects:i.projects.map(u=>({type:"project",id:u.key,title:u.name,subtitle:u.repository}))}}const l0=300,wh={tasks:pb,workers:ap,projects:nb},i0={tasks:"tasks",workers:"workers",projects:"projects"};function wp({renderTrigger:i}={}){const[u,s]=g.useState(""),[o,f]=g.useState({tasks:[],workers:[],projects:[]}),[m,_]=g.useState(!1),[b,y]=g.useState(!1),[p,w]=g.useState(0),k=g.useRef(null),N=g.useRef(null),Y=g.useRef(void 0),L=g.useRef(void 0),H=Fa(),{t:B}=Vt(),U=g.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),K=g.useCallback(async W=>{var Pe;if(!W.trim()){f({tasks:[],workers:[],projects:[]});return}(Pe=L.current)==null||Pe.abort();const se=new AbortController;L.current=se;try{_(!0);const Je=await Xr.get("web/search",{searchParams:{q:W},signal:se.signal}).json();f(n0(Je)),w(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{se.signal.aborted||_(!1)}},[]);g.useEffect(()=>(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>K(u),l0),()=>{Y.current&&clearTimeout(Y.current)}),[u,K]),g.useEffect(()=>{function W(se){se.key==="/"&&!b&&!(se.target instanceof HTMLInputElement||se.target instanceof HTMLTextAreaElement)&&(se.preventDefault(),y(!0)),se.key==="Escape"&&b&&(se.preventDefault(),X())}return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[b]),g.useEffect(()=>{b&&setTimeout(()=>{var W;return(W=N.current)==null?void 0:W.focus()},50)},[b]);function X(){y(!1),s(""),f({tasks:[],workers:[],projects:[]}),w(0)}function ue(W){switch(X(),W.type){case"task":H(`/tasks/${W.id}`);break;case"worker":H(`/workers/${W.id}`);break;case"project":H(`/projects/${W.id}`);break}}function ce(W){W.key==="ArrowDown"?(W.preventDefault(),w(se=>Math.min(se+1,U.length-1))):W.key==="ArrowUp"?(W.preventDefault(),w(se=>Math.max(se-1,0))):W.key==="Enter"&&U[p]&&(W.preventDefault(),ue(U[p]))}const _e=U.length>0;let F=0;return h.jsxs(h.Fragment,{children:[i?i(()=>y(!0)):h.jsxs("button",{type:"button",onClick:()=>y(!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:[h.jsx(tp,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:B("common.search_placeholder")}),h.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:"/"})]}),b&&h.jsx("div",{ref:k,className:"fixed inset-0 z-[100] flex items-start justify-center pt-[calc(var(--safe-area-top,0px)+16px)] md:pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:W=>{W.target===k.current&&X()},children:h.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:[h.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[h.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),h.jsx("input",{ref:N,type:"text",placeholder:B("common.search_input_placeholder"),value:u,onChange:W=>s(W.target.value),onKeyDown:ce,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),m&&h.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),h.jsx("div",{className:"max-h-[50vh] overflow-y-auto sm:max-h-[60vh] md:max-h-[400px]",children:u.trim()&&!_e&&!m?h.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:B("common.no_search_results",{query:u})}):Object.keys(wh).map(W=>{const se=o[W];if(se.length===0)return null;const Pe=wh[W],Je=F;return F+=se.length,h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[h.jsx(Pe,{className:"h-3 w-3"}),h.jsx("span",{className:"text-[11px] lowercase tracking-wider",children:i0[W]})]}),se.map((Ce,At)=>{const ut=Je+At,Me=ut===p;return h.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${Me?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>ue(Ce),onMouseEnter:()=>w(ut),children:[h.jsx("span",{className:`text-xs ${Me?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:Me?">":" "}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"truncate text-sm",title:Ce.hoverTitle??Ce.title,children:Ce.title}),Ce.subtitle&&h.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",title:Ce.subtitle,children:Ce.subtitle})]})]},`${Ce.type}-${Ce.id}`)})]},W)})}),h.jsxs("div",{className:"hidden items-center gap-4 border-t border-[var(--border)] px-4 py-2 md:flex",children:[h.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[h.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↑↓"})," ",B("common.navigate_hint")]}),h.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[h.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↵"})," ",B("common.select_hint")]}),h.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[h.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"esc"})," ",B("common.close_hint")]})]})]})})]})}const r0={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"};function Th(i){return Array.from(i.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))}function u0({isOpen:i,onClose:u,onConfirm:s,title:o,message:f,confirmLabel:m,cancelLabel:_,confirmVariant:b="danger",isLoading:y,children:p}){const{t:w}=Vt(),k=g.useId(),N=m??w("common.confirm"),Y=_??w("common.cancel"),L=g.useRef(null),H=g.useRef(null),B=r0[b];g.useEffect(()=>{if(!i)return;H.current=document.activeElement;const K=requestAnimationFrame(()=>{if(L.current){const X=Th(L.current);X.length>0&&X[0].focus()}});return()=>{var X;cancelAnimationFrame(K),(X=H.current)==null||X.focus()}},[i]);const U=g.useCallback(K=>{if(K.key==="Escape"){u();return}if(K.key==="Tab"&&L.current){const X=Th(L.current);if(X.length===0)return;const ue=X[0],ce=X[X.length-1];K.shiftKey?document.activeElement===ue&&(K.preventDefault(),ce.focus()):document.activeElement===ce&&(K.preventDefault(),ue.focus())}},[u]);return i?h.jsx("div",{onClick:u,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:h.jsxs("div",{ref:L,role:"dialog","aria-modal":"true","aria-labelledby":k,onClick:K=>K.stopPropagation(),onKeyDown:U,style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem"},children:[h.jsx("div",{style:{marginBottom:"1.25rem"},children:h.jsxs("div",{id:k,style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[h.jsx(np,{style:{width:"1rem",height:"1rem"}}),o]})}),h.jsxs("div",{style:{marginBottom:"1.25rem"},children:[h.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f}),p]}),h.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[h.jsx("button",{type:"button",onClick:u,disabled:y,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:y?"not-allowed":"pointer",opacity:y?.7:1,transition:"color 0.15s, border-color 0.15s"},children:Y}),h.jsx("button",{type:"button",onClick:s,disabled:y,style:{flex:1,padding:"0.5rem",backgroundColor:B,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:y?"not-allowed":"pointer",opacity:y?.7:1},children:y?w("common.processing"):N})]})]})}):null}const jh="overlord-pwa-install-dismissed";function o0(){const i=navigator.userAgent;return/iP(hone|od|ad)/.test(i)&&/WebKit/.test(i)&&!/(CriOS|FxiOS|OPiOS|mercury)/.test(i)}function s0(){return navigator.standalone===!0||window.matchMedia("(display-mode: standalone)").matches}function c0(){const{t:i}=Vt(),[u,s]=g.useState("hidden"),[o,f]=g.useState(!1),m=g.useRef(null),_=g.useRef(void 0);g.useEffect(()=>{if(s0()||localStorage.getItem(jh)||window.innerWidth>=768)return;const p=k=>{k.preventDefault(),m.current=k};window.addEventListener("beforeinstallprompt",p);const w=setTimeout(()=>s("visible"),1e3);return()=>{window.removeEventListener("beforeinstallprompt",p),clearTimeout(w),clearTimeout(_.current)}},[]);function b(){localStorage.setItem(jh,"1"),s("dismissing"),_.current=setTimeout(()=>s("hidden"),200)}async function y(){if(m.current){await m.current.prompt();const{outcome:p}=await m.current.userChoice;p==="accepted"&&b(),m.current=null}else o0()&&f(!0)}return u==="hidden"?null:h.jsx("div",{className:`fixed bottom-4 left-4 right-4 z-40 md:hidden ${u==="dismissing"?"animate-slide-down":"animate-slide-up"}`,role:"dialog","aria-label":i("pwa_install.title"),children:h.jsxs("div",{className:"overflow-hidden rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--accent)]/20 bg-[var(--accent)]/[0.06] px-3 py-1.5",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-[var(--accent)]"}),h.jsx("span",{className:"text-[9px] font-medium text-[var(--accent)]",children:i("pwa_install.title")})]}),h.jsx("button",{onClick:b,className:"p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:h.jsx(lp,{size:14})})]}),h.jsx("div",{className:"px-3.5 py-3",children:o?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[h.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",i("pwa_install.ios_command")]}),h.jsx("div",{className:"mt-2.5 flex flex-col gap-2.5",children:[i("pwa_install.ios_step_1"),i("pwa_install.ios_step_2"),i("pwa_install.ios_step_3")].map((p,w)=>h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] bg-[var(--accent)]/[0.08]",children:h.jsx("span",{className:"text-xs font-semibold text-[var(--accent)]",children:w+1})}),h.jsxs("span",{className:"text-[10px] leading-snug text-[var(--text-secondary)]",children:[w===0&&h.jsx(db,{size:12,className:"mr-1 inline-block align-text-bottom text-[var(--text-muted)]"}),p]})]},w))})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[h.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",i("pwa_install.command")]}),h.jsxs("div",{className:"mt-1.5 text-[10px] leading-relaxed text-[var(--text-secondary)]",children:["→ ",i("pwa_install.desc_1"),h.jsx("br",{}),"→ ",i("pwa_install.desc_2")]}),h.jsxs("div",{className:"mt-2.5 flex gap-2",children:[h.jsx("button",{onClick:y,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:i("pwa_install.install")}),h.jsx("button",{onClick:b,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[10px] text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:i("pwa_install.skip")})]})]})})]})})}function f0(){const{t:i}=Vt(),[u,s]=g.useState(!1);return g.useEffect(()=>{if(!("serviceWorker"in navigator))return;let o=!1,f=null,m=null,_=null,b=null;function y(){o||s(!0)}navigator.serviceWorker.addEventListener("controllerchange",y);function p(k){if(f=k,k.waiting){s(!0);return}_=()=>{const N=k.installing;N&&(m=N,b=()=>{N.state==="installed"&&navigator.serviceWorker.controller&&(o||s(!0))},N.addEventListener("statechange",b))},k.addEventListener("updatefound",_)}navigator.serviceWorker.getRegistration().then(k=>{k&&!o&&p(k)});const w=setInterval(()=>{navigator.serviceWorker.getRegistration().then(k=>{!k||o||(k.update().catch(()=>{}),k.waiting&&s(!0))})},3e4);return()=>{o=!0,clearInterval(w),navigator.serviceWorker.removeEventListener("controllerchange",y),f&&_&&f.removeEventListener("updatefound",_),m&&b&&m.removeEventListener("statechange",b)}},[]),u?h.jsx("div",{className:"animate-slide-up fixed bottom-20 left-4 right-4 z-50 md:bottom-4 md:left-auto md:right-4 md:w-80",children:h.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] px-3.5 py-3 shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[h.jsx(ep,{size:14,className:"shrink-0 text-[var(--accent)]"}),h.jsx("span",{className:"flex-1 text-[10px] text-[var(--text-secondary)]",children:i("pwa_update.message")}),h.jsx("button",{onClick:()=>window.location.reload(),className:"shrink-0 rounded-[4px] bg-[var(--accent)] px-3 py-1 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:i("pwa_update.reload")})]})}):null}const Ur=64,d0=96,Rh=32;function m0({children:i,className:u}){const s=g.useRef(null),o=g.useRef(0),f=g.useRef("idle"),[m,_]=g.useState(0),[b,y]=g.useState("idle"),p=g.useCallback(U=>{f.current=U,y(U)},[]),w=g.useCallback(()=>{const U=s.current;return U?U.scrollTop<=0:!0},[]),k=g.useCallback(U=>{if(!w()){o.current=0;return}o.current=U.touches[0].clientY},[w]),N=g.useCallback(U=>{if(f.current==="refreshing"||o.current===0)return;const X=U.touches[0].clientY-o.current;if(X<=0){f.current!=="idle"&&(_(0),p("idle"));return}if(!w())return;U.preventDefault();const ue=Math.min(X*.5,d0);_(ue),p(ue>=Ur?"ready":"pulling")},[w,p]),Y=g.useCallback(()=>{f.current!=="refreshing"&&(f.current==="ready"?(p("refreshing"),_(Ur),setTimeout(()=>{window.location.reload()},300)):(_(0),p("idle")),o.current=0)},[p]);g.useEffect(()=>{const U=s.current;if(U)return U.addEventListener("touchstart",k,{passive:!0}),U.addEventListener("touchmove",N,{passive:!1}),U.addEventListener("touchend",Y,{passive:!0}),()=>{U.removeEventListener("touchstart",k),U.removeEventListener("touchmove",N),U.removeEventListener("touchend",Y)}},[k,N,Y]);const L=Math.min(m/Ur,1),H=b==="refreshing"?0:m/Ur*180,B=m>0||b==="refreshing";return h.jsxs("div",{ref:s,className:u,style:{overscrollBehaviorY:"contain"},children:[B&&h.jsx("div",{className:"pointer-events-none flex items-center justify-center md:hidden",style:{height:m,transition:b==="idle"?"height 200ms ease-out":void 0},children:h.jsx("div",{className:"flex items-center justify-center rounded-full bg-[var(--bg-card)] border border-[var(--border)]",style:{width:Rh,height:Rh,opacity:L,transition:b==="idle"?"opacity 200ms ease-out":void 0},children:b==="refreshing"?h.jsxs("svg",{width:16,height:16,viewBox:"0 0 16 16",className:"animate-spin",style:{color:"var(--accent)"},children:[h.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),h.jsx("path",{d:"M8 2a6 6 0 0 1 6 6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}):h.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16",style:{color:b==="ready"?"var(--accent)":"var(--text-muted)",transform:`rotate(${H}deg)`,transition:"color 150ms"},children:h.jsx("path",{d:"M8 3v8M5 8l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),i]})}const Tp=g.createContext({setActions:()=>{}});function X1(i){const{setActions:u}=g.useContext(Tp);g.useEffect(()=>(u(i),()=>u(null)),[i,u])}const jp=g.createContext({setSubtitle:()=>{}});function Q1(i){const{setSubtitle:u}=g.useContext(jp),s=typeof i=="string"?i:(i==null?void 0:i.text)??null,o=typeof i=="string"?i:(i==null?void 0:i.title)??(i==null?void 0:i.text)??null;g.useEffect(()=>s?(u(o&&o!==s?{text:s,title:o}:s),()=>u(null)):(u(null),()=>u(null)),[s,o,u])}const h0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:Ph},{to:"/dashboard",label:"dashboard",icon:Ih},{to:"/workers",label:"workers",icon:ap},{to:"/projects",label:"projects",icon:lb},{to:"/access-tokens",label:"tokens",icon:rb}],p0=[{to:"/docs/cli",label:"cli",icon:$s},{to:"/docs/api",label:"api",icon:ab},{to:"/docs/bot",label:"bot",icon:cb},{to:"/docs/skill",label:"skill",icon:hb},{to:"/docs/all",label:"all",icon:ub}],_0=[{to:"/admin",label:"admin",icon:mb}],g0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:Ph},{to:"/dashboard",label:"dashboard",icon:Ih}],qr={"/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_tokens",subtitle:"common.breadcrumb_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"},"/docs/bot":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_bot_sub"},"/docs/all":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_all_sub"}};function y0(i){const{t:u}=Vt();if(qr[i]){const o=qr[i];return{title:u(o.title),subtitle:u(o.subtitle)}}const s="/"+i.split("/").filter(Boolean)[0];if(qr[s]){const o=qr[s],f=i.split("/").filter(Boolean).slice(1).join(" / ");return{title:u(o.title),subtitle:f||u(o.subtitle)}}return{title:i.slice(1).replace(/\//g," // ")||"home"}}function v0(i,u){return i==="/home"?u==="/home":i==="/dashboard"?u==="/dashboard":u.startsWith(i)}function b0(){const i=gt(),{t:u}=Vt(),s={terminal:u("terminal_home.title"),dashboard:u("dashboard.title"),tasks:u("tasks.title"),workers:u("workers.title")};return h.jsxs("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)]",style:{height:48,paddingTop:4},children:[g0.map(({to:o,label:f,icon:m})=>{const _=v0(o,i.pathname);return h.jsxs(Js,{to:o,className:"flex flex-1 flex-col items-center gap-1",children:[h.jsx(m,{size:18,className:_?"text-[var(--accent)]":"text-[var(--text-muted)]"}),h.jsx("span",{className:`text-[11px] lowercase ${_?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),h.jsx(wp,{renderTrigger:o=>h.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[h.jsx(tp,{size:18,className:"text-[var(--text-muted)]"}),h.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:u("common.search_placeholder")})]})})]})}function x0(){const i=Fa(),{t:u}=Vt();return h.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:[h.jsxs("button",{onClick:()=>i("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[h.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",children:h.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),h.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",children:u("common.overlord")})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{onClick:()=>i("/profile"),className:"p-2 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]","aria-label":u("common.profile"),children:h.jsx(gb,{size:18})}),h.jsx(Sp,{}),h.jsx(cp,{})]})]})}function zs({label:i,items:u,collapsed:s}){return h.jsxs("div",{className:"mt-4 first:mt-0",children:[!s&&h.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:i}),u.map(({to:o,label:f,icon:m})=>h.jsx(Js,{to:o,className:({isActive:_})=>`flex items-center text-sm lowercase transition-colors ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${_?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:_})=>h.jsxs(h.Fragment,{children:[h.jsx(m,{size:14,style:{flexShrink:0}}),!s&&h.jsx("span",{children:_?`> ${f}`:` ${f}`})]})},o))]})}function S0(){const{user:i,logout:u}=xa(),s=Fa(),[o,f]=g.useState(!1),m=xb(),{t:_}=Vt(),{sidebarCollapsed:b,toggleSidebar:y}=kb();function p(){u(),s("/login")}return h.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)] transition-[width,min-width] duration-300 overflow-hidden",style:{width:b?56:240,minWidth:b?56:240,backgroundColor:"var(--bg-card)"},children:[h.jsx("div",{className:"flex items-center px-5",style:{height:48},children:h.jsxs("button",{onClick:()=>s("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[h.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{flexShrink:0},children:h.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),!b&&h.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)"},children:_("common.overlord")})]})}),h.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[h.jsx(zs,{label:_("common.navigation"),items:h0,collapsed:b}),h.jsx(zs,{label:_("common.docs_section"),items:p0,collapsed:b}),m&&h.jsx(zs,{label:_("common.admin_section"),items:_0,collapsed:b})]}),h.jsx("div",{className:`px-3 py-1 ${b?"flex justify-center":""}`,children:h.jsx("button",{onClick:y,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":b?"expand sidebar":"collapse sidebar",children:b?h.jsx(Pv,{size:14}):h.jsx(Iv,{size:14})})}),h.jsx("div",{className:"border-t border-[var(--border)] p-3",children:h.jsxs("div",{className:`flex items-center py-2 ${b?"justify-center":"gap-3 px-3"}`,children:[h.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:_("common.profile"),children:((i==null?void 0:i.username)??"u")[0].toUpperCase()}),!b&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:_("common.profile"),children:[h.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(i==null?void 0:i.username)??"user"}),h.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(i==null?void 0:i.role)??"user"})]}),h.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":_("common.log_out"),children:h.jsx(sb,{size:14})})]})]})}),h.jsx(u0,{isOpen:o,onClose:()=>f(!1),onConfirm:p,title:_("common.logout_title"),message:_("common.logout_message"),confirmLabel:_("common.logout"),confirmVariant:"warning"})]})}function k0({headerActions:i,subtitleOverride:u}){const s=gt(),{title:o,subtitle:f}=y0(s.pathname),m=u??f,_=typeof m=="string"?m:m==null?void 0:m.text,b=typeof m=="string"?m:(m==null?void 0:m.title)??(m==null?void 0:m.text);return h.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:[h.jsxs("div",{className:"text-sm lowercase",children:[h.jsx("span",{style:{color:"var(--text-primary)"},children:o}),_&&h.jsxs("span",{style:{color:"var(--text-muted)"},title:b,children:[" ","// ",Wh(_,40)]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[i,h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(wp,{}),h.jsx(Sp,{}),h.jsx(cp,{})]})]})]})}function E0(){const[i,u]=g.useState(null),[s,o]=g.useState(null),f=gt(),m=f.pathname==="/home",_=/^\/tasks\/\d+$/.test(f.pathname),b=f.pathname.startsWith("/docs");return g.useEffect(()=>up.getState().init(),[]),h.jsxs("div",{className:"fixed inset-x-0 top-0 flex w-full overflow-hidden font-mono md:flex-row",style:{height:"var(--app-height, 100dvh)",minHeight:"var(--app-height, 100dvh)"},children:[h.jsx(S0,{}),h.jsxs("div",{"data-testid":"app-main-column",className:"flex min-h-0 flex-1 flex-col overflow-hidden pb-[calc(48px+var(--safe-area-bottom,0px))] md:pb-0",children:[h.jsx(x0,{}),!b&&h.jsx(k0,{headerActions:i,subtitleOverride:s}),h.jsx(m0,{className:m||_?"min-h-0 flex-1 overflow-hidden bg-[var(--bg-primary)]":"min-h-0 flex-1 overflow-auto bg-[var(--bg-primary)] p-4 pb-6 md:p-6 md:pb-6",children:h.jsx(Tp.Provider,{value:{setActions:u},children:h.jsx(jp.Provider,{value:{setSubtitle:o},children:h.jsx(cv,{})})})}),h.jsx(c0,{}),h.jsx(f0,{}),h.jsx("div",{className:"safe-area-bottom-fill fixed inset-x-0 bottom-0 z-30 bg-[var(--bg-card)] md:hidden",children:h.jsx(b0,{})})]})]})}function Ah(i){var s;const u=(s=i.state)==null?void 0:s.from;return u?{from:u}:{from:{pathname:i.pathname,search:i.search}}}function li({children:i,requireAdmin:u=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:m}=xa(),_=gt();if(m)return h.jsx("div",{className:"flex h-screen items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})});if(!s)return h.jsx(ll,{to:"/login",state:Ah(_),replace:!0});if(f){const b=Ah(_);return _.pathname!=="/totp-setup"&&_.pathname!=="/bind"?h.jsx(ll,{to:"/totp-setup",state:b,replace:!0}):_.pathname==="/bind"?(sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(b.from)),h.jsx(ll,{to:"/totp-setup",state:b,replace:!0})):h.jsx(h.Fragment,{children:i})}return u&&(o==null?void 0:o.role)!==ip.ADMIN?h.jsx(ll,{to:"/home",replace:!0}):h.jsx(h.Fragment,{children:i})}function w0({children:i}){const{theme:u,resolved:s,setResolved:o}=sp();return g.useEffect(()=>{if(u!=="system"){o(u);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const m=_=>o(_.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[u,o]),g.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),h.jsx(h.Fragment,{children:i})}class T0 extends g.Component{constructor(u){super(u),this.state={hasError:!1,error:null}}static getDerivedStateFromError(u){return{hasError:!0,error:u}}render(){var u;return this.state.hasError?h.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8 font-mono",children:[h.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Br("common.runtime_error")}),h.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((u=this.state.error)==null?void 0:u.message)||Br("common.an_unexpected_error_occurred")}),h.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:[h.jsx(ep,{className:"h-3.5 w-3.5"}),Br("common.reload")]})]}):this.props.children}}function j0({isOpen:i}){const u=Fa(),{logout:s,setSessionExpired:o}=xa(),{t:f}=Vt();function m(){s(),o(!1),u("/login")}return i?h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),h.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:h.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[h.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:h.jsx(ob,{className:"h-7 w-7 text-[var(--warning)]"})}),h.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),h.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),h.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 zh=5;let ba=[];const Bs=new Set;function Rp(){Bs.forEach(i=>i())}function R0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(i,u,s=4e3){const o=R0();return ba=[...ba,{id:o,variant:i,message:u,duration:s}],ba.length>zh&&(ba=ba.slice(ba.length-zh)),Rp(),o}Wa.success=(i,u)=>Wa("success",i,u);Wa.error=(i,u)=>Wa("error",i,u);Wa.warning=(i,u)=>Wa("warning",i,u);Wa.info=(i,u)=>Wa("info",i,u);function A0(i){ba=ba.filter(u=>u.id!==i),Rp()}function z0(){const[,i]=g.useState(0);return g.useEffect(()=>{const u=()=>i(s=>s+1);return Bs.add(u),()=>{Bs.delete(u)}},[]),ba}const O0={success:{icon:eb,borderColor:"var(--accent)"},error:{icon:tb,borderColor:"var(--destructive)"},warning:{icon:np,borderColor:"var(--warning)"},info:{icon:ib,borderColor:"var(--info)"}};function C0({item:i}){const u=O0[i.variant],s=u.icon,{t:o}=Vt(),f=g.useCallback(()=>A0(i.id),[i.id]);return g.useEffect(()=>{if(!i.duration)return;const m=setTimeout(f,i.duration);return()=>clearTimeout(m)},[i.duration,f]),h.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${u.borderColor}`},role:"alert",children:[h.jsx(s,{className:"h-4 w-4 shrink-0",style:{color:u.borderColor}}),h.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:i.message}),h.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:h.jsx(lp,{className:"h-3.5 w-3.5"})})]})}function D0(){const i=z0();return i.length===0?null:h.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:i.map(u=>h.jsx("div",{className:"pointer-events-auto",children:h.jsx(C0,{item:u})},u.id))})}const N0=g.lazy(()=>ne(()=>import("./LandingPage-B29hFr5l.js"),__vite__mapDeps([0,1,2,3,4,5]))),M0=g.lazy(()=>ne(()=>import("./LoginPage-DxhouRBW.js"),[])),U0=g.lazy(()=>ne(()=>import("./TotpSetupPage-DjccU57R.js"),[])),q0=g.lazy(()=>ne(()=>import("./NotFoundPage-C0EcsleR.js"),[])),L0=g.lazy(()=>ne(()=>import("./HomePage-kOecxD0_.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),H0=g.lazy(()=>ne(()=>import("./TerminalHomePage-DmYjzI7b.js"),__vite__mapDeps([15,16,17,18,10,11,19,8,12,13,20,21,22]))),B0=g.lazy(()=>ne(()=>import("./TaskListPage-wY64PBlG.js"),__vite__mapDeps([23,16,7,8,12,14,24,19,5,25,9,20,26,11]))),Y0=g.lazy(()=>ne(()=>import("./TaskDetailPage-Bj7vrwv0.js"),__vite__mapDeps([27,16,17,18,12,19,8,14,28,21,24,29,30]))),G0=g.lazy(()=>ne(()=>import("./WorkerListPage-C0rAZuEy.js"),__vite__mapDeps([31,8,32,33,34,35,36,22,5,30,19,25,9,13,20]))),V0=g.lazy(()=>ne(()=>import("./WorkerDetailPage-CE4-kfOS.js"),__vite__mapDeps([37,12,8,38,32,13,14,39,28]))),X0=g.lazy(()=>ne(()=>import("./WorkerSetupGuidePage-m-iSn-iM.js"),__vite__mapDeps([33,34,35,36,22]))),Q0=g.lazy(()=>ne(()=>import("./ProjectListPage-CYcEgWyH.js"),__vite__mapDeps([40,19,25,9,12,13,20]))),Z0=g.lazy(()=>ne(()=>import("./ProjectDetailPage-CNiRP1xl.js"),__vite__mapDeps([41,42,19,14,12,8,38,13,43,39,20]))),K0=g.lazy(()=>ne(()=>import("./EditProjectPage-D0JZ_TKw.js"),__vite__mapDeps([44,19,42,20]))),J0=g.lazy(()=>ne(()=>import("./PipelineEditorPage-EWSpEJ5f.js"),__vite__mapDeps([45,19]))),$0=g.lazy(()=>ne(()=>import("./ProfilePage-DELsbzEP.js"),__vite__mapDeps([46,47,38,13]))),W0=g.lazy(()=>ne(()=>import("./BindPlatformPage-rtjDTUn-.js"),[])),F0=g.lazy(()=>ne(()=>import("./AccessTokensPage-B1G2-mUi.js"),__vite__mapDeps([48,19,25,9,12,13,20,5,39]))),I0=g.lazy(()=>ne(()=>import("./CliReferencePage-ejyySCuq.js"),__vite__mapDeps([49,50,5,20]))),P0=g.lazy(()=>ne(()=>import("./ApiReferencePage-DIYFxzq0.js"),__vite__mapDeps([51,50,5,20]))),e1=g.lazy(()=>ne(()=>import("./SkillPage-BvcpkVCR.js"),__vite__mapDeps([52,53,5,29]))),t1=g.lazy(()=>ne(()=>import("./DocsLayout-BY6F_ywj.js"),__vite__mapDeps([54,28]))),a1=g.lazy(()=>ne(()=>import("./InstallationPage-BI1eTsYg.js"),__vite__mapDeps([55,53,5]))),n1=g.lazy(()=>ne(()=>import("./DeveloperSetupPage-bXuJM2eH.js"),__vite__mapDeps([56,53,5]))),l1=g.lazy(()=>ne(()=>import("./WorkerSetupPage-CLOruE6A.js"),__vite__mapDeps([57,53,5]))),i1=g.lazy(()=>ne(()=>import("./BotSetupPage-BKSV06rk.js"),__vite__mapDeps([58,53,5]))),r1=g.lazy(()=>ne(()=>import("./LocalDevelopmentPage-DKZu2NH2.js"),__vite__mapDeps([59,53,5]))),u1=g.lazy(()=>ne(()=>import("./WorkerOperationsPage-B3P0RNCo.js"),[])),o1=g.lazy(()=>ne(()=>import("./DeploymentPage-Cq1gui8d.js"),__vite__mapDeps([60,53,5]))),Oh=g.lazy(()=>ne(()=>import("./BotIntegrationPage-DhApmTBA.js"),[])),s1=g.lazy(()=>ne(()=>import("./PipelineConfigPage-Dpg_1f8s.js"),__vite__mapDeps([61,53,5]))),c1=g.lazy(()=>ne(()=>import("./DevWorkflowPage-CqU3wVnM.js"),__vite__mapDeps([62,53,5]))),f1=g.lazy(()=>ne(()=>import("./PermissionsPage-gn5TccJJ.js"),[])),d1=g.lazy(()=>ne(()=>import("./EnvVariablesPage-fLXzba5e.js"),__vite__mapDeps([63,53,5]))),m1=g.lazy(()=>ne(()=>import("./ArchitecturePage-DZqBL3l7.js"),__vite__mapDeps([64,53,5]))),h1=g.lazy(()=>ne(()=>import("./ChangelogPage-C3gSpp3g.js"),[])),p1=g.lazy(()=>ne(()=>import("./AgentCliPage-D7QPKJpY.js"),__vite__mapDeps([65,53,5]))),_1=g.lazy(()=>ne(()=>import("./DocsIndexPage-D_GPFyTY.js"),__vite__mapDeps([66,35,2,3,36]))),g1=g.lazy(()=>ne(()=>import("./AdminPage-BfQmSXQa.js"),__vite__mapDeps([67,4,2,68,36]))),y1=g.lazy(()=>ne(()=>import("./DeveloperManage-CpSvUtkr.js"),__vite__mapDeps([69,19,47,25,9,13,8,20,4,43,21]))),v1=g.lazy(()=>ne(()=>import("./BotManage-Db0KRZ8H.js"),__vite__mapDeps([70,19,53,5,39,20,25,9,13,8,2,43]))),b1=g.lazy(()=>ne(()=>import("./TokenManage-CyUVin7L.js"),__vite__mapDeps([71,34,5,29,25,9,13,8,20]))),x1=g.lazy(()=>ne(()=>import("./AuditLogPage-BGxaXcKz.js"),__vite__mapDeps([72,19,25,9,68,26,11]))),S1=g.lazy(()=>ne(()=>import("./SettingsPage-DZJf1o-J.js"),[]));function k1(){return h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function E1(){const i=xa(u=>u.sessionExpired);return h.jsxs(w0,{children:[h.jsx(D0,{}),h.jsx(T0,{children:h.jsxs(qv,{children:[h.jsx(j0,{isOpen:i}),h.jsx(g.Suspense,{fallback:h.jsx(k1,{}),children:h.jsxs(dv,{children:[h.jsx(ee,{path:"/",element:h.jsx(N0,{})}),h.jsx(ee,{path:"/login",element:h.jsx(M0,{})}),h.jsx(ee,{path:"/totp-setup",element:h.jsx(li,{children:h.jsx(U0,{})})}),h.jsx(ee,{path:"/bind",element:h.jsx(li,{children:h.jsx(W0,{})})}),h.jsxs(ee,{element:h.jsx(li,{children:h.jsx(E0,{})}),children:[h.jsx(ee,{path:"/home",element:h.jsx(H0,{})}),h.jsx(ee,{path:"/dashboard",element:h.jsx(L0,{})}),h.jsx(ee,{path:"/tasks",element:h.jsx(B0,{})}),h.jsx(ee,{path:"/tasks/:id",element:h.jsx(Y0,{})}),h.jsx(ee,{path:"/workers",element:h.jsx(G0,{})}),h.jsx(ee,{path:"/workers/setup",element:h.jsx(li,{requireAdmin:!0,children:h.jsx(X0,{})})}),h.jsx(ee,{path:"/workers/:id",element:h.jsx(V0,{})}),h.jsx(ee,{path:"/projects",element:h.jsx(Q0,{})}),h.jsx(ee,{path:"/projects/:key",element:h.jsx(Z0,{})}),h.jsx(ee,{path:"/projects/:key/edit",element:h.jsx(K0,{})}),h.jsx(ee,{path:"/projects/:key/pipeline",element:h.jsx(J0,{})}),h.jsx(ee,{path:"/profile",element:h.jsx($0,{})}),h.jsx(ee,{path:"/access-tokens",element:h.jsx(F0,{})}),h.jsxs(ee,{path:"/docs",element:h.jsx(t1,{}),children:[h.jsx(ee,{index:!0,element:h.jsx(ll,{to:"cli",replace:!0})}),h.jsx(ee,{path:"cli",element:h.jsx(I0,{})}),h.jsx(ee,{path:"api",element:h.jsx(P0,{})}),h.jsx(ee,{path:"bot",element:h.jsx(Oh,{})}),h.jsx(ee,{path:"all",element:h.jsx(_1,{})}),h.jsx(ee,{path:"skill",element:h.jsx(e1,{})}),h.jsx(ee,{path:"installation",element:h.jsx(a1,{})}),h.jsx(ee,{path:"developer-setup",element:h.jsx(n1,{})}),h.jsx(ee,{path:"worker-setup",element:h.jsx(l1,{})}),h.jsx(ee,{path:"bot-setup",element:h.jsx(i1,{})}),h.jsx(ee,{path:"local-development",element:h.jsx(r1,{})}),h.jsx(ee,{path:"worker-operations",element:h.jsx(u1,{})}),h.jsx(ee,{path:"deployment",element:h.jsx(o1,{})}),h.jsx(ee,{path:"bot-integration",element:h.jsx(Oh,{})}),h.jsx(ee,{path:"pipeline-config",element:h.jsx(s1,{})}),h.jsx(ee,{path:"dev-workflow",element:h.jsx(c1,{})}),h.jsx(ee,{path:"permissions",element:h.jsx(f1,{})}),h.jsx(ee,{path:"env-variables",element:h.jsx(d1,{})}),h.jsx(ee,{path:"architecture",element:h.jsx(m1,{})}),h.jsx(ee,{path:"agent-cli",element:h.jsx(p1,{})}),h.jsx(ee,{path:"changelog",element:h.jsx(h1,{})})]}),h.jsxs(ee,{path:"/admin",element:h.jsx(li,{requireAdmin:!0,children:h.jsx(g1,{})}),children:[h.jsx(ee,{index:!0,element:h.jsx(ll,{to:"developers",replace:!0})}),h.jsx(ee,{path:"developers",element:h.jsx(y1,{})}),h.jsx(ee,{path:"bots",element:h.jsx(v1,{})}),h.jsx(ee,{path:"tokens",element:h.jsx(b1,{})}),h.jsx(ee,{path:"audit-logs",element:h.jsx(x1,{})}),h.jsx(ee,{path:"settings",element:h.jsx(S1,{})})]})]}),h.jsx(ee,{path:"*",element:h.jsx(q0,{})})]})})]})})]})}function w1(i){var u,s;return((u=i.matchMedia)==null?void 0:u.call(i,"(display-mode: standalone)").matches)===!0||((s=i.navigator)==null?void 0:s.standalone)===!0}function T1(i){var s,o;const u=((s=i.navigator)==null?void 0:s.userAgent)??"";return/iPhone|iPad|iPod/i.test(u)||/Macintosh/i.test(u)&&(((o=i.navigator)==null?void 0:o.maxTouchPoints)??0)>1}function j1(i){const u=i.activeElement;if(!(u instanceof HTMLElement))return!1;const s=u.tagName;return u.isContentEditable||s==="INPUT"||s==="TEXTAREA"||s==="SELECT"}function R1(i){const u=i.screen;if(!u)return null;const s=Math.round(u.width),o=Math.round(u.height);return i.innerHeight>=i.innerWidth?Math.max(s,o):Math.min(s,o)}function A1(i=window,u=document){const s=u.documentElement,o=i.visualViewport??null;let f=-1;const m=()=>{const _=Math.round((o==null?void 0:o.height)??0),b=Math.round(i.innerHeight);let y=_>0?_:b;if(w1(i)&&T1(i)&&!j1(u)){const p=R1(i);p!==null&&(y=Math.max(y,b,p))}y!==f&&(f=y,s.style.setProperty("--app-height",`${y}px`))};return m(),i.addEventListener("resize",m),i.addEventListener("orientationchange",m),o==null||o.addEventListener("resize",m),()=>{i.removeEventListener("resize",m),i.removeEventListener("orientationchange",m),o==null||o.removeEventListener("resize",m)}}xa.getState().initialize();A1(window,document);const z1=window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0;if(z1){document.documentElement.classList.add("pwa-standalone");const i=window.matchMedia("(prefers-color-scheme: dark)").matches,u=localStorage.getItem("overlord-theme"),s=u==="dark"||u!=="light"&&i;document.body.style.backgroundColor=s?"#171717":"#FFFFFF",new MutationObserver(()=>{const o=document.documentElement.classList.contains("dark");document.body.style.backgroundColor=o?"#171717":"#FFFFFF"}).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})}cy.createRoot(document.getElementById("root")).render(h.jsx(g.StrictMode,{children:h.jsx(E1,{})}));export{Js as $,C1 as A,D1 as B,Fv as C,ip as D,eb as E,q1 as F,H1 as G,Ns as H,np as I,U1 as J,ep as K,Jh as L,cb as M,ll as N,uy as O,c0 as P,Wh as Q,Rr as R,ap as S,cp as T,rb as U,sb as V,M1 as W,lp as X,L1 as Y,ab as Z,hb as _,Vt as a,cv as a0,B1 as a1,Y1 as a2,tb as a3,$s as b,xe as c,mb as d,ub as e,Fa as f,gt as g,Xr as h,xb as i,h as j,up as k,kp as l,Ep as m,a0 as n,Fr as o,N1 as p,Q1 as q,g as r,V1 as s,Wa as t,xa as u,u0 as v,X1 as w,tp as x,Ph as y,G1 as z};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-B10YHYT-.js";/**
1
+ import{c as e}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-B10YHYT-.js";/**
1
+ import{c as e}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-B10YHYT-.js";/**
1
+ import{c as a}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-B10YHYT-.js";/**
1
+ import{c as e}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-B10YHYT-.js";/**
1
+ import{c as t}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-B10YHYT-.js";/**
1
+ import{c as a}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-B10YHYT-.js";/**
1
+ import{c as a}from"./index-CbvYIryv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{W as r,p as e,a1 as s,a2 as u,Y as a}from"./index-B10YHYT-.js";const n={[e.QUEUED]:"var(--text-muted)",[e.ASSIGNED]:"#60a5fa",[e.RUNNING]:"var(--accent)",[e.SUSPENDED]:"var(--warning)",[e.COMPLETED]:"var(--info)",[e.FAILED]:"var(--destructive)",[e.CANCELLED]:"var(--text-muted)"};function v(t){return n[t]??"var(--text-muted)"}const o={[r.ONLINE]:"var(--accent)",[r.OFFLINE]:"var(--destructive)",[r.DRAINING]:"var(--warning)",[r.DECOMMISSIONED]:"var(--text-muted)"};function E(t){return o[t]??"var(--text-muted)"}function x(t){switch(t){case s.ACTIVE:return"text-green-400";case s.DISABLED:return"text-red-400";default:return"text-[var(--text-muted)]"}}function S(t){switch(t){case a.ACTIVE:return"text-green-400";case a.USED:return"text-blue-400";case a.REVOKED:return"text-red-400";case a.EXPIRED:return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}}function d(t){switch(t){case u.ACTIVE:return"text-green-400";case"error":return"text-red-400";default:return"text-[var(--text-muted)]"}}function i(t){return t>.8?"var(--destructive)":t>.6?"var(--warning)":"var(--accent)"}export{v as a,i as b,x as c,d,S as e,E as g,n as t,o as w};
1
+ import{W as r,p as e,a1 as s,a2 as u,Y as a}from"./index-CbvYIryv.js";const n={[e.QUEUED]:"var(--text-muted)",[e.ASSIGNED]:"#60a5fa",[e.RUNNING]:"var(--accent)",[e.SUSPENDED]:"var(--warning)",[e.COMPLETED]:"var(--info)",[e.FAILED]:"var(--destructive)",[e.CANCELLED]:"var(--text-muted)"};function v(t){return n[t]??"var(--text-muted)"}const o={[r.ONLINE]:"var(--accent)",[r.OFFLINE]:"var(--destructive)",[r.DRAINING]:"var(--warning)",[r.DECOMMISSIONED]:"var(--text-muted)"};function E(t){return o[t]??"var(--text-muted)"}function x(t){switch(t){case s.ACTIVE:return"text-green-400";case s.DISABLED:return"text-red-400";default:return"text-[var(--text-muted)]"}}function S(t){switch(t){case a.ACTIVE:return"text-green-400";case a.USED:return"text-blue-400";case a.REVOKED:return"text-red-400";case a.EXPIRED:return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}}function d(t){switch(t){case u.ACTIVE:return"text-green-400";case"error":return"text-red-400";default:return"text-[var(--text-muted)]"}}function i(t){return t>.8?"var(--destructive)":t>.6?"var(--warning)":"var(--accent)"}export{v as a,i as b,x as c,d,S as e,E as g,n as t,o as w};
@@ -1 +1 @@
1
- import{o as i,h as n,p as c,F as T}from"./index-B10YHYT-.js";const h=i((t,r)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0,fetchTasks:async a=>{const s=r()._fetchTasksAbort;s&&s.abort();const o=new AbortController,l=r()._fetchTasksRequestId+1;t({loading:!0,error:null,_fetchTasksAbort:o,_fetchTasksRequestId:l});try{const e={};a!=null&&a.status&&(e.status=a.status),a!=null&&a.projectKey&&(e.projectKey=a.projectKey),a!=null&&a.developerId&&(e.developerId=a.developerId),a!=null&&a.cursor&&(e.cursor=a.cursor),a!=null&&a.limit&&(e.limit=String(a.limit));const f=await n.get("web/tasks",{searchParams:e,signal:o.signal}).json();if(r()._fetchTasksRequestId!==l)return;t({tasks:f.data,nextCursor:f.nextCursor??null,_fetchTasksAbort:null})}catch(e){if(e instanceof DOMException&&e.name==="AbortError")return;r()._fetchTasksRequestId===l&&t({error:e instanceof Error?e.message:"Failed to fetch tasks"})}finally{r()._fetchTasksRequestId===l&&t({loading:!1,_fetchTasksAbort:null})}},fetchTask:async a=>{t({loading:!0,error:null});try{const s=await n.get(`web/tasks/${a}`).json();t({currentTask:s})}catch(s){t({error:s instanceof Error?s.message:"Failed to fetch task"})}finally{t({loading:!1})}},createTask:async a=>{t({error:null});try{const s=await n.post("web/tasks",{json:a}).json();return t(o=>({tasks:[s,...o.tasks]})),s}catch(s){throw t({error:s instanceof Error?s.message:"Failed to create task"}),s}},cancelTask:async a=>{t({error:null});try{await n.post(`web/tasks/${a}/cancel`);const{currentTask:s}=r();(s==null?void 0:s.id)===a&&await r().fetchTask(a)}catch(s){throw t({error:s instanceof Error?s.message:"Failed to cancel task"}),s}},reset:()=>{t({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0})}})),u=[c.COMPLETED,c.FAILED,c.CANCELLED],b=[{value:"feat",label:"feat"},{value:"fix",label:"fix"},{value:"refactor",label:"refactor"},{value:"docs",label:"docs"},{value:"chore",label:"chore"}],k=Object.values(T).map(t=>({value:t,label:t})),_=[{value:"",label:"default"},...k];export{_ as A,k as C,u as T,b as a,h as u};
1
+ import{o as i,h as n,p as c,F as T}from"./index-CbvYIryv.js";const h=i((t,r)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0,fetchTasks:async a=>{const s=r()._fetchTasksAbort;s&&s.abort();const o=new AbortController,l=r()._fetchTasksRequestId+1;t({loading:!0,error:null,_fetchTasksAbort:o,_fetchTasksRequestId:l});try{const e={};a!=null&&a.status&&(e.status=a.status),a!=null&&a.projectKey&&(e.projectKey=a.projectKey),a!=null&&a.developerId&&(e.developerId=a.developerId),a!=null&&a.cursor&&(e.cursor=a.cursor),a!=null&&a.limit&&(e.limit=String(a.limit));const f=await n.get("web/tasks",{searchParams:e,signal:o.signal}).json();if(r()._fetchTasksRequestId!==l)return;t({tasks:f.data,nextCursor:f.nextCursor??null,_fetchTasksAbort:null})}catch(e){if(e instanceof DOMException&&e.name==="AbortError")return;r()._fetchTasksRequestId===l&&t({error:e instanceof Error?e.message:"Failed to fetch tasks"})}finally{r()._fetchTasksRequestId===l&&t({loading:!1,_fetchTasksAbort:null})}},fetchTask:async a=>{t({loading:!0,error:null});try{const s=await n.get(`web/tasks/${a}`).json();t({currentTask:s})}catch(s){t({error:s instanceof Error?s.message:"Failed to fetch task"})}finally{t({loading:!1})}},createTask:async a=>{t({error:null});try{const s=await n.post("web/tasks",{json:a}).json();return t(o=>({tasks:[s,...o.tasks]})),s}catch(s){throw t({error:s instanceof Error?s.message:"Failed to create task"}),s}},cancelTask:async a=>{t({error:null});try{await n.post(`web/tasks/${a}/cancel`);const{currentTask:s}=r();(s==null?void 0:s.id)===a&&await r().fetchTask(a)}catch(s){throw t({error:s instanceof Error?s.message:"Failed to cancel task"}),s}},reset:()=>{t({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0})}})),u=[c.COMPLETED,c.FAILED,c.CANCELLED],b=[{value:"feat",label:"feat"},{value:"fix",label:"fix"},{value:"refactor",label:"refactor"},{value:"docs",label:"docs"},{value:"chore",label:"chore"}],k=Object.values(T).map(t=>({value:t,label:t})),_=[{value:"",label:"default"},...k];export{_ as A,k as C,u as T,b as a,h as u};