agent-tower 0.7.4 → 0.7.5-beta.5
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.
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +6 -1
- package/dist/app.js.map +1 -1
- package/dist/core/container.d.ts +2 -0
- package/dist/core/container.d.ts.map +1 -1
- package/dist/core/container.js +25 -0
- package/dist/core/container.js.map +1 -1
- package/dist/executors/__tests__/base.executor.test.js +19 -0
- package/dist/executors/__tests__/base.executor.test.js.map +1 -1
- package/dist/executors/__tests__/claude-code-mcp.test.d.ts +2 -0
- package/dist/executors/__tests__/claude-code-mcp.test.d.ts.map +1 -0
- package/dist/executors/__tests__/claude-code-mcp.test.js +211 -0
- package/dist/executors/__tests__/claude-code-mcp.test.js.map +1 -0
- package/dist/executors/__tests__/codex-mcp-windows.test.d.ts +2 -0
- package/dist/executors/__tests__/codex-mcp-windows.test.d.ts.map +1 -0
- package/dist/executors/__tests__/codex-mcp-windows.test.js +128 -0
- package/dist/executors/__tests__/codex-mcp-windows.test.js.map +1 -0
- package/dist/executors/__tests__/codex.executor.test.js +394 -1
- package/dist/executors/__tests__/codex.executor.test.js.map +1 -1
- package/dist/executors/base.executor.d.ts.map +1 -1
- package/dist/executors/base.executor.js +13 -0
- package/dist/executors/base.executor.js.map +1 -1
- package/dist/executors/claude-code.executor.d.ts +1 -0
- package/dist/executors/claude-code.executor.d.ts.map +1 -1
- package/dist/executors/claude-code.executor.js +52 -3
- package/dist/executors/claude-code.executor.js.map +1 -1
- package/dist/executors/codex.executor.d.ts +6 -6
- package/dist/executors/codex.executor.d.ts.map +1 -1
- package/dist/executors/codex.executor.js +118 -32
- package/dist/executors/codex.executor.js.map +1 -1
- package/dist/git/worktree.manager.d.ts.map +1 -1
- package/dist/git/worktree.manager.js +5 -2
- package/dist/git/worktree.manager.js.map +1 -1
- package/dist/mcp/http-client.d.ts +8 -1
- package/dist/mcp/http-client.d.ts.map +1 -1
- package/dist/mcp/http-client.js +6 -0
- package/dist/mcp/http-client.js.map +1 -1
- package/dist/mcp/tools/__tests__/workspace-services.test.js +34 -1
- package/dist/mcp/tools/__tests__/workspace-services.test.js.map +1 -1
- package/dist/mcp/tools/tasks.js +1 -1
- package/dist/mcp/tools/tasks.js.map +1 -1
- package/dist/mcp/tools/workspace-services.d.ts.map +1 -1
- package/dist/mcp/tools/workspace-services.js +39 -2
- package/dist/mcp/tools/workspace-services.js.map +1 -1
- package/dist/mcp/types.d.ts +20 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/types.js +12 -0
- package/dist/mcp/types.js.map +1 -1
- package/dist/middleware/__tests__/preview-fallback.test.d.ts +2 -0
- package/dist/middleware/__tests__/preview-fallback.test.d.ts.map +1 -0
- package/dist/middleware/__tests__/preview-fallback.test.js +93 -0
- package/dist/middleware/__tests__/preview-fallback.test.js.map +1 -0
- package/dist/middleware/preview-fallback.d.ts +5 -0
- package/dist/middleware/preview-fallback.d.ts.map +1 -0
- package/dist/middleware/preview-fallback.js +91 -0
- package/dist/middleware/preview-fallback.js.map +1 -0
- package/dist/output/__tests__/claude-code-parser-continuation.test.d.ts +2 -0
- package/dist/output/__tests__/claude-code-parser-continuation.test.d.ts.map +1 -0
- package/dist/output/__tests__/claude-code-parser-continuation.test.js +89 -0
- package/dist/output/__tests__/claude-code-parser-continuation.test.js.map +1 -0
- package/dist/output/__tests__/claude-code-parser-lifecycle.test.js +4 -1
- package/dist/output/__tests__/claude-code-parser-lifecycle.test.js.map +1 -1
- package/dist/output/claude-code-parser.d.ts +36 -1
- package/dist/output/claude-code-parser.d.ts.map +1 -1
- package/dist/output/claude-code-parser.js +149 -18
- package/dist/output/claude-code-parser.js.map +1 -1
- package/dist/output/types.d.ts +2 -0
- package/dist/output/types.d.ts.map +1 -1
- package/dist/output/types.js.map +1 -1
- package/dist/prompts/workspace-background-service-policy.d.ts +6 -2
- package/dist/prompts/workspace-background-service-policy.d.ts.map +1 -1
- package/dist/prompts/workspace-background-service-policy.js +12 -3
- package/dist/prompts/workspace-background-service-policy.js.map +1 -1
- package/dist/prompts/workspace-background-service-policy.test.js +11 -0
- package/dist/prompts/workspace-background-service-policy.test.js.map +1 -1
- package/dist/routes/__tests__/previews.integration.test.js +117 -6
- package/dist/routes/__tests__/previews.integration.test.js.map +1 -1
- package/dist/routes/__tests__/previews.test.js +223 -194
- package/dist/routes/__tests__/previews.test.js.map +1 -1
- package/dist/routes/__tests__/task-handoff.test.js +25 -16
- package/dist/routes/__tests__/task-handoff.test.js.map +1 -1
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +3 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/previews.d.ts +11 -9
- package/dist/routes/previews.d.ts.map +1 -1
- package/dist/routes/previews.js +137 -516
- package/dist/routes/previews.js.map +1 -1
- package/dist/routes/session-wakeups.d.ts +7 -0
- package/dist/routes/session-wakeups.d.ts.map +1 -0
- package/dist/routes/session-wakeups.js +86 -0
- package/dist/routes/session-wakeups.js.map +1 -0
- package/dist/routes/tasks.d.ts.map +1 -1
- package/dist/routes/tasks.js +3 -1
- package/dist/routes/tasks.js.map +1 -1
- package/dist/runtime/__tests__/acp-process-manager.test.js +65 -0
- package/dist/runtime/__tests__/acp-process-manager.test.js.map +1 -1
- package/dist/runtime/__tests__/claude-cli-driver.test.js +96 -2
- package/dist/runtime/__tests__/claude-cli-driver.test.js.map +1 -1
- package/dist/runtime/__tests__/claude-run-lifecycle.test.d.ts +2 -0
- package/dist/runtime/__tests__/claude-run-lifecycle.test.d.ts.map +1 -0
- package/dist/runtime/__tests__/claude-run-lifecycle.test.js +88 -0
- package/dist/runtime/__tests__/claude-run-lifecycle.test.js.map +1 -0
- package/dist/runtime/__tests__/cli-driver-lifecycle.test.js +14 -7
- package/dist/runtime/__tests__/cli-driver-lifecycle.test.js.map +1 -1
- package/dist/runtime/acp/agents/pi-coding-agent.d.ts.map +1 -1
- package/dist/runtime/acp/agents/pi-coding-agent.js +3 -0
- package/dist/runtime/acp/agents/pi-coding-agent.js.map +1 -1
- package/dist/runtime/claude-run-lifecycle.d.ts +77 -0
- package/dist/runtime/claude-run-lifecycle.d.ts.map +1 -0
- package/dist/runtime/claude-run-lifecycle.js +147 -0
- package/dist/runtime/claude-run-lifecycle.js.map +1 -0
- package/dist/runtime/cli-driver.d.ts.map +1 -1
- package/dist/runtime/cli-driver.js +89 -3
- package/dist/runtime/cli-driver.js.map +1 -1
- package/dist/runtime/contracts.d.ts +6 -1
- package/dist/runtime/contracts.d.ts.map +1 -1
- package/dist/runtime/process-scope/__tests__/process-scope.test.d.ts +2 -0
- package/dist/runtime/process-scope/__tests__/process-scope.test.d.ts.map +1 -0
- package/dist/runtime/process-scope/__tests__/process-scope.test.js +156 -0
- package/dist/runtime/process-scope/__tests__/process-scope.test.js.map +1 -0
- package/dist/runtime/process-scope/process-scope.d.ts +46 -0
- package/dist/runtime/process-scope/process-scope.d.ts.map +1 -0
- package/dist/runtime/process-scope/process-scope.js +68 -0
- package/dist/runtime/process-scope/process-scope.js.map +1 -0
- package/dist/runtime/process-scope/scope-helper.d.ts +28 -0
- package/dist/runtime/process-scope/scope-helper.d.ts.map +1 -0
- package/dist/runtime/process-scope/scope-helper.js +78 -0
- package/dist/runtime/process-scope/scope-helper.js.map +1 -0
- package/dist/runtime/runtime-coordinator.d.ts.map +1 -1
- package/dist/runtime/runtime-coordinator.js +6 -0
- package/dist/runtime/runtime-coordinator.js.map +1 -1
- package/dist/services/__tests__/preview-runtime-manager.test.js +13 -112
- package/dist/services/__tests__/preview-runtime-manager.test.js.map +1 -1
- package/dist/services/__tests__/preview.service.test.js +13 -14
- package/dist/services/__tests__/preview.service.test.js.map +1 -1
- package/dist/services/__tests__/session-manager.lifecycle.test.js +147 -1
- package/dist/services/__tests__/session-manager.lifecycle.test.js.map +1 -1
- package/dist/services/__tests__/session-wakeup.service.test.d.ts +2 -0
- package/dist/services/__tests__/session-wakeup.service.test.d.ts.map +1 -0
- package/dist/services/__tests__/session-wakeup.service.test.js +173 -0
- package/dist/services/__tests__/session-wakeup.service.test.js.map +1 -0
- package/dist/services/__tests__/terminal-manager.test.js +129 -51
- package/dist/services/__tests__/terminal-manager.test.js.map +1 -1
- package/dist/services/__tests__/workspace.service.test.js +31 -0
- package/dist/services/__tests__/workspace.service.test.js.map +1 -1
- package/dist/services/message-delivery.service.d.ts +3 -2
- package/dist/services/message-delivery.service.d.ts.map +1 -1
- package/dist/services/message-delivery.service.js +11 -7
- package/dist/services/message-delivery.service.js.map +1 -1
- package/dist/services/preview-bridge.d.ts +50 -0
- package/dist/services/preview-bridge.d.ts.map +1 -0
- package/dist/services/preview-bridge.js +537 -0
- package/dist/services/preview-bridge.js.map +1 -0
- package/dist/services/preview-cookies.d.ts +28 -0
- package/dist/services/preview-cookies.d.ts.map +1 -0
- package/dist/services/preview-cookies.js +133 -0
- package/dist/services/preview-cookies.js.map +1 -0
- package/dist/services/preview-proxy.d.ts +71 -0
- package/dist/services/preview-proxy.d.ts.map +1 -0
- package/dist/services/preview-proxy.js +462 -0
- package/dist/services/preview-proxy.js.map +1 -0
- package/dist/services/preview-runtime-manager.d.ts +11 -25
- package/dist/services/preview-runtime-manager.d.ts.map +1 -1
- package/dist/services/preview-runtime-manager.js +46 -363
- package/dist/services/preview-runtime-manager.js.map +1 -1
- package/dist/services/preview.service.d.ts.map +1 -1
- package/dist/services/preview.service.js +11 -9
- package/dist/services/preview.service.js.map +1 -1
- package/dist/services/project.service.d.ts +13 -13
- package/dist/services/session-manager.d.ts +2 -0
- package/dist/services/session-manager.d.ts.map +1 -1
- package/dist/services/session-manager.js +4 -2
- package/dist/services/session-manager.js.map +1 -1
- package/dist/services/session-wakeup.service.d.ts +105 -0
- package/dist/services/session-wakeup.service.d.ts.map +1 -0
- package/dist/services/session-wakeup.service.js +319 -0
- package/dist/services/session-wakeup.service.js.map +1 -0
- package/dist/services/task-handoff.service.d.ts +3 -2
- package/dist/services/task-handoff.service.d.ts.map +1 -1
- package/dist/services/task-handoff.service.js +7 -6
- package/dist/services/task-handoff.service.js.map +1 -1
- package/dist/services/team-room-delivery.d.ts +4 -4
- package/dist/services/terminal-manager.d.ts +16 -0
- package/dist/services/terminal-manager.d.ts.map +1 -1
- package/dist/services/terminal-manager.js +64 -7
- package/dist/services/terminal-manager.js.map +1 -1
- package/dist/services/workspace-background-service.service.d.ts +15 -1
- package/dist/services/workspace-background-service.service.d.ts.map +1 -1
- package/dist/services/workspace-background-service.service.js +41 -2
- package/dist/services/workspace-background-service.service.js.map +1 -1
- package/dist/services/workspace.service.d.ts.map +1 -1
- package/dist/services/workspace.service.js +2 -1
- package/dist/services/workspace.service.js.map +1 -1
- package/dist/utils/database-schema.d.ts.map +1 -1
- package/dist/utils/database-schema.js +9 -4
- package/dist/utils/database-schema.js.map +1 -1
- package/dist/utils/database-schema.test.js +21 -0
- package/dist/utils/database-schema.test.js.map +1 -1
- package/dist/utils/owned-child-process.d.ts +32 -3
- package/dist/utils/owned-child-process.d.ts.map +1 -1
- package/dist/utils/owned-child-process.js +138 -1
- package/dist/utils/owned-child-process.js.map +1 -1
- package/dist/web/assets/{AgentDemoPage-D9bIiALx.js → AgentDemoPage-D6clLNZx.js} +1 -1
- package/dist/web/assets/{AgentEnvironmentSettingsPage-BE0RC6fR.js → AgentEnvironmentSettingsPage-O1hlpsgp.js} +1 -1
- package/dist/web/assets/AttachmentPreview-hD3g_T_y.js +2 -0
- package/dist/web/assets/{BranchSelect-Kv3M1YhZ.js → BranchSelect-BkuXnEG2.js} +1 -1
- package/dist/web/assets/{BrandLogo-fR2lCwEo.js → BrandLogo-BSwQa2SF.js} +1 -1
- package/dist/web/assets/{ConversationPage-BZiMHI9T.js → ConversationPage-DvWjqFF2.js} +1 -1
- package/dist/web/assets/CreateTaskInput-Bric0GeW.js +1 -0
- package/dist/web/assets/{DemoPage-DwpThe16.js → DemoPage-Cwy3EmOm.js} +1 -1
- package/dist/web/assets/{DesignSystemPage-DH9_cygJ.js → DesignSystemPage-C1HrGwpV.js} +1 -1
- package/dist/web/assets/{ExecutionPermissionSelector-C-akTOVg.js → ExecutionPermissionSelector-BgrxbvBB.js} +1 -1
- package/dist/web/assets/{GeneralSettingsPage-v2w1eofz.js → GeneralSettingsPage-qdeAdBkW.js} +1 -1
- package/dist/web/assets/{LoadingPreviewPage-pgk3PWM9.js → LoadingPreviewPage-qeZ8nuiQ.js} +1 -1
- package/dist/web/assets/{McpSettingsPage-w1DOlY5V.js → McpSettingsPage-Bo-auo0X.js} +1 -1
- package/dist/web/assets/{MemberAvatar-CJtylxwu.js → MemberAvatar-DBab_9EO.js} +1 -1
- package/dist/web/assets/{MobileTaskDetail-D5Czlr2O.js → MobileTaskDetail-Dm64ie99.js} +2 -2
- package/dist/web/assets/{NotificationSettingsPage-CkLg4WvT.js → NotificationSettingsPage-BVJpo76k.js} +1 -1
- package/dist/web/assets/{ProfileSettingsPage-B3yzbY1V.js → ProfileSettingsPage-CbSRYGcp.js} +1 -1
- package/dist/web/assets/{ProjectKanbanPage-CuGSLvrU.js → ProjectKanbanPage-Cp3rdFik.js} +6 -6
- package/dist/web/assets/{ProjectSettingsPage-DoklOfna.js → ProjectSettingsPage-DLs5-Gk3.js} +1 -1
- package/dist/web/assets/{ProviderSettingsPage-Cm0hbX5n.js → ProviderSettingsPage-BnBcgAMQ.js} +1 -1
- package/dist/web/assets/{SettingsMasterDetail-CGCUalkW.js → SettingsMasterDetail-fu-_yejj.js} +1 -1
- package/dist/web/assets/{TaskDetail-BiZbuXcE.js → TaskDetail-C2_Fg59e.js} +1 -1
- package/dist/web/assets/TaskHandoffPanel-3Y0gcjyN.js +70 -0
- package/dist/web/assets/{TeamSettingsPage-CyppRTaY.js → TeamSettingsPage-CAjitaBe.js} +1 -1
- package/dist/web/assets/{TranslationSettingsPage-BoQXEZmn.js → TranslationSettingsPage-DKD6Uw2F.js} +1 -1
- package/dist/web/assets/{arc-5NPBSbiL.js → arc-BiuUFTzU.js} +1 -1
- package/dist/web/assets/{architectureDiagram-3BPJPVTR-CqPT-IsX.js → architectureDiagram-3BPJPVTR-Dcwk905A.js} +1 -1
- package/dist/web/assets/{at-sign-Cf39WHCg.js → at-sign-CZAKOH3i.js} +1 -1
- package/dist/web/assets/{blockDiagram-GPEHLZMM-BN-1z9KN.js → blockDiagram-GPEHLZMM-Cfc5JDN-.js} +1 -1
- package/dist/web/assets/{c4Diagram-AAUBKEIU-CkeLbmQp.js → c4Diagram-AAUBKEIU-B4v5PUdt.js} +1 -1
- package/dist/web/assets/channel-DThSYkmR.js +1 -0
- package/dist/web/assets/check-C3vuSPKz.js +1 -0
- package/dist/web/assets/{chevron-down-Ct7FZbKm.js → chevron-down-CtAk9uZw.js} +1 -1
- package/dist/web/assets/{chevron-up-ARFlXMyO.js → chevron-up-DAc3NX1J.js} +1 -1
- package/dist/web/assets/{chip-BV_1-tIb.js → chip-CDUNxQW2.js} +1 -1
- package/dist/web/assets/{chunk-2J33WTMH-CWR7tRuT.js → chunk-2J33WTMH-BYRdUeyt.js} +1 -1
- package/dist/web/assets/{chunk-4BX2VUAB-CAulp4D5.js → chunk-4BX2VUAB-3si_kPmV.js} +1 -1
- package/dist/web/assets/{chunk-55IACEB6-DqkKXsbD.js → chunk-55IACEB6-JiMm9u33.js} +1 -1
- package/dist/web/assets/{chunk-727SXJPM-B19m45Sq.js → chunk-727SXJPM-CMCFIUyF.js} +1 -1
- package/dist/web/assets/{chunk-AQP2D5EJ-CuODwkza.js → chunk-AQP2D5EJ-CzvnZjH5.js} +1 -1
- package/dist/web/assets/{chunk-FMBD7UC4-CbUAjtCT.js → chunk-FMBD7UC4-hsabZkPl.js} +1 -1
- package/dist/web/assets/{chunk-ND2GUHAM-C54VxArl.js → chunk-ND2GUHAM-D2o-Reeo.js} +1 -1
- package/dist/web/assets/{chunk-QZHKN3VN-D54Uw5fD.js → chunk-QZHKN3VN-ASJk-E7d.js} +1 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-CjJqgIpK.js +1 -0
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-CjJqgIpK.js +1 -0
- package/dist/web/assets/{code-block-OCS4YCEC-CtAySD1h.js → code-block-OCS4YCEC-5bkFBowa.js} +1 -1
- package/dist/web/assets/{confirm-dialog-CCjHVFTv.js → confirm-dialog-Bs80kXB9.js} +1 -1
- package/dist/web/assets/{content-DZozZbBD.js → content-DAccroCT.js} +1 -1
- package/dist/web/assets/{copy-C-jvx2et.js → copy-D1XK3OqK.js} +1 -1
- package/dist/web/assets/{cose-bilkent-S5V4N54A-BaB2EVcU.js → cose-bilkent-S5V4N54A-C52UKnOd.js} +1 -1
- package/dist/web/assets/{cssMode-wd7JR1S4.js → cssMode-BFq_c5xU.js} +1 -1
- package/dist/web/assets/{dagre-BM42HDAG-C2j1Y8pO.js → dagre-BM42HDAG-CeEute93.js} +1 -1
- package/dist/web/assets/{diagram-2AECGRRQ-CF-EvpV9.js → diagram-2AECGRRQ-CEcq4W4S.js} +1 -1
- package/dist/web/assets/{diagram-5GNKFQAL-rBNso835.js → diagram-5GNKFQAL-DqQe7Rr7.js} +1 -1
- package/dist/web/assets/{diagram-KO2AKTUF-6NW-oos1.js → diagram-KO2AKTUF-C1KVZphS.js} +1 -1
- package/dist/web/assets/{diagram-LMA3HP47-DTfRxRLT.js → diagram-LMA3HP47-D1BL7GQh.js} +1 -1
- package/dist/web/assets/{diagram-OG6HWLK6-CS4Ae-hD.js → diagram-OG6HWLK6-ngyXooqC.js} +1 -1
- package/dist/web/assets/{dialog-DV4wfpNU.js → dialog-XkZ8wMQa.js} +1 -1
- package/dist/web/assets/{erDiagram-TEJ5UH35-Dw9QQctN.js → erDiagram-TEJ5UH35-D1zIFVqE.js} +1 -1
- package/dist/web/assets/{file-Btui_I8Z.js → file-CXCll7Pm.js} +1 -1
- package/dist/web/assets/{flowDiagram-I6XJVG4X-BGZ9q86S.js → flowDiagram-I6XJVG4X-BZu49qcj.js} +1 -1
- package/dist/web/assets/{folder-picker-DiR-8Qdl.js → folder-picker-CVkaEJEL.js} +1 -1
- package/dist/web/assets/{freemarker2-yVWXzD3l.js → freemarker2-CmhadAeB.js} +1 -1
- package/dist/web/assets/{ganttDiagram-6RSMTGT7-CkGun0no.js → ganttDiagram-6RSMTGT7-eJ8yBxfS.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-PVQCEYII-Bz3oiYvi.js → gitGraphDiagram-PVQCEYII-DpeUUyH_.js} +1 -1
- package/dist/web/assets/{globe-DAFqpAcW.js → globe-WnxN1JzY.js} +1 -1
- package/dist/web/assets/{handlebars-BPf0z6eN.js → handlebars-DtjmH1qR.js} +1 -1
- package/dist/web/assets/{html-HCTCjfUg.js → html-DOYAlzlD.js} +1 -1
- package/dist/web/assets/{htmlMode-BDkbsknt.js → htmlMode-ORxd7KRN.js} +1 -1
- package/dist/web/assets/{index-BMcLxIvZ.js → index-6mINSZng.js} +1 -1
- package/dist/web/assets/{index-BPqjxXmH.js → index-BrjvxKaf.js} +1 -1
- package/dist/web/assets/{index-B8xoIIa6.js → index-CqIyOiVN.js} +4 -4
- package/dist/web/assets/{index-DgUtx9rV.js → index-D9w1zMaz.js} +1 -1
- package/dist/web/assets/{index-DkSPjZm4.js → index-DHDgbH3t.js} +1 -1
- package/dist/web/assets/{index-BszkzNS4.js → index-Dz9SKopM.js} +13 -13
- package/dist/web/assets/{index-GuczxPxb.js → index-eIXz5Hbk.js} +1 -1
- package/dist/web/assets/{index-DuM6iAxG.js → index-iOIxdF6J.js} +1 -1
- package/dist/web/assets/{index-lZLy5rkr.js → index-wbMiSmsY.js} +1 -1
- package/dist/web/assets/{infoDiagram-5YYISTIA-DYFufUYC.js → infoDiagram-5YYISTIA-BiVrC__7.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-IOkrKRwu.js → ishikawaDiagram-YF4QCWOH-B1kPjO1J.js} +1 -1
- package/dist/web/assets/javascript-CHlWHrtz.js +1 -0
- package/dist/web/assets/{journeyDiagram-JHISSGLW-Btl3yxne.js → journeyDiagram-JHISSGLW-DoTAPPAQ.js} +1 -1
- package/dist/web/assets/{jsonMode-DJPdvFcw.js → jsonMode-BkeQ_C6g.js} +1 -1
- package/dist/web/assets/{kanban-definition-UN3LZRKU-CDryhPbA.js → kanban-definition-UN3LZRKU-CBRmLcce.js} +1 -1
- package/dist/web/assets/{kbd-8RRRm9jd.js → kbd-CTfS0G5-.js} +1 -1
- package/dist/web/assets/{key-round-wojrCrDP.js → key-round-B7gTfpDR.js} +1 -1
- package/dist/web/assets/{layers-BH_LL4b8.js → layers-DE0xXedq.js} +1 -1
- package/dist/web/assets/{linear-BLuwKHze.js → linear-VLiA8Vcw.js} +1 -1
- package/dist/web/assets/{link-jWQOSQOQ.js → link-BSE_nRDT.js} +1 -1
- package/dist/web/assets/{liquid-1y-xg637.js → liquid-BZeg6p1K.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-cYkILdCn.js → lspLanguageFeatures-CuFQ2_f9.js} +1 -1
- package/dist/web/assets/{mdx-CRg4Q6aP.js → mdx-C7xLyFFX.js} +1 -1
- package/dist/web/assets/{menu-CMqbaDni.js → menu-Dp4RDxvP.js} +1 -1
- package/dist/web/assets/{mermaid-NOHMQCX5-CYeAhOl-.js → mermaid-NOHMQCX5-C2enCJxR.js} +62 -62
- package/dist/web/assets/{message-square-DykJ2lWP.js → message-square-4lyHjyHe.js} +1 -1
- package/dist/web/assets/{mindmap-definition-RKZ34NQL-B5wtw1Rv.js → mindmap-definition-RKZ34NQL-C1OOtqma.js} +1 -1
- package/dist/web/assets/{modal-BwOwTzij.js → modal-BGglpgrR.js} +1 -1
- package/dist/web/assets/{monaco-CcHqpOKe.js → monaco-B-6VmJO0.js} +3 -3
- package/dist/web/assets/{nav-row-BmtdNLxR.js → nav-row-DaR8yP7p.js} +1 -1
- package/dist/web/assets/{paperclip-C4t49vX2.js → paperclip-DORF2rEM.js} +1 -1
- package/dist/web/assets/{pencil-BQ5_raiB.js → pencil-BG033B74.js} +1 -1
- package/dist/web/assets/{people-Dr0v8HK0.js → people-1qyKeYq6.js} +1 -1
- package/dist/web/assets/{pieDiagram-4H26LBE5-BZ3VoaNI.js → pieDiagram-4H26LBE5-BYYFVqOS.js} +1 -1
- package/dist/web/assets/{popover-CTqvKqTR.js → popover-CvjMbMb4.js} +1 -1
- package/dist/web/assets/{python-Huq_acyd.js → python-TTfnYnjF.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-W4KKPZXB-C6ArHmnG.js → quadrantDiagram-W4KKPZXB-DTllM2j9.js} +1 -1
- package/dist/web/assets/{razor-Clc87Ivb.js → razor-BFVXAHVd.js} +1 -1
- package/dist/web/assets/{requirementDiagram-4Y6WPE33-DiLzBRQP.js → requirementDiagram-4Y6WPE33-DeJDRYUP.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-5OEKKPKP-QlYYd7IZ.js → sankeyDiagram-5OEKKPKP-DzTvEKv8.js} +1 -1
- package/dist/web/assets/{search-CMIAPUEt.js → search-DDRcBORc.js} +1 -1
- package/dist/web/assets/{select-DqB7YF38.js → select-CXC17bJx.js} +1 -1
- package/dist/web/assets/{select-Bg7NI8i0.js → select-CzXL3ZbG.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-3UESZ5HK-COKEtqc0.js → sequenceDiagram-3UESZ5HK-CIYrA1ww.js} +1 -1
- package/dist/web/assets/{server-D7knl8H9.js → server-KqeWHfgr.js} +1 -1
- package/dist/web/assets/{stateDiagram-AJRCARHV-1RZZZdOe.js → stateDiagram-AJRCARHV-Dg_UXkEq.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-Lc4r0bC3.js +1 -0
- package/dist/web/assets/{textarea-BCY2J2ca.js → textarea-Cmbv5l35.js} +1 -1
- package/dist/web/assets/{timeline-definition-PNZ67QCA-IJl1LY6J.js → timeline-definition-PNZ67QCA-CfSPMqxF.js} +1 -1
- package/dist/web/assets/{toggles-C4LmZwyo.js → toggles-t5v4QKn6.js} +1 -1
- package/dist/web/assets/{tooltip-Cirpotu3.js → tooltip-Cp8tovqH.js} +1 -1
- package/dist/web/assets/{track-Cv7h6oaE.js → track-C1rUV49K.js} +1 -1
- package/dist/web/assets/{trash-2-BEOQ1ICJ.js → trash-2-Ca2ken6q.js} +1 -1
- package/dist/web/assets/{tsMode-CHIbCBQc.js → tsMode-DBbiXlyu.js} +1 -1
- package/dist/web/assets/{typescript-CScj0bbb.js → typescript-jv_3P9x_.js} +1 -1
- package/dist/web/assets/{upload-tLVD0xMT.js → upload-CgGjN1FH.js} +1 -1
- package/dist/web/assets/{use-profiles-TkoP4Yw9.js → use-profiles-BdL-U8GZ.js} +1 -1
- package/dist/web/assets/{use-providers-Bz6YNiYj.js → use-providers-B6Mj5qeG.js} +1 -1
- package/dist/web/assets/{use-translation-settings-CCpQNS30.js → use-translation-settings-FIP674t9.js} +1 -1
- package/dist/web/assets/{useNormalizedLogs-Bstb98cF.js → useNormalizedLogs-FpVMUHeq.js} +1 -1
- package/dist/web/assets/useTokenUsage-Ay3Yy0_V.js +1 -0
- package/dist/web/assets/{vennDiagram-CIIHVFJN-DzVayy4U.js → vennDiagram-CIIHVFJN-DKREAIRT.js} +1 -1
- package/dist/web/assets/{wardley-L42UT6IY-CULSKh55.js → wardley-L42UT6IY-BMpDotAz.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-YWT4CUSO-C5_h3lAA.js → wardleyDiagram-YWT4CUSO-DAPccQsF.js} +1 -1
- package/dist/web/assets/{xml-XuycSwh6.js → xml-DnxIQwRS.js} +1 -1
- package/dist/web/assets/{xychartDiagram-2RQKCTM6-F65naXcR.js → xychartDiagram-2RQKCTM6-o06g8vo8.js} +1 -1
- package/dist/web/assets/{yaml-BWm159lw.js → yaml-BV5yQTRd.js} +1 -1
- package/dist/web/index.html +1 -1
- package/node_modules/@agent-tower/shared/dist/log-adapter.d.ts +4 -0
- package/node_modules/@agent-tower/shared/dist/log-adapter.d.ts.map +1 -1
- package/node_modules/@agent-tower/shared/dist/log-adapter.js +1 -0
- package/node_modules/@agent-tower/shared/dist/log-adapter.js.map +1 -1
- package/node_modules/@agent-tower/shared/dist/translation.d.ts +4 -1
- package/node_modules/@agent-tower/shared/dist/translation.d.ts.map +1 -1
- package/node_modules/@agent-tower/shared/dist/translation.js +4 -1
- package/node_modules/@agent-tower/shared/dist/translation.js.map +1 -1
- package/node_modules/@agent-tower/shared/dist/types.d.ts +38 -2
- package/node_modules/@agent-tower/shared/dist/types.d.ts.map +1 -1
- package/node_modules/@agent-tower/shared/dist/types.js.map +1 -1
- package/package.json +2 -1
- package/prisma/migrations/20261106000000_add_session_wakeups/migration.sql +28 -0
- package/prisma/schema.prisma +28 -0
- package/scripts/postinstall.js +23 -0
- package/dist/web/assets/AttachmentPreview-TPd4gdfb.js +0 -2
- package/dist/web/assets/CreateTaskInput-TcZpjBe-.js +0 -1
- package/dist/web/assets/TaskHandoffPanel-CJahUKNo.js +0 -70
- package/dist/web/assets/channel-CDkuQ_7m.js +0 -1
- package/dist/web/assets/check-yNWhPvMH.js +0 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-eHY73FGu.js +0 -1
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-eHY73FGu.js +0 -1
- package/dist/web/assets/javascript-DKmxrNeR.js +0 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-CCLmVs34.js +0 -1
- package/dist/web/assets/useTokenUsage-D7SEwXb0.js +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TaskDetail-
|
|
2
|
-
import{c as lr,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TaskDetail-C2_Fg59e.js","assets/index-Dz9SKopM.js","assets/index-408ws6FY.css","assets/TaskHandoffPanel-3Y0gcjyN.js","assets/trash-2-Ca2ken6q.js","assets/mermaid-NOHMQCX5-C2enCJxR.js","assets/AttachmentPreview-hD3g_T_y.js","assets/tooltip-Cp8tovqH.js","assets/kbd-CTfS0G5-.js","assets/index-BrjvxKaf.js","assets/index-wbMiSmsY.js","assets/index-DHDgbH3t.js","assets/use-translation-settings-FIP674t9.js","assets/copy-D1XK3OqK.js","assets/index-D9w1zMaz.js","assets/chevron-down-CtAk9uZw.js","assets/mermaid-NOHMQCX5-lI9o3AWT.css","assets/use-providers-B6Mj5qeG.js","assets/MemberAvatar-DBab_9EO.js","assets/people-1qyKeYq6.js","assets/chevron-up-DAc3NX1J.js","assets/at-sign-CZAKOH3i.js","assets/paperclip-DORF2rEM.js","assets/check-C3vuSPKz.js","assets/useTokenUsage-Ay3Yy0_V.js","assets/menu-Dp4RDxvP.js","assets/menu-styles-DWynpVVz.js","assets/index-eIXz5Hbk.js","assets/index-iOIxdF6J.js","assets/ExecutionPermissionSelector-BgrxbvBB.js","assets/provider-selection-DSu7SCI7.js","assets/BrandLogo-BSwQa2SF.js","assets/popover-CvjMbMb4.js","assets/search-DDRcBORc.js","assets/confirm-dialog-Bs80kXB9.js","assets/dialog-XkZ8wMQa.js","assets/modal-BGglpgrR.js","assets/select-CXC17bJx.js","assets/select-CzXL3ZbG.js","assets/index-6mINSZng.js","assets/layers-DE0xXedq.js","assets/message-square-4lyHjyHe.js","assets/textarea-Cmbv5l35.js","assets/content-DAccroCT.js","assets/file-CXCll7Pm.js","assets/CreateTaskInput-Bric0GeW.js","assets/BranchSelect-BkuXnEG2.js","assets/server-KqeWHfgr.js","assets/upload-CgGjN1FH.js","assets/globe-WnxN1JzY.js","assets/pencil-BG033B74.js","assets/TaskHandoffPanel-DcpNTP1B.css","assets/useNormalizedLogs-FpVMUHeq.js","assets/track-C1rUV49K.js","assets/chip-CDUNxQW2.js","assets/folder-picker-CVkaEJEL.js","assets/MobileTaskDetail-Dm64ie99.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as lr,bb as is,p as Ue,r as u,ab as _,aG as pt,as as Xe,az as ne,bn as Le,b2 as Te,u as ze,bo as as,j as o,a5 as De,ap as Rn,aA as it,l as ce,a2 as cr,bp as ls,au as vt,bq as Lt,br as cs,bs as us,bt as ds,aO as ur,bu as dr,N as fs,m as hs,o as Wt,n as vn,q as fe,X as ms,aB as gs,ae as ps,aj as Pt,aU as vs,t as Oe,bv as bs,bw as en,ai as xs,bx as ys,by as ws,bz as Cs,bA as tn,aQ as An,aR as Tn,bB as fr}from"./index-Dz9SKopM.js";import{C as Ss}from"./confirm-dialog-Bs80kXB9.js";import{a as Ns,k as Es,h as js}from"./BranchSelect-BkuXnEG2.js";import{f as ks,b as Dn,c as In,s as bt,d as Rs,C as Mn}from"./CreateTaskInput-Bric0GeW.js";import{P as hr,T as As}from"./trash-2-Ca2ken6q.js";import{C as Ct}from"./check-C3vuSPKz.js";import{S as mr}from"./search-DDRcBORc.js";import{F as Ts}from"./chip-CDUNxQW2.js";import{S as Ds,I as nn,B as Pn}from"./BrandLogo-BSwQa2SF.js";import{M as Is}from"./message-square-4lyHjyHe.js";import{L as dn}from"./layers-DE0xXedq.js";import{b as Ms}from"./AttachmentPreview-hD3g_T_y.js";import{c as Ps,P as Os,a as Ls,b as zs,I as Bs}from"./popover-CvjMbMb4.js";import{C as On}from"./copy-D1XK3OqK.js";import{u as Fs}from"./use-providers-B6Mj5qeG.js";import{i as _s}from"./provider-selection-DSu7SCI7.js";import{F as Us}from"./folder-picker-CVkaEJEL.js";import{M as Ln}from"./modal-BGglpgrR.js";import{a as mt}from"./ExecutionPermissionSelector-BgrxbvBB.js";import{C as $s}from"./chevron-down-CtAk9uZw.js";const Ks=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],Gs=lr("list-tree",Ks);const Ws=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],zn=lr("smartphone",Ws),rn=new Map;async function Qs(e,t,n){const r=`tower:task-start:${e}:${JSON.stringify(t)}`;let a=rn.get(r);if(!a)try{const h=sessionStorage.getItem(r);h&&(a=JSON.parse(h))}catch{}a??={creationId:is()},rn.set(r,a);const c=()=>{try{sessionStorage.setItem(r,JSON.stringify(a))}catch{}};c(),a.workspace||(n.onStep?.("creating-workspace"),a.workspace=await n.createWorkspace(a.creationId),c()),a.session||(n.onStep?.("creating-session"),a.session=await Ue.post(`/workspaces/${a.workspace.id}/sessions`,{providerId:t.providerId,prompt:t.prompt,retryTask:t.retryTask,clientSubmissionId:a.creationId}),c()),n.onStep?.("starting-session"),await n.startSession(a.session.id),rn.delete(r);try{sessionStorage.removeItem(r)}catch{}return{workspace:a.workspace,session:a.session}}const Qt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function lt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function bn(e){return"nodeType"in e}function be(e){var t,n;return e?lt(e)?e:bn(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function xn(e){const{Document:t}=be(e);return e instanceof t}function jt(e){return lt(e)?!1:e instanceof be(e).HTMLElement}function gr(e){return e instanceof be(e).SVGElement}function ct(e){return e?lt(e)?e.document:bn(e)?xn(e)?e:jt(e)||gr(e)?e.ownerDocument:document:document:document}const $e=Qt?u.useLayoutEffect:u.useEffect;function Yt(e){const t=u.useRef(e);return $e(()=>{t.current=e}),u.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}function Ys(){const e=u.useRef(null),t=u.useCallback((r,a)=>{e.current=setInterval(r,a)},[]),n=u.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function St(e,t){t===void 0&&(t=[e]);const n=u.useRef(e);return $e(()=>{n.current!==e&&(n.current=e)},t),n}function kt(e,t){const n=u.useRef();return u.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function zt(e){const t=Yt(e),n=u.useRef(null),r=u.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,r]}function Bt(e){const t=u.useRef();return u.useEffect(()=>{t.current=e},[e]),t.current}let sn={};function Ht(e,t){return u.useMemo(()=>{if(t)return t;const n=sn[e]==null?0:sn[e]+1;return sn[e]=n,e+"-"+n},[e,t])}function pr(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return r.reduce((c,h)=>{const f=Object.entries(h);for(const[s,i]of f){const l=c[s];l!=null&&(c[s]=l+e*i)}return c},{...t})}}const at=pr(1),Ft=pr(-1);function Hs(e){return"clientX"in e&&"clientY"in e}function yn(e){if(!e)return!1;const{KeyboardEvent:t}=be(e.target);return t&&e instanceof t}function Xs(e){if(!e)return!1;const{TouchEvent:t}=be(e.target);return t&&e instanceof t}function _t(e){if(Xs(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Hs(e)?{x:e.clientX,y:e.clientY}:null}const Nt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Nt.Translate.toString(e),Nt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Bn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function qs(e){return e.matches(Bn)?e:e.querySelector(Bn)}const Vs={display:"none"};function Js(e){let{id:t,value:n}=e;return _.createElement("div",{id:t,style:Vs},n)}function Zs(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return _.createElement("div",{id:t,style:a,role:"status","aria-live":r,"aria-atomic":!0},n)}function eo(){const[e,t]=u.useState("");return{announce:u.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const vr=u.createContext(null);function to(e){const t=u.useContext(vr);u.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function no(){const[e]=u.useState(()=>new Set),t=u.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[u.useCallback(r=>{let{type:a,event:c}=r;e.forEach(h=>{var f;return(f=h[a])==null?void 0:f.call(h,c)})},[e]),t]}const ro={draggable:`
|
|
3
3
|
To pick up a draggable item, press the space bar.
|
|
4
4
|
While dragging, use the arrow keys to move the item.
|
|
5
5
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
6
6
|
`},so={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function oo(e){let{announcements:t=so,container:n,hiddenTextDescribedById:r,screenReaderInstructions:a=ro}=e;const{announce:c,announcement:h}=eo(),f=Ht("DndLiveRegion"),[s,i]=u.useState(!1);if(u.useEffect(()=>{i(!0)},[]),to(u.useMemo(()=>({onDragStart(d){let{active:g}=d;c(t.onDragStart({active:g}))},onDragMove(d){let{active:g,over:p}=d;t.onDragMove&&c(t.onDragMove({active:g,over:p}))},onDragOver(d){let{active:g,over:p}=d;c(t.onDragOver({active:g,over:p}))},onDragEnd(d){let{active:g,over:p}=d;c(t.onDragEnd({active:g,over:p}))},onDragCancel(d){let{active:g,over:p}=d;c(t.onDragCancel({active:g,over:p}))}}),[c,t])),!s)return null;const l=_.createElement(_.Fragment,null,_.createElement(Js,{id:r,value:a.draggable}),_.createElement(Zs,{id:f,announcement:h}));return n?pt.createPortal(l,n):l}var de;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(de||(de={}));function Ut(){}function io(e,t){return u.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function ao(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return u.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Ie=Object.freeze({x:0,y:0});function lo(e,t){const n=_t(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function co(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function uo(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function fo(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),c=Math.min(t.top+t.height,e.top+e.height),h=a-r,f=c-n;if(r<a&&n<c){const s=t.width*t.height,i=e.width*e.height,l=h*f,d=l/(s+i-l);return Number(d.toFixed(4))}return 0}const ho=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=[];for(const c of r){const{id:h}=c,f=n.get(h);if(f){const s=fo(f,t);s>0&&a.push({id:h,data:{droppableContainer:c,value:s}})}}return a.sort(co)};function mo(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function br(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ie}function go(e){return function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),c=1;c<r;c++)a[c-1]=arguments[c];return a.reduce((h,f)=>({...h,top:h.top+e*f.y,bottom:h.bottom+e*f.y,left:h.left+e*f.x,right:h.right+e*f.x}),{...n})}}const po=go(1);function xr(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function vo(e,t,n){const r=xr(t);if(!r)return e;const{scaleX:a,scaleY:c,x:h,y:f}=r,s=e.left-h-(1-a)*parseFloat(n),i=e.top-f-(1-c)*parseFloat(n.slice(n.indexOf(" ")+1)),l=a?e.width/a:e.width,d=c?e.height/c:e.height;return{width:l,height:d,top:i,right:s+l,bottom:i+d,left:s}}const bo={ignoreTransform:!1};function Rt(e,t){t===void 0&&(t=bo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:i,transformOrigin:l}=be(e).getComputedStyle(e);i&&(n=vo(n,i,l))}const{top:r,left:a,width:c,height:h,bottom:f,right:s}=n;return{top:r,left:a,width:c,height:h,bottom:f,right:s}}function Fn(e){return Rt(e,{ignoreTransform:!0})}function xo(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function yo(e,t){return t===void 0&&(t=be(e).getComputedStyle(e)),t.position==="fixed"}function wo(e,t){t===void 0&&(t=be(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const c=t[a];return typeof c=="string"?n.test(c):!1})}function wn(e,t){const n=[];function r(a){if(t!=null&&n.length>=t||!a)return n;if(xn(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!jt(a)||gr(a)||n.includes(a))return n;const c=be(e).getComputedStyle(a);return a!==e&&wo(a,c)&&n.push(a),yo(a,c)?n:r(a.parentNode)}return e?r(e):n}function yr(e){const[t]=wn(e,1);return t??null}function on(e){return!Qt||!e?null:lt(e)?e:bn(e)?xn(e)||e===ct(e).scrollingElement?window:jt(e)?e:null:null}function wr(e){return lt(e)?e.scrollX:e.scrollLeft}function Cr(e){return lt(e)?e.scrollY:e.scrollTop}function fn(e){return{x:wr(e),y:Cr(e)}}var he;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(he||(he={}));function Sr(e){return!Qt||!e?!1:e===document.scrollingElement}function Nr(e){const t={x:0,y:0},n=Sr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},a=e.scrollTop<=t.y,c=e.scrollLeft<=t.x,h=e.scrollTop>=r.y,f=e.scrollLeft>=r.x;return{isTop:a,isLeft:c,isBottom:h,isRight:f,maxScroll:r,minScroll:t}}const Co={x:.2,y:.2};function So(e,t,n,r,a){let{top:c,left:h,right:f,bottom:s}=n;r===void 0&&(r=10),a===void 0&&(a=Co);const{isTop:i,isBottom:l,isLeft:d,isRight:g}=Nr(e),p={x:0,y:0},m={x:0,y:0},x={height:t.height*a.y,width:t.width*a.x};return!i&&c<=t.top+x.height?(p.y=he.Backward,m.y=r*Math.abs((t.top+x.height-c)/x.height)):!l&&s>=t.bottom-x.height&&(p.y=he.Forward,m.y=r*Math.abs((t.bottom-x.height-s)/x.height)),!g&&f>=t.right-x.width?(p.x=he.Forward,m.x=r*Math.abs((t.right-x.width-f)/x.width)):!d&&h<=t.left+x.width&&(p.x=he.Backward,m.x=r*Math.abs((t.left+x.width-h)/x.width)),{direction:p,speed:m}}function No(e){if(e===document.scrollingElement){const{innerWidth:c,innerHeight:h}=window;return{top:0,left:0,right:c,bottom:h,width:c,height:h}}const{top:t,left:n,right:r,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Er(e){return e.reduce((t,n)=>at(t,fn(n)),Ie)}function Eo(e){return e.reduce((t,n)=>t+wr(n),0)}function jo(e){return e.reduce((t,n)=>t+Cr(n),0)}function jr(e,t){if(t===void 0&&(t=Rt),!e)return;const{top:n,left:r,bottom:a,right:c}=t(e);yr(e)&&(a<=0||c<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ko=[["x",["left","right"],Eo],["y",["top","bottom"],jo]];class Cn{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=wn(n),a=Er(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[c,h,f]of ko)for(const s of h)Object.defineProperty(this,s,{get:()=>{const i=f(r),l=a[c]-i;return this.rect[s]+l},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xt{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var a;(a=this.target)==null||a.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Ro(e){const{EventTarget:t}=be(e);return e instanceof t?e:ct(e)}function an(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Ne;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ne||(Ne={}));function _n(e){e.preventDefault()}function Ao(e){e.stopPropagation()}var V;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(V||(V={}));const kr={start:[V.Space,V.Enter],cancel:[V.Esc],end:[V.Space,V.Enter,V.Tab]},To=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case V.Right:return{...n,x:n.x+25};case V.Left:return{...n,x:n.x-25};case V.Down:return{...n,y:n.y+25};case V.Up:return{...n,y:n.y-25}}};class Rr{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new xt(ct(n)),this.windowListeners=new xt(be(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ne.Resize,this.handleCancel),this.windowListeners.add(Ne.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ne.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&jr(r),n(Ie)}handleKeyDown(t){if(yn(t)){const{active:n,context:r,options:a}=this.props,{keyboardCodes:c=kr,coordinateGetter:h=To,scrollBehavior:f="smooth"}=a,{code:s}=t;if(c.end.includes(s)){this.handleEnd(t);return}if(c.cancel.includes(s)){this.handleCancel(t);return}const{collisionRect:i}=r.current,l=i?{x:i.left,y:i.top}:Ie;this.referenceCoordinates||(this.referenceCoordinates=l);const d=h(t,{active:n,context:r.current,currentCoordinates:l});if(d){const g=Ft(d,l),p={x:0,y:0},{scrollableAncestors:m}=r.current;for(const x of m){const v=t.code,{isTop:k,isRight:C,isLeft:y,isBottom:R,maxScroll:S,minScroll:M}=Nr(x),D=No(x),j={x:Math.min(v===V.Right?D.right-D.width/2:D.right,Math.max(v===V.Right?D.left:D.left+D.width/2,d.x)),y:Math.min(v===V.Down?D.bottom-D.height/2:D.bottom,Math.max(v===V.Down?D.top:D.top+D.height/2,d.y))},P=v===V.Right&&!C||v===V.Left&&!y,F=v===V.Down&&!R||v===V.Up&&!k;if(P&&j.x!==d.x){const O=x.scrollLeft+g.x,W=v===V.Right&&O<=S.x||v===V.Left&&O>=M.x;if(W&&!g.y){x.scrollTo({left:O,behavior:f});return}W?p.x=x.scrollLeft-O:p.x=v===V.Right?x.scrollLeft-S.x:x.scrollLeft-M.x,p.x&&x.scrollBy({left:-p.x,behavior:f});break}else if(F&&j.y!==d.y){const O=x.scrollTop+g.y,W=v===V.Down&&O<=S.y||v===V.Up&&O>=M.y;if(W&&!g.x){x.scrollTo({top:O,behavior:f});return}W?p.y=x.scrollTop-O:p.y=v===V.Down?x.scrollTop-S.y:x.scrollTop-M.y,p.y&&x.scrollBy({top:-p.y,behavior:f});break}}this.handleMove(t,at(Ft(d,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Rr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=kr,onActivation:a}=t,{active:c}=n;const{code:h}=e.nativeEvent;if(r.start.includes(h)){const f=c.activatorNode.current;return f&&e.target!==f?!1:(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];function Un(e){return!!(e&&"distance"in e)}function $n(e){return!!(e&&"delay"in e)}class Sn{constructor(t,n,r){var a;r===void 0&&(r=Ro(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:c}=t,{target:h}=c;this.props=t,this.events=n,this.document=ct(h),this.documentListeners=new xt(this.document),this.listeners=new xt(r),this.windowListeners=new xt(be(h)),this.initialCoordinates=(a=_t(c))!=null?a:Ie,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ne.Resize,this.handleCancel),this.windowListeners.add(Ne.DragStart,_n),this.windowListeners.add(Ne.VisibilityChange,this.handleCancel),this.windowListeners.add(Ne.ContextMenu,_n),this.documentListeners.add(Ne.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if($n(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Un(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:a}=this.props;a(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ne.Click,Ao,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ne.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:a,props:c}=this,{onMove:h,options:{activationConstraint:f}}=c;if(!a)return;const s=(n=_t(t))!=null?n:Ie,i=Ft(a,s);if(!r&&f){if(Un(f)){if(f.tolerance!=null&&an(i,f.tolerance))return this.handleCancel();if(an(i,f.distance))return this.handleStart()}if($n(f)&&an(i,f.tolerance))return this.handleCancel();this.handlePending(f,i);return}t.cancelable&&t.preventDefault(),h(s)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===V.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Do={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Nn extends Sn{constructor(t){const{event:n}=t,r=ct(n.target);super(t,Do,r)}}Nn.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const Io={move:{name:"mousemove"},end:{name:"mouseup"}};var hn;(function(e){e[e.RightClick=2]="RightClick"})(hn||(hn={}));class Mo extends Sn{constructor(t){super(t,Io,ct(t.event.target))}}Mo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===hn.RightClick?!1:(r?.({event:n}),!0)}}];const ln={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Po extends Sn{constructor(t){super(t,ln)}static setup(){return window.addEventListener(ln.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ln.move.name,t)};function t(){}}}Po.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:a}=n;return a.length>1?!1:(r?.({event:n}),!0)}}];var yt;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(yt||(yt={}));var $t;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})($t||($t={}));function Oo(e){let{acceleration:t,activator:n=yt.Pointer,canScroll:r,draggingRect:a,enabled:c,interval:h=5,order:f=$t.TreeOrder,pointerCoordinates:s,scrollableAncestors:i,scrollableAncestorRects:l,delta:d,threshold:g}=e;const p=zo({delta:d,disabled:!c}),[m,x]=Ys(),v=u.useRef({x:0,y:0}),k=u.useRef({x:0,y:0}),C=u.useMemo(()=>{switch(n){case yt.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case yt.DraggableRect:return a}},[n,a,s]),y=u.useRef(null),R=u.useCallback(()=>{const M=y.current;if(!M)return;const D=v.current.x*k.current.x,j=v.current.y*k.current.y;M.scrollBy(D,j)},[]),S=u.useMemo(()=>f===$t.TreeOrder?[...i].reverse():i,[f,i]);u.useEffect(()=>{if(!c||!i.length||!C){x();return}for(const M of S){if(r?.(M)===!1)continue;const D=i.indexOf(M),j=l[D];if(!j)continue;const{direction:P,speed:F}=So(M,j,C,t,g);for(const O of["x","y"])p[O][P[O]]||(F[O]=0,P[O]=0);if(F.x>0||F.y>0){x(),y.current=M,m(R,h),v.current=F,k.current=P;return}}v.current={x:0,y:0},k.current={x:0,y:0},x()},[t,R,r,x,c,h,JSON.stringify(C),JSON.stringify(p),m,i,S,l,JSON.stringify(g)])}const Lo={x:{[he.Backward]:!1,[he.Forward]:!1},y:{[he.Backward]:!1,[he.Forward]:!1}};function zo(e){let{delta:t,disabled:n}=e;const r=Bt(t);return kt(a=>{if(n||!r||!a)return Lo;const c={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[he.Backward]:a.x[he.Backward]||c.x===-1,[he.Forward]:a.x[he.Forward]||c.x===1},y:{[he.Backward]:a.y[he.Backward]||c.y===-1,[he.Forward]:a.y[he.Forward]||c.y===1}}},[n,t,r])}function Bo(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return kt(a=>{var c;return t==null?null:(c=r??a)!=null?c:null},[r,t])}function Fo(e,t){return u.useMemo(()=>e.reduce((n,r)=>{const{sensor:a}=r,c=a.activators.map(h=>({eventName:h.eventName,handler:t(h.handler,r)}));return[...n,...c]},[]),[e,t])}var Et;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Et||(Et={}));var mn;(function(e){e.Optimized="optimized"})(mn||(mn={}));const Kn=new Map;function _o(e,t){let{dragging:n,dependencies:r,config:a}=t;const[c,h]=u.useState(null),{frequency:f,measure:s,strategy:i}=a,l=u.useRef(e),d=v(),g=St(d),p=u.useCallback(function(k){k===void 0&&(k=[]),!g.current&&h(C=>C===null?k:C.concat(k.filter(y=>!C.includes(y))))},[g]),m=u.useRef(null),x=kt(k=>{if(d&&!n)return Kn;if(!k||k===Kn||l.current!==e||c!=null){const C=new Map;for(let y of e){if(!y)continue;if(c&&c.length>0&&!c.includes(y.id)&&y.rect.current){C.set(y.id,y.rect.current);continue}const R=y.node.current,S=R?new Cn(s(R),R):null;y.rect.current=S,S&&C.set(y.id,S)}return C}return k},[e,c,n,d,s]);return u.useEffect(()=>{l.current=e},[e]),u.useEffect(()=>{d||p()},[n,d]),u.useEffect(()=>{c&&c.length>0&&h(null)},[JSON.stringify(c)]),u.useEffect(()=>{d||typeof f!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},f))},[f,d,p,...r]),{droppableRects:x,measureDroppableContainers:p,measuringScheduled:c!=null};function v(){switch(i){case Et.Always:return!1;case Et.BeforeDragging:return n;default:return!n}}}function En(e,t){return kt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Uo(e,t){return En(e,t)}function $o(e){let{callback:t,disabled:n}=e;const r=Yt(t),a=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:c}=window;return new c(r)},[r,n]);return u.useEffect(()=>()=>a?.disconnect(),[a]),a}function Xt(e){let{callback:t,disabled:n}=e;const r=Yt(t),a=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:c}=window;return new c(r)},[n]);return u.useEffect(()=>()=>a?.disconnect(),[a]),a}function Ko(e){return new Cn(Rt(e),e)}function Gn(e,t,n){t===void 0&&(t=Ko);const[r,a]=u.useState(null);function c(){a(s=>{if(!e)return null;if(e.isConnected===!1){var i;return(i=s??n)!=null?i:null}const l=t(e);return JSON.stringify(s)===JSON.stringify(l)?s:l})}const h=$o({callback(s){if(e)for(const i of s){const{type:l,target:d}=i;if(l==="childList"&&d instanceof HTMLElement&&d.contains(e)){c();break}}}}),f=Xt({callback:c});return $e(()=>{c(),e?(f?.observe(e),h?.observe(document.body,{childList:!0,subtree:!0})):(f?.disconnect(),h?.disconnect())},[e]),r}function Go(e){const t=En(e);return br(e,t)}const Wn=[];function Wo(e){const t=u.useRef(e),n=kt(r=>e?r&&r!==Wn&&e&&t.current&&e.parentNode===t.current.parentNode?r:wn(e):Wn,[e]);return u.useEffect(()=>{t.current=e},[e]),n}function Qo(e){const[t,n]=u.useState(null),r=u.useRef(e),a=u.useCallback(c=>{const h=on(c.target);h&&n(f=>f?(f.set(h,fn(h)),new Map(f)):null)},[]);return u.useEffect(()=>{const c=r.current;if(e!==c){h(c);const f=e.map(s=>{const i=on(s);return i?(i.addEventListener("scroll",a,{passive:!0}),[i,fn(i)]):null}).filter(s=>s!=null);n(f.length?new Map(f):null),r.current=e}return()=>{h(e),h(c)};function h(f){f.forEach(s=>{const i=on(s);i?.removeEventListener("scroll",a)})}},[a,e]),u.useMemo(()=>e.length?t?Array.from(t.values()).reduce((c,h)=>at(c,h),Ie):Er(e):Ie,[e,t])}function Qn(e,t){t===void 0&&(t=[]);const n=u.useRef(null);return u.useEffect(()=>{n.current=null},t),u.useEffect(()=>{const r=e!==Ie;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Ft(e,n.current):Ie}function Yo(e){u.useEffect(()=>{if(!Qt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function Ho(e,t){return u.useMemo(()=>e.reduce((n,r)=>{let{eventName:a,handler:c}=r;return n[a]=h=>{c(h,t)},n},{}),[e,t])}function Ar(e){return u.useMemo(()=>e?xo(e):null,[e])}const Yn=[];function Xo(e,t){t===void 0&&(t=Rt);const[n]=e,r=Ar(n?be(n):null),[a,c]=u.useState(Yn);function h(){c(()=>e.length?e.map(s=>Sr(s)?r:new Cn(t(s),s)):Yn)}const f=Xt({callback:h});return $e(()=>{f?.disconnect(),h(),e.forEach(s=>f?.observe(s))},[e]),a}function Tr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return jt(t)?t:e}function qo(e){let{measure:t}=e;const[n,r]=u.useState(null),a=u.useCallback(i=>{for(const{target:l}of i)if(jt(l)){r(d=>{const g=t(l);return d?{...d,width:g.width,height:g.height}:g});break}},[t]),c=Xt({callback:a}),h=u.useCallback(i=>{const l=Tr(i);c?.disconnect(),l&&c?.observe(l),r(l?t(l):null)},[t,c]),[f,s]=zt(h);return u.useMemo(()=>({nodeRef:f,rect:n,setRef:s}),[n,f,s])}const Vo=[{sensor:Nn,options:{}},{sensor:Rr,options:{}}],Jo={current:{}},Ot={draggable:{measure:Fn},droppable:{measure:Fn,strategy:Et.WhileDragging,frequency:mn.Optimized},dragOverlay:{measure:Rt}};class wt extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Zo={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new wt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ut},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ot,measureDroppableContainers:Ut,windowRect:null,measuringScheduled:!1},Dr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ut,draggableNodes:new Map,over:null,measureDroppableContainers:Ut},At=u.createContext(Dr),Ir=u.createContext(Zo);function ei(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new wt}}}function ti(e,t){switch(t.type){case de.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case de.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case de.DragEnd:case de.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case de.RegisterDroppable:{const{element:n}=t,{id:r}=n,a=new wt(e.droppable.containers);return a.set(r,n),{...e,droppable:{...e.droppable,containers:a}}}case de.SetDroppableDisabled:{const{id:n,key:r,disabled:a}=t,c=e.droppable.containers.get(n);if(!c||r!==c.key)return e;const h=new wt(e.droppable.containers);return h.set(n,{...c,disabled:a}),{...e,droppable:{...e.droppable,containers:h}}}case de.UnregisterDroppable:{const{id:n,key:r}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const c=new wt(e.droppable.containers);return c.delete(n),{...e,droppable:{...e.droppable,containers:c}}}default:return e}}function ni(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:a}=u.useContext(At),c=Bt(r),h=Bt(n?.id);return u.useEffect(()=>{if(!t&&!r&&c&&h!=null){if(!yn(c)||document.activeElement===c.target)return;const f=a.get(h);if(!f)return;const{activatorNode:s,node:i}=f;if(!s.current&&!i.current)return;requestAnimationFrame(()=>{for(const l of[s.current,i.current]){if(!l)continue;const d=qs(l);if(d){d.focus();break}}})}},[r,t,a,h,c]),null}function Mr(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((a,c)=>c({transform:a,...r}),n):n}function ri(e){return u.useMemo(()=>({draggable:{...Ot.draggable,...e?.draggable},droppable:{...Ot.droppable,...e?.droppable},dragOverlay:{...Ot.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function si(e){let{activeNode:t,measure:n,initialRect:r,config:a=!0}=e;const c=u.useRef(!1),{x:h,y:f}=typeof a=="boolean"?{x:a,y:a}:a;$e(()=>{if(!h&&!f||!t){c.current=!1;return}if(c.current||!r)return;const i=t?.node.current;if(!i||i.isConnected===!1)return;const l=n(i),d=br(l,r);if(h||(d.x=0),f||(d.y=0),c.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const g=yr(i);g&&g.scrollBy({top:d.y,left:d.x})}},[t,h,f,r,n])}const qt=u.createContext({...Ie,scaleX:1,scaleY:1});var We;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(We||(We={}));const oi=u.memo(function(t){var n,r,a,c;let{id:h,accessibility:f,autoScroll:s=!0,children:i,sensors:l=Vo,collisionDetection:d=ho,measuring:g,modifiers:p,...m}=t;const x=u.useReducer(ti,void 0,ei),[v,k]=x,[C,y]=no(),[R,S]=u.useState(We.Uninitialized),M=R===We.Initialized,{draggable:{active:D,nodes:j,translate:P},droppable:{containers:F}}=v,O=D!=null?j.get(D):null,W=u.useRef({initial:null,translated:null}),z=u.useMemo(()=>{var ae;return D!=null?{id:D,data:(ae=O?.data)!=null?ae:Jo,rect:W}:null},[D,O]),q=u.useRef(null),[te,J]=u.useState(null),[U,Y]=u.useState(null),K=St(m,Object.values(m)),re=Ht("DndDescribedBy",h),ie=u.useMemo(()=>F.getEnabled(),[F]),H=ri(g),{droppableRects:me,measureDroppableContainers:xe,measuringScheduled:Me}=_o(ie,{dragging:M,dependencies:[P.x,P.y],config:H.droppable}),Z=Bo(j,D),Ee=u.useMemo(()=>U?_t(U):null,[U]),E=Zt(),Q=Uo(Z,H.draggable.measure);si({activeNode:D!=null?j.get(D):null,config:E.layoutShiftCompensation,initialRect:Q,measure:H.draggable.measure});const w=Gn(Z,H.draggable.measure,Q),A=Gn(Z?Z.parentElement:null),I=u.useRef({activatorEvent:null,active:null,activeNode:Z,collisionRect:null,collisions:null,droppableRects:me,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),L=F.getNodeFor((n=I.current.over)==null?void 0:n.id),G=qo({measure:H.dragOverlay.measure}),je=(r=G.nodeRef.current)!=null?r:Z,Ce=M?(a=G.rect)!=null?a:w:null,Be=!!(G.nodeRef.current&&G.rect),ut=Go(Be?null:w),Ve=Ar(je?be(je):null),we=Wo(M?L??Z:null),Qe=Xo(we),Ye=Mr(p,{transform:{x:P.x-ut.x,y:P.y-ut.y,scaleX:1,scaleY:1},activatorEvent:U,active:z,activeNodeRect:w,containerNodeRect:A,draggingNodeRect:Ce,over:I.current.over,overlayNodeRect:G.rect,scrollableAncestors:we,scrollableAncestorRects:Qe,windowRect:Ve}),He=Ee?at(Ee,P):null,Je=Qo(we),Ze=Qn(Je),Jt=Qn(Je,[w]),ke=at(Ye,Ze),Ke=Ce?po(Ce,Ye):null,Fe=z&&Ke?d({active:z,collisionRect:Ke,droppableRects:me,droppableContainers:ie,pointerCoordinates:He}):null,et=uo(Fe,"id"),[Re,dt]=u.useState(null),Tt=Be?Ye:at(Ye,Jt),_e=mo(Tt,(c=Re?.rect)!=null?c:null,w),tt=u.useRef(null),nt=u.useCallback((ae,le)=>{let{sensor:ge,options:Pe}=le;if(q.current==null)return;const ye=j.get(q.current);if(!ye)return;const pe=ae.nativeEvent,ve=new ge({active:q.current,activeNode:ye,event:pe,options:Pe,context:I,onAbort(ue){if(!j.get(ue))return;const{onDragAbort:N}=K.current,T={id:ue};N?.(T),C({type:"onDragAbort",event:T})},onPending(ue,b,N,T){if(!j.get(ue))return;const{onDragPending:se}=K.current,X={id:ue,constraint:b,initialCoordinates:N,offset:T};se?.(X),C({type:"onDragPending",event:X})},onStart(ue){const b=q.current;if(b==null)return;const N=j.get(b);if(!N)return;const{onDragStart:T}=K.current,B={activatorEvent:pe,active:{id:b,data:N.data,rect:W}};pt.unstable_batchedUpdates(()=>{T?.(B),S(We.Initializing),k({type:de.DragStart,initialCoordinates:ue,active:b}),C({type:"onDragStart",event:B}),J(tt.current),Y(pe)})},onMove(ue){k({type:de.DragMove,coordinates:ue})},onEnd:Ae(de.DragEnd),onCancel:Ae(de.DragCancel)});tt.current=ve;function Ae(ue){return async function(){const{active:N,collisions:T,over:B,scrollAdjustedTranslate:se}=I.current;let X=null;if(N&&se){const{cancelDrop:ee}=K.current;X={activatorEvent:pe,active:N,collisions:T,delta:se,over:B},ue===de.DragEnd&&typeof ee=="function"&&await Promise.resolve(ee(X))&&(ue=de.DragCancel)}q.current=null,pt.unstable_batchedUpdates(()=>{k({type:ue}),S(We.Uninitialized),dt(null),J(null),Y(null),tt.current=null;const ee=ue===de.DragEnd?"onDragEnd":"onDragCancel";if(X){const Se=K.current[ee];Se?.(X),C({type:ee,event:X})}})}}},[j]),Dt=u.useCallback((ae,le)=>(ge,Pe)=>{const ye=ge.nativeEvent,pe=j.get(Pe);if(q.current!==null||!pe||ye.dndKit||ye.defaultPrevented)return;const ve={active:pe};ae(ge,le.options,ve)===!0&&(ye.dndKit={capturedBy:le.sensor},q.current=Pe,nt(ge,le))},[j,nt]),ft=Fo(l,Dt);Yo(l),$e(()=>{w&&R===We.Initializing&&S(We.Initialized)},[w,R]),u.useEffect(()=>{const{onDragMove:ae}=K.current,{active:le,activatorEvent:ge,collisions:Pe,over:ye}=I.current;if(!le||!ge)return;const pe={active:le,activatorEvent:ge,collisions:Pe,delta:{x:ke.x,y:ke.y},over:ye};pt.unstable_batchedUpdates(()=>{ae?.(pe),C({type:"onDragMove",event:pe})})},[ke.x,ke.y]),u.useEffect(()=>{const{active:ae,activatorEvent:le,collisions:ge,droppableContainers:Pe,scrollAdjustedTranslate:ye}=I.current;if(!ae||q.current==null||!le||!ye)return;const{onDragOver:pe}=K.current,ve=Pe.get(et),Ae=ve&&ve.rect.current?{id:ve.id,rect:ve.rect.current,data:ve.data,disabled:ve.disabled}:null,ue={active:ae,activatorEvent:le,collisions:ge,delta:{x:ye.x,y:ye.y},over:Ae};pt.unstable_batchedUpdates(()=>{dt(Ae),pe?.(ue),C({type:"onDragOver",event:ue})})},[et]),$e(()=>{I.current={activatorEvent:U,active:z,activeNode:Z,collisionRect:Ke,collisions:Fe,droppableRects:me,draggableNodes:j,draggingNode:je,draggingNodeRect:Ce,droppableContainers:F,over:Re,scrollableAncestors:we,scrollAdjustedTranslate:ke},W.current={initial:Ce,translated:Ke}},[z,Z,Fe,Ke,j,je,Ce,me,F,Re,we,ke]),Oo({...E,delta:P,draggingRect:Ke,pointerCoordinates:He,scrollableAncestors:we,scrollableAncestorRects:Qe});const It=u.useMemo(()=>({active:z,activeNode:Z,activeNodeRect:w,activatorEvent:U,collisions:Fe,containerNodeRect:A,dragOverlay:G,draggableNodes:j,droppableContainers:F,droppableRects:me,over:Re,measureDroppableContainers:xe,scrollableAncestors:we,scrollableAncestorRects:Qe,measuringConfiguration:H,measuringScheduled:Me,windowRect:Ve}),[z,Z,w,U,Fe,A,G,j,F,me,Re,xe,we,Qe,H,Me,Ve]),ht=u.useMemo(()=>({activatorEvent:U,activators:ft,active:z,activeNodeRect:w,ariaDescribedById:{draggable:re},dispatch:k,draggableNodes:j,over:Re,measureDroppableContainers:xe}),[U,ft,z,w,k,re,j,Re,xe]);return _.createElement(vr.Provider,{value:y},_.createElement(At.Provider,{value:ht},_.createElement(Ir.Provider,{value:It},_.createElement(qt.Provider,{value:_e},i)),_.createElement(ni,{disabled:f?.restoreFocus===!1})),_.createElement(oo,{...f,hiddenTextDescribedById:re}));function Zt(){const ae=te?.autoScrollEnabled===!1,le=typeof s=="object"?s.enabled===!1:s===!1,ge=M&&!ae&&!le;return typeof s=="object"?{...s,enabled:ge}:{enabled:ge}}}),ii=u.createContext(null),Hn="button",ai="Draggable";function li(e){let{id:t,data:n,disabled:r=!1,attributes:a}=e;const c=Ht(ai),{activators:h,activatorEvent:f,active:s,activeNodeRect:i,ariaDescribedById:l,draggableNodes:d,over:g}=u.useContext(At),{role:p=Hn,roleDescription:m="draggable",tabIndex:x=0}=a??{},v=s?.id===t,k=u.useContext(v?qt:ii),[C,y]=zt(),[R,S]=zt(),M=Ho(h,t),D=St(n);$e(()=>(d.set(t,{id:t,key:c,node:C,activatorNode:R,data:D}),()=>{const P=d.get(t);P&&P.key===c&&d.delete(t)}),[d,t]);const j=u.useMemo(()=>({role:p,tabIndex:x,"aria-disabled":r,"aria-pressed":v&&p===Hn?!0:void 0,"aria-roledescription":m,"aria-describedby":l.draggable}),[r,p,x,v,m,l.draggable]);return{active:s,activatorEvent:f,activeNodeRect:i,attributes:j,isDragging:v,listeners:r?void 0:M,node:C,over:g,setNodeRef:y,setActivatorNodeRef:S,transform:k}}function ci(){return u.useContext(Ir)}const ui="Droppable",di={timeout:25};function fi(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:a}=e;const c=Ht(ui),{active:h,dispatch:f,over:s,measureDroppableContainers:i}=u.useContext(At),l=u.useRef({disabled:n}),d=u.useRef(!1),g=u.useRef(null),p=u.useRef(null),{disabled:m,updateMeasurementsFor:x,timeout:v}={...di,...a},k=St(x??r),C=u.useCallback(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{i(Array.isArray(k.current)?k.current:[k.current]),p.current=null},v)},[v]),y=Xt({callback:C,disabled:m||!h}),R=u.useCallback((j,P)=>{y&&(P&&(y.unobserve(P),d.current=!1),j&&y.observe(j))},[y]),[S,M]=zt(R),D=St(t);return u.useEffect(()=>{!y||!S.current||(y.disconnect(),d.current=!1,y.observe(S.current))},[S,y]),u.useEffect(()=>(f({type:de.RegisterDroppable,element:{id:r,key:c,disabled:n,node:S,rect:g,data:D}}),()=>f({type:de.UnregisterDroppable,key:c,id:r})),[r]),u.useEffect(()=>{n!==l.current.disabled&&(f({type:de.SetDroppableDisabled,id:r,key:c,disabled:n}),l.current.disabled=n)},[r,c,n,f]),{active:h,rect:g,isOver:s?.id===r,node:S,over:s,setNodeRef:M}}function hi(e){let{animation:t,children:n}=e;const[r,a]=u.useState(null),[c,h]=u.useState(null),f=Bt(n);return!n&&!r&&f&&a(f),$e(()=>{if(!c)return;const s=r?.key,i=r?.props.id;if(s==null||i==null){a(null);return}Promise.resolve(t(i,c)).then(()=>{a(null)})},[t,r,c]),_.createElement(_.Fragment,null,n,r?u.cloneElement(r,{ref:h}):null)}const mi={x:0,y:0,scaleX:1,scaleY:1};function gi(e){let{children:t}=e;return _.createElement(At.Provider,{value:Dr},_.createElement(qt.Provider,{value:mi},t))}const pi={position:"fixed",touchAction:"none"},vi=e=>yn(e)?"transform 250ms ease":void 0,bi=u.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:a,children:c,className:h,rect:f,style:s,transform:i,transition:l=vi}=e;if(!f)return null;const d=a?i:{...i,scaleX:1,scaleY:1},g={...pi,width:f.width,height:f.height,top:f.top,left:f.left,transform:Nt.Transform.toString(d),transformOrigin:a&&r?lo(r,f):void 0,transition:typeof l=="function"?l(r):l,...s};return _.createElement(n,{className:h,style:g,ref:t},c)}),xi=e=>t=>{let{active:n,dragOverlay:r}=t;const a={},{styles:c,className:h}=e;if(c!=null&&c.active)for(const[f,s]of Object.entries(c.active))s!==void 0&&(a[f]=n.node.style.getPropertyValue(f),n.node.style.setProperty(f,s));if(c!=null&&c.dragOverlay)for(const[f,s]of Object.entries(c.dragOverlay))s!==void 0&&r.node.style.setProperty(f,s);return h!=null&&h.active&&n.node.classList.add(h.active),h!=null&&h.dragOverlay&&r.node.classList.add(h.dragOverlay),function(){for(const[s,i]of Object.entries(a))n.node.style.setProperty(s,i);h!=null&&h.active&&n.node.classList.remove(h.active)}},yi=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Nt.Transform.toString(t)},{transform:Nt.Transform.toString(n)}]},wi={duration:250,easing:"ease",keyframes:yi,sideEffects:xi({styles:{active:{opacity:"0"}}})};function Ci(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:a}=e;return Yt((c,h)=>{if(t===null)return;const f=n.get(c);if(!f)return;const s=f.node.current;if(!s)return;const i=Tr(h);if(!i)return;const{transform:l}=be(h).getComputedStyle(h),d=xr(l);if(!d)return;const g=typeof t=="function"?t:Si(t);return jr(s,a.draggable.measure),g({active:{id:c,data:f.data,node:s,rect:a.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:h,rect:a.dragOverlay.measure(i)},droppableContainers:r,measuringConfiguration:a,transform:d})})}function Si(e){const{duration:t,easing:n,sideEffects:r,keyframes:a}={...wi,...e};return c=>{let{active:h,dragOverlay:f,transform:s,...i}=c;if(!t)return;const l={x:f.rect.left-h.rect.left,y:f.rect.top-h.rect.top},d={scaleX:s.scaleX!==1?h.rect.width*s.scaleX/f.rect.width:1,scaleY:s.scaleY!==1?h.rect.height*s.scaleY/f.rect.height:1},g={x:s.x-l.x,y:s.y-l.y,...d},p=a({...i,active:h,dragOverlay:f,transform:{initial:s,final:g}}),[m]=p,x=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(x))return;const v=r?.({active:h,dragOverlay:f,...i}),k=f.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(C=>{k.onfinish=()=>{v?.(),C()}})}}let Xn=0;function Ni(e){return u.useMemo(()=>{if(e!=null)return Xn++,Xn},[e])}const Ei=_.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:a,transition:c,modifiers:h,wrapperElement:f="div",className:s,zIndex:i=999}=e;const{activatorEvent:l,active:d,activeNodeRect:g,containerNodeRect:p,draggableNodes:m,droppableContainers:x,dragOverlay:v,over:k,measuringConfiguration:C,scrollableAncestors:y,scrollableAncestorRects:R,windowRect:S}=ci(),M=u.useContext(qt),D=Ni(d?.id),j=Mr(h,{activatorEvent:l,active:d,activeNodeRect:g,containerNodeRect:p,draggingNodeRect:v.rect,over:k,overlayNodeRect:v.rect,scrollableAncestors:y,scrollableAncestorRects:R,transform:M,windowRect:S}),P=En(g),F=Ci({config:r,draggableNodes:m,droppableContainers:x,measuringConfiguration:C}),O=P?v.setRef:void 0;return _.createElement(gi,null,_.createElement(hi,{animation:F},d&&D?_.createElement(bi,{key:D,id:d.id,ref:O,as:f,activatorEvent:l,adjustScale:t,className:s,transition:c,rect:P,style:{zIndex:i,...a},transform:j},n):null))}),Pr=768;function ji(e){const t=window.matchMedia(`(max-width: ${Pr-1}px)`);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function ki(){return window.innerWidth<Pr}function Ri(){return!1}function Or(){return u.useSyncExternalStore(ji,ki,Ri)}function qn(e){switch(e){case Le.TODO:return ne.Pending;case Le.IN_PROGRESS:return ne.Running;case Le.IN_REVIEW:return ne.Review;case Le.DONE:return ne.Done;case Le.CANCELLED:return ne.Cancelled}}function Ai(e){switch(e){case ne.Pending:return Le.TODO;case ne.Running:return Le.IN_PROGRESS;case ne.Review:return Le.IN_REVIEW;case ne.Done:return Le.DONE;case ne.Cancelled:return Le.CANCELLED}}function Vt(e){return{status:qn(e.displayStatus??e.status),ownStatus:qn(e.status),runningDescendantCount:e.runningDescendantCount,reviewDescendantCount:e.reviewDescendantCount}}function Lr(e){switch(e){case Te.CLAUDE_CODE:return"Claude Code";case Te.GEMINI_CLI:return"Gemini CLI";case Te.CURSOR_AGENT:return"Cursor Agent";case Te.CODEX:return"Codex";case Te.QWEN_CODE:return"Qwen Code";case Te.KIRO_CLI:return"Kiro CLI";case Te.OPENCODE:return"OpenCode";case Te.PI_CODING_AGENT:return"Pi Coding Agent";case Te.GROK_BUILD:return"Grok Build";case Te.MINION_CODE:return"Minion Code";case Te.DEEPSEEK_HERMES:return"DeepSeek Harness"}}const Kt=["text-indigo-600","text-emerald-600","text-rose-600","text-amber-600","text-cyan-600","text-violet-600","text-teal-600","text-pink-600"];function zr(e,t){let n=0;for(let r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r)|0;return Math.abs(n)%t}function Ti(e,t){return e?.find(n=>n.status==="ACTIVE")??e?.[0]}function Di(e){return e?e.workspaceKind===Xe.MAIN_DIRECTORY?"Project directory":e.branchName:"—"}function Ii(e){return{id:e.id,name:e.name,color:e.color||Kt[zr(e.name,Kt.length)],isGitRepo:e.isGitRepo,worktreeReady:e.worktreeReady,reason:e.reason,archivedAt:e.archivedAt??null,repoDeletedAt:e.repoDeletedAt??null}}function Mi(e){const t=Ti(e);if(!t)return{agent:"—",branch:"—"};const n=Di(t),r=t.sessions;if(r&&r.length>0){const a=r[r.length-1];return{agent:Lr(a.agentType),branch:n}}return{agent:"—",branch:n}}function Vn(e){const{agent:t,branch:n}=Mi(e.workspaces),r=e.project;return{id:e.id,parentTaskId:e.parentTaskId,ancestorIds:e.ancestorIds,subtaskCount:e.subtaskCount,projectId:e.projectId,title:e.titlePreview??e.title,...Vt(e),priority:e.priority,agent:t,branch:n,description:e.contentPreview??e.description??"",updatedAt:e.updatedAt,isGitRepo:r?.isGitRepo,worktreeReady:r?.worktreeReady,reason:r?.reason,projectArchivedAt:r?.archivedAt??null,projectRepoDeletedAt:r?.repoDeletedAt??null}}function Br(e,t){const n=e.preferredWorkspace?e.preferredWorkspace.workspaceKind===Xe.MAIN_DIRECTORY?"Project directory":e.preferredWorkspace.branchName:"—";return{id:e.id,parentTaskId:e.parentTaskId,ancestorIds:e.ancestorIds,subtaskCount:e.subtaskCount,runningSubtaskCount:e.runningSubtaskCount,projectId:e.projectId,title:e.title,...Vt(e),priority:e.priority,agent:e.latestAgentType?Lr(e.latestAgentType):"—",branch:n,description:"",updatedAt:new Date(e.updatedAt).toISOString(),isGitRepo:t?.isGitRepo,worktreeReady:t?.worktreeReady,reason:t?.reason,projectArchivedAt:t?.archivedAt??null,projectRepoDeletedAt:t?.repoDeletedAt??null}}function Pi(e,t){const n=e.preferredWorkspace?e.preferredWorkspace.workspaceKind===Xe.MAIN_DIRECTORY?"Project directory":e.preferredWorkspace.branchName:"—";return{id:e.id,parentTaskId:e.parentTaskId,ancestorIds:e.ancestorIds,subtaskCount:e.subtaskCount,projectId:t.id,projectName:t.name,projectColor:t.color||Kt[zr(t.name,Kt.length)],title:e.title,...Vt(e),priority:e.priority,branch:n,mainBranch:t.mainBranch??"main",description:"",isGitRepo:t.isGitRepo,worktreeReady:t.worktreeReady,reason:t.reason,projectArchivedAt:t.archivedAt??null,projectRepoDeletedAt:t.repoDeletedAt??null}}const Fr=u.createContext(null);function Oi(e,t){const n=[];if(!e||e.length===0)return n;const r=e.some(c=>c.status==="ACTIVE");return e.some(c=>c.sessions?.some(h=>h.status===Rn.RUNNING||h.status===Rn.PENDING))&&n.push(t("正在运行的 Agent 将被停止")),r&&(n.push(t("分支上未合并的变更将丢失")),n.push(t("关联的工作目录(worktree)将被清理"))),n}function Li({isOpen:e,onClose:t,onConfirm:n,taskId:r,taskTitle:a,workspaces:c,isLoading:h}){const{t:f}=ze(),{data:s,isLoading:i}=Ns(c===void 0&&e?r:""),l=as(r,e),d=l.data?.descendantCount??0,g=c??s,p=c===void 0&&e&&i,m=u.useMemo(()=>Oi(g,f),[g,f]);return o.jsx(Ss,{isOpen:e,onClose:t,onConfirm:()=>n(d),title:f("删除任务"),description:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:d>0?f("Delete “{title}” and all {count} descendants? This cannot be undone.",{title:a,count:d}):f("确认删除任务「{title}」?此操作不可撤销。",{title:a})}),d>0&&o.jsx("p",{className:"mt-2 text-warning-ink",children:f("All related Agents and services will stop. Their worktrees and owned branches will be deleted.")}),l.isError&&o.jsx(De,{variant:"ghost",size:"sm",onClick:()=>l.refetch(),children:f("Could not load subtasks. Retry")}),l.isFetching&&o.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:f("Loading...")}),p?o.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:f("加载中...")}):m.length>0?o.jsx("ul",{className:"mt-2 space-y-1",children:m.map((x,v)=>o.jsxs("li",{className:"flex items-start gap-1.5 text-warning-ink",children:[o.jsx("span",{className:"mt-1 shrink-0 w-1.5 h-1.5 rounded-full bg-warning"}),o.jsx("span",{children:x})]},v))}):null]}),confirmText:d>0?f("Delete all"):f("删除"),variant:"danger",isLoading:h,confirmDisabled:p||l.isFetching||l.isError||!l.data})}function _r(e,t){const n=e.runningDescendantCount??0,r=e.reviewDescendantCount??0;if(!(!n&&!r))return t("Subtasks and grandchildren: {running} running, {review} in review",{running:n,review:r})}function zi(e,t){const n=_r(e,t);if(n)return`${t("Own status: {status}",{status:t(e.ownStatus??e.status)})}. ${n}`}const Bi=3e4;function Fi(e=Bi){const[,t]=u.useState(0);u.useEffect(()=>{const n=setInterval(()=>t(r=>r+1),e);return()=>clearInterval(n)},[e])}function _i(e){const t=ds(e,9,"..");if(t===e)return e;const n=t.slice(0,-2),r=n.search(/[-_.\s][^-_.\s]*$/);return`${r>=3?n.slice(0,r):n}..`}const st="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] text-foreground/80 transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent focus-visible:outline-none",Jn="px-2 pb-1 pt-1.5 text-xs font-medium text-muted-foreground",cn=o.jsx("div",{className:"-mx-1 my-1 h-px bg-border/60"});function Ur({task:e,status:t,isSelected:n,project:r,showProject:a,onSelectTask:c,onTaskStatusChange:h,onDeleteTask:f,onTaskPriorityChange:s,disableDrag:i,onCreateSubtask:l,selectedTaskId:d,expandForSelection:g,selectionPath:p}){const{t:m,locale:x}=ze(),[v,k]=u.useState({open:!1}),C=v.open||!!(g&&v.selection!==d),y=ls(e.id,C&&vt(e)),R=y.data?.pages[0]?.total??e.subtaskCount??0,S=y.data?.pages.flatMap(w=>w.data).map(w=>Br(w))??[],M=p?.find(w=>w.parentTaskId===e.id);M?.parentTaskId===e.id&&!S.some(w=>w.id===M.id)&&S.push(M);const D=u.useContext(Fr),j=u.useRef(null),P=!!e.projectArchivedAt,F=P||!!i,{attributes:O,listeners:W,setNodeRef:z,isDragging:q}=li({id:e.id,data:{task:e,fromStatus:t},disabled:F}),te=u.useCallback(w=>{j.current=w,z(w),D&&(w?D.registry.set(e.id,w):D.registry.delete(e.id))},[z,D,e.id]);u.useEffect(()=>()=>{D?.registry.delete(e.id)},[e.id,D]);const[J,U]=u.useState(null),[Y,K]=u.useState(!1),re=u.useRef(null),ie=u.useRef(null),H=u.useCallback(w=>{P||!h&&!f&&!s&&!l||(w.preventDefault(),U({x:w.clientX,y:w.clientY}))},[P,h,f,s,l,U]),me=u.useCallback(()=>{ie.current&&(clearTimeout(ie.current),ie.current=null)},[]),xe=u.useCallback(w=>{if(!i||P||!h&&!f&&!l)return;const A=w.touches[0];if(!A)return;const{clientX:I,clientY:L}=A;ie.current=setTimeout(()=>{ie.current=null,U({x:I,y:L})},500)},[i,P,h,f,l,U]);u.useEffect(()=>{if(!J)return;const w=()=>U(null),A=L=>{re.current&&!re.current.contains(L.target)&&w()},I=L=>{L.key==="Escape"&&w()};return document.addEventListener("mousedown",A),document.addEventListener("touchstart",A),document.addEventListener("keydown",I),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("touchstart",A),document.removeEventListener("keydown",I),window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[J]),u.useLayoutEffect(()=>{const w=re.current;if(!J||!w)return;const A=8;w.style.left=`${Math.max(A,Math.min(J.x,window.innerWidth-w.offsetWidth-A))}px`,w.style.top=`${Math.max(A,Math.min(J.y,window.innerHeight-w.offsetHeight-A))}px`},[J]);const Me=r?r.name:void 0,Z=a?r:void 0,Ee=e.updatedAt?ks(e.updatedAt,m,x):null,{titleClass:E}=it[t],Q=zi(e,m);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-0.5",children:[o.jsxs("button",{ref:te,type:"button",onClick:()=>c(e.id),onContextMenu:H,onTouchStart:xe,onTouchEnd:me,onTouchMove:me,title:[Z?`${e.title} · ${Z.name}`:e.title,Q].filter(Boolean).join(`
|
|
7
7
|
`),"aria-label":Me?`${e.title} — ${Me}`:e.title,"aria-current":n||void 0,"data-sidebar-item":"",className:ce("task-row animate-task-enter",bt(n),"min-w-0 flex-1",q&&"opacity-30"),...F?{}:W,...F?{}:O,children:[e.parentTaskId&&(()=>{const{icon:w,accentClass:A,label:I}=it[t];return o.jsx("span",{className:"shrink-0",title:m(I),"aria-label":m(I),children:o.jsx(w,{className:ce("size-3.5",A)})})})(),t===ne.Running?o.jsx(Dn,{text:e.title,variant:"running",animate:!n,className:ce("min-w-0 flex-1 truncate",E)}):o.jsx("span",{className:ce("min-w-0 flex-1 truncate",E),children:e.title}),e.priority!==void 0&&e.priority!==Lt.NORMAL&&o.jsx(In,{priority:e.priority}),e.projectArchivedAt&&o.jsx("span",{className:"inline-flex shrink-0 items-center rounded-full bg-foreground/[0.06] px-1.5 py-0.5 text-xs font-medium leading-none text-muted-foreground",children:e.projectRepoDeletedAt?m("源码已删除"):m("已删除")}),(Ee||Z)&&o.jsx("span",{className:"task-row-meta",children:o.jsxs("span",{className:"flex items-center gap-1",children:[Z&&o.jsx("span",{className:"shrink-0 whitespace-nowrap rounded bg-foreground/[0.05] px-1 py-0.5 text-[10px] font-medium leading-none @max-[22rem]:hidden",children:o.jsx(Dn,{text:_i(Z.name),variant:"project",className:Z.color})}),Ee&&o.jsx("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:Ee})]})})]}),vt(e)&&R>0&&o.jsxs("button",{type:"button","data-sidebar-item":"","aria-expanded":C,"aria-label":m("Subtasks of {title}",{title:e.title}),title:[m("{count} subtasks",{count:R}),_r(e,m)].filter(Boolean).join(`
|
|
8
|
-
`),onClick:()=>k({selection:d,open:!C}),className:"flex h-8 shrink-0 items-center gap-1 rounded-md px-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 pointer-coarse:h-10",children:[o.jsx(Gs,{size:14}),o.jsx("span",{className:"tabular-nums",children:R}),o.jsx(cr,{size:12,className:ce("transition-transform",C&&"rotate-90")})]})]}),vt(e)&&C&&o.jsxs("div",{className:"ml-4 border-l border-border/60 pl-1",role:"group","aria-label":m("Subtasks of {title}",{title:e.title}),children:[y.isLoading&&o.jsx("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:m("Loading...")}),y.isError&&o.jsx("button",{type:"button",className:st,onClick:()=>y.refetch(),children:m("Could not load subtasks. Retry")}),S.map(w=>o.jsx(Ur,{task:{...w,projectArchivedAt:e.projectArchivedAt},status:w.status,isSelected:d===w.id,project:r,showProject:!1,selectedTaskId:d,selectionPath:p,expandForSelection:p?.some(A=>A.parentTaskId===w.id),onCreateSubtask:l,onSelectTask:c,onTaskStatusChange:h,onDeleteTask:f,onTaskPriorityChange:s,disableDrag:i},w.id)),y.hasNextPage&&o.jsx("button",{type:"button",className:st,disabled:y.isFetchingNextPage,onClick:()=>y.fetchNextPage(),children:m("Load more")})]}),J&&o.jsxs("div",{ref:re,role:"menu",className:"fixed z-[100] w-48 rounded-lg border border-border bg-popover p-1 shadow-popover shadow-black/5 animate-in fade-in zoom-in-95 duration-100",children:[l&&vt(e)&&o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",role:"menuitem",className:st,onClick:()=>{l(e.id),U(null)},children:[o.jsx(hr,{className:"size-3.5 shrink-0"}),o.jsx("span",{children:m("Create subtask")})]}),cn]}),h&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Jn,children:e.ownStatus&&e.ownStatus!==t?m("Own status: {status}",{status:m(e.ownStatus)}):m("Move to")}),cs.filter(w=>w!==(e.ownStatus??t)).map(w=>{const{icon:A,label:I,accentClass:L}=it[w];return o.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(e.id,w),U(null)},className:st,children:[o.jsx(A,{className:ce("size-3.5 shrink-0",L)}),o.jsx("span",{children:m(I)})]},w)})]}),s&&o.jsxs(o.Fragment,{children:[h&&cn,o.jsx("div",{className:Jn,children:m("Priority")}),us.map(w=>{const A=(e.priority??Lt.NORMAL)===w.value;return o.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":A,onClick:()=>{s(e.id,w.value),U(null)},className:st,children:[o.jsx(In,{priority:w.value}),o.jsx("span",{className:"flex-1",children:m(w.label)}),A&&o.jsx(Ct,{className:"size-3.5 shrink-0 text-foreground","aria-hidden":!0})]},w.value)})]}),f&&o.jsxs(o.Fragment,{children:[(h||s)&&cn,o.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{K(!0),U(null)},className:ce(st,"text-destructive-ink hover:bg-destructive/10 hover:text-destructive-ink focus-visible:bg-destructive/10"),children:[o.jsx(
|
|
9
|
-
${x===s?"bg-accent":""}`,children:[o.jsx(k,{className:`${C} size-4 shrink-0`}),o.jsxs("span",{className:"flex-1 min-w-0 truncate text-sm text-foreground/90",title:m.title,children:[m.title,m.parentTaskId&&o.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:c("Parent task: {title}",{title:n.find(y=>y.id===m.parentTaskId)?.title??"…"})})]}),v&&o.jsx("span",{className:"shrink-0 max-w-[120px] truncate text-xs text-muted-foreground",children:v.name})]},m.id)})})]}):o.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:c("No matching tasks")})]})]}):null}const Wi=260,Qi=220;function Yi(e){const t={[ne.Review]:[],[ne.Running]:[],[ne.Pending]:[],[ne.Done]:[],[ne.Cancelled]:[]};for(const n of e)t[n.status].push(n);return t[ne.Review].sort((n,r)=>(r.priority??Lt.NORMAL)-(n.priority??Lt.NORMAL)),t}const Hi=[{status:ne.Review,title:"Review",defaultOpen:!0},{status:ne.Running,title:"Running",defaultOpen:!0},{status:ne.Pending,title:"Pending",defaultOpen:!1},{status:ne.Done,title:"Done",defaultOpen:!1},{status:ne.Cancelled,title:"Cancelled",defaultOpen:!1}];function Xi(){return o.jsx("div",{className:"flex-1 overflow-hidden px-2 pt-3 motion-safe:animate-pulse","aria-hidden":!0,children:[3,4].map((e,t)=>o.jsxs("div",{className:"mb-4",children:[o.jsxs("div",{className:"flex h-8 items-center gap-2.5 px-2 pointer-coarse:h-10",children:[o.jsx("div",{className:"size-4 shrink-0 rounded-full bg-foreground/[0.06]"}),o.jsx("div",{className:"h-3 w-14 rounded-full bg-foreground/[0.06]"})]}),Array.from({length:e}).map((n,r)=>o.jsxs("div",{className:"flex h-8 items-center gap-2.5 px-2 pointer-coarse:h-10",children:[o.jsx("div",{className:"h-3 rounded-full bg-foreground/[0.06]",style:{width:`${64-(r+t)%3*14}%`}}),o.jsx("div",{className:"ml-auto h-2.5 w-8 shrink-0 rounded-full bg-foreground/[0.05]"})]},r))]},t))})}function Zn({tasks:e=[],projects:t=[],selectedTaskId:n,selectedParentTaskId:r,onCreateSubtask:a,onSelectTask:c,filterProjectId:h,setFilterProjectId:f,width:s=320,onCreateTask:i,onCreateProject:l,isCreateActive:d,onTaskStatusChange:g,onDeleteTask:p,onTaskPriorityChange:m,isLoading:x=!1}){const{t:v}=ze(),{preserveDesktopSearch:k}=ur(),C=Or(),[y,R]=u.useState(null),[S,M]=u.useState(null),[D,j]=u.useState(!1),P=u.useRef(new Set),F=u.useRef(new Map),[O]=u.useState(()=>({registry:new Map})),W=u.useCallback(E=>{E.remove(),P.current.delete(E)},[]),z=h?e.filter(E=>E.projectId===h):e,q=u.useCallback((E,Q)=>{const w=document.querySelector(`[data-task-group-status="${E}"]`);if(!w)return null;const I=(w.querySelector("button")??w).getBoundingClientRect();return I.width===0||I.height===0?null:new DOMRect(I.left,I.bottom+2,Q.width,Q.height)},[]),te=u.useCallback((E,Q,w,A=!1)=>{const I=document.createElement("div");I.setAttribute("aria-hidden","true"),I.innerHTML=w,I.querySelectorAll("[data-gradient-ready]").forEach(Be=>Be.removeAttribute("data-gradient-ready")),I.querySelectorAll(".task-gradient-text__canvas").forEach(Be=>Be.remove());const L=I.firstElementChild;L&&(L.style.cssText="",L.className=L.className.replace(/\bopacity-\S*/g,"").replace(/\banimate-task-enter\b/g,""),L.style.pointerEvents="none",L.style.width=`${E.width}px`,L.style.height=`${E.height}px`,L.style.margin="0",L.style.backgroundColor="var(--background)",L.style.borderRadius="0.5rem",L.style.boxShadow="var(--shadow-popover), 0 0 0 1px var(--border)",L.style.opacity="0.96",L.style.transition="none",L.setAttribute("tabindex","-1")),Object.assign(I.style,{position:"fixed",left:`${E.left}px`,top:`${E.top}px`,width:`${E.width}px`,height:`${E.height}px`,zIndex:"9999",pointerEvents:"none",overflow:"visible",transformOrigin:"top left",willChange:"transform, opacity"}),document.body.appendChild(I),P.current.add(I);const G=Q.left-E.left,je=Q.top-E.top;I.animate([{transform:"translate(0, 0)",opacity:.96,offset:0},{transform:`translate(${G}px, ${je}px)`,opacity:A?.12:.96,offset:1}],{duration:A?Qi:Wi,easing:"cubic-bezier(0.2, 0, 0, 1)",fill:"forwards"}).finished.then(()=>W(I),()=>W(I))},[W]);u.useLayoutEffect(()=>{const E=window.matchMedia("(prefers-reduced-motion: reduce)").matches,Q=new Map;for(const w of z){const A=O.registry.get(w.id);if(!A)continue;const I={status:w.status,rect:A.getBoundingClientRect(),html:A.outerHTML};if(Q.set(w.id,I),E)continue;const L=F.current.get(w.id);if(!L||L.status===w.status)continue;const G=I.rect.left-L.rect.left,je=I.rect.top-L.rect.top;Math.abs(G)<1&&Math.abs(je)<1||te(L.rect,I.rect,L.html)}if(!E)for(const[w,A]of F.current){if(Q.has(w))continue;const I=z.find(G=>G.id===w);if(!I||I.status===A.status)continue;const L=q(I.status,A.rect);L&&te(A.rect,L,A.html,!0)}F.current=Q},[z,te,q,O]),u.useEffect(()=>()=>{for(const E of P.current)E.remove();P.current.clear()},[]);const J=ao(io(Nn,{activationConstraint:{distance:8}})),U=u.useCallback(E=>{const Q=E.active.data.current?.task,w=E.active.data.current?.fromStatus;Q&&R(Q),w&&M(w)},[]),Y=u.useCallback(E=>{R(null),M(null);const{active:Q,over:w}=E;if(!w)return;const A=Q.data.current?.task,I=Q.data.current?.fromStatus,L=w.data.current?.status;!A||!I||!L||A.projectArchivedAt||I!==L&&(A.ownStatus??I)!==L&&g?.(A.id,L)},[g]),ie=!!!(h?t.find(E=>E.id===h)??null:null)?.archivedAt,H=e.find(E=>E.id===n),me=H?dr(H):[],xe=e.filter(E=>E.id===n||me.includes(E.id)||E.id===r),Me=Yi(z.filter(E=>!E.parentTaskId)),Z=y?it[y.status]:null,Ee=u.useCallback(E=>{if(E.key!=="ArrowDown"&&E.key!=="ArrowUp"||E.altKey||E.ctrlKey||E.metaKey||E.shiftKey)return;const Q=Array.from(E.currentTarget.querySelectorAll("[data-sidebar-item]:not(:disabled)")),w=Q.indexOf(E.target);w!==-1&&(E.preventDefault(),Q[w+(E.key==="ArrowDown"?1:-1)]?.focus())},[]);return o.jsxs("div",{className:"@container h-full flex flex-col flex-shrink-0",style:{width:s},onKeyDown:Ee,children:[o.jsxs("div",{className:"px-2 pt-2 pb-1 flex flex-col gap-px flex-shrink-0",children:[l&&o.jsxs("button",{type:"button",onClick:l,"data-sidebar-item":"",className:bt(!1),children:[o.jsx(Ds,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"truncate",children:v("New Project")})]}),o.jsxs("button",{type:"button",onClick:i,disabled:!ie,"aria-current":d||void 0,"data-sidebar-item":"",className:ce(bt(!!d),"disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent"),title:ie?void 0:v("Deleted projects are read-only"),children:[o.jsx(Is,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"truncate",children:v("New Task")})]}),o.jsxs("button",{type:"button",onClick:()=>j(!0),"data-sidebar-item":"",className:bt(!1),children:[o.jsx(mr,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"truncate",children:v("Search")})]}),o.jsxs(fs,{to:k("/conversations"),"data-sidebar-item":"",className:bt(!1),children:[o.jsx(Ms,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"truncate",children:v("对话")})]})]}),x?o.jsx(Xi,{}):z.length===0?o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 pb-[10vh] text-center select-none",children:[o.jsx(dn,{size:36,"aria-hidden":"true",className:"text-muted-foreground/50 mb-3",strokeWidth:1.5}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:v("No tasks")}),ie&&i?o.jsx("button",{type:"button",onClick:i,className:"px-3.5 py-1.5 rounded-md bg-brand text-brand-foreground text-xs font-medium hover:bg-brand/90 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-2",children:v("New Task")}):null]}):o.jsx(Fr.Provider,{value:O,children:o.jsxs(oi,{sensors:J,onDragStart:U,onDragEnd:Y,children:[o.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-app-thin scroll-pt-8 pointer-coarse:scroll-pt-10 relative",children:o.jsx("div",{className:"pt-3 pb-4",children:Hi.map(({status:E,title:Q,defaultOpen:w})=>o.jsx(Ui,{title:Q,tasks:Me[E],status:E,defaultOpen:w,selectedTaskId:n,selectionPath:xe,selectedParentTaskId:r??e.find(A=>A.id===n)?.parentTaskId,onCreateSubtask:a,onSelectTask:c,projects:t,showProject:!h,isDragging:y!==null,dragFromStatus:S,onTaskStatusChange:g,onDeleteTask:p,onTaskPriorityChange:m,disableDrag:C},E))})}),o.jsx(Ei,{dropAnimation:null,children:y&&Z?o.jsxs("div",{className:"flex h-8 w-fit max-w-[280px] items-center gap-2.5 rounded-md bg-background px-2 text-sm text-foreground shadow-overlay ring-1 ring-border/80",children:[o.jsx(Z.icon,{className:ce("size-4 shrink-0",Z.iconClass)}),o.jsx("span",{className:"truncate",title:y.title,children:y.title})]}):null})]})}),!x&&o.jsxs("div",{className:"h-9 px-4 flex flex-shrink-0 items-center justify-between border-t border-border/60 text-xs text-muted-foreground",children:[o.jsx("span",{className:"tabular-nums",children:v("{count} tasks",{count:z.length})}),h?o.jsx("button",{type:"button",onClick:()=>f(null),className:"rounded-sm hover:text-foreground underline decoration-border underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:v("Clear filter")}):null]}),o.jsx(Gi,{isOpen:D,onClose:()=>j(!1),tasks:z,projects:t,onSelectTask:c})]})}var qi=Object.defineProperty,Gt=Object.getOwnPropertySymbols,$r=Object.prototype.hasOwnProperty,Kr=Object.prototype.propertyIsEnumerable,er=(e,t,n)=>t in e?qi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gn=(e,t)=>{for(var n in t||(t={}))$r.call(t,n)&&er(e,n,t[n]);if(Gt)for(var n of Gt(t))Kr.call(t,n)&&er(e,n,t[n]);return e},pn=(e,t)=>{var n={};for(var r in e)$r.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gt)for(var r of Gt(e))t.indexOf(r)<0&&Kr.call(e,r)&&(n[r]=e[r]);return n};var qe;(e=>{const t=class ${constructor(s,i,l,d){if(this.version=s,this.errorCorrectionLevel=i,this.modules=[],this.isFunction=[],s<$.MIN_VERSION||s>$.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=s*4+17;let g=[];for(let m=0;m<this.size;m++)g.push(!1);for(let m=0;m<this.size;m++)this.modules.push(g.slice()),this.isFunction.push(g.slice());this.drawFunctionPatterns();const p=this.addEccAndInterleave(l);if(this.drawCodewords(p),d==-1){let m=1e9;for(let x=0;x<8;x++){this.applyMask(x),this.drawFormatBits(x);const v=this.getPenaltyScore();v<m&&(d=x,m=v),this.applyMask(x)}}a(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(s,i){const l=e.QrSegment.makeSegments(s);return $.encodeSegments(l,i)}static encodeBinary(s,i){const l=e.QrSegment.makeBytes(s);return $.encodeSegments([l],i)}static encodeSegments(s,i,l=1,d=40,g=-1,p=!0){if(!($.MIN_VERSION<=l&&l<=d&&d<=$.MAX_VERSION)||g<-1||g>7)throw new RangeError("Invalid value");let m,x;for(m=l;;m++){const y=$.getNumDataCodewords(m,i)*8,R=h.getTotalBits(s,m);if(R<=y){x=R;break}if(m>=d)throw new RangeError("Data too long")}for(const y of[$.Ecc.MEDIUM,$.Ecc.QUARTILE,$.Ecc.HIGH])p&&x<=$.getNumDataCodewords(m,y)*8&&(i=y);let v=[];for(const y of s){n(y.mode.modeBits,4,v),n(y.numChars,y.mode.numCharCountBits(m),v);for(const R of y.getData())v.push(R)}a(v.length==x);const k=$.getNumDataCodewords(m,i)*8;a(v.length<=k),n(0,Math.min(4,k-v.length),v),n(0,(8-v.length%8)%8,v),a(v.length%8==0);for(let y=236;v.length<k;y^=253)n(y,8,v);let C=[];for(;C.length*8<v.length;)C.push(0);return v.forEach((y,R)=>C[R>>>3]|=y<<7-(R&7)),new $(m,i,C,g)}getModule(s,i){return 0<=s&&s<this.size&&0<=i&&i<this.size&&this.modules[i][s]}getModules(){return this.modules}drawFunctionPatterns(){for(let l=0;l<this.size;l++)this.setFunctionModule(6,l,l%2==0),this.setFunctionModule(l,6,l%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const s=this.getAlignmentPatternPositions(),i=s.length;for(let l=0;l<i;l++)for(let d=0;d<i;d++)l==0&&d==0||l==0&&d==i-1||l==i-1&&d==0||this.drawAlignmentPattern(s[l],s[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(s){const i=this.errorCorrectionLevel.formatBits<<3|s;let l=i;for(let g=0;g<10;g++)l=l<<1^(l>>>9)*1335;const d=(i<<10|l)^21522;a(d>>>15==0);for(let g=0;g<=5;g++)this.setFunctionModule(8,g,r(d,g));this.setFunctionModule(8,7,r(d,6)),this.setFunctionModule(8,8,r(d,7)),this.setFunctionModule(7,8,r(d,8));for(let g=9;g<15;g++)this.setFunctionModule(14-g,8,r(d,g));for(let g=0;g<8;g++)this.setFunctionModule(this.size-1-g,8,r(d,g));for(let g=8;g<15;g++)this.setFunctionModule(8,this.size-15+g,r(d,g));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let s=this.version;for(let l=0;l<12;l++)s=s<<1^(s>>>11)*7973;const i=this.version<<12|s;a(i>>>18==0);for(let l=0;l<18;l++){const d=r(i,l),g=this.size-11+l%3,p=Math.floor(l/3);this.setFunctionModule(g,p,d),this.setFunctionModule(p,g,d)}}drawFinderPattern(s,i){for(let l=-4;l<=4;l++)for(let d=-4;d<=4;d++){const g=Math.max(Math.abs(d),Math.abs(l)),p=s+d,m=i+l;0<=p&&p<this.size&&0<=m&&m<this.size&&this.setFunctionModule(p,m,g!=2&&g!=4)}}drawAlignmentPattern(s,i){for(let l=-2;l<=2;l++)for(let d=-2;d<=2;d++)this.setFunctionModule(s+d,i+l,Math.max(Math.abs(d),Math.abs(l))!=1)}setFunctionModule(s,i,l){this.modules[i][s]=l,this.isFunction[i][s]=!0}addEccAndInterleave(s){const i=this.version,l=this.errorCorrectionLevel;if(s.length!=$.getNumDataCodewords(i,l))throw new RangeError("Invalid argument");const d=$.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][i],g=$.ECC_CODEWORDS_PER_BLOCK[l.ordinal][i],p=Math.floor($.getNumRawDataModules(i)/8),m=d-p%d,x=Math.floor(p/d);let v=[];const k=$.reedSolomonComputeDivisor(g);for(let y=0,R=0;y<d;y++){let S=s.slice(R,R+x-g+(y<m?0:1));R+=S.length;const M=$.reedSolomonComputeRemainder(S,k);y<m&&S.push(0),v.push(S.concat(M))}let C=[];for(let y=0;y<v[0].length;y++)v.forEach((R,S)=>{(y!=x-g||S>=m)&&C.push(R[y])});return a(C.length==p),C}drawCodewords(s){if(s.length!=Math.floor($.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let i=0;for(let l=this.size-1;l>=1;l-=2){l==6&&(l=5);for(let d=0;d<this.size;d++)for(let g=0;g<2;g++){const p=l-g,x=(l+1&2)==0?this.size-1-d:d;!this.isFunction[x][p]&&i<s.length*8&&(this.modules[x][p]=r(s[i>>>3],7-(i&7)),i++)}}a(i==s.length*8)}applyMask(s){if(s<0||s>7)throw new RangeError("Mask value out of range");for(let i=0;i<this.size;i++)for(let l=0;l<this.size;l++){let d;switch(s){case 0:d=(l+i)%2==0;break;case 1:d=i%2==0;break;case 2:d=l%3==0;break;case 3:d=(l+i)%3==0;break;case 4:d=(Math.floor(l/3)+Math.floor(i/2))%2==0;break;case 5:d=l*i%2+l*i%3==0;break;case 6:d=(l*i%2+l*i%3)%2==0;break;case 7:d=((l+i)%2+l*i%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[i][l]&&d&&(this.modules[i][l]=!this.modules[i][l])}}getPenaltyScore(){let s=0;for(let g=0;g<this.size;g++){let p=!1,m=0,x=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[g][v]==p?(m++,m==5?s+=$.PENALTY_N1:m>5&&s++):(this.finderPenaltyAddHistory(m,x),p||(s+=this.finderPenaltyCountPatterns(x)*$.PENALTY_N3),p=this.modules[g][v],m=1);s+=this.finderPenaltyTerminateAndCount(p,m,x)*$.PENALTY_N3}for(let g=0;g<this.size;g++){let p=!1,m=0,x=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[v][g]==p?(m++,m==5?s+=$.PENALTY_N1:m>5&&s++):(this.finderPenaltyAddHistory(m,x),p||(s+=this.finderPenaltyCountPatterns(x)*$.PENALTY_N3),p=this.modules[v][g],m=1);s+=this.finderPenaltyTerminateAndCount(p,m,x)*$.PENALTY_N3}for(let g=0;g<this.size-1;g++)for(let p=0;p<this.size-1;p++){const m=this.modules[g][p];m==this.modules[g][p+1]&&m==this.modules[g+1][p]&&m==this.modules[g+1][p+1]&&(s+=$.PENALTY_N2)}let i=0;for(const g of this.modules)i=g.reduce((p,m)=>p+(m?1:0),i);const l=this.size*this.size,d=Math.ceil(Math.abs(i*20-l*10)/l)-1;return a(0<=d&&d<=9),s+=d*$.PENALTY_N4,a(0<=s&&s<=2568888),s}getAlignmentPatternPositions(){if(this.version==1)return[];{const s=Math.floor(this.version/7)+2,i=this.version==32?26:Math.ceil((this.version*4+4)/(s*2-2))*2;let l=[6];for(let d=this.size-7;l.length<s;d-=i)l.splice(1,0,d);return l}}static getNumRawDataModules(s){if(s<$.MIN_VERSION||s>$.MAX_VERSION)throw new RangeError("Version number out of range");let i=(16*s+128)*s+64;if(s>=2){const l=Math.floor(s/7)+2;i-=(25*l-10)*l-55,s>=7&&(i-=36)}return a(208<=i&&i<=29648),i}static getNumDataCodewords(s,i){return Math.floor($.getNumRawDataModules(s)/8)-$.ECC_CODEWORDS_PER_BLOCK[i.ordinal][s]*$.NUM_ERROR_CORRECTION_BLOCKS[i.ordinal][s]}static reedSolomonComputeDivisor(s){if(s<1||s>255)throw new RangeError("Degree out of range");let i=[];for(let d=0;d<s-1;d++)i.push(0);i.push(1);let l=1;for(let d=0;d<s;d++){for(let g=0;g<i.length;g++)i[g]=$.reedSolomonMultiply(i[g],l),g+1<i.length&&(i[g]^=i[g+1]);l=$.reedSolomonMultiply(l,2)}return i}static reedSolomonComputeRemainder(s,i){let l=i.map(d=>0);for(const d of s){const g=d^l.shift();l.push(0),i.forEach((p,m)=>l[m]^=$.reedSolomonMultiply(p,g))}return l}static reedSolomonMultiply(s,i){if(s>>>8||i>>>8)throw new RangeError("Byte out of range");let l=0;for(let d=7;d>=0;d--)l=l<<1^(l>>>7)*285,l^=(i>>>d&1)*s;return a(l>>>8==0),l}finderPenaltyCountPatterns(s){const i=s[1];a(i<=this.size*3);const l=i>0&&s[2]==i&&s[3]==i*3&&s[4]==i&&s[5]==i;return(l&&s[0]>=i*4&&s[6]>=i?1:0)+(l&&s[6]>=i*4&&s[0]>=i?1:0)}finderPenaltyTerminateAndCount(s,i,l){return s&&(this.finderPenaltyAddHistory(i,l),i=0),i+=this.size,this.finderPenaltyAddHistory(i,l),this.finderPenaltyCountPatterns(l)}finderPenaltyAddHistory(s,i){i[0]==0&&(s+=this.size),i.pop(),i.unshift(s)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(f,s,i){if(s<0||s>31||f>>>s)throw new RangeError("Value out of range");for(let l=s-1;l>=0;l--)i.push(f>>>l&1)}function r(f,s){return(f>>>s&1)!=0}function a(f){if(!f)throw new Error("Assertion error")}const c=class oe{constructor(s,i,l){if(this.mode=s,this.numChars=i,this.bitData=l,i<0)throw new RangeError("Invalid argument");this.bitData=l.slice()}static makeBytes(s){let i=[];for(const l of s)n(l,8,i);return new oe(oe.Mode.BYTE,s.length,i)}static makeNumeric(s){if(!oe.isNumeric(s))throw new RangeError("String contains non-numeric characters");let i=[];for(let l=0;l<s.length;){const d=Math.min(s.length-l,3);n(parseInt(s.substring(l,l+d),10),d*3+1,i),l+=d}return new oe(oe.Mode.NUMERIC,s.length,i)}static makeAlphanumeric(s){if(!oe.isAlphanumeric(s))throw new RangeError("String contains unencodable characters in alphanumeric mode");let i=[],l;for(l=0;l+2<=s.length;l+=2){let d=oe.ALPHANUMERIC_CHARSET.indexOf(s.charAt(l))*45;d+=oe.ALPHANUMERIC_CHARSET.indexOf(s.charAt(l+1)),n(d,11,i)}return l<s.length&&n(oe.ALPHANUMERIC_CHARSET.indexOf(s.charAt(l)),6,i),new oe(oe.Mode.ALPHANUMERIC,s.length,i)}static makeSegments(s){return s==""?[]:oe.isNumeric(s)?[oe.makeNumeric(s)]:oe.isAlphanumeric(s)?[oe.makeAlphanumeric(s)]:[oe.makeBytes(oe.toUtf8ByteArray(s))]}static makeEci(s){let i=[];if(s<0)throw new RangeError("ECI assignment value out of range");if(s<128)n(s,8,i);else if(s<16384)n(2,2,i),n(s,14,i);else if(s<1e6)n(6,3,i),n(s,21,i);else throw new RangeError("ECI assignment value out of range");return new oe(oe.Mode.ECI,0,i)}static isNumeric(s){return oe.NUMERIC_REGEX.test(s)}static isAlphanumeric(s){return oe.ALPHANUMERIC_REGEX.test(s)}getData(){return this.bitData.slice()}static getTotalBits(s,i){let l=0;for(const d of s){const g=d.mode.numCharCountBits(i);if(d.numChars>=1<<g)return 1/0;l+=4+g+d.bitData.length}return l}static toUtf8ByteArray(s){s=encodeURI(s);let i=[];for(let l=0;l<s.length;l++)s.charAt(l)!="%"?i.push(s.charCodeAt(l)):(i.push(parseInt(s.substring(l+1,l+3),16)),l+=2);return i}};c.NUMERIC_REGEX=/^[0-9]*$/,c.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,c.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let h=c;e.QrSegment=c})(qe||(qe={}));(e=>{(t=>{const n=class{constructor(a,c){this.ordinal=a,this.formatBits=c}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(qe||(qe={}));(e=>{(t=>{const n=class{constructor(a,c){this.modeBits=a,this.numBitsCharCount=c}numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(qe||(qe={}));var ot=qe;var Vi={L:ot.QrCode.Ecc.LOW,M:ot.QrCode.Ecc.MEDIUM,Q:ot.QrCode.Ecc.QUARTILE,H:ot.QrCode.Ecc.HIGH},Gr=128,Wr="L",Qr="#FFFFFF",Yr="#000000",Hr=!1,Xr=1,Ji=4,Zi=0,ea=.1;function qr(e,t=0){const n=[];return e.forEach(function(r,a){let c=null;r.forEach(function(h,f){if(!h&&c!==null){n.push(`M${c+t} ${a+t}h${f-c}v1H${c+t}z`),c=null;return}if(f===r.length-1){if(!h)return;c===null?n.push(`M${f+t},${a+t} h1v1H${f+t}z`):n.push(`M${c+t},${a+t} h${f+1-c}v1H${c+t}z`);return}h&&c===null&&(c=f)})}),n.join("")}function Vr(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((a,c)=>c<t.x||c>=t.x+t.w?a:!1))}function ta(e,t,n,r){if(r==null)return null;const a=e.length+n*2,c=Math.floor(t*ea),h=a/t,f=(r.width||c)*h,s=(r.height||c)*h,i=r.x==null?e.length/2-f/2:r.x*h,l=r.y==null?e.length/2-s/2:r.y*h,d=r.opacity==null?1:r.opacity;let g=null;if(r.excavate){let m=Math.floor(i),x=Math.floor(l),v=Math.ceil(f+i-m),k=Math.ceil(s+l-x);g={x:m,y:x,w:v,h:k}}const p=r.crossOrigin;return{x:i,y:l,h:s,w:f,excavation:g,opacity:d,crossOrigin:p}}function na(e,t){return t!=null?Math.max(Math.floor(t),0):e?Ji:Zi}function Jr({value:e,level:t,minVersion:n,includeMargin:r,marginSize:a,imageSettings:c,size:h,boostLevel:f}){let s=_.useMemo(()=>{const m=(Array.isArray(e)?e:[e]).reduce((x,v)=>(x.push(...ot.QrSegment.makeSegments(v)),x),[]);return ot.QrCode.encodeSegments(m,Vi[t],n,void 0,void 0,f)},[e,t,n,f]);const{cells:i,margin:l,numCells:d,calculatedImageSettings:g}=_.useMemo(()=>{let p=s.getModules();const m=na(r,a),x=p.length+m*2,v=ta(p,h,m,c);return{cells:p,margin:m,numCells:x,calculatedImageSettings:v}},[s,h,c,r,a]);return{qrcode:s,margin:l,cells:i,numCells:d,calculatedImageSettings:g}}var ra=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),sa=_.forwardRef(function(t,n){const r=t,{value:a,size:c=Gr,level:h=Wr,bgColor:f=Qr,fgColor:s=Yr,includeMargin:i=Hr,minVersion:l=Xr,boostLevel:d,marginSize:g,imageSettings:p}=r,x=pn(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:v}=x,k=pn(x,["style"]),C=p?.src,y=_.useRef(null),R=_.useRef(null),S=_.useCallback(q=>{y.current=q,typeof n=="function"?n(q):n&&(n.current=q)},[n]),[M,D]=_.useState(!1),{margin:j,cells:P,numCells:F,calculatedImageSettings:O}=Jr({value:a,level:h,minVersion:l,boostLevel:d,includeMargin:i,marginSize:g,imageSettings:p,size:c});_.useEffect(()=>{if(y.current!=null){const q=y.current,te=q.getContext("2d");if(!te)return;let J=P;const U=R.current,Y=O!=null&&U!==null&&U.complete&&U.naturalHeight!==0&&U.naturalWidth!==0;Y&&O.excavation!=null&&(J=Vr(P,O.excavation));const K=window.devicePixelRatio||1;q.height=q.width=c*K;const re=c/F*K;te.scale(re,re),te.fillStyle=f,te.fillRect(0,0,F,F),te.fillStyle=s,ra?te.fill(new Path2D(qr(J,j))):P.forEach(function(ie,H){ie.forEach(function(me,xe){me&&te.fillRect(xe+j,H+j,1,1)})}),O&&(te.globalAlpha=O.opacity),Y&&te.drawImage(U,O.x+j,O.y+j,O.w,O.h)}}),_.useEffect(()=>{D(!1)},[C]);const W=gn({height:c,width:c},v);let z=null;return C!=null&&(z=_.createElement("img",{src:C,key:C,style:{display:"none"},onLoad:()=>{D(!0)},ref:R,crossOrigin:O?.crossOrigin})),_.createElement(_.Fragment,null,_.createElement("canvas",gn({style:W,height:c,width:c,ref:S,role:"img"},k)),z)});sa.displayName="QRCodeCanvas";var Zr=_.forwardRef(function(t,n){const r=t,{value:a,size:c=Gr,level:h=Wr,bgColor:f=Qr,fgColor:s=Yr,includeMargin:i=Hr,minVersion:l=Xr,boostLevel:d,title:g,marginSize:p,imageSettings:m}=r,x=pn(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:v,cells:k,numCells:C,calculatedImageSettings:y}=Jr({value:a,level:h,minVersion:l,boostLevel:d,includeMargin:i,marginSize:p,imageSettings:m,size:c});let R=k,S=null;m!=null&&y!=null&&(y.excavation!=null&&(R=Vr(k,y.excavation)),S=_.createElement("image",{href:m.src,height:y.h,width:y.w,x:y.x+v,y:y.y+v,preserveAspectRatio:"none",opacity:y.opacity,crossOrigin:y.crossOrigin}));const M=qr(R,v);return _.createElement("svg",gn({height:c,width:c,viewBox:`0 0 ${C} ${C}`,ref:n,role:"img"},x),!!g&&_.createElement("title",null,g),_.createElement("path",{fill:f,d:`M0,0 h${C}v${C}H0z`,shapeRendering:"crispEdges"}),_.createElement("path",{fill:s,d:M,shapeRendering:"crispEdges"}),S)});Zr.displayName="QRCodeSVG";function es(){return parseInt(window.location.port||(window.location.protocol==="https:"?"443":"80"),10)}function oa(){return hs({queryKey:fe.tunnel.status,queryFn:()=>Ue.get("/tunnel/status"),refetchInterval:e=>e.state.data?.running?5e3:!1})}function ia(){const e=Wt();return vn({mutationFn:()=>Ue.post("/tunnel/start",{port:es()}),onSuccess:()=>{e.invalidateQueries({queryKey:fe.tunnel.status})}})}function aa(){const e=Wt();return vn({mutationFn:()=>Ue.post("/tunnel/regenerate",{port:es()}),onSuccess:()=>{e.invalidateQueries({queryKey:fe.tunnel.status})}})}function la(){const e=Wt();return vn({mutationFn:()=>Ue.post("/tunnel/stop"),onSuccess:()=>{e.invalidateQueries({queryKey:fe.tunnel.status})}})}function ca(e){if(!e||e.status==="stopped")return{button:"text-muted-foreground hover:text-foreground hover:bg-accent",dot:"",label:"Use Agent Tower on your phone",icon:"idle"};switch(e.status){case"healthy":case"checking":return{button:"text-success-ink hover:bg-success/10",dot:"bg-success",label:e.status==="healthy"?"Tunnel healthy":"Checking tunnel health",icon:"ok"};case"degraded":case"localUnhealthy":case"linkReplaced":return{button:"text-warning-ink hover:bg-warning/10",dot:"bg-warning",label:"Tunnel needs attention",icon:"warn"};case"exited":case"error":return{button:"text-destructive-ink hover:bg-destructive/10",dot:"bg-destructive",label:"Tunnel unavailable",icon:"error"};case"starting":return{button:"text-warning-ink hover:bg-warning/10",dot:"bg-warning",label:"Tunnel starting",icon:"loading"}}}function ua(e){if(!e||e.status==="stopped")return"Tunnel is off";switch(e.status){case"healthy":return"Tunnel healthy";case"checking":return"Checking tunnel health";case"degraded":return"Observing original link";case"localUnhealthy":return"Local service unavailable";case"exited":return"Tunnel process exited";case"error":return"Tunnel error";case"linkReplaced":return"New link generated";case"starting":return"Tunnel starting"}}function da(e){if(!e||e.status==="stopped")return"Start a temporary Quick Tunnel when you need to share this Agent Tower session.";switch(e.status){case"healthy":return"The Cloudflare tunnel is running and the local Agent Tower health check passed.";case"checking":return"The Cloudflare tunnel is running. Agent Tower is waiting for the first local health check.";case"degraded":return"The original public URL is currently unreachable. Agent Tower is watching for it to recover and will not generate a new link automatically.";case"localUnhealthy":return"The local Agent Tower target is not responding, so the tunnel cannot be considered healthy.";case"exited":return"The tunnel process has exited. The old Quick Tunnel link is unlikely to recover.";case"error":return"The tunnel reported an error. Check the diagnostics before generating a new link.";case"linkReplaced":return"A new Quick Tunnel link was generated. The old link and token are no longer valid.";case"starting":return"Agent Tower is asking Cloudflare Quick Tunnel for a temporary public URL."}}function tr(e){if(!e)return"Never";const t=new Date(e).getTime();if(!Number.isFinite(t))return e;const n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`${n}s ago`;const r=Math.round(n/60);if(r<60)return`${r}m ago`;const a=Math.round(r/60);return a<24?`${a}h ago`:`${Math.round(a/24)}d ago`}function gt(e){const t=e?.trim();return t||null}function fa(e){if(!e)return"";const t=[gt(e.lastLocalError),gt(e.lastRemoteError),gt(e.lastError)].filter(a=>a!==null),n=gt(e.lastProcessOutput),r=!!n&&(e.status==="error"||e.status==="exited"||!!gt(e.lastError));return n&&r&&t.push(n),t.join(`
|
|
10
|
-
`)}function nr(){const{t:e}=ze(),{data:t}=oa(),n=ia(),r=la(),a=aa(),[c,h]=u.useState(!1),[f,s]=u.useState(null),[i,l]=u.useState(!1),[d,g]=u.useState(!1),p=t?.status!==void 0&&t.status!=="stopped",m=n.isPending||t?.status==="starting",x=a.isPending,v=t?.shareableUrl,k=t?.token,C=ca(t),y=ua(t),R=fa(t),S=t?.status==="healthy"||t?.status==="checking"?"text-success-ink":t?.status==="exited"||t?.status==="error"?"text-destructive-ink":"text-warning-ink",M=u.useCallback(()=>{n.mutate(void 0,{onSuccess:()=>h(!0)})},[n]),D=u.useCallback(()=>{v&&(navigator.clipboard.writeText(v),s("url"),setTimeout(()=>s(null),2e3))},[v]),j=u.useCallback(()=>{k&&(navigator.clipboard.writeText(k),s("token"),setTimeout(()=>s(null),2e3))},[k]),P=u.useCallback(()=>{r.mutate(),h(!1),l(!1),g(!1)},[r]),F=u.useCallback(()=>{a.mutate(void 0,{onSuccess:()=>{g(!1),h(!0)}})},[a]),O=o.jsx(Ps,{asChild:!0,children:o.jsx(nn,{size:"xs",label:e("Close"),className:"-mr-1 -mt-0.5 shrink-0",children:o.jsx(ms,{})})});return o.jsxs(Os,{open:c,onOpenChange:h,children:[o.jsxs("div",{className:"relative",children:[o.jsx(Ls,{asChild:!0,children:o.jsx("button",{type:"button",disabled:m,className:ce("p-1.5 rounded-md transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/60",C.button),title:e(C.label),"aria-label":e(C.label),children:m?o.jsx(gs,{size:"md"}):C.icon==="warn"?o.jsx(ps,{size:16}):o.jsx(zn,{size:16})})}),p&&!m&&o.jsx("span",{className:`pointer-events-none absolute top-0.5 right-0.5 w-2 h-2 ${C.dot} rounded-full`})]}),o.jsx(zs,{align:"end",className:ce("max-w-[calc(100vw-1rem)]",p?"w-96":"w-80"),children:p?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"mb-2 flex items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsxs("span",{className:ce("flex items-center gap-1.5 text-xs font-medium",S),children:[o.jsx("span",{className:`inline-block w-1.5 h-1.5 ${C.dot} rounded-full`}),e(y)]}),o.jsx("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:e(da(t))})]}),O]}),k&&o.jsxs("div",{className:"mb-2 flex items-center gap-1.5 rounded-md bg-muted/50 px-2 py-1 text-xs text-foreground/80",children:[o.jsx(Rs,{size:12}),o.jsx("span",{children:e("Token protected")})]}),v&&o.jsx("div",{className:"flex justify-center py-3",children:o.jsx(Zr,{value:v,size:160})}),v||t?.url?o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Bs,{size:"sm",readOnly:!0,value:v??t?.url??"",onFocus:W=>W.target.select(),"aria-label":e("Copy shareable link"),className:"select-all text-xs"}),o.jsx(nn,{size:"sm",label:e("Copy shareable link"),onClick:D,disabled:!v,children:f==="url"?o.jsx(Ct,{className:"text-success"}):o.jsx(On,{})})]}):o.jsx("div",{className:"rounded-md border border-border bg-muted/50 px-2 py-1.5 text-xs text-muted-foreground",children:e("No tunnel link available")}),o.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs",children:[o.jsxs("div",{className:"rounded-md border border-border px-2 py-1.5",children:[o.jsx("div",{className:"text-muted-foreground",children:e("Last checked")}),o.jsx("div",{className:"mt-0.5 text-foreground",children:tr(t?.lastCheckedAt)})]}),o.jsxs("div",{className:"rounded-md border border-border px-2 py-1.5",children:[o.jsx("div",{className:"text-muted-foreground",children:e("Last healthy")}),o.jsx("div",{className:"mt-0.5 text-foreground",children:tr(t?.lastHealthyAt)})]})]}),R&&o.jsx(Pt,{tone:"warning",size:"sm",className:"mt-2 max-h-28 overflow-auto",children:o.jsx("div",{className:"whitespace-pre-wrap break-words",children:R})}),t?.status==="degraded"&&o.jsx(Pt,{tone:"warning",size:"sm",className:"mt-2",children:e("Agent Tower is keeping the same URL and waiting for Cloudflare Quick Tunnel to recover.")}),t?.status==="linkReplaced"&&o.jsx(Pt,{tone:"warning",size:"sm",className:"mt-2",children:e("The previous tunnel link and token are no longer valid.")}),k&&o.jsxs("div",{className:"mt-2",children:[o.jsx("button",{type:"button",onClick:()=>l(!i),className:"rounded-sm text-xs text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:e(i?"Hide token":"Show token")}),i&&o.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[o.jsx("code",{className:"flex-1 min-w-0 break-all rounded-md border border-border bg-muted/50 px-2 py-1.5 text-xs text-foreground/80",children:k}),o.jsx(nn,{size:"sm",label:e("Copy token"),onClick:j,className:"shrink-0",children:f==="token"?o.jsx(Ct,{className:"text-success"}):o.jsx(On,{})})]})]}),d?o.jsxs(Pt,{tone:"danger",size:"sm",className:"mt-3",children:[e("Generating a new link will invalidate the current link. People using the old URL must receive the new one."),o.jsxs("div",{className:"mt-2 flex gap-2",children:[o.jsx(De,{variant:"secondary",size:"xs",className:"flex-1",onClick:()=>g(!1),children:e("Cancel")}),o.jsx(De,{variant:"primary",tone:"danger",size:"xs",className:"flex-1",onClick:F,loading:x,children:e(x?"Generating...":"Regenerate link")})]})]}):o.jsxs(De,{variant:"ghost",size:"sm",block:!0,className:"mt-3",onClick:()=>g(!0),disabled:x||t?.canRegenerate===!1,children:[o.jsx(vs,{}),e("Regenerate link")]}),o.jsx(De,{variant:"ghost",tone:"danger",size:"sm",block:!0,className:"mt-1",onClick:P,loading:r.isPending,children:r.isPending?e("Stopping..."):e("Stop Tunnel")})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-md bg-muted text-foreground/80",children:o.jsx(zn,{size:16})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm font-medium text-foreground",children:e("Use Agent Tower on your phone")}),o.jsx("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:e("After enabling the tunnel, you can scan a QR code with your phone to visit this Agent Tower instance, assign tasks, and check agent status.")})]})]}),O]}),o.jsx(De,{variant:"primary",size:"sm",block:!0,className:"mt-3",onClick:M,loading:m,children:e(m?"Starting tunnel...":"Enable phone access")})]})})]})}function un({isOpen:e,onClose:t}){const{t:n}=ze(),r=Es(),[a,c]=u.useState(""),[h,f]=u.useState(""),[s,i]=u.useState(null),[l,d]=u.useState(!1),[g,p]=u.useState(!1),m=a.trim(),x=h.trim(),v=l||r.isPending,k=u.useMemo(()=>!!(m&&x&&!v),[m,x,v]),C=u.useCallback(()=>{c(""),f(""),i(null),p(!1)},[]),y=u.useCallback(()=>{v||(C(),t())},[v,t,C]);u.useEffect(()=>{e||C()},[e,C]);const R=u.useCallback(async j=>{try{await r.mutateAsync({name:m,repoPath:x,initEmptyRepo:j}),C(),t()}catch(P){const F=P instanceof Error?P.message:n("Failed to create project");i(F),Oe.error(F)}},[r,t,C,n,m,x]),S=u.useCallback(async()=>{if(!(!m||!x||v)){i(null),d(!0);try{const j=await Ue.get("/filesystem/validate",{params:{path:x}});if(!j.valid){i(j.error??n("Selected path is not a valid directory"));return}if(j.isGitRepo){await R(!1);return}if(j.reason==="no_git"&&j.isEmpty){p(!0);return}if(j.reason==="no_git"){await R(!1);return}await R(!1)}catch(j){i(j instanceof Error?j.message:n("Could not check project path"))}finally{d(!1)}}},[R,v,n,m,x]),M=u.useCallback(()=>{p(!1),R(!1)},[R]),D=u.useCallback(()=>{p(!1),R(!0)},[R]);return o.jsxs(o.Fragment,{children:[o.jsx(Ln,{isOpen:e,onClose:y,title:n("Create New Project"),action:o.jsxs(o.Fragment,{children:[o.jsx(De,{onClick:y,disabled:v,children:n("Cancel")}),o.jsx(De,{variant:"primary",onClick:S,disabled:!k,children:l?n("Checking..."):r.isPending?n("Creating..."):n("Create Project")})]}),children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-foreground/80 mb-1.5",children:n("Project Name")}),o.jsx("input",{type:"text",value:a,onChange:j=>c(j.target.value),placeholder:n("e.g., Agent Tower"),disabled:v,className:"w-full px-3 py-2 border border-border rounded-lg text-sm focus:outline-none focus:border-ring transition-colors disabled:bg-muted/50 disabled:text-muted-foreground",autoFocus:!0})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-foreground/80 mb-1.5",children:n("Project Path")}),o.jsx(Us,{value:h,onChange:f,validationMode:"directory"})]}),s&&o.jsx("p",{className:"text-xs text-destructive-ink leading-relaxed",children:s})]})}),o.jsx(Ln,{isOpen:g,onClose:()=>{r.isPending||p(!1)},title:n("Initialize Git repository?"),action:o.jsxs(o.Fragment,{children:[o.jsx(De,{onClick:()=>p(!1),disabled:r.isPending,children:n("Cancel")}),o.jsx(De,{onClick:M,disabled:r.isPending,children:n("Create Local Project")}),o.jsx(De,{variant:"primary",onClick:D,disabled:r.isPending,children:r.isPending?n("Creating..."):n("Initialize and Create")})]}),children:o.jsxs("div",{className:"space-y-3 text-sm text-foreground/70 leading-relaxed",children:[o.jsx("p",{children:n("This directory is empty and does not have Git version control yet. Agent Tower can initialize Git and create the initial commit before creating the project.")}),o.jsx("p",{children:n("You can also create it as a local project now. Local projects only support local Solo tasks until Git is initialized.")})]})})]})}function rr(e){if(!e)return 0;const t=Date.parse(e);return Number.isNaN(t)?0:t}function ha(e){return e.map((t,n)=>({project:t,index:n,activityTime:rr(t.lastActivityAt??t.createdAt),createdTime:rr(t.createdAt)})).sort((t,n)=>{const r=n.activityTime-t.activityTime;if(r!==0)return r;const a=n.createdTime-t.createdTime;return a!==0?a:t.index-n.index}).map(({project:t})=>t)}const ts="providerLastUsedAt";function ma(){const e={};try{const t=localStorage.getItem(ts),n=t?JSON.parse(t):{};if(n&&typeof n=="object"&&!Array.isArray(n))for(const[r,a]of Object.entries(n))typeof a=="number"&&Number.isFinite(a)&&a>0&&(e[r]=a)}catch{}try{const t=localStorage.getItem("lastSelectedProviderId");t&&Object.keys(e).length===0&&(e[t]=1)}catch{}return e}function ga(e){try{localStorage.setItem(ts,JSON.stringify(e))}catch{}}const pa=u.lazy(()=>fr(()=>import("./TaskDetail-BiZbuXcE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55])).then(e=>({default:e.TaskDetail}))),va=u.lazy(()=>fr(()=>import("./MobileTaskDetail-D5Czlr2O.js"),__vite__mapDeps([56,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55])).then(e=>({default:e.MobileTaskDetail})));function sr(){const{t:e}=ze();return o.jsx("div",{role:"status",className:"flex flex-1 items-center justify-center bg-background p-4 text-sm text-muted-foreground",children:e("Loading...")})}function or({projects:e,filterProjectId:t,setFilterProjectId:n,onCreateProject:r,className:a}){const{t:c}=ze(),[h,f]=u.useState(!1),s=e.filter(l=>!l.archivedAt),i=t?e.find(l=>l.id===t)??null:null;return o.jsxs("div",{className:ce("relative flex items-center min-w-0",a),children:[o.jsx("span",{className:"mx-1.5 text-muted-foreground select-none",children:"/"}),o.jsxs("button",{onClick:()=>f(l=>!l),className:"flex items-center gap-1.5 px-2 py-1 rounded-md text-sm text-foreground/90 hover:bg-accent transition-colors min-w-0",children:[i?o.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${i.color.replace("text-","bg-")}`}):o.jsx(dn,{size:13,className:"text-muted-foreground shrink-0"}),o.jsx("span",{className:"truncate max-w-[200px] font-medium",children:i?i.name:c("All Projects")}),o.jsx($s,{size:13,className:`text-muted-foreground/70 shrink-0 transition-transform duration-200 ${h?"rotate-180":""}`})]}),h?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"fixed inset-0 z-30",onClick:()=>f(!1)}),o.jsxs("div",{className:"absolute left-4 top-full mt-1.5 w-60 bg-popover border border-border rounded-lg shadow-popover shadow-black/5 z-40 py-1 animate-in fade-in zoom-in-95 duration-100 origin-top-left",children:[o.jsxs("button",{onClick:()=>{n(null),f(!1)},className:"w-full text-left px-3 py-1.5 text-[13px] flex items-center gap-2 hover:bg-accent/50 transition-colors",children:[o.jsx(dn,{size:13,className:"text-muted-foreground shrink-0"}),o.jsx("span",{className:`flex-1 truncate ${t===null?"text-foreground font-medium":"text-muted-foreground"}`,children:c("All Projects")}),t===null?o.jsx(Ct,{size:14,className:"text-foreground shrink-0"}):null]}),o.jsx("div",{className:"h-px bg-border/60 my-1 mx-2"}),o.jsx("div",{className:"max-h-[40vh] overflow-y-auto scrollbar-app-thin",children:s.map(l=>{const d=t===l.id;return o.jsxs("button",{onClick:()=>{n(l.id),f(!1)},className:"w-full text-left px-3 py-1.5 text-[13px] flex items-center gap-2 hover:bg-accent/50 transition-colors",children:[o.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${l.color.replace("text-","bg-")}`}),o.jsx("span",{className:`flex-1 truncate ${d?"text-foreground font-medium":"text-muted-foreground"}`,children:l.name}),d?o.jsx(Ct,{size:14,className:"text-foreground shrink-0"}):null]},l.id)})}),o.jsx("div",{className:"h-px bg-border/60 my-1 mx-2"}),o.jsxs("button",{onClick:()=>{f(!1),r()},className:"w-full text-left px-3 py-1.5 text-[13px] flex items-center gap-2 text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors",children:[o.jsx(hr,{size:13}),o.jsx("span",{children:c("Create New Project...")})]})]})]}):null]})}const ba=260,xa=600,ir=400,ya=100,wa=1e3;function ar(e){const t=e.workspaces?.find(r=>r.status==="ACTIVE")??e.workspaces?.[0],n=t?.sessions?.at(-1);return{id:e.id,parentTaskId:e.parentTaskId,ancestorIds:e.ancestorIds,subtaskCount:e.subtaskCount,projectId:e.projectId,title:e.titlePreview??e.title,status:e.status,displayStatus:e.displayStatus,runningDescendantCount:e.runningDescendantCount,reviewDescendantCount:e.reviewDescendantCount,priority:e.priority,...t?{preferredWorkspace:{...t.workspaceKind===Xe.MAIN_DIRECTORY?{workspaceKind:Xe.MAIN_DIRECTORY}:{},branchName:t.branchName}}:{},...n?{latestAgentType:n.agentType}:{},...e.workspaces?.some(r=>r.sessions?.some(a=>a.status==="RUNNING"||a.status==="PENDING"))?{hasRunningSession:!0}:{},updatedAt:e.updatedAt?new Date(e.updatedAt).getTime():Date.now()}}function Ca(){const{t:e,locale:t}=ze(),[n,r]=u.useState(void 0),a=u.useRef(0),[c,h]=u.useState(null),[f,s]=u.useState(null),[i,l]=u.useState(ir),[d,g]=u.useState(!1),[p,m]=u.useState("idle"),[x,v]=u.useState({}),k=u.useRef(!1),C=u.useRef(0),y=u.useRef(ir),R=u.useRef(null),S=Wt(),{data:M,isLoading:D}=Fs(),[j,P]=u.useState(ma),{data:F,isLoading:O}=js({limit:ya}),W=u.useMemo(()=>F?.data??[],[F?.data]),z=f&&W.some(b=>b.id===f)?f:null,{data:q,isLoading:te}=bs({...z?{projectId:z}:{},limit:wa}),J=u.useMemo(()=>[...q?.data??[],...q?.parents??[]],[q]),[U,Y]=u.useState([]),K=u.useMemo(()=>{if(U.length===0)return J;const b=new Set(J.map(N=>N.id));return[...U.filter(N=>!b.has(N.id)),...J]},[J,U]),[re,ie]=u.useState(null),H=en(c&&!K.some(b=>b.id===c)?c:""),me=K.find(b=>b.id===c)??H.data,xe=u.useMemo(()=>me?dr(me):[],[me]),Me=b=>{const N=xe[b];return N&&!K.some(T=>T.id===N)?N:""},Z=en(Me(0)),Ee=en(Me(1)),E=u.useMemo(()=>c&&K.some(b=>b.id===c)?c:re&&c===re?re:c&&(H.isLoading||H.data&&(!z||H.data.projectId===z))?c:null,[c,K,re,H.data,H.isLoading,z]);u.useEffect(()=>{re&&K.some(b=>b.id===re)&&ie(null)},[re,K]),u.useEffect(()=>{if(U.length===0)return;const b=new Set(J.map(N=>N.id));U.some(N=>b.has(N.id))&&Y(N=>N.filter(T=>!b.has(T.id)))},[J,U]);const Q=u.useMemo(()=>ha(W),[W]),w=u.useMemo(()=>Q.map(Ii),[Q]),A=u.useMemo(()=>Q.filter(b=>!b.archivedAt),[Q]),I=u.useMemo(()=>M?M.filter(_s).sort((b,N)=>{const T=!mt(b),B=!mt(N);return T!==B?T?-1:1:(j[N.provider.id]??0)-(j[b.provider.id]??0)}):[],[M,j]),L=u.useMemo(()=>{const b=K.map(N=>Br(N,W.find(T=>T.id===N.projectId)));H.data&&E===H.data.id&&!b.some(N=>N.id===H.data.id)&&b.push(Vn(H.data));for(const N of[Z.data,Ee.data])N&&xe.includes(N.id)&&!b.some(T=>T.id===N.id)&&b.push(Vn(N));return b},[W,K,H.data,E,Z.data,Ee.data,xe]),G=u.useMemo(()=>{if(!E)return null;const b=K.find(T=>T.id===E)??(H.data?ar(H.data):void 0);if(!b)return null;const N=W.find(T=>T.id===b.projectId);if(!N){const T=b.preferredWorkspace?b.preferredWorkspace.workspaceKind===Xe.MAIN_DIRECTORY?"Project directory":b.preferredWorkspace.branchName:"—";return{id:b.id,parentTaskId:b.parentTaskId,ancestorIds:b.ancestorIds,subtaskCount:b.subtaskCount,projectId:b.projectId,projectName:"Unknown",projectColor:"text-muted-foreground",title:b.title,...Vt(b),priority:b.priority,branch:T,mainBranch:"main",description:"",isGitRepo:!1,worktreeReady:!1,reason:"NO_GIT",projectArchivedAt:null,projectRepoDeletedAt:null}}return Pi(b,N)},[E,K,W,H.data]),je=xs(),Ce=ys(),Be=ws(),ut=Cs(),Ve=As(),we=u.useCallback(b=>{const N=ar(b);Y(T=>T.some(B=>B.id===b.id)?T.map(B=>B.id===b.id?N:B):[N,...T]),S.setQueryData(fe.tasks.detail(b.id),b),ie(b.id),h(b.id)},[S]),Qe=u.useCallback((b,N,T)=>{const B=b.id,se=[b.title,b.description].filter(Boolean).join(`
|
|
8
|
+
`),onClick:()=>k({selection:d,open:!C}),className:"flex h-8 shrink-0 items-center gap-1 rounded-md px-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 pointer-coarse:h-10",children:[o.jsx(Gs,{size:14}),o.jsx("span",{className:"tabular-nums",children:R}),o.jsx(cr,{size:12,className:ce("transition-transform",C&&"rotate-90")})]})]}),vt(e)&&C&&o.jsxs("div",{className:"ml-4 border-l border-border/60 pl-1",role:"group","aria-label":m("Subtasks of {title}",{title:e.title}),children:[y.isLoading&&o.jsx("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:m("Loading...")}),y.isError&&o.jsx("button",{type:"button",className:st,onClick:()=>y.refetch(),children:m("Could not load subtasks. Retry")}),S.map(w=>o.jsx(Ur,{task:{...w,projectArchivedAt:e.projectArchivedAt},status:w.status,isSelected:d===w.id,project:r,showProject:!1,selectedTaskId:d,selectionPath:p,expandForSelection:p?.some(A=>A.parentTaskId===w.id),onCreateSubtask:l,onSelectTask:c,onTaskStatusChange:h,onDeleteTask:f,onTaskPriorityChange:s,disableDrag:i},w.id)),y.hasNextPage&&o.jsx("button",{type:"button",className:st,disabled:y.isFetchingNextPage,onClick:()=>y.fetchNextPage(),children:m("Load more")})]}),J&&o.jsxs("div",{ref:re,role:"menu",className:"fixed z-[100] w-48 rounded-lg border border-border bg-popover p-1 shadow-popover shadow-black/5 animate-in fade-in zoom-in-95 duration-100",children:[l&&vt(e)&&o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",role:"menuitem",className:st,onClick:()=>{l(e.id),U(null)},children:[o.jsx(hr,{className:"size-3.5 shrink-0"}),o.jsx("span",{children:m("Create subtask")})]}),cn]}),h&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Jn,children:e.ownStatus&&e.ownStatus!==t?m("Own status: {status}",{status:m(e.ownStatus)}):m("Move to")}),cs.filter(w=>w!==(e.ownStatus??t)).map(w=>{const{icon:A,label:I,accentClass:L}=it[w];return o.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(e.id,w),U(null)},className:st,children:[o.jsx(A,{className:ce("size-3.5 shrink-0",L)}),o.jsx("span",{children:m(I)})]},w)})]}),s&&o.jsxs(o.Fragment,{children:[h&&cn,o.jsx("div",{className:Jn,children:m("Priority")}),us.map(w=>{const A=(e.priority??Lt.NORMAL)===w.value;return o.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":A,onClick:()=>{s(e.id,w.value),U(null)},className:st,children:[o.jsx(In,{priority:w.value}),o.jsx("span",{className:"flex-1",children:m(w.label)}),A&&o.jsx(Ct,{className:"size-3.5 shrink-0 text-foreground","aria-hidden":!0})]},w.value)})]}),f&&o.jsxs(o.Fragment,{children:[(h||s)&&cn,o.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{K(!0),U(null)},className:ce(st,"text-destructive-ink hover:bg-destructive/10 hover:text-destructive-ink focus-visible:bg-destructive/10"),children:[o.jsx(As,{className:"size-3.5 shrink-0","aria-hidden":!0}),o.jsx("span",{children:m("Delete Task")})]})]})]}),o.jsx(Li,{isOpen:Y,onClose:()=>K(!1),onConfirm:w=>{f?.(e.id,w),K(!1)},taskId:e.id,taskTitle:e.title})]})}const Ui=u.memo(function({title:t,tasks:n,status:r,defaultOpen:a,selectedTaskId:c,selectedParentTaskId:h,selectionPath:f,onCreateSubtask:s,onSelectTask:i,projects:l,showProject:d=!0,isDragging:g,dragFromStatus:p,onTaskStatusChange:m,onDeleteTask:x,onTaskPriorityChange:v,disableDrag:k}){const{t:C}=ze(),[y,R]=u.useState({selection:null,open:a}),S=y.open||!!(c&&y.selection!==c&&n.some(Y=>Y.id===c||Y.id===h||f?.some(K=>K.id===Y.id)));Fi();const M=n.length===0,D=g&&p===r,j=g&&p!==r,{setNodeRef:P,isOver:F}=fi({id:`group-${r}`,data:{status:r}}),O=r===ne.Review,W=C(t),{icon:z,accentClass:q}=it[r],te=u.useId(),J=g?D:S,U=J&&!j&&!M;return o.jsxs("div",{className:U?"mb-4":"mb-2","data-task-group-status":r,children:[o.jsx("div",{className:"sticky top-0 z-10 bg-sidebar px-2",children:o.jsxs("button",{type:"button",onClick:()=>!g&&R({selection:c,open:!S}),"aria-expanded":S,"data-sidebar-item":"",className:"group/header flex h-8 w-full items-center gap-1 rounded-md px-2 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 pointer-coarse:h-10 pointer-coarse:text-[15px]",children:[o.jsx(z,{className:ce("mr-1.5 size-4 shrink-0 -translate-y-px",q)}),o.jsx("span",{id:te,className:"truncate",children:W}),o.jsx(cr,{size:14,"aria-hidden":!0,className:ce("shrink-0 text-muted-foreground transition-transform duration-150 group-hover/header:text-muted-foreground",J&&"rotate-90")}),O&&!M?o.jsx("span",{className:"ml-auto rounded-full bg-warning/15 px-1.5 text-xs font-semibold leading-5 tabular-nums text-warning-ink",children:n.length}):o.jsx("span",{className:"ml-auto text-xs tabular-nums text-muted-foreground",children:n.length})]})}),j&&o.jsx("div",{ref:P,className:ce("mx-2 mt-0.5 flex h-9 items-center justify-center rounded-md border border-dashed text-xs font-medium transition-colors duration-150",F?"border-foreground/30 bg-foreground/[0.04] text-foreground/80":"border-border bg-foreground/[0.02] text-muted-foreground"),children:F?C("Drop into {title}",{title:W}):C("Drop here")}),U&&o.jsx("div",{ref:D?void 0:P,role:"group","aria-labelledby":te,className:"mt-0.5 flex flex-col gap-px px-2",children:n.map(Y=>{const K=c===Y.id,re=Y.projectId?l.find(ie=>ie.id===Y.projectId):void 0;return o.jsx(Ur,{selectedTaskId:c,selectionPath:f,expandForSelection:h===Y.id||f?.some(ie=>ie.parentTaskId===Y.id),onCreateSubtask:Y.projectArchivedAt?void 0:s,task:Y,status:r,isSelected:K,project:re,showProject:d,onSelectTask:i,onTaskStatusChange:Y.projectArchivedAt?void 0:m,onDeleteTask:Y.projectArchivedAt?void 0:x,onTaskPriorityChange:Y.projectArchivedAt?void 0:v,disableDrag:k},Y.id)})})]})}),$i=12,Ki=50;function Gi({isOpen:e,onClose:t,tasks:n,projects:r,onSelectTask:a}){const{t:c}=ze(),[h,f]=u.useState(""),[s,i]=u.useState(0),l=u.useRef(null);u.useEffect(()=>{e&&(f(""),i(0))},[e]);const d=u.useMemo(()=>{const m=h.trim().toLowerCase();return m?n.filter(x=>x.title.toLowerCase().includes(m)).slice(0,Ki):n.slice(0,$i)},[n,h]);u.useEffect(()=>{i(0)},[h]),u.useEffect(()=>{l.current?.children[s]?.scrollIntoView({block:"nearest"})},[s]);const g=u.useCallback(m=>{a(m),t()},[a,t]),p=u.useCallback(m=>{if(m.key==="Escape")m.preventDefault(),t();else if(m.key==="ArrowDown")m.preventDefault(),i(x=>Math.min(x+1,d.length-1));else if(m.key==="ArrowUp")m.preventDefault(),i(x=>Math.max(x-1,0));else if(m.key==="Enter"&&!m.nativeEvent.isComposing){m.preventDefault();const x=d[s];x&&g(x.id)}},[t,d,s,g]);return e?o.jsxs("div",{className:"fixed inset-0 z-90",role:"dialog","aria-modal":"true",children:[o.jsx("div",{className:"absolute inset-0 bg-black/20",onClick:t}),o.jsxs("div",{className:"absolute left-1/2 top-[18vh] w-[min(560px,calc(100vw-2rem))] -translate-x-1/2 bg-popover rounded-xl border border-border shadow-popover overflow-hidden animate-in fade-in zoom-in-95 duration-100",children:[o.jsxs("div",{className:"flex items-center gap-2.5 px-4 border-b border-border/60",children:[o.jsx(mr,{size:15,className:"text-muted-foreground/70 shrink-0"}),o.jsx("input",{value:h,onChange:m=>f(m.target.value),onKeyDown:p,placeholder:c("Search tasks..."),"aria-label":c("Search tasks..."),autoFocus:!0,className:"flex-1 py-3 bg-transparent border-none focus:outline-none text-sm text-foreground placeholder-muted-foreground/60"})]}),d.length>0?o.jsxs(o.Fragment,{children:[!h.trim()&&o.jsx("div",{className:"px-4 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",children:c("Recent tasks")}),o.jsx("div",{ref:l,className:"max-h-[46vh] overflow-y-auto scrollbar-app-thin pb-1.5 pt-0.5",children:d.map((m,x)=>{const v=r.find(y=>y.id===m.projectId),{icon:k,iconClass:C}=it[m.status];return o.jsxs("button",{onClick:()=>g(m.id),onMouseEnter:()=>i(x),className:`w-full flex items-center gap-2.5 px-4 py-2 text-left transition-colors
|
|
9
|
+
${x===s?"bg-accent":""}`,children:[o.jsx(k,{className:`${C} size-4 shrink-0`}),o.jsxs("span",{className:"flex-1 min-w-0 truncate text-sm text-foreground/90",title:m.title,children:[m.title,m.parentTaskId&&o.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:c("Parent task: {title}",{title:n.find(y=>y.id===m.parentTaskId)?.title??"…"})})]}),v&&o.jsx("span",{className:"shrink-0 max-w-[120px] truncate text-xs text-muted-foreground",children:v.name})]},m.id)})})]}):o.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:c("No matching tasks")})]})]}):null}const Wi=260,Qi=220;function Yi(e){const t={[ne.Review]:[],[ne.Running]:[],[ne.Pending]:[],[ne.Done]:[],[ne.Cancelled]:[]};for(const n of e)t[n.status].push(n);return t[ne.Review].sort((n,r)=>(r.priority??Lt.NORMAL)-(n.priority??Lt.NORMAL)),t}const Hi=[{status:ne.Review,title:"Review",defaultOpen:!0},{status:ne.Running,title:"Running",defaultOpen:!0},{status:ne.Pending,title:"Pending",defaultOpen:!1},{status:ne.Done,title:"Done",defaultOpen:!1},{status:ne.Cancelled,title:"Cancelled",defaultOpen:!1}];function Xi(){return o.jsx("div",{className:"flex-1 overflow-hidden px-2 pt-3 motion-safe:animate-pulse","aria-hidden":!0,children:[3,4].map((e,t)=>o.jsxs("div",{className:"mb-4",children:[o.jsxs("div",{className:"flex h-8 items-center gap-2.5 px-2 pointer-coarse:h-10",children:[o.jsx("div",{className:"size-4 shrink-0 rounded-full bg-foreground/[0.06]"}),o.jsx("div",{className:"h-3 w-14 rounded-full bg-foreground/[0.06]"})]}),Array.from({length:e}).map((n,r)=>o.jsxs("div",{className:"flex h-8 items-center gap-2.5 px-2 pointer-coarse:h-10",children:[o.jsx("div",{className:"h-3 rounded-full bg-foreground/[0.06]",style:{width:`${64-(r+t)%3*14}%`}}),o.jsx("div",{className:"ml-auto h-2.5 w-8 shrink-0 rounded-full bg-foreground/[0.05]"})]},r))]},t))})}function Zn({tasks:e=[],projects:t=[],selectedTaskId:n,selectedParentTaskId:r,onCreateSubtask:a,onSelectTask:c,filterProjectId:h,setFilterProjectId:f,width:s=320,onCreateTask:i,onCreateProject:l,isCreateActive:d,onTaskStatusChange:g,onDeleteTask:p,onTaskPriorityChange:m,isLoading:x=!1}){const{t:v}=ze(),{preserveDesktopSearch:k}=ur(),C=Or(),[y,R]=u.useState(null),[S,M]=u.useState(null),[D,j]=u.useState(!1),P=u.useRef(new Set),F=u.useRef(new Map),[O]=u.useState(()=>({registry:new Map})),W=u.useCallback(E=>{E.remove(),P.current.delete(E)},[]),z=h?e.filter(E=>E.projectId===h):e,q=u.useCallback((E,Q)=>{const w=document.querySelector(`[data-task-group-status="${E}"]`);if(!w)return null;const I=(w.querySelector("button")??w).getBoundingClientRect();return I.width===0||I.height===0?null:new DOMRect(I.left,I.bottom+2,Q.width,Q.height)},[]),te=u.useCallback((E,Q,w,A=!1)=>{const I=document.createElement("div");I.setAttribute("aria-hidden","true"),I.innerHTML=w,I.querySelectorAll("[data-gradient-ready]").forEach(Be=>Be.removeAttribute("data-gradient-ready")),I.querySelectorAll(".task-gradient-text__canvas").forEach(Be=>Be.remove());const L=I.firstElementChild;L&&(L.style.cssText="",L.className=L.className.replace(/\bopacity-\S*/g,"").replace(/\banimate-task-enter\b/g,""),L.style.pointerEvents="none",L.style.width=`${E.width}px`,L.style.height=`${E.height}px`,L.style.margin="0",L.style.backgroundColor="var(--background)",L.style.borderRadius="0.5rem",L.style.boxShadow="var(--shadow-popover), 0 0 0 1px var(--border)",L.style.opacity="0.96",L.style.transition="none",L.setAttribute("tabindex","-1")),Object.assign(I.style,{position:"fixed",left:`${E.left}px`,top:`${E.top}px`,width:`${E.width}px`,height:`${E.height}px`,zIndex:"9999",pointerEvents:"none",overflow:"visible",transformOrigin:"top left",willChange:"transform, opacity"}),document.body.appendChild(I),P.current.add(I);const G=Q.left-E.left,je=Q.top-E.top;I.animate([{transform:"translate(0, 0)",opacity:.96,offset:0},{transform:`translate(${G}px, ${je}px)`,opacity:A?.12:.96,offset:1}],{duration:A?Qi:Wi,easing:"cubic-bezier(0.2, 0, 0, 1)",fill:"forwards"}).finished.then(()=>W(I),()=>W(I))},[W]);u.useLayoutEffect(()=>{const E=window.matchMedia("(prefers-reduced-motion: reduce)").matches,Q=new Map;for(const w of z){const A=O.registry.get(w.id);if(!A)continue;const I={status:w.status,rect:A.getBoundingClientRect(),html:A.outerHTML};if(Q.set(w.id,I),E)continue;const L=F.current.get(w.id);if(!L||L.status===w.status)continue;const G=I.rect.left-L.rect.left,je=I.rect.top-L.rect.top;Math.abs(G)<1&&Math.abs(je)<1||te(L.rect,I.rect,L.html)}if(!E)for(const[w,A]of F.current){if(Q.has(w))continue;const I=z.find(G=>G.id===w);if(!I||I.status===A.status)continue;const L=q(I.status,A.rect);L&&te(A.rect,L,A.html,!0)}F.current=Q},[z,te,q,O]),u.useEffect(()=>()=>{for(const E of P.current)E.remove();P.current.clear()},[]);const J=ao(io(Nn,{activationConstraint:{distance:8}})),U=u.useCallback(E=>{const Q=E.active.data.current?.task,w=E.active.data.current?.fromStatus;Q&&R(Q),w&&M(w)},[]),Y=u.useCallback(E=>{R(null),M(null);const{active:Q,over:w}=E;if(!w)return;const A=Q.data.current?.task,I=Q.data.current?.fromStatus,L=w.data.current?.status;!A||!I||!L||A.projectArchivedAt||I!==L&&(A.ownStatus??I)!==L&&g?.(A.id,L)},[g]),ie=!!!(h?t.find(E=>E.id===h)??null:null)?.archivedAt,H=e.find(E=>E.id===n),me=H?dr(H):[],xe=e.filter(E=>E.id===n||me.includes(E.id)||E.id===r),Me=Yi(z.filter(E=>!E.parentTaskId)),Z=y?it[y.status]:null,Ee=u.useCallback(E=>{if(E.key!=="ArrowDown"&&E.key!=="ArrowUp"||E.altKey||E.ctrlKey||E.metaKey||E.shiftKey)return;const Q=Array.from(E.currentTarget.querySelectorAll("[data-sidebar-item]:not(:disabled)")),w=Q.indexOf(E.target);w!==-1&&(E.preventDefault(),Q[w+(E.key==="ArrowDown"?1:-1)]?.focus())},[]);return o.jsxs("div",{className:"@container h-full flex flex-col flex-shrink-0",style:{width:s},onKeyDown:Ee,children:[o.jsxs("div",{className:"px-2 pt-2 pb-1 flex flex-col gap-px flex-shrink-0",children:[l&&o.jsxs("button",{type:"button",onClick:l,"data-sidebar-item":"",className:bt(!1),children:[o.jsx(Ts,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"truncate",children:v("New Project")})]}),o.jsxs("button",{type:"button",onClick:i,disabled:!ie,"aria-current":d||void 0,"data-sidebar-item":"",className:ce(bt(!!d),"disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent"),title:ie?void 0:v("Deleted projects are read-only"),children:[o.jsx(Ds,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"truncate",children:v("New Task")})]}),o.jsxs("button",{type:"button",onClick:()=>j(!0),"data-sidebar-item":"",className:bt(!1),children:[o.jsx(mr,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"truncate",children:v("Search")})]}),o.jsxs(fs,{to:k("/conversations"),"data-sidebar-item":"",className:bt(!1),children:[o.jsx(Is,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"truncate",children:v("对话")})]})]}),x?o.jsx(Xi,{}):z.length===0?o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 pb-[10vh] text-center select-none",children:[o.jsx(dn,{size:36,"aria-hidden":"true",className:"text-muted-foreground/50 mb-3",strokeWidth:1.5}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:v("No tasks")}),ie&&i?o.jsx("button",{type:"button",onClick:i,className:"px-3.5 py-1.5 rounded-md bg-brand text-brand-foreground text-xs font-medium hover:bg-brand/90 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-2",children:v("New Task")}):null]}):o.jsx(Fr.Provider,{value:O,children:o.jsxs(oi,{sensors:J,onDragStart:U,onDragEnd:Y,children:[o.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-app-thin scroll-pt-8 pointer-coarse:scroll-pt-10 relative",children:o.jsx("div",{className:"pt-3 pb-4",children:Hi.map(({status:E,title:Q,defaultOpen:w})=>o.jsx(Ui,{title:Q,tasks:Me[E],status:E,defaultOpen:w,selectedTaskId:n,selectionPath:xe,selectedParentTaskId:r??e.find(A=>A.id===n)?.parentTaskId,onCreateSubtask:a,onSelectTask:c,projects:t,showProject:!h,isDragging:y!==null,dragFromStatus:S,onTaskStatusChange:g,onDeleteTask:p,onTaskPriorityChange:m,disableDrag:C},E))})}),o.jsx(Ei,{dropAnimation:null,children:y&&Z?o.jsxs("div",{className:"flex h-8 w-fit max-w-[280px] items-center gap-2.5 rounded-md bg-background px-2 text-sm text-foreground shadow-overlay ring-1 ring-border/80",children:[o.jsx(Z.icon,{className:ce("size-4 shrink-0",Z.iconClass)}),o.jsx("span",{className:"truncate",title:y.title,children:y.title})]}):null})]})}),!x&&o.jsxs("div",{className:"h-9 px-4 flex flex-shrink-0 items-center justify-between border-t border-border/60 text-xs text-muted-foreground",children:[o.jsx("span",{className:"tabular-nums",children:v("{count} tasks",{count:z.length})}),h?o.jsx("button",{type:"button",onClick:()=>f(null),className:"rounded-sm hover:text-foreground underline decoration-border underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:v("Clear filter")}):null]}),o.jsx(Gi,{isOpen:D,onClose:()=>j(!1),tasks:z,projects:t,onSelectTask:c})]})}var qi=Object.defineProperty,Gt=Object.getOwnPropertySymbols,$r=Object.prototype.hasOwnProperty,Kr=Object.prototype.propertyIsEnumerable,er=(e,t,n)=>t in e?qi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gn=(e,t)=>{for(var n in t||(t={}))$r.call(t,n)&&er(e,n,t[n]);if(Gt)for(var n of Gt(t))Kr.call(t,n)&&er(e,n,t[n]);return e},pn=(e,t)=>{var n={};for(var r in e)$r.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gt)for(var r of Gt(e))t.indexOf(r)<0&&Kr.call(e,r)&&(n[r]=e[r]);return n};var qe;(e=>{const t=class ${constructor(s,i,l,d){if(this.version=s,this.errorCorrectionLevel=i,this.modules=[],this.isFunction=[],s<$.MIN_VERSION||s>$.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=s*4+17;let g=[];for(let m=0;m<this.size;m++)g.push(!1);for(let m=0;m<this.size;m++)this.modules.push(g.slice()),this.isFunction.push(g.slice());this.drawFunctionPatterns();const p=this.addEccAndInterleave(l);if(this.drawCodewords(p),d==-1){let m=1e9;for(let x=0;x<8;x++){this.applyMask(x),this.drawFormatBits(x);const v=this.getPenaltyScore();v<m&&(d=x,m=v),this.applyMask(x)}}a(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(s,i){const l=e.QrSegment.makeSegments(s);return $.encodeSegments(l,i)}static encodeBinary(s,i){const l=e.QrSegment.makeBytes(s);return $.encodeSegments([l],i)}static encodeSegments(s,i,l=1,d=40,g=-1,p=!0){if(!($.MIN_VERSION<=l&&l<=d&&d<=$.MAX_VERSION)||g<-1||g>7)throw new RangeError("Invalid value");let m,x;for(m=l;;m++){const y=$.getNumDataCodewords(m,i)*8,R=h.getTotalBits(s,m);if(R<=y){x=R;break}if(m>=d)throw new RangeError("Data too long")}for(const y of[$.Ecc.MEDIUM,$.Ecc.QUARTILE,$.Ecc.HIGH])p&&x<=$.getNumDataCodewords(m,y)*8&&(i=y);let v=[];for(const y of s){n(y.mode.modeBits,4,v),n(y.numChars,y.mode.numCharCountBits(m),v);for(const R of y.getData())v.push(R)}a(v.length==x);const k=$.getNumDataCodewords(m,i)*8;a(v.length<=k),n(0,Math.min(4,k-v.length),v),n(0,(8-v.length%8)%8,v),a(v.length%8==0);for(let y=236;v.length<k;y^=253)n(y,8,v);let C=[];for(;C.length*8<v.length;)C.push(0);return v.forEach((y,R)=>C[R>>>3]|=y<<7-(R&7)),new $(m,i,C,g)}getModule(s,i){return 0<=s&&s<this.size&&0<=i&&i<this.size&&this.modules[i][s]}getModules(){return this.modules}drawFunctionPatterns(){for(let l=0;l<this.size;l++)this.setFunctionModule(6,l,l%2==0),this.setFunctionModule(l,6,l%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const s=this.getAlignmentPatternPositions(),i=s.length;for(let l=0;l<i;l++)for(let d=0;d<i;d++)l==0&&d==0||l==0&&d==i-1||l==i-1&&d==0||this.drawAlignmentPattern(s[l],s[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(s){const i=this.errorCorrectionLevel.formatBits<<3|s;let l=i;for(let g=0;g<10;g++)l=l<<1^(l>>>9)*1335;const d=(i<<10|l)^21522;a(d>>>15==0);for(let g=0;g<=5;g++)this.setFunctionModule(8,g,r(d,g));this.setFunctionModule(8,7,r(d,6)),this.setFunctionModule(8,8,r(d,7)),this.setFunctionModule(7,8,r(d,8));for(let g=9;g<15;g++)this.setFunctionModule(14-g,8,r(d,g));for(let g=0;g<8;g++)this.setFunctionModule(this.size-1-g,8,r(d,g));for(let g=8;g<15;g++)this.setFunctionModule(8,this.size-15+g,r(d,g));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let s=this.version;for(let l=0;l<12;l++)s=s<<1^(s>>>11)*7973;const i=this.version<<12|s;a(i>>>18==0);for(let l=0;l<18;l++){const d=r(i,l),g=this.size-11+l%3,p=Math.floor(l/3);this.setFunctionModule(g,p,d),this.setFunctionModule(p,g,d)}}drawFinderPattern(s,i){for(let l=-4;l<=4;l++)for(let d=-4;d<=4;d++){const g=Math.max(Math.abs(d),Math.abs(l)),p=s+d,m=i+l;0<=p&&p<this.size&&0<=m&&m<this.size&&this.setFunctionModule(p,m,g!=2&&g!=4)}}drawAlignmentPattern(s,i){for(let l=-2;l<=2;l++)for(let d=-2;d<=2;d++)this.setFunctionModule(s+d,i+l,Math.max(Math.abs(d),Math.abs(l))!=1)}setFunctionModule(s,i,l){this.modules[i][s]=l,this.isFunction[i][s]=!0}addEccAndInterleave(s){const i=this.version,l=this.errorCorrectionLevel;if(s.length!=$.getNumDataCodewords(i,l))throw new RangeError("Invalid argument");const d=$.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][i],g=$.ECC_CODEWORDS_PER_BLOCK[l.ordinal][i],p=Math.floor($.getNumRawDataModules(i)/8),m=d-p%d,x=Math.floor(p/d);let v=[];const k=$.reedSolomonComputeDivisor(g);for(let y=0,R=0;y<d;y++){let S=s.slice(R,R+x-g+(y<m?0:1));R+=S.length;const M=$.reedSolomonComputeRemainder(S,k);y<m&&S.push(0),v.push(S.concat(M))}let C=[];for(let y=0;y<v[0].length;y++)v.forEach((R,S)=>{(y!=x-g||S>=m)&&C.push(R[y])});return a(C.length==p),C}drawCodewords(s){if(s.length!=Math.floor($.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let i=0;for(let l=this.size-1;l>=1;l-=2){l==6&&(l=5);for(let d=0;d<this.size;d++)for(let g=0;g<2;g++){const p=l-g,x=(l+1&2)==0?this.size-1-d:d;!this.isFunction[x][p]&&i<s.length*8&&(this.modules[x][p]=r(s[i>>>3],7-(i&7)),i++)}}a(i==s.length*8)}applyMask(s){if(s<0||s>7)throw new RangeError("Mask value out of range");for(let i=0;i<this.size;i++)for(let l=0;l<this.size;l++){let d;switch(s){case 0:d=(l+i)%2==0;break;case 1:d=i%2==0;break;case 2:d=l%3==0;break;case 3:d=(l+i)%3==0;break;case 4:d=(Math.floor(l/3)+Math.floor(i/2))%2==0;break;case 5:d=l*i%2+l*i%3==0;break;case 6:d=(l*i%2+l*i%3)%2==0;break;case 7:d=((l+i)%2+l*i%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[i][l]&&d&&(this.modules[i][l]=!this.modules[i][l])}}getPenaltyScore(){let s=0;for(let g=0;g<this.size;g++){let p=!1,m=0,x=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[g][v]==p?(m++,m==5?s+=$.PENALTY_N1:m>5&&s++):(this.finderPenaltyAddHistory(m,x),p||(s+=this.finderPenaltyCountPatterns(x)*$.PENALTY_N3),p=this.modules[g][v],m=1);s+=this.finderPenaltyTerminateAndCount(p,m,x)*$.PENALTY_N3}for(let g=0;g<this.size;g++){let p=!1,m=0,x=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[v][g]==p?(m++,m==5?s+=$.PENALTY_N1:m>5&&s++):(this.finderPenaltyAddHistory(m,x),p||(s+=this.finderPenaltyCountPatterns(x)*$.PENALTY_N3),p=this.modules[v][g],m=1);s+=this.finderPenaltyTerminateAndCount(p,m,x)*$.PENALTY_N3}for(let g=0;g<this.size-1;g++)for(let p=0;p<this.size-1;p++){const m=this.modules[g][p];m==this.modules[g][p+1]&&m==this.modules[g+1][p]&&m==this.modules[g+1][p+1]&&(s+=$.PENALTY_N2)}let i=0;for(const g of this.modules)i=g.reduce((p,m)=>p+(m?1:0),i);const l=this.size*this.size,d=Math.ceil(Math.abs(i*20-l*10)/l)-1;return a(0<=d&&d<=9),s+=d*$.PENALTY_N4,a(0<=s&&s<=2568888),s}getAlignmentPatternPositions(){if(this.version==1)return[];{const s=Math.floor(this.version/7)+2,i=this.version==32?26:Math.ceil((this.version*4+4)/(s*2-2))*2;let l=[6];for(let d=this.size-7;l.length<s;d-=i)l.splice(1,0,d);return l}}static getNumRawDataModules(s){if(s<$.MIN_VERSION||s>$.MAX_VERSION)throw new RangeError("Version number out of range");let i=(16*s+128)*s+64;if(s>=2){const l=Math.floor(s/7)+2;i-=(25*l-10)*l-55,s>=7&&(i-=36)}return a(208<=i&&i<=29648),i}static getNumDataCodewords(s,i){return Math.floor($.getNumRawDataModules(s)/8)-$.ECC_CODEWORDS_PER_BLOCK[i.ordinal][s]*$.NUM_ERROR_CORRECTION_BLOCKS[i.ordinal][s]}static reedSolomonComputeDivisor(s){if(s<1||s>255)throw new RangeError("Degree out of range");let i=[];for(let d=0;d<s-1;d++)i.push(0);i.push(1);let l=1;for(let d=0;d<s;d++){for(let g=0;g<i.length;g++)i[g]=$.reedSolomonMultiply(i[g],l),g+1<i.length&&(i[g]^=i[g+1]);l=$.reedSolomonMultiply(l,2)}return i}static reedSolomonComputeRemainder(s,i){let l=i.map(d=>0);for(const d of s){const g=d^l.shift();l.push(0),i.forEach((p,m)=>l[m]^=$.reedSolomonMultiply(p,g))}return l}static reedSolomonMultiply(s,i){if(s>>>8||i>>>8)throw new RangeError("Byte out of range");let l=0;for(let d=7;d>=0;d--)l=l<<1^(l>>>7)*285,l^=(i>>>d&1)*s;return a(l>>>8==0),l}finderPenaltyCountPatterns(s){const i=s[1];a(i<=this.size*3);const l=i>0&&s[2]==i&&s[3]==i*3&&s[4]==i&&s[5]==i;return(l&&s[0]>=i*4&&s[6]>=i?1:0)+(l&&s[6]>=i*4&&s[0]>=i?1:0)}finderPenaltyTerminateAndCount(s,i,l){return s&&(this.finderPenaltyAddHistory(i,l),i=0),i+=this.size,this.finderPenaltyAddHistory(i,l),this.finderPenaltyCountPatterns(l)}finderPenaltyAddHistory(s,i){i[0]==0&&(s+=this.size),i.pop(),i.unshift(s)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(f,s,i){if(s<0||s>31||f>>>s)throw new RangeError("Value out of range");for(let l=s-1;l>=0;l--)i.push(f>>>l&1)}function r(f,s){return(f>>>s&1)!=0}function a(f){if(!f)throw new Error("Assertion error")}const c=class oe{constructor(s,i,l){if(this.mode=s,this.numChars=i,this.bitData=l,i<0)throw new RangeError("Invalid argument");this.bitData=l.slice()}static makeBytes(s){let i=[];for(const l of s)n(l,8,i);return new oe(oe.Mode.BYTE,s.length,i)}static makeNumeric(s){if(!oe.isNumeric(s))throw new RangeError("String contains non-numeric characters");let i=[];for(let l=0;l<s.length;){const d=Math.min(s.length-l,3);n(parseInt(s.substring(l,l+d),10),d*3+1,i),l+=d}return new oe(oe.Mode.NUMERIC,s.length,i)}static makeAlphanumeric(s){if(!oe.isAlphanumeric(s))throw new RangeError("String contains unencodable characters in alphanumeric mode");let i=[],l;for(l=0;l+2<=s.length;l+=2){let d=oe.ALPHANUMERIC_CHARSET.indexOf(s.charAt(l))*45;d+=oe.ALPHANUMERIC_CHARSET.indexOf(s.charAt(l+1)),n(d,11,i)}return l<s.length&&n(oe.ALPHANUMERIC_CHARSET.indexOf(s.charAt(l)),6,i),new oe(oe.Mode.ALPHANUMERIC,s.length,i)}static makeSegments(s){return s==""?[]:oe.isNumeric(s)?[oe.makeNumeric(s)]:oe.isAlphanumeric(s)?[oe.makeAlphanumeric(s)]:[oe.makeBytes(oe.toUtf8ByteArray(s))]}static makeEci(s){let i=[];if(s<0)throw new RangeError("ECI assignment value out of range");if(s<128)n(s,8,i);else if(s<16384)n(2,2,i),n(s,14,i);else if(s<1e6)n(6,3,i),n(s,21,i);else throw new RangeError("ECI assignment value out of range");return new oe(oe.Mode.ECI,0,i)}static isNumeric(s){return oe.NUMERIC_REGEX.test(s)}static isAlphanumeric(s){return oe.ALPHANUMERIC_REGEX.test(s)}getData(){return this.bitData.slice()}static getTotalBits(s,i){let l=0;for(const d of s){const g=d.mode.numCharCountBits(i);if(d.numChars>=1<<g)return 1/0;l+=4+g+d.bitData.length}return l}static toUtf8ByteArray(s){s=encodeURI(s);let i=[];for(let l=0;l<s.length;l++)s.charAt(l)!="%"?i.push(s.charCodeAt(l)):(i.push(parseInt(s.substring(l+1,l+3),16)),l+=2);return i}};c.NUMERIC_REGEX=/^[0-9]*$/,c.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,c.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let h=c;e.QrSegment=c})(qe||(qe={}));(e=>{(t=>{const n=class{constructor(a,c){this.ordinal=a,this.formatBits=c}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(qe||(qe={}));(e=>{(t=>{const n=class{constructor(a,c){this.modeBits=a,this.numBitsCharCount=c}numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(qe||(qe={}));var ot=qe;var Vi={L:ot.QrCode.Ecc.LOW,M:ot.QrCode.Ecc.MEDIUM,Q:ot.QrCode.Ecc.QUARTILE,H:ot.QrCode.Ecc.HIGH},Gr=128,Wr="L",Qr="#FFFFFF",Yr="#000000",Hr=!1,Xr=1,Ji=4,Zi=0,ea=.1;function qr(e,t=0){const n=[];return e.forEach(function(r,a){let c=null;r.forEach(function(h,f){if(!h&&c!==null){n.push(`M${c+t} ${a+t}h${f-c}v1H${c+t}z`),c=null;return}if(f===r.length-1){if(!h)return;c===null?n.push(`M${f+t},${a+t} h1v1H${f+t}z`):n.push(`M${c+t},${a+t} h${f+1-c}v1H${c+t}z`);return}h&&c===null&&(c=f)})}),n.join("")}function Vr(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((a,c)=>c<t.x||c>=t.x+t.w?a:!1))}function ta(e,t,n,r){if(r==null)return null;const a=e.length+n*2,c=Math.floor(t*ea),h=a/t,f=(r.width||c)*h,s=(r.height||c)*h,i=r.x==null?e.length/2-f/2:r.x*h,l=r.y==null?e.length/2-s/2:r.y*h,d=r.opacity==null?1:r.opacity;let g=null;if(r.excavate){let m=Math.floor(i),x=Math.floor(l),v=Math.ceil(f+i-m),k=Math.ceil(s+l-x);g={x:m,y:x,w:v,h:k}}const p=r.crossOrigin;return{x:i,y:l,h:s,w:f,excavation:g,opacity:d,crossOrigin:p}}function na(e,t){return t!=null?Math.max(Math.floor(t),0):e?Ji:Zi}function Jr({value:e,level:t,minVersion:n,includeMargin:r,marginSize:a,imageSettings:c,size:h,boostLevel:f}){let s=_.useMemo(()=>{const m=(Array.isArray(e)?e:[e]).reduce((x,v)=>(x.push(...ot.QrSegment.makeSegments(v)),x),[]);return ot.QrCode.encodeSegments(m,Vi[t],n,void 0,void 0,f)},[e,t,n,f]);const{cells:i,margin:l,numCells:d,calculatedImageSettings:g}=_.useMemo(()=>{let p=s.getModules();const m=na(r,a),x=p.length+m*2,v=ta(p,h,m,c);return{cells:p,margin:m,numCells:x,calculatedImageSettings:v}},[s,h,c,r,a]);return{qrcode:s,margin:l,cells:i,numCells:d,calculatedImageSettings:g}}var ra=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),sa=_.forwardRef(function(t,n){const r=t,{value:a,size:c=Gr,level:h=Wr,bgColor:f=Qr,fgColor:s=Yr,includeMargin:i=Hr,minVersion:l=Xr,boostLevel:d,marginSize:g,imageSettings:p}=r,x=pn(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:v}=x,k=pn(x,["style"]),C=p?.src,y=_.useRef(null),R=_.useRef(null),S=_.useCallback(q=>{y.current=q,typeof n=="function"?n(q):n&&(n.current=q)},[n]),[M,D]=_.useState(!1),{margin:j,cells:P,numCells:F,calculatedImageSettings:O}=Jr({value:a,level:h,minVersion:l,boostLevel:d,includeMargin:i,marginSize:g,imageSettings:p,size:c});_.useEffect(()=>{if(y.current!=null){const q=y.current,te=q.getContext("2d");if(!te)return;let J=P;const U=R.current,Y=O!=null&&U!==null&&U.complete&&U.naturalHeight!==0&&U.naturalWidth!==0;Y&&O.excavation!=null&&(J=Vr(P,O.excavation));const K=window.devicePixelRatio||1;q.height=q.width=c*K;const re=c/F*K;te.scale(re,re),te.fillStyle=f,te.fillRect(0,0,F,F),te.fillStyle=s,ra?te.fill(new Path2D(qr(J,j))):P.forEach(function(ie,H){ie.forEach(function(me,xe){me&&te.fillRect(xe+j,H+j,1,1)})}),O&&(te.globalAlpha=O.opacity),Y&&te.drawImage(U,O.x+j,O.y+j,O.w,O.h)}}),_.useEffect(()=>{D(!1)},[C]);const W=gn({height:c,width:c},v);let z=null;return C!=null&&(z=_.createElement("img",{src:C,key:C,style:{display:"none"},onLoad:()=>{D(!0)},ref:R,crossOrigin:O?.crossOrigin})),_.createElement(_.Fragment,null,_.createElement("canvas",gn({style:W,height:c,width:c,ref:S,role:"img"},k)),z)});sa.displayName="QRCodeCanvas";var Zr=_.forwardRef(function(t,n){const r=t,{value:a,size:c=Gr,level:h=Wr,bgColor:f=Qr,fgColor:s=Yr,includeMargin:i=Hr,minVersion:l=Xr,boostLevel:d,title:g,marginSize:p,imageSettings:m}=r,x=pn(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:v,cells:k,numCells:C,calculatedImageSettings:y}=Jr({value:a,level:h,minVersion:l,boostLevel:d,includeMargin:i,marginSize:p,imageSettings:m,size:c});let R=k,S=null;m!=null&&y!=null&&(y.excavation!=null&&(R=Vr(k,y.excavation)),S=_.createElement("image",{href:m.src,height:y.h,width:y.w,x:y.x+v,y:y.y+v,preserveAspectRatio:"none",opacity:y.opacity,crossOrigin:y.crossOrigin}));const M=qr(R,v);return _.createElement("svg",gn({height:c,width:c,viewBox:`0 0 ${C} ${C}`,ref:n,role:"img"},x),!!g&&_.createElement("title",null,g),_.createElement("path",{fill:f,d:`M0,0 h${C}v${C}H0z`,shapeRendering:"crispEdges"}),_.createElement("path",{fill:s,d:M,shapeRendering:"crispEdges"}),S)});Zr.displayName="QRCodeSVG";function es(){return parseInt(window.location.port||(window.location.protocol==="https:"?"443":"80"),10)}function oa(){return hs({queryKey:fe.tunnel.status,queryFn:()=>Ue.get("/tunnel/status"),refetchInterval:e=>e.state.data?.running?5e3:!1})}function ia(){const e=Wt();return vn({mutationFn:()=>Ue.post("/tunnel/start",{port:es()}),onSuccess:()=>{e.invalidateQueries({queryKey:fe.tunnel.status})}})}function aa(){const e=Wt();return vn({mutationFn:()=>Ue.post("/tunnel/regenerate",{port:es()}),onSuccess:()=>{e.invalidateQueries({queryKey:fe.tunnel.status})}})}function la(){const e=Wt();return vn({mutationFn:()=>Ue.post("/tunnel/stop"),onSuccess:()=>{e.invalidateQueries({queryKey:fe.tunnel.status})}})}function ca(e){if(!e||e.status==="stopped")return{button:"text-muted-foreground hover:text-foreground hover:bg-accent",dot:"",label:"Use Agent Tower on your phone",icon:"idle"};switch(e.status){case"healthy":case"checking":return{button:"text-success-ink hover:bg-success/10",dot:"bg-success",label:e.status==="healthy"?"Tunnel healthy":"Checking tunnel health",icon:"ok"};case"degraded":case"localUnhealthy":case"linkReplaced":return{button:"text-warning-ink hover:bg-warning/10",dot:"bg-warning",label:"Tunnel needs attention",icon:"warn"};case"exited":case"error":return{button:"text-destructive-ink hover:bg-destructive/10",dot:"bg-destructive",label:"Tunnel unavailable",icon:"error"};case"starting":return{button:"text-warning-ink hover:bg-warning/10",dot:"bg-warning",label:"Tunnel starting",icon:"loading"}}}function ua(e){if(!e||e.status==="stopped")return"Tunnel is off";switch(e.status){case"healthy":return"Tunnel healthy";case"checking":return"Checking tunnel health";case"degraded":return"Observing original link";case"localUnhealthy":return"Local service unavailable";case"exited":return"Tunnel process exited";case"error":return"Tunnel error";case"linkReplaced":return"New link generated";case"starting":return"Tunnel starting"}}function da(e){if(!e||e.status==="stopped")return"Start a temporary Quick Tunnel when you need to share this Agent Tower session.";switch(e.status){case"healthy":return"The Cloudflare tunnel is running and the local Agent Tower health check passed.";case"checking":return"The Cloudflare tunnel is running. Agent Tower is waiting for the first local health check.";case"degraded":return"The original public URL is currently unreachable. Agent Tower is watching for it to recover and will not generate a new link automatically.";case"localUnhealthy":return"The local Agent Tower target is not responding, so the tunnel cannot be considered healthy.";case"exited":return"The tunnel process has exited. The old Quick Tunnel link is unlikely to recover.";case"error":return"The tunnel reported an error. Check the diagnostics before generating a new link.";case"linkReplaced":return"A new Quick Tunnel link was generated. The old link and token are no longer valid.";case"starting":return"Agent Tower is asking Cloudflare Quick Tunnel for a temporary public URL."}}function tr(e){if(!e)return"Never";const t=new Date(e).getTime();if(!Number.isFinite(t))return e;const n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`${n}s ago`;const r=Math.round(n/60);if(r<60)return`${r}m ago`;const a=Math.round(r/60);return a<24?`${a}h ago`:`${Math.round(a/24)}d ago`}function gt(e){const t=e?.trim();return t||null}function fa(e){if(!e)return"";const t=[gt(e.lastLocalError),gt(e.lastRemoteError),gt(e.lastError)].filter(a=>a!==null),n=gt(e.lastProcessOutput),r=!!n&&(e.status==="error"||e.status==="exited"||!!gt(e.lastError));return n&&r&&t.push(n),t.join(`
|
|
10
|
+
`)}function nr(){const{t:e}=ze(),{data:t}=oa(),n=ia(),r=la(),a=aa(),[c,h]=u.useState(!1),[f,s]=u.useState(null),[i,l]=u.useState(!1),[d,g]=u.useState(!1),p=t?.status!==void 0&&t.status!=="stopped",m=n.isPending||t?.status==="starting",x=a.isPending,v=t?.shareableUrl,k=t?.token,C=ca(t),y=ua(t),R=fa(t),S=t?.status==="healthy"||t?.status==="checking"?"text-success-ink":t?.status==="exited"||t?.status==="error"?"text-destructive-ink":"text-warning-ink",M=u.useCallback(()=>{n.mutate(void 0,{onSuccess:()=>h(!0)})},[n]),D=u.useCallback(()=>{v&&(navigator.clipboard.writeText(v),s("url"),setTimeout(()=>s(null),2e3))},[v]),j=u.useCallback(()=>{k&&(navigator.clipboard.writeText(k),s("token"),setTimeout(()=>s(null),2e3))},[k]),P=u.useCallback(()=>{r.mutate(),h(!1),l(!1),g(!1)},[r]),F=u.useCallback(()=>{a.mutate(void 0,{onSuccess:()=>{g(!1),h(!0)}})},[a]),O=o.jsx(Ps,{asChild:!0,children:o.jsx(nn,{size:"xs",label:e("Close"),className:"-mr-1 -mt-0.5 shrink-0",children:o.jsx(ms,{})})});return o.jsxs(Os,{open:c,onOpenChange:h,children:[o.jsxs("div",{className:"relative",children:[o.jsx(Ls,{asChild:!0,children:o.jsx("button",{type:"button",disabled:m,className:ce("p-1.5 rounded-md transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/60",C.button),title:e(C.label),"aria-label":e(C.label),children:m?o.jsx(gs,{size:"md"}):C.icon==="warn"?o.jsx(ps,{size:16}):o.jsx(zn,{size:16})})}),p&&!m&&o.jsx("span",{className:`pointer-events-none absolute top-0.5 right-0.5 w-2 h-2 ${C.dot} rounded-full`})]}),o.jsx(zs,{align:"end",className:ce("max-w-[calc(100vw-1rem)]",p?"w-96":"w-80"),children:p?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"mb-2 flex items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsxs("span",{className:ce("flex items-center gap-1.5 text-xs font-medium",S),children:[o.jsx("span",{className:`inline-block w-1.5 h-1.5 ${C.dot} rounded-full`}),e(y)]}),o.jsx("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:e(da(t))})]}),O]}),k&&o.jsxs("div",{className:"mb-2 flex items-center gap-1.5 rounded-md bg-muted/50 px-2 py-1 text-xs text-foreground/80",children:[o.jsx(Rs,{size:12}),o.jsx("span",{children:e("Token protected")})]}),v&&o.jsx("div",{className:"flex justify-center py-3",children:o.jsx(Zr,{value:v,size:160})}),v||t?.url?o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Bs,{size:"sm",readOnly:!0,value:v??t?.url??"",onFocus:W=>W.target.select(),"aria-label":e("Copy shareable link"),className:"select-all text-xs"}),o.jsx(nn,{size:"sm",label:e("Copy shareable link"),onClick:D,disabled:!v,children:f==="url"?o.jsx(Ct,{className:"text-success"}):o.jsx(On,{})})]}):o.jsx("div",{className:"rounded-md border border-border bg-muted/50 px-2 py-1.5 text-xs text-muted-foreground",children:e("No tunnel link available")}),o.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs",children:[o.jsxs("div",{className:"rounded-md border border-border px-2 py-1.5",children:[o.jsx("div",{className:"text-muted-foreground",children:e("Last checked")}),o.jsx("div",{className:"mt-0.5 text-foreground",children:tr(t?.lastCheckedAt)})]}),o.jsxs("div",{className:"rounded-md border border-border px-2 py-1.5",children:[o.jsx("div",{className:"text-muted-foreground",children:e("Last healthy")}),o.jsx("div",{className:"mt-0.5 text-foreground",children:tr(t?.lastHealthyAt)})]})]}),R&&o.jsx(Pt,{tone:"warning",size:"sm",className:"mt-2 max-h-28 overflow-auto",children:o.jsx("div",{className:"whitespace-pre-wrap break-words",children:R})}),t?.status==="degraded"&&o.jsx(Pt,{tone:"warning",size:"sm",className:"mt-2",children:e("Agent Tower is keeping the same URL and waiting for Cloudflare Quick Tunnel to recover.")}),t?.status==="linkReplaced"&&o.jsx(Pt,{tone:"warning",size:"sm",className:"mt-2",children:e("The previous tunnel link and token are no longer valid.")}),k&&o.jsxs("div",{className:"mt-2",children:[o.jsx("button",{type:"button",onClick:()=>l(!i),className:"rounded-sm text-xs text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:e(i?"Hide token":"Show token")}),i&&o.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[o.jsx("code",{className:"flex-1 min-w-0 break-all rounded-md border border-border bg-muted/50 px-2 py-1.5 text-xs text-foreground/80",children:k}),o.jsx(nn,{size:"sm",label:e("Copy token"),onClick:j,className:"shrink-0",children:f==="token"?o.jsx(Ct,{className:"text-success"}):o.jsx(On,{})})]})]}),d?o.jsxs(Pt,{tone:"danger",size:"sm",className:"mt-3",children:[e("Generating a new link will invalidate the current link. People using the old URL must receive the new one."),o.jsxs("div",{className:"mt-2 flex gap-2",children:[o.jsx(De,{variant:"secondary",size:"xs",className:"flex-1",onClick:()=>g(!1),children:e("Cancel")}),o.jsx(De,{variant:"primary",tone:"danger",size:"xs",className:"flex-1",onClick:F,loading:x,children:e(x?"Generating...":"Regenerate link")})]})]}):o.jsxs(De,{variant:"ghost",size:"sm",block:!0,className:"mt-3",onClick:()=>g(!0),disabled:x||t?.canRegenerate===!1,children:[o.jsx(vs,{}),e("Regenerate link")]}),o.jsx(De,{variant:"ghost",tone:"danger",size:"sm",block:!0,className:"mt-1",onClick:P,loading:r.isPending,children:r.isPending?e("Stopping..."):e("Stop Tunnel")})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-md bg-muted text-foreground/80",children:o.jsx(zn,{size:16})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm font-medium text-foreground",children:e("Use Agent Tower on your phone")}),o.jsx("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:e("After enabling the tunnel, you can scan a QR code with your phone to visit this Agent Tower instance, assign tasks, and check agent status.")})]})]}),O]}),o.jsx(De,{variant:"primary",size:"sm",block:!0,className:"mt-3",onClick:M,loading:m,children:e(m?"Starting tunnel...":"Enable phone access")})]})})]})}function un({isOpen:e,onClose:t}){const{t:n}=ze(),r=Es(),[a,c]=u.useState(""),[h,f]=u.useState(""),[s,i]=u.useState(null),[l,d]=u.useState(!1),[g,p]=u.useState(!1),m=a.trim(),x=h.trim(),v=l||r.isPending,k=u.useMemo(()=>!!(m&&x&&!v),[m,x,v]),C=u.useCallback(()=>{c(""),f(""),i(null),p(!1)},[]),y=u.useCallback(()=>{v||(C(),t())},[v,t,C]);u.useEffect(()=>{e||C()},[e,C]);const R=u.useCallback(async j=>{try{await r.mutateAsync({name:m,repoPath:x,initEmptyRepo:j}),C(),t()}catch(P){const F=P instanceof Error?P.message:n("Failed to create project");i(F),Oe.error(F)}},[r,t,C,n,m,x]),S=u.useCallback(async()=>{if(!(!m||!x||v)){i(null),d(!0);try{const j=await Ue.get("/filesystem/validate",{params:{path:x}});if(!j.valid){i(j.error??n("Selected path is not a valid directory"));return}if(j.isGitRepo){await R(!1);return}if(j.reason==="no_git"&&j.isEmpty){p(!0);return}if(j.reason==="no_git"){await R(!1);return}await R(!1)}catch(j){i(j instanceof Error?j.message:n("Could not check project path"))}finally{d(!1)}}},[R,v,n,m,x]),M=u.useCallback(()=>{p(!1),R(!1)},[R]),D=u.useCallback(()=>{p(!1),R(!0)},[R]);return o.jsxs(o.Fragment,{children:[o.jsx(Ln,{isOpen:e,onClose:y,title:n("Create New Project"),action:o.jsxs(o.Fragment,{children:[o.jsx(De,{onClick:y,disabled:v,children:n("Cancel")}),o.jsx(De,{variant:"primary",onClick:S,disabled:!k,children:l?n("Checking..."):r.isPending?n("Creating..."):n("Create Project")})]}),children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-foreground/80 mb-1.5",children:n("Project Name")}),o.jsx("input",{type:"text",value:a,onChange:j=>c(j.target.value),placeholder:n("e.g., Agent Tower"),disabled:v,className:"w-full px-3 py-2 border border-border rounded-lg text-sm focus:outline-none focus:border-ring transition-colors disabled:bg-muted/50 disabled:text-muted-foreground",autoFocus:!0})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-foreground/80 mb-1.5",children:n("Project Path")}),o.jsx(Us,{value:h,onChange:f,validationMode:"directory"})]}),s&&o.jsx("p",{className:"text-xs text-destructive-ink leading-relaxed",children:s})]})}),o.jsx(Ln,{isOpen:g,onClose:()=>{r.isPending||p(!1)},title:n("Initialize Git repository?"),action:o.jsxs(o.Fragment,{children:[o.jsx(De,{onClick:()=>p(!1),disabled:r.isPending,children:n("Cancel")}),o.jsx(De,{onClick:M,disabled:r.isPending,children:n("Create Local Project")}),o.jsx(De,{variant:"primary",onClick:D,disabled:r.isPending,children:r.isPending?n("Creating..."):n("Initialize and Create")})]}),children:o.jsxs("div",{className:"space-y-3 text-sm text-foreground/70 leading-relaxed",children:[o.jsx("p",{children:n("This directory is empty and does not have Git version control yet. Agent Tower can initialize Git and create the initial commit before creating the project.")}),o.jsx("p",{children:n("You can also create it as a local project now. Local projects only support local Solo tasks until Git is initialized.")})]})})]})}function rr(e){if(!e)return 0;const t=Date.parse(e);return Number.isNaN(t)?0:t}function ha(e){return e.map((t,n)=>({project:t,index:n,activityTime:rr(t.lastActivityAt??t.createdAt),createdTime:rr(t.createdAt)})).sort((t,n)=>{const r=n.activityTime-t.activityTime;if(r!==0)return r;const a=n.createdTime-t.createdTime;return a!==0?a:t.index-n.index}).map(({project:t})=>t)}const ts="providerLastUsedAt";function ma(){const e={};try{const t=localStorage.getItem(ts),n=t?JSON.parse(t):{};if(n&&typeof n=="object"&&!Array.isArray(n))for(const[r,a]of Object.entries(n))typeof a=="number"&&Number.isFinite(a)&&a>0&&(e[r]=a)}catch{}try{const t=localStorage.getItem("lastSelectedProviderId");t&&Object.keys(e).length===0&&(e[t]=1)}catch{}return e}function ga(e){try{localStorage.setItem(ts,JSON.stringify(e))}catch{}}const pa=u.lazy(()=>fr(()=>import("./TaskDetail-C2_Fg59e.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55])).then(e=>({default:e.TaskDetail}))),va=u.lazy(()=>fr(()=>import("./MobileTaskDetail-Dm64ie99.js"),__vite__mapDeps([56,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55])).then(e=>({default:e.MobileTaskDetail})));function sr(){const{t:e}=ze();return o.jsx("div",{role:"status",className:"flex flex-1 items-center justify-center bg-background p-4 text-sm text-muted-foreground",children:e("Loading...")})}function or({projects:e,filterProjectId:t,setFilterProjectId:n,onCreateProject:r,className:a}){const{t:c}=ze(),[h,f]=u.useState(!1),s=e.filter(l=>!l.archivedAt),i=t?e.find(l=>l.id===t)??null:null;return o.jsxs("div",{className:ce("relative flex items-center min-w-0",a),children:[o.jsx("span",{className:"mx-1.5 text-muted-foreground select-none",children:"/"}),o.jsxs("button",{onClick:()=>f(l=>!l),className:"flex items-center gap-1.5 px-2 py-1 rounded-md text-sm text-foreground/90 hover:bg-accent transition-colors min-w-0",children:[i?o.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${i.color.replace("text-","bg-")}`}):o.jsx(dn,{size:13,className:"text-muted-foreground shrink-0"}),o.jsx("span",{className:"truncate max-w-[200px] font-medium",children:i?i.name:c("All Projects")}),o.jsx($s,{size:13,className:`text-muted-foreground/70 shrink-0 transition-transform duration-200 ${h?"rotate-180":""}`})]}),h?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"fixed inset-0 z-30",onClick:()=>f(!1)}),o.jsxs("div",{className:"absolute left-4 top-full mt-1.5 w-60 bg-popover border border-border rounded-lg shadow-popover shadow-black/5 z-40 py-1 animate-in fade-in zoom-in-95 duration-100 origin-top-left",children:[o.jsxs("button",{onClick:()=>{n(null),f(!1)},className:"w-full text-left px-3 py-1.5 text-[13px] flex items-center gap-2 hover:bg-accent/50 transition-colors",children:[o.jsx(dn,{size:13,className:"text-muted-foreground shrink-0"}),o.jsx("span",{className:`flex-1 truncate ${t===null?"text-foreground font-medium":"text-muted-foreground"}`,children:c("All Projects")}),t===null?o.jsx(Ct,{size:14,className:"text-foreground shrink-0"}):null]}),o.jsx("div",{className:"h-px bg-border/60 my-1 mx-2"}),o.jsx("div",{className:"max-h-[40vh] overflow-y-auto scrollbar-app-thin",children:s.map(l=>{const d=t===l.id;return o.jsxs("button",{onClick:()=>{n(l.id),f(!1)},className:"w-full text-left px-3 py-1.5 text-[13px] flex items-center gap-2 hover:bg-accent/50 transition-colors",children:[o.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${l.color.replace("text-","bg-")}`}),o.jsx("span",{className:`flex-1 truncate ${d?"text-foreground font-medium":"text-muted-foreground"}`,children:l.name}),d?o.jsx(Ct,{size:14,className:"text-foreground shrink-0"}):null]},l.id)})}),o.jsx("div",{className:"h-px bg-border/60 my-1 mx-2"}),o.jsxs("button",{onClick:()=>{f(!1),r()},className:"w-full text-left px-3 py-1.5 text-[13px] flex items-center gap-2 text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors",children:[o.jsx(hr,{size:13}),o.jsx("span",{children:c("Create New Project...")})]})]})]}):null]})}const ba=260,xa=600,ir=400,ya=100,wa=1e3;function ar(e){const t=e.workspaces?.find(r=>r.status==="ACTIVE")??e.workspaces?.[0],n=t?.sessions?.at(-1);return{id:e.id,parentTaskId:e.parentTaskId,ancestorIds:e.ancestorIds,subtaskCount:e.subtaskCount,projectId:e.projectId,title:e.titlePreview??e.title,status:e.status,displayStatus:e.displayStatus,runningDescendantCount:e.runningDescendantCount,reviewDescendantCount:e.reviewDescendantCount,priority:e.priority,...t?{preferredWorkspace:{...t.workspaceKind===Xe.MAIN_DIRECTORY?{workspaceKind:Xe.MAIN_DIRECTORY}:{},branchName:t.branchName}}:{},...n?{latestAgentType:n.agentType}:{},...e.workspaces?.some(r=>r.sessions?.some(a=>a.status==="RUNNING"||a.status==="PENDING"))?{hasRunningSession:!0}:{},updatedAt:e.updatedAt?new Date(e.updatedAt).getTime():Date.now()}}function Ca(){const{t:e,locale:t}=ze(),[n,r]=u.useState(void 0),a=u.useRef(0),[c,h]=u.useState(null),[f,s]=u.useState(null),[i,l]=u.useState(ir),[d,g]=u.useState(!1),[p,m]=u.useState("idle"),[x,v]=u.useState({}),k=u.useRef(!1),C=u.useRef(0),y=u.useRef(ir),R=u.useRef(null),S=Wt(),{data:M,isLoading:D}=Fs(),[j,P]=u.useState(ma),{data:F,isLoading:O}=js({limit:ya}),W=u.useMemo(()=>F?.data??[],[F?.data]),z=f&&W.some(b=>b.id===f)?f:null,{data:q,isLoading:te}=bs({...z?{projectId:z}:{},limit:wa}),J=u.useMemo(()=>[...q?.data??[],...q?.parents??[]],[q]),[U,Y]=u.useState([]),K=u.useMemo(()=>{if(U.length===0)return J;const b=new Set(J.map(N=>N.id));return[...U.filter(N=>!b.has(N.id)),...J]},[J,U]),[re,ie]=u.useState(null),H=en(c&&!K.some(b=>b.id===c)?c:""),me=K.find(b=>b.id===c)??H.data,xe=u.useMemo(()=>me?dr(me):[],[me]),Me=b=>{const N=xe[b];return N&&!K.some(T=>T.id===N)?N:""},Z=en(Me(0)),Ee=en(Me(1)),E=u.useMemo(()=>c&&K.some(b=>b.id===c)?c:re&&c===re?re:c&&(H.isLoading||H.data&&(!z||H.data.projectId===z))?c:null,[c,K,re,H.data,H.isLoading,z]);u.useEffect(()=>{re&&K.some(b=>b.id===re)&&ie(null)},[re,K]),u.useEffect(()=>{if(U.length===0)return;const b=new Set(J.map(N=>N.id));U.some(N=>b.has(N.id))&&Y(N=>N.filter(T=>!b.has(T.id)))},[J,U]);const Q=u.useMemo(()=>ha(W),[W]),w=u.useMemo(()=>Q.map(Ii),[Q]),A=u.useMemo(()=>Q.filter(b=>!b.archivedAt),[Q]),I=u.useMemo(()=>M?M.filter(_s).sort((b,N)=>{const T=!mt(b),B=!mt(N);return T!==B?T?-1:1:(j[N.provider.id]??0)-(j[b.provider.id]??0)}):[],[M,j]),L=u.useMemo(()=>{const b=K.map(N=>Br(N,W.find(T=>T.id===N.projectId)));H.data&&E===H.data.id&&!b.some(N=>N.id===H.data.id)&&b.push(Vn(H.data));for(const N of[Z.data,Ee.data])N&&xe.includes(N.id)&&!b.some(T=>T.id===N.id)&&b.push(Vn(N));return b},[W,K,H.data,E,Z.data,Ee.data,xe]),G=u.useMemo(()=>{if(!E)return null;const b=K.find(T=>T.id===E)??(H.data?ar(H.data):void 0);if(!b)return null;const N=W.find(T=>T.id===b.projectId);if(!N){const T=b.preferredWorkspace?b.preferredWorkspace.workspaceKind===Xe.MAIN_DIRECTORY?"Project directory":b.preferredWorkspace.branchName:"—";return{id:b.id,parentTaskId:b.parentTaskId,ancestorIds:b.ancestorIds,subtaskCount:b.subtaskCount,projectId:b.projectId,projectName:"Unknown",projectColor:"text-muted-foreground",title:b.title,...Vt(b),priority:b.priority,branch:T,mainBranch:"main",description:"",isGitRepo:!1,worktreeReady:!1,reason:"NO_GIT",projectArchivedAt:null,projectRepoDeletedAt:null}}return Pi(b,N)},[E,K,W,H.data]),je=xs(),Ce=ys(),Be=ws(),ut=Cs(),Ve=Ms(),we=u.useCallback(b=>{const N=ar(b);Y(T=>T.some(B=>B.id===b.id)?T.map(B=>B.id===b.id?N:B):[N,...T]),S.setQueryData(fe.tasks.detail(b.id),b),ie(b.id),h(b.id)},[S]),Qe=u.useCallback((b,N,T)=>{const B=b.id,se=[b.title,b.description].filter(Boolean).join(`
|
|
11
11
|
|
|
12
12
|
`),X=T===Xe.WORKTREE?A.find(ee=>ee.id===b.projectId)?.setupScript??null:null;v(ee=>({...ee,[B]:{status:"creating-workspace",setupScript:X}})),(async()=>{try{await Qs(B,{providerId:N,prompt:se,workspaceKind:T},{createWorkspace:ee=>Ue.post(`/tasks/${B}/workspaces`,{clientSubmissionId:ee,workspaceKind:T}),startSession:ee=>Ve.mutateAsync(ee),onStep:ee=>v(Se=>({...Se,[B]:{status:ee,setupScript:X}}))}),await S.invalidateQueries({queryKey:fe.workspaces.list(B)}),await S.invalidateQueries({queryKey:fe.workspaces.setupProgress(B)}),await S.invalidateQueries({queryKey:fe.tasks.all}),v(ee=>{const Se={...ee};return delete Se[B],Se})}catch(ee){const Se=ee instanceof Error?ee.message:e("启动 Agent 失败");v(Mt=>({...Mt,[B]:{status:"failed",error:Se,setupScript:X}})),Oe.error(e("任务已创建,但启动 Agent 失败,可在详情中重试")),S.invalidateQueries({queryKey:fe.workspaces.list(B)}),S.invalidateQueries({queryKey:fe.tasks.all})}})()},[A,S,Ve,e]),Ye=u.useCallback(b=>{v(N=>{const T={...N};return delete T[b],T}),S.invalidateQueries({queryKey:fe.workspaces.list(b)}),S.invalidateQueries({queryKey:fe.tasks.all})},[S]),He=u.useCallback((b,N)=>{const T=new Set([b,...K.filter(B=>tn(B,b)).map(B=>B.id)]);Ce.mutate({id:b,expectedSubtaskCount:N},{onSuccess:()=>{(E===b||G&&tn(G,b))&&h(null),v(B=>{const se={...B};for(const X of T)delete se[X];return se}),Y(B=>B.filter(se=>!tn(se,b))),S.invalidateQueries({queryKey:fe.tasks.all})},onError:B=>{Oe.error(B instanceof Error?e(B.message):e("删除任务失败"))}})},[Ce,E,G,K,S,e]),Je=u.useCallback((b,N)=>{Be.mutate({id:b,status:Ai(N)},{onError:()=>{Oe.error(e("状态变更失败,该操作不被允许"))}})},[Be,e]),Ze=u.useCallback((b,N)=>{ut.mutate({id:b,priority:N},{onError:()=>{Oe.error(e("优先级变更失败"))}})},[ut,e]),Jt=u.useCallback(b=>{b.preventDefault(),k.current=!0,C.current=b.clientX,y.current=i,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[i]);u.useEffect(()=>{const b=T=>{if(!k.current)return;const B=T.clientX-C.current,se=Math.max(ba,Math.min(xa,y.current+B));l(se)},N=()=>{k.current&&(k.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",b),document.addEventListener("mouseup",N),()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",N)}},[]);const ke=u.useCallback(()=>{g(!0)},[]),Ke=u.useCallback(()=>{if(a.current++,r(void 0),A.length===0){Oe.error(e("没有可用项目,请先创建或恢复项目"));return}h(null)},[A,e]),Fe=u.useCallback(()=>{g(!1)},[]),et=u.useCallback(async b=>{const{title:N,description:T,projectId:B,providerId:se,mode:X,workspaceMode:ee,teamRunMode:Se,teamTemplateId:Mt,memberPresetIds:jn,attachmentLinks:ns,priority:rs,baseBranch:ss}=b,os=[T,ns].filter(Boolean).join(`
|
|
13
13
|
|
|
14
|
-
`);let Ge=null;try{if(m("creating-task"),Ge=await Ue.post(`/projects/${B}/tasks`,{title:N,description:os||void 0,priority:rs,baseBranch:ss,parentTaskId:b.parentTaskId}),localStorage.setItem("lastSelectedProjectId",B),X==="SOLO"&&se){localStorage.setItem("lastSelectedProviderId",se);const kn={...j,[se]:Date.now()};ga(kn),P(kn)}X==="TEAM"?(m("creating-teamrun"),await je.mutateAsync({taskId:Ge.id,mode:Se,...Mt?{teamTemplateId:Mt}:{},...jn.length>0?{memberPresetIds:jn}:{}})):se&&Qe(Ge,se,ee),z&&B!==z&&s(null),we(Ge),r(void 0),m("idle"),S.invalidateQueries({queryKey:fe.tasks.all}),S.invalidateQueries({queryKey:fe.projects.all})}catch(rt){if(m("idle"),Ge&&X==="TEAM")we(Ge),S.invalidateQueries({queryKey:fe.tasks.all}),Oe.error(rt instanceof Error?rt.message:e("TeamRun 创建失败,请检查团队配置后重试"));else if(Ge)z&&B!==z&&s(null),we(Ge),S.invalidateQueries({queryKey:fe.tasks.all}),S.invalidateQueries({queryKey:fe.projects.all});else throw Oe.error(rt instanceof Error?rt.message:e("Failed to create task")),rt}},[je,Qe,S,e,z,we,j]),Re=O||te,dt=u.useMemo(()=>A.filter(b=>!n||b.id===n.projectId).map(b=>({id:b.id,name:b.name,color:w.find(N=>N.id===b.id)?.color,repoPath:b.repoPath,mainBranch:b.mainBranch,isGitRepo:b.isGitRepo,worktreeReady:b.worktreeReady,reason:b.reason})),[A,w,n]),Tt=u.useMemo(()=>I.map(b=>{const N=mt(b);return{id:b.provider.id,name:b.provider.name,agentType:b.provider.agentType,available:!N,permissionMode:b.provider.executionPermission,reason:N}}),[I]),_e=u.useMemo(()=>{if(n)return n.projectId;if(z&&A.find(N=>N.id===z))return z;const b=localStorage.getItem("lastSelectedProjectId");return b&&A.find(N=>N.id===b)?b:A[0]?.id??""},[A,z,n]),[tt,nt]=u.useState(_e);u.useEffect(()=>{nt(_e)},[_e]);const Dt=u.useMemo(()=>A.find(b=>b.id===tt)?.name??A.find(b=>b.id===_e)?.name??e("Project"),[A,tt,_e,e]),ft=n?e("Create subtask"):t==="zh-CN"?`你需要在 ${Dt} 中做点什么?`:`What do you need to do in ${Dt}?`,It=u.useMemo(()=>{const b=localStorage.getItem("lastSelectedProviderId");return b&&I.find(T=>T.provider.id===b&&!mt(T))?b:I.find(T=>!mt(T))?.provider.id??""},[I]),ht=Or(),[Zt,ae]=u.useState(!1),{usesIntegratedTitlebar:le,desktopPlatform:ge,hasMacTrafficLights:Pe}=ur(),ye=le&&ge==="win32",pe=u.useCallback(()=>{if(a.current++,r(void 0),A.length===0){Oe.error(e("没有可用项目,请先创建或恢复项目"));return}ae(!0)},[A,e]),ve=u.useCallback(b=>{a.current++,r(void 0),h(b)},[]),Ae=u.useCallback(async b=>{const N=++a.current;try{const T=await Ue.get(`/tasks/${b}`);if(N!==a.current)return;if(!vt(T))throw new Error(e("Tasks support at most three levels"));const B=(T.workspaces?.filter(X=>!X.parentWorkspaceId&&!X.cleanedAt&&X.status!=="ABANDONED")??[]).sort((X,ee)=>(ee.createdAt??"").localeCompare(X.createdAt??"")),se=B.find(X=>X.status==="ACTIVE")??B.find(X=>X.status==="HIBERNATED")??B[0];r({id:b,title:T.titlePreview??T.title,projectId:T.projectId,baseBranch:se?.branchName||T.baseBranch}),h(null),ht&&ae(!0)}catch(T){N===a.current&&Oe.error(T instanceof Error?T.message:e("Failed to create task"))}},[ht,e]),ue=u.useCallback(async b=>{await et(b),ae(!1)},[et]);return ht?Zt?o.jsxs("div",{className:"flex flex-col h-dvh bg-background overflow-hidden text-sm",children:[o.jsx("header",{className:"h-12 border-b border-border/60 flex items-center px-4 shrink-0",children:o.jsx("button",{onClick:()=>{a.current++,n&&h(n.id),r(void 0),ae(!1)},className:"text-sm text-muted-foreground active:text-foreground",children:e("Cancel")})}),o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-4 pb-[8vh]",children:[o.jsx("h1",{className:"max-w-full text-center text-[22px] font-medium tracking-tight leading-snug text-foreground mb-5 break-words",children:ft}),o.jsx(Mn,{parentTask:n,projects:dt,providers:Tt,isProvidersLoading:D,onSubmit:ue,defaultProjectId:_e,defaultProviderId:It,onProjectChange:nt,createStep:p},n?.id??"root")]})]}):E&&G?o.jsxs(o.Fragment,{children:[o.jsx(u.Suspense,{fallback:o.jsx("div",{className:"flex h-dvh",children:o.jsx(sr,{})}),children:o.jsx(va,{task:G,onSelectTask:ve,onCreateSubtask:Ae,onBack:()=>h(null),onDeleteTask:G.projectArchivedAt?void 0:He,onTaskPriorityChange:G.projectArchivedAt?void 0:Ze,isDeleting:Ce.isPending,autoStartState:x[G.id]??null,onAutoStartRecovered:Ye})}),o.jsx(un,{isOpen:d,onClose:Fe})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-col h-dvh bg-sidebar overflow-hidden text-sm",children:[o.jsxs("header",{className:"h-12 bg-sidebar flex items-center px-4 justify-between shrink-0 z-20",children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Pn,{}),o.jsx(or,{projects:w,filterProjectId:z,setFilterProjectId:s,onCreateProject:ke})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(nr,{}),o.jsx("button",{onClick:()=>Tn.getState().openSettings(),className:"p-1.5 text-muted-foreground active:text-foreground rounded-md",children:o.jsx(An,{size:16})})]})]}),o.jsx(Zn,{tasks:L,projects:w,selectedTaskId:null,onSelectTask:ve,onCreateSubtask:Ae,selectedParentTaskId:G?.parentTaskId,filterProjectId:z,setFilterProjectId:s,width:"100%",onDeleteTask:He,onCreateTask:pe,onCreateProject:ke,onTaskStatusChange:Je,onTaskPriorityChange:Ze,isLoading:Re&&L.length===0})]}),o.jsx(un,{isOpen:d,onClose:Fe})]}):o.jsxs("div",{ref:R,className:"flex flex-col h-screen bg-sidebar overflow-hidden text-sm",children:[o.jsxs("header",{className:ce("h-12 bg-sidebar flex items-center px-4 justify-between flex-shrink-0 z-20 relative",le&&"app-region-drag",ye&&"pr-[150px]"),children:[o.jsxs("div",{className:ce("flex items-center gap-2 min-w-0",Pe&&"pl-[72px]"),children:[o.jsx(Pn,{}),o.jsx(or,{projects:w,filterProjectId:z,setFilterProjectId:s,onCreateProject:ke,className:le?"app-region-no-drag":void 0})]}),o.jsxs("div",{className:ce("flex items-center gap-1",le&&"app-region-no-drag"),children:[o.jsx("div",{className:le?"app-region-no-drag":void 0,children:o.jsx(nr,{})}),o.jsx("button",{onClick:()=>Tn.getState().openSettings(),className:ce("p-1.5 text-muted-foreground hover:text-foreground hover:bg-accent rounded-md transition-colors",le&&"app-region-no-drag"),children:o.jsx(An,{size:16})})]})]}),o.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[o.jsx(Zn,{tasks:L,projects:w,selectedTaskId:E,onSelectTask:ve,onCreateSubtask:Ae,selectedParentTaskId:G?.parentTaskId,filterProjectId:z,setFilterProjectId:s,width:i,onCreateTask:Ke,onCreateProject:ke,isCreateActive:!E,onTaskStatusChange:Je,onDeleteTask:He,onTaskPriorityChange:Ze,isLoading:Re&&L.length===0}),o.jsx("div",{onMouseDown:Jt,className:"w-1 cursor-col-resize hover:bg-border active:bg-ring/40 transition-colors z-50 -ml-[2px] flex-shrink-0 h-full",title:e("Drag to resize")}),o.jsx("div",{className:"flex-1 flex min-w-0 mb-2 mr-2 rounded-xl border border-border/50 bg-background overflow-hidden",children:E&&G?o.jsx(u.Suspense,{fallback:o.jsx(sr,{}),children:o.jsx(pa,{task:G,onSelectTask:ve,onCreateSubtask:Ae,onDeleteTask:G.projectArchivedAt?void 0:He,isDeleting:Ce.isPending,onTaskStatusChange:G.projectArchivedAt?void 0:Je,onTaskPriorityChange:G.projectArchivedAt?void 0:Ze,autoStartState:x[G.id]??null,onAutoStartRecovered:Ye})}):E&&!G?o.jsx("div",{className:"flex-1 flex items-center justify-center bg-background min-w-0",children:o.jsx("span",{className:"text-sm text-muted-foreground",children:e("Loading...")})}):o.jsx("div",{className:"flex-1 flex flex-col items-center justify-center bg-background min-w-0 px-8 pb-[10vh]",children:o.jsxs("div",{className:"w-full max-w-2xl flex flex-col items-center animate-[fadeInUp_0.5s_cubic-bezier(0.16,1,0.3,1)]",children:[o.jsx("h1",{className:"max-w-full text-center text-[26px] font-medium tracking-tight leading-snug text-foreground mb-6 break-words",children:ft}),o.jsx(Mn,{parentTask:n,projects:dt,providers:Tt,isProvidersLoading:D,onSubmit:et,defaultProjectId:_e,defaultProviderId:It,onProjectChange:nt,createStep:p},n?.id??"root")]})})})]}),o.jsx(un,{isOpen:d,onClose:Fe})]})}const
|
|
14
|
+
`);let Ge=null;try{if(m("creating-task"),Ge=await Ue.post(`/projects/${B}/tasks`,{title:N,description:os||void 0,priority:rs,baseBranch:ss,parentTaskId:b.parentTaskId}),localStorage.setItem("lastSelectedProjectId",B),X==="SOLO"&&se){localStorage.setItem("lastSelectedProviderId",se);const kn={...j,[se]:Date.now()};ga(kn),P(kn)}X==="TEAM"?(m("creating-teamrun"),await je.mutateAsync({taskId:Ge.id,mode:Se,...Mt?{teamTemplateId:Mt}:{},...jn.length>0?{memberPresetIds:jn}:{}})):se&&Qe(Ge,se,ee),z&&B!==z&&s(null),we(Ge),r(void 0),m("idle"),S.invalidateQueries({queryKey:fe.tasks.all}),S.invalidateQueries({queryKey:fe.projects.all})}catch(rt){if(m("idle"),Ge&&X==="TEAM")we(Ge),S.invalidateQueries({queryKey:fe.tasks.all}),Oe.error(rt instanceof Error?rt.message:e("TeamRun 创建失败,请检查团队配置后重试"));else if(Ge)z&&B!==z&&s(null),we(Ge),S.invalidateQueries({queryKey:fe.tasks.all}),S.invalidateQueries({queryKey:fe.projects.all});else throw Oe.error(rt instanceof Error?rt.message:e("Failed to create task")),rt}},[je,Qe,S,e,z,we,j]),Re=O||te,dt=u.useMemo(()=>A.filter(b=>!n||b.id===n.projectId).map(b=>({id:b.id,name:b.name,color:w.find(N=>N.id===b.id)?.color,repoPath:b.repoPath,mainBranch:b.mainBranch,isGitRepo:b.isGitRepo,worktreeReady:b.worktreeReady,reason:b.reason})),[A,w,n]),Tt=u.useMemo(()=>I.map(b=>{const N=mt(b);return{id:b.provider.id,name:b.provider.name,agentType:b.provider.agentType,available:!N,permissionMode:b.provider.executionPermission,reason:N}}),[I]),_e=u.useMemo(()=>{if(n)return n.projectId;if(z&&A.find(N=>N.id===z))return z;const b=localStorage.getItem("lastSelectedProjectId");return b&&A.find(N=>N.id===b)?b:A[0]?.id??""},[A,z,n]),[tt,nt]=u.useState(_e);u.useEffect(()=>{nt(_e)},[_e]);const Dt=u.useMemo(()=>A.find(b=>b.id===tt)?.name??A.find(b=>b.id===_e)?.name??e("Project"),[A,tt,_e,e]),ft=n?e("Create subtask"):t==="zh-CN"?`你需要在 ${Dt} 中做点什么?`:`What do you need to do in ${Dt}?`,It=u.useMemo(()=>{const b=localStorage.getItem("lastSelectedProviderId");return b&&I.find(T=>T.provider.id===b&&!mt(T))?b:I.find(T=>!mt(T))?.provider.id??""},[I]),ht=Or(),[Zt,ae]=u.useState(!1),{usesIntegratedTitlebar:le,desktopPlatform:ge,hasMacTrafficLights:Pe}=ur(),ye=le&&ge==="win32",pe=u.useCallback(()=>{if(a.current++,r(void 0),A.length===0){Oe.error(e("没有可用项目,请先创建或恢复项目"));return}ae(!0)},[A,e]),ve=u.useCallback(b=>{a.current++,r(void 0),h(b)},[]),Ae=u.useCallback(async b=>{const N=++a.current;try{const T=await Ue.get(`/tasks/${b}`);if(N!==a.current)return;if(!vt(T))throw new Error(e("Tasks support at most three levels"));const B=(T.workspaces?.filter(X=>!X.parentWorkspaceId&&!X.cleanedAt&&X.status!=="ABANDONED")??[]).sort((X,ee)=>(ee.createdAt??"").localeCompare(X.createdAt??"")),se=B.find(X=>X.status==="ACTIVE")??B.find(X=>X.status==="HIBERNATED")??B[0];r({id:b,title:T.titlePreview??T.title,projectId:T.projectId,baseBranch:se?.branchName||T.baseBranch}),h(null),ht&&ae(!0)}catch(T){N===a.current&&Oe.error(T instanceof Error?T.message:e("Failed to create task"))}},[ht,e]),ue=u.useCallback(async b=>{await et(b),ae(!1)},[et]);return ht?Zt?o.jsxs("div",{className:"flex flex-col h-dvh bg-background overflow-hidden text-sm",children:[o.jsx("header",{className:"h-12 border-b border-border/60 flex items-center px-4 shrink-0",children:o.jsx("button",{onClick:()=>{a.current++,n&&h(n.id),r(void 0),ae(!1)},className:"text-sm text-muted-foreground active:text-foreground",children:e("Cancel")})}),o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-4 pb-[8vh]",children:[o.jsx("h1",{className:"max-w-full text-center text-[22px] font-medium tracking-tight leading-snug text-foreground mb-5 break-words",children:ft}),o.jsx(Mn,{parentTask:n,projects:dt,providers:Tt,isProvidersLoading:D,onSubmit:ue,defaultProjectId:_e,defaultProviderId:It,onProjectChange:nt,createStep:p},n?.id??"root")]})]}):E&&G?o.jsxs(o.Fragment,{children:[o.jsx(u.Suspense,{fallback:o.jsx("div",{className:"flex h-dvh",children:o.jsx(sr,{})}),children:o.jsx(va,{task:G,onSelectTask:ve,onCreateSubtask:Ae,onBack:()=>h(null),onDeleteTask:G.projectArchivedAt?void 0:He,onTaskPriorityChange:G.projectArchivedAt?void 0:Ze,isDeleting:Ce.isPending,autoStartState:x[G.id]??null,onAutoStartRecovered:Ye})}),o.jsx(un,{isOpen:d,onClose:Fe})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-col h-dvh bg-sidebar overflow-hidden text-sm",children:[o.jsxs("header",{className:"h-12 bg-sidebar flex items-center px-4 justify-between shrink-0 z-20",children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Pn,{}),o.jsx(or,{projects:w,filterProjectId:z,setFilterProjectId:s,onCreateProject:ke})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(nr,{}),o.jsx("button",{onClick:()=>Tn.getState().openSettings(),className:"p-1.5 text-muted-foreground active:text-foreground rounded-md",children:o.jsx(An,{size:16})})]})]}),o.jsx(Zn,{tasks:L,projects:w,selectedTaskId:null,onSelectTask:ve,onCreateSubtask:Ae,selectedParentTaskId:G?.parentTaskId,filterProjectId:z,setFilterProjectId:s,width:"100%",onDeleteTask:He,onCreateTask:pe,onCreateProject:ke,onTaskStatusChange:Je,onTaskPriorityChange:Ze,isLoading:Re&&L.length===0})]}),o.jsx(un,{isOpen:d,onClose:Fe})]}):o.jsxs("div",{ref:R,className:"flex flex-col h-screen bg-sidebar overflow-hidden text-sm",children:[o.jsxs("header",{className:ce("h-12 bg-sidebar flex items-center px-4 justify-between flex-shrink-0 z-20 relative",le&&"app-region-drag",ye&&"pr-[150px]"),children:[o.jsxs("div",{className:ce("flex items-center gap-2 min-w-0",Pe&&"pl-[72px]"),children:[o.jsx(Pn,{}),o.jsx(or,{projects:w,filterProjectId:z,setFilterProjectId:s,onCreateProject:ke,className:le?"app-region-no-drag":void 0})]}),o.jsxs("div",{className:ce("flex items-center gap-1",le&&"app-region-no-drag"),children:[o.jsx("div",{className:le?"app-region-no-drag":void 0,children:o.jsx(nr,{})}),o.jsx("button",{onClick:()=>Tn.getState().openSettings(),className:ce("p-1.5 text-muted-foreground hover:text-foreground hover:bg-accent rounded-md transition-colors",le&&"app-region-no-drag"),children:o.jsx(An,{size:16})})]})]}),o.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[o.jsx(Zn,{tasks:L,projects:w,selectedTaskId:E,onSelectTask:ve,onCreateSubtask:Ae,selectedParentTaskId:G?.parentTaskId,filterProjectId:z,setFilterProjectId:s,width:i,onCreateTask:Ke,onCreateProject:ke,isCreateActive:!E,onTaskStatusChange:Je,onDeleteTask:He,onTaskPriorityChange:Ze,isLoading:Re&&L.length===0}),o.jsx("div",{onMouseDown:Jt,className:"w-1 cursor-col-resize hover:bg-border active:bg-ring/40 transition-colors z-50 -ml-[2px] flex-shrink-0 h-full",title:e("Drag to resize")}),o.jsx("div",{className:"flex-1 flex min-w-0 mb-2 mr-2 rounded-xl border border-border/50 bg-background overflow-hidden",children:E&&G?o.jsx(u.Suspense,{fallback:o.jsx(sr,{}),children:o.jsx(pa,{task:G,onSelectTask:ve,onCreateSubtask:Ae,onDeleteTask:G.projectArchivedAt?void 0:He,isDeleting:Ce.isPending,onTaskStatusChange:G.projectArchivedAt?void 0:Je,onTaskPriorityChange:G.projectArchivedAt?void 0:Ze,autoStartState:x[G.id]??null,onAutoStartRecovered:Ye})}):E&&!G?o.jsx("div",{className:"flex-1 flex items-center justify-center bg-background min-w-0",children:o.jsx("span",{className:"text-sm text-muted-foreground",children:e("Loading...")})}):o.jsx("div",{className:"flex-1 flex flex-col items-center justify-center bg-background min-w-0 px-8 pb-[10vh]",children:o.jsxs("div",{className:"w-full max-w-2xl flex flex-col items-center animate-[fadeInUp_0.5s_cubic-bezier(0.16,1,0.3,1)]",children:[o.jsx("h1",{className:"max-w-full text-center text-[26px] font-medium tracking-tight leading-snug text-foreground mb-6 break-words",children:ft}),o.jsx(Mn,{parentTask:n,projects:dt,providers:Tt,isProvidersLoading:D,onSubmit:et,defaultProjectId:_e,defaultProviderId:It,onProjectChange:nt,createStep:p},n?.id??"root")]})})})]}),o.jsx(un,{isOpen:d,onClose:Fe})]})}const Wa=Object.freeze(Object.defineProperty({__proto__:null,ProjectKanbanPage:Ca},Symbol.toStringTag,{value:"Module"}));export{Li as D,Gs as L,Wa as P,zi as a,_r as g,qn as m,Qs as t};
|