@overlordai/server 1.0.57 → 1.0.59

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 (64) hide show
  1. package/dist/dispatcher/worker-auth.service.js +1 -1
  2. package/dist/dispatcher/worker-auth.service.js.map +1 -1
  3. package/package.json +4 -4
  4. package/public/assets/{AccessTokensPage-DPQB2fbi.js → AccessTokensPage-CUQDQyQ5.js} +1 -1
  5. package/public/assets/{AdminPage-BqVelYNu.js → AdminPage-ChDIUX_3.js} +1 -1
  6. package/public/assets/{ApiReferencePage-CiGvbLxL.js → ApiReferencePage-DFFhnxAn.js} +1 -1
  7. package/public/assets/{AuditLogPage-DSo4jVYm.js → AuditLogPage-X3KImiZ3.js} +1 -1
  8. package/public/assets/{BindPlatformPage-CTqzpOmt.js → BindPlatformPage-ByhQZ5qX.js} +1 -1
  9. package/public/assets/{BotManage-CIR0rrK7.js → BotManage-BCCGabIK.js} +1 -1
  10. package/public/assets/{CliReferencePage-C8GmlwUz.js → CliReferencePage-BmEVf_Yf.js} +1 -1
  11. package/public/assets/{DeveloperManage-r6y2AoB4.js → DeveloperManage-959Sec6Y.js} +1 -1
  12. package/public/assets/{EditProjectPage-7WCsNltj.js → EditProjectPage-DiVkK33D.js} +1 -1
  13. package/public/assets/{EmptyState-D3foEiul.js → EmptyState-BQqxSE6p.js} +1 -1
  14. package/public/assets/{HomePage-D4yv4orb.js → HomePage-CO4wRT0y.js} +1 -1
  15. package/public/assets/{InfoRow-DhdTYoY9.js → InfoRow-DGKqWvsB.js} +1 -1
  16. package/public/assets/{LandingPage-CqS0E2eC.js → LandingPage-DP9U6Iea.js} +1 -1
  17. package/public/assets/{LoginPage-DDXkdcz_.js → LoginPage-OLBwEvXt.js} +1 -1
  18. package/public/assets/{MetricBar-DMMHfS0A.js → MetricBar-D8u403eM.js} +1 -1
  19. package/public/assets/{NotFoundPage-D5x5BrlX.js → NotFoundPage-DA9fVgox.js} +1 -1
  20. package/public/assets/{OnboardingGuide-D8RyPcEd.js → OnboardingGuide-BgPC4aiz.js} +1 -1
  21. package/public/assets/{PipelineEditorPage-y2-Q8ofQ.js → PipelineEditorPage-Ra4MjS17.js} +1 -1
  22. package/public/assets/{ProfilePage-DN7usHOi.js → ProfilePage-BWGufJ03.js} +1 -1
  23. package/public/assets/{ProjectDetailPage-DJexg49z.js → ProjectDetailPage-CLqYqqVX.js} +1 -1
  24. package/public/assets/{ProjectListPage-Bz7I2D0H.js → ProjectListPage-CitoAwwH.js} +1 -1
  25. package/public/assets/{QuickAuth-Dr0Q50ld.js → QuickAuth-dOCzSE_V.js} +1 -1
  26. package/public/assets/{RemoveMemberConfirmDialog-BCrue0AP.js → RemoveMemberConfirmDialog-D-rvX20k.js} +1 -1
  27. package/public/assets/{Select-BnV8yZlD.js → Select-CdRjIJm4.js} +1 -1
  28. package/public/assets/{SettingsPage-HaUCcsgl.js → SettingsPage-DHa6WOhU.js} +1 -1
  29. package/public/assets/{Skeleton-DUgWc2LJ.js → Skeleton-CEc5RMQi.js} +1 -1
  30. package/public/assets/{SkillPage-BInwZTQh.js → SkillPage-D0lNlB7o.js} +1 -1
  31. package/public/assets/{TaskDetailPage-CfwEj1hy.js → TaskDetailPage-LdLghDpk.js} +1 -1
  32. package/public/assets/TaskListPage-BjPRD6v8.js +1 -0
  33. package/public/assets/{TaskStatusBadge-DuOoGIwE.js → TaskStatusBadge-xZ7FBWZw.js} +1 -1
  34. package/public/assets/{TerminalHomePage-BwXJjr-a.js → TerminalHomePage-cz_7HYVr.js} +1 -1
  35. package/public/assets/{TokenManage-B0Cpv6SO.js → TokenManage-DP0iub57.js} +1 -1
  36. package/public/assets/{TotpSetupPage-MSCCURj9.js → TotpSetupPage-VeqXwL5k.js} +1 -1
  37. package/public/assets/{WorkerDetailPage-R2veIzKo.js → WorkerDetailPage-BOn7z8cR.js} +1 -1
  38. package/public/assets/{WorkerListPage-CserMjGO.js → WorkerListPage-P1hVwXGG.js} +1 -1
  39. package/public/assets/{WorkerSetupGuidePage-SqO2lzVa.js → WorkerSetupGuidePage-m-ZneK_i.js} +1 -1
  40. package/public/assets/{arrow-left-DklRsENx.js → arrow-left-DGmTxTQH.js} +1 -1
  41. package/public/assets/{arrow-right-MDrzFe3K.js → arrow-right-CTOYnmu3.js} +1 -1
  42. package/public/assets/{bot-DPaziJPf.js → bot-BKKWb03w.js} +1 -1
  43. package/public/assets/{chevron-right-CqyufMDW.js → chevron-right-CKEZOJqX.js} +1 -1
  44. package/public/assets/{copy-BUH7P2Hf.js → copy-Ca3klMOV.js} +1 -1
  45. package/public/assets/{external-link-ChPgQ7N_.js → external-link-smb8Si2G.js} +1 -1
  46. package/public/assets/{index-vL7aQJNr.js → index-CqnL6hX8.js} +2 -2
  47. package/public/assets/{key-CxvwwHnW.js → key-uv0MVCos.js} +1 -1
  48. package/public/assets/{loader-circle-DS5g1-Od.js → loader-circle-knGZUOVM.js} +1 -1
  49. package/public/assets/{pencil-B6spIBcw.js → pencil-zZY9INFY.js} +1 -1
  50. package/public/assets/{plus-Bnd1Vz2Y.js → plus-CypZlZSj.js} +1 -1
  51. package/public/assets/{rotate-ccw-CgcLAXNR.js → rotate-ccw-CV1EIcxQ.js} +1 -1
  52. package/public/assets/{scroll-text-CecZ0Fk5.js → scroll-text-mAU4OFrg.js} +1 -1
  53. package/public/assets/{settings-C1uOD3PZ.js → settings-BZyNzgEB.js} +1 -1
  54. package/public/assets/{status-colors-BPEUp90-.js → status-colors-BXL4VDNh.js} +1 -1
  55. package/public/assets/{task-constants-BbFyCyKk.js → task-constants-Bj_lR7bu.js} +1 -1
  56. package/public/assets/{task.store-BE6fEPu4.js → task.store-Bldcjv9A.js} +1 -1
  57. package/public/assets/{trash-2-A2FsT1yG.js → trash-2-BJ5q4Wkp.js} +1 -1
  58. package/public/assets/{useFetch-vGZMAvGi.js → useFetch-CJla7_79.js} +1 -1
  59. package/public/assets/{users-CEdRS_A3.js → users-DBFmGr_S.js} +1 -1
  60. package/public/assets/{wifi-D60NkK6F.js → wifi-DZo2oi08.js} +1 -1
  61. package/public/assets/{zap-DXw1NrWz.js → zap-CDX3UpIX.js} +1 -1
  62. package/public/index.html +1 -1
  63. package/public/sw.js +1 -1
  64. package/public/assets/TaskListPage-Dh59ldSZ.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-CqS0E2eC.js","assets/arrow-right-MDrzFe3K.js","assets/zap-DXw1NrWz.js","assets/bot-DPaziJPf.js","assets/users-CEdRS_A3.js","assets/copy-BUH7P2Hf.js","assets/HomePage-D4yv4orb.js","assets/TaskStatusBadge-DuOoGIwE.js","assets/status-colors-BPEUp90-.js","assets/Skeleton-DUgWc2LJ.js","assets/OnboardingGuide-D8RyPcEd.js","assets/chevron-right-CqyufMDW.js","assets/date-BdNtiQTP.js","assets/string-B39tzdVK.js","assets/useFetch-vGZMAvGi.js","assets/TerminalHomePage-BwXJjr-a.js","assets/task.store-BE6fEPu4.js","assets/task-constants-BbFyCyKk.js","assets/task-constants-Beg8tuEN.css","assets/Select-BnV8yZlD.js","assets/plus-Bnd1Vz2Y.js","assets/wifi-D60NkK6F.js","assets/TaskListPage-Dh59ldSZ.js","assets/EmptyState-D3foEiul.js","assets/TaskDetailPage-CfwEj1hy.js","assets/arrow-left-DklRsENx.js","assets/rotate-ccw-CgcLAXNR.js","assets/external-link-ChPgQ7N_.js","assets/loader-circle-DS5g1-Od.js","assets/WorkerListPage-CserMjGO.js","assets/MetricBar-DMMHfS0A.js","assets/WorkerSetupGuidePage-SqO2lzVa.js","assets/key-CxvwwHnW.js","assets/settings-C1uOD3PZ.js","assets/WorkerDetailPage-R2veIzKo.js","assets/InfoRow-DhdTYoY9.js","assets/trash-2-A2FsT1yG.js","assets/ProjectListPage-Bz7I2D0H.js","assets/ProjectDetailPage-DJexg49z.js","assets/RemoveMemberConfirmDialog-BCrue0AP.js","assets/pencil-B6spIBcw.js","assets/EditProjectPage-7WCsNltj.js","assets/PipelineEditorPage-y2-Q8ofQ.js","assets/ProfilePage-DN7usHOi.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-DPQB2fbi.js","assets/CliReferencePage-C8GmlwUz.js","assets/QuickAuth-Dr0Q50ld.js","assets/ApiReferencePage-CiGvbLxL.js","assets/SkillPage-BInwZTQh.js","assets/AdminPage-BqVelYNu.js","assets/scroll-text-CecZ0Fk5.js","assets/DeveloperManage-r6y2AoB4.js","assets/BotManage-CIR0rrK7.js","assets/TokenManage-B0Cpv6SO.js","assets/AuditLogPage-DSo4jVYm.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-DP9U6Iea.js","assets/arrow-right-CTOYnmu3.js","assets/zap-CDX3UpIX.js","assets/bot-BKKWb03w.js","assets/users-DBFmGr_S.js","assets/copy-Ca3klMOV.js","assets/HomePage-CO4wRT0y.js","assets/TaskStatusBadge-xZ7FBWZw.js","assets/status-colors-BXL4VDNh.js","assets/Skeleton-CEc5RMQi.js","assets/OnboardingGuide-BgPC4aiz.js","assets/chevron-right-CKEZOJqX.js","assets/date-BdNtiQTP.js","assets/string-B39tzdVK.js","assets/useFetch-CJla7_79.js","assets/TerminalHomePage-cz_7HYVr.js","assets/task.store-Bldcjv9A.js","assets/task-constants-Bj_lR7bu.js","assets/task-constants-Beg8tuEN.css","assets/Select-CdRjIJm4.js","assets/plus-CypZlZSj.js","assets/wifi-DZo2oi08.js","assets/TaskListPage-BjPRD6v8.js","assets/EmptyState-BQqxSE6p.js","assets/TaskDetailPage-LdLghDpk.js","assets/arrow-left-DGmTxTQH.js","assets/rotate-ccw-CV1EIcxQ.js","assets/external-link-smb8Si2G.js","assets/loader-circle-knGZUOVM.js","assets/WorkerListPage-P1hVwXGG.js","assets/MetricBar-D8u403eM.js","assets/WorkerSetupGuidePage-m-ZneK_i.js","assets/key-uv0MVCos.js","assets/settings-BZyNzgEB.js","assets/WorkerDetailPage-BOn7z8cR.js","assets/InfoRow-DGKqWvsB.js","assets/trash-2-BJ5q4Wkp.js","assets/ProjectListPage-CitoAwwH.js","assets/ProjectDetailPage-CLqYqqVX.js","assets/RemoveMemberConfirmDialog-D-rvX20k.js","assets/pencil-zZY9INFY.js","assets/EditProjectPage-DiVkK33D.js","assets/PipelineEditorPage-Ra4MjS17.js","assets/ProfilePage-BWGufJ03.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-CUQDQyQ5.js","assets/CliReferencePage-BmEVf_Yf.js","assets/QuickAuth-dOCzSE_V.js","assets/ApiReferencePage-DFFhnxAn.js","assets/SkillPage-D0lNlB7o.js","assets/AdminPage-ChDIUX_3.js","assets/scroll-text-mAU4OFrg.js","assets/DeveloperManage-959Sec6Y.js","assets/BotManage-BCCGabIK.js","assets/TokenManage-DP0iub57.js","assets/AuditLogPage-X3KImiZ3.js"])))=>i.map(i=>d[i]);
2
2
  var Xy=Object.defineProperty;var Im=u=>{throw TypeError(u)};var Vy=(u,r,s)=>r in u?Xy(u,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[r]=s;var Xe=(u,r,s)=>Vy(u,typeof r!="symbol"?r+"":r,s),_s=(u,r,s)=>r.has(u)||Im("Cannot "+s);var U=(u,r,s)=>(_s(u,r,"read from private field"),s?s.call(u):r.get(u)),It=(u,r,s)=>r.has(u)?Im("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(u):r.set(u,s),Zt=(u,r,s,o)=>(_s(u,r,"write to private field"),o?o.call(u,s):r.set(u,s),s),be=(u,r,s)=>(_s(u,r,"access private method"),s);var Pm=(u,r,s,o)=>({set _(f){Zt(u,r,f,s)},get _(){return U(u,r,o)}});(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function s(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(f){if(f.ep)return;f.ep=!0;const m=s(f);fetch(f.href,m)}})();function Qy(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var ys={exports:{}},ei={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -222,4 +222,4 @@ Please change the parent <Route path="${L}"> to <Route path="${L==="/"?"*":`${L}
222
222
  you will need to set up 2fa again on your next login.`,regenerate_2fa:"regenerate_2fa",regenerating:"regenerating...",access_tokens:"access_tokens",access_tokens_desc:"// manage personal access tokens for cli & api",git_info_updated:"git info updated.",failed_to_update_git_info:"failed to update git info.",two_fa_reset:"2fa has been reset. please set up your authenticator again on next login.",failed_to_regenerate_2fa:"failed to regenerate 2fa.",failed_to_load_profile:"failed to load profile.",unable_to_load_profile:"// unable to load profile information",personal_settings:"// personal settings",password_length_10_20:"password must be between 10 and 20 characters.",password_hint_10_20:"// 10-20 characters, letters, numbers, and special characters",current_totp_code:"current_totp_code",totp_code_placeholder:"6-digit code",totp_code_required:"please enter your current 6-digit totp code to regenerate 2fa.",two_fa_regenerated:"2fa regenerated. you will need to set it up again on next login.",totp_code_invalid:"invalid totp code or failed to regenerate 2fa.",platform_accounts:"platform accounts",not_linked:"not linked",bind_hint:'send "bind" to the bot in lark or slack to link your account.'},access_tokens:{title:"access_tokens",subtitle:"// personal access tokens",create_token:"create_token",no_tokens:"no_personal_access_tokens",create_token_desc:"create a token to authenticate with the cli or api",copy_token_warning:"// copy your token now. you will not be able to see it again.",token_name:"token_name",token_name_placeholder:"my-cli-token",expires_in:"expires_in",days_30:"30 days",days_90:"90 days",days_365:"365 days",no_expiry:"no expiry",token_created:"token created.",failed_to_create_token:"failed to create token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",failed_to_load_tokens:"failed to load tokens.",revoke:"revoke",revoke_token:"revoke_token",last_used:"last_used",expires_at:"expires_at",token:"token",created:"created",expires:"expires",revoke_confirm:'are you sure you want to revoke "{name}"? this action cannot be undone.',create_personal_access_token:"// create personal access token",tokens_authenticate_desc:"// tokens authenticate the ov cli and api requests",revoke_token_title:"// revoke token",token_label_required:"token label is required."},admin:{title:"admin",subtitle:"// system control",tab_developers:"developers",tab_bots:"bots",tab_tokens:"worker_tokens",tab_audit_logs:"audit_logs",tab_settings:"settings",developers_title:"admin / developers",developers_subtitle:"// developer account management",create_developer:"create_developer",search_developers:"search developers...",no_matching_developers:"no_matching_developers",no_developers_found:"no_developers_found",try_adjusting_search:"try adjusting your search query",username:"username",display_name:"display_name",role:"role",status:"status",two_fa_status:"2fa_status",dev_name:"dev_name",totp:"totp",reset_2fa:"reset 2fa",deactivate:"deactivate",activate:"activate",create_developer_title:"create_developer",create_developer_desc:"// add a new developer account",edit_developer_title:"edit_developer",edit_developer_desc:"// update developer account settings",developer_created:"developer created.",developer_updated:"developer updated.",failed_to_create_developer:"failed to create developer",failed_to_update_developer:"failed to update developer",confirm_reset_2fa:'reset 2fa for "{name}"? they will need to set up 2fa again on next login.',two_fa_reset:"2fa has been reset.",failed_to_reset_2fa:"failed to reset 2fa",confirm_deactivate:'deactivate "{name}"? they will not be able to log in.',confirm_activate:'activate "{name}"?',developer_deactivated:"developer deactivated.",developer_activated:"developer activated.",failed_to_update_status:"failed to update developer status.",create_first_developer:"create your first developer to get started",all_fields_required:"all fields are required.",password_length_error:"password must be between 10 and 20 characters.",password_complexity_error:"password must contain at least one letter, one digit, and one special character.",password_hint:"// must be 10-20 characters with letters, digits, and special characters.",display_name_required:"display name is required.",demote_self_warning:"you are about to demote yourself from admin. the system must have at least one admin. please verify another admin exists before proceeding.",demote_self_inline_warning:"// warning: you are demoting yourself from admin. ensure at least one other admin exists.",lark_uid:"lark open_id",slack_uid:"slack user_id",platform_accounts:"platform accounts",reset_2fa_confirm_message:"are you sure you want to reset two-factor authentication for",reset_2fa_audit_note:"// the user will be required to set up 2fa again on their next login. this action is recorded in the audit log.",resetting:"resetting...",bots_title:"admin / bots",bots_subtitle:"// bot instance management",create_bot:"create_bot",no_bots_configured:"no_bots_configured",add_bot_desc:"add a bot instance to enable chat integrations with lark or slack",bot_name:"bot_name",platform:"platform",app_id:"app_id",lark:"lark",slack:"slack",delete_bot:"delete_bot",delete_bot_confirm:'delete bot "{name}"? this cannot be undone.',bot_deleted:"bot deleted.",failed_to_delete_bot:"failed to delete bot.",bot_created:"bot created.",failed_to_create_bot:"failed to create bot",chat_bindings:"chat_bindings",chat_bindings_subtitle:"// all integrations",no_chat_bindings:"// no chat bindings configured",chat_id:"chat_id",chat_name:"chat_name",project:"project",bot:"bot",edit_bot:"edit_bot",name_and_app_id_required:"name and app id are required.",app_secret_required:"app secret is required for new bots.",app_secret:"app_secret",app_secret_keep_current:"app_secret (leave empty to keep current)",webhook_url_optional:"webhook_url (optional)",lark_feishu:"lark_(feishu)",failed_to_update_bot:"failed to update bot",no_chat_bindings_for_bot:"// no chat bindings configured for this bot.",add_chat_binding_desc:"// add chat binding",add_binding:"add_binding",failed_to_add_binding:"failed to add binding",tokens_title:"admin / worker_tokens",tokens_subtitle:"// worker registration token management",generate_token:"generate_token",no_worker_tokens:"no_worker_tokens",generate_token_desc:"generate a token to register a new worker",label:"label",purpose:"purpose",expires_at:"expires_at",token_generated:"token generated.",failed_to_generate_token:"failed to generate token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",revoke_token:"revoke_token",revoke_token_confirm:'revoke token "{label}"? this cannot be undone.',show_revoked:"show revoked",hide_revoked:"hide revoked",audit_title:"admin / audit_logs",audit_subtitle:"// system activity audit trail",all_actions:"all_actions",filter_by_user:"filter by user...",no_audit_entries:"no_audit_log_entries",audit_logs_appear:"audit logs will appear here as actions are performed in the system",timestamp:"timestamp",user_id:"user_id",action:"action",resource:"resource",detail:"detail",ip:"ip",action_login:"login",action_logout:"logout",action_create:"create",action_update:"update",action_delete:"delete",action_revoke:"revoke",action_reset_2fa:"reset_2fa",action_generate_token:"generate_token",showing_entries:"showing {count} entries",revoke:"revoke",generate_worker_token_title:"> generate_worker_token",create_one_time_token:"// create a one-time registration token",label_identifies_worker:"// identifies which worker this token is for",generating:"generating...",generate:"generate",worker_registered:"> worker_registered",worker_token_generated:"> worker_token_generated",run_command_desc:"// run this command on the target machine to register the worker",token_shown_once:"// this token will only be shown once. copy the command before closing.",setup_command:"setup command",waiting_for_worker:"// waiting for worker to register...",token_not_yet_used:"// token not yet used. the worker can still register later using this token.",worker_registered_success:"// worker registered successfully",worker:"worker",copied_wait_for_worker:"copied — wait_for_worker",close_worker_can_register:"close // worker can still register",view_worker:"view_worker",label_required:"label is required.",settings_title:"admin / settings",settings_subtitle:"// global system configuration",save_settings:"save_settings",settings_saved:"settings saved",failed_to_save_settings:"failed to save settings",loading_settings:"// loading settings...",scheduling:"> scheduling",heartbeat:"> heartbeat",output:"> output",defaults:"> defaults",max_concurrent_tasks:"max_concurrent_tasks_per_worker",max_concurrent_tasks_desc:"// maximum number of tasks a single worker can run simultaneously",task_timeout:"task_timeout_minutes",task_timeout_desc:"// auto-cancel tasks after this many minutes of inactivity",heartbeat_interval:"heartbeat_interval_seconds",heartbeat_interval_desc:"// expected interval between worker heartbeats",worker_offline_threshold:"worker_offline_threshold_seconds",worker_offline_threshold_desc:"// mark worker offline after missing heartbeats for this duration",default_agent_type:"default_agent_type",default_agent_type_desc:"// default agent type for new projects",server_url:"server_url",server_url_desc:"// public server url used in worker setup instructions",chat_binding_title:"// chat_bindings — {name}",chat_binding_no_bindings:"// no chat bindings configured for this bot.",chat_binding_add:"// add chat binding",chat_binding_id_placeholder:"platform chat/group id",chat_binding_name_placeholder:"display name for the chat",chat_binding_select_project:"select project...",chat_binding_all_fields_required:"all fields are required.",chat_binding_adding:"adding...",pat_label_required:"label is required.",pat_failed_to_generate:"failed to generate token",pat_label_placeholder:"e.g. build-server-03"},landing:{overlord:"overlord",version_badge:"self-hosted · bring your own subscriptions and machines",hero_line1:"turn your subscriptions / machines into",hero_turn_your:"turn your",hero_into:"into",hero_word_subscriptions:"subscriptions",hero_word_machines:"machines",hero_highlight:"a dev team that never sleeps.",hero_desc:"dispatch coding tasks across your machine fleet. ai agents execute in parallel — you watch, jump in, or come back to finished pull requests.",get_started:"get started",read_docs:"read docs",how_it_works:"how it works",three_steps:"from task description to merged pull request.",step_n:"step {n}",step_define:"connect your fleet",step_define_desc:"register your machines as workers. each one runs ai agents — claude code, cursor, codex — using your existing subscriptions.",step_dispatch:"send a task",step_dispatch_desc:"describe what you want from slack, lark, cli, or the web dashboard. overlord finds the best available machine and starts the ai agent automatically.",step_monitor:"watch or walk away",step_monitor_desc:"live terminal streams agent output to your browser. jump in to guide the agent, or come back later to a finished pull request.",everything_you_need:"everything you need",complete_platform:"self-hosted. your machines, your ai subscriptions, your control.",feature_terminal:"real-time pty terminal",feature_terminal_desc:"stream live agent output directly in the browser. full xterm.js integration with scrollback and search.",feature_multi_agent:"multi-agent support",feature_multi_agent_desc:"first-class support for claude code, cursor, and codex. route tasks to the right agent automatically.",feature_routing:"smart task routing",feature_routing_desc:"intelligent scheduling across your machine fleet. tasks land on the best available worker every time.",feature_pipeline:"pipeline automation",feature_pipeline_desc:"chain tasks into multi-stage pipelines. build, test, and deploy in one continuous flow.",feature_collab:"team collaboration",feature_collab_desc:"project-level permissions, audit logs, and shared dashboards. keep your whole team in sync.",feature_pool:"pool subscriptions, maximize value",feature_pool_desc:"every team member's ai subscription goes into a shared pool — everyone can use any seat. no idle subscriptions, no duplicate costs. the bigger your team, the more you save.",feature_trigger:"trigger from everywhere",feature_trigger_desc:"slack message, lark bot, cli command, or web dashboard — create tasks from whatever tool you already use. phone, laptop, tablet, it all works.",feature_remote:"code from anywhere",feature_remote_desc:"on the bus, at a café, or away from your desk — dispatch tasks from your phone or laptop and your fleet keeps coding. come back to finished pull requests.",feature_security:"secure by design",feature_security_desc:"totp two-factor auth, scoped api tokens, and full audit trail. enterprise-ready from day one.",install_title:"get up and running",install_desc:"three components, three commands. deploy in minutes.",install_command:"npm install -g @overlordai/developer-cli",setup_step_1_title:"deploy the server",setup_step_1_desc:"install overlord and start the central server. it manages all tasks, authentication, and real-time communication.",setup_step_1_command:`npm install -g @overlordai/cli @overlordai/server
223
223
  overlord install`,setup_step_1_link:"installation guide",setup_step_2_title:"register workers",setup_step_2_desc:"set up worker machines that execute tasks. each worker runs ai agents in isolated workspaces with full git integration.",setup_step_2_command:`npm install -g @overlordai/cli @overlordai/worker
224
224
  overlord setup worker`,setup_step_2_link:"worker setup guide",setup_step_3_title:"connect as developer",setup_step_3_desc:"install the developer cli to create tasks, attach to running sessions, and monitor progress from your terminal.",setup_step_3_command:`npm install -g @overlordai/developer-cli
225
- ov login https://overlord.yourdomain.com`,setup_step_3_link:"development workflow",go_to_app:"open app",documentation:"documentation",api:"api",copy_install_command:"copy install command"},docs:{cli_reference:"cli",cli_subtitle:"// command-line tools",api_reference:"api",api_subtitle:"// rest api endpoints",quick_start:"// quick start",developer_cli:"developer cli (ov)",admin_cli:"admin cli (overlord)",authentication:"// authentication",usage:"usage",flags:"flags",example:"example",request_body:"request body",response:"response",quick_start_with_token:"// quick start with your token",replace_token_hint:"// replace <your-token> with the actual token value from your access tokens page",cli_tools_desc:"// overlord provides two cli tools: {ov} (developer cli) and {overlord} (admin/ops cli)",api_base_url_desc:"// base url: {url} · all endpoints return json · auth via bearer token in authorization header"},onboarding:{getting_started:"// getting started",completed_count:"{done}/{total} completed",dismiss:"dismiss",all_done:"all set! you're ready to go.",admin_create_project_title:"create your first project",admin_create_project_desc:"set up a project with a git repo and pipeline",admin_register_worker_title:"register a worker",admin_register_worker_desc:"generate a token and set up a worker to run tasks",admin_create_developer_title:"create a developer account",admin_create_developer_desc:"add team members who can create and monitor tasks",admin_configure_bot_title:"configure a chat bot",admin_configure_bot_desc:"register a Lark or Slack bot to enable task management via chat",admin_first_task_title:"create your first task",admin_first_task_desc:"verify the full pipeline works end-to-end",lead_view_projects_title:"view your projects",lead_view_projects_desc:"check the projects assigned to you",lead_configure_pipeline_title:"configure a pipeline",lead_configure_pipeline_desc:"set up stages for your project workflow",lead_add_member_title:"add a team member",lead_add_member_desc:"invite developers to your project",lead_first_task_title:"create your first task",lead_first_task_desc:"submit a task and watch it execute",dev_install_cli_title:"install the ov cli",dev_install_cli_desc:"npm install -g @overlordai/developer-cli",dev_setup_cli_title:"run ov setup",dev_setup_cli_desc:"connect to the server and authenticate",dev_link_chat_title:"link your chat account",dev_link_chat_desc:'send "bind" to the bot in Lark or Slack to connect your account',dev_view_projects_title:"explore projects",dev_view_projects_desc:"browse available projects and their pipelines",dev_first_task_title:"create your first task",dev_first_task_desc:"submit a task via web or cli",go_to_projects:"go to projects",go_to_workers:"go to workers",go_to_tasks:"go to tasks",go_to_bots:"manage bots",manage_developers:"manage developers",cli:"cli",setup_guide:"setup guide"},bind:{title:"// link platform account",linking:"linking your account...",success:"account linked successfully!",success_detail:"your {platform} account has been connected. you can now use bot commands.",error:"failed to link account",invalid_token:'this link is invalid or has expired. send "bind" to the bot again to get a new link.',back_to_home:"go to dashboard",no_token:"no bind token provided."},terminal_home:{title:"terminal",select_project:"project...",all_projects:"all projects",task_description_placeholder:"describe the task...",new_task:"new task",no_active_tasks:"no active tasks",create_task_hint:"create a task using the bar above to get started"}};function gb(u,r){const s=r.split(".");let o=u;for(const f of s){if(o==null||typeof o!="object")return r;o=o[f]}return typeof o=="string"?o:r}function vb(u,r){return r?u.replace(/\{(\w+)\}/g,(s,o)=>r[o]!=null?String(r[o]):`{${o}}`):u}function Lu(u,r){return vb(gb(yb,u),r)}function ta(){return{t:v.useCallback((r,s)=>Lu(r,s),[])}}function lp(){const{theme:u,setTheme:r}=ap(),{t:s}=ta(),o=u==="dark"||u==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function f(){r(o?"light":"dark")}return _.jsx("button",{onClick:f,className:"flex items-center gap-1.5 rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]","aria-label":s(o?"common.switch_to_light":"common.switch_to_dark"),title:s(o?"common.light_mode":"common.dark_mode"),children:o?_.jsx(ib,{size:16}):_.jsx(eb,{size:16})})}class Ns extends Error{constructor(s,o,f){const m=s.status||s.status===0?s.status:"",h=s.statusText??"",x=`${m} ${h}`.trim(),g=x?`status code ${x}`:"an unknown error";super(`Request failed with ${g}: ${o.method} ${o.url}`);Xe(this,"response");Xe(this,"request");Xe(this,"options");this.name="HTTPError",this.response=s,this.request=o,this.options=f}}class np extends Error{constructor(s){let o="Non-error value was thrown";try{typeof s=="string"?o=s:s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&(o=s.message)}catch{}super(o);Xe(this,"name","NonError");Xe(this,"value");this.value=s}}class Rs extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new np(s.cause):void 0;super(s!=null&&s.code?`Forced retry: ${s.code}`:"Forced retry",o?{cause:o}:void 0);Xe(this,"name","ForceRetryError");Xe(this,"customDelay");Xe(this,"code");Xe(this,"customRequest");this.customDelay=s==null?void 0:s.delay,this.code=s==null?void 0:s.code,this.customRequest=s==null?void 0:s.request}}const xh=(()=>{let u=!1,r=!1;const s=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(s&&o)try{r=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return u&&!r})(),bb=typeof globalThis.AbortController=="function",ip=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",xb=typeof globalThis.ReadableStream=="function",Sb=typeof globalThis.FormData=="function",up=["get","post","put","patch","head","delete"],Eb={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},js=2147483647,kb=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,rp=Symbol("stop");class op{constructor(r){Xe(this,"options");this.options=r}}const wb=u=>new op(u),Tb={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Rb={next:!0},jb={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Ab=u=>{if(!u)return 0;if(u instanceof FormData){let r=0;for(const[s,o]of u)r+=kb,r+=new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length,r+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return r}if(u instanceof Blob)return u.size;if(u instanceof ArrayBuffer)return u.byteLength;if(typeof u=="string")return new TextEncoder().encode(u).length;if(u instanceof URLSearchParams)return new TextEncoder().encode(u.toString()).length;if("byteLength"in u)return u.byteLength;if(typeof u=="object"&&u!==null)try{const r=JSON.stringify(u);return new TextEncoder().encode(r).length}catch{return 0}return 0},sp=(u,r,s)=>{let o,f=0;return u.pipeThrough(new TransformStream({transform(m,h){if(h.enqueue(m),o){f+=o.byteLength;let x=r===0?0:f/r;x>=1&&(x=1-Number.EPSILON),s==null||s({percent:x,totalBytes:Math.max(r,f),transferredBytes:f},o)}o=m},flush(){o&&(f+=o.byteLength,s==null||s({percent:1,totalBytes:Math.max(r,f),transferredBytes:f},o))}}))},zb=(u,r)=>{if(!u.body)return u;if(u.status===204)return new Response(null,{status:u.status,statusText:u.statusText,headers:u.headers});const s=Math.max(0,Number(u.headers.get("content-length"))||0);return new Response(sp(u.body,s,r),{status:u.status,statusText:u.statusText,headers:u.headers})},Cb=(u,r,s)=>{if(!u.body)return u;const o=Ab(s??u.body);return new Request(u,{duplex:"half",body:sp(u.body,o,r)})},yl=u=>u!==null&&typeof u=="object",Nu=(...u)=>{for(const r of u)if((!yl(r)||Array.isArray(r))&&r!==void 0)throw new TypeError("The `options` argument must be an object");return $s({},...u)},cp=(u={},r={})=>{const s=new globalThis.Headers(u),o=r instanceof globalThis.Headers,f=new globalThis.Headers(r);for(const[m,h]of f.entries())o&&h==="undefined"||h===void 0?s.delete(m):s.set(m,h);return s};function Du(u,r,s){return Object.hasOwn(r,s)&&r[s]===void 0?[]:$s(u[s]??[],r[s]??[])}const fp=(u={},r={})=>({beforeRequest:Du(u,r,"beforeRequest"),beforeRetry:Du(u,r,"beforeRetry"),afterResponse:Du(u,r,"afterResponse"),beforeError:Du(u,r,"beforeError")}),Ob=(u,r)=>{const s=new URLSearchParams;for(const o of[u,r])if(o!==void 0)if(o instanceof URLSearchParams)for(const[f,m]of o.entries())s.append(f,m);else if(Array.isArray(o))for(const f of o){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");s.append(String(f[0]),String(f[1]))}else if(yl(o))for(const[f,m]of Object.entries(o))m!==void 0&&s.append(f,String(m));else{const f=new URLSearchParams(o);for(const[m,h]of f.entries())s.append(m,h)}return s},$s=(...u)=>{let r={},s={},o={},f;const m=[];for(const h of u)if(Array.isArray(h))Array.isArray(r)||(r=[]),r=[...r,...h];else if(yl(h)){for(let[x,g]of Object.entries(h)){if(x==="signal"&&g instanceof globalThis.AbortSignal){m.push(g);continue}if(x==="context"){if(g!=null&&(!yl(g)||Array.isArray(g)))throw new TypeError("The `context` option must be an object");r={...r,context:g==null?{}:{...r.context,...g}};continue}if(x==="searchParams"){g==null?f=void 0:f=f===void 0?g:Ob(f,g);continue}yl(g)&&x in r&&(g=$s(r[x],g)),r={...r,[x]:g}}yl(h.hooks)&&(o=fp(o,h.hooks),r.hooks=o),yl(h.headers)&&(s=cp(s,h.headers),r.headers=s)}return f!==void 0&&(r.searchParams=f),m.length>0&&(m.length===1?r.signal=m[0]:ip?r.signal=AbortSignal.any(m):r.signal=m.at(-1)),r},Nb=u=>up.includes(u)?u.toUpperCase():u,Db=["get","put","head","delete","options","trace"],Mb=[408,413,429,500,502,503,504],Ub=[413,429,503],Sh={limit:2,methods:Db,statusCodes:Mb,afterStatusCodes:Ub,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:u=>.3*2**(u-1)*1e3,jitter:void 0,retryOnTimeout:!1},qb=(u={})=>{if(typeof u=="number")return{...Sh,limit:u};if(u.methods&&!Array.isArray(u.methods))throw new Error("retry.methods must be an array");if(u.methods&&(u.methods=u.methods.map(s=>s.toLowerCase())),u.statusCodes&&!Array.isArray(u.statusCodes))throw new Error("retry.statusCodes must be an array");const r=Object.fromEntries(Object.entries(u).filter(([,s])=>s!==void 0));return{...Sh,...r}};class Ds extends Error{constructor(s){super(`Request timed out: ${s.method} ${s.url}`);Xe(this,"request");this.name="TimeoutError",this.request=s}}async function Hb(u,r,s,o){return new Promise((f,m)=>{const h=setTimeout(()=>{s&&s.abort(),m(new Ds(u))},o.timeout);o.fetch(u,r).then(f).catch(m).then(()=>{clearTimeout(h)})})}async function Lb(u,{signal:r}){return new Promise((s,o)=>{r&&(r.throwIfAborted(),r.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(m),o(r.reason)}const m=setTimeout(()=>{r==null||r.removeEventListener("abort",f),s()},u)})}const Bb=(u,r)=>{const s={};for(const o in r)Object.hasOwn(r,o)&&!(o in jb)&&!(o in Tb)&&(!(o in u)||o in Rb)&&(s[o]=r[o]);return s},Yb=u=>u===void 0?!1:Array.isArray(u)?u.length>0:u instanceof URLSearchParams?u.size>0:typeof u=="object"?Object.keys(u).length>0:typeof u=="string"?u.trim().length>0:!!u;function Gb(u){return u instanceof Ns||(u==null?void 0:u.name)===Ns.name}function Xb(u){return u instanceof Ds||(u==null?void 0:u.name)===Ds.name}var Zu,dp,Kt,Bt,ut,V,$a,Pt,gl,ie,Bu,mp,Ms,Yu,Ja,Us,hp,ii,Gu,qs;const ui=class ui{constructor(r,s={}){It(this,ie);Xe(this,"request");It(this,Kt);It(this,Bt,0);It(this,ut);It(this,V);It(this,$a);It(this,Pt);It(this,gl);var f,m,h;if(Zt(this,ut,r),Zt(this,V,{...s,headers:cp(U(this,ut).headers,s.headers),hooks:fp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Nb(s.method??U(this,ut).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:qb(s.retry),throwHttpErrors:s.throwHttpErrors??!0,timeout:s.timeout??1e4,fetch:s.fetch??globalThis.fetch.bind(globalThis),context:s.context??{}}),typeof U(this,ut)!="string"&&!(U(this,ut)instanceof URL||U(this,ut)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(U(this,V).prefixUrl&&typeof U(this,ut)=="string"){if(U(this,ut).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");U(this,V).prefixUrl.endsWith("/")||(U(this,V).prefixUrl+="/"),Zt(this,ut,U(this,V).prefixUrl+U(this,ut))}bb&&ip&&(Zt(this,Pt,U(this,V).signal??U(this,ut).signal),Zt(this,Kt,new globalThis.AbortController),U(this,V).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Kt).signal]):U(this,Kt).signal),xh&&(U(this,V).duplex="half"),U(this,V).json!==void 0&&(U(this,V).body=((m=(f=U(this,V)).stringifyJson)==null?void 0:m.call(f,U(this,V).json))??JSON.stringify(U(this,V).json),U(this,V).headers.set("content-type",U(this,V).headers.get("content-type")??"application/json"));const o=s.headers&&new globalThis.Headers(s.headers).has("content-type");if(U(this,ut)instanceof globalThis.Request&&(Sb&&U(this,V).body instanceof globalThis.FormData||U(this,V).body instanceof URLSearchParams)&&!o&&U(this,V).headers.delete("content-type"),this.request=new globalThis.Request(U(this,ut),U(this,V)),Yb(U(this,V).searchParams)){const g="?"+(typeof U(this,V).searchParams=="string"?U(this,V).searchParams.replace(/^\?/,""):new URLSearchParams(be(h=ui,Zu,dp).call(h,U(this,V).searchParams)).toString()),p=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,g);this.request=new globalThis.Request(p,U(this,V))}if(U(this,V).onUploadProgress){if(typeof U(this,V).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!xh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=be(this,ie,qs).call(this,this.request,U(this,V).body??void 0)}}static create(r,s){var h,x,g;const o=new ui(r,s),f=async()=>{var j,k,M,X,B,q,H,L,I,J,he,pe;if(typeof U(o,V).timeout=="number"&&U(o,V).timeout>js)throw new RangeError(`The \`timeout\` option cannot be greater than ${js}`);await Promise.resolve();let p=await be(j=o,ie,hp).call(j);for(const de of U(o,V).hooks.afterResponse){const W=be(k=o,ie,Ms).call(k,p.clone());let $;try{$=await de(o.request,be(M=o,ie,ii).call(M),W,{retryCount:U(o,Bt)})}catch(Pe){throw be(X=o,ie,Ja).call(X,W),be(B=o,ie,Ja).call(B,p),Pe}if($ instanceof op)throw be(q=o,ie,Ja).call(q,W),be(H=o,ie,Ja).call(H,p),new Rs($.options);const ue=$ instanceof globalThis.Response?$:p;W!==ue&&be(L=o,ie,Ja).call(L,W),p!==ue&&be(I=o,ie,Ja).call(I,p),p=ue}if(be(J=o,ie,Ms).call(J,p),!p.ok&&(typeof U(o,V).throwHttpErrors=="function"?U(o,V).throwHttpErrors(p.status):U(o,V).throwHttpErrors)){let de=new Ns(p,o.request,be(he=o,ie,ii).call(he));for(const W of U(o,V).hooks.beforeError)de=await W(de,{retryCount:U(o,Bt)});throw de}if(U(o,V).onDownloadProgress){if(typeof U(o,V).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!xb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const de=p.clone();return be(pe=o,ie,Ja).call(pe,p),zb(de,U(o,V).onDownloadProgress)}return p},m=be(h=o,ie,Us).call(h,f).finally(()=>{var j,k;const p=U(o,$a);be(j=o,ie,Yu).call(j,(p==null?void 0:p.body)??void 0),be(k=o,ie,Yu).call(k,o.request.body??void 0)});for(const[p,j]of Object.entries(Eb))p==="bytes"&&typeof((g=(x=globalThis.Response)==null?void 0:x.prototype)==null?void 0:g.bytes)!="function"||(m[p]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||j);const k=await m;if(p==="json"){if(k.status===204)return"";const M=await k.text();return M===""?"":s.parseJson?s.parseJson(M):JSON.parse(M)}return k[p]()});return m}};Zu=new WeakSet,dp=function(r){return r&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof URLSearchParams)?Object.fromEntries(Object.entries(r).filter(([,s])=>s!==void 0)):r},Kt=new WeakMap,Bt=new WeakMap,ut=new WeakMap,V=new WeakMap,$a=new WeakMap,Pt=new WeakMap,gl=new WeakMap,ie=new WeakSet,Bu=function(){const r=U(this,V).retry.delay(U(this,Bt));let s=r;U(this,V).retry.jitter===!0?s=Math.random()*r:typeof U(this,V).retry.jitter=="function"&&(s=U(this,V).retry.jitter(r),(!Number.isFinite(s)||s<0)&&(s=r));const o=U(this,V).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,s)},mp=async function(r){if(Pm(this,Bt)._++,U(this,Bt)>U(this,V).retry.limit)throw r;const s=r instanceof Error?r:new np(r);if(s instanceof Rs)return s.customDelay??be(this,ie,Bu).call(this);if(!U(this,V).retry.methods.includes(this.request.method.toLowerCase()))throw r;if(U(this,V).retry.shouldRetry!==void 0){const o=await U(this,V).retry.shouldRetry({error:s,retryCount:U(this,Bt)});if(o===!1)throw r;if(o===!0)return be(this,ie,Bu).call(this)}if(Xb(r)&&!U(this,V).retry.retryOnTimeout)throw r;if(Gb(r)){if(!U(this,V).retry.statusCodes.includes(r.response.status))throw r;const o=r.response.headers.get("Retry-After")??r.response.headers.get("RateLimit-Reset")??r.response.headers.get("X-RateLimit-Retry-After")??r.response.headers.get("X-RateLimit-Reset")??r.response.headers.get("X-Rate-Limit-Reset");if(o&&U(this,V).retry.afterStatusCodes.includes(r.response.status)){let f=Number(o)*1e3;Number.isNaN(f)?f=Date.parse(o)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const m=U(this,V).retry.maxRetryAfter??f;return f<m?f:m}if(r.response.status===413)throw r}return be(this,ie,Bu).call(this)},Ms=function(r){return U(this,V).parseJson&&(r.json=async()=>U(this,V).parseJson(await r.text())),r},Yu=function(r){r&&r.cancel().catch(()=>{})},Ja=function(r){be(this,ie,Yu).call(this,r.body??void 0)},Us=async function(r){try{return await r()}catch(s){const o=Math.min(await be(this,ie,mp).call(this,s),js);if(U(this,Bt)<1)throw s;if(await Lb(o,U(this,Pt)?{signal:U(this,Pt)}:{}),s instanceof Rs&&s.customRequest){const f=U(this,V).signal?new globalThis.Request(s.customRequest,{signal:U(this,V).signal}):new globalThis.Request(s.customRequest);be(this,ie,Gu).call(this,f)}for(const f of U(this,V).hooks.beforeRetry){const m=await f({request:this.request,options:be(this,ie,ii).call(this),error:s,retryCount:U(this,Bt)});if(m instanceof globalThis.Request){be(this,ie,Gu).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===rp)return}return be(this,ie,Us).call(this,r)}},hp=async function(){var s;(s=U(this,Kt))!=null&&s.signal.aborted&&(Zt(this,Kt,new globalThis.AbortController),U(this,V).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Kt).signal]):U(this,Kt).signal,this.request=new globalThis.Request(this.request,{signal:U(this,V).signal}));for(const o of U(this,V).hooks.beforeRequest){const f=await o(this.request,be(this,ie,ii).call(this),{retryCount:U(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){be(this,ie,Gu).call(this,f);break}}const r=Bb(this.request,U(this,V));return Zt(this,$a,this.request),this.request=U(this,$a).clone(),U(this,V).timeout===!1?U(this,V).fetch(U(this,$a),r):Hb(U(this,$a),r,U(this,Kt),U(this,V))},ii=function(){if(!U(this,gl)){const{hooks:r,...s}=U(this,V);Zt(this,gl,Object.freeze(s))}return U(this,gl)},Gu=function(r){Zt(this,gl,void 0),this.request=be(this,ie,qs).call(this,r)},qs=function(r,s){return!U(this,V).onUploadProgress||!r.body?r:Cb(r,U(this,V).onUploadProgress,s??U(this,V).body??void 0)},It(ui,Zu);let Qu=ui;/*! MIT License © Sindre Sorhus */const Hs=u=>{const r=(s,o)=>Qu.create(s,Nu(u,o));for(const s of up)r[s]=(o,f)=>Qu.create(o,Nu(u,f,{method:s}));return r.create=s=>Hs(Nu(s)),r.extend=s=>(typeof s=="function"&&(s=s(u??{})),Hs(Nu(u,s))),r.stop=rp,r.retry=wb,r},Eh=Hs();let Mu=null;const Xu=Eh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[u=>{const r=xa.getState().accessToken;r&&u.headers.set("Authorization",`Bearer ${r}`)}],afterResponse:[async(u,r,s)=>{if(s.status===401&&!u.headers.has("X-Retry-After-Refresh")){Mu||(Mu=xa.getState().refresh().finally(()=>{Mu=null}));try{await Mu}catch{throw s}const o=xa.getState().accessToken;return o&&u.headers.set("Authorization",`Bearer ${o}`),u.headers.set("X-Retry-After-Refresh","1"),Eh(u,r)}}]}}),Vb=3e4;function Qb(u){if(u.link)return u.link;const r=(u.title+" "+u.body).match(/task\s*#?(\d+)/i);if(r)return`/tasks/${r[1]}`;const s=(u.title+" "+u.body).match(/worker\s+(\S+)/i);return s?`/workers/${s[1]}`:null}function pp(){const u=Fa(),[r,s]=v.useState([]),[o,f]=v.useState(0),[m,h]=v.useState(!1),[x,g]=v.useState(!1),p=v.useRef(null),{t:j}=ta(),k=v.useRef(async()=>{try{g(!0);const q=(await Xu.get("web/notifications",{searchParams:{limit:"20"}}).json()).data,H=q.filter(L=>!L.isRead).length;s(L=>L.length===q.length&&L.every((I,J)=>I.id===q[J].id&&I.isRead===q[J].isRead)?L:q),f(L=>L===H?L:H)}catch{}finally{g(!1)}});v.useEffect(()=>{k.current();const B=setInterval(()=>k.current(),Vb);return()=>clearInterval(B)},[]),v.useEffect(()=>{function B(q){p.current&&!p.current.contains(q.target)&&h(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);async function M(B){try{await Xu.post(`web/notifications/${B}/read`),s(q=>q.map(H=>H.id===B?{...H,isRead:!0}:H)),f(q=>Math.max(0,q-1))}catch{}}async function X(){try{await Xu.post("web/notifications/read-all"),s(B=>B.map(q=>({...q,isRead:!0}))),f(0)}catch{}}return _.jsxs("div",{className:"relative",ref:p,children:[_.jsxs("button",{type:"button",onClick:()=>h(B=>!B),"aria-label":j("common.notifications"),className:"relative inline-flex items-center justify-center rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]",children:[_.jsx(Bv,{size:16}),o>0&&_.jsx("span",{className:"absolute right-0 top-0 flex h-3 min-w-3 items-center justify-center rounded-full bg-[var(--destructive)] px-0.5 text-[8px] font-semibold leading-none text-white",children:o})]}),m&&_.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-[min(320px,calc(100vw-2rem))] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[_.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[_.jsx("span",{className:"text-sm font-semibold",children:j("common.notifications")}),o>0&&_.jsxs("button",{type:"button",onClick:X,"aria-label":j("common.mark_all_read"),className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[_.jsx(Yv,{className:"h-3.5 w-3.5"}),j("common.mark_all_read")]})]}),_.jsx("div",{className:"max-h-80 overflow-y-auto",children:x&&r.length===0?_.jsx("div",{className:"flex justify-center py-8",children:_.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):r.length===0?_.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[_.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),_.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:j("common.no_notifications")})]}):r.map(B=>{const q=Qb(B);return _.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${q?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${B.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{q&&(B.isRead||M(B.id),h(!1),u(q))},children:[_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsx("p",{className:"text-sm font-medium",children:B.title}),_.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:B.body}),_.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(B.createdAt).toLocaleString()})]}),!B.isRead&&_.jsx("button",{type:"button",onClick:H=>{H.stopPropagation(),M(B.id)},"aria-label":j("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:_.jsx(Gv,{className:"h-3.5 w-3.5"})})]},B.id)})})]})]})}function Zb(u){return{tasks:u.tasks.map(r=>({type:"task",id:r.id,title:`#${r.id} ${r.description}`,subtitle:`${r.status} · ${r.project_key}`})),workers:(u.workers??[]).map(r=>({type:"worker",id:r.id,title:r.name,subtitle:`${r.hostname} · ${r.status}`})),projects:u.projects.map(r=>({type:"project",id:r.key,title:r.name,subtitle:r.repository}))}}const Kb=300,kh={tasks:nb,workers:Fh,projects:Jv},Jb={tasks:"tasks",workers:"workers",projects:"projects"};function _p({renderTrigger:u}={}){const[r,s]=v.useState(""),[o,f]=v.useState({tasks:[],workers:[],projects:[]}),[m,h]=v.useState(!1),[x,g]=v.useState(!1),[p,j]=v.useState(0),k=v.useRef(null),M=v.useRef(null),X=v.useRef(void 0),B=v.useRef(void 0),q=Fa(),{t:H}=ta(),L=v.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),I=v.useCallback(async $=>{var Pe;if(!$.trim()){f({tasks:[],workers:[],projects:[]});return}(Pe=B.current)==null||Pe.abort();const ue=new AbortController;B.current=ue;try{h(!0);const Je=await Xu.get("web/search",{searchParams:{q:$},signal:ue.signal}).json();f(Zb(Je)),j(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{ue.signal.aborted||h(!1)}},[]);v.useEffect(()=>(X.current&&clearTimeout(X.current),X.current=setTimeout(()=>I(r),Kb),()=>{X.current&&clearTimeout(X.current)}),[r,I]),v.useEffect(()=>{function $(ue){ue.key==="/"&&!x&&!(ue.target instanceof HTMLInputElement||ue.target instanceof HTMLTextAreaElement)&&(ue.preventDefault(),g(!0)),ue.key==="Escape"&&x&&(ue.preventDefault(),J())}return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[x]),v.useEffect(()=>{x&&setTimeout(()=>{var $;return($=M.current)==null?void 0:$.focus()},50)},[x]);function J(){g(!1),s(""),f({tasks:[],workers:[],projects:[]}),j(0)}function he($){switch(J(),$.type){case"task":q(`/tasks/${$.id}`);break;case"worker":q(`/workers/${$.id}`);break;case"project":q(`/projects/${$.id}`);break}}function pe($){$.key==="ArrowDown"?($.preventDefault(),j(ue=>Math.min(ue+1,L.length-1))):$.key==="ArrowUp"?($.preventDefault(),j(ue=>Math.max(ue-1,0))):$.key==="Enter"&&L[p]&&($.preventDefault(),he(L[p]))}const de=L.length>0;let W=0;return _.jsxs(_.Fragment,{children:[u?u(()=>g(!0)):_.jsxs("button",{type:"button",onClick:()=>g(!0),className:"flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:[_.jsx(Wh,{className:"h-3.5 w-3.5"}),_.jsx("span",{children:H("common.search_placeholder")}),_.jsx("kbd",{className:"ml-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[11px] text-[var(--text-muted)]",children:"/"})]}),x&&_.jsx("div",{ref:k,className:"fixed inset-0 z-[100] flex items-start justify-center pt-4 md:pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:$=>{$.target===k.current&&J()},children:_.jsxs("div",{className:"mx-3 w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl sm:mx-4 md:mx-0",children:[_.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[_.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),_.jsx("input",{ref:M,type:"text",placeholder:H("common.search_input_placeholder"),value:r,onChange:$=>s($.target.value),onKeyDown:pe,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),m&&_.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),_.jsx("div",{className:"max-h-[50vh] overflow-y-auto sm:max-h-[60vh] md:max-h-[400px]",children:r.trim()&&!de&&!m?_.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:H("common.no_search_results",{query:r})}):Object.keys(kh).map($=>{const ue=o[$];if(ue.length===0)return null;const Pe=kh[$],Je=W;return W+=ue.length,_.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[_.jsx(Pe,{className:"h-3 w-3"}),_.jsx("span",{className:"text-[11px] lowercase tracking-wider",children:Jb[$]})]}),ue.map((qe,At)=>{const rt=Je+At,De=rt===p;return _.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${De?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>he(qe),onMouseEnter:()=>j(rt),children:[_.jsx("span",{className:`text-xs ${De?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:De?">":" "}),_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsx("p",{className:"truncate text-sm",children:qe.title}),qe.subtitle&&_.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",children:qe.subtitle})]})]},`${qe.type}-${qe.id}`)})]},$)})}),_.jsxs("div",{className:"hidden items-center gap-4 border-t border-[var(--border)] px-4 py-2 md:flex",children:[_.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↑↓"})," ",H("common.navigate_hint")]}),_.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↵"})," ",H("common.select_hint")]}),_.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"esc"})," ",H("common.close_hint")]})]})]})})]})}const $b={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"},wh="confirm-dialog-title";function Th(u){return Array.from(u.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))}function Wb({isOpen:u,onClose:r,onConfirm:s,title:o,message:f,confirmVariant:m="danger",isLoading:h,...x}){const{t:g}=ta(),p=x.confirmLabel??g("common.confirm"),j=x.cancelLabel??g("common.cancel"),k=v.useRef(null),M=v.useRef(null),X=$b[m];v.useEffect(()=>{if(!u)return;M.current=document.activeElement;const q=requestAnimationFrame(()=>{if(k.current){const H=Th(k.current);H.length>0&&H[0].focus()}});return()=>{var H;cancelAnimationFrame(q),(H=M.current)==null||H.focus()}},[u]);const B=v.useCallback(q=>{if(q.key==="Tab"&&k.current){const H=Th(k.current);if(H.length===0)return;const L=H[0],I=H[H.length-1];q.shiftKey?document.activeElement===L&&(q.preventDefault(),I.focus()):document.activeElement===I&&(q.preventDefault(),L.focus())}},[]);return u?_.jsx("div",{onClick:r,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"max(1rem, 10vh)",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:_.jsxs("div",{ref:k,role:"dialog","aria-modal":"true","aria-labelledby":wh,onClick:q=>q.stopPropagation(),onKeyDown:B,style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem"},children:[_.jsx("div",{style:{marginBottom:"1.25rem"},children:_.jsxs("div",{id:wh,style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[_.jsx(Ih,{style:{width:"1rem",height:"1rem"}}),o]})}),_.jsx("div",{style:{marginBottom:"1.25rem"},children:_.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f})}),_.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[_.jsx("button",{type:"button",onClick:r,disabled:h,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",cursor:h?"not-allowed":"pointer",opacity:h?.7:1,transition:"color 0.15s, border-color 0.15s"},children:j}),_.jsx("button",{type:"button",onClick:s,disabled:h,style:{flex:1,padding:"0.5rem",backgroundColor:X,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:h?"not-allowed":"pointer",opacity:h?.7:1},children:h?g("common.processing"):p})]})]})}):null}const yp=v.createContext({setActions:()=>{}});function n1(u){const{setActions:r}=v.useContext(yp);v.useEffect(()=>(r(u),()=>r(null)),[u,r])}const gp=v.createContext({setSubtitle:()=>{}});function i1(u){const{setSubtitle:r}=v.useContext(gp);v.useEffect(()=>(r(u),()=>r(null)),[u,r])}const Fb=[{to:"/home",label:"terminal",icon:Js},{to:"/tasks",label:"tasks",icon:$h},{to:"/dashboard",label:"dashboard",icon:Jh},{to:"/workers",label:"workers",icon:Fh},{to:"/projects",label:"projects",icon:$v},{to:"/access-tokens",label:"access_tokens",icon:Fv}],Ib=[{to:"/docs/cli",label:"cli",icon:Js},{to:"/docs/api",label:"api",icon:Kv},{to:"/docs/skill",label:"skill",icon:lb}],Pb=[{to:"/admin",label:"admin",icon:ab}],e0=[{to:"/home",label:"terminal",icon:Js},{to:"/tasks",label:"tasks",icon:$h},{to:"/dashboard",label:"dashboard",icon:Jh}],Uu={"/home":{title:"common.breadcrumb_terminal",subtitle:"common.breadcrumb_terminal_sub"},"/dashboard":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/workers":{title:"common.breadcrumb_workers",subtitle:"common.breadcrumb_workers_sub"},"/projects":{title:"common.breadcrumb_projects",subtitle:"common.breadcrumb_projects_sub"},"/admin":{title:"common.breadcrumb_admin",subtitle:"common.breadcrumb_admin_sub"},"/profile":{title:"common.breadcrumb_profile",subtitle:"common.breadcrumb_profile_sub"},"/access-tokens":{title:"common.breadcrumb_access_tokens",subtitle:"common.breadcrumb_access_tokens_sub"},"/docs":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_sub"},"/docs/cli":{title:"common.breadcrumb_docs_cli",subtitle:"common.breadcrumb_docs_cli_sub"},"/docs/api":{title:"common.breadcrumb_docs_api",subtitle:"common.breadcrumb_docs_api_sub"},"/docs/skill":{title:"common.breadcrumb_docs_skill",subtitle:"common.breadcrumb_docs_skill_sub"}};function t0(u){const{t:r}=ta();if(Uu[u]){const o=Uu[u];return{title:r(o.title),subtitle:r(o.subtitle)}}const s="/"+u.split("/").filter(Boolean)[0];if(Uu[s]){const o=Uu[s],f=u.split("/").filter(Boolean).slice(1).join(" / ");return{title:r(o.title),subtitle:f||r(o.subtitle)}}return{title:u.slice(1).replace(/\//g," // ")||"home"}}function a0(u,r){return u==="/home"?r==="/home":u==="/dashboard"?r==="/dashboard":r.startsWith(u)}function l0(){const u=yt(),{t:r}=ta(),s={terminal:r("terminal_home.title"),dashboard:r("dashboard.title"),tasks:r("tasks.title"),workers:r("workers.title")};return _.jsxs("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)] md:hidden",style:{height:60,paddingTop:8,paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:[e0.map(({to:o,label:f,icon:m})=>{const h=a0(o,u.pathname);return _.jsxs(Ks,{to:o,className:"flex flex-1 flex-col items-center gap-1",children:[_.jsx(m,{size:18,className:h?"text-[var(--accent)]":"text-[var(--text-muted)]"}),_.jsx("span",{className:`text-[11px] lowercase ${h?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),_.jsx(_p,{renderTrigger:o=>_.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[_.jsx(Wh,{size:18,className:"text-[var(--text-muted)]"}),_.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:r("common.search_placeholder")})]})})]})}function n0(){const u=Fa(),{t:r}=ta();return _.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:"calc(56px + env(safe-area-inset-top, 0px))",minHeight:"calc(56px + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)"},children:[_.jsxs("button",{onClick:()=>u("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[_.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",children:_.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),_.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",children:r("common.overlord")})]}),_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx("button",{onClick:()=>u("/profile"),className:"p-2 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]","aria-label":r("common.profile"),children:_.jsx(ub,{size:18})}),_.jsx(pp,{}),_.jsx(lp,{})]})]})}function As({label:u,items:r,collapsed:s}){return _.jsxs("div",{className:"mt-4 first:mt-0",children:[!s&&_.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:u}),r.map(({to:o,label:f,icon:m})=>_.jsx(Ks,{to:o,className:({isActive:h})=>`flex items-center text-sm lowercase transition-colors ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${h?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:h})=>_.jsxs(_.Fragment,{children:[_.jsx(m,{size:14,style:{flexShrink:0}}),!s&&_.jsx("span",{children:h?`> ${f}`:` ${f}`})]})},o))]})}function i0(){const{user:u,logout:r}=xa(),s=Fa(),[o,f]=v.useState(!1),m=fb(),{t:h}=ta(),{sidebarCollapsed:x,toggleSidebar:g}=mb();function p(){r(),s("/login")}return _.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)] transition-[width,min-width] duration-300 overflow-hidden",style:{width:x?56:240,minWidth:x?56:240,backgroundColor:"var(--bg-card)"},children:[_.jsx("div",{className:"flex items-center px-5",style:{height:48},children:_.jsxs("button",{onClick:()=>s("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[_.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{flexShrink:0},children:_.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),!x&&_.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)"},children:h("common.overlord")})]})}),_.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[_.jsx(As,{label:h("common.navigation"),items:Fb,collapsed:x}),_.jsx(As,{label:h("common.docs_section"),items:Ib,collapsed:x}),m&&_.jsx(As,{label:h("common.admin_section"),items:Pb,collapsed:x})]}),_.jsx("div",{className:`px-3 py-1 ${x?"flex justify-center":""}`,children:_.jsx("button",{onClick:g,className:"flex items-center justify-center w-full py-1.5 rounded-[4px] text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)] hover:bg-[var(--accent)]/5","aria-label":x?"expand sidebar":"collapse sidebar",children:x?_.jsx(Vv,{size:14}):_.jsx(Xv,{size:14})})}),_.jsx("div",{className:"border-t border-[var(--border)] p-3",children:_.jsxs("div",{className:`flex items-center py-2 ${x?"justify-center":"gap-3 px-3"}`,children:[_.jsx("button",{onClick:()=>s("/profile"),className:"flex h-7 w-7 items-center justify-center text-xs font-bold text-black transition-opacity hover:opacity-80",style:{backgroundColor:"var(--accent)",borderRadius:4,flexShrink:0},title:h("common.profile"),children:((u==null?void 0:u.username)??"u")[0].toUpperCase()}),!x&&_.jsxs(_.Fragment,{children:[_.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:h("common.profile"),children:[_.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(u==null?void 0:u.username)??"user"}),_.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(u==null?void 0:u.role)??"user"})]}),_.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":h("common.log_out"),children:_.jsx(Pv,{size:14})})]})]})}),_.jsx(Wb,{isOpen:o,onClose:()=>f(!1),onConfirm:p,title:h("common.logout_title"),message:h("common.logout_message"),confirmLabel:h("common.logout"),confirmVariant:"warning"})]})}function u0({headerActions:u,subtitleOverride:r}){const s=yt(),{title:o,subtitle:f}=t0(s.pathname),m=r??f;return _.jsxs("header",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5",style:{height:48,minHeight:48,backgroundColor:"var(--bg-card)"},children:[_.jsxs("div",{className:"text-sm lowercase",children:[_.jsx("span",{style:{color:"var(--text-primary)"},children:o}),m&&_.jsxs("span",{style:{color:"var(--text-muted)"},children:[" ","// ",m]})]}),_.jsxs("div",{className:"flex items-center gap-3",children:[u,_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(_p,{}),_.jsx(pp,{}),_.jsx(lp,{})]})]})]})}function r0(){const[u,r]=v.useState(null),[s,o]=v.useState(null),m=yt().pathname==="/home";return v.useEffect(()=>pb.getState().init(),[]),_.jsxs("div",{className:"flex font-mono",style:{height:"100dvh",minHeight:"100vh"},children:[_.jsx(i0,{}),_.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[_.jsx(n0,{}),_.jsx(u0,{headerActions:u,subtitleOverride:s}),_.jsx("main",{className:m?"flex-1 overflow-hidden bg-[var(--bg-primary)] pb-[calc(60px+env(safe-area-inset-bottom,0px))] md:pb-0":"flex-1 overflow-auto bg-[var(--bg-primary)] p-4 pb-[calc(60px+env(safe-area-inset-bottom,0px)+0.5rem)] md:p-6 md:pb-6",children:_.jsx(yp.Provider,{value:{setActions:r},children:_.jsx(gp.Provider,{value:{setSubtitle:o},children:_.jsx(tv,{})})})}),_.jsx(l0,{})]})]})}function Rh(u){var s;const r=(s=u.state)==null?void 0:s.from;return r?{from:r}:{from:{pathname:u.pathname,search:u.search}}}function li({children:u,requireAdmin:r=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:m}=xa(),h=yt();if(m)return _.jsx("div",{className:"flex h-screen items-center justify-center",children:_.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})});if(!s)return _.jsx(ni,{to:"/login",state:Rh(h),replace:!0});if(f){const x=Rh(h);return h.pathname!=="/totp-setup"&&h.pathname!=="/bind"?_.jsx(ni,{to:"/totp-setup",state:x,replace:!0}):h.pathname==="/bind"?(sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(x.from)),_.jsx(ni,{to:"/totp-setup",state:x,replace:!0})):_.jsx(_.Fragment,{children:u})}return r&&(o==null?void 0:o.role)!==Ph.ADMIN?_.jsx(ni,{to:"/home",replace:!0}):_.jsx(_.Fragment,{children:u})}function o0({children:u}){const{theme:r,resolved:s,setResolved:o}=ap();return v.useEffect(()=>{if(r!=="system"){o(r);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const m=h=>o(h.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[r,o]),v.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),_.jsx(_.Fragment,{children:u})}class s0 extends v.Component{constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}render(){var r;return this.state.hasError?_.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8 font-mono",children:[_.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Lu("common.runtime_error")}),_.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((r=this.state.error)==null?void 0:r.message)||Lu("common.an_unexpected_error_occurred")}),_.jsxs("button",{onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[_.jsx(tb,{className:"h-3.5 w-3.5"}),Lu("common.reload")]})]}):this.props.children}}function c0({isOpen:u}){const r=Fa(),{logout:s,setSessionExpired:o}=xa(),{t:f}=ta();function m(){s(),o(!1),r("/login")}return u?_.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[_.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),_.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:_.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[_.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:_.jsx(Iv,{className:"h-7 w-7 text-[var(--warning)]"})}),_.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),_.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),_.jsx("button",{type:"button",className:"w-full rounded-[4px] bg-[var(--accent)] px-3 py-2.5 text-xs font-medium text-black hover:opacity-90 transition-opacity",onClick:m,children:f("auth.go_to_login")})]})})]}):null}const jh=5;let ba=[];const Ls=new Set;function vp(){Ls.forEach(u=>u())}function f0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(u,r,s=4e3){const o=f0();return ba=[...ba,{id:o,variant:u,message:r,duration:s}],ba.length>jh&&(ba=ba.slice(ba.length-jh)),vp(),o}Wa.success=(u,r)=>Wa("success",u,r);Wa.error=(u,r)=>Wa("error",u,r);Wa.warning=(u,r)=>Wa("warning",u,r);Wa.info=(u,r)=>Wa("info",u,r);function d0(u){ba=ba.filter(r=>r.id!==u),vp()}function m0(){const[,u]=v.useState(0);return v.useEffect(()=>{const r=()=>u(s=>s+1);return Ls.add(r),()=>{Ls.delete(r)}},[]),ba}const h0={success:{icon:Qv,borderColor:"var(--accent)"},error:{icon:Zv,borderColor:"var(--destructive)"},warning:{icon:Ih,borderColor:"var(--warning)"},info:{icon:Wv,borderColor:"var(--info)"}};function p0({item:u}){const r=h0[u.variant],s=r.icon,{t:o}=ta(),f=v.useCallback(()=>d0(u.id),[u.id]);return v.useEffect(()=>{if(!u.duration)return;const m=setTimeout(f,u.duration);return()=>clearTimeout(m)},[u.duration,f]),_.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${r.borderColor}`},role:"alert",children:[_.jsx(s,{className:"h-4 w-4 shrink-0",style:{color:r.borderColor}}),_.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:u.message}),_.jsx("button",{onClick:f,className:"shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]","aria-label":o("common.dismiss_notification"),children:_.jsx(rb,{className:"h-3.5 w-3.5"})})]})}function _0(){const u=m0();return u.length===0?null:_.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-[9999] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2",children:u.map(r=>_.jsx("div",{className:"pointer-events-auto",children:_.jsx(p0,{item:r})},r.id))})}const y0=v.lazy(()=>Ce(()=>import("./LandingPage-CqS0E2eC.js"),__vite__mapDeps([0,1,2,3,4,5]))),g0=v.lazy(()=>Ce(()=>import("./LoginPage-DDXkdcz_.js"),[])),v0=v.lazy(()=>Ce(()=>import("./TotpSetupPage-MSCCURj9.js"),[])),b0=v.lazy(()=>Ce(()=>import("./NotFoundPage-D5x5BrlX.js"),[])),x0=v.lazy(()=>Ce(()=>import("./HomePage-D4yv4orb.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),S0=v.lazy(()=>Ce(()=>import("./TerminalHomePage-BwXJjr-a.js"),__vite__mapDeps([15,16,17,18,10,11,19,8,12,14,20,2,21]))),E0=v.lazy(()=>Ce(()=>import("./TaskListPage-Dh59ldSZ.js"),__vite__mapDeps([22,16,7,8,12,13,19,5,23,9,20]))),k0=v.lazy(()=>Ce(()=>import("./TaskDetailPage-CfwEj1hy.js"),__vite__mapDeps([24,16,17,18,12,19,8,25,26,27,28]))),w0=v.lazy(()=>Ce(()=>import("./WorkerListPage-CserMjGO.js"),__vite__mapDeps([29,8,30,31,32,33,21,5,28,19,23,9,14,20]))),T0=v.lazy(()=>Ce(()=>import("./WorkerDetailPage-R2veIzKo.js"),__vite__mapDeps([34,12,8,35,30,14,36,25]))),R0=v.lazy(()=>Ce(()=>import("./WorkerSetupGuidePage-SqO2lzVa.js"),__vite__mapDeps([31,32,33,21]))),j0=v.lazy(()=>Ce(()=>import("./ProjectListPage-Bz7I2D0H.js"),__vite__mapDeps([37,19,23,9,12,14,20]))),A0=v.lazy(()=>Ce(()=>import("./ProjectDetailPage-DJexg49z.js"),__vite__mapDeps([38,39,19,12,8,35,14,40,36,20]))),z0=v.lazy(()=>Ce(()=>import("./EditProjectPage-7WCsNltj.js"),__vite__mapDeps([41,19,39,20]))),C0=v.lazy(()=>Ce(()=>import("./PipelineEditorPage-y2-Q8ofQ.js"),__vite__mapDeps([42,19,13]))),O0=v.lazy(()=>Ce(()=>import("./ProfilePage-DN7usHOi.js"),__vite__mapDeps([43,44,35,14]))),N0=v.lazy(()=>Ce(()=>import("./BindPlatformPage-CTqzpOmt.js"),[])),D0=v.lazy(()=>Ce(()=>import("./AccessTokensPage-DPQB2fbi.js"),__vite__mapDeps([45,19,23,9,12,14,20,5,36]))),M0=v.lazy(()=>Ce(()=>import("./CliReferencePage-C8GmlwUz.js"),__vite__mapDeps([46,47,5,20]))),U0=v.lazy(()=>Ce(()=>import("./ApiReferencePage-CiGvbLxL.js"),__vite__mapDeps([48,47,5,20]))),q0=v.lazy(()=>Ce(()=>import("./SkillPage-BInwZTQh.js"),__vite__mapDeps([49,27,5]))),H0=v.lazy(()=>Ce(()=>import("./AdminPage-BqVelYNu.js"),__vite__mapDeps([50,4,3,51,33]))),L0=v.lazy(()=>Ce(()=>import("./DeveloperManage-r6y2AoB4.js"),__vite__mapDeps([52,19,44,23,9,14,8,20,4,40,26]))),B0=v.lazy(()=>Ce(()=>import("./BotManage-CIR0rrK7.js"),__vite__mapDeps([53,19,36,20,23,9,14,8,3,40]))),Y0=v.lazy(()=>Ce(()=>import("./TokenManage-B0Cpv6SO.js"),__vite__mapDeps([54,32,5,27,23,9,14,8,20]))),G0=v.lazy(()=>Ce(()=>import("./AuditLogPage-DSo4jVYm.js"),__vite__mapDeps([55,19,23,9,51,11]))),X0=v.lazy(()=>Ce(()=>import("./SettingsPage-HaUCcsgl.js"),[]));function V0(){return _.jsx("div",{className:"flex h-full items-center justify-center",children:_.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function Q0(){const u=xa(r=>r.sessionExpired);return _.jsxs(o0,{children:[_.jsx(_0,{}),_.jsx(s0,{children:_.jsxs(jv,{children:[_.jsx(c0,{isOpen:u}),_.jsx(v.Suspense,{fallback:_.jsx(V0,{}),children:_.jsxs(lv,{children:[_.jsx(xe,{path:"/",element:_.jsx(y0,{})}),_.jsx(xe,{path:"/login",element:_.jsx(g0,{})}),_.jsx(xe,{path:"/totp-setup",element:_.jsx(li,{children:_.jsx(v0,{})})}),_.jsx(xe,{path:"/bind",element:_.jsx(li,{children:_.jsx(N0,{})})}),_.jsxs(xe,{element:_.jsx(li,{children:_.jsx(r0,{})}),children:[_.jsx(xe,{path:"/home",element:_.jsx(S0,{})}),_.jsx(xe,{path:"/dashboard",element:_.jsx(x0,{})}),_.jsx(xe,{path:"/tasks",element:_.jsx(E0,{})}),_.jsx(xe,{path:"/tasks/:id",element:_.jsx(k0,{})}),_.jsx(xe,{path:"/workers",element:_.jsx(w0,{})}),_.jsx(xe,{path:"/workers/setup",element:_.jsx(li,{requireAdmin:!0,children:_.jsx(R0,{})})}),_.jsx(xe,{path:"/workers/:id",element:_.jsx(T0,{})}),_.jsx(xe,{path:"/projects",element:_.jsx(j0,{})}),_.jsx(xe,{path:"/projects/:key",element:_.jsx(A0,{})}),_.jsx(xe,{path:"/projects/:key/edit",element:_.jsx(z0,{})}),_.jsx(xe,{path:"/projects/:key/pipeline",element:_.jsx(C0,{})}),_.jsx(xe,{path:"/profile",element:_.jsx(O0,{})}),_.jsx(xe,{path:"/access-tokens",element:_.jsx(D0,{})}),_.jsx(xe,{path:"/docs/cli",element:_.jsx(M0,{})}),_.jsx(xe,{path:"/docs/api",element:_.jsx(U0,{})}),_.jsx(xe,{path:"/docs/skill",element:_.jsx(q0,{})}),_.jsxs(xe,{path:"/admin",element:_.jsx(li,{requireAdmin:!0,children:_.jsx(H0,{})}),children:[_.jsx(xe,{index:!0,element:_.jsx(ni,{to:"developers",replace:!0})}),_.jsx(xe,{path:"developers",element:_.jsx(L0,{})}),_.jsx(xe,{path:"bots",element:_.jsx(B0,{})}),_.jsx(xe,{path:"tokens",element:_.jsx(Y0,{})}),_.jsx(xe,{path:"audit-logs",element:_.jsx(G0,{})}),_.jsx(xe,{path:"settings",element:_.jsx(X0,{})})]})]}),_.jsx(xe,{path:"*",element:_.jsx(b0,{})})]})})]})})]})}xa.getState().initialize();tg.createRoot(document.getElementById("root")).render(_.jsx(v.StrictMode,{children:_.jsx(Q0,{})}));export{I0 as A,P0 as B,Gv as C,Ph as D,Ks as E,t1 as F,e1 as G,Ns as H,Zv as I,a1 as J,Fv as K,Qh as L,ni as N,tv as O,F0 as P,ju as R,Fh as S,lp as T,W0 as W,rb as X,ta as a,Js as b,je as c,ab as d,Fa as e,yt as f,Xu as g,fb as h,pb as i,_ as j,Wu as k,$0 as l,i1 as m,n1 as n,Wh as o,$h as p,l1 as q,v as r,Wb as s,Wa as t,xa as u,K0 as v,Qv as w,Ih as x,tb as y,J0 as z};
225
+ ov login https://overlord.yourdomain.com`,setup_step_3_link:"development workflow",go_to_app:"open app",documentation:"documentation",api:"api",copy_install_command:"copy install command"},docs:{cli_reference:"cli",cli_subtitle:"// command-line tools",api_reference:"api",api_subtitle:"// rest api endpoints",quick_start:"// quick start",developer_cli:"developer cli (ov)",admin_cli:"admin cli (overlord)",authentication:"// authentication",usage:"usage",flags:"flags",example:"example",request_body:"request body",response:"response",quick_start_with_token:"// quick start with your token",replace_token_hint:"// replace <your-token> with the actual token value from your access tokens page",cli_tools_desc:"// overlord provides two cli tools: {ov} (developer cli) and {overlord} (admin/ops cli)",api_base_url_desc:"// base url: {url} · all endpoints return json · auth via bearer token in authorization header"},onboarding:{getting_started:"// getting started",completed_count:"{done}/{total} completed",dismiss:"dismiss",all_done:"all set! you're ready to go.",admin_create_project_title:"create your first project",admin_create_project_desc:"set up a project with a git repo and pipeline",admin_register_worker_title:"register a worker",admin_register_worker_desc:"generate a token and set up a worker to run tasks",admin_create_developer_title:"create a developer account",admin_create_developer_desc:"add team members who can create and monitor tasks",admin_configure_bot_title:"configure a chat bot",admin_configure_bot_desc:"register a Lark or Slack bot to enable task management via chat",admin_first_task_title:"create your first task",admin_first_task_desc:"verify the full pipeline works end-to-end",lead_view_projects_title:"view your projects",lead_view_projects_desc:"check the projects assigned to you",lead_configure_pipeline_title:"configure a pipeline",lead_configure_pipeline_desc:"set up stages for your project workflow",lead_add_member_title:"add a team member",lead_add_member_desc:"invite developers to your project",lead_first_task_title:"create your first task",lead_first_task_desc:"submit a task and watch it execute",dev_install_cli_title:"install the ov cli",dev_install_cli_desc:"npm install -g @overlordai/developer-cli",dev_setup_cli_title:"run ov setup",dev_setup_cli_desc:"connect to the server and authenticate",dev_link_chat_title:"link your chat account",dev_link_chat_desc:'send "bind" to the bot in Lark or Slack to connect your account',dev_view_projects_title:"explore projects",dev_view_projects_desc:"browse available projects and their pipelines",dev_first_task_title:"create your first task",dev_first_task_desc:"submit a task via web or cli",go_to_projects:"go to projects",go_to_workers:"go to workers",go_to_tasks:"go to tasks",go_to_bots:"manage bots",manage_developers:"manage developers",cli:"cli",setup_guide:"setup guide"},bind:{title:"// link platform account",linking:"linking your account...",success:"account linked successfully!",success_detail:"your {platform} account has been connected. you can now use bot commands.",error:"failed to link account",invalid_token:'this link is invalid or has expired. send "bind" to the bot again to get a new link.',back_to_home:"go to dashboard",no_token:"no bind token provided."},terminal_home:{title:"terminal",select_project:"project...",all_projects:"all projects",task_description_placeholder:"describe the task...",new_task:"new task",no_active_tasks:"no active tasks",create_task_hint:"create a task using the bar above to get started"}};function gb(u,r){const s=r.split(".");let o=u;for(const f of s){if(o==null||typeof o!="object")return r;o=o[f]}return typeof o=="string"?o:r}function vb(u,r){return r?u.replace(/\{(\w+)\}/g,(s,o)=>r[o]!=null?String(r[o]):`{${o}}`):u}function Lu(u,r){return vb(gb(yb,u),r)}function ta(){return{t:v.useCallback((r,s)=>Lu(r,s),[])}}function lp(){const{theme:u,setTheme:r}=ap(),{t:s}=ta(),o=u==="dark"||u==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function f(){r(o?"light":"dark")}return _.jsx("button",{onClick:f,className:"flex items-center gap-1.5 rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]","aria-label":s(o?"common.switch_to_light":"common.switch_to_dark"),title:s(o?"common.light_mode":"common.dark_mode"),children:o?_.jsx(ib,{size:16}):_.jsx(eb,{size:16})})}class Ns extends Error{constructor(s,o,f){const m=s.status||s.status===0?s.status:"",h=s.statusText??"",x=`${m} ${h}`.trim(),g=x?`status code ${x}`:"an unknown error";super(`Request failed with ${g}: ${o.method} ${o.url}`);Xe(this,"response");Xe(this,"request");Xe(this,"options");this.name="HTTPError",this.response=s,this.request=o,this.options=f}}class np extends Error{constructor(s){let o="Non-error value was thrown";try{typeof s=="string"?o=s:s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&(o=s.message)}catch{}super(o);Xe(this,"name","NonError");Xe(this,"value");this.value=s}}class Rs extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new np(s.cause):void 0;super(s!=null&&s.code?`Forced retry: ${s.code}`:"Forced retry",o?{cause:o}:void 0);Xe(this,"name","ForceRetryError");Xe(this,"customDelay");Xe(this,"code");Xe(this,"customRequest");this.customDelay=s==null?void 0:s.delay,this.code=s==null?void 0:s.code,this.customRequest=s==null?void 0:s.request}}const xh=(()=>{let u=!1,r=!1;const s=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(s&&o)try{r=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return u&&!r})(),bb=typeof globalThis.AbortController=="function",ip=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",xb=typeof globalThis.ReadableStream=="function",Sb=typeof globalThis.FormData=="function",up=["get","post","put","patch","head","delete"],Eb={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},js=2147483647,kb=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,rp=Symbol("stop");class op{constructor(r){Xe(this,"options");this.options=r}}const wb=u=>new op(u),Tb={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Rb={next:!0},jb={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Ab=u=>{if(!u)return 0;if(u instanceof FormData){let r=0;for(const[s,o]of u)r+=kb,r+=new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length,r+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return r}if(u instanceof Blob)return u.size;if(u instanceof ArrayBuffer)return u.byteLength;if(typeof u=="string")return new TextEncoder().encode(u).length;if(u instanceof URLSearchParams)return new TextEncoder().encode(u.toString()).length;if("byteLength"in u)return u.byteLength;if(typeof u=="object"&&u!==null)try{const r=JSON.stringify(u);return new TextEncoder().encode(r).length}catch{return 0}return 0},sp=(u,r,s)=>{let o,f=0;return u.pipeThrough(new TransformStream({transform(m,h){if(h.enqueue(m),o){f+=o.byteLength;let x=r===0?0:f/r;x>=1&&(x=1-Number.EPSILON),s==null||s({percent:x,totalBytes:Math.max(r,f),transferredBytes:f},o)}o=m},flush(){o&&(f+=o.byteLength,s==null||s({percent:1,totalBytes:Math.max(r,f),transferredBytes:f},o))}}))},zb=(u,r)=>{if(!u.body)return u;if(u.status===204)return new Response(null,{status:u.status,statusText:u.statusText,headers:u.headers});const s=Math.max(0,Number(u.headers.get("content-length"))||0);return new Response(sp(u.body,s,r),{status:u.status,statusText:u.statusText,headers:u.headers})},Cb=(u,r,s)=>{if(!u.body)return u;const o=Ab(s??u.body);return new Request(u,{duplex:"half",body:sp(u.body,o,r)})},yl=u=>u!==null&&typeof u=="object",Nu=(...u)=>{for(const r of u)if((!yl(r)||Array.isArray(r))&&r!==void 0)throw new TypeError("The `options` argument must be an object");return $s({},...u)},cp=(u={},r={})=>{const s=new globalThis.Headers(u),o=r instanceof globalThis.Headers,f=new globalThis.Headers(r);for(const[m,h]of f.entries())o&&h==="undefined"||h===void 0?s.delete(m):s.set(m,h);return s};function Du(u,r,s){return Object.hasOwn(r,s)&&r[s]===void 0?[]:$s(u[s]??[],r[s]??[])}const fp=(u={},r={})=>({beforeRequest:Du(u,r,"beforeRequest"),beforeRetry:Du(u,r,"beforeRetry"),afterResponse:Du(u,r,"afterResponse"),beforeError:Du(u,r,"beforeError")}),Ob=(u,r)=>{const s=new URLSearchParams;for(const o of[u,r])if(o!==void 0)if(o instanceof URLSearchParams)for(const[f,m]of o.entries())s.append(f,m);else if(Array.isArray(o))for(const f of o){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");s.append(String(f[0]),String(f[1]))}else if(yl(o))for(const[f,m]of Object.entries(o))m!==void 0&&s.append(f,String(m));else{const f=new URLSearchParams(o);for(const[m,h]of f.entries())s.append(m,h)}return s},$s=(...u)=>{let r={},s={},o={},f;const m=[];for(const h of u)if(Array.isArray(h))Array.isArray(r)||(r=[]),r=[...r,...h];else if(yl(h)){for(let[x,g]of Object.entries(h)){if(x==="signal"&&g instanceof globalThis.AbortSignal){m.push(g);continue}if(x==="context"){if(g!=null&&(!yl(g)||Array.isArray(g)))throw new TypeError("The `context` option must be an object");r={...r,context:g==null?{}:{...r.context,...g}};continue}if(x==="searchParams"){g==null?f=void 0:f=f===void 0?g:Ob(f,g);continue}yl(g)&&x in r&&(g=$s(r[x],g)),r={...r,[x]:g}}yl(h.hooks)&&(o=fp(o,h.hooks),r.hooks=o),yl(h.headers)&&(s=cp(s,h.headers),r.headers=s)}return f!==void 0&&(r.searchParams=f),m.length>0&&(m.length===1?r.signal=m[0]:ip?r.signal=AbortSignal.any(m):r.signal=m.at(-1)),r},Nb=u=>up.includes(u)?u.toUpperCase():u,Db=["get","put","head","delete","options","trace"],Mb=[408,413,429,500,502,503,504],Ub=[413,429,503],Sh={limit:2,methods:Db,statusCodes:Mb,afterStatusCodes:Ub,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:u=>.3*2**(u-1)*1e3,jitter:void 0,retryOnTimeout:!1},qb=(u={})=>{if(typeof u=="number")return{...Sh,limit:u};if(u.methods&&!Array.isArray(u.methods))throw new Error("retry.methods must be an array");if(u.methods&&(u.methods=u.methods.map(s=>s.toLowerCase())),u.statusCodes&&!Array.isArray(u.statusCodes))throw new Error("retry.statusCodes must be an array");const r=Object.fromEntries(Object.entries(u).filter(([,s])=>s!==void 0));return{...Sh,...r}};class Ds extends Error{constructor(s){super(`Request timed out: ${s.method} ${s.url}`);Xe(this,"request");this.name="TimeoutError",this.request=s}}async function Hb(u,r,s,o){return new Promise((f,m)=>{const h=setTimeout(()=>{s&&s.abort(),m(new Ds(u))},o.timeout);o.fetch(u,r).then(f).catch(m).then(()=>{clearTimeout(h)})})}async function Lb(u,{signal:r}){return new Promise((s,o)=>{r&&(r.throwIfAborted(),r.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(m),o(r.reason)}const m=setTimeout(()=>{r==null||r.removeEventListener("abort",f),s()},u)})}const Bb=(u,r)=>{const s={};for(const o in r)Object.hasOwn(r,o)&&!(o in jb)&&!(o in Tb)&&(!(o in u)||o in Rb)&&(s[o]=r[o]);return s},Yb=u=>u===void 0?!1:Array.isArray(u)?u.length>0:u instanceof URLSearchParams?u.size>0:typeof u=="object"?Object.keys(u).length>0:typeof u=="string"?u.trim().length>0:!!u;function Gb(u){return u instanceof Ns||(u==null?void 0:u.name)===Ns.name}function Xb(u){return u instanceof Ds||(u==null?void 0:u.name)===Ds.name}var Zu,dp,Kt,Bt,ut,V,$a,Pt,gl,ie,Bu,mp,Ms,Yu,Ja,Us,hp,ii,Gu,qs;const ui=class ui{constructor(r,s={}){It(this,ie);Xe(this,"request");It(this,Kt);It(this,Bt,0);It(this,ut);It(this,V);It(this,$a);It(this,Pt);It(this,gl);var f,m,h;if(Zt(this,ut,r),Zt(this,V,{...s,headers:cp(U(this,ut).headers,s.headers),hooks:fp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Nb(s.method??U(this,ut).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:qb(s.retry),throwHttpErrors:s.throwHttpErrors??!0,timeout:s.timeout??1e4,fetch:s.fetch??globalThis.fetch.bind(globalThis),context:s.context??{}}),typeof U(this,ut)!="string"&&!(U(this,ut)instanceof URL||U(this,ut)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(U(this,V).prefixUrl&&typeof U(this,ut)=="string"){if(U(this,ut).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");U(this,V).prefixUrl.endsWith("/")||(U(this,V).prefixUrl+="/"),Zt(this,ut,U(this,V).prefixUrl+U(this,ut))}bb&&ip&&(Zt(this,Pt,U(this,V).signal??U(this,ut).signal),Zt(this,Kt,new globalThis.AbortController),U(this,V).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Kt).signal]):U(this,Kt).signal),xh&&(U(this,V).duplex="half"),U(this,V).json!==void 0&&(U(this,V).body=((m=(f=U(this,V)).stringifyJson)==null?void 0:m.call(f,U(this,V).json))??JSON.stringify(U(this,V).json),U(this,V).headers.set("content-type",U(this,V).headers.get("content-type")??"application/json"));const o=s.headers&&new globalThis.Headers(s.headers).has("content-type");if(U(this,ut)instanceof globalThis.Request&&(Sb&&U(this,V).body instanceof globalThis.FormData||U(this,V).body instanceof URLSearchParams)&&!o&&U(this,V).headers.delete("content-type"),this.request=new globalThis.Request(U(this,ut),U(this,V)),Yb(U(this,V).searchParams)){const g="?"+(typeof U(this,V).searchParams=="string"?U(this,V).searchParams.replace(/^\?/,""):new URLSearchParams(be(h=ui,Zu,dp).call(h,U(this,V).searchParams)).toString()),p=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,g);this.request=new globalThis.Request(p,U(this,V))}if(U(this,V).onUploadProgress){if(typeof U(this,V).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!xh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=be(this,ie,qs).call(this,this.request,U(this,V).body??void 0)}}static create(r,s){var h,x,g;const o=new ui(r,s),f=async()=>{var j,k,M,X,B,q,H,L,I,J,he,pe;if(typeof U(o,V).timeout=="number"&&U(o,V).timeout>js)throw new RangeError(`The \`timeout\` option cannot be greater than ${js}`);await Promise.resolve();let p=await be(j=o,ie,hp).call(j);for(const de of U(o,V).hooks.afterResponse){const W=be(k=o,ie,Ms).call(k,p.clone());let $;try{$=await de(o.request,be(M=o,ie,ii).call(M),W,{retryCount:U(o,Bt)})}catch(Pe){throw be(X=o,ie,Ja).call(X,W),be(B=o,ie,Ja).call(B,p),Pe}if($ instanceof op)throw be(q=o,ie,Ja).call(q,W),be(H=o,ie,Ja).call(H,p),new Rs($.options);const ue=$ instanceof globalThis.Response?$:p;W!==ue&&be(L=o,ie,Ja).call(L,W),p!==ue&&be(I=o,ie,Ja).call(I,p),p=ue}if(be(J=o,ie,Ms).call(J,p),!p.ok&&(typeof U(o,V).throwHttpErrors=="function"?U(o,V).throwHttpErrors(p.status):U(o,V).throwHttpErrors)){let de=new Ns(p,o.request,be(he=o,ie,ii).call(he));for(const W of U(o,V).hooks.beforeError)de=await W(de,{retryCount:U(o,Bt)});throw de}if(U(o,V).onDownloadProgress){if(typeof U(o,V).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!xb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const de=p.clone();return be(pe=o,ie,Ja).call(pe,p),zb(de,U(o,V).onDownloadProgress)}return p},m=be(h=o,ie,Us).call(h,f).finally(()=>{var j,k;const p=U(o,$a);be(j=o,ie,Yu).call(j,(p==null?void 0:p.body)??void 0),be(k=o,ie,Yu).call(k,o.request.body??void 0)});for(const[p,j]of Object.entries(Eb))p==="bytes"&&typeof((g=(x=globalThis.Response)==null?void 0:x.prototype)==null?void 0:g.bytes)!="function"||(m[p]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||j);const k=await m;if(p==="json"){if(k.status===204)return"";const M=await k.text();return M===""?"":s.parseJson?s.parseJson(M):JSON.parse(M)}return k[p]()});return m}};Zu=new WeakSet,dp=function(r){return r&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof URLSearchParams)?Object.fromEntries(Object.entries(r).filter(([,s])=>s!==void 0)):r},Kt=new WeakMap,Bt=new WeakMap,ut=new WeakMap,V=new WeakMap,$a=new WeakMap,Pt=new WeakMap,gl=new WeakMap,ie=new WeakSet,Bu=function(){const r=U(this,V).retry.delay(U(this,Bt));let s=r;U(this,V).retry.jitter===!0?s=Math.random()*r:typeof U(this,V).retry.jitter=="function"&&(s=U(this,V).retry.jitter(r),(!Number.isFinite(s)||s<0)&&(s=r));const o=U(this,V).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,s)},mp=async function(r){if(Pm(this,Bt)._++,U(this,Bt)>U(this,V).retry.limit)throw r;const s=r instanceof Error?r:new np(r);if(s instanceof Rs)return s.customDelay??be(this,ie,Bu).call(this);if(!U(this,V).retry.methods.includes(this.request.method.toLowerCase()))throw r;if(U(this,V).retry.shouldRetry!==void 0){const o=await U(this,V).retry.shouldRetry({error:s,retryCount:U(this,Bt)});if(o===!1)throw r;if(o===!0)return be(this,ie,Bu).call(this)}if(Xb(r)&&!U(this,V).retry.retryOnTimeout)throw r;if(Gb(r)){if(!U(this,V).retry.statusCodes.includes(r.response.status))throw r;const o=r.response.headers.get("Retry-After")??r.response.headers.get("RateLimit-Reset")??r.response.headers.get("X-RateLimit-Retry-After")??r.response.headers.get("X-RateLimit-Reset")??r.response.headers.get("X-Rate-Limit-Reset");if(o&&U(this,V).retry.afterStatusCodes.includes(r.response.status)){let f=Number(o)*1e3;Number.isNaN(f)?f=Date.parse(o)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const m=U(this,V).retry.maxRetryAfter??f;return f<m?f:m}if(r.response.status===413)throw r}return be(this,ie,Bu).call(this)},Ms=function(r){return U(this,V).parseJson&&(r.json=async()=>U(this,V).parseJson(await r.text())),r},Yu=function(r){r&&r.cancel().catch(()=>{})},Ja=function(r){be(this,ie,Yu).call(this,r.body??void 0)},Us=async function(r){try{return await r()}catch(s){const o=Math.min(await be(this,ie,mp).call(this,s),js);if(U(this,Bt)<1)throw s;if(await Lb(o,U(this,Pt)?{signal:U(this,Pt)}:{}),s instanceof Rs&&s.customRequest){const f=U(this,V).signal?new globalThis.Request(s.customRequest,{signal:U(this,V).signal}):new globalThis.Request(s.customRequest);be(this,ie,Gu).call(this,f)}for(const f of U(this,V).hooks.beforeRetry){const m=await f({request:this.request,options:be(this,ie,ii).call(this),error:s,retryCount:U(this,Bt)});if(m instanceof globalThis.Request){be(this,ie,Gu).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===rp)return}return be(this,ie,Us).call(this,r)}},hp=async function(){var s;(s=U(this,Kt))!=null&&s.signal.aborted&&(Zt(this,Kt,new globalThis.AbortController),U(this,V).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Kt).signal]):U(this,Kt).signal,this.request=new globalThis.Request(this.request,{signal:U(this,V).signal}));for(const o of U(this,V).hooks.beforeRequest){const f=await o(this.request,be(this,ie,ii).call(this),{retryCount:U(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){be(this,ie,Gu).call(this,f);break}}const r=Bb(this.request,U(this,V));return Zt(this,$a,this.request),this.request=U(this,$a).clone(),U(this,V).timeout===!1?U(this,V).fetch(U(this,$a),r):Hb(U(this,$a),r,U(this,Kt),U(this,V))},ii=function(){if(!U(this,gl)){const{hooks:r,...s}=U(this,V);Zt(this,gl,Object.freeze(s))}return U(this,gl)},Gu=function(r){Zt(this,gl,void 0),this.request=be(this,ie,qs).call(this,r)},qs=function(r,s){return!U(this,V).onUploadProgress||!r.body?r:Cb(r,U(this,V).onUploadProgress,s??U(this,V).body??void 0)},It(ui,Zu);let Qu=ui;/*! MIT License © Sindre Sorhus */const Hs=u=>{const r=(s,o)=>Qu.create(s,Nu(u,o));for(const s of up)r[s]=(o,f)=>Qu.create(o,Nu(u,f,{method:s}));return r.create=s=>Hs(Nu(s)),r.extend=s=>(typeof s=="function"&&(s=s(u??{})),Hs(Nu(u,s))),r.stop=rp,r.retry=wb,r},Eh=Hs();let Mu=null;const Xu=Eh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[u=>{const r=xa.getState().accessToken;r&&u.headers.set("Authorization",`Bearer ${r}`)}],afterResponse:[async(u,r,s)=>{if(s.status===401&&!u.headers.has("X-Retry-After-Refresh")){Mu||(Mu=xa.getState().refresh().finally(()=>{Mu=null}));try{await Mu}catch{throw s}const o=xa.getState().accessToken;return o&&u.headers.set("Authorization",`Bearer ${o}`),u.headers.set("X-Retry-After-Refresh","1"),Eh(u,r)}}]}}),Vb=3e4;function Qb(u){if(u.link)return u.link;const r=(u.title+" "+u.body).match(/task\s*#?(\d+)/i);if(r)return`/tasks/${r[1]}`;const s=(u.title+" "+u.body).match(/worker\s+(\S+)/i);return s?`/workers/${s[1]}`:null}function pp(){const u=Fa(),[r,s]=v.useState([]),[o,f]=v.useState(0),[m,h]=v.useState(!1),[x,g]=v.useState(!1),p=v.useRef(null),{t:j}=ta(),k=v.useRef(async()=>{try{g(!0);const q=(await Xu.get("web/notifications",{searchParams:{limit:"20"}}).json()).data,H=q.filter(L=>!L.isRead).length;s(L=>L.length===q.length&&L.every((I,J)=>I.id===q[J].id&&I.isRead===q[J].isRead)?L:q),f(L=>L===H?L:H)}catch{}finally{g(!1)}});v.useEffect(()=>{k.current();const B=setInterval(()=>k.current(),Vb);return()=>clearInterval(B)},[]),v.useEffect(()=>{function B(q){p.current&&!p.current.contains(q.target)&&h(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);async function M(B){try{await Xu.post(`web/notifications/${B}/read`),s(q=>q.map(H=>H.id===B?{...H,isRead:!0}:H)),f(q=>Math.max(0,q-1))}catch{}}async function X(){try{await Xu.post("web/notifications/read-all"),s(B=>B.map(q=>({...q,isRead:!0}))),f(0)}catch{}}return _.jsxs("div",{className:"relative",ref:p,children:[_.jsxs("button",{type:"button",onClick:()=>h(B=>!B),"aria-label":j("common.notifications"),className:"relative inline-flex items-center justify-center rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]",children:[_.jsx(Bv,{size:16}),o>0&&_.jsx("span",{className:"absolute right-0 top-0 flex h-3 min-w-3 items-center justify-center rounded-full bg-[var(--destructive)] px-0.5 text-[8px] font-semibold leading-none text-white",children:o})]}),m&&_.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-[min(320px,calc(100vw-2rem))] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[_.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[_.jsx("span",{className:"text-sm font-semibold",children:j("common.notifications")}),o>0&&_.jsxs("button",{type:"button",onClick:X,"aria-label":j("common.mark_all_read"),className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[_.jsx(Yv,{className:"h-3.5 w-3.5"}),j("common.mark_all_read")]})]}),_.jsx("div",{className:"max-h-80 overflow-y-auto",children:x&&r.length===0?_.jsx("div",{className:"flex justify-center py-8",children:_.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):r.length===0?_.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[_.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),_.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:j("common.no_notifications")})]}):r.map(B=>{const q=Qb(B);return _.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${q?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${B.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{q&&(B.isRead||M(B.id),h(!1),u(q))},children:[_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsx("p",{className:"text-sm font-medium",children:B.title}),_.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:B.body}),_.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(B.createdAt).toLocaleString()})]}),!B.isRead&&_.jsx("button",{type:"button",onClick:H=>{H.stopPropagation(),M(B.id)},"aria-label":j("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:_.jsx(Gv,{className:"h-3.5 w-3.5"})})]},B.id)})})]})]})}function Zb(u){return{tasks:u.tasks.map(r=>({type:"task",id:r.id,title:`#${r.id} ${r.description}`,subtitle:`${r.status} · ${r.project_key}`})),workers:(u.workers??[]).map(r=>({type:"worker",id:r.id,title:r.name,subtitle:`${r.hostname} · ${r.status}`})),projects:u.projects.map(r=>({type:"project",id:r.key,title:r.name,subtitle:r.repository}))}}const Kb=300,kh={tasks:nb,workers:Fh,projects:Jv},Jb={tasks:"tasks",workers:"workers",projects:"projects"};function _p({renderTrigger:u}={}){const[r,s]=v.useState(""),[o,f]=v.useState({tasks:[],workers:[],projects:[]}),[m,h]=v.useState(!1),[x,g]=v.useState(!1),[p,j]=v.useState(0),k=v.useRef(null),M=v.useRef(null),X=v.useRef(void 0),B=v.useRef(void 0),q=Fa(),{t:H}=ta(),L=v.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),I=v.useCallback(async $=>{var Pe;if(!$.trim()){f({tasks:[],workers:[],projects:[]});return}(Pe=B.current)==null||Pe.abort();const ue=new AbortController;B.current=ue;try{h(!0);const Je=await Xu.get("web/search",{searchParams:{q:$},signal:ue.signal}).json();f(Zb(Je)),j(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{ue.signal.aborted||h(!1)}},[]);v.useEffect(()=>(X.current&&clearTimeout(X.current),X.current=setTimeout(()=>I(r),Kb),()=>{X.current&&clearTimeout(X.current)}),[r,I]),v.useEffect(()=>{function $(ue){ue.key==="/"&&!x&&!(ue.target instanceof HTMLInputElement||ue.target instanceof HTMLTextAreaElement)&&(ue.preventDefault(),g(!0)),ue.key==="Escape"&&x&&(ue.preventDefault(),J())}return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[x]),v.useEffect(()=>{x&&setTimeout(()=>{var $;return($=M.current)==null?void 0:$.focus()},50)},[x]);function J(){g(!1),s(""),f({tasks:[],workers:[],projects:[]}),j(0)}function he($){switch(J(),$.type){case"task":q(`/tasks/${$.id}`);break;case"worker":q(`/workers/${$.id}`);break;case"project":q(`/projects/${$.id}`);break}}function pe($){$.key==="ArrowDown"?($.preventDefault(),j(ue=>Math.min(ue+1,L.length-1))):$.key==="ArrowUp"?($.preventDefault(),j(ue=>Math.max(ue-1,0))):$.key==="Enter"&&L[p]&&($.preventDefault(),he(L[p]))}const de=L.length>0;let W=0;return _.jsxs(_.Fragment,{children:[u?u(()=>g(!0)):_.jsxs("button",{type:"button",onClick:()=>g(!0),className:"flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:[_.jsx(Wh,{className:"h-3.5 w-3.5"}),_.jsx("span",{children:H("common.search_placeholder")}),_.jsx("kbd",{className:"ml-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[11px] text-[var(--text-muted)]",children:"/"})]}),x&&_.jsx("div",{ref:k,className:"fixed inset-0 z-[100] flex items-start justify-center pt-4 md:pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:$=>{$.target===k.current&&J()},children:_.jsxs("div",{className:"mx-3 w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl sm:mx-4 md:mx-0",children:[_.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[_.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),_.jsx("input",{ref:M,type:"text",placeholder:H("common.search_input_placeholder"),value:r,onChange:$=>s($.target.value),onKeyDown:pe,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),m&&_.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),_.jsx("div",{className:"max-h-[50vh] overflow-y-auto sm:max-h-[60vh] md:max-h-[400px]",children:r.trim()&&!de&&!m?_.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:H("common.no_search_results",{query:r})}):Object.keys(kh).map($=>{const ue=o[$];if(ue.length===0)return null;const Pe=kh[$],Je=W;return W+=ue.length,_.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[_.jsx(Pe,{className:"h-3 w-3"}),_.jsx("span",{className:"text-[11px] lowercase tracking-wider",children:Jb[$]})]}),ue.map((qe,At)=>{const rt=Je+At,De=rt===p;return _.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${De?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>he(qe),onMouseEnter:()=>j(rt),children:[_.jsx("span",{className:`text-xs ${De?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:De?">":" "}),_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsx("p",{className:"truncate text-sm",children:qe.title}),qe.subtitle&&_.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",children:qe.subtitle})]})]},`${qe.type}-${qe.id}`)})]},$)})}),_.jsxs("div",{className:"hidden items-center gap-4 border-t border-[var(--border)] px-4 py-2 md:flex",children:[_.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↑↓"})," ",H("common.navigate_hint")]}),_.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↵"})," ",H("common.select_hint")]}),_.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"esc"})," ",H("common.close_hint")]})]})]})})]})}const $b={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"},wh="confirm-dialog-title";function Th(u){return Array.from(u.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))}function Wb({isOpen:u,onClose:r,onConfirm:s,title:o,message:f,confirmVariant:m="danger",isLoading:h,...x}){const{t:g}=ta(),p=x.confirmLabel??g("common.confirm"),j=x.cancelLabel??g("common.cancel"),k=v.useRef(null),M=v.useRef(null),X=$b[m];v.useEffect(()=>{if(!u)return;M.current=document.activeElement;const q=requestAnimationFrame(()=>{if(k.current){const H=Th(k.current);H.length>0&&H[0].focus()}});return()=>{var H;cancelAnimationFrame(q),(H=M.current)==null||H.focus()}},[u]);const B=v.useCallback(q=>{if(q.key==="Tab"&&k.current){const H=Th(k.current);if(H.length===0)return;const L=H[0],I=H[H.length-1];q.shiftKey?document.activeElement===L&&(q.preventDefault(),I.focus()):document.activeElement===I&&(q.preventDefault(),L.focus())}},[]);return u?_.jsx("div",{onClick:r,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"max(1rem, 10vh)",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:_.jsxs("div",{ref:k,role:"dialog","aria-modal":"true","aria-labelledby":wh,onClick:q=>q.stopPropagation(),onKeyDown:B,style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem"},children:[_.jsx("div",{style:{marginBottom:"1.25rem"},children:_.jsxs("div",{id:wh,style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[_.jsx(Ih,{style:{width:"1rem",height:"1rem"}}),o]})}),_.jsx("div",{style:{marginBottom:"1.25rem"},children:_.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f})}),_.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[_.jsx("button",{type:"button",onClick:r,disabled:h,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",cursor:h?"not-allowed":"pointer",opacity:h?.7:1,transition:"color 0.15s, border-color 0.15s"},children:j}),_.jsx("button",{type:"button",onClick:s,disabled:h,style:{flex:1,padding:"0.5rem",backgroundColor:X,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:h?"not-allowed":"pointer",opacity:h?.7:1},children:h?g("common.processing"):p})]})]})}):null}const yp=v.createContext({setActions:()=>{}});function n1(u){const{setActions:r}=v.useContext(yp);v.useEffect(()=>(r(u),()=>r(null)),[u,r])}const gp=v.createContext({setSubtitle:()=>{}});function i1(u){const{setSubtitle:r}=v.useContext(gp);v.useEffect(()=>(r(u),()=>r(null)),[u,r])}const Fb=[{to:"/home",label:"terminal",icon:Js},{to:"/tasks",label:"tasks",icon:$h},{to:"/dashboard",label:"dashboard",icon:Jh},{to:"/workers",label:"workers",icon:Fh},{to:"/projects",label:"projects",icon:$v},{to:"/access-tokens",label:"access_tokens",icon:Fv}],Ib=[{to:"/docs/cli",label:"cli",icon:Js},{to:"/docs/api",label:"api",icon:Kv},{to:"/docs/skill",label:"skill",icon:lb}],Pb=[{to:"/admin",label:"admin",icon:ab}],e0=[{to:"/home",label:"terminal",icon:Js},{to:"/tasks",label:"tasks",icon:$h},{to:"/dashboard",label:"dashboard",icon:Jh}],Uu={"/home":{title:"common.breadcrumb_terminal",subtitle:"common.breadcrumb_terminal_sub"},"/dashboard":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/workers":{title:"common.breadcrumb_workers",subtitle:"common.breadcrumb_workers_sub"},"/projects":{title:"common.breadcrumb_projects",subtitle:"common.breadcrumb_projects_sub"},"/admin":{title:"common.breadcrumb_admin",subtitle:"common.breadcrumb_admin_sub"},"/profile":{title:"common.breadcrumb_profile",subtitle:"common.breadcrumb_profile_sub"},"/access-tokens":{title:"common.breadcrumb_access_tokens",subtitle:"common.breadcrumb_access_tokens_sub"},"/docs":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_sub"},"/docs/cli":{title:"common.breadcrumb_docs_cli",subtitle:"common.breadcrumb_docs_cli_sub"},"/docs/api":{title:"common.breadcrumb_docs_api",subtitle:"common.breadcrumb_docs_api_sub"},"/docs/skill":{title:"common.breadcrumb_docs_skill",subtitle:"common.breadcrumb_docs_skill_sub"}};function t0(u){const{t:r}=ta();if(Uu[u]){const o=Uu[u];return{title:r(o.title),subtitle:r(o.subtitle)}}const s="/"+u.split("/").filter(Boolean)[0];if(Uu[s]){const o=Uu[s],f=u.split("/").filter(Boolean).slice(1).join(" / ");return{title:r(o.title),subtitle:f||r(o.subtitle)}}return{title:u.slice(1).replace(/\//g," // ")||"home"}}function a0(u,r){return u==="/home"?r==="/home":u==="/dashboard"?r==="/dashboard":r.startsWith(u)}function l0(){const u=yt(),{t:r}=ta(),s={terminal:r("terminal_home.title"),dashboard:r("dashboard.title"),tasks:r("tasks.title"),workers:r("workers.title")};return _.jsxs("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)] md:hidden",style:{height:60,paddingTop:8,paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:[e0.map(({to:o,label:f,icon:m})=>{const h=a0(o,u.pathname);return _.jsxs(Ks,{to:o,className:"flex flex-1 flex-col items-center gap-1",children:[_.jsx(m,{size:18,className:h?"text-[var(--accent)]":"text-[var(--text-muted)]"}),_.jsx("span",{className:`text-[11px] lowercase ${h?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),_.jsx(_p,{renderTrigger:o=>_.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[_.jsx(Wh,{size:18,className:"text-[var(--text-muted)]"}),_.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:r("common.search_placeholder")})]})})]})}function n0(){const u=Fa(),{t:r}=ta();return _.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:"calc(56px + env(safe-area-inset-top, 0px))",minHeight:"calc(56px + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)"},children:[_.jsxs("button",{onClick:()=>u("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[_.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",children:_.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),_.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",children:r("common.overlord")})]}),_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx("button",{onClick:()=>u("/profile"),className:"p-2 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]","aria-label":r("common.profile"),children:_.jsx(ub,{size:18})}),_.jsx(pp,{}),_.jsx(lp,{})]})]})}function As({label:u,items:r,collapsed:s}){return _.jsxs("div",{className:"mt-4 first:mt-0",children:[!s&&_.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:u}),r.map(({to:o,label:f,icon:m})=>_.jsx(Ks,{to:o,className:({isActive:h})=>`flex items-center text-sm lowercase transition-colors ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${h?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:h})=>_.jsxs(_.Fragment,{children:[_.jsx(m,{size:14,style:{flexShrink:0}}),!s&&_.jsx("span",{children:h?`> ${f}`:` ${f}`})]})},o))]})}function i0(){const{user:u,logout:r}=xa(),s=Fa(),[o,f]=v.useState(!1),m=fb(),{t:h}=ta(),{sidebarCollapsed:x,toggleSidebar:g}=mb();function p(){r(),s("/login")}return _.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)] transition-[width,min-width] duration-300 overflow-hidden",style:{width:x?56:240,minWidth:x?56:240,backgroundColor:"var(--bg-card)"},children:[_.jsx("div",{className:"flex items-center px-5",style:{height:48},children:_.jsxs("button",{onClick:()=>s("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[_.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{flexShrink:0},children:_.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),!x&&_.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)"},children:h("common.overlord")})]})}),_.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[_.jsx(As,{label:h("common.navigation"),items:Fb,collapsed:x}),_.jsx(As,{label:h("common.docs_section"),items:Ib,collapsed:x}),m&&_.jsx(As,{label:h("common.admin_section"),items:Pb,collapsed:x})]}),_.jsx("div",{className:`px-3 py-1 ${x?"flex justify-center":""}`,children:_.jsx("button",{onClick:g,className:"flex items-center justify-center w-full py-1.5 rounded-[4px] text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)] hover:bg-[var(--accent)]/5","aria-label":x?"expand sidebar":"collapse sidebar",children:x?_.jsx(Vv,{size:14}):_.jsx(Xv,{size:14})})}),_.jsx("div",{className:"border-t border-[var(--border)] p-3",children:_.jsxs("div",{className:`flex items-center py-2 ${x?"justify-center":"gap-3 px-3"}`,children:[_.jsx("button",{onClick:()=>s("/profile"),className:"flex h-7 w-7 items-center justify-center text-xs font-bold text-black transition-opacity hover:opacity-80",style:{backgroundColor:"var(--accent)",borderRadius:4,flexShrink:0},title:h("common.profile"),children:((u==null?void 0:u.username)??"u")[0].toUpperCase()}),!x&&_.jsxs(_.Fragment,{children:[_.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:h("common.profile"),children:[_.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(u==null?void 0:u.username)??"user"}),_.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(u==null?void 0:u.role)??"user"})]}),_.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":h("common.log_out"),children:_.jsx(Pv,{size:14})})]})]})}),_.jsx(Wb,{isOpen:o,onClose:()=>f(!1),onConfirm:p,title:h("common.logout_title"),message:h("common.logout_message"),confirmLabel:h("common.logout"),confirmVariant:"warning"})]})}function u0({headerActions:u,subtitleOverride:r}){const s=yt(),{title:o,subtitle:f}=t0(s.pathname),m=r??f;return _.jsxs("header",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5",style:{height:48,minHeight:48,backgroundColor:"var(--bg-card)"},children:[_.jsxs("div",{className:"text-sm lowercase",children:[_.jsx("span",{style:{color:"var(--text-primary)"},children:o}),m&&_.jsxs("span",{style:{color:"var(--text-muted)"},children:[" ","// ",m]})]}),_.jsxs("div",{className:"flex items-center gap-3",children:[u,_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(_p,{}),_.jsx(pp,{}),_.jsx(lp,{})]})]})]})}function r0(){const[u,r]=v.useState(null),[s,o]=v.useState(null),m=yt().pathname==="/home";return v.useEffect(()=>pb.getState().init(),[]),_.jsxs("div",{className:"flex font-mono",style:{height:"100dvh",minHeight:"100vh"},children:[_.jsx(i0,{}),_.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[_.jsx(n0,{}),_.jsx(u0,{headerActions:u,subtitleOverride:s}),_.jsx("main",{className:m?"flex-1 overflow-hidden bg-[var(--bg-primary)] pb-[calc(60px+env(safe-area-inset-bottom,0px))] md:pb-0":"flex-1 overflow-auto bg-[var(--bg-primary)] p-4 pb-[calc(60px+env(safe-area-inset-bottom,0px)+0.5rem)] md:p-6 md:pb-6",children:_.jsx(yp.Provider,{value:{setActions:r},children:_.jsx(gp.Provider,{value:{setSubtitle:o},children:_.jsx(tv,{})})})}),_.jsx(l0,{})]})]})}function Rh(u){var s;const r=(s=u.state)==null?void 0:s.from;return r?{from:r}:{from:{pathname:u.pathname,search:u.search}}}function li({children:u,requireAdmin:r=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:m}=xa(),h=yt();if(m)return _.jsx("div",{className:"flex h-screen items-center justify-center",children:_.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})});if(!s)return _.jsx(ni,{to:"/login",state:Rh(h),replace:!0});if(f){const x=Rh(h);return h.pathname!=="/totp-setup"&&h.pathname!=="/bind"?_.jsx(ni,{to:"/totp-setup",state:x,replace:!0}):h.pathname==="/bind"?(sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(x.from)),_.jsx(ni,{to:"/totp-setup",state:x,replace:!0})):_.jsx(_.Fragment,{children:u})}return r&&(o==null?void 0:o.role)!==Ph.ADMIN?_.jsx(ni,{to:"/home",replace:!0}):_.jsx(_.Fragment,{children:u})}function o0({children:u}){const{theme:r,resolved:s,setResolved:o}=ap();return v.useEffect(()=>{if(r!=="system"){o(r);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const m=h=>o(h.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[r,o]),v.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),_.jsx(_.Fragment,{children:u})}class s0 extends v.Component{constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}render(){var r;return this.state.hasError?_.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8 font-mono",children:[_.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Lu("common.runtime_error")}),_.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((r=this.state.error)==null?void 0:r.message)||Lu("common.an_unexpected_error_occurred")}),_.jsxs("button",{onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[_.jsx(tb,{className:"h-3.5 w-3.5"}),Lu("common.reload")]})]}):this.props.children}}function c0({isOpen:u}){const r=Fa(),{logout:s,setSessionExpired:o}=xa(),{t:f}=ta();function m(){s(),o(!1),r("/login")}return u?_.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[_.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),_.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:_.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[_.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:_.jsx(Iv,{className:"h-7 w-7 text-[var(--warning)]"})}),_.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),_.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),_.jsx("button",{type:"button",className:"w-full rounded-[4px] bg-[var(--accent)] px-3 py-2.5 text-xs font-medium text-black hover:opacity-90 transition-opacity",onClick:m,children:f("auth.go_to_login")})]})})]}):null}const jh=5;let ba=[];const Ls=new Set;function vp(){Ls.forEach(u=>u())}function f0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(u,r,s=4e3){const o=f0();return ba=[...ba,{id:o,variant:u,message:r,duration:s}],ba.length>jh&&(ba=ba.slice(ba.length-jh)),vp(),o}Wa.success=(u,r)=>Wa("success",u,r);Wa.error=(u,r)=>Wa("error",u,r);Wa.warning=(u,r)=>Wa("warning",u,r);Wa.info=(u,r)=>Wa("info",u,r);function d0(u){ba=ba.filter(r=>r.id!==u),vp()}function m0(){const[,u]=v.useState(0);return v.useEffect(()=>{const r=()=>u(s=>s+1);return Ls.add(r),()=>{Ls.delete(r)}},[]),ba}const h0={success:{icon:Qv,borderColor:"var(--accent)"},error:{icon:Zv,borderColor:"var(--destructive)"},warning:{icon:Ih,borderColor:"var(--warning)"},info:{icon:Wv,borderColor:"var(--info)"}};function p0({item:u}){const r=h0[u.variant],s=r.icon,{t:o}=ta(),f=v.useCallback(()=>d0(u.id),[u.id]);return v.useEffect(()=>{if(!u.duration)return;const m=setTimeout(f,u.duration);return()=>clearTimeout(m)},[u.duration,f]),_.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${r.borderColor}`},role:"alert",children:[_.jsx(s,{className:"h-4 w-4 shrink-0",style:{color:r.borderColor}}),_.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:u.message}),_.jsx("button",{onClick:f,className:"shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]","aria-label":o("common.dismiss_notification"),children:_.jsx(rb,{className:"h-3.5 w-3.5"})})]})}function _0(){const u=m0();return u.length===0?null:_.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-[9999] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2",children:u.map(r=>_.jsx("div",{className:"pointer-events-auto",children:_.jsx(p0,{item:r})},r.id))})}const y0=v.lazy(()=>Ce(()=>import("./LandingPage-DP9U6Iea.js"),__vite__mapDeps([0,1,2,3,4,5]))),g0=v.lazy(()=>Ce(()=>import("./LoginPage-OLBwEvXt.js"),[])),v0=v.lazy(()=>Ce(()=>import("./TotpSetupPage-VeqXwL5k.js"),[])),b0=v.lazy(()=>Ce(()=>import("./NotFoundPage-DA9fVgox.js"),[])),x0=v.lazy(()=>Ce(()=>import("./HomePage-CO4wRT0y.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),S0=v.lazy(()=>Ce(()=>import("./TerminalHomePage-cz_7HYVr.js"),__vite__mapDeps([15,16,17,18,10,11,19,8,12,14,20,2,21]))),E0=v.lazy(()=>Ce(()=>import("./TaskListPage-BjPRD6v8.js"),__vite__mapDeps([22,16,7,8,12,13,19,5,23,9,20]))),k0=v.lazy(()=>Ce(()=>import("./TaskDetailPage-LdLghDpk.js"),__vite__mapDeps([24,16,17,18,12,19,8,25,26,27,28]))),w0=v.lazy(()=>Ce(()=>import("./WorkerListPage-P1hVwXGG.js"),__vite__mapDeps([29,8,30,31,32,33,21,5,28,19,23,9,14,20]))),T0=v.lazy(()=>Ce(()=>import("./WorkerDetailPage-BOn7z8cR.js"),__vite__mapDeps([34,12,8,35,30,14,36,25]))),R0=v.lazy(()=>Ce(()=>import("./WorkerSetupGuidePage-m-ZneK_i.js"),__vite__mapDeps([31,32,33,21]))),j0=v.lazy(()=>Ce(()=>import("./ProjectListPage-CitoAwwH.js"),__vite__mapDeps([37,19,23,9,12,14,20]))),A0=v.lazy(()=>Ce(()=>import("./ProjectDetailPage-CLqYqqVX.js"),__vite__mapDeps([38,39,19,12,8,35,14,40,36,20]))),z0=v.lazy(()=>Ce(()=>import("./EditProjectPage-DiVkK33D.js"),__vite__mapDeps([41,19,39,20]))),C0=v.lazy(()=>Ce(()=>import("./PipelineEditorPage-Ra4MjS17.js"),__vite__mapDeps([42,19,13]))),O0=v.lazy(()=>Ce(()=>import("./ProfilePage-BWGufJ03.js"),__vite__mapDeps([43,44,35,14]))),N0=v.lazy(()=>Ce(()=>import("./BindPlatformPage-ByhQZ5qX.js"),[])),D0=v.lazy(()=>Ce(()=>import("./AccessTokensPage-CUQDQyQ5.js"),__vite__mapDeps([45,19,23,9,12,14,20,5,36]))),M0=v.lazy(()=>Ce(()=>import("./CliReferencePage-BmEVf_Yf.js"),__vite__mapDeps([46,47,5,20]))),U0=v.lazy(()=>Ce(()=>import("./ApiReferencePage-DFFhnxAn.js"),__vite__mapDeps([48,47,5,20]))),q0=v.lazy(()=>Ce(()=>import("./SkillPage-D0lNlB7o.js"),__vite__mapDeps([49,27,5]))),H0=v.lazy(()=>Ce(()=>import("./AdminPage-ChDIUX_3.js"),__vite__mapDeps([50,4,3,51,33]))),L0=v.lazy(()=>Ce(()=>import("./DeveloperManage-959Sec6Y.js"),__vite__mapDeps([52,19,44,23,9,14,8,20,4,40,26]))),B0=v.lazy(()=>Ce(()=>import("./BotManage-BCCGabIK.js"),__vite__mapDeps([53,19,36,20,23,9,14,8,3,40]))),Y0=v.lazy(()=>Ce(()=>import("./TokenManage-DP0iub57.js"),__vite__mapDeps([54,32,5,27,23,9,14,8,20]))),G0=v.lazy(()=>Ce(()=>import("./AuditLogPage-X3KImiZ3.js"),__vite__mapDeps([55,19,23,9,51,11]))),X0=v.lazy(()=>Ce(()=>import("./SettingsPage-DHa6WOhU.js"),[]));function V0(){return _.jsx("div",{className:"flex h-full items-center justify-center",children:_.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function Q0(){const u=xa(r=>r.sessionExpired);return _.jsxs(o0,{children:[_.jsx(_0,{}),_.jsx(s0,{children:_.jsxs(jv,{children:[_.jsx(c0,{isOpen:u}),_.jsx(v.Suspense,{fallback:_.jsx(V0,{}),children:_.jsxs(lv,{children:[_.jsx(xe,{path:"/",element:_.jsx(y0,{})}),_.jsx(xe,{path:"/login",element:_.jsx(g0,{})}),_.jsx(xe,{path:"/totp-setup",element:_.jsx(li,{children:_.jsx(v0,{})})}),_.jsx(xe,{path:"/bind",element:_.jsx(li,{children:_.jsx(N0,{})})}),_.jsxs(xe,{element:_.jsx(li,{children:_.jsx(r0,{})}),children:[_.jsx(xe,{path:"/home",element:_.jsx(S0,{})}),_.jsx(xe,{path:"/dashboard",element:_.jsx(x0,{})}),_.jsx(xe,{path:"/tasks",element:_.jsx(E0,{})}),_.jsx(xe,{path:"/tasks/:id",element:_.jsx(k0,{})}),_.jsx(xe,{path:"/workers",element:_.jsx(w0,{})}),_.jsx(xe,{path:"/workers/setup",element:_.jsx(li,{requireAdmin:!0,children:_.jsx(R0,{})})}),_.jsx(xe,{path:"/workers/:id",element:_.jsx(T0,{})}),_.jsx(xe,{path:"/projects",element:_.jsx(j0,{})}),_.jsx(xe,{path:"/projects/:key",element:_.jsx(A0,{})}),_.jsx(xe,{path:"/projects/:key/edit",element:_.jsx(z0,{})}),_.jsx(xe,{path:"/projects/:key/pipeline",element:_.jsx(C0,{})}),_.jsx(xe,{path:"/profile",element:_.jsx(O0,{})}),_.jsx(xe,{path:"/access-tokens",element:_.jsx(D0,{})}),_.jsx(xe,{path:"/docs/cli",element:_.jsx(M0,{})}),_.jsx(xe,{path:"/docs/api",element:_.jsx(U0,{})}),_.jsx(xe,{path:"/docs/skill",element:_.jsx(q0,{})}),_.jsxs(xe,{path:"/admin",element:_.jsx(li,{requireAdmin:!0,children:_.jsx(H0,{})}),children:[_.jsx(xe,{index:!0,element:_.jsx(ni,{to:"developers",replace:!0})}),_.jsx(xe,{path:"developers",element:_.jsx(L0,{})}),_.jsx(xe,{path:"bots",element:_.jsx(B0,{})}),_.jsx(xe,{path:"tokens",element:_.jsx(Y0,{})}),_.jsx(xe,{path:"audit-logs",element:_.jsx(G0,{})}),_.jsx(xe,{path:"settings",element:_.jsx(X0,{})})]})]}),_.jsx(xe,{path:"*",element:_.jsx(b0,{})})]})})]})})]})}xa.getState().initialize();tg.createRoot(document.getElementById("root")).render(_.jsx(v.StrictMode,{children:_.jsx(Q0,{})}));export{I0 as A,P0 as B,Gv as C,Ph as D,Ks as E,t1 as F,e1 as G,Ns as H,Zv as I,a1 as J,Fv as K,Qh as L,ni as N,tv as O,F0 as P,ju as R,Fh as S,lp as T,W0 as W,rb as X,ta as a,Js as b,je as c,ab as d,Fa as e,yt as f,Xu as g,fb as h,pb as i,_ as j,Wu as k,$0 as l,i1 as m,n1 as n,Wh as o,$h as p,l1 as q,v as r,Wb as s,Wa as t,xa as u,K0 as v,Qv as w,Ih as x,tb as y,J0 as z};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-vL7aQJNr.js";/**
1
+ import{c as e}from"./index-CqnL6hX8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-vL7aQJNr.js";/**
1
+ import{c as e}from"./index-CqnL6hX8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-vL7aQJNr.js";/**
1
+ import{c as a}from"./index-CqnL6hX8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-vL7aQJNr.js";/**
1
+ import{c as e}from"./index-CqnL6hX8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-vL7aQJNr.js";/**
1
+ import{c as t}from"./index-CqnL6hX8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-vL7aQJNr.js";/**
1
+ import{c as a}from"./index-CqnL6hX8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-vL7aQJNr.js";/**
1
+ import{c as a}from"./index-CqnL6hX8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{W as r,l as e,F as s,J as u,B as a}from"./index-vL7aQJNr.js";const n={[e.QUEUED]:"var(--text-muted)",[e.ASSIGNED]:"#60a5fa",[e.RUNNING]:"var(--accent)",[e.SUSPENDED]:"var(--warning)",[e.COMPLETED]:"var(--accent)",[e.FAILED]:"var(--destructive)",[e.CANCELLED]:"var(--text-muted)"};function v(t){return n[t]??"var(--text-muted)"}const c={[r.ONLINE]:"var(--accent)",[r.OFFLINE]:"var(--destructive)",[r.DRAINING]:"var(--warning)",[r.DECOMMISSIONED]:"var(--text-muted)"};function E(t){return c[t]??"var(--text-muted)"}function x(t){switch(t){case s.ACTIVE:return"text-green-400";case s.DISABLED:return"text-red-400";default:return"text-[var(--text-muted)]"}}function S(t){switch(t){case a.ACTIVE:return"text-green-400";case a.USED:return"text-blue-400";case a.REVOKED:return"text-red-400";case a.EXPIRED:return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}}function d(t){switch(t){case u.ACTIVE:return"text-green-400";case"error":return"text-red-400";default:return"text-[var(--text-muted)]"}}function i(t){return t>.8?"var(--destructive)":t>.6?"var(--warning)":"var(--accent)"}export{v as a,i as b,x as c,d,S as e,E as g,n as t,c as w};
1
+ import{W as r,l as e,F as s,J as u,B as a}from"./index-CqnL6hX8.js";const n={[e.QUEUED]:"var(--text-muted)",[e.ASSIGNED]:"#60a5fa",[e.RUNNING]:"var(--accent)",[e.SUSPENDED]:"var(--warning)",[e.COMPLETED]:"var(--accent)",[e.FAILED]:"var(--destructive)",[e.CANCELLED]:"var(--text-muted)"};function v(t){return n[t]??"var(--text-muted)"}const c={[r.ONLINE]:"var(--accent)",[r.OFFLINE]:"var(--destructive)",[r.DRAINING]:"var(--warning)",[r.DECOMMISSIONED]:"var(--text-muted)"};function E(t){return c[t]??"var(--text-muted)"}function x(t){switch(t){case s.ACTIVE:return"text-green-400";case s.DISABLED:return"text-red-400";default:return"text-[var(--text-muted)]"}}function S(t){switch(t){case a.ACTIVE:return"text-green-400";case a.USED:return"text-blue-400";case a.REVOKED:return"text-red-400";case a.EXPIRED:return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}}function d(t){switch(t){case u.ACTIVE:return"text-green-400";case"error":return"text-red-400";default:return"text-[var(--text-muted)]"}}function i(t){return t>.8?"var(--destructive)":t>.6?"var(--warning)":"var(--accent)"}export{v as a,i as b,x as c,d,S as e,E as g,n as t,c as w};
@@ -1,4 +1,4 @@
1
- var Ee=Object.defineProperty;var ke=(te,j,K)=>j in te?Ee(te,j,{enumerable:!0,configurable:!0,writable:!0,value:K}):te[j]=K;var se=(te,j,K)=>ke(te,typeof j!="symbol"?j+"":j,K);import{c as Le,r as X,u as De,g as Re,j as xe,l as ge}from"./index-vL7aQJNr.js";/**
1
+ var Ee=Object.defineProperty;var ke=(te,j,K)=>j in te?Ee(te,j,{enumerable:!0,configurable:!0,writable:!0,value:K}):te[j]=K;var se=(te,j,K)=>ke(te,typeof j!="symbol"?j+"":j,K);import{c as Le,r as X,u as De,g as Re,j as xe,l as ge}from"./index-CqnL6hX8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{k as i,g as l}from"./index-vL7aQJNr.js";const f=i((t,c)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,fetchTasks:async a=>{const s=c()._fetchTasksAbort;s&&s.abort();const o=new AbortController;t({loading:!0,error:null,_fetchTasksAbort:o});try{const r={};a!=null&&a.status&&(r.status=a.status),a!=null&&a.projectKey&&(r.projectKey=a.projectKey),a!=null&&a.cursor&&(r.cursor=a.cursor),a!=null&&a.limit&&(r.limit=String(a.limit));const n=await l.get("web/tasks",{searchParams:r,signal:o.signal}).json();a!=null&&a.cursor?t(e=>({tasks:[...e.tasks,...n.data],nextCursor:n.nextCursor??null,_fetchTasksAbort:null})):t({tasks:n.data,nextCursor:n.nextCursor??null,_fetchTasksAbort:null})}catch(r){if(r instanceof DOMException&&r.name==="AbortError")return;t({error:r instanceof Error?r.message:"Failed to fetch tasks"})}finally{t({loading:!1})}},fetchTask:async a=>{t({loading:!0,error:null});try{const s=await l.get(`web/tasks/${a}`).json();t({currentTask:s})}catch(s){t({error:s instanceof Error?s.message:"Failed to fetch task"})}finally{t({loading:!1})}},createTask:async a=>{t({error:null});try{const s=await l.post("web/tasks",{json:a}).json();return t(o=>({tasks:[s,...o.tasks]})),s}catch(s){throw t({error:s instanceof Error?s.message:"Failed to create task"}),s}},cancelTask:async a=>{t({error:null});try{await l.post(`web/tasks/${a}/cancel`);const{currentTask:s}=c();(s==null?void 0:s.id)===a&&await c().fetchTask(a)}catch(s){throw t({error:s instanceof Error?s.message:"Failed to cancel task"}),s}},reset:()=>{t({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null})}}));export{f as u};
1
+ import{k as i,g as l}from"./index-CqnL6hX8.js";const f=i((t,c)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,fetchTasks:async a=>{const s=c()._fetchTasksAbort;s&&s.abort();const o=new AbortController;t({loading:!0,error:null,_fetchTasksAbort:o});try{const r={};a!=null&&a.status&&(r.status=a.status),a!=null&&a.projectKey&&(r.projectKey=a.projectKey),a!=null&&a.cursor&&(r.cursor=a.cursor),a!=null&&a.limit&&(r.limit=String(a.limit));const n=await l.get("web/tasks",{searchParams:r,signal:o.signal}).json();a!=null&&a.cursor?t(e=>({tasks:[...e.tasks,...n.data],nextCursor:n.nextCursor??null,_fetchTasksAbort:null})):t({tasks:n.data,nextCursor:n.nextCursor??null,_fetchTasksAbort:null})}catch(r){if(r instanceof DOMException&&r.name==="AbortError")return;t({error:r instanceof Error?r.message:"Failed to fetch tasks"})}finally{t({loading:!1})}},fetchTask:async a=>{t({loading:!0,error:null});try{const s=await l.get(`web/tasks/${a}`).json();t({currentTask:s})}catch(s){t({error:s instanceof Error?s.message:"Failed to fetch task"})}finally{t({loading:!1})}},createTask:async a=>{t({error:null});try{const s=await l.post("web/tasks",{json:a}).json();return t(o=>({tasks:[s,...o.tasks]})),s}catch(s){throw t({error:s instanceof Error?s.message:"Failed to create task"}),s}},cancelTask:async a=>{t({error:null});try{await l.post(`web/tasks/${a}/cancel`);const{currentTask:s}=c();(s==null?void 0:s.id)===a&&await c().fetchTask(a)}catch(s){throw t({error:s instanceof Error?s.message:"Failed to cancel task"}),s}},reset:()=>{t({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null})}}));export{f as u};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-vL7aQJNr.js";/**
1
+ import{c as e}from"./index-CqnL6hX8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as e}from"./index-vL7aQJNr.js";function p(c,f){const[l,i]=e.useState(null),[d,u]=e.useState(!0),[R,a]=e.useState(null),o=e.useRef(c);o.current=c;const r=e.useRef(0),n=e.useCallback(async()=>{const s=++r.current;u(!0),a(null);try{const t=await o.current();s===r.current&&i(t)}catch(t){if(s===r.current){const g=t instanceof Error?t.message:"An unexpected error occurred";a(g)}}finally{s===r.current&&u(!1)}},f);return e.useEffect(()=>{n()},[n]),{data:l,loading:d,error:R,refetch:n}}export{p as u};
1
+ import{r as e}from"./index-CqnL6hX8.js";function p(c,f){const[l,i]=e.useState(null),[d,u]=e.useState(!0),[R,a]=e.useState(null),o=e.useRef(c);o.current=c;const r=e.useRef(0),n=e.useCallback(async()=>{const s=++r.current;u(!0),a(null);try{const t=await o.current();s===r.current&&i(t)}catch(t){if(s===r.current){const g=t instanceof Error?t.message:"An unexpected error occurred";a(g)}}finally{s===r.current&&u(!1)}},f);return e.useEffect(()=>{n()},[n]),{data:l,loading:d,error:R,refetch:n}}export{p as u};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-vL7aQJNr.js";/**
1
+ import{c as e}from"./index-CqnL6hX8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-vL7aQJNr.js";/**
1
+ import{c as e}from"./index-CqnL6hX8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-vL7aQJNr.js";/**
1
+ import{c as a}from"./index-CqnL6hX8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
package/public/index.html CHANGED
@@ -28,7 +28,7 @@
28
28
  href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap"
29
29
  rel="stylesheet"
30
30
  />
31
- <script type="module" crossorigin src="/assets/index-vL7aQJNr.js"></script>
31
+ <script type="module" crossorigin src="/assets/index-CqnL6hX8.js"></script>
32
32
  <link rel="stylesheet" crossorigin href="/assets/index-BS0Fbx5V.css">
33
33
  <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
34
34
  <body>
package/public/sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let o={};const u=s=>l(s,r),a={module:{uri:r},exports:o,require:u};e[r]=Promise.all(i.map(s=>a[s]||u(s))).then(s=>(n(...s),o))}}define(["./workbox-6e9b121d"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"og-image.png",revision:"f1563b4bdc7d1a4ab0aef864b0c2294e"},{url:"index.html",revision:"224ff6d003cc74f4f2fb98e759540846"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"apple-touch-icon-152x152.png",revision:"8cc7ef3bc3aa19c3d8a29a58646d0636"},{url:"apple-touch-icon-120x120.png",revision:"7057fb6fb60df3fcf3cd49883db13be9"},{url:"assets/zap-DXw1NrWz.js",revision:null},{url:"assets/wifi-D60NkK6F.js",revision:null},{url:"assets/users-CEdRS_A3.js",revision:null},{url:"assets/useFetch-vGZMAvGi.js",revision:null},{url:"assets/trash-2-A2FsT1yG.js",revision:null},{url:"assets/task.store-BE6fEPu4.js",revision:null},{url:"assets/task-constants-Beg8tuEN.css",revision:null},{url:"assets/task-constants-BbFyCyKk.js",revision:null},{url:"assets/string-B39tzdVK.js",revision:null},{url:"assets/status-colors-BPEUp90-.js",revision:null},{url:"assets/settings-C1uOD3PZ.js",revision:null},{url:"assets/scroll-text-CecZ0Fk5.js",revision:null},{url:"assets/rotate-ccw-CgcLAXNR.js",revision:null},{url:"assets/plus-Bnd1Vz2Y.js",revision:null},{url:"assets/pencil-B6spIBcw.js",revision:null},{url:"assets/password-CHk45-jw.js",revision:null},{url:"assets/loader-circle-DS5g1-Od.js",revision:null},{url:"assets/key-CxvwwHnW.js",revision:null},{url:"assets/index-vL7aQJNr.js",revision:null},{url:"assets/index-BS0Fbx5V.css",revision:null},{url:"assets/external-link-ChPgQ7N_.js",revision:null},{url:"assets/date-BdNtiQTP.js",revision:null},{url:"assets/copy-BUH7P2Hf.js",revision:null},{url:"assets/chevron-right-CqyufMDW.js",revision:null},{url:"assets/bot-DPaziJPf.js",revision:null},{url:"assets/arrow-right-MDrzFe3K.js",revision:null},{url:"assets/arrow-left-DklRsENx.js",revision:null},{url:"assets/WorkerSetupGuidePage-SqO2lzVa.js",revision:null},{url:"assets/WorkerListPage-CserMjGO.js",revision:null},{url:"assets/WorkerDetailPage-R2veIzKo.js",revision:null},{url:"assets/TotpSetupPage-MSCCURj9.js",revision:null},{url:"assets/TokenManage-B0Cpv6SO.js",revision:null},{url:"assets/TerminalHomePage-BwXJjr-a.js",revision:null},{url:"assets/TaskStatusBadge-DuOoGIwE.js",revision:null},{url:"assets/TaskListPage-Dh59ldSZ.js",revision:null},{url:"assets/TaskDetailPage-CfwEj1hy.js",revision:null},{url:"assets/SkillPage-BInwZTQh.js",revision:null},{url:"assets/Skeleton-DUgWc2LJ.js",revision:null},{url:"assets/SettingsPage-HaUCcsgl.js",revision:null},{url:"assets/Select-BnV8yZlD.js",revision:null},{url:"assets/RemoveMemberConfirmDialog-BCrue0AP.js",revision:null},{url:"assets/QuickAuth-Dr0Q50ld.js",revision:null},{url:"assets/ProjectListPage-Bz7I2D0H.js",revision:null},{url:"assets/ProjectDetailPage-DJexg49z.js",revision:null},{url:"assets/ProfilePage-DN7usHOi.js",revision:null},{url:"assets/PipelineEditorPage-y2-Q8ofQ.js",revision:null},{url:"assets/OnboardingGuide-D8RyPcEd.js",revision:null},{url:"assets/NotFoundPage-D5x5BrlX.js",revision:null},{url:"assets/MetricBar-DMMHfS0A.js",revision:null},{url:"assets/LoginPage-DDXkdcz_.js",revision:null},{url:"assets/LandingPage-CqS0E2eC.js",revision:null},{url:"assets/InfoRow-DhdTYoY9.js",revision:null},{url:"assets/HomePage-D4yv4orb.js",revision:null},{url:"assets/EmptyState-D3foEiul.js",revision:null},{url:"assets/EditProjectPage-7WCsNltj.js",revision:null},{url:"assets/DeveloperManage-r6y2AoB4.js",revision:null},{url:"assets/CliReferencePage-C8GmlwUz.js",revision:null},{url:"assets/BotManage-CIR0rrK7.js",revision:null},{url:"assets/BindPlatformPage-CTqzpOmt.js",revision:null},{url:"assets/AuditLogPage-DSo4jVYm.js",revision:null},{url:"assets/ApiReferencePage-CiGvbLxL.js",revision:null},{url:"assets/AdminPage-BqVelYNu.js",revision:null},{url:"assets/AccessTokensPage-DPQB2fbi.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"manifest.webmanifest",revision:"c35fecd3fb20dd6d473c713737b26dd4"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("/index.html"))),s.registerRoute(/^https:\/\/fonts\.googleapis\.com/,new s.CacheFirst({cacheName:"google-fonts-stylesheets",plugins:[]}),"GET"),s.registerRoute(/^https:\/\/fonts\.gstatic\.com/,new s.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new s.ExpirationPlugin({maxEntries:10,maxAgeSeconds:31536e3})]}),"GET")});
1
+ if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let a={};const o=s=>l(s,r),u={module:{uri:r},exports:a,require:o};e[r]=Promise.all(i.map(s=>u[s]||o(s))).then(s=>(n(...s),a))}}define(["./workbox-6e9b121d"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"og-image.png",revision:"f1563b4bdc7d1a4ab0aef864b0c2294e"},{url:"index.html",revision:"59c850e6cea4ac4c85b11302630fecc4"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"apple-touch-icon-152x152.png",revision:"8cc7ef3bc3aa19c3d8a29a58646d0636"},{url:"apple-touch-icon-120x120.png",revision:"7057fb6fb60df3fcf3cd49883db13be9"},{url:"assets/zap-CDX3UpIX.js",revision:null},{url:"assets/wifi-DZo2oi08.js",revision:null},{url:"assets/users-DBFmGr_S.js",revision:null},{url:"assets/useFetch-CJla7_79.js",revision:null},{url:"assets/trash-2-BJ5q4Wkp.js",revision:null},{url:"assets/task.store-Bldcjv9A.js",revision:null},{url:"assets/task-constants-Bj_lR7bu.js",revision:null},{url:"assets/task-constants-Beg8tuEN.css",revision:null},{url:"assets/string-B39tzdVK.js",revision:null},{url:"assets/status-colors-BXL4VDNh.js",revision:null},{url:"assets/settings-BZyNzgEB.js",revision:null},{url:"assets/scroll-text-mAU4OFrg.js",revision:null},{url:"assets/rotate-ccw-CV1EIcxQ.js",revision:null},{url:"assets/plus-CypZlZSj.js",revision:null},{url:"assets/pencil-zZY9INFY.js",revision:null},{url:"assets/password-CHk45-jw.js",revision:null},{url:"assets/loader-circle-knGZUOVM.js",revision:null},{url:"assets/key-uv0MVCos.js",revision:null},{url:"assets/index-CqnL6hX8.js",revision:null},{url:"assets/index-BS0Fbx5V.css",revision:null},{url:"assets/external-link-smb8Si2G.js",revision:null},{url:"assets/date-BdNtiQTP.js",revision:null},{url:"assets/copy-Ca3klMOV.js",revision:null},{url:"assets/chevron-right-CKEZOJqX.js",revision:null},{url:"assets/bot-BKKWb03w.js",revision:null},{url:"assets/arrow-right-CTOYnmu3.js",revision:null},{url:"assets/arrow-left-DGmTxTQH.js",revision:null},{url:"assets/WorkerSetupGuidePage-m-ZneK_i.js",revision:null},{url:"assets/WorkerListPage-P1hVwXGG.js",revision:null},{url:"assets/WorkerDetailPage-BOn7z8cR.js",revision:null},{url:"assets/TotpSetupPage-VeqXwL5k.js",revision:null},{url:"assets/TokenManage-DP0iub57.js",revision:null},{url:"assets/TerminalHomePage-cz_7HYVr.js",revision:null},{url:"assets/TaskStatusBadge-xZ7FBWZw.js",revision:null},{url:"assets/TaskListPage-BjPRD6v8.js",revision:null},{url:"assets/TaskDetailPage-LdLghDpk.js",revision:null},{url:"assets/SkillPage-D0lNlB7o.js",revision:null},{url:"assets/Skeleton-CEc5RMQi.js",revision:null},{url:"assets/SettingsPage-DHa6WOhU.js",revision:null},{url:"assets/Select-CdRjIJm4.js",revision:null},{url:"assets/RemoveMemberConfirmDialog-D-rvX20k.js",revision:null},{url:"assets/QuickAuth-dOCzSE_V.js",revision:null},{url:"assets/ProjectListPage-CitoAwwH.js",revision:null},{url:"assets/ProjectDetailPage-CLqYqqVX.js",revision:null},{url:"assets/ProfilePage-BWGufJ03.js",revision:null},{url:"assets/PipelineEditorPage-Ra4MjS17.js",revision:null},{url:"assets/OnboardingGuide-BgPC4aiz.js",revision:null},{url:"assets/NotFoundPage-DA9fVgox.js",revision:null},{url:"assets/MetricBar-D8u403eM.js",revision:null},{url:"assets/LoginPage-OLBwEvXt.js",revision:null},{url:"assets/LandingPage-DP9U6Iea.js",revision:null},{url:"assets/InfoRow-DGKqWvsB.js",revision:null},{url:"assets/HomePage-CO4wRT0y.js",revision:null},{url:"assets/EmptyState-BQqxSE6p.js",revision:null},{url:"assets/EditProjectPage-DiVkK33D.js",revision:null},{url:"assets/DeveloperManage-959Sec6Y.js",revision:null},{url:"assets/CliReferencePage-BmEVf_Yf.js",revision:null},{url:"assets/BotManage-BCCGabIK.js",revision:null},{url:"assets/BindPlatformPage-ByhQZ5qX.js",revision:null},{url:"assets/AuditLogPage-X3KImiZ3.js",revision:null},{url:"assets/ApiReferencePage-DFFhnxAn.js",revision:null},{url:"assets/AdminPage-ChDIUX_3.js",revision:null},{url:"assets/AccessTokensPage-CUQDQyQ5.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"manifest.webmanifest",revision:"c35fecd3fb20dd6d473c713737b26dd4"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("/index.html"))),s.registerRoute(/^https:\/\/fonts\.googleapis\.com/,new s.CacheFirst({cacheName:"google-fonts-stylesheets",plugins:[]}),"GET"),s.registerRoute(/^https:\/\/fonts\.gstatic\.com/,new s.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new s.ExpirationPlugin({maxEntries:10,maxAgeSeconds:31536e3})]}),"GET")});
@@ -1 +0,0 @@
1
- import{R as V,e as F,a as P,j as e,u as X,h as Z,r as o,g as M,X as Y,i as ee,n as te,H as se,t as q,l as C,o as re,p as $}from"./index-vL7aQJNr.js";import{u as ae}from"./task.store-BE6fEPu4.js";import{T as U}from"./TaskStatusBadge-DuOoGIwE.js";import{f as W}from"./date-BdNtiQTP.js";import{t as oe}from"./string-B39tzdVK.js";import{S as L}from"./Select-BnV8yZlD.js";import{C as ne}from"./copy-BUH7P2Hf.js";import{E as J}from"./EmptyState-D3foEiul.js";import{T as H}from"./Skeleton-DUgWc2LJ.js";import{P as ie}from"./plus-Bnd1Vz2Y.js";import"./status-colors-BPEUp90-.js";const ce=V.memo(function({task:t}){const m=F(),{t:p}=P(),d=(i,r)=>p(`common.${i}`,{n:r});return e.jsxs("tr",{onClick:()=>m(`/tasks/${t.id}`),className:"cursor-pointer border-b border-[var(--border-row)] transition-colors hover:bg-[var(--bg-input)]",children:[e.jsxs("td",{className:"w-16 py-3 pr-4 font-mono text-xs font-medium text-[var(--text-secondary)] text-right tabular-nums",children:["#",t.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)]",children:oe(t.description,80)}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(U,{status:t.status})}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:t.projectKey}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:t.developerName??t.creatorName??"-"}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:t.workerName??"—"}),e.jsx("td",{className:"py-3 font-mono text-xs text-[var(--text-muted)]",children:W(t.createdAt,d)})]})});function le({isOpen:n,onClose:t,projects:m,projectsLoading:p,onSubmit:d,isSubmitting:i}){const{t:r}=P();X(a=>a.user);const h=Z(),[c,j]=o.useState(""),[x,v]=o.useState(""),[f,b]=o.useState(""),[g,_]=o.useState(""),[A,k]=o.useState([]),[N,u]=o.useState("");o.useEffect(()=>{n&&(j(""),v(""),b(""),_(""),u(""),h&&M.get("admin/developers").json().then(k).catch(()=>k([])))},[n,h]),o.useEffect(()=>{if(!n)return;function a(y){y.key==="Escape"&&t()}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[n,t]);async function D(a){if(a.preventDefault(),u(""),!c||!x.trim()){u(r("tasks.project_and_description_required"));return}try{await d({projectKey:c,description:x.trim(),workerId:f||void 0,developerId:g?Number(g):void 0})}catch(y){const R=y instanceof Error?y.message:r("tasks.failed_to_create_task");u(R)}}return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 font-mono",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:a=>{a.target===a.currentTarget&&t()},children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-4",children:[e.jsxs("h2",{className:"text-sm text-[var(--text-primary)]",children:["// ",r("tasks.new_task")]}),e.jsx("button",{onClick:t,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(Y,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:D,className:"px-6 py-5",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.task_description")}),e.jsx("textarea",{value:x,onChange:a=>v(a.target.value),placeholder:r("tasks.describe_task_placeholder"),rows:4,className:"w-full resize-none rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.project")}),e.jsx(L,{value:c,onChange:j,options:m.map(a=>({value:a.key,label:a.name})),placeholder:r(p?"common.loading":"tasks.select_project"),disabled:p})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.target_worker")}),e.jsx("input",{type:"text",value:f,onChange:a=>b(a.target.value),placeholder:r("tasks.any_able"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),h&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.assign_developer")}),e.jsx(L,{value:g,onChange:_,options:A.map(a=>({value:String(a.id),label:a.username})),placeholder:r("tasks.select_developer")})]}),N&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:N})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:t,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",children:r("common.cancel")}),e.jsx("button",{type:"submit",disabled:i||!c||!x.trim(),className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs text-black transition-opacity hover:opacity-90 disabled:opacity-40",children:r(i?"common.creating":"tasks.create_task")})]})]})]})}):null}function de({isOpen:n,onClose:t,onForceCreate:m,onViewExisting:p,similarTask:d,isLoading:i}){const{t:r}=P();return!d||!n?null:e.jsx("div",{onClick:t,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{onClick:h=>h.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(ne,{style:{width:"1rem",height:"1rem"}}),r("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:r("tasks.dedup_description")})]}),e.jsxs("div",{style:{marginBottom:"1.25rem",padding:"0.75rem",border:"1px solid var(--border)",borderRadius:"4px",backgroundColor:"var(--bg-primary)"},children:[e.jsxs("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",fontFamily:"'JetBrains Mono', monospace"},children:["#",d.id," · ",d.status]}),e.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.75rem",marginTop:"0.375rem",lineHeight:"1.5"},children:d.description})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[e.jsx("button",{type:"button",onClick:t,disabled:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1,transition:"color 0.15s, border-color 0.15s"},children:r("common.cancel")}),e.jsx("button",{type:"button",onClick:()=>p(d.id),style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:r("tasks.view_existing")}),e.jsx("button",{type:"button",onClick:m,disabled:i,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--warning)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1},children:r(i?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function xe({task:n}){const t=F();return e.jsxs("div",{onClick:()=>t(`/tasks/${n.id}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight",style:{wordBreak:"break-word"},children:["#",n.id," ",n.description]}),e.jsx("span",{className:"shrink-0",children:e.jsx(U,{status:n.status})})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:W(n.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:n.projectKey}),n.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:n.workerName})]})]})]})}const pe=[{key:"all",labelKey:"tasks.tab_all"},{key:C.RUNNING,labelKey:"tasks.tab_running"},{key:C.QUEUED,labelKey:"tasks.tab_queued"},{key:C.COMPLETED,labelKey:"tasks.tab_completed"},{key:C.FAILED,labelKey:"tasks.tab_failed"},{key:C.CANCELLED,labelKey:"tasks.tab_cancelled"}],K=20;function we(){const n=F(),{t}=P(),{tasks:m,loading:p,fetchTasks:d}=ae(),i=ee(s=>s.taskSeq),[r,h]=o.useState("all"),[c,j]=o.useState(""),[x,v]=o.useState(1),[f,b]=o.useState(!1);te(o.useMemo(()=>e.jsxs("button",{onClick:()=>b(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(ie,{className:"h-3.5 w-3.5"}),t("tasks.new_task")]}),[t]));const[g,_]=o.useState([]),[A,k]=o.useState(!1),[N,u]=o.useState(!1),[D,a]=o.useState(!1),[y,R]=o.useState(null),[w,O]=o.useState(null);o.useEffect(()=>{const s={limit:String(K)};r!=="all"&&(s.status=r),d(s)},[r,d,i]),o.useEffect(()=>{v(1)},[c]),o.useEffect(()=>{f&&(k(!0),M.get("web/projects").json().then(s=>_(s)).catch(()=>{}).finally(()=>k(!1)))},[f]);const Q=o.useCallback(async s=>{u(!0);try{const l=await M.post("web/tasks",{json:{projectKey:s.projectKey,description:s.description,workerId:s.workerId,developerId:s.developerId}}).json();b(!1),n(`/tasks/${l.task.id}`)}catch(l){if(l instanceof se&&l.response.status===409){try{const S=await l.response.json();if(S.confirmRequired){R({id:S.confirmRequired.taskId,description:S.confirmRequired.message,status:"active"}),O(s),b(!1),a(!0);return}}catch{}q.error(t("tasks.similar_task_exists"))}else{const S=l instanceof Error?l.message:String(l);q.error(S)}}finally{u(!1)}},[n]),G=o.useCallback(async()=>{if(w){u(!0);try{const s=await M.post("web/tasks",{json:{projectKey:w.projectKey,description:w.description,workerId:w.workerId,force:!0}}).json();a(!1),n(`/tasks/${s.task.id}`)}finally{u(!1)}}},[w,n]),E=o.useMemo(()=>{if(!c.trim())return m;const s=c.toLowerCase();return m.filter(l=>l.description.toLowerCase().includes(s)||String(l.id).includes(c))},[m,c]),T=Math.max(1,Math.ceil(E.length/K)),I=E.slice((x-1)*K,x*K),z=t(c?"tasks.try_adjusting_search":"tasks.create_first_task"),B=c?void 0:e.jsx("button",{onClick:()=>b(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:t("tasks.create_task")});return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar",children:pe.map(s=>e.jsx("button",{onClick:()=>h(s.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-10 md:h-8 text-xs transition-colors ${r===s.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:t(s.labelKey)},s.key))}),e.jsxs("div",{className:"relative md:ml-auto md:w-64",children:[e.jsx(re,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:t("tasks.search_tasks"),value:c,onChange:s=>j(s.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),c&&e.jsx("button",{onClick:()=>j(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:"x"})]})]}),e.jsx("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[e.jsx("th",{className:"w-16 px-4 py-2.5 text-right",children:t("tasks.id")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.description_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.status_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.project_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.assignee")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.time")})]})}),e.jsxs("tbody",{children:[p&&I.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(H,{rows:5})})}),!p&&E.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(J,{icon:$,title:t("tasks.no_tasks_found"),description:z,action:B})})}),I.map(s=>e.jsx(ce,{task:s},s.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[p&&I.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(H,{rows:5})}),!p&&E.length===0&&e.jsx(J,{icon:$,title:t("tasks.no_tasks_found"),description:z,action:B}),I.map(s=>e.jsx(xe,{task:s},s.id))]}),T>1&&e.jsxs("div",{className:"mt-6 flex items-center justify-center gap-1",children:[e.jsx("button",{onClick:()=>v(Math.max(1,x-1)),disabled:x===1,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] disabled:opacity-30 min-w-[44px] min-h-[44px] flex items-center justify-center",children:t("tasks.prev")}),Array.from({length:T},(s,l)=>l+1).map(s=>e.jsx("button",{onClick:()=>v(s),className:`rounded-[4px] px-2.5 py-1 text-xs transition-colors min-w-[44px] min-h-[44px] flex items-center justify-center ${x===s?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:s},s)),e.jsx("button",{onClick:()=>v(Math.min(T,x+1)),disabled:x===T,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] disabled:opacity-30 min-w-[44px] min-h-[44px] flex items-center justify-center",children:t("common.next")})]}),e.jsx(le,{isOpen:f,onClose:()=>b(!1),projects:g,projectsLoading:A,onSubmit:Q,isSubmitting:N}),e.jsx(de,{isOpen:D,onClose:()=>a(!1),onForceCreate:G,onViewExisting:s=>{a(!1),n(`/tasks/${s}`)},similarTask:y,isLoading:N})]})}export{we as default};