@overlordai/server 1.0.142 → 1.0.143

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 (155) hide show
  1. package/database/migrations/012-schema-index-fixes.sql +1 -0
  2. package/database/migrations/013-review-status.sql +8 -0
  3. package/dist/adapters/command-parser.utils.d.ts +26 -1
  4. package/dist/adapters/command-parser.utils.d.ts.map +1 -1
  5. package/dist/adapters/command-parser.utils.js +112 -26
  6. package/dist/adapters/command-parser.utils.js.map +1 -1
  7. package/dist/adapters/help-text.d.ts.map +1 -1
  8. package/dist/adapters/help-text.js +5 -1
  9. package/dist/adapters/help-text.js.map +1 -1
  10. package/dist/adapters/lark/lark-message.parser.d.ts.map +1 -1
  11. package/dist/adapters/lark/lark-message.parser.js +3 -1
  12. package/dist/adapters/lark/lark-message.parser.js.map +1 -1
  13. package/dist/adapters/lark/lark.adapter.d.ts.map +1 -1
  14. package/dist/adapters/lark/lark.adapter.js +46 -9
  15. package/dist/adapters/lark/lark.adapter.js.map +1 -1
  16. package/dist/adapters/nlu-fallback.utils.d.ts +27 -0
  17. package/dist/adapters/nlu-fallback.utils.d.ts.map +1 -0
  18. package/dist/adapters/nlu-fallback.utils.js +57 -0
  19. package/dist/adapters/nlu-fallback.utils.js.map +1 -0
  20. package/dist/adapters/nlu.service.d.ts.map +1 -1
  21. package/dist/adapters/nlu.service.js +22 -6
  22. package/dist/adapters/nlu.service.js.map +1 -1
  23. package/dist/adapters/slack/slack-message.parser.d.ts.map +1 -1
  24. package/dist/adapters/slack/slack-message.parser.js +3 -1
  25. package/dist/adapters/slack/slack-message.parser.js.map +1 -1
  26. package/dist/adapters/slack/slack.adapter.d.ts.map +1 -1
  27. package/dist/adapters/slack/slack.adapter.js +31 -6
  28. package/dist/adapters/slack/slack.adapter.js.map +1 -1
  29. package/dist/database/repositories/project-member.repository.js +4 -4
  30. package/dist/database/repositories/project-member.repository.js.map +1 -1
  31. package/dist/database/repositories/project.repository.d.ts.map +1 -1
  32. package/dist/database/repositories/project.repository.js +9 -7
  33. package/dist/database/repositories/project.repository.js.map +1 -1
  34. package/dist/database/repositories/task.repository.d.ts +18 -0
  35. package/dist/database/repositories/task.repository.d.ts.map +1 -1
  36. package/dist/database/repositories/task.repository.js +104 -58
  37. package/dist/database/repositories/task.repository.js.map +1 -1
  38. package/dist/dispatcher/dispatcher.service.d.ts +24 -1
  39. package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
  40. package/dist/dispatcher/dispatcher.service.js +124 -113
  41. package/dist/dispatcher/dispatcher.service.js.map +1 -1
  42. package/dist/notifier/notification-consumer.d.ts.map +1 -1
  43. package/dist/notifier/notification-consumer.js +14 -9
  44. package/dist/notifier/notification-consumer.js.map +1 -1
  45. package/dist/web/frame-handlers/review-report.handler.d.ts.map +1 -1
  46. package/dist/web/frame-handlers/review-report.handler.js +15 -0
  47. package/dist/web/frame-handlers/review-report.handler.js.map +1 -1
  48. package/dist/web/task.controller.d.ts +11 -1
  49. package/dist/web/task.controller.d.ts.map +1 -1
  50. package/dist/web/task.controller.js +51 -6
  51. package/dist/web/task.controller.js.map +1 -1
  52. package/package.json +4 -4
  53. package/public/assets/{AccessTokensPage-DsNgVUdv.js → AccessTokensPage-BSxprw7x.js} +1 -1
  54. package/public/assets/{AdminPage-NZC6yOHW.js → AdminPage-CxHMuTgJ.js} +1 -1
  55. package/public/assets/{AgentCliPage-Bp8tQiWl.js → AgentCliPage-DxZUrhjz.js} +1 -1
  56. package/public/assets/{ApiReferencePage-DXNSPdww.js → ApiReferencePage-Cc_-lPFn.js} +1 -1
  57. package/public/assets/{ArchitecturePage-DFUNHKTN.js → ArchitecturePage-CpXl4jb3.js} +1 -1
  58. package/public/assets/{AuditLogPage-Wtpr8CDi.js → AuditLogPage-CvG7Kmpn.js} +1 -1
  59. package/public/assets/{BindPlatformPage-Bp_NG22g.js → BindPlatformPage-DQEP-N9z.js} +1 -1
  60. package/public/assets/{BotIntegrationPage-DuH_f_mp.js → BotIntegrationPage-DP1ipK65.js} +1 -1
  61. package/public/assets/{BotManage-CJ5GZ0HR.js → BotManage-B1lkaWlW.js} +1 -1
  62. package/public/assets/{BotSetupPage-Ct_gjzJt.js → BotSetupPage-kJHd4z6w.js} +1 -1
  63. package/public/assets/{ChangelogPage-DrpgpyjK.js → ChangelogPage-QheUxtEJ.js} +1 -1
  64. package/public/assets/{CliReferencePage-BiUl0LtI.js → CliReferencePage-Dy78S9h1.js} +1 -1
  65. package/public/assets/{ConfirmStageDialog-BsoAtSes.js → ConfirmStageDialog-rt45LR8Q.js} +4 -4
  66. package/public/assets/{DeploymentPage-DtlH8d7p.js → DeploymentPage-CaIslw2W.js} +1 -1
  67. package/public/assets/{DevWorkflowPage-BoZm03L7.js → DevWorkflowPage-DjmFkvCo.js} +1 -1
  68. package/public/assets/{DeveloperManage-hoNX7J5P.js → DeveloperManage-Ab6SdQEz.js} +1 -1
  69. package/public/assets/{DeveloperSetupPage-D3FDp-R7.js → DeveloperSetupPage-D3RvWqx0.js} +1 -1
  70. package/public/assets/{DocsIndexPage-ZBDBTreg.js → DocsIndexPage-BHnvOEn8.js} +1 -1
  71. package/public/assets/{DocsLayout-CX3AKUlL.js → DocsLayout-BdWlFJ_G.js} +1 -1
  72. package/public/assets/{DocsPrimitives-B3qhkVFu.js → DocsPrimitives-BRoBpWHe.js} +1 -1
  73. package/public/assets/{EditProjectPage-DKaSpnod.js → EditProjectPage-CepF7mnT.js} +2 -2
  74. package/public/assets/{EmptyState-BKUHLcAb.js → EmptyState-BIXXLer_.js} +1 -1
  75. package/public/assets/{EnvVariablesPage-C2nu-wxe.js → EnvVariablesPage-DxRT4ql6.js} +1 -1
  76. package/public/assets/HomePage-CkiXfp2H.js +1 -0
  77. package/public/assets/{InfoRow-CBKDMEtd.js → InfoRow-DXCzjoGj.js} +1 -1
  78. package/public/assets/{InstallationPage-0TO7IQzJ.js → InstallationPage-CF8j4Y-C.js} +1 -1
  79. package/public/assets/{LandingPage-YcgE-OTL.js → LandingPage-CaYr_-RD.js} +1 -1
  80. package/public/assets/{LocalDevelopmentPage-BDpTHWAo.js → LocalDevelopmentPage-HIFhYvHJ.js} +1 -1
  81. package/public/assets/{LoginPage-F34Kt4ot.js → LoginPage-D17Mq8Qe.js} +1 -1
  82. package/public/assets/{MetricBar-xV1juDz6.js → MetricBar-DDJWywkw.js} +1 -1
  83. package/public/assets/{NotFoundPage-DPZDwk1M.js → NotFoundPage-BTlUFX7F.js} +1 -1
  84. package/public/assets/{OnboardingGuide-C8QTC3cZ.js → OnboardingGuide-CTJYul4_.js} +1 -1
  85. package/public/assets/{PermissionsPage-DsNmsUoe.js → PermissionsPage-Dj27JR_m.js} +1 -1
  86. package/public/assets/PipelineConfigPage-BTy8cOFI.js +22 -0
  87. package/public/assets/{PipelineEditorPage-18u7wxjE.js → PipelineEditorPage-CuSW0B-0.js} +2 -2
  88. package/public/assets/PlanPage-CMQs2Hiz.js +1 -0
  89. package/public/assets/{ProfilePage-D3YRdW9C.js → ProfilePage-BRxrQCQd.js} +1 -1
  90. package/public/assets/ProjectDetailPage-CRHNrgPt.js +7 -0
  91. package/public/assets/{ProjectListPage-D62NmkBp.js → ProjectListPage-QM4505IY.js} +2 -2
  92. package/public/assets/{PtyTerminal-B3lRN-u1.js → PtyTerminal-BxD1WFmu.js} +1 -1
  93. package/public/assets/{QuickAuth-DzYrNwL-.js → QuickAuth-Dx-LoUjm.js} +1 -1
  94. package/public/assets/{RemoveMemberConfirmDialog-svHE4uU4.js → RemoveMemberConfirmDialog-pg5SnIU8.js} +1 -1
  95. package/public/assets/{ReviewAggregatePage-Dq3hl9db.js → ReviewAggregatePage-DHUyVVeT.js} +2 -2
  96. package/public/assets/ReviewPage-DzNkeQXP.js +1 -0
  97. package/public/assets/{Select-BMBYwPr-.js → Select-DYnPuPlP.js} +1 -1
  98. package/public/assets/{SettingsPage-Ml3L-j5R.js → SettingsPage-YpqaOT8x.js} +1 -1
  99. package/public/assets/{Skeleton-9LGrFcdv.js → Skeleton-tFvClhRo.js} +1 -1
  100. package/public/assets/{SkillPage-BGYJMqPr.js → SkillPage-BQto2TJm.js} +1 -1
  101. package/public/assets/TaskDetailPage-BAnCb9zv.js +21 -0
  102. package/public/assets/{TaskGuidePage-CKnugDRu.js → TaskGuidePage-Bs-Unzck.js} +1 -1
  103. package/public/assets/TaskListPage-CL98Ev5l.js +1 -0
  104. package/public/assets/{TaskStatusBadge-B_S_xjEI.js → TaskStatusBadge-BUczBM5S.js} +1 -1
  105. package/public/assets/TerminalHomePage-CgZYHN7Y.js +6 -0
  106. package/public/assets/{TokenManage-BqOEJDHV.js → TokenManage-BU8KbNvZ.js} +1 -1
  107. package/public/assets/{Tooltip-BFj-n88a.js → Tooltip-BTMAbLUj.js} +1 -1
  108. package/public/assets/{TotpSetupPage-CI411-Y7.js → TotpSetupPage-B9IghCSA.js} +1 -1
  109. package/public/assets/WorkerDetailPage-D0Vz2Z_J.js +1 -0
  110. package/public/assets/{WorkerListPage-nPKvREXn.js → WorkerListPage-B4aOYXSX.js} +2 -2
  111. package/public/assets/{WorkerOperationsPage-qgdLSK1X.js → WorkerOperationsPage-Du5dUuwe.js} +1 -1
  112. package/public/assets/{WorkerSetupGuidePage-DHbju_7j.js → WorkerSetupGuidePage-Chgd3lOw.js} +1 -1
  113. package/public/assets/{WorkerSetupPage-D0Cob5nl.js → WorkerSetupPage-DOy5dzpL.js} +1 -1
  114. package/public/assets/{agent-type-options-CdJpMswW.js → agent-type-options-DYVQzNPE.js} +1 -1
  115. package/public/assets/{arrow-left-BOJ_pZwC.js → arrow-left-BmJhqQxJ.js} +1 -1
  116. package/public/assets/{arrow-right-GWPYDcKr.js → arrow-right-za11FMwb.js} +1 -1
  117. package/public/assets/{bot-DZ_48uoa.js → bot-BREu_dZH.js} +1 -1
  118. package/public/assets/{chevron-down-DiFQzkq3.js → chevron-down-pInOI1Sz.js} +1 -1
  119. package/public/assets/{chevron-left-PB0m_3-R.js → chevron-left-9sE-mZhp.js} +1 -1
  120. package/public/assets/{chevron-right-Bsbm1nYp.js → chevron-right-BTVDsZF2.js} +1 -1
  121. package/public/assets/{chevron-up-CvYNL872.js → chevron-up-7pQBLB6e.js} +1 -1
  122. package/public/assets/{copy-DR5cQtVj.js → copy-Ciibu4ij.js} +1 -1
  123. package/public/assets/{download-FpaVrNQK.js → download-C5M-xVQE.js} +1 -1
  124. package/public/assets/{external-link-CiQhHCsl.js → external-link-DXCE8f-2.js} +1 -1
  125. package/public/assets/{file-text-Gk2VyRBd.js → file-text-FxjQforC.js} +1 -1
  126. package/public/assets/{git-fork-CLaKXs0Y.js → git-fork-BnUjRz81.js} +1 -1
  127. package/public/assets/{index-CfvO5R0v.js → index-CTVNJXL0.js} +5 -5
  128. package/public/assets/{key-b2-JaSCL.js → key-DORG2Bvk.js} +1 -1
  129. package/public/assets/{loader-circle-_Xw40aLD.js → loader-circle-Ce741dwH.js} +1 -1
  130. package/public/assets/{pencil-z5Zqj0qg.js → pencil-C4ejRMe1.js} +1 -1
  131. package/public/assets/{play-D2z1wzeo.js → play-w6NUT3Ge.js} +1 -1
  132. package/public/assets/{plus-DDEIETPT.js → plus-CgnoWo2P.js} +1 -1
  133. package/public/assets/{rotate-ccw-DryDtPrl.js → rotate-ccw-DE82XdM1.js} +1 -1
  134. package/public/assets/{scroll-text-DdAPH940.js → scroll-text-DAbRTvTk.js} +1 -1
  135. package/public/assets/{settings-DLSb7OkM.js → settings-B6CvfGJs.js} +1 -1
  136. package/public/assets/{skip-forward-Dshgkb5J.js → skip-forward-kX5fzSWO.js} +1 -1
  137. package/public/assets/{status-colors-w6Ie5LWO.js → status-colors-DTc6Ynln.js} +1 -1
  138. package/public/assets/{task-constants-DpDhF7YW.js → task-constants-DFxPkPUs.js} +1 -1
  139. package/public/assets/{task.store-QLdgw-z_.js → task.store-VJg4-Qif.js} +1 -1
  140. package/public/assets/{trash-2-DN1oshyp.js → trash-2-BTUlSSX7.js} +1 -1
  141. package/public/assets/{useFetch-DpOLDSFc.js → useFetch-DLQT-fqN.js} +1 -1
  142. package/public/assets/{users-DrLwCx8Z.js → users-B6ZPxGEF.js} +1 -1
  143. package/public/assets/{wifi-B4XgJ6JW.js → wifi-RZmzDeRm.js} +1 -1
  144. package/public/assets/{workflow-Cd6zqDgi.js → workflow-C1oJzdp3.js} +1 -1
  145. package/public/index.html +1 -1
  146. package/public/sw.js +1 -1
  147. package/public/assets/HomePage-CQ0Upd0D.js +0 -1
  148. package/public/assets/PipelineConfigPage-D5gx3bIv.js +0 -22
  149. package/public/assets/PlanPage-Dds_7koM.js +0 -1
  150. package/public/assets/ProjectDetailPage-1mftEUqP.js +0 -7
  151. package/public/assets/ReviewPage-CNeCz2eT.js +0 -1
  152. package/public/assets/TaskDetailPage-Beto_Zqp.js +0 -21
  153. package/public/assets/TaskListPage-CFri9wCk.js +0 -1
  154. package/public/assets/TerminalHomePage-CDr4Mq6o.js +0 -6
  155. package/public/assets/WorkerDetailPage-DcMycoTh.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-YcgE-OTL.js","assets/arrow-right-GWPYDcKr.js","assets/bot-DZ_48uoa.js","assets/workflow-Cd6zqDgi.js","assets/users-DrLwCx8Z.js","assets/copy-DR5cQtVj.js","assets/HomePage-CQ0Upd0D.js","assets/TaskStatusBadge-B_S_xjEI.js","assets/status-colors-w6Ie5LWO.js","assets/Skeleton-9LGrFcdv.js","assets/OnboardingGuide-C8QTC3cZ.js","assets/chevron-right-Bsbm1nYp.js","assets/date-RFA7-ZGs.js","assets/useFetch-DpOLDSFc.js","assets/Tooltip-BFj-n88a.js","assets/TerminalHomePage-CDr4Mq6o.js","assets/ConfirmStageDialog-BsoAtSes.js","assets/loader-circle-_Xw40aLD.js","assets/rotate-ccw-DryDtPrl.js","assets/PtyTerminal-B3lRN-u1.js","assets/PtyTerminal-6GBZ9nXN.css","assets/file-text-Gk2VyRBd.js","assets/task.store-QLdgw-z_.js","assets/Select-BMBYwPr-.js","assets/chevron-down-DiFQzkq3.js","assets/task-constants-DpDhF7YW.js","assets/agent-type-options-CdJpMswW.js","assets/plus-DDEIETPT.js","assets/chevron-up-CvYNL872.js","assets/wifi-B4XgJ6JW.js","assets/TaskListPage-CFri9wCk.js","assets/git-fork-CLaKXs0Y.js","assets/EmptyState-BKUHLcAb.js","assets/chevron-left-PB0m_3-R.js","assets/TaskDetailPage-Beto_Zqp.js","assets/arrow-left-BOJ_pZwC.js","assets/play-D2z1wzeo.js","assets/external-link-CiQhHCsl.js","assets/skip-forward-Dshgkb5J.js","assets/PlanPage-Dds_7koM.js","assets/ReviewPage-CNeCz2eT.js","assets/ReviewAggregatePage-Dq3hl9db.js","assets/WorkerListPage-nPKvREXn.js","assets/MetricBar-xV1juDz6.js","assets/WorkerSetupGuidePage-DHbju_7j.js","assets/key-b2-JaSCL.js","assets/download-FpaVrNQK.js","assets/settings-DLSb7OkM.js","assets/WorkerDetailPage-DcMycoTh.js","assets/InfoRow-CBKDMEtd.js","assets/trash-2-DN1oshyp.js","assets/ProjectListPage-D62NmkBp.js","assets/ProjectDetailPage-1mftEUqP.js","assets/RemoveMemberConfirmDialog-svHE4uU4.js","assets/pencil-z5Zqj0qg.js","assets/EditProjectPage-DKaSpnod.js","assets/PipelineEditorPage-18u7wxjE.js","assets/ProfilePage-D3YRdW9C.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-DsNgVUdv.js","assets/CliReferencePage-BiUl0LtI.js","assets/DocsPrimitives-B3qhkVFu.js","assets/QuickAuth-DzYrNwL-.js","assets/ApiReferencePage-DXNSPdww.js","assets/SkillPage-BGYJMqPr.js","assets/DocsLayout-CX3AKUlL.js","assets/InstallationPage-0TO7IQzJ.js","assets/DeveloperSetupPage-D3FDp-R7.js","assets/WorkerSetupPage-D0Cob5nl.js","assets/BotSetupPage-Ct_gjzJt.js","assets/LocalDevelopmentPage-BDpTHWAo.js","assets/DeploymentPage-DtlH8d7p.js","assets/PipelineConfigPage-D5gx3bIv.js","assets/DevWorkflowPage-BoZm03L7.js","assets/EnvVariablesPage-C2nu-wxe.js","assets/ArchitecturePage-DFUNHKTN.js","assets/AgentCliPage-Bp8tQiWl.js","assets/TaskGuidePage-CKnugDRu.js","assets/DocsIndexPage-ZBDBTreg.js","assets/AdminPage-NZC6yOHW.js","assets/scroll-text-DdAPH940.js","assets/DeveloperManage-hoNX7J5P.js","assets/BotManage-CJ5GZ0HR.js","assets/TokenManage-BqOEJDHV.js","assets/AuditLogPage-Wtpr8CDi.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-CaYr_-RD.js","assets/arrow-right-za11FMwb.js","assets/bot-BREu_dZH.js","assets/workflow-C1oJzdp3.js","assets/users-B6ZPxGEF.js","assets/copy-Ciibu4ij.js","assets/HomePage-CkiXfp2H.js","assets/TaskStatusBadge-BUczBM5S.js","assets/status-colors-DTc6Ynln.js","assets/Skeleton-tFvClhRo.js","assets/OnboardingGuide-CTJYul4_.js","assets/chevron-right-BTVDsZF2.js","assets/date-RFA7-ZGs.js","assets/useFetch-DLQT-fqN.js","assets/Tooltip-BTMAbLUj.js","assets/TerminalHomePage-CgZYHN7Y.js","assets/ConfirmStageDialog-rt45LR8Q.js","assets/loader-circle-Ce741dwH.js","assets/rotate-ccw-DE82XdM1.js","assets/PtyTerminal-BxD1WFmu.js","assets/PtyTerminal-6GBZ9nXN.css","assets/file-text-FxjQforC.js","assets/task.store-VJg4-Qif.js","assets/Select-DYnPuPlP.js","assets/chevron-down-pInOI1Sz.js","assets/task-constants-DFxPkPUs.js","assets/agent-type-options-DYVQzNPE.js","assets/plus-CgnoWo2P.js","assets/chevron-up-7pQBLB6e.js","assets/wifi-RZmzDeRm.js","assets/TaskListPage-CL98Ev5l.js","assets/git-fork-BnUjRz81.js","assets/EmptyState-BIXXLer_.js","assets/chevron-left-9sE-mZhp.js","assets/TaskDetailPage-BAnCb9zv.js","assets/arrow-left-BmJhqQxJ.js","assets/play-w6NUT3Ge.js","assets/external-link-DXCE8f-2.js","assets/skip-forward-kX5fzSWO.js","assets/PlanPage-CMQs2Hiz.js","assets/ReviewPage-DzNkeQXP.js","assets/ReviewAggregatePage-DHUyVVeT.js","assets/WorkerListPage-B4aOYXSX.js","assets/MetricBar-DDJWywkw.js","assets/WorkerSetupGuidePage-Chgd3lOw.js","assets/key-DORG2Bvk.js","assets/download-C5M-xVQE.js","assets/settings-B6CvfGJs.js","assets/WorkerDetailPage-D0Vz2Z_J.js","assets/InfoRow-DXCzjoGj.js","assets/trash-2-BTUlSSX7.js","assets/ProjectListPage-QM4505IY.js","assets/ProjectDetailPage-CRHNrgPt.js","assets/RemoveMemberConfirmDialog-pg5SnIU8.js","assets/pencil-C4ejRMe1.js","assets/EditProjectPage-CepF7mnT.js","assets/PipelineEditorPage-CuSW0B-0.js","assets/ProfilePage-BRxrQCQd.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-BSxprw7x.js","assets/CliReferencePage-Dy78S9h1.js","assets/DocsPrimitives-BRoBpWHe.js","assets/QuickAuth-Dx-LoUjm.js","assets/ApiReferencePage-Cc_-lPFn.js","assets/SkillPage-BQto2TJm.js","assets/DocsLayout-BdWlFJ_G.js","assets/InstallationPage-CF8j4Y-C.js","assets/DeveloperSetupPage-D3RvWqx0.js","assets/WorkerSetupPage-DOy5dzpL.js","assets/BotSetupPage-kJHd4z6w.js","assets/LocalDevelopmentPage-HIFhYvHJ.js","assets/DeploymentPage-CaIslw2W.js","assets/PipelineConfigPage-BTy8cOFI.js","assets/DevWorkflowPage-DjmFkvCo.js","assets/EnvVariablesPage-DxRT4ql6.js","assets/ArchitecturePage-CpXl4jb3.js","assets/AgentCliPage-DxZUrhjz.js","assets/TaskGuidePage-Bs-Unzck.js","assets/DocsIndexPage-BHnvOEn8.js","assets/AdminPage-CxHMuTgJ.js","assets/scroll-text-DAbRTvTk.js","assets/DeveloperManage-Ab6SdQEz.js","assets/BotManage-B1lkaWlW.js","assets/TokenManage-BU8KbNvZ.js","assets/AuditLogPage-CvG7Kmpn.js"])))=>i.map(i=>d[i]);
2
2
  var a_=Object.defineProperty;var Pm=i=>{throw TypeError(i)};var n_=(i,u,s)=>u in i?a_(i,u,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[u]=s;var Ve=(i,u,s)=>n_(i,typeof u!="symbol"?u+"":u,s),_s=(i,u,s)=>u.has(i)||Pm("Cannot "+s);var q=(i,u,s)=>(_s(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)=>(_s(i,u,"write to private field"),o?o.call(i,s):u.set(i,s),s),ke=(i,u,s)=>(_s(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 g of m.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&o(g)}).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 l_(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var vs={exports:{}},ti={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -56,9 +56,9 @@ Error generating stack: `+n.message+`
56
56
  * LICENSE.md file in the root directory of this source tree.
57
57
  *
58
58
  * @license MIT
59
- */var dh="popstate";function mh(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function y_(i={}){function u(o,f){var p;let m=(p=f.state)==null?void 0:p.masked,{pathname:g,search:b,hash:_}=m||o.location;return Os("",{pathname:g,search:b,hash:_},f.state&&f.state.usr||null,f.state&&f.state.key||"default",m?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function s(o,f){return typeof f=="string"?f:oi(f)}return v_(u,s,null,i)}function qe(i,u){if(i===!1||i===null||typeof i>"u")throw new Error(u)}function Yt(i,u){if(!i){typeof console<"u"&&console.warn(u);try{throw new Error(u)}catch{}}}function __(){return Math.random().toString(36).substring(2,10)}function hh(i,u){return{usr:i.state,key:i.key,idx:u,masked:i.unstable_mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function Os(i,u,s=null,o,f){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof u=="string"?il(u):u,state:s,key:u&&u.key||o||__(),unstable_mask:f}}function oi({pathname:i="/",search:u="",hash:s=""}){return u&&u!=="?"&&(i+=u.charAt(0)==="?"?u:"?"+u),s&&s!=="#"&&(i+=s.charAt(0)==="#"?s:"#"+s),i}function il(i){let u={};if(i){let s=i.indexOf("#");s>=0&&(u.hash=i.substring(s),i=i.substring(0,s));let o=i.indexOf("?");o>=0&&(u.search=i.substring(o),i=i.substring(0,o)),i&&(u.pathname=i)}return u}function v_(i,u,s,o={}){let{window:f=document.defaultView,v5Compat:m=!1}=o,g=f.history,b="POP",_=null,p=w();p==null&&(p=0,g.replaceState({...g.state,idx:p},""));function w(){return(g.state||{idx:null}).idx}function k(){b="POP";let B=w(),U=B==null?null:B-p;p=B,_&&_({action:b,location:H.location,delta:U})}function N(B,U){b="PUSH";let K=mh(B)?B:Os(H.location,B,U);p=w()+1;let X=hh(K,p),ue=H.createHref(K.unstable_mask||K);try{g.pushState(X,"",ue)}catch(ce){if(ce instanceof DOMException&&ce.name==="DataCloneError")throw ce;f.location.assign(ue)}m&&_&&_({action:b,location:H.location,delta:1})}function Y(B,U){b="REPLACE";let K=mh(B)?B:Os(H.location,B,U);p=w();let X=hh(K,p),ue=H.createHref(K.unstable_mask||K);g.replaceState(X,"",ue),m&&_&&_({action:b,location:H.location,delta:0})}function L(B){return b_(B)}let H={get action(){return b},get location(){return i(f,g)},listen(B){if(_)throw new Error("A history only accepts one active listener");return f.addEventListener(dh,k),_=B,()=>{f.removeEventListener(dh,k),_=null}},createHref(B){return u(f,B)},createURL:L,encodeLocation(B){let U=L(B);return{pathname:U.pathname,search:U.search,hash:U.hash}},push:N,replace:Y,go(B){return g.go(B)}};return H}function b_(i,u=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),qe(s,"No window.location.(origin|href) available to create URL");let o=typeof i=="string"?i:oi(i);return o=o.replace(/ $/,"%20"),!u&&o.startsWith("//")&&(o=s+o),new URL(o,s)}function Ch(i,u,s="/"){return x_(i,u,s,!1)}function x_(i,u,s,o){let f=typeof u=="string"?il(u):u,m=Sa(f.pathname||"/",s);if(m==null)return null;let g=Dh(i);S_(g);let b=null;for(let _=0;b==null&&_<g.length;++_){let p=D_(m);b=O_(g[_],p,o)}return b}function Dh(i,u=[],s=[],o="",f=!1){let m=(g,b,_=f,p)=>{let w={relativePath:p===void 0?g.path||"":p,caseSensitive:g.caseSensitive===!0,childrenIndex:b,route:g};if(w.relativePath.startsWith("/")){if(!w.relativePath.startsWith(o)&&_)return;qe(w.relativePath.startsWith(o),`Absolute route path "${w.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),w.relativePath=w.relativePath.slice(o.length)}let k=ta([o,w.relativePath]),N=s.concat(w);g.children&&g.children.length>0&&(qe(g.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${k}".`),Dh(g.children,u,N,k,_)),!(g.path==null&&!g.index)&&u.push({path:k,score:A_(k,g.index),routesMeta:N})};return i.forEach((g,b)=>{var _;if(g.path===""||!((_=g.path)!=null&&_.includes("?")))m(g,b);else for(let p of Nh(g.path))m(g,b,!0,p)}),u}function Nh(i){let u=i.split("/");if(u.length===0)return[];let[s,...o]=u,f=s.endsWith("?"),m=s.replace(/\?$/,"");if(o.length===0)return f?[m,""]:[m];let g=Nh(o.join("/")),b=[];return b.push(...g.map(_=>_===""?m:[m,_].join("/"))),f&&b.push(...g),b.map(_=>i.startsWith("/")&&_===""?"/":_)}function S_(i){i.sort((u,s)=>u.score!==s.score?s.score-u.score:z_(u.routesMeta.map(o=>o.childrenIndex),s.routesMeta.map(o=>o.childrenIndex)))}var k_=/^:[\w-]+$/,E_=3,w_=2,T_=1,j_=10,R_=-2,ph=i=>i==="*";function A_(i,u){let s=i.split("/"),o=s.length;return s.some(ph)&&(o+=R_),u&&(o+=w_),s.filter(f=>!ph(f)).reduce((f,m)=>f+(k_.test(m)?E_:m===""?T_:j_),o)}function z_(i,u){return i.length===u.length&&i.slice(0,-1).every((o,f)=>o===u[f])?i[i.length-1]-u[u.length-1]:0}function O_(i,u,s=!1){let{routesMeta:o}=i,f={},m="/",g=[];for(let b=0;b<o.length;++b){let _=o[b],p=b===o.length-1,w=m==="/"?u:u.slice(m.length)||"/",k=Zr({path:_.relativePath,caseSensitive:_.caseSensitive,end:p},w),N=_.route;if(!k&&p&&s&&!o[o.length-1].route.index&&(k=Zr({path:_.relativePath,caseSensitive:_.caseSensitive,end:!1},w)),!k)return null;Object.assign(f,k.params),g.push({params:f,pathname:ta([m,k.pathname]),pathnameBase:q_(ta([m,k.pathnameBase])),route:N}),k.pathnameBase!=="/"&&(m=ta([m,k.pathnameBase]))}return g}function Zr(i,u){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[s,o]=C_(i.path,i.caseSensitive,i.end),f=u.match(s);if(!f)return null;let m=f[0],g=m.replace(/(.)\/+$/,"$1"),b=f.slice(1);return{params:o.reduce((p,{paramName:w,isOptional:k},N)=>{if(w==="*"){let L=b[N]||"";g=m.slice(0,m.length-L.length).replace(/(.)\/+$/,"$1")}const Y=b[N];return k&&!Y?p[w]=void 0:p[w]=(Y||"").replace(/%2F/g,"/"),p},{}),pathname:m,pathnameBase:g,pattern:i}}function C_(i,u=!1,s=!0){Yt(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let o=[],f="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(g,b,_,p,w)=>{if(o.push({paramName:b,isOptional:_!=null}),_){let k=w.charAt(p+g.length);return k&&k!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(o.push({paramName:"*"}),f+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?f+="\\/*$":i!==""&&i!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,u?void 0:"i"),o]}function D_(i){try{return i.split("/").map(u=>decodeURIComponent(u).replace(/\//g,"%2F")).join("/")}catch(u){return Yt(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${u}).`),i}}function Sa(i,u){if(u==="/")return i;if(!i.toLowerCase().startsWith(u.toLowerCase()))return null;let s=u.endsWith("/")?u.length-1:u.length,o=i.charAt(s);return o&&o!=="/"?null:i.slice(s)||"/"}var N_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function M_(i,u="/"){let{pathname:s,search:o="",hash:f=""}=typeof i=="string"?il(i):i,m;return s?(s=s.replace(/\/\/+/g,"/"),s.startsWith("/")?m=gh(s.substring(1),"/"):m=gh(s,u)):m=u,{pathname:m,search:L_(o),hash:H_(f)}}function gh(i,u){let s=u.replace(/\/+$/,"").split("/");return i.split("/").forEach(f=>{f===".."?s.length>1&&s.pop():f!=="."&&s.push(f)}),s.length>1?s.join("/"):"/"}function ws(i,u,s,o){return`Cannot include a '${i}' character in a manually specified \`to.${u}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function U_(i){return i.filter((u,s)=>s===0||u.route.path&&u.route.path.length>0)}function Gs(i){let u=U_(i);return u.map((s,o)=>o===u.length-1?s.pathname:s.pathnameBase)}function $r(i,u,s,o=!1){let f;typeof i=="string"?f=il(i):(f={...i},qe(!f.pathname||!f.pathname.includes("?"),ws("?","pathname","search",f)),qe(!f.pathname||!f.pathname.includes("#"),ws("#","pathname","hash",f)),qe(!f.search||!f.search.includes("#"),ws("#","search","hash",f)));let m=i===""||f.pathname==="",g=m?"/":f.pathname,b;if(g==null)b=s;else{let k=u.length-1;if(!o&&g.startsWith("..")){let N=g.split("/");for(;N[0]==="..";)N.shift(),k-=1;f.pathname=N.join("/")}b=k>=0?u[k]:"/"}let _=M_(f,b),p=g&&g!=="/"&&g.endsWith("/"),w=(m||g===".")&&s.endsWith("/");return!_.pathname.endsWith("/")&&(p||w)&&(_.pathname+="/"),_}var ta=i=>i.join("/").replace(/\/\/+/g,"/"),q_=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),L_=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,H_=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,B_=class{constructor(i,u,s,o=!1){this.status=i,this.statusText=u||"",this.internal=o,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Y_(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function G_(i){return i.map(u=>u.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Mh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Uh(i,u){let s=i;if(typeof s!="string"||!N_.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let o=s,f=!1;if(Mh)try{let m=new URL(window.location.href),g=s.startsWith("//")?new URL(m.protocol+s):new URL(s),b=Sa(g.pathname,u);g.origin===m.origin&&b!=null?s=b+g.search+g.hash:f=!0}catch{Yt(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:f,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var qh=["POST","PUT","PATCH","DELETE"];new Set(qh);var V_=["GET",...qh];new Set(V_);var rl=y.createContext(null);rl.displayName="DataRouter";var Wr=y.createContext(null);Wr.displayName="DataRouterState";var X_=y.createContext(!1),Lh=y.createContext({isTransitioning:!1});Lh.displayName="ViewTransition";var Q_=y.createContext(new Map);Q_.displayName="Fetchers";var Z_=y.createContext(null);Z_.displayName="Await";var Rt=y.createContext(null);Rt.displayName="Navigation";var si=y.createContext(null);si.displayName="Location";var Gt=y.createContext({outlet:null,matches:[],isDataRoute:!1});Gt.displayName="Route";var Vs=y.createContext(null);Vs.displayName="RouteError";var Hh="REACT_ROUTER_ERROR",K_="REDIRECT",J_="ROUTE_ERROR_RESPONSE";function $_(i){if(i.startsWith(`${Hh}:${K_}:{`))try{let u=JSON.parse(i.slice(28));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string"&&typeof u.location=="string"&&typeof u.reloadDocument=="boolean"&&typeof u.replace=="boolean")return u}catch{}}function W_(i){if(i.startsWith(`${Hh}:${J_}:{`))try{let u=JSON.parse(i.slice(40));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string")return new B_(u.status,u.statusText,u.data)}catch{}}function F_(i,{relative:u}={}){qe(ul(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:o}=y.useContext(Rt),{hash:f,pathname:m,search:g}=ci(i,{relative:u}),b=m;return s!=="/"&&(b=m==="/"?s:ta([s,m])),o.createHref({pathname:b,search:g,hash:f})}function ul(){return y.useContext(si)!=null}function yt(){return qe(ul(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(si).location}var Bh="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Yh(i){y.useContext(Rt).static||y.useLayoutEffect(i)}function Fa(){let{isDataRoute:i}=y.useContext(Gt);return i?dv():I_()}function I_(){qe(ul(),"useNavigate() may be used only in the context of a <Router> component.");let i=y.useContext(rl),{basename:u,navigator:s}=y.useContext(Rt),{matches:o}=y.useContext(Gt),{pathname:f}=yt(),m=JSON.stringify(Gs(o)),g=y.useRef(!1);return Yh(()=>{g.current=!0}),y.useCallback((_,p={})=>{if(Yt(g.current,Bh),!g.current)return;if(typeof _=="number"){s.go(_);return}let w=$r(_,JSON.parse(m),f,p.relative==="path");i==null&&u!=="/"&&(w.pathname=w.pathname==="/"?u:ta([u,w.pathname])),(p.replace?s.replace:s.push)(w,p.state,p)},[u,s,m,f,i])}var P_=y.createContext(null);function ev(i){let u=y.useContext(Gt).outlet;return y.useMemo(()=>u&&y.createElement(P_.Provider,{value:i},u),[u,i])}function V1(){let{matches:i}=y.useContext(Gt),u=i[i.length-1];return u?u.params:{}}function ci(i,{relative:u}={}){let{matches:s}=y.useContext(Gt),{pathname:o}=yt(),f=JSON.stringify(Gs(s));return y.useMemo(()=>$r(i,JSON.parse(f),o,u==="path"),[i,f,o,u])}function tv(i,u){return Gh(i,u)}function Gh(i,u,s){var B;qe(ul(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=y.useContext(Rt),{matches:f}=y.useContext(Gt),m=f[f.length-1],g=m?m.params:{},b=m?m.pathname:"/",_=m?m.pathnameBase:"/",p=m&&m.route;{let U=p&&p.path||"";Xh(b,!p||U.endsWith("*")||U.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${b}" (under <Route path="${U}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+ */var dh="popstate";function mh(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function y_(i={}){function u(o,f){var p;let m=(p=f.state)==null?void 0:p.masked,{pathname:g,search:b,hash:_}=m||o.location;return Os("",{pathname:g,search:b,hash:_},f.state&&f.state.usr||null,f.state&&f.state.key||"default",m?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function s(o,f){return typeof f=="string"?f:oi(f)}return v_(u,s,null,i)}function qe(i,u){if(i===!1||i===null||typeof i>"u")throw new Error(u)}function Yt(i,u){if(!i){typeof console<"u"&&console.warn(u);try{throw new Error(u)}catch{}}}function __(){return Math.random().toString(36).substring(2,10)}function hh(i,u){return{usr:i.state,key:i.key,idx:u,masked:i.unstable_mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function Os(i,u,s=null,o,f){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof u=="string"?il(u):u,state:s,key:u&&u.key||o||__(),unstable_mask:f}}function oi({pathname:i="/",search:u="",hash:s=""}){return u&&u!=="?"&&(i+=u.charAt(0)==="?"?u:"?"+u),s&&s!=="#"&&(i+=s.charAt(0)==="#"?s:"#"+s),i}function il(i){let u={};if(i){let s=i.indexOf("#");s>=0&&(u.hash=i.substring(s),i=i.substring(0,s));let o=i.indexOf("?");o>=0&&(u.search=i.substring(o),i=i.substring(0,o)),i&&(u.pathname=i)}return u}function v_(i,u,s,o={}){let{window:f=document.defaultView,v5Compat:m=!1}=o,g=f.history,b="POP",_=null,p=w();p==null&&(p=0,g.replaceState({...g.state,idx:p},""));function w(){return(g.state||{idx:null}).idx}function k(){b="POP";let B=w(),U=B==null?null:B-p;p=B,_&&_({action:b,location:H.location,delta:U})}function N(B,U){b="PUSH";let K=mh(B)?B:Os(H.location,B,U);p=w()+1;let X=hh(K,p),ue=H.createHref(K.unstable_mask||K);try{g.pushState(X,"",ue)}catch(ce){if(ce instanceof DOMException&&ce.name==="DataCloneError")throw ce;f.location.assign(ue)}m&&_&&_({action:b,location:H.location,delta:1})}function Y(B,U){b="REPLACE";let K=mh(B)?B:Os(H.location,B,U);p=w();let X=hh(K,p),ue=H.createHref(K.unstable_mask||K);g.replaceState(X,"",ue),m&&_&&_({action:b,location:H.location,delta:0})}function L(B){return b_(B)}let H={get action(){return b},get location(){return i(f,g)},listen(B){if(_)throw new Error("A history only accepts one active listener");return f.addEventListener(dh,k),_=B,()=>{f.removeEventListener(dh,k),_=null}},createHref(B){return u(f,B)},createURL:L,encodeLocation(B){let U=L(B);return{pathname:U.pathname,search:U.search,hash:U.hash}},push:N,replace:Y,go(B){return g.go(B)}};return H}function b_(i,u=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),qe(s,"No window.location.(origin|href) available to create URL");let o=typeof i=="string"?i:oi(i);return o=o.replace(/ $/,"%20"),!u&&o.startsWith("//")&&(o=s+o),new URL(o,s)}function Ch(i,u,s="/"){return x_(i,u,s,!1)}function x_(i,u,s,o){let f=typeof u=="string"?il(u):u,m=Sa(f.pathname||"/",s);if(m==null)return null;let g=Dh(i);S_(g);let b=null;for(let _=0;b==null&&_<g.length;++_){let p=D_(m);b=O_(g[_],p,o)}return b}function Dh(i,u=[],s=[],o="",f=!1){let m=(g,b,_=f,p)=>{let w={relativePath:p===void 0?g.path||"":p,caseSensitive:g.caseSensitive===!0,childrenIndex:b,route:g};if(w.relativePath.startsWith("/")){if(!w.relativePath.startsWith(o)&&_)return;qe(w.relativePath.startsWith(o),`Absolute route path "${w.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),w.relativePath=w.relativePath.slice(o.length)}let k=ta([o,w.relativePath]),N=s.concat(w);g.children&&g.children.length>0&&(qe(g.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${k}".`),Dh(g.children,u,N,k,_)),!(g.path==null&&!g.index)&&u.push({path:k,score:A_(k,g.index),routesMeta:N})};return i.forEach((g,b)=>{var _;if(g.path===""||!((_=g.path)!=null&&_.includes("?")))m(g,b);else for(let p of Nh(g.path))m(g,b,!0,p)}),u}function Nh(i){let u=i.split("/");if(u.length===0)return[];let[s,...o]=u,f=s.endsWith("?"),m=s.replace(/\?$/,"");if(o.length===0)return f?[m,""]:[m];let g=Nh(o.join("/")),b=[];return b.push(...g.map(_=>_===""?m:[m,_].join("/"))),f&&b.push(...g),b.map(_=>i.startsWith("/")&&_===""?"/":_)}function S_(i){i.sort((u,s)=>u.score!==s.score?s.score-u.score:z_(u.routesMeta.map(o=>o.childrenIndex),s.routesMeta.map(o=>o.childrenIndex)))}var k_=/^:[\w-]+$/,E_=3,w_=2,T_=1,j_=10,R_=-2,ph=i=>i==="*";function A_(i,u){let s=i.split("/"),o=s.length;return s.some(ph)&&(o+=R_),u&&(o+=w_),s.filter(f=>!ph(f)).reduce((f,m)=>f+(k_.test(m)?E_:m===""?T_:j_),o)}function z_(i,u){return i.length===u.length&&i.slice(0,-1).every((o,f)=>o===u[f])?i[i.length-1]-u[u.length-1]:0}function O_(i,u,s=!1){let{routesMeta:o}=i,f={},m="/",g=[];for(let b=0;b<o.length;++b){let _=o[b],p=b===o.length-1,w=m==="/"?u:u.slice(m.length)||"/",k=Zr({path:_.relativePath,caseSensitive:_.caseSensitive,end:p},w),N=_.route;if(!k&&p&&s&&!o[o.length-1].route.index&&(k=Zr({path:_.relativePath,caseSensitive:_.caseSensitive,end:!1},w)),!k)return null;Object.assign(f,k.params),g.push({params:f,pathname:ta([m,k.pathname]),pathnameBase:q_(ta([m,k.pathnameBase])),route:N}),k.pathnameBase!=="/"&&(m=ta([m,k.pathnameBase]))}return g}function Zr(i,u){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[s,o]=C_(i.path,i.caseSensitive,i.end),f=u.match(s);if(!f)return null;let m=f[0],g=m.replace(/(.)\/+$/,"$1"),b=f.slice(1);return{params:o.reduce((p,{paramName:w,isOptional:k},N)=>{if(w==="*"){let L=b[N]||"";g=m.slice(0,m.length-L.length).replace(/(.)\/+$/,"$1")}const Y=b[N];return k&&!Y?p[w]=void 0:p[w]=(Y||"").replace(/%2F/g,"/"),p},{}),pathname:m,pathnameBase:g,pattern:i}}function C_(i,u=!1,s=!0){Yt(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let o=[],f="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(g,b,_,p,w)=>{if(o.push({paramName:b,isOptional:_!=null}),_){let k=w.charAt(p+g.length);return k&&k!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(o.push({paramName:"*"}),f+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?f+="\\/*$":i!==""&&i!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,u?void 0:"i"),o]}function D_(i){try{return i.split("/").map(u=>decodeURIComponent(u).replace(/\//g,"%2F")).join("/")}catch(u){return Yt(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${u}).`),i}}function Sa(i,u){if(u==="/")return i;if(!i.toLowerCase().startsWith(u.toLowerCase()))return null;let s=u.endsWith("/")?u.length-1:u.length,o=i.charAt(s);return o&&o!=="/"?null:i.slice(s)||"/"}var N_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function M_(i,u="/"){let{pathname:s,search:o="",hash:f=""}=typeof i=="string"?il(i):i,m;return s?(s=s.replace(/\/\/+/g,"/"),s.startsWith("/")?m=gh(s.substring(1),"/"):m=gh(s,u)):m=u,{pathname:m,search:L_(o),hash:H_(f)}}function gh(i,u){let s=u.replace(/\/+$/,"").split("/");return i.split("/").forEach(f=>{f===".."?s.length>1&&s.pop():f!=="."&&s.push(f)}),s.length>1?s.join("/"):"/"}function ws(i,u,s,o){return`Cannot include a '${i}' character in a manually specified \`to.${u}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function U_(i){return i.filter((u,s)=>s===0||u.route.path&&u.route.path.length>0)}function Gs(i){let u=U_(i);return u.map((s,o)=>o===u.length-1?s.pathname:s.pathnameBase)}function $r(i,u,s,o=!1){let f;typeof i=="string"?f=il(i):(f={...i},qe(!f.pathname||!f.pathname.includes("?"),ws("?","pathname","search",f)),qe(!f.pathname||!f.pathname.includes("#"),ws("#","pathname","hash",f)),qe(!f.search||!f.search.includes("#"),ws("#","search","hash",f)));let m=i===""||f.pathname==="",g=m?"/":f.pathname,b;if(g==null)b=s;else{let k=u.length-1;if(!o&&g.startsWith("..")){let N=g.split("/");for(;N[0]==="..";)N.shift(),k-=1;f.pathname=N.join("/")}b=k>=0?u[k]:"/"}let _=M_(f,b),p=g&&g!=="/"&&g.endsWith("/"),w=(m||g===".")&&s.endsWith("/");return!_.pathname.endsWith("/")&&(p||w)&&(_.pathname+="/"),_}var ta=i=>i.join("/").replace(/\/\/+/g,"/"),q_=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),L_=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,H_=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,B_=class{constructor(i,u,s,o=!1){this.status=i,this.statusText=u||"",this.internal=o,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Y_(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function G_(i){return i.map(u=>u.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Mh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Uh(i,u){let s=i;if(typeof s!="string"||!N_.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let o=s,f=!1;if(Mh)try{let m=new URL(window.location.href),g=s.startsWith("//")?new URL(m.protocol+s):new URL(s),b=Sa(g.pathname,u);g.origin===m.origin&&b!=null?s=b+g.search+g.hash:f=!0}catch{Yt(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:f,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var qh=["POST","PUT","PATCH","DELETE"];new Set(qh);var V_=["GET",...qh];new Set(V_);var rl=y.createContext(null);rl.displayName="DataRouter";var Wr=y.createContext(null);Wr.displayName="DataRouterState";var X_=y.createContext(!1),Lh=y.createContext({isTransitioning:!1});Lh.displayName="ViewTransition";var Q_=y.createContext(new Map);Q_.displayName="Fetchers";var Z_=y.createContext(null);Z_.displayName="Await";var Rt=y.createContext(null);Rt.displayName="Navigation";var si=y.createContext(null);si.displayName="Location";var Gt=y.createContext({outlet:null,matches:[],isDataRoute:!1});Gt.displayName="Route";var Vs=y.createContext(null);Vs.displayName="RouteError";var Hh="REACT_ROUTER_ERROR",K_="REDIRECT",J_="ROUTE_ERROR_RESPONSE";function $_(i){if(i.startsWith(`${Hh}:${K_}:{`))try{let u=JSON.parse(i.slice(28));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string"&&typeof u.location=="string"&&typeof u.reloadDocument=="boolean"&&typeof u.replace=="boolean")return u}catch{}}function W_(i){if(i.startsWith(`${Hh}:${J_}:{`))try{let u=JSON.parse(i.slice(40));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string")return new B_(u.status,u.statusText,u.data)}catch{}}function F_(i,{relative:u}={}){qe(ul(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:o}=y.useContext(Rt),{hash:f,pathname:m,search:g}=ci(i,{relative:u}),b=m;return s!=="/"&&(b=m==="/"?s:ta([s,m])),o.createHref({pathname:b,search:g,hash:f})}function ul(){return y.useContext(si)!=null}function yt(){return qe(ul(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(si).location}var Bh="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Yh(i){y.useContext(Rt).static||y.useLayoutEffect(i)}function Fa(){let{isDataRoute:i}=y.useContext(Gt);return i?dv():I_()}function I_(){qe(ul(),"useNavigate() may be used only in the context of a <Router> component.");let i=y.useContext(rl),{basename:u,navigator:s}=y.useContext(Rt),{matches:o}=y.useContext(Gt),{pathname:f}=yt(),m=JSON.stringify(Gs(o)),g=y.useRef(!1);return Yh(()=>{g.current=!0}),y.useCallback((_,p={})=>{if(Yt(g.current,Bh),!g.current)return;if(typeof _=="number"){s.go(_);return}let w=$r(_,JSON.parse(m),f,p.relative==="path");i==null&&u!=="/"&&(w.pathname=w.pathname==="/"?u:ta([u,w.pathname])),(p.replace?s.replace:s.push)(w,p.state,p)},[u,s,m,f,i])}var P_=y.createContext(null);function ev(i){let u=y.useContext(Gt).outlet;return y.useMemo(()=>u&&y.createElement(P_.Provider,{value:i},u),[u,i])}function G1(){let{matches:i}=y.useContext(Gt),u=i[i.length-1];return u?u.params:{}}function ci(i,{relative:u}={}){let{matches:s}=y.useContext(Gt),{pathname:o}=yt(),f=JSON.stringify(Gs(s));return y.useMemo(()=>$r(i,JSON.parse(f),o,u==="path"),[i,f,o,u])}function tv(i,u){return Gh(i,u)}function Gh(i,u,s){var B;qe(ul(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=y.useContext(Rt),{matches:f}=y.useContext(Gt),m=f[f.length-1],g=m?m.params:{},b=m?m.pathname:"/",_=m?m.pathnameBase:"/",p=m&&m.route;{let U=p&&p.path||"";Xh(b,!p||U.endsWith("*")||U.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${b}" (under <Route path="${U}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
60
 
61
- Please change the parent <Route path="${U}"> to <Route path="${U==="/"?"*":`${U}/*`}">.`)}let w=yt(),k;if(u){let U=typeof u=="string"?il(u):u;qe(_==="/"||((B=U.pathname)==null?void 0:B.startsWith(_)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${_}" but pathname "${U.pathname}" was given in the \`location\` prop.`),k=U}else k=w;let N=k.pathname||"/",Y=N;if(_!=="/"){let U=_.replace(/^\//,"").split("/");Y="/"+N.replace(/^\//,"").split("/").slice(U.length).join("/")}let L=Ch(i,{pathname:Y});Yt(p||L!=null,`No routes matched location "${k.pathname}${k.search}${k.hash}" `),Yt(L==null||L[L.length-1].route.element!==void 0||L[L.length-1].route.Component!==void 0||L[L.length-1].route.lazy!==void 0,`Matched leaf route at location "${k.pathname}${k.search}${k.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let H=rv(L&&L.map(U=>Object.assign({},U,{params:Object.assign({},g,U.params),pathname:ta([_,o.encodeLocation?o.encodeLocation(U.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:U.pathname]),pathnameBase:U.pathnameBase==="/"?_:ta([_,o.encodeLocation?o.encodeLocation(U.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:U.pathnameBase])})),f,s);return u&&H?y.createElement(si.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...k},navigationType:"POP"}},H):H}function av(){let i=fv(),u=Y_(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),s=i instanceof Error?i.stack:null,o="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:o},m={padding:"2px 4px",backgroundColor:o},g=null;return console.error("Error handled by React Router default ErrorBoundary:",i),g=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:m},"ErrorBoundary")," or"," ",y.createElement("code",{style:m},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},u),s?y.createElement("pre",{style:f},s):null,g)}var nv=y.createElement(av,null),Vh=class extends y.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,u){return u.location!==i.location||u.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:u.error,location:u.location,revalidation:i.revalidation||u.revalidation}}componentDidCatch(i,u){this.props.onError?this.props.onError(i,u):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const s=W_(i.digest);s&&(i=s)}let u=i!==void 0?y.createElement(Gt.Provider,{value:this.props.routeContext},y.createElement(Vs.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?y.createElement(lv,{error:i},u):u}};Vh.contextType=X_;var Ts=new WeakMap;function lv({children:i,error:u}){let{basename:s}=y.useContext(Rt);if(typeof u=="object"&&u&&"digest"in u&&typeof u.digest=="string"){let o=$_(u.digest);if(o){let f=Ts.get(u);if(f)throw f;let m=Uh(o.location,s);if(Mh&&!Ts.get(u))if(m.isExternal||o.reloadDocument)window.location.href=m.absoluteURL||m.to;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:o.replace}));throw Ts.set(u,g),g}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m.absoluteURL||m.to}`})}}return i}function iv({routeContext:i,match:u,children:s}){let o=y.useContext(rl);return o&&o.static&&o.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=u.route.id),y.createElement(Gt.Provider,{value:i},s)}function rv(i,u=[],s){let o=s==null?void 0:s.state;if(i==null){if(!o)return null;if(o.errors)i=o.matches;else if(u.length===0&&!o.initialized&&o.matches.length>0)i=o.matches;else return null}let f=i,m=o==null?void 0:o.errors;if(m!=null){let w=f.findIndex(k=>k.route.id&&(m==null?void 0:m[k.route.id])!==void 0);qe(w>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),f=f.slice(0,Math.min(f.length,w+1))}let g=!1,b=-1;if(s&&o){g=o.renderFallback;for(let w=0;w<f.length;w++){let k=f[w];if((k.route.HydrateFallback||k.route.hydrateFallbackElement)&&(b=w),k.route.id){let{loaderData:N,errors:Y}=o,L=k.route.loader&&!N.hasOwnProperty(k.route.id)&&(!Y||Y[k.route.id]===void 0);if(k.route.lazy||L){s.isStatic&&(g=!0),b>=0?f=f.slice(0,b+1):f=[f[0]];break}}}}let _=s==null?void 0:s.onError,p=o&&_?(w,k)=>{var N,Y;_(w,{location:o.location,params:((Y=(N=o.matches)==null?void 0:N[0])==null?void 0:Y.params)??{},unstable_pattern:G_(o.matches),errorInfo:k})}:void 0;return f.reduceRight((w,k,N)=>{let Y,L=!1,H=null,B=null;o&&(Y=m&&k.route.id?m[k.route.id]:void 0,H=k.route.errorElement||nv,g&&(b<0&&N===0?(Xh("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),L=!0,B=null):b===N&&(L=!0,B=k.route.hydrateFallbackElement||null)));let U=u.concat(f.slice(0,N+1)),K=()=>{let X;return Y?X=H:L?X=B:k.route.Component?X=y.createElement(k.route.Component,null):k.route.element?X=k.route.element:X=w,y.createElement(iv,{match:k,routeContext:{outlet:w,matches:U,isDataRoute:o!=null},children:X})};return o&&(k.route.ErrorBoundary||k.route.errorElement||N===0)?y.createElement(Vh,{location:o.location,revalidation:o.revalidation,component:H,error:Y,children:K(),routeContext:{outlet:null,matches:U,isDataRoute:!0},onError:p}):K()},null)}function Xs(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function uv(i){let u=y.useContext(rl);return qe(u,Xs(i)),u}function ov(i){let u=y.useContext(Wr);return qe(u,Xs(i)),u}function sv(i){let u=y.useContext(Gt);return qe(u,Xs(i)),u}function Qs(i){let u=sv(i),s=u.matches[u.matches.length-1];return qe(s.route.id,`${i} can only be used on routes that contain a unique "id"`),s.route.id}function cv(){return Qs("useRouteId")}function fv(){var o;let i=y.useContext(Vs),u=ov("useRouteError"),s=Qs("useRouteError");return i!==void 0?i:(o=u.errors)==null?void 0:o[s]}function dv(){let{router:i}=uv("useNavigate"),u=Qs("useNavigate"),s=y.useRef(!1);return Yh(()=>{s.current=!0}),y.useCallback(async(f,m={})=>{Yt(s.current,Bh),s.current&&(typeof f=="number"?await i.navigate(f):await i.navigate(f,{fromRouteId:u,...m}))},[i,u])}var yh={};function Xh(i,u,s){!u&&!yh[i]&&(yh[i]=!0,Yt(!1,s))}y.memo(mv);function mv({routes:i,future:u,state:s,isStatic:o,onError:f}){return Gh(i,void 0,{state:s,isStatic:o,onError:f})}function ll({to:i,replace:u,state:s,relative:o}){qe(ul(),"<Navigate> may be used only in the context of a <Router> component.");let{static:f}=y.useContext(Rt);Yt(!f,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:m}=y.useContext(Gt),{pathname:g}=yt(),b=Fa(),_=$r(i,Gs(m),g,o==="path"),p=JSON.stringify(_);return y.useEffect(()=>{b(JSON.parse(p),{replace:u,state:s,relative:o})},[b,p,o,u,s]),null}function hv(i){return ev(i.context)}function P(i){qe(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function pv({basename:i="/",children:u=null,location:s,navigationType:o="POP",navigator:f,static:m=!1,unstable_useTransitions:g}){qe(!ul(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let b=i.replace(/^\/*/,"/"),_=y.useMemo(()=>({basename:b,navigator:f,static:m,unstable_useTransitions:g,future:{}}),[b,f,m,g]);typeof s=="string"&&(s=il(s));let{pathname:p="/",search:w="",hash:k="",state:N=null,key:Y="default",unstable_mask:L}=s,H=y.useMemo(()=>{let B=Sa(p,b);return B==null?null:{location:{pathname:B,search:w,hash:k,state:N,key:Y,unstable_mask:L},navigationType:o}},[b,p,w,k,N,Y,o,L]);return Yt(H!=null,`<Router basename="${b}"> is not able to match the URL "${p}${w}${k}" because it does not start with the basename, so the <Router> won't render anything.`),H==null?null:y.createElement(Rt.Provider,{value:_},y.createElement(si.Provider,{children:u,value:H}))}function gv({children:i,location:u}){return tv(Cs(i),u)}function Cs(i,u=[]){let s=[];return y.Children.forEach(i,(o,f)=>{if(!y.isValidElement(o))return;let m=[...u,f];if(o.type===y.Fragment){s.push.apply(s,Cs(o.props.children,m));return}qe(o.type===P,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),qe(!o.props.index||!o.props.children,"An index route cannot have child routes.");let g={id:o.props.id||m.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(g.children=Cs(o.props.children,m)),s.push(g)}),s}var Hr="get",Br="application/x-www-form-urlencoded";function Fr(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function yv(i){return Fr(i)&&i.tagName.toLowerCase()==="button"}function _v(i){return Fr(i)&&i.tagName.toLowerCase()==="form"}function vv(i){return Fr(i)&&i.tagName.toLowerCase()==="input"}function bv(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function xv(i,u){return i.button===0&&(!u||u==="_self")&&!bv(i)}function Ds(i=""){return new URLSearchParams(typeof i=="string"||Array.isArray(i)||i instanceof URLSearchParams?i:Object.keys(i).reduce((u,s)=>{let o=i[s];return u.concat(Array.isArray(o)?o.map(f=>[s,f]):[[s,o]])},[]))}function Sv(i,u){let s=Ds(i);return u&&u.forEach((o,f)=>{s.has(f)||u.getAll(f).forEach(m=>{s.append(f,m)})}),s}var zr=null;function kv(){if(zr===null)try{new FormData(document.createElement("form"),0),zr=!1}catch{zr=!0}return zr}var Ev=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function js(i){return i!=null&&!Ev.has(i)?(Yt(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Br}"`),null):i}function wv(i,u){let s,o,f,m,g;if(_v(i)){let b=i.getAttribute("action");o=b?Sa(b,u):null,s=i.getAttribute("method")||Hr,f=js(i.getAttribute("enctype"))||Br,m=new FormData(i)}else if(yv(i)||vv(i)&&(i.type==="submit"||i.type==="image")){let b=i.form;if(b==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let _=i.getAttribute("formaction")||b.getAttribute("action");if(o=_?Sa(_,u):null,s=i.getAttribute("formmethod")||b.getAttribute("method")||Hr,f=js(i.getAttribute("formenctype"))||js(b.getAttribute("enctype"))||Br,m=new FormData(b,i),!kv()){let{name:p,type:w,value:k}=i;if(w==="image"){let N=p?`${p}.`:"";m.append(`${N}x`,"0"),m.append(`${N}y`,"0")}else p&&m.append(p,k)}}else{if(Fr(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Hr,o=null,f=Br,g=i}return m&&f==="text/plain"&&(g=m,m=void 0),{action:o,method:s.toLowerCase(),encType:f,formData:m,body:g}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Zs(i,u){if(i===!1||i===null||typeof i>"u")throw new Error(u)}function Tv(i,u,s,o){let f=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return s?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${o}`:f.pathname=`${f.pathname}.${o}`:f.pathname==="/"?f.pathname=`_root.${o}`:u&&Sa(f.pathname,u)==="/"?f.pathname=`${u.replace(/\/$/,"")}/_root.${o}`:f.pathname=`${f.pathname.replace(/\/$/,"")}.${o}`,f}async function jv(i,u){if(i.id in u)return u[i.id];try{let s=await import(i.module);return u[i.id]=s,s}catch(s){return console.error(`Error loading route module \`${i.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Rv(i){return i==null?!1:i.href==null?i.rel==="preload"&&typeof i.imageSrcSet=="string"&&typeof i.imageSizes=="string":typeof i.rel=="string"&&typeof i.href=="string"}async function Av(i,u,s){let o=await Promise.all(i.map(async f=>{let m=u.routes[f.route.id];if(m){let g=await jv(m,s);return g.links?g.links():[]}return[]}));return Dv(o.flat(1).filter(Rv).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function _h(i,u,s,o,f,m){let g=(_,p)=>s[p]?_.route.id!==s[p].route.id:!0,b=(_,p)=>{var w;return s[p].pathname!==_.pathname||((w=s[p].route.path)==null?void 0:w.endsWith("*"))&&s[p].params["*"]!==_.params["*"]};return m==="assets"?u.filter((_,p)=>g(_,p)||b(_,p)):m==="data"?u.filter((_,p)=>{var k;let w=o.routes[_.route.id];if(!w||!w.hasLoader)return!1;if(g(_,p)||b(_,p))return!0;if(_.route.shouldRevalidate){let N=_.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:((k=s[0])==null?void 0:k.params)||{},nextUrl:new URL(i,window.origin),nextParams:_.params,defaultShouldRevalidate:!0});if(typeof N=="boolean")return N}return!0}):[]}function zv(i,u,{includeHydrateFallback:s}={}){return Ov(i.map(o=>{let f=u.routes[o.route.id];if(!f)return[];let m=[f.module];return f.clientActionModule&&(m=m.concat(f.clientActionModule)),f.clientLoaderModule&&(m=m.concat(f.clientLoaderModule)),s&&f.hydrateFallbackModule&&(m=m.concat(f.hydrateFallbackModule)),f.imports&&(m=m.concat(f.imports)),m}).flat(1))}function Ov(i){return[...new Set(i)]}function Cv(i){let u={},s=Object.keys(i).sort();for(let o of s)u[o]=i[o];return u}function Dv(i,u){let s=new Set;return new Set(u),i.reduce((o,f)=>{let m=JSON.stringify(Cv(f));return s.has(m)||(s.add(m),o.push({key:m,link:f})),o},[])}function Qh(){let i=y.useContext(rl);return Zs(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function Nv(){let i=y.useContext(Wr);return Zs(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var Ks=y.createContext(void 0);Ks.displayName="FrameworkContext";function Zh(){let i=y.useContext(Ks);return Zs(i,"You must render this element inside a <HydratedRouter> element"),i}function Mv(i,u){let s=y.useContext(Ks),[o,f]=y.useState(!1),[m,g]=y.useState(!1),{onFocus:b,onBlur:_,onMouseEnter:p,onMouseLeave:w,onTouchStart:k}=u,N=y.useRef(null);y.useEffect(()=>{if(i==="render"&&g(!0),i==="viewport"){let H=U=>{U.forEach(K=>{g(K.isIntersecting)})},B=new IntersectionObserver(H,{threshold:.5});return N.current&&B.observe(N.current),()=>{B.disconnect()}}},[i]),y.useEffect(()=>{if(o){let H=setTimeout(()=>{g(!0)},100);return()=>{clearTimeout(H)}}},[o]);let Y=()=>{f(!0)},L=()=>{f(!1),g(!1)};return s?i!=="intent"?[m,N,{}]:[m,N,{onFocus:ni(b,Y),onBlur:ni(_,L),onMouseEnter:ni(p,Y),onMouseLeave:ni(w,L),onTouchStart:ni(k,Y)}]:[!1,N,{}]}function ni(i,u){return s=>{i&&i(s),s.defaultPrevented||u(s)}}function Uv({page:i,...u}){let{router:s}=Qh(),o=y.useMemo(()=>Ch(s.routes,i,s.basename),[s.routes,i,s.basename]);return o?y.createElement(Lv,{page:i,matches:o,...u}):null}function qv(i){let{manifest:u,routeModules:s}=Zh(),[o,f]=y.useState([]);return y.useEffect(()=>{let m=!1;return Av(i,u,s).then(g=>{m||f(g)}),()=>{m=!0}},[i,u,s]),o}function Lv({page:i,matches:u,...s}){let o=yt(),{future:f,manifest:m,routeModules:g}=Zh(),{basename:b}=Qh(),{loaderData:_,matches:p}=Nv(),w=y.useMemo(()=>_h(i,u,p,m,o,"data"),[i,u,p,m,o]),k=y.useMemo(()=>_h(i,u,p,m,o,"assets"),[i,u,p,m,o]),N=y.useMemo(()=>{if(i===o.pathname+o.search+o.hash)return[];let H=new Set,B=!1;if(u.forEach(K=>{var ue;let X=m.routes[K.route.id];!X||!X.hasLoader||(!w.some(ce=>ce.route.id===K.route.id)&&K.route.id in _&&((ue=g[K.route.id])!=null&&ue.shouldRevalidate)||X.hasClientLoader?B=!0:H.add(K.route.id))}),H.size===0)return[];let U=Tv(i,b,f.unstable_trailingSlashAwareDataRequests,"data");return B&&H.size>0&&U.searchParams.set("_routes",u.filter(K=>H.has(K.route.id)).map(K=>K.route.id).join(",")),[U.pathname+U.search]},[b,f.unstable_trailingSlashAwareDataRequests,_,o,m,w,u,i,g]),Y=y.useMemo(()=>zv(k,m),[k,m]),L=qv(k);return y.createElement(y.Fragment,null,N.map(H=>y.createElement("link",{key:H,rel:"prefetch",as:"fetch",href:H,...s})),Y.map(H=>y.createElement("link",{key:H,rel:"modulepreload",href:H,...s})),L.map(({key:H,link:B})=>y.createElement("link",{key:H,nonce:s.nonce,...B,crossOrigin:B.crossOrigin??s.crossOrigin})))}function Hv(...i){return u=>{i.forEach(s=>{typeof s=="function"?s(u):s!=null&&(s.current=u)})}}var Bv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Bv&&(window.__reactRouterVersion="7.13.1")}catch{}function Yv({basename:i,children:u,unstable_useTransitions:s,window:o}){let f=y.useRef();f.current==null&&(f.current=y_({window:o,v5Compat:!0}));let m=f.current,[g,b]=y.useState({action:m.action,location:m.location}),_=y.useCallback(p=>{s===!1?b(p):y.startTransition(()=>b(p))},[s]);return y.useLayoutEffect(()=>m.listen(_),[m,_]),y.createElement(pv,{basename:i,children:u,location:g.location,navigationType:g.action,navigator:m,unstable_useTransitions:s})}var Kh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jh=y.forwardRef(function({onClick:u,discover:s="render",prefetch:o="none",relative:f,reloadDocument:m,replace:g,unstable_mask:b,state:_,target:p,to:w,preventScrollReset:k,viewTransition:N,unstable_defaultShouldRevalidate:Y,...L},H){let{basename:B,navigator:U,unstable_useTransitions:K}=y.useContext(Rt),X=typeof w=="string"&&Kh.test(w),ue=Uh(w,B);w=ue.to;let ce=F_(w,{relative:f}),ge=yt(),F=null;if(b){let Me=$r(b,[],ge.unstable_mask?ge.unstable_mask.pathname:"/",!0);B!=="/"&&(Me.pathname=Me.pathname==="/"?B:ta([B,Me.pathname])),F=U.createHref(Me)}let[W,se,Pe]=Mv(o,L),Je=Xv(w,{replace:g,unstable_mask:b,state:_,target:p,preventScrollReset:k,relative:f,viewTransition:N,unstable_defaultShouldRevalidate:Y,unstable_useTransitions:K});function Ce(Me){u&&u(Me),Me.defaultPrevented||Je(Me)}let At=!(ue.isExternal||m),ut=y.createElement("a",{...L,...Pe,href:(At?F:void 0)||ue.absoluteURL||ce,onClick:At?Ce:u,ref:Hv(H,se),target:p,"data-discover":!X&&s==="render"?"true":void 0});return W&&!X?y.createElement(y.Fragment,null,ut,y.createElement(Uv,{page:ce})):ut});Jh.displayName="Link";var Js=y.forwardRef(function({"aria-current":u="page",caseSensitive:s=!1,className:o="",end:f=!1,style:m,to:g,viewTransition:b,children:_,...p},w){let k=ci(g,{relative:p.relative}),N=yt(),Y=y.useContext(Wr),{navigator:L,basename:H}=y.useContext(Rt),B=Y!=null&&$v(k)&&b===!0,U=L.encodeLocation?L.encodeLocation(k).pathname:k.pathname,K=N.pathname,X=Y&&Y.navigation&&Y.navigation.location?Y.navigation.location.pathname:null;s||(K=K.toLowerCase(),X=X?X.toLowerCase():null,U=U.toLowerCase()),X&&H&&(X=Sa(X,H)||X);const ue=U!=="/"&&U.endsWith("/")?U.length-1:U.length;let ce=K===U||!f&&K.startsWith(U)&&K.charAt(ue)==="/",ge=X!=null&&(X===U||!f&&X.startsWith(U)&&X.charAt(U.length)==="/"),F={isActive:ce,isPending:ge,isTransitioning:B},W=ce?u:void 0,se;typeof o=="function"?se=o(F):se=[o,ce?"active":null,ge?"pending":null,B?"transitioning":null].filter(Boolean).join(" ");let Pe=typeof m=="function"?m(F):m;return y.createElement(Jh,{...p,"aria-current":W,className:se,ref:w,style:Pe,to:g,viewTransition:b},typeof _=="function"?_(F):_)});Js.displayName="NavLink";var Gv=y.forwardRef(({discover:i="render",fetcherKey:u,navigate:s,reloadDocument:o,replace:f,state:m,method:g=Hr,action:b,onSubmit:_,relative:p,preventScrollReset:w,viewTransition:k,unstable_defaultShouldRevalidate:N,...Y},L)=>{let{unstable_useTransitions:H}=y.useContext(Rt),B=Kv(),U=Jv(b,{relative:p}),K=g.toLowerCase()==="get"?"get":"post",X=typeof b=="string"&&Kh.test(b),ue=ce=>{if(_&&_(ce),ce.defaultPrevented)return;ce.preventDefault();let ge=ce.nativeEvent.submitter,F=(ge==null?void 0:ge.getAttribute("formmethod"))||g,W=()=>B(ge||ce.currentTarget,{fetcherKey:u,method:F,navigate:s,replace:f,state:m,relative:p,preventScrollReset:w,viewTransition:k,unstable_defaultShouldRevalidate:N});H&&s!==!1?y.startTransition(()=>W()):W()};return y.createElement("form",{ref:L,method:K,action:U,onSubmit:o?_:ue,...Y,"data-discover":!X&&i==="render"?"true":void 0})});Gv.displayName="Form";function Vv(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $h(i){let u=y.useContext(rl);return qe(u,Vv(i)),u}function Xv(i,{target:u,replace:s,unstable_mask:o,state:f,preventScrollReset:m,relative:g,viewTransition:b,unstable_defaultShouldRevalidate:_,unstable_useTransitions:p}={}){let w=Fa(),k=yt(),N=ci(i,{relative:g});return y.useCallback(Y=>{if(xv(Y,u)){Y.preventDefault();let L=s!==void 0?s:oi(k)===oi(N),H=()=>w(i,{replace:L,unstable_mask:o,state:f,preventScrollReset:m,relative:g,viewTransition:b,unstable_defaultShouldRevalidate:_});p?y.startTransition(()=>H()):H()}},[k,w,N,s,o,f,u,i,m,g,b,_,p])}function X1(i){Yt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let u=y.useRef(Ds(i)),s=y.useRef(!1),o=yt(),f=y.useMemo(()=>Sv(o.search,s.current?null:u.current),[o.search]),m=Fa(),g=y.useCallback((b,_)=>{const p=Ds(typeof b=="function"?b(new URLSearchParams(f)):b);s.current=!0,m("?"+p,_)},[m,f]);return[f,g]}var Qv=0,Zv=()=>`__${String(++Qv)}__`;function Kv(){let{router:i}=$h("useSubmit"),{basename:u}=y.useContext(Rt),s=cv(),o=i.fetch,f=i.navigate;return y.useCallback(async(m,g={})=>{let{action:b,method:_,encType:p,formData:w,body:k}=wv(m,u);if(g.navigate===!1){let N=g.fetcherKey||Zv();await o(N,s,g.action||b,{unstable_defaultShouldRevalidate:g.unstable_defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:w,body:k,formMethod:g.method||_,formEncType:g.encType||p,flushSync:g.flushSync})}else await f(g.action||b,{unstable_defaultShouldRevalidate:g.unstable_defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:w,body:k,formMethod:g.method||_,formEncType:g.encType||p,replace:g.replace,state:g.state,fromRouteId:s,flushSync:g.flushSync,viewTransition:g.viewTransition})},[o,f,u,s])}function Jv(i,{relative:u}={}){let{basename:s}=y.useContext(Rt),o=y.useContext(Gt);qe(o,"useFormAction must be used inside a RouteContext");let[f]=o.matches.slice(-1),m={...ci(i||".",{relative:u})},g=yt();if(i==null){m.search=g.search;let b=new URLSearchParams(m.search),_=b.getAll("index");if(_.some(w=>w==="")){b.delete("index"),_.filter(k=>k).forEach(k=>b.append("index",k));let w=b.toString();m.search=w?`?${w}`:""}}return(!i||i===".")&&f.route.index&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(m.pathname=m.pathname==="/"?s:ta([s,m.pathname])),oi(m)}function $v(i,{relative:u}={}){let s=y.useContext(Lh);qe(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=$h("useViewTransitionState"),f=ci(i,{relative:u});if(!s.isTransitioning)return!1;let m=Sa(s.currentLocation.pathname,o)||s.currentLocation.pathname,g=Sa(s.nextLocation.pathname,o)||s.nextLocation.pathname;return Zr(f.pathname,g)!=null||Zr(f.pathname,m)!=null}function Wh(i,u){return i?i.length<=u?i:i.slice(0,u)+"...":""}/**
61
+ Please change the parent <Route path="${U}"> to <Route path="${U==="/"?"*":`${U}/*`}">.`)}let w=yt(),k;if(u){let U=typeof u=="string"?il(u):u;qe(_==="/"||((B=U.pathname)==null?void 0:B.startsWith(_)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${_}" but pathname "${U.pathname}" was given in the \`location\` prop.`),k=U}else k=w;let N=k.pathname||"/",Y=N;if(_!=="/"){let U=_.replace(/^\//,"").split("/");Y="/"+N.replace(/^\//,"").split("/").slice(U.length).join("/")}let L=Ch(i,{pathname:Y});Yt(p||L!=null,`No routes matched location "${k.pathname}${k.search}${k.hash}" `),Yt(L==null||L[L.length-1].route.element!==void 0||L[L.length-1].route.Component!==void 0||L[L.length-1].route.lazy!==void 0,`Matched leaf route at location "${k.pathname}${k.search}${k.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let H=rv(L&&L.map(U=>Object.assign({},U,{params:Object.assign({},g,U.params),pathname:ta([_,o.encodeLocation?o.encodeLocation(U.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:U.pathname]),pathnameBase:U.pathnameBase==="/"?_:ta([_,o.encodeLocation?o.encodeLocation(U.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:U.pathnameBase])})),f,s);return u&&H?y.createElement(si.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...k},navigationType:"POP"}},H):H}function av(){let i=fv(),u=Y_(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),s=i instanceof Error?i.stack:null,o="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:o},m={padding:"2px 4px",backgroundColor:o},g=null;return console.error("Error handled by React Router default ErrorBoundary:",i),g=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:m},"ErrorBoundary")," or"," ",y.createElement("code",{style:m},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},u),s?y.createElement("pre",{style:f},s):null,g)}var nv=y.createElement(av,null),Vh=class extends y.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,u){return u.location!==i.location||u.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:u.error,location:u.location,revalidation:i.revalidation||u.revalidation}}componentDidCatch(i,u){this.props.onError?this.props.onError(i,u):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const s=W_(i.digest);s&&(i=s)}let u=i!==void 0?y.createElement(Gt.Provider,{value:this.props.routeContext},y.createElement(Vs.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?y.createElement(lv,{error:i},u):u}};Vh.contextType=X_;var Ts=new WeakMap;function lv({children:i,error:u}){let{basename:s}=y.useContext(Rt);if(typeof u=="object"&&u&&"digest"in u&&typeof u.digest=="string"){let o=$_(u.digest);if(o){let f=Ts.get(u);if(f)throw f;let m=Uh(o.location,s);if(Mh&&!Ts.get(u))if(m.isExternal||o.reloadDocument)window.location.href=m.absoluteURL||m.to;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:o.replace}));throw Ts.set(u,g),g}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m.absoluteURL||m.to}`})}}return i}function iv({routeContext:i,match:u,children:s}){let o=y.useContext(rl);return o&&o.static&&o.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=u.route.id),y.createElement(Gt.Provider,{value:i},s)}function rv(i,u=[],s){let o=s==null?void 0:s.state;if(i==null){if(!o)return null;if(o.errors)i=o.matches;else if(u.length===0&&!o.initialized&&o.matches.length>0)i=o.matches;else return null}let f=i,m=o==null?void 0:o.errors;if(m!=null){let w=f.findIndex(k=>k.route.id&&(m==null?void 0:m[k.route.id])!==void 0);qe(w>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),f=f.slice(0,Math.min(f.length,w+1))}let g=!1,b=-1;if(s&&o){g=o.renderFallback;for(let w=0;w<f.length;w++){let k=f[w];if((k.route.HydrateFallback||k.route.hydrateFallbackElement)&&(b=w),k.route.id){let{loaderData:N,errors:Y}=o,L=k.route.loader&&!N.hasOwnProperty(k.route.id)&&(!Y||Y[k.route.id]===void 0);if(k.route.lazy||L){s.isStatic&&(g=!0),b>=0?f=f.slice(0,b+1):f=[f[0]];break}}}}let _=s==null?void 0:s.onError,p=o&&_?(w,k)=>{var N,Y;_(w,{location:o.location,params:((Y=(N=o.matches)==null?void 0:N[0])==null?void 0:Y.params)??{},unstable_pattern:G_(o.matches),errorInfo:k})}:void 0;return f.reduceRight((w,k,N)=>{let Y,L=!1,H=null,B=null;o&&(Y=m&&k.route.id?m[k.route.id]:void 0,H=k.route.errorElement||nv,g&&(b<0&&N===0?(Xh("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),L=!0,B=null):b===N&&(L=!0,B=k.route.hydrateFallbackElement||null)));let U=u.concat(f.slice(0,N+1)),K=()=>{let X;return Y?X=H:L?X=B:k.route.Component?X=y.createElement(k.route.Component,null):k.route.element?X=k.route.element:X=w,y.createElement(iv,{match:k,routeContext:{outlet:w,matches:U,isDataRoute:o!=null},children:X})};return o&&(k.route.ErrorBoundary||k.route.errorElement||N===0)?y.createElement(Vh,{location:o.location,revalidation:o.revalidation,component:H,error:Y,children:K(),routeContext:{outlet:null,matches:U,isDataRoute:!0},onError:p}):K()},null)}function Xs(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function uv(i){let u=y.useContext(rl);return qe(u,Xs(i)),u}function ov(i){let u=y.useContext(Wr);return qe(u,Xs(i)),u}function sv(i){let u=y.useContext(Gt);return qe(u,Xs(i)),u}function Qs(i){let u=sv(i),s=u.matches[u.matches.length-1];return qe(s.route.id,`${i} can only be used on routes that contain a unique "id"`),s.route.id}function cv(){return Qs("useRouteId")}function fv(){var o;let i=y.useContext(Vs),u=ov("useRouteError"),s=Qs("useRouteError");return i!==void 0?i:(o=u.errors)==null?void 0:o[s]}function dv(){let{router:i}=uv("useNavigate"),u=Qs("useNavigate"),s=y.useRef(!1);return Yh(()=>{s.current=!0}),y.useCallback(async(f,m={})=>{Yt(s.current,Bh),s.current&&(typeof f=="number"?await i.navigate(f):await i.navigate(f,{fromRouteId:u,...m}))},[i,u])}var yh={};function Xh(i,u,s){!u&&!yh[i]&&(yh[i]=!0,Yt(!1,s))}y.memo(mv);function mv({routes:i,future:u,state:s,isStatic:o,onError:f}){return Gh(i,void 0,{state:s,isStatic:o,onError:f})}function ll({to:i,replace:u,state:s,relative:o}){qe(ul(),"<Navigate> may be used only in the context of a <Router> component.");let{static:f}=y.useContext(Rt);Yt(!f,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:m}=y.useContext(Gt),{pathname:g}=yt(),b=Fa(),_=$r(i,Gs(m),g,o==="path"),p=JSON.stringify(_);return y.useEffect(()=>{b(JSON.parse(p),{replace:u,state:s,relative:o})},[b,p,o,u,s]),null}function hv(i){return ev(i.context)}function P(i){qe(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function pv({basename:i="/",children:u=null,location:s,navigationType:o="POP",navigator:f,static:m=!1,unstable_useTransitions:g}){qe(!ul(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let b=i.replace(/^\/*/,"/"),_=y.useMemo(()=>({basename:b,navigator:f,static:m,unstable_useTransitions:g,future:{}}),[b,f,m,g]);typeof s=="string"&&(s=il(s));let{pathname:p="/",search:w="",hash:k="",state:N=null,key:Y="default",unstable_mask:L}=s,H=y.useMemo(()=>{let B=Sa(p,b);return B==null?null:{location:{pathname:B,search:w,hash:k,state:N,key:Y,unstable_mask:L},navigationType:o}},[b,p,w,k,N,Y,o,L]);return Yt(H!=null,`<Router basename="${b}"> is not able to match the URL "${p}${w}${k}" because it does not start with the basename, so the <Router> won't render anything.`),H==null?null:y.createElement(Rt.Provider,{value:_},y.createElement(si.Provider,{children:u,value:H}))}function gv({children:i,location:u}){return tv(Cs(i),u)}function Cs(i,u=[]){let s=[];return y.Children.forEach(i,(o,f)=>{if(!y.isValidElement(o))return;let m=[...u,f];if(o.type===y.Fragment){s.push.apply(s,Cs(o.props.children,m));return}qe(o.type===P,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),qe(!o.props.index||!o.props.children,"An index route cannot have child routes.");let g={id:o.props.id||m.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(g.children=Cs(o.props.children,m)),s.push(g)}),s}var Hr="get",Br="application/x-www-form-urlencoded";function Fr(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function yv(i){return Fr(i)&&i.tagName.toLowerCase()==="button"}function _v(i){return Fr(i)&&i.tagName.toLowerCase()==="form"}function vv(i){return Fr(i)&&i.tagName.toLowerCase()==="input"}function bv(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function xv(i,u){return i.button===0&&(!u||u==="_self")&&!bv(i)}function Ds(i=""){return new URLSearchParams(typeof i=="string"||Array.isArray(i)||i instanceof URLSearchParams?i:Object.keys(i).reduce((u,s)=>{let o=i[s];return u.concat(Array.isArray(o)?o.map(f=>[s,f]):[[s,o]])},[]))}function Sv(i,u){let s=Ds(i);return u&&u.forEach((o,f)=>{s.has(f)||u.getAll(f).forEach(m=>{s.append(f,m)})}),s}var zr=null;function kv(){if(zr===null)try{new FormData(document.createElement("form"),0),zr=!1}catch{zr=!0}return zr}var Ev=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function js(i){return i!=null&&!Ev.has(i)?(Yt(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Br}"`),null):i}function wv(i,u){let s,o,f,m,g;if(_v(i)){let b=i.getAttribute("action");o=b?Sa(b,u):null,s=i.getAttribute("method")||Hr,f=js(i.getAttribute("enctype"))||Br,m=new FormData(i)}else if(yv(i)||vv(i)&&(i.type==="submit"||i.type==="image")){let b=i.form;if(b==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let _=i.getAttribute("formaction")||b.getAttribute("action");if(o=_?Sa(_,u):null,s=i.getAttribute("formmethod")||b.getAttribute("method")||Hr,f=js(i.getAttribute("formenctype"))||js(b.getAttribute("enctype"))||Br,m=new FormData(b,i),!kv()){let{name:p,type:w,value:k}=i;if(w==="image"){let N=p?`${p}.`:"";m.append(`${N}x`,"0"),m.append(`${N}y`,"0")}else p&&m.append(p,k)}}else{if(Fr(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Hr,o=null,f=Br,g=i}return m&&f==="text/plain"&&(g=m,m=void 0),{action:o,method:s.toLowerCase(),encType:f,formData:m,body:g}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Zs(i,u){if(i===!1||i===null||typeof i>"u")throw new Error(u)}function Tv(i,u,s,o){let f=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return s?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${o}`:f.pathname=`${f.pathname}.${o}`:f.pathname==="/"?f.pathname=`_root.${o}`:u&&Sa(f.pathname,u)==="/"?f.pathname=`${u.replace(/\/$/,"")}/_root.${o}`:f.pathname=`${f.pathname.replace(/\/$/,"")}.${o}`,f}async function jv(i,u){if(i.id in u)return u[i.id];try{let s=await import(i.module);return u[i.id]=s,s}catch(s){return console.error(`Error loading route module \`${i.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Rv(i){return i==null?!1:i.href==null?i.rel==="preload"&&typeof i.imageSrcSet=="string"&&typeof i.imageSizes=="string":typeof i.rel=="string"&&typeof i.href=="string"}async function Av(i,u,s){let o=await Promise.all(i.map(async f=>{let m=u.routes[f.route.id];if(m){let g=await jv(m,s);return g.links?g.links():[]}return[]}));return Dv(o.flat(1).filter(Rv).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function _h(i,u,s,o,f,m){let g=(_,p)=>s[p]?_.route.id!==s[p].route.id:!0,b=(_,p)=>{var w;return s[p].pathname!==_.pathname||((w=s[p].route.path)==null?void 0:w.endsWith("*"))&&s[p].params["*"]!==_.params["*"]};return m==="assets"?u.filter((_,p)=>g(_,p)||b(_,p)):m==="data"?u.filter((_,p)=>{var k;let w=o.routes[_.route.id];if(!w||!w.hasLoader)return!1;if(g(_,p)||b(_,p))return!0;if(_.route.shouldRevalidate){let N=_.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:((k=s[0])==null?void 0:k.params)||{},nextUrl:new URL(i,window.origin),nextParams:_.params,defaultShouldRevalidate:!0});if(typeof N=="boolean")return N}return!0}):[]}function zv(i,u,{includeHydrateFallback:s}={}){return Ov(i.map(o=>{let f=u.routes[o.route.id];if(!f)return[];let m=[f.module];return f.clientActionModule&&(m=m.concat(f.clientActionModule)),f.clientLoaderModule&&(m=m.concat(f.clientLoaderModule)),s&&f.hydrateFallbackModule&&(m=m.concat(f.hydrateFallbackModule)),f.imports&&(m=m.concat(f.imports)),m}).flat(1))}function Ov(i){return[...new Set(i)]}function Cv(i){let u={},s=Object.keys(i).sort();for(let o of s)u[o]=i[o];return u}function Dv(i,u){let s=new Set;return new Set(u),i.reduce((o,f)=>{let m=JSON.stringify(Cv(f));return s.has(m)||(s.add(m),o.push({key:m,link:f})),o},[])}function Qh(){let i=y.useContext(rl);return Zs(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function Nv(){let i=y.useContext(Wr);return Zs(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var Ks=y.createContext(void 0);Ks.displayName="FrameworkContext";function Zh(){let i=y.useContext(Ks);return Zs(i,"You must render this element inside a <HydratedRouter> element"),i}function Mv(i,u){let s=y.useContext(Ks),[o,f]=y.useState(!1),[m,g]=y.useState(!1),{onFocus:b,onBlur:_,onMouseEnter:p,onMouseLeave:w,onTouchStart:k}=u,N=y.useRef(null);y.useEffect(()=>{if(i==="render"&&g(!0),i==="viewport"){let H=U=>{U.forEach(K=>{g(K.isIntersecting)})},B=new IntersectionObserver(H,{threshold:.5});return N.current&&B.observe(N.current),()=>{B.disconnect()}}},[i]),y.useEffect(()=>{if(o){let H=setTimeout(()=>{g(!0)},100);return()=>{clearTimeout(H)}}},[o]);let Y=()=>{f(!0)},L=()=>{f(!1),g(!1)};return s?i!=="intent"?[m,N,{}]:[m,N,{onFocus:ni(b,Y),onBlur:ni(_,L),onMouseEnter:ni(p,Y),onMouseLeave:ni(w,L),onTouchStart:ni(k,Y)}]:[!1,N,{}]}function ni(i,u){return s=>{i&&i(s),s.defaultPrevented||u(s)}}function Uv({page:i,...u}){let{router:s}=Qh(),o=y.useMemo(()=>Ch(s.routes,i,s.basename),[s.routes,i,s.basename]);return o?y.createElement(Lv,{page:i,matches:o,...u}):null}function qv(i){let{manifest:u,routeModules:s}=Zh(),[o,f]=y.useState([]);return y.useEffect(()=>{let m=!1;return Av(i,u,s).then(g=>{m||f(g)}),()=>{m=!0}},[i,u,s]),o}function Lv({page:i,matches:u,...s}){let o=yt(),{future:f,manifest:m,routeModules:g}=Zh(),{basename:b}=Qh(),{loaderData:_,matches:p}=Nv(),w=y.useMemo(()=>_h(i,u,p,m,o,"data"),[i,u,p,m,o]),k=y.useMemo(()=>_h(i,u,p,m,o,"assets"),[i,u,p,m,o]),N=y.useMemo(()=>{if(i===o.pathname+o.search+o.hash)return[];let H=new Set,B=!1;if(u.forEach(K=>{var ue;let X=m.routes[K.route.id];!X||!X.hasLoader||(!w.some(ce=>ce.route.id===K.route.id)&&K.route.id in _&&((ue=g[K.route.id])!=null&&ue.shouldRevalidate)||X.hasClientLoader?B=!0:H.add(K.route.id))}),H.size===0)return[];let U=Tv(i,b,f.unstable_trailingSlashAwareDataRequests,"data");return B&&H.size>0&&U.searchParams.set("_routes",u.filter(K=>H.has(K.route.id)).map(K=>K.route.id).join(",")),[U.pathname+U.search]},[b,f.unstable_trailingSlashAwareDataRequests,_,o,m,w,u,i,g]),Y=y.useMemo(()=>zv(k,m),[k,m]),L=qv(k);return y.createElement(y.Fragment,null,N.map(H=>y.createElement("link",{key:H,rel:"prefetch",as:"fetch",href:H,...s})),Y.map(H=>y.createElement("link",{key:H,rel:"modulepreload",href:H,...s})),L.map(({key:H,link:B})=>y.createElement("link",{key:H,nonce:s.nonce,...B,crossOrigin:B.crossOrigin??s.crossOrigin})))}function Hv(...i){return u=>{i.forEach(s=>{typeof s=="function"?s(u):s!=null&&(s.current=u)})}}var Bv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Bv&&(window.__reactRouterVersion="7.13.1")}catch{}function Yv({basename:i,children:u,unstable_useTransitions:s,window:o}){let f=y.useRef();f.current==null&&(f.current=y_({window:o,v5Compat:!0}));let m=f.current,[g,b]=y.useState({action:m.action,location:m.location}),_=y.useCallback(p=>{s===!1?b(p):y.startTransition(()=>b(p))},[s]);return y.useLayoutEffect(()=>m.listen(_),[m,_]),y.createElement(pv,{basename:i,children:u,location:g.location,navigationType:g.action,navigator:m,unstable_useTransitions:s})}var Kh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jh=y.forwardRef(function({onClick:u,discover:s="render",prefetch:o="none",relative:f,reloadDocument:m,replace:g,unstable_mask:b,state:_,target:p,to:w,preventScrollReset:k,viewTransition:N,unstable_defaultShouldRevalidate:Y,...L},H){let{basename:B,navigator:U,unstable_useTransitions:K}=y.useContext(Rt),X=typeof w=="string"&&Kh.test(w),ue=Uh(w,B);w=ue.to;let ce=F_(w,{relative:f}),ge=yt(),F=null;if(b){let Me=$r(b,[],ge.unstable_mask?ge.unstable_mask.pathname:"/",!0);B!=="/"&&(Me.pathname=Me.pathname==="/"?B:ta([B,Me.pathname])),F=U.createHref(Me)}let[W,se,Pe]=Mv(o,L),Je=Xv(w,{replace:g,unstable_mask:b,state:_,target:p,preventScrollReset:k,relative:f,viewTransition:N,unstable_defaultShouldRevalidate:Y,unstable_useTransitions:K});function Ce(Me){u&&u(Me),Me.defaultPrevented||Je(Me)}let At=!(ue.isExternal||m),ut=y.createElement("a",{...L,...Pe,href:(At?F:void 0)||ue.absoluteURL||ce,onClick:At?Ce:u,ref:Hv(H,se),target:p,"data-discover":!X&&s==="render"?"true":void 0});return W&&!X?y.createElement(y.Fragment,null,ut,y.createElement(Uv,{page:ce})):ut});Jh.displayName="Link";var Js=y.forwardRef(function({"aria-current":u="page",caseSensitive:s=!1,className:o="",end:f=!1,style:m,to:g,viewTransition:b,children:_,...p},w){let k=ci(g,{relative:p.relative}),N=yt(),Y=y.useContext(Wr),{navigator:L,basename:H}=y.useContext(Rt),B=Y!=null&&$v(k)&&b===!0,U=L.encodeLocation?L.encodeLocation(k).pathname:k.pathname,K=N.pathname,X=Y&&Y.navigation&&Y.navigation.location?Y.navigation.location.pathname:null;s||(K=K.toLowerCase(),X=X?X.toLowerCase():null,U=U.toLowerCase()),X&&H&&(X=Sa(X,H)||X);const ue=U!=="/"&&U.endsWith("/")?U.length-1:U.length;let ce=K===U||!f&&K.startsWith(U)&&K.charAt(ue)==="/",ge=X!=null&&(X===U||!f&&X.startsWith(U)&&X.charAt(U.length)==="/"),F={isActive:ce,isPending:ge,isTransitioning:B},W=ce?u:void 0,se;typeof o=="function"?se=o(F):se=[o,ce?"active":null,ge?"pending":null,B?"transitioning":null].filter(Boolean).join(" ");let Pe=typeof m=="function"?m(F):m;return y.createElement(Jh,{...p,"aria-current":W,className:se,ref:w,style:Pe,to:g,viewTransition:b},typeof _=="function"?_(F):_)});Js.displayName="NavLink";var Gv=y.forwardRef(({discover:i="render",fetcherKey:u,navigate:s,reloadDocument:o,replace:f,state:m,method:g=Hr,action:b,onSubmit:_,relative:p,preventScrollReset:w,viewTransition:k,unstable_defaultShouldRevalidate:N,...Y},L)=>{let{unstable_useTransitions:H}=y.useContext(Rt),B=Kv(),U=Jv(b,{relative:p}),K=g.toLowerCase()==="get"?"get":"post",X=typeof b=="string"&&Kh.test(b),ue=ce=>{if(_&&_(ce),ce.defaultPrevented)return;ce.preventDefault();let ge=ce.nativeEvent.submitter,F=(ge==null?void 0:ge.getAttribute("formmethod"))||g,W=()=>B(ge||ce.currentTarget,{fetcherKey:u,method:F,navigate:s,replace:f,state:m,relative:p,preventScrollReset:w,viewTransition:k,unstable_defaultShouldRevalidate:N});H&&s!==!1?y.startTransition(()=>W()):W()};return y.createElement("form",{ref:L,method:K,action:U,onSubmit:o?_:ue,...Y,"data-discover":!X&&i==="render"?"true":void 0})});Gv.displayName="Form";function Vv(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $h(i){let u=y.useContext(rl);return qe(u,Vv(i)),u}function Xv(i,{target:u,replace:s,unstable_mask:o,state:f,preventScrollReset:m,relative:g,viewTransition:b,unstable_defaultShouldRevalidate:_,unstable_useTransitions:p}={}){let w=Fa(),k=yt(),N=ci(i,{relative:g});return y.useCallback(Y=>{if(xv(Y,u)){Y.preventDefault();let L=s!==void 0?s:oi(k)===oi(N),H=()=>w(i,{replace:L,unstable_mask:o,state:f,preventScrollReset:m,relative:g,viewTransition:b,unstable_defaultShouldRevalidate:_});p?y.startTransition(()=>H()):H()}},[k,w,N,s,o,f,u,i,m,g,b,_,p])}function V1(i){Yt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let u=y.useRef(Ds(i)),s=y.useRef(!1),o=yt(),f=y.useMemo(()=>Sv(o.search,s.current?null:u.current),[o.search]),m=Fa(),g=y.useCallback((b,_)=>{const p=Ds(typeof b=="function"?b(new URLSearchParams(f)):b);s.current=!0,m("?"+p,_)},[m,f]);return[f,g]}var Qv=0,Zv=()=>`__${String(++Qv)}__`;function Kv(){let{router:i}=$h("useSubmit"),{basename:u}=y.useContext(Rt),s=cv(),o=i.fetch,f=i.navigate;return y.useCallback(async(m,g={})=>{let{action:b,method:_,encType:p,formData:w,body:k}=wv(m,u);if(g.navigate===!1){let N=g.fetcherKey||Zv();await o(N,s,g.action||b,{unstable_defaultShouldRevalidate:g.unstable_defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:w,body:k,formMethod:g.method||_,formEncType:g.encType||p,flushSync:g.flushSync})}else await f(g.action||b,{unstable_defaultShouldRevalidate:g.unstable_defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:w,body:k,formMethod:g.method||_,formEncType:g.encType||p,replace:g.replace,state:g.state,fromRouteId:s,flushSync:g.flushSync,viewTransition:g.viewTransition})},[o,f,u,s])}function Jv(i,{relative:u}={}){let{basename:s}=y.useContext(Rt),o=y.useContext(Gt);qe(o,"useFormAction must be used inside a RouteContext");let[f]=o.matches.slice(-1),m={...ci(i||".",{relative:u})},g=yt();if(i==null){m.search=g.search;let b=new URLSearchParams(m.search),_=b.getAll("index");if(_.some(w=>w==="")){b.delete("index"),_.filter(k=>k).forEach(k=>b.append("index",k));let w=b.toString();m.search=w?`?${w}`:""}}return(!i||i===".")&&f.route.index&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(m.pathname=m.pathname==="/"?s:ta([s,m.pathname])),oi(m)}function $v(i,{relative:u}={}){let s=y.useContext(Lh);qe(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=$h("useViewTransitionState"),f=ci(i,{relative:u});if(!s.isTransitioning)return!1;let m=Sa(s.currentLocation.pathname,o)||s.currentLocation.pathname,g=Sa(s.nextLocation.pathname,o)||s.nextLocation.pathname;return Zr(f.pathname,g)!=null||Zr(f.pathname,m)!=null}function Wh(i,u){return i?i.length<=u?i:i.slice(0,u)+"...":""}/**
62
62
  * @license lucide-react v0.469.0 - ISC
63
63
  *
64
64
  * This source code is licensed under the ISC license.
@@ -243,10 +243,10 @@ Please change the parent <Route path="${U}"> to <Route path="${U==="/"?"*":`${U}
243
243
  *
244
244
  * This source code is licensed under the ISC license.
245
245
  * See the LICENSE file in the root directory of this source tree.
246
- */const rp=_e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),vh=i=>{let u;const s=new Set,o=(p,w)=>{const k=typeof p=="function"?p(u):p;if(!Object.is(k,u)){const N=u;u=w??(typeof k!="object"||k===null)?k:Object.assign({},u,k),s.forEach(Y=>Y(u,N))}},f=()=>u,b={setState:o,getState:f,getInitialState:()=>_,subscribe:p=>(s.add(p),()=>s.delete(p))},_=u=i(o,f,b);return b},Sb=(i=>i?vh(i):vh),kb=i=>i;function Eb(i,u=kb){const s=Ar.useSyncExternalStore(i.subscribe,Ar.useCallback(()=>u(i.getState()),[i,u]),Ar.useCallback(()=>u(i.getInitialState()),[i,u]));return Ar.useDebugValue(s),s}const bh=i=>{const u=Sb(i),s=o=>Eb(u,o);return Object.assign(s,u),s},Ir=(i=>i?bh(i):bh),Or="overlord-access-token",Cr="overlord-refresh-token",We={getAccessToken(){return localStorage.getItem(Or)},setAccessToken(i){localStorage.setItem(Or,i)},getRefreshToken(){return localStorage.getItem(Cr)},setRefreshToken(i){localStorage.setItem(Cr,i)},setTokens(i,u){localStorage.setItem(Or,i),localStorage.setItem(Cr,u)},clearTokens(){localStorage.removeItem(Or),localStorage.removeItem(Cr)},parseToken(i){try{const u=i.split(".")[1];return JSON.parse(atob(u))}catch{return null}},hasScope(i,u){const s=We.parseToken(i);return s?s.scope===u:!1},isExpired(i){const u=We.parseToken(i);return!u||typeof u.exp!="number"?!0:Date.now()/1e3>u.exp-30}};function Rs(i){const u=We.parseToken(i);if(!u)return null;const s=u.name??"";return{id:u.sub,username:s,display_name:s,role:u.role}}const xa=Ir((i,u)=>({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1,initializing:!0,initialize:()=>{const s=We.getAccessToken();s&&!We.isExpired(s)?i({accessToken:s,user:Rs(s),requireTotpSetup:We.hasScope(s,"totp_setup"),initializing:!1}):We.getRefreshToken()?u().refresh().catch(()=>{We.clearTokens()}).finally(()=>{i({initializing:!1})}):i({initializing:!1})},login:async s=>{var m;const o=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!o.ok){const g=await o.json().catch(()=>({message:"Login failed"})),b=((m=g.error)==null?void 0:m.message)??g.message??"Login failed";throw new Error(b)}const f=await o.json();if(f.totpSetup){We.setAccessToken(f.accessToken),i({accessToken:f.accessToken,user:null,requireTotpSetup:!0});return}We.setTokens(f.accessToken,f.refreshToken),i({accessToken:f.accessToken,user:Rs(f.accessToken),requireTotpSetup:!1,sessionExpired:!1})},logout:()=>{const s=We.getRefreshToken();s&&fetch("/api/auth/logout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:s})}).catch(()=>{}),We.clearTokens(),i({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1})},refresh:(()=>{let s=null;return async()=>s||(s=(async()=>{const o=We.getRefreshToken();if(!o)throw We.clearTokens(),i({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!0}),new Error("No refresh token");const f=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:o})});if(!f.ok)throw We.clearTokens(),i({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!0}),new Error("Refresh failed");const m=await f.json();We.setTokens(m.accessToken,m.refreshToken),i({accessToken:m.accessToken,user:Rs(m.accessToken)})})().finally(()=>{s=null}),s)})(),setSessionExpired:s=>{i({sessionExpired:s})}})),Q1={QUEUED:"QUEUED",ASSIGNED:"ASSIGNED",RUNNING:"RUNNING",SUSPENDED:"SUSPENDED",COMPLETED:"COMPLETED",FAILED:"FAILED",CANCELLED:"CANCELLED"},Z1={ONLINE:"online",OFFLINE:"offline",DRAINING:"draining",DECOMMISSIONED:"decommissioned"},up={DEVELOPER:"developer",LEAD:"lead",ADMIN:"admin"},K1={MAINTAINER:"maintainer",MEMBER:"member"},J1={CLAUDE:"claude",CURSOR:"cursor",CODEX:"codex"},$1={ACTIVE:"active",USED:"used",REVOKED:"revoked",EXPIRED:"expired"},W1={GITLAB:"gitlab",GITHUB:"github",GITEA:"gitea"},F1={ACTIVE:"active",DISABLED:"disabled"},I1={ACTIVE:"active"},P1={IDLE:"IDLE",STARTING:"STARTING",CONNECTED:"CONNECTED",EXPIRED:"EXPIRED",CLOSING:"CLOSING",CLOSED:"CLOSED"};function wb(){return xa(i=>{var u;return((u=i.user)==null?void 0:u.role)===up.ADMIN})??!1}const op="overlord-sidebar-collapsed";function Tb(){try{return localStorage.getItem(op)==="true"}catch{return!1}}const jb=Ir((i,u)=>({sidebarCollapsed:Tb(),toggleSidebar:()=>{const s=!u().sidebarCollapsed;try{localStorage.setItem(op,String(s))}catch{}i({sidebarCollapsed:s})}}));class Rb{constructor(){Ve(this,"ws",null);Ve(this,"reconnectAttempts",0);Ve(this,"maxReconnectAttempts",15);Ve(this,"reconnectTimer",null);Ve(this,"disposed",!1);Ve(this,"authenticated",!1);Ve(this,"eventHandlers",new Set);Ve(this,"statusHandlers",new Set)}onEvent(u){return this.eventHandlers.add(u),()=>this.eventHandlers.delete(u)}onStatus(u){return this.statusHandlers.add(u),()=>this.statusHandlers.delete(u)}get isConnected(){var u;return this.authenticated&&((u=this.ws)==null?void 0:u.readyState)===WebSocket.OPEN}connect(){var f,m;if(this.disposed||((f=this.ws)==null?void 0:f.readyState)===WebSocket.OPEN||((m=this.ws)==null?void 0:m.readyState)===WebSocket.CONNECTING)return;const u=We.getAccessToken();if(!u||We.isExpired(u))return;const o=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/events`;this.notifyStatus("connecting"),this.authenticated=!1,this.ws=new WebSocket(o),this.ws.onopen=()=>{var b,_;const g=We.getAccessToken();g?(b=this.ws)==null||b.send(JSON.stringify({type:"auth",token:g})):(_=this.ws)==null||_.close()},this.ws.onmessage=g=>{var b;if(typeof g.data=="string")try{const _=JSON.parse(g.data);if(_.type==="auth_ok"){this.authenticated=!0,this.reconnectAttempts=0,this.notifyStatus("connected");return}if(_.type==="auth_error"){(b=this.ws)==null||b.close();return}if(_.type==="event")for(const p of this.eventHandlers)try{p(_)}catch{}}catch{}},this.ws.onclose=()=>{this.authenticated=!1,this.notifyStatus("disconnected"),this.scheduleReconnect()},this.ws.onerror=()=>{var g;(g=this.ws)==null||g.close()}}disconnect(){var u;this.clearReconnectTimer(),this.authenticated=!1,(u=this.ws)==null||u.close(),this.ws=null}dispose(){this.disposed=!0,this.disconnect(),this.eventHandlers.clear(),this.statusHandlers.clear()}reconnect(){this.disconnect(),this.reconnectAttempts=0,this.connect()}scheduleReconnect(){if(this.disposed||this.reconnectAttempts>=this.maxReconnectAttempts)return;const u=Math.min(1e3*2**this.reconnectAttempts,3e4);this.reconnectAttempts++,this.reconnectTimer=setTimeout(()=>{this.disposed||this.connect()},u)}clearReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}notifyStatus(u){for(const s of this.statusHandlers)try{s(u)}catch{}}}const Dr=new Rb,sp=Ir(i=>({status:"disconnected",lastEvent:null,eventSeq:0,taskSeq:0,workerSeq:0,init:()=>{const u=Dr.onEvent(o=>{const f=o.event==="task_status_changed"||o.event==="task_created"||o.event==="review_round_complete",m=o.event==="worker_status_changed";i(g=>({lastEvent:o,eventSeq:g.eventSeq+1,...f&&{taskSeq:g.taskSeq+1},...m&&{workerSeq:g.workerSeq+1}}))}),s=Dr.onStatus(o=>{const f=sp.getState().status;i({status:o}),f==="disconnected"&&o==="connected"&&i(m=>({eventSeq:m.eventSeq+1,taskSeq:m.taskSeq+1,workerSeq:m.workerSeq+1}))});return Dr.connect(),()=>{u(),s(),Dr.disconnect()}}})),cp="overlord-theme";function Ab(){try{const i=localStorage.getItem(cp);if(i==="light"||i==="dark"||i==="system")return i}catch{}return"dark"}function xh(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const fp=Ir(i=>{const u=Ab(),s=u==="system"?xh():u;return{theme:u,resolved:s,setTheme:o=>{localStorage.setItem(cp,o);const f=o==="system"?xh():o;i({theme:o,resolved:f})},setResolved:o=>{i({resolved:o})}}}),zb={common:{cancel:"cancel",confirm:"confirm",save:"save",delete:"delete",edit:"edit",create:"create",copy:"copy",copied:"copied",close:"close",back:"back",go_back:"go back",go_home:"go home",dismiss:"dismiss",retry:"retry",loading:"// thinking...",processing:"processing...",creating:"creating...",saving:"saving...",updating:"updating...",verifying:"verifying...",signing_in:"signing in...",just_now:"just now",never:"never",previous:"previous",next:"next",enabled:"enabled",disabled:"disabled",runtime_error:"// runtime error",an_unexpected_error_occurred:"an unexpected error occurred",reload:"reload",not_found:"404",page_not_found:"// page not found",the_page_does_not_exist:"the page you are looking for does not exist or has been moved.",not_found_terminal_error:"error: requested not found - page does not exist",not_set:"not set",view_all:"view all",discard:"discard",save_changes:"save changes",remove:"remove",actions:"actions",name:"name",status:"status",role:"role",created_at:"created at",m_ago:"{n}m ago",h_ago:"{n}h ago",d_ago:"{n}d ago",loop_section:"// loop",tasks_section:"// tasks",fleet_section:"// fleet",docs_section:"// docs",admin_section:"// admin",overlord:"overlord",logout:"logout",logout_title:"// logout",logout_message:"are you sure you want to log out?",log_out:"log out",profile:"profile",search_placeholder:"search",search_input_placeholder:"search tasks, workers, projects...",no_search_results:'// no results for "{query}"',navigate_hint:"navigate",select_hint:"select",close_hint:"close",notifications:"notifications",mark_all_read:"mark all read",no_notifications:"// no notifications",mark_as_read:"mark as read",switch_to_light:"switch to light mode",switch_to_dark:"switch to dark mode",light_mode:"light mode",dark_mode:"dark mode",dismiss_notification:"dismiss",breadcrumb_terminal:"terminal",breadcrumb_terminal_sub:"active sessions",breadcrumb_dashboard:"dashboard",breadcrumb_dashboard_sub:"active overview",breadcrumb_tasks:"tasks",breadcrumb_tasks_sub:"queue management",breadcrumb_workers:"workers",breadcrumb_workers_sub:"fleet status",breadcrumb_projects:"projects",breadcrumb_projects_sub:"repository index",breadcrumb_admin:"admin",breadcrumb_admin_sub:"system control",breadcrumb_profile:"profile",breadcrumb_profile_sub:"user settings",breadcrumb_tokens:"tokens",breadcrumb_tokens_sub:"personal api tokens",breadcrumb_docs:"docs",breadcrumb_docs_sub:"documentation",breadcrumb_docs_cli:"docs",breadcrumb_docs_cli_sub:"cli",breadcrumb_docs_api:"docs",breadcrumb_docs_api_sub:"api",breadcrumb_docs_skill:"docs",breadcrumb_docs_skill_sub:"skill",breadcrumb_docs_bot_sub:"bot",breadcrumb_docs_all_sub:"all"},auth:{sign_in:"sign in",username:"username",enter_username:"enter username",password:"password",enter_password:"enter password",ai_powered_development_system:"// ai-powered development system",username_and_password_required:"username and password are required.",login_failed:"login failed",invalid_totp_code:"invalid totp code",two_factor_verification:"// 2fa verification",enter_totp_code:"enter your totp code",please_enter_valid_6_digit_code:"please enter a valid 6-digit code.",session_expired:"session expired",session_expired_message:"// your session has expired. please log in again.",go_to_login:"go to login",totp_setup_subtitle:"// scan the qr code with your authenticator app",verification_code:"verification code",verify_and_enable:"verify and enable",totp_setup_complete_login_again:"2fa setup complete! please log in again.",totp_setup_failed:"verification failed. please try again.",totp_setup_footer:"// you must complete this setup before accessing the application",totp_manual_entry:"// or enter this key manually",verify:"verify",initializing:"// initializing...",failed_to_init_totp:"failed to initialize totp setup"},dashboard:{title:"dashboard",tasks_active_queued:"active / queued",online_workers:"online workers",completed_all_today:"completed all today",completed_by_you_today:"completed by you today",task_count:"> task count",success_rate:"success rate",last_7_days:"last 7 days",recent_tasks:"> recent tasks",no_tasks_yet:"// no tasks yet",workers:"> workers",no_workers_registered:"// no workers registered",projects:"> projects",recent_activity:"> recent activity",no_recent_activity:"// no recent activity",daily_breakdown_not_available:"// daily breakdown not available",task_total:"task",tasks_total:"tasks",slots:"slots",online:"online",idle:"idle",offline:"offline"},tasks:{title:"tasks",create_task:"create task",new_task:"new task",task_description:"task description",describe_task_placeholder:"describe the development task in detail...",project:"project",select_project:"select project...",task_type:"type",branch_slug:"branch name (optional)",branch_slug_placeholder:"auto-generated from description",target_branch:"target branch (optional)",target_branch_placeholder:"defaults to project default branch",target_worker:"target worker (optional)",any_able:"any able",assign_developer:"assign developer (admin only)",select_developer:"select developer...",search_tasks:"search tasks...",filter_project:"all projects",filter_developer:"all developers",id:"id",description_col:"description",status_col:"status",project_col:"project",assignee:"assignee",worker:"worker",time:"time",stage:"stage",no_tasks_found:"no tasks found",try_adjusting_search:"try adjusting your search query",create_first_task:"create your first task to get started",tab_all:"all",tab_running:"running",tab_queued:"queued",tab_completed:"completed",tab_failed:"failed",tab_cancelled:"cancelled",status_queued:"queued",status_assigned:"assigned",status_running:"running",status_suspended:"suspended",status_completed:"completed",status_failed:"failed",status_cancelled:"cancelled",similar_task_exists:"a similar task already exists.",view_existing:"view existing",cancel_task:"cancel",retry_task:"retry",cursor_tunnel:"IDE tunnel",skip_stage:"skip stage",take_over:"take over",connected:"connected",disconnected:"disconnected",connecting:"connecting",terminal:"terminal",pipeline_tab:"pipeline",logs:"logs",task_not_found:"// task not found",back_to_tasks:"back to tasks",cancel_task_title:"cancel task",fork_task:"fork task",fork_task_desc:"create a new task based on this one. new text appends to the original detail by default.",fork_description_placeholder:"enter extra detail to append (leave empty to reuse original)",fork_agent_type_placeholder:"same as source ({agent})",fork_replace_description:"replace original detail instead of appending",fork_append_hint:"without replace enabled, your input is appended after the original detail",fork_success:"task forked successfully",fork_error:"failed to fork task",activity_log:"> activity log",no_activity:"// no activity yet",confirm_stage_message:'confirm execution of stage "{name}"? this will proceed with the pipeline.',plan_review_message:'review the implementation plan for stage "{name}". approve to proceed or provide feedback.',plan_decompose_message:"spec document has been generated and pushed. would you like to decompose it into development tasks?",code_review_message:'review the changes for stage "{name}". approve to proceed or provide feedback.',feedback_placeholder:"provide feedback (optional)...",approve_plan:"approve plan",approve_plan_decompose:"decompose into tasks",reject_plan_decompose:"save spec only",approve_review:"approve changes",request_changes:"request changes",loading_task:"// thinking...",task_suspended_banner:"// task suspended — waiting for user confirmation",pending_confirmation:"> pending confirmation",pipeline_requires_confirmation:"the pipeline requires confirmation before proceeding.",confirm_and_proceed:"confirm and proceed",confirm_failed:"failed to confirm stage",reject:"reject",pty_terminal:"// pty terminal",view_terminal:"switch to terminal tab",restore_auto:"restore auto",requesting_takeover:"requesting...",pipeline_stages:"// pipeline stages",task_info:"> task info",stage_timeline:"> stage timeline",workspace_section:"> workspace",mr_link:"MR link",queue_position:"queue position: #{position} of {total}",queue_ahead:"{count} task(s) ahead",queue_next:"next to be processed",queue_position_banner:"// queued — position #{position} of {total}",no_worker_assigned:"// no worker assigned",no_output:"// no output",pty_output:"> PTY output",stage_progress:"> stage progress",task_logs:"> task logs",full_terminal:"open full terminal",return_to_companion:"return to companion",complex_terminal_hint:"complex terminal detected. use the full terminal for the best view.",search_logs:"search logs...",no_log_entries:"// no log entries",prev:"prev",cursor_tunnel_section:"> IDE tunnel",auto_pipeline:"auto pipeline",manual_takeover:"manual takeover",takeover_denied:"takeover denied",form_project_label:"project",form_description_label:"description",form_description_placeholder:"describe the task for the ai agent...",form_worker_preference:"worker preference",form_worker_placeholder:"optional: worker id or name (--on)",form_worker_hint:"leave empty for automatic worker selection.",form_agent_type:"agent",form_agent_type_placeholder:"default",form_select_project:"select a project",form_create_task:"create task",project_and_description_required:"project and description are required.",failed_to_create_task:"failed to create task.",tunnel_idle:"idle",tunnel_starting:"starting...",tunnel_connected:"connected",tunnel_expired:"expired",tunnel_closing:"closing...",tunnel_start:"start",tunnel_open_in_cursor:"open in IDE",tunnel_header:"> IDE tunnel",tunnel_copied:"// copied to clipboard",tunnel_waiting:"// waiting for connection url...",tunnel_start_button:"> start tunnel",tunnel_starting_button:"// starting...",tunnel_stopping:"// stopping...",tunnel_cancel:"> cancel",tunnel_open_cursor:"> open in IDE",tunnel_open_vscode:"> open in vscode",tunnel_stop:"> stop tunnel",tunnel_restart:"> restart tunnel",tunnel_copy_url:"copy url",tunnel_expires_hm:"expires in {h}h {m}m",tunnel_expires_m:"expires in {m}m",tunnel_start_failed:"failed to start tunnel",tunnel_install_code_hint:'install the VS Code CLI ("code" command) to enable tunnels',dedup_title:"> similar task exists",dedup_description:"// a similar task was found that may already address your request",dedup_create_anyway:"create anyway",stage_submitting:"submitting...",cancel_task_message:"are you sure you want to cancel task #{id}? this will terminate the running agent and cannot be undone.",cancel_task_confirm_label:"cancel task",retry_title:"retry task",retry_confirm_label:"retry",retry_message_with_mr:"task #{id} has an existing mr ({url}). retrying will create a new attempt on the same branch. continue?",retry_message_without_mr:"are you sure you want to retry task #{id}? this will create a new execution attempt.",reuse_workspace_label:"reuse existing workspace (skip worktree recreation, continue on current branch)",detail_tab:"detail",detail_basic_info:"> basic info",detail_creator:"creator",detail_project:"project",detail_worker:"worker",detail_time_cost:"time cost",detail_branch:"branch",detail_task_name:"> task name & description",detail_ai_name:"ai-generated name",detail_task_id:"task id",detail_source:"source platform",detail_description:"> description"},workers:{title:"workers",fleet:"fleet",setup_guide:"setup guide",all_statuses:"all",register_worker:"register worker",no_workers_found:"no workers found",no_workers_registered:"no workers have registered yet",try_changing_status_filter:"try changing the status filter",view_setup_guide:"view setup guide",online:"online",offline:"offline",draining:"draining",cpu:"cpu",mem:"mem",disk:"disk",tasks_slots:"tasks: {active}/{max} slots",back_to_workers:"back to workers",drain:"drain",undrain:"undrain",last_heartbeat:"last heartbeat: {time}",resource_usage:"> resource usage",connection_info:"> connection info",capabilities:"> capabilities",current_tasks:"> current tasks",host:"host",os:"os",cpu_model:"CPU model",cpu_cores:"CPU cores",memory:"memory",loading_worker:"// thinking...",worker_not_found:"// worker not found",draining_warning:"// this worker is draining — no new tasks will be assigned",draining_active_tasks:"active tasks will continue to run until completion",active_tasks:"> active tasks",no_active_tasks:"// no active tasks on this worker",worker_info:"> worker info",unknown:"unknown",n_a:"n/a",id:"id",description:"description",stage:"stage",no_capabilities_short:"// no capabilities",slots:"slots",status_label:"status",undrain_worker_title:"> undrain worker",drain_worker_title:"> drain worker",undrain_confirm:"are you sure you want to undrain {name}? the worker will start accepting new tasks again.",drain_confirm:"are you sure you want to drain {name}? running tasks will complete, but no new tasks will be assigned until the worker is undrained.",decommission:"decommission",decommission_title:"> decommission worker",decommission_confirm:'permanently decommission "{name}"? active tasks will be failed or re-queued, and the worker will be disconnected. this cannot be undone.',restore_capability:"restore capability",restore_capability_title:"> restore capability",restore_capability_confirm:"restore {capability} on {name}? this only clears the degradation flag. it does not fix the underlying issue.",awaiting_auto_recovery:"awaiting auto-recovery",manual_restore_required:"manual restore required",worker_id:"worker ID",setup_header_desc:"// follow these steps to add a new worker to your overlord cluster.",prerequisites:"// prerequisites",prereq_machine:"linux or macos machine with at least 2 cpu cores and 4gb ram",prereq_node:"node.js 18+ and pnpm installed",prereq_git:"git installed (2.25+)",prereq_network:"network access to the overlord server",prereq_token:"admin-generated worker registration token",step_generate_token:"generate worker token",step_generate_token_desc:"// create a one-time registration token from the admin panel. each token can register exactly one worker.",go_to_token_management:"go to token management",step_install_worker:"install worker package",step_install_worker_desc:"// install the overlord worker package globally via npm.",step_configure_env:"configure environment",step_configure_env_desc:"// create a .env file in ~/.overlord-worker/ or set environment variables.",env_host:"overlord server address (required)",env_worker_token:"one-time registration token (required for first run)",env_worker_name:"display name (defaults to hostname)",env_workspace_root:"task workspace directory (defaults to ~/.overlord-worker/workspaces)",env_max_slots:"max concurrent tasks (defaults to 2)",step_start_worker:"start worker",step_start_worker_desc:"// start the worker process. it will register with the server and begin accepting tasks.",setup_wizard_option:"// option a: interactive setup wizard (recommended)",manual_config_option:"// option b: manual configuration",start_note_setup_wizard:"// if you used the setup wizard, the worker may already be running.",step_verify_connection:"verify connection",step_verify_connection_desc:'// once the worker connects, it will appear in the workers list with a "healthy" status.',verify_how_to:"// how to verify:",verify_check_workers:"check the workers page for your new worker",verify_status:'status should show "healthy" within 30 seconds',verify_capabilities:"worker capabilities are auto-detected on first heartbeat",last_heartbeat_label:"last heartbeat",worker_version:"worker version",reg_title:"// worker registration",reg_subtitle:"> register a new worker node",reg_step_generate_token:"generate token",reg_step_install_worker:"install worker",reg_step_waiting_activation:"waiting activation",reg_step_activated:"activated",reg_click_to_generate:"// click to generate a one-time registration token",reg_token_generated:"// token generated successfully",reg_running_installation:"// running installation on target worker",reg_installed_wait:"i've installed → wait for activation",reg_listening_for_worker:"listening for worker connection...",reg_worker_connected:"// worker connected",reg_waiting_for_worker:"// waiting for worker to connect...",reg_worker_activated:"worker {name} activated!",reg_worker_registered:"// worker successfully registered",reg_done:"done",reg_completed:"// completed"},projects:{title:"projects",create_project:"create project",no_projects_yet:"no projects yet",create_first_project:"create your first project to get started",key:"key",name:"name",project_info:"> project info",repo_url:"repo URL",default_branch:"default branch",git_platform:"git platform",agent_type:"agent type",max_turns:"max turns",allowed_tools:"allowed tools",default_project:"default project",tasks_count:"tasks",last_activity:"last activity",members:"> members",developer:"developer",role:"role",added_at:"added at",add_member:"add member",remove_member:"remove member",remove_member_confirm:"remove {name} from this project?",failed_to_add_member:"failed to add member.",member_already_exists:"this developer is already a member of this project.",pipeline:"> pipeline",add_stage:"+ add stage",recent_tasks:"> recent tasks",edit_project:"edit project",delete_project:"delete project",delete_project_confirm:'delete project "{name}"? this cannot be undone.',project_name:"project name",project_name_placeholder:"my awesome project",project_key:"project key",project_key_placeholder:"my-project",project_key_hint:"// unique identifier (lowercase, alphanumeric, hyphens)",ssh_url:"SSH URL",ssh_url_placeholder:"git@github.com:org/repo.git",ssh_url_hint:"// optional — workers prefer ssh for git operations",repo_url_placeholder:"https://github.com/org/repo.git",main:"main",github:"github",gitlab:"gitlab",gitea:"gitea",tools_placeholder:"tool1, tool2, ...",add_project_desc:"// add a new project to overlord",failed_to_create_project:"failed to create project.",update_project_desc:"// update project configuration",save_changes:"save changes",basic_info:"> basic info",agent_config:"> agent config",security:"> security",git_token:"> git token",git_token_label:"current token",git_token_hint:"// personal access token for git operations (push, clone, etc.)",git_token_set:"set token",git_token_clear:"clear token",git_token_saved:"git token saved.",git_token_cleared:"git token cleared.",git_token_failed:"failed to update git token.",pipeline_section:"> pipeline",edit_pipeline:"> edit pipeline",pty_output_filter:"PTY output filter",workspace_root:"workspace root",member_role:"member",maintainer_role:"maintainer",select_developer:"select developer...",adding:"adding...",project_not_found:"// project not found",back_to_projects:"back to projects",no_members_yet:"// no members yet",no_tasks_for_project:"// no tasks for this project yet",no_pipeline_configured:"// no pipeline configured",confirm_label:"confirm",id:"id",description:"description",status:"status",created:"created",project_saved:"project saved",failed_to_save_project:"failed to save project",invalid_pipeline_json:"invalid pipeline json",setup_commands:"setup commands",post_command:"post command",environment:"> environment",add_member_title:"// add member",edit_project_title:"edit project"},pipeline:{title:"pipeline editor",subtitle:"-- {key}",save:"save",cancel:"cancel",json_toggle:"json",add_stage:"add stage",stage_properties:"> stage properties",stage_name:"stage name",timeout:"timeout",confirm_required:"confirm required",on_failure:"on failure",goto:"goto",max_loops:"max loops",stop:"stop",select_stage:"// select a stage to edit properties",saved:"pipeline saved",failed_to_save:"failed to save pipeline",loading_pipeline:"// thinking...",unnamed:"unnamed",editing:"// editing: {name}",name:"name",on_failure_section:"// on failure",goto_stage:"goto stage",up:"up",down:"down",failed_to_load_project:"failed to load project",delete_stage:"delete stage"},profile:{title:"profile",profile_info:"> profile info",username:"username",git_name:"git name",git_email:"git email",status:"status",created_at:"created at",change_password:"> change password",current_password:"current password",new_password:"new password",confirm_password:"confirm password",current_password_required:"current password is required.",new_password_required:"new password is required.",passwords_do_not_match:"new passwords do not match.",password_changed:"password changed successfully.",failed_to_change_password:"failed to change password.",update_password:"update password",two_factor_auth:"> two-factor authentication",two_fa_enabled:"2fa is enabled",two_fa_not_setup:"2fa is not set up",regenerate_2fa_warning:`// regenerating 2fa will invalidate your current authenticator app setup.
246
+ */const rp=_e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),vh=i=>{let u;const s=new Set,o=(p,w)=>{const k=typeof p=="function"?p(u):p;if(!Object.is(k,u)){const N=u;u=w??(typeof k!="object"||k===null)?k:Object.assign({},u,k),s.forEach(Y=>Y(u,N))}},f=()=>u,b={setState:o,getState:f,getInitialState:()=>_,subscribe:p=>(s.add(p),()=>s.delete(p))},_=u=i(o,f,b);return b},Sb=(i=>i?vh(i):vh),kb=i=>i;function Eb(i,u=kb){const s=Ar.useSyncExternalStore(i.subscribe,Ar.useCallback(()=>u(i.getState()),[i,u]),Ar.useCallback(()=>u(i.getInitialState()),[i,u]));return Ar.useDebugValue(s),s}const bh=i=>{const u=Sb(i),s=o=>Eb(u,o);return Object.assign(s,u),s},Ir=(i=>i?bh(i):bh),Or="overlord-access-token",Cr="overlord-refresh-token",We={getAccessToken(){return localStorage.getItem(Or)},setAccessToken(i){localStorage.setItem(Or,i)},getRefreshToken(){return localStorage.getItem(Cr)},setRefreshToken(i){localStorage.setItem(Cr,i)},setTokens(i,u){localStorage.setItem(Or,i),localStorage.setItem(Cr,u)},clearTokens(){localStorage.removeItem(Or),localStorage.removeItem(Cr)},parseToken(i){try{const u=i.split(".")[1];return JSON.parse(atob(u))}catch{return null}},hasScope(i,u){const s=We.parseToken(i);return s?s.scope===u:!1},isExpired(i){const u=We.parseToken(i);return!u||typeof u.exp!="number"?!0:Date.now()/1e3>u.exp-30}};function Rs(i){const u=We.parseToken(i);if(!u)return null;const s=u.name??"";return{id:u.sub,username:s,display_name:s,role:u.role}}const xa=Ir((i,u)=>({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1,initializing:!0,initialize:()=>{const s=We.getAccessToken();s&&!We.isExpired(s)?i({accessToken:s,user:Rs(s),requireTotpSetup:We.hasScope(s,"totp_setup"),initializing:!1}):We.getRefreshToken()?u().refresh().catch(()=>{We.clearTokens()}).finally(()=>{i({initializing:!1})}):i({initializing:!1})},login:async s=>{var m;const o=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!o.ok){const g=await o.json().catch(()=>({message:"Login failed"})),b=((m=g.error)==null?void 0:m.message)??g.message??"Login failed";throw new Error(b)}const f=await o.json();if(f.totpSetup){We.setAccessToken(f.accessToken),i({accessToken:f.accessToken,user:null,requireTotpSetup:!0});return}We.setTokens(f.accessToken,f.refreshToken),i({accessToken:f.accessToken,user:Rs(f.accessToken),requireTotpSetup:!1,sessionExpired:!1})},logout:()=>{const s=We.getRefreshToken();s&&fetch("/api/auth/logout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:s})}).catch(()=>{}),We.clearTokens(),i({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1})},refresh:(()=>{let s=null;return async()=>s||(s=(async()=>{const o=We.getRefreshToken();if(!o)throw We.clearTokens(),i({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!0}),new Error("No refresh token");const f=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:o})});if(!f.ok)throw We.clearTokens(),i({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!0}),new Error("Refresh failed");const m=await f.json();We.setTokens(m.accessToken,m.refreshToken),i({accessToken:m.accessToken,user:Rs(m.accessToken)})})().finally(()=>{s=null}),s)})(),setSessionExpired:s=>{i({sessionExpired:s})}})),X1={QUEUED:"QUEUED",ASSIGNED:"ASSIGNED",RUNNING:"RUNNING",SUSPENDED:"SUSPENDED",COMPLETED:"COMPLETED",FAILED:"FAILED",CANCELLED:"CANCELLED"},Q1={ONLINE:"online",OFFLINE:"offline",DRAINING:"draining",DECOMMISSIONED:"decommissioned"},up={DEVELOPER:"developer",LEAD:"lead",ADMIN:"admin"},Z1={MAINTAINER:"maintainer",MEMBER:"member"},K1={CLAUDE:"claude",CURSOR:"cursor",CODEX:"codex"},J1={ACTIVE:"active",USED:"used",REVOKED:"revoked",EXPIRED:"expired"},$1={GITLAB:"gitlab",GITHUB:"github",GITEA:"gitea"},W1={ACTIVE:"active",DISABLED:"disabled"},F1={ACTIVE:"active"},I1={IDLE:"IDLE",STARTING:"STARTING",CONNECTED:"CONNECTED",EXPIRED:"EXPIRED",CLOSING:"CLOSING",CLOSED:"CLOSED"};function wb(){return xa(i=>{var u;return((u=i.user)==null?void 0:u.role)===up.ADMIN})??!1}const op="overlord-sidebar-collapsed";function Tb(){try{return localStorage.getItem(op)==="true"}catch{return!1}}const jb=Ir((i,u)=>({sidebarCollapsed:Tb(),toggleSidebar:()=>{const s=!u().sidebarCollapsed;try{localStorage.setItem(op,String(s))}catch{}i({sidebarCollapsed:s})}}));class Rb{constructor(){Ve(this,"ws",null);Ve(this,"reconnectAttempts",0);Ve(this,"maxReconnectAttempts",15);Ve(this,"reconnectTimer",null);Ve(this,"disposed",!1);Ve(this,"authenticated",!1);Ve(this,"eventHandlers",new Set);Ve(this,"statusHandlers",new Set)}onEvent(u){return this.eventHandlers.add(u),()=>this.eventHandlers.delete(u)}onStatus(u){return this.statusHandlers.add(u),()=>this.statusHandlers.delete(u)}get isConnected(){var u;return this.authenticated&&((u=this.ws)==null?void 0:u.readyState)===WebSocket.OPEN}connect(){var f,m;if(this.disposed||((f=this.ws)==null?void 0:f.readyState)===WebSocket.OPEN||((m=this.ws)==null?void 0:m.readyState)===WebSocket.CONNECTING)return;const u=We.getAccessToken();if(!u||We.isExpired(u))return;const o=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/events`;this.notifyStatus("connecting"),this.authenticated=!1,this.ws=new WebSocket(o),this.ws.onopen=()=>{var b,_;const g=We.getAccessToken();g?(b=this.ws)==null||b.send(JSON.stringify({type:"auth",token:g})):(_=this.ws)==null||_.close()},this.ws.onmessage=g=>{var b;if(typeof g.data=="string")try{const _=JSON.parse(g.data);if(_.type==="auth_ok"){this.authenticated=!0,this.reconnectAttempts=0,this.notifyStatus("connected");return}if(_.type==="auth_error"){(b=this.ws)==null||b.close();return}if(_.type==="event")for(const p of this.eventHandlers)try{p(_)}catch{}}catch{}},this.ws.onclose=()=>{this.authenticated=!1,this.notifyStatus("disconnected"),this.scheduleReconnect()},this.ws.onerror=()=>{var g;(g=this.ws)==null||g.close()}}disconnect(){var u;this.clearReconnectTimer(),this.authenticated=!1,(u=this.ws)==null||u.close(),this.ws=null}dispose(){this.disposed=!0,this.disconnect(),this.eventHandlers.clear(),this.statusHandlers.clear()}reconnect(){this.disconnect(),this.reconnectAttempts=0,this.connect()}scheduleReconnect(){if(this.disposed||this.reconnectAttempts>=this.maxReconnectAttempts)return;const u=Math.min(1e3*2**this.reconnectAttempts,3e4);this.reconnectAttempts++,this.reconnectTimer=setTimeout(()=>{this.disposed||this.connect()},u)}clearReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}notifyStatus(u){for(const s of this.statusHandlers)try{s(u)}catch{}}}const Dr=new Rb,sp=Ir(i=>({status:"disconnected",lastEvent:null,eventSeq:0,taskSeq:0,workerSeq:0,init:()=>{const u=Dr.onEvent(o=>{const f=o.event==="task_status_changed"||o.event==="task_created"||o.event==="review_round_complete",m=o.event==="worker_status_changed";i(g=>({lastEvent:o,eventSeq:g.eventSeq+1,...f&&{taskSeq:g.taskSeq+1},...m&&{workerSeq:g.workerSeq+1}}))}),s=Dr.onStatus(o=>{const f=sp.getState().status;i({status:o}),f==="disconnected"&&o==="connected"&&i(m=>({eventSeq:m.eventSeq+1,taskSeq:m.taskSeq+1,workerSeq:m.workerSeq+1}))});return Dr.connect(),()=>{u(),s(),Dr.disconnect()}}})),cp="overlord-theme";function Ab(){try{const i=localStorage.getItem(cp);if(i==="light"||i==="dark"||i==="system")return i}catch{}return"dark"}function xh(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const fp=Ir(i=>{const u=Ab(),s=u==="system"?xh():u;return{theme:u,resolved:s,setTheme:o=>{localStorage.setItem(cp,o);const f=o==="system"?xh():o;i({theme:o,resolved:f})},setResolved:o=>{i({resolved:o})}}}),zb={common:{cancel:"cancel",confirm:"confirm",save:"save",delete:"delete",edit:"edit",create:"create",copy:"copy",copied:"copied",close:"close",back:"back",go_back:"go back",go_home:"go home",dismiss:"dismiss",retry:"retry",loading:"// thinking...",processing:"processing...",creating:"creating...",saving:"saving...",updating:"updating...",verifying:"verifying...",signing_in:"signing in...",just_now:"just now",never:"never",previous:"previous",next:"next",enabled:"enabled",disabled:"disabled",runtime_error:"// runtime error",an_unexpected_error_occurred:"an unexpected error occurred",reload:"reload",not_found:"404",page_not_found:"// page not found",the_page_does_not_exist:"the page you are looking for does not exist or has been moved.",not_found_terminal_error:"error: requested not found - page does not exist",not_set:"not set",view_all:"view all",discard:"discard",save_changes:"save changes",remove:"remove",actions:"actions",name:"name",status:"status",role:"role",created_at:"created at",m_ago:"{n}m ago",h_ago:"{n}h ago",d_ago:"{n}d ago",loop_section:"// loop",tasks_section:"// tasks",fleet_section:"// fleet",docs_section:"// docs",admin_section:"// admin",overlord:"overlord",logout:"logout",logout_title:"// logout",logout_message:"are you sure you want to log out?",log_out:"log out",profile:"profile",search_placeholder:"search",search_input_placeholder:"search tasks, workers, projects...",no_search_results:'// no results for "{query}"',navigate_hint:"navigate",select_hint:"select",close_hint:"close",notifications:"notifications",mark_all_read:"mark all read",no_notifications:"// no notifications",mark_as_read:"mark as read",switch_to_light:"switch to light mode",switch_to_dark:"switch to dark mode",light_mode:"light mode",dark_mode:"dark mode",dismiss_notification:"dismiss",breadcrumb_terminal:"terminal",breadcrumb_terminal_sub:"active sessions",breadcrumb_dashboard:"dashboard",breadcrumb_dashboard_sub:"active overview",breadcrumb_tasks:"tasks",breadcrumb_tasks_sub:"queue management",breadcrumb_workers:"workers",breadcrumb_workers_sub:"fleet status",breadcrumb_projects:"projects",breadcrumb_projects_sub:"repository index",breadcrumb_admin:"admin",breadcrumb_admin_sub:"system control",breadcrumb_profile:"profile",breadcrumb_profile_sub:"user settings",breadcrumb_tokens:"tokens",breadcrumb_tokens_sub:"personal api tokens",breadcrumb_docs:"docs",breadcrumb_docs_sub:"documentation",breadcrumb_docs_cli:"docs",breadcrumb_docs_cli_sub:"cli",breadcrumb_docs_api:"docs",breadcrumb_docs_api_sub:"api",breadcrumb_docs_skill:"docs",breadcrumb_docs_skill_sub:"skill",breadcrumb_docs_bot_sub:"bot",breadcrumb_docs_all_sub:"all"},auth:{sign_in:"sign in",username:"username",enter_username:"enter username",password:"password",enter_password:"enter password",ai_powered_development_system:"// ai-powered development system",username_and_password_required:"username and password are required.",login_failed:"login failed",invalid_totp_code:"invalid totp code",two_factor_verification:"// 2fa verification",enter_totp_code:"enter your totp code",please_enter_valid_6_digit_code:"please enter a valid 6-digit code.",session_expired:"session expired",session_expired_message:"// your session has expired. please log in again.",go_to_login:"go to login",totp_setup_subtitle:"// scan the qr code with your authenticator app",verification_code:"verification code",verify_and_enable:"verify and enable",totp_setup_complete_login_again:"2fa setup complete! please log in again.",totp_setup_failed:"verification failed. please try again.",totp_setup_footer:"// you must complete this setup before accessing the application",totp_manual_entry:"// or enter this key manually",verify:"verify",initializing:"// initializing...",failed_to_init_totp:"failed to initialize totp setup"},dashboard:{title:"dashboard",tasks_active_queued:"active / queued",online_workers:"online workers",completed_all_today:"completed all today",completed_by_you_today:"completed by you today",task_count:"> task count",success_rate:"success rate",last_7_days:"last 7 days",recent_tasks:"> recent tasks",no_tasks_yet:"// no tasks yet",workers:"> workers",no_workers_registered:"// no workers registered",projects:"> projects",recent_activity:"> recent activity",no_recent_activity:"// no recent activity",daily_breakdown_not_available:"// daily breakdown not available",task_total:"task",tasks_total:"tasks",slots:"slots",online:"online",idle:"idle",offline:"offline"},tasks:{title:"tasks",create_task:"create task",new_task:"new task",task_description:"task description",describe_task_placeholder:"describe the development task in detail...",project:"project",select_project:"select project...",task_type:"type",branch_slug:"branch name (optional)",branch_slug_placeholder:"auto-generated from description",target_branch:"target branch (optional)",target_branch_placeholder:"defaults to project default branch",target_worker:"target worker (optional)",any_able:"any able",assign_developer:"assign developer (admin only)",select_developer:"select developer...",search_tasks:"search tasks...",filter_project:"all projects",filter_developer:"all developers",id:"id",description_col:"description",status_col:"status",project_col:"project",assignee:"assignee",worker:"worker",time:"time",stage:"stage",no_tasks_found:"no tasks found",try_adjusting_search:"try adjusting your search query",create_first_task:"create your first task to get started",tab_all:"all",tab_running:"running",tab_queued:"queued",tab_completed:"completed",tab_failed:"failed",tab_cancelled:"cancelled",status_queued:"queued",status_assigned:"assigned",status_running:"running",status_suspended:"suspended",status_completed:"completed",status_failed:"failed",status_cancelled:"cancelled",similar_task_exists:"a similar task already exists.",view_existing:"view existing",cancel_task:"cancel",retry_task:"retry",cursor_tunnel:"IDE tunnel",skip_stage:"skip stage",take_over:"take over",connected:"connected",disconnected:"disconnected",connecting:"connecting",terminal:"terminal",pipeline_tab:"pipeline",logs:"logs",task_not_found:"// task not found",back_to_tasks:"back to tasks",cancel_task_title:"cancel task",fork_task:"fork task",fork_task_desc:"create a new task based on this one. new text appends to the original detail by default.",fork_description_placeholder:"enter extra detail to append (leave empty to reuse original)",fork_agent_type_placeholder:"same as source ({agent})",fork_replace_description:"replace original detail instead of appending",fork_append_hint:"without replace enabled, your input is appended after the original detail",fork_success:"task forked successfully",fork_error:"failed to fork task",activity_log:"> activity log",no_activity:"// no activity yet",confirm_stage_message:'confirm execution of stage "{name}"? this will proceed with the pipeline.',plan_review_message:'review the implementation plan for stage "{name}". approve to proceed or provide feedback.',plan_decompose_message:"spec document has been generated and pushed. would you like to decompose it into development tasks?",code_review_message:'review the changes for stage "{name}". approve to proceed or provide feedback.',feedback_placeholder:"provide feedback (optional)...",approve_plan:"approve plan",approve_plan_decompose:"decompose into tasks",reject_plan_decompose:"save spec only",approve_review:"approve changes",request_changes:"request changes",loading_task:"// thinking...",task_suspended_banner:"// task suspended — waiting for user confirmation",pending_confirmation:"> pending confirmation",pipeline_requires_confirmation:"the pipeline requires confirmation before proceeding.",confirm_and_proceed:"confirm and proceed",confirm_failed:"failed to confirm stage",reject:"reject",pty_terminal:"// pty terminal",view_terminal:"switch to terminal tab",restore_auto:"restore auto",requesting_takeover:"requesting...",pipeline_stages:"// pipeline stages",task_info:"> task info",stage_timeline:"> stage timeline",workspace_section:"> workspace",mr_link:"MR link",queue_position:"queue position: #{position} of {total}",queue_ahead:"{count} task(s) ahead",queue_next:"next to be processed",queue_position_banner:"// queued — position #{position} of {total}",no_worker_assigned:"// no worker assigned",no_output:"// no output",pty_output:"> PTY output",stage_progress:"> stage progress",task_logs:"> task logs",full_terminal:"open full terminal",return_to_companion:"return to companion",complex_terminal_hint:"complex terminal detected. use the full terminal for the best view.",search_logs:"search logs...",no_log_entries:"// no log entries",prev:"prev",cursor_tunnel_section:"> IDE tunnel",auto_pipeline:"auto pipeline",manual_takeover:"manual takeover",takeover_denied:"takeover denied",form_project_label:"project",form_description_label:"description",form_description_placeholder:"describe the task for the ai agent...",form_worker_preference:"worker preference",form_worker_placeholder:"optional: worker id or name (--on)",form_worker_hint:"leave empty for automatic worker selection.",form_agent_type:"agent",form_agent_type_placeholder:"default",form_select_project:"select a project",form_create_task:"create task",project_and_description_required:"project and description are required.",failed_to_create_task:"failed to create task.",tunnel_idle:"idle",tunnel_starting:"starting...",tunnel_connected:"connected",tunnel_expired:"expired",tunnel_closing:"closing...",tunnel_start:"start",tunnel_open_in_cursor:"open in IDE",tunnel_header:"> IDE tunnel",tunnel_copied:"// copied to clipboard",tunnel_waiting:"// waiting for connection url...",tunnel_start_button:"> start tunnel",tunnel_starting_button:"// starting...",tunnel_stopping:"// stopping...",tunnel_cancel:"> cancel",tunnel_open_cursor:"> open in IDE",tunnel_open_vscode:"> open in vscode",tunnel_stop:"> stop tunnel",tunnel_restart:"> restart tunnel",tunnel_copy_url:"copy url",tunnel_expires_hm:"expires in {h}h {m}m",tunnel_expires_m:"expires in {m}m",tunnel_start_failed:"failed to start tunnel",tunnel_install_code_hint:'install the VS Code CLI ("code" command) to enable tunnels',dedup_title:"> similar task exists",dedup_description:"// a similar task was found that may already address your request",dedup_create_anyway:"create anyway",stage_submitting:"submitting...",cancel_task_message:"are you sure you want to cancel task #{id}? this will terminate the running agent and cannot be undone.",cancel_task_confirm_label:"cancel task",retry_title:"retry task",retry_confirm_label:"retry",retry_message_with_mr:"task #{id} has an existing mr ({url}). retrying will create a new attempt on the same branch. continue?",retry_message_without_mr:"are you sure you want to retry task #{id}? this will create a new execution attempt.",reuse_workspace_label:"reuse existing workspace (skip worktree recreation, continue on current branch)",detail_tab:"detail",detail_basic_info:"> basic info",detail_creator:"creator",detail_project:"project",detail_worker:"worker",detail_time_cost:"time cost",detail_branch:"branch",detail_task_name:"> task name & description",detail_ai_name:"ai-generated name",detail_task_id:"task id",detail_source:"source platform",detail_description:"> description"},workers:{title:"workers",fleet:"fleet",setup_guide:"setup guide",all_statuses:"all",register_worker:"register worker",no_workers_found:"no workers found",no_workers_registered:"no workers have registered yet",try_changing_status_filter:"try changing the status filter",view_setup_guide:"view setup guide",online:"online",offline:"offline",draining:"draining",cpu:"cpu",mem:"mem",disk:"disk",tasks_slots:"tasks: {active}/{max} slots",back_to_workers:"back to workers",drain:"drain",undrain:"undrain",last_heartbeat:"last heartbeat: {time}",resource_usage:"> resource usage",connection_info:"> connection info",capabilities:"> capabilities",current_tasks:"> current tasks",host:"host",os:"os",cpu_model:"CPU model",cpu_cores:"CPU cores",memory:"memory",loading_worker:"// thinking...",worker_not_found:"// worker not found",draining_warning:"// this worker is draining — no new tasks will be assigned",draining_active_tasks:"active tasks will continue to run until completion",active_tasks:"> active tasks",no_active_tasks:"// no active tasks on this worker",worker_info:"> worker info",unknown:"unknown",n_a:"n/a",id:"id",description:"description",stage:"stage",no_capabilities_short:"// no capabilities",slots:"slots",status_label:"status",undrain_worker_title:"> undrain worker",drain_worker_title:"> drain worker",undrain_confirm:"are you sure you want to undrain {name}? the worker will start accepting new tasks again.",drain_confirm:"are you sure you want to drain {name}? running tasks will complete, but no new tasks will be assigned until the worker is undrained.",decommission:"decommission",decommission_title:"> decommission worker",decommission_confirm:'permanently decommission "{name}"? active tasks will be failed or re-queued, and the worker will be disconnected. this cannot be undone.',restore_capability:"restore capability",restore_capability_title:"> restore capability",restore_capability_confirm:"restore {capability} on {name}? this only clears the degradation flag. it does not fix the underlying issue.",awaiting_auto_recovery:"awaiting auto-recovery",manual_restore_required:"manual restore required",worker_id:"worker ID",setup_header_desc:"// follow these steps to add a new worker to your overlord cluster.",prerequisites:"// prerequisites",prereq_machine:"linux or macos machine with at least 2 cpu cores and 4gb ram",prereq_node:"node.js 18+ and pnpm installed",prereq_git:"git installed (2.25+)",prereq_network:"network access to the overlord server",prereq_token:"admin-generated worker registration token",step_generate_token:"generate worker token",step_generate_token_desc:"// create a one-time registration token from the admin panel. each token can register exactly one worker.",go_to_token_management:"go to token management",step_install_worker:"install worker package",step_install_worker_desc:"// install the overlord worker package globally via npm.",step_configure_env:"configure environment",step_configure_env_desc:"// create a .env file in ~/.overlord-worker/ or set environment variables.",env_host:"overlord server address (required)",env_worker_token:"one-time registration token (required for first run)",env_worker_name:"display name (defaults to hostname)",env_workspace_root:"task workspace directory (defaults to ~/.overlord-worker/workspaces)",env_max_slots:"max concurrent tasks (defaults to 2)",step_start_worker:"start worker",step_start_worker_desc:"// start the worker process. it will register with the server and begin accepting tasks.",setup_wizard_option:"// option a: interactive setup wizard (recommended)",manual_config_option:"// option b: manual configuration",start_note_setup_wizard:"// if you used the setup wizard, the worker may already be running.",step_verify_connection:"verify connection",step_verify_connection_desc:'// once the worker connects, it will appear in the workers list with a "healthy" status.',verify_how_to:"// how to verify:",verify_check_workers:"check the workers page for your new worker",verify_status:'status should show "healthy" within 30 seconds',verify_capabilities:"worker capabilities are auto-detected on first heartbeat",last_heartbeat_label:"last heartbeat",worker_version:"worker version",reg_title:"// worker registration",reg_subtitle:"> register a new worker node",reg_step_generate_token:"generate token",reg_step_install_worker:"install worker",reg_step_waiting_activation:"waiting activation",reg_step_activated:"activated",reg_click_to_generate:"// click to generate a one-time registration token",reg_token_generated:"// token generated successfully",reg_running_installation:"// running installation on target worker",reg_installed_wait:"i've installed → wait for activation",reg_listening_for_worker:"listening for worker connection...",reg_worker_connected:"// worker connected",reg_waiting_for_worker:"// waiting for worker to connect...",reg_worker_activated:"worker {name} activated!",reg_worker_registered:"// worker successfully registered",reg_done:"done",reg_completed:"// completed"},projects:{title:"projects",create_project:"create project",no_projects_yet:"no projects yet",create_first_project:"create your first project to get started",key:"key",name:"name",project_info:"> project info",repo_url:"repo URL",default_branch:"default branch",git_platform:"git platform",agent_type:"agent type",max_turns:"max turns",allowed_tools:"allowed tools",default_project:"default project",tasks_count:"tasks",last_activity:"last activity",members:"> members",developer:"developer",role:"role",added_at:"added at",add_member:"add member",remove_member:"remove member",remove_member_confirm:"remove {name} from this project?",failed_to_add_member:"failed to add member.",member_already_exists:"this developer is already a member of this project.",pipeline:"> pipeline",add_stage:"+ add stage",recent_tasks:"> recent tasks",edit_project:"edit project",delete_project:"delete project",delete_project_confirm:'delete project "{name}"? this cannot be undone.',project_name:"project name",project_name_placeholder:"my awesome project",project_key:"project key",project_key_placeholder:"my-project",project_key_hint:"// unique identifier (lowercase, alphanumeric, hyphens)",ssh_url:"SSH URL",ssh_url_placeholder:"git@github.com:org/repo.git",ssh_url_hint:"// optional — workers prefer ssh for git operations",repo_url_placeholder:"https://github.com/org/repo.git",main:"main",github:"github",gitlab:"gitlab",gitea:"gitea",tools_placeholder:"tool1, tool2, ...",add_project_desc:"// add a new project to overlord",failed_to_create_project:"failed to create project.",update_project_desc:"// update project configuration",save_changes:"save changes",basic_info:"> basic info",agent_config:"> agent config",security:"> security",git_token:"> git token",git_token_label:"current token",git_token_hint:"// personal access token for git operations (push, clone, etc.)",git_token_set:"set token",git_token_clear:"clear token",git_token_saved:"git token saved.",git_token_cleared:"git token cleared.",git_token_failed:"failed to update git token.",pipeline_section:"> pipeline",edit_pipeline:"> edit pipeline",pty_output_filter:"PTY output filter",workspace_root:"workspace root",member_role:"member",maintainer_role:"maintainer",select_developer:"select developer...",adding:"adding...",project_not_found:"// project not found",back_to_projects:"back to projects",no_members_yet:"// no members yet",no_tasks_for_project:"// no tasks for this project yet",no_pipeline_configured:"// no pipeline configured",confirm_label:"confirm",id:"id",description:"description",status:"status",created:"created",project_saved:"project saved",failed_to_save_project:"failed to save project",invalid_pipeline_json:"invalid pipeline json",setup_commands:"setup commands",post_command:"post command",environment:"> environment",add_member_title:"// add member",edit_project_title:"edit project"},pipeline:{title:"pipeline editor",subtitle:"-- {key}",save:"save",cancel:"cancel",json_toggle:"json",add_stage:"add stage",stage_properties:"> stage properties",stage_name:"stage name",timeout:"timeout",confirm_required:"confirm required",on_failure:"on failure",goto:"goto",max_loops:"max loops",stop:"stop",select_stage:"// select a stage to edit properties",saved:"pipeline saved",failed_to_save:"failed to save pipeline",loading_pipeline:"// thinking...",unnamed:"unnamed",editing:"// editing: {name}",name:"name",on_failure_section:"// on failure",goto_stage:"goto stage",up:"up",down:"down",failed_to_load_project:"failed to load project",delete_stage:"delete stage"},profile:{title:"profile",profile_info:"> profile info",username:"username",git_name:"git name",git_email:"git email",status:"status",created_at:"created at",change_password:"> change password",current_password:"current password",new_password:"new password",confirm_password:"confirm password",current_password_required:"current password is required.",new_password_required:"new password is required.",passwords_do_not_match:"new passwords do not match.",password_changed:"password changed successfully.",failed_to_change_password:"failed to change password.",update_password:"update password",two_factor_auth:"> two-factor authentication",two_fa_enabled:"2fa is enabled",two_fa_not_setup:"2fa is not set up",regenerate_2fa_warning:`// regenerating 2fa will invalidate your current authenticator app setup.
247
247
  you will need to set up 2fa again on your next login.`,regenerate_2fa:"regenerate 2FA",regenerating:"regenerating...",access_tokens:"access tokens",access_tokens_desc:"// manage personal access tokens for cli & api",unable_to_load_profile:"// unable to load profile information",personal_settings:"// personal settings",password_hint_10_20:"// 10-20 characters, letters, numbers, and special characters",current_totp_code:"current TOTP code",totp_code_placeholder:"6-digit code",totp_code_required:"please enter your current 6-digit totp code to regenerate 2fa.",two_fa_regenerated:"2fa regenerated. you will need to set it up again on next login.",totp_code_invalid:"invalid totp code or failed to regenerate 2fa.",platform_accounts:"platform accounts",not_linked:"not linked",bind_hint:'send "bind" to the bot in lark or slack to link your account.'},access_tokens:{create_token:"create token",no_tokens:"no personal access tokens",create_token_desc:"create a token to authenticate with the cli or api",copy_token_warning:"// copy your token now. you will not be able to see it again.",token_name:"token name",token_name_placeholder:"my-cli-token",days_30:"30 days",days_90:"90 days",days_365:"365 days",no_expiry:"no expiry",failed_to_create_token:"failed to create token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",revoke:"revoke",last_used:"last used",created:"created",expires:"expires",revoke_confirm:'are you sure you want to revoke "{name}"? this action cannot be undone.',create_personal_access_token:"// create personal access token",tokens_authenticate_desc:"// tokens authenticate the ov cli and api requests",revoke_token_title:"// revoke token",token_label_required:"token label is required."},admin:{tab_developers:"developers",tab_bots:"bots",tab_tokens:"worker tokens",tab_audit_logs:"audit logs",tab_settings:"settings",developers_title:"admin / developers",developers_subtitle:"// developer account management",create_developer:"create developer",search_developers:"search developers...",no_matching_developers:"no matching developers",no_developers_found:"no developers found",try_adjusting_search:"try adjusting your search query",username:"username",role:"role",status:"status",totp:"totp",reset_2fa:"reset 2fa",deactivate:"deactivate",activate:"activate",create_developer_title:"create developer",edit_developer_title:"edit developer",failed_to_create_developer:"failed to create developer",failed_to_update_developer:"failed to update developer",failed_to_reset_2fa:"failed to reset 2fa",create_first_developer:"create your first developer to get started",all_fields_required:"all fields are required.",password_length_error:"password must be between 10 and 20 characters.",password_complexity_error:"password must contain at least one letter, one digit, and one special character.",password_hint:"// must be 10-20 characters with letters, digits, and special characters.",demote_self_warning:"you are about to demote yourself from admin. the system must have at least one admin. please verify another admin exists before proceeding.",demote_self_inline_warning:"// warning: you are demoting yourself from admin. ensure at least one other admin exists.",lark_uid:"lark open ID",slack_uid:"slack user ID",platform_accounts:"platform accounts",reset_2fa_confirm_message:"are you sure you want to reset two-factor authentication for",reset_2fa_audit_note:"// the user will be required to set up 2fa again on their next login. this action is recorded in the audit log.",resetting:"resetting...",bots_title:"admin / bots",bots_subtitle:"// bot instance management",create_bot:"create bot",no_bots_configured:"no bots configured",add_bot_desc:"add a bot instance to enable chat integrations with lark or slack",bot_name:"bot name",platform:"platform",app_id:"app ID",delete_bot:"delete bot",delete_bot_confirm:'delete bot "{name}"? this cannot be undone.',failed_to_delete_bot:"failed to delete bot.",failed_to_create_bot:"failed to create bot",chat_bindings:"group bindings",chat_bindings_subtitle:"// all integrations",no_chat_bindings:"// no group bindings configured",chat_id:"chat ID",chat_name:"chat name",project:"project",bot:"bot",edit_bot:"edit bot",name_and_app_id_required:"name and app id are required.",app_secret_required:"app secret is required for new bots.",app_secret:"app secret",app_secret_keep_current:"app secret (leave empty to keep current)",failed_to_update_bot:"failed to update bot",bot_token:"bot token",bot_token_keep_current:"bot token (leave empty to keep current)",bot_token_placeholder:"xoxb-...",bot_token_hint:"// OAuth & Permissions → Bot User OAuth Token",signing_secret:"signing secret",signing_secret_keep_current:"signing secret (leave empty to keep current)",signing_secret_placeholder:"your signing secret",signing_secret_hint:"// Basic Information → App Credentials → Signing Secret",app_secret_hint_lark:"// lark open platform → app credentials → app secret",encrypt_key:"encrypt key",encrypt_key_keep_current:"encrypt key (leave empty to keep current)",encrypt_key_hint:"events & callbacks → encryption strategy → encrypt key",encrypt_key_placeholder:"encrypt key from encryption strategy",app_id_hint_slack:"// Basic Information → App ID",app_id_hint_lark:"// lark open platform → app id",webhook_config:"// webhook configuration",webhook_config_hint_slack:"// copy these URLs to your Slack app settings",webhook_config_hint_lark:"// copy this URL to event subscriptions → request url",webhook_events_url:"events url",webhook_interact_url:"interactivity url",webhook_commands_url:"slash commands url",webhook_request_url:"request url",slack_events_hint:"// paste in Event Subscriptions → Request URL",slack_interact_hint:"// paste in Interactivity & Shortcuts → Request URL",slack_commands_hint:"// paste in Slash Commands → Request URL",invalid_bot_token:"// bot token must start with xoxb-",signing_secret_required:"// signing secret is required for Slack bots",add_binding:"add binding",failed_to_add_binding:"failed to add binding",failed_to_delete_binding:"failed to delete binding",tokens_title:"admin / worker tokens",tokens_subtitle:"// worker registration token management",generate_token:"generate token",no_worker_tokens:"no worker tokens",generate_token_desc:"generate a token to register a new worker",label:"label",purpose:"purpose",expires_at:"expires at",revoke_token:"revoke token",revoke_token_confirm:'revoke token "{label}"? this cannot be undone.',show_revoked:"show revoked",hide_revoked:"hide revoked",audit_title:"admin / audit logs",audit_subtitle:"// system activity audit trail",all_actions:"all actions",filter_by_user:"filter by user...",no_audit_entries:"no audit log entries",audit_logs_appear:"audit logs will appear here as actions are performed in the system",timestamp:"timestamp",user_id:"user ID",action:"action",resource:"resource",detail:"detail",ip:"ip",action_login:"login",action_logout:"logout",action_create:"create",action_update:"update",action_delete:"delete",action_revoke:"revoke",action_reset_2fa:"reset 2FA",action_generate_token:"generate token",showing_entries:"showing {count} entries",revoke:"revoke",generate_worker_token_title:"> generate worker token",create_one_time_token:"// create a one-time registration token",label_identifies_worker:"// identifies which worker this token is for",generating:"generating...",generate:"generate",worker_registered:"> worker registered",worker_token_generated:"> worker token generated",run_command_desc:"// run this command on the target machine to register the worker",token_shown_once:"// this token will only be shown once. copy the command before closing.",setup_command:"setup command",waiting_for_worker:"// waiting for worker to register...",token_not_yet_used:"// token not yet used. the worker can still register later using this token.",worker_registered_success:"// worker registered successfully",worker:"worker",copied_wait_for_worker:"copied — wait for worker",close_worker_can_register:"close // worker can still register",view_worker:"view worker",settings_title:"admin / settings",settings_subtitle:"// global system configuration",save_settings:"save settings",settings_saved:"settings saved",failed_to_save_settings:"failed to save settings",loading_settings:"// thinking...",scheduling:"> scheduling",heartbeat:"> heartbeat",output:"> output",defaults:"> defaults",max_concurrent_tasks:"max concurrent tasks per worker",max_concurrent_tasks_desc:"// maximum number of tasks a single worker can run simultaneously",task_timeout:"task timeout minutes",task_timeout_desc:"// auto-cancel tasks after this many minutes of inactivity",heartbeat_interval:"heartbeat interval seconds",heartbeat_interval_desc:"// expected interval between worker heartbeats",worker_offline_threshold:"worker offline threshold seconds",worker_offline_threshold_desc:"// mark worker offline after missing heartbeats for this duration",default_agent_type:"default agent type",default_agent_type_desc:"// default agent type for new projects",chat_binding_title:"// group bindings — {name}",chat_binding_no_bindings:"// no group bindings configured for this bot.",chat_binding_add:"// add group binding",chat_binding_id_placeholder:"platform chat/group id",chat_binding_name_placeholder:"display name for the chat",chat_binding_select_project:"select project...",chat_binding_all_fields_required:"all fields are required.",chat_binding_adding:"adding...",chat_binding_projects:"projects",chat_binding_default_project:"default project",chat_binding_set_default:"set default",chat_binding_default_badge:"default",chat_binding_set_default_failed:"failed to set default project",pat_label_required:"label is required.",pat_failed_to_generate:"failed to generate token",pat_label_placeholder:"e.g. build-server-03"},landing:{overlord:"overlord",version_badge:"self-hosted · bring your own subscriptions and machines",hero_turn_your:"turn your",hero_into:"into",hero_word_subscriptions:"subscriptions",hero_word_machines:"machines",hero_highlight:"a dev team that never sleeps.",hero_desc:"dispatch coding tasks across your machine fleet. ai agents execute in parallel — you watch, jump in, or come back to finished pull requests.",get_started:"get started",read_docs:"read docs",how_it_works:"how it works",three_steps:"from task description to merged pull request.",step_n:"step {n}",step_define:"connect your fleet",step_define_desc:"register your machines as workers. each one runs ai agents — claude code, cursor, codex — using your existing subscriptions.",step_dispatch:"send a task",step_dispatch_desc:"describe what you want from slack, lark, cli, or the web dashboard. overlord finds the best available machine and starts the ai agent automatically.",step_monitor:"watch or walk away",step_monitor_desc:"live terminal streams agent output to your browser. jump in to guide the agent, or come back later to a finished pull request.",everything_you_need:"everything you need",complete_platform:"self-hosted. your machines, your ai subscriptions, your control.",feature_terminal:"real-time pty terminal",feature_terminal_desc:"stream live agent output directly in the browser. full xterm.js integration with scrollback and search.",feature_multi_agent:"multi-agent support",feature_multi_agent_desc:"first-class support for claude code, cursor, and codex. route tasks to the right agent automatically.",feature_routing:"smart task routing",feature_routing_desc:"intelligent scheduling across your machine fleet. tasks land on the best available worker every time.",feature_pipeline:"pipeline automation",feature_pipeline_desc:"chain tasks into multi-stage pipelines. build, test, and deploy in one continuous flow.",feature_collab:"team collaboration",feature_collab_desc:"project-level permissions, audit logs, and shared dashboards. keep your whole team in sync.",feature_pool:"pool subscriptions, maximize value",feature_pool_desc:"every team member's ai subscription goes into a shared pool — everyone can use any seat. no idle subscriptions, no duplicate costs. the bigger your team, the more you save.",feature_trigger:"trigger from everywhere",feature_trigger_desc:"slack message, lark bot, cli command, or web dashboard — create tasks from whatever tool you already use. phone, laptop, tablet, it all works.",feature_remote:"code from anywhere",feature_remote_desc:"on the bus, at a café, or away from your desk — dispatch tasks from your phone or laptop and your fleet keeps coding. come back to finished pull requests.",feature_security:"secure by design",feature_security_desc:"totp two-factor auth, scoped api tokens, and full audit trail. enterprise-ready from day one.",install_title:"get up and running",install_desc:"three components, three commands. deploy in minutes.",setup_step_1_title:"deploy the server",setup_step_1_desc:"install overlord and start the central server. it manages all tasks, authentication, and real-time communication.",setup_step_1_command:`npm install -g @overlordai/cli @overlordai/server
248
248
  overlord install`,setup_step_1_link:"installation guide",setup_step_2_title:"register workers",setup_step_2_desc:"set up worker machines that execute tasks. each worker runs ai agents in isolated workspaces with full git integration.",setup_step_2_command:`npm install -g @overlordai/cli @overlordai/worker
249
249
  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
250
250
  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:{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_task_guide:"task guide",docs_skill:"skill reference",docs_permissions:"permissions & roles",docs_env_vars:"environment variables",docs_architecture:"architecture",docs_changelog:"changelog",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_task_guide:"task modes, task types, forks, and task relationships",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",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}]?
251
251
 
252
- "{description}"`},plan:{title:"plan",create:"create plan",description_placeholder:"describe what you want to build...",spec_generated:"spec generated",decompose:"decompose into tasks",save_only:"save spec only",no_plans:"no plan tasks yet",view_spec:"view spec"},review:{title:"review",pending:"pending review",in_progress:"in progress",history:"history",launch:"launch review",select_agents:"select review agents",approve_fix:"fix issues",skip_fix:"no fix needed",review_again:"review again",round:"round",no_reviews:"no reviews yet",issues_summary:"{critical} critical · {warning} warning · {suggestion} suggestion",description_placeholder:"review instructions (optional)...",empty_report_warning:"review completed but no structured report was produced. check the terminal output for details.",fix_push_info:"selected agent will push fixes to the source branch",waiting_agents:"waiting for review agents to finish...",skip_fix_label:"review only (skip fix stage)"}};function Ob(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 Cb(i,u){return u?i.replace(/\{(\w+)\}/g,(s,o)=>u[o]!=null?String(u[o]):`{${o}}`):i}function Yr(i,u){return Cb(Ob(zb,i),u)}function Vt(){return{t:y.useCallback((u,s)=>Yr(u,s),[])}}function dp(){const{theme:i,setTheme:u}=fp(),{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(bb,{size:16}):h.jsx(pb,{size:16})})}class Ns extends Error{constructor(s,o,f){const m=s.status||s.status===0?s.status:"",g=s.statusText??"",b=`${m} ${g}`.trim(),_=b?`status code ${b}`:"an unknown error";super(`Request failed with ${_}: ${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 mp 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 As extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new mp(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})(),Db=typeof globalThis.AbortController=="function",hp=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Nb=typeof globalThis.ReadableStream=="function",Mb=typeof globalThis.FormData=="function",pp=["get","post","put","patch","head","delete"],Ub={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},zs=2147483647,qb=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,gp=Symbol("stop");class yp{constructor(u){Ve(this,"options");this.options=u}}const Lb=i=>new yp(i),Hb={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},Bb={next:!0},Yb={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},Gb=i=>{if(!i)return 0;if(i instanceof FormData){let u=0;for(const[s,o]of i)u+=qb,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,g){if(g.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))}}))},Vb=(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})},Xb=(i,u,s)=>{if(!i.body)return i;const o=Gb(s??i.body);return new Request(i,{duplex:"half",body:_p(i.body,o,u)})},_n=i=>i!==null&&typeof i=="object",Nr=(...i)=>{for(const u of i)if((!_n(u)||Array.isArray(u))&&u!==void 0)throw new TypeError("The `options` argument must be an object");return Ws({},...i)},vp=(i={},u={})=>{const s=new globalThis.Headers(i),o=u instanceof globalThis.Headers,f=new globalThis.Headers(u);for(const[m,g]of f.entries())o&&g==="undefined"||g===void 0?s.delete(m):s.set(m,g);return s};function Mr(i,u,s){return Object.hasOwn(u,s)&&u[s]===void 0?[]:Ws(i[s]??[],u[s]??[])}const bp=(i={},u={})=>({beforeRequest:Mr(i,u,"beforeRequest"),beforeRetry:Mr(i,u,"beforeRetry"),afterResponse:Mr(i,u,"afterResponse"),beforeError:Mr(i,u,"beforeError")}),Qb=(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(_n(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,g]of f.entries())s.append(m,g)}return s},Ws=(...i)=>{let u={},s={},o={},f;const m=[];for(const g of i)if(Array.isArray(g))Array.isArray(u)||(u=[]),u=[...u,...g];else if(_n(g)){for(let[b,_]of Object.entries(g)){if(b==="signal"&&_ instanceof globalThis.AbortSignal){m.push(_);continue}if(b==="context"){if(_!=null&&(!_n(_)||Array.isArray(_)))throw new TypeError("The `context` option must be an object");u={...u,context:_==null?{}:{...u.context,..._}};continue}if(b==="searchParams"){_==null?f=void 0:f=f===void 0?_:Qb(f,_);continue}_n(_)&&b in u&&(_=Ws(u[b],_)),u={...u,[b]:_}}_n(g.hooks)&&(o=bp(o,g.hooks),u.hooks=o),_n(g.headers)&&(s=vp(s,g.headers),u.headers=s)}return f!==void 0&&(u.searchParams=f),m.length>0&&(m.length===1?u.signal=m[0]:hp?u.signal=AbortSignal.any(m):u.signal=m.at(-1)),u},Zb=i=>pp.includes(i)?i.toUpperCase():i,Kb=["get","put","head","delete","options","trace"],Jb=[408,413,429,500,502,503,504],$b=[413,429,503],kh={limit:2,methods:Kb,statusCodes:Jb,afterStatusCodes:$b,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:i=>.3*2**(i-1)*1e3,jitter:void 0,retryOnTimeout:!1},Wb=(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 Fb(i,u,s,o){return new Promise((f,m)=>{const g=setTimeout(()=>{s&&s.abort(),m(new Ms(i))},o.timeout);o.fetch(i,u).then(f).catch(m).then(()=>{clearTimeout(g)})})}async function Ib(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 Pb=(i,u)=>{const s={};for(const o in u)Object.hasOwn(u,o)&&!(o in Yb)&&!(o in Hb)&&(!(o in i)||o in Bb)&&(s[o]=u[o]);return s},e0=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 t0(i){return i instanceof Ns||(i==null?void 0:i.name)===Ns.name}function a0(i){return i instanceof Ms||(i==null?void 0:i.name)===Ms.name}var Jr,xp,Jt,Bt,rt,Q,$a,ea,vn,oe,Gr,Sp,Us,Vr,Ja,qs,kp,ri,Xr,Ls;const ui=class ui{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,g;if(Kt(this,rt,u),Kt(this,Q,{...s,headers:vp(q(this,rt).headers,s.headers),hooks:bp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Zb(s.method??q(this,rt).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:Wb(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))}Db&&hp&&(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&&(Mb&&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)),e0(q(this,Q).searchParams)){const _="?"+(typeof q(this,Q).searchParams=="string"?q(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ke(g=ui,Jr,xp).call(g,q(this,Q).searchParams)).toString()),p=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,_);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 g,b,_;const o=new ui(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>zs)throw new RangeError(`The \`timeout\` option cannot be greater than ${zs}`);await Promise.resolve();let p=await ke(w=o,oe,kp).call(w);for(const ge of q(o,Q).hooks.afterResponse){const F=ke(k=o,oe,Us).call(k,p.clone());let W;try{W=await ge(o.request,ke(N=o,oe,ri).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 yp)throw ke(H=o,oe,Ja).call(H,F),ke(B=o,oe,Ja).call(B,p),new As(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 ge=new Ns(p,o.request,ke(ue=o,oe,ri).call(ue));for(const F of q(o,Q).hooks.beforeError)ge=await F(ge,{retryCount:q(o,Bt)});throw ge}if(q(o,Q).onDownloadProgress){if(typeof q(o,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Nb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const ge=p.clone();return ke(ce=o,oe,Ja).call(ce,p),Vb(ge,q(o,Q).onDownloadProgress)}return p},m=ke(g=o,oe,qs).call(g,f).finally(()=>{var w,k;const p=q(o,$a);ke(w=o,oe,Vr).call(w,(p==null?void 0:p.body)??void 0),ke(k=o,oe,Vr).call(k,o.request.body??void 0)});for(const[p,w]of Object.entries(Ub))p==="bytes"&&typeof((_=(b=globalThis.Response)==null?void 0:b.prototype)==null?void 0:_.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}};Jr=new WeakSet,xp=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,Gr=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)},Sp=async function(u){if(eh(this,Bt)._++,q(this,Bt)>q(this,Q).retry.limit)throw u;const s=u instanceof Error?u:new mp(u);if(s instanceof As)return s.customDelay??ke(this,oe,Gr).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,Gr).call(this)}if(a0(u)&&!q(this,Q).retry.retryOnTimeout)throw u;if(t0(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,Gr).call(this)},Us=function(u){return q(this,Q).parseJson&&(u.json=async()=>q(this,Q).parseJson(await u.text())),u},Vr=function(u){u&&u.cancel().catch(()=>{})},Ja=function(u){ke(this,oe,Vr).call(this,u.body??void 0)},qs=async function(u){try{return await u()}catch(s){const o=Math.min(await ke(this,oe,Sp).call(this,s),zs);if(q(this,Bt)<1)throw s;if(await Ib(o,q(this,ea)?{signal:q(this,ea)}:{}),s instanceof As&&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,Xr).call(this,f)}for(const f of q(this,Q).hooks.beforeRetry){const m=await f({request:this.request,options:ke(this,oe,ri).call(this),error:s,retryCount:q(this,Bt)});if(m instanceof globalThis.Request){ke(this,oe,Xr).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===gp)return}return ke(this,oe,qs).call(this,u)}},kp=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,ri).call(this),{retryCount:q(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ke(this,oe,Xr).call(this,f);break}}const u=Pb(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):Fb(q(this,$a),u,q(this,Jt),q(this,Q))},ri=function(){if(!q(this,vn)){const{hooks:u,...s}=q(this,Q);Kt(this,vn,Object.freeze(s))}return q(this,vn)},Xr=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:Xb(u,q(this,Q).onUploadProgress,s??q(this,Q).body??void 0)},Pt(ui,Jr);let Kr=ui;/*! MIT License © Sindre Sorhus */const Hs=i=>{const u=(s,o)=>Kr.create(s,Nr(i,o));for(const s of pp)u[s]=(o,f)=>Kr.create(o,Nr(i,f,{method:s}));return u.create=s=>Hs(Nr(s)),u.extend=s=>(typeof s=="function"&&(s=s(i??{})),Hs(Nr(i,s))),u.stop=gp,u.retry=Lb,u},Eh=Hs();let Ur=null;const Qr=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")){Ur||(Ur=xa.getState().refresh().finally(()=>{Ur=null}));try{await Ur}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)}}]}}),n0=3e4;function l0(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 Ep(){const i=Fa(),[u,s]=y.useState([]),[o,f]=y.useState(0),[m,g]=y.useState(!1),[b,_]=y.useState(!1),p=y.useRef(null),{t:w}=Vt(),k=y.useRef(async()=>{try{_(!0);const H=(await Qr.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{_(!1)}});y.useEffect(()=>{k.current();const L=setInterval(()=>k.current(),n0);return()=>clearInterval(L)},[]),y.useEffect(()=>{function L(H){p.current&&!p.current.contains(H.target)&&g(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);async function N(L){try{await Qr.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 Qr.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:()=>g(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(Pv,{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(eb,{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=l0(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),g(!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(tb,{className:"h-3.5 w-3.5"})})]},L.id)})})]})]})}function i0(i){return i&&i.trim().length>0?i:null}function wp(i,u=50){return i0(i.name)??Wh(i.description,u)}function r0(i){return i.description}function Tp(i){return`#${i.id} ${r0(i)}`}function ex(i,u=100){return{text:`#${i.id} ${wp(i,u)}`,title:Tp(i)}}function u0(i){return{tasks:i.tasks.map(u=>({type:"task",id:u.id,title:`#${u.id} ${wp(u)}`,subtitle:`${u.status} · ${u.project_key}`,hoverTitle:Tp(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 o0=300,wh={tasks:vb,workers:lp,projects:ub},s0={tasks:"tasks",workers:"workers",projects:"projects"};function jp({renderTrigger:i}={}){const[u,s]=y.useState(""),[o,f]=y.useState({tasks:[],workers:[],projects:[]}),[m,g]=y.useState(!1),[b,_]=y.useState(!1),[p,w]=y.useState(0),k=y.useRef(null),N=y.useRef(null),Y=y.useRef(void 0),L=y.useRef(void 0),H=Fa(),{t:B}=Vt(),U=y.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),K=y.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{g(!0);const Je=await Qr.get("web/search",{searchParams:{q:W},signal:se.signal}).json();f(u0(Je)),w(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{se.signal.aborted||g(!1)}},[]);y.useEffect(()=>(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>K(u),o0),()=>{Y.current&&clearTimeout(Y.current)}),[u,K]),y.useEffect(()=>{function W(se){se.key==="/"&&!b&&!(se.target instanceof HTMLInputElement||se.target instanceof HTMLTextAreaElement)&&(se.preventDefault(),_(!0)),se.key==="Escape"&&b&&(se.preventDefault(),X())}return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[b]),y.useEffect(()=>{b&&setTimeout(()=>{var W;return(W=N.current)==null?void 0:W.focus()},50)},[b]);function X(){_(!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 ge=U.length>0;let F=0;return h.jsxs(h.Fragment,{children:[i?i(()=>_(!0)):h.jsxs("button",{type:"button",onClick:()=>_(!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(np,{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()&&!ge&&!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:s0[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 c0={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 f0({isOpen:i,onClose:u,onConfirm:s,title:o,message:f,confirmLabel:m,cancelLabel:g,confirmVariant:b="danger",isLoading:_,children:p}){const{t:w}=Vt(),k=y.useId(),N=m??w("common.confirm"),Y=g??w("common.cancel"),L=y.useRef(null),H=y.useRef(null),B=c0[b];y.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=y.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(ip,{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:_,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:_?"not-allowed":"pointer",opacity:_?.7:1,transition:"color 0.15s, border-color 0.15s"},children:Y}),h.jsx("button",{type:"button",onClick:s,disabled:_,style:{flex:1,padding:"0.5rem",backgroundColor:B,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:_?"not-allowed":"pointer",opacity:_?.7:1},children:_?w("common.processing"):N})]})]})}):null}const jh="overlord-pwa-install-dismissed";function d0(){const i=navigator.userAgent;return/iP(hone|od|ad)/.test(i)&&/WebKit/.test(i)&&!/(CriOS|FxiOS|OPiOS|mercury)/.test(i)}function m0(){return navigator.standalone===!0||window.matchMedia("(display-mode: standalone)").matches}function h0(){const{t:i}=Vt(),[u,s]=y.useState("hidden"),[o,f]=y.useState(!1),m=y.useRef(null),g=y.useRef(void 0);y.useEffect(()=>{if(m0()||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(g.current)}},[]);function b(){localStorage.setItem(jh,"1"),s("dismissing"),g.current=setTimeout(()=>s("hidden"),200)}async function _(){if(m.current){await m.current.prompt();const{outcome:p}=await m.current.userChoice;p==="accepted"&&b(),m.current=null}else d0()&&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(rp,{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(gb,{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:_,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 p0(){const{t:i}=Vt(),[u,s]=y.useState(!1);return y.useEffect(()=>{if(!("serviceWorker"in navigator))return;let o=!1,f=null,m=null,g=null,b=null;function _(){o||s(!0)}navigator.serviceWorker.addEventListener("controllerchange",_);function p(k){if(f=k,k.waiting){s(!0);return}g=()=>{const N=k.installing;N&&(m=N,b=()=>{N.state==="installed"&&navigator.serviceWorker.controller&&(o||s(!0))},N.addEventListener("statechange",b))},k.addEventListener("updatefound",g)}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",_),f&&g&&f.removeEventListener("updatefound",g),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(ap,{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 qr=64,g0=96,Rh=32;function y0({children:i,className:u}){const s=y.useRef(null),o=y.useRef(0),f=y.useRef("idle"),[m,g]=y.useState(0),[b,_]=y.useState("idle"),p=y.useCallback(U=>{f.current=U,_(U)},[]),w=y.useCallback(()=>{const U=s.current;return U?U.scrollTop<=0:!0},[]),k=y.useCallback(U=>{if(!w()){o.current=0;return}o.current=U.touches[0].clientY},[w]),N=y.useCallback(U=>{if(f.current==="refreshing"||o.current===0)return;const X=U.touches[0].clientY-o.current;if(X<=0){f.current!=="idle"&&(g(0),p("idle"));return}if(!w())return;U.preventDefault();const ue=Math.min(X*.5,g0);g(ue),p(ue>=qr?"ready":"pulling")},[w,p]),Y=y.useCallback(()=>{f.current!=="refreshing"&&(f.current==="ready"?(p("refreshing"),g(qr),setTimeout(()=>{window.location.reload()},300)):(g(0),p("idle")),o.current=0)},[p]);y.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/qr,1),H=b==="refreshing"?0:m/qr*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 Rp=y.createContext({setActions:()=>{}});function tx(i){const{setActions:u}=y.useContext(Rp);y.useEffect(()=>(u(i),()=>u(null)),[i,u])}const Ap=y.createContext({setSubtitle:()=>{}});function ax(i){const{setSubtitle:u}=y.useContext(Ap),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;y.useEffect(()=>s?(u(o&&o!==s?{text:s,title:o}:s),()=>u(null)):(u(null),()=>u(null)),[s,o,u])}const _0=[{to:"/plan",label:"plan",icon:Ih},{to:"/review",label:"review",icon:Ph}],v0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:tp},{to:"/dashboard",label:"dashboard",icon:ep}],b0=[{to:"/workers",label:"workers",icon:lp},{to:"/projects",label:"projects",icon:ob},{to:"/access-tokens",label:"tokens",icon:cb}],x0=[{to:"/docs/cli",label:"cli",icon:$s},{to:"/docs/api",label:"api",icon:rb},{to:"/docs/bot",label:"bot",icon:hb},{to:"/docs/skill",label:"skill",icon:_b},{to:"/docs/all",label:"all",icon:fb}],S0=[{to:"/admin",label:"admin",icon:yb}],k0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:tp},{to:"/plan",label:"plan",icon:Ih},{to:"/review",label:"review",icon:Ph},{to:"/dashboard",label:"dashboard",icon:ep}],Lr={"/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"},"/plan":{title:"plan.title",subtitle:"plan.title"},"/review":{title:"review.title",subtitle:"review.title"},"/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 E0(i){const{t:u}=Vt();if(Lr[i]){const o=Lr[i];return{title:u(o.title),subtitle:u(o.subtitle)}}const s="/"+i.split("/").filter(Boolean)[0];if(Lr[s]){const o=Lr[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 w0(i,u){return i==="/home"?u==="/home":i==="/dashboard"?u==="/dashboard":u.startsWith(i)}function T0(){const i=yt(),{t:u}=Vt(),s={terminal:u("terminal_home.title"),dashboard:u("dashboard.title"),tasks:u("tasks.title"),workers:u("workers.title"),plan:u("plan.title"),review:u("review.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:[k0.map(({to:o,label:f,icon:m})=>{const g=w0(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:g?"text-[var(--accent)]":"text-[var(--text-muted)]"}),h.jsx("span",{className:`text-[11px] lowercase ${g?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),h.jsx(jp,{renderTrigger:o=>h.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[h.jsx(np,{size:18,className:"text-[var(--text-muted)]"}),h.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:u("common.search_placeholder")})]})})]})}function j0(){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(xb,{size:18})}),h.jsx(Ep,{}),h.jsx(dp,{})]})]})}function li({label:i,items:u,collapsed:s}){return h.jsxs("div",{className:"mt-4 first:mt-0",children:[h.jsx("div",{className:`overflow-hidden transition-all duration-300 ${s?"max-h-0 mb-0 opacity-0":"max-h-6 mb-2 opacity-100"}`,children:h.jsx("div",{className:"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:g})=>`flex items-center text-sm lowercase transition-all duration-300 ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${g?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:g})=>h.jsxs(h.Fragment,{children:[h.jsx(m,{size:14,style:{flexShrink:0}}),!s&&h.jsx("span",{children:g?`> ${f}`:` ${f}`})]})},o))]})}function R0(){const{user:i,logout:u}=xa(),s=Fa(),[o,f]=y.useState(!1),m=wb(),{t:g}=Vt(),{sidebarCollapsed:b,toggleSidebar:_}=jb();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:g("common.overlord")})]})}),h.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[h.jsx(li,{label:g("common.loop_section"),items:_0,collapsed:b}),h.jsx(li,{label:g("common.tasks_section"),items:v0,collapsed:b}),h.jsx(li,{label:g("common.fleet_section"),items:b0,collapsed:b}),h.jsx(li,{label:g("common.docs_section"),items:x0,collapsed:b}),m&&h.jsx(li,{label:g("common.admin_section"),items:S0,collapsed:b})]}),h.jsx("div",{className:"flex px-3 py-1",children:h.jsx("button",{onClick:_,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(nb,{size:14}):h.jsx(ab,{size:14})})}),h.jsx("div",{className:"border-t border-[var(--border)] p-3",children:h.jsxs("div",{className:`flex min-h-[44px] items-center px-3 transition-[gap] duration-300 ${b?"gap-0":"gap-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:g("common.profile"),children:((i==null?void 0:i.username)??"u")[0].toUpperCase()}),h.jsxs("div",{className:`flex min-w-0 flex-1 items-center overflow-hidden transition-[max-width,opacity] duration-300 ${b?"pointer-events-none max-w-0 opacity-0":"max-w-[calc(100%-28px)] opacity-100"}`,"aria-hidden":b,children:[h.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:g("common.profile"),tabIndex:b?-1:void 0,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:"ml-2 p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":g("common.log_out"),tabIndex:b?-1:void 0,children:h.jsx(mb,{size:14})})]})]})}),h.jsx(f0,{isOpen:o,onClose:()=>f(!1),onConfirm:p,title:g("common.logout_title"),message:g("common.logout_message"),confirmLabel:g("common.logout"),confirmVariant:"warning"})]})}function A0({headerActions:i,subtitleOverride:u}){const s=yt(),{title:o,subtitle:f}=E0(s.pathname),m=u??f,g=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}),g&&h.jsxs("span",{style:{color:"var(--text-muted)"},title:b,children:[" ","// ",Wh(g,40)]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[i,h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(jp,{}),h.jsx(Ep,{}),h.jsx(dp,{})]})]})]})}function z0(){const[i,u]=y.useState(null),[s,o]=y.useState(null),f=yt(),m=f.pathname==="/home",g=/^\/tasks\/\d+$/.test(f.pathname),b=f.pathname.startsWith("/docs");return y.useEffect(()=>sp.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(R0,{}),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(j0,{}),!b&&h.jsx(A0,{headerActions:i,subtitleOverride:s}),h.jsx(y0,{className:m||g?"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(Rp.Provider,{value:{setActions:u},children:h.jsx(Ap.Provider,{value:{setSubtitle:o},children:h.jsx(hv,{})})})}),h.jsx(h0,{}),h.jsx(p0,{}),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(T0,{})})]})]})}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 ii({children:i,requireAdmin:u=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:m}=xa(),g=yt();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(g),replace:!0});if(f){const b=Ah(g);return g.pathname!=="/totp-setup"&&g.pathname!=="/bind"?h.jsx(ll,{to:"/totp-setup",state:b,replace:!0}):g.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)!==up.ADMIN?h.jsx(ll,{to:"/home",replace:!0}):h.jsx(h.Fragment,{children:i})}function O0({children:i}){const{theme:u,resolved:s,setResolved:o}=fp();return y.useEffect(()=>{if(u!=="system"){o(u);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const m=g=>o(g.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[u,o]),y.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),h.jsx(h.Fragment,{children:i})}class C0 extends y.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:Yr("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)||Yr("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(ap,{className:"h-3.5 w-3.5"}),Yr("common.reload")]})]}):this.props.children}}function D0({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(db,{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 zp(){Bs.forEach(i=>i())}function N0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(i,u,s=4e3){const o=N0();return ba=[...ba,{id:o,variant:i,message:u,duration:s}],ba.length>zh&&(ba=ba.slice(ba.length-zh)),zp(),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 M0(i){ba=ba.filter(u=>u.id!==i),zp()}function U0(){const[,i]=y.useState(0);return y.useEffect(()=>{const u=()=>i(s=>s+1);return Bs.add(u),()=>{Bs.delete(u)}},[]),ba}const q0={success:{icon:lb,borderColor:"var(--accent)"},error:{icon:ib,borderColor:"var(--destructive)"},warning:{icon:ip,borderColor:"var(--warning)"},info:{icon:sb,borderColor:"var(--info)"}};function L0({item:i}){const u=q0[i.variant],s=u.icon,{t:o}=Vt(),f=y.useCallback(()=>M0(i.id),[i.id]);return y.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(rp,{className:"h-3.5 w-3.5"})})]})}function H0(){const i=U0();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(L0,{item:u})},u.id))})}const B0=y.lazy(()=>ae(()=>import("./LandingPage-YcgE-OTL.js"),__vite__mapDeps([0,1,2,3,4,5]))),Y0=y.lazy(()=>ae(()=>import("./LoginPage-F34Kt4ot.js"),[])),G0=y.lazy(()=>ae(()=>import("./TotpSetupPage-CI411-Y7.js"),[])),V0=y.lazy(()=>ae(()=>import("./NotFoundPage-DPZDwk1M.js"),[])),X0=y.lazy(()=>ae(()=>import("./HomePage-CQ0Upd0D.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),Q0=y.lazy(()=>ae(()=>import("./TerminalHomePage-CDr4Mq6o.js"),__vite__mapDeps([15,16,17,18,19,20,12,21,22,10,11,23,24,8,25,26,13,27,28,29]))),Z0=y.lazy(()=>ae(()=>import("./TaskListPage-CFri9wCk.js"),__vite__mapDeps([30,22,7,8,12,14,31,23,24,25,26,5,32,9,27,33,11]))),K0=y.lazy(()=>ae(()=>import("./TaskDetailPage-Beto_Zqp.js"),__vite__mapDeps([34,22,16,17,18,19,20,12,21,23,24,8,26,25,14,35,31,36,37,38]))),J0=y.lazy(()=>ae(()=>import("./PlanPage-Dds_7koM.js"),__vite__mapDeps([39,32,9,12,23,24,27,37,33,11]))),$0=y.lazy(()=>ae(()=>import("./ReviewPage-CNeCz2eT.js"),__vite__mapDeps([40,32,9,12,26,25,36]))),W0=y.lazy(()=>ae(()=>import("./ReviewAggregatePage-Dq3hl9db.js"),__vite__mapDeps([41,19,20,9,12,26,25,35,17,36,38,18,28,24]))),F0=y.lazy(()=>ae(()=>import("./WorkerListPage-nPKvREXn.js"),__vite__mapDeps([42,8,43,44,45,46,47,36,29,5,17,23,24,32,9,13,27,35]))),I0=y.lazy(()=>ae(()=>import("./WorkerDetailPage-DcMycoTh.js"),__vite__mapDeps([48,12,8,49,43,13,14,50,35]))),P0=y.lazy(()=>ae(()=>import("./WorkerSetupGuidePage-DHbju_7j.js"),__vite__mapDeps([44,45,46,47,36,29]))),e1=y.lazy(()=>ae(()=>import("./ProjectListPage-D62NmkBp.js"),__vite__mapDeps([51,23,24,26,32,9,12,13,27,35]))),t1=y.lazy(()=>ae(()=>import("./ProjectDetailPage-1mftEUqP.js"),__vite__mapDeps([52,53,23,24,14,12,8,49,13,54,50,35,27]))),a1=y.lazy(()=>ae(()=>import("./EditProjectPage-DKaSpnod.js"),__vite__mapDeps([55,23,24,53,26,27]))),n1=y.lazy(()=>ae(()=>import("./PipelineEditorPage-18u7wxjE.js"),__vite__mapDeps([56,23,24]))),l1=y.lazy(()=>ae(()=>import("./ProfilePage-D3YRdW9C.js"),__vite__mapDeps([57,58,49,13]))),i1=y.lazy(()=>ae(()=>import("./BindPlatformPage-Bp_NG22g.js"),[])),r1=y.lazy(()=>ae(()=>import("./AccessTokensPage-DsNgVUdv.js"),__vite__mapDeps([59,23,24,32,9,12,13,27,5,50]))),u1=y.lazy(()=>ae(()=>import("./CliReferencePage-BiUl0LtI.js"),__vite__mapDeps([60,61,5,62,27]))),o1=y.lazy(()=>ae(()=>import("./ApiReferencePage-DXNSPdww.js"),__vite__mapDeps([63,62,5,27]))),s1=y.lazy(()=>ae(()=>import("./SkillPage-BGYJMqPr.js"),__vite__mapDeps([64,61,5,37]))),c1=y.lazy(()=>ae(()=>import("./DocsLayout-CX3AKUlL.js"),__vite__mapDeps([65,35]))),f1=y.lazy(()=>ae(()=>import("./InstallationPage-0TO7IQzJ.js"),__vite__mapDeps([66,61,5]))),d1=y.lazy(()=>ae(()=>import("./DeveloperSetupPage-D3FDp-R7.js"),__vite__mapDeps([67,61,5]))),m1=y.lazy(()=>ae(()=>import("./WorkerSetupPage-D0Cob5nl.js"),__vite__mapDeps([68,61,5]))),h1=y.lazy(()=>ae(()=>import("./BotSetupPage-Ct_gjzJt.js"),__vite__mapDeps([69,61,5]))),p1=y.lazy(()=>ae(()=>import("./LocalDevelopmentPage-BDpTHWAo.js"),__vite__mapDeps([70,61,5]))),g1=y.lazy(()=>ae(()=>import("./WorkerOperationsPage-qgdLSK1X.js"),[])),y1=y.lazy(()=>ae(()=>import("./DeploymentPage-DtlH8d7p.js"),__vite__mapDeps([71,61,5]))),Oh=y.lazy(()=>ae(()=>import("./BotIntegrationPage-DuH_f_mp.js"),[])),_1=y.lazy(()=>ae(()=>import("./PipelineConfigPage-D5gx3bIv.js"),__vite__mapDeps([72,61,5]))),v1=y.lazy(()=>ae(()=>import("./DevWorkflowPage-BoZm03L7.js"),__vite__mapDeps([73,61,5]))),b1=y.lazy(()=>ae(()=>import("./PermissionsPage-DsNmsUoe.js"),[])),x1=y.lazy(()=>ae(()=>import("./EnvVariablesPage-C2nu-wxe.js"),__vite__mapDeps([74,61,5]))),S1=y.lazy(()=>ae(()=>import("./ArchitecturePage-DFUNHKTN.js"),__vite__mapDeps([75,61,5]))),k1=y.lazy(()=>ae(()=>import("./ChangelogPage-DrpgpyjK.js"),[])),E1=y.lazy(()=>ae(()=>import("./AgentCliPage-Bp8tQiWl.js"),__vite__mapDeps([76,61,5]))),w1=y.lazy(()=>ae(()=>import("./TaskGuidePage-CKnugDRu.js"),__vite__mapDeps([77,61,5]))),T1=y.lazy(()=>ae(()=>import("./DocsIndexPage-ZBDBTreg.js"),__vite__mapDeps([78,46,2,3,47,21]))),j1=y.lazy(()=>ae(()=>import("./AdminPage-NZC6yOHW.js"),__vite__mapDeps([79,4,2,80,47]))),R1=y.lazy(()=>ae(()=>import("./DeveloperManage-hoNX7J5P.js"),__vite__mapDeps([81,23,24,58,32,9,13,8,27,4,54,18]))),A1=y.lazy(()=>ae(()=>import("./BotManage-CJ5GZ0HR.js"),__vite__mapDeps([82,23,24,61,5,50,27,32,9,13,8,2,54]))),z1=y.lazy(()=>ae(()=>import("./TokenManage-BqOEJDHV.js"),__vite__mapDeps([83,45,5,37,32,9,13,8,27]))),O1=y.lazy(()=>ae(()=>import("./AuditLogPage-Wtpr8CDi.js"),__vite__mapDeps([84,23,24,32,9,80,33,11]))),C1=y.lazy(()=>ae(()=>import("./SettingsPage-Ml3L-j5R.js"),[]));function D1(){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 N1(){const i=xa(u=>u.sessionExpired);return h.jsxs(O0,{children:[h.jsx(H0,{}),h.jsx(C0,{children:h.jsxs(Yv,{children:[h.jsx(D0,{isOpen:i}),h.jsx(y.Suspense,{fallback:h.jsx(D1,{}),children:h.jsxs(gv,{children:[h.jsx(P,{path:"/",element:h.jsx(B0,{})}),h.jsx(P,{path:"/login",element:h.jsx(Y0,{})}),h.jsx(P,{path:"/totp-setup",element:h.jsx(ii,{children:h.jsx(G0,{})})}),h.jsx(P,{path:"/bind",element:h.jsx(ii,{children:h.jsx(i1,{})})}),h.jsxs(P,{element:h.jsx(ii,{children:h.jsx(z0,{})}),children:[h.jsx(P,{path:"/home",element:h.jsx(Q0,{})}),h.jsx(P,{path:"/dashboard",element:h.jsx(X0,{})}),h.jsx(P,{path:"/tasks",element:h.jsx(Z0,{})}),h.jsx(P,{path:"/tasks/:id",element:h.jsx(K0,{})}),h.jsx(P,{path:"/plan",element:h.jsx(J0,{})}),h.jsx(P,{path:"/review",element:h.jsx($0,{})}),h.jsx(P,{path:"/review/:sourceTaskId",element:h.jsx(W0,{})}),h.jsx(P,{path:"/workers",element:h.jsx(F0,{})}),h.jsx(P,{path:"/workers/setup",element:h.jsx(ii,{requireAdmin:!0,children:h.jsx(P0,{})})}),h.jsx(P,{path:"/workers/:id",element:h.jsx(I0,{})}),h.jsx(P,{path:"/projects",element:h.jsx(e1,{})}),h.jsx(P,{path:"/projects/:key",element:h.jsx(t1,{})}),h.jsx(P,{path:"/projects/:key/edit",element:h.jsx(a1,{})}),h.jsx(P,{path:"/projects/:key/pipeline",element:h.jsx(n1,{})}),h.jsx(P,{path:"/profile",element:h.jsx(l1,{})}),h.jsx(P,{path:"/access-tokens",element:h.jsx(r1,{})}),h.jsxs(P,{path:"/docs",element:h.jsx(c1,{}),children:[h.jsx(P,{index:!0,element:h.jsx(ll,{to:"cli",replace:!0})}),h.jsx(P,{path:"cli",element:h.jsx(u1,{})}),h.jsx(P,{path:"api",element:h.jsx(o1,{})}),h.jsx(P,{path:"bot",element:h.jsx(Oh,{})}),h.jsx(P,{path:"all",element:h.jsx(T1,{})}),h.jsx(P,{path:"skill",element:h.jsx(s1,{})}),h.jsx(P,{path:"installation",element:h.jsx(f1,{})}),h.jsx(P,{path:"developer-setup",element:h.jsx(d1,{})}),h.jsx(P,{path:"worker-setup",element:h.jsx(m1,{})}),h.jsx(P,{path:"bot-setup",element:h.jsx(h1,{})}),h.jsx(P,{path:"local-development",element:h.jsx(p1,{})}),h.jsx(P,{path:"worker-operations",element:h.jsx(g1,{})}),h.jsx(P,{path:"deployment",element:h.jsx(y1,{})}),h.jsx(P,{path:"bot-integration",element:h.jsx(Oh,{})}),h.jsx(P,{path:"pipeline-config",element:h.jsx(_1,{})}),h.jsx(P,{path:"dev-workflow",element:h.jsx(v1,{})}),h.jsx(P,{path:"permissions",element:h.jsx(b1,{})}),h.jsx(P,{path:"env-variables",element:h.jsx(x1,{})}),h.jsx(P,{path:"architecture",element:h.jsx(S1,{})}),h.jsx(P,{path:"task-guide",element:h.jsx(w1,{})}),h.jsx(P,{path:"agent-cli",element:h.jsx(E1,{})}),h.jsx(P,{path:"changelog",element:h.jsx(k1,{})})]}),h.jsxs(P,{path:"/admin",element:h.jsx(ii,{requireAdmin:!0,children:h.jsx(j1,{})}),children:[h.jsx(P,{index:!0,element:h.jsx(ll,{to:"developers",replace:!0})}),h.jsx(P,{path:"developers",element:h.jsx(R1,{})}),h.jsx(P,{path:"bots",element:h.jsx(A1,{})}),h.jsx(P,{path:"tokens",element:h.jsx(z1,{})}),h.jsx(P,{path:"audit-logs",element:h.jsx(O1,{})}),h.jsx(P,{path:"settings",element:h.jsx(C1,{})})]})]}),h.jsx(P,{path:"*",element:h.jsx(V0,{})})]})})]})})]})}function Op(i=window){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}async function M1(i=window,u="portrait"){var o,f;if(!Op(i))return!1;const s=(f=(o=i.screen)==null?void 0:o.orientation)==null?void 0:f.lock;if(typeof s!="function")return!1;try{return await s.call(i.screen.orientation,u),!0}catch{return!1}}function U1(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 q1(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 L1(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 H1(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 B1(i=window,u=document){const s=u.documentElement,o=i.visualViewport??null;let f=-1;const m=()=>{const g=Math.round((o==null?void 0:o.height)??0),b=Math.round(i.innerHeight);let _=g>0?g:b;if(U1(i)&&q1(i)&&!L1(u)){const p=H1(i);p!==null&&(_=Math.max(_,b,p))}_!==f&&(f=_,s.style.setProperty("--app-height",`${_}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();B1(window,document);const Cp=window,Y1=Op(Cp);M1(Cp);if(Y1){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"]})}h_.createRoot(document.getElementById("root")).render(h.jsx(y.StrictMode,{children:h.jsx(N1,{})}));export{f_ as $,V1 as A,X1 as B,tb as C,up as D,Ph as E,lb as F,W1 as G,Ns as H,db as I,ib as J,rb as K,Jh as L,hb as M,ll as N,Ih as O,h0 as P,J1 as Q,Ar as R,lp as S,dp as T,xb as U,ip as V,Z1 as W,rp as X,sb as Y,K1 as Z,ap as _,Vt as a,Wh as a0,cb as a1,mb as a2,$1 as a3,_b as a4,Js as a5,hv as a6,F1 as a7,I1 as a8,$s as b,_e as c,yb as d,fb as e,Fa as f,yt as g,Qr as h,wb as i,h as j,sp as k,wp as l,Tp as m,r0 as n,Ir as o,Q1 as p,ax as q,y as r,ex as s,Wa as t,xa as u,f0 as v,tx as w,np as x,tp as y,P1 as z};
252
+ "{description}"`},plan:{title:"plan",create:"create plan",description_placeholder:"describe what you want to build...",spec_generated:"spec generated",decompose:"decompose into tasks",save_only:"save spec only",no_plans:"no plan tasks yet",view_spec:"view spec"},review:{title:"review",pending:"pending review",in_progress:"in progress",history:"history",launch:"launch review",launch_short:"review",select_agents:"select review agents",approve_fix:"fix issues",skip_fix:"no fix needed",review_again:"review again",round:"round",no_reviews:"no reviews yet",issues_summary:"{critical} critical · {warning} warning · {suggestion} suggestion",description_placeholder:"review instructions (optional)...",empty_report_warning:"review completed but no structured report was produced. check the terminal output for details.",fix_push_info:"selected agent will push fixes to the source branch",waiting_agents:"waiting for review agents to finish...",skip_fix_label:"review only (skip fix stage)"}};function Ob(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 Cb(i,u){return u?i.replace(/\{(\w+)\}/g,(s,o)=>u[o]!=null?String(u[o]):`{${o}}`):i}function Yr(i,u){return Cb(Ob(zb,i),u)}function Vt(){return{t:y.useCallback((u,s)=>Yr(u,s),[])}}function dp(){const{theme:i,setTheme:u}=fp(),{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(bb,{size:16}):h.jsx(pb,{size:16})})}class Ns extends Error{constructor(s,o,f){const m=s.status||s.status===0?s.status:"",g=s.statusText??"",b=`${m} ${g}`.trim(),_=b?`status code ${b}`:"an unknown error";super(`Request failed with ${_}: ${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 mp 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 As extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new mp(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})(),Db=typeof globalThis.AbortController=="function",hp=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Nb=typeof globalThis.ReadableStream=="function",Mb=typeof globalThis.FormData=="function",pp=["get","post","put","patch","head","delete"],Ub={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},zs=2147483647,qb=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,gp=Symbol("stop");class yp{constructor(u){Ve(this,"options");this.options=u}}const Lb=i=>new yp(i),Hb={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},Bb={next:!0},Yb={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},Gb=i=>{if(!i)return 0;if(i instanceof FormData){let u=0;for(const[s,o]of i)u+=qb,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,g){if(g.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))}}))},Vb=(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})},Xb=(i,u,s)=>{if(!i.body)return i;const o=Gb(s??i.body);return new Request(i,{duplex:"half",body:_p(i.body,o,u)})},_n=i=>i!==null&&typeof i=="object",Nr=(...i)=>{for(const u of i)if((!_n(u)||Array.isArray(u))&&u!==void 0)throw new TypeError("The `options` argument must be an object");return Ws({},...i)},vp=(i={},u={})=>{const s=new globalThis.Headers(i),o=u instanceof globalThis.Headers,f=new globalThis.Headers(u);for(const[m,g]of f.entries())o&&g==="undefined"||g===void 0?s.delete(m):s.set(m,g);return s};function Mr(i,u,s){return Object.hasOwn(u,s)&&u[s]===void 0?[]:Ws(i[s]??[],u[s]??[])}const bp=(i={},u={})=>({beforeRequest:Mr(i,u,"beforeRequest"),beforeRetry:Mr(i,u,"beforeRetry"),afterResponse:Mr(i,u,"afterResponse"),beforeError:Mr(i,u,"beforeError")}),Qb=(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(_n(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,g]of f.entries())s.append(m,g)}return s},Ws=(...i)=>{let u={},s={},o={},f;const m=[];for(const g of i)if(Array.isArray(g))Array.isArray(u)||(u=[]),u=[...u,...g];else if(_n(g)){for(let[b,_]of Object.entries(g)){if(b==="signal"&&_ instanceof globalThis.AbortSignal){m.push(_);continue}if(b==="context"){if(_!=null&&(!_n(_)||Array.isArray(_)))throw new TypeError("The `context` option must be an object");u={...u,context:_==null?{}:{...u.context,..._}};continue}if(b==="searchParams"){_==null?f=void 0:f=f===void 0?_:Qb(f,_);continue}_n(_)&&b in u&&(_=Ws(u[b],_)),u={...u,[b]:_}}_n(g.hooks)&&(o=bp(o,g.hooks),u.hooks=o),_n(g.headers)&&(s=vp(s,g.headers),u.headers=s)}return f!==void 0&&(u.searchParams=f),m.length>0&&(m.length===1?u.signal=m[0]:hp?u.signal=AbortSignal.any(m):u.signal=m.at(-1)),u},Zb=i=>pp.includes(i)?i.toUpperCase():i,Kb=["get","put","head","delete","options","trace"],Jb=[408,413,429,500,502,503,504],$b=[413,429,503],kh={limit:2,methods:Kb,statusCodes:Jb,afterStatusCodes:$b,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:i=>.3*2**(i-1)*1e3,jitter:void 0,retryOnTimeout:!1},Wb=(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 Fb(i,u,s,o){return new Promise((f,m)=>{const g=setTimeout(()=>{s&&s.abort(),m(new Ms(i))},o.timeout);o.fetch(i,u).then(f).catch(m).then(()=>{clearTimeout(g)})})}async function Ib(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 Pb=(i,u)=>{const s={};for(const o in u)Object.hasOwn(u,o)&&!(o in Yb)&&!(o in Hb)&&(!(o in i)||o in Bb)&&(s[o]=u[o]);return s},e0=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 t0(i){return i instanceof Ns||(i==null?void 0:i.name)===Ns.name}function a0(i){return i instanceof Ms||(i==null?void 0:i.name)===Ms.name}var Jr,xp,Jt,Bt,rt,Q,$a,ea,vn,oe,Gr,Sp,Us,Vr,Ja,qs,kp,ri,Xr,Ls;const ui=class ui{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,g;if(Kt(this,rt,u),Kt(this,Q,{...s,headers:vp(q(this,rt).headers,s.headers),hooks:bp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Zb(s.method??q(this,rt).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:Wb(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))}Db&&hp&&(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&&(Mb&&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)),e0(q(this,Q).searchParams)){const _="?"+(typeof q(this,Q).searchParams=="string"?q(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ke(g=ui,Jr,xp).call(g,q(this,Q).searchParams)).toString()),p=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,_);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 g,b,_;const o=new ui(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>zs)throw new RangeError(`The \`timeout\` option cannot be greater than ${zs}`);await Promise.resolve();let p=await ke(w=o,oe,kp).call(w);for(const ge of q(o,Q).hooks.afterResponse){const F=ke(k=o,oe,Us).call(k,p.clone());let W;try{W=await ge(o.request,ke(N=o,oe,ri).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 yp)throw ke(H=o,oe,Ja).call(H,F),ke(B=o,oe,Ja).call(B,p),new As(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 ge=new Ns(p,o.request,ke(ue=o,oe,ri).call(ue));for(const F of q(o,Q).hooks.beforeError)ge=await F(ge,{retryCount:q(o,Bt)});throw ge}if(q(o,Q).onDownloadProgress){if(typeof q(o,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Nb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const ge=p.clone();return ke(ce=o,oe,Ja).call(ce,p),Vb(ge,q(o,Q).onDownloadProgress)}return p},m=ke(g=o,oe,qs).call(g,f).finally(()=>{var w,k;const p=q(o,$a);ke(w=o,oe,Vr).call(w,(p==null?void 0:p.body)??void 0),ke(k=o,oe,Vr).call(k,o.request.body??void 0)});for(const[p,w]of Object.entries(Ub))p==="bytes"&&typeof((_=(b=globalThis.Response)==null?void 0:b.prototype)==null?void 0:_.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}};Jr=new WeakSet,xp=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,Gr=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)},Sp=async function(u){if(eh(this,Bt)._++,q(this,Bt)>q(this,Q).retry.limit)throw u;const s=u instanceof Error?u:new mp(u);if(s instanceof As)return s.customDelay??ke(this,oe,Gr).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,Gr).call(this)}if(a0(u)&&!q(this,Q).retry.retryOnTimeout)throw u;if(t0(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,Gr).call(this)},Us=function(u){return q(this,Q).parseJson&&(u.json=async()=>q(this,Q).parseJson(await u.text())),u},Vr=function(u){u&&u.cancel().catch(()=>{})},Ja=function(u){ke(this,oe,Vr).call(this,u.body??void 0)},qs=async function(u){try{return await u()}catch(s){const o=Math.min(await ke(this,oe,Sp).call(this,s),zs);if(q(this,Bt)<1)throw s;if(await Ib(o,q(this,ea)?{signal:q(this,ea)}:{}),s instanceof As&&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,Xr).call(this,f)}for(const f of q(this,Q).hooks.beforeRetry){const m=await f({request:this.request,options:ke(this,oe,ri).call(this),error:s,retryCount:q(this,Bt)});if(m instanceof globalThis.Request){ke(this,oe,Xr).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===gp)return}return ke(this,oe,qs).call(this,u)}},kp=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,ri).call(this),{retryCount:q(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ke(this,oe,Xr).call(this,f);break}}const u=Pb(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):Fb(q(this,$a),u,q(this,Jt),q(this,Q))},ri=function(){if(!q(this,vn)){const{hooks:u,...s}=q(this,Q);Kt(this,vn,Object.freeze(s))}return q(this,vn)},Xr=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:Xb(u,q(this,Q).onUploadProgress,s??q(this,Q).body??void 0)},Pt(ui,Jr);let Kr=ui;/*! MIT License © Sindre Sorhus */const Hs=i=>{const u=(s,o)=>Kr.create(s,Nr(i,o));for(const s of pp)u[s]=(o,f)=>Kr.create(o,Nr(i,f,{method:s}));return u.create=s=>Hs(Nr(s)),u.extend=s=>(typeof s=="function"&&(s=s(i??{})),Hs(Nr(i,s))),u.stop=gp,u.retry=Lb,u},Eh=Hs();let Ur=null;const Qr=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")){Ur||(Ur=xa.getState().refresh().finally(()=>{Ur=null}));try{await Ur}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)}}]}}),n0=3e4;function l0(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 Ep(){const i=Fa(),[u,s]=y.useState([]),[o,f]=y.useState(0),[m,g]=y.useState(!1),[b,_]=y.useState(!1),p=y.useRef(null),{t:w}=Vt(),k=y.useRef(async()=>{try{_(!0);const H=(await Qr.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{_(!1)}});y.useEffect(()=>{k.current();const L=setInterval(()=>k.current(),n0);return()=>clearInterval(L)},[]),y.useEffect(()=>{function L(H){p.current&&!p.current.contains(H.target)&&g(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);async function N(L){try{await Qr.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 Qr.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:()=>g(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(Pv,{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(eb,{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=l0(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),g(!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(tb,{className:"h-3.5 w-3.5"})})]},L.id)})})]})]})}function i0(i){return i&&i.trim().length>0?i:null}function wp(i,u=50){return i0(i.name)??Wh(i.description,u)}function Tp(i){return`#${i.id} ${i.description}`}function P1(i,u=100){return{text:`#${i.id} ${wp(i,u)}`,title:Tp(i)}}function r0(i){return{tasks:i.tasks.map(u=>({type:"task",id:u.id,title:`#${u.id} ${wp(u)}`,subtitle:`${u.status} · ${u.project_key}`,hoverTitle:Tp(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 u0=300,wh={tasks:vb,workers:lp,projects:ub},o0={tasks:"tasks",workers:"workers",projects:"projects"};function jp({renderTrigger:i}={}){const[u,s]=y.useState(""),[o,f]=y.useState({tasks:[],workers:[],projects:[]}),[m,g]=y.useState(!1),[b,_]=y.useState(!1),[p,w]=y.useState(0),k=y.useRef(null),N=y.useRef(null),Y=y.useRef(void 0),L=y.useRef(void 0),H=Fa(),{t:B}=Vt(),U=y.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),K=y.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{g(!0);const Je=await Qr.get("web/search",{searchParams:{q:W},signal:se.signal}).json();f(r0(Je)),w(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{se.signal.aborted||g(!1)}},[]);y.useEffect(()=>(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>K(u),u0),()=>{Y.current&&clearTimeout(Y.current)}),[u,K]),y.useEffect(()=>{function W(se){se.key==="/"&&!b&&!(se.target instanceof HTMLInputElement||se.target instanceof HTMLTextAreaElement)&&(se.preventDefault(),_(!0)),se.key==="Escape"&&b&&(se.preventDefault(),X())}return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[b]),y.useEffect(()=>{b&&setTimeout(()=>{var W;return(W=N.current)==null?void 0:W.focus()},50)},[b]);function X(){_(!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 ge=U.length>0;let F=0;return h.jsxs(h.Fragment,{children:[i?i(()=>_(!0)):h.jsxs("button",{type:"button",onClick:()=>_(!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(np,{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()&&!ge&&!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:o0[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 s0={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 c0({isOpen:i,onClose:u,onConfirm:s,title:o,message:f,confirmLabel:m,cancelLabel:g,confirmVariant:b="danger",isLoading:_,children:p}){const{t:w}=Vt(),k=y.useId(),N=m??w("common.confirm"),Y=g??w("common.cancel"),L=y.useRef(null),H=y.useRef(null),B=s0[b];y.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=y.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(ip,{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:_,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:_?"not-allowed":"pointer",opacity:_?.7:1,transition:"color 0.15s, border-color 0.15s"},children:Y}),h.jsx("button",{type:"button",onClick:s,disabled:_,style:{flex:1,padding:"0.5rem",backgroundColor:B,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:_?"not-allowed":"pointer",opacity:_?.7:1},children:_?w("common.processing"):N})]})]})}):null}const jh="overlord-pwa-install-dismissed";function f0(){const i=navigator.userAgent;return/iP(hone|od|ad)/.test(i)&&/WebKit/.test(i)&&!/(CriOS|FxiOS|OPiOS|mercury)/.test(i)}function d0(){return navigator.standalone===!0||window.matchMedia("(display-mode: standalone)").matches}function m0(){const{t:i}=Vt(),[u,s]=y.useState("hidden"),[o,f]=y.useState(!1),m=y.useRef(null),g=y.useRef(void 0);y.useEffect(()=>{if(d0()||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(g.current)}},[]);function b(){localStorage.setItem(jh,"1"),s("dismissing"),g.current=setTimeout(()=>s("hidden"),200)}async function _(){if(m.current){await m.current.prompt();const{outcome:p}=await m.current.userChoice;p==="accepted"&&b(),m.current=null}else f0()&&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(rp,{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(gb,{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:_,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 h0(){const{t:i}=Vt(),[u,s]=y.useState(!1);return y.useEffect(()=>{if(!("serviceWorker"in navigator))return;let o=!1,f=null,m=null,g=null,b=null;function _(){o||s(!0)}navigator.serviceWorker.addEventListener("controllerchange",_);function p(k){if(f=k,k.waiting){s(!0);return}g=()=>{const N=k.installing;N&&(m=N,b=()=>{N.state==="installed"&&navigator.serviceWorker.controller&&(o||s(!0))},N.addEventListener("statechange",b))},k.addEventListener("updatefound",g)}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",_),f&&g&&f.removeEventListener("updatefound",g),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(ap,{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 qr=64,p0=96,Rh=32;function g0({children:i,className:u}){const s=y.useRef(null),o=y.useRef(0),f=y.useRef("idle"),[m,g]=y.useState(0),[b,_]=y.useState("idle"),p=y.useCallback(U=>{f.current=U,_(U)},[]),w=y.useCallback(()=>{const U=s.current;return U?U.scrollTop<=0:!0},[]),k=y.useCallback(U=>{if(!w()){o.current=0;return}o.current=U.touches[0].clientY},[w]),N=y.useCallback(U=>{if(f.current==="refreshing"||o.current===0)return;const X=U.touches[0].clientY-o.current;if(X<=0){f.current!=="idle"&&(g(0),p("idle"));return}if(!w())return;U.preventDefault();const ue=Math.min(X*.5,p0);g(ue),p(ue>=qr?"ready":"pulling")},[w,p]),Y=y.useCallback(()=>{f.current!=="refreshing"&&(f.current==="ready"?(p("refreshing"),g(qr),setTimeout(()=>{window.location.reload()},300)):(g(0),p("idle")),o.current=0)},[p]);y.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/qr,1),H=b==="refreshing"?0:m/qr*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 Rp=y.createContext({setActions:()=>{}});function ex(i){const{setActions:u}=y.useContext(Rp);y.useEffect(()=>(u(i),()=>u(null)),[i,u])}const Ap=y.createContext({setSubtitle:()=>{}});function tx(i){const{setSubtitle:u}=y.useContext(Ap),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;y.useEffect(()=>s?(u(o&&o!==s?{text:s,title:o}:s),()=>u(null)):(u(null),()=>u(null)),[s,o,u])}const y0=[{to:"/plan",label:"plan",icon:Ih},{to:"/review",label:"review",icon:Ph}],_0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:tp},{to:"/dashboard",label:"dashboard",icon:ep}],v0=[{to:"/workers",label:"workers",icon:lp},{to:"/projects",label:"projects",icon:ob},{to:"/access-tokens",label:"tokens",icon:cb}],b0=[{to:"/docs/cli",label:"cli",icon:$s},{to:"/docs/api",label:"api",icon:rb},{to:"/docs/bot",label:"bot",icon:hb},{to:"/docs/skill",label:"skill",icon:_b},{to:"/docs/all",label:"all",icon:fb}],x0=[{to:"/admin",label:"admin",icon:yb}],S0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:tp},{to:"/plan",label:"plan",icon:Ih},{to:"/review",label:"review",icon:Ph},{to:"/dashboard",label:"dashboard",icon:ep}],Lr={"/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"},"/plan":{title:"plan.title",subtitle:"plan.title"},"/review":{title:"review.title",subtitle:"review.title"},"/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 k0(i){const{t:u}=Vt();if(Lr[i]){const o=Lr[i];return{title:u(o.title),subtitle:u(o.subtitle)}}const s="/"+i.split("/").filter(Boolean)[0];if(Lr[s]){const o=Lr[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 E0(i,u){return i==="/home"?u==="/home":i==="/dashboard"?u==="/dashboard":u.startsWith(i)}function w0(){const i=yt(),{t:u}=Vt(),s={terminal:u("terminal_home.title"),dashboard:u("dashboard.title"),tasks:u("tasks.title"),workers:u("workers.title"),plan:u("plan.title"),review:u("review.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:[S0.map(({to:o,label:f,icon:m})=>{const g=E0(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:g?"text-[var(--accent)]":"text-[var(--text-muted)]"}),h.jsx("span",{className:`text-[11px] lowercase ${g?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),h.jsx(jp,{renderTrigger:o=>h.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[h.jsx(np,{size:18,className:"text-[var(--text-muted)]"}),h.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:u("common.search_placeholder")})]})})]})}function T0(){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(xb,{size:18})}),h.jsx(Ep,{}),h.jsx(dp,{})]})]})}function li({label:i,items:u,collapsed:s}){return h.jsxs("div",{className:"mt-4 first:mt-0",children:[h.jsx("div",{className:`overflow-hidden transition-all duration-300 ${s?"max-h-0 mb-0 opacity-0":"max-h-6 mb-2 opacity-100"}`,children:h.jsx("div",{className:"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:g})=>`flex items-center text-sm lowercase transition-all duration-300 ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${g?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:g})=>h.jsxs(h.Fragment,{children:[h.jsx(m,{size:14,style:{flexShrink:0}}),!s&&h.jsx("span",{children:g?`> ${f}`:` ${f}`})]})},o))]})}function j0(){const{user:i,logout:u}=xa(),s=Fa(),[o,f]=y.useState(!1),m=wb(),{t:g}=Vt(),{sidebarCollapsed:b,toggleSidebar:_}=jb();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:g("common.overlord")})]})}),h.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[h.jsx(li,{label:g("common.loop_section"),items:y0,collapsed:b}),h.jsx(li,{label:g("common.tasks_section"),items:_0,collapsed:b}),h.jsx(li,{label:g("common.fleet_section"),items:v0,collapsed:b}),h.jsx(li,{label:g("common.docs_section"),items:b0,collapsed:b}),m&&h.jsx(li,{label:g("common.admin_section"),items:x0,collapsed:b})]}),h.jsx("div",{className:"flex px-3 py-1",children:h.jsx("button",{onClick:_,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(nb,{size:14}):h.jsx(ab,{size:14})})}),h.jsx("div",{className:"border-t border-[var(--border)] p-3",children:h.jsxs("div",{className:`flex min-h-[44px] items-center px-3 transition-[gap] duration-300 ${b?"gap-0":"gap-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:g("common.profile"),children:((i==null?void 0:i.username)??"u")[0].toUpperCase()}),h.jsxs("div",{className:`flex min-w-0 flex-1 items-center overflow-hidden transition-[max-width,opacity] duration-300 ${b?"pointer-events-none max-w-0 opacity-0":"max-w-[calc(100%-28px)] opacity-100"}`,"aria-hidden":b,children:[h.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:g("common.profile"),tabIndex:b?-1:void 0,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:"ml-2 p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":g("common.log_out"),tabIndex:b?-1:void 0,children:h.jsx(mb,{size:14})})]})]})}),h.jsx(c0,{isOpen:o,onClose:()=>f(!1),onConfirm:p,title:g("common.logout_title"),message:g("common.logout_message"),confirmLabel:g("common.logout"),confirmVariant:"warning"})]})}function R0({headerActions:i,subtitleOverride:u}){const s=yt(),{title:o,subtitle:f}=k0(s.pathname),m=u??f,g=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}),g&&h.jsxs("span",{style:{color:"var(--text-muted)"},title:b,children:[" ","// ",Wh(g,40)]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[i,h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(jp,{}),h.jsx(Ep,{}),h.jsx(dp,{})]})]})]})}function A0(){const[i,u]=y.useState(null),[s,o]=y.useState(null),f=yt(),m=f.pathname==="/home",g=/^\/tasks\/\d+$/.test(f.pathname),b=f.pathname.startsWith("/docs");return y.useEffect(()=>sp.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(j0,{}),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(T0,{}),!b&&h.jsx(R0,{headerActions:i,subtitleOverride:s}),h.jsx(g0,{className:m||g?"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(Rp.Provider,{value:{setActions:u},children:h.jsx(Ap.Provider,{value:{setSubtitle:o},children:h.jsx(hv,{})})})}),h.jsx(m0,{}),h.jsx(h0,{}),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(w0,{})})]})]})}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 ii({children:i,requireAdmin:u=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:m}=xa(),g=yt();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(g),replace:!0});if(f){const b=Ah(g);return g.pathname!=="/totp-setup"&&g.pathname!=="/bind"?h.jsx(ll,{to:"/totp-setup",state:b,replace:!0}):g.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)!==up.ADMIN?h.jsx(ll,{to:"/home",replace:!0}):h.jsx(h.Fragment,{children:i})}function z0({children:i}){const{theme:u,resolved:s,setResolved:o}=fp();return y.useEffect(()=>{if(u!=="system"){o(u);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const m=g=>o(g.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[u,o]),y.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),h.jsx(h.Fragment,{children:i})}class O0 extends y.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:Yr("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)||Yr("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(ap,{className:"h-3.5 w-3.5"}),Yr("common.reload")]})]}):this.props.children}}function C0({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(db,{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 zp(){Bs.forEach(i=>i())}function D0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(i,u,s=4e3){const o=D0();return ba=[...ba,{id:o,variant:i,message:u,duration:s}],ba.length>zh&&(ba=ba.slice(ba.length-zh)),zp(),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 N0(i){ba=ba.filter(u=>u.id!==i),zp()}function M0(){const[,i]=y.useState(0);return y.useEffect(()=>{const u=()=>i(s=>s+1);return Bs.add(u),()=>{Bs.delete(u)}},[]),ba}const U0={success:{icon:lb,borderColor:"var(--accent)"},error:{icon:ib,borderColor:"var(--destructive)"},warning:{icon:ip,borderColor:"var(--warning)"},info:{icon:sb,borderColor:"var(--info)"}};function q0({item:i}){const u=U0[i.variant],s=u.icon,{t:o}=Vt(),f=y.useCallback(()=>N0(i.id),[i.id]);return y.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(rp,{className:"h-3.5 w-3.5"})})]})}function L0(){const i=M0();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(q0,{item:u})},u.id))})}const H0=y.lazy(()=>ae(()=>import("./LandingPage-CaYr_-RD.js"),__vite__mapDeps([0,1,2,3,4,5]))),B0=y.lazy(()=>ae(()=>import("./LoginPage-D17Mq8Qe.js"),[])),Y0=y.lazy(()=>ae(()=>import("./TotpSetupPage-B9IghCSA.js"),[])),G0=y.lazy(()=>ae(()=>import("./NotFoundPage-BTlUFX7F.js"),[])),V0=y.lazy(()=>ae(()=>import("./HomePage-CkiXfp2H.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),X0=y.lazy(()=>ae(()=>import("./TerminalHomePage-CgZYHN7Y.js"),__vite__mapDeps([15,16,17,18,19,20,12,21,22,10,11,23,24,8,25,26,13,27,28,29]))),Q0=y.lazy(()=>ae(()=>import("./TaskListPage-CL98Ev5l.js"),__vite__mapDeps([30,22,7,8,12,14,31,23,24,25,26,5,32,9,27,33,11]))),Z0=y.lazy(()=>ae(()=>import("./TaskDetailPage-BAnCb9zv.js"),__vite__mapDeps([34,22,16,17,18,19,20,12,21,23,24,8,26,25,14,35,31,36,37,38]))),K0=y.lazy(()=>ae(()=>import("./PlanPage-CMQs2Hiz.js"),__vite__mapDeps([39,32,9,12,23,24,27,37,33,11]))),J0=y.lazy(()=>ae(()=>import("./ReviewPage-DzNkeQXP.js"),__vite__mapDeps([40,32,9,23,24,12,14,26,25,36,33,11]))),$0=y.lazy(()=>ae(()=>import("./ReviewAggregatePage-DHUyVVeT.js"),__vite__mapDeps([41,19,20,9,12,26,25,35,17,36,38,18,28,24]))),W0=y.lazy(()=>ae(()=>import("./WorkerListPage-B4aOYXSX.js"),__vite__mapDeps([42,8,43,44,45,46,47,36,29,5,17,23,24,32,9,13,27,35]))),F0=y.lazy(()=>ae(()=>import("./WorkerDetailPage-D0Vz2Z_J.js"),__vite__mapDeps([48,12,8,49,43,13,14,50,35]))),I0=y.lazy(()=>ae(()=>import("./WorkerSetupGuidePage-Chgd3lOw.js"),__vite__mapDeps([44,45,46,47,36,29]))),P0=y.lazy(()=>ae(()=>import("./ProjectListPage-QM4505IY.js"),__vite__mapDeps([51,23,24,26,32,9,12,13,27,35]))),e1=y.lazy(()=>ae(()=>import("./ProjectDetailPage-CRHNrgPt.js"),__vite__mapDeps([52,53,23,24,14,12,8,49,13,54,50,35,27]))),t1=y.lazy(()=>ae(()=>import("./EditProjectPage-CepF7mnT.js"),__vite__mapDeps([55,23,24,53,26,27]))),a1=y.lazy(()=>ae(()=>import("./PipelineEditorPage-CuSW0B-0.js"),__vite__mapDeps([56,23,24]))),n1=y.lazy(()=>ae(()=>import("./ProfilePage-BRxrQCQd.js"),__vite__mapDeps([57,58,49,13]))),l1=y.lazy(()=>ae(()=>import("./BindPlatformPage-DQEP-N9z.js"),[])),i1=y.lazy(()=>ae(()=>import("./AccessTokensPage-BSxprw7x.js"),__vite__mapDeps([59,23,24,32,9,12,13,27,5,50]))),r1=y.lazy(()=>ae(()=>import("./CliReferencePage-Dy78S9h1.js"),__vite__mapDeps([60,61,5,62,27]))),u1=y.lazy(()=>ae(()=>import("./ApiReferencePage-Cc_-lPFn.js"),__vite__mapDeps([63,62,5,27]))),o1=y.lazy(()=>ae(()=>import("./SkillPage-BQto2TJm.js"),__vite__mapDeps([64,61,5,37]))),s1=y.lazy(()=>ae(()=>import("./DocsLayout-BdWlFJ_G.js"),__vite__mapDeps([65,35]))),c1=y.lazy(()=>ae(()=>import("./InstallationPage-CF8j4Y-C.js"),__vite__mapDeps([66,61,5]))),f1=y.lazy(()=>ae(()=>import("./DeveloperSetupPage-D3RvWqx0.js"),__vite__mapDeps([67,61,5]))),d1=y.lazy(()=>ae(()=>import("./WorkerSetupPage-DOy5dzpL.js"),__vite__mapDeps([68,61,5]))),m1=y.lazy(()=>ae(()=>import("./BotSetupPage-kJHd4z6w.js"),__vite__mapDeps([69,61,5]))),h1=y.lazy(()=>ae(()=>import("./LocalDevelopmentPage-HIFhYvHJ.js"),__vite__mapDeps([70,61,5]))),p1=y.lazy(()=>ae(()=>import("./WorkerOperationsPage-Du5dUuwe.js"),[])),g1=y.lazy(()=>ae(()=>import("./DeploymentPage-CaIslw2W.js"),__vite__mapDeps([71,61,5]))),Oh=y.lazy(()=>ae(()=>import("./BotIntegrationPage-DP1ipK65.js"),[])),y1=y.lazy(()=>ae(()=>import("./PipelineConfigPage-BTy8cOFI.js"),__vite__mapDeps([72,61,5]))),_1=y.lazy(()=>ae(()=>import("./DevWorkflowPage-DjmFkvCo.js"),__vite__mapDeps([73,61,5]))),v1=y.lazy(()=>ae(()=>import("./PermissionsPage-Dj27JR_m.js"),[])),b1=y.lazy(()=>ae(()=>import("./EnvVariablesPage-DxRT4ql6.js"),__vite__mapDeps([74,61,5]))),x1=y.lazy(()=>ae(()=>import("./ArchitecturePage-CpXl4jb3.js"),__vite__mapDeps([75,61,5]))),S1=y.lazy(()=>ae(()=>import("./ChangelogPage-QheUxtEJ.js"),[])),k1=y.lazy(()=>ae(()=>import("./AgentCliPage-DxZUrhjz.js"),__vite__mapDeps([76,61,5]))),E1=y.lazy(()=>ae(()=>import("./TaskGuidePage-Bs-Unzck.js"),__vite__mapDeps([77,61,5]))),w1=y.lazy(()=>ae(()=>import("./DocsIndexPage-BHnvOEn8.js"),__vite__mapDeps([78,46,2,3,47,21]))),T1=y.lazy(()=>ae(()=>import("./AdminPage-CxHMuTgJ.js"),__vite__mapDeps([79,4,2,80,47]))),j1=y.lazy(()=>ae(()=>import("./DeveloperManage-Ab6SdQEz.js"),__vite__mapDeps([81,23,24,58,32,9,13,8,27,4,54,18]))),R1=y.lazy(()=>ae(()=>import("./BotManage-B1lkaWlW.js"),__vite__mapDeps([82,23,24,61,5,50,27,32,9,13,8,2,54]))),A1=y.lazy(()=>ae(()=>import("./TokenManage-BU8KbNvZ.js"),__vite__mapDeps([83,45,5,37,32,9,13,8,27]))),z1=y.lazy(()=>ae(()=>import("./AuditLogPage-CvG7Kmpn.js"),__vite__mapDeps([84,23,24,32,9,80,33,11]))),O1=y.lazy(()=>ae(()=>import("./SettingsPage-YpqaOT8x.js"),[]));function C1(){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 D1(){const i=xa(u=>u.sessionExpired);return h.jsxs(z0,{children:[h.jsx(L0,{}),h.jsx(O0,{children:h.jsxs(Yv,{children:[h.jsx(C0,{isOpen:i}),h.jsx(y.Suspense,{fallback:h.jsx(C1,{}),children:h.jsxs(gv,{children:[h.jsx(P,{path:"/",element:h.jsx(H0,{})}),h.jsx(P,{path:"/login",element:h.jsx(B0,{})}),h.jsx(P,{path:"/totp-setup",element:h.jsx(ii,{children:h.jsx(Y0,{})})}),h.jsx(P,{path:"/bind",element:h.jsx(ii,{children:h.jsx(l1,{})})}),h.jsxs(P,{element:h.jsx(ii,{children:h.jsx(A0,{})}),children:[h.jsx(P,{path:"/home",element:h.jsx(X0,{})}),h.jsx(P,{path:"/dashboard",element:h.jsx(V0,{})}),h.jsx(P,{path:"/tasks",element:h.jsx(Q0,{})}),h.jsx(P,{path:"/tasks/:id",element:h.jsx(Z0,{})}),h.jsx(P,{path:"/plan",element:h.jsx(K0,{})}),h.jsx(P,{path:"/review",element:h.jsx(J0,{})}),h.jsx(P,{path:"/review/:sourceTaskId",element:h.jsx($0,{})}),h.jsx(P,{path:"/workers",element:h.jsx(W0,{})}),h.jsx(P,{path:"/workers/setup",element:h.jsx(ii,{requireAdmin:!0,children:h.jsx(I0,{})})}),h.jsx(P,{path:"/workers/:id",element:h.jsx(F0,{})}),h.jsx(P,{path:"/projects",element:h.jsx(P0,{})}),h.jsx(P,{path:"/projects/:key",element:h.jsx(e1,{})}),h.jsx(P,{path:"/projects/:key/edit",element:h.jsx(t1,{})}),h.jsx(P,{path:"/projects/:key/pipeline",element:h.jsx(a1,{})}),h.jsx(P,{path:"/profile",element:h.jsx(n1,{})}),h.jsx(P,{path:"/access-tokens",element:h.jsx(i1,{})}),h.jsxs(P,{path:"/docs",element:h.jsx(s1,{}),children:[h.jsx(P,{index:!0,element:h.jsx(ll,{to:"cli",replace:!0})}),h.jsx(P,{path:"cli",element:h.jsx(r1,{})}),h.jsx(P,{path:"api",element:h.jsx(u1,{})}),h.jsx(P,{path:"bot",element:h.jsx(Oh,{})}),h.jsx(P,{path:"all",element:h.jsx(w1,{})}),h.jsx(P,{path:"skill",element:h.jsx(o1,{})}),h.jsx(P,{path:"installation",element:h.jsx(c1,{})}),h.jsx(P,{path:"developer-setup",element:h.jsx(f1,{})}),h.jsx(P,{path:"worker-setup",element:h.jsx(d1,{})}),h.jsx(P,{path:"bot-setup",element:h.jsx(m1,{})}),h.jsx(P,{path:"local-development",element:h.jsx(h1,{})}),h.jsx(P,{path:"worker-operations",element:h.jsx(p1,{})}),h.jsx(P,{path:"deployment",element:h.jsx(g1,{})}),h.jsx(P,{path:"bot-integration",element:h.jsx(Oh,{})}),h.jsx(P,{path:"pipeline-config",element:h.jsx(y1,{})}),h.jsx(P,{path:"dev-workflow",element:h.jsx(_1,{})}),h.jsx(P,{path:"permissions",element:h.jsx(v1,{})}),h.jsx(P,{path:"env-variables",element:h.jsx(b1,{})}),h.jsx(P,{path:"architecture",element:h.jsx(x1,{})}),h.jsx(P,{path:"task-guide",element:h.jsx(E1,{})}),h.jsx(P,{path:"agent-cli",element:h.jsx(k1,{})}),h.jsx(P,{path:"changelog",element:h.jsx(S1,{})})]}),h.jsxs(P,{path:"/admin",element:h.jsx(ii,{requireAdmin:!0,children:h.jsx(T1,{})}),children:[h.jsx(P,{index:!0,element:h.jsx(ll,{to:"developers",replace:!0})}),h.jsx(P,{path:"developers",element:h.jsx(j1,{})}),h.jsx(P,{path:"bots",element:h.jsx(R1,{})}),h.jsx(P,{path:"tokens",element:h.jsx(A1,{})}),h.jsx(P,{path:"audit-logs",element:h.jsx(z1,{})}),h.jsx(P,{path:"settings",element:h.jsx(O1,{})})]})]}),h.jsx(P,{path:"*",element:h.jsx(G0,{})})]})})]})})]})}function Op(i=window){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}async function N1(i=window,u="portrait"){var o,f;if(!Op(i))return!1;const s=(f=(o=i.screen)==null?void 0:o.orientation)==null?void 0:f.lock;if(typeof s!="function")return!1;try{return await s.call(i.screen.orientation,u),!0}catch{return!1}}function M1(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 U1(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 q1(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 L1(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 H1(i=window,u=document){const s=u.documentElement,o=i.visualViewport??null;let f=-1;const m=()=>{const g=Math.round((o==null?void 0:o.height)??0),b=Math.round(i.innerHeight);let _=g>0?g:b;if(M1(i)&&U1(i)&&!q1(u)){const p=L1(i);p!==null&&(_=Math.max(_,b,p))}_!==f&&(f=_,s.style.setProperty("--app-height",`${_}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();H1(window,document);const Cp=window,B1=Op(Cp);N1(Cp);if(B1){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"]})}h_.createRoot(document.getElementById("root")).render(h.jsx(y.StrictMode,{children:h.jsx(D1,{})}));export{Wh as $,V1 as A,lb as B,tb as C,up as D,Ph as E,db as F,$1 as G,Ns as H,ib as I,rb as J,Ih as K,Jh as L,hb as M,ll as N,K1 as O,m0 as P,ip as Q,Ar as R,lp as S,dp as T,xb as U,sb as V,Q1 as W,rp as X,Z1 as Y,ap as Z,f_ as _,Vt as a,cb as a0,mb as a1,J1 as a2,_b as a3,Js as a4,hv as a5,W1 as a6,F1 as a7,$s as b,_e as c,yb as d,fb as e,Fa as f,yt as g,Qr as h,wb as i,h as j,sp as k,wp as l,Tp as m,Ir as n,X1 as o,tx as p,P1 as q,y as r,c0 as s,Wa as t,xa as u,ex as v,np as w,tp as x,I1 as y,G1 as z};