@a5c-ai/agent-mux-webui 0.4.10-staging.7a8768ec
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/README.md +60 -0
- package/dist/assets/index-DfHuDOVv.js +84 -0
- package/dist/assets/index-DfHuDOVv.js.map +1 -0
- package/dist/assets/index-zUqQIz-I.css +1 -0
- package/dist/favicon.svg +5 -0
- package/dist/index.html +44 -0
- package/dist-types/src/App.d.ts +1 -0
- package/dist-types/src/App.d.ts.map +1 -0
- package/dist-types/src/kanban/app/actions/approve-breakpoint.d.ts +5 -0
- package/dist-types/src/kanban/app/actions/approve-breakpoint.d.ts.map +1 -0
- package/dist-types/src/kanban/components/agent-mux/gateway-provider.d.ts +1 -0
- package/dist-types/src/kanban/components/agent-mux/gateway-provider.d.ts.map +1 -0
- package/dist-types/src/kanban/components/agent-mux/gateway-snapshot.d.ts +13 -0
- package/dist-types/src/kanban/components/agent-mux/gateway-snapshot.d.ts.map +1 -0
- package/dist-types/src/kanban/components/agent-mux/require-gateway-auth.d.ts +5 -0
- package/dist-types/src/kanban/components/agent-mux/require-gateway-auth.d.ts.map +1 -0
- package/dist-types/src/kanban/components/automations/automations-page.d.ts +1 -0
- package/dist-types/src/kanban/components/automations/automations-page.d.ts.map +1 -0
- package/dist-types/src/kanban/components/breakpoint/breakpoint-approval.d.ts +7 -0
- package/dist-types/src/kanban/components/breakpoint/breakpoint-approval.d.ts.map +1 -0
- package/dist-types/src/kanban/components/breakpoint/breakpoint-panel.d.ts +7 -0
- package/dist-types/src/kanban/components/breakpoint/breakpoint-panel.d.ts.map +1 -0
- package/dist-types/src/kanban/components/breakpoint/file-preview.d.ts +8 -0
- package/dist-types/src/kanban/components/breakpoint/file-preview.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/babysitter-overlay-panel.d.ts +1 -0
- package/dist-types/src/kanban/components/dashboard/babysitter-overlay-panel.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/backlog-overview.d.ts +12 -0
- package/dist-types/src/kanban/components/dashboard/backlog-overview.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/breakpoint-banner.d.ts +6 -0
- package/dist-types/src/kanban/components/dashboard/breakpoint-banner.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/catch-up-banner.d.ts +19 -0
- package/dist-types/src/kanban/components/dashboard/catch-up-banner.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/executive-summary-banner.d.ts +17 -0
- package/dist-types/src/kanban/components/dashboard/executive-summary-banner.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/global-search.d.ts +1 -0
- package/dist-types/src/kanban/components/dashboard/global-search.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/kpi-grid.d.ts +8 -0
- package/dist-types/src/kanban/components/dashboard/kpi-grid.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/pagination-controls.d.ts +9 -0
- package/dist-types/src/kanban/components/dashboard/pagination-controls.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/project-accordion.d.ts +8 -0
- package/dist-types/src/kanban/components/dashboard/project-accordion.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/project-health-card.d.ts +9 -0
- package/dist-types/src/kanban/components/dashboard/project-health-card.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/project-list-view.d.ts +16 -0
- package/dist-types/src/kanban/components/dashboard/project-list-view.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/project-search-input.d.ts +8 -0
- package/dist-types/src/kanban/components/dashboard/project-search-input.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/project-section-header.d.ts +11 -0
- package/dist-types/src/kanban/components/dashboard/project-section-header.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/project-section.d.ts +11 -0
- package/dist-types/src/kanban/components/dashboard/project-section.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/run-card.d.ts +7 -0
- package/dist-types/src/kanban/components/dashboard/run-card.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/run-filter-bar.d.ts +10 -0
- package/dist-types/src/kanban/components/dashboard/run-filter-bar.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/run-list.d.ts +8 -0
- package/dist-types/src/kanban/components/dashboard/run-list.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/search-filter.d.ts +12 -0
- package/dist-types/src/kanban/components/dashboard/search-filter.d.ts.map +1 -0
- package/dist-types/src/kanban/components/dashboard/virtualized-run-list.d.ts +23 -0
- package/dist-types/src/kanban/components/dashboard/virtualized-run-list.d.ts.map +1 -0
- package/dist-types/src/kanban/components/details/agent-panel.d.ts +8 -0
- package/dist-types/src/kanban/components/details/agent-panel.d.ts.map +1 -0
- package/dist-types/src/kanban/components/details/json-tree/categorize.d.ts +26 -0
- package/dist-types/src/kanban/components/details/json-tree/categorize.d.ts.map +1 -0
- package/dist-types/src/kanban/components/details/json-tree/index.d.ts +10 -0
- package/dist-types/src/kanban/components/details/json-tree/index.d.ts.map +1 -0
- package/dist-types/src/kanban/components/details/json-tree/json-node.d.ts +25 -0
- package/dist-types/src/kanban/components/details/json-tree/json-node.d.ts.map +1 -0
- package/dist-types/src/kanban/components/details/json-tree/smart-summary.d.ts +54 -0
- package/dist-types/src/kanban/components/details/json-tree/smart-summary.d.ts.map +1 -0
- package/dist-types/src/kanban/components/details/json-tree/tree-controls.d.ts +7 -0
- package/dist-types/src/kanban/components/details/json-tree/tree-controls.d.ts.map +1 -0
- package/dist-types/src/kanban/components/details/json-tree.d.ts +9 -0
- package/dist-types/src/kanban/components/details/json-tree.d.ts.map +1 -0
- package/dist-types/src/kanban/components/details/log-viewer.d.ts +4 -0
- package/dist-types/src/kanban/components/details/log-viewer.d.ts.map +1 -0
- package/dist-types/src/kanban/components/details/task-detail.d.ts +14 -0
- package/dist-types/src/kanban/components/details/task-detail.d.ts.map +1 -0
- package/dist-types/src/kanban/components/details/timing-panel.d.ts +9 -0
- package/dist-types/src/kanban/components/details/timing-panel.d.ts.map +1 -0
- package/dist-types/src/kanban/components/events/event-item.d.ts +7 -0
- package/dist-types/src/kanban/components/events/event-item.d.ts.map +1 -0
- package/dist-types/src/kanban/components/events/event-stream.d.ts +7 -0
- package/dist-types/src/kanban/components/events/event-stream.d.ts.map +1 -0
- package/dist-types/src/kanban/components/notifications/notification-panel.d.ts +9 -0
- package/dist-types/src/kanban/components/notifications/notification-panel.d.ts.map +1 -0
- package/dist-types/src/kanban/components/notifications/notification-provider.d.ts +19 -0
- package/dist-types/src/kanban/components/notifications/notification-provider.d.ts.map +1 -0
- package/dist-types/src/kanban/components/notifications/toast-stack.d.ts +7 -0
- package/dist-types/src/kanban/components/notifications/toast-stack.d.ts.map +1 -0
- package/dist-types/src/kanban/components/pipeline/parallel-group.d.ts +13 -0
- package/dist-types/src/kanban/components/pipeline/parallel-group.d.ts.map +1 -0
- package/dist-types/src/kanban/components/pipeline/pipeline-view.d.ts +9 -0
- package/dist-types/src/kanban/components/pipeline/pipeline-view.d.ts.map +1 -0
- package/dist-types/src/kanban/components/pipeline/step-card.d.ts +12 -0
- package/dist-types/src/kanban/components/pipeline/step-card.d.ts.map +1 -0
- package/dist-types/src/kanban/components/providers/event-stream-provider.d.ts +11 -0
- package/dist-types/src/kanban/components/providers/event-stream-provider.d.ts.map +1 -0
- package/dist-types/src/kanban/components/providers.d.ts +3 -0
- package/dist-types/src/kanban/components/providers.d.ts.map +1 -0
- package/dist-types/src/kanban/components/review/review-panel.d.ts +26 -0
- package/dist-types/src/kanban/components/review/review-panel.d.ts.map +1 -0
- package/dist-types/src/kanban/components/runs/run-realtime-execution-panel.d.ts +4 -0
- package/dist-types/src/kanban/components/runs/run-realtime-execution-panel.d.ts.map +1 -0
- package/dist-types/src/kanban/components/sessions/session-conversation-surface.d.ts +33 -0
- package/dist-types/src/kanban/components/sessions/session-conversation-surface.d.ts.map +1 -0
- package/dist-types/src/kanban/components/sessions/session-observability-panel.d.ts +12 -0
- package/dist-types/src/kanban/components/sessions/session-observability-panel.d.ts.map +1 -0
- package/dist-types/src/kanban/components/sessions/session-workspace-shell.d.ts +27 -0
- package/dist-types/src/kanban/components/sessions/session-workspace-shell.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/app-footer.d.ts +1 -0
- package/dist-types/src/kanban/components/shared/app-footer.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/app-header-nav.d.ts +29 -0
- package/dist-types/src/kanban/components/shared/app-header-nav.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/app-header.d.ts +2 -0
- package/dist-types/src/kanban/components/shared/app-header.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/dialog-shell.d.ts +8 -0
- package/dist-types/src/kanban/components/shared/dialog-shell.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/dispatch-context-audit-panel.d.ts +7 -0
- package/dist-types/src/kanban/components/shared/dispatch-context-audit-panel.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/empty-state.d.ts +8 -0
- package/dist-types/src/kanban/components/shared/empty-state.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/error-boundary.d.ts +18 -0
- package/dist-types/src/kanban/components/shared/error-boundary.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/execution-context-panel.d.ts +8 -0
- package/dist-types/src/kanban/components/shared/execution-context-panel.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/friendly-id.d.ts +6 -0
- package/dist-types/src/kanban/components/shared/friendly-id.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/kbd.d.ts +4 -0
- package/dist-types/src/kanban/components/shared/kbd.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/kind-badge.d.ts +5 -0
- package/dist-types/src/kanban/components/shared/kind-badge.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/metrics-row.d.ts +6 -0
- package/dist-types/src/kanban/components/shared/metrics-row.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/outcome-banner.d.ts +6 -0
- package/dist-types/src/kanban/components/shared/outcome-banner.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/page-shell.d.ts +17 -0
- package/dist-types/src/kanban/components/shared/page-shell.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/progress-bar.d.ts +9 -0
- package/dist-types/src/kanban/components/shared/progress-bar.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/session-pill.d.ts +7 -0
- package/dist-types/src/kanban/components/shared/session-pill.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/settings-modal.d.ts +6 -0
- package/dist-types/src/kanban/components/shared/settings-modal.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/shortcuts-help.d.ts +8 -0
- package/dist-types/src/kanban/components/shared/shortcuts-help.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/status-badge.d.ts +9 -0
- package/dist-types/src/kanban/components/shared/status-badge.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/theme-provider.d.ts +10 -0
- package/dist-types/src/kanban/components/shared/theme-provider.d.ts.map +1 -0
- package/dist-types/src/kanban/components/shared/truncated-id.d.ts +7 -0
- package/dist-types/src/kanban/components/shared/truncated-id.d.ts.map +1 -0
- package/dist-types/src/kanban/components/task-tags/task-tag-autocomplete-textarea.d.ts +13 -0
- package/dist-types/src/kanban/components/task-tags/task-tag-autocomplete-textarea.d.ts.map +1 -0
- package/dist-types/src/kanban/components/ui/accordion.d.ts +24 -0
- package/dist-types/src/kanban/components/ui/accordion.d.ts.map +1 -0
- package/dist-types/src/kanban/components/ui/badge.d.ts +8 -0
- package/dist-types/src/kanban/components/ui/badge.d.ts.map +1 -0
- package/dist-types/src/kanban/components/ui/button.d.ts +11 -0
- package/dist-types/src/kanban/components/ui/button.d.ts.map +1 -0
- package/dist-types/src/kanban/components/ui/card.d.ts +3 -0
- package/dist-types/src/kanban/components/ui/card.d.ts.map +1 -0
- package/dist-types/src/kanban/components/ui/scroll-area.d.ts +7 -0
- package/dist-types/src/kanban/components/ui/scroll-area.d.ts.map +1 -0
- package/dist-types/src/kanban/components/ui/separator.d.ts +4 -0
- package/dist-types/src/kanban/components/ui/separator.d.ts.map +1 -0
- package/dist-types/src/kanban/components/ui/tabs.d.ts +25 -0
- package/dist-types/src/kanban/components/ui/tabs.d.ts.map +1 -0
- package/dist-types/src/kanban/components/ui/tooltip.d.ts +18 -0
- package/dist-types/src/kanban/components/ui/tooltip.d.ts.map +1 -0
- package/dist-types/src/kanban/components/workspaces/workspace-detail-shell.d.ts +50 -0
- package/dist-types/src/kanban/components/workspaces/workspace-detail-shell.d.ts.map +1 -0
- package/dist-types/src/kanban/components/workspaces/workspace-details-sidebar.d.ts +37 -0
- package/dist-types/src/kanban/components/workspaces/workspace-details-sidebar.d.ts.map +1 -0
- package/dist-types/src/kanban/components/workspaces/workspace-provisioning-page.d.ts +7 -0
- package/dist-types/src/kanban/components/workspaces/workspace-provisioning-page.d.ts.map +1 -0
- package/dist-types/src/kanban/components/workspaces/workspace-runtime-panel.d.ts +12 -0
- package/dist-types/src/kanban/components/workspaces/workspace-runtime-panel.d.ts.map +1 -0
- package/dist-types/src/kanban/components/workspaces/workspaces-page.d.ts +27 -0
- package/dist-types/src/kanban/components/workspaces/workspaces-page.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-animated-number.d.ts +9 -0
- package/dist-types/src/kanban/hooks/use-animated-number.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-backlog.d.ts +192 -0
- package/dist-types/src/kanban/hooks/use-backlog.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-batched-updates.d.ts +34 -0
- package/dist-types/src/kanban/hooks/use-batched-updates.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-event-stream.d.ts +16 -0
- package/dist-types/src/kanban/hooks/use-event-stream.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-keyboard.d.ts +8 -0
- package/dist-types/src/kanban/hooks/use-keyboard.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-notifications.d.ts +20 -0
- package/dist-types/src/kanban/hooks/use-notifications.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-persisted-state.d.ts +10 -0
- package/dist-types/src/kanban/hooks/use-persisted-state.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-polling.d.ts +11 -0
- package/dist-types/src/kanban/hooks/use-polling.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-project-runs.d.ts +17 -0
- package/dist-types/src/kanban/hooks/use-project-runs.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-projects.d.ts +8 -0
- package/dist-types/src/kanban/hooks/use-projects.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-reviews.d.ts +111 -0
- package/dist-types/src/kanban/hooks/use-reviews.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-run-dashboard.d.ts +42 -0
- package/dist-types/src/kanban/hooks/use-run-dashboard.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-run-detail.d.ts +12 -0
- package/dist-types/src/kanban/hooks/use-run-detail.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-smart-polling.d.ts +15 -0
- package/dist-types/src/kanban/hooks/use-smart-polling.d.ts.map +1 -0
- package/dist-types/src/kanban/hooks/use-task-tags.d.ts +6 -0
- package/dist-types/src/kanban/hooks/use-task-tags.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/agent-mux-ui.d.ts +2 -0
- package/dist-types/src/kanban/lib/agent-mux-ui.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/babysitter-overlays.d.ts +74 -0
- package/dist-types/src/kanban/lib/babysitter-overlays.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/cn.d.ts +2 -0
- package/dist-types/src/kanban/lib/cn.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/config-loader.d.ts +29 -0
- package/dist-types/src/kanban/lib/config-loader.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/config.d.ts +3 -0
- package/dist-types/src/kanban/lib/config.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/dispatch-context-audit.d.ts +12 -0
- package/dist-types/src/kanban/lib/dispatch-context-audit.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/error-handler.d.ts +28 -0
- package/dist-types/src/kanban/lib/error-handler.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/fetcher.d.ts +70 -0
- package/dist-types/src/kanban/lib/fetcher.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/gateway-runtime-config.d.ts +24 -0
- package/dist-types/src/kanban/lib/gateway-runtime-config.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/global-registry.d.ts +71 -0
- package/dist-types/src/kanban/lib/global-registry.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/parser.d.ts +36 -0
- package/dist-types/src/kanban/lib/parser.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/path-resolver.d.ts +2 -0
- package/dist-types/src/kanban/lib/path-resolver.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/review-service.d.ts +63 -0
- package/dist-types/src/kanban/lib/review-service.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/run-cache.d.ts +36 -0
- package/dist-types/src/kanban/lib/run-cache.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/server-init.d.ts +26 -0
- package/dist-types/src/kanban/lib/server-init.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/services/automation-rule-service.d.ts +97 -0
- package/dist-types/src/kanban/lib/services/automation-rule-service.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/services/automation-webhook-service.d.ts +44 -0
- package/dist-types/src/kanban/lib/services/automation-webhook-service.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/services/backlog-query-service.d.ts +124 -0
- package/dist-types/src/kanban/lib/services/backlog-query-service.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/services/dispatch-context-label-service.d.ts +39 -0
- package/dist-types/src/kanban/lib/services/dispatch-context-label-service.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/services/kanban-storage.d.ts +36 -0
- package/dist-types/src/kanban/lib/services/kanban-storage.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/services/run-query-service.d.ts +79 -0
- package/dist-types/src/kanban/lib/services/run-query-service.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/services/task-tag-service.d.ts +39 -0
- package/dist-types/src/kanban/lib/services/task-tag-service.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/settings-section-storage.d.ts +13 -0
- package/dist-types/src/kanban/lib/settings-section-storage.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/source-discovery.d.ts +10 -0
- package/dist-types/src/kanban/lib/source-discovery.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/utils.d.ts +8 -0
- package/dist-types/src/kanban/lib/utils.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/watcher.d.ts +14 -0
- package/dist-types/src/kanban/lib/watcher.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/workspace-layout-state.d.ts +20 -0
- package/dist-types/src/kanban/lib/workspace-layout-state.d.ts.map +1 -0
- package/dist-types/src/kanban/lib/workspace-lifecycle.d.ts +67 -0
- package/dist-types/src/kanban/lib/workspace-lifecycle.d.ts.map +1 -0
- package/dist-types/src/kanban/routes/AutomationsPage.d.ts +1 -0
- package/dist-types/src/kanban/routes/AutomationsPage.d.ts.map +1 -0
- package/dist-types/src/kanban/routes/ProjectsPage.d.ts +1 -0
- package/dist-types/src/kanban/routes/ProjectsPage.d.ts.map +1 -0
- package/dist-types/src/kanban/routes/SettingsPage.d.ts +1 -0
- package/dist-types/src/kanban/routes/SettingsPage.d.ts.map +1 -0
- package/dist-types/src/kanban/test/fixtures.d.ts +99 -0
- package/dist-types/src/kanban/test/fixtures.d.ts.map +1 -0
- package/dist-types/src/kanban/test/setup.d.ts +1 -0
- package/dist-types/src/kanban/test/setup.d.ts.map +1 -0
- package/dist-types/src/kanban/test/test-utils.d.ts +8 -0
- package/dist-types/src/kanban/test/test-utils.d.ts.map +1 -0
- package/dist-types/src/kanban/types/breakpoint.d.ts +13 -0
- package/dist-types/src/kanban/types/breakpoint.d.ts.map +1 -0
- package/dist-types/src/kanban/types/index.d.ts +173 -0
- package/dist-types/src/kanban/types/index.d.ts.map +1 -0
- package/dist-types/src/kanban-shims/next-link.d.ts +5 -0
- package/dist-types/src/kanban-shims/next-link.d.ts.map +1 -0
- package/dist-types/src/kanban-shims/next-navigation.d.ts +11 -0
- package/dist-types/src/kanban-shims/next-navigation.d.ts.map +1 -0
- package/dist-types/src/main.d.ts +3 -0
- package/dist-types/src/main.d.ts.map +1 -0
- package/dist-types/src/pages/AgentsPage.d.ts +1 -0
- package/dist-types/src/pages/AgentsPage.d.ts.map +1 -0
- package/dist-types/src/pages/HomePage.d.ts +1 -0
- package/dist-types/src/pages/HomePage.d.ts.map +1 -0
- package/dist-types/src/pages/HookInboxPage.d.ts +1 -0
- package/dist-types/src/pages/HookInboxPage.d.ts.map +1 -0
- package/dist-types/src/pages/KanbanLayout.d.ts +1 -0
- package/dist-types/src/pages/KanbanLayout.d.ts.map +1 -0
- package/dist-types/src/pages/KanbanPages.d.ts +14 -0
- package/dist-types/src/pages/KanbanPages.d.ts.map +1 -0
- package/dist-types/src/pages/LoginPage.d.ts +1 -0
- package/dist-types/src/pages/LoginPage.d.ts.map +1 -0
- package/dist-types/src/pages/NewRunPage.d.ts +1 -0
- package/dist-types/src/pages/NewRunPage.d.ts.map +1 -0
- package/dist-types/src/pages/PairDevicePage.d.ts +1 -0
- package/dist-types/src/pages/PairDevicePage.d.ts.map +1 -0
- package/dist-types/src/pages/RunPage.d.ts +1 -0
- package/dist-types/src/pages/RunPage.d.ts.map +1 -0
- package/dist-types/src/pages/SessionDetailPage.d.ts +1 -0
- package/dist-types/src/pages/SessionDetailPage.d.ts.map +1 -0
- package/dist-types/src/pages/SessionsPage.d.ts +1 -0
- package/dist-types/src/pages/SessionsPage.d.ts.map +1 -0
- package/dist-types/src/pages/SettingsPage.d.ts +1 -0
- package/dist-types/src/pages/SettingsPage.d.ts.map +1 -0
- package/dist-types/src/pages/WorkspacesPage.d.ts +1 -0
- package/dist-types/src/pages/WorkspacesPage.d.ts.map +1 -0
- package/dist-types/src/providers/GatewayProvider.d.ts +17 -0
- package/dist-types/src/providers/GatewayProvider.d.ts.map +1 -0
- package/dist-types/src/providers/NotificationProvider.d.ts +4 -0
- package/dist-types/src/providers/NotificationProvider.d.ts.map +1 -0
- package/dist-types/src/providers/ThemeProvider.d.ts +10 -0
- package/dist-types/src/providers/ThemeProvider.d.ts.map +1 -0
- package/dist-types/src/router.d.ts +1 -0
- package/dist-types/src/router.d.ts.map +1 -0
- package/dist-types/src/shell/CommandPalette.d.ts +10 -0
- package/dist-types/src/shell/CommandPalette.d.ts.map +1 -0
- package/dist-types/src/shell/Sidebar.d.ts +1 -0
- package/dist-types/src/shell/Sidebar.d.ts.map +1 -0
- package/dist-types/src/shell/TopBar.d.ts +4 -0
- package/dist-types/src/shell/TopBar.d.ts.map +1 -0
- package/dist-types/src/shell/navigation.d.ts +14 -0
- package/dist-types/src/shell/navigation.d.ts.map +1 -0
- package/dist-types/src/web-only/clipboard.d.ts +1 -0
- package/dist-types/src/web-only/clipboard.d.ts.map +1 -0
- package/dist-types/src/web-only/desktop-notifications.d.ts +6 -0
- package/dist-types/src/web-only/desktop-notifications.d.ts.map +1 -0
- package/dist-types/src/web-only/keyboard.d.ts +3 -0
- package/dist-types/src/web-only/keyboard.d.ts.map +1 -0
- package/dist-types/tsconfig.tsbuildinfo +1 -0
- package/dist-types/vite.config.d.ts +2 -0
- package/dist-types/vite.config.d.ts.map +1 -0
- package/package.json +80 -0
- package/public/favicon.svg +5 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=s((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P={current:null},F={transition:null},I={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:F,ReactCurrentOwner:C};e.Children={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=F.transition;F.transition={};try{e()}finally{F.transition=t}},e.unstable_act=function(){throw Error(`act(...) is not supported in production builds of React.`)},e.useCallback=function(e,t){return P.current.useCallback(e,t)},e.useContext=function(e){return P.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return P.current.useDeferredValue(e)},e.useEffect=function(e,t){return P.current.useEffect(e,t)},e.useId=function(){return P.current.useId()},e.useImperativeHandle=function(e,t,n){return P.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return P.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return P.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return P.current.useMemo(e,t)},e.useReducer=function(e,t,n){return P.current.useReducer(e,t,n)},e.useRef=function(e){return P.current.useRef(e)},e.useState=function(e){return P.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return P.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return P.current.useTransition()},e.version=`18.2.0`})),p=s(((e,t)=>{t.exports=f()})),m=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function N(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,M(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),h=s(((e,t)=>{t.exports=m()})),g=s((e=>{var t=p(),n=h();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},f={};function m(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(_(t,n,i,r)&&(n=null),r||i===null?m(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),k=Symbol.for(`react.provider`),A=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),M=Symbol.for(`react.suspense`),N=Symbol.for(`react.suspense_list`),P=Symbol.for(`react.memo`),F=Symbol.for(`react.lazy`),I=Symbol.for(`react.offscreen`),L=Symbol.iterator;function R(e){return typeof e!=`object`||!e?null:(e=L&&e[L]||e[`@@iterator`],typeof e==`function`?e:null)}var z=Object.assign,ee;function te(e){if(ee===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ee=t&&t[1]||``}return`
|
|
2
|
+
`+ee+e}var ne=!1;function re(e,t){if(!e||ne)return``;ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
|
3
|
+
`),a=r.stack.split(`
|
|
4
|
+
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
|
5
|
+
`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{ne=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?te(e):``}function ie(e){switch(e.tag){case 5:return te(e.type);case 16:return te(`Lazy`);case 13:return te(`Suspense`);case 19:return te(`SuspenseList`);case 0:case 2:case 15:return e=re(e.type,!1),e;case 11:return e=re(e.type.render,!1),e;case 1:return e=re(e.type,!0),e;default:return``}}function ae(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}function oe(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return ae(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function se(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function ce(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function le(e){var t=ce(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ue(e){e._valueTracker||=le(e)}function de(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=ce(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function fe(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function pe(e,t){var n=t.checked;return z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function me(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=se(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function he(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function ge(e,t){he(e,t);var n=se(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?ve(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&ve(e,t.type,se(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _e(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function ve(e,t,n){(t!==`number`||fe(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var ye=Array.isArray;function be(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+se(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function xe(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return z({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function B(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(ye(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:se(n)}}function Se(e,t){var n=se(t.value),r=se(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function Ce(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function we(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function Te(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?we(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var Ee,V=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(Ee||=document.createElement(`div`),Ee.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=Ee.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function De(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Oe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ke=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Oe).forEach(function(e){ke.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Oe[t]=Oe[e]})});function Ae(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Oe.hasOwnProperty(e)&&Oe[e]?(``+t).trim():t+`px`}function je(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Ae(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Me=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ne(e,t){if(t){if(Me[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Pe(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Fe=null;function Ie(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Le=null,Re=null,ze=null;function Be(e){if(e=Ii(e)){if(typeof Le!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ri(t),Le(e.stateNode,e.type,t))}}function Ve(e){Re?ze?ze.push(e):ze=[e]:Re=e}function He(){if(Re){var e=Re,t=ze;if(ze=Re=null,Be(e),t)for(e=0;e<t.length;e++)Be(t[e])}}function Ue(e,t){return e(t)}function We(){}var Ge=!1;function Ke(e,t,n){if(Ge)return e(t,n);Ge=!0;try{return Ue(e,t,n)}finally{Ge=!1,(Re!==null||ze!==null)&&(We(),He())}}function qe(e,t){var n=e.stateNode;if(n===null)return null;var i=Ri(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var Je=!1;if(c)try{var Ye={};Object.defineProperty(Ye,`passive`,{get:function(){Je=!0}}),window.addEventListener(`test`,Ye,Ye),window.removeEventListener(`test`,Ye,Ye)}catch{Je=!1}function H(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var Xe=!1,Ze=null,Qe=!1,$e=null,et={onError:function(e){Xe=!0,Ze=e}};function tt(e,t,n,r,i,a,o,s,c){Xe=!1,Ze=null,H.apply(et,arguments)}function nt(e,t,n,i,a,o,s,c,l){if(tt.apply(this,arguments),Xe){if(Xe){var u=Ze;Xe=!1,Ze=null}else throw Error(r(198));Qe||(Qe=!0,$e=u)}}function rt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function it(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function U(e){if(rt(e)!==e)throw Error(r(188))}function at(e){var t=e.alternate;if(!t){if(t=rt(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return U(a),e;if(o===i)return U(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function ot(e){return e=at(e),e===null?null:st(e)}function st(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=st(e);if(t!==null)return t;e=e.sibling}return null}var ct=n.unstable_scheduleCallback,W=n.unstable_cancelCallback,lt=n.unstable_shouldYield,ut=n.unstable_requestPaint,dt=n.unstable_now,ft=n.unstable_getCurrentPriorityLevel,pt=n.unstable_ImmediatePriority,mt=n.unstable_UserBlockingPriority,ht=n.unstable_NormalPriority,gt=n.unstable_LowPriority,_t=n.unstable_IdlePriority,vt=null,yt=null;function bt(e){if(yt&&typeof yt.onCommitFiberRoot==`function`)try{yt.onCommitFiberRoot(vt,e,void 0,(e.current.flags&128)==128)}catch{}}var xt=Math.clz32?Math.clz32:wt,St=Math.log,Ct=Math.LN2;function wt(e){return e>>>=0,e===0?32:31-(St(e)/Ct|0)|0}var Tt=64,Et=4194304;function Dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ot(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Dt(a))):r=Dt(s)}else o=n&~i,o===0?a!==0&&(r=Dt(a)):r=Dt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-xt(t),i=1<<n,r|=e[n],t&=~i;return r}function kt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function At(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-xt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=kt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function jt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Mt(){var e=Tt;return Tt<<=1,!(Tt&4194240)&&(Tt=64),e}function Nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Pt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-xt(t),e[t]=n}function Ft(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-xt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function It(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-xt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Lt=0;function Rt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zt,Bt,Vt,Ht,Ut,Wt=!1,Gt=[],Kt=null,qt=null,Jt=null,Yt=new Map,Xt=new Map,Zt=[],Qt=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit`.split(` `);function $t(e,t){switch(e){case`focusin`:case`focusout`:Kt=null;break;case`dragenter`:case`dragleave`:qt=null;break;case`mouseover`:case`mouseout`:Jt=null;break;case`pointerover`:case`pointerout`:Yt.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Xt.delete(t.pointerId)}}function en(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ii(t),t!==null&&Bt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function tn(e,t,n,r,i){switch(t){case`focusin`:return Kt=en(Kt,e,t,n,r,i),!0;case`dragenter`:return qt=en(qt,e,t,n,r,i),!0;case`mouseover`:return Jt=en(Jt,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Yt.set(a,en(Yt.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Xt.set(a,en(Xt.get(a)||null,e,t,n,r,i)),!0}return!1}function G(e){var t=Fi(e.target);if(t!==null){var n=rt(t);if(n!==null){if(t=n.tag,t===13){if(t=it(n),t!==null){e.blockedOn=t,Ut(e.priority,function(){Vt(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function nn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=mn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Fe=r,n.target.dispatchEvent(r),Fe=null}else return t=Ii(n),t!==null&&Bt(t),e.blockedOn=n,!1;t.shift()}return!0}function rn(e,t,n){nn(e)&&n.delete(t)}function an(){Wt=!1,Kt!==null&&nn(Kt)&&(Kt=null),qt!==null&&nn(qt)&&(qt=null),Jt!==null&&nn(Jt)&&(Jt=null),Yt.forEach(rn),Xt.forEach(rn)}function on(e,t){e.blockedOn===t&&(e.blockedOn=null,Wt||(Wt=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,an)))}function sn(e){function t(t){return on(t,e)}if(0<Gt.length){on(Gt[0],e);for(var n=1;n<Gt.length;n++){var r=Gt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Kt!==null&&on(Kt,e),qt!==null&&on(qt,e),Jt!==null&&on(Jt,e),Yt.forEach(t),Xt.forEach(t),n=0;n<Zt.length;n++)r=Zt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Zt.length&&(n=Zt[0],n.blockedOn===null);)G(n),n.blockedOn===null&&Zt.shift()}var cn=C.ReactCurrentBatchConfig,ln=!0;function un(e,t,n,r){var i=Lt,a=cn.transition;cn.transition=null;try{Lt=1,fn(e,t,n,r)}finally{Lt=i,cn.transition=a}}function dn(e,t,n,r){var i=Lt,a=cn.transition;cn.transition=null;try{Lt=4,fn(e,t,n,r)}finally{Lt=i,cn.transition=a}}function fn(e,t,n,r){if(ln){var i=mn(e,t,n,r);if(i===null)si(e,t,r,pn,n),$t(e,r);else if(tn(i,e,t,n,r))r.stopPropagation();else if($t(e,r),t&4&&-1<Qt.indexOf(e)){for(;i!==null;){var a=Ii(i);if(a!==null&&zt(a),a=mn(e,t,n,r),a===null&&si(e,t,r,pn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else si(e,t,r,null,n)}}var pn=null;function mn(e,t,n,r){if(pn=null,e=Ie(r),e=Fi(e),e!==null)if(t=rt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=it(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return pn=e,null}function hn(e){switch(e){case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 1;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(ft()){case pt:return 1;case mt:return 4;case ht:case gt:return 16;case _t:return 536870912;default:return 16}default:return 16}}var gn=null,_n=null,vn=null;function yn(){if(vn)return vn;var e,t=_n,n=t.length,r,i=`value`in gn?gn.value:gn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return vn=i.slice(e,1<r?1-r:void 0)}function bn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function xn(){return!0}function Sn(){return!1}function Cn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?xn:Sn,this.isPropagationStopped=Sn,this}return z(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=xn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=xn)},persist:function(){},isPersistent:xn}),t}var wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tn=Cn(wn),En=z({},wn,{view:0,detail:0}),Dn=Cn(En),K,On,kn,An=z({},En,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==kn&&(kn&&e.type===`mousemove`?(K=e.screenX-kn.screenX,On=e.screenY-kn.screenY):On=K=0,kn=e),K)},movementY:function(e){return`movementY`in e?e.movementY:On}}),jn=Cn(An),Mn=Cn(z({},An,{dataTransfer:0})),Nn=Cn(z({},En,{relatedTarget:0})),Pn=Cn(z({},wn,{animationName:0,elapsedTime:0,pseudoElement:0})),Fn=Cn(z({},wn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),In=Cn(z({},wn,{data:0})),Ln={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Rn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Bn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zn[e])?!!t[e]:!1}function Vn(){return Bn}var Hn=Cn(z({},En,{key:function(e){if(e.key){var t=Ln[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=bn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Rn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vn,charCode:function(e){return e.type===`keypress`?bn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?bn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Un=Cn(z({},An,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Wn=Cn(z({},En,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vn})),Gn=Cn(z({},wn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Kn=Cn(z({},An,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),qn=[9,13,27,32],Jn=c&&`CompositionEvent`in window,Yn=null;c&&`documentMode`in document&&(Yn=document.documentMode);var Xn=c&&`TextEvent`in window&&!Yn,Zn=c&&(!Jn||Yn&&8<Yn&&11>=Yn),Qn=` `,$n=!1;function er(e,t){switch(e){case`keyup`:return qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var nr=!1;function rr(e,t){switch(e){case`compositionend`:return tr(t);case`keypress`:return t.which===32?($n=!0,Qn):null;case`textInput`:return e=t.data,e===Qn&&$n?null:e;default:return null}}function ir(e,t){if(nr)return e===`compositionend`||!Jn&&er(e,t)?(e=yn(),vn=_n=gn=null,nr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Zn&&t.locale!==`ko`?null:t.data;default:return null}}var ar={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ar[e.type]:t===`textarea`}function sr(e,t,n,r){Ve(r),t=li(t,`onChange`),0<t.length&&(n=new Tn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var cr=null,lr=null;function ur(e){ti(e,0)}function dr(e){if(de(Li(e)))return e}function fr(e,t){if(e===`change`)return t}var pr=!1;if(c){var mr;if(c){var hr=`oninput`in document;if(!hr){var gr=document.createElement(`div`);gr.setAttribute(`oninput`,`return;`),hr=typeof gr.oninput==`function`}mr=hr}else mr=!1;pr=mr&&(!document.documentMode||9<document.documentMode)}function _r(){cr&&(cr.detachEvent(`onpropertychange`,vr),lr=cr=null)}function vr(e){if(e.propertyName===`value`&&dr(lr)){var t=[];sr(t,lr,e,Ie(e)),Ke(ur,t)}}function yr(e,t,n){e===`focusin`?(_r(),cr=t,lr=n,cr.attachEvent(`onpropertychange`,vr)):e===`focusout`&&_r()}function br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return dr(lr)}function xr(e,t){if(e===`click`)return dr(t)}function Sr(e,t){if(e===`input`||e===`change`)return dr(t)}function Cr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var wr=typeof Object.is==`function`?Object.is:Cr;function Tr(e,t){if(wr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!wr(e[i],t[i]))return!1}return!0}function Er(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dr(e,t){var n=Er(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Er(n)}}function Or(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Or(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kr(){for(var e=window,t=fe();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=fe(e.document)}return t}function Ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function jr(e){var t=kr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Or(n.ownerDocument.documentElement,n)){if(r!==null&&Ar(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Dr(n,a);var o=Dr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Mr=c&&`documentMode`in document&&11>=document.documentMode,Nr=null,Pr=null,Fr=null,Ir=!1;function Lr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ir||Nr==null||Nr!==fe(r)||(r=Nr,`selectionStart`in r&&Ar(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fr&&Tr(Fr,r)||(Fr=r,r=li(Pr,`onSelect`),0<r.length&&(t=new Tn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Nr)))}function Rr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var zr={animationend:Rr(`Animation`,`AnimationEnd`),animationiteration:Rr(`Animation`,`AnimationIteration`),animationstart:Rr(`Animation`,`AnimationStart`),transitionend:Rr(`Transition`,`TransitionEnd`)},Br={},Vr={};c&&(Vr=document.createElement(`div`).style,`AnimationEvent`in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),`TransitionEvent`in window||delete zr.transitionend.transition);function Hr(e){if(Br[e])return Br[e];if(!zr[e])return e;var t=zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vr)return Br[e]=t[n];return e}var Ur=Hr(`animationend`),Wr=Hr(`animationiteration`),Gr=Hr(`animationstart`),Kr=Hr(`transitionend`),qr=new Map,Jr=`abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);function Yr(e,t){qr.set(e,t),o(t,[e])}for(var Xr=0;Xr<Jr.length;Xr++){var Zr=Jr[Xr];Yr(Zr.toLowerCase(),`on`+(Zr[0].toUpperCase()+Zr.slice(1)))}Yr(Ur,`onAnimationEnd`),Yr(Wr,`onAnimationIteration`),Yr(Gr,`onAnimationStart`),Yr(`dblclick`,`onDoubleClick`),Yr(`focusin`,`onFocus`),Yr(`focusout`,`onBlur`),Yr(Kr,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`onPointerLeave`,[`pointerout`,`pointerover`]),o(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),o(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),o(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),o(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Qr=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),$r=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(Qr));function ei(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,nt(r,t,void 0,e),e.currentTarget=null}function ti(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;ei(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;ei(i,s,l),a=c}}}if(Qe)throw e=$e,Qe=!1,$e=null,e}function ni(e,t){var n=t[Mi];n===void 0&&(n=t[Mi]=new Set);var r=e+`__bubble`;n.has(r)||(oi(t,e,2,!1),n.add(r))}function ri(e,t,n){var r=0;t&&(r|=4),oi(n,e,r,t)}var ii=`_reactListening`+Math.random().toString(36).slice(2);function ai(e){if(!e[ii]){e[ii]=!0,i.forEach(function(t){t!==`selectionchange`&&($r.has(t)||ri(t,!1,e),ri(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ii]||(t[ii]=!0,ri(`selectionchange`,!1,t))}}function oi(e,t,n,r){switch(hn(t)){case 1:var i=un;break;case 4:i=dn;break;default:i=fn}n=i.bind(null,t,n,e),i=void 0,!Je||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function si(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Fi(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}Ke(function(){var r=a,i=Ie(n),o=[];a:{var s=qr.get(e);if(s!==void 0){var c=Tn,l=e;switch(e){case`keypress`:if(bn(n)===0)break a;case`keydown`:case`keyup`:c=Hn;break;case`focusin`:l=`focus`,c=Nn;break;case`focusout`:l=`blur`,c=Nn;break;case`beforeblur`:case`afterblur`:c=Nn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=jn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Mn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Wn;break;case Ur:case Wr:case Gr:c=Pn;break;case Kr:c=Gn;break;case`scroll`:c=Dn;break;case`wheel`:c=Kn;break;case`copy`:case`cut`:case`paste`:c=Fn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Un}var u=(t&4)!=0,d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=qe(p,f),h!=null&&u.push(ci(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Fe&&(l=n.relatedTarget||n.fromElement)&&(Fi(l)||l[ji]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Fi(l):null,l!==null&&(d=rt(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=jn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=Un,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Li(c),m=l==null?s:Li(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Fi(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=ui(m))p++;for(m=0,h=f;h;h=ui(h))m++;for(;0<p-m;)u=ui(u),p--;for(;0<m-p;)f=ui(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=ui(u),f=ui(f)}u=null}else u=null;c!==null&&di(o,s,c,u,!1),l!==null&&d!==null&&di(o,d,l,u,!0)}}a:{if(s=r?Li(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=fr;else if(or(s))if(pr)g=Sr;else{g=br;var _=yr}else (c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=xr);if(g&&=g(e,r)){sr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&ve(s,`number`,s.value)}switch(_=r?Li(r):window,e){case`focusin`:(or(_)||_.contentEditable===`true`)&&(Nr=_,Pr=r,Fr=null);break;case`focusout`:Fr=Pr=Nr=null;break;case`mousedown`:Ir=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ir=!1,Lr(o,n,i);break;case`selectionchange`:if(Mr)break;case`keydown`:case`keyup`:Lr(o,n,i)}var v;if(Jn)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else nr?er(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(Zn&&n.locale!==`ko`&&(nr||y!==`onCompositionStart`?y===`onCompositionEnd`&&nr&&(v=yn()):(gn=i,_n=`value`in gn?gn.value:gn.textContent,nr=!0)),_=li(r,y),0<_.length&&(y=new In(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=tr(n),v!==null&&(y.data=v)))),(v=Xn?rr(e,n):ir(e,n))&&(r=li(r,`onBeforeInput`),0<r.length&&(i=new In(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}ti(o,t)})}function ci(e,t,n){return{instance:e,listener:t,currentTarget:n}}function li(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=qe(e,n),a!=null&&r.unshift(ci(e,a,i)),a=qe(e,t),a!=null&&r.push(ci(e,a,i))),e=e.return}return r}function ui(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function di(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=qe(n,a),c!=null&&o.unshift(ci(n,c,s))):i||(c=qe(n,a),c!=null&&o.push(ci(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var fi=/\r\n?/g,pi=/\u0000|\uFFFD/g;function mi(e){return(typeof e==`string`?e:``+e).replace(fi,`
|
|
6
|
+
`).replace(pi,``)}function hi(e,t,n){if(t=mi(t),mi(e)!==t&&n)throw Error(r(425))}function gi(){}var _i=null,vi=null;function yi(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bi=typeof setTimeout==`function`?setTimeout:void 0,xi=typeof clearTimeout==`function`?clearTimeout:void 0,Si=typeof Promise==`function`?Promise:void 0,Ci=typeof queueMicrotask==`function`?queueMicrotask:Si===void 0?bi:function(e){return Si.resolve(null).then(e).catch(wi)};function wi(e){setTimeout(function(){throw e})}function Ti(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),sn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);sn(t)}function Ei(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function Di(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Oi=Math.random().toString(36).slice(2),ki=`__reactFiber$`+Oi,Ai=`__reactProps$`+Oi,ji=`__reactContainer$`+Oi,Mi=`__reactEvents$`+Oi,Ni=`__reactListeners$`+Oi,Pi=`__reactHandles$`+Oi;function Fi(e){var t=e[ki];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ji]||n[ki]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Di(e);e!==null;){if(n=e[ki])return n;e=Di(e)}return t}e=n,n=e.parentNode}return null}function Ii(e){return e=e[ki]||e[ji],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Li(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Ri(e){return e[Ai]||null}var zi=[],Bi=-1;function Vi(e){return{current:e}}function Hi(e){0>Bi||(e.current=zi[Bi],zi[Bi]=null,Bi--)}function Ui(e,t){Bi++,zi[Bi]=e.current,e.current=t}var Wi={},Gi=Vi(Wi),Ki=Vi(!1),qi=Wi;function Ji(e,t){var n=e.type.contextTypes;if(!n)return Wi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yi(e){return e=e.childContextTypes,e!=null}function Xi(){Hi(Ki),Hi(Gi)}function Zi(e,t,n){if(Gi.current!==Wi)throw Error(r(168));Ui(Gi,t),Ui(Ki,n)}function Qi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,oe(e)||`Unknown`,a));return z({},n,i)}function $i(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wi,qi=Gi.current,Ui(Gi,e),Ui(Ki,Ki.current),!0}function ea(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=Qi(e,t,qi),i.__reactInternalMemoizedMergedChildContext=e,Hi(Ki),Hi(Gi),Ui(Gi,e)):Hi(Ki),Ui(Ki,n)}var ta=null,na=!1,ra=!1;function ia(e){ta===null?ta=[e]:ta.push(e)}function aa(e){na=!0,ia(e)}function oa(){if(!ra&&ta!==null){ra=!0;var e=0,t=Lt;try{var n=ta;for(Lt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ta=null,na=!1}catch(t){throw ta!==null&&(ta=ta.slice(e+1)),ct(pt,oa),t}finally{Lt=t,ra=!1}}return null}var sa=[],ca=0,la=null,ua=0,da=[],fa=0,pa=null,ma=1,ha=``;function ga(e,t){sa[ca++]=ua,sa[ca++]=la,la=e,ua=t}function _a(e,t,n){da[fa++]=ma,da[fa++]=ha,da[fa++]=pa,pa=e;var r=ma;e=ha;var i=32-xt(r)-1;r&=~(1<<i),n+=1;var a=32-xt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ma=1<<32-xt(t)+i|n<<i|r,ha=a+e}else ma=1<<a|n<<i|r,ha=e}function va(e){e.return!==null&&(ga(e,1),_a(e,1,0))}function ya(e){for(;e===la;)la=sa[--ca],sa[ca]=null,ua=sa[--ca],sa[ca]=null;for(;e===pa;)pa=da[--fa],da[fa]=null,ha=da[--fa],da[fa]=null,ma=da[--fa],da[fa]=null}var ba=null,xa=null,Sa=!1,Ca=null;function wa(e,t){var n=$l(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ta(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t===null?!1:(e.stateNode=t,ba=e,xa=Ei(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,ba=e,xa=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=pa===null?null:{id:ma,overflow:ha},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=$l(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ba=e,xa=null,!0);default:return!1}}function Ea(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Da(e){if(Sa){var t=xa;if(t){var n=t;if(!Ta(e,t)){if(Ea(e))throw Error(r(418));t=Ei(n.nextSibling);var i=ba;t&&Ta(e,t)?wa(i,n):(e.flags=e.flags&-4097|2,Sa=!1,ba=e)}}else{if(Ea(e))throw Error(r(418));e.flags=e.flags&-4097|2,Sa=!1,ba=e}}}function Oa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ba=e}function ka(e){if(e!==ba)return!1;if(!Sa)return Oa(e),Sa=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!yi(e.type,e.memoizedProps)),t&&=xa){if(Ea(e))throw Aa(),Error(r(418));for(;t;)wa(e,t),t=Ei(t.nextSibling)}if(Oa(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){xa=Ei(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}xa=null}}else xa=ba?Ei(e.stateNode.nextSibling):null;return!0}function Aa(){for(var e=xa;e;)e=Ei(e.nextSibling)}function ja(){xa=ba=null,Sa=!1}function Ma(e){Ca===null?Ca=[e]:Ca.push(e)}var Na=C.ReactCurrentBatchConfig;function Pa(e,t){if(e&&e.defaultProps){for(var n in t=z({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Fa=Vi(null),Ia=null,La=null,Ra=null;function za(){Ra=La=Ia=null}function Ba(e){var t=Fa.current;Hi(Fa),e._currentValue=t}function Va(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ha(e,t){Ia=e,Ra=La=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Rs=!0),e.firstContext=null)}function Ua(e){var t=e._currentValue;if(Ra!==e)if(e={context:e,memoizedValue:t,next:null},La===null){if(Ia===null)throw Error(r(308));La=e,Ia.dependencies={lanes:0,firstContext:e}}else La=La.next=e;return t}var Wa=null;function Ga(e){Wa===null?Wa=[e]:Wa.push(e)}function Ka(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ga(t)):(n.next=i.next,i.next=n),t.interleaved=n,qa(e,r)}function qa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ja=!1;function Ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Za(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,qc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,qa(e,n)}return i=r.interleaved,i===null?(t.next=t,Ga(r)):(t.next=i.next,i.next=t),r.interleaved=t,qa(e,n)}function $a(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,It(e,n)}}function eo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function to(e,t,n,r){var i=e.updateQueue;Ja=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=z({},d,f);break a;case 2:Ja=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);tl|=o,e.lanes=o,e.memoizedState=d}}function no(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var ro=new t.Component().refs;function io(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:z({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ao={isMounted:function(e){return(e=e._reactInternals)?rt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=yl(),i=bl(e),a=Za(r,i);a.payload=t,n!=null&&(a.callback=n),t=Qa(e,a,i),t!==null&&(xl(t,e,i,r),$a(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=yl(),i=bl(e),a=Za(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Qa(e,a,i),t!==null&&(xl(t,e,i,r),$a(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=yl(),r=bl(e),i=Za(n,r);i.tag=2,t!=null&&(i.callback=t),t=Qa(e,i,r),t!==null&&(xl(t,e,r,n),$a(t,e,r))}};function oo(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Tr(n,r)||!Tr(i,a):!0}function so(e,t,n){var r=!1,i=Wi,a=t.contextType;return typeof a==`object`&&a?a=Ua(a):(i=Yi(t)?qi:Gi.current,r=t.contextTypes,a=(r=r!=null)?Ji(e,i):Wi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ao,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function co(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ao.enqueueReplaceState(t,t.state,null)}function lo(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=ro,Ya(e);var a=t.contextType;typeof a==`object`&&a?i.context=Ua(a):(a=Yi(t)?qi:Gi.current,i.context=Ji(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(io(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&ao.enqueueReplaceState(i,i.state,null),to(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function uo(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;t===ro&&(t=a.refs={}),e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function fo(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function po(e){var t=e._init;return t(e._payload)}function mo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=nu(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ou(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===E?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===F&&po(i)===t.type)?(r=a(t,n.props),r.ref=uo(e,t,n),r.return=e,r):(r=ru(n.type,n.key,n.props,null,e.mode,r),r.ref=uo(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=su(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=iu(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=ou(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=ru(t.type,t.key,t.props,null,e.mode,n),n.ref=uo(e,null,t),n.return=e,n;case T:return t=su(t,e.mode,n),t.return=e,t;case F:var r=t._init;return f(e,r(t._payload),n)}if(ye(t)||R(t))return t=iu(t,e.mode,n,null),t.return=e,t;fo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case F:return i=n._init,p(e,t,i(n._payload),r)}if(ye(n)||R(n))return i===null?d(e,t,n,r,null):null;fo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case F:var a=r._init;return m(e,t,n,a(r._payload),i)}if(ye(r)||R(r))return e=e.get(n)||null,d(t,e,r,i,null);fo(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Sa&&ga(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Sa&&ga(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),Sa&&ga(r,h),l}function g(a,s,c,l){var u=R(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Sa&&ga(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Sa&&ga(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Sa&&ga(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&po(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=uo(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=iu(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=ru(i.type,i.key,i.props,null,e.mode,o),o.ref=uo(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=su(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(ye(i))return h(e,r,i,o);if(R(i))return g(e,r,i,o);fo(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=ou(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var ho=mo(!0),go=mo(!1),_o={},vo=Vi(_o),yo=Vi(_o),bo=Vi(_o);function xo(e){if(e===_o)throw Error(r(174));return e}function So(e,t){switch(Ui(bo,t),Ui(yo,e),Ui(vo,_o),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Te(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Te(t,e)}Hi(vo),Ui(vo,t)}function Co(){Hi(vo),Hi(yo),Hi(bo)}function wo(e){xo(bo.current);var t=xo(vo.current),n=Te(t,e.type);t!==n&&(Ui(yo,e),Ui(vo,n))}function To(e){yo.current===e&&(Hi(vo),Hi(yo))}var Eo=Vi(0);function Do(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Oo=[];function ko(){for(var e=0;e<Oo.length;e++)Oo[e]._workInProgressVersionPrimary=null;Oo.length=0}var Ao=C.ReactCurrentDispatcher,jo=C.ReactCurrentBatchConfig,Mo=0,No=null,Po=null,Fo=null,Io=!1,Lo=!1,Ro=0,zo=0;function Bo(){throw Error(r(321))}function Vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wr(e[n],t[n]))return!1;return!0}function Ho(e,t,n,i,a,o){if(Mo=o,No=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ao.current=e===null||e.memoizedState===null?Ts:Es,e=n(i,a),Lo){o=0;do{if(Lo=!1,Ro=0,25<=o)throw Error(r(301));o+=1,Fo=Po=null,t.updateQueue=null,Ao.current=Ds,e=n(i,a)}while(Lo)}if(Ao.current=ws,t=Po!==null&&Po.next!==null,Mo=0,Fo=Po=No=null,Io=!1,t)throw Error(r(300));return e}function Uo(){var e=Ro!==0;return Ro=0,e}function Wo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fo===null?No.memoizedState=Fo=e:Fo=Fo.next=e,Fo}function Go(){if(Po===null){var e=No.alternate;e=e===null?null:e.memoizedState}else e=Po.next;var t=Fo===null?No.memoizedState:Fo.next;if(t!==null)Fo=t,Po=e;else{if(e===null)throw Error(r(310));Po=e,e={memoizedState:Po.memoizedState,baseState:Po.baseState,baseQueue:Po.baseQueue,queue:Po.queue,next:null},Fo===null?No.memoizedState=Fo=e:Fo=Fo.next=e}return Fo}function Ko(e,t){return typeof t==`function`?t(e):t}function qo(e){var t=Go(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=Po,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Mo&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,No.lanes|=d,tl|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,wr(i,t.memoizedState)||(Rs=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,No.lanes|=o,tl|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Jo(e){var t=Go(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);wr(o,t.memoizedState)||(Rs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Yo(){}function Xo(e,t){var n=No,i=Go(),a=t(),o=!wr(i.memoizedState,a);if(o&&(i.memoizedState=a,Rs=!0),i=i.queue,cs($o.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||Fo!==null&&Fo.memoizedState.tag&1){if(n.flags|=2048,rs(9,Qo.bind(null,n,i,a,t),void 0,null),Jc===null)throw Error(r(349));Mo&30||Zo(n,t,a)}return a}function Zo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=No.updateQueue,t===null?(t={lastEffect:null,stores:null},No.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Qo(e,t,n,r){t.value=n,t.getSnapshot=r,es(t)&&ts(e)}function $o(e,t,n){return n(function(){es(t)&&ts(e)})}function es(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wr(e,n)}catch{return!0}}function ts(e){var t=qa(e,1);t!==null&&xl(t,e,1,-1)}function ns(e){var t=Wo();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:e},t.queue=e,e=e.dispatch=bs.bind(null,No,e),[t.memoizedState,e]}function rs(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=No.updateQueue,t===null?(t={lastEffect:null,stores:null},No.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function is(){return Go().memoizedState}function as(e,t,n,r){var i=Wo();No.flags|=e,i.memoizedState=rs(1|t,n,void 0,r===void 0?null:r)}function os(e,t,n,r){var i=Go();r=r===void 0?null:r;var a=void 0;if(Po!==null){var o=Po.memoizedState;if(a=o.destroy,r!==null&&Vo(r,o.deps)){i.memoizedState=rs(t,n,a,r);return}}No.flags|=e,i.memoizedState=rs(1|t,n,a,r)}function ss(e,t){return as(8390656,8,e,t)}function cs(e,t){return os(2048,8,e,t)}function ls(e,t){return os(4,2,e,t)}function us(e,t){return os(4,4,e,t)}function ds(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fs(e,t,n){return n=n==null?null:n.concat([e]),os(4,4,ds.bind(null,t,e),n)}function ps(){}function ms(e,t){var n=Go();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hs(e,t){var n=Go();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Vo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function gs(e,t,n){return Mo&21?(wr(n,t)||(n=Mt(),No.lanes|=n,tl|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Rs=!0),e.memoizedState=n)}function _s(e,t){var n=Lt;Lt=n!==0&&4>n?n:4,e(!0);var r=jo.transition;jo.transition={};try{e(!1),t()}finally{Lt=n,jo.transition=r}}function vs(){return Go().memoizedState}function ys(e,t,n){var r=bl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xs(e))Ss(t,n);else if(n=Ka(e,t,n,r),n!==null){var i=yl();xl(n,e,r,i),Cs(n,t,r)}}function bs(e,t,n){var r=bl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xs(e))Ss(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,wr(s,o)){var c=t.interleaved;c===null?(i.next=i,Ga(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Ka(e,t,i,r),n!==null&&(i=yl(),xl(n,e,r,i),Cs(n,t,r))}}function xs(e){var t=e.alternate;return e===No||t!==null&&t===No}function Ss(e,t){Lo=Io=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Cs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,It(e,n)}}var ws={readContext:Ua,useCallback:Bo,useContext:Bo,useEffect:Bo,useImperativeHandle:Bo,useInsertionEffect:Bo,useLayoutEffect:Bo,useMemo:Bo,useReducer:Bo,useRef:Bo,useState:Bo,useDebugValue:Bo,useDeferredValue:Bo,useTransition:Bo,useMutableSource:Bo,useSyncExternalStore:Bo,useId:Bo,unstable_isNewReconciler:!1},Ts={readContext:Ua,useCallback:function(e,t){return Wo().memoizedState=[e,t===void 0?null:t],e},useContext:Ua,useEffect:ss,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),as(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){return as(4,2,e,t)},useMemo:function(e,t){var n=Wo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ys.bind(null,No,e),[r.memoizedState,e]},useRef:function(e){var t=Wo();return e={current:e},t.memoizedState=e},useState:ns,useDebugValue:ps,useDeferredValue:function(e){return Wo().memoizedState=e},useTransition:function(){var e=ns(!1),t=e[0];return e=_s.bind(null,e[1]),Wo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=No,a=Wo();if(Sa){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Jc===null)throw Error(r(349));Mo&30||Zo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss($o.bind(null,i,o,e),[e]),i.flags|=2048,rs(9,Qo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Wo(),t=Jc.identifierPrefix;if(Sa){var n=ha,r=ma;n=(r&~(1<<32-xt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Ro++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=zo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},Es={readContext:Ua,useCallback:ms,useContext:Ua,useEffect:cs,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:qo,useRef:is,useState:function(){return qo(Ko)},useDebugValue:ps,useDeferredValue:function(e){return gs(Go(),Po.memoizedState,e)},useTransition:function(){return[qo(Ko)[0],Go().memoizedState]},useMutableSource:Yo,useSyncExternalStore:Xo,useId:vs,unstable_isNewReconciler:!1},Ds={readContext:Ua,useCallback:ms,useContext:Ua,useEffect:cs,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Jo,useRef:is,useState:function(){return Jo(Ko)},useDebugValue:ps,useDeferredValue:function(e){var t=Go();return Po===null?t.memoizedState=e:gs(t,Po.memoizedState,e)},useTransition:function(){return[Jo(Ko)[0],Go().memoizedState]},useMutableSource:Yo,useSyncExternalStore:Xo,useId:vs,unstable_isNewReconciler:!1};function Os(e,t){try{var n=``,r=t;do n+=ie(r),r=r.return;while(r);var i=n}catch(e){i=`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}return{value:e,source:t,stack:i,digest:null}}function ks(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function As(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var js=typeof WeakMap==`function`?WeakMap:Map;function Ms(e,t,n){n=Za(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ll||(ll=!0,ul=r),As(e,t)},n}function Ns(e,t,n){n=Za(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){As(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){As(e,t),typeof r!=`function`&&(dl===null?dl=new Set([this]):dl.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Ps(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new js;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Kl.bind(null,e,t,n),t.then(e,e))}function Fs(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Is(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Za(-1,1),t.tag=2,Qa(n,t,1))),n.lanes|=1),e)}var Ls=C.ReactCurrentOwner,Rs=!1;function zs(e,t,n,r){t.child=e===null?go(t,null,n,r):ho(t,e.child,n,r)}function Bs(e,t,n,r,i){n=n.render;var a=t.ref;return Ha(t,i),r=Ho(e,t,n,r,a,i),n=Uo(),e!==null&&!Rs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,oc(e,t,i)):(Sa&&n&&va(t),t.flags|=1,zs(e,t,r,i),t.child)}function Vs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!eu(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Hs(e,t,a,r,i)):(e=ru(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Tr:n,n(o,r)&&e.ref===t.ref)return oc(e,t,i)}return t.flags|=1,e=nu(a,r),e.ref=t.ref,e.return=t,t.child=e}function Hs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Tr(a,r)&&e.ref===t.ref)if(Rs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Rs=!0);else return t.lanes=e.lanes,oc(e,t,i)}return Gs(e,t,n,r,i)}function Us(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ui(Qc,Zc),Zc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ui(Qc,Zc),Zc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Ui(Qc,Zc),Zc|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Ui(Qc,Zc),Zc|=r;return zs(e,t,i,n),t.child}function Ws(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Gs(e,t,n,r,i){var a=Yi(n)?qi:Gi.current;return a=Ji(t,a),Ha(t,i),n=Ho(e,t,n,r,a,i),r=Uo(),e!==null&&!Rs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,oc(e,t,i)):(Sa&&r&&va(t),t.flags|=1,zs(e,t,n,i),t.child)}function Ks(e,t,n,r,i){if(Yi(n)){var a=!0;$i(t)}else a=!1;if(Ha(t,i),t.stateNode===null)ac(e,t),so(t,n,r),lo(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Ua(l):(l=Yi(n)?qi:Gi.current,l=Ji(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&co(t,o,r,l),Ja=!1;var f=t.memoizedState;o.state=f,to(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Ki.current||Ja?(typeof u==`function`&&(io(t,n,u,r),c=t.memoizedState),(s=Ja||oo(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Xa(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Pa(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Ua(c):(c=Yi(n)?qi:Gi.current,c=Ji(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&co(t,o,r,c),Ja=!1,f=t.memoizedState,o.state=f,to(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Ki.current||Ja?(typeof p==`function`&&(io(t,n,p,r),m=t.memoizedState),(l=Ja||oo(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return qs(e,t,n,r,a,i)}function qs(e,t,n,r,i,a){Ws(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&ea(t,n,!1),oc(e,t,a);r=t.stateNode,Ls.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=ho(t,e.child,null,a),t.child=ho(t,null,s,a)):zs(e,t,s,a),t.memoizedState=r.state,i&&ea(t,n,!0),t.child}function Js(e){var t=e.stateNode;t.pendingContext?Zi(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Zi(e,t.context,!1),So(e,t.containerInfo)}function Ys(e,t,n,r,i){return ja(),Ma(i),t.flags|=256,zs(e,t,n,r),t.child}var Xs={dehydrated:null,treeContext:null,retryLane:0};function Zs(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qs(e,t,n){var r=t.pendingProps,i=Eo.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ui(Eo,i&1),e===null)return Da(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=au(o,r,0,null),e=iu(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Zs(n),t.memoizedState=Xs,e):$s(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return tc(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=nu(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=iu(a,o,n,null),a.flags|=2):a=nu(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Zs(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Xs,r}return a=e.child,e=a.sibling,r=nu(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function $s(e,t){return t=au({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function ec(e,t,n,r){return r!==null&&Ma(r),ho(t,e.child,null,n),e=$s(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=ks(Error(r(422))),ec(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=au({mode:`visible`,children:i.children},a,0,null),o=iu(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&ho(t,e.child,null,s),t.child.memoizedState=Zs(s),t.memoizedState=Xs,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return ec(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=ks(o,i,void 0),ec(e,t,s,i)}if(c=(s&e.childLanes)!==0,Rs||c){if(i=Jc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,qa(e,a),xl(i,e,a,-1))}return Fl(),i=ks(Error(r(421))),ec(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Jl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,xa=Ei(a.nextSibling),ba=t,Sa=!0,Ca=null,e!==null&&(da[fa++]=ma,da[fa++]=ha,da[fa++]=pa,ma=e.id,ha=e.overflow,pa=t),t=$s(t,i.children),t.flags|=4096,t)}function nc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Va(e.return,t,n)}function rc(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function ic(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(zs(e,t,r.children,n),r=Eo.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nc(e,n,t);else if(e.tag===19)nc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ui(Eo,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Do(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rc(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Do(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rc(t,!0,n,null,a);break;case`together`:rc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ac(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function oc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),tl|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=nu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=nu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sc(e,t,n){switch(t.tag){case 3:Js(t),ja();break;case 5:wo(t);break;case 1:Yi(t.type)&&$i(t);break;case 4:So(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ui(Fa,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ui(Eo,Eo.current&1),e=oc(e,t,n),e===null?null:e.sibling):Qs(e,t,n):(Ui(Eo,Eo.current&1),t.flags|=128,null);Ui(Eo,Eo.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ic(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ui(Eo,Eo.current),r)break;return null;case 22:case 23:return t.lanes=0,Us(e,t,n)}return oc(e,t,n)}var cc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},lc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,xo(vo.current);var o=null;switch(n){case`input`:i=pe(e,i),r=pe(e,r),o=[];break;case`select`:i=z({},i,{value:void 0}),r=z({},r,{value:void 0}),o=[];break;case`textarea`:i=xe(e,i),r=xe(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=gi)}Ne(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&ni(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},uc=function(e,t,n,r){n!==r&&(t.flags|=4)};function dc(e,t){if(!Sa)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function fc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function pc(e,t,n){var i=t.pendingProps;switch(ya(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fc(t),null;case 1:return Yi(t.type)&&Xi(),fc(t),null;case 3:return i=t.stateNode,Co(),Hi(Ki),Hi(Gi),ko(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ka(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ca!==null&&(Tl(Ca),Ca=null))),fc(t),null;case 5:To(t);var o=xo(bo.current);if(n=t.type,e!==null&&t.stateNode!=null)lc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return fc(t),null}if(e=xo(vo.current),ka(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[ki]=t,i[Ai]=s,e=(t.mode&1)!=0,n){case`dialog`:ni(`cancel`,i),ni(`close`,i);break;case`iframe`:case`object`:case`embed`:ni(`load`,i);break;case`video`:case`audio`:for(o=0;o<Qr.length;o++)ni(Qr[o],i);break;case`source`:ni(`error`,i);break;case`img`:case`image`:case`link`:ni(`error`,i),ni(`load`,i);break;case`details`:ni(`toggle`,i);break;case`input`:me(i,s),ni(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},ni(`invalid`,i);break;case`textarea`:B(i,s),ni(`invalid`,i)}for(var c in Ne(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&hi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&hi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&ni(`scroll`,i)}switch(n){case`input`:ue(i),_e(i,s,!0);break;case`textarea`:ue(i),Ce(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=gi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=we(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[ki]=t,e[Ai]=i,cc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Pe(n,i),n){case`dialog`:ni(`cancel`,e),ni(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:ni(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<Qr.length;o++)ni(Qr[o],e);o=i;break;case`source`:ni(`error`,e),o=i;break;case`img`:case`image`:case`link`:ni(`error`,e),ni(`load`,e),o=i;break;case`details`:ni(`toggle`,e),o=i;break;case`input`:me(e,i),o=pe(e,i),ni(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=z({},i,{value:void 0}),ni(`invalid`,e);break;case`textarea`:B(e,i),o=xe(e,i),ni(`invalid`,e);break;default:o=i}for(s in Ne(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?je(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&V(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&De(e,u):typeof u==`number`&&De(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&ni(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:ue(e),_e(e,i,!1);break;case`textarea`:ue(e),Ce(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+se(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&be(e,!!i.multiple,i.defaultValue,!0):be(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=gi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return fc(t),null;case 6:if(e&&t.stateNode!=null)uc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=xo(bo.current),xo(vo.current),ka(t)){if(i=t.stateNode,n=t.memoizedProps,i[ki]=t,(s=i.nodeValue!==n)&&(e=ba,e!==null))switch(e.tag){case 3:hi(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&hi(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[ki]=t,t.stateNode=i}return fc(t),null;case 13:if(Hi(Eo),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Sa&&xa!==null&&t.mode&1&&!(t.flags&128))Aa(),ja(),t.flags|=98560,s=!1;else if(s=ka(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[ki]=t}else ja(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fc(t),s=!1}else Ca!==null&&(Tl(Ca),Ca=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||Eo.current&1?$c===0&&($c=3):Fl())),t.updateQueue!==null&&(t.flags|=4),fc(t),null);case 4:return Co(),e===null&&ai(t.stateNode.containerInfo),fc(t),null;case 10:return Ba(t.type._context),fc(t),null;case 17:return Yi(t.type)&&Xi(),fc(t),null;case 19:if(Hi(Eo),s=t.memoizedState,s===null)return fc(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)dc(s,!1);else{if($c!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=Do(e),c!==null){for(t.flags|=128,dc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ui(Eo,Eo.current&1|2),t.child}e=e.sibling}s.tail!==null&&dt()>sl&&(t.flags|=128,i=!0,dc(s,!1),t.lanes=4194304)}else{if(!i)if(e=Do(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),dc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Sa)return fc(t),null}else 2*dt()-s.renderingStartTime>sl&&n!==1073741824&&(t.flags|=128,i=!0,dc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(fc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=dt(),t.sibling=null,n=Eo.current,Ui(Eo,i?n&1|2:n&1),t);case 22:case 23:return jl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Zc&1073741824&&(fc(t),t.subtreeFlags&6&&(t.flags|=8192)):fc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function mc(e,t){switch(ya(t),t.tag){case 1:return Yi(t.type)&&Xi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Co(),Hi(Ki),Hi(Gi),ko(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return To(t),null;case 13:if(Hi(Eo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Hi(Eo),null;case 4:return Co(),null;case 10:return Ba(t.type._context),null;case 22:case 23:return jl(),null;case 24:return null;default:return null}}var hc=!1,gc=!1,_c=typeof WeakSet==`function`?WeakSet:Set,q=null;function vc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Gl(e,t,n)}else n.current=null}function yc(e,t,n){try{n()}catch(n){Gl(e,t,n)}}var bc=!1;function xc(e,t){if(_i=ln,e=kr(),Ar(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(vi={focusedElem:e,selectionRange:n},ln=!1,q=t;q!==null;)if(t=q,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,q=e;else for(;q!==null;){t=q;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Pa(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Gl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,q=e;break}q=t.return}return h=bc,bc=!1,h}function Sc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&yc(t,n,a)}i=i.next}while(i!==r)}}function Cc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function wc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Tc(e){var t=e.alternate;t!==null&&(e.alternate=null,Tc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ki],delete t[Ai],delete t[Mi],delete t[Ni],delete t[Pi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ec(e){return e.tag===5||e.tag===3||e.tag===4}function Dc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ec(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Oc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gi));else if(r!==4&&(e=e.child,e!==null))for(Oc(e,t,n),e=e.sibling;e!==null;)Oc(e,t,n),e=e.sibling}function kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(kc(e,t,n),e=e.sibling;e!==null;)kc(e,t,n),e=e.sibling}var Ac=null,jc=!1;function Mc(e,t,n){for(n=n.child;n!==null;)Nc(e,t,n),n=n.sibling}function Nc(e,t,n){if(yt&&typeof yt.onCommitFiberUnmount==`function`)try{yt.onCommitFiberUnmount(vt,n)}catch{}switch(n.tag){case 5:gc||vc(n,t);case 6:var r=Ac,i=jc;Ac=null,Mc(e,t,n),Ac=r,jc=i,Ac!==null&&(jc?(e=Ac,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ac.removeChild(n.stateNode));break;case 18:Ac!==null&&(jc?(e=Ac,n=n.stateNode,e.nodeType===8?Ti(e.parentNode,n):e.nodeType===1&&Ti(e,n),sn(e)):Ti(Ac,n.stateNode));break;case 4:r=Ac,i=jc,Ac=n.stateNode.containerInfo,jc=!0,Mc(e,t,n),Ac=r,jc=i;break;case 0:case 11:case 14:case 15:if(!gc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&yc(n,t,o),i=i.next}while(i!==r)}Mc(e,t,n);break;case 1:if(!gc&&(vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Gl(n,t,e)}Mc(e,t,n);break;case 21:Mc(e,t,n);break;case 22:n.mode&1?(gc=(r=gc)||n.memoizedState!==null,Mc(e,t,n),gc=r):Mc(e,t,n);break;default:Mc(e,t,n)}}function Pc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _c),t.forEach(function(t){var r=Yl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Fc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Ac=c.stateNode,jc=!1;break a;case 3:Ac=c.stateNode.containerInfo,jc=!0;break a;case 4:Ac=c.stateNode.containerInfo,jc=!0;break a}c=c.return}if(Ac===null)throw Error(r(160));Nc(o,s,a),Ac=null,jc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Gl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ic(t,e),t=t.sibling}function Ic(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Fc(t,e),Lc(e),i&4){try{Sc(3,e,e.return),Cc(3,e)}catch(t){Gl(e,e.return,t)}try{Sc(5,e,e.return)}catch(t){Gl(e,e.return,t)}}break;case 1:Fc(t,e),Lc(e),i&512&&n!==null&&vc(n,n.return);break;case 5:if(Fc(t,e),Lc(e),i&512&&n!==null&&vc(n,n.return),e.flags&32){var a=e.stateNode;try{De(a,``)}catch(t){Gl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&he(a,o),Pe(c,s);var u=Pe(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?je(a,f):d===`dangerouslySetInnerHTML`?V(a,f):d===`children`?De(a,f):S(a,d,f,u)}switch(c){case`input`:ge(a,o);break;case`textarea`:Se(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?be(a,!!o.multiple,o.multiple?[]:``,!1):be(a,!!o.multiple,o.defaultValue,!0)):be(a,!!o.multiple,m,!1)}a[Ai]=o}catch(t){Gl(e,e.return,t)}}break;case 6:if(Fc(t,e),Lc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Gl(e,e.return,t)}}break;case 3:if(Fc(t,e),Lc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{sn(t.containerInfo)}catch(t){Gl(e,e.return,t)}break;case 4:Fc(t,e),Lc(e);break;case 13:Fc(t,e),Lc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(ol=dt())),i&4&&Pc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(gc=(u=gc)||d,Fc(t,e),gc=u):Fc(t,e),Lc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(q=e,d=e.child;d!==null;){for(f=q=d;q!==null;){switch(p=q,m=p.child,p.tag){case 0:case 11:case 14:case 15:Sc(4,p,p.return);break;case 1:vc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Gl(i,n,e)}}break;case 5:vc(p,p.return);break;case 22:if(p.memoizedState!==null){Vc(f);continue}}m===null?Vc(f):(m.return=p,q=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Ae(`display`,s))}catch(t){Gl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Gl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Fc(t,e),Lc(e),i&4&&Pc(e);break;case 21:break;default:Fc(t,e),Lc(e)}}function Lc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Ec(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(De(a,``),i.flags&=-33),kc(e,Dc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Oc(e,Dc(e),o);break;default:throw Error(r(161))}}catch(t){Gl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rc(e,t,n){q=e,zc(e,t,n)}function zc(e,t,n){for(var r=(e.mode&1)!=0;q!==null;){var i=q,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||hc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||gc;s=hc;var l=gc;if(hc=o,(gc=c)&&!l)for(q=i;q!==null;)o=q,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Hc(i):(c.return=o,q=c);for(;a!==null;)q=a,zc(a,t,n),a=a.sibling;q=i,hc=s,gc=l}Bc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,q=a):Bc(e,t,n)}}function Bc(e){for(;q!==null;){var t=q;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:gc||Cc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!gc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Pa(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&no(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}no(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&sn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}gc||t.flags&512&&wc(t)}catch(e){Gl(t,t.return,e)}}if(t===e){q=null;break}if(n=t.sibling,n!==null){n.return=t.return,q=n;break}q=t.return}}function Vc(e){for(;q!==null;){var t=q;if(t===e){q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,q=n;break}q=t.return}}function Hc(e){for(;q!==null;){var t=q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Cc(4,t)}catch(e){Gl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Gl(t,i,e)}}var a=t.return;try{wc(t)}catch(e){Gl(t,a,e)}break;case 5:var o=t.return;try{wc(t)}catch(e){Gl(t,o,e)}}}catch(e){Gl(t,t.return,e)}if(t===e){q=null;break}var s=t.sibling;if(s!==null){s.return=t.return,q=s;break}q=t.return}}var Uc=Math.ceil,Wc=C.ReactCurrentDispatcher,Gc=C.ReactCurrentOwner,Kc=C.ReactCurrentBatchConfig,qc=0,Jc=null,Yc=null,Xc=0,Zc=0,Qc=Vi(0),$c=0,el=null,tl=0,nl=0,rl=0,il=null,al=null,ol=0,sl=1/0,cl=null,ll=!1,ul=null,dl=null,fl=!1,pl=null,ml=0,hl=0,gl=null,_l=-1,vl=0;function yl(){return qc&6?dt():_l===-1?_l=dt():_l}function bl(e){return e.mode&1?qc&2&&Xc!==0?Xc&-Xc:Na.transition===null?(e=Lt,e===0?(e=window.event,e=e===void 0?16:hn(e.type),e):e):(vl===0&&(vl=Mt()),vl):1}function xl(e,t,n,i){if(50<hl)throw hl=0,gl=null,Error(r(185));Pt(e,n,i),(!(qc&2)||e!==Jc)&&(e===Jc&&(!(qc&2)&&(nl|=n),$c===4&&Dl(e,Xc)),Sl(e,i),n===1&&qc===0&&!(t.mode&1)&&(sl=dt()+500,na&&oa()))}function Sl(e,t){var n=e.callbackNode;At(e,t);var r=Ot(e,e===Jc?Xc:0);if(r===0)n!==null&&W(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&W(n),t===1)e.tag===0?aa(Ol.bind(null,e)):ia(Ol.bind(null,e)),Ci(function(){!(qc&6)&&oa()}),n=null;else{switch(Rt(r)){case 1:n=pt;break;case 4:n=mt;break;case 16:n=ht;break;case 536870912:n=_t;break;default:n=ht}n=Zl(n,Cl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Cl(e,t){if(_l=-1,vl=0,qc&6)throw Error(r(327));var n=e.callbackNode;if(Ul()&&e.callbackNode!==n)return null;var i=Ot(e,e===Jc?Xc:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Il(e,i);else{t=i;var a=qc;qc|=2;var o=Pl();(Jc!==e||Xc!==t)&&(cl=null,sl=dt()+500,Ml(e,t));do try{Rl();break}catch(t){Nl(e,t)}while(1);za(),Wc.current=o,qc=a,Yc===null?(Jc=null,Xc=0,t=$c):t=0}if(t!==0){if(t===2&&(a=jt(e),a!==0&&(i=a,t=wl(e,a))),t===1)throw n=el,Ml(e,0),Dl(e,i),Sl(e,dt()),n;if(t===6)Dl(e,i);else{if(a=e.current.alternate,!(i&30)&&!El(a)&&(t=Il(e,i),t===2&&(o=jt(e),o!==0&&(i=o,t=wl(e,o))),t===1))throw n=el,Ml(e,0),Dl(e,i),Sl(e,dt()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Vl(e,al,cl);break;case 3:if(Dl(e,i),(i&130023424)===i&&(t=ol+500-dt(),10<t)){if(Ot(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){yl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=bi(Vl.bind(null,e,al,cl),t);break}Vl(e,al,cl);break;case 4:if(Dl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-xt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=dt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Uc(i/1960))-i,10<i){e.timeoutHandle=bi(Vl.bind(null,e,al,cl),i);break}Vl(e,al,cl);break;case 5:Vl(e,al,cl);break;default:throw Error(r(329))}}}return Sl(e,dt()),e.callbackNode===n?Cl.bind(null,e):null}function wl(e,t){var n=il;return e.current.memoizedState.isDehydrated&&(Ml(e,t).flags|=256),e=Il(e,t),e!==2&&(t=al,al=n,t!==null&&Tl(t)),e}function Tl(e){al===null?al=e:al.push.apply(al,e)}function El(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!wr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Dl(e,t){for(t&=~rl,t&=~nl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-xt(t),r=1<<n;e[n]=-1,t&=~r}}function Ol(e){if(qc&6)throw Error(r(327));Ul();var t=Ot(e,0);if(!(t&1))return Sl(e,dt()),null;var n=Il(e,t);if(e.tag!==0&&n===2){var i=jt(e);i!==0&&(t=i,n=wl(e,i))}if(n===1)throw n=el,Ml(e,0),Dl(e,t),Sl(e,dt()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Vl(e,al,cl),Sl(e,dt()),null}function kl(e,t){var n=qc;qc|=1;try{return e(t)}finally{qc=n,qc===0&&(sl=dt()+500,na&&oa())}}function Al(e){pl!==null&&pl.tag===0&&!(qc&6)&&Ul();var t=qc;qc|=1;var n=Kc.transition,r=Lt;try{if(Kc.transition=null,Lt=1,e)return e()}finally{Lt=r,Kc.transition=n,qc=t,!(qc&6)&&oa()}}function jl(){Zc=Qc.current,Hi(Qc)}function Ml(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,xi(n)),Yc!==null)for(n=Yc.return;n!==null;){var r=n;switch(ya(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Xi();break;case 3:Co(),Hi(Ki),Hi(Gi),ko();break;case 5:To(r);break;case 4:Co();break;case 13:Hi(Eo);break;case 19:Hi(Eo);break;case 10:Ba(r.type._context);break;case 22:case 23:jl()}n=n.return}if(Jc=e,Yc=e=nu(e.current,null),Xc=Zc=t,$c=0,el=null,rl=nl=tl=0,al=il=null,Wa!==null){for(t=0;t<Wa.length;t++)if(n=Wa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Wa=null}return e}function Nl(e,t){do{var n=Yc;try{if(za(),Ao.current=ws,Io){for(var i=No.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Io=!1}if(Mo=0,Fo=Po=No=null,Lo=!1,Ro=0,Gc.current=null,n===null||n.return===null){$c=1,el=t,Yc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=Xc,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Fs(s);if(m!==null){m.flags&=-257,Is(m,s,c,o,t),m.mode&1&&Ps(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){Ps(o,u,t),Fl();break a}l=Error(r(426))}}else if(Sa&&c.mode&1){var _=Fs(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Is(_,s,c,o,t),Ma(Os(l,c));break a}}o=l=Os(l,c),$c!==4&&($c=2),il===null?il=[o]:il.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Ms(o,l,t);eo(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(dl===null||!dl.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Ns(o,c,t);eo(o,x);break a}}o=o.return}while(o!==null)}Bl(n)}catch(e){t=e,Yc===n&&n!==null&&(Yc=n=n.return);continue}break}while(1)}function Pl(){var e=Wc.current;return Wc.current=ws,e===null?ws:e}function Fl(){($c===0||$c===3||$c===2)&&($c=4),Jc===null||!(tl&268435455)&&!(nl&268435455)||Dl(Jc,Xc)}function Il(e,t){var n=qc;qc|=2;var i=Pl();(Jc!==e||Xc!==t)&&(cl=null,Ml(e,t));do try{Ll();break}catch(t){Nl(e,t)}while(1);if(za(),qc=n,Wc.current=i,Yc!==null)throw Error(r(261));return Jc=null,Xc=0,$c}function Ll(){for(;Yc!==null;)zl(Yc)}function Rl(){for(;Yc!==null&&!lt();)zl(Yc)}function zl(e){var t=Xl(e.alternate,e,Zc);e.memoizedProps=e.pendingProps,t===null?Bl(e):Yc=t,Gc.current=null}function Bl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=mc(n,t),n!==null){n.flags&=32767,Yc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{$c=6,Yc=null;return}}else if(n=pc(n,t,Zc),n!==null){Yc=n;return}if(t=t.sibling,t!==null){Yc=t;return}Yc=t=e}while(t!==null);$c===0&&($c=5)}function Vl(e,t,n){var r=Lt,i=Kc.transition;try{Kc.transition=null,Lt=1,Hl(e,t,n,r)}finally{Kc.transition=i,Lt=r}return null}function Hl(e,t,n,i){do Ul();while(pl!==null);if(qc&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Ft(e,o),e===Jc&&(Yc=Jc=null,Xc=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||fl||(fl=!0,Zl(ht,function(){return Ul(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Kc.transition,Kc.transition=null;var s=Lt;Lt=1;var c=qc;qc|=4,Gc.current=null,xc(e,n),Ic(n,e),jr(vi),ln=!!_i,vi=_i=null,e.current=n,Rc(n,e,a),ut(),qc=c,Lt=s,Kc.transition=o}else e.current=n;if(fl&&(fl=!1,pl=e,ml=a),o=e.pendingLanes,o===0&&(dl=null),bt(n.stateNode,i),Sl(e,dt()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(ll)throw ll=!1,e=ul,ul=null,e;return ml&1&&e.tag!==0&&Ul(),o=e.pendingLanes,o&1?e===gl?hl++:(hl=0,gl=e):hl=0,oa(),null}function Ul(){if(pl!==null){var e=Rt(ml),t=Kc.transition,n=Lt;try{if(Kc.transition=null,Lt=16>e?16:e,pl===null)var i=!1;else{if(e=pl,pl=null,ml=0,qc&6)throw Error(r(331));var a=qc;for(qc|=4,q=e.current;q!==null;){var o=q,s=o.child;if(q.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(q=u;q!==null;){var d=q;switch(d.tag){case 0:case 11:case 15:Sc(8,d,o)}var f=d.child;if(f!==null)f.return=d,q=f;else for(;q!==null;){d=q;var p=d.sibling,m=d.return;if(Tc(d),d===u){q=null;break}if(p!==null){p.return=m,q=p;break}q=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}q=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,q=s;else b:for(;q!==null;){if(o=q,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Sc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,q=v;break b}q=o.return}}var y=e.current;for(q=y;q!==null;){s=q;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,q=b;else b:for(s=y;q!==null;){if(c=q,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Cc(9,c)}}catch(e){Gl(c,c.return,e)}if(c===s){q=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,q=x;break b}q=c.return}}if(qc=a,oa(),yt&&typeof yt.onPostCommitFiberRoot==`function`)try{yt.onPostCommitFiberRoot(vt,e)}catch{}i=!0}return i}finally{Lt=n,Kc.transition=t}}return!1}function Wl(e,t,n){t=Os(n,t),t=Ms(e,t,1),e=Qa(e,t,1),t=yl(),e!==null&&(Pt(e,1,t),Sl(e,t))}function Gl(e,t,n){if(e.tag===3)Wl(e,e,n);else for(;t!==null;){if(t.tag===3){Wl(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(dl===null||!dl.has(r))){e=Os(n,e),e=Ns(t,e,1),t=Qa(t,e,1),e=yl(),t!==null&&(Pt(t,1,e),Sl(t,e));break}}t=t.return}}function Kl(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=yl(),e.pingedLanes|=e.suspendedLanes&n,Jc===e&&(Xc&n)===n&&($c===4||$c===3&&(Xc&130023424)===Xc&&500>dt()-ol?Ml(e,0):rl|=n),Sl(e,t)}function ql(e,t){t===0&&(e.mode&1?(t=Et,Et<<=1,!(Et&130023424)&&(Et=4194304)):t=1);var n=yl();e=qa(e,t),e!==null&&(Pt(e,t,n),Sl(e,n))}function Jl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ql(e,n)}function Yl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),ql(e,n)}var Xl=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ki.current)Rs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Rs=!1,sc(e,t,n);Rs=!!(e.flags&131072)}else Rs=!1,Sa&&t.flags&1048576&&_a(t,ua,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;ac(e,t),e=t.pendingProps;var a=Ji(t,Gi.current);Ha(t,n),a=Ho(null,t,i,e,a,n);var o=Uo();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yi(i)?(o=!0,$i(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ya(t),a.updater=ao,t.stateNode=a,a._reactInternals=t,lo(t,i,e,n),t=qs(null,t,i,!0,o,n)):(t.tag=0,Sa&&o&&va(t),zs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(ac(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=tu(i),e=Pa(i,e),a){case 0:t=Gs(null,t,i,e,n);break a;case 1:t=Ks(null,t,i,e,n);break a;case 11:t=Bs(null,t,i,e,n);break a;case 14:t=Vs(null,t,i,Pa(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Pa(i,a),Gs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Pa(i,a),Ks(e,t,i,a,n);case 3:a:{if(Js(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,Xa(e,t),to(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Os(Error(r(423)),t),t=Ys(e,t,i,n,a);break a}else if(i!==a){a=Os(Error(r(424)),t),t=Ys(e,t,i,n,a);break a}else for(xa=Ei(t.stateNode.containerInfo.firstChild),ba=t,Sa=!0,Ca=null,n=go(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ja(),i===a){t=oc(e,t,n);break a}zs(e,t,i,n)}t=t.child}return t;case 5:return wo(t),e===null&&Da(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,yi(i,a)?s=null:o!==null&&yi(i,o)&&(t.flags|=32),Ws(e,t),zs(e,t,s,n),t.child;case 6:return e===null&&Da(t),null;case 13:return Qs(e,t,n);case 4:return So(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ho(t,null,i,n):zs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Pa(i,a),Bs(e,t,i,a,n);case 7:return zs(e,t,t.pendingProps,n),t.child;case 8:return zs(e,t,t.pendingProps.children,n),t.child;case 12:return zs(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Ui(Fa,i._currentValue),i._currentValue=s,o!==null)if(wr(o.value,s)){if(o.children===a.children&&!Ki.current){t=oc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=Za(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Va(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Va(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}zs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ha(t,n),a=Ua(a),i=i(a),t.flags|=1,zs(e,t,i,n),t.child;case 14:return i=t.type,a=Pa(i,t.pendingProps),a=Pa(i.type,a),Vs(e,t,i,a,n);case 15:return Hs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Pa(i,a),ac(e,t),t.tag=1,Yi(i)?(e=!0,$i(t)):e=!1,Ha(t,n),so(t,i,a),lo(t,i,a,n),qs(null,t,i,!0,e,n);case 19:return ic(e,t,n);case 22:return Us(e,t,n)}throw Error(r(156,t.tag))};function Zl(e,t){return ct(e,t)}function Ql(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $l(e,t,n,r){return new Ql(e,t,n,r)}function eu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tu(e){if(typeof e==`function`)return+!!eu(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function nu(e,t){var n=e.alternate;return n===null?(n=$l(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ru(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)eu(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return iu(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=$l(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=$l(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=$l(19,n,t,a),e.elementType=N,e.lanes=o,e;case I:return au(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=$l(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function iu(e,t,n,r){return e=$l(7,e,r,t),e.lanes=n,e}function au(e,t,n,r){return e=$l(22,e,r,t),e.elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function ou(e,t,n){return e=$l(6,e,null,t),e.lanes=n,e}function su(e,t,n){return t=$l(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function cu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Nt(0),this.expirationTimes=Nt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function lu(e,t,n,r,i,a,o,s,c){return e=new cu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=$l(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ya(a),e}function uu(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function du(e){if(!e)return Wi;e=e._reactInternals;a:{if(rt(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(Yi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(Yi(n))return Qi(e,n,t)}return t}function fu(e,t,n,r,i,a,o,s,c){return e=lu(n,r,!0,e,i,a,o,s,c),e.context=du(null),n=e.current,r=yl(),i=bl(n),a=Za(r,i),a.callback=t??null,Qa(n,a,i),e.current.lanes=i,Pt(e,i,r),Sl(e,r),e}function pu(e,t,n,r){var i=t.current,a=yl(),o=bl(i);return n=du(n),t.context===null?t.context=n:t.pendingContext=n,t=Za(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Qa(i,t,o),e!==null&&(xl(e,i,o,a),$a(e,i,o)),o}function mu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function hu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gu(e,t){hu(e,t),(e=e.alternate)&&hu(e,t)}function _u(){return null}var vu=typeof reportError==`function`?reportError:function(e){console.error(e)};function yu(e){this._internalRoot=e}bu.prototype.render=yu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));pu(e,t,null,null)},bu.prototype.unmount=yu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Al(function(){pu(null,e,null,null)}),t[ji]=null}};function bu(e){this._internalRoot=e}bu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ht();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Zt.length&&t!==0&&t<Zt[n].priority;n++);Zt.splice(n,0,e),n===0&&G(e)}};function xu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Su(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function Cu(){}function wu(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=mu(o);a.call(e)}}var o=fu(t,r,e,0,null,!1,!1,``,Cu);return e._reactRootContainer=o,e[ji]=o.current,ai(e.nodeType===8?e.parentNode:e),Al(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=mu(c);s.call(e)}}var c=lu(e,0,!1,null,null,!1,!1,``,Cu);return e._reactRootContainer=c,e[ji]=c.current,ai(e.nodeType===8?e.parentNode:e),Al(function(){pu(t,c,n,r)}),c}function Tu(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=mu(o);s.call(e)}}pu(t,o,e,i)}else o=wu(n,t,e,i,r);return mu(o)}zt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Dt(t.pendingLanes);n!==0&&(It(t,n|1),Sl(t,dt()),!(qc&6)&&(sl=dt()+500,oa()))}break;case 13:Al(function(){var t=qa(e,1);t!==null&&xl(t,e,1,yl())}),gu(e,1)}},Bt=function(e){if(e.tag===13){var t=qa(e,134217728);t!==null&&xl(t,e,134217728,yl()),gu(e,134217728)}},Vt=function(e){if(e.tag===13){var t=bl(e),n=qa(e,t);n!==null&&xl(n,e,t,yl()),gu(e,t)}},Ht=function(){return Lt},Ut=function(e,t){var n=Lt;try{return Lt=e,t()}finally{Lt=n}},Le=function(e,t,n){switch(t){case`input`:if(ge(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Ri(i);if(!a)throw Error(r(90));de(i),ge(i,a)}}}break;case`textarea`:Se(e,n);break;case`select`:t=n.value,t!=null&&be(e,!!n.multiple,t,!1)}},Ue=kl,We=Al;var Eu={usingClientEntryPoint:!1,Events:[Ii,Li,Ri,Ve,He,kl]},Du={findFiberByHostInstance:Fi,bundleType:0,version:`18.2.0`,rendererPackageName:`react-dom`},Ou={bundleType:Du.bundleType,version:Du.version,rendererPackageName:Du.rendererPackageName,rendererConfig:Du.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ot(e),e===null?null:e.stateNode},findFiberByHostInstance:Du.findFiberByHostInstance||_u,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.2.0-next-9e3b772b8-20220608`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ku=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ku.isDisabled&&ku.supportsFiber)try{vt=ku.inject(Ou),yt=ku}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Eu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xu(t))throw Error(r(200));return uu(e,t,null,n)},e.createRoot=function(e,t){if(!xu(e))throw Error(r(299));var n=!1,i=``,a=vu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=lu(e,1,!1,null,null,n,!1,i,a),e[ji]=t.current,ai(e.nodeType===8?e.parentNode:e),new yu(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=ot(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Al(e)},e.hydrate=function(e,t,n){if(!Su(t))throw Error(r(200));return Tu(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!xu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=vu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=fu(t,null,e,1,n??null,a,!1,o,s),e[ji]=t.current,ai(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new bu(t)},e.render=function(e,t,n){if(!Su(t))throw Error(r(200));return Tu(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!Su(e))throw Error(r(40));return e._reactRootContainer?(Al(function(){Tu(null,null,e,!1,function(){e._reactRootContainer=null,e[ji]=null})}),!0):!1},e.unstable_batchedUpdates=kl,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Su(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Tu(e,t,n,!1,i)},e.version=`18.2.0-next-9e3b772b8-20220608`})),_=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=s((e=>{var t=_();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),y=u(p()),b=u(v(),1),x=u(_());function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S.apply(this,arguments)}var C;(function(e){e.Pop=`POP`,e.Push=`PUSH`,e.Replace=`REPLACE`})(C||={});var w=`popstate`;function T(e){e===void 0&&(e={});function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return A(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:j(t)}return N(t,n,null,e)}function E(e,t){if(e===!1||e==null)throw Error(t)}function D(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function O(){return Math.random().toString(36).substr(2,8)}function k(e,t){return{usr:e.state,key:e.key,idx:t}}function A(e,t,n,r){return n===void 0&&(n=null),S({pathname:typeof e==`string`?e:e.pathname,search:``,hash:``},typeof t==`string`?M(t):t,{state:n,key:t&&t.key||r||O()})}function j(e){let{pathname:t=`/`,search:n=``,hash:r=``}=e;return n&&n!==`?`&&(t+=n.charAt(0)===`?`?n:`?`+n),r&&r!==`#`&&(t+=r.charAt(0)===`#`?r:`#`+r),t}function M(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function N(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=C.Pop,c=null,l=u();l??(l=0,o.replaceState(S({},o.state,{idx:l}),``));function u(){return(o.state||{idx:null}).idx}function d(){s=C.Pop;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=C.Push;let r=A(h.location,e,t);n&&n(r,e),l=u()+1;let d=k(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=C.Replace;let r=A(h.location,e,t);n&&n(r,e),l=u();let i=k(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:j(e);return n=n.replace(/ $/,`%20`),E(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(w,d),c=e,()=>{i.removeEventListener(w,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}var P;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(P||={});function F(e,t,n){return n===void 0&&(n=`/`),I(e,t,n,!1)}function I(e,t,n,r){let i=pe((typeof t==`string`?M(t):t).pathname||`/`,n);if(i==null)return null;let a=L(e);z(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=fe(i);o=le(a[e],t,r)}return o}function L(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r=``);let i=(e,i,a)=>{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(E(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=B([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(E(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),L(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:se(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of R(e.path))i(e,t,n)}),t}function R(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=R(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function z(e){e.sort((e,t)=>e.score===t.score?ce(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ee=/^:[\w-]+$/,te=3,ne=2,re=1,ie=10,ae=-2,oe=e=>e===`*`;function se(e,t){let n=e.split(`/`),r=n.length;return n.some(oe)&&(r+=ae),t&&(r+=ne),n.filter(e=>!oe(e)).reduce((e,t)=>e+(ee.test(t)?te:t===``?re:ie),r)}function ce(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function le(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=ue({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=ue({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:B([a,u.pathname]),pathnameBase:Se(B([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=B([a,u.pathnameBase]))}return o}function ue(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=de(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function de(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),D(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "`+e+`" will be treated as if it were `+(`"`+e.replace(/\*$/,`/*`)+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+(`please change the route path to "`+e.replace(/\*$/,`/*`)+`".`));let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function fe(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return D(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function pe(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var me=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,he=e=>me.test(e);function ge(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?M(e):e,a;if(n)if(he(n))a=n;else{if(n.includes(`//`)){let e=n;n=n.replace(/\/\/+/g,`/`),D(!1,`Pathnames cannot have embedded double slashes - normalizing `+(e+` -> `+n))}a=n.startsWith(`/`)?_e(n.substring(1),`/`):_e(n,t)}else a=t;return{pathname:a,search:Ce(r),hash:we(i)}}function _e(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ve(e,t,n,r){return`Cannot include a '`+e+`' character in a manually specified `+("`to."+t+"` field ["+JSON.stringify(r)+`]. Please separate it out to the `)+("`to."+n+"` field. Alternatively you may provide the full path as ")+`a string in <Link to="..."> and the router will parse it for you.`}function ye(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function be(e,t){let n=ye(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function xe(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=M(e):(i=S({},e),E(!i.pathname||!i.pathname.includes(`?`),ve(`?`,`pathname`,`search`,i)),E(!i.pathname||!i.pathname.includes(`#`),ve(`#`,`pathname`,`hash`,i)),E(!i.search||!i.search.includes(`#`),ve(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=ge(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var B=e=>e.join(`/`).replace(/\/\/+/g,`/`),Se=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Ce=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,we=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e;function Te(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var Ee=[`post`,`put`,`patch`,`delete`];new Set(Ee);var V=[`get`,...Ee];new Set(V);function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},De.apply(this,arguments)}var Oe=y.createContext(null),ke=y.createContext(null),Ae=y.createContext(null),je=y.createContext(null),Me=y.createContext({outlet:null,matches:[],isDataRoute:!1}),Ne=y.createContext(null);function Pe(e,t){let{relative:n}=t===void 0?{}:t;!Fe()&&E(!1);let{basename:r,navigator:i}=y.useContext(Ae),{hash:a,pathname:o,search:s}=Ue(e,{relative:n}),c=o;return r!==`/`&&(c=o===`/`?r:B([r,o])),i.createHref({pathname:c,search:s,hash:a})}function Fe(){return y.useContext(je)!=null}function Ie(){return!Fe()&&E(!1),y.useContext(je).location}function Le(e){y.useContext(Ae).static||y.useLayoutEffect(e)}function Re(){let{isDataRoute:e}=y.useContext(Me);return e?rt():ze()}function ze(){!Fe()&&E(!1);let e=y.useContext(Oe),{basename:t,future:n,navigator:r}=y.useContext(Ae),{matches:i}=y.useContext(Me),{pathname:a}=Ie(),o=JSON.stringify(be(i,n.v7_relativeSplatPath)),s=y.useRef(!1);return Le(()=>{s.current=!0}),y.useCallback(function(n,i){if(i===void 0&&(i={}),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=xe(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:B([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}var Be=y.createContext(null);function Ve(e){let t=y.useContext(Me).outlet;return t&&y.createElement(Be.Provider,{value:e},t)}function He(){let{matches:e}=y.useContext(Me),t=e[e.length-1];return t?t.params:{}}function Ue(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(Ae),{matches:i}=y.useContext(Me),{pathname:a}=Ie(),o=JSON.stringify(be(i,r.v7_relativeSplatPath));return y.useMemo(()=>xe(e,JSON.parse(o),a,n===`path`),[e,o,a,n])}function We(e,t){return Ge(e,t)}function Ge(e,t,n,r){!Fe()&&E(!1);let{navigator:i}=y.useContext(Ae),{matches:a}=y.useContext(Me),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:`/`;o&&o.route;let l=Ie(),u;if(t){let e=typeof t==`string`?M(t):t;!(c===`/`||e.pathname?.startsWith(c))&&E(!1),u=e}else u=l;let d=u.pathname||`/`,f=d;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=F(e,{pathname:f}),m=H(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:B([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:B([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,n,r);return t&&m?y.createElement(je.Provider,{value:{location:De({pathname:`/`,search:``,hash:``,state:null,key:`default`},u),navigationType:C.Pop}},m):m}function Ke(){let e=nt(),t=Te(e)?e.status+` `+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return y.createElement(y.Fragment,null,y.createElement(`h2`,null,`Unexpected Application Error!`),y.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?y.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var qe=y.createElement(Ke,null),Je=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error(`React Router caught the following error during render`,e,t)}render(){return this.state.error===void 0?this.props.children:y.createElement(Me.Provider,{value:this.props.routeContext},y.createElement(Ne.Provider,{value:this.state.error,children:this.props.component}))}};function Ye(e){let{routeContext:t,match:n,children:r}=e,i=y.useContext(Oe);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Me.Provider,{value:t},r)}function H(e,t,n,r){if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);!(e>=0)&&E(!1),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&e[t.route.id]===void 0&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}return a.reduceRight((e,r,i)=>{let l,u=!1,d=null,f=null;n&&(l=o&&r.route.id?o[r.route.id]:void 0,d=r.route.errorElement||qe,s&&(c<0&&i===0?(U(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),u=!0,f=null):c===i&&(u=!0,f=r.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,i+1)),m=()=>{let t;return t=l?d:u?f:r.route.Component?y.createElement(r.route.Component,null):r.route.element?r.route.element:e,y.createElement(Ye,{match:r,routeContext:{outlet:e,matches:p,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?y.createElement(Je,{location:n.location,revalidation:n.revalidation,component:d,error:l,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}var Xe=function(e){return e.UseBlocker=`useBlocker`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e}(Xe||{}),Ze=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}(Ze||{});function Qe(e){let t=y.useContext(Oe);return!t&&E(!1),t}function $e(e){let t=y.useContext(ke);return!t&&E(!1),t}function et(e){let t=y.useContext(Me);return!t&&E(!1),t}function tt(e){let t=et(e),n=t.matches[t.matches.length-1];return!n.route.id&&E(!1),n.route.id}function nt(){let e=y.useContext(Ne),t=$e(Ze.UseRouteError),n=tt(Ze.UseRouteError);return e===void 0?t.errors?.[n]:e}function rt(){let{router:e}=Qe(Xe.UseNavigateStable),t=tt(Ze.UseNavigateStable),n=y.useRef(!1);return Le(()=>{n.current=!0}),y.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r==`number`?e.navigate(r):e.navigate(r,De({fromRouteId:t},i)))},[e,t])}var it={};function U(e,t,n){!t&&!it[e]&&(it[e]=!0)}var at=(e,t,n)=>(``+t+("You can use the `"+e+"` future flag to opt-in early. ")+(`For more information, see `+n+`.`),void 0);function ot(e,t){e?.v7_startTransition===void 0&&at(`v7_startTransition`,"React Router will begin wrapping state updates in `React.startTransition` in v7",`https://reactrouter.com/v6/upgrading/future#v7_starttransition`),e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath===void 0)&&at(`v7_relativeSplatPath`,`Relative route resolution within Splat routes is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath`),t&&(t.v7_fetcherPersist===void 0&&at(`v7_fetcherPersist`,`The persistence behavior of fetchers is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist`),t.v7_normalizeFormMethod===void 0&&at(`v7_normalizeFormMethod`,"Casing of `formMethod` fields is being normalized to uppercase in v7",`https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod`),t.v7_partialHydration===void 0&&at(`v7_partialHydration`,"`RouterProvider` hydration behavior is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_partialhydration`),t.v7_skipActionErrorRevalidation===void 0&&at(`v7_skipActionErrorRevalidation`,"The revalidation behavior after 4xx/5xx `action` responses is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation`))}y.startTransition;function st(e){let{to:t,replace:n,state:r,relative:i}=e;!Fe()&&E(!1);let{future:a,static:o}=y.useContext(Ae),{matches:s}=y.useContext(Me),{pathname:c}=Ie(),l=Re(),u=xe(t,be(s,a.v7_relativeSplatPath),c,i===`path`),d=JSON.stringify(u);return y.useEffect(()=>l(JSON.parse(d),{replace:n,state:r,relative:i}),[l,d,i,n,r]),null}function ct(e){return Ve(e.context)}function W(e){E(!1)}function lt(e){let{basename:t=`/`,children:n=null,location:r,navigationType:i=C.Pop,navigator:a,static:o=!1,future:s}=e;Fe()&&E(!1);let c=t.replace(/^\/*/,`/`),l=y.useMemo(()=>({basename:c,navigator:a,static:o,future:De({v7_relativeSplatPath:!1},s)}),[c,s,a,o]);typeof r==`string`&&(r=M(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`}=r,h=y.useMemo(()=>{let e=pe(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m},navigationType:i}},[c,u,d,f,p,m,i]);return h==null?null:y.createElement(Ae.Provider,{value:l},y.createElement(je.Provider,{children:n,value:h}))}function ut(e){let{children:t,location:n}=e;return We(ft(t),n)}var dt=function(e){return e[e.pending=0]=`pending`,e[e.success=1]=`success`,e[e.error=2]=`error`,e}(dt||{});new Promise(()=>{}),y.Component;function ft(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(e,r)=>{if(!y.isValidElement(e))return;let i=[...t,r];if(e.type===y.Fragment){n.push.apply(n,ft(e.props.children,i));return}e.type!==W&&E(!1),!(!e.props.index||!e.props.children)&&E(!1);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=ft(e.props.children,i)),n.push(a)}),n}function pt(){return pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pt.apply(this,arguments)}function mt(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function ht(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function gt(e,t){return e.button===0&&(!t||t===`_self`)&&!ht(e)}function _t(e){return e===void 0&&(e=``),new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function vt(e,t){let n=_t(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var yt=[`onClick`,`relative`,`reloadDocument`,`replace`,`state`,`target`,`to`,`preventScrollReset`,`viewTransition`],bt=[`aria-current`,`caseSensitive`,`className`,`end`,`style`,`to`,`viewTransition`,`children`],xt=`6`;try{window.__reactRouterVersion=xt}catch{}var St=y.createContext({isTransitioning:!1}),Ct=y.startTransition;x.flushSync,y.useId;function wt(e){let{basename:t,children:n,future:r,window:i}=e,a=y.useRef();a.current??=T({window:i,v5Compat:!0});let o=a.current,[s,c]=y.useState({action:o.action,location:o.location}),{v7_startTransition:l}=r||{},u=y.useCallback(e=>{l&&Ct?Ct(()=>c(e)):c(e)},[c,l]);return y.useLayoutEffect(()=>o.listen(u),[o,u]),y.useEffect(()=>ot(r),[r]),y.createElement(lt,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}var Tt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Et=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dt=y.forwardRef(function(e,t){let{onClick:n,relative:r,reloadDocument:i,replace:a,state:o,target:s,to:c,preventScrollReset:l,viewTransition:u}=e,d=mt(e,yt),{basename:f}=y.useContext(Ae),p,m=!1;if(typeof c==`string`&&Et.test(c)&&(p=c,Tt))try{let e=new URL(window.location.href),t=c.startsWith(`//`)?new URL(e.protocol+c):new URL(c),n=pe(t.pathname,f);t.origin===e.origin&&n!=null?c=n+t.search+t.hash:m=!0}catch{}let h=Pe(c,{relative:r}),g=Mt(c,{replace:a,state:o,target:s,preventScrollReset:l,relative:r,viewTransition:u});function _(e){n&&n(e),e.defaultPrevented||g(e)}return y.createElement(`a`,pt({},d,{href:p||h,onClick:m||i?n:_,ref:t,target:s}))}),Ot=y.forwardRef(function(e,t){let{"aria-current":n=`page`,caseSensitive:r=!1,className:i=``,end:a=!1,style:o,to:s,viewTransition:c,children:l}=e,u=mt(e,bt),d=Ue(s,{relative:u.relative}),f=Ie(),p=y.useContext(ke),{navigator:m,basename:h}=y.useContext(Ae),g=p!=null&&Pt(d)&&c===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;r||(v=v.toLowerCase(),b=b?b.toLowerCase():null,_=_.toLowerCase()),b&&h&&(b=pe(b,h)||b);let x=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,S=v===_||!a&&v.startsWith(_)&&v.charAt(x)===`/`,C=b!=null&&(b===_||!a&&b.startsWith(_)&&b.charAt(_.length)===`/`),w={isActive:S,isPending:C,isTransitioning:g},T=S?n:void 0,E;E=typeof i==`function`?i(w):[i,S?`active`:null,C?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let D=typeof o==`function`?o(w):o;return y.createElement(Dt,pt({},u,{"aria-current":T,className:E,ref:t,style:D,to:s,viewTransition:c}),typeof l==`function`?l(w):l)}),kt;(function(e){e.UseScrollRestoration=`useScrollRestoration`,e.UseSubmit=`useSubmit`,e.UseSubmitFetcher=`useSubmitFetcher`,e.UseFetcher=`useFetcher`,e.useViewTransitionState=`useViewTransitionState`})(kt||={});var At;(function(e){e.UseFetcher=`useFetcher`,e.UseFetchers=`useFetchers`,e.UseScrollRestoration=`useScrollRestoration`})(At||={});function jt(e){let t=y.useContext(Oe);return!t&&E(!1),t}function Mt(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,c=Re(),l=Ie(),u=Ue(e,{relative:o});return y.useCallback(t=>{gt(t,n)&&(t.preventDefault(),c(e,{replace:r===void 0?j(l)===j(u):r,state:i,preventScrollReset:a,relative:o,viewTransition:s}))},[l,c,u,r,i,n,e,a,o,s])}function Nt(e){let t=y.useRef(_t(e)),n=y.useRef(!1),r=Ie(),i=y.useMemo(()=>vt(r.search,n.current?null:t.current),[r.search]),a=Re();return[i,y.useCallback((e,t)=>{let r=_t(typeof e==`function`?e(i):e);n.current=!0,a(`?`+r,t)},[a,i])]}function Pt(e,t){t===void 0&&(t={});let n=y.useContext(St);n??E(!1);let{basename:r}=jt(kt.useViewTransitionState),i=Ue(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=pe(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=pe(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ue(i.pathname,o)!=null||ue(i.pathname,a)!=null}function Ft(e,t={}){let n=t.baseMs??500,r=t.maxMs??3e4,i=t.jitterFactor??.2,a=Math.min(r,n*2**Math.max(0,e-1)),o=a*i*Math.random();return Math.round(a+o)}var It=class extends Error{constructor(e){super(e),this.name=`GatewayClientError`}},Lt=class extends It{constructor(e){super(e),this.name=`GatewayClientTimeoutError`}},Rt=class extends It{constructor(e){super(e),this.name=`GatewayClientDisconnectedError`}};function zt(e){let t=new WebSocket(e);return{send(e){t.send(e)},close(e,n){t.close(e,n)},onOpen(e){t.addEventListener(`open`,e)},onMessage(e){t.addEventListener(`message`,t=>e(String(t.data)))},onClose(e){t.addEventListener(`close`,t=>e({code:t.code,reason:t.reason}))},onError(e){t.addEventListener(`error`,e)}}}var Bt=class{socket=null;pending=new Map;listeners=new Map;runSubscriptions=new Map;sessionSubscriptions=new Map;requestTimeoutMs;shouldReconnect;reconnectTimer=null;reconnectAttempt=0;closedManually=!1;ready=!1;nextId=0;constructor(e){this.options=e,this.requestTimeoutMs=e.requestTimeoutMs??1e4,this.shouldReconnect=e.shouldReconnect??!0}async connect(){this.closedManually=!1,await this.openSocket()}async close(){this.closedManually=!0,this.ready=!1,this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null),this.socket?.close(1e3,`client close`),this.socket=null}async request(e){let t=typeof e.id==`string`?e.id:this.allocateId(),n={...e,id:t},r=this.socket;if(!r)throw new Rt(`Gateway socket is not connected`);return await new Promise((e,i)=>{let a=setTimeout(()=>{this.pending.delete(t),i(new Lt(`Timed out waiting for response to frame ${t}`))},this.requestTimeoutMs);this.pending.set(t,{resolve:e,reject:i,timer:a}),r.send(JSON.stringify(n))})}async startSession(e){return await this.request({type:`session.start`,...e})}async sendSessionMessage(e){return await this.request({type:`session.message`,...e})}subscribeRun(e,t){return this.runSubscriptions.set(e,{runId:e,sinceSeq:this.runSubscriptions.get(e)?.sinceSeq??0,callback:t}),this.sendFrame({type:`subscribe`,runId:e,sinceSeq:this.runSubscriptions.get(e)?.sinceSeq}),()=>{this.runSubscriptions.delete(e),this.sendFrame({type:`unsubscribe`,runId:e})}}subscribeSession(e,t){return this.sessionSubscriptions.set(e,{sessionId:e,callback:t}),this.sendFrame({type:`session.subscribe`,sessionId:e}),()=>{this.sessionSubscriptions.delete(e),this.sendFrame({type:`session.unsubscribe`,sessionId:e})}}on(e,t){let n=this.listeners.get(e);return n||(n=new Set,this.listeners.set(e,n)),n.add(t),()=>{n?.delete(t)}}async openSocket(){let e=(this.options.createSocket??zt)(this.options.url,this.options.token);this.socket=e,this.ready=!1;let t=!1;await new Promise((n,r)=>{e.onOpen(()=>{e.send(JSON.stringify({type:`auth`,token:this.options.token}))}),e.onError(e=>{this.emit(`error`,e),t||r(e)}),e.onMessage(e=>{this.handleMessage(e),t||JSON.parse(e).type===`hello`&&(t=!0,this.ready=!0,this.reconnectAttempt=0,this.emit(`connected`),this.replaySubscriptions(),n())}),e.onClose(e=>{if(this.ready=!1,this.emit(`disconnected`,e??{}),!t){r(new Rt(`Gateway socket closed before authentication completed`));return}!this.closedManually&&this.shouldReconnect&&this.scheduleReconnect()})})}sendFrame(e){!this.socket||!this.ready||this.socket.send(JSON.stringify(e))}handleMessage(e){let t=JSON.parse(e),n=typeof t.id==`string`?t.id:null;if(n){let e=this.pending.get(n);e&&(clearTimeout(e.timer),this.pending.delete(n),e.resolve(t))}if(t.type===`run.event`&&typeof t.runId==`string`&&typeof t.seq==`number`){let e=this.runSubscriptions.get(t.runId);e&&(e.sinceSeq=Math.max(e.sinceSeq,Number(t.seq)),e.callback?.(t))}if(t.type===`hook.request`){let e=t;this.runSubscriptions.get(e.runId)?.callback?.({type:`run.event`,runId:e.runId,seq:e.deadlineTs,source:`gateway`,event:e})}this.emit(`frame`,t)}replaySubscriptions(){for(let e of this.runSubscriptions.values())this.sendFrame({type:`subscribe`,runId:e.runId,sinceSeq:e.sinceSeq});for(let e of this.sessionSubscriptions.values())this.sendFrame({type:`session.subscribe`,sessionId:e.sessionId})}scheduleReconnect(){let e=Ft(++this.reconnectAttempt);this.reconnectTimer=setTimeout(()=>{this.openSocket().catch(e=>{this.emit(`error`,e),this.scheduleReconnect()})},e)}emit(e,...t){let n=this.listeners.get(e);if(n)for(let e of n)e(...t)}allocateId(){return this.nextId+=1,`req-${this.nextId}`}},Vt=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Ht=(e=>e?Vt(e):Vt);function Ut(){return{seqs:[],sources:[],events:[]}}function Wt(e,t,n,r){let i=0,a=e.seqs.length;for(;i<a;){let n=Math.floor((i+a)/2),r=e.seqs[n];if(r===t)return e;r<t?i=n+1:a=n}return{seqs:[...e.seqs.slice(0,i),t,...e.seqs.slice(i)],sources:[...e.sources.slice(0,i),n,...e.sources.slice(i)],events:[...e.events.slice(0,i),r,...e.events.slice(i)]}}function Gt(e){return Ht((t,n)=>({client:e,connection:{status:`disconnected`,error:null},agents:{items:[],byId:{}},sessions:{byId:{}},runs:{byId:{}},events:{byRunId:{}},hooks:{byRunId:{}},actions:{setConnection(e,n=null){t(t=>({...t,connection:{status:e,error:n}}))},setAgents(e){t(t=>({...t,agents:{items:e.map(e=>e.agent),byId:Object.fromEntries(e.map(e=>[e.agent,e]))}}))},mergeSession(e,n){t(t=>({...t,sessions:{byId:{...t.sessions.byId,[e]:{...t.sessions.byId[e]??{},sessionId:e,...n}}}}))},mergeRun(e,n){t(t=>({...t,runs:{byId:{...t.runs.byId,[e]:{...t.runs.byId[e]??{},runId:e,...n}}}}))},mergeRunEvent(e,n,r,i){t(t=>{let a=t.events.byRunId[e]??Ut(),o=Wt(a,n,r,i);return o===a?t:{...t,events:{byRunId:{...t.events.byRunId,[e]:o}}}})},addHookRequest(e){t(t=>({...t,hooks:{byRunId:{...t.hooks.byRunId,[e.runId]:[...(t.hooks.byRunId[e.runId]??[]).filter(t=>t.hookRequestId!==e.hookRequestId),e]}}}))},resolveHookRequest(e,n){t(t=>({...t,hooks:{byRunId:{...t.hooks.byRunId,[e]:(t.hooks.byRunId[e]??[]).filter(e=>e.hookRequestId!==n)}}}))}}}))}var Kt=[];function qt(e,t){if(t)return e.hooks.byRunId[t]??Kt;let n=Object.values(e.hooks.byRunId).flat();return n.length>0?n:Kt}function Jt(e,t=180){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,Math.max(0,t-1))}…`}function Yt(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Xt(e){if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e==`string`){let t=Date.parse(e);if(Number.isFinite(t))return t}return null}function Zt(e,t,n){let r=t!=null&&n!=null?Math.max(0,n-t):0;return r>0?Math.max(1,Math.min(10,Math.round(r/1e3)+1)):Math.max(1,Math.min(7,Math.ceil(Math.max(16,e.length)/28)))}function Qt(e,t){for(let n of t)n.length===0||e.includes(n)||e.push(n)}function $t(e,t=0,n=new Set){if(t>3||e==null)return n;if(typeof e==`string`)return(/[\\/]/.test(e)||e.endsWith(`.ts`)||e.endsWith(`.tsx`)||e.endsWith(`.js`)||e.endsWith(`.json`)||e.endsWith(`.md`))&&n.add(e),n;if(Array.isArray(e)){for(let r of e)$t(r,t+1,n);return n}if(typeof e==`object`)for(let[r,i]of Object.entries(e)){if(r===`path`||r===`paths`||r===`file`||r===`files`||r===`file_path`||r===`cwd`||r===`target`){$t(i,t+1,n);continue}t<2&&$t(i,t+1,n)}return n}function en(e,t){let n=e.timestamp??e.startedAt??0,r=t.timestamp??t.startedAt??0;return n===r?String(e.path??``).localeCompare(String(t.path??``)):n-r}function tn(e){return typeof e==`object`&&!!e}function G(e){return typeof e==`string`?e:null}function nn(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function rn(e){let t=e.timestamp;return typeof t==`string`||typeof t==`number`?t:void 0}function an(e){if(!tn(e))return null;let t={totalUsd:nn(e.totalUsd)??void 0,inputTokens:nn(e.inputTokens)??void 0,outputTokens:nn(e.outputTokens)??void 0,thinkingTokens:nn(e.thinkingTokens)??void 0,cachedTokens:nn(e.cachedTokens)??void 0,cacheCreationTokens:nn(e.cacheCreationTokens)??void 0,cacheReadTokens:nn(e.cacheReadTokens)??void 0};return Object.values(t).some(e=>e!=null)?t:null}function on(e){let t=G(e.toolCallId);if(!t)return null;let n=rn(e);switch(e.type){case`tool_call_start`:{let r=G(e.toolName),i=G(e.inputAccumulated);return r&&i!=null?{type:`tool_call_start`,toolCallId:t,toolName:r,inputAccumulated:i,timestamp:n}:null}case`tool_call_ready`:{let r=G(e.toolName);return r?{type:`tool_call_ready`,toolCallId:t,toolName:r,input:e.input,timestamp:n}:null}case`tool_input_delta`:{let r=G(e.inputAccumulated);return r==null?null:{type:`tool_input_delta`,toolCallId:t,inputAccumulated:r,timestamp:n}}case`tool_result`:{let r=G(e.toolName);return r?{type:`tool_result`,toolCallId:t,toolName:r,output:e.output,timestamp:n}:null}case`tool_error`:{let r=G(e.toolName),i=G(e.error);return r&&i!=null?{type:`tool_error`,toolCallId:t,toolName:r,error:i,timestamp:n}:null}default:return null}}function sn(e){let t=G(e.toolCallId),n=G(e.server),r=G(e.toolName);if(!t||!n||!r)return null;let i=rn(e);switch(e.type){case`mcp_tool_call_start`:return{type:`mcp_tool_call_start`,toolCallId:t,server:n,toolName:r,input:e.input,timestamp:i};case`mcp_tool_result`:return{type:`mcp_tool_result`,toolCallId:t,server:n,toolName:r,output:e.output,timestamp:i};case`mcp_tool_error`:{let a=G(e.error);return a==null?null:{type:`mcp_tool_error`,toolCallId:t,server:n,toolName:r,error:a,timestamp:i}}default:return null}}function cn(e){let t=G(e.agentName);if(!t)return null;let n=rn(e);switch(e.type){case`subagent_spawn`:{let r=G(e.prompt);return r==null?null:{type:`subagent_spawn`,agentName:t,prompt:r,timestamp:n}}case`subagent_result`:{let r=G(e.summary);return r==null?null:{type:`subagent_result`,agentName:t,summary:r,timestamp:n}}case`subagent_error`:{let r=G(e.error);return r==null?null:{type:`subagent_error`,agentName:t,error:r,timestamp:n}}default:return null}}function ln(e){let t=rn(e);switch(e.type){case`session_start`:case`session_resume`:case`session_end`:case`session_fork`:return{type:e.type,timestamp:t};case`turn_start`:case`turn_end`:{let n=nn(e.turnIndex);return n==null?null:{type:e.type,turnIndex:n,timestamp:t}}case`step_start`:{let n=G(e.stepType),r=nn(e.stepIndex);return n!=null&&r!=null?{type:`step_start`,stepType:n,stepIndex:r,timestamp:t}:null}case`step_end`:{let n=nn(e.stepIndex);return n==null?null:{type:`step_end`,stepIndex:n,timestamp:t}}default:return null}}function un(e){let t=G(e.path);if(!t)return null;let n=rn(e);switch(e.type){case`file_read`:case`file_write`:case`file_create`:case`file_delete`:return{type:e.type,path:t,timestamp:n};case`file_patch`:return{type:`file_patch`,path:t,diff:G(e.diff)??``,timestamp:n};default:return null}}function dn(e){let t=rn(e);switch(e.type){case`shell_start`:{let n=G(e.command);return n==null?null:{type:`shell_start`,command:n,timestamp:t}}case`shell_exit`:{let n=nn(e.exitCode);return n==null?null:{type:`shell_exit`,exitCode:n,timestamp:t}}case`plugin_loaded`:case`plugin_invoked`:{let n=G(e.pluginName),r=G(e.pluginId);return n&&r?{type:e.type,pluginName:n,pluginId:r,timestamp:t}:null}case`plugin_error`:{let n=G(e.pluginName),r=G(e.pluginId),i=G(e.error);return n&&r&&i!=null?{type:`plugin_error`,pluginName:n,pluginId:r,error:i,timestamp:t}:null}case`skill_loaded`:case`skill_invoked`:{let n=G(e.skillName);return n?{type:e.type,skillName:n,timestamp:t}:null}case`agentdoc_read`:{let n=G(e.path);return n?{type:`agentdoc_read`,path:n,timestamp:t}:null}case`image_output`:return{type:`image_output`,filePath:G(e.filePath)??void 0,timestamp:t};default:return null}}function fn(e){if(!tn(e))return null;let t=G(e.type);if(!t)return null;let n=e;switch(t){case`user_message`:{let e=G(n.text);return e==null?null:{type:t,text:e,sessionId:G(n.sessionId)??void 0,timestamp:rn(n)}}case`thinking_delta`:{let e=G(n.delta);return e==null?null:{type:t,delta:e,timestamp:rn(n)}}case`thinking_stop`:{let e=G(n.thinking);return e==null?null:{type:t,thinking:e,timestamp:rn(n)}}case`text_delta`:{let e=G(n.delta);return e==null?null:{type:t,delta:e,timestamp:rn(n)}}case`message_stop`:{let e=G(n.text);return e==null?null:{type:t,text:e,timestamp:rn(n)}}case`tool_call_start`:case`tool_call_ready`:case`tool_input_delta`:case`tool_result`:case`tool_error`:return on(n);case`mcp_tool_call_start`:case`mcp_tool_result`:case`mcp_tool_error`:return sn(n);case`subagent_spawn`:case`subagent_result`:case`subagent_error`:return cn(n);case`session_start`:case`session_resume`:case`session_end`:case`session_fork`:case`turn_start`:case`turn_end`:case`step_start`:case`step_end`:return ln(n);case`file_read`:case`file_write`:case`file_create`:case`file_delete`:case`file_patch`:return un(n);case`shell_start`:case`shell_exit`:case`plugin_loaded`:case`plugin_invoked`:case`plugin_error`:case`skill_loaded`:case`skill_invoked`:case`agentdoc_read`:case`image_output`:return dn(n);case`cost`:{let e=an(n.cost);return e?{type:`cost`,cost:e,timestamp:rn(n)}:null}case`error`:{let e=G(n.message)??G(n.error);return e==null?null:{type:`error`,message:e,timestamp:rn(n)}}default:return null}}function pn(e){if(!e)return[];let t=[];for(let n of e.events){let e=fn(n);e&&t.push(e)}return t}function mn(e){let t=typeof e.runId==`string`?e.runId:``;return t.length===0?null:{runId:t,agent:typeof e.agent==`string`&&e.agent.length>0?e.agent:`unknown`,status:typeof e.status==`string`&&e.status.length>0?e.status:`unknown`,startedAt:Xt(e.startedAt)??0}}function hn(e,t){let n={totalUsd:0,inputTokens:0,outputTokens:0,thinkingTokens:0,cachedTokens:0,cacheCreationTokens:0,cacheReadTokens:0},r=!1;for(let i of e)for(let e of pn(t[i]))e.type===`cost`&&(n.totalUsd=(n.totalUsd??0)+Number(e.cost.totalUsd??0),n.inputTokens=(n.inputTokens??0)+Number(e.cost.inputTokens??0),n.outputTokens=(n.outputTokens??0)+Number(e.cost.outputTokens??0),n.thinkingTokens=(n.thinkingTokens??0)+Number(e.cost.thinkingTokens??0),n.cachedTokens=(n.cachedTokens??0)+Number(e.cost.cachedTokens??0),n.cacheCreationTokens=(n.cacheCreationTokens??0)+Number(e.cost.cacheCreationTokens??0),n.cacheReadTokens=(n.cacheReadTokens??0)+Number(e.cost.cacheReadTokens??0),r=!0);return r?n:null}function gn(e,t){let n=[];for(let[r,i]of t.entries()){let t=`${e}:native:${r}`;if(i.role===`user`&&typeof i.content==`string`&&i.content.length>0){n.push({id:`${t}:user`,kind:`user`,label:`user`,text:i.content,runId:t,timestamp:r,filePaths:[]});continue}if(typeof i.thinking==`string`&&i.thinking.length>0&&n.push({id:`${t}:thinking`,kind:`thinking`,label:`thinking`,text:i.thinking,runId:t,timestamp:r+.1,filePaths:[]}),Array.isArray(i.toolCalls))for(let[e,a]of i.toolCalls.entries()){let i=[...$t(a.input),...$t(a.output)];n.push({id:`${t}:tool:${e}`,kind:`tool`,label:String(a.toolName??`tool`),text:Yt({input:a.input,output:a.output,durationMs:a.durationMs}),runId:t,timestamp:r+.2+e/10,filePaths:i})}if(i.role===`tool`&&i.toolResult){n.push({id:`${t}:tool-result`,kind:`tool`,label:String(i.toolResult.toolName??`tool`),text:Yt(i.toolResult.output),runId:t,timestamp:r+.25,filePaths:[...$t(i.toolResult.output)]});continue}if(i.role===`assistant`&&typeof i.content==`string`&&i.content.length>0){n.push({id:`${t}:assistant`,kind:`assistant`,label:`assistant`,text:i.content,runId:t,timestamp:r+.3,filePaths:[]});continue}i.role===`system`&&typeof i.content==`string`&&i.content.length>0&&n.push({id:`${t}:system`,kind:`system`,label:`system`,text:i.content,runId:t,timestamp:r+.4,filePaths:[]})}return n}function _n(e,t,n,r){if(t.length===0)return null;let i=gn(e,t).map((t,n)=>({id:`${e}:native:segment:${n}`,kind:t.kind,title:t.label,detail:Jt(t.text,220),weight:Zt(t.text,null,null),startedAt:typeof t.timestamp==`number`?t.timestamp:null,endedAt:typeof t.timestamp==`number`?t.timestamp:null,status:t.kind===`error`?`error`:`complete`,filePaths:t.filePaths})),a=i.filter(e=>e.kind===`tool`).length;return{runId:`${e}:native`,laneKey:`${e}:native`,agent:n,status:r,startedAt:0,lastEventAt:t.length,segmentCount:i.length,toolCount:a,totalUsd:null,segments:i}}function vn(e,t,n,r,i,a){let o=e.get(t)??{path:t,reads:0,writes:0,touches:0,lastEventAt:null,runIds:[],tools:[]};n===`read`?o.reads+=1:o.writes+=1,o.touches+=1,o.lastEventAt=i??o.lastEventAt,o.runIds.includes(r)||o.runIds.push(r),a&&!o.tools.includes(a)&&o.tools.push(a),e.set(t,o)}function yn(e,t){for(let n of t){let t=e.get(n.path);if(!t){e.set(n.path,{...n,runIds:[...n.runIds],tools:[...n.tools]});continue}t.reads+=n.reads,t.writes+=n.writes,t.touches+=n.touches,t.lastEventAt=Math.max(t.lastEventAt??0,n.lastEventAt??0)||null,Qt(t.runIds,n.runIds),Qt(t.tools,n.tools)}}function bn(e){return e.type===`turn_start`||e.type===`turn_end`?`turn ${String(e.turnIndex??`?`)}`:e.type===`step_start`||e.type===`step_end`?`step ${String((`stepType`in e?e.stepType:void 0)??e.stepIndex??`?`)}`:e.type===`session_start`||e.type===`session_resume`||e.type===`session_end`||e.type===`session_fork`?`session ${e.type.replace(`session_`,``)}`:e.type.replace(/_/g,` `)}function xn(e){switch(e.type){case`shell_start`:return`shell ${Jt(e.command,48)}`;case`shell_exit`:return`shell exit ${String(e.exitCode??`?`)}`;case`file_read`:case`file_write`:case`file_create`:case`file_delete`:case`file_patch`:return`${e.type.replace(`file_`,``)} ${Jt(e.path,36)}`;case`mcp_tool_call_start`:case`mcp_tool_result`:case`mcp_tool_error`:return`${e.toolName} · ${e.server}`;case`plugin_loaded`:case`plugin_invoked`:case`plugin_error`:return`${e.type.replace(`plugin_`,``)} ${e.pluginName??e.pluginId??`plugin`}`;case`skill_loaded`:case`skill_invoked`:return`${e.type.replace(`skill_`,``)} ${e.skillName}`;case`agentdoc_read`:return`agent doc ${Jt(e.path,36)}`;default:return e.type.replace(/_/g,` `)}}function Sn(e,t){return t?`${e} · ${t}`:e}function Cn(e,t){let n=[],r=[],i=[],a=new Map,o=new Map,s=``,c=null,l=``,u=null,d=0,f=0,p=!1,m=e.startedAt,h=(t,a,o,s,c,l,u)=>{let d=Jt(o.length>0?o:a,220),f=[...u?.filePaths??[]],p={id:`${e.runId}-${n.length}-${t}`,kind:t,title:a,detail:d,weight:Zt(d,s,c),startedAt:s,endedAt:c,status:l,secondaryLabel:u?.secondaryLabel,filePaths:f};if(n.push(p),i.push({id:`timeline-${p.id}`,runId:e.runId,laneKey:e.runId,kind:t,title:u?.secondaryLabel?Sn(a,u.secondaryLabel):a,detail:d,timestamp:s??c,status:l,filePaths:f}),u?.includeTranscript&&t!==`lifecycle`){let n=t===`user`||t===`assistant`||t===`thinking`||t===`tool`||t===`system`||t===`branch`?t:`error`;r.push({id:`transcript-${p.id}`,kind:n,label:u?.secondaryLabel?Sn(a,u.secondaryLabel):a,text:o,runId:e.runId,timestamp:s??c,status:l,filePaths:f})}},g=e=>{s&&(h(`assistant`,`assistant`,s,c,e??c,`complete`,{includeTranscript:!0}),s=``,c=null)},_=e=>{l&&(h(`thinking`,`thinking`,l,u,e??u,`complete`,{includeTranscript:!0}),l=``,u=null)};for(let n of t){let t=Xt(n.timestamp)??e.startedAt;if(m=Math.max(m,t),n.type===`cost`){f+=Number(n.cost.totalUsd??0),p=!0;continue}if(n.type===`user_message`){_(t),g(t),n.text.length>0&&h(`user`,`user`,n.text,t,t,`complete`,{includeTranscript:!0});continue}if(n.type===`thinking_delta`){u??=t,l+=n.delta;continue}if(n.type===`thinking_stop`){n.thinking.length>0&&(l=n.thinking),_(t);continue}if(n.type===`text_delta`){_(t),c??=t,s+=n.delta;continue}if(n.type===`message_stop`){_(t),n.text.length>0&&(s=n.text),g(t);continue}if(_(t),g(t),n.type===`tool_call_start`||n.type===`tool_call_ready`||n.type===`tool_input_delta`){let r=n.toolCallId,i=o.get(r),s=`toolName`in n?n.toolName:i?.toolName??`tool`,c=n.type===`tool_call_ready`?Yt(n.input):n.type===`tool_call_start`?n.inputAccumulated:n.inputAccumulated||i?.detail||``,l=[...$t(n.type===`tool_call_ready`?n.input:c)];for(let n of l)vn(a,n,`read`,e.runId,t,s);o.set(r,{toolName:s,startedAt:i?.startedAt??t,detail:c,filePaths:l});continue}if(n.type===`tool_result`||n.type===`tool_error`){let r=o.get(n.toolCallId),i=r?.toolName??n.toolName,s=n.type===`tool_error`?n.error:Yt(n.output),c=r?.filePaths??[],l=n.type===`tool_result`?[...$t(n.output),...$t(s)].filter(e=>!c.includes(e)):[],u=[...new Set([...c,...l])],f=/write|edit|patch/i.test(i);for(let n of f?c:l)vn(a,n,f?`write`:`read`,e.runId,t,i);h(n.type===`tool_error`?`error`:`tool`,i,s,r?.startedAt??t,t,n.type===`tool_error`?`error`:`complete`,{includeTranscript:!0,filePaths:u}),o.delete(n.toolCallId),d+=1;continue}if(n.type===`mcp_tool_call_start`){let r=Yt(n.input),i=[...$t(n.input)];for(let r of i)vn(a,r,`read`,e.runId,t,n.toolName);o.set(n.toolCallId,{toolName:n.toolName,secondaryLabel:n.server,startedAt:t,detail:r,filePaths:i});continue}if(n.type===`mcp_tool_result`||n.type===`mcp_tool_error`){let e=o.get(n.toolCallId),r=n.type===`mcp_tool_error`?n.error:Yt(n.output);h(n.type===`mcp_tool_error`?`error`:`tool`,e?.toolName??n.toolName,r,e?.startedAt??t,t,n.type===`mcp_tool_error`?`error`:`complete`,{secondaryLabel:e?.secondaryLabel??n.server,includeTranscript:!0,filePaths:e?.filePaths??[]}),o.delete(n.toolCallId),d+=1;continue}if(n.type===`subagent_spawn`||n.type===`subagent_result`||n.type===`subagent_error`){let e=n.type===`subagent_spawn`?n.prompt:n.type===`subagent_result`?n.summary:n.error;h(n.type===`subagent_error`?`error`:`branch`,n.agentName,e,t,t,n.type===`subagent_error`?`error`:`complete`,{includeTranscript:!0});continue}if(n.type===`session_start`||n.type===`session_resume`||n.type===`session_end`||n.type===`session_fork`||n.type===`turn_start`||n.type===`turn_end`||n.type===`step_start`||n.type===`step_end`){let e=bn(n);h(`lifecycle`,e,e,t,t,`complete`);continue}if(n.type===`file_read`||n.type===`file_write`||n.type===`file_create`||n.type===`file_delete`||n.type===`file_patch`){n.path.length>0&&vn(a,n.path,n.type===`file_read`?`read`:`write`,e.runId,t);let r=xn(n);h(`system`,r,r,t,t,`complete`,{includeTranscript:!0,filePaths:n.path.length>0?[n.path]:[]});continue}if(n.type===`shell_start`||n.type===`shell_exit`||n.type===`plugin_loaded`||n.type===`plugin_invoked`||n.type===`plugin_error`||n.type===`skill_loaded`||n.type===`skill_invoked`||n.type===`agentdoc_read`||n.type===`image_output`){let e=xn(n);h(n.type.endsWith(`error`)?`error`:`system`,e,e,t,t,n.type.endsWith(`error`)?`error`:`complete`,{includeTranscript:!0,filePaths:[...$t(n)]});continue}n.type===`error`&&h(`error`,`error`,n.message,t,t,`error`,{includeTranscript:!0})}_(m||null),g(m||null);for(let[t,n]of o.entries())h(`tool`,n.toolName,n.detail.length>0?n.detail:n.toolName,n.startedAt,n.startedAt,`running`,{secondaryLabel:n.secondaryLabel,includeTranscript:!0,filePaths:n.filePaths}),i[i.length-1].id=`timeline-${e.runId}-${t}-pending`,r[r.length-1].id=`transcript-${e.runId}-${t}-pending`,d+=1;return{lane:{runId:e.runId,laneKey:e.runId,agent:e.agent,status:e.status,startedAt:e.startedAt,lastEventAt:m,segmentCount:n.length,toolCount:d,totalUsd:p?f:null,segments:n},transcript:r,timeline:i,files:Array.from(a.values())}}function wn(e){return e.map(e=>({id:`${e.id}:timeline`,runId:e.runId,laneKey:e.runId,kind:e.kind,title:e.label,detail:e.text,timestamp:e.timestamp,status:e.status??`complete`,filePaths:e.filePaths}))}function Tn(e){let t=new Map;for(let n of e)for(let e of n.filePaths){let r=t.get(e)??{path:e,reads:0,writes:0,touches:0,lastEventAt:null,runIds:[],tools:[]};r.touches+=1,r.runIds.includes(n.runId)||r.runIds.push(n.runId),n.kind===`tool`&&!r.tools.includes(n.label)&&r.tools.push(n.label),typeof n.timestamp==`number`&&(r.lastEventAt=Math.max(r.lastEventAt??0,n.timestamp)||null),t.set(e,r)}return Array.from(t.values()).sort((e,t)=>e.touches===t.touches?(t.lastEventAt??0)-(e.lastEventAt??0):t.touches-e.touches)}function En(e,t){let n=e.map(e=>mn(e)).filter(e=>e!=null).sort((e,t)=>e.startedAt-t.startedAt),r=[],i=[],a=[],o=new Map;for(let e of n){let n=Cn(e,pn(t[e.runId]));r.push(n.lane),i.push(...n.transcript),a.push(...n.timeline),yn(o,n.files)}let s=[...a].sort(en),c=[...i].sort(en),l=Array.from(o.values()).sort((e,t)=>e.touches===t.touches?(t.lastEventAt??0)-(e.lastEventAt??0):t.touches-e.touches),u=0,d=!1,f=0,p=0,m=0;for(let e of r)f+=e.toolCount,m+=e.segmentCount,p+=e.segments.filter(e=>e.kind===`tool`&&e.status===`running`).length,e.totalUsd!=null&&(u+=e.totalUsd,d=!0);return{lanes:r,transcript:c,timeline:s,files:l,summary:{totalRuns:r.length,totalSegments:m,totalTools:f,pendingTools:p,fileCount:l.length,totalUsd:d?u:null}}}var Dn=s((e=>{var t=p(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),K=s(((e,t)=>{t.exports=Dn()}))(),On=(0,y.createContext)(null),kn=(0,y.createContext)(null);function An(e,t){let n=[e.on(`connected`,()=>t.getState().actions.setConnection(`connected`)),e.on(`disconnected`,e=>t.getState().actions.setConnection(`disconnected`,e.reason??null)),e.on(`error`,e=>t.getState().actions.setConnection(`disconnected`,e instanceof Error?e.message:String(e))),e.on(`frame`,e=>{let n=e.type;if(n===`run.event`&&typeof e.runId==`string`&&typeof e.seq==`number`){let n=e.runId,r=e.event;if(t.getState().actions.mergeRunEvent(n,e.seq,String(e.source??`gateway`),r),r.type===`session_start`&&typeof r.sessionId==`string`&&(t.getState().actions.mergeRun(n,{sessionId:r.sessionId}),t.getState().actions.mergeSession(r.sessionId,{agent:r.agent,activeRunId:n,latestRunId:n,status:`active`})),r.type===`run.finalized`){let e=String(r.exitReason??`failed`),i=e===`completed`?`completed`:e===`aborted`||e===`interrupted`||e===`killed`?`aborted`:`failed`;t.getState().actions.mergeRun(n,{status:i,exitReason:e});let a=t.getState().runs.byId[n],o=typeof a?.sessionId==`string`?a.sessionId:null;o&&t.getState().actions.mergeSession(o,{status:`inactive`,activeRunId:null,latestRunId:n})}}if(n===`hook.request`&&t.getState().actions.addHookRequest({hookRequestId:String(e.hookRequestId),runId:String(e.runId),hookKind:String(e.hookKind),payload:e.payload??{},deadlineTs:Number(e.deadlineTs??0)}),n===`hook.resolved`){let n=Object.entries(t.getState().hooks.byRunId);for(let[r,i]of n)i.some(t=>t.hookRequestId===e.hookRequestId)&&t.getState().actions.resolveHookRequest(r,String(e.hookRequestId))}})];return()=>{for(let e of n)e()}}function jn({client:e,children:t}){let n=(0,y.useMemo)(()=>Gt(e),[e]);return(0,y.useEffect)(()=>{n.getState().actions.setConnection(`connecting`);let t=An(e,n);return e.connect(),()=>{t(),e.close()}},[e,n]),(0,K.jsx)(On.Provider,{value:e,children:(0,K.jsx)(kn.Provider,{value:n,children:t})})}function Mn(){let e=(0,y.useContext)(On),t=(0,y.useContext)(kn);if(!e||!t)throw Error(`useGateway must be used inside a GatewayProvider`);return{client:e,store:t}}var Nn=e=>e;function Pn(e,t=Nn){let n=y.useSyncExternalStore(e.subscribe,y.useCallback(()=>t(e.getState()),[e,t]),y.useCallback(()=>t(e.getInitialState()),[e,t]));return y.useDebugValue(n),n}function Fn(){let{store:e}=Mn();return Pn(e,e=>e.connection)}function In(){let{store:e}=Mn();return Pn(e,e=>e.agents.items)}var Ln=e=>Symbol.iterator in e,Rn=e=>`entries`in e,zn=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},Bn=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function Vn(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:Ln(e)&&Ln(t)?Rn(e)&&Rn(t)?zn(e,t):Bn(e,t):zn({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function Hn(e){let t=y.useRef(void 0);return n=>{let r=e(n);return Vn(t.current,r)?t.current:t.current=r}}function Un(e){let{store:t}=Mn();return Pn(t,t=>t.runs.byId[e]??null)}function Wn(e){let{store:t}=Mn();return Pn(t,Hn(t=>qt(t,e)))}var Gn={colors:{background:`#f6f3ec`,surface:`#ffffff`,border:`#d8d0c5`,text:`#1d1a17`,mutedText:`#6c6258`,primary:`#0f766e`},spacing:{xs:4,sm:8,md:12,lg:16},radius:{sm:8,md:14}},Kn=(0,y.createContext)(Gn);function qn(e){return y.createElement(Kn.Provider,{value:e.value},e.children)}function Jn(){return(0,y.useContext)(Kn)}var Yn=e=>e.disabled||Array.isArray(e.accessibilityStates)&&e.accessibilityStates.indexOf(`disabled`)>-1,Xn={adjustable:`slider`,button:`button`,header:`heading`,image:`img`,imagebutton:null,keyboardkey:null,label:null,link:`link`,none:`presentation`,search:`search`,summary:`region`,text:null},Zn=e=>{var t=e.accessibilityRole,n=e.role||t;if(n){var r=Xn[n];if(r!==null)return r||n}},Qn={article:`article`,banner:`header`,blockquote:`blockquote`,button:`button`,code:`code`,complementary:`aside`,contentinfo:`footer`,deletion:`del`,emphasis:`em`,figure:`figure`,insertion:`ins`,form:`form`,list:`ul`,listitem:`li`,main:`main`,navigation:`nav`,paragraph:`p`,region:`section`,strong:`strong`},$n={},er={isDisabled:Yn,propsToAccessibilityComponent:function(e){if(e===void 0&&(e=$n),(e.role||e.accessibilityRole)===`label`)return`label`;var t=Zn(e);if(t){if(t===`heading`){var n=e.accessibilityLevel||e[`aria-level`];return n==null?`h1`:`h`+n}return Qn[t]}},propsToAriaRole:Zn};function tr(e){"@babel/helpers - typeof";return tr=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},tr(e)}function nr(e,t){if(tr(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(tr(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function rr(e){var t=nr(e,`string`);return tr(t)==`symbol`?t:t+``}function ir(e,t,n){return(t=rr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ar(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function or(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ar(Object(n),!0).forEach(function(t){ir(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ar(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var cr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},lr=[`ms`,`Moz`,`O`,`Webkit`],ur=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1);Object.keys(cr).forEach(e=>{lr.forEach(t=>{cr[ur(t,e)]=cr[e]})});var dr=e=>e===`currentcolor`||e===`currentColor`||e===`inherit`||e.indexOf(`var(`)===0,fr=u(s(((e,t)=>{function n(e){if(typeof e==`number`)return e>>>0===e&&e>=0&&e<=4294967295?e:null;if(typeof e!=`string`)return null;let t=f(),n;return(n=t.hex6.exec(e))?parseInt(n[1]+`ff`,16)>>>0:_(e)??((n=t.rgb.exec(e))?(p(n[1])<<24|p(n[2])<<16|p(n[3])<<8|255)>>>0:(n=t.rgba.exec(e))?n[6]===void 0?(p(n[2])<<24|p(n[3])<<16|p(n[4])<<8|h(n[5]))>>>0:(p(n[6])<<24|p(n[7])<<16|p(n[8])<<8|h(n[9]))>>>0:(n=t.hex3.exec(e))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+`ff`,16)>>>0:(n=t.hex8.exec(e))?parseInt(n[1],16)>>>0:(n=t.hex4.exec(e))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=t.hsl.exec(e))?(i(m(n[1]),g(n[2]),g(n[3]))|255)>>>0:(n=t.hsla.exec(e))?n[6]===void 0?(i(m(n[2]),g(n[3]),g(n[4]))|h(n[5]))>>>0:(i(m(n[6]),g(n[7]),g(n[8]))|h(n[9]))>>>0:(n=t.hwb.exec(e))?(a(m(n[1]),g(n[2]),g(n[3]))|255)>>>0:null)}function r(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function i(e,t,n){let i=n<.5?n*(1+t):n+t-n*t,a=2*n-i,o=r(a,i,e+1/3),s=r(a,i,e),c=r(a,i,e-1/3);return Math.round(o*255)<<24|Math.round(s*255)<<16|Math.round(c*255)<<8}function a(e,t,n){if(t+n>=1){let e=Math.round(t*255/(t+n));return e<<24|e<<16|e<<8}let i=r(0,1,e+1/3)*(1-t-n)+t,a=r(0,1,e)*(1-t-n)+t,o=r(0,1,e-1/3)*(1-t-n)+t;return Math.round(i*255)<<24|Math.round(a*255)<<16|Math.round(o*255)<<8}var o=`[-+]?\\d*\\.?\\d+`,s=o+`%`;function c(...e){return`\\(\\s*(`+e.join(`)\\s*,?\\s*(`)+`)\\s*\\)`}function l(...e){return`\\(\\s*(`+e.slice(0,e.length-1).join(`)\\s*,?\\s*(`)+`)\\s*/\\s*(`+e[e.length-1]+`)\\s*\\)`}function u(...e){return`\\(\\s*(`+e.join(`)\\s*,\\s*(`)+`)\\s*\\)`}var d;function f(){return d===void 0&&(d={rgb:RegExp(`rgb`+c(o,o,o)),rgba:RegExp(`rgba(`+u(o,o,o,o)+`|`+l(o,o,o,o)+`)`),hsl:RegExp(`hsl`+c(o,s,s)),hsla:RegExp(`hsla(`+u(o,s,s,o)+`|`+l(o,s,s,o)+`)`),hwb:RegExp(`hwb`+c(o,s,s)),hex3:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#([0-9a-fA-F]{6})$/,hex8:/^#([0-9a-fA-F]{8})$/}),d}function p(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function m(e){return(parseFloat(e)%360+360)%360/360}function h(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function g(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function _(e){switch(e){case`transparent`:return 0;case`aliceblue`:return 4042850303;case`antiquewhite`:return 4209760255;case`aqua`:return 16777215;case`aquamarine`:return 2147472639;case`azure`:return 4043309055;case`beige`:return 4126530815;case`bisque`:return 4293182719;case`black`:return 255;case`blanchedalmond`:return 4293643775;case`blue`:return 65535;case`blueviolet`:return 2318131967;case`brown`:return 2771004159;case`burlywood`:return 3736635391;case`burntsienna`:return 3934150143;case`cadetblue`:return 1604231423;case`chartreuse`:return 2147418367;case`chocolate`:return 3530104575;case`coral`:return 4286533887;case`cornflowerblue`:return 1687547391;case`cornsilk`:return 4294499583;case`crimson`:return 3692313855;case`cyan`:return 16777215;case`darkblue`:return 35839;case`darkcyan`:return 9145343;case`darkgoldenrod`:return 3095792639;case`darkgray`:return 2846468607;case`darkgreen`:return 6553855;case`darkgrey`:return 2846468607;case`darkkhaki`:return 3182914559;case`darkmagenta`:return 2332068863;case`darkolivegreen`:return 1433087999;case`darkorange`:return 4287365375;case`darkorchid`:return 2570243327;case`darkred`:return 2332033279;case`darksalmon`:return 3918953215;case`darkseagreen`:return 2411499519;case`darkslateblue`:return 1211993087;case`darkslategray`:return 793726975;case`darkslategrey`:return 793726975;case`darkturquoise`:return 13554175;case`darkviolet`:return 2483082239;case`deeppink`:return 4279538687;case`deepskyblue`:return 12582911;case`dimgray`:return 1768516095;case`dimgrey`:return 1768516095;case`dodgerblue`:return 512819199;case`firebrick`:return 2988581631;case`floralwhite`:return 4294635775;case`forestgreen`:return 579543807;case`fuchsia`:return 4278255615;case`gainsboro`:return 3705462015;case`ghostwhite`:return 4177068031;case`gold`:return 4292280575;case`goldenrod`:return 3668254975;case`gray`:return 2155905279;case`green`:return 8388863;case`greenyellow`:return 2919182335;case`grey`:return 2155905279;case`honeydew`:return 4043305215;case`hotpink`:return 4285117695;case`indianred`:return 3445382399;case`indigo`:return 1258324735;case`ivory`:return 4294963455;case`khaki`:return 4041641215;case`lavender`:return 3873897215;case`lavenderblush`:return 4293981695;case`lawngreen`:return 2096890111;case`lemonchiffon`:return 4294626815;case`lightblue`:return 2916673279;case`lightcoral`:return 4034953471;case`lightcyan`:return 3774873599;case`lightgoldenrodyellow`:return 4210742015;case`lightgray`:return 3553874943;case`lightgreen`:return 2431553791;case`lightgrey`:return 3553874943;case`lightpink`:return 4290167295;case`lightsalmon`:return 4288707327;case`lightseagreen`:return 548580095;case`lightskyblue`:return 2278488831;case`lightslategray`:return 2005441023;case`lightslategrey`:return 2005441023;case`lightsteelblue`:return 2965692159;case`lightyellow`:return 4294959359;case`lime`:return 16711935;case`limegreen`:return 852308735;case`linen`:return 4210091775;case`magenta`:return 4278255615;case`maroon`:return 2147483903;case`mediumaquamarine`:return 1724754687;case`mediumblue`:return 52735;case`mediumorchid`:return 3126187007;case`mediumpurple`:return 2473647103;case`mediumseagreen`:return 1018393087;case`mediumslateblue`:return 2070474495;case`mediumspringgreen`:return 16423679;case`mediumturquoise`:return 1221709055;case`mediumvioletred`:return 3340076543;case`midnightblue`:return 421097727;case`mintcream`:return 4127193855;case`mistyrose`:return 4293190143;case`moccasin`:return 4293178879;case`navajowhite`:return 4292783615;case`navy`:return 33023;case`oldlace`:return 4260751103;case`olive`:return 2155872511;case`olivedrab`:return 1804477439;case`orange`:return 4289003775;case`orangered`:return 4282712319;case`orchid`:return 3664828159;case`palegoldenrod`:return 4008225535;case`palegreen`:return 2566625535;case`paleturquoise`:return 2951671551;case`palevioletred`:return 3681588223;case`papayawhip`:return 4293907967;case`peachpuff`:return 4292524543;case`peru`:return 3448061951;case`pink`:return 4290825215;case`plum`:return 3718307327;case`powderblue`:return 2967529215;case`purple`:return 2147516671;case`rebeccapurple`:return 1714657791;case`red`:return 4278190335;case`rosybrown`:return 3163525119;case`royalblue`:return 1097458175;case`saddlebrown`:return 2336560127;case`salmon`:return 4202722047;case`sandybrown`:return 4104413439;case`seagreen`:return 780883967;case`seashell`:return 4294307583;case`sienna`:return 2689740287;case`silver`:return 3233857791;case`skyblue`:return 2278484991;case`slateblue`:return 1784335871;case`slategray`:return 1887473919;case`slategrey`:return 1887473919;case`snow`:return 4294638335;case`springgreen`:return 16744447;case`steelblue`:return 1182971135;case`tan`:return 3535047935;case`teal`:return 8421631;case`thistle`:return 3636451583;case`tomato`:return 4284696575;case`turquoise`:return 1088475391;case`violet`:return 4001558271;case`wheat`:return 4125012991;case`white`:return 4294967295;case`whitesmoke`:return 4126537215;case`yellow`:return 4294902015;case`yellowgreen`:return 2597139199}return null}t.exports=n}))()),pr=e=>{if(e==null)return e;var t=(0,fr.default)(e);if(t!=null)return t=(t<<24|t>>>8)>>>0,t},mr=function(e,t){if(t===void 0&&(t=1),e!=null){if(typeof e==`string`&&dr(e))return e;var n=pr(e);if(n!=null){var r=n>>16&255,i=n>>8&255,a=n&255,o=((n>>24&255)/255*t).toFixed(2);return`rgba(`+r+`,`+i+`,`+a+`,`+o+`)`}}},hr={backgroundColor:!0,borderColor:!0,borderTopColor:!0,borderRightColor:!0,borderBottomColor:!0,borderLeftColor:!0,color:!0,shadowColor:!0,textDecorationColor:!0,textShadowColor:!0};function gr(e,t){var n=e;return(t==null||!cr[t])&&typeof e==`number`?n=e+`px`:t!=null&&hr[t]&&(n=mr(e)),n}var _r=!!(typeof window<`u`&&window.document&&window.document.createElement),vr={},yr=!_r||window.CSS!=null&&window.CSS.supports!=null&&(window.CSS.supports(`text-decoration-line`,`none`)||window.CSS.supports(`-webkit-text-decoration-line`,`none`)),br=`monospace,monospace`,xr=`-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif`,Sr={borderColor:[`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`],borderBlockColor:[`borderTopColor`,`borderBottomColor`],borderInlineColor:[`borderRightColor`,`borderLeftColor`],borderRadius:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],borderStyle:[`borderTopStyle`,`borderRightStyle`,`borderBottomStyle`,`borderLeftStyle`],borderBlockStyle:[`borderTopStyle`,`borderBottomStyle`],borderInlineStyle:[`borderRightStyle`,`borderLeftStyle`],borderWidth:[`borderTopWidth`,`borderRightWidth`,`borderBottomWidth`,`borderLeftWidth`],borderBlockWidth:[`borderTopWidth`,`borderBottomWidth`],borderInlineWidth:[`borderRightWidth`,`borderLeftWidth`],insetBlock:[`top`,`bottom`],insetInline:[`left`,`right`],marginBlock:[`marginTop`,`marginBottom`],marginInline:[`marginRight`,`marginLeft`],paddingBlock:[`paddingTop`,`paddingBottom`],paddingInline:[`paddingRight`,`paddingLeft`],overflow:[`overflowX`,`overflowY`],overscrollBehavior:[`overscrollBehaviorX`,`overscrollBehaviorY`],borderBlockStartColor:[`borderTopColor`],borderBlockStartStyle:[`borderTopStyle`],borderBlockStartWidth:[`borderTopWidth`],borderBlockEndColor:[`borderBottomColor`],borderBlockEndStyle:[`borderBottomStyle`],borderBlockEndWidth:[`borderBottomWidth`],borderEndStartRadius:[`borderBottomLeftRadius`],borderEndEndRadius:[`borderBottomRightRadius`],borderStartStartRadius:[`borderTopLeftRadius`],borderStartEndRadius:[`borderTopRightRadius`],insetBlockEnd:[`bottom`],insetBlockStart:[`top`],marginBlockStart:[`marginTop`],marginBlockEnd:[`marginBottom`],paddingBlockStart:[`paddingTop`],paddingBlockEnd:[`paddingBottom`]},Cr=(e,t)=>{if(!e)return vr;var n={},r=function(){var r=e[i];if(r==null)return`continue`;if(i===`backgroundClip`)r===`text`&&(n.backgroundClip=r,n.WebkitBackgroundClip=r);else if(i===`flex`)r===-1?(n.flexGrow=0,n.flexShrink=1,n.flexBasis=`auto`):n.flex=r;else if(i===`font`)n[i]=r.replace(`System`,xr);else if(i===`fontFamily`)if(r.indexOf(`System`)>-1){var a=r.split(/,\s*/);a[a.indexOf(`System`)]=xr,n[i]=a.join(`,`)}else r===`monospace`?n[i]=br:n[i]=r;else if(i===`textDecorationLine`)yr?n.textDecorationLine=r:n.textDecoration=r;else if(i===`writingDirection`)n.direction=r;else{var o=gr(e[i],i),s=Sr[i];t&&i===`inset`?(e.insetInline??(n.left=o,n.right=o),e.insetBlock??(n.top=o,n.bottom=o)):t&&i===`margin`?(e.marginInline??(n.marginLeft=o,n.marginRight=o),e.marginBlock??(n.marginTop=o,n.marginBottom=o)):t&&i===`padding`?(e.paddingInline??(n.paddingLeft=o,n.paddingRight=o),e.paddingBlock??(n.paddingTop=o,n.paddingBottom=o)):s?s.forEach((t,r)=>{e[t]??(n[t]=o)}):n[i]=o}};for(var i in e)if(r()===`continue`)continue;return n};function wr(e,t){for(var n=e.length,r=t^n,i=0,a;n>=4;)a=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),a^=a>>>24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)^a,n-=4,++i;switch(n){case 3:r^=(e.charCodeAt(i+2)&255)<<16;case 2:r^=(e.charCodeAt(i+1)&255)<<8;case 1:r^=e.charCodeAt(i)&255,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)}return r^=r>>>13,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16),r^=r>>>15,r>>>0}var Tr=e=>wr(e,1).toString(36),Er=/[A-Z]/g,Dr=/^ms-/,Or={};function kr(e){return`-`+e.toLowerCase()}function Ar(e){if(e in Or)return Or[e];var t=e.replace(Er,kr);return Or[e]=Dr.test(t)?`-`+t:t}var jr=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=t;function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}})),Mr=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var t=n(jr());function n(e){return e&&e.__esModule?e:{default:e}}function r(e,n,r){var i=e[n];if(i&&r.hasOwnProperty(n))for(var a=(0,t.default)(n),o=0;o<i.length;++o){var s=i[o]+a;r[s]||(r[s]=r[n])}return r}})),Nr=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=t;function t(e,t,n,r,i){for(var a=0,o=e.length;a<o;++a){var s=e[a](t,n,r,i);if(s)return s}}})),Pr=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=n;function t(e,t){e.indexOf(t)===-1&&e.push(t)}function n(e,n){if(Array.isArray(n))for(var r=0,i=n.length;r<i;++r)t(e,n[r]);else t(e,n)}})),Fr=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=t;function t(e){return e instanceof Object&&!Array.isArray(e)}})),Ir=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=o;var t=a(Mr()),n=a(Nr()),r=a(Pr()),i=a(Fr());function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var a=e.prefixMap,o=e.plugins;return function e(s){for(var c in s){var l=s[c];if((0,i.default)(l))s[c]=e(l);else if(Array.isArray(l)){for(var u=[],d=0,f=l.length;d<f;++d){var p=(0,n.default)(o,c,l[d],s,a);(0,r.default)(u,p||l[d])}u.length>0&&(s[c]=u)}else{var m=(0,n.default)(o,c,l,s,a);m&&(s[c]=m),s=(0,t.default)(a,c,s)}}return s}}}));function Lr(e){"@babel/helpers - typeof";return Lr=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Lr(e)}function Rr(e){return Hr(e)||Vr(e)||Br(e)||zr()}function zr(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
9
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Br(e,t){if(e){if(typeof e==`string`)return Ur(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(n);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ur(e,t)}}function Vr(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function Hr(e){if(Array.isArray(e))return Ur(e)}function Ur(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Wr(e){return e.filter(function(t,n){return e.lastIndexOf(t)===n})}function Gr(e){for(var t=0,n=arguments.length<=1?0:arguments.length-1;t<n;++t){var r=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];for(var i in r){var a=r[i],o=e[i];if(o&&a){if(Array.isArray(o)){e[i]=Wr(o.concat(a));continue}if(Array.isArray(a)){e[i]=Wr([o].concat(Rr(a)));continue}if(Lr(a)===`object`){e[i]=Gr({},o,a);continue}}e[i]=a}}return e}var Kr=o((()=>{}));function qr(e){return e[1].toUpperCase()}function Jr(e){if(Zr.hasOwnProperty(e))return Zr[e];var t=e.replace(Yr,qr).replace(Xr,`ms`);return Zr[e]=t,t}var Yr,Xr,Zr,Qr=o((()=>{Yr=/-([a-z])/g,Xr=/^Ms/g,Zr={}})),$r=c({default:()=>ti});function ei(e){return`-`+e.toLowerCase()}function ti(e){if(ii.hasOwnProperty(e))return ii[e];var t=e.replace(ni,ei);return ii[e]=ri.test(t)?`-`+t:t}var ni,ri,ii,ai=o((()=>{ni=/[A-Z]/g,ri=/^ms-/,ii={}}));function oi(e){return ti(e)}var si=o((()=>{ai()}));function ci(e,t){return oi(e)+`:`+t}var li=o((()=>{si()}));function ui(e){var t=``;for(var n in e){var r=e[n];typeof r!=`string`&&typeof r!=`number`||(t&&(t+=`;`),t+=ci(n,r))}return t}var di=o((()=>{li()}));function fi(e){return pi.test(e)}var pi,mi=o((()=>{pi=/^(Webkit|Moz|O|ms)/}));function hi(e){return typeof e==`string`&&gi.test(e)}var gi,_i=o((()=>{gi=/-webkit-|-moz-|-ms-/}));function vi(e,t){return e+t.charAt(0).toUpperCase()+t.slice(1)}function yi(e){return bi.hasOwnProperty(e)}var bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi=o((()=>{for(si(),bi={borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xi=[`animationIterationCount`,`boxFlex`,`boxFlexGroup`,`boxOrdinalGroup`,`columnCount`,`flex`,`flexGrow`,`flexPositive`,`flexShrink`,`flexNegative`,`flexOrder`,`gridColumn`,`gridColumnEnd`,`gridColumnStart`,`gridRow`,`gridRowEnd`,`gridRowStart`,`lineClamp`,`order`],Si=[`Webkit`,`ms`,`Moz`,`O`],Ci=0,wi=xi.length;Ci<wi;++Ci)for(Ti=xi[Ci],bi[Ti]=!0,Ei=0,Di=Si.length;Ei<Di;++Ei)bi[vi(Si[Ei],Ti)]=!0;for(var e in bi)bi[oi(e)]=!0}));function ki(e){var t=e.replace(Ai,``);return t.charAt(0).toLowerCase()+t.slice(1)}var Ai,ji=o((()=>{Ai=/^(ms|Webkit|Moz|O)/}));function Mi(e){return ki(Jr(e))}var Ni=o((()=>{Qr(),ji()}));function Pi(e,t){return t.join(`;`+oi(e)+`:`)}var Fi=o((()=>{si()}));function Ii(e){return typeof e==`string`?e.replace(Li,``):e}var Li,Ri=o((()=>{Li=/(-ms-|-webkit-|-moz-|-o-)/g})),zi=c({assignStyle:()=>Gr,camelCaseProperty:()=>Jr,cssifyDeclaration:()=>ci,cssifyObject:()=>ui,hyphenateProperty:()=>oi,isPrefixedProperty:()=>fi,isPrefixedValue:()=>hi,isUnitlessProperty:()=>yi,normalizeProperty:()=>Mi,resolveArrayValue:()=>Pi,unprefixProperty:()=>ki,unprefixValue:()=>Ii}),Bi=o((()=>{Kr(),Qr(),li(),di(),si(),mi(),_i(),Oi(),Ni(),Fi(),ji(),Ri()})),Vi=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=i;var t=(Bi(),d(zi)),n=/cross-fade\(/g,r=[`-webkit-`,``];function i(e,i){if(typeof i==`string`&&!(0,t.isPrefixedValue)(i)&&i.indexOf(`cross-fade(`)!==-1)return r.map(function(e){return i.replace(n,e+`cross-fade(`)})}})),Hi=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=n;var t=/-webkit-|-moz-|-ms-/;function n(e){return typeof e==`string`&&t.test(e)}})),Ui=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=i;var t=n(Hi());function n(e){return e&&e.__esModule?e:{default:e}}var r=[`-webkit-`,``];function i(e,n){if(typeof n==`string`&&!(0,t.default)(n)&&n.indexOf(`image-set(`)>-1)return r.map(function(e){return n.replace(/image-set\(/g,e+`image-set(`)})}})),Wi=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=n;var t={marginBlockStart:[`WebkitMarginBefore`],marginBlockEnd:[`WebkitMarginAfter`],marginInlineStart:[`WebkitMarginStart`,`MozMarginStart`],marginInlineEnd:[`WebkitMarginEnd`,`MozMarginEnd`],paddingBlockStart:[`WebkitPaddingBefore`],paddingBlockEnd:[`WebkitPaddingAfter`],paddingInlineStart:[`WebkitPaddingStart`,`MozPaddingStart`],paddingInlineEnd:[`WebkitPaddingEnd`,`MozPaddingEnd`],borderBlockStart:[`WebkitBorderBefore`],borderBlockStartColor:[`WebkitBorderBeforeColor`],borderBlockStartStyle:[`WebkitBorderBeforeStyle`],borderBlockStartWidth:[`WebkitBorderBeforeWidth`],borderBlockEnd:[`WebkitBorderAfter`],borderBlockEndColor:[`WebkitBorderAfterColor`],borderBlockEndStyle:[`WebkitBorderAfterStyle`],borderBlockEndWidth:[`WebkitBorderAfterWidth`],borderInlineStart:[`WebkitBorderStart`,`MozBorderStart`],borderInlineStartColor:[`WebkitBorderStartColor`,`MozBorderStartColor`],borderInlineStartStyle:[`WebkitBorderStartStyle`,`MozBorderStartStyle`],borderInlineStartWidth:[`WebkitBorderStartWidth`,`MozBorderStartWidth`],borderInlineEnd:[`WebkitBorderEnd`,`MozBorderEnd`],borderInlineEndColor:[`WebkitBorderEndColor`,`MozBorderEndColor`],borderInlineEndStyle:[`WebkitBorderEndStyle`,`MozBorderEndStyle`],borderInlineEndWidth:[`WebkitBorderEndWidth`,`MozBorderEndWidth`]};function n(e,n,r){if(Object.prototype.hasOwnProperty.call(t,e))for(var i=t[e],a=0,o=i.length;a<o;++a)r[i[a]]=n}})),Gi=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=t;function t(e,t){if(e===`position`&&t===`sticky`)return[`-webkit-sticky`,`sticky`]}})),Ki=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=i;var t=[`-webkit-`,`-moz-`,``],n={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},r={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};function i(e,i){if(n.hasOwnProperty(e)&&r.hasOwnProperty(i))return t.map(function(e){return e+i})}})),qi=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var t=n((ai(),d($r)));function n(e){return e&&e.__esModule?e:{default:e}}function r(e){return(0,t.default)(e)}})),Ji=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=c;var t=i(qi()),n=i(Hi()),r=i(jr());function i(e){return e&&e.__esModule?e:{default:e}}var a={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},o={Webkit:`-webkit-`,Moz:`-moz-`,ms:`-ms-`};function s(e,r){if((0,n.default)(e))return e;for(var i=e.split(/,(?![^()]*(?:\([^()]*\))?\))/g),a=0,s=i.length;a<s;++a){var c=i[a],l=[c];for(var u in r){var d=(0,t.default)(u);if(c.indexOf(d)>-1&&d!==`order`)for(var f=r[u],p=0,m=f.length;p<m;++p)l.unshift(c.replace(d,o[f[p]]+d))}i[a]=l.join(`,`)}return i.join(`,`)}function c(e,t,n,i){if(typeof t==`string`&&a.hasOwnProperty(e)){var o=s(t,i),c=o.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(e){return!/-moz-|-ms-/.test(e)}).join(`,`);if(e.indexOf(`Webkit`)>-1)return c;var l=o.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(e){return!/-webkit-|-ms-/.test(e)}).join(`,`);return e.indexOf(`Moz`)>-1?l:(n[`Webkit`+(0,r.default)(e)]=c,n[`Moz`+(0,r.default)(e)]=l,o)}}})),Yi=u(Vi()),Xi=u(Ui()),Zi=u(Wi()),Qi=u(Gi()),$i=u(Ki()),ea=u(Ji()),ta=[`Webkit`],na=[`Moz`],ra=[`Webkit`,`Moz`],ia=[`Webkit`,`ms`],aa={plugins:[Yi.default,Xi.default,Zi.default,Qi.default,$i.default,ea.default],prefixMap:{appearance:[`Webkit`,`Moz`,`ms`],userSelect:ra,textEmphasisPosition:ia,textEmphasis:ia,textEmphasisStyle:ia,textEmphasisColor:ia,boxDecorationBreak:ia,clipPath:ta,maskImage:ia,maskMode:ia,maskRepeat:ia,maskPosition:ia,maskClip:ia,maskOrigin:ia,maskSize:ia,maskComposite:ia,mask:ia,maskBorderSource:ia,maskBorderMode:ia,maskBorderSlice:ia,maskBorderWidth:ia,maskBorderOutset:ia,maskBorderRepeat:ia,maskBorder:ia,maskType:ia,textDecorationStyle:ta,textDecorationSkip:ta,textDecorationLine:ta,textDecorationColor:ta,filter:ta,breakAfter:ta,breakBefore:ta,breakInside:ta,columnCount:ta,columnFill:ta,columnGap:ta,columnRule:ta,columnRuleColor:ta,columnRuleStyle:ta,columnRuleWidth:ta,columns:ta,columnSpan:ta,columnWidth:ta,backdropFilter:ta,hyphens:ta,flowInto:ta,flowFrom:ta,regionFragment:ta,textOrientation:ta,tabSize:na,fontKerning:ta,textSizeAdjust:ta}},oa=(0,u(Ir()).default)(aa),sa=[`animationKeyframes`],ca=new Map,la={},ua=1,da=3,fa={borderColor:2,borderRadius:2,borderStyle:2,borderWidth:2,display:2,flex:2,inset:2,margin:2,overflow:2,overscrollBehavior:2,padding:2,insetBlock:2.1,insetInline:2.1,marginInline:2.1,marginBlock:2.1,paddingInline:2.1,paddingBlock:2.1,borderBlockStartColor:2.2,borderBlockStartStyle:2.2,borderBlockStartWidth:2.2,borderBlockEndColor:2.2,borderBlockEndStyle:2.2,borderBlockEndWidth:2.2,borderInlineStartColor:2.2,borderInlineStartStyle:2.2,borderInlineStartWidth:2.2,borderInlineEndColor:2.2,borderInlineEndStyle:2.2,borderInlineEndWidth:2.2,borderEndStartRadius:2.2,borderEndEndRadius:2.2,borderStartStartRadius:2.2,borderStartEndRadius:2.2,insetBlockEnd:2.2,insetBlockStart:2.2,insetInlineEnd:2.2,insetInlineStart:2.2,marginBlockStart:2.2,marginBlockEnd:2.2,marginInlineStart:2.2,marginInlineEnd:2.2,paddingBlockStart:2.2,paddingBlockEnd:2.2,paddingInlineStart:2.2,paddingInlineEnd:2.2},pa=`borderTopLeftRadius`,ma=`borderTopRightRadius`,ha=`borderBottomLeftRadius`,ga=`borderBottomRightRadius`,_a=`borderLeftColor`,va=`borderLeftStyle`,ya=`borderLeftWidth`,ba=`borderRightColor`,xa=`borderRightStyle`,Sa=`borderRightWidth`,Ca=`right`,wa=`marginLeft`,Ta=`marginRight`,Ea=`paddingLeft`,Da=`paddingRight`,Oa=`left`,ka={[pa]:ma,[ma]:pa,[ha]:ga,[ga]:ha,[_a]:ba,[va]:xa,[ya]:Sa,[ba]:_a,[xa]:va,[Sa]:ya,[Oa]:Ca,[wa]:Ta,[Ta]:wa,[Ea]:Da,[Da]:Ea,[Ca]:Oa},Aa={borderStartStartRadius:pa,borderStartEndRadius:ma,borderEndStartRadius:ha,borderEndEndRadius:ga,borderInlineStartColor:_a,borderInlineStartStyle:va,borderInlineStartWidth:ya,borderInlineEndColor:ba,borderInlineEndStyle:xa,borderInlineEndWidth:Sa,insetInlineEnd:Ca,insetInlineStart:Oa,marginInlineStart:wa,marginInlineEnd:Ta,paddingInlineStart:Ea,paddingInlineEnd:Da},ja=[`clear`,`float`,`textAlign`];function Ma(e){var t={$$css:!0},n=[];function r(e,t,r){var i=Fa(r,t),a=t+i,o=ca.get(a),s;if(o!=null)s=o[0],n.push(o[1]);else{s=Ra(`r`,e,e===t?i:a);var c=fa[e]||da,l=[Ia(s,t,r),c];n.push(l),ca.set(a,[s,l])}return s}return Object.keys(e).sort().forEach(n=>{var i=e[n];if(i!=null){var a;if(ja.indexOf(n)>-1){var o=r(n,n,`left`),s=r(n,n,`right`);i===`start`?a=[o,s]:i===`end`&&(a=[s,o])}var c=Aa[n];if(c!=null&&(a=[r(n,c,i),r(n,ka[c],i)]),n===`transitionProperty`){for(var l=Array.isArray(i)?i:[i],u=[],d=0;d<l.length;d++){var f=l[d];typeof f==`string`&&Aa[f]!=null&&u.push(d)}if(u.length>0){var p=[...l],m=[...l];u.forEach(e=>{var t=p[e];if(typeof t==`string`){var i=Aa[t],o=ka[i];p[e]=i,m[e]=o,a=[r(n,n,p),r(n,n,m)]}})}}a==null?a=r(n,n,i):t.$$css$localize=!0,t[n]=a}}),[t,n]}function Na(e,t){var n={$$css:!0},r=[],i=e.animationKeyframes,a=sr(e,sa),o=Ra(`css`,t,JSON.stringify(e)),s=`.`+o,c;if(i!=null){var l=Ba(i),u=l[0],d=l[1];c=u.join(`,`),r.push(...d)}var f=La(or(or({},a),{},{animationName:c}));return r.push(``+s+f),n[o]=o,[n,[[r,ua]]]}function Pa(e,t){var n=e||la,r={},i={},a=function(){var e=n[o],a=o,s=e;if(!Object.prototype.hasOwnProperty.call(n,o)||e==null)return`continue`;ja.indexOf(o)>-1&&(e===`start`?s=t?`right`:`left`:e===`end`&&(s=t?`left`:`right`));var c=Aa[o];if(c!=null&&(a=t?ka[c]:c),o===`transitionProperty`){var l=Array.isArray(e)?e:[e];l.forEach((e,n)=>{if(typeof e==`string`){var r=Aa[e];r!=null&&(l[n]=t?ka[r]:r,s=l.join(` `))}})}r[a]||(i[a]=s),a===o&&(r[a]=!0)};for(var o in n)if(a()===`continue`)continue;return Cr(i,!0)}function Fa(e,t){var n=gr(e,t);return typeof n==`string`?n:JSON.stringify(n||``)}function Ia(e,t,n){var r=[],i=`.`+e;switch(t){case`animationKeyframes`:var a=Ba(n),o=a[0],s=a[1],c=La({animationName:o.join(`,`)});r.push(``+i+c,...s);break;case`placeholderTextColor`:var l=La({color:n,opacity:1});r.push(i+`::-webkit-input-placeholder`+l,i+`::-moz-placeholder`+l,i+`:-ms-input-placeholder`+l,i+`::placeholder`+l);break;case`pointerEvents`:var u=n;if(n===`auto`)u=`auto!important`;else if(n===`none`){u=`none!important`;var d=La({pointerEvents:`none`});r.push(i+`>* `+d)}else if(n===`box-none`){u=`none!important`;var f=La({pointerEvents:`auto`});r.push(i+`>* `+f)}else if(n===`box-only`){u=`auto!important`;var p=La({pointerEvents:`none`});r.push(i+`>* `+p)}var m=La({pointerEvents:u});r.push(``+i+m);break;case`scrollbarWidth`:n===`none`&&r.push(i+`::-webkit-scrollbar{display:none}`);var h=La({scrollbarWidth:n});r.push(``+i+h);break;default:var g=La({[t]:n});r.push(``+i+g);break}return r}function La(e){var t=oa(Cr(e));return`{`+Object.keys(t).map(e=>{var n=t[e],r=Ar(e);return Array.isArray(n)?n.map(e=>r+`:`+e).join(`;`):r+`:`+n}).sort().join(`;`)+`;}`}function Ra(e,t,n){var r=Tr(t+n);return e+`-`+r}function za(e){var t=[`-webkit-`,``],n=Ra(`r`,`animation`,JSON.stringify(e)),r=`{`+Object.keys(e).map(t=>{var n=e[t],r=La(n);return``+t+r}).join(``)+`}`;return[n,t.map(e=>`@`+e+`keyframes `+n+r)]}function Ba(e){if(typeof e==`number`)throw Error(`Invalid CSS keyframes type: `+typeof e);var t=[],n=[];return(Array.isArray(e)?e:[e]).forEach(e=>{if(typeof e==`string`)t.push(e);else{var r=za(e),i=r[0],a=r[1];t.push(i),n.push(...a)}}),[t,n]}function Va(e,t,n){if(_r){var r=t??document,i=r.getElementById(e);if(i==null)if(i=document.createElement(`style`),i.setAttribute(`id`,e),typeof n==`string`&&i.appendChild(document.createTextNode(n)),r instanceof ShadowRoot)r.insertBefore(i,r.firstChild);else{var a=r.head;a&&a.insertBefore(i,a.firstChild)}return i.sheet}else return null}var Ha=Array.prototype.slice;function Ua(e){var t={},n={};if(e!=null){var r;Ha.call(e.cssRules).forEach((e,i)=>{var a=e.cssText;if(a.indexOf(`stylesheet-group`)>-1)r=Ka(e),t[r]={start:i,rules:[a]};else{var o=Ya(a);o!=null&&(n[o]=!0,t[r].rules.push(a))}})}function i(e,n,r){var i=qa(t),a=i.indexOf(n)+1,o=i[a],s=o!=null&&t[o].start!=null?t[o].start:e.cssRules.length,c=Xa(e,r,s);if(c){t[n].start??(t[n].start=s);for(var l=a;l<i.length;l+=1){var u=i[l],d=t[u].start||0;t[u].start=d+1}}return c}return{getTextContent(){return qa(t).map(e=>{var n=t[e].rules,r=n.shift();return n.sort(),n.unshift(r),n.join(`
|
|
10
|
+
`)}).join(`
|
|
11
|
+
`)},insert(r,a){var o=Number(a);if(t[o]==null){var s=Wa(o);t[o]={start:null,rules:[s]},e!=null&&i(e,o,s)}var c=Ya(r);c!=null&&n[c]==null&&(n[c]=!0,t[o].rules.push(r),e!=null&&(i(e,o,r)||t[o].rules.pop()))}}}function Wa(e){return`[stylesheet-group="`+e+`"]{}`}var Ga=/["']/g;function Ka(e){return Number(e.selectorText.split(Ga)[1])}function qa(e){return Object.keys(e).map(Number).sort((e,t)=>e>t?1:-1)}var Ja=/\s*([,])\s*/g;function Ya(e){var t=e.split(`{`)[0].trim();return t===``?null:t.replace(Ja,`$1`)}function Xa(e,t,n){try{return e.insertRule(t,n),!0}catch{return!1}}var Za=`react-native-stylesheet`,Qa=new WeakMap,$a=[],eo=[`html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}`,`body{margin:0;}`,`button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}`,`input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}`];function to(e,t){t===void 0&&(t=Za);var n;if(_r){var r=e==null?document:e.getRootNode();if($a.length===0)n=Ua(Va(t)),eo.forEach(e=>{n.insert(e,0)}),Qa.set(r,$a.length),$a.push(n);else{var i=Qa.get(r);if(i==null){var a=$a[0],o=a==null?``:a.getTextContent();n=Ua(Va(t,r,o)),Qa.set(r,$a.length),$a.push(n)}else n=$a[i]}}else $a.length===0?(n=Ua(Va(t)),eo.forEach(e=>{n.insert(e,0)}),$a.push(n)):n=$a[0];return{getTextContent(){return n.getTextContent()},id:t,insert(e,t){$a.forEach(n=>{n.insert(e,t)})}}}var no=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.localizeStyle=i;var t=new WeakMap,n=`$$css$localize`;function r(e,t){var r={};for(var i in e)if(i!==n){var a=e[i];Array.isArray(a)?r[i]=t?a[1]:a[0]:r[i]=a}return r}function i(e,i){if(e[n]!=null){var a=+!!i;if(t.has(e)){var o=t.get(e),s=o[a];return s??(s=r(e,i),o[a]=s,t.set(e,o)),s}var c=r(e,i),l=[,,];return l[a]=c,t.set(e,l),c}return e}})),ro=s(((e,t)=>{t.exports=no()})),io={},ao={height:0,width:0},oo=e=>{var t=e.shadowColor,n=e.shadowOffset,r=e.shadowOpacity,i=e.shadowRadius,a=n||ao,o=a.height,s=a.width,c=gr(s),l=gr(o),u=gr(i||0),d=mr(t||`black`,r);if(d!=null&&c!=null&&l!=null&&u!=null)return c+` `+l+` `+u+` `+d},so=e=>{var t=e.textShadowColor,n=e.textShadowOffset,r=e.textShadowRadius,i=n||ao,a=i.height,o=i.width,s=r||0,c=gr(o),l=gr(a),u=gr(s),d=gr(t,`textShadowColor`);if(d&&(a!==0||o!==0||s!==0)&&c!=null&&l!=null&&u!=null)return c+` `+l+` `+u+` `+d},co=e=>{if(typeof e==`string`)return e;var t=gr(e.offsetX)||0,n=gr(e.offsetY)||0,r=gr(e.blurRadius)||0,i=gr(e.spreadDistance)||0,a=mr(e.color)||`black`;return(e.inset?`inset `:``)+t+` `+n+` `+r+` `+i+` `+a},lo=e=>e.map(co).join(`, `),uo=e=>{var t=Object.keys(e)[0],n=e[t];if(t===`matrix`||t===`matrix3d`)return t+`(`+n.join(`,`)+`)`;var r=gr(n,t);return t+`(`+r+`)`},fo=e=>e.map(uo).join(` `),po=e=>e.map(e=>gr(e)).join(` `),mo={borderBottomEndRadius:`borderEndEndRadius`,borderBottomStartRadius:`borderEndStartRadius`,borderTopEndRadius:`borderStartEndRadius`,borderTopStartRadius:`borderStartStartRadius`,borderEndColor:`borderInlineEndColor`,borderEndStyle:`borderInlineEndStyle`,borderEndWidth:`borderInlineEndWidth`,borderStartColor:`borderInlineStartColor`,borderStartStyle:`borderInlineStartStyle`,borderStartWidth:`borderInlineStartWidth`,end:`insetInlineEnd`,marginEnd:`marginInlineEnd`,marginHorizontal:`marginInline`,marginStart:`marginInlineStart`,marginVertical:`marginBlock`,paddingEnd:`paddingInlineEnd`,paddingHorizontal:`paddingInline`,paddingStart:`paddingInlineStart`,paddingVertical:`paddingBlock`,start:`insetInlineStart`},ho={elevation:!0,overlayColor:!0,resizeMode:!0,tintColor:!0},go=function(e,t){t===void 0&&(t={});var n=e||io,r={};if(t.shadow,n.shadowColor!=null||n.shadowOffset!=null||n.shadowOpacity!=null||n.shadowRadius!=null){var i=oo(n);i!=null&&(r.boxShadow=i)}if(t.textShadow,n.textShadowColor!=null||n.textShadowOffset!=null||n.textShadowRadius!=null){var a=so(n);if(a!=null&&r.textShadow==null){var o=n.textShadow;r.textShadow=o?o+`, `+a:a}}for(var s in n)if(!(ho[s]!=null||s===`shadowColor`||s===`shadowOffset`||s===`shadowOpacity`||s===`shadowRadius`||s===`textShadowColor`||s===`textShadowOffset`||s===`textShadowRadius`)){var c=n[s],l=mo[s]||s,u=c;if(!(!Object.prototype.hasOwnProperty.call(n,s)||l!==s&&n[l]!=null))if(l===`aspectRatio`&&typeof u==`number`)r[l]=u.toString();else if(l===`boxShadow`){Array.isArray(u)&&(u=lo(u));var d=r.boxShadow;r.boxShadow=d?u+`, `+d:u}else l===`fontVariant`?(Array.isArray(u)&&u.length>0&&(u=u.join(` `)),r[l]=u):l===`textAlignVertical`?n.verticalAlign??(r.verticalAlign=u===`center`?`middle`:u):l===`transform`?(Array.isArray(u)&&(u=fo(u)),r.transform=u):l===`transformOrigin`?(Array.isArray(u)&&(u=po(u)),r.transformOrigin=u):r[l]=u}return r},_o=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.styleq=void 0;var t=new WeakMap,n=`$$css`;function r(e){var r,i,a;return e!=null&&(r=e.disableCache===!0,i=e.disableMix===!0,a=e.transform),function(){for(var e=[],o=``,s=null,c=r?null:t,l=Array(arguments.length),u=0;u<arguments.length;u++)l[u]=arguments[u];for(;l.length>0;){var d=l.pop();if(!(d==null||d===!1)){if(Array.isArray(d)){for(var f=0;f<d.length;f++)l.push(d[f]);continue}var p=a==null?d:a(d);if(p.$$css){var m=``;if(c!=null&&c.has(p)){var h=c.get(p);h!=null&&(m=h[0],e.push.apply(e,h[1]),c=h[2])}else{var g=[];for(var _ in p){var v=p[_];_!==n&&(typeof v==`string`||v===null?e.includes(_)||(e.push(_),c!=null&&g.push(_),typeof v==`string`&&(m+=m?` `+v:v)):console.error(`styleq: ${_} typeof ${String(v)} is not "string" or "null".`))}if(c!=null){var y=new WeakMap;c.set(p,[m,g,y]),c=y}}m&&(o=o?m+` `+o:m)}else if(i)s??={},s=Object.assign({},p,s);else{var b=null;for(var x in p){var S=p[x];S!==void 0&&(e.includes(x)||(S!=null&&(s??={},b??={},b[x]=S),e.push(x),c=null))}b!=null&&(s=Object.assign(b,s))}}}return[o,s]}}var i=r();e.styleq=i,i.factory=r})),vo=ro(),yo=_o(),bo=[`writingDirection`],xo=new WeakMap,So=to(),Co={shadow:!0,textShadow:!0};function wo(e,t){t===void 0&&(t={});var n=t,r=n.writingDirection,i=sr(n,bo),a=r===`rtl`;return yo.styleq.factory({transform(e){var t=xo.get(e);return t==null?go(e,or(or({},Co),i)):(0,vo.localizeStyle)(t,a)}})(e)}function To(e){e.forEach(e=>{var t=e[0],n=e[1];So!=null&&t.forEach(e=>{So.insert(e,n)})})}function Eo(e){var t=Ma(go(e,Co)),n=t[0],r=t[1];return To(r),n}function Do(e,t){var n=Na(e,t),r=n[0],i=n[1];return To(i),r}var Oo={position:`absolute`,left:0,right:0,top:0,bottom:0},ko=Ao({x:or({},Oo)}).x;function Ao(e){return Object.keys(e).forEach(t=>{var n=e[t];if(n!=null&&n.$$css!==!0){var r=t.indexOf(`$raw`)>-1?Do(n,t.split(`$raw`)[0]):Eo(n);xo.set(n,r)}}),e}function jo(e,t){return[e,t]}function Mo(){for(var e=[...arguments].flat(1/0),t={},n=0;n<e.length;n++){var r=e[n];typeof r==`object`&&r&&Object.assign(t,r)}return t}function No(){return{id:So.id,textContent:So.getTextContent()}}function Po(e,t){t===void 0&&(t={});var n=t.writingDirection===`rtl`,r=wo(e,t);return Array.isArray(r)&&r[1]!=null&&(r[1]=Pa(r[1],n)),r}Po.absoluteFill=ko,Po.absoluteFillObject=Oo,Po.create=Ao,Po.compose=jo,Po.flatten=Mo,Po.getSheet=No,Po.hairlineWidth=1,_r&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle=Po.flatten);var Fo=Po,Io=`aria-activedescendant.accessibilityActiveDescendant.aria-atomic.accessibilityAtomic.aria-autocomplete.accessibilityAutoComplete.aria-busy.accessibilityBusy.aria-checked.accessibilityChecked.aria-colcount.accessibilityColumnCount.aria-colindex.accessibilityColumnIndex.aria-colspan.accessibilityColumnSpan.aria-controls.accessibilityControls.aria-current.accessibilityCurrent.aria-describedby.accessibilityDescribedBy.aria-details.accessibilityDetails.aria-disabled.accessibilityDisabled.aria-errormessage.accessibilityErrorMessage.aria-expanded.accessibilityExpanded.aria-flowto.accessibilityFlowTo.aria-haspopup.accessibilityHasPopup.aria-hidden.accessibilityHidden.aria-invalid.accessibilityInvalid.aria-keyshortcuts.accessibilityKeyShortcuts.aria-label.accessibilityLabel.aria-labelledby.accessibilityLabelledBy.aria-level.accessibilityLevel.aria-live.accessibilityLiveRegion.aria-modal.accessibilityModal.aria-multiline.accessibilityMultiline.aria-multiselectable.accessibilityMultiSelectable.aria-orientation.accessibilityOrientation.aria-owns.accessibilityOwns.aria-placeholder.accessibilityPlaceholder.aria-posinset.accessibilityPosInSet.aria-pressed.accessibilityPressed.aria-readonly.accessibilityReadOnly.aria-required.accessibilityRequired.role.accessibilityRole.aria-roledescription.accessibilityRoleDescription.aria-rowcount.accessibilityRowCount.aria-rowindex.accessibilityRowIndex.aria-rowspan.accessibilityRowSpan.aria-selected.accessibilitySelected.aria-setsize.accessibilitySetSize.aria-sort.accessibilitySort.aria-valuemax.accessibilityValueMax.aria-valuemin.accessibilityValueMin.aria-valuenow.accessibilityValueNow.aria-valuetext.accessibilityValueText.dataSet.focusable.id.nativeID.pointerEvents.style.tabIndex.testID`.split(`.`),Lo={},Ro=Object.prototype.hasOwnProperty,zo=Array.isArray,Bo=/[A-Z]/g;function Vo(e){return`-`+e.toLowerCase()}function Ho(e){return e.replace(Bo,Vo)}function Uo(e){return zo(e)?e.join(` `):e}var Wo=Fo.create({auto:{pointerEvents:`auto`},"box-none":{pointerEvents:`box-none`},"box-only":{pointerEvents:`box-only`},none:{pointerEvents:`none`}}),Go=(e,t,n)=>{t||=Lo;var r=t,i=r[`aria-activedescendant`],a=r.accessibilityActiveDescendant,o=r[`aria-atomic`],s=r.accessibilityAtomic,c=r[`aria-autocomplete`],l=r.accessibilityAutoComplete,u=r[`aria-busy`],d=r.accessibilityBusy,f=r[`aria-checked`],p=r.accessibilityChecked,m=r[`aria-colcount`],h=r.accessibilityColumnCount,g=r[`aria-colindex`],_=r.accessibilityColumnIndex,v=r[`aria-colspan`],y=r.accessibilityColumnSpan,b=r[`aria-controls`],x=r.accessibilityControls,S=r[`aria-current`],C=r.accessibilityCurrent,w=r[`aria-describedby`],T=r.accessibilityDescribedBy,E=r[`aria-details`],D=r.accessibilityDetails,O=r[`aria-disabled`],k=r.accessibilityDisabled,A=r[`aria-errormessage`],j=r.accessibilityErrorMessage,M=r[`aria-expanded`],N=r.accessibilityExpanded,P=r[`aria-flowto`],F=r.accessibilityFlowTo,I=r[`aria-haspopup`],L=r.accessibilityHasPopup,R=r[`aria-hidden`],z=r.accessibilityHidden,ee=r[`aria-invalid`],te=r.accessibilityInvalid,ne=r[`aria-keyshortcuts`],re=r.accessibilityKeyShortcuts,ie=r[`aria-label`],ae=r.accessibilityLabel,oe=r[`aria-labelledby`],se=r.accessibilityLabelledBy,ce=r[`aria-level`],le=r.accessibilityLevel,ue=r[`aria-live`],de=r.accessibilityLiveRegion,fe=r[`aria-modal`],pe=r.accessibilityModal,me=r[`aria-multiline`],he=r.accessibilityMultiline,ge=r[`aria-multiselectable`],_e=r.accessibilityMultiSelectable,ve=r[`aria-orientation`],ye=r.accessibilityOrientation,be=r[`aria-owns`],xe=r.accessibilityOwns,B=r[`aria-placeholder`],Se=r.accessibilityPlaceholder,Ce=r[`aria-posinset`],we=r.accessibilityPosInSet,Te=r[`aria-pressed`],Ee=r.accessibilityPressed,V=r[`aria-readonly`],De=r.accessibilityReadOnly,Oe=r[`aria-required`],ke=r.accessibilityRequired;r.role,r.accessibilityRole;var Ae=r[`aria-roledescription`],je=r.accessibilityRoleDescription,Me=r[`aria-rowcount`],Ne=r.accessibilityRowCount,Pe=r[`aria-rowindex`],Fe=r.accessibilityRowIndex,Ie=r[`aria-rowspan`],Le=r.accessibilityRowSpan,Re=r[`aria-selected`],ze=r.accessibilitySelected,Be=r[`aria-setsize`],Ve=r.accessibilitySetSize,He=r[`aria-sort`],Ue=r.accessibilitySort,We=r[`aria-valuemax`],Ge=r.accessibilityValueMax,Ke=r[`aria-valuemin`],qe=r.accessibilityValueMin,Je=r[`aria-valuenow`],Ye=r.accessibilityValueNow,H=r[`aria-valuetext`],Xe=r.accessibilityValueText,Ze=r.dataSet,Qe=r.focusable,$e=r.id,et=r.nativeID,tt=r.pointerEvents,nt=r.style,rt=r.tabIndex,it=r.testID,U=sr(r,Io),at=O||k,ot=er.propsToAriaRole(t),st=i??a;st!=null&&(U[`aria-activedescendant`]=st);var ct=o==null?s:i;ct!=null&&(U[`aria-atomic`]=ct);var W=c??l;W!=null&&(U[`aria-autocomplete`]=W);var lt=u??d;lt!=null&&(U[`aria-busy`]=lt);var ut=f??p;ut!=null&&(U[`aria-checked`]=ut);var dt=m??h;dt!=null&&(U[`aria-colcount`]=dt);var ft=g??_;ft!=null&&(U[`aria-colindex`]=ft);var pt=v??y;pt!=null&&(U[`aria-colspan`]=pt);var mt=b??x;mt!=null&&(U[`aria-controls`]=Uo(mt));var ht=S??C;ht!=null&&(U[`aria-current`]=ht);var gt=w??T;gt!=null&&(U[`aria-describedby`]=Uo(gt));var _t=E??D;_t!=null&&(U[`aria-details`]=_t),at===!0&&(U[`aria-disabled`]=!0,(e===`button`||e===`form`||e===`input`||e===`select`||e===`textarea`)&&(U.disabled=!0));var vt=A??j;vt!=null&&(U[`aria-errormessage`]=vt);var yt=M??N;yt!=null&&(U[`aria-expanded`]=yt);var bt=P??F;bt!=null&&(U[`aria-flowto`]=Uo(bt));var xt=I??L;xt!=null&&(U[`aria-haspopup`]=xt);var St=R??z;St===!0&&(U[`aria-hidden`]=St);var Ct=ee??te;Ct!=null&&(U[`aria-invalid`]=Ct);var wt=ne??re;wt!=null&&(U[`aria-keyshortcuts`]=Uo(wt));var Tt=ie??ae;Tt!=null&&(U[`aria-label`]=Tt);var Et=oe??se;Et!=null&&(U[`aria-labelledby`]=Uo(Et));var Dt=ce??le;Dt!=null&&(U[`aria-level`]=Dt);var Ot=ue??de;Ot!=null&&(U[`aria-live`]=Ot===`none`?`off`:Ot);var kt=fe??pe;kt!=null&&(U[`aria-modal`]=kt);var At=me??he;At!=null&&(U[`aria-multiline`]=At);var jt=ge??_e;jt!=null&&(U[`aria-multiselectable`]=jt);var Mt=ve??ye;Mt!=null&&(U[`aria-orientation`]=Mt);var Nt=be??xe;Nt!=null&&(U[`aria-owns`]=Uo(Nt));var Pt=B??Se;Pt!=null&&(U[`aria-placeholder`]=Pt);var Ft=Ce??we;Ft!=null&&(U[`aria-posinset`]=Ft);var It=Te??Ee;It!=null&&(U[`aria-pressed`]=It);var Lt=V??De;Lt!=null&&(U[`aria-readonly`]=Lt,(e===`input`||e===`select`||e===`textarea`)&&(U.readOnly=!0));var Rt=Oe??ke;Rt!=null&&(U[`aria-required`]=Rt,(e===`input`||e===`select`||e===`textarea`)&&(U.required=ke)),ot!=null&&(U.role=ot===`none`?`presentation`:ot);var zt=Ae??je;zt!=null&&(U[`aria-roledescription`]=zt);var Bt=Me??Ne;Bt!=null&&(U[`aria-rowcount`]=Bt);var Vt=Pe??Fe;Vt!=null&&(U[`aria-rowindex`]=Vt);var Ht=Ie??Le;Ht!=null&&(U[`aria-rowspan`]=Ht);var Ut=Re??ze;Ut!=null&&(U[`aria-selected`]=Ut);var Wt=Be??Ve;Wt!=null&&(U[`aria-setsize`]=Wt);var Gt=He??Ue;Gt!=null&&(U[`aria-sort`]=Gt);var Kt=We??Ge;Kt!=null&&(U[`aria-valuemax`]=Kt);var qt=Ke??qe;qt!=null&&(U[`aria-valuemin`]=qt);var Jt=Je??Ye;Jt!=null&&(U[`aria-valuenow`]=Jt);var Yt=H??Xe;if(Yt!=null&&(U[`aria-valuetext`]=Yt),Ze!=null){for(var Xt in Ze)if(Ro.call(Ze,Xt)){var Zt=Ho(Xt),Qt=Ze[Xt];Qt!=null&&(U[`data-`+Zt]=Qt)}}rt===0||rt===`0`||rt===-1||rt===`-1`?U.tabIndex=rt:(Qe===!1&&(U.tabIndex=`-1`),e===`a`||e===`button`||e===`input`||e===`select`||e===`textarea`?(Qe===!1||k===!0)&&(U.tabIndex=`-1`):ot===`button`||ot===`checkbox`||ot===`link`||ot===`radio`||ot===`textbox`||ot===`switch`?Qe!==!1&&(U.tabIndex=`0`):Qe===!0&&(U.tabIndex=`0`));var $t=Fo([nt,tt&&Wo[tt]],or({writingDirection:`ltr`},n)),en=$t[0],tn=$t[1];en&&(U.className=en),tn&&(U.style=tn);var G=$e??et;return G!=null&&(U.id=G),it!=null&&(U[`data-testid`]=it),U.type==null&&e===`button`&&(U.type=`button`),U},Ko=new Set([`Arab`,`Syrc`,`Samr`,`Mand`,`Thaa`,`Mend`,`Nkoo`,`Adlm`,`Rohg`,`Hebr`]),qo=new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`far`,`glk`,`he`,`iw`,`khw`,`ks`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]),Jo=new Map;function Yo(e){var t=Jo.get(e);if(t)return t;var n=!1;if(Intl.Locale)try{var r=new Intl.Locale(e).maximize().script;n=Ko.has(r)}catch{var i=e.split(`-`)[0];n=qo.has(i)}else{var a=e.split(`-`)[0];n=qo.has(a)}return Jo.set(e,n),n}var Xo=(0,y.createContext)({direction:`ltr`,locale:`en-US`});function Zo(e){return Yo(e)?`rtl`:`ltr`}function Qo(e){var t=e.direction,n=e.locale,r=e.children;return t||n?y.createElement(Xo.Provider,{children:r,value:{direction:n?Zo(n):t,locale:n}}):r}function $o(){return(0,y.useContext)(Xo)}var es=(e,t,n)=>{var r;e&&e.constructor===String&&(r=er.propsToAccessibilityComponent(t));var i=r||e,a=Go(i,t,n),o=y.createElement(i,a);return a.dir?y.createElement(Qo,{children:o,direction:a.dir,locale:a.lang}):o},ts=e=>{if(e!=null&&e.nodeType===1&&typeof e.getBoundingClientRect==`function`)return e.getBoundingClientRect()},ns={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},rs=[`ms`,`Moz`,`O`,`Webkit`],is=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1);Object.keys(ns).forEach(e=>{rs.forEach(t=>{ns[is(t,e)]=ns[e]})});function as(e,t,n){return t==null||typeof t==`boolean`||t===``?``:!n&&typeof t==`number`&&t!==0&&!(ns.hasOwnProperty(e)&&ns[e])?t+`px`:(``+t).trim()}function os(e,t){var n=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf(`--`)===0,a=as(r,t[r],i);r===`float`&&(r=`cssFloat`),i?n.setProperty(r,a):n[r]=a}}var ss=e=>{var t=e.offsetHeight,n=e.offsetWidth,r=e.offsetLeft,i=e.offsetTop;for(e=e.offsetParent;e&&e.nodeType===1;)r+=e.offsetLeft+e.clientLeft-e.scrollLeft,i+=e.offsetTop+e.clientTop-e.scrollTop,e=e.offsetParent;return i-=window.scrollY,r-=window.scrollX,{width:n,height:t,top:i,left:r}},cs=(e,t,n)=>{var r=t||e&&e.parentNode;e&&r&&setTimeout(()=>{if(e.isConnected&&r.isConnected){var t=ss(r),i=ss(e),a=i.height,o=i.left,s=i.top,c=i.width;n(o-t.left,s-t.top,c,a,o,s)}},0)},ls={A:!0,BODY:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0},us={blur(e){try{e.blur()}catch{}},focus(e){try{var t=e.nodeName;e.getAttribute(`tabIndex`)==null&&e.isContentEditable!==!0&&ls[t]==null&&e.setAttribute(`tabIndex`,`-1`),e.focus()}catch{}},measure(e,t){cs(e,null,t)},measureInWindow(e,t){e&&setTimeout(()=>{var n=ts(e),r=n.height,i=n.left,a=n.top,o=n.width;t(i,a,o,r)},0)},measureLayout(e,t,n,r){cs(e,t,r)},updateView(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];switch(n){case`style`:os(e,r);break;case`class`:case`className`:e.setAttribute(`class`,r);break;case`text`:case`value`:e.value=r;break;default:e.setAttribute(n,r)}}},configureNextLayoutAnimation(e,t){t()},setLayoutAnimationEnabledExperimental(){}};function ds(){return ds=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ds.apply(null,arguments)}var fs={children:!0,dataSet:!0,dir:!0,id:!0,ref:!0,suppressHydrationWarning:!0,tabIndex:!0,testID:!0,focusable:!0,nativeID:!0},ps={"aria-activedescendant":!0,"aria-atomic":!0,"aria-autocomplete":!0,"aria-busy":!0,"aria-checked":!0,"aria-colcount":!0,"aria-colindex":!0,"aria-colspan":!0,"aria-controls":!0,"aria-current":!0,"aria-describedby":!0,"aria-details":!0,"aria-disabled":!0,"aria-errormessage":!0,"aria-expanded":!0,"aria-flowto":!0,"aria-haspopup":!0,"aria-hidden":!0,"aria-invalid":!0,"aria-keyshortcuts":!0,"aria-label":!0,"aria-labelledby":!0,"aria-level":!0,"aria-live":!0,"aria-modal":!0,"aria-multiline":!0,"aria-multiselectable":!0,"aria-orientation":!0,"aria-owns":!0,"aria-placeholder":!0,"aria-posinset":!0,"aria-pressed":!0,"aria-readonly":!0,"aria-required":!0,inert:!0,role:!0,"aria-roledescription":!0,"aria-rowcount":!0,"aria-rowindex":!0,"aria-rowspan":!0,"aria-selected":!0,"aria-setsize":!0,"aria-sort":!0,"aria-valuemax":!0,"aria-valuemin":!0,"aria-valuenow":!0,"aria-valuetext":!0,accessibilityActiveDescendant:!0,accessibilityAtomic:!0,accessibilityAutoComplete:!0,accessibilityBusy:!0,accessibilityChecked:!0,accessibilityColumnCount:!0,accessibilityColumnIndex:!0,accessibilityColumnSpan:!0,accessibilityControls:!0,accessibilityCurrent:!0,accessibilityDescribedBy:!0,accessibilityDetails:!0,accessibilityDisabled:!0,accessibilityErrorMessage:!0,accessibilityExpanded:!0,accessibilityFlowTo:!0,accessibilityHasPopup:!0,accessibilityHidden:!0,accessibilityInvalid:!0,accessibilityKeyShortcuts:!0,accessibilityLabel:!0,accessibilityLabelledBy:!0,accessibilityLevel:!0,accessibilityLiveRegion:!0,accessibilityModal:!0,accessibilityMultiline:!0,accessibilityMultiSelectable:!0,accessibilityOrientation:!0,accessibilityOwns:!0,accessibilityPlaceholder:!0,accessibilityPosInSet:!0,accessibilityPressed:!0,accessibilityReadOnly:!0,accessibilityRequired:!0,accessibilityRole:!0,accessibilityRoleDescription:!0,accessibilityRowCount:!0,accessibilityRowIndex:!0,accessibilityRowSpan:!0,accessibilitySelected:!0,accessibilitySetSize:!0,accessibilitySort:!0,accessibilityValueMax:!0,accessibilityValueMin:!0,accessibilityValueNow:!0,accessibilityValueText:!0},ms={onClick:!0,onAuxClick:!0,onContextMenu:!0,onGotPointerCapture:!0,onLostPointerCapture:!0,onPointerCancel:!0,onPointerDown:!0,onPointerEnter:!0,onPointerMove:!0,onPointerLeave:!0,onPointerOut:!0,onPointerOver:!0,onPointerUp:!0},hs={onBlur:!0,onFocus:!0},gs={onKeyDown:!0,onKeyDownCapture:!0,onKeyUp:!0,onKeyUpCapture:!0},_s={onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOver:!0,onMouseOut:!0,onMouseUp:!0},vs={onTouchCancel:!0,onTouchCancelCapture:!0,onTouchEnd:!0,onTouchEndCapture:!0,onTouchMove:!0,onTouchMoveCapture:!0,onTouchStart:!0,onTouchStartCapture:!0},ys={style:!0};function bs(e,t){var n={};for(var r in e)e.hasOwnProperty(r)&&t[r]===!0&&(n[r]=e[r]);return n}var xs=_r?y.useLayoutEffect:y.useEffect,Ss=`__reactLayoutHandler`,Cs=null;function ws(){return _r&&window.ResizeObserver!==void 0&&(Cs??=new window.ResizeObserver(function(e){e.forEach(e=>{var t=e.target,n=t[Ss];typeof n==`function`&&us.measure(t,(t,r,i,a,o,s)=>{var c={nativeEvent:{layout:{x:t,y:r,width:i,height:a,left:o,top:s}},timeStamp:Date.now()};Object.defineProperty(c.nativeEvent,`target`,{enumerable:!0,get:()=>e.target}),n(c)})})})),Cs}function Ts(e,t){var n=ws();xs(()=>{var n=e.current;n!=null&&(n[Ss]=t)},[e,t]),xs(()=>{var t=e.current;return t!=null&&n!=null&&(typeof t[Ss]==`function`?n.observe(t):n.unobserve(t)),()=>{t!=null&&n!=null&&n.unobserve(t)}},[e,n])}function Es(){var e=[...arguments];return function(t){e.forEach(e=>{if(e!=null){if(typeof e==`function`){e(t);return}if(typeof e==`object`){e.current=t;return}console.error(`mergeRefs cannot handle Refs of type boolean, number or string, received ref `+String(e))}})}}function Ds(){var e=[...arguments];return y.useMemo(()=>Es(...e),[...e])}var Os=typeof Symbol==`function`&&typeof Symbol()==`symbol`?Symbol():Object.freeze({});function ks(e){var t=y.useRef(Os);return t.current===Os&&(t.current=e()),t.current}function As(e){return e.pointerEvents,e.style,ks(()=>e=>{e!=null&&(e.measure=t=>us.measure(e,t),e.measureLayout=(t,n,r)=>us.measureLayout(e,t,r,n),e.measureInWindow=t=>us.measureInWindow(e,t))})}var js=()=>{},Ms={},Ns=[];function Ps(e){return e>20?e%20:e}function Fs(e,t){var n,r=!1,i,a,o=e.changedTouches,s=e.type,c=e.metaKey===!0,l=e.shiftKey===!0,u=o&&o[0].force||0,d=Ps(o&&o[0].identifier||0),f=o&&o[0].clientX||e.clientX,p=o&&o[0].clientY||e.clientY,m=o&&o[0].pageX||e.pageX,h=o&&o[0].pageY||e.pageY,g=typeof e.preventDefault==`function`?e.preventDefault.bind(e):js,_=e.timeStamp;function v(e){return Array.prototype.slice.call(e).map(e=>({force:e.force,identifier:Ps(e.identifier),get locationX(){return x(e.clientX)},get locationY(){return S(e.clientY)},pageX:e.pageX,pageY:e.pageY,target:e.target,timestamp:_}))}if(o!=null)i=v(o),a=v(e.touches);else{var y=[{force:u,identifier:d,get locationX(){return x(f)},get locationY(){return S(p)},pageX:m,pageY:h,target:e.target,timestamp:_}];i=y,a=s===`mouseup`||s===`dragstart`?Ns:y}var b={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:e.defaultPrevented,dispatchConfig:Ms,eventPhase:e.eventPhase,isDefaultPrevented(){return e.defaultPrevented},isPropagationStopped(){return r},isTrusted:e.isTrusted,nativeEvent:{altKey:!1,ctrlKey:!1,metaKey:c,shiftKey:l,changedTouches:i,force:u,identifier:d,get locationX(){return x(f)},get locationY(){return S(p)},pageX:m,pageY:h,target:e.target,timestamp:_,touches:a,type:s},persist:js,preventDefault:g,stopPropagation(){r=!0},target:e.target,timeStamp:_,touchHistory:t.touchHistory};function x(e){if(n||=ts(b.currentTarget),n)return e-n.left}function S(e){if(n||=ts(b.currentTarget),n)return e-n.top}return b}var Is=`scroll`;function Ls(e){return e===`touchstart`||e===`mousedown`}function Rs(e){return e===`touchmove`||e===`mousemove`}function zs(e){return e===`touchend`||e===`mouseup`||Bs(e)}function Bs(e){return e===`touchcancel`||e===`dragstart`}function Vs(e){return e===Is}function Hs(e){return e===`select`||e===`selectionchange`}function Us(){var e=window.getSelection(),t=e.toString(),n=e.anchorNode,r=e.focusNode,i=n&&n.nodeType===window.Node.TEXT_NODE||r&&r.nodeType===window.Node.TEXT_NODE;return t.length>=1&&t!==`
|
|
12
|
+
`&&i}var Ws=`__reactResponderId`;function Gs(e){if(e.type===`selectionchange`){var t=window.getSelection().anchorNode;return Ks(t)}else return e.composedPath==null?Ks(e.target):e.composedPath()}function Ks(e){for(var t=[];e!=null&&e!==document.body;)t.push(e),e=e.parentNode;return t}function qs(e){return e==null?null:e[Ws]}function Js(e,t){e!=null&&(e[Ws]=t)}function Ys(e){for(var t=[],n=[],r=Gs(e),i=0;i<r.length;i++){var a=r[i],o=qs(a);o!=null&&(t.push(o),n.push(a))}return{idPath:t,nodePath:n}}function Xs(e,t){var n=e.length,r=t.length;if(n===0||r===0||e[n-1]!==t[r-1])return null;var i=e[0],a=0,o=t[0],s=0;n-r>0&&(a=n-r,i=e[a],n=r),r-n>0&&(s=r-n,o=t[s],r=n);for(var c=n;c--;){if(i===o)return i;i=e[a++],o=t[s++]}return null}function Zs(e,t){if(!t||t.length===0)return!1;for(var n=0;n<t.length;n++){var r=t[n].target;if(r!=null&&e.contains(r))return!0}return!1}function Qs(e){return e.type===`selectionchange`?Us():e.type===`select`}function $s(e){var t=e.altKey,n=e.button,r=e.buttons,i=e.ctrlKey,a=e.type,o=a===`touchstart`||a===`touchmove`,s=a===`mousedown`&&(n===0||r===1),c=a===`mousemove`&&r===1,l=t===!1&&i===!1;return!!(o||s&&l||c&&l)}var ec=!1,tc=20;function nc(e){return e.timeStamp||e.timestamp}function rc(e){return{touchActive:!0,startPageX:e.pageX,startPageY:e.pageY,startTimeStamp:nc(e),currentPageX:e.pageX,currentPageY:e.pageY,currentTimeStamp:nc(e),previousPageX:e.pageX,previousPageY:e.pageY,previousTimeStamp:nc(e)}}function ic(e,t){e.touchActive=!0,e.startPageX=t.pageX,e.startPageY=t.pageY,e.startTimeStamp=nc(t),e.currentPageX=t.pageX,e.currentPageY=t.pageY,e.currentTimeStamp=nc(t),e.previousPageX=t.pageX,e.previousPageY=t.pageY,e.previousTimeStamp=nc(t)}function ac(e){var t=e.identifier;return t??console.error(`Touch object is missing identifier.`),ec&&t>tc&&console.error(`Touch identifier %s is greater than maximum supported %s which causes performance issues backfilling array locations for all of the indices.`,t,tc),t}function oc(e,t){var n=ac(e),r=t.touchBank[n];r?ic(r,e):t.touchBank[n]=rc(e),t.mostRecentTimeStamp=nc(e)}function sc(e,t){var n=t.touchBank[ac(e)];n?(n.touchActive=!0,n.previousPageX=n.currentPageX,n.previousPageY=n.currentPageY,n.previousTimeStamp=n.currentTimeStamp,n.currentPageX=e.pageX,n.currentPageY=e.pageY,n.currentTimeStamp=nc(e),t.mostRecentTimeStamp=nc(e)):console.warn(`Cannot record touch move without a touch start.
|
|
13
|
+
`,`Touch Move: `+lc(e)+`
|
|
14
|
+
`,`Touch Bank: `+uc(t))}function cc(e,t){var n=t.touchBank[ac(e)];n?(n.touchActive=!1,n.previousPageX=n.currentPageX,n.previousPageY=n.currentPageY,n.previousTimeStamp=n.currentTimeStamp,n.currentPageX=e.pageX,n.currentPageY=e.pageY,n.currentTimeStamp=nc(e),t.mostRecentTimeStamp=nc(e)):console.warn(`Cannot record touch end without a touch start.
|
|
15
|
+
`,`Touch End: `+lc(e)+`
|
|
16
|
+
`,`Touch Bank: `+uc(t))}function lc(e){return JSON.stringify({identifier:e.identifier,pageX:e.pageX,pageY:e.pageY,timestamp:nc(e)})}function uc(e){var t=e.touchBank,n=JSON.stringify(t.slice(0,tc));return t.length>tc&&(n+=` (original size: `+t.length+`)`),n}var dc=class{constructor(){this._touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0}}recordTouchTrack(e,t){var n=this._touchHistory;if(Rs(e))t.changedTouches.forEach(e=>sc(e,n));else if(Ls(e))t.changedTouches.forEach(e=>oc(e,n)),n.numberActiveTouches=t.touches.length,n.numberActiveTouches===1&&(n.indexOfSingleActiveTouch=t.touches[0].identifier);else if(zs(e)&&(t.changedTouches.forEach(e=>cc(e,n)),n.numberActiveTouches=t.touches.length,n.numberActiveTouches===1)){for(var r=n.touchBank,i=0;i<r.length;i++){var a=r[i];if(a!=null&&a.touchActive){n.indexOfSingleActiveTouch=i;break}}if(ec){var o=r[n.indexOfSingleActiveTouch];o!=null&&o.touchActive||console.error(`Cannot find single active touch.`)}}}get touchHistory(){return this._touchHistory}},fc={},pc=[`onStartShouldSetResponderCapture`,`onStartShouldSetResponder`,{bubbles:!0}],mc=[`onMoveShouldSetResponderCapture`,`onMoveShouldSetResponder`,{bubbles:!0}],hc={touchstart:pc,mousedown:pc,touchmove:mc,mousemove:mc,scroll:[`onScrollShouldSetResponderCapture`,`onScrollShouldSetResponder`,{bubbles:!1}]},gc={id:null,idPath:null,node:null},_c=new Map,q=!1,vc=0,yc={id:null,node:null,idPath:null},bc=new dc;function xc(e){yc=e}function Sc(e){return _c.get(e)??fc}function Cc(e){var t=e.type,n=e.target;if(t===`touchstart`&&(q=!0),(t===`touchmove`||vc>1)&&(q=!1),!(t===`mousedown`&&q||t===`mousemove`&&q||t===`mousemove`&&vc<1)){if(q&&t===`mouseup`){vc===0&&(q=!1);return}var r=Ls(t)&&$s(e),i=Rs(t),a=zs(t),o=Vs(t),s=Hs(t),c=Fs(e,bc);(r||i||a)&&(e.touches?vc=e.touches.length:r?vc=1:a&&(vc=0),bc.recordTouchTrack(t,c.nativeEvent));var l=Ys(e),u=!1,d;if(r||i||o&&vc>0){var f=yc.idPath,p=l.idPath;if(f!=null&&p!=null){var m=Xs(f,p);if(m!=null){var h=p.indexOf(m)+ +(m===yc.id);l={idPath:p.slice(h),nodePath:l.nodePath.slice(h)}}else l=null}l!=null&&(d=wc(l,e,c),d!=null&&(Tc(c,d),u=!0))}if(yc.id!=null&&yc.node!=null){var g=yc,_=g.id,v=g.node,y=Sc(_),b=y.onResponderStart,x=y.onResponderMove,S=y.onResponderEnd,C=y.onResponderRelease,w=y.onResponderTerminate,T=y.onResponderTerminationRequest;if(c.bubbles=!1,c.cancelable=!1,c.currentTarget=v,r)b!=null&&(c.dispatchConfig.registrationName=`onResponderStart`,b(c));else if(i)x!=null&&(c.dispatchConfig.registrationName=`onResponderMove`,x(c));else{var E=Bs(t)||t===`contextmenu`||t===`blur`&&n===window||t===`blur`&&n.contains(v)&&e.relatedTarget!==v||o&&vc===0||o&&n.contains(v)&&n!==v||s&&Qs(e),D=a&&!E&&!Zs(v,e.touches);if(a&&S!=null&&(c.dispatchConfig.registrationName=`onResponderEnd`,S(c)),D&&(C!=null&&(c.dispatchConfig.registrationName=`onResponderRelease`,C(c)),xc(gc)),E){var O=!0;(t===`contextmenu`||t===`scroll`||t===`selectionchange`)&&(u?O=!1:T!=null&&(c.dispatchConfig.registrationName=`onResponderTerminationRequest`,T(c)===!1&&(O=!1))),O&&(w!=null&&(c.dispatchConfig.registrationName=`onResponderTerminate`,w(c)),xc(gc),q=!1,vc=0)}}}}}function wc(e,t,n){var r=hc[t.type];if(r!=null){for(var i=e.idPath,a=e.nodePath,o=r[0],s=r[1],c=r[2].bubbles,l=function(e,t,r){var a=Sc(e)[r];if(a!=null&&(n.currentTarget=t,a(n)===!0))return{id:e,node:t,idPath:i.slice(i.indexOf(e))}},u=i.length-1;u>=0;u--){var d=i[u],f=a[u],p=l(d,f,o);if(p!=null)return p;if(n.isPropagationStopped()===!0)return}if(c)for(var m=0;m<i.length;m++){var h=i[m],g=a[m],_=l(h,g,s);if(_!=null)return _;if(n.isPropagationStopped()===!0)return}else{var v=i[0],y=a[0];if(t.target===y)return l(v,y,s)}}}function Tc(e,t){var n=yc,r=n.id,i=n.node,a=t.id,o=t.node,s=Sc(a),c=s.onResponderGrant,l=s.onResponderReject;if(e.bubbles=!1,e.cancelable=!1,e.currentTarget=o,r==null)c!=null&&(e.currentTarget=o,e.dispatchConfig.registrationName=`onResponderGrant`,c(e)),xc(t);else{var u=Sc(r),d=u.onResponderTerminate,f=u.onResponderTerminationRequest,p=!0;f!=null&&(e.currentTarget=i,e.dispatchConfig.registrationName=`onResponderTerminationRequest`,f(e)===!1&&(p=!1)),p?(d!=null&&(e.currentTarget=i,e.dispatchConfig.registrationName=`onResponderTerminate`,d(e)),c!=null&&(e.currentTarget=o,e.dispatchConfig.registrationName=`onResponderGrant`,c(e)),xc(t)):l!=null&&(e.currentTarget=o,e.dispatchConfig.registrationName=`onResponderReject`,l(e))}}var Ec=[`blur`,`scroll`],Dc=[`mousedown`,`mousemove`,`mouseup`,`dragstart`,`touchstart`,`touchmove`,`touchend`,`touchcancel`,`contextmenu`,`select`,`selectionchange`];function Oc(){_r&&window.__reactResponderSystemActive==null&&(window.addEventListener(`blur`,Cc),Dc.forEach(e=>{document.addEventListener(e,Cc)}),Ec.forEach(e=>{document.addEventListener(e,Cc,!0)}),window.__reactResponderSystemActive=!0)}function kc(e,t,n){Js(t,e),_c.set(e,n)}function Ac(e){yc.id===e&&jc(),_c.has(e)&&_c.delete(e)}function jc(){var e=yc,t=e.id,n=e.node;if(t!=null&&n!=null){var r=Sc(t).onResponderTerminate;if(r!=null){var i=Fs({},bc);i.currentTarget=n,r(i)}xc(gc)}q=!1,vc=0}function Mc(){return yc.node}var Nc={},Pc=0;function Fc(e){var t=y.useRef(null);return t.current??=e(),t.current}function Ic(e,t){t===void 0&&(t=Nc);var n=Fc(()=>Pc++),r=y.useRef(!1);y.useEffect(()=>(Oc(),()=>{Ac(n)}),[n]),y.useEffect(()=>{var i=t,a=i.onMoveShouldSetResponder,o=i.onMoveShouldSetResponderCapture,s=i.onScrollShouldSetResponder,c=i.onScrollShouldSetResponderCapture,l=i.onSelectionChangeShouldSetResponder,u=i.onSelectionChangeShouldSetResponderCapture,d=i.onStartShouldSetResponder,f=i.onStartShouldSetResponderCapture,p=a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f!=null,m=e.current;p?(kc(n,m,t),r.current=!0):r.current&&=(Ac(n),!1)},[t,e,n]),y.useDebugValue({isResponder:e.current===Mc()}),y.useDebugValue(t)}var Lc=(0,y.createContext)(!1),Rc=[`hrefAttrs`,`onLayout`,`onMoveShouldSetResponder`,`onMoveShouldSetResponderCapture`,`onResponderEnd`,`onResponderGrant`,`onResponderMove`,`onResponderReject`,`onResponderRelease`,`onResponderStart`,`onResponderTerminate`,`onResponderTerminationRequest`,`onScrollShouldSetResponder`,`onScrollShouldSetResponderCapture`,`onSelectionChangeShouldSetResponder`,`onSelectionChangeShouldSetResponderCapture`,`onStartShouldSetResponder`,`onStartShouldSetResponderCapture`],zc=Object.assign({},fs,ps,ms,hs,gs,_s,vs,ys,{href:!0,lang:!0,onScroll:!0,onWheel:!0,pointerEvents:!0}),Bc=e=>bs(e,zc),Vc=y.forwardRef((e,t)=>{var n=e.hrefAttrs,r=e.onLayout,i=e.onMoveShouldSetResponder,a=e.onMoveShouldSetResponderCapture,o=e.onResponderEnd,s=e.onResponderGrant,c=e.onResponderMove,l=e.onResponderReject,u=e.onResponderRelease,d=e.onResponderStart,f=e.onResponderTerminate,p=e.onResponderTerminationRequest,m=e.onScrollShouldSetResponder,h=e.onScrollShouldSetResponderCapture,g=e.onSelectionChangeShouldSetResponder,_=e.onSelectionChangeShouldSetResponderCapture,v=e.onStartShouldSetResponder,b=e.onStartShouldSetResponderCapture,x=sr(e,Rc),S=y.useContext(Lc),C=y.useRef(null),w=$o().direction;Ts(C,r),Ic(C,{onMoveShouldSetResponder:i,onMoveShouldSetResponderCapture:a,onResponderEnd:o,onResponderGrant:s,onResponderMove:c,onResponderReject:l,onResponderRelease:u,onResponderStart:d,onResponderTerminate:f,onResponderTerminationRequest:p,onScrollShouldSetResponder:m,onScrollShouldSetResponderCapture:h,onSelectionChangeShouldSetResponder:g,onSelectionChangeShouldSetResponderCapture:_,onStartShouldSetResponder:v,onStartShouldSetResponderCapture:b});var T=`div`,E=e.lang==null?null:Zo(e.lang),D=e.dir||E,O=D||w,k=Bc(x);if(k.dir=D,k.style=[Hc.view$raw,S&&Hc.inline,e.style],e.href!=null&&(T=`a`,n!=null)){var A=n.download,j=n.rel,M=n.target;A!=null&&(k.download=A),j!=null&&(k.rel=j),typeof M==`string`&&(k.target=M.charAt(0)===`_`?M:`_`+M)}return k.ref=Ds(C,As(k),t),es(T,k,{writingDirection:O})});Vc.displayName=`View`;var Hc=Fo.create({view$raw:{alignContent:`flex-start`,alignItems:`stretch`,backgroundColor:`transparent`,border:`0 solid black`,boxSizing:`border-box`,display:`flex`,flexBasis:`auto`,flexDirection:`column`,flexShrink:0,listStyle:`none`,margin:0,minHeight:0,minWidth:0,padding:0,position:`relative`,textDecoration:`none`,zIndex:0},inline:{display:`inline-flex`}}),Uc=[`hrefAttrs`,`numberOfLines`,`onClick`,`onLayout`,`onPress`,`onMoveShouldSetResponder`,`onMoveShouldSetResponderCapture`,`onResponderEnd`,`onResponderGrant`,`onResponderMove`,`onResponderReject`,`onResponderRelease`,`onResponderStart`,`onResponderTerminate`,`onResponderTerminationRequest`,`onScrollShouldSetResponder`,`onScrollShouldSetResponderCapture`,`onSelectionChangeShouldSetResponder`,`onSelectionChangeShouldSetResponderCapture`,`onStartShouldSetResponder`,`onStartShouldSetResponderCapture`,`selectable`],Wc=Object.assign({},fs,ps,ms,hs,gs,_s,vs,ys,{href:!0,lang:!0,pointerEvents:!0}),Gc=e=>bs(e,Wc),Kc=y.forwardRef((e,t)=>{var n=e.hrefAttrs,r=e.numberOfLines,i=e.onClick,a=e.onLayout,o=e.onPress,s=e.onMoveShouldSetResponder,c=e.onMoveShouldSetResponderCapture,l=e.onResponderEnd,u=e.onResponderGrant,d=e.onResponderMove,f=e.onResponderReject,p=e.onResponderRelease,m=e.onResponderStart,h=e.onResponderTerminate,g=e.onResponderTerminationRequest,_=e.onScrollShouldSetResponder,v=e.onScrollShouldSetResponderCapture,b=e.onSelectionChangeShouldSetResponder,x=e.onSelectionChangeShouldSetResponderCapture,S=e.onStartShouldSetResponder,C=e.onStartShouldSetResponderCapture,w=e.selectable,T=sr(e,Uc),E=y.useContext(Lc),D=y.useRef(null),O=$o().direction;Ts(D,a),Ic(D,{onMoveShouldSetResponder:s,onMoveShouldSetResponderCapture:c,onResponderEnd:l,onResponderGrant:u,onResponderMove:d,onResponderReject:f,onResponderRelease:p,onResponderStart:m,onResponderTerminate:h,onResponderTerminationRequest:g,onScrollShouldSetResponder:_,onScrollShouldSetResponderCapture:v,onSelectionChangeShouldSetResponder:b,onSelectionChangeShouldSetResponderCapture:x,onStartShouldSetResponder:S,onStartShouldSetResponderCapture:C});var k=y.useCallback(e=>{i==null?o!=null&&(e.stopPropagation(),o(e)):i(e)},[i,o]),A=E?`span`:`div`,j=e.lang==null?null:Zo(e.lang),M=e.dir||j,N=M||O,P=Gc(T);if(P.dir=M,E||(P.dir=M??`auto`),(i||o)&&(P.onClick=k),P.style=[r!=null&&r>1&&{WebkitLineClamp:r},E===!0?Jc.textHasAncestor$raw:Jc.text$raw,r===1&&Jc.textOneLine,r!=null&&r>1&&Jc.textMultiLine,e.style,w===!0&&Jc.selectable,w===!1&&Jc.notSelectable,o&&Jc.pressable],e.href!=null&&(A=`a`,n!=null)){var F=n.download,I=n.rel,L=n.target;F!=null&&(P.download=F),I!=null&&(P.rel=I),typeof L==`string`&&(P.target=L.charAt(0)===`_`?L:`_`+L)}P.ref=Ds(D,As(P),t);var R=es(A,P,{writingDirection:N});return E?R:y.createElement(Lc.Provider,{value:!0},R)});Kc.displayName=`Text`;var qc={backgroundColor:`transparent`,border:`0 solid black`,boxSizing:`border-box`,color:`black`,display:`inline`,font:`14px System`,listStyle:`none`,margin:0,padding:0,position:`relative`,textAlign:`start`,textDecoration:`none`,whiteSpace:`pre-wrap`,wordWrap:`break-word`},Jc=Fo.create({text$raw:qc,textHasAncestor$raw:or(or({},qc),{},{color:`inherit`,font:`inherit`,textAlign:`inherit`,whiteSpace:`inherit`}),textOneLine:{maxWidth:`100%`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,wordWrap:`normal`},textMultiLine:{display:`-webkit-box`,maxWidth:`100%`,overflow:`clip`,textOverflow:`ellipsis`,WebkitBoxOrient:`vertical`},notSelectable:{userSelect:`none`},selectable:{userSelect:`text`},pressable:{cursor:`pointer`}}),Yc=`DELAY`,Xc=`ERROR`,Zc=`LONG_PRESS_DETECTED`,Qc=`NOT_RESPONDER`,$c=`RESPONDER_ACTIVE_LONG_PRESS_START`,el=`RESPONDER_ACTIVE_PRESS_START`,tl=`RESPONDER_INACTIVE_PRESS_START`,nl=`RESPONDER_GRANT`,rl=`RESPONDER_RELEASE`,il=`RESPONDER_TERMINATED`,al=Object.freeze({NOT_RESPONDER:{DELAY:Xc,RESPONDER_GRANT:tl,RESPONDER_RELEASE:Xc,RESPONDER_TERMINATED:Xc,LONG_PRESS_DETECTED:Xc},RESPONDER_INACTIVE_PRESS_START:{DELAY:el,RESPONDER_GRANT:Xc,RESPONDER_RELEASE:Qc,RESPONDER_TERMINATED:Qc,LONG_PRESS_DETECTED:Xc},RESPONDER_ACTIVE_PRESS_START:{DELAY:Xc,RESPONDER_GRANT:Xc,RESPONDER_RELEASE:Qc,RESPONDER_TERMINATED:Qc,LONG_PRESS_DETECTED:$c},RESPONDER_ACTIVE_LONG_PRESS_START:{DELAY:Xc,RESPONDER_GRANT:Xc,RESPONDER_RELEASE:Qc,RESPONDER_TERMINATED:Qc,LONG_PRESS_DETECTED:$c},ERROR:{DELAY:Qc,RESPONDER_GRANT:tl,RESPONDER_RELEASE:Qc,RESPONDER_TERMINATED:Qc,LONG_PRESS_DETECTED:Qc}}),ol=e=>e.getAttribute(`role`),sl=e=>e.tagName.toLowerCase(),cl=e=>e===el||e===$c,ll=e=>ol(e)===`button`,ul=e=>e===tl||e===el||e===$c,dl=e=>e===il||e===rl,fl=e=>{var t=e.key,n=e.target,r=t===` `||t===`Spacebar`,i=sl(n)===`button`||ll(n);return t===`Enter`||r&&i},pl=450,ml=50,hl=class{constructor(e){this._eventHandlers=null,this._isPointerTouch=!1,this._longPressDelayTimeout=null,this._longPressDispatched=!1,this._pressDelayTimeout=null,this._pressOutDelayTimeout=null,this._touchState=Qc,this._responderElement=null,this.configure(e)}configure(e){this._config=e}reset(){this._cancelLongPressDelayTimeout(),this._cancelPressDelayTimeout(),this._cancelPressOutDelayTimeout()}getEventHandlers(){return this._eventHandlers??=this._createEventHandlers(),this._eventHandlers}_createEventHandlers(){var e=(e,t)=>{e.persist(),this._cancelPressOutDelayTimeout(),this._longPressDispatched=!1,this._selectionTerminated=!1,this._touchState=Qc,this._isPointerTouch=e.nativeEvent.type===`touchstart`,this._receiveSignal(nl,e);var n=gl(this._config.delayPressStart,0,ml);t!==!1&&n>0?this._pressDelayTimeout=setTimeout(()=>{this._receiveSignal(Yc,e)},n):this._receiveSignal(Yc,e);var r=gl(this._config.delayLongPress,10,pl);this._longPressDelayTimeout=setTimeout(()=>{this._handleLongPress(e)},r+n)},t=e=>{this._receiveSignal(rl,e)},n=e=>{var r=this._config.onPress,i=e.target;if(this._touchState!==Qc&&fl(e)){t(e),document.removeEventListener(`keyup`,n);var a=i.getAttribute(`role`),o=sl(i),s=a===`link`||o===`a`||o===`button`||o===`input`||o===`select`||o===`textarea`,c=this._responderElement===i;r!=null&&!s&&c&&r(e),this._responderElement=null}};return{onStartShouldSetResponder:e=>{var t=this._config.disabled;return t&&ll(e.currentTarget)&&e.stopPropagation(),t==null?!0:!t},onKeyDown:t=>{var r=this._config.disabled,i=t.key,a=t.target;if(!r&&fl(t)){this._touchState===Qc&&(e(t,!1),this._responderElement=a,document.addEventListener(`keyup`,n));var o=i===` `||i===`Spacebar`,s=ol(a);o&&(s===`button`||s===`menuitem`)&&sl(a)!==`button`&&t.preventDefault(),t.stopPropagation()}},onResponderGrant:t=>e(t),onResponderMove:e=>{this._config.onPressMove!=null&&this._config.onPressMove(e);var t=_l(e);if(this._touchActivatePosition!=null){var n=this._touchActivatePosition.pageX-t.pageX,r=this._touchActivatePosition.pageY-t.pageY;Math.hypot(n,r)>10&&this._cancelLongPressDelayTimeout()}},onResponderRelease:e=>t(e),onResponderTerminate:e=>{e.nativeEvent.type===`selectionchange`&&(this._selectionTerminated=!0),this._receiveSignal(il,e)},onResponderTerminationRequest:e=>{var t=this._config,n=t.cancelable,r=t.disabled,i=t.onLongPress;return!r&&i!=null&&this._isPointerTouch&&e.nativeEvent.type===`contextmenu`?!1:n??!0},onClick:e=>{var t=this._config,n=t.disabled,r=t.onPress;n?ll(e.currentTarget)&&e.stopPropagation():(e.stopPropagation(),this._longPressDispatched||this._selectionTerminated?e.preventDefault():r!=null&&e.altKey===!1&&r(e))},onContextMenu:e=>{var t=this._config,n=t.disabled,r=t.onLongPress;n?ll(e.currentTarget)&&e.stopPropagation():r!=null&&this._isPointerTouch&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation())}}}_receiveSignal(e,t){var n=this._touchState,r=null;al[n]!=null&&(r=al[n][e]),!(this._touchState===Qc&&e===rl)&&(r==null||r===Xc?console.error(`PressResponder: Invalid signal `+e+` for state `+n+` on responder`):n!==r&&(this._performTransitionSideEffects(n,r,e,t),this._touchState=r))}_performTransitionSideEffects(e,t,n,r){if(dl(n)&&(setTimeout(()=>{this._isPointerTouch=!1},0),this._touchActivatePosition=null,this._cancelLongPressDelayTimeout()),ul(e)&&n===Zc){var i=this._config.onLongPress;i!=null&&r.nativeEvent.key==null&&(i(r),this._longPressDispatched=!0)}var a=cl(e),o=cl(t);if(!a&&o?this._activate(r):a&&!o&&this._deactivate(r),ul(e)&&n===rl){var s=this._config,c=s.onLongPress;s.onPress!=null&&(c!=null&&e===$c||!o&&!a&&(this._activate(r),this._deactivate(r)))}this._cancelPressDelayTimeout()}_activate(e){var t=this._config,n=t.onPressChange,r=t.onPressStart,i=_l(e);this._touchActivatePosition={pageX:i.pageX,pageY:i.pageY},r?.(e),n?.(!0)}_deactivate(e){var t=this._config,n=t.onPressChange,r=t.onPressEnd;function i(){r?.(e),n?.(!1)}var a=gl(this._config.delayPressEnd);a>0?this._pressOutDelayTimeout=setTimeout(()=>{i()},a):i()}_handleLongPress(e){(this._touchState===el||this._touchState===$c)&&this._receiveSignal(Zc,e)}_cancelLongPressDelayTimeout(){this._longPressDelayTimeout!=null&&(clearTimeout(this._longPressDelayTimeout),this._longPressDelayTimeout=null)}_cancelPressDelayTimeout(){this._pressDelayTimeout!=null&&(clearTimeout(this._pressDelayTimeout),this._pressDelayTimeout=null)}_cancelPressOutDelayTimeout(){this._pressOutDelayTimeout!=null&&(clearTimeout(this._pressOutDelayTimeout),this._pressOutDelayTimeout=null)}};function gl(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=0),Math.max(t,e??n)}function _l(e){var t=e.nativeEvent,n=t.changedTouches,r=t.touches;return r!=null&&r.length>0?r[0]:n!=null&&n.length>0?n[0]:e.nativeEvent}function vl(e,t){var n=(0,y.useRef)(null);n.current??=new hl(t);var r=n.current;return(0,y.useEffect)(()=>{r.configure(t)},[t,r]),(0,y.useEffect)(()=>()=>{r.reset()},[r]),(0,y.useDebugValue)(t),r.getEventHandlers()}var yl=()=>{};function bl(){var e=!1;if(_r)try{var t={};Object.defineProperty(t,`passive`,{get(){return e=!0,!1}}),window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t)}catch{}return e}var xl=bl();function Sl(e){return e==null?!1:xl?e:!!e.capture}function Cl(){return this.cancelBubble}function wl(){return this.defaultPrevented}function Tl(e){return e.nativeEvent=e,e.persist=yl,e.isDefaultPrevented=wl,e.isPropagationStopped=Cl,e}function El(e,t,n,r){var i=Sl(r),a=e=>n(Tl(e));return e.addEventListener(t,a,i),function(){e?.removeEventListener(t,a,i)}}var Dl=()=>typeof window<`u`&&window.PointerEvent!=null,Ol=`keyboard`,kl=`keyboard`,Al,jl,Ml=!1,Nl=new Set,Pl=`keyboard`,Fl=`mouse`,Il=`touch`,Ll=`blur`,Rl=`contextmenu`,zl=`focus`,Bl=`keydown`,Vl=`mousedown`,Hl=`mousemove`,Ul=`mouseup`,Wl=`pointerdown`,Gl=`pointermove`,Kl=`scroll`,ql=`selectionchange`,Jl=`touchcancel`,Yl=`touchmove`,Xl=`touchstart`,Zl=`visibilitychange`,Ql={passive:!0},$l={capture:!0,passive:!0};function eu(){(Al!=null||jl!=null)&&(Al!=null&&(kl=Al,Al=null),jl!=null&&(Ol=jl,jl=null),ou())}function tu(){Al=kl,jl=Ol,Ol=Pl,kl=Pl,ou(),Ml=!1}function nu(){eu()}function ru(e){e.metaKey||e.altKey||e.ctrlKey||kl!==Pl&&(kl=Pl,Ol=Pl,ou())}function iu(){document.visibilityState!==`hidden`&&eu()}function au(e){var t=e.type;if(Dl()){if(t===Wl){Ol!==e.pointerType&&(kl=e.pointerType,Ol=e.pointerType,ou());return}if(t===Gl){kl!==e.pointerType&&(kl=e.pointerType,ou());return}}else{if(Ml||(t===Vl&&Ol!==Fl&&(kl=Fl,Ol=Fl,ou()),t===Hl&&kl!==Fl&&(kl=Fl,ou())),t===Xl){Ml=!0,e.touches&&e.touches.length>1&&(Ml=!1),Ol!==Il&&(kl=Il,Ol=Il,ou());return}(t===Rl||t===Ul||t===ql||t===Kl||t===Jl||t===Yl)&&(Ml=!1)}}_r&&(El(window,Ll,tu,Ql),El(window,zl,nu,Ql),El(document,Bl,ru,$l),El(document,Zl,iu,$l),El(document,Wl,au,$l),El(document,Gl,au,$l),El(document,Rl,au,$l),El(document,Vl,au,$l),El(document,Hl,au,$l),El(document,Ul,au,$l),El(document,Jl,au,$l),El(document,Yl,au,$l),El(document,Xl,au,$l),El(document,ql,au,$l),El(document,Kl,au,$l));function ou(){var e={activeModality:Ol,modality:kl};Nl.forEach(t=>{t(e)})}function su(){return kl}function cu(e,t){var n=ks(()=>new Map),r=ks(()=>(r,i)=>{n.get(r)?.(),i??=(n.delete(r),()=>{});var a=El(r,e,i,t);return n.set(r,a),a});return xs(()=>()=>{n.forEach(e=>{e()}),n.clear()},[n]),r}var lu={},uu={passive:!0},du=`react-gui:hover:lock`,fu=`react-gui:hover:unlock`,pu=()=>typeof window<`u`&&window.PointerEvent!=null;function mu(e,t,n){var r=document.createEvent(`CustomEvent`),i=n||lu,a=i.bubbles,o=a===void 0?!0:a,s=i.cancelable,c=s===void 0?!0:s,l=i.detail;r.initCustomEvent(t,o,c,l),e.dispatchEvent(r)}function hu(e){return e.pointerType??su()}function gu(e,t){var n=t.contain,r=t.disabled,i=t.onHoverStart,a=t.onHoverChange,o=t.onHoverUpdate,s=t.onHoverEnd,c=pu(),l=cu(c?`pointermove`:`mousemove`,uu),u=cu(c?`pointerenter`:`mouseenter`,uu),d=cu(c?`pointerleave`:`mouseleave`,uu),f=cu(du,uu),p=cu(fu,uu);xs(()=>{var t=e.current;if(t!==null){var c=function(e){s?.(e),a?.(!1),l(t,null),d(t,null)},m=function(t){var r=e.current;r!=null&&hu(t)!==`touch`&&(n&&mu(r,fu),c(t))},h=function(e){hu(e)!==`touch`&&o!=null&&(e.x??=e.clientX,e.y??=e.clientY,o(e))},g=function(e){i?.(e),a?.(!0),o!=null&&l(t,r?null:h),d(t,r?null:m)};u(t,r?null:function(t){var i=e.current;i!=null&&hu(t)!==`touch`&&(n&&mu(i,du),g(t),f(i,r?null:function(e){e.target!==i&&c(t)}),p(i,r?null:function(e){e.target!==i&&g(t)}))})}},[u,l,d,f,p,n,r,i,a,o,s,e])}var _u=[`children`,`delayLongPress`,`delayPressIn`,`delayPressOut`,`disabled`,`onBlur`,`onContextMenu`,`onFocus`,`onHoverIn`,`onHoverOut`,`onKeyDown`,`onLongPress`,`onPress`,`onPressMove`,`onPressIn`,`onPressOut`,`style`,`tabIndex`,`testOnly_hovered`,`testOnly_pressed`];function vu(e,t){var n=e.children,r=e.delayLongPress,i=e.delayPressIn,a=e.delayPressOut,o=e.disabled,s=e.onBlur,c=e.onContextMenu,l=e.onFocus,u=e.onHoverIn,d=e.onHoverOut,f=e.onKeyDown,p=e.onLongPress,m=e.onPress,h=e.onPressMove,g=e.onPressIn,_=e.onPressOut,v=e.style,b=e.tabIndex,x=e.testOnly_hovered,S=e.testOnly_pressed,C=sr(e,_u),w=yu(x===!0),T=w[0],E=w[1],D=yu(!1),O=D[0],k=D[1],A=yu(S===!0),j=A[0],M=A[1],N=(0,y.useRef)(null),P=Ds(t,N),F=vl(N,(0,y.useMemo)(()=>({delayLongPress:r,delayPressStart:i,delayPressEnd:a,disabled:o,onLongPress:p,onPress:m,onPressChange:M,onPressStart:g,onPressMove:h,onPressEnd:_}),[r,i,a,o,p,m,g,h,_,M])),I=F.onContextMenu,L=F.onKeyDown;gu(N,{contain:!0,disabled:o,onHoverChange:E,onHoverStart:u,onHoverEnd:d});var R={hovered:T,focused:O,pressed:j},z=y.useCallback(e=>{e.nativeEvent.target===N.current&&(k(!1),s?.(e))},[N,k,s]),ee=y.useCallback(e=>{e.nativeEvent.target===N.current&&(k(!0),l?.(e))},[N,k,l]),te=y.useCallback(e=>{I?.(e),c?.(e)},[c,I]),ne=y.useCallback(e=>{L?.(e),f?.(e)},[f,L]),re=b===void 0?o?-1:0:b;return y.createElement(Vc,ds({},C,F,{"aria-disabled":o,onBlur:z,onContextMenu:te,onFocus:ee,onKeyDown:ne,ref:P,style:[o?bu.disabled:bu.active,typeof v==`function`?v(R):v],tabIndex:re}),typeof n==`function`?n(R):n)}function yu(e){var t=(0,y.useState)(!1),n=t[0],r=t[1];return[n||e,r]}var bu=Fo.create({active:{cursor:`pointer`,touchAction:`manipulation`},disabled:{pointerEvents:`box-none`}}),xu=(0,y.memo)((0,y.forwardRef)(vu));xu.displayName=`Pressable`;function Su(e){let t=Jn();return(0,K.jsx)(Kc,{...e,style:[Cu.base,{color:t.colors.text},e.style]})}var Cu=Fo.create({base:{fontSize:14,lineHeight:20}});function wu({label:e,onPress:t}){let n=Jn();return(0,K.jsx)(xu,{onPress:t,children:(0,K.jsx)(Vc,{style:[Tu.button,{backgroundColor:n.colors.primary,borderRadius:n.radius.md}],children:(0,K.jsx)(Su,{style:Tu.label,children:e})})})}var Tu=Fo.create({button:{paddingHorizontal:16,paddingVertical:10},label:{color:`#ffffff`,fontWeight:`600`}});Fo.create({content:{flexGrow:1}});function Eu(e){let t=Jn();return(0,K.jsx)(Vc,{...e,style:[Du.card,{backgroundColor:t.colors.surface,borderColor:t.colors.border,borderRadius:t.radius.md},e.style]})}var Du=Fo.create({card:{borderWidth:1,padding:12}}),Ou={destructive:!0,readOnly:!1,network:!1,longRunning:!1,handlesSecrets:!1},ku={"*":[{test:/^(read|cat|view|open_file|read_file|file_read|glob|grep|search_files|file_search|list_dir|ls|find)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(fetch|web(fetch|search)?|search_query|browser_(navigate|open|visit|search)|open_url|http_request)$/i,value:{destructive:!1,readOnly:!0,network:!0}},{test:/^(bash|shell|exec_command|run_shell_command|terminal|command)$/i,value:{longRunning:!0},inputTest:/\b(rm|del|remove-item|mv|move|cp|copy|chmod|chown|git\s+(commit|push|reset|clean|checkout)|npm\s+publish)\b/i},{test:/^(bash|shell|exec_command|run_shell_command|terminal|command)$/i,value:{destructive:!1,readOnly:!0,longRunning:!0},inputTest:/\b(ls|dir|cat|type|pwd|echo|grep|rg|find|git\s+(status|diff|log)|npm\s+(test|run\s+lint)|vitest|eslint|tsc)\b/i},{test:/^(write|edit|multi(edit)?|replace|patch|apply_patch|notebook(edit|_write)|file_(write|create|delete|patch)|create|mkdir|delete|remove|rename|move|copy)$/i,value:{destructive:!0,readOnly:!1}},{test:/^(secret|credential|credentials|auth|login|token|env|keychain|vault)/i,value:{handlesSecrets:!0}}],claude:[{test:/^(Read|Grep|Glob|LS|NotebookRead|TodoRead)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(Write|Edit|MultiEdit|NotebookEdit|TodoWrite)$/i,value:{destructive:!0,readOnly:!1}},{test:/^Web(Fetch|Search)$/i,value:{destructive:!1,readOnly:!0,network:!0}},{test:/^Bash$/i,value:{longRunning:!0}},{test:/^Task$/i,value:{longRunning:!0}}],codex:[{test:/^(view_image|read_mcp_resource|list_mcp_resources|list_mcp_resource_templates)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(exec_command|write_stdin)$/i,value:{longRunning:!0}},{test:/^apply_patch$/i,value:{destructive:!0,readOnly:!1}}],gemini:[{test:/^(read_file|grep_in_files|search_codebase)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(write_file|replace_file_text|create_file|delete_file)$/i,value:{destructive:!0,readOnly:!1}},{test:/^google_search$/i,value:{destructive:!1,readOnly:!0,network:!0}},{test:/^run_shell_command$/i,value:{longRunning:!0}}],copilot:[{test:/^(readFile|findTextInFiles|search)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(createFile|editFile|deleteFile)$/i,value:{destructive:!0,readOnly:!1}}],cursor:[{test:/^(read_file|search_files|list_files)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(edit_file|create_file|delete_file)$/i,value:{destructive:!0,readOnly:!1}}],opencode:[{test:/^(read|grep|glob|ls)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(write|edit|patch)$/i,value:{destructive:!0,readOnly:!1}}],openclaw:[{test:/^(channel-plugin|webhook)$/i,value:{network:!0,longRunning:!0}}],pi:[{test:/^(read_file|search_files)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(write_file|edit_file)$/i,value:{destructive:!0,readOnly:!1}}],omp:[{test:/^(read|grep|glob)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(write|edit|patch)$/i,value:{destructive:!0,readOnly:!1}}],hermes:[{test:/^(read_file|grep|glob)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(write_file|edit_file|patch_file)$/i,value:{destructive:!0,readOnly:!1}}]};function Au(e,t,n){let r=String(e).toLowerCase(),i=typeof n==`string`?n:JSON.stringify(n??``),a=[...ku[`*`]??[],...ku[r]??[]],o={...Ou};for(let e of a)e.test.test(t)&&(e.inputTest&&!e.inputTest.test(i)||Object.assign(o,e.value));return o}var ju=[];function Mu(e){let t=ju.findIndex(t=>t.id===e.id);t>=0&&ju.splice(t,1),ju.push(e),ju.sort((e,t)=>t.priority-e.priority)}function Nu(e,t,n){let r=Au(e,t,n),i=ju.find(e=>e.match({toolName:t,classification:r}));if(!i)throw Error(`No tool-call renderer registered. Register generic last.`);return i}function Pu(e,t,n){return(0,K.jsxs)(Eu,{children:[(0,K.jsx)(Su,{style:{fontWeight:`700`,color:n?`#b91c1c`:void 0},children:e}),(0,K.jsx)(Su,{children:t})]})}var Fu={id:`generic`,priority:0,match:()=>!0,compact(e){return Pu(e.toolName,Iu(e.input),e.classification.destructive)},expanded(e){return Pu(e.toolName,`${Iu(e.input)}\n${Iu(e.output)}`,e.classification.destructive)},approvalPreview(e){return Pu(`Approve ${e.toolName}?`,Iu(e.input),e.classification.destructive)}};function Iu(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}var Lu={...Fu,id:`bash`,priority:99,match:({toolName:e})=>/bash|shell|exec_command|terminal/i.test(e)},Ru={...Fu,id:`edit`,priority:93,match:({toolName:e})=>/edit|patch|replace/i.test(e)},zu={...Fu,id:`glob`,priority:91,match:({toolName:e})=>/glob|ls|find/i.test(e)},Bu={...Fu,id:`grep`,priority:91,match:({toolName:e})=>/grep|search/i.test(e)},Vu={...Fu,id:`read`,priority:90,match:({toolName:e})=>/read|cat|view/i.test(e)},Hu={...Fu,id:`web-fetch`,priority:94,match:({toolName:e})=>/fetch/i.test(e)},Uu={...Fu,id:`web-search`,priority:94,match:({toolName:e})=>/search/i.test(e)&&/web|browser/i.test(e)},Wu={...Fu,id:`write`,priority:92,match:({toolName:e})=>/write|create/i.test(e)},Gu=!1;function Ku(){if(!Gu){Gu=!0;for(let e of[Lu,Hu,Uu,Ru,Wu,Bu,zu,Vu,Fu])Mu(e)}}function qu(e){Ku();let t=Nu(e.agent,e.toolName,e.input),n=Au(e.agent,e.toolName,e.input);return(0,K.jsxs)(Eu,{children:[(0,K.jsxs)(Vc,{style:{gap:12},children:[(0,K.jsx)(Su,{style:{fontWeight:`700`},children:`Hook Approval`}),(0,K.jsx)(Su,{children:`Decision in ${e.secondsRemaining}s`}),t.approvalPreview({agent:e.agent,toolName:e.toolName,input:e.input,classification:n})]}),(0,K.jsxs)(Vc,{style:{flexDirection:`row`,gap:8,marginTop:12},children:[(0,K.jsx)(wu,{label:`Allow`,onPress:e.onAllow}),(0,K.jsx)(wu,{label:`Deny`,onPress:e.onDeny}),e.onModify?(0,K.jsx)(wu,{label:`Modify`,onPress:e.onModify}):null]})]})}function Ju(e){return(0,K.jsx)(Vc,{style:{flexDirection:`row`,flexWrap:`wrap`,gap:8},children:e.agents.map(t=>(0,K.jsx)(wu,{label:t===e.selected?`${t} *`:t,onPress:()=>e.onSelect(t)},t))})}function Yu(e){return e.status===`connected`&&!e.error?null:(0,K.jsx)(Eu,{children:(0,K.jsx)(Su,{children:e.error??e.status})})}Fo.create({container:{flex:1,gap:12},summaryRow:{flexDirection:`row`,flexWrap:`wrap`,gap:8},chip:{borderWidth:1,borderRadius:999,paddingHorizontal:10,paddingVertical:6},chipText:{fontSize:12,lineHeight:16,fontWeight:`600`},tabRow:{flexDirection:`row`,flexWrap:`wrap`,gap:8},tab:{borderWidth:1,borderRadius:999,paddingHorizontal:12,paddingVertical:8,flexDirection:`row`,alignItems:`center`,gap:8},tabText:{fontWeight:`700`},tabTextActive:{color:`#ffffff`},tabBadge:{fontSize:12,lineHeight:16,fontWeight:`700`},scroll:{flex:1},scrollContent:{gap:10,paddingBottom:16},sectionCard:{gap:10},cardHeader:{flexDirection:`row`,flexWrap:`wrap`,justifyContent:`space-between`,alignItems:`flex-start`,gap:10},cardHeaderText:{flexShrink:1,gap:4},cardTitle:{fontWeight:`700`},segmentRow:{flexDirection:`row`,flexWrap:`wrap`,gap:10},segmentCard:{minWidth:180,flexBasis:180,borderWidth:1,borderRadius:12,padding:10,gap:8},segmentHeader:{flexDirection:`row`,flexWrap:`wrap`,alignItems:`center`,gap:8},segmentTitle:{fontWeight:`600`},metaRow:{flexDirection:`row`,flexWrap:`wrap`,gap:8},mutedText:{fontSize:12,lineHeight:16,opacity:.8},emptyState:{borderWidth:1,borderStyle:`dashed`,borderRadius:14,padding:14}});function Xu(e){return(0,K.jsx)(Vc,{children:(0,K.jsx)(Ju,{agents:In(),selected:e.selected,onSelect:e.onSelect})})}Fo.create({screen:{flex:1,gap:12},heading:{fontWeight:`700`}});function Zu(){let e=Wn(),{client:t}=Mn();return(0,K.jsx)(Vc,{children:e.map(e=>(0,K.jsx)(qu,{agent:`claude`,toolName:String(e.payload.toolName??e.hookKind),input:e.payload,secondsRemaining:Math.max(0,Math.floor((e.deadlineTs-Date.now())/1e3)),onAllow:()=>void t.request({type:`hook.decision`,hookRequestId:e.hookRequestId,decision:`allow`}),onDeny:()=>void t.request({type:`hook.decision`,hookRequestId:e.hookRequestId,decision:`deny`})},e.hookRequestId))})}function Qu(){let e=Fn();return(0,K.jsx)(Vc,{children:(0,K.jsx)(Yu,{status:e.status,error:e.error})})}var $u={colors:{background:`#151819`,surface:`#1f2628`,border:`#344144`,text:`#f4f2ee`,mutedText:`#a7b0b1`,primary:`#7dd3c7`},spacing:{xs:4,sm:8,md:12,lg:16},radius:{sm:8,md:14}},ed=`amux.webui.auth`,td=15e3,nd=(0,y.createContext)(null);function rd(e){return e.replace(/\/+$/,``)}function id(e){return e.startsWith(`https://`)?`wss://${e.slice(8)}`:e.startsWith(`http://`)?`ws://${e.slice(7)}`:e}function ad(){return typeof window>`u`?`http://127.0.0.1:7878`:`${window.location.protocol}//${window.location.host}`}function od(){if(typeof window>`u`)return null;let e=window.localStorage.getItem(ed);if(!e)return null;try{let t=JSON.parse(e);return!t.token||!t.gatewayUrl?null:{gatewayUrl:rd(t.gatewayUrl),token:t.token}}catch{return null}}async function sd(e){let t=new Bt({url:id(e.gatewayUrl),token:e.token});try{await t.connect(),await t.request({type:`agents.list`})}finally{await t.close()}}async function cd(e,t,n,r){let i=await fetch(`${rd(e)}${n}`,{...r,headers:{"content-type":`application/json`,authorization:`Bearer ${t}`,...r?.headers??{}}});if(!i.ok)throw Error(`Gateway request failed: ${i.status}`);return await i.json()}function ld(e){let{client:t,store:n}=Mn(),r=(0,y.useRef)(new Map),i=(0,y.useRef)(null);function a(e){return Array.isArray(e)?e.flatMap(e=>{if(typeof e==`string`)return[{agent:e,displayName:e}];if(!e||typeof e!=`object`)return[];let t=e,n=typeof t.agent==`string`?t.agent:``;return n?[{agent:n,displayName:typeof t.displayName==`string`?t.displayName:n,adapterType:typeof t.adapterType==`string`?t.adapterType:void 0,structuredSessionTransport:t.structuredSessionTransport===`restart-per-turn`||t.structuredSessionTransport===`persistent`?t.structuredSessionTransport:`none`,sessionControlPlane:t.sessionControlPlane===`external-host`||t.sessionControlPlane===`mcp-mediated`?t.sessionControlPlane:`self-managed`,supportsInteractiveMode:typeof t.supportsInteractiveMode==`boolean`?t.supportsInteractiveMode:void 0,canResume:typeof t.canResume==`boolean`?t.canResume:void 0}]:[]}):[]}return(0,y.useEffect)(()=>{let o=!1,s=null;async function c(){if(i.current)return await i.current;let s=(async()=>{let[i,s,c]=await Promise.allSettled([cd(e.gatewayUrl,e.token,`/api/v1/agents`),cd(e.gatewayUrl,e.token,`/api/v1/runs`),cd(e.gatewayUrl,e.token,`/api/v1/sessions`)]);if(o)return;let l=n.getState().actions;i.status===`fulfilled`&&l.setAgents(a(i.value.agentDescriptors??i.value.agents));for(let e of s.status===`fulfilled`?s.value.runs:[]){let t=String(e.runId??``);t&&(l.mergeRun(t,e),typeof e.sessionId==`string`&&l.mergeSession(e.sessionId,{agent:e.agent}))}let u=new Set;for(let e of c.status===`fulfilled`?c.value.sessions:[]){let t=typeof e.sessionId==`string`?e.sessionId:``;t&&(l.mergeSession(t,e),typeof e.activeRunId==`string`&&e.activeRunId.length>0&&u.add(e.activeRunId))}for(let[e,t]of r.current.entries())u.has(e)||(t(),r.current.delete(e));for(let e of u)r.current.has(e)||r.current.set(e,t.subscribeRun(e))})().finally(()=>{i.current=null});return i.current=s,await s}function l(){o||(s=window.setTimeout(async()=>{try{await c()}finally{l()}},td))}return c().finally(()=>{l()}),()=>{o=!0,s!=null&&window.clearTimeout(s);for(let e of r.current.values())e();r.current.clear()}},[t,e.gatewayUrl,e.token,n]),(0,K.jsx)(K.Fragment,{children:e.children})}function ud(e){let[t,n]=(0,y.useState)(()=>od()),r=(0,y.useMemo)(()=>({auth:t,isAuthenticated:t!==null,async login(e){let t={gatewayUrl:rd(e.gatewayUrl||ad()),token:e.token.trim()};await sd(t),window.localStorage.setItem(ed,JSON.stringify(t)),n(t)},logout(){window.localStorage.removeItem(ed),n(null)}}),[t]),i=(0,y.useMemo)(()=>t?new Bt({url:id(t.gatewayUrl),token:t.token}):null,[t]);return(0,K.jsx)(nd.Provider,{value:r,children:i&&t?(0,K.jsx)(jn,{client:i,children:(0,K.jsx)(ld,{gatewayUrl:t.gatewayUrl,token:t.token,children:e.children})}):e.children})}function dd(){let e=(0,y.useContext)(nd);if(!e)throw Error(`useGatewayAuth must be used inside the web gateway provider`);return e}function fd(){let{auth:e}=dd();return(0,y.useMemo)(()=>async(t,n)=>{if(!e)throw Error(`Gateway auth is required`);return await fetch(`${rd(e.gatewayUrl)}${t}`,{...n,headers:{authorization:`Bearer ${e.token}`,...n?.headers??{}}})},[e])}async function pd(){typeof Notification>`u`||Notification.permission!==`default`||await Notification.requestPermission()}function md(e){if(typeof Notification>`u`||Notification.permission!==`granted`)return;let t=new Notification(e.title,{body:e.body});t.onclick=()=>{window.focus(),e.onClick(),t.close()}}function hd(){let e=Re(),t=Wn(),n=(0,y.useRef)(new Set);return(0,y.useEffect)(()=>{pd()},[]),(0,y.useEffect)(()=>{if(!(typeof document>`u`||document.visibilityState===`visible`))for(let r of t)n.current.has(r.hookRequestId)||(n.current.add(r.hookRequestId),md({title:`agent-mux hook approval`,body:`${r.hookKind} requires attention`,onClick:()=>e(`/inbox`)}))},[t,e]),null}function gd(e){let{isAuthenticated:t}=dd();return(0,K.jsxs)(K.Fragment,{children:[t?(0,K.jsx)(hd,{}):null,e.children]})}var _d=`amux.webui.theme`,vd=(0,y.createContext)(null);function yd(){return typeof window>`u`?`light`:window.localStorage.getItem(_d)===`dark`?`dark`:`light`}function bd(e){let[t,n]=(0,y.useState)(()=>yd());(0,y.useEffect)(()=>{typeof document>`u`||(document.documentElement.dataset.theme=t,document.documentElement.dataset.compendiumTheme=t===`light`?`vellum`:`void`)},[t]);let r=(0,y.useMemo)(()=>({mode:t,toggle(){let e=t===`light`?`dark`:`light`;window.localStorage.setItem(_d,e),n(e)}}),[t]);return(0,K.jsx)(vd.Provider,{value:r,children:(0,K.jsx)(qn,{value:t===`light`?Gn:$u,children:e.children})})}function xd(){let e=(0,y.useContext)(vd);if(!e)throw Error(`useThemeMode must be used inside ThemeProvider`);return e}function Sd(){let{store:e}=Mn(),t=Pn(e,Hn(e=>Object.values(e.sessions.byId))),n=Pn(e,e=>e.agents.items),r=(0,y.useMemo)(()=>[...t].sort((e,t)=>Number(t.updatedAt??0)-Number(e.updatedAt??0)).slice(0,8),[t]),i=t.filter(e=>e.status===`active`).length,a=t.filter(e=>e.status!==`active`).length;return(0,K.jsxs)(`section`,{className:`dashboard-layout`,children:[(0,K.jsxs)(`article`,{className:`panel hero-panel`,children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`Session-First Flow`}),(0,K.jsx)(`h2`,{children:`Sessions are the product. Live processes are just the current execution state.`}),(0,K.jsx)(`p`,{className:`lede`,children:`Start a new session, talk inside the session view, and resume inactive sessions from the same place. The browser should not force you to think in terms of runs.`}),(0,K.jsxs)(`div`,{className:`actions`,children:[(0,K.jsx)(Dt,{to:`/sessions/new`,children:`Start session`}),(0,K.jsx)(Dt,{className:`ghost-link`,to:`/sessions`,children:`Open sessions`})]})]}),(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Session Overview`})}),(0,K.jsxs)(`div`,{className:`summary-grid`,children:[(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Active sessions`}),(0,K.jsx)(`strong`,{children:i})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Inactive sessions`}),(0,K.jsx)(`strong`,{children:a})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Available agents`}),(0,K.jsx)(`strong`,{children:n.length})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Primary action`}),(0,K.jsx)(`strong`,{children:`Open a session chat`})]})]})]}),(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsxs)(`header`,{children:[(0,K.jsx)(`h2`,{children:`Recent Sessions`}),(0,K.jsx)(Dt,{to:`/sessions`,children:`View all`})]}),(0,K.jsxs)(`div`,{className:`list-grid`,children:[r.map(e=>(0,K.jsxs)(`article`,{className:`list-card`,children:[(0,K.jsxs)(`div`,{className:`list-card-main`,children:[(0,K.jsx)(`strong`,{children:String(e.sessionId)}),(0,K.jsx)(`span`,{className:`meta-chip`,children:String(e.agent??`unknown`)}),(0,K.jsx)(`span`,{className:`status-badge status-${String(e.status??`inactive`)}`,children:String(e.status??`inactive`)})]}),(0,K.jsx)(`div`,{className:`actions`,children:(0,K.jsx)(Dt,{className:`ghost-link`,to:`/sessions/${e.sessionId}`,children:`Open chat`})})]},String(e.sessionId))),r.length===0?(0,K.jsx)(`p`,{className:`muted-copy`,children:`No sessions have been created yet.`}):null]})]})]})}function Cd(...e){return e.filter(Boolean).join(` `)}function wd(e,t,n=!0){(0,y.useEffect)(()=>{if(!n)return;let r=n=>{let r=e.current;r&&!r.contains(n.target)&&t(n)};return document.addEventListener(`mousedown`,r),()=>document.removeEventListener(`mousedown`,r)},[n,t])}function Td(e,t,n=!0){(0,y.useEffect)(()=>{if(!n)return;let r=n=>{n.key===e&&t(n)};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e,n,t])}function Ed(e,t,n){let[r,i]=(0,y.useState)(t),a=e!==void 0;return[a?e:r,(0,y.useCallback)(e=>{a||i(e),n&&n(e)},[a,n])]}function Dd(e,t,n=`bottom-start`){let[r,i]=(0,y.useState)({top:0,left:0,width:0});return(0,y.useLayoutEffect)(()=>{if(!t||!e.current)return;let r=()=>{let t=e.current.getBoundingClientRect(),r=t.bottom+4,a=t.left;n===`bottom-end`&&(a=t.right),n===`top-start`&&(r=t.top-4),i({top:r+window.scrollY,left:a+window.scrollX,width:t.width})};return r(),window.addEventListener(`scroll`,r,!0),window.addEventListener(`resize`,r),()=>{window.removeEventListener(`scroll`,r,!0),window.removeEventListener(`resize`,r)}},[t,n]),r}var Od=({children:e})=>{let[t]=(0,y.useState)(()=>{let e=document.createElement(`div`);return e.setAttribute(`data-tkc-portal`,``),e});return(0,y.useEffect)(()=>(document.body.appendChild(t),()=>{document.body.removeChild(t)}),[t]),(0,x.createPortal)(e,t)},kd={check:`M4 8l3 3 5-7`,dash:`M4 8h8`,caret:`M6 4l4 4-4 4`,x:`M4 4l8 8M12 4l-8 8`,plus:`M8 3v10M3 8h10`,minus:`M3 8h10`,search:[`M7.5 13a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11zM11.5 11.5L14 14`,null],folder:`M2 4.5C2 3.67 2.67 3 3.5 3h2.3l1 1.5H12.5c.83 0 1.5.67 1.5 1.5V12c0 .83-.67 1.5-1.5 1.5h-9A1.5 1.5 0 0 1 2 12z`,file:`M4 2h5l3 3v9H4z M9 2v3h3`,gear:`M8 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM8 1v2M8 13v2M1 8h2M13 8h2M3 3l1.5 1.5M11.5 11.5L13 13M3 13l1.5-1.5M11.5 4.5L13 3`,calendar:`M3 5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1zM3 7h10M5 3v2M11 3v2`,clock:[`M8 2.5A5.5 5.5 0 1 0 8 13.5 5.5 5.5 0 0 0 8 2.5zM8 5v3l2 1.5`,null],pencil:`M3 13l1-3 7-7 2 2-7 7-3 1z`,upload:`M8 11V3M5 6l3-3 3 3M3 13h10`,bell:`M4 11a4 4 0 0 1 8 0v1l1 1H3l1-1zM6 13a2 2 0 0 0 4 0`,info:[`M8 1.5A6.5 6.5 0 1 0 8 14.5 6.5 6.5 0 0 0 8 1.5zM8 7v4.5M8 5h.01`,null],chevronRight:`M6 3l5 5-5 5`,chevronDown:`M3 6l5 5 5-5`},Ad=({name:e,size:t=14,className:n=``,style:r})=>{let i=kd[e]||``;return(0,K.jsx)(`svg`,{className:n,width:t,height:t,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{display:`inline-block`,verticalAlign:`middle`,...r},children:Array.isArray(i)?i.map((e,t)=>e?(0,K.jsx)(`path`,{d:e},t):null):(0,K.jsx)(`path`,{d:i})})},jd=({variant:e=`default`,size:t,loading:n,disabled:r,leading:i,trailing:a,className:o,children:s,onClick:c,...l})=>(0,K.jsxs)(`button`,{className:Cd(`tkc-btn`,e===`primary`&&`tkc-btn--primary`,e===`ghost`&&`tkc-btn--ghost`,t===`sm`&&`tkc-btn--sm`,o),disabled:r,"data-loading":n||void 0,onClick:c,...l,children:[n&&(0,K.jsx)(`span`,{className:`tkc-btn__spin`}),!n&&i,s,!n&&a]}),Md=(0,y.forwardRef)(({className:e,invalid:t,...n},r)=>(0,K.jsx)(`input`,{ref:r,className:Cd(`tkc-input`,t&&`tkc-input--invalid`,e),...n}));Md.displayName=`Input`;var Nd=(0,y.forwardRef)(({className:e,invalid:t,rows:n=3,...r},i)=>(0,K.jsx)(`textarea`,{ref:i,className:Cd(`tkc-textarea`,t&&`tkc-input--invalid`,e),rows:n,style:{resize:`vertical`},...r}));Nd.displayName=`Textarea`;var Pd=({label:e,hint:t,error:n,children:r})=>(0,K.jsxs)(`label`,{className:`tkc-field`,children:[e&&(0,K.jsx)(`span`,{className:`tkc-field__label`,children:e}),r,n?(0,K.jsx)(`span`,{className:`tkc-field__error`,children:n}):t?(0,K.jsx)(`span`,{className:`tkc-field__hint`,children:t}):null]}),Fd=({value:e,defaultValue:t,onChange:n,items:r=[]})=>{let[i,a]=Ed(e,t||r&&r[0]?.value,n);return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`tkc-tabs`,role:`tablist`,children:r.map(e=>(0,K.jsxs)(`button`,{type:`button`,role:`tab`,className:`tkc-tab`,"data-active":i===e.value||void 0,onClick:()=>a(e.value),children:[e.label,e.badge!=null&&(0,K.jsx)(`span`,{className:`tkc-badge`,style:{marginLeft:8},children:e.badge})]},e.value))}),r.map(e=>i===e.value?(0,K.jsx)(`div`,{role:`tabpanel`,style:{paddingTop:16},children:e.body},e.value):null)]})},Id=({node:e,depth:t=0,expanded:n,setExpanded:r,selected:i,setSelected:a})=>{let o=n.has(e.id),s=!!(e.children&&e.children.length>0);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`tkc-tree__node`,"data-open":o||void 0,"data-selected":i===e.id||void 0,style:{paddingLeft:6+t*16},onClick:()=>{if(a(e.id),s){let t=new Set(n);t.has(e.id)?t.delete(e.id):t.add(e.id),r(t)}},children:[(0,K.jsx)(`span`,{className:`tkc-tree__caret`,children:s?(0,K.jsx)(Ad,{name:`chevronRight`,size:11}):null}),(0,K.jsx)(Ad,{name:s?`folder`:`file`,size:13,style:{color:`var(--tkc-ink-soft)`}}),(0,K.jsx)(`span`,{children:e.label}),e.count!=null&&(0,K.jsx)(`span`,{className:`tkc-tree__count`,children:e.count})]}),s&&o&&e.children.map(e=>(0,K.jsx)(Id,{node:e,depth:t+1,expanded:n,setExpanded:r,selected:i,setSelected:a},e.id))]})},Ld=({item:e,active:t,onSelect:n,depth:r=0})=>{let[i,a]=(0,y.useState)(!1),o=!!(e.children&&e.children.length>0);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`tkc-tree__node`,"data-selected":t===e.value||void 0,style:{paddingLeft:6+r*16},onClick:()=>{o&&a(e=>!e),n&&n(e.value)},children:[e.icon&&(0,K.jsx)(Ad,{name:e.icon,size:13,style:{color:`var(--tkc-ink-soft)`}}),(0,K.jsx)(`span`,{children:e.label}),o&&(0,K.jsx)(`span`,{className:`tkc-tree__caret`,children:(0,K.jsx)(Ad,{name:`chevronRight`,size:11})})]}),o&&i&&e.children.map(e=>(0,K.jsx)(Ld,{item:e,active:t,onSelect:n,depth:r+1},e.value))]})},Rd=({value:e,defaultValue:t,onChange:n,options:r,placeholder:i=`Select…`,disabled:a})=>{let[o,s]=Ed(e,t,n),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(0),f=(0,y.useRef)(null),p=(0,y.useRef)(null),m=Dd(f,c),h=r.map(e=>typeof e==`string`?{value:e,label:e}:e);wd(p,()=>l(!1),c),Td(`Escape`,()=>l(!1),c);let g=h.find(e=>e.value===o),_=e=>{if(!c){(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(l(!0),e.preventDefault());return}e.key===`ArrowDown`?(d(e=>(e+1)%h.length),e.preventDefault()):e.key===`ArrowUp`?(d(e=>(e-1+h.length)%h.length),e.preventDefault()):e.key===`Enter`&&(s(h[u].value),l(!1),e.preventDefault())};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`button`,{ref:f,type:`button`,className:`tkc-select tkc-focus`,"data-open":c||void 0,disabled:a,onClick:()=>!a&&l(e=>!e),onKeyDown:_,children:[(0,K.jsx)(`span`,{className:g?``:`tkc-select__placeholder`,children:g?g.label:i}),(0,K.jsx)(`span`,{className:`tkc-select__caret`,children:(0,K.jsx)(Ad,{name:`chevronDown`,size:12})})]}),c&&(0,K.jsx)(Od,{children:(0,K.jsx)(`div`,{ref:p,className:`tkc-pop`,style:{top:m.top,left:m.left,minWidth:m.width},onKeyDown:_,children:h.map((e,t)=>(0,K.jsxs)(`div`,{className:`tkc-pop__item`,"data-active":t===u||void 0,"data-selected":e.value===o||void 0,onMouseEnter:()=>d(t),onClick:()=>{s(e.value),l(!1)},children:[(0,K.jsx)(`span`,{children:e.label}),(0,K.jsx)(`span`,{className:`tkc-pop__check`,children:(0,K.jsx)(Ad,{name:`check`,size:12})})]},e.value))})})]})},zd=({open:e,onClose:t,items:n,placeholder:r=`Type a command…`,onSelect:i})=>{let[a,o]=(0,y.useState)(``),[s,c]=(0,y.useState)(0),l=(0,y.useRef)(null);Td(`Escape`,()=>t&&t(),e),(0,y.useEffect)(()=>{e&&(o(``),c(0),setTimeout(()=>l.current?.focus(),0))},[e]);let u=n.filter(e=>e.label.toLowerCase().includes(a.toLowerCase())),d=e=>{e.onSelect&&e.onSelect(),i&&i(e),t&&t()};return e?(0,K.jsxs)(Od,{children:[(0,K.jsx)(`div`,{className:`tkc-scrim`,onClick:t}),(0,K.jsxs)(`div`,{className:`tkc-modal`,role:`dialog`,"aria-modal":`true`,style:{width:`min(520px, 92vw)`,padding:0},children:[(0,K.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`10px 14px`,borderBottom:`1.5px solid var(--tkc-rule-m)`},children:[(0,K.jsx)(Ad,{name:`search`,size:15,style:{color:`var(--tkc-ink-quiet)`}}),(0,K.jsx)(`input`,{ref:l,style:{border:0,background:`transparent`,outline:0,flex:1,font:`inherit`,fontSize:15,color:`var(--tkc-ink)`},placeholder:r,value:a,onChange:e=>{o(e.target.value),c(0)},onKeyDown:e=>{e.key===`ArrowDown`?(c(e=>Math.min(u.length-1,e+1)),e.preventDefault()):e.key===`ArrowUp`?(c(e=>Math.max(0,e-1)),e.preventDefault()):e.key===`Enter`&&u[s]&&(d(u[s]),e.preventDefault())}})]}),(0,K.jsx)(`div`,{style:{maxHeight:320,overflow:`auto`,padding:4},children:u.length===0?(0,K.jsx)(`div`,{className:`tkc-pop__empty`,children:`No commands found`}):u.map((e,t)=>(0,K.jsxs)(`div`,{className:`tkc-pop__item`,"data-active":t===s||void 0,onMouseEnter:()=>c(t),onClick:()=>d(e),children:[e.icon&&(0,K.jsx)(Ad,{name:e.icon,size:13}),(0,K.jsx)(`span`,{children:e.label}),e.shortcut&&(0,K.jsx)(`span`,{style:{marginLeft:`auto`,fontFamily:`var(--font-mono)`,fontSize:10,letterSpacing:`.1em`,color:`var(--tkc-ink-quiet)`},children:e.shortcut})]},e.id))})]})]}):null};(0,y.createContext)(null);var Bd=e=>(0,K.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 400 120`,width:400,height:120,...e,children:[(0,K.jsxs)(`g`,{stroke:`#1B1611`,strokeWidth:1,fill:`none`,children:[(0,K.jsx)(`path`,{d:`M10 10 h14 M10 10 v14`}),(0,K.jsx)(`path`,{d:`M390 10 h-14 M390 10 v14`}),(0,K.jsx)(`path`,{d:`M10 110 h14 M10 110 v-14`}),(0,K.jsx)(`path`,{d:`M390 110 h-14 M390 110 v-14`})]}),(0,K.jsxs)(`g`,{transform:`translate(36, 30)`,fill:`none`,stroke:`#1B1611`,strokeWidth:1.6,strokeLinecap:`round`,children:[(0,K.jsx)(`circle`,{cx:30,cy:30,r:28}),(0,K.jsx)(`path`,{d:`M14 44 L30 10 L46 44 M20 36 H40`}),(0,K.jsx)(`text`,{x:30,y:56,textAnchor:`middle`,className:`wm-mono`,fontSize:9,fill:`#1B1611`,stroke:`none`,children:`V.c`})]}),(0,K.jsxs)(`text`,{x:112,y:62,className:`wm-serif`,fontSize:44,fill:`#1B1611`,children:[`a5c`,(0,K.jsx)(`tspan`,{fill:`#C03A2B`,children:`.`}),`ai`]}),(0,K.jsx)(`text`,{x:112,y:86,className:`wm-mono`,fontSize:9,fill:`#5A4E3C`,children:`CODEX · OF · RELIABLE · AUTONOMY`}),(0,K.jsx)(`text`,{x:390,y:118,textAnchor:`end`,className:`wm-mono`,fontSize:8,fill:`#8C7E65`,children:`fol. I`})]});function Vd(){let e=Re(),t=Ie(),{login:n}=dd(),[r,i]=(0,y.useState)(()=>`${window.location.protocol}//${window.location.host}`),[a,o]=(0,y.useState)(``),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(!1);async function d(i){i.preventDefault(),u(!0),c(null);try{await n({gatewayUrl:r,token:a}),e(t.state?.from??`/`,{replace:!0})}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}return(0,K.jsx)(`main`,{className:`login-page`,children:(0,K.jsxs)(`section`,{className:`login-card`,children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`agent-mux webui`}),(0,K.jsx)(`h1`,{children:`Attach to your gateway`}),(0,K.jsx)(`p`,{className:`lede`,children:"The token is stored in `localStorage.amux.webui.auth`. That is convenient and less secure than an OS keychain."}),(0,K.jsxs)(`form`,{onSubmit:d,className:`stack`,children:[(0,K.jsx)(Pd,{label:`Gateway URL`,children:(0,K.jsx)(Md,{value:r,onChange:e=>i(e.target.value),placeholder:`http://127.0.0.1:7878`})}),(0,K.jsx)(Pd,{label:`Bearer token`,children:(0,K.jsx)(Md,{type:`password`,value:a,onChange:e=>o(e.target.value),placeholder:`paste token`})}),s?(0,K.jsx)(`p`,{className:`error-banner`,children:s}):null,(0,K.jsx)(jd,{type:`submit`,variant:`primary`,loading:l,disabled:l||!a.trim(),children:`Connect`})]})]})})}function Hd(){let[e,t]=(0,y.useState)();return(0,K.jsxs)(`section`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Agents`})}),(0,K.jsx)(Xu,{selected:e,onSelect:t})]})}function Ud(e){return e==null||!Number.isFinite(e)?null:new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:e>=1?2:4,maximumFractionDigits:4}).format(e)}function Wd(){let{store:e}=Mn(),t=Pn(e,Hn(e=>Object.values(e.sessions.byId))),n=Pn(e,Hn(e=>Object.values(e.runs.byId))),r=Pn(e,e=>e.events.byRunId),i=(0,y.useMemo)(()=>t.map(e=>{let t=String(e.sessionId),i=n.filter(e=>String(e.sessionId??``)===t).reduce((e,t)=>{let n=r[String(t.runId??``)];return n?e+n.events.reduce((e,t)=>{if(t.type!==`cost`)return e;let n=t.cost;return!n||typeof n!=`object`?e:e+Number(n.totalUsd??0)},0):e},0);return{sessionId:t,agent:String(e.agent??`unknown`),status:String(e.status??`inactive`),activeRunId:typeof e.activeRunId==`string`?e.activeRunId:null,latestRunId:typeof e.latestRunId==`string`?e.latestRunId:null,updatedAt:Number(e.updatedAt??0),title:typeof e.title==`string`?e.title:null,turnCount:typeof e.turnCount==`number`?e.turnCount:null,messageCount:typeof e.messageCount==`number`?e.messageCount:null,costTotalUsd:e.cost&&typeof e.cost==`object`&&typeof e.cost.totalUsd==`number`?e.cost.totalUsd??null:i>0?i:null}}).sort((e,t)=>t.updatedAt-e.updatedAt),[r,n,t]),a=i.filter(e=>e.status===`active`),o=i.filter(e=>e.status!==`active`);return(0,K.jsxs)(`section`,{className:`flow-grid`,children:[(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsxs)(`header`,{children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`Sessions`}),(0,K.jsx)(`h2`,{children:`Active Sessions`})]}),(0,K.jsx)(Dt,{to:`/sessions/new`,children:`Start session`})]}),(0,K.jsxs)(`div`,{className:`list-grid`,children:[a.map(e=>(0,K.jsxs)(`article`,{className:`list-card`,children:[(0,K.jsxs)(`div`,{className:`list-card-main`,children:[(0,K.jsx)(`strong`,{children:e.sessionId}),(0,K.jsx)(`span`,{className:`meta-chip`,children:e.agent}),(0,K.jsx)(`span`,{className:`status-badge status-active`,children:`active`})]}),(0,K.jsxs)(`p`,{className:`muted-copy`,children:[e.title??`Untitled session`,e.messageCount==null?``:` · ${e.messageCount} messages`,e.turnCount==null?``:` · ${e.turnCount} turns`,Ud(e.costTotalUsd)?` · ${Ud(e.costTotalUsd)}`:``]}),(0,K.jsx)(`div`,{className:`actions`,children:(0,K.jsx)(Dt,{className:`ghost-link`,to:`/sessions/${e.sessionId}`,children:`Open chat`})})]},e.sessionId)),a.length===0?(0,K.jsx)(`p`,{className:`muted-copy`,children:`No active sessions right now.`}):null]})]}),(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`Sessions`}),(0,K.jsx)(`h2`,{children:`Inactive Sessions`})]})}),(0,K.jsxs)(`div`,{className:`list-grid`,children:[o.map(e=>(0,K.jsxs)(`article`,{className:`list-card`,children:[(0,K.jsxs)(`div`,{className:`list-card-main`,children:[(0,K.jsx)(`strong`,{children:e.sessionId}),(0,K.jsx)(`span`,{className:`meta-chip`,children:e.agent}),(0,K.jsx)(`span`,{className:`status-badge status-inactive`,children:`inactive`})]}),(0,K.jsxs)(`p`,{className:`muted-copy`,children:[e.title??`Untitled session`,e.messageCount==null?``:` · ${e.messageCount} messages`,e.turnCount==null?``:` · ${e.turnCount} turns`,Ud(e.costTotalUsd)?` · ${Ud(e.costTotalUsd)}`:``]}),(0,K.jsxs)(`div`,{className:`actions`,children:[(0,K.jsx)(Dt,{className:`ghost-link`,to:`/sessions/${e.sessionId}`,children:`Open session`}),(0,K.jsx)(Dt,{className:`ghost-link`,to:`/sessions/${e.sessionId}?compose=1`,children:`Continue`})]})]},e.sessionId)),o.length===0?(0,K.jsx)(`p`,{className:`muted-copy`,children:`No inactive sessions yet.`}):null]})]})]})}function Gd(e){return e==null||!Number.isFinite(e)?`unavailable`:new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:e>=1?2:4,maximumFractionDigits:4}).format(e)}function Kd(e){return!Number.isFinite(e)||e<=0?`unknown`:new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function qd(e,t){if(e==null||t==null||t<=e)return null;let n=t-e;return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${Math.round(n/1e3)}s`}function Jd(e,t){let n=t[e]?.structuredSessionTransport;return n===`persistent`||n===`restart-per-turn`?n:`none`}function Yd(e,t){let n=t[e]?.sessionControlPlane;return n===`external-host`||n===`mcp-mediated`?n:`self-managed`}function Xd(e){switch(e){case`external-host`:return`external host`;case`mcp-mediated`:return`host mediated`;default:return`agent-mux managed`}}function Zd(e){let t=e.get(`view`);return t===`flow`?`agent-flow`:t===`timeline`||t===`files`||t===`transcript`?t:`agent-flow`}function Qd(e){return!e||typeof e!=`object`?null:e}function $d(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.currentPath==`string`&&t.currentPath.length>0?t.currentPath:typeof t.workspaceDefaultCwd==`string`&&t.workspaceDefaultCwd.length>0?t.workspaceDefaultCwd:typeof t.workspaceRootPath==`string`&&t.workspaceRootPath.length>0?t.workspaceRootPath:null}function ef(e){return e.startsWith(`/`)||e.startsWith(`\\\\`)||/^[a-zA-Z]:[\\/]/.test(e)}function tf(e,t){let n=e.includes(`\\`)?`\\`:`/`;return`${e.replace(/[\\/]+$/,``)}${n}${t.replace(/^[./\\\/]+/,``)}`}function nf(e,t){return t.trim()?ef(t)?t:e?tf(e,t):null:null}function rf(e){return`vscode://file${e}`}function af(e){return typeof e?.preview?.primaryUrl==`string`&&e.preview.primaryUrl.length>0?e.preview.primaryUrl:typeof e?.devServer?.primaryUrl==`string`&&e.devServer.primaryUrl.length>0?e.devServer.primaryUrl:null}function of(e){return e.actions.length===0?null:(0,K.jsx)(`div`,{className:`item-actions`,children:e.actions.map(e=>e.external?(0,K.jsx)(`a`,{className:`ghost-link action-link`,href:e.href,target:`_blank`,rel:`noreferrer`,children:e.label},e.key):(0,K.jsx)(`a`,{className:`ghost-link action-link`,href:e.href,children:e.label},e.key))})}function sf(){let e=He(),[t]=Nt(),n=e.sessionId??``,r=fd(),{client:i,store:a}=Mn(),o=Pn(a,e=>e.agents.byId),s=Pn(a,e=>e.sessions.byId[n]??null),c=Pn(a,Hn(e=>Object.values(e.runs.byId).filter(e=>e.sessionId===n).sort((e,t)=>Number(t.startedAt??0)-Number(e.startedAt??0)))),l=Pn(a,e=>e.events.byRunId),[u,d]=(0,y.useState)(``),[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(null),[g,_]=(0,y.useState)([]),[v,b]=(0,y.useState)(!1),[x,S]=(0,y.useState)(()=>Zd(t)),C=(0,y.useMemo)(()=>[...typeof s?.agent==`string`?[s.agent]:[],...c.map(e=>typeof e.agent==`string`?e.agent:null).filter(e=>e!=null)],[c,s?.agent]),w=C[0]??`unknown`,T=String(s?.status??`inactive`),E=C.reduce((e,t)=>{let n=Jd(t,o);return n===`persistent`||e===`none`&&n===`restart-per-turn`?n:e},`none`),D=C.reduce((e,t)=>{let n=Yd(t,o);return n===`mcp-mediated`||e===`self-managed`&&n===`external-host`?n:e},`self-managed`),O=typeof s?.activeRunId==`string`?s.activeRunId:typeof c.find(e=>e.status===`running`)?.runId==`string`?String(c.find(e=>e.status===`running`)?.runId):null,k=T!==`active`||E===`persistent`,A=typeof s?.cwd==`string`&&s.cwd.length>0?s.cwd:$d(s?.workspace),j=Qd(s?.runtime),M=af(j),N=(0,y.useMemo)(()=>{let e=c.map(e=>{let t=String(e.runId??``),n=typeof e.cwd==`string`&&e.cwd.length>0?e.cwd:$d(e.workspace)??A,r=af(Qd(e.runtime)??j)??M;return[t,{runId:t,runHref:`/runs/${encodeURIComponent(t)}`,workspaceHref:n?rf(n):void 0,runtimeHref:r??void 0,fileHref:e=>{let t=nf(n,e);return t?rf(t):null}}]});return new Map(e)},[c,j,M,A]),P=(e,t)=>{let n=N.get(e);if(!n)return[];let r=[{key:`${e}:run`,label:`Open run detail`,href:n.runHref}],i=t.map(e=>({path:e,href:n.fileHref(e)})).find(e=>e.href!=null);return i?.href&&r.push({key:`${e}:file:${i.path}`,label:`Open file`,href:i.href,external:!0}),n.workspaceHref&&r.push({key:`${e}:workspace`,label:`Open workspace`,href:n.workspaceHref,external:!0}),n.runtimeHref&&r.push({key:`${e}:runtime`,label:`Open runtime`,href:n.runtimeHref,external:!0}),r},F=(0,y.useMemo)(()=>En(c,l),[l,c]),I=(0,y.useMemo)(()=>gn(n,g),[g,n]),L=(0,y.useMemo)(()=>_n(n,g,w,T),[g,w,n,T]),R=F.lanes.length>0?F.lanes:L?[L]:[],z=T===`active`?F.transcript.length>0?F.transcript:I:I.length>0?I:F.transcript,ee=F.timeline.length>0?F.timeline:wn(z),te=F.files.length>0?F.files:Tn(z),ne=(0,y.useMemo)(()=>hn(c.map(e=>String(e.runId??``)),l),[l,c]),re=s?.cost&&typeof s.cost==`object`?s.cost:ne;(0,y.useEffect)(()=>{if(n)return i.subscribeSession(n)},[i,n]),(0,y.useEffect)(()=>{if(!n){h(null);return}let e=!1;return(async()=>{try{let t=await r(`/api/v1/sessions/${encodeURIComponent(n)}`);if(!t.ok){if(t.status===404||e)return;throw Error(`Gateway request failed: ${t.status}`)}let i=await t.json();e||a.getState().actions.mergeSession(n,i)}catch(t){e||h(t instanceof Error?t.message:String(t))}})(),()=>{e=!0}},[r,n,a]),(0,y.useEffect)(()=>{if(!n){_([]),b(!1);return}if(T===`active`&&F.transcript.length>0){b(!1);return}let e=!1;return h(null),b(!0),_([]),(async()=>{try{let t=await r(`/api/v1/sessions/${encodeURIComponent(n)}/full`);if(!t.ok){if(t.status===404){e||_([]);return}throw Error(`Gateway request failed: ${t.status}`)}let i=await t.json();if(e)return;Array.isArray(i.messages)&&_(i.messages),a.getState().actions.mergeSession(n,{title:i.title,turnCount:i.turnCount,model:i.model,cost:i.cost,cwd:i.cwd})}catch(t){e||h(t instanceof Error?t.message:String(t))}finally{e||b(!1)}})(),()=>{e=!0}},[F.transcript.length,r,n,T,a]);async function ie(e){if(e.preventDefault(),u.trim()){p(!0),h(null);try{let e=await r(`/api/v1/sessions/${encodeURIComponent(n)}/messages`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({prompt:u,agent:w})});if(!e.ok)throw Error(`Gateway request failed: ${e.status}`);let t=await e.json();t.run&&typeof t.run.runId==`string`&&a.getState().actions.mergeRun(t.run.runId,t.run),t.session&&typeof t.session.sessionId==`string`&&a.getState().actions.mergeSession(t.session.sessionId,t.session),d(``)}catch(e){h(e instanceof Error?e.message:String(e))}finally{p(!1)}}}let ae=[{value:`agent-flow`,label:`Flow`,badge:R.length,body:(0,K.jsxs)(`div`,{className:`agent-flow-view`,children:[R.map(e=>(0,K.jsxs)(`article`,{className:`flow-lane`,children:[(0,K.jsxs)(`div`,{className:`flow-lane-header`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`flow-lane-title`,children:e.agent}),(0,K.jsxs)(`div`,{className:`flow-lane-subtitle`,children:[e.startedAt>0?`${Kd(e.startedAt)} · `:``,e.runId]})]}),(0,K.jsxs)(`div`,{className:`chip-row`,children:[(0,K.jsx)(`span`,{className:`status-badge status-${e.status}`,children:e.status}),(0,K.jsxs)(`span`,{className:`meta-chip`,children:[e.segmentCount,` phases`]}),e.toolCount>0?(0,K.jsxs)(`span`,{className:`meta-chip`,children:[e.toolCount,` tools`]}):null,e.totalUsd==null?null:(0,K.jsx)(`span`,{className:`meta-chip`,children:Gd(e.totalUsd)})]})]}),(0,K.jsx)(`div`,{className:`flow-track`,"aria-label":`Agent flow for ${e.runId}`,children:e.segments.map(t=>(0,K.jsxs)(`article`,{className:`flow-segment segment-${t.kind} segment-status-${t.status}`,style:{flexGrow:t.weight},children:[(0,K.jsxs)(`div`,{className:`flow-segment-topline`,children:[(0,K.jsx)(`div`,{className:`flow-segment-title`,children:t.title}),t.secondaryLabel?(0,K.jsx)(`span`,{className:`meta-chip`,children:t.secondaryLabel}):null]}),(0,K.jsx)(`p`,{children:t.detail}),(0,K.jsxs)(`div`,{className:`flow-segment-meta`,children:[t.status===`complete`?null:(0,K.jsx)(`span`,{children:t.status}),qd(t.startedAt,t.endedAt)?(0,K.jsx)(`span`,{children:qd(t.startedAt,t.endedAt)}):null,t.filePaths.length>0?(0,K.jsxs)(`span`,{children:[t.filePaths.length,` file refs`]}):null]}),(0,K.jsx)(of,{actions:P(e.runId,t.filePaths)})]},t.id))})]},e.runId)),R.length===0&&v?(0,K.jsx)(`p`,{className:`muted-copy`,children:`Loading agent flow…`}):null,R.length===0&&!v?(0,K.jsx)(`p`,{className:`muted-copy`,children:`No structured execution flow has been indexed yet.`}):null]})},{value:`timeline`,label:`Timeline`,badge:ee.length,body:(0,K.jsxs)(`div`,{className:`timeline-view`,children:[ee.map(e=>(0,K.jsxs)(`article`,{className:`timeline-item timeline-${e.kind}`,children:[(0,K.jsxs)(`div`,{className:`timeline-item-topline`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`flow-segment-title`,children:e.title}),(0,K.jsxs)(`div`,{className:`flow-lane-subtitle`,children:[e.timestamp==null?``:`${Kd(e.timestamp)} · `,e.runId]})]}),(0,K.jsxs)(`div`,{className:`chip-row`,children:[(0,K.jsx)(`span`,{className:`status-badge status-${e.status===`error`?`failed`:e.status===`running`?`running`:`completed`}`,children:e.status}),(0,K.jsx)(`span`,{className:`meta-chip`,children:e.kind})]})]}),(0,K.jsx)(`pre`,{children:e.detail}),(0,K.jsx)(of,{actions:P(e.runId,e.filePaths)})]},e.id)),ee.length===0&&v?(0,K.jsx)(`p`,{className:`muted-copy`,children:`Loading timeline…`}):null,ee.length===0&&!v?(0,K.jsx)(`p`,{className:`muted-copy`,children:`No timeline events have been indexed yet.`}):null]})},{value:`transcript`,label:`Transcript`,badge:z.length,body:(0,K.jsxs)(`div`,{className:`transcript`,children:[z.map(e=>(0,K.jsxs)(`article`,{className:`message ${e.kind===`assistant`?`agent-message`:e.kind===`user`?`user-message`:e.kind===`thinking`?`thinking-message`:e.kind===`error`?`error-message`:`tool-message`}`,children:[(0,K.jsxs)(`div`,{className:`message-meta`,children:[e.label,e.timestamp==null?null:(0,K.jsxs)(`span`,{className:`message-time`,children:[` · `,Kd(e.timestamp)]})]}),(0,K.jsx)(`pre`,{children:e.text}),(0,K.jsx)(of,{actions:P(e.runId,e.filePaths)})]},e.id)),z.length===0&&v?(0,K.jsx)(`p`,{className:`muted-copy`,children:`Loading session transcript…`}):null,z.length===0&&!v?(0,K.jsx)(`p`,{className:`muted-copy`,children:`No session transcript has been indexed yet.`}):null]})},{value:`files`,label:`Files`,badge:te.length,body:(0,K.jsxs)(`div`,{className:`files-view`,children:[te.map(e=>(0,K.jsxs)(`article`,{className:`file-card`,children:[(0,K.jsxs)(`div`,{className:`flow-segment-topline`,children:[(0,K.jsx)(`div`,{className:`flow-segment-title`,children:e.path}),(0,K.jsxs)(`div`,{className:`chip-row`,children:[(0,K.jsxs)(`span`,{className:`meta-chip`,children:[e.touches,` touches`]}),e.reads>0?(0,K.jsxs)(`span`,{className:`meta-chip`,children:[e.reads,` reads`]}):null,e.writes>0?(0,K.jsxs)(`span`,{className:`meta-chip`,children:[e.writes,` writes`]}):null]})]}),(0,K.jsxs)(`p`,{className:`muted-copy`,children:[`Runs: `,e.runIds.join(`, `),e.tools.length>0?` · Tools: ${e.tools.join(`, `)}`:``]}),(0,K.jsx)(of,{actions:P(e.runIds[0]??``,[e.path])})]},e.path)),te.length===0&&v?(0,K.jsx)(`p`,{className:`muted-copy`,children:`Loading file attention…`}):null,te.length===0&&!v?(0,K.jsx)(`p`,{className:`muted-copy`,children:`No file attention has been captured for this session yet.`}):null]})}];return(0,K.jsxs)(`section`,{className:`flow-grid`,children:[(0,K.jsxs)(`article`,{className:`panel run-shell`,children:[(0,K.jsxs)(`header`,{children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`Realtime Session View`}),(0,K.jsx)(`h2`,{children:n||`Missing session id`})]}),(0,K.jsxs)(`div`,{className:`status-stack`,children:[(0,K.jsx)(`span`,{className:`status-badge status-${T}`,children:T}),(0,K.jsx)(`span`,{className:`meta-chip`,children:w})]})]}),(0,K.jsxs)(`div`,{className:`flow-summary-strip`,children:[(0,K.jsxs)(`span`,{className:`meta-chip`,children:[R.length,` lanes`]}),(0,K.jsxs)(`span`,{className:`meta-chip`,children:[ee.length,` timeline events`]}),(0,K.jsxs)(`span`,{className:`meta-chip`,children:[te.length,` files`]}),(0,K.jsxs)(`span`,{className:`meta-chip`,children:[F.summary.pendingTools,` pending tools`]})]}),(0,K.jsx)(Fd,{value:x,onChange:e=>S(e),items:ae}),(0,K.jsxs)(`form`,{className:`composer`,onSubmit:ie,children:[(0,K.jsx)(Pd,{label:T===`active`&&E!==`persistent`?`Wait for the current live turn to finish`:`Continue this session with a new turn`,children:(0,K.jsx)(Nd,{autoFocus:t.get(`compose`)===`1`,value:u,onChange:e=>d(e.target.value),rows:5,placeholder:T===`active`&&E!==`persistent`?`The live session is still running…`:`Type the next message for this session…`,disabled:!k})}),m?(0,K.jsx)(`p`,{className:`error-banner`,children:m}):null,(0,K.jsx)(`div`,{className:`actions`,children:(0,K.jsx)(jd,{type:`submit`,variant:`primary`,loading:f,disabled:f||!u.trim()||!k,children:`Continue session`})})]})]}),(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Session State`})}),(0,K.jsxs)(`div`,{className:`summary-grid`,children:[(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Session`}),(0,K.jsx)(`strong`,{children:n||`unknown`})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Agent`}),(0,K.jsx)(`strong`,{children:w})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`State`}),(0,K.jsx)(`strong`,{children:T})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Session owner`}),(0,K.jsx)(`strong`,{children:Xd(D)})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Live attachment`}),(0,K.jsx)(`strong`,{children:O?`attached`:`idle`})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Session cost`}),(0,K.jsx)(`strong`,{children:Gd(re?.totalUsd??null)})]})]}),re?(0,K.jsxs)(`p`,{className:`muted-copy`,children:[`Tokens in `,re.inputTokens??0,` · out `,re.outputTokens??0,re.thinkingTokens==null?``:` · thinking ${re.thinkingTokens}`,re.cachedTokens==null?``:` · cached ${re.cachedTokens}`]}):null,(0,K.jsx)(`p`,{className:`muted-copy`,children:E===`persistent`?`Later turns stay on the same live structured channel.`:E===`restart-per-turn`?`Later turns resume the same session by starting a fresh execution.`:`This harness does not currently expose structured session continuation.`}),(0,K.jsx)(`p`,{className:`muted-copy`,children:c.length>0?`${c.length} execution ${c.length===1?`attempt`:`attempts`} recorded for this session.`:`No execution attempts recorded for this session yet.`})]})]})}function cf(){let e=He().runId??``,t=Un(e);return typeof t?.sessionId==`string`&&t.sessionId.length>0?(0,K.jsx)(st,{to:`/sessions/${t.sessionId}`,replace:!0}):(0,K.jsxs)(`section`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`Creating Session`}),(0,K.jsx)(`h2`,{children:e||`pending session`})]})}),(0,K.jsx)(`p`,{className:`lede`,children:`The session bootstrap is still waiting for the harness to emit its real session id. This page will redirect into the live session as soon as the gateway sees it.`}),(0,K.jsxs)(`div`,{className:`summary-grid`,children:[(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Agent`}),(0,K.jsx)(`strong`,{children:String(t?.agent??`unknown`)})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`State`}),(0,K.jsx)(`strong`,{children:String(t?.status??`starting`)})]})]}),(0,K.jsx)(`div`,{className:`actions`,children:(0,K.jsx)(Dt,{className:`ghost-link`,to:`/sessions`,children:`Back to sessions`})})]})}function lf(e,t){return t&&e.includes(t)?t:e[0]??`codex`}function uf(e){return e?.supportsInteractiveMode===!0||e?.structuredSessionTransport===`persistent`}function df(e){switch(e){case`external-host`:return`Live session owner: external host surface.`;case`mcp-mediated`:return`Live session owner: host-mediated channel.`;default:return`Live session owner: agent-mux managed process or SDK.`}}function ff(){let e=Re(),t=fd(),{client:n,store:r}=Mn(),[i]=Nt(),a=In(),o=i.get(`agent`),[s,c]=(0,y.useState)(()=>lf(a,o)),[l,u]=(0,y.useState)(``),[d,f]=(0,y.useState)(``),[p,m]=(0,y.useState)(`none`),[h,g]=(0,y.useState)(`session-workspace`),[_,v]=(0,y.useState)(`worktree`),[b,x]=(0,y.useState)(``),[S,C]=(0,y.useState)([]),[w,T]=(0,y.useState)(!1),[E,D]=(0,y.useState)(null),O=Pn(r,e=>e.agents.byId),k=Pn(r,e=>e.agents.byId[s]??null),A=(0,y.useMemo)(()=>{let e=a.filter(e=>uf(O[e]??null));return e.length>0?e:a},[O,a]);(0,y.useEffect)(()=>{c(e=>A.length===0||A.includes(e)?e:lf(A,o))},[o,A]),(0,y.useEffect)(()=>{let e=!1;return(async()=>{try{let n=await t(`/api/v1/workspaces`);if(!n.ok)return;let r=await n.json();e||C(r.workspaces??[])}catch{}})(),()=>{e=!0}},[t]);async function j(i){if(i.preventDefault(),!(!l.trim()||!s)){T(!0),D(null);try{let i,a;if(p===`create`){let e=b.split(`
|
|
17
|
+
`).map(e=>e.trim()).filter(Boolean),n=await t(`/api/v1/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`create`,name:h,mode:_,repos:e.map(e=>({path:e}))})});if(!n.ok)throw Error(`Workspace creation failed: ${n.status}`);let r=await n.json();i=typeof r.workspace?.id==`string`?r.workspace.id:void 0,a=typeof r.workspace?.defaultCwd==`string`?r.workspace.defaultCwd:typeof r.workspace?.rootPath==`string`?r.workspace.rootPath:void 0}else if(p===`existing`&&d){let e=S.find(e=>e.id===d);i=d,a=e?.defaultCwd??e?.rootPath}let o=await t(`/api/v1/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:s,prompt:l,workspaceId:i,cwd:a})});if(!o.ok)throw Error(`Gateway request failed: ${o.status}`);let c=(await o.json()).run,u=typeof c?.runId==`string`?c.runId:null;if(!u)throw Error(`Gateway did not return a run id`);if(r.getState().actions.mergeRun(u,c??{}),typeof c?.sessionId==`string`&&c.sessionId.length>0&&r.getState().actions.mergeSession(c.sessionId,{sessionId:c.sessionId,agent:s,activeRunId:u,latestRunId:u,status:`active`}),n.subscribeRun(u),typeof c?.sessionId==`string`&&c.sessionId.length>0){e(`/sessions/${c.sessionId}`);return}e(`/sessions/pending/${u}`)}catch(e){D(e instanceof Error?e.message:String(e))}finally{T(!1)}}}return(0,K.jsxs)(`section`,{className:`flow-grid`,children:[(0,K.jsxs)(`article`,{className:`panel hero-panel`,children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`New Session`}),(0,K.jsx)(`h2`,{children:`Start a real conversation`}),(0,K.jsx)(`p`,{className:`lede`,children:`This creates a real session on the selected harness. If the harness does not emit its session id immediately, the browser stays inside the sessions flow until the live session is ready.`})]}),(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Compose First Turn`})}),(0,K.jsxs)(`form`,{className:`stack`,onSubmit:j,children:[(0,K.jsx)(Pd,{label:`Agent`,children:(0,K.jsx)(Rd,{value:s,onChange:c,options:A.map(e=>({label:e,value:e}))})}),k?(0,K.jsxs)(`p`,{className:`muted-copy`,children:[df(k.sessionControlPlane),` `,k.structuredSessionTransport===`persistent`?`Later turns stay on the same live structured channel.`:k.structuredSessionTransport===`restart-per-turn`?`Later turns reconnect the same session with a fresh execution.`:`Structured multi-turn transport is unavailable.`]}):null,A.length===a.length?null:(0,K.jsx)(`p`,{className:`muted-copy`,children:`The browser is showing only transports that can keep a session interactive or persistent.`}),(0,K.jsx)(Pd,{label:`Prompt`,children:(0,K.jsx)(Nd,{value:l,onChange:e=>u(e.target.value),placeholder:`Describe the task you want the agent to handle...`,rows:10})}),(0,K.jsx)(Pd,{label:`Workspace`,children:(0,K.jsx)(Rd,{value:p,onChange:e=>m(e===`create`||e===`existing`?e:`none`),options:[{label:`No workspace`,value:`none`},{label:`Use existing workspace`,value:`existing`},{label:`Create workspace now`,value:`create`}]})}),p===`existing`?(0,K.jsx)(Pd,{label:`Existing workspace`,children:(0,K.jsx)(Rd,{value:d,onChange:f,options:S.map(e=>({label:`${e.name} · ${e.defaultCwd}`,value:e.id}))})}):null,p===`create`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Pd,{label:`Workspace name`,children:(0,K.jsx)(`input`,{value:h,onChange:e=>g(e.target.value)})}),(0,K.jsx)(Pd,{label:`Materialization`,children:(0,K.jsx)(Rd,{value:_,onChange:e=>v(e===`symlink`?`symlink`:`worktree`),options:[{label:`Git worktrees`,value:`worktree`},{label:`Symbolic links`,value:`symlink`}]})}),(0,K.jsx)(Pd,{label:`Repo paths`,children:(0,K.jsx)(Nd,{value:b,onChange:e=>x(e.target.value),rows:4,placeholder:`/abs/path/to/repo-one
|
|
18
|
+
/abs/path/to/repo-two`})})]}):null,E?(0,K.jsx)(`p`,{className:`error-banner`,children:E}):null,(0,K.jsxs)(`div`,{className:`actions`,children:[(0,K.jsx)(jd,{type:`submit`,variant:`primary`,loading:w,disabled:w||!l.trim(),children:`Start session`}),(0,K.jsx)(Dt,{className:`ghost-link`,to:`/workspaces`,children:`Manage workspaces`}),(0,K.jsx)(Dt,{className:`ghost-link`,to:`/sessions`,children:`Browse sessions`})]})]})]})]})}function pf(){return(0,K.jsxs)(`section`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Hook inbox`})}),(0,K.jsx)(Zu,{})]})}function mf(){let[e,t]=(0,y.useState)([]),[n,r]=(0,y.useState)(`default`),i=(0,y.useRef)(0);(0,y.useEffect)(()=>{typeof window<`u`&&`Notification`in window&&r(Notification.permission)},[]);let a=(0,y.useCallback)(async()=>{typeof window>`u`||!(`Notification`in window)||r(await Notification.requestPermission())},[]);return{notifications:e,notify:(0,y.useCallback)((e,r,a=`info`,o)=>{let s=`notif-${++i.current}-${Date.now()}`,c={id:s,title:e,body:r,type:a,timestamp:Date.now(),href:o?.href,persistent:o?.persistent};if(t(e=>[...e,c]),o?.persistent||setTimeout(()=>{t(e=>e.filter(e=>e.id!==s))},5e3),n===`granted`&&typeof window<`u`&&document.hidden)try{new Notification(e,{body:r,tag:s})}catch{}},[n]),dismiss:(0,y.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),requestPermission:a,permission:n}}function hf(){let e=Re();return{push(t){e(t)},replace(t){e(t,{replace:!0})},back(){e(-1)},forward(){e(1)},refresh(){e(0)},async prefetch(){}}}function gf(){return Ie().pathname}function _f(){return Nt()[0]}function vf(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=vf(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function yf(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=vf(e))&&(r&&(r+=` `),r+=t);return r}var bf=`-`,xf=e=>{let t=Tf(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(bf);return n[0]===``&&n.length!==1&&n.shift(),Sf(n,t)||wf(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},Sf=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?Sf(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(bf);return t.validators.find(({validator:e})=>e(a))?.classGroupId},Cf=/^\[(.+)\]$/,wf=e=>{if(Cf.test(e)){let t=Cf.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},Tf=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return kf(Object.entries(e.classGroups),n).forEach(([e,n])=>{Ef(n,r,e,t)}),r},Ef=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:Df(t,e);r.classGroupId=n;return}if(typeof e==`function`){if(Of(e)){Ef(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n});return}Object.entries(e).forEach(([e,i])=>{Ef(i,Df(t,e),n,r)})})},Df=(e,t)=>{let n=e;return t.split(bf).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},Of=e=>e.isThemeGetter,kf=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>typeof e==`string`?t+e:typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,Af=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=new Map,r=new Map,i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);if(t!==void 0)return t;if((t=r.get(e))!==void 0)return i(e,t),t},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},jf=`!`,Mf=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=e=>{let n=[],o=0,s=0,c;for(let l=0;l<e.length;l++){let u=e[l];if(o===0){if(u===i&&(r||e.slice(l,l+a)===t)){n.push(e.slice(s,l)),s=l+a;continue}if(u===`/`){c=l;continue}}u===`[`?o++:u===`]`&&o--}let l=n.length===0?e:e.substring(s),u=l.startsWith(jf);return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:c&&c>s?c-s:void 0}};return n?e=>n({className:e,parseClassName:o}):o},Nf=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(e=>{e[0]===`[`?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},Pf=e=>({cache:Af(e.cacheSize),parseClassName:Mf(e),...xf(e)}),Ff=/\s+/,If=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(Ff),s=``;for(let e=o.length-1;e>=0;--e){let t=o[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t),f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f){s=t+(s.length>0?` `+s:s);continue}if(p=r(u),!p){s=t+(s.length>0?` `+s:s);continue}f=!1}let m=Nf(c).join(`:`),h=l?m+jf:m,g=h+p;if(a.includes(g))continue;a.push(g);let _=i(p,f);for(let e=0;e<_.length;++e){let t=_[e];a.push(h+t)}s=t+(s.length>0?` `+s:s)}return s};function Lf(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=Rf(t))&&(r&&(r+=` `),r+=n);return r}var Rf=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Rf(e[r]))&&(n&&(n+=` `),n+=t);return n};function zf(e,...t){let n,r,i,a=o;function o(o){return n=Pf(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)}function s(e){let t=r(e);if(t)return t;let a=If(e,n);return i(e,a),a}return function(){return a(Lf.apply(null,arguments))}}var Bf=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},Vf=/^\[(?:([a-z-]+):)?(.+)\]$/i,Hf=/^\d+\/\d+$/,Uf=new Set([`px`,`full`,`screen`]),Wf=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gf=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Kf=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qf=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jf=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yf=e=>Zf(e)||Uf.has(e)||Hf.test(e),Xf=e=>lp(e,`length`,up),Zf=e=>!!e&&!Number.isNaN(Number(e)),Qf=e=>lp(e,`number`,Zf),$f=e=>!!e&&Number.isInteger(Number(e)),ep=e=>e.endsWith(`%`)&&Zf(e.slice(0,-1)),J=e=>Vf.test(e),tp=e=>Wf.test(e),np=new Set([`length`,`size`,`percentage`]),rp=e=>lp(e,np,dp),ip=e=>lp(e,`position`,dp),ap=new Set([`image`,`url`]),op=e=>lp(e,ap,pp),sp=e=>lp(e,``,fp),cp=()=>!0,lp=(e,t,n)=>{let r=Vf.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},up=e=>Gf.test(e)&&!Kf.test(e),dp=()=>!1,fp=e=>qf.test(e),pp=e=>Jf.test(e),mp=zf(()=>{let e=Bf(`colors`),t=Bf(`spacing`),n=Bf(`blur`),r=Bf(`brightness`),i=Bf(`borderColor`),a=Bf(`borderRadius`),o=Bf(`borderSpacing`),s=Bf(`borderWidth`),c=Bf(`contrast`),l=Bf(`grayscale`),u=Bf(`hueRotate`),d=Bf(`invert`),f=Bf(`gap`),p=Bf(`gradientColorStops`),m=Bf(`gradientColorStopPositions`),h=Bf(`inset`),g=Bf(`margin`),_=Bf(`opacity`),v=Bf(`padding`),y=Bf(`saturate`),b=Bf(`scale`),x=Bf(`sepia`),S=Bf(`skew`),C=Bf(`space`),w=Bf(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,J,t],O=()=>[J,t],k=()=>[``,Yf,Xf],A=()=>[`auto`,Zf,J],j=()=>[`bottom`,`center`,`left`,`left-bottom`,`left-top`,`right`,`right-bottom`,`right-top`,`top`],M=()=>[`solid`,`dashed`,`dotted`,`double`,`none`],N=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],P=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`],F=()=>[``,`0`,J],I=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],L=()=>[Zf,J];return{cacheSize:500,separator:`:`,theme:{colors:[cp],spacing:[Yf,Xf],blur:[`none`,``,tp,J],brightness:L(),borderColor:[e],borderRadius:[`none`,``,`full`,tp,J],borderSpacing:O(),borderWidth:k(),contrast:L(),grayscale:F(),hueRotate:L(),invert:F(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[ep,Xf],inset:D(),margin:D(),opacity:L(),padding:O(),saturate:L(),scale:L(),sepia:F(),skew:L(),space:O(),translate:O()},classGroups:{aspect:[{aspect:[`auto`,`square`,`video`,J]}],container:[`container`],columns:[{columns:[tp]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:[...j(),J]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[`auto`,$f,J]}],basis:[{basis:D()}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`wrap`,`wrap-reverse`,`nowrap`]}],flex:[{flex:[`1`,`auto`,`initial`,`none`,J]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:[`first`,`last`,`none`,$f,J]}],"grid-cols":[{"grid-cols":[cp]}],"col-start-end":[{col:[`auto`,{span:[`full`,$f,J]},J]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[cp]}],"row-start-end":[{row:[`auto`,{span:[$f,J]},J]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":[`auto`,`min`,`max`,`fr`,J]}],"auto-rows":[{"auto-rows":[`auto`,`min`,`max`,`fr`,J]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:[`normal`,...P()]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`]}],"align-content":[{content:[`normal`,...P(),`baseline`]}],"align-items":[{items:[`start`,`end`,`center`,`baseline`,`stretch`]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`baseline`]}],"place-content":[{"place-content":[...P(),`baseline`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`baseline`,`stretch`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":[C]}],"space-y-reverse":[`space-y-reverse`],w:[{w:[`auto`,`min`,`max`,`fit`,`svw`,`lvw`,`dvw`,J,t]}],"min-w":[{"min-w":[J,t,`min`,`max`,`fit`]}],"max-w":[{"max-w":[J,t,`none`,`full`,`min`,`max`,`fit`,`prose`,{screen:[tp]},tp]}],h:[{h:[J,t,`auto`,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"min-h":[{"min-h":[J,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"max-h":[{"max-h":[J,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],size:[{size:[J,t,`auto`,`min`,`max`,`fit`]}],"font-size":[{text:[`base`,tp,Xf]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,Qf]}],"font-family":[{font:[cp]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`,J]}],"line-clamp":[{"line-clamp":[`none`,Zf,Qf]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,Yf,J]}],"list-image":[{"list-image":[`none`,J]}],"list-style-type":[{list:[`none`,`disc`,`decimal`,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[`auto`,`from-font`,Yf,Xf]}],"underline-offset":[{"underline-offset":[`auto`,Yf,J]}],"text-decoration-color":[{decoration:[e]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:O()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:[...j(),ip]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,rp]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},op]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...M(),`hidden`]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":[`divide-y-reverse`],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:[``,...M()]}],"outline-offset":[{"outline-offset":[Yf,J]}],"outline-w":[{outline:[Yf,Xf]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Yf,Xf]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,tp,sp]}],"shadow-color":[{shadow:[cp]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...N(),`plus-lighter`,`plus-darker`]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:[``,`none`]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":[``,`none`,tp,J]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":[``,`none`]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[`none`,`all`,``,`colors`,`opacity`,`shadow`,`transform`,J]}],duration:[{duration:L()}],ease:[{ease:[`linear`,`in`,`out`,`in-out`,J]}],delay:[{delay:L()}],animate:[{animate:[`none`,`spin`,`ping`,`pulse`,`bounce`,J]}],transform:[{transform:[``,`gpu`,`none`]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[$f,J]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:[`center`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`,`top-left`,J]}],accent:[{accent:[`auto`,e]}],appearance:[{appearance:[`none`,`auto`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,J]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":[`none`,`auto`]}],resize:[{resize:[`none`,`y`,`x`,``]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,J]}],fill:[{fill:[e,`none`]}],"stroke-w":[{stroke:[Yf,Xf,Qf]}],stroke:[{stroke:[e,`none`]}],sr:[`sr-only`,`not-sr-only`],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]}}});function Y(...e){return mp(yf(e))}var hp=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),gp=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),_p={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},vp=(0,y.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,y.createElement)(`svg`,{ref:c,..._p,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:gp(`lucide`,i),...s},[...o.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(a)?a:[a]])),X=(e,t)=>{let n=(0,y.forwardRef)(({className:n,...r},i)=>(0,y.createElement)(vp,{ref:i,iconNode:t,className:gp(`lucide-${hp(e)}`,n),...r}));return n.displayName=`${e}`,n},yp=X(`Activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),bp=X(`Archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),xp=X(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Sp=X(`ArrowRightLeft`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),Cp=X(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),wp=X(`ArrowUpDown`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),Tp=X(`ArrowUpRight`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),Ep=X(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Dp=X(`Boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),Op=X(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),kp=X(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ap=X(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),jp=X(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Mp=X(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Np=X(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Pp=X(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Fp=X(`CirclePlay`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polygon`,{points:`10 8 16 12 10 16 10 8`,key:`1cimsy`}]]),Ip=X(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Lp=X(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Rp=X(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),zp=X(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),Bp=X(`CornerDownRight`,[[`polyline`,{points:`15 10 20 15 15 20`,key:`1q7qjw`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),Vp=X(`Cpu`,[[`rect`,{width:`16`,height:`16`,x:`4`,y:`4`,rx:`2`,key:`14l7u7`}],[`rect`,{width:`6`,height:`6`,x:`9`,y:`9`,rx:`1`,key:`5aljv4`}],[`path`,{d:`M15 2v2`,key:`13l42r`}],[`path`,{d:`M15 20v2`,key:`15mkzm`}],[`path`,{d:`M2 15h2`,key:`1gxd5l`}],[`path`,{d:`M2 9h2`,key:`1bbxkp`}],[`path`,{d:`M20 15h2`,key:`19e6y8`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M9 2v2`,key:`165o2o`}],[`path`,{d:`M9 20v2`,key:`i2bqo8`}]]),Hp=X(`ExternalLink`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Up=X(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Wp=X(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Gp=X(`FileDiff`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),Kp=X(`FileImage`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),qp=X(`FileStack`,[[`path`,{d:`M21 7h-3a2 2 0 0 1-2-2V2`,key:`9rb54x`}],[`path`,{d:`M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z`,key:`1059l0`}],[`path`,{d:`M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15`,key:`16874u`}],[`path`,{d:`M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11`,key:`k2ox98`}]]),Jp=X(`FileText`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Yp=X(`Files`,[[`path`,{d:`M20 7h-3a2 2 0 0 1-2-2V2`,key:`x099mo`}],[`path`,{d:`M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z`,key:`18t6ie`}],[`path`,{d:`M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8`,key:`1nja0z`}]]),Xp=X(`FolderGit2`,[[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`path`,{d:`M18 19c-2.8 0-5-2.2-5-5v8`,key:`pkpw2h`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),Zp=X(`FolderOpen`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Qp=X(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),$p=X(`GripVertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),em=X(`Hammer`,[[`path`,{d:`m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9`,key:`eefl8a`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`b7pghm`}]]),tm=X(`Hand`,[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]),nm=X(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),rm=X(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),im=X(`Info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),am=X(`LaptopMinimal`,[[`rect`,{width:`18`,height:`12`,x:`3`,y:`4`,rx:`2`,ry:`2`,key:`1qhy41`}],[`line`,{x1:`2`,x2:`22`,y1:`20`,y2:`20`,key:`ni3hll`}]]),om=X(`Layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),sm=X(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),cm=X(`LifeBuoy`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m4.93 4.93 4.24 4.24`,key:`1ymg45`}],[`path`,{d:`m14.83 9.17 4.24-4.24`,key:`1cb5xl`}],[`path`,{d:`m14.83 14.83 4.24 4.24`,key:`q42g0n`}],[`path`,{d:`m9.17 14.83-4.24 4.24`,key:`bqpfvv`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),lm=X(`Link2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),um=X(`ListTodo`,[[`rect`,{x:`3`,y:`5`,width:`6`,height:`6`,rx:`1`,key:`1defrl`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),dm=X(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),fm=X(`Logs`,[[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M3 12h1`,key:`lp3yf2`}],[`path`,{d:`M3 18h1`,key:`1eiwyy`}],[`path`,{d:`M3 6h1`,key:`rgxa97`}],[`path`,{d:`M8 12h1`,key:`1con00`}],[`path`,{d:`M8 18h1`,key:`13wk12`}],[`path`,{d:`M8 6h1`,key:`tn6mkg`}]]),pm=X(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),mm=X(`MessageSquareWarning`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M12 7v2`,key:`stiyo7`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}]]),hm=X(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),gm=X(`Network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),_m=X(`PanelLeft`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),vm=X(`PanelRight`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),ym=X(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),bm=X(`PinOff`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),xm=X(`Pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),Sm=X(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),Cm=X(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),wm=X(`Power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Tm=X(`Radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),Em=X(`RefreshCcw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),Dm=X(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Om=X(`RotateCcw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),km=X(`Route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),Am=X(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),jm=X(`ServerCog`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5`,key:`tn8das`}],[`path`,{d:`M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5`,key:`1g2pve`}],[`path`,{d:`M6 6h.01`,key:`1utrut`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`m15.7 13.4-.9-.3`,key:`1jwmzr`}],[`path`,{d:`m9.2 10.9-.9-.3`,key:`qapnim`}],[`path`,{d:`m10.6 15.7.3-.9`,key:`quwk0k`}],[`path`,{d:`m13.6 15.7-.4-1`,key:`cb9xp7`}],[`path`,{d:`m10.8 9.3-.4-1`,key:`1uaiz5`}],[`path`,{d:`m8.3 13.6 1-.4`,key:`s6srou`}],[`path`,{d:`m14.7 10.8 1-.4`,key:`4d31cq`}],[`path`,{d:`m13.4 8.3-.3.9`,key:`1bm987`}]]),Mm=X(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Nm=X(`ShieldAlert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Pm=X(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Fm=X(`Siren`,[[`path`,{d:`M7 18v-6a5 5 0 1 1 10 0v6`,key:`pcx96s`}],[`path`,{d:`M5 21a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2z`,key:`1b4s83`}],[`path`,{d:`M21 12h1`,key:`jtio3y`}],[`path`,{d:`M18.5 4.5 18 5`,key:`g5sp9y`}],[`path`,{d:`M2 12h1`,key:`1uaihz`}],[`path`,{d:`M12 2v1`,key:`11qlp1`}],[`path`,{d:`m4.929 4.929.707.707`,key:`1i51kw`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}]]),Im=X(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Lm=X(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),Rm=X(`SquareTerminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),zm=X(`TabletSmartphone`,[[`rect`,{width:`10`,height:`14`,x:`3`,y:`8`,rx:`2`,key:`1vrsiq`}],[`path`,{d:`M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4`,key:`1j4zmg`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}]]),Bm=X(`Tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Vm=X(`Terminal`,[[`polyline`,{points:`4 17 10 11 4 5`,key:`akl6gq`}],[`line`,{x1:`12`,x2:`20`,y1:`19`,y2:`19`,key:`q2wloq`}]]),Hm=X(`TimerReset`,[[`path`,{d:`M10 2h4`,key:`n1abiw`}],[`path`,{d:`M12 14v-4`,key:`1evpnu`}],[`path`,{d:`M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6`,key:`1ts96g`}],[`path`,{d:`M9 17H4v5`,key:`8t5av`}]]),Um=X(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),Wm=X(`TriangleAlert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Gm=X(`UserRoundPlus`,[[`path`,{d:`M2 21a8 8 0 0 1 13.292-6`,key:`bjp14o`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M19 16v6`,key:`tddt3s`}],[`path`,{d:`M22 19h-6`,key:`vcuq98`}]]),Km=X(`Users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`,key:`1da9ce`}]]),qm=X(`WandSparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),Jm=X(`Webhook`,[[`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`,key:`q3hayz`}],[`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06`,key:`1go1hn`}],[`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`,key:`qlwsc0`}]]),Ym=X(`WifiOff`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Xm=X(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Zm=X(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),Qm=X(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),$m={success:(0,K.jsx)(Pp,{className:`h-4 w-4 text-success drop-shadow-[var(--drop-glow-success)]`}),error:(0,K.jsx)(Ip,{className:`h-4 w-4 text-error drop-shadow-[var(--drop-glow-error)]`}),warning:(0,K.jsx)(Wm,{className:`h-4 w-4 text-warning drop-shadow-[var(--drop-glow-warning)]`}),info:(0,K.jsx)(im,{className:`h-4 w-4 text-info drop-shadow-[var(--drop-glow-cyan)]`})},eh={success:`border-l-success shadow-toast-glow-success`,error:`border-l-error shadow-toast-glow-error`,warning:`border-l-warning shadow-toast-glow-warning`,info:`border-l-info shadow-toast-glow-cyan`};function th({notifications:e,onDismiss:t}){let n=hf(),r=e=>{e.href&&(n.push(e.href),t(e.id))};return(0,K.jsx)(`div`,{role:`log`,"aria-live":`assertive`,"aria-label":`Notifications`,"data-testid":`toast-stack`,className:`fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm`,children:e.map(e=>(0,K.jsx)(`div`,{"data-testid":`toast-item-${e.id}`,className:Y(`rounded-lg border border-[var(--glass-border-subtle)] bg-[var(--glass-bg-heavy)] backdrop-blur-sm p-3 shadow-lg border-l-2`,`animate-slide-in-right`,e.href&&`cursor-pointer hover:bg-card-hover`,e.persistent&&`ring-1 ring-primary/20`,eh[e.type]),onClick:()=>r(e),children:(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(`div`,{className:`shrink-0 mt-0.5`,children:$m[e.type]}),e.persistent&&(0,K.jsx)(`span`,{title:`Pinned — won't auto-dismiss`,className:`shrink-0`,children:(0,K.jsx)(xm,{className:`h-3 w-3 text-primary/50`})}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e.title}),e.persistent&&(0,K.jsx)(xm,{className:`h-3 w-3 text-warning shrink-0`,"aria-label":`Persistent notification`})]}),(0,K.jsx)(`p`,{className:`text-xs text-foreground-muted mt-0.5 truncate`,children:e.body})]}),(0,K.jsx)(`button`,{onClick:n=>{n.stopPropagation(),t(e.id)},className:`shrink-0 rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-primary transition-colors`,"aria-label":`Dismiss ${e.title}`,children:(0,K.jsx)(Qm,{className:`h-3.5 w-3.5`})})]})},e.id))})}function nh(e){return e>=500||e===404}function rh(e){return e instanceof DOMException&&e.name===`AbortError`}function ih(e){let t=e.trimStart();return t.startsWith(`<!DOCTYPE`)||t.startsWith(`<html`)||t.startsWith(`<pre`)||t.startsWith(`<script`)||t.startsWith(`<div`)||t.startsWith(`<head`)}function ah(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason??new DOMException(`Aborted`,`AbortError`));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t.reason??new DOMException(`Aborted`,`AbortError`))};t?.addEventListener(`abort`,a,{once:!0})})}function oh(e,t){let n=new AbortController,r=setTimeout(()=>{n.abort(new DOMException(`Request timed out`,`TimeoutError`))},e),i=()=>{clearTimeout(r),n.abort(t.reason??new DOMException(`Aborted`,`AbortError`))};return t?.aborted?(clearTimeout(r),n.abort(t.reason??new DOMException(`Aborted`,`AbortError`))):t?.addEventListener(`abort`,i,{once:!0}),{signal:n.signal,cleanup:()=>{clearTimeout(r),t?.removeEventListener(`abort`,i)}}}var sh=new Map,ch=100;function lh(){if(sh.size<=ch)return;let e=Array.from(sh.keys()).slice(0,sh.size-ch);for(let t of e)sh.delete(t)}async function uh(e,t={}){let{signal:n,retries:r=2,retryDelay:i=1e3,timeout:a=1e4,method:o=`GET`,headers:s,body:c}=t,l={...s},u=sh.get(e);u&&o===`GET`&&(l[`If-None-Match`]=u.etag);let d;for(let t=0;t<=r;t++){let{signal:s,cleanup:f}=oh(a,n);try{let a=await fetch(e,{method:o,headers:l,body:c,signal:s});if(a.status===304&&u)return f(),{ok:!0,data:u.data,status:304};if(a.ok){let o=a.headers.get(`Content-Type`)||``;if(!o.includes(`application/json`)&&o.includes(`text/html`)){f(),d={status:a.status,message:`Server temporarily unavailable (recompiling)`,isRetryable:!0,isAborted:!1},t<r&&await ah(i*2**t,n);continue}let s;try{s=await a.json()}catch{if(f(),d={status:a.status,message:`Server temporarily unavailable (recompiling)`,isRetryable:!0,isAborted:!1},t<r){let e=i*2**t;try{await ah(e,n)}catch{return{ok:!1,error:{status:0,message:`Request aborted`,isRetryable:!1,isAborted:!0}}}}continue}let c=a.headers.get(`ETag`);return c&&(sh.set(e,{etag:c,data:s}),lh()),f(),{ok:!0,data:s,status:a.status}}let p=nh(a.status),m;try{let e=await a.text();m=e&&ih(e)?`Server temporarily unavailable (HTTP ${a.status})`:e||`HTTP ${a.status}`}catch{m=`HTTP ${a.status}`}if(f(),d={status:a.status,message:m,isRetryable:p,isAborted:!1},!p)return{ok:!1,error:d};t<r&&await ah(i*2**t,n)}catch(e){if(f(),rh(e)||e instanceof DOMException&&e.name===`TimeoutError`){let e=s.reason,t=e instanceof DOMException&&e.name===`TimeoutError`;return{ok:!1,error:{status:0,message:t?`Request timed out`:`Request aborted`,isRetryable:!1,isAborted:!t}}}if(d={status:0,message:e instanceof Error?e.message:`Network error`,isRetryable:!0,isAborted:!1},t<r)try{await ah(i*2**t,n)}catch{return{ok:!1,error:{status:0,message:`Request aborted`,isRetryable:!1,isAborted:!0}}}}}return{ok:!1,error:d??{status:0,message:`Unknown error`,isRetryable:!1,isAborted:!1}}}function dh(e,t={}){let{interval:n=2e3,enabled:r=!0}=t,[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(r&&!!e),[c,l]=(0,y.useState)(null),u=(0,y.useRef)(!0),d=(0,y.useRef)(null),f=(0,y.useCallback)(async()=>{if(!e)return;d.current?.abort(),d.current=new AbortController;let t=await uh(e,{signal:d.current.signal});if(!t.ok){if(t.error.isAborted)return;u.current&&(l(t.error.message),s(!1));return}u.current&&(a(t.data),l(null),s(!1))},[e]);return(0,y.useEffect)(()=>{if(u.current=!0,!r||!e){s(!1);return}s(!0),f();let t=setInterval(f,n);return()=>{u.current=!1,d.current?.abort(),clearInterval(t)}},[f,n,r,e]),{data:i,loading:o,error:c,refresh:f}}function fh(e){if(e==null||e<0)return`—`;if(e===0)return`<1s`;if(e<1e3)return`${e}ms`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return n<60?`${n}m ${r}s`:`${Math.floor(n/60)}h ${n%60}m`}function ph(e){if(!e)return``;try{let t=Date.now()-new Date(e).getTime();return t<0||t<5e3?`just now`:t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}catch{return``}}function mh(e,t=4){return e?e.length<=t?e:`...`+e.slice(-t):`—`}function hh(e){return e?e.split(/[-/]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):``}var gh=(0,y.createContext)({notify:()=>{},requestPermission:()=>{},permission:`default`,notifications:[],dismiss:()=>{}}),_h=()=>(0,y.useContext)(gh);function vh({children:e}){let{notifications:t,notify:n,dismiss:r,requestPermission:i,permission:a}=mf(),{data:o}=dh(`/api/digest`,{interval:3e3}),s=(0,y.useRef)(new Map),c=(0,y.useRef)(Date.now());return(0,y.useEffect)(()=>{if(!o)return;let e=s.current;if(Date.now()-c.current<1e4){for(let t of o.runs)e.set(t.runId,{status:t.status,completedTasks:t.completedTasks,pendingBreakpoints:t.pendingBreakpoints||0,notifiedCompleted:t.status===`completed`,notifiedFailed:t.status===`failed`,notifiedWaiting:t.status===`waiting`});return}for(let t of o.runs){let r=e.get(t.runId);if(!r){e.set(t.runId,{status:t.status,completedTasks:t.completedTasks,pendingBreakpoints:t.pendingBreakpoints||0,notifiedCompleted:t.status===`completed`,notifiedFailed:t.status===`failed`,notifiedWaiting:t.status===`waiting`}),n(`New Run Started`,`${mh(t.runId,4)} started`,`info`,{href:`/runs/${t.runId}`});continue}if(t.status===`completed`&&!r.notifiedCompleted&&(r.notifiedCompleted=!0,n(`Run Completed`,`${mh(t.runId,4)} finished successfully`,`success`,{href:`/runs/${t.runId}`})),t.status===`failed`&&!r.notifiedFailed&&(r.notifiedFailed=!0,n(`Run Failed`,`${mh(t.runId,4)} failed`,`error`,{href:`/runs/${t.runId}`})),t.completedTasks>r.completedTasks&&(r.completedTasks=t.completedTasks),t.status===`waiting`&&!r.notifiedWaiting){r.notifiedWaiting=!0;let e=t.breakpointQuestion||`Review required`;n(`Run ${mh(t.runId,4)} needs attention`,e,`warning`,{href:`/runs/${t.runId}`,persistent:!0})}t.status!==`waiting`&&r.notifiedWaiting&&(r.notifiedWaiting=!1),r.pendingBreakpoints>0&&(t.pendingBreakpoints===0||t.pendingBreakpoints===void 0)&&n(`Breakpoint Resolved`,`Breakpoint in ${mh(t.runId,4)} was approved`,`success`,{href:`/runs/${t.runId}`}),r.pendingBreakpoints=t.pendingBreakpoints||0,r.status=t.status}},[o,n]),(0,K.jsxs)(gh.Provider,{value:{notify:n,requestPermission:i,permission:a,notifications:t,dismiss:r},children:[e,(0,K.jsx)(th,{notifications:t,onDismiss:r})]})}typeof window<`u`&&window.document&&window.document.createElement;function yh(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function bh(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function xh(...e){return t=>{let n=!1,r=e.map(e=>{let r=bh(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():bh(e[t],null)}}}}function Sh(...e){return y.useCallback(xh(...e),e)}function Ch(e,t){let n=y.createContext(t),r=e=>{let{children:t,...r}=e,i=y.useMemo(()=>r,Object.values(r));return(0,K.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=y.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function wh(e,t=[]){let n=[];function r(t,r){let i=y.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=y.useMemo(()=>o,Object.values(o));return(0,K.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=y.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>y.createContext(e));return function(n){let r=n?.[e]||t;return y.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Th(i,...t)]}function Th(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Eh=globalThis?.document?y.useLayoutEffect:()=>{},Dh=y.useId||(()=>void 0),Oh=0;function kh(e){let[t,n]=y.useState(Dh());return Eh(()=>{e||n(e=>e??String(Oh++))},[e]),e||(t?`radix-${t}`:``)}var Ah=y.useInsertionEffect||Eh;function jh({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Mh({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=y.useRef(e!==void 0);y.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,y.useCallback(t=>{if(s){let n=Nh(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Mh({defaultProp:e,onChange:t}){let[n,r]=y.useState(e),i=y.useRef(n),a=y.useRef(t);return Ah(()=>{a.current=t},[t]),y.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Nh(e){return typeof e==`function`}function Ph(e){let t=Fh(e),n=y.forwardRef((e,n)=>{let{children:r,...i}=e,a=y.Children.toArray(r),o=a.find(Lh);if(o){let e=o.props.children,r=a.map(t=>t===o?y.Children.count(e)>1?y.Children.only(null):y.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:y.isValidElement(e)?y.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Fh(e){let t=y.forwardRef((e,t)=>{let{children:n,...r}=e;if(y.isValidElement(n)){let e=zh(n),i=Rh(r,n.props);return n.type!==y.Fragment&&(i.ref=t?xh(t,e):e),y.cloneElement(n,i)}return y.Children.count(n)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ih=Symbol(`radix.slottable`);function Lh(e){return y.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ih}function Rh(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function zh(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bh=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ph(`Primitive.${t}`),r=y.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,K.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Vh(e,t){e&&x.flushSync(()=>e.dispatchEvent(t))}function Hh(e){let t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...e)=>t.current?.(...e),[])}function Uh(e,t=globalThis?.document){let n=Hh(e);y.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Wh=`DismissableLayer`,Gh=`dismissableLayer.update`,Kh=`dismissableLayer.pointerDownOutside`,qh=`dismissableLayer.focusOutside`,Jh,Yh=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xh=y.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=y.useContext(Yh),[u,d]=y.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=y.useState({}),m=Sh(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=v>=_,S=$h(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=eg(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Uh(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),y.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Jh=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),tg(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Jh)}},[u,f,n,l]),y.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),tg())},[u,l]),y.useEffect(()=>{let e=()=>p({});return document.addEventListener(Gh,e),()=>document.removeEventListener(Gh,e)},[]),(0,K.jsx)(Bh.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:yh(e.onFocusCapture,C.onFocusCapture),onBlurCapture:yh(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:yh(e.onPointerDownCapture,S.onPointerDownCapture)})});Xh.displayName=Wh;var Zh=`DismissableLayerBranch`,Qh=y.forwardRef((e,t)=>{let n=y.useContext(Yh),r=y.useRef(null),i=Sh(t,r);return y.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,K.jsx)(Bh.div,{...e,ref:i})});Qh.displayName=Zh;function $h(e,t=globalThis?.document){let n=Hh(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){ng(Kh,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function eg(e,t=globalThis?.document){let n=Hh(e),r=y.useRef(!1);return y.useEffect(()=>{let e=e=>{e.target&&!r.current&&ng(qh,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tg(){let e=new CustomEvent(Gh);document.dispatchEvent(e)}function ng(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Vh(i,a):i.dispatchEvent(a)}var rg=`focusScope.autoFocusOnMount`,ig=`focusScope.autoFocusOnUnmount`,ag={bubbles:!1,cancelable:!0},og=`FocusScope`,sg=y.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=y.useState(null),l=Hh(i),u=Hh(a),d=y.useRef(null),f=Sh(t,e=>c(e)),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:mg(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||mg(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&mg(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),y.useEffect(()=>{if(s){hg.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(rg,ag);s.addEventListener(rg,l),s.dispatchEvent(t),t.defaultPrevented||(cg(vg(ug(s)),{select:!0}),document.activeElement===e&&mg(s))}return()=>{s.removeEventListener(rg,l),setTimeout(()=>{let t=new CustomEvent(ig,ag);s.addEventListener(ig,u),s.dispatchEvent(t),t.defaultPrevented||mg(e??document.body,{select:!0}),s.removeEventListener(ig,u),hg.remove(p)},0)}}},[s,l,u,p]);let m=y.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=lg(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&mg(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&mg(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,K.jsx)(Bh.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});sg.displayName=og;function cg(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(mg(r,{select:t}),document.activeElement!==n)return}function lg(e){let t=ug(e);return[dg(t,e),dg(t.reverse(),e)]}function ug(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dg(e,t){for(let n of e)if(!fg(n,{upTo:t}))return n}function fg(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function pg(e){return e instanceof HTMLInputElement&&`select`in e}function mg(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pg(e)&&t&&e.select()}}var hg=gg();function gg(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=_g(e,t),e.unshift(t)},remove(t){e=_g(e,t),e[0]?.resume()}}}function _g(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function vg(e){return e.filter(e=>e.tagName!==`A`)}var yg=`Portal`,bg=y.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=y.useState(!1);Eh(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?x.createPortal((0,K.jsx)(Bh.div,{...r,ref:t}),o):null});bg.displayName=yg;function xg(e,t){return y.useReducer((e,n)=>t[e][n]??e,e)}var Sg=e=>{let{present:t,children:n}=e,r=Cg(t),i=typeof n==`function`?n({present:r.isPresent}):y.Children.only(n),a=Sh(r.ref,Tg(i));return typeof n==`function`||r.isPresent?y.cloneElement(i,{ref:a}):null};Sg.displayName=`Presence`;function Cg(e){let[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),a=y.useRef(`none`),[o,s]=xg(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return y.useEffect(()=>{let e=wg(r.current);a.current=o===`mounted`?e:`none`},[o]),Eh(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=wg(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Eh(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=wg(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=wg(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:y.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function wg(e){return e?.animationName||`none`}function Tg(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Eg=0;function Dg(){y.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Og()),document.body.insertAdjacentElement(`beforeend`,e[1]??Og()),Eg++,()=>{Eg===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Eg--}},[])}function Og(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var kg=function(){return kg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},kg.apply(this,arguments)};function Ag(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function jg(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Mg=`right-scroll-bar-position`,Ng=`width-before-scroll-bar`,Pg=`with-scroll-bars-hidden`,Fg=`--removed-body-scroll-bar-size`;function Ig(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Lg(e,t){var n=(0,y.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Rg=typeof window<`u`?y.useLayoutEffect:y.useEffect,zg=new WeakMap;function Bg(e,t){var n=Lg(t||null,function(t){return e.forEach(function(e){return Ig(e,t)})});return Rg(function(){var t=zg.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ig(e,null)}),i.forEach(function(e){r.has(e)||Ig(e,a)})}zg.set(n,e)},[e]),n}function Vg(e){return e}function Hg(e,t){t===void 0&&(t=Vg);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ug(e){e===void 0&&(e={});var t=Hg(null);return t.options=kg({async:!0,ssr:!1},e),t}var Wg=function(e){var t=e.sideCar,n=Ag(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return y.createElement(r,kg({},n))};Wg.isSideCarExport=!0;function Gg(e,t){return e.useMedium(t),Wg}var Kg=Ug(),qg=function(){},Jg=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:qg,onWheelCapture:qg,onTouchMoveCapture:qg}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,b=e.gapMode,x=Ag(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Bg([n,t]),w=kg(kg({},x),i);return y.createElement(y.Fragment,null,u&&y.createElement(S,{sideCar:Kg,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?y.cloneElement(y.Children.only(s),kg(kg({},w),{ref:C})):y.createElement(v,kg({},w,{className:c,ref:C}),s))});Jg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Jg.classNames={fullWidth:Ng,zeroRight:Mg};var Yg,Xg=function(){if(Yg)return Yg;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Zg(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Xg();return t&&e.setAttribute(`nonce`,t),e}function Qg(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $g(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var e_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Zg())&&(Qg(t,n),$g(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},t_=function(){var e=e_();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},n_=function(){var e=t_();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},r_={left:0,top:0,right:0,gap:0},i_=function(e){return parseInt(e||``,10)||0},a_=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[i_(n),i_(r),i_(i)]},o_=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return r_;var t=a_(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},s_=n_(),c_=`data-scroll-locked`,l_=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
19
|
+
.${Pg} {
|
|
20
|
+
overflow: hidden ${r};
|
|
21
|
+
padding-right: ${s}px ${r};
|
|
22
|
+
}
|
|
23
|
+
body[${c_}] {
|
|
24
|
+
overflow: hidden ${r};
|
|
25
|
+
overscroll-behavior: contain;
|
|
26
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
27
|
+
padding-left: ${i}px;
|
|
28
|
+
padding-top: ${a}px;
|
|
29
|
+
padding-right: ${o}px;
|
|
30
|
+
margin-left:0;
|
|
31
|
+
margin-top:0;
|
|
32
|
+
margin-right: ${s}px ${r};
|
|
33
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.${Mg} {
|
|
37
|
+
right: ${s}px ${r};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.${Ng} {
|
|
41
|
+
margin-right: ${s}px ${r};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.${Mg} .${Mg} {
|
|
45
|
+
right: 0 ${r};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.${Ng} .${Ng} {
|
|
49
|
+
margin-right: 0 ${r};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
body[${c_}] {
|
|
53
|
+
${Fg}: ${s}px;
|
|
54
|
+
}
|
|
55
|
+
`},u_=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},d_=function(){y.useEffect(function(){return document.body.setAttribute(c_,(u_()+1).toString()),function(){var e=u_()-1;e<=0?document.body.removeAttribute(c_):document.body.setAttribute(c_,e.toString())}},[])},f_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;d_();var a=y.useMemo(function(){return o_(i)},[i]);return y.createElement(s_,{styles:l_(a,!t,i,n?``:`!important`)})},p_=!1;if(typeof window<`u`)try{var m_=Object.defineProperty({},`passive`,{get:function(){return p_=!0,!0}});window.addEventListener(`test`,m_,m_),window.removeEventListener(`test`,m_,m_)}catch{p_=!1}var h_=p_?{passive:!1}:!1,g_=function(e){return e.tagName===`TEXTAREA`},__=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!g_(e)&&n[t]===`visible`)},v_=function(e){return __(e,`overflowY`)},y_=function(e){return __(e,`overflowX`)},b_=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),C_(e,r)){var i=w_(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},x_=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},S_=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},C_=function(e,t){return e===`v`?v_(t):y_(t)},w_=function(e,t){return e===`v`?x_(t):S_(t)},T_=function(e,t){return e===`h`&&t===`rtl`?-1:1},E_=function(e,t,n,r,i){var a=T_(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=w_(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&C_(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},D_=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},O_=function(e){return[e.deltaX,e.deltaY]},k_=function(e){return e&&`current`in e?e.current:e},A_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},j_=function(e){return`
|
|
56
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
57
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
58
|
+
`},M_=0,N_=[];function P_(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(M_++)[0],a=y.useState(n_)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=jg([e.lockRef.current],(e.shards||[]).map(k_),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=D_(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=b_(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=b_(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return E_(h,t,e,h===`h`?s:c,!0)},[]),c=y.useCallback(function(e){var n=e;if(!(!N_.length||N_[N_.length-1]!==a)){var r=`deltaY`in n?O_(n):D_(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&A_(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(k_).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=y.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:F_(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=y.useCallback(function(e){n.current=D_(e),r.current=void 0},[]),d=y.useCallback(function(t){l(t.type,O_(t),t.target,s(t,e.lockRef.current))},[]),f=y.useCallback(function(t){l(t.type,D_(t),t.target,s(t,e.lockRef.current))},[]);y.useEffect(function(){return N_.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,h_),document.addEventListener(`touchmove`,c,h_),document.addEventListener(`touchstart`,u,h_),function(){N_=N_.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,h_),document.removeEventListener(`touchmove`,c,h_),document.removeEventListener(`touchstart`,u,h_)}},[]);var p=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(a,{styles:j_(i)}):null,p?y.createElement(f_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function F_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var I_=Gg(Kg,P_),L_=y.forwardRef(function(e,t){return y.createElement(Jg,kg({},e,{ref:t,sideCar:I_}))});L_.classNames=Jg.classNames;var R_=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},z_=new WeakMap,B_=new WeakMap,V_={},H_=0,U_=function(e){return e&&(e.host||U_(e.parentNode))},W_=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=U_(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},G_=function(e,t,n,r){var i=W_(t,Array.isArray(e)?e:[e]);V_[n]||(V_[n]=new WeakMap);var a=V_[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(z_.get(e)||0)+1,l=(a.get(e)||0)+1;z_.set(e,c),a.set(e,l),o.push(e),c===1&&i&&B_.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),H_++,function(){o.forEach(function(e){var t=z_.get(e)-1,i=a.get(e)-1;z_.set(e,t),a.set(e,i),t||(B_.has(e)||e.removeAttribute(r),B_.delete(e)),i||e.removeAttribute(n)}),H_--,H_||(z_=new WeakMap,z_=new WeakMap,B_=new WeakMap,V_={})}},K_=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||R_(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),G_(r,i,n,`aria-hidden`)):function(){return null}};function q_(e){let t=J_(e),n=y.forwardRef((e,n)=>{let{children:r,...i}=e,a=y.Children.toArray(r),o=a.find(X_);if(o){let e=o.props.children,r=a.map(t=>t===o?y.Children.count(e)>1?y.Children.only(null):y.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:y.isValidElement(e)?y.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function J_(e){let t=y.forwardRef((e,t)=>{let{children:n,...r}=e;if(y.isValidElement(n)){let e=Q_(n),i=Z_(r,n.props);return n.type!==y.Fragment&&(i.ref=t?xh(t,e):e),y.cloneElement(n,i)}return y.Children.count(n)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Y_=Symbol(`radix.slottable`);function X_(e){return y.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Y_}function Z_(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Q_(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $_=`Dialog`,[ev,tv]=wh($_),[nv,rv]=ev($_),iv=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=y.useRef(null),c=y.useRef(null),[l,u]=jh({prop:r,defaultProp:i??!1,onChange:a,caller:$_});return(0,K.jsx)(nv,{scope:t,triggerRef:s,contentRef:c,contentId:kh(),titleId:kh(),descriptionId:kh(),open:l,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};iv.displayName=$_;var av=`DialogTrigger`,ov=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=rv(av,n),a=Sh(t,i.triggerRef);return(0,K.jsx)(Bh.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ev(i.open),...r,ref:a,onClick:yh(e.onClick,i.onOpenToggle)})});ov.displayName=av;var sv=`DialogPortal`,[cv,lv]=ev(sv,{forceMount:void 0}),uv=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=rv(sv,t);return(0,K.jsx)(cv,{scope:t,forceMount:n,children:y.Children.map(r,e=>(0,K.jsx)(Sg,{present:n||a.open,children:(0,K.jsx)(bg,{asChild:!0,container:i,children:e})}))})};uv.displayName=sv;var dv=`DialogOverlay`,fv=y.forwardRef((e,t)=>{let n=lv(dv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=rv(dv,e.__scopeDialog);return a.modal?(0,K.jsx)(Sg,{present:r||a.open,children:(0,K.jsx)(mv,{...i,ref:t})}):null});fv.displayName=dv;var pv=q_(`DialogOverlay.RemoveScroll`),mv=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=rv(dv,n);return(0,K.jsx)(L_,{as:pv,allowPinchZoom:!0,shards:[i.contentRef],children:(0,K.jsx)(Bh.div,{"data-state":Ev(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),hv=`DialogContent`,gv=y.forwardRef((e,t)=>{let n=lv(hv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=rv(hv,e.__scopeDialog);return(0,K.jsx)(Sg,{present:r||a.open,children:a.modal?(0,K.jsx)(_v,{...i,ref:t}):(0,K.jsx)(vv,{...i,ref:t})})});gv.displayName=hv;var _v=y.forwardRef((e,t)=>{let n=rv(hv,e.__scopeDialog),r=y.useRef(null),i=Sh(t,n.contentRef,r);return y.useEffect(()=>{let e=r.current;if(e)return K_(e)},[]),(0,K.jsx)(yv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yh(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:yh(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:yh(e.onFocusOutside,e=>e.preventDefault())})}),vv=y.forwardRef((e,t)=>{let n=rv(hv,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return(0,K.jsx)(yv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),yv=y.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=rv(hv,n),c=y.useRef(null),l=Sh(t,c);return Dg(),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(sg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,K.jsx)(Xh,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Ev(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Av,{titleId:s.titleId}),(0,K.jsx)(Mv,{contentRef:c,descriptionId:s.descriptionId})]})]})}),bv=`DialogTitle`,xv=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=rv(bv,n);return(0,K.jsx)(Bh.h2,{id:i.titleId,...r,ref:t})});xv.displayName=bv;var Sv=`DialogDescription`,Cv=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=rv(Sv,n);return(0,K.jsx)(Bh.p,{id:i.descriptionId,...r,ref:t})});Cv.displayName=Sv;var wv=`DialogClose`,Tv=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=rv(wv,n);return(0,K.jsx)(Bh.button,{type:`button`,...r,ref:t,onClick:yh(e.onClick,()=>i.onOpenChange(!1))})});Tv.displayName=wv;function Ev(e){return e?`open`:`closed`}var Dv=`DialogTitleWarning`,[Ov,kv]=Ch(Dv,{contentName:hv,titleName:bv,docsSlug:`dialog`}),Av=({titleId:e})=>{let t=kv(Dv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
59
|
+
|
|
60
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
61
|
+
|
|
62
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},jv=`DialogDescriptionWarning`,Mv=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${kv(jv).contentName}}.`;return y.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Nv=iv,Pv=uv,Fv=fv,Iv=gv,Lv=xv,Rv=Tv;function zv({children:e,className:t}){return(0,K.jsx)(`kbd`,{className:Y(`inline-flex h-5 min-w-[20px] items-center justify-center rounded`,`border border-[var(--kbd-border)] bg-background-secondary`,`px-1.5 font-mono text-xs leading-tight text-foreground-muted`,`shadow-kbd`,t),children:e})}function Bv(e){let t=(0,y.useRef)(e);t.current=e,(0,y.useEffect)(()=>{let e=e=>{let n=e.target;if(!(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.tagName===`SELECT`||n.isContentEditable)){for(let n of t.current)if(e.key===n.key&&!!e.ctrlKey==!!n.ctrl&&!!e.shiftKey==!!n.shift){e.preventDefault(),n.action();return}}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[])}var Vv=[{keys:[`?`],description:`Show this help`,context:`global`},{keys:[`n`],description:`Toggle notifications`,context:`global`},{keys:[`/`],description:`Focus search`,context:`dashboard`},{keys:[`j`],description:`Next item`,context:`run-detail`},{keys:[`k`],description:`Previous item`,context:`run-detail`},{keys:[`Enter`],description:`Open selected`,context:`run-detail`},{keys:[`Esc`],description:`Go back / Close`,context:`run-detail`},{keys:[`e`],description:`Toggle event stream`,context:`run-detail`},{keys:[`1`],description:`Agent tab`,context:`run-detail`},{keys:[`2`],description:`Timing tab`,context:`run-detail`},{keys:[`3`],description:`Logs tab`,context:`run-detail`},{keys:[`4`],description:`Data tab`,context:`run-detail`},{keys:[`5`],description:`Approval tab`,context:`run-detail`},{keys:[`Shift`,`W`],description:`Toggle workspace sidebar`,context:`session-workspace`},{keys:[`Shift`,`C`],description:`Toggle conversation panel`,context:`session-workspace`},{keys:[`Shift`,`X`],description:`Toggle context panel`,context:`session-workspace`},{keys:[`Shift`,`D`],description:`Toggle details sidebar`,context:`session-workspace`},{keys:[`Ctrl/Cmd`,`K`],description:`Open workspace command bar`,context:`session-workspace`}],Hv={global:`Global`,dashboard:`Dashboard`,"run-detail":`Run Detail`,"session-workspace":`Session Workspace`};function Uv(){let[e,t]=(0,y.useState)(!1),n=gf(),r=n?.startsWith(`/runs/`)??!1,i=n?.startsWith(`/sessions/`)??!1;Bv([{key:`?`,action:()=>t(!0),description:`Show shortcuts help`},{key:`Escape`,action:()=>t(!1),description:`Close shortcuts help`}]),(0,y.useEffect)(()=>{let e=()=>t(!0);return window.addEventListener(`open-shortcuts-help`,e),()=>window.removeEventListener(`open-shortcuts-help`,e)},[]);let a=Vv.filter(e=>!!(e.context===`global`||e.context===`dashboard`&&!r||e.context===`run-detail`&&r||e.context===`session-workspace`&&i)).reduce((e,t)=>((e[t.context]??=[]).push(t),e),{});return(0,K.jsx)(Nv,{open:e,onOpenChange:t,children:(0,K.jsxs)(Pv,{children:[(0,K.jsx)(Fv,{className:`fixed inset-0 z-50 bg-black/70 backdrop-blur-sm`}),(0,K.jsxs)(Iv,{className:`fixed inset-x-4 bottom-4 top-4 z-50 flex max-h-[calc(100dvh-2rem)] flex-col overflow-hidden rounded-2xl border border-[var(--glass-border)] bg-[var(--glass-bg)] p-4 shadow-glass backdrop-blur-xl sm:left-1/2 sm:top-1/2 sm:w-full sm:max-w-md sm:-translate-x-1/2 sm:-translate-y-1/2 sm:p-6`,children:[(0,K.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,K.jsx)(Lv,{className:`text-sm font-medium text-foreground`,children:`Keyboard Shortcuts`}),(0,K.jsx)(Rv,{asChild:!0,children:(0,K.jsx)(`button`,{className:`rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-primary transition-colors`,children:(0,K.jsx)(Qm,{className:`h-4 w-4`})})})]}),(0,K.jsx)(`div`,{className:`space-y-4 overflow-y-auto pr-1`,children:Object.entries(a).map(([e,t])=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h3`,{className:`text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2`,children:Hv[e]??e}),(0,K.jsx)(`div`,{className:`space-y-2`,children:t.map(({keys:e,description:t})=>(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 py-1 sm:flex-row sm:items-center sm:justify-between`,children:[(0,K.jsx)(`span`,{className:`text-sm text-foreground-secondary`,children:t}),(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,children:e.map(e=>(0,K.jsx)(zv,{children:e},e))})]},t))})]},e))})]})]})})}function Wv(){return(0,K.jsxs)(vh,{children:[(0,K.jsx)(ct,{}),(0,K.jsx)(Uv,{})]})}var Z=y.forwardRef(function(e,t){let{href:n,...r}=e;return Fe()?(0,K.jsx)(Dt,{ref:t,to:n,...r}):(0,K.jsx)(`a`,{ref:t,href:n,...r})}),Gv=null,Kv=0,qv=0,Jv=null,Yv=new Set;function Xv(){let e=[1e3,2e3,4e3,8e3,3e4];return e[Math.min(qv,e.length-1)]}function Zv(){if(typeof EventSource>`u`)return console.warn(`EventSource not supported in this environment`),null;let e=new EventSource(`/api/stream`);return e.onopen=()=>{console.log(`SSE connected`),qv=0},e.onmessage=e=>{try{let t=JSON.parse(e.data);Yv.forEach(e=>e(t))}catch(e){console.error(`Failed to parse SSE message:`,e)}},e.onerror=()=>{if(console.error(`SSE connection error`),e.close(),Gv=null,Yv.forEach(e=>e({type:`disconnect`})),Kv>0){qv++;let e=Xv();console.log(`Reconnecting in ${e}ms (attempt ${qv})`),Jv=setTimeout(()=>{Kv>0&&(Gv=Zv())},e)}},e}function Qv(e){return Yv.add(e),Kv++,Kv===1&&!Gv&&(Gv=Zv()),()=>{Yv.delete(e),Kv--,Kv===0&&(Jv&&=(clearTimeout(Jv),null),Gv&&=(Gv.close(),null),qv=0)}}function $v(e,t={}){let{interval:n=5e3,sseFilter:r,enabled:i=!0,suppressSseRefetch:a=!1}=t,[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)(i&&!!e),[u,d]=(0,y.useState)(null),f=(0,y.useRef)(!0),p=(0,y.useRef)(r);p.current=r;let m=(0,y.useRef)(!1),h=(0,y.useRef)(null),g=(0,y.useRef)(null),_=(0,y.useRef)(null),v=(0,y.useRef)(a);v.current=a;let b=(0,y.useCallback)(async()=>{if(!e||!i)return;g.current?.abort(),g.current=new AbortController;let t=await uh(e,{signal:g.current.signal});if(!t.ok){if(t.error.isAborted)return;f.current&&(d(t.error.message),l(!1));return}f.current&&(t.status!==304&&(0,y.startTransition)(()=>{s(t.data)}),d(null),l(!1))},[e,i]);return(0,y.useEffect)(()=>{if(f.current=!0,!i||!e){l(!1);return}l(!0),b();function t(){h.current&&clearInterval(h.current);let e=m.current?Math.max(n*3,15e3):n;h.current=setInterval(b,e)}return t(),()=>{f.current=!1,g.current?.abort(),h.current&&=(clearInterval(h.current),null)}},[b,n,i,e]),(0,y.useEffect)(()=>{if(!i||!p.current)return;let e=Qv(e=>{if(e.type===`connected`){if(!m.current){m.current=!0,h.current&&clearInterval(h.current);let e=Math.max(n*3,15e3);h.current=setInterval(b,e)}return}if(e.type===`disconnect`||e.type===`error`){m.current&&(m.current=!1,h.current&&clearInterval(h.current),h.current=setInterval(b,n));return}if(p.current?.(e)){if(v.current)return;_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{_.current=null,b()},1500)}});return()=>{e(),m.current=!1,_.current&&=(clearTimeout(_.current),null)}},[i,b,n]),{data:o,loading:c,error:u,refresh:b}}async function ey(){let e=await uh(`/api/task-tags`);if(!e.ok)throw Error(e.error.message);return e.data.taskTags}async function ty(e){let t=await uh(`/api/task-tags`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(t.error.message);return t.data}async function ny(e,t){let n=await uh(`/api/task-tags/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(n.error.message);return n.data}async function ry(e){let t=await uh(`/api/task-tags/${e}`,{method:`DELETE`});if(!t.ok)throw Error(t.error.message);return t.data}async function iy(e){let t=await uh(`/api/dispatch-context-labels`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(t.error.message);return t.data}async function ay(e,t){let n=await uh(`/api/dispatch-context-labels/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(n.error.message);return n.data}async function oy(e){let t=await uh(`/api/dispatch-context-labels/${e}`,{method:`DELETE`});if(!t.ok)throw Error(t.error.message);return t.data}function sy(e=15e3){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null),{data:l,loading:u,error:d,refresh:f}=$v(`/api/backlog`,{interval:e,sseFilter:e=>e.type===`update`||e.type===`new-run`});async function p(e,t){i(t),c(null);try{let n=await uh(`/api/backlog`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok){let e={issueId:t,message:n.error.message};throw c(e),Error(e.message)}return await f(),n.data}catch(e){throw e instanceof Error&&c({issueId:t,message:e.message}),e}finally{i(null)}}async function m(e,t){n(e);try{await p({action:`move-issue`,issueId:e,toState:t},e)}finally{n(null)}}async function h(e){await p({action:`link-repository`,...e},e.issueId)}async function g(e){await p({action:`update-repository-settings`,...e},e.issueId)}async function _(e){await p({action:`create-pull-request`,...e},e.issueId)}async function v(e){await p({action:`update-project-collaboration`,...e},e.projectId)}async function b(e){await p({action:`update-issue-collaboration`,...e},e.issueId)}async function x(e){await p({action:`update-issue-dispatch-context-labels`,...e},e.issueId)}async function S(e){o(!0);try{return await p({action:`create-issue`,...e},e.projectId)}finally{o(!1)}}async function C(e){await p({action:`create-sub-issue`,...e},e.parentIssueId)}async function w(e){await p({action:`link-child-issue`,...e},e.parentIssueId)}async function T(e){return p({action:`update-issue-detail`,...e},e.issueId)}async function E(e){await p({action:`create-issue-workspace`,issueId:e},e)}async function D(e){await p({action:`link-issue-workspace`,...e},e.issueId)}return{snapshot:l?.snapshot,board:l?.board,summary:l?.summary,loading:u,error:d,refresh:f,moveIssue:m,linkRepository:h,updateRepositorySettings:g,createPullRequest:_,createIssue:S,updateProjectCollaboration:v,updateIssueCollaboration:b,updateIssueDispatchContextLabels:x,createSubIssue:C,linkChildIssue:w,updateIssueDetail:T,createIssueWorkspace:E,linkIssueWorkspace:D,movingIssueId:t,mutatingIssueId:r,creatingIssue:a,mutationError:s}}var cy=`mx-auto flex w-full max-w-[1600px] flex-1 flex-col gap-6 px-4 py-5 sm:px-6 sm:py-6`,ly=`rounded-3xl border border-border/90 bg-card/95 p-6 shadow-lg`,uy=`rounded-3xl border border-border/80 bg-background/60 p-5 shadow-sm`;function dy(e){return(0,K.jsx)(`div`,{className:Y(`flex-1`,(e.background??`ambient`)===`ambient`?`bg-gradient-brand-subtle`:null),children:(0,K.jsx)(`div`,{className:Y(cy,e.className),children:e.children})})}function fy(e){return(0,K.jsx)(`section`,{className:Y(e.inset?uy:ly,e.className),children:e.children})}function py(e){return(0,K.jsx)(`section`,{className:Y(`grid gap-4 xl:grid-cols-[minmax(0,1.45fr)_minmax(0,0.95fr)]`,e.className),children:e.children})}function my(){let{snapshot:e,summary:t,loading:n,error:r}=sy();return n&&!e?(0,K.jsx)(dy,{children:(0,K.jsxs)(`div`,{className:`w-full animate-pulse rounded-3xl border border-border bg-card p-6`,children:[(0,K.jsx)(`div`,{className:`h-5 w-48 rounded bg-background-secondary`}),(0,K.jsx)(`div`,{className:`mt-4 grid gap-4 lg:grid-cols-3`,children:Array.from({length:3}).map((e,t)=>(0,K.jsx)(`div`,{className:`h-40 rounded-2xl bg-background-secondary`},t))})]})}):r||!e?(0,K.jsx)(dy,{children:(0,K.jsx)(`div`,{className:`w-full rounded-3xl border border-error/25 bg-error-muted p-6 text-sm text-error`,children:`Failed to load project planning workspace.`})}):(0,K.jsxs)(dy,{children:[(0,K.jsxs)(fy,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Projects`}),(0,K.jsx)(`h1`,{className:`mt-2 text-3xl font-semibold tracking-tight text-foreground`,children:`Planning starts from projects and board routes now`}),(0,K.jsx)(`p`,{className:`mt-3 max-w-4xl text-sm leading-6 text-foreground-muted`,children:`The main surface is no longer a dashboard-first run list. Choose a project board, switch to list mode when you need linear triage, and use the routed workspace to move issues, filter planning state, and provision execution context.`}),(0,K.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-3 text-sm text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-2 rounded-full border border-border bg-background px-3 py-2`,children:[(0,K.jsx)(Xp,{className:`h-4 w-4`}),e.projects.length,` project boards`]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-2 rounded-full border border-border bg-background px-3 py-2`,children:[(0,K.jsx)(Xm,{className:`h-4 w-4`}),t?.issueCount??0,` issues tracked`]})]})]}),(0,K.jsx)(`section`,{className:`mt-5 grid gap-4 xl:grid-cols-2`,children:e.projects.map(e=>(0,K.jsxs)(`article`,{className:`rounded-3xl border border-border bg-card p-5 shadow-sm`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:e.key}),(0,K.jsx)(`h2`,{className:`mt-1 text-xl font-semibold text-foreground`,children:e.name})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1 text-xs text-foreground-muted`,children:[e.metrics.totalIssues,` issues`]})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-3`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`div`,{className:`font-semibold text-foreground`,children:e.metrics.inProgressIssues}),(0,K.jsx)(`div`,{children:`Active work`})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`div`,{className:`font-semibold text-foreground`,children:e.metrics.readyIssues}),(0,K.jsx)(`div`,{children:`Ready issues`})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`div`,{className:`font-semibold text-foreground`,children:e.team.members.length}),(0,K.jsx)(`div`,{children:`Collaborators`})]})]}),(0,K.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:e.labels.slice(0,4).map(e=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:e.name},e.id))}),(0,K.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-3`,children:[(0,K.jsxs)(Z,{href:`/projects/${e.id}/board`,className:`inline-flex h-11 items-center gap-2 rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary`,children:[(0,K.jsx)(om,{className:`h-4 w-4`}),`Open board`]}),(0,K.jsxs)(Z,{href:`/projects/${e.id}/list`,className:`inline-flex h-11 items-center gap-2 rounded-xl border border-border bg-background px-4 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(um,{className:`h-4 w-4`}),`Open list`]}),(0,K.jsxs)(Z,{href:`/projects/${e.id}/workspaces/new`,className:`inline-flex h-11 items-center gap-2 rounded-xl border border-border bg-background px-4 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Xp,{className:`h-4 w-4`}),`Create workspace`]}),(0,K.jsxs)(`span`,{className:`inline-flex h-11 items-center gap-2 rounded-xl border border-border bg-background px-4 text-sm font-semibold text-foreground-muted`,children:[(0,K.jsx)(Km,{className:`h-4 w-4`}),e.team.members.length,` teammates on this board`]})]})]},e.id))})]})}function hy({title:e=`No runs found`,description:t=`Start a babysitter run to see it here.`,className:n,compact:r=!1}){return(0,K.jsxs)(`div`,{className:Y(`flex flex-col items-center justify-center rounded-3xl border border-dashed border-border bg-background/50 px-6 text-center`,r?`py-10`:`py-16`,n),children:[(0,K.jsx)(`div`,{className:`mb-4 flex h-14 w-14 items-center justify-center rounded-2xl border border-border bg-card/80 shadow-sm`,children:(0,K.jsx)(rm,{className:`h-6 w-6 text-foreground-muted/60`})}),(0,K.jsx)(`h3`,{className:`text-base font-semibold tracking-tight text-foreground`,children:e}),(0,K.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-foreground-muted`,children:t})]})}var gy=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,_y=yf,vy=(e,t)=>n=>{if(t?.variants==null)return _y(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=gy(t)||gy(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return _y(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},yy=Symbol.for(`react.lazy`),by=y.use;function xy(e){return typeof e==`object`&&!!e&&`then`in e}function Sy(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===yy&&`_payload`in e&&xy(e._payload)}function Cy(e){let t=Ty(e),n=y.forwardRef((e,n)=>{let{children:r,...i}=e;Sy(r)&&typeof by==`function`&&(r=by(r._payload));let a=y.Children.toArray(r),o=a.find(Dy);if(o){let e=o.props.children,r=a.map(t=>t===o?y.Children.count(e)>1?y.Children.only(null):y.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:y.isValidElement(e)?y.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var wy=Cy(`Slot`);function Ty(e){let t=y.forwardRef((e,t)=>{let{children:n,...r}=e;if(Sy(n)&&typeof by==`function`&&(n=by(n._payload)),y.isValidElement(n)){let e=ky(n),i=Oy(r,n.props);return n.type!==y.Fragment&&(i.ref=t?xh(t,e):e),y.cloneElement(n,i)}return y.Children.count(n)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ey=Symbol(`radix.slottable`);function Dy(e){return y.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ey}function Oy(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ky(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ay=vy(`tkc-btn whitespace-nowrap`,{variants:{variant:{default:``,primary:`tkc-btn--primary`,neon:`tkc-btn--primary`,outline:`bg-transparent text-[var(--tkc-ink)] border-[color:var(--tkc-rule-m)] hover:bg-[var(--tkc-panel-muted)]`,ghost:`tkc-btn--ghost`,destructive:`tkc-btn--primary`},size:{default:``,sm:`tkc-btn--sm min-h-11`,lg:`px-5 py-2.5 text-base`,icon:`tkc-btn--icon h-10 w-10 justify-center p-0`}},defaultVariants:{variant:`default`,size:`default`}});function Q({className:e,variant:t,size:n,asChild:r=!1,loading:i=!1,disabled:a,...o}){let s=Y(Ay({variant:t,size:n}),e);return(0,K.jsx)(r?wy:`button`,{"aria-busy":i||void 0,className:s,disabled:i||a,...o})}var jy=vy(`tkc-tag border font-mono uppercase shadow-none`,{variants:{variant:{default:`bg-[var(--tkc-surface-muted)] text-[var(--tkc-ink-quiet)] border-[color:var(--tkc-rule)]`,success:`bg-success/10 text-success border-success/30`,error:`bg-error/10 text-error border-error/30`,warning:`bg-warning/10 text-warning border-warning/30`,info:`bg-info/10 text-info border-info/30`,pending:`bg-[var(--tkc-panel-muted)] text-[var(--tkc-cinnabar)] border-[color:var(--tkc-rule-m)]`}},defaultVariants:{variant:`default`}});function My({className:e,variant:t,...n}){return(0,K.jsx)(`span`,{className:Y(jy({variant:t}),e),...n})}function Ny({className:e,...t}){return(0,K.jsx)(`div`,{className:Y(`rounded-[8px] border border-[color:var(--tkc-rule)] bg-[var(--tkc-surface)] text-[var(--tkc-ink)] shadow-[inset_0_1px_0_rgba(255,255,255,.45),0_2px_0_var(--tkc-rule-m)] transition-all duration-200 hover:-translate-y-px hover:bg-[var(--tkc-surface-hover)]`,e),...t})}function Py({className:e,...t}){return(0,K.jsx)(`div`,{className:Y(`flex flex-col space-y-1.5 p-4`,e),...t})}function Fy({className:e,...t}){return(0,K.jsx)(`div`,{className:Y(`p-4 pt-0`,e),...t})}var Iy={totalCount:0,visibleCount:0,stateCounts:{draft:0,active:0,paused:0,disabled:0,archived:0},triggerCounts:{timer:0,webhook:0},executionCount:0,failureCount:0,failingCount:0},Ly=[`critical`,`high`,`medium`,`low`],Ry=[`manual`,`api`,`external-system`,`config-file`];function zy(e){return{name:``,triggerType:`timer`,cron:`0 9 * * 1-5`,timezone:`UTC`,webhookPort:`4100`,webhookPath:`/automations/incoming`,webhookAuthType:`none`,webhookToken:``,webhookSourceEvent:``,targetProjectId:e[0]?.projectId??``,templateTitle:``,templateSummary:``,templateDescription:``,templatePriority:`medium`,acceptanceCriteria:``,sourceKind:`manual`,sourceProvider:``,sourceExternalId:``,sourcePath:``}}function By(e){return{name:e.name,triggerType:e.trigger.type,cron:e.trigger.type===`timer`?e.trigger.cron:`0 9 * * 1-5`,timezone:e.trigger.type===`timer`?e.trigger.timezone??`UTC`:`UTC`,webhookPort:e.trigger.type===`webhook`?String(e.trigger.port):`4100`,webhookPath:e.trigger.type===`webhook`?e.trigger.path??``:`/automations/incoming`,webhookAuthType:e.trigger.type===`webhook`&&e.trigger.auth?.type===`bearer`?`bearer`:`none`,webhookToken:e.trigger.type===`webhook`&&e.trigger.auth?.type===`bearer`?e.trigger.auth.token:``,webhookSourceEvent:e.trigger.type===`webhook`?e.trigger.sourceEvent??``:``,targetProjectId:e.target.projectId,templateTitle:e.template.title,templateSummary:e.template.summary??``,templateDescription:e.template.description??``,templatePriority:e.template.priority??`medium`,acceptanceCriteria:(e.template.acceptanceCriteria??[]).join(`
|
|
63
|
+
`),sourceKind:e.source.kind,sourceProvider:e.source.provider??``,sourceExternalId:e.source.externalId??``,sourcePath:e.source.path??``}}function Vy(e){return e?new Date(e).toLocaleString():`Not yet triggered`}function Hy(e){switch(e){case`active`:return`success`;case`paused`:return`warning`;case`disabled`:return`error`;case`draft`:return`pending`;case`archived`:return`default`}return`default`}function Uy(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Wy(e){return e===`timer`?{label:`Timer`,icon:(0,K.jsx)(Rp,{className:`h-3.5 w-3.5`}),variant:`info`}:{label:`Webhook`,icon:(0,K.jsx)(Jm,{className:`h-3.5 w-3.5`}),variant:`warning`}}function Gy(e){switch(e){case`created`:return`success`;case`coalesced`:return`warning`;case`rejected`:return`error`}return`warning`}function Ky(e){switch(e){case`created`:return(0,K.jsx)(Pp,{className:`h-3.5 w-3.5`});case`coalesced`:return(0,K.jsx)(Wm,{className:`h-3.5 w-3.5`});case`rejected`:return(0,K.jsx)(Ip,{className:`h-3.5 w-3.5`})}}function qy(e,t){let n=e.metadata?.[t];return typeof n==`string`&&n.trim()?n.trim():void 0}function Jy(e){return qy(e,`triggerEventSummary`)??qy(e,`eventName`)??e.reason??(e.status===`created`?`Created work item`:`${Uy(e.status)} delivery`)}function Yy(e){let t=new URLSearchParams;e.issueId&&t.set(`issueId`,e.issueId),e.issueKey&&t.set(`issueKey`,e.issueKey);let n=t.toString(),r=`/projects/${encodeURIComponent(e.boardProjectId)}/board`;return n?`${r}?${n}`:r}function Xy(e){return e.trigger.type===`timer`?`${e.trigger.cron}${e.trigger.timezone?` · ${e.trigger.timezone}`:``}`:[`POST ${e.trigger.path||`/`}`,`:${e.trigger.port}`,e.trigger.sourceEvent?`event ${e.trigger.sourceEvent}`:null].filter(Boolean).join(` · `)}function Zy(e,t){return t.find(t=>t.projectId===e.target.projectId)}function Qy(e){let t=e.split(`
|
|
64
|
+
`).map(e=>e.trim()).filter(Boolean);return t.length>0?t:void 0}function $y(e,t){let n=t.find(t=>t.projectId===e.targetProjectId);if(!n)throw Error(`Select a target project before saving.`);let r={projectId:n.projectId,boardProjectId:n.boardProjectId},i=e.triggerType===`timer`?{type:`timer`,cron:e.cron.trim(),timezone:e.timezone.trim()||void 0}:{type:`webhook`,port:Number.parseInt(e.webhookPort,10),path:e.webhookPath.trim()||void 0,method:`POST`,auth:e.webhookAuthType===`bearer`?{type:`bearer`,token:e.webhookToken.trim()}:{type:`none`},sourceEvent:e.webhookSourceEvent.trim()||void 0},a={title:e.templateTitle.trim(),summary:e.templateSummary.trim()||void 0,description:e.templateDescription.trim()||void 0,priority:e.templatePriority,acceptanceCriteria:Qy(e.acceptanceCriteria)},o={kind:e.sourceKind,provider:e.sourceProvider.trim()||void 0,externalId:e.sourceExternalId.trim()||void 0,path:e.sourcePath.trim()||void 0};return{name:e.name.trim(),trigger:i,target:r,routing:{issue:{action:`canonical-issue-create`,projectId:r.projectId},board:{action:`shared-board-derive`,boardProjectId:r.boardProjectId},mutateBoardDirectly:!1},template:a,source:o}}async function eb(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Request failed: ${e.status}`);return t}function tb(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(()=>zy([])),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!0),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(!1),[f,p]=(0,y.useState)(null),[m,h]=(0,y.useState)(null);async function g(e){let n=e?.preserveForm??!1;l(!0),p(null);try{let e=await eb(await fetch(`/api/automations`));t(e),n?i||r(t=>({...t,targetProjectId:t.targetProjectId||e.targetOptions[0]?.projectId||``})):(r(zy(e.targetOptions)),a(null))}catch(e){p(e instanceof Error?e.message:String(e))}finally{s(!1),l(!1)}}(0,y.useEffect)(()=>{g()},[]);let _=e?.rules??[],v=e?.targetOptions??[],b=e?.summary??Iy,x=(0,y.useMemo)(()=>v.find(e=>e.projectId===n.targetProjectId),[n.targetProjectId,v]);function S(e,t){r(n=>({...n,[e]:t}))}function C(){a(null),r(zy(v)),p(null)}function w(e){a(e.id),r(By(e)),p(null)}async function T(e){e.preventDefault(),d(!0),p(null);try{let e=$y(n,v);await eb(await fetch(i?`/api/automations/${i}`:`/api/automations`,{method:i?`PATCH`:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...e,...i?{updatedBy:`operator`}:{createdBy:`operator`}})})),await g()}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}}async function E(e,t){h(`${t}:${e.id}`),p(null);try{t===`delete`?await eb(await fetch(`/api/automations/${e.id}`,{method:`DELETE`})):await eb(await fetch(`/api/automations/${e.id}/lifecycle`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:t,updatedBy:`operator`})})),await g({preserveForm:i!==null})}catch(e){p(e instanceof Error?e.message:String(e))}finally{h(null)}}return(0,K.jsxs)(dy,{children:[(0,K.jsxs)(fy,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Automation control plane`}),(0,K.jsx)(`h1`,{className:`mt-2 text-3xl font-semibold tracking-tight`,children:`Dedicated rule authoring and operational control`}),(0,K.jsx)(`p`,{className:`mt-3 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`Manage timer and webhook rules here so the board stays focused on generated work. This surface exposes lifecycle state, target routing, and automation authorship through the existing shared automation API.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,K.jsxs)(Q,{variant:`outline`,onClick:()=>void g({preserveForm:i!==null}),disabled:c,children:[(0,K.jsx)(Dm,{className:Y(`mr-2 h-4 w-4`,c&&`animate-spin`)}),`Refresh rules`]}),(0,K.jsx)(Q,{asChild:!0,variant:`ghost`,children:(0,K.jsx)(`a`,{href:`/projects`,children:`Back to board`})})]})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 md:grid-cols-7`,children:[(0,K.jsx)(nb,{label:`Visible rules`,value:String(b.visibleCount),tone:`info`}),(0,K.jsx)(nb,{label:`Active`,value:String(b.stateCounts.active),tone:`success`}),(0,K.jsx)(nb,{label:`Paused`,value:String(b.stateCounts.paused),tone:`warning`}),(0,K.jsx)(nb,{label:`Failing`,value:String(b.failingCount),tone:`error`}),(0,K.jsx)(nb,{label:`Timers`,value:String(b.triggerCounts.timer),tone:`info`}),(0,K.jsx)(nb,{label:`Webhooks`,value:String(b.triggerCounts.webhook),tone:`warning`}),(0,K.jsx)(nb,{label:`Failures`,value:String(b.failureCount),tone:`error`})]})]}),f?(0,K.jsx)(`section`,{className:`rounded-3xl border border-error/30 bg-error/10 p-4 text-sm text-error`,children:f}):null,(0,K.jsxs)(`div`,{className:`grid gap-6 xl:grid-cols-[minmax(0,0.95fr)_minmax(0,1.4fr)]`,children:[(0,K.jsxs)(Ny,{className:`rounded-3xl`,children:[(0,K.jsx)(Py,{className:`border-b border-border/70 pb-4`,children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.22em] text-primary/80`,children:i?`Edit rule`:`Create rule`}),(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:i?`Update an automation rule`:`Author a new automation rule`})]}),i?(0,K.jsx)(Q,{variant:`ghost`,onClick:C,children:`New rule`}):null]})}),(0,K.jsx)(Fy,{className:`pt-4`,children:(0,K.jsxs)(`form`,{className:`grid gap-4`,onSubmit:T,children:[(0,K.jsx)(rb,{label:`Rule name`,children:(0,K.jsx)(`input`,{value:n.name,onChange:e=>S(`name`,e.target.value),placeholder:`Daily digest triage`,className:`tkc-input`,required:!0})}),(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,K.jsx)(rb,{label:`Trigger type`,children:(0,K.jsxs)(`select`,{value:n.triggerType,onChange:e=>S(`triggerType`,e.target.value),className:`tkc-input`,children:[(0,K.jsx)(`option`,{value:`timer`,children:`Timer`}),(0,K.jsx)(`option`,{value:`webhook`,children:`Webhook`})]})}),(0,K.jsx)(rb,{label:`Target project`,children:(0,K.jsx)(`select`,{value:n.targetProjectId,onChange:e=>S(`targetProjectId`,e.target.value),className:`tkc-input`,required:!0,children:v.map(e=>(0,K.jsxs)(`option`,{value:e.projectId,children:[e.key,` · `,e.name]},e.projectId))})})]}),n.triggerType===`timer`?(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,K.jsx)(rb,{label:`Cron schedule`,children:(0,K.jsx)(`input`,{value:n.cron,onChange:e=>S(`cron`,e.target.value),placeholder:`0 9 * * 1-5`,className:`tkc-input font-mono`,required:!0})}),(0,K.jsx)(rb,{label:`Timezone`,children:(0,K.jsx)(`input`,{value:n.timezone,onChange:e=>S(`timezone`,e.target.value),placeholder:`UTC`,className:`tkc-input`})})]}):(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,K.jsx)(rb,{label:`Webhook port`,children:(0,K.jsx)(`input`,{type:`number`,value:n.webhookPort,onChange:e=>S(`webhookPort`,e.target.value),min:1,className:`tkc-input font-mono`,required:!0})}),(0,K.jsx)(rb,{label:`Webhook path`,children:(0,K.jsx)(`input`,{value:n.webhookPath,onChange:e=>S(`webhookPath`,e.target.value),placeholder:`/automations/incoming`,className:`tkc-input font-mono`})})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[(0,K.jsx)(rb,{label:`Auth`,children:(0,K.jsxs)(`select`,{value:n.webhookAuthType,onChange:e=>S(`webhookAuthType`,e.target.value),className:`tkc-input`,children:[(0,K.jsx)(`option`,{value:`none`,children:`None`}),(0,K.jsx)(`option`,{value:`bearer`,children:`Bearer token`})]})}),(0,K.jsx)(rb,{label:`Source event`,children:(0,K.jsx)(`input`,{value:n.webhookSourceEvent,onChange:e=>S(`webhookSourceEvent`,e.target.value),placeholder:`github.issue.created`,className:`tkc-input`})}),(0,K.jsx)(rb,{label:`HTTP method`,children:(0,K.jsx)(`input`,{value:`POST`,className:`tkc-input font-mono text-foreground-muted`,disabled:!0})})]}),n.webhookAuthType===`bearer`?(0,K.jsx)(rb,{label:`Bearer token`,children:(0,K.jsx)(`input`,{value:n.webhookToken,onChange:e=>S(`webhookToken`,e.target.value),placeholder:`secret-token`,className:`tkc-input font-mono`,required:!0})}):null]}),(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,K.jsx)(rb,{label:`Task title`,children:(0,K.jsx)(`input`,{value:n.templateTitle,onChange:e=>S(`templateTitle`,e.target.value),placeholder:`Review the daily digest`,className:`tkc-input`,required:!0})}),(0,K.jsx)(rb,{label:`Priority`,children:(0,K.jsx)(`select`,{value:n.templatePriority,onChange:e=>S(`templatePriority`,e.target.value),className:`tkc-input`,children:Ly.map(e=>(0,K.jsx)(`option`,{value:e,children:e},e))})})]}),(0,K.jsx)(rb,{label:`Task summary`,children:(0,K.jsx)(`input`,{value:n.templateSummary,onChange:e=>S(`templateSummary`,e.target.value),placeholder:`Create a triage issue on the shared board.`,className:`tkc-input`})}),(0,K.jsx)(rb,{label:`Task description`,children:(0,K.jsx)(`textarea`,{value:n.templateDescription,onChange:e=>S(`templateDescription`,e.target.value),placeholder:`Include operator instructions, expected routing, and follow-up notes.`,className:`tkc-input min-h-28 resize-y`})}),(0,K.jsx)(rb,{label:`Acceptance criteria`,children:(0,K.jsx)(`textarea`,{value:n.acceptanceCriteria,onChange:e=>S(`acceptanceCriteria`,e.target.value),placeholder:`Issue lands on the correct board
|
|
65
|
+
Owner sees routing metadata`,className:`tkc-input min-h-24 resize-y`})}),(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,K.jsx)(rb,{label:`Source kind`,children:(0,K.jsx)(`select`,{value:n.sourceKind,onChange:e=>S(`sourceKind`,e.target.value),className:`tkc-input`,children:Ry.map(e=>(0,K.jsx)(`option`,{value:e,children:e},e))})}),(0,K.jsx)(rb,{label:`Source provider`,children:(0,K.jsx)(`input`,{value:n.sourceProvider,onChange:e=>S(`sourceProvider`,e.target.value),placeholder:`github`,className:`tkc-input`})})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,K.jsx)(rb,{label:`Source external id`,children:(0,K.jsx)(`input`,{value:n.sourceExternalId,onChange:e=>S(`sourceExternalId`,e.target.value),placeholder:`digest-job`,className:`tkc-input`})}),(0,K.jsx)(rb,{label:`Source path`,children:(0,K.jsx)(`input`,{value:n.sourcePath,onChange:e=>S(`sourcePath`,e.target.value),placeholder:`configs/automations.yml`,className:`tkc-input font-mono`})})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background-secondary/50 p-4 text-sm text-foreground-muted`,children:[(0,K.jsx)(`p`,{className:`font-semibold text-foreground`,children:`Resolved routing`}),(0,K.jsxs)(`p`,{className:`mt-2`,children:[`Canonical issue create →`,(0,K.jsxs)(`span`,{className:`font-mono`,children:[` `,x?.projectId??`select a project`]})]}),(0,K.jsxs)(`p`,{className:`mt-1`,children:[`Shared board derive →`,(0,K.jsxs)(`span`,{className:`font-mono`,children:[` `,x?.boardProjectId??`select a board`]})]}),(0,K.jsx)(`p`,{className:`mt-1`,children:`Board mutation stays indirect so generated work still flows through issues.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,K.jsx)(Q,{type:`submit`,variant:`primary`,disabled:u||v.length===0,children:u?`Saving...`:i?`Save changes`:`Create rule`}),i?(0,K.jsx)(Q,{type:`button`,variant:`outline`,onClick:C,children:`Cancel edit`}):null]})]})})]}),(0,K.jsx)(`div`,{className:`grid gap-4`,children:o?(0,K.jsx)(Ny,{className:`rounded-3xl p-6 text-sm text-foreground-muted`,children:`Loading automation rules…`}):_.length===0?(0,K.jsx)(Ny,{className:`rounded-3xl p-6`,children:(0,K.jsx)(hy,{title:`No automation rules yet`,description:`Create a timer or webhook rule to route generated work into the board without crowding the dashboard.`})}):_.map(e=>{let t=Wy(e.triggerType),n=Zy(e,v);return(0,K.jsxs)(Ny,{className:`rounded-3xl`,children:[(0,K.jsx)(Py,{className:`border-b border-border/70 pb-4`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:e.name}),(0,K.jsx)(My,{variant:Hy(e.state),children:e.state}),e.executionSummary.isFailing?(0,K.jsx)(My,{variant:`error`,children:`failing`}):null,(0,K.jsxs)(My,{variant:t.variant,className:`gap-1`,children:[t.icon,t.label]})]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm text-foreground-muted`,children:Xy(e)})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(Q,{variant:`outline`,onClick:()=>w(e),children:`Edit`}),e.allowedActions.map(t=>(0,K.jsx)(ob,{action:t,disabled:m===`${t}:${e.id}`,onClick:()=>void E(e,t)},t))]})]})}),(0,K.jsxs)(Fy,{className:`grid gap-4 pt-4 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`,children:[(0,K.jsx)(ib,{title:`Target routing`,icon:(0,K.jsx)(Sp,{className:`h-4 w-4`}),lines:[`${n?.key??`UNK`} · ${n?.name??e.target.projectId}`,`Issue target: ${e.routing.issue.projectId}`,`Board target: ${e.routing.board.boardProjectId}`,n?.linkedRunProjectName?`Linked run project: ${n.linkedRunProjectName}`:`Project id: ${e.target.projectId}`]}),(0,K.jsx)(ib,{title:`Operational state`,icon:(0,K.jsx)(Fm,{className:`h-4 w-4`}),lines:[`State: ${e.executionSummary.isFailing?`${e.state} · failing`:e.state}`,`Allowed actions: ${e.allowedActions.join(`, `)}`,`Created: ${Vy(e.audit.createdAt)}`,`Updated: ${Vy(e.audit.updatedAt)}`,`Last triggered: ${Vy(e.audit.lastTriggeredAt)}`,`Last failure: ${Vy(e.executionSummary.lastFailureAt)}`]}),(0,K.jsx)(ib,{title:`Template payload`,lines:[e.template.title,e.template.summary??`No summary`,`Priority: ${e.template.priority??`medium`}`,e.template.acceptanceCriteria?.length?`Acceptance: ${e.template.acceptanceCriteria.join(` · `)}`:`Acceptance: none`]}),(0,K.jsx)(ib,{title:`Source metadata`,lines:[`Kind: ${e.source.kind}`,`Provider: ${e.source.provider??`n/a`}`,`External id: ${e.source.externalId??`n/a`}`,`Path: ${e.source.path??`n/a`}`]}),(0,K.jsx)(ab,{rule:e})]})]},e.id)})})]})]})}function nb(e){return(0,K.jsxs)(`div`,{className:Y(`rounded-2xl border px-4 py-4 shadow-sm`,e.tone===`success`&&`border-success/20 bg-success/10`,e.tone===`warning`&&`border-warning/20 bg-warning/10`,e.tone===`info`&&`border-info/20 bg-info/10`,e.tone===`error`&&`border-error/20 bg-error/10`),children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.22em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`p`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:e.value})]})}function rb(e){return(0,K.jsxs)(`label`,{className:`grid gap-2 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:e.label}),e.children]})}function ib(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border/70 bg-background-secondary/45 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.22em] text-foreground-muted`,children:[e.icon,e.title]}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-2 text-sm text-foreground-muted`,children:e.lines.map(e=>(0,K.jsx)(`p`,{children:e},e))})]})}function ab(e){return(0,K.jsxs)(`div`,{className:`lg:col-span-2 rounded-2xl border border-border/70 bg-background-secondary/45 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.22em] text-foreground-muted`,children:[(0,K.jsx)(Fm,{className:`h-4 w-4`}),`Recent deliveries`]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(My,{variant:`default`,children:[e.rule.executionSummary.totalCount,` total`]}),(0,K.jsxs)(My,{variant:`success`,children:[e.rule.executionSummary.createdCount,` created`]}),(0,K.jsxs)(My,{variant:`warning`,children:[e.rule.executionSummary.coalescedCount,` coalesced`]}),(0,K.jsxs)(My,{variant:`error`,children:[e.rule.executionSummary.rejectedCount,` rejected`]})]})]}),e.rule.recentExecutions.length===0?(0,K.jsx)(`p`,{className:`mt-3 text-sm text-foreground-muted`,children:`No deliveries have been recorded for this rule yet.`}):(0,K.jsx)(`div`,{className:`mt-4 grid gap-3`,children:e.rule.recentExecutions.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(My,{variant:Gy(e.status),className:`gap-1`,children:[Ky(e.status),e.status]}),(0,K.jsxs)(My,{variant:e.triggerType===`timer`?`info`:`warning`,className:`gap-1`,children:[e.triggerType===`timer`?(0,K.jsx)(Rp,{className:`h-3.5 w-3.5`}):(0,K.jsx)(Jm,{className:`h-3.5 w-3.5`}),e.triggerType]}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:Vy(e.triggeredAt)})]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm font-medium text-foreground`,children:Jy(e)}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-3 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{children:[`Actor: `,e.triggeredBy]}),e.deliveryId?(0,K.jsxs)(`span`,{children:[`Delivery: `,e.deliveryId]}):null,qy(e,`triggerEventSource`)?(0,K.jsxs)(`span`,{children:[`Event: `,qy(e,`triggerEventSource`)]}):null]})]}),e.issueId?(0,K.jsx)(Q,{asChild:!0,variant:`outline`,children:(0,K.jsxs)(Z,{href:Yy(e),children:[e.issueKey??e.issueId,(0,K.jsx)(Hp,{className:`ml-2 h-4 w-4`})]})}):null]}),e.reason?(0,K.jsx)(`p`,{className:`mt-3 text-sm text-foreground-muted`,children:e.reason}):null]},e.id))})]})}function ob(e){let t=(()=>{switch(e.action){case`enable`:case`resume`:return{icon:(0,K.jsx)(Sm,{className:`mr-2 h-4 w-4`}),label:e.action===`enable`?`Enable`:`Resume`,variant:`outline`};case`pause`:return{icon:(0,K.jsx)(ym,{className:`mr-2 h-4 w-4`}),label:`Pause`,variant:`outline`};case`disable`:return{icon:(0,K.jsx)(wm,{className:`mr-2 h-4 w-4`}),label:`Disable`,variant:`ghost`};case`delete`:return{icon:(0,K.jsx)(wm,{className:`mr-2 h-4 w-4`}),label:`Delete`,variant:`ghost`}}})();return(0,K.jsxs)(Q,{type:`button`,variant:t.variant,onClick:e.onClick,disabled:e.disabled,children:[t.icon,t.label]})}function sb(){return(0,K.jsx)(tb,{})}var cb=(0,y.createContext)(null);function lb(){return(0,y.useContext)(cb)||{theme:`dark`,toggle:()=>void 0}}function ub(){return{key:``,label:``,description:``,instruction:``}}var db=[{id:`general`,title:`General`,summary:`Local Babysitter framing, config locations, theme, gateway access, and runtime overview.`,icon:yp},{id:`repositories-projects`,title:`Repositories & Projects`,summary:`Project policy, linked repositories, and dispatch-context definitions.`,icon:Dp},{id:`organization`,title:`Organization`,summary:`Team, visibility, default roles, and shared permission context.`,icon:Km},{id:`remote-project`,title:`Remote Projects`,summary:`Host/org/project binding state and blocked-action guidance per provider.`,icon:gm},{id:`agent-configuration`,title:`Agent Configuration`,summary:`Default model/provider settings with validation-aware save behavior.`,icon:Vp},{id:`mcp-servers`,title:`MCP Servers`,summary:`Per-agent MCP transport definitions with draft preservation and validation.`,icon:jm},{id:`editor-integration`,title:`Editor Integration`,summary:`Workspace-first editing flow, command-bar shortcuts, and session handoff guidance.`,icon:Dp},{id:`git`,title:`Git`,summary:`Branch defaults, review policy, auto-merge posture, and provider readiness context.`,icon:Pm},{id:`notifications`,title:`Notifications`,summary:`In-app alerts, browser permission state, and breakpoint/run attention behavior.`,icon:yp},{id:`task-tags`,title:`Task Tags`,summary:`Reusable @ snippets kept as a first-class settings surface.`,icon:Dp},{id:`keyboard-shortcuts`,title:`Keyboard Shortcuts`,summary:`Current shortcut groups for dashboard, runs, and session workspaces.`,icon:Vp}],fb=`~/.a5c/kanban.json`,pb=`~/.a5c/kanban-settings-sections.json`;function mb(){return{status:`idle`,data:null,error:null}}function hb(e){let t=e.trim();if(!t.startsWith(`{`))return e;try{let n=JSON.parse(t);return typeof n.error==`string`&&n.error.length>0?n.error:e}catch{return e}}function gb(e){return{...e,configuredModel:e.configuredModel??``,configuredProvider:e.configuredProvider??``,maxTokens:e.maxTokens??``}}function _b(e){return{name:e.name.trim(),transport:e.transport,command:e.command.trim(),url:e.url.trim(),argsText:e.argsText.trim(),envText:e.envText.trim()}}function vb(e){return[...e].sort((e,t)=>e.fullName.localeCompare(t.fullName))}function yb(e,t){return e?{reviewRequiredForDone:e.settings.reviewRequiredForDone,activityScope:e.settings.activityScope,workspaceProvisioning:e.settings.workspaceProvisioning,repositories:vb(e.repositories.map(e=>({id:e.id,fullName:e.fullName,linkedIssueId:t.find(t=>t.repositoryLifecycle?.repositoryId===e.id)?.id??null,baseBranch:e.settings.baseBranch,ciProvider:e.settings.ciProvider??``,publishTarget:e.settings.publishTarget??``,autoMerge:e.settings.autoMerge,requiredApprovals:e.settings.requiredApprovals})))}:null}function bb(e){return e?{teamName:e.team.name,visibility:e.team.settings.visibility,defaultRole:e.team.settings.defaultRole,allowSelfAssign:e.team.settings.allowSelfAssign}:null}async function xb(){let e=await uh(`/api/settings/agent-configuration`);if(!e.ok)throw Error(hb(e.error.message));return{agents:e.data.agents.map(gb)}}async function Sb(e){let t=await uh(`/api/settings/agent-configuration`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(hb(t.error.message));return{agents:t.data.agents.map(gb)}}async function Cb(){let e=await uh(`/api/settings/mcp-servers`);if(!e.ok)throw Error(hb(e.error.message));return{agents:e.data.agents.map(e=>({...e,servers:e.servers.map(_b)}))}}async function wb(e){let t=await uh(`/api/settings/mcp-servers`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({agent:e.agent,servers:e.servers.map(_b)})});if(!t.ok)throw Error(hb(t.error.message));return{agents:t.data.agents.map(e=>({...e,servers:e.servers.map(_b)}))}}function Tb(e,t){return JSON.stringify(e)!==JSON.stringify(t)}function Eb(){let{theme:e}=lb(),{auth:t,logout:n,isAuthenticated:r}=dd(),{notifications:i,permission:a,requestPermission:o}=_h(),{snapshot:s,refresh:c,loading:l,error:u,updateProjectCollaboration:d,updateRepositorySettings:f}=sy(),p=s?.projects[0],m=s?.dispatchContextLabels??[],h=s?.issues??[],[g,_]=(0,y.useState)(`general`),[v,b]=(0,y.useState)(null),[x,S]=(0,y.useState)(null),[C,w]=(0,y.useState)(null),[T,E]=(0,y.useState)(null),[D,O]=(0,y.useState)(null),[k,A]=(0,y.useState)(null),[j,M]=(0,y.useState)(!1),[N,P]=(0,y.useState)(!1),[F,I]=(0,y.useState)(null),[L,R]=(0,y.useState)(null),[z,ee]=(0,y.useState)(null),[te,ne]=(0,y.useState)(null),[re,ie]=(0,y.useState)(mb()),[ae,oe]=(0,y.useState)({}),[se,ce]=(0,y.useState)({}),[le,ue]=(0,y.useState)(null),[de,fe]=(0,y.useState)(!1),[pe,me]=(0,y.useState)(null),[he,ge]=(0,y.useState)(null),[_e,ve]=(0,y.useState)(mb()),[ye,be]=(0,y.useState)({}),[xe,B]=(0,y.useState)({}),[Se,Ce]=(0,y.useState)(null),[we,Te]=(0,y.useState)(!1),[Ee,V]=(0,y.useState)(null),[De,Oe]=(0,y.useState)(null),ke=T?.repositories.find(e=>e.id===x)??T?.repositories[0]??null,Ae=T?.repositories.length??p?.repositories.length??0,je=T?.repositories.filter(e=>e.autoMerge).length??p?.repositories.filter(e=>e.settings.autoMerge).length??0;p?.integrations.length;let Me=p?.integrations.filter(e=>e.prerequisites.some(e=>!e.satisfied)).length??0,Ne=p?.integrations.filter(e=>e.status===`connected`).length??0,Pe=Object.entries(Vv.reduce((e,t)=>((e[t.context]??=[]).push(t),e),{})),Fe=Vv.filter(e=>e.context===`session-workspace`),Ie=a===`granted`?`Browser notifications allowed`:a===`denied`?`Browser notifications blocked`:`Browser notification permission pending`;(0,y.useEffect)(()=>{let e=yb(p,h);(!Tb(C,T)&&Tb(C,e)||C===null)&&(w(e),E(e))},[h,p,C,T]),(0,y.useEffect)(()=>{let e=bb(p);(!Tb(D,k)&&Tb(D,e)||D===null)&&(O(e),A(e))},[D,k,p]),(0,y.useEffect)(()=>{T?.repositories.length&&!x&&S(T.repositories[0].id),x&&T?.repositories.every(e=>e.id!==x)&&S(T.repositories[0]?.id??null)},[T,x]),(0,y.useEffect)(()=>{g!==`agent-configuration`||re.status!==`idle`||(ie({status:`loading`,data:null,error:null}),xb().then(e=>{ie({status:`ready`,data:e,error:null});let t=Object.fromEntries(e.agents.map(e=>[e.agent,e]));oe(t),ce(t),ue(t=>t??e.agents[0]?.agent??null)}).catch(e=>{ie({status:`error`,data:null,error:e instanceof Error?e.message:`Failed to load agent configuration.`})}))},[re.status,g]),(0,y.useEffect)(()=>{g!==`mcp-servers`||_e.status!==`idle`||(ve({status:`loading`,data:null,error:null}),Cb().then(e=>{ve({status:`ready`,data:e,error:null});let t=Object.fromEntries(e.agents.map(e=>[e.agent,e.servers.map(_b)]));be(t),B(t),Ce(t=>t??e.agents[0]?.agent??null)}).catch(e=>{ve({status:`error`,data:null,error:e instanceof Error?e.message:`Failed to load MCP servers.`})}))},[_e.status,g]);let Le=Tb(C,T),Re=Tb(D,k),ze=JSON.stringify(ae)!==JSON.stringify(se),Be=JSON.stringify(ye)!==JSON.stringify(xe),Ve=g===`repositories-projects`&&Le||g===`organization`&&Re||g===`agent-configuration`&&ze||g===`mcp-servers`&&Be;function He(e){if(e!==g){if(Ve){b(e);return}_(e),b(null)}}function Ue(){g===`repositories-projects`&&(E(C),ee(null),I(null)),g===`organization`&&(A(D),ne(null),R(null)),g===`agent-configuration`&&(ce(ae),me(null),ge(null)),g===`mcp-servers`&&(B(ye),V(null),Oe(null)),v&&(_(v),b(null))}async function We(){if(!(!p||!T||!C)){M(!0),ee(null),I(null);try{(T.reviewRequiredForDone!==C.reviewRequiredForDone||T.activityScope!==C.activityScope||T.workspaceProvisioning!==C.workspaceProvisioning)&&await d({projectId:p.id,teamName:p.team.name,visibility:p.team.settings.visibility,defaultRole:p.team.settings.defaultRole,allowSelfAssign:p.team.settings.allowSelfAssign,reviewRequiredForDone:T.reviewRequiredForDone,activityScope:T.activityScope,workspaceProvisioning:T.workspaceProvisioning,members:p.team.members.map(e=>({id:e.id,displayName:e.displayName,email:e.email,role:e.role})),permissions:p.permissions.map(e=>({action:e.action,description:e.description,roles:[...e.roles]}))});for(let e of T.repositories){let t=C.repositories.find(t=>t.id===e.id);if(t&&JSON.stringify(e)!==JSON.stringify(t)){if(!e.linkedIssueId)throw Error(`Repository ${e.fullName} is missing the linked issue/work item context required for persistence.`);await f({issueId:e.linkedIssueId,baseBranch:e.baseBranch,ciProvider:e.ciProvider||void 0,publishTarget:e.publishTarget||void 0,autoMerge:e.autoMerge,requiredApprovals:e.requiredApprovals})}}await c(),w(T),E(T),I(`Saved repositories/projects settings.`)}catch(e){ee(e instanceof Error?e.message:`Failed to save repositories/projects settings.`)}finally{M(!1)}}}async function Ge(){if(!(!p||!k)){P(!0),ne(null),R(null);try{await d({projectId:p.id,teamName:k.teamName,visibility:k.visibility,defaultRole:k.defaultRole,allowSelfAssign:k.allowSelfAssign,reviewRequiredForDone:p.settings.reviewRequiredForDone,activityScope:p.settings.activityScope,workspaceProvisioning:p.settings.workspaceProvisioning,members:p.team.members.map(e=>({id:e.id,displayName:e.displayName,email:e.email,role:e.role})),permissions:p.permissions.map(e=>({action:e.action,description:e.description,roles:[...e.roles]}))}),await c(),O(k),A(k),R(`Saved organization settings.`)}catch(e){ne(e instanceof Error?e.message:`Failed to save organization settings.`)}finally{P(!1)}}}async function Ke(){if(!le||!se[le])return;let e=se[le];fe(!0),me(null),ge(null);try{let t=await Sb({agent:le,model:e.configuredModel,provider:e.configuredProvider,approvalMode:e.approvalMode,maxTokens:e.maxTokens}),n=Object.fromEntries(t.agents.map(e=>[e.agent,e]));ie({status:`ready`,data:t,error:null}),oe(n),ce(n),ge(`Saved agent configuration for ${le}.`)}catch(e){me(e instanceof Error?e.message:`Failed to save agent configuration.`)}finally{fe(!1)}}async function qe(){if(Se){Te(!0),V(null),Oe(null);try{let e=await wb({agent:Se,servers:xe[Se]??[]}),t=Object.fromEntries(e.agents.map(e=>[e.agent,e.servers.map(_b)]));ve({status:`ready`,data:e,error:null}),be(t),B(t),Oe(`Saved MCP server settings for ${Se}.`)}catch(e){V(e instanceof Error?e.message:`Failed to save MCP servers.`)}finally{Te(!1)}}}return(0,K.jsxs)(dy,{children:[(0,K.jsxs)(fy,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Settings`}),(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(Bd,{className:`h-6 w-auto`})}),(0,K.jsx)(`h1`,{className:`mt-2 text-3xl font-semibold tracking-tight`,children:`Settings breadth parity`}),(0,K.jsx)(`p`,{className:`mt-2 max-w-4xl text-sm leading-6 text-foreground-muted`,children:`The local kanban settings surface keeps its Babysitter-specific framing while expanding to the broader upstream settings breadth: general preferences, repositories/projects, organization, remote-project bindings, agents, MCP, editor integration, git, notifications, task tags, and keyboard shortcuts all live as explicit sections.`})]}),(0,K.jsxs)(`div`,{className:`grid gap-6 xl:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,K.jsxs)(`aside`,{className:`rounded-3xl border border-border bg-card p-4 shadow-lg`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-foreground-muted`,children:`Settings sections`}),(0,K.jsx)(`div`,{className:`mt-4 space-y-2`,children:db.map(e=>{let t=e.icon,n=e.id===g;return(0,K.jsxs)(`button`,{type:`button`,"data-testid":`settings-nav-${e.id}`,onClick:()=>He(e.id),className:[`w-full rounded-2xl border px-4 py-3 text-left transition`,n?`border-primary/30 bg-primary/10`:`border-border bg-background/60 hover:bg-background`].join(` `),children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(t,{className:`h-4 w-4`}),e.title]}),(0,K.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-foreground-muted`,children:e.summary})]},e.id)})})]}),(0,K.jsxs)(`div`,{className:`space-y-6`,children:[v?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,"data-testid":`settings-dirty-switch-guard`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(Wm,{className:`mt-0.5 h-4 w-4 text-amber-500`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`div`,{className:`font-semibold text-foreground`,children:`Unsaved changes are still open.`}),(0,K.jsx)(`div`,{className:`mt-1 text-foreground-muted`,children:`Switching sections now would drop the current draft. Discard the draft or stay on the current section.`})]})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(Q,{type:`button`,variant:`primary`,onClick:Ue,children:`Discard changes`}),(0,K.jsx)(Q,{type:`button`,variant:`ghost`,onClick:()=>b(null),children:`Keep editing`})]})]}):null,g===`general`?(0,K.jsxs)(`section`,{className:`space-y-6`,"data-testid":`general-settings`,children:[(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`max-w-3xl`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`General settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`This local surface stays opinionated for Babysitter workflows: filesystem-backed config, gateway connectivity, live runs, and app theme are treated as first-class operator preferences instead of being hidden behind a runtime-only modal.`})]}),(0,K.jsxs)(`div`,{className:`grid min-w-[240px] gap-3 sm:grid-cols-2`,children:[(0,K.jsx)($,{label:`Theme`,value:e}),(0,K.jsx)($,{label:`Gateway`,value:t?.gatewayUrl??`not connected`}),(0,K.jsx)($,{label:`Notifications`,value:Ie}),(0,K.jsx)($,{label:`Config files`,value:`2 local files`})]})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)]`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Local runtime framing`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,K.jsx)($,{label:`Kanban config`,value:fb}),(0,K.jsx)($,{label:`Section storage`,value:pb}),(0,K.jsx)($,{label:`Saved access`,value:t?`configured`:`missing`}),(0,K.jsx)($,{label:`Linked repos`,value:String(Ae)})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(Q,{asChild:!0,variant:`primary`,children:(0,K.jsx)(Z,{href:`/login`,children:r?`Reconnect gateway`:`Connect gateway`})}),r?(0,K.jsx)(Q,{onClick:n,variant:`ghost`,type:`button`,children:`Forget access`}):null]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Breadth without losing local voice`}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`p`,{children:`Repositories, organization, remote-project bindings, agent configuration, MCP servers, editor integration, git, notifications, task tags, and keyboard shortcuts are all navigable here.`}),(0,K.jsx)(`p`,{children:`The local package still centers Babysitter operations: linked repository defaults, workspace-driven editing, run attention, and filesystem-backed configuration remain visible instead of being flattened into generic settings copy.`})]})]})]})]}),(0,K.jsx)(Wb,{})]}):null,g===`repositories-projects`?(0,K.jsxs)(`section`,{className:`space-y-6`,"data-testid":`repositories-projects-settings`,children:[(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`max-w-3xl`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Repositories and projects`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Shared project policy and linked repository defaults live here, alongside the reusable authoring surfaces that stay tied to project execution context.`})]}),(0,K.jsxs)(`div`,{className:`grid min-w-[220px] gap-3 sm:grid-cols-2`,children:[(0,K.jsx)($,{label:`Projects`,value:String(s?.projects.length??0)}),(0,K.jsx)($,{label:`Linked repos`,value:String(T?.repositories.length??0)})]})]}),l?(0,K.jsx)(Db,{text:`Loading repositories and project settings…`}):u?(0,K.jsx)(kb,{title:`Failed to load project settings`,message:u}):!T||!p?(0,K.jsx)(Ob,{title:`Project context is missing`,message:`No local kanban project snapshot is available yet, so repository and project settings cannot be edited.`}):(0,K.jsxs)(`div`,{className:`mt-5 space-y-5`,children:[z?(0,K.jsx)(Ab,{message:z}):null,F?(0,K.jsx)(jb,{message:F}):null,(0,K.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-[minmax(0,340px)_minmax(0,1fr)]`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Project policy`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4`,children:[(0,K.jsx)(Ib,{label:`Review required before done`,checked:T.reviewRequiredForDone,onChange:e=>E(t=>t&&{...t,reviewRequiredForDone:e})}),(0,K.jsx)(Fb,{label:`Activity scope`,value:T.activityScope,onChange:e=>E(t=>t&&{...t,activityScope:e}),options:[{value:`project-and-issues`,label:`Project and issues`},{value:`all-board-entities`,label:`All board entities`}]}),(0,K.jsx)(Fb,{label:`Workspace provisioning`,value:T.workspaceProvisioning,onChange:e=>E(t=>t&&{...t,workspaceProvisioning:e}),options:[{value:`owners-maintainers`,label:`Owners and maintainers`},{value:`contributors-and-up`,label:`Contributors and up`}]})]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Repository defaults`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Each repository persists through the existing issue-linked mutation seam, so missing work-item context is called out explicitly.`})]}),(0,K.jsx)(`select`,{"aria-label":`Repository selector`,value:x??``,onChange:e=>S(e.target.value),className:`h-10 rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:T.repositories.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.fullName},e.id))})]}),T.repositories.length===0?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-dashed border-border bg-card px-4 py-4 text-sm text-foreground-muted`,children:`No linked repositories exist yet.`}):ke?(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4`,children:[ke.linkedIssueId?null:(0,K.jsx)(`div`,{className:`rounded-2xl border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-foreground`,"data-testid":`missing-project-context`,children:`This repository is visible in the snapshot, but there is no linked issue/work item available to persist repository settings through the current kanban API seam.`}),(0,K.jsx)(Mb,{label:`Base branch`,value:ke.baseBranch,onChange:e=>E(t=>t&&{...t,repositories:t.repositories.map(t=>t.id===ke.id?{...t,baseBranch:e}:t)})}),(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,K.jsx)(Mb,{label:`CI provider`,value:ke.ciProvider,onChange:e=>E(t=>t&&{...t,repositories:t.repositories.map(t=>t.id===ke.id?{...t,ciProvider:e}:t)})}),(0,K.jsx)(Mb,{label:`Publish target`,value:ke.publishTarget,onChange:e=>E(t=>t&&{...t,repositories:t.repositories.map(t=>t.id===ke.id?{...t,publishTarget:e}:t)})})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,K.jsx)(Ib,{label:`Auto merge`,checked:ke.autoMerge,onChange:e=>E(t=>t&&{...t,repositories:t.repositories.map(t=>t.id===ke.id?{...t,autoMerge:e}:t)})}),(0,K.jsx)(Pb,{label:`Required approvals`,value:ke.requiredApprovals,min:0,onChange:e=>E(t=>t&&{...t,repositories:t.repositories.map(t=>t.id===ke.id?{...t,requiredApprovals:Math.max(0,e)}:t)})})]})]},ke.id):null]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(Q,{type:`button`,variant:`primary`,onClick:()=>void We(),disabled:j||!Le,children:j?`Saving…`:`Save repositories/projects`}),(0,K.jsx)(Q,{type:`button`,variant:`ghost`,onClick:()=>{E(C),ee(null),I(null)},disabled:!Le||j,children:`Discard changes`})]})]})]}),(0,K.jsx)(Ub,{dispatchContextLabels:m,issues:h,onRefresh:c})]}):null,g===`organization`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`organization-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Organization settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Team identity, visibility, default role, and roster policy are treated as a separate organization section instead of being buried in the default settings body.`}),l?(0,K.jsx)(Db,{text:`Loading organization settings…`}):u?(0,K.jsx)(kb,{title:`Failed to load organization settings`,message:u}):!p||!k?(0,K.jsx)(Ob,{title:`Organization context is missing`,message:`No project/team data is available in the local backlog snapshot.`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 lg:grid-cols-3`,children:[(0,K.jsx)($,{label:`Team`,value:`${p.team.name} (${p.team.members.length} members)`}),(0,K.jsx)($,{label:`Visibility`,value:`${p.team.settings.visibility} / default ${p.team.settings.defaultRole}`}),(0,K.jsx)($,{label:`Workspace policy`,value:p.settings.workspaceProvisioning})]}),te?(0,K.jsx)(Ab,{message:te}):null,L?(0,K.jsx)(jb,{message:L}):null,(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[minmax(0,360px)_minmax(0,1fr)]`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Organization policy`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4`,children:[(0,K.jsx)(Mb,{label:`Team name`,value:k.teamName,onChange:e=>A(t=>t&&{...t,teamName:e})}),(0,K.jsx)(Fb,{label:`Visibility`,value:k.visibility,onChange:e=>A(t=>t&&{...t,visibility:e}),options:[{value:`private`,label:`Private`},{value:`team`,label:`Team`},{value:`workspace-shared`,label:`Workspace shared`}]}),(0,K.jsx)(Fb,{label:`Default role`,value:k.defaultRole,onChange:e=>A(t=>t&&{...t,defaultRole:e}),options:[{value:`owner`,label:`Owner`},{value:`maintainer`,label:`Maintainer`},{value:`contributor`,label:`Contributor`},{value:`viewer`,label:`Viewer`}]}),(0,K.jsx)(Ib,{label:`Allow self assign`,checked:k.allowSelfAssign,onChange:e=>A(t=>t&&{...t,allowSelfAssign:e})})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(Q,{type:`button`,variant:`primary`,onClick:()=>void Ge(),disabled:!Re||N,children:N?`Saving…`:`Save organization`}),(0,K.jsx)(Q,{type:`button`,variant:`ghost`,onClick:()=>{A(D),ne(null),R(null)},disabled:!Re||N,children:`Discard changes`})]})]}),(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Km,{className:`h-4 w-4`}),`Team roster`]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:p.team.members.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl border border-border bg-card px-3 py-2 text-sm`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.displayName}),(0,K.jsx)(`div`,{className:`text-xs text-foreground-muted`,children:e.email??e.id})]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:e.role})]},e.id))})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Pm,{className:`h-4 w-4`}),`Permission policy`]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:p.permissions.map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-3 py-3 text-sm`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.action}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:e.description}),(0,K.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:e.roles.map(t=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:t},`${e.action}-${t}`))})]},e.action))})]})]})]})]})]}):null,g===`remote-project`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`remote-project-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Remote-project settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Remote host, organization, and project binding state is surfaced explicitly so linked PR and review failures are explainable before operators leave the page.`}),l?(0,K.jsx)(Db,{text:`Loading remote-project settings…`}):u?(0,K.jsx)(kb,{title:`Failed to load remote-project settings`,message:u}):p?p.integrations.length===0?(0,K.jsx)(Ob,{title:`Host context is missing`,message:`No remote host integrations are configured for this project yet.`}):(0,K.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[p.integrations.some(e=>e.prerequisites.some(e=>!e.satisfied))?(0,K.jsx)(`div`,{className:`rounded-2xl border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-foreground`,"data-testid":`missing-host-context`,children:`One or more remote hosts are missing organization or project binding prerequisites. Fix those prerequisites before relying on linked PR actions.`}):null,(0,K.jsx)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:p.integrations.map(e=>(0,K.jsx)(Kb,{integration:e},e.provider))})]}):(0,K.jsx)(Ob,{title:`Project context is missing`,message:`Remote-project bindings depend on a loaded project snapshot.`})]}):null,g===`agent-configuration`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`agent-configuration-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Agent configuration`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Default model, provider, approval mode, and token limits are validated and saved as a distinct section with its own loading and retry behavior.`}),re.status===`loading`||re.status===`idle`?(0,K.jsx)(Db,{text:`Loading agent configuration…`}):re.status===`error`?(0,K.jsx)(kb,{title:`Failed to load agent configuration`,message:re.error??`Unknown error`}):!re.data||re.data.agents.length===0?(0,K.jsx)(Ob,{title:`No agent configuration is available`,message:`No agent definitions were returned for this settings surface.`}):(0,K.jsxs)(K.Fragment,{children:[pe?(0,K.jsx)(Ab,{message:pe}):null,he?(0,K.jsx)(jb,{message:he}):null,(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[220px_minmax(0,1fr)]`,children:[(0,K.jsx)(`div`,{className:`space-y-2`,children:re.data.agents.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>ue(e.agent),className:[`w-full rounded-2xl border px-4 py-3 text-left`,le===e.agent?`border-primary/30 bg-primary/10`:`border-border bg-background/60`].join(` `),children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e.displayName}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[`default `,e.defaultModel||`unconfigured`]})]},e.agent))}),le&&se[le]?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[(0,K.jsx)(Mb,{label:`Model`,value:se[le].configuredModel,onChange:e=>ce(t=>({...t,[le]:{...t[le],configuredModel:e}})),listId:`agent-models-${le}`}),(0,K.jsx)(`datalist`,{id:`agent-models-${le}`,children:se[le].availableModels.map(e=>(0,K.jsx)(`option`,{value:e.modelId},e.modelId))}),(0,K.jsx)(Mb,{label:`Provider`,value:se[le].configuredProvider,onChange:e=>ce(t=>({...t,[le]:{...t[le],configuredProvider:e}}))}),(0,K.jsx)(Fb,{label:`Approval mode`,value:se[le].approvalMode,onChange:e=>ce(t=>({...t,[le]:{...t[le],approvalMode:e}})),options:[{value:`prompt`,label:`Prompt`},{value:`yolo`,label:`Yolo`},{value:`deny`,label:`Deny`}]}),(0,K.jsx)(Mb,{label:`Max tokens`,value:se[le].maxTokens,onChange:e=>ce(t=>({...t,[le]:{...t[le],maxTokens:e}}))})]}),(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card px-4 py-3 text-xs text-foreground-muted`,children:[`Known models:`,` `,se[le].availableModels.map(e=>e.deprecated&&e.successorModelId?`${e.modelId} -> ${e.successorModelId}`:e.modelId).join(`, `)]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(Q,{type:`button`,variant:`primary`,onClick:()=>void Ke(),disabled:!ze||de,children:de?`Saving…`:`Save agent configuration`}),(0,K.jsx)(Q,{type:`button`,variant:`ghost`,onClick:()=>{ce(ae),me(null),ge(null)},disabled:!ze||de,children:`Discard changes`})]})]}):null]})]})]}):null,g===`mcp-servers`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`mcp-server-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`MCP server settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Per-agent MCP transport definitions are edited as structured drafts so invalid entries fail safely without wiping the current form state.`}),_e.status===`loading`||_e.status===`idle`?(0,K.jsx)(Db,{text:`Loading MCP server settings…`}):_e.status===`error`?(0,K.jsx)(kb,{title:`Failed to load MCP server settings`,message:_e.error??`Unknown error`}):!_e.data||_e.data.agents.length===0?(0,K.jsx)(Ob,{title:`No MCP server settings are available`,message:`No agents were returned for the MCP settings section.`}):(0,K.jsxs)(K.Fragment,{children:[Ee?(0,K.jsx)(Ab,{message:Ee}):null,De?(0,K.jsx)(jb,{message:De}):null,(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[220px_minmax(0,1fr)]`,children:[(0,K.jsx)(`div`,{className:`space-y-2`,children:_e.data.agents.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>Ce(e.agent),className:[`w-full rounded-2xl border px-4 py-3 text-left`,Se===e.agent?`border-primary/30 bg-primary/10`:`border-border bg-background/60`].join(` `),children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e.displayName}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[(xe[e.agent]??[]).length,` server(s)`]})]},e.agent))}),Se?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`text-sm font-semibold text-foreground`,children:[`MCP definitions for `,Se]}),(0,K.jsx)(Q,{type:`button`,variant:`ghost`,onClick:()=>B(e=>({...e,[Se]:[...e[Se]??[],{name:``,transport:`stdio`,command:``,url:``,argsText:``,envText:``}]})),children:`Add server`})]}),(xe[Se]??[]).length===0?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-dashed border-border bg-card px-4 py-4 text-sm text-foreground-muted`,children:`No MCP servers configured for this agent yet.`}):(0,K.jsx)(`div`,{className:`mt-4 space-y-4`,children:(xe[Se]??[]).map((e,t)=>(0,K.jsx)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,K.jsx)(Mb,{label:`Name`,value:e.name,onChange:e=>B(n=>({...n,[Se]:(n[Se]??[]).map((n,r)=>r===t?{...n,name:e}:n)}))}),(0,K.jsx)(Fb,{label:`Transport`,value:e.transport,onChange:e=>B(n=>({...n,[Se]:(n[Se]??[]).map((n,r)=>r===t?{...n,transport:e}:n)})),options:[{value:`stdio`,label:`stdio`},{value:`sse`,label:`sse`},{value:`streamable-http`,label:`streamable-http`}]})]}),e.transport===`stdio`?(0,K.jsx)(Mb,{label:`Command`,value:e.command,onChange:e=>B(n=>({...n,[Se]:(n[Se]??[]).map((n,r)=>r===t?{...n,command:e}:n)}))}):(0,K.jsx)(Mb,{label:`URL`,value:e.url,onChange:e=>B(n=>({...n,[Se]:(n[Se]??[]).map((n,r)=>r===t?{...n,url:e}:n)}))}),(0,K.jsx)(Nb,{label:`Args`,value:e.argsText,onChange:e=>B(n=>({...n,[Se]:(n[Se]??[]).map((n,r)=>r===t?{...n,argsText:e}:n)})),placeholder:`One argument per line`}),(0,K.jsx)(Nb,{label:`Environment`,value:e.envText,onChange:e=>B(n=>({...n,[Se]:(n[Se]??[]).map((n,r)=>r===t?{...n,envText:e}:n)})),placeholder:`KEY=value`}),(0,K.jsx)(Q,{type:`button`,variant:`ghost`,onClick:()=>B(e=>({...e,[Se]:(e[Se]??[]).filter((e,n)=>n!==t)})),children:`Remove server`})]})},`${Se}-${t}`))}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(Q,{type:`button`,variant:`primary`,onClick:()=>void qe(),disabled:!Be||we,children:we?`Saving…`:`Save MCP servers`}),(0,K.jsx)(Q,{type:`button`,variant:`ghost`,onClick:()=>{B(ye),V(null),Oe(null)},disabled:!Be||we,children:`Discard changes`})]})]}):null]})]})]}):null,g===`editor-integration`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`editor-integration-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Editor integration`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`The local package is workspace-first. Editing happens through sessions and workspaces, with keyboard-driven panels and command-bar access layered on top instead of hidden in a separate IDE-only integration surface.`}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)]`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,K.jsx)($,{label:`Workspace shortcuts`,value:String(Fe.length)}),(0,K.jsx)($,{label:`Primary route`,value:`/workspaces`}),(0,K.jsx)($,{label:`Command bar`,value:`Ctrl/Cmd + K`}),(0,K.jsx)($,{label:`Session route`,value:`/sessions`})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(Q,{asChild:!0,variant:`primary`,children:(0,K.jsx)(Z,{href:`/workspaces`,children:`Open workspaces`})}),(0,K.jsx)(Q,{asChild:!0,variant:`ghost`,children:(0,K.jsx)(Z,{href:`/sessions`,children:`Open sessions`})})]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Active editor conventions`}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`p`,{children:`Session workspaces expose panel toggles for workspace, conversation, context, and details alongside a command bar for fast navigation.`}),(0,K.jsx)(`p`,{children:`Settings breadth here keeps those local editing conventions visible instead of pretending editor integration is only an external IDE handshake.`})]})]})]})]}):null,g===`git`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`git-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Git settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Repository policy is still edited through project-backed seams, but the git section summarizes the current branch, review, merge, and provider readiness posture in one place.`}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 lg:grid-cols-4`,children:[(0,K.jsx)($,{label:`Linked repos`,value:String(Ae)}),(0,K.jsx)($,{label:`Auto-merge enabled`,value:String(je)}),(0,K.jsx)($,{label:`Connected providers`,value:String(Ne)}),(0,K.jsx)($,{label:`Missing bindings`,value:String(Me)})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-2`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Repository defaults`}),Ae===0?(0,K.jsx)(`div`,{className:`mt-3 text-sm text-foreground-muted`,children:`No linked repositories are available yet.`}):(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:(T?.repositories??[]).map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-3 py-3 text-sm`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.fullName}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[`Base branch `,e.baseBranch,` · approvals `,e.requiredApprovals,` · auto-merge`,` `,e.autoMerge?`on`:`off`]})]},e.id))})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Remote readiness`}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`p`,{children:`Provider connectivity and missing project bindings affect linked PR workflows, review sync, and approval automation.`}),(0,K.jsx)(`p`,{children:`Use the Repositories & Projects and Remote Projects sections to change persisted policy; this section keeps the current git posture visible at a glance.`})]})]})]})]}):null,g===`notifications`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`notification-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Notification settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Run completion, failure, and waiting-for-review events surface in-app first, with browser notifications available when permission is granted and the tab is hidden.`}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 lg:grid-cols-4`,children:[(0,K.jsx)($,{label:`Browser permission`,value:Ie}),(0,K.jsx)($,{label:`In-app queue`,value:String(i.length)}),(0,K.jsx)($,{label:`Persistent alerts`,value:`breakpoints stay pinned`}),(0,K.jsx)($,{label:`Digest polling`,value:`3s`})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[minmax(0,1fr)_minmax(0,1.1fr)]`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Current behavior`}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`p`,{children:`New runs, completions, failures, and breakpoint attention all publish to the in-app stack.`}),(0,K.jsx)(`p`,{children:`Browser notifications only fire when permission is granted and the document is hidden.`}),(0,K.jsx)(`p`,{children:`Breakpoint notifications stay persistent until operators resolve them.`})]}),a===`granted`?null:(0,K.jsx)(`div`,{className:`mt-4`,children:(0,K.jsx)(Q,{type:`button`,variant:`primary`,onClick:o,children:`Enable browser notifications`})})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Why this is explicit here`}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`p`,{children:`Upstream breadth includes notifications, but the local package needs to explain the Babysitter-specific attention model: runs can require review, not just passive status updates.`}),(0,K.jsx)(`p`,{children:`This section keeps notification policy visible without forcing operators to infer it from transient toasts alone.`})]})]})]})]}):null,g===`task-tags`?(0,K.jsx)(Hb,{}):null,g===`keyboard-shortcuts`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`keyboard-shortcut-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Keyboard shortcut settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Shortcut visibility is explicit here so the app shell, run detail view, and session workspace remain keyboard-driven without hiding the available commands behind memory alone.`}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 lg:grid-cols-3`,children:[(0,K.jsx)($,{label:`Shortcut groups`,value:String(Pe.length)}),(0,K.jsx)($,{label:`Global shortcuts`,value:String(Vv.filter(e=>e.context===`global`).length)}),(0,K.jsx)($,{label:`Workspace shortcuts`,value:String(Fe.length)})]}),(0,K.jsx)(`div`,{className:`mt-5 space-y-4`,children:Pe.map(([e,t])=>(0,K.jsxs)(`section`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:Hv[e]??e}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-3 md:grid-cols-2`,children:t.map(t=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-3 py-3 text-sm`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:t.description}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:t.keys.join(` + `)})]},`${e}-${t.description}`))})]},e))})]}):null]})]})]})}function Db(e){return(0,K.jsx)(`div`,{className:`mt-5 rounded-2xl border border-border bg-background/60 px-4 py-4 text-sm text-foreground-muted`,children:e.text})}function Ob(e){return(0,K.jsxs)(`div`,{className:`mt-5 rounded-2xl border border-dashed border-border bg-background/40 px-4 py-4`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.title}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-foreground-muted`,children:e.message})]})}function kb(e){return(0,K.jsxs)(`div`,{className:`mt-5 rounded-2xl border border-error/25 bg-error-muted px-4 py-4`,children:[(0,K.jsx)(`div`,{className:`font-medium text-error`,children:e.title}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-error`,children:e.message})]})}function Ab(e){return(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-error/25 bg-error-muted px-4 py-3 text-sm text-error`,children:e.message})}function jb(e){return(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-green-500/25 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300`,children:e.message})}function Mb(e){return(0,K.jsxs)(`label`,{className:`block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[e.label,(0,K.jsx)(`input`,{value:e.value,onChange:t=>e.onChange(t.target.value),list:e.listId,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]})}function Nb(e){return(0,K.jsxs)(`label`,{className:`block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[e.label,(0,K.jsx)(`textarea`,{value:e.value,onChange:t=>e.onChange(t.target.value),placeholder:e.placeholder,className:`mt-2 min-h-24 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})]})}function Pb(e){return(0,K.jsxs)(`label`,{className:`block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[e.label,(0,K.jsx)(`input`,{type:`number`,min:e.min,value:e.value,onChange:t=>e.onChange(Number.parseInt(t.target.value,10)||0),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]})}function Fb(e){return(0,K.jsxs)(`label`,{className:`block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[e.label,(0,K.jsx)(`select`,{value:e.value,onChange:t=>e.onChange(t.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:e.options.map(e=>(0,K.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})}function Ib(e){return(0,K.jsxs)(`label`,{className:`flex items-center justify-between gap-4 rounded-2xl border border-border bg-card px-4 py-3 text-sm`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),(0,K.jsx)(`input`,{type:`checkbox`,checked:e.checked,onChange:t=>e.onChange(t.target.checked),className:`h-4 w-4`})]})}var Lb=/^[a-z0-9]+(?:_[a-z0-9]+)*$/,Rb={key:``,label:``,content:``,description:``};function zb(e){return[...e].sort((e,t)=>e.order-t.order||e.key.localeCompare(t.key)||e.label.localeCompare(t.label))}function Bb(e,t,n){let r={key:e.key.trim(),label:e.label.trim(),content:e.content.trim(),description:e.description.trim()},i={};return r.key?Lb.test(r.key)?t.some(e=>e.key===r.key&&e.id!==n)&&(i.key=`Key ${r.key} already exists.`):i.key=`Key must use lowercase snake_case.`:i.key=`Key is required.`,r.label||(i.label=`Label is required.`),r.content||(i.content=`Snippet content is required.`),{normalized:r,errors:i}}function Vb(e){return e.includes(`snake_case`)?{key:`Key must use lowercase snake_case.`}:e.includes(`already exists`)?{key:e}:{}}function Hb(){let[e,t]=(0,y.useState)([]),[n,r]=(0,y.useState)(!0),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(Rb),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)({}),[f,p]=(0,y.useState)(null),[m,h]=(0,y.useState)(null),[g,_]=(0,y.useState)(!1),[v,b]=(0,y.useState)(null);(0,y.useEffect)(()=>{let e=!0;async function n(){r(!0),a(null);try{let n=await ey();if(!e)return;t(zb(n))}catch(t){if(!e)return;a(t instanceof Error?t.message:`Failed to load Task Tags.`)}finally{e&&r(!1)}}return n(),()=>{e=!1}},[]);let x=zb(e);function S(){s(Rb),l(null),d({})}function C(e){l(e.id),s({key:e.key,label:e.label,content:e.content,description:e.description??``}),d({}),p(null),h(null)}async function w(e){e.preventDefault();let{normalized:n,errors:r}=Bb(o,x,c);if(Object.keys(r).length>0){d(r),p(null);return}_(!0),d({}),p(null),h(null);try{let e={key:n.key,label:n.label,content:n.content,description:n.description||void 0};t(zb((c?await ny(c,e):await ty({...e,order:x.length})).taskTags)),h(c?`Updated @${n.key}.`:`Created @${n.key}.`),S()}catch(e){let t=e instanceof Error?e.message:`Failed to save Task Tag.`,n=Vb(t);d(n),p(Object.keys(n).length>0?null:t)}finally{_(!1)}}async function T(e){b(e.id),p(null),h(null);try{t(zb((await ry(e.id)).taskTags)),h(`Deleted @${e.key}.`),c===e.id&&S()}catch(e){p(e instanceof Error?e.message:`Failed to delete Task Tag.`)}finally{b(null)}}async function E(n,r){let i=x.findIndex(e=>e.id===n),a=i+r;if(i<0||a<0||a>=x.length)return;let o=[...x],[s]=o.splice(i,1);if(!s)return;o.splice(a,0,s);let c=o.map((e,t)=>({...e,order:t}));b(n),p(null),h(null);try{let n=e;for(let e of c){let t=x.find(t=>t.id===e.id);!t||t.order===e.order||(n=[...(await ny(e.id,{order:e.order})).taskTags])}t(zb(n)),h(`Updated Task Tag order.`)}catch(e){p(e instanceof Error?e.message:`Failed to reorder Task Tags.`)}finally{b(null)}}return(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`task-tag-settings`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`max-w-3xl`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Task Tags`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:"Reusable snippet tags stay separate from issue labels and Dispatch Context Labels. This Settings surface manages the shared `@` library that authoring flows consume."})]}),(0,K.jsxs)(`div`,{className:`grid min-w-[220px] gap-3 sm:grid-cols-2`,children:[(0,K.jsx)($,{label:`Definitions`,value:String(x.length)}),(0,K.jsx)($,{label:`Sort rule`,value:x.length>0?`order then key`:`empty library`})]})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-6 xl:grid-cols-[minmax(0,1.1fr)_minmax(0,1.4fr)]`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:c?`Edit Task Tag`:`Create Task Tag`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:"Keys must be unique lowercase snake_case tokens used after `@`."})]}),c?(0,K.jsx)(Q,{type:`button`,variant:`ghost`,onClick:S,children:`Cancel edit`}):null]}),(0,K.jsxs)(`form`,{className:`mt-4 space-y-4`,onSubmit:w,children:[(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Key`,(0,K.jsx)(`input`,{"aria-label":`Task Tag key`,value:o.key,onChange:e=>s(t=>({...t,key:e.target.value})),placeholder:`bug_report`,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 font-mono text-sm text-foreground placeholder:text-foreground-muted/60`}),u.key?(0,K.jsx)(`span`,{className:`mt-2 block text-xs normal-case tracking-normal text-error`,children:u.key}):null]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Label`,(0,K.jsx)(`input`,{"aria-label":`Task Tag label`,value:o.label,onChange:e=>s(t=>({...t,label:e.target.value})),placeholder:`Bug Report`,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground placeholder:text-foreground-muted/60`}),u.label?(0,K.jsx)(`span`,{className:`mt-2 block text-xs normal-case tracking-normal text-error`,children:u.label}):null]})]}),(0,K.jsxs)(`label`,{className:`block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Description`,(0,K.jsx)(`input`,{"aria-label":`Task Tag description`,value:o.description,onChange:e=>s(t=>({...t,description:e.target.value})),placeholder:`Optional guidance for when this snippet should be used.`,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground placeholder:text-foreground-muted/60`})]}),(0,K.jsxs)(`label`,{className:`block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Snippet content`,(0,K.jsx)(`textarea`,{"aria-label":`Task Tag content`,value:o.content,onChange:e=>s(t=>({...t,content:e.target.value})),placeholder:`Describe the bug, impact, expected behavior, and steps to reproduce.`,className:`mt-2 min-h-28 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-foreground-muted/60`}),u.content?(0,K.jsx)(`span`,{className:`mt-2 block text-xs normal-case tracking-normal text-error`,children:u.content}):null]}),f?(0,K.jsx)(`div`,{className:`rounded-2xl border border-error/30 bg-error-muted px-4 py-3 text-sm text-error`,children:f}):null,m?(0,K.jsx)(`div`,{className:`rounded-2xl border border-success/30 bg-success-muted px-4 py-3 text-sm text-success`,children:m}):null,(0,K.jsx)(Q,{type:`submit`,variant:`primary`,disabled:g||v!==null,children:g?`Saving Task Tag…`:c?`Save Task Tag`:`Create Task Tag`})]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Reusable library`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:"Ordering is explicit. Move controls patch stored `order` values to keep autocomplete deterministic."})]}),(0,K.jsx)(Q,{type:`button`,variant:`ghost`,onClick:()=>{r(!0),a(null),ey().then(e=>t(zb(e))).catch(e=>a(e instanceof Error?e.message:`Failed to load Task Tags.`)).finally(()=>r(!1))},disabled:n,children:`Refresh`})]}),i?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-error/30 bg-error-muted px-4 py-3 text-sm text-error`,children:i}):null,n?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card px-4 py-4 text-sm text-foreground-muted`,children:`Loading Task Tags…`}):x.length===0?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-dashed border-border bg-card px-4 py-4 text-sm text-foreground-muted`,children:`No Task Tags yet. Create one to seed the reusable snippet library.`}):(0,K.jsx)(`div`,{className:`mt-4 space-y-3`,children:x.map((e,t)=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-card p-4`,"data-testid":`task-tag-item-${e.id}`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.label}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs font-mono text-foreground-muted`,children:[`@`,e.key]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[`order `,e.order]})]}),e.description?(0,K.jsx)(`p`,{className:`mt-2 text-sm text-foreground-muted`,children:e.description}):null]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(Q,{type:`button`,variant:`ghost`,onClick:()=>void E(e.id,-1),disabled:t===0||v!==null||g,"aria-label":`Move ${e.label} up`,children:`Move up`}),(0,K.jsx)(Q,{type:`button`,variant:`ghost`,onClick:()=>void E(e.id,1),disabled:t===x.length-1||v!==null||g,"aria-label":`Move ${e.label} down`,children:`Move down`}),(0,K.jsx)(Q,{type:`button`,variant:`ghost`,onClick:()=>C(e),disabled:v!==null||g,children:`Edit`}),(0,K.jsx)(Q,{type:`button`,variant:`ghost`,onClick:()=>void T(e),disabled:v!==null||g,children:v===e.id?`Deleting…`:`Delete`})]})]}),(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap rounded-xl border border-border bg-background/80 px-3 py-3 text-xs text-foreground-secondary`,children:e.content})]},e.id))})]})]})]})}function Ub(e){let[t,n]=(0,y.useState)(ub()),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(null),[d,f]=(0,y.useState)(null);async function p(t,n){c(t),u(null),f(null);try{await n(),await e.onRefresh()}catch(e){throw u(e instanceof Error?e.message:`Dispatch Context Label update failed.`),e}finally{c(null)}}async function m(){await p(`create-dispatch-context-label`,async()=>{await iy({key:t.key,label:t.label,description:t.description||void 0,instruction:t.instruction}),n(ub()),f(`Created Dispatch Context Label definition.`)})}async function h(){!r||!a||await p(`save-${r}`,async()=>{await ay(r,{key:a.key,label:a.label,description:a.description||void 0,instruction:a.instruction}),i(null),o(null),f(`Updated Dispatch Context Label definition.`)})}async function g(e){await p(`delete-${e}`,async()=>{await oy(e),r===e&&(i(null),o(null)),f(`Deleted Dispatch Context Label definition.`)})}return(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`dispatch-context-label-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Dispatch Context Labels`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Manage reusable execution-context definitions here. These definitions stay separate from board labels, Task Tags, and default agent selection so reviewers can inspect exactly what dispatch instructions are reusable and where they are attached.`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[(0,K.jsx)($,{label:`Definitions`,value:String(e.dispatchContextLabels.length)}),(0,K.jsx)($,{label:`Attached issues`,value:String(e.issues.filter(e=>e.dispatch.contextLabels.length>0).length)}),(0,K.jsx)($,{label:`Rendered projections`,value:String(e.issues.filter(e=>(e.dispatch.renderedContext??``).length>0).length)})]}),l?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-error/25 bg-error-muted px-4 py-3 text-sm text-error`,children:l}):null,d?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-success/30 bg-success-muted px-4 py-3 text-sm text-success`,children:d}):null,(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[minmax(0,360px)_minmax(0,1fr)]`,children:[(0,K.jsxs)(`form`,{className:`rounded-2xl border border-border bg-background/60 p-4`,onSubmit:e=>{e.preventDefault(),m().catch(()=>void 0)},children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Create reusable definition`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Define the reusable dispatch instruction once, then attach it by reference on the issue surface instead of copying prompt text into board labels or Task Tags.`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Dispatch Context Label key`,(0,K.jsx)(`input`,{"aria-label":`Dispatch Context Label key`,value:t.key,onChange:e=>n(t=>({...t,key:e.target.value})),placeholder:`tests_first`,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Display label`,(0,K.jsx)(`input`,{"aria-label":`Dispatch Context Label name`,value:t.label,onChange:e=>n(t=>({...t,label:e.target.value})),placeholder:`Tests First`,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Helper description`,(0,K.jsx)(`textarea`,{"aria-label":`Dispatch Context Label description`,value:t.description,onChange:e=>n(t=>({...t,description:e.target.value})),placeholder:`Explain when to attach this reusable context label.`,className:`mt-2 min-h-20 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Dispatch instruction`,(0,K.jsx)(`textarea`,{"aria-label":`Dispatch Context Label instruction`,value:t.instruction,onChange:e=>n(t=>({...t,instruction:e.target.value})),placeholder:`Write or update deterministic verification before implementation changes.`,className:`mt-2 min-h-32 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})]}),(0,K.jsx)(`button`,{type:`submit`,disabled:s===`create-dispatch-context-label`,className:`inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:s===`create-dispatch-context-label`?`Creating definition…`:`Create Dispatch Context Label`})]})]}),(0,K.jsxs)(`div`,{className:`space-y-3`,children:[e.dispatchContextLabels.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border bg-background/40 p-4 text-sm text-foreground-muted`,children:`No Dispatch Context Label definitions exist yet. Create one here, then attach it from the issue surface.`}):null,e.dispatchContextLabels.map(t=>{let n=e.issues.filter(e=>e.dispatch.contextLabels.some(e=>e.labelId===t.id));return(0,K.jsx)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:r===t.id&&a!==null?(0,K.jsxs)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault(),h().catch(()=>void 0)},children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Edit definition`}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[n.length,` issue`,n.length===1?``:`s`]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Dispatch Context Label key`,(0,K.jsx)(`input`,{"aria-label":`Dispatch Context Label key ${t.key}`,value:a.key,onChange:e=>o(t=>t&&{...t,key:e.target.value}),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Display label`,(0,K.jsx)(`input`,{"aria-label":`Dispatch Context Label name ${t.key}`,value:a.label,onChange:e=>o(t=>t&&{...t,label:e.target.value}),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Helper description`,(0,K.jsx)(`textarea`,{"aria-label":`Dispatch Context Label description ${t.key}`,value:a.description,onChange:e=>o(t=>t&&{...t,description:e.target.value}),className:`mt-2 min-h-20 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Dispatch instruction`,(0,K.jsx)(`textarea`,{"aria-label":`Dispatch Context Label instruction ${t.key}`,value:a.instruction,onChange:e=>o(t=>t&&{...t,instruction:e.target.value}),className:`mt-2 min-h-28 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(`button`,{type:`submit`,disabled:s===`save-${t.id}`,className:`inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:s===`save-${t.id}`?`Saving…`:`Save definition`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{i(null),o(null),u(null)},className:`inline-flex h-11 items-center justify-center rounded-xl border border-border px-4 text-sm font-semibold text-foreground-muted`,children:`Cancel edit`})]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:t.label}),(0,K.jsx)(`div`,{className:`text-xs text-foreground-muted`,children:t.key})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[n.length,` issue`,n.length===1?``:`s`]})]}),t.description?(0,K.jsx)(`p`,{className:`mt-2 text-sm text-foreground-muted`,children:t.description}):null,(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap rounded-xl border border-border bg-card px-3 py-3 text-xs text-foreground-secondary`,children:t.instruction}),n.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:n.map(e=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:e.key},`${t.id}-${e.id}`))}):(0,K.jsx)(`div`,{className:`mt-3 text-xs text-foreground-muted`,children:`Not attached to any issue yet.`}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>{i(t.id),o({key:t.key,label:t.label,description:t.description??``,instruction:t.instruction}),u(null),f(null)},className:`inline-flex h-11 items-center justify-center rounded-xl border border-border bg-card px-4 text-sm font-semibold text-foreground`,children:`Edit definition`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void g(t.id).catch(()=>void 0),disabled:s===`delete-${t.id}`,className:`inline-flex h-11 items-center justify-center rounded-xl border border-error/30 bg-error-muted px-4 text-sm font-semibold text-error disabled:opacity-50`,children:s===`delete-${t.id}`?`Deleting…`:`Delete definition`})]})]})},t.id)})]})]})]})}function Wb(){let e=Fn(),{store:t}=Mn(),n=Pn(t,e=>e.agents.items.length),r=Pn(t,e=>Object.keys(e.sessions.byId).length),i=Pn(t,e=>Object.keys(e.runs.byId).length);return(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Live state`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,K.jsx)($,{label:`Socket status`,value:e.status}),(0,K.jsx)($,{label:`Agents`,value:String(n)}),(0,K.jsx)($,{label:`Sessions`,value:String(r)}),(0,K.jsx)($,{label:`Runs`,value:String(i)})]}),e.error?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-error/20 bg-error-muted px-4 py-3 text-sm text-error`,children:e.error}):null]})}function $(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-xs uppercase tracking-[0.2em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`div`,{className:`mt-2 text-sm font-medium`,children:e.value})]})}function Gb(e){switch(e){case`connected`:return`border-success/20 bg-success/10 text-success`;case`partial-setup`:case`missing-scopes`:return`border-warning/20 bg-warning/10 text-warning`;case`expired-auth`:case`failing`:return`border-error/20 bg-error/10 text-error`;default:return`border-border bg-background text-foreground-muted`}}function Kb(e){let{integration:t}=e,n=[t.actions.canCreatePullRequest?null:`create linked PRs`,t.actions.canManagePullRequest?null:`sync linked PR state`,t.actions.canApproveFromReview?null:`approve from review`].filter(Boolean);return(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:t.label}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:t.accountLabel??`No account selected`})]}),(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${Gb(t.status)}`,children:t.status.replace(/-/g,` `)})]}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:t.guidance}),t.failureMessage?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-error/20 bg-error/10 px-3 py-2 text-sm text-error`,children:t.failureMessage}):null,t.missingScopes?.length?(0,K.jsxs)(`div`,{className:`mt-3 rounded-2xl border border-warning/20 bg-warning/10 px-3 py-2 text-sm text-warning`,children:[`Missing scopes: `,t.missingScopes.join(`, `)]}):null,(0,K.jsx)(`div`,{className:`mt-4 space-y-2`,children:t.prerequisites.map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-3 py-3 text-sm`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),(0,K.jsx)(`span`,{className:`rounded-full border px-2 py-0.5 text-xs ${e.satisfied?`border-success/20 bg-success/10 text-success`:`border-warning/20 bg-warning/10 text-warning`}`,children:e.satisfied?`ready`:`missing`})]}),e.guidance?(0,K.jsx)(`div`,{className:`mt-2 text-xs leading-5 text-foreground-muted`,children:e.guidance}):null]},e.key))}),n.length>0?(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card px-3 py-3 text-sm text-foreground-muted`,children:[`Blocked actions: `,n.join(`, `),`.`,t.actions.reason?` ${t.actions.reason}`:``]}):null]})}function qb(e){let{isAuthenticated:t}=dd();return t?(0,K.jsx)(K.Fragment,{children:e.children}):(0,K.jsx)(`section`,{className:`mx-auto flex w-full max-w-3xl flex-1 items-center justify-center px-6 py-10`,children:(0,K.jsxs)(`div`,{className:`w-full rounded-3xl border border-border bg-card p-8 shadow-lg`,children:[(0,K.jsx)(`p`,{className:`mb-2 text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Gateway Required`}),(0,K.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:e.title??`Connect agent-mux before using this page`}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:e.body??`This surface wraps live agent-mux sessions and hooks. Connect through the gateway login flow, then come back here.`}),(0,K.jsxs)(`div`,{className:`mt-6 flex gap-3`,children:[(0,K.jsx)(Q,{asChild:!0,variant:`primary`,children:(0,K.jsx)(Z,{href:`/login`,children:`Connect gateway`})}),(0,K.jsx)(Q,{asChild:!0,variant:`outline`,children:(0,K.jsx)(Z,{href:`/settings`,children:`Open settings`})})]})]})})}async function Jb(e){let t=await uh(`/api/reviews`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(t.error.message);return t.data}function Yb(e={},t=15e3){let n=(0,y.useMemo)(()=>{let t=new URLSearchParams;return e.targetType&&t.set(`targetType`,e.targetType),e.targetId&&t.set(`targetId`,e.targetId),`/api/reviews${t.size>0?`?${t.toString()}`:``}`},[e.targetId,e.targetType]),[r,i]=(0,y.useState)(null),{data:a,loading:o,error:s,refresh:c}=$v(n,{interval:t,sseFilter:e=>e.type===`update`||e.type===`new-run`});async function l(e){i(e.artifactId);try{let t=await Jb(e);return await c(),t}finally{i(null)}}let u=a?.artifacts??[];return{snapshot:a,artifacts:u,queue:a?.queue??[],summary:a?.summary,loading:o,error:s,refresh:c,actOnReview:l,pendingArtifactId:r,selectedArtifact:e=>u.find(t=>t.id===e)??null}}function Xb(e){switch(e){case`dispatch`:return`Ready for dispatch`;case`executing`:return`Executing on the board`;case`review`:return`Approval and review`;case`recovery`:return`Recovery required`;case`done`:return`Execution landed`}}function Zb(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function Qb(e){return e&&typeof e==`object`?e:null}function $b(e){return e.tasks.find(e=>e.kind===`breakpoint`&&e.status===`requested`)??null}function ex(e){if(!e.snapshot||!e.board)return[];let t=e.nowMs??Date.now(),n=new Map(e.runs.map(e=>[e.runId,e])),r=new Map(e.board.projects.flatMap(e=>e.cards.map(e=>[e.issueId,e]))),i=new Map((e.reviewArtifacts??[]).map(e=>[e.targetId,e])),a=[];for(let o of e.snapshot.issues){let e=r.get(o.id);if(!e)continue;let s=(o.dispatch?.runIds??[]).map(e=>n.get(e)).filter(e=>!!e).sort((e,t)=>Zb(t.updatedAt)-Zb(e.updatedAt)),c=i.get(o.id),l=s.filter(e=>$b(e)).length,u=s.filter(e=>e.status===`pending`||e.status===`waiting`).length,d=s.filter(e=>e.status===`failed`).length,f=s.filter(e=>e.status===`completed`).length,p=s.filter(e=>e.isStale).length,m=s[0],h=Math.max(0,s.length-1),g=p>0||s.some(e=>e.status!==`pending`&&e.status!==`waiting`?!1:t-Zb(e.updatedAt)>900*1e3),_=`dispatch`;d>0||p>0||g?_=`recovery`:l>0||e.workflowState===`review`||c?.decision===`changes-requested`||c?.decision===`pending`?_=`review`:u>0||e.workflowState===`in-progress`?_=`executing`:(e.workflowState===`done`||s.length>0&&f===s.length)&&(_=`done`),a.push({issueId:o.id,issueKey:o.key,issueTitle:o.title,workflowState:e.workflowState,stage:_,stageLabel:Xb(_),reviewDecision:c?.decision,runIds:s.map(e=>e.runId),sessionIds:Array.from(new Set(o.dispatch?.sessionIds??s.map(e=>e.sessionId??``).filter(Boolean))),runCount:s.length,activeRuns:u,failedRuns:d,completedRuns:f,staleRuns:p,retryCount:h,pendingBreakpoints:l,stuck:g,primaryRunId:m?.runId,primarySessionId:m?.sessionId??o.dispatch?.sessionIds?.[0],updatedAt:m?.updatedAt??o.updatedAt})}return a.sort((e,t)=>{let n=[`recovery`,`review`,`executing`,`dispatch`,`done`],r=n.indexOf(e.stage)-n.indexOf(t.stage);return r===0?Zb(t.updatedAt)-Zb(e.updatedAt):r})}function tx(e,t=Date.now()){let n=new Map;for(let t of e){let e=t.sessionId&&t.sessionId.length>0?`session:${t.sessionId}`:`process:${t.projectName??`unknown`}:${t.processId}`,r=n.get(e);r?r.push(t):n.set(e,[t])}return Array.from(n.values()).map(e=>e.sort((e,t)=>Zb(t.updatedAt)-Zb(e.updatedAt))[0]).map(e=>{let r=e.sessionId&&e.sessionId.length>0?`session:${e.sessionId}`:`process:${e.projectName??`unknown`}:${e.processId}`,i=Math.max(0,(n.get(r)?.length??1)-1),a=e.tasks.filter(e=>e.kind===`breakpoint`&&e.status===`requested`).length,o=e.isStale===!0||(e.status===`pending`||e.status===`waiting`)&&t-Zb(e.updatedAt)>900*1e3,s=e.tasks.filter(e=>e.status===`error`).length,c=$b(e),l=`healthy`;e.status===`failed`||o?l=`critical`:(a>0||s>0||i>0)&&(l=`attention`);let u=[];return a>0&&u.push(`${a} breakpoint${a===1?``:`s`}`),i>0&&u.push(`${i} retr${i===1?`y`:`ies`}`),o&&u.push(`stuck-task signal`),u.length===0&&u.push(`${e.completedTasks}/${e.totalTasks} tasks complete`),{runId:e.runId,processId:e.processId,projectName:e.projectName,sessionId:e.sessionId,status:e.status,retryCount:i,stuck:o,pendingBreakpoints:a,severity:l,recoveryHref:e.sessionId?`/sessions/${e.sessionId}`:`/runs/${e.runId}`,reviewHref:c?`/runs/${e.runId}?effectId=${encodeURIComponent(c.effectId)}`:void 0,summary:u.join(` · `),updatedAt:e.updatedAt}}).sort((e,t)=>{let n={critical:0,attention:1,healthy:2},r=n[e.severity]-n[t.severity];return r===0?Zb(t.updatedAt)-Zb(e.updatedAt):r})}function nx(e){return e.map(e=>{let t=Array.isArray(e.tasks)?e.tasks:[],n=t.find(e=>{let t=Qb(e);return t?.kind===`breakpoint`&&t.status===`requested`&&typeof t.effectId==`string`}),r=t.find(e=>{let t=Qb(e);return t?.status===`error`&&typeof t.effectId==`string`});return{runId:String(e.runId??``),processId:String(e.processId??`unknown`),status:e.status??`pending`,sessionId:typeof e.sessionId==`string`?e.sessionId:void 0,breakpointEffectId:n?.effectId,errorEffectId:r?.effectId,logTaskCount:t.filter(e=>{let t=Qb(e);return!!(t?.stdout||t?.stderr)}).length,resultTaskCount:t.filter(e=>!!Qb(e)?.result).length,pendingBreakpointCount:t.filter(e=>{let t=Qb(e);return t?.kind===`breakpoint`&&t.status===`requested`}).length,failedTaskCount:t.filter(e=>Qb(e)?.status===`error`).length}})}var rx=[`recovery`,`review`,`executing`,`dispatch`,`done`];function ix(e){switch(e){case`recovery`:return`Recovery`;case`review`:return`Approval`;case`executing`:return`Execution`;case`dispatch`:return`Dispatch`;case`done`:return`Done`}}function ax(e){switch(e){case`recovery`:return`border-error/25 bg-error-muted`;case`review`:return`border-warning/25 bg-warning-muted`;case`executing`:return`border-primary/25 bg-primary/10`;case`dispatch`:return`border-border bg-background/80`;case`done`:return`border-success/25 bg-success-muted`}}function ox(e){switch(e){case`critical`:return`border-error/25 bg-error-muted text-error`;case`attention`:return`border-warning/25 bg-warning-muted text-warning`;default:return`border-success/25 bg-success-muted text-success`}}function sx(){let{snapshot:e,board:t,loading:n,error:r}=sy(),i=Yb({},15e3),{data:a,loading:o,error:s}=$v(`/api/runs?limit=200&sort=activity`,{interval:5e3,sseFilter:()=>!0}),c=a?.runs??[],l=ex({snapshot:e,board:t,runs:c,reviewArtifacts:i.artifacts}),u=tx(c).slice(0,6);return n&&o||!e&&!t&&!a&&!r&&!s?(0,K.jsx)(`section`,{className:`mb-6 rounded-3xl border border-border bg-card p-6 shadow-lg`,children:(0,K.jsxs)(`div`,{className:`animate-pulse space-y-4`,children:[(0,K.jsx)(`div`,{className:`h-4 w-48 rounded bg-background-secondary`}),(0,K.jsx)(`div`,{className:`h-8 w-96 rounded bg-background-secondary`}),(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[1.5fr_1fr]`,children:[(0,K.jsx)(`div`,{className:`h-80 rounded-2xl bg-background-secondary`}),(0,K.jsx)(`div`,{className:`h-80 rounded-2xl bg-background-secondary`})]})]})}):r||s?(0,K.jsx)(`section`,{className:`mb-6 rounded-3xl border border-error/25 bg-error-muted p-6 text-sm text-error shadow-lg`,children:`Failed to build the Babysitter execution overlay.`}):(0,K.jsxs)(`section`,{className:`mb-6 rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`babysitter-overlay-panel`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`max-w-4xl`,children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Babysitter-native overlay`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:`Board stages now carry run health, approval state, and recovery context`}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:`The board remains the planning surface, but Babysitter run state now maps directly into execution lanes with retry signals, stuck-task detection, breakpoint review entry points, and direct navigation into session and run artifacts.`})]}),(0,K.jsxs)(`div`,{className:`min-w-[260px] rounded-2xl border border-border bg-background p-4`,children:[(0,K.jsx)(`div`,{className:`text-xs uppercase tracking-[0.18em] text-foreground-muted`,children:`Overlay coverage`}),(0,K.jsxs)(`div`,{className:`mt-3 grid gap-2 text-sm text-foreground-muted`,children:[(0,K.jsxs)(`div`,{children:[l.length,` board cards with linked Babysitter context`]}),(0,K.jsxs)(`div`,{children:[u.filter(e=>e.severity!==`healthy`).length,` runs need operator attention`]}),(0,K.jsxs)(`div`,{children:[i.summary?.openCommentCount??0,` review comments still open`]})]})]})]}),(0,K.jsxs)(`div`,{className:`mt-6 grid gap-6 xl:grid-cols-[1.5fr_1fr]`,children:[(0,K.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:rx.map(e=>{let t=l.filter(t=>t.stage===e).slice(0,4);return(0,K.jsxs)(`article`,{className:`rounded-2xl border p-4 ${ax(e)}`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:ix(e)}),(0,K.jsxs)(`div`,{className:`text-xs text-foreground-muted`,children:[t.length,` issue overlays`]})]}),(0,K.jsx)(km,{className:`h-4 w-4 text-foreground-muted`})]}),(0,K.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[t.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-current/10 bg-card/75 p-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-current/15 px-2 py-0.5 text-[11px] uppercase tracking-[0.18em]`,children:e.issueKey}),e.pendingBreakpoints>0?(0,K.jsxs)(`span`,{className:`rounded-full border border-warning/25 bg-warning/10 px-2 py-0.5 text-[11px] text-warning`,children:[e.pendingBreakpoints,` approval`]}):null,e.retryCount>0?(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] text-foreground-muted`,children:[e.retryCount,` retries`]}):null]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm font-semibold text-foreground`,children:e.issueTitle}),(0,K.jsxs)(`div`,{className:`mt-2 text-xs text-foreground-muted`,children:[e.stageLabel,e.stuck?` · stuck-task signal`:``]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[e.primaryRunId?(0,K.jsxs)(Z,{href:`/runs/${e.primaryRunId}`,className:`inline-flex items-center gap-1 text-primary`,children:[`Run`,(0,K.jsx)(Tp,{className:`h-3 w-3`})]}):null,e.primarySessionId?(0,K.jsxs)(Z,{href:`/sessions/${e.primarySessionId}`,className:`inline-flex items-center gap-1 text-primary`,children:[`Session`,(0,K.jsx)(Tp,{className:`h-3 w-3`})]}):null,(0,K.jsxs)(Z,{href:`/projects`,className:`inline-flex items-center gap-1 text-primary`,children:[`Board`,(0,K.jsx)(Tp,{className:`h-3 w-3`})]})]})]},e.issueId)),t.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No issues in this overlay lane.`}):null]})]},e)})}),(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Pm,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Run health and recovery`})]}),(0,K.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[u.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(Z,{href:`/runs/${e.runId}`,className:`font-mono text-sm text-primary`,children:e.runId}),(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${ox(e.severity)}`,children:e.severity})]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm text-foreground`,children:e.processId}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:e.summary}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[(0,K.jsxs)(Z,{href:e.recoveryHref,className:`inline-flex items-center gap-1 text-primary`,children:[e.stuck||e.status===`failed`?(0,K.jsx)(cm,{className:`h-3 w-3`}):(0,K.jsx)(Rp,{className:`h-3 w-3`}),`Recovery`]}),e.reviewHref?(0,K.jsxs)(Z,{href:e.reviewHref,className:`inline-flex items-center gap-1 text-primary`,children:[(0,K.jsx)(tm,{className:`h-3 w-3`}),`Breakpoint`]}):null]})]},e.runId)),u.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No linked runs yet.`}):null]})]}),(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Em,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Operator shortcuts`})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(Z,{href:`/inbox`,className:`rounded-2xl border border-border bg-card px-4 py-3 text-left hover:border-primary/30 hover:text-foreground`,children:`Inbox surfaces workspaces that need recovery, rebase, or review action.`}),(0,K.jsx)(Z,{href:`/sessions`,className:`rounded-2xl border border-border bg-card px-4 py-3 text-left hover:border-primary/30 hover:text-foreground`,children:`Session detail merges transcript activity with run milestones and artifacts.`}),(0,K.jsx)(Z,{href:`/workspaces`,className:`rounded-2xl border border-border bg-card px-4 py-3 text-left hover:border-primary/30 hover:text-foreground`,children:`Workspace recovery stays the control plane for failed or cleaned execution contexts.`}),(0,K.jsx)(`div`,{className:`rounded-2xl border border-border bg-card px-4 py-3`,children:(0,K.jsxs)(`div`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,K.jsx)(Wm,{className:`h-4 w-4 text-warning`}),`Retries are surfaced by linked-run history, so repeated attempts stay visible on the board instead of disappearing into raw run lists.`]})})]})]})]})]})]})}var cx=`kanban:`,lx=typeof window<`u`?y.useLayoutEffect:y.useEffect;function ux(e,t){let n=e.startsWith(cx)?e:`${cx}${e}`,[r,i]=(0,y.useState)(t);return lx(()=>{try{let e=window.localStorage.getItem(n);e!==null&&i(JSON.parse(e))}catch{}},[n]),[r,(0,y.useCallback)(e=>{i(t=>{let r=typeof e==`function`?e(t):e;try{typeof window<`u`&&window.localStorage.setItem(n,JSON.stringify(r))}catch{}return r})},[n])]}function dx(){let[e,t]=(0,y.useState)([]),[n,r]=(0,y.useState)(!0),[i,a]=(0,y.useState)(null);return(0,y.useEffect)(()=>{let e=!1;return ey().then(n=>{e||(t(n),a(null))}).catch(n=>{e||(t([]),a(n instanceof Error?n.message:String(n)))}).finally(()=>{e||r(!1)}),()=>{e=!0}},[]),{taskTags:e,loading:n,error:i}}function fx(e){switch(e){case`approved`:return`Approved`;case`changes-requested`:return`Changes Requested`;default:return`Pending Review`}}function px(e){switch(e){case`approved`:return`border-success/20 bg-success/10 text-success`;case`changes-requested`:return`border-error/20 bg-error/10 text-error`;default:return`border-primary/20 bg-primary/10 text-primary`}}function mx(e){switch(e){case`completed`:return`border-success/20 bg-success/10 text-success`;case`in-review`:return`border-warning/20 bg-warning/10 text-warning`;default:return`border-border text-foreground-muted`}}function hx(e){switch(e){case`connected`:return`border-success/20 bg-success/10 text-success`;case`partial-setup`:case`missing-scopes`:return`border-warning/20 bg-warning/10 text-warning`;case`expired-auth`:case`failing`:return`border-error/20 bg-error/10 text-error`;default:return`border-border text-foreground-muted`}}function gx(e){return e===`azure-repos`?`Azure Repos`:`GitHub`}function _x(e){switch(e){case`approved`:case`ready`:case`passing`:case`published`:case`merged`:return`border-success/20 bg-success/10 text-success`;case`pending`:case`in-review`:return`border-warning/20 bg-warning/10 text-warning`;case`changes-requested`:case`blocked`:case`failing`:case`failed`:return`border-error/20 bg-error/10 text-error`;default:return`border-border text-foreground-muted`}}function vx(e){return e===`add`?`bg-success/10`:e===`delete`?`bg-error/10`:`bg-transparent`}function yx(e,t,n){return typeof n.newLineNumber==`number`?{fileId:e.id,filePath:e.path,hunkId:t,side:`head`,line:n.newLineNumber}:typeof n.oldLineNumber==`number`?{fileId:e.id,filePath:e.path,hunkId:t,side:`base`,line:n.oldLineNumber}:null}function bx(e){return`${e.fileId}:${e.hunkId}:${e.side}:${e.line}`}function xx(e){return`review-line-${e.fileId}-${e.hunkId}-${e.side}-${e.line}`}function Sx(e){let t=typeof e.oldLineNumber==`number`?String(e.oldLineNumber):``,n=typeof e.newLineNumber==`number`?String(e.newLineNumber):``;return`${t.padStart(4,` `)} ${n.padStart(4,` `)}`}function Cx(e,t){if(!t)return[];let n=bx(t);return e.filter(e=>bx(e.anchor)===n)}function wx(e,t){return e.comments.filter(e=>e.anchor.fileId===t&&e.status===`open`).length}function Tx(e){let t=new Map;e.targetType===`issue`&&t.set(`issue:${e.targetId}`,{id:`issue:${e.targetId}`,label:`Issue`,href:`/issues/${encodeURIComponent(e.targetId)}`}),e.targetType===`workspace`&&t.set(`workspace:${e.targetId}`,{id:`workspace:${e.targetId}`,label:`Workspace`,href:`/workspaces?workspace=${encodeURIComponent(e.targetId)}`});for(let n of e.executionTargets??[])t.set(`execution:${n.id}`,{id:`execution:${n.id}`,label:n.label,href:n.href});for(let n of e.comments){let e=n.feedbackSource;!e||e.kind!==`agent-feedback`||(e.runId&&t.set(`run:${e.runId}:${e.effectId??``}`,{id:`run:${e.runId}:${e.effectId??``}`,label:e.effectId?`Run task`:`Run`,href:e.effectId?`/runs/${e.runId}?effectId=${encodeURIComponent(e.effectId)}`:`/runs/${e.runId}`}),e.sessionId&&t.set(`session:${e.sessionId}`,{id:`session:${e.sessionId}`,label:`Session`,href:`/sessions/${e.sessionId}`}))}return Array.from(t.values())}function Ex(e){return e.hunks.some(e=>e.lines.some(e=>typeof e.oldLineNumber==`number`||typeof e.newLineNumber==`number`))}function Dx(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 px-3 py-2`,children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`p`,{className:`mt-1 text-lg font-semibold text-foreground`,children:e.value})]})}function Ox(e){let[t,n]=(0,y.useState)(e.artifact.latestSubmission?.summary??``),[r,i]=(0,y.useState)(e.artifact.latestSubmission?.executionTargetId??``);(0,y.useEffect)(()=>{n(e.artifact.latestSubmission?.summary??``),i(e.artifact.latestSubmission?.executionTargetId??``)},[e.artifact.id,e.artifact.latestSubmission?.executionTargetId,e.artifact.latestSubmission?.summary]);let a=typeof e.onSubmitReview==`function`;async function o(n){if(a){await e.onSubmitReview?.({artifactId:e.artifact.id,decision:n,summary:t.trim()||void 0,executionTargetId:r||void 0});return}if(n===`approved`){await e.onApprove(e.artifact.id);return}await e.onRequestChanges(e.artifact.id)}return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,K.jsx)(Gp,{className:`h-4 w-4 text-primary`}),`Review submission`]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Submit a decision from the review surface and optionally route the follow-up back into a workspace, session, or run context.`}),(0,K.jsxs)(`label`,{className:`mt-3 block text-xs font-medium text-foreground-muted`,children:[`Review summary`,(0,K.jsx)(`textarea`,{className:`mt-2 min-h-[112px] w-full rounded-2xl border border-border bg-background px-3 py-2 text-sm text-foreground outline-none`,placeholder:`Summarize what changed, what still needs work, or what follow-up the execution owner should take.`,value:t,onChange:e=>n(e.target.value)})]}),(e.artifact.executionTargets?.length??0)>0?(0,K.jsxs)(`label`,{className:`mt-3 block text-xs font-medium text-foreground-muted`,children:[`Route follow-up to`,(0,K.jsxs)(`select`,{className:`mt-2 w-full rounded-2xl border border-border bg-background px-3 py-2 text-sm text-foreground outline-none`,value:r,onChange:e=>i(e.target.value),children:[(0,K.jsx)(`option`,{value:``,children:`No direct handoff target`}),e.artifact.executionTargets?.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.label},e.id))]})]}):null,(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,K.jsxs)(Q,{type:`button`,variant:`outline`,onClick:()=>void o(`changes-requested`),disabled:e.pending,children:[(0,K.jsx)(Ip,{className:`mr-2 h-4 w-4`}),`Request changes`]}),(0,K.jsxs)(Q,{type:`button`,variant:`default`,onClick:()=>void o(`approved`),disabled:e.pending,children:[(0,K.jsx)(Pp,{className:`mr-2 h-4 w-4`}),`Approve review`]})]}),e.artifact.latestSubmission?(0,K.jsxs)(`div`,{className:`mt-3 rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-xs`,px(e.artifact.latestSubmission.decision)),children:fx(e.artifact.latestSubmission.decision)}),(0,K.jsxs)(`span`,{className:`ml-2`,children:[`Last submitted `,new Date(e.artifact.latestSubmission.submittedAt).toLocaleString()]}),e.artifact.latestSubmission.executionTargetLabel?(0,K.jsxs)(`p`,{className:`mt-2`,children:[`Follow-up routed to `,e.artifact.latestSubmission.executionTargetLabel,`.`]}):null]}):null]})}function kx(e){return(0,K.jsx)(`div`,{className:`space-y-4`,children:e.file.hunks.map(t=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80`,children:[(0,K.jsx)(`div`,{className:`border-b border-border px-4 py-2 text-xs font-medium text-foreground-muted`,children:t.header}),(0,K.jsx)(`div`,{className:`overflow-x-auto`,children:(0,K.jsx)(`div`,{className:`min-w-[640px] space-y-1 p-3 font-mono text-xs`,children:t.lines.map((n,r)=>{let i=yx(e.file,t.id,n),a=Cx(e.artifact.comments,i),o=i&&e.draftAnchor&&bx(i)===bx(e.draftAnchor),s=i&&e.focusedAnchorKey===bx(i);return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{id:i?xx(i):void 0,className:Y(`grid grid-cols-[96px_minmax(0,1fr)_auto] items-start gap-3 rounded-lg px-3 py-2`,vx(n.kind),s?`ring-1 ring-primary/40`:void 0),children:[(0,K.jsx)(`div`,{className:`text-[11px] text-foreground-muted`,children:Sx(n)}),(0,K.jsx)(`pre`,{className:`whitespace-pre-wrap break-words text-foreground`,children:n.content}),i?(0,K.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-full border border-border px-2 py-1 text-[11px] text-foreground-muted hover:border-primary/30 hover:text-foreground`,onClick:()=>{e.onFocusAnchor(i),e.onChangeDraftBody(``)},children:[(0,K.jsx)(Bp,{className:`h-3 w-3`}),`Comment`]}):(0,K.jsx)(`span`,{})]}),a.length>0?(0,K.jsx)(`div`,{className:`space-y-2 px-4 pb-3`,children:a.map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-background px-3 py-2 text-sm`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author.name}),(0,K.jsx)(`span`,{children:e.author.kind}),e.feedbackSource?(0,K.jsx)(`span`,{className:`rounded-full border border-primary/20 bg-primary/10 px-2 py-0.5 text-primary`,children:e.feedbackSource.label}):null]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm text-foreground`,children:e.body})]},e.id))}):null,o&&i?(0,K.jsxs)(`form`,{className:`mx-4 mb-3 rounded-2xl border border-primary/20 bg-primary/5 p-3`,onSubmit:t=>{t.preventDefault();let n=e.draftBody.trim();n&&(e.onAddComment({artifactId:e.artifact.id,body:n,anchor:i,feedbackSource:e.mapFeedback?{kind:`agent-feedback`,label:`Mapped from inline review follow-up`,sessionId:e.artifact.targetType===`workspace`?`workspace-review-follow-up`:`issue-review-follow-up`}:void 0}),e.onChangeDraftBody(``),e.onFocusAnchor(null))},children:[(0,K.jsxs)(`label`,{className:`text-xs font-medium text-foreground-muted`,children:[`Inline review comment`,(0,K.jsx)(`textarea`,{className:`mt-2 min-h-[96px] w-full rounded-2xl border border-border bg-background px-3 py-2 text-sm text-foreground outline-none`,value:e.draftBody,onChange:t=>e.onChangeDraftBody(t.target.value),placeholder:`Explain the requested change or approval note.`})]}),(0,K.jsxs)(`label`,{className:`mt-3 flex items-center gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.mapFeedback,onChange:t=>e.onChangeMapFeedback(t.target.checked)}),`Map this comment back to agent feedback metadata`]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,K.jsxs)(Q,{type:`submit`,variant:`default`,size:`sm`,children:[(0,K.jsx)(pm,{className:`mr-2 h-4 w-4`}),`Save comment`]}),(0,K.jsx)(Q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>e.onFocusAnchor(null),children:`Cancel`})]})]}):null]},`${t.id}-${r}`)})})})]},t.id))})}function Ax(e){return(0,K.jsx)(`div`,{className:`space-y-4`,children:e.file.hunks.map(t=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80`,children:[(0,K.jsx)(`div`,{className:`border-b border-border px-4 py-2 text-xs font-medium text-foreground-muted`,children:t.header}),(0,K.jsx)(`div`,{className:`overflow-x-auto`,children:(0,K.jsxs)(`div`,{className:`min-w-[960px] p-3`,children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-3 text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:[(0,K.jsx)(`div`,{className:`rounded-lg border border-border px-3 py-2`,children:`Base`}),(0,K.jsx)(`div`,{className:`rounded-lg border border-border px-3 py-2`,children:`Head`}),(0,K.jsx)(`div`,{})]}),(0,K.jsx)(`div`,{className:`mt-2 space-y-1 font-mono text-xs`,children:t.lines.map((n,r)=>{let i=yx(e.file,t.id,n),a=i&&e.focusedAnchorKey===bx(i),o=Cx(e.artifact.comments,i),s=i&&e.draftAnchor&&bx(i)===bx(e.draftAnchor);return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{id:i?xx(i):void 0,className:Y(`grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] items-start gap-3 rounded-lg px-2 py-2`,vx(n.kind),a?`ring-1 ring-primary/40`:void 0),children:[(0,K.jsxs)(`div`,{className:`rounded-lg border border-border/60 px-3 py-2`,children:[(0,K.jsx)(`div`,{className:`text-[11px] text-foreground-muted`,children:typeof n.oldLineNumber==`number`?n.oldLineNumber:``}),(0,K.jsx)(`pre`,{className:`whitespace-pre-wrap break-words text-foreground`,children:n.kind===`add`?``:n.content})]}),(0,K.jsxs)(`div`,{className:`rounded-lg border border-border/60 px-3 py-2`,children:[(0,K.jsx)(`div`,{className:`text-[11px] text-foreground-muted`,children:typeof n.newLineNumber==`number`?n.newLineNumber:``}),(0,K.jsx)(`pre`,{className:`whitespace-pre-wrap break-words text-foreground`,children:n.kind===`delete`?``:n.content})]}),i?(0,K.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-full border border-border px-2 py-1 text-[11px] text-foreground-muted hover:border-primary/30 hover:text-foreground`,onClick:()=>e.onFocusAnchor(i),children:[(0,K.jsx)(Bp,{className:`h-3 w-3`}),`Comment`]}):(0,K.jsx)(`span`,{})]}),o.length>0?(0,K.jsx)(`div`,{className:`space-y-2 px-4 pb-3`,children:o.map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-background px-3 py-2 text-sm`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author.name}),(0,K.jsxs)(`span`,{children:[e.anchor.side,`:`,e.anchor.line]})]}),(0,K.jsx)(`p`,{className:`mt-2 text-foreground`,children:e.body})]},e.id))}):null,s&&i?(0,K.jsxs)(`form`,{className:`mx-4 mb-3 rounded-2xl border border-primary/20 bg-primary/5 p-3`,onSubmit:t=>{t.preventDefault();let n=e.draftBody.trim();n&&(e.onAddComment({artifactId:e.artifact.id,body:n,anchor:i,feedbackSource:e.mapFeedback?{kind:`agent-feedback`,label:`Mapped from inline review follow-up`,sessionId:e.artifact.targetType===`workspace`?`workspace-review-follow-up`:`issue-review-follow-up`}:void 0}),e.onChangeDraftBody(``),e.onFocusAnchor(null))},children:[(0,K.jsxs)(`label`,{className:`text-xs font-medium text-foreground-muted`,children:[`Inline review comment`,(0,K.jsx)(`textarea`,{className:`mt-2 min-h-[96px] w-full rounded-2xl border border-border bg-background px-3 py-2 text-sm text-foreground outline-none`,value:e.draftBody,onChange:t=>e.onChangeDraftBody(t.target.value),placeholder:`Explain the requested change or approval note.`})]}),(0,K.jsxs)(`label`,{className:`mt-3 flex items-center gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.mapFeedback,onChange:t=>e.onChangeMapFeedback(t.target.checked)}),`Map this comment back to agent feedback metadata`]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,K.jsxs)(Q,{type:`submit`,variant:`default`,size:`sm`,children:[(0,K.jsx)(pm,{className:`mr-2 h-4 w-4`}),`Save comment`]}),(0,K.jsx)(Q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>e.onFocusAnchor(null),children:`Cancel`})]})]}):null]},`${t.id}-${r}`)})})]})})]},t.id))})}function jx(e){let[t,n]=(0,y.useState)(e.artifacts[0]?.id??null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(``),[l,u]=(0,y.useState)(!0),[d,f]=(0,y.useState)(null),[p,m]=(0,y.useState)(`unified`);(0,y.useEffect)(()=>{if(e.artifacts.length===0){n(null);return}(!t||!e.artifacts.some(e=>e.id===t))&&n(e.artifacts[0]?.id??null)},[e.artifacts,t]);let h=(0,y.useMemo)(()=>e.artifacts.find(e=>e.id===t)??null,[e.artifacts,t]),g=(0,y.useMemo)(()=>h?Tx(h):[],[h]);(0,y.useEffect)(()=>{if(!h){i(null);return}(!r||!h.diff.some(e=>e.id===r))&&i(h.diff[0]?.id??null),m(h.preferredPresentation??`unified`)},[h,r]);let _=(0,y.useMemo)(()=>h?.diff.find(e=>e.id===r)??h?.diff[0]??null,[h,r]),v=_?Ex(_):!1,b=(0,y.useMemo)(()=>h?h.comments.filter(e=>e.status===`open`):[],[h]),x=(0,y.useMemo)(()=>_&&h?h.comments.filter(e=>e.anchor.fileId===_.id):[],[h,_]);return e.loading&&e.artifacts.length===0?(0,K.jsx)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`review-panel-loading`,children:(0,K.jsxs)(`div`,{className:`animate-pulse space-y-3`,children:[(0,K.jsx)(`div`,{className:`h-4 w-40 rounded bg-background-secondary`}),(0,K.jsx)(`div`,{className:`h-8 w-72 rounded bg-background-secondary`}),(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[320px_minmax(0,1fr)]`,children:[(0,K.jsx)(`div`,{className:`h-64 rounded-2xl bg-background-secondary`}),(0,K.jsx)(`div`,{className:`h-64 rounded-2xl bg-background-secondary`})]})]})}):e.error?(0,K.jsx)(`section`,{className:`rounded-3xl border border-error/30 bg-error/10 p-6 text-sm text-error shadow-lg`,children:e.error}):e.artifacts.length===0||!h?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Review Queue`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:e.title}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:e.empty})]}):(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`review-panel`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`max-w-4xl`,children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Review Queue`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:e.title}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:e.description})]}),e.summary?(0,K.jsxs)(`div`,{className:`grid min-w-[280px] gap-2 sm:grid-cols-2`,children:[(0,K.jsx)(Dx,{label:`Queued`,value:String(e.summary.pendingCount+e.summary.changesRequestedCount)}),(0,K.jsx)(Dx,{label:`Approved`,value:String(e.summary.approvedCount)}),(0,K.jsx)(Dx,{label:`Open comments`,value:String(e.summary.openCommentCount)}),(0,K.jsx)(Dx,{label:`Artifacts`,value:String(e.summary.total)})]}):null]}),(0,K.jsxs)(`div`,{className:`mt-6 grid gap-6 xl:grid-cols-[320px_minmax(0,1fr)]`,children:[(0,K.jsx)(`aside`,{className:`space-y-3`,children:e.queue.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{n(e.artifactId),o(null),c(``),f(null)},className:Y(`w-full rounded-2xl border p-4 text-left transition-colors`,t===e.artifactId?`border-primary/30 bg-primary/5`:`border-border bg-background/70 hover:border-primary/20 hover:bg-background`),children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:e.targetType}),(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-xs`,px(e.decision)),children:fx(e.decision)})]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm font-semibold text-foreground`,children:e.targetLabel}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-foreground-muted`,children:e.title}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,mx(e.queueState)),children:e.queueState}),(0,K.jsxs)(`span`,{children:[e.openCommentCount,` open comments`]})]})]},e.artifactId))}),(0,K.jsxs)(`div`,{className:`space-y-5`,children:[(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-5`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:h.targetLabel}),(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-xs`,px(h.decision)),children:fx(h.decision)}),(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-xs`,mx(h.queueState)),children:h.queueState})]}),(0,K.jsx)(`h3`,{className:`mt-3 text-xl font-semibold tracking-tight`,children:h.title}),h.summary?(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:h.summary}):null,(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-3 text-sm text-foreground-muted`,children:[h.branch?(0,K.jsxs)(`span`,{children:[`Branch: `,h.branch]}):null,(0,K.jsxs)(`span`,{children:[h.diff.length,` files changed`]}),(0,K.jsxs)(`span`,{children:[h.comments.length,` comments`]})]}),g.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:g.map(e=>(0,K.jsxs)(Z,{href:e.href,className:`inline-flex items-center gap-1 rounded-full border border-border px-2.5 py-1 text-foreground-muted hover:border-primary/30 hover:text-primary`,children:[e.label,(0,K.jsx)(Bp,{className:`h-3 w-3`})]},e.id))}):null]})}),h.linkedPullRequest||h.integration?(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[h.linkedPullRequest?(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[gx(h.linkedPullRequest.provider),` PR`,` `,h.linkedPullRequest.number?`#${h.linkedPullRequest.number}`:``]}):null,h.linkedPullRequest?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:h.linkedPullRequest.linkState===`partially-linked`?`partially linked`:h.linkedPullRequest.linkState}):null,h.integration?(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-xs`,hx(h.integration.status)),children:h.integration.status.replace(/-/g,` `)}):null]}),h.linkedPullRequest?.title?(0,K.jsx)(`p`,{className:`mt-2 text-sm text-foreground`,children:h.linkedPullRequest.title}):null,h.linkedPullRequest?(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[h.linkedPullRequest.reviewStatus?(0,K.jsxs)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,_x(h.linkedPullRequest.reviewStatus)),children:[`Review `,h.linkedPullRequest.reviewStatus]}):null,h.linkedPullRequest.mergeStatus?(0,K.jsxs)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,_x(h.linkedPullRequest.mergeStatus)),children:[`Merge `,h.linkedPullRequest.mergeStatus]}):null,h.linkedPullRequest.publishStatus?(0,K.jsxs)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,_x(h.linkedPullRequest.publishStatus)),children:[`Publish `,h.linkedPullRequest.publishStatus]}):null]}):null,(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:h.integration?.guidance??h.linkedPullRequest?.guidance??`No linked PR guidance available.`}),h.linkedPullRequest?.ciGates?.length?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:h.linkedPullRequest.ciGates.map(e=>(0,K.jsxs)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,_x(e.status)),children:[e.name,`: `,e.status]},`${h.id}-${e.id}`))}):null,h.integration?.actions.reason?(0,K.jsx)(`div`,{className:`mt-3 rounded-xl border border-warning/20 bg-warning/10 px-3 py-2 text-sm text-warning`,children:h.integration.actions.reason}):null]}):null]}),(0,K.jsx)(Ox,{artifact:h,pending:e.pendingArtifactId===h.id,onApprove:e.onApprove,onRequestChanges:e.onRequestChanges,onSubmitReview:e.onSubmitReview}),(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,K.jsxs)(`aside`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,K.jsx)(Gp,{className:`h-4 w-4 text-primary`}),`File navigator`]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,K.jsx)(Q,{type:`button`,variant:p===`unified`?`default`:`outline`,size:`sm`,onClick:()=>m(`unified`),children:`Unified`}),(0,K.jsx)(Q,{type:`button`,variant:p===`split`?`default`:`outline`,size:`sm`,onClick:()=>m(`split`),disabled:!v,children:`Side by side`})]}),(0,K.jsx)(`div`,{className:`mt-4 space-y-2`,children:h.diff.map(e=>{let t=wx(h,e.id);return(0,K.jsxs)(`button`,{type:`button`,"data-testid":`review-file-${e.id}`,onClick:()=>{i(e.id),f(null),o(null)},className:Y(`w-full rounded-2xl border p-3 text-left transition-colors`,_?.id===e.id?`border-primary/30 bg-primary/5`:`border-border bg-card hover:border-primary/20 hover:bg-background`),children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.path}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-success/20 bg-success/10 px-2 py-0.5 text-success`,children:[`+`,e.additions]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-error/20 bg-error/10 px-2 py-0.5 text-error`,children:[`-`,e.deletions]}),(0,K.jsxs)(`span`,{children:[t,` open comments`]})]})]},e.id)})})]}),(0,K.jsxs)(`div`,{className:`space-y-4`,children:[_?(0,K.jsxs)(`article`,{className:`overflow-hidden rounded-2xl border border-border bg-background/80`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-b border-border px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Gp,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:_.path})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-xs`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-success/20 bg-success/10 px-2 py-0.5 text-success`,children:[`+`,_.additions]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-error/20 bg-error/10 px-2 py-0.5 text-error`,children:[`-`,_.deletions]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-foreground-muted`,children:p===`split`?`Side by side`:`Unified`})]})]}),(0,K.jsxs)(`div`,{className:`border-b border-border px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(mm,{className:`h-4 w-4 text-primary`}),(0,K.jsxs)(`span`,{children:[x.length,` comments on this file`]})]}),x.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:x.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted hover:border-primary/30 hover:text-primary`,onClick:()=>{f(bx(e.anchor)),i(e.anchor.fileId),o(e.anchor)},children:[e.anchor.side,`:`,e.anchor.line,` · `,e.author.name]},e.id))}):null]}),(0,K.jsx)(`div`,{className:`p-4`,children:p===`split`&&v?(0,K.jsx)(Ax,{artifact:h,file:_,draftAnchor:a,draftBody:s,mapFeedback:l,focusedAnchorKey:d,onChangeDraftBody:c,onChangeMapFeedback:u,onFocusAnchor:e=>{o(e),f(e?bx(e):null)},onAddComment:e.onAddComment}):(0,K.jsx)(kx,{artifact:h,file:_,draftAnchor:a,draftBody:s,mapFeedback:l,focusedAnchorKey:d,onChangeDraftBody:c,onChangeMapFeedback:u,onFocusAnchor:e=>{o(e),f(e?bx(e):null)},onAddComment:e.onAddComment})})]}):null,(h.executionTargets?.length??0)>0?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,K.jsx)(Gp,{className:`h-4 w-4 text-primary`}),`Feedback loop handoff`]}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-3 md:grid-cols-2`,children:h.executionTargets?.map(e=>(0,K.jsxs)(Z,{href:e.href,className:`rounded-2xl border border-border bg-card px-4 py-3 transition-colors hover:border-primary/30 hover:bg-background`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.actionLabel??e.label}),(0,K.jsx)(`div`,{className:`mt-1 text-xs uppercase tracking-[0.18em] text-foreground-muted`,children:e.kind}),e.description?(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:e.description}):null]},e.id))})]}):null]})]}),b.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-4 text-sm text-foreground-muted`,children:`No review comments yet.`}):(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,K.jsx)(mm,{className:`h-4 w-4 text-primary`}),`Review activity`]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2 text-sm text-foreground-muted`,children:h.comments.map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author.name}),(0,K.jsx)(`span`,{children:e.anchor.filePath}),(0,K.jsxs)(`span`,{children:[e.anchor.side,`:`,e.anchor.line]})]}),(0,K.jsx)(`p`,{className:`mt-1 text-foreground`,children:e.body})]},`${h.id}-${e.id}`))})]})]})]})]})}function Mx(e,t){if(t==null)return null;let n=e.slice(0,t),r=n.lastIndexOf(`@`);if(r<0)return null;let i=r===0?``:n.slice(r-1,r);if(i&&/[A-Za-z0-9_]/.test(i))return null;let a=n.slice(r+1);return a.includes(`@`)||/\s/.test(a)?null:{start:r,end:t,query:a}}function Nx(e,t){let n=t.trim().toLowerCase();return n.length===0?e:e.filter(e=>{let t=e.key.toLowerCase(),r=e.label.toLowerCase();return t.includes(n)||r.includes(n)})}function Px({value:e,onValueChange:t,taskTags:n,disabled:r=!1,className:i,emptyText:a=`No matching Task Tags.`,renderTextarea:o}){let s=(0,y.useRef)(null),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(0),f=(0,y.useId)(),p=(0,y.useMemo)(()=>c?Nx(n,c.query):[],[c,n]);(0,y.useEffect)(()=>{d(0)},[c?.query]);function m(){return s.current?.querySelector(`textarea`)??null}function h(t){l(Mx(e,t))}function g(n){c&&(t(e.slice(0,c.start)+n.content+e.slice(c.end)),l(null),d(0),queueMicrotask(()=>{let e=m();if(!e)return;let t=c.start+n.content.length;e.focus(),e.setSelectionRange(t,t)}))}function _(e){if(c){if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),l(null);return}if(p.length!==0){if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),d(e=>(e+1)%p.length);return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),d(e=>(e-1+p.length)%p.length);return}(e.key===`Enter`||e.key===`Tab`)&&(e.preventDefault(),e.stopPropagation(),g(p[u]??p[0]))}}}let v=c&&p.length>0?`${f}-option-${u}`:void 0,b={value:e,disabled:r,onChange:e=>{t(e.currentTarget.value),l(Mx(e.currentTarget.value,e.currentTarget.selectionStart))},onClick:e=>{h(e.currentTarget.selectionStart)},onBlur:()=>{queueMicrotask(()=>{s.current?.contains(document.activeElement)||l(null)})},onKeyDown:_,onKeyUp:e=>{e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Enter`||e.key===`Tab`||e.key===`Escape`||h(e.currentTarget.selectionStart)},onSelect:e=>{h(e.currentTarget.selectionStart)},"aria-autocomplete":`list`,"aria-controls":c?f:void 0,"aria-expanded":c?!0:void 0,"aria-activedescendant":v};return(0,K.jsxs)(`div`,{className:Y(`relative`,i),ref:s,children:[o?o(b):(0,K.jsx)(`textarea`,{...b}),c?(0,K.jsx)(`div`,{className:`absolute inset-x-0 top-full z-20 mt-2 overflow-hidden rounded-2xl border border-border bg-card shadow-xl`,children:p.length>0?(0,K.jsx)(`ul`,{id:f,role:`listbox`,className:`max-h-64 overflow-y-auto py-2`,children:p.map((e,t)=>(0,K.jsxs)(`li`,{id:`${f}-option-${t}`,role:`option`,"aria-selected":t===u,className:Y(`cursor-pointer px-4 py-3 transition-colors`,t===u?`bg-primary/10`:`hover:bg-background/70`),onMouseDown:t=>{t.preventDefault(),g(e)},children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),(0,K.jsxs)(`span`,{className:`font-mono text-xs text-foreground-muted`,children:[`@`,e.key]})]}),e.description?(0,K.jsx)(`p`,{className:`mt-1 text-xs text-foreground-muted`,children:e.description}):null]},e.id))}):(0,K.jsx)(`div`,{className:`px-4 py-3 text-sm text-foreground-muted`,children:a})}):null]})}var Fx=[`todo`,`in-progress`,`review`,`done`];function Ix(e){return e.blocked?`border-error/30 bg-error-muted/70 text-error`:e.workflowState===`done`?`border-success/25 bg-success-muted text-success`:e.workflowState===`review`?`border-primary/25 bg-primary/10 text-primary`:e.workflowState===`in-progress`?`border-warning/25 bg-warning-muted text-warning`:`border-border bg-background text-foreground-secondary`}function Lx(e,t){if(t)return`border-error/30 bg-error-muted/60`;switch(e){case`todo`:return`border-border bg-background/80`;case`in-progress`:return`border-warning/25 bg-warning-muted/50`;case`review`:return`border-primary/20 bg-primary/5`;case`done`:return`border-success/20 bg-success-muted/60`}}function Rx(e){switch(e){case`todo`:return`Todo`;case`in-progress`:return`In Progress`;case`review`:return`Review`;case`done`:return`Done`}}function zx(e,t,n){return e.cards.filter(e=>e.swimlaneId===t&&e.workflowState===n)}function Bx(e){switch(e){case`approved`:case`ready`:case`passing`:case`published`:case`merged`:return`border-success/25 bg-success-muted text-success`;case`pending`:case`in-review`:return`border-warning/25 bg-warning-muted text-warning`;case`changes-requested`:case`blocked`:case`failing`:case`failed`:return`border-error/25 bg-error-muted text-error`;default:return`border-border bg-background text-foreground-muted`}}function Vx(e){return e===`azure-repos`?`Azure Repos`:e}function Hx(e){switch(e){case`connected`:return`border-success/25 bg-success-muted text-success`;case`partial-setup`:case`missing-scopes`:return`border-warning/25 bg-warning-muted text-warning`;case`expired-auth`:case`failing`:return`border-error/25 bg-error-muted text-error`;default:return`border-border bg-background text-foreground-muted`}}function Ux(e){return e.replace(/-/g,` `)}function Wx(e){return e===`partially-linked`?`partially linked`:e}function Gx(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function Kx(e){return Bx(e.status)}function qx(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Jx(e){return e?new Date(e).toLocaleString(`en-US`,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):`No activity yet`}function Yx(e){return`/workspaces?workspace=${encodeURIComponent(e)}`}function Xx(e,t){return`/projects/${encodeURIComponent(e)}/issues/${encodeURIComponent(t)}`}function Zx(e){return`/projects/${encodeURIComponent(e)}/issues/new`}function Qx(e){return`/projects/${encodeURIComponent(e)}/workspaces/new`}function $x(e,t){return`/projects/${encodeURIComponent(e)}/issues/${encodeURIComponent(t)}/workspace/new`}function eS(e){switch(e){case`active`:return`border-success/25 bg-success-muted text-success`;case`archived`:return`border-warning/25 bg-warning-muted text-warning`;case`missing`:return`border-error/25 bg-error-muted text-error`;default:return`border-border bg-background text-foreground-muted`}}async function tS(){let e=await fetch(`/api/workspaces`,{cache:`no-store`});if(!e.ok){let t=await e.json().catch(()=>null);throw Error(t?.error??`Workspace inventory request failed: ${e.status}`)}return await e.json()}function nS(e=`todo`){return{title:``,summary:``,description:``,workflowState:e,status:rS(e),priority:e===`in-progress`||e===`review`?`high`:`medium`,assigneeIds:[],labelIds:[],dependencies:[],acceptanceCriteria:[]}}function rS(e){switch(e){case`in-progress`:return`in-progress`;case`review`:return`review`;case`done`:return`done`;default:return`backlog`}}function iS(e){return e.trim().toLowerCase()}function aS(e,t){return[e.issueKey,e.title,e.summary??``,e.priority,e.readiness,...e.labelNames,...e.assigneeNames,...e.collaboratorNames,...(t?.dispatch.contextLabelProjections??[]).flatMap(e=>[e.key,e.label,e.instruction])].join(` `).toLowerCase()}function oS(e){switch(e){case`critical`:return 0;case`high`:return 1;case`medium`:return 2;default:return 3}}function sS(e){switch(e){case`saving`:return`Autosaving draft…`;case`saved`:return`Draft autosaved locally.`;case`partial`:return`Issue save failed. Draft preserved locally for retry.`;default:return`Draft is empty.`}}function cS(e){return{title:e.title,summary:e.summary??``,description:e.description??``,status:e.status,priority:e.priority,assigneeIds:e.assignees.map(e=>e.id),labelIds:e.labels.map(e=>e.id),dependencies:e.dependencies.map(e=>({issueId:e.issueId,type:e.type})),acceptanceCriteria:e.acceptanceCriteria.map(e=>({id:e.id,title:e.title,satisfied:e.satisfied,notes:e.notes??``})),baseUpdatedAt:e.updatedAt}}function lS(){return{metadata:{status:`idle`,message:null},description:{status:`idle`,message:null},priority:{status:`idle`,message:null},assignees:{status:`idle`,message:null},labels:{status:`idle`,message:null}}}function uS(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function dS(e,t){return e.length===t.length&&e.every((e,n)=>e.issueId===t[n]?.issueId&&e.type===t[n]?.type)}function fS(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.title===t[n]?.title&&e.satisfied===t[n]?.satisfied&&e.notes===t[n]?.notes)}function pS(e,t,n){switch(e){case`metadata`:return t.title!==n.title||t.summary!==(n.summary??``)||t.status!==n.status||!dS(t.dependencies,n.dependencies.map(e=>({issueId:e.issueId,type:e.type})))||!fS(t.acceptanceCriteria,n.acceptanceCriteria.map(e=>({id:e.id,title:e.title,satisfied:e.satisfied,notes:e.notes??``})));case`description`:return t.description!==(n.description??``);case`priority`:return t.priority!==n.priority;case`assignees`:return!uS(t.assigneeIds,n.assignees.map(e=>e.id));case`labels`:return!uS(t.labelIds,n.labels.map(e=>e.id))}}function mS(e,t){return pS(`metadata`,e,t)||pS(`description`,e,t)||pS(`priority`,e,t)||pS(`assignees`,e,t)||pS(`labels`,e,t)}function hS(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function gS({draft:e,project:t,issues:n,taskTags:r,autosaveStatus:i,creatingIssue:a,error:o,validationError:s,onChange:c,onClose:l,onSubmit:u}){let d=n.filter(e=>e.projectId===t.id),[f,p]=(0,y.useState)(d[0]?.id??``),[m,h]=(0,y.useState)(`blocked-by`);return(0,y.useEffect)(()=>{p(e=>e&&d.some(t=>t.id===e)?e:d[0]?.id??``)},[d]),(0,K.jsxs)(`aside`,{className:`rounded-3xl border border-primary/20 bg-background p-5 shadow-lg`,"data-testid":`create-issue-panel`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Create mode`}),(0,K.jsx)(`h3`,{className:`mt-1 text-xl font-semibold text-foreground`,children:`Create issue beside the board`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`New issues open from board-level entry points and stay anchored to the planning surface while draft, validation, save, autosave, and failure state remain explicit.`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:l,className:`inline-flex h-10 items-center justify-center rounded-xl border border-border px-3 text-sm text-foreground-muted`,children:`Close`})]}),(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card px-4 py-3 text-sm text-foreground-muted`,children:sS(i)}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`Target column `,Rx(e.workflowState)]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`Status `,vS(e.status)]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`Priority `,e.priority]})]}),(0,K.jsxs)(`form`,{className:`mt-4 grid gap-4`,onSubmit:e=>{e.preventDefault(),u()},children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Title`,(0,K.jsx)(`input`,{"aria-label":`Issue title`,value:e.title,onChange:e=>c(t=>({...t,title:e.target.value})),placeholder:`Summarize the work item`,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Summary`,(0,K.jsx)(Px,{taskTags:r,value:e.summary,onValueChange:e=>c(t=>({...t,summary:e})),className:`mt-2`,renderTextarea:e=>(0,K.jsx)(`textarea`,{...e,"aria-label":`Issue summary`,placeholder:`Capture the outcome expected from this issue.`,className:`min-h-24 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Description`,(0,K.jsx)(`textarea`,{"aria-label":`Issue description`,value:e.description,onChange:e=>c(t=>({...t,description:e.target.value})),placeholder:`Describe the implementation, rollout, and acceptance notes.`,className:`mt-2 min-h-28 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Target column`,(0,K.jsx)(`select`,{"aria-label":`Target column`,value:e.workflowState,onChange:e=>c(t=>({...t,workflowState:e.target.value,status:rS(e.target.value)})),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:Fx.map(e=>(0,K.jsx)(`option`,{value:e,children:Rx(e)},e))})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Status`,(0,K.jsxs)(`select`,{"aria-label":`Issue status`,value:e.status,onChange:e=>c(t=>({...t,status:e.target.value})),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`backlog`,children:`Backlog`}),(0,K.jsx)(`option`,{value:`ready`,children:`Ready`}),(0,K.jsx)(`option`,{value:`in-progress`,children:`In Progress`}),(0,K.jsx)(`option`,{value:`blocked`,children:`Blocked`}),(0,K.jsx)(`option`,{value:`review`,children:`Review`}),(0,K.jsx)(`option`,{value:`done`,children:`Done`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Priority`,(0,K.jsxs)(`select`,{"aria-label":`Priority`,value:e.priority,onChange:e=>c(t=>({...t,priority:e.target.value})),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`critical`,children:`Critical`}),(0,K.jsx)(`option`,{value:`high`,children:`High`}),(0,K.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,K.jsx)(`option`,{value:`low`,children:`Low`})]})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Assignees`}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:t.team.members.length>0?t.team.members.map(t=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.assigneeIds.includes(t.id),onChange:()=>c(e=>({...e,assigneeIds:hS(e.assigneeIds,t.id)}))}),(0,K.jsx)(`span`,{children:t.displayName})]},`create-issue-assignee-${t.id}`)):(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No assignees are configured for this project yet.`})})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Tags`}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:t.labels.length>0?t.labels.map(t=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.labelIds.includes(t.id),onChange:()=>c(e=>({...e,labelIds:hS(e.labelIds,t.id)}))}),(0,K.jsx)(`span`,{children:t.name})]},`create-issue-label-${t.id}`)):(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No project tags are available yet.`})})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Dependencies`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Link existing issues while authoring instead of patching them later.`})]})}),d.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-[minmax(0,1fr)_160px_auto]`,children:[(0,K.jsx)(`select`,{"aria-label":`Dependency issue`,value:f,onChange:e=>p(e.target.value),className:`h-10 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:d.map(e=>(0,K.jsxs)(`option`,{value:e.id,children:[e.key,`: `,e.title]},`create-dependency-${e.id}`))}),(0,K.jsxs)(`select`,{"aria-label":`Dependency type`,value:m,onChange:e=>h(e.target.value),className:`h-10 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`blocked-by`,children:`Blocked by`}),(0,K.jsx)(`option`,{value:`blocks`,children:`Blocks`}),(0,K.jsx)(`option`,{value:`related`,children:`Related`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{f&&c(e=>{let t={issueId:f,type:m};return e.dependencies.some(e=>e.issueId===t.issueId&&e.type===t.type)?e:{...e,dependencies:[...e.dependencies,t]}})},className:`inline-flex h-10 items-center justify-center rounded-xl border border-border px-3 text-sm font-semibold text-foreground`,children:`Add`})]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:e.dependencies.length>0?e.dependencies.map((e,t)=>{let n=d.find(t=>t.id===e.issueId);return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-3`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:n?.key??e.issueId}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-foreground-muted`,children:n?.title??`Linked dependency`}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,K.jsxs)(`select`,{value:e.type,onChange:e=>c(n=>({...n,dependencies:n.dependencies.map((n,r)=>r===t?{...n,type:e.target.value}:n)})),className:`h-9 rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`blocked-by`,children:`Blocked by`}),(0,K.jsx)(`option`,{value:`blocks`,children:`Blocks`}),(0,K.jsx)(`option`,{value:`related`,children:`Related`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>c(e=>({...e,dependencies:e.dependencies.filter((e,n)=>n!==t)})),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Remove`})]})]},`create-dependency-draft-${e.issueId}-${t}`)}):(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No dependencies configured.`})})]}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No same-project issues are available to link as dependencies yet.`})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Acceptance criteria`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Author criteria up front so issue readiness is explicit from creation time.`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>c(e=>({...e,acceptanceCriteria:[...e.acceptanceCriteria,{title:``,satisfied:!1,notes:``}]})),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Add criterion`})]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:e.acceptanceCriteria.length>0?e.acceptanceCriteria.map((e,t)=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-3`,children:[(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.satisfied,onChange:e=>c(n=>({...n,acceptanceCriteria:n.acceptanceCriteria.map((n,r)=>r===t?{...n,satisfied:e.target.checked}:n)}))}),`Satisfied`]}),(0,K.jsx)(`input`,{"aria-label":`Acceptance criterion ${t+1} title`,value:e.title,onChange:e=>c(n=>({...n,acceptanceCriteria:n.acceptanceCriteria.map((n,r)=>r===t?{...n,title:e.target.value}:n)})),placeholder:`Describe the acceptance condition`,className:`mt-3 h-10 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`}),(0,K.jsx)(`input`,{"aria-label":`Acceptance criterion ${t+1} notes`,value:e.notes,onChange:e=>c(n=>({...n,acceptanceCriteria:n.acceptanceCriteria.map((n,r)=>r===t?{...n,notes:e.target.value}:n)})),placeholder:`Optional note`,className:`mt-2 h-10 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`}),(0,K.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,K.jsx)(`button`,{type:`button`,onClick:()=>c(e=>({...e,acceptanceCriteria:e.acceptanceCriteria.filter((e,n)=>n!==t)})),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Remove`})})]},`create-criterion-draft-${e.id??t}`)):(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No acceptance criteria authored yet.`})})]})]}),s?(0,K.jsx)(`div`,{className:`rounded-2xl border border-error/30 bg-error-muted px-4 py-3 text-sm text-error`,children:s}):null,o?(0,K.jsx)(`div`,{className:`rounded-2xl border border-error/30 bg-error-muted px-4 py-3 text-sm text-error`,children:o}):null,(0,K.jsxs)(`button`,{type:`submit`,disabled:a,className:`inline-flex h-11 items-center justify-center gap-2 rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:[(0,K.jsx)(Cm,{className:`h-4 w-4`}),a?`Creating issue…`:`Create issue`]})]})]})}function _S(e,t,n,r,i,a,o,s,c){return(0,K.jsxs)(`article`,{id:`kanban-issue-${e.issueId}`,className:`rounded-2xl border p-4 ${Ix(e)} ${n?`ring-2 ring-primary/50 ring-offset-2 ring-offset-background`:``}`,"data-testid":`kanban-list-card-${e.issueKey}`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`label`,{className:`inline-flex items-center gap-2 text-xs text-foreground-muted`,children:(0,K.jsx)(`input`,{type:`checkbox`,checked:i,onChange:()=>a(e.issueId),className:`h-4 w-4 rounded border border-border`,"aria-label":`Select ${e.issueKey}`})}),(0,K.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.18em]`,children:e.issueKey}),(0,K.jsx)(`span`,{className:`rounded-full border border-current/20 px-2 py-0.5 text-xs`,children:Rx(e.workflowState)}),(0,K.jsx)(`span`,{className:`rounded-full border border-current/20 px-2 py-0.5 text-xs`,children:e.priority}),(0,K.jsx)(`span`,{className:`rounded-full border border-current/20 px-2 py-0.5 text-xs`,children:e.readiness})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>t&&r(t),className:`mt-2 text-left text-base font-semibold underline-offset-4 hover:underline`,"data-testid":`open-list-issue-${e.issueKey}`,children:e.title}),e.summary?(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 opacity-90`,children:e.summary}):null,(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3 text-xs opacity-80`,children:[(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(Qp,{className:`h-3.5 w-3.5`}),e.dependencyCount,` dependencies`]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(Xm,{className:`h-3.5 w-3.5`}),e.childCount,` child issues`]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(Pp,{className:`h-3.5 w-3.5`}),e.acceptanceProgress.satisfied,`/`,e.acceptanceProgress.total,` accepted`]})]}),(0,K.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:e.moveTargets.map(t=>(0,K.jsxs)(`button`,{disabled:!t.allowed||s===e.issueId,onClick:()=>o(e.issueId,t.state),className:`inline-flex h-11 items-center justify-center gap-2 rounded-md border border-border-hover bg-transparent px-3 text-xs font-medium italic tracking-[0.04em] text-foreground transition-all duration-200 hover:bg-card hover:border-primary/30 hover:shadow-sm disabled:pointer-events-none disabled:opacity-50 font-serif`,"data-testid":`move-list-${e.issueKey}-${t.state}`,children:[(0,K.jsx)(Cp,{className:`h-3.5 w-3.5`}),Rx(t.state)]},`${e.issueId}-${t.state}`))}),c&&e.moveTargets.some(e=>e.signals.length>0)?(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.moveTargets.flatMap(t=>t.signals.map((n,r)=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-background px-3 py-2 text-xs text-foreground-muted`,children:[Rx(t.state),`: `,n.message]},`${e.issueId}-${t.state}-${n.hookId}-${r}`)))}):null]},`list-${e.issueId}`)}function vS(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function yS(e){switch(e){case`done`:return`border-success/25 bg-success-muted text-success`;case`review`:return`border-primary/25 bg-primary/10 text-primary`;case`in-progress`:return`border-warning/25 bg-warning-muted text-warning`;case`blocked`:return`border-error/25 bg-error-muted text-error`;default:return`border-border bg-background text-foreground-muted`}}function bS(e,t){let n=new Set,r=[...e.childIssueIds];for(;r.length>0;){let e=r.shift();if(!e||n.has(e))continue;n.add(e);let i=t.get(e);i&&r.push(...i.childIssueIds)}return n}function xS({project:e,mutating:t,onSave:n}){let[r,i]=(0,y.useState)(e.team.name),[a,o]=(0,y.useState)(e.team.settings.visibility),[s,c]=(0,y.useState)(e.team.settings.defaultRole),[l,u]=(0,y.useState)(e.team.settings.allowSelfAssign),[d,f]=(0,y.useState)(e.settings.reviewRequiredForDone),[p,m]=(0,y.useState)(e.settings.activityScope),[h,g]=(0,y.useState)(e.settings.workspaceProvisioning),[_,v]=(0,y.useState)(e.team.members.map(e=>({id:e.id,displayName:e.displayName,email:e.email??``,role:e.role})));return(0,K.jsxs)(`div`,{className:`mt-5 rounded-3xl border border-border bg-background p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-foreground-muted`,children:`Team and permissions`}),(0,K.jsx)(`h3`,{className:`mt-1 text-lg font-semibold text-foreground`,children:`Shared collaboration state now lives beside the board model`}),(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`Team roster, project policy, activity visibility, and role-based permissions now exist as shared kanban primitives instead of implicit gateway-token access.`})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1 text-xs text-foreground-muted`,children:[e.team.members.length,` collaborators`]})]}),(0,K.jsxs)(`form`,{className:`mt-4 grid gap-3 xl:grid-cols-2`,onSubmit:t=>{t.preventDefault(),n({projectId:e.id,teamName:r,visibility:a,defaultRole:s,allowSelfAssign:l,reviewRequiredForDone:d,activityScope:p,workspaceProvisioning:h,members:_.map(e=>({...e,email:e.email||void 0})),permissions:[...e.permissions]})},children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Team name`,(0,K.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Visibility`,(0,K.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`private`,children:`Private`}),(0,K.jsx)(`option`,{value:`team`,children:`Team`}),(0,K.jsx)(`option`,{value:`workspace-shared`,children:`Workspace shared`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Default role`,(0,K.jsxs)(`select`,{value:s,onChange:e=>c(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`owner`,children:`Owner`}),(0,K.jsx)(`option`,{value:`maintainer`,children:`Maintainer`}),(0,K.jsx)(`option`,{value:`contributor`,children:`Contributor`}),(0,K.jsx)(`option`,{value:`viewer`,children:`Viewer`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Workspace provisioning`,(0,K.jsxs)(`select`,{value:h,onChange:e=>g(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`owners-maintainers`,children:`Owners and maintainers`}),(0,K.jsx)(`option`,{value:`contributors-and-up`,children:`Contributors and up`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Activity scope`,(0,K.jsxs)(`select`,{value:p,onChange:e=>m(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`project-and-issues`,children:`Project and issues`}),(0,K.jsx)(`option`,{value:`all-board-entities`,children:`All board entities`})]})]}),(0,K.jsxs)(`label`,{className:`col-span-full flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>u(e.target.checked),className:`h-4 w-4 rounded border border-border`}),`Allow contributors to self-assign issues`]}),(0,K.jsxs)(`label`,{className:`col-span-full flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:d,onChange:e=>f(e.target.checked),className:`h-4 w-4 rounded border border-border`}),`Require review completion before cards can reach done`]}),(0,K.jsxs)(`div`,{className:`col-span-full rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Km,{className:`h-4 w-4`}),`Team roster`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>v(e=>[...e,{id:`member-${e.length+1}`,displayName:``,email:``,role:s}]),className:`inline-flex items-center gap-2 rounded-xl border border-border px-3 py-2 text-xs font-semibold text-foreground`,children:[(0,K.jsx)(Gm,{className:`h-3.5 w-3.5`}),`Add member`]})]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:_.map((e,t)=>(0,K.jsxs)(`div`,{className:`grid gap-3 xl:grid-cols-[1fr_1fr_180px_auto]`,children:[(0,K.jsx)(`input`,{value:e.displayName,onChange:e=>v(n=>n.map((n,r)=>r===t?{...n,displayName:e.target.value}:n)),placeholder:`Display name`,className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground`}),(0,K.jsx)(`input`,{value:e.email,onChange:e=>v(n=>n.map((n,r)=>r===t?{...n,email:e.target.value}:n)),placeholder:`email@example.com`,className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground`}),(0,K.jsxs)(`select`,{value:e.role,onChange:e=>v(n=>n.map((n,r)=>r===t?{...n,role:e.target.value}:n)),className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`owner`,children:`Owner`}),(0,K.jsx)(`option`,{value:`maintainer`,children:`Maintainer`}),(0,K.jsx)(`option`,{value:`contributor`,children:`Contributor`}),(0,K.jsx)(`option`,{value:`viewer`,children:`Viewer`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>v(e=>e.filter((e,n)=>n!==t)),className:`inline-flex h-11 items-center justify-center rounded-xl border border-border px-3 text-sm text-foreground-muted`,children:(0,K.jsx)(Um,{className:`h-4 w-4`})})]},`${e.id}-${t}`))})]}),(0,K.jsxs)(`div`,{className:`col-span-full rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Pm,{className:`h-4 w-4`}),`Permission matrix`]}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-3 xl:grid-cols-2`,children:e.permissions.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-3`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e.action}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-foreground-muted`,children:e.description}),(0,K.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:e.roles.map(t=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:qx(t)},`${e.action}-${t}`))})]},e.action))})]}),(0,K.jsx)(`button`,{type:`submit`,disabled:t,className:`inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:`Save collaboration settings`})]}),(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(yp,{className:`h-4 w-4`}),`Project activity`]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:e.activity.slice(0,4).map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background px-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:e.actor.displayName}),(0,K.jsx)(`span`,{children:Jx(e.createdAt)})]}),(0,K.jsx)(`div`,{className:`mt-1 text-sm font-semibold text-foreground`,children:e.summary})]},e.id))})]})]})}function SS({card:e,project:t,activityEntries:n,mutating:r,onSave:i}){let[a,o]=(0,y.useState)(t.team.members.filter(t=>e.assigneeNames.includes(t.displayName)).map(e=>e.id)),[s,c]=(0,y.useState)(t.team.members.filter(t=>e.collaboratorNames.includes(t.displayName)).map(e=>e.id));return(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border/80 bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Km,{className:`h-4 w-4`}),`Collaboration`]}),(0,K.jsxs)(`div`,{className:`mt-2 text-sm text-foreground-muted`,children:[e.assigneeNames.length,` assignees, `,e.collaboratorNames.length,` collaborators,`,` `,e.activityCount,` activity entries`]}),(0,K.jsxs)(`form`,{className:`mt-4 grid gap-4 lg:grid-cols-2`,onSubmit:t=>{t.preventDefault(),i({issueId:e.issueId,assigneeIds:a,collaboratorIds:s})},children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-3`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:`Assignees`}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:t.team.members.map(e=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:a.includes(e.id),onChange:t=>o(n=>t.target.checked?[...n,e.id]:n.filter(t=>t!==e.id)),className:`h-4 w-4 rounded border border-border`}),(0,K.jsx)(`span`,{className:`text-foreground`,children:e.displayName}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:qx(e.role)})]},`assignee-${e.id}`))})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-3`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:`Collaborators`}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:t.team.members.map(e=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:s.includes(e.id),onChange:t=>c(n=>t.target.checked?[...n,e.id]:n.filter(t=>t!==e.id)),className:`h-4 w-4 rounded border border-border`}),(0,K.jsx)(`span`,{className:`text-foreground`,children:e.displayName}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:qx(e.role)})]},`collaborator-${e.id}`))})]}),(0,K.jsx)(`button`,{type:`submit`,disabled:r,className:`inline-flex h-11 items-center justify-center rounded-xl border border-border bg-card px-4 text-sm font-semibold text-foreground disabled:opacity-50`,children:`Save collaboration`})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[e.assigneeNames.map(e=>(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[`Assignee `,e]},`assignee-chip-${e}`)),e.collaboratorNames.map(e=>(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[`Collaborator `,e]},`collaborator-chip-${e}`))]}),(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card p-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(yp,{className:`h-4 w-4`}),`Issue activity`]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:n.slice(0,3).map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:e.actor.displayName}),(0,K.jsx)(`span`,{children:Jx(e.createdAt)})]}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-foreground`,children:e.summary})]},e.id))})]})]})}function CS({issue:e,dispatchContextLabels:t,mutating:n,onSave:r}){let[i,a]=(0,y.useState)(e.dispatch.contextLabels.map(e=>e.labelId));return(0,y.useEffect)(()=>{a(e.dispatch.contextLabels.map(e=>e.labelId))},[e.id,e.dispatch.contextLabels]),(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,"data-testid":`issue-dispatch-context-panel`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Dispatch Context Labels`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Attach reusable dispatch instructions here. These are not board labels, Task Tags, or default agent settings.`})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[i.length,` attached`]})]}),t.length>0?(0,K.jsxs)(`form`,{className:`mt-4`,onSubmit:t=>{t.preventDefault(),r({issueId:e.id,dispatchContextLabelIds:i})},children:[(0,K.jsx)(`div`,{className:`space-y-2`,children:t.map(e=>(0,K.jsxs)(`label`,{className:`flex items-start gap-3 rounded-2xl border border-border bg-card px-3 py-3 text-sm`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:i.includes(e.id),onChange:t=>a(n=>t.target.checked?[...n,e.id]:n.filter(t=>t!==e.id)),className:`mt-1 h-4 w-4 rounded border border-border`}),(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsx)(`span`,{className:`block font-semibold text-foreground`,children:e.label}),(0,K.jsx)(`span`,{className:`block text-xs text-foreground-muted`,children:e.key}),e.description?(0,K.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-foreground-muted`,children:e.description}):null]})]},e.id))}),(0,K.jsx)(`button`,{type:`submit`,disabled:n,className:`mt-4 inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:`Save dispatch context`})]}):(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No reusable Dispatch Context Labels exist yet. Create definitions in Settings first, then attach them here by reference.`}),(e.dispatch.contextLabelProjections??[]).length>0?(0,K.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:(e.dispatch.contextLabelProjections??[]).map(t=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:t.key},`${e.id}-${t.labelId}`))}):null,e.dispatch.renderedContext?(0,K.jsx)(`pre`,{className:`mt-4 whitespace-pre-wrap rounded-2xl border border-border bg-card px-3 py-3 text-xs text-foreground-secondary`,children:e.dispatch.renderedContext}):(0,K.jsx)(`div`,{className:`mt-4 text-xs text-foreground-muted`,children:`No dispatch context is currently rendered for this issue.`})]})}function wS({card:e,mutating:t,onLinkRepository:n,onUpdateRepositorySettings:r,onCreatePullRequest:i}){let a=e.repository,o=e.repositoryLifecycle,s=o?.integration,[c,l]=(0,y.useState)(a?.owner??`a5c-ai`),[u,d]=(0,y.useState)(a?.name??`babysitter`),[f,p]=(0,y.useState)(a?.provider===`azure-repos`?`azure-repos`:`github`),[m,h]=(0,y.useState)(o?.branchName??`feature/${e.issueKey.toLowerCase()}`),[g,_]=(0,y.useState)(a?.defaultBranch??`main`),[v,b]=(0,y.useState)(a?.settings.baseBranch??`main`),[x,S]=(0,y.useState)(a?.settings.ciProvider??`GitHub Actions`),[C,w]=(0,y.useState)(a?.settings.publishTarget??`npm`),[T,E]=(0,y.useState)(a?.settings.requiredApprovals??1),[D,O]=(0,y.useState)(a?.settings.autoMerge??!1),[k,A]=(0,y.useState)(`${e.issueKey}: ${e.title}`),[j,M]=(0,y.useState)(o?.pullRequest?.reviewLinks.map(e=>e.reviewer??e.label).join(`, `)??`kanban-maintainers`);return!a||!o?(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-dashed border-border/80 bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Xp,{className:`h-4 w-4`}),`Repository lifecycle`]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Link this work item to a shared repository context before opening a PR or surfacing CI, merge, and publish state.`}),(0,K.jsxs)(`form`,{className:`mt-4 grid gap-3 md:grid-cols-2`,onSubmit:t=>{t.preventDefault(),n({issueId:e.issueId,provider:f,owner:c,name:u,branchName:m,defaultBranch:g})},children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Provider`,(0,K.jsxs)(`select`,{value:f,onChange:e=>p(e.target.value===`azure-repos`?`azure-repos`:`github`),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`github`,children:`GitHub`}),(0,K.jsx)(`option`,{value:`azure-repos`,children:`Azure Repos`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Repo owner`,(0,K.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Repo name`,(0,K.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Branch`,(0,K.jsx)(`input`,{value:m,onChange:e=>h(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Default branch`,(0,K.jsx)(`input`,{value:g,onChange:e=>_(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsx)(`button`,{type:`submit`,disabled:t,className:`inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:`Link repository`})]})]}):(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border/80 bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Xp,{className:`h-4 w-4`}),a.fullName]}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:["Branch `",o.branchName,"` into `",a.settings.baseBranch,"`"]})]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:Vx(a.provider)})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${Bx(o.reviewStatus)}`,children:[`Review `,Gx(o.reviewStatus)]}),(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${Bx(o.mergeStatus)}`,children:[`Merge `,Gx(o.mergeStatus)]}),(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${Bx(o.publishStatus)}`,children:[`Publish `,Gx(o.publishStatus)]}),s?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${Hx(s.status)}`,children:[Vx(s.provider),` `,Ux(s.status)]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[`PR `,Wx(s.linkState)]})]}):null]}),s?(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card/80 p-4`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:`Integration guidance`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:s.guidance}),s.actions.reason?(0,K.jsx)(`div`,{className:`mt-3 rounded-xl border border-warning/20 bg-warning/10 px-3 py-2 text-sm text-warning`,children:s.actions.reason}):null,s.missingScopes?.length?(0,K.jsxs)(`div`,{className:`mt-3 rounded-xl border border-warning/20 bg-warning/10 px-3 py-2 text-sm text-warning`,children:[`Missing scopes: `,s.missingScopes.join(`, `)]}):null]}):null,o.pullRequest?(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Qp,{className:`h-4 w-4`}),`PR #`,o.pullRequest.number,(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${Bx(o.pullRequest.status)}`,children:Gx(o.pullRequest.status)}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:Wx(o.pullRequest.linkState??`linked`)})]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm text-foreground`,children:o.pullRequest.title}),o.pullRequest.reviewLinks.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:o.pullRequest.reviewLinks.map(e=>(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${Kx(e)}`,children:[e.label,`: `,Gx(e.status)]},e.id))}):null]}):(0,K.jsxs)(`form`,{className:`mt-4 grid gap-3 md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]`,onSubmit:t=>{t.preventDefault(),i({issueId:e.issueId,title:k,reviewers:j})},children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`PR title`,(0,K.jsx)(`input`,{value:k,onChange:e=>A(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Reviewers`,(0,K.jsx)(`input`,{value:j,onChange:e=>M(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsx)(`button`,{type:`submit`,disabled:t||(s?!s.actions.canCreatePullRequest:!1),className:`inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:`Create PR`})]}),s&&!s.actions.canCreatePullRequest&&!o.pullRequest?(0,K.jsxs)(`p`,{className:`mt-3 text-sm text-warning`,children:[`Linked PR creation is disabled until `,Vx(s.provider),` setup issues are resolved.`]}):null,(0,K.jsxs)(`div`,{className:`mt-4`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:`CI gates`}),(0,K.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:o.ciGates.map(e=>(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${Bx(e.status)}`,children:[e.name,`: `,Gx(e.status)]},e.id))})]}),(0,K.jsxs)(`form`,{className:`mt-4 grid gap-3 md:grid-cols-2`,onSubmit:t=>{t.preventDefault(),r({issueId:e.issueId,baseBranch:v,ciProvider:x,publishTarget:C,autoMerge:D,requiredApprovals:T})},children:[(0,K.jsxs)(`div`,{className:`col-span-full flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[(0,K.jsx)(Mm,{className:`h-4 w-4`}),`Repo settings`]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Base branch`,(0,K.jsx)(`input`,{value:v,onChange:e=>b(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`CI provider`,(0,K.jsx)(`input`,{value:x,onChange:e=>S(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Publish target`,(0,K.jsx)(`input`,{value:C,onChange:e=>w(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Required approvals`,(0,K.jsx)(`input`,{type:`number`,min:0,value:T,onChange:e=>E(Number(e.target.value)||0),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`col-span-full flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:D,onChange:e=>O(e.target.checked),className:`h-4 w-4 rounded border border-border`}),`Enable auto-merge when approvals and CI gates pass`]}),(0,K.jsx)(`button`,{type:`submit`,disabled:t,className:`inline-flex h-11 items-center justify-center rounded-xl border border-border bg-card px-4 text-sm font-semibold text-foreground disabled:opacity-50`,children:`Save repo settings`})]})]})}function TS({issue:e,card:t,reviewArtifact:n,project:r,issues:i,dispatchContextLabels:a,taskTags:o,loading:s,mutating:c,mutationError:l,draft:u,fieldStates:d,priorityEditing:f,assigneeEditing:p,labelEditing:m,onFocusIssue:h,onOpenDedicatedPage:g,onClose:_,onChangeDraft:v,onResetDraft:b,onRetryDescriptionSave:x,onSaveField:S,onSetPriorityEditing:C,onSetAssigneeEditing:w,onSetLabelEditing:T,onResetField:E,onCreateSubIssue:D,onLinkChildIssue:O,onSaveDispatchContextLabels:k,workspaceInventory:A,onRefreshWorkspaceInventory:j,onCreateIssueWorkspace:M,onLinkIssueWorkspace:N,onOpenWorkspacePath:P}){let F=new Map(i.map(e=>[e.id,e])),I=e.parentIssueId?F.get(e.parentIssueId):void 0,L=e.childIssueIds.map(e=>F.get(e)).filter(e=>!!e),R=bS(e,F),z=new Set,ee=e.parentIssueId;for(;ee;)z.add(ee),ee=F.get(ee)?.parentIssueId;let te=i.filter(t=>t.projectId===e.projectId&&t.id!==e.id&&!e.childIssueIds.includes(t.id)&&!R.has(t.id)&&!z.has(t.id)&&!t.parentIssueId),ne=i.filter(t=>t.projectId===e.projectId&&t.id!==e.id),[re,ie]=(0,y.useState)(``),[ae,oe]=(0,y.useState)(``),[se,ce]=(0,y.useState)(`medium`),[le,ue]=(0,y.useState)(`backlog`),[de,fe]=(0,y.useState)(te[0]?.id??``),[pe,me]=(0,y.useState)(ne[0]?.id??``),[he,ge]=(0,y.useState)(`blocked-by`),_e=(0,y.useRef)(null),ve=r.labels,ye=mS(u,e),be=ye&&u.baseUpdatedAt!==e.updatedAt,xe=l?.issueId===e.id?l.message:null,B=n?.linkedPullRequest,Se=B?.ciGates??t?.repositoryLifecycle?.ciGates??[],Ce=[...n?.comments??[]].slice(-2).reverse(),we=(0,y.useMemo)(()=>new Map(A.items.map(e=>[e.path,e])),[A.items]),Te=e.workspaceLinks??[],Ee=A.items.filter(e=>!e.missing&&!Te.some(t=>t.workspacePath===e.path)),[V,De]=(0,y.useState)(Ee[0]?.path??``);(0,y.useEffect)(()=>{fe(e=>e&&te.some(t=>t.id===e)?e:te[0]?.id??``)},[te]),(0,y.useEffect)(()=>{De(e=>e&&Ee.some(t=>t.path===e)?e:Ee[0]?.path??``)},[Ee]),(0,y.useEffect)(()=>{me(e=>e&&ne.some(t=>t.id===e)?e:ne[0]?.id??``)},[ne]);function Oe(e){let t=_e.current;if(!t){v(t=>({...t,description:t.description?`${t.description}\n${e}`:e}));return}let n=t.selectionStart??t.value.length,r=t.selectionEnd??t.value.length,i=t.value.slice(0,n),a=t.value.slice(r);v(t=>({...t,description:`${i}${e}${a}`})),requestAnimationFrame(()=>{t.focus();let r=n+e.length;t.setSelectionRange(r,r)})}function ke(e){return e.trim()?(0,K.jsx)(`div`,{className:`space-y-2 text-sm leading-6 text-foreground`,children:e.split(`
|
|
66
|
+
`).map((e,t)=>{let n=e.trim();return n?n.startsWith(`# `)?(0,K.jsx)(`div`,{className:`text-lg font-semibold text-foreground`,children:n.slice(2)},`description-preview-${t}`):n.startsWith(`- [ ] `)?(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(`span`,{className:`mt-1 h-4 w-4 rounded border border-border`}),(0,K.jsx)(`span`,{children:n.slice(6)})]},`description-preview-${t}`):n.startsWith(`- `)?(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(`span`,{className:`mt-1.5 h-2 w-2 rounded-full bg-foreground-muted`}),(0,K.jsx)(`span`,{children:n.slice(2)})]},`description-preview-${t}`):(0,K.jsx)(`p`,{children:n},`description-preview-${t}`):(0,K.jsx)(`div`,{className:`h-2`},`description-preview-${t}`)})}):(0,K.jsx)(`p`,{className:`text-sm text-foreground-muted`,children:`No description authored yet.`})}return(0,K.jsxs)(`aside`,{className:`rounded-3xl border border-border bg-card p-5 shadow-lg`,"data-testid":`issue-detail-panel`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Issue detail`}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`h3`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:e.key}),(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${yS(e.status)}`,children:vS(e.status)}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:e.dispatch.readiness})]}),(0,K.jsx)(`p`,{className:`mt-2 text-base font-semibold text-foreground`,children:e.title}),e.summary?(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:e.summary}):null,(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[e.childIssueIds.length,` child issues`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[e.dependencies.length,` dependencies`]}),t?(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[Rx(t.workflowState),` context`]}):null]})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>g(e),className:`inline-flex h-11 items-center justify-center rounded-xl border border-border px-4 text-sm font-semibold text-foreground-muted`,children:`Open page`}),(0,K.jsx)(`button`,{type:`button`,onClick:_,className:`inline-flex h-11 items-center justify-center rounded-xl border border-border px-4 text-sm font-semibold text-foreground-muted`,children:`Close issue`})]}),be?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-warning/30 bg-warning-muted px-4 py-3 text-sm text-warning`,children:`Server state changed while unsaved edits were still open. Reset to the latest version or keep your local draft and retry after refreshing.`}):null,xe?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-error/30 bg-error-muted px-4 py-3 text-sm text-error`,children:xe}):null,(0,K.jsxs)(`section`,{className:`mt-5 rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Issue profile`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Shared issue metadata now edits through the same mutation-backed flow as the board.`})]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[pS(`metadata`,u,e)?(0,K.jsx)(`button`,{type:`button`,onClick:()=>E(`metadata`),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Reset`}):null,(0,K.jsx)(`button`,{type:`button`,onClick:()=>S(`metadata`),disabled:!pS(`metadata`,u,e)||d.metadata.status===`saving`,className:`inline-flex h-9 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-3 text-xs font-semibold text-primary disabled:opacity-50`,children:d.metadata.status===`saving`?`Saving…`:`Save profile`})]})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4 xl:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Title`,(0,K.jsx)(`input`,{value:u.title,onChange:e=>v(t=>({...t,title:e.target.value})),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Status`,(0,K.jsxs)(`select`,{value:u.status,onChange:e=>v(t=>({...t,status:e.target.value})),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`backlog`,children:`Backlog`}),(0,K.jsx)(`option`,{value:`ready`,children:`Ready`}),(0,K.jsx)(`option`,{value:`in-progress`,children:`In Progress`}),(0,K.jsx)(`option`,{value:`blocked`,children:`Blocked`}),(0,K.jsx)(`option`,{value:`review`,children:`Review`}),(0,K.jsx)(`option`,{value:`done`,children:`Done`})]})]})]}),(0,K.jsxs)(`label`,{className:`mt-4 block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Summary`,(0,K.jsx)(Px,{taskTags:o,value:u.summary,onValueChange:e=>v(t=>({...t,summary:e})),className:`mt-2`,renderTextarea:e=>(0,K.jsx)(`textarea`,{...e,className:`min-h-24 w-full rounded-2xl border border-border bg-card px-3 py-3 text-sm text-foreground`})})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4 xl:grid-cols-2`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Dependencies`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Link blockers and related work directly from the detail surface.`})]})}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,K.jsx)(`select`,{value:pe,onChange:e=>me(e.target.value),className:`h-10 min-w-[180px] flex-1 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:ne.map(e=>(0,K.jsxs)(`option`,{value:e.id,children:[e.key,` · `,e.title]},`dependency-option-${e.id}`))}),(0,K.jsxs)(`select`,{value:he,onChange:e=>ge(e.target.value),className:`h-10 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`blocked-by`,children:`Blocked by`}),(0,K.jsx)(`option`,{value:`blocks`,children:`Blocks`}),(0,K.jsx)(`option`,{value:`related`,children:`Related`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{pe&&v(e=>e.dependencies.some(e=>e.issueId===pe&&e.type===he)?e:{...e,dependencies:[...e.dependencies,{issueId:pe,type:he}]})},className:`inline-flex h-10 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Add`})]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:u.dependencies.length>0?u.dependencies.map((e,t)=>{let n=F.get(e.issueId);return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background px-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>n&&h(n),className:`text-sm font-semibold text-foreground underline-offset-4 hover:underline`,children:n?.key??e.issueId}),(0,K.jsx)(`span`,{className:`text-sm text-foreground-muted`,children:n?.title??`Linked dependency`})]}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,K.jsxs)(`select`,{value:e.type,onChange:e=>v(n=>({...n,dependencies:n.dependencies.map((n,r)=>r===t?{...n,type:e.target.value}:n)})),className:`h-9 rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`blocked-by`,children:`Blocked by`}),(0,K.jsx)(`option`,{value:`blocks`,children:`Blocks`}),(0,K.jsx)(`option`,{value:`related`,children:`Related`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>v(e=>({...e,dependencies:e.dependencies.filter((e,n)=>n!==t)})),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Remove`})]})]},`dependency-draft-${e.issueId}-${e.type}-${t}`)}):(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No dependencies configured.`})})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Acceptance criteria`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Criteria now stay editable instead of living only in seeded snapshots.`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>v(e=>({...e,acceptanceCriteria:[...e.acceptanceCriteria,{title:``,satisfied:!1,notes:``}]})),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Add criterion`})]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:u.acceptanceCriteria.length>0?u.acceptanceCriteria.map((e,t)=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-3`,children:[(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.satisfied,onChange:e=>v(n=>({...n,acceptanceCriteria:n.acceptanceCriteria.map((n,r)=>r===t?{...n,satisfied:e.target.checked}:n)}))}),`Satisfied`]}),(0,K.jsx)(`input`,{value:e.title,onChange:e=>v(n=>({...n,acceptanceCriteria:n.acceptanceCriteria.map((n,r)=>r===t?{...n,title:e.target.value}:n)})),placeholder:`Describe the acceptance condition`,className:`mt-3 h-10 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`}),(0,K.jsx)(`input`,{value:e.notes,onChange:e=>v(n=>({...n,acceptanceCriteria:n.acceptanceCriteria.map((n,r)=>r===t?{...n,notes:e.target.value}:n)})),placeholder:`Optional note`,className:`mt-2 h-10 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`}),(0,K.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,K.jsx)(`button`,{type:`button`,onClick:()=>v(e=>({...e,acceptanceCriteria:e.acceptanceCriteria.filter((e,n)=>n!==t)})),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Remove`})})]},`criterion-draft-${e.id??t}`)):(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No acceptance criteria authored yet.`})})]})]}),d.metadata.message?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border px-4 py-3 text-sm ${d.metadata.status===`error`?`border-error/30 bg-error-muted text-error`:`border-success/30 bg-success-muted text-success`}`,children:d.metadata.message}):null]}),(0,K.jsxs)(`section`,{className:`mt-5 rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Description`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`The panel now behaves like an authoring surface, not a static summary.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${d.description.status===`error`?`border-error/25 bg-error-muted text-error`:d.description.status===`saving`?`border-warning/25 bg-warning-muted text-warning`:d.description.status===`saved`?`border-success/25 bg-success-muted text-success`:`border-border text-foreground-muted`}`,children:d.description.status===`saving`?`Autosaving`:d.description.status===`saved`?`Saved`:d.description.status===`error`?`Recovery needed`:ye?`Local draft`:`In sync`}),ye?(0,K.jsx)(`button`,{type:`button`,onClick:b,className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Reset draft`}):null]})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>Oe(`# `),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Heading`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>Oe(`- `),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Bullet`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>Oe(`- [ ] `),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Checklist`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>Oe("```\n\n```"),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Code`}),d.description.status===`error`?(0,K.jsx)(`button`,{type:`button`,onClick:x,className:`inline-flex h-9 items-center justify-center rounded-xl border border-error/30 bg-error-muted px-3 text-xs font-semibold text-error`,children:`Retry save`}):null]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 xl:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Editor`,(0,K.jsx)(`textarea`,{ref:_e,value:u.description,onChange:e=>v(t=>({...t,description:e.target.value})),placeholder:`Describe the work, add checklists, and capture recovery notes.`,className:`mt-2 min-h-40 w-full rounded-2xl border border-border bg-card px-3 py-3 text-sm text-foreground`,"data-testid":`issue-description-editor`})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,"data-testid":`issue-description-preview`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:`Preview`}),(0,K.jsx)(`div`,{className:`mt-3`,children:ke(u.description)})]})]}),d.description.message?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border px-4 py-3 text-sm ${d.description.status===`error`?`border-error/30 bg-error-muted text-error`:`border-success/30 bg-success-muted text-success`}`,children:d.description.message}):null]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-4`,children:[n||t?.repositoryLifecycle?(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Review and PR context`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Shared review output and linked PR state stay visible on the active issue, not only in the queue panel.`})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[n?(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 ${Bx(n.decision)}`,children:[`Review `,n.decision]}):null,(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 ${Bx(B?.reviewStatus??t?.repositoryLifecycle?.reviewStatus??`unlinked`)}`,children:[`PR review `,B?.reviewStatus??t?.repositoryLifecycle?.reviewStatus??`unlinked`]}),(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 ${Bx(B?.mergeStatus??t?.repositoryLifecycle?.mergeStatus??`not-ready`)}`,children:[`Merge `,B?.mergeStatus??t?.repositoryLifecycle?.mergeStatus??`not-ready`]}),(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 ${Bx(B?.publishStatus??t?.repositoryLifecycle?.publishStatus??`not-ready`)}`,children:[`Publish `,B?.publishStatus??t?.repositoryLifecycle?.publishStatus??`not-ready`]})]}),B?.title||t?.repositoryLifecycle?.pullRequest?.title?(0,K.jsxs)(`div`,{className:`mt-3 rounded-2xl border border-border bg-card px-4 py-3`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:B?.title??t?.repositoryLifecycle?.pullRequest?.title}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:B?`${Vx(B.provider)} PR ${B.number?`#${B.number}`:``}`:t?.repositoryLifecycle?.pullRequest?`PR #${t.repositoryLifecycle.pullRequest.number}`:`Linked PR`})]}):null,Se.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:Se.map(e=>(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 ${Bx(e.status)}`,children:[e.name,`: `,Gx(e.status)]},`issue-detail-${e.id}`))}):null,Ce.length>0?(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:Ce.map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-[11px] text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:e.author.name}),(0,K.jsx)(`span`,{children:e.anchor.filePath}),(0,K.jsxs)(`span`,{children:[e.anchor.side,`:`,e.anchor.line]})]}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,children:e.body})]},`issue-review-${e.id}`))}):n?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No review comments have been mapped back to this issue yet.`}):null]}):null,(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Priority`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Field-level save keeps rank changes separate from editor autosave.`})]}),(0,K.jsx)(`div`,{className:`flex gap-2`,children:f?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>S(`priority`),disabled:!pS(`priority`,u,e)||d.priority.status===`saving`,className:`inline-flex h-9 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-3 text-xs font-semibold text-primary disabled:opacity-50`,children:d.priority.status===`saving`?`Saving…`:`Save`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{E(`priority`),C(!1)},className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Cancel`})]}):(0,K.jsx)(`button`,{type:`button`,onClick:()=>C(!0),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Edit`})})]}),s?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`Loading priority controls…`}):f?(0,K.jsx)(`div`,{className:`mt-3`,children:(0,K.jsxs)(`select`,{"aria-label":`Issue priority`,value:u.priority,onChange:e=>v(t=>({...t,priority:e.target.value})),className:`h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`critical`,children:`Critical`}),(0,K.jsx)(`option`,{value:`high`,children:`High`}),(0,K.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,K.jsx)(`option`,{value:`low`,children:`Low`})]})}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-border bg-card px-4 py-3 text-sm text-foreground`,children:e.priority}),d.priority.message?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border px-4 py-3 text-sm ${d.priority.status===`error`?`border-error/30 bg-error-muted text-error`:`border-success/30 bg-success-muted text-success`}`,children:d.priority.message}):null]}),(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Assignees`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Empty, loading, edit, and error states stay explicit.`})]}),(0,K.jsx)(`div`,{className:`flex gap-2`,children:p?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>S(`assignees`),disabled:!pS(`assignees`,u,e)||d.assignees.status===`saving`,className:`inline-flex h-9 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-3 text-xs font-semibold text-primary disabled:opacity-50`,children:d.assignees.status===`saving`?`Saving…`:`Save`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{E(`assignees`),w(!1)},className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Cancel`})]}):(0,K.jsx)(`button`,{type:`button`,onClick:()=>w(!0),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Edit`})})]}),s?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`Loading assignee options…`}):p?(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,"data-testid":`issue-assignee-edit`,children:r.team.members.map(e=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:u.assigneeIds.includes(e.id),onChange:()=>v(t=>({...t,assigneeIds:hS(t.assigneeIds,e.id)}))}),(0,K.jsx)(`span`,{children:e.displayName})]},`issue-assignee-${e.id}`))}):e.assignees.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.assignees.map(e=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:e.displayName},`issue-assignee-chip-${e.id}`))}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`issue-assignee-empty`,children:`No assignees yet.`}),d.assignees.message?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border px-4 py-3 text-sm ${d.assignees.status===`error`?`border-error/30 bg-error-muted text-error`:`border-success/30 bg-success-muted text-success`}`,children:d.assignees.message}):null]}),(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Tags`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Shared project labels now behave like editable issue tags from the side panel.`})]}),ve.length>0?(0,K.jsx)(`div`,{className:`flex gap-2`,children:m?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>S(`labels`),disabled:!pS(`labels`,u,e)||d.labels.status===`saving`,className:`inline-flex h-9 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-3 text-xs font-semibold text-primary disabled:opacity-50`,children:d.labels.status===`saving`?`Saving…`:`Save`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{E(`labels`),T(!1)},className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Cancel`})]}):(0,K.jsx)(`button`,{type:`button`,onClick:()=>T(!0),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Edit`})}):null]}),s?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`Loading tag controls…`}):ve.length===0?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`issue-tags-empty`,children:`No project tags configured yet.`}):m?(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,"data-testid":`issue-tags-edit`,children:ve.map(e=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:u.labelIds.includes(e.id),onChange:()=>v(t=>({...t,labelIds:hS(t.labelIds,e.id)}))}),(0,K.jsx)(`span`,{children:e.name})]},`issue-label-${e.id}`))}):e.labels.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.labels.map(e=>(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[(0,K.jsx)(Bm,{className:`h-3.5 w-3.5`}),e.name]},`issue-label-chip-${e.id}`))}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No tags applied to this issue.`}),d.labels.message?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border px-4 py-3 text-sm ${d.labels.status===`error`?`border-error/30 bg-error-muted text-error`:`border-success/30 bg-success-muted text-success`}`,children:d.labels.message}):null]}),(0,K.jsx)(CS,{issue:e,dispatchContextLabels:a,mutating:c,onSave:k})]}),(0,K.jsxs)(`section`,{className:`mt-5 rounded-2xl border border-border bg-background/80 p-4`,"data-testid":`issue-workspace-panel`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Xp,{className:`h-4 w-4`}),`Linked workspaces`]}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Create a new execution workspace from this issue or attach one or more existing workspaces.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>M(e),disabled:c,className:`inline-flex h-10 items-center justify-center gap-2 rounded-xl border border-primary/30 bg-primary/10 px-3 text-xs font-semibold text-primary disabled:opacity-50`,children:[(0,K.jsx)(Cm,{className:`h-3.5 w-3.5`}),`Create workspace`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:j,disabled:A.loading,className:`inline-flex h-10 items-center justify-center gap-2 rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted disabled:opacity-50`,children:[(0,K.jsx)(Dm,{className:`h-3.5 w-3.5`}),`Refresh`]})]})]}),A.loading?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`issue-workspace-loading`,children:`Loading workspace association state…`}):null,A.error?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-error/25 bg-error-muted p-3 text-sm text-error`,"data-testid":`issue-workspace-error`,children:A.error}):null,Te.length>0?(0,K.jsx)(`div`,{className:`mt-4 space-y-3`,"data-testid":`linked-workspaces-list`,children:Te.map(t=>{let n=we.get(t.workspacePath),r=n?.status??`stale-link`;return(0,K.jsx)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-semibold text-foreground`,children:t.workspaceName}),(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${eS(r)}`,children:r===`stale-link`?`stale link`:r}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:t.source===`created-from-issue`?`created from issue`:`linked existing workspace`})]}),(0,K.jsx)(`div`,{className:`mt-2 font-mono text-xs text-foreground-muted`,children:t.workspacePath}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[t.branchName?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:t.branchName}):null,(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`Linked `,Jx(t.linkedAt)]}),n?.issues&&n.issues.length>1?(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[n.issues.length,` issue associations`]}):null]})]}),n?(0,K.jsxs)(`button`,{type:`button`,onClick:()=>P(n.path),className:`inline-flex h-10 items-center justify-center gap-2 rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,"data-testid":`open-workspace-${n.path}`,children:[(0,K.jsx)(lm,{className:`h-3.5 w-3.5`}),`Open workspace`]}):(0,K.jsxs)(`button`,{type:`button`,onClick:()=>P(),className:`inline-flex h-10 items-center justify-center gap-2 rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,"data-testid":`recover-workspace-${t.workspacePath}`,children:[(0,K.jsx)(Dm,{className:`h-3.5 w-3.5`}),`Open workspaces`]})]})},`${e.id}-${t.workspacePath}`)})}):A.loading?null:(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`issue-workspace-empty`,children:`No workspaces are linked to this issue yet.`}),(0,K.jsxs)(`form`,{className:`mt-4 rounded-2xl border border-border bg-card p-4`,onSubmit:t=>{t.preventDefault(),V&&N({issueId:e.id,workspacePath:V}).then(()=>j())},"data-testid":`link-workspace-form`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Link existing workspace`}),Ee.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`select`,{"aria-label":`Existing workspace`,value:V,onChange:e=>De(e.target.value),className:`mt-3 h-11 w-full rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:Ee.map(e=>(0,K.jsxs)(`option`,{value:e.path,children:[e.name,` - `,e.path]},e.path))}),(0,K.jsx)(`button`,{type:`submit`,disabled:c||!V,className:`mt-3 inline-flex h-11 items-center justify-center rounded-xl border border-border bg-background px-4 text-sm font-semibold text-foreground disabled:opacity-50`,children:`Link workspace`})]}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`link-workspace-empty`,children:`Every available workspace is already attached or waiting on recovery.`})]})]}),(0,K.jsxs)(`section`,{className:`mt-5 rounded-2xl border border-border bg-background/80 p-4`,"data-testid":`issue-relationship-panel`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Xm,{className:`h-4 w-4`}),`Parent and child issue flow`]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4 xl:grid-cols-2`,children:[(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-card p-4`,"data-testid":`parent-relationship-section`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(xp,{className:`h-4 w-4`}),`Parent issue`]}),s?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`parent-relationship-loading`,children:`Refreshing parent relationship state…`}):xe?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-error/25 bg-error-muted p-3 text-sm text-error`,"data-testid":`parent-relationship-error`,children:xe}):I?(0,K.jsxs)(`div`,{className:`mt-3 rounded-2xl border border-border bg-background p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>h(I),className:`text-sm font-semibold text-foreground underline-offset-4 hover:underline`,"data-testid":`back-to-parent-${I.key}`,children:[`Back to `,I.key]}),(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${yS(I.status)}`,children:vS(I.status)})]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm text-foreground`,children:I.title}),(0,K.jsxs)(`div`,{className:`mt-2 text-xs text-foreground-muted`,children:[`Parent readiness: `,I.dispatch.readiness]})]}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`parent-relationship-empty`,children:`No parent issue linked.`})]}),(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-card p-4`,"data-testid":`child-relationship-section`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Xm,{className:`h-4 w-4`}),`Child issues`]}),s?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`child-relationship-loading`,children:`Refreshing child relationship state…`}):xe?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-error/25 bg-error-muted p-3 text-sm text-error`,"data-testid":`child-relationship-error`,children:xe}):L.length>0?(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:L.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>h(e),className:`text-sm font-semibold text-foreground underline-offset-4 hover:underline`,"data-testid":`child-nav-${e.key}`,children:e.key}),(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${yS(e.status)}`,children:vS(e.status)}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:e.dispatch.readiness})]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm text-foreground`,children:e.title})]},e.id))}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`child-relationship-empty`,children:`No child issues linked yet.`}),(0,K.jsxs)(`form`,{className:`mt-4 grid gap-3 rounded-2xl border border-border bg-background p-4`,onSubmit:t=>{t.preventDefault(),re.trim()&&D({parentIssueId:e.id,title:re,summary:ae||void 0,priority:se,status:le}).then(()=>{ie(``),oe(``),ce(`medium`),ue(`backlog`)}).catch(()=>void 0)},"data-testid":`create-sub-issue-form`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Create sub-issue`}),(0,K.jsx)(`input`,{"aria-label":`Sub-issue title`,value:re,onChange:e=>ie(e.target.value),placeholder:`Break out a child issue`,className:`h-11 rounded-xl border border-border bg-card px-3 text-sm text-foreground`}),(0,K.jsx)(Px,{taskTags:o,value:ae,onValueChange:oe,className:`min-h-24`,renderTextarea:e=>(0,K.jsx)(`textarea`,{...e,"aria-label":`Sub-issue summary`,placeholder:`Optional context for the child issue`,className:`min-h-24 rounded-xl border border-border bg-card px-3 py-3 text-sm text-foreground`})}),(0,K.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Priority`,(0,K.jsxs)(`select`,{"aria-label":`Sub-issue priority`,value:se,onChange:e=>ce(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`critical`,children:`Critical`}),(0,K.jsx)(`option`,{value:`high`,children:`High`}),(0,K.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,K.jsx)(`option`,{value:`low`,children:`Low`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Initial status`,(0,K.jsxs)(`select`,{"aria-label":`Sub-issue status`,value:le,onChange:e=>ue(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`backlog`,children:`Backlog`}),(0,K.jsx)(`option`,{value:`ready`,children:`Ready`}),(0,K.jsx)(`option`,{value:`in-progress`,children:`In Progress`}),(0,K.jsx)(`option`,{value:`blocked`,children:`Blocked`}),(0,K.jsx)(`option`,{value:`review`,children:`Review`}),(0,K.jsx)(`option`,{value:`done`,children:`Done`})]})]})]}),(0,K.jsx)(`button`,{type:`submit`,disabled:c,className:`inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:`Create child issue`})]}),(0,K.jsxs)(`form`,{className:`mt-4 rounded-2xl border border-border bg-background p-4`,onSubmit:t=>{t.preventDefault(),de&&O({parentIssueId:e.id,childIssueId:de}).catch(()=>void 0)},"data-testid":`link-child-issue-form`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Link existing child issue`}),te.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`select`,{"aria-label":`Existing child issue`,value:de,onChange:e=>fe(e.target.value),className:`mt-3 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:te.map(e=>(0,K.jsxs)(`option`,{value:e.id,children:[e.key,` - `,e.title]},e.id))}),(0,K.jsx)(`button`,{type:`submit`,disabled:c,className:`mt-3 inline-flex h-11 items-center justify-center rounded-xl border border-border bg-card px-4 text-sm font-semibold text-foreground disabled:opacity-50`,children:`Link child issue`})]}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`link-child-issue-empty`,children:`No unparented sibling issues are available to link here.`})]})]})]})]})]})}function ES({projectId:e,routeBasePath:t,forcedPresentation:n,routeMode:r=`board`,initialIssueId:i,initialIssueKey:a,initialProjectId:o}={}){let s=hf(),c=_f(),{taskTags:l}=dx(),{snapshot:u,board:d,summary:f,loading:p,error:m,moveIssue:h,linkRepository:g,updateRepositorySettings:_,createPullRequest:v,createIssue:b,updateProjectCollaboration:x,updateIssueCollaboration:S,updateIssueDispatchContextLabels:C,createSubIssue:w,linkChildIssue:T,updateIssueDetail:E,createIssueWorkspace:D,linkIssueWorkspace:O,movingIssueId:k,mutatingIssueId:A,creatingIssue:j,mutationError:M,refresh:N}=sy(),P=Yb({targetType:`issue`}),F=(0,y.useMemo)(()=>new Map(P.artifacts.map(e=>[e.targetId,e])),[P.artifacts]),I=r===`board`?c.get(`issueId`):i??null,L=r===`board`?c.get(`issueKey`):a??null,R=e??o??`default`,[z,ee]=ux(`backlog-presentation`,`board`),te=n??z,[ne,re]=ux(`kanban-search-${R}`,``),[ie,ae]=ux(`kanban-workflow-filter-${R}`,`all`),[oe,se]=ux(`kanban-readiness-filter-${R}`,`all`),[ce,le]=ux(`kanban-assignee-filter-${R}`,`all`),[ue,de]=ux(`kanban-tag-filter-${R}`,`all`),[fe,pe]=ux(`kanban-sort-mode-${R}`,`board-order`),[me,he]=ux(`kanban-show-empty-swimlanes-${R}`,!1),[ge,_e]=ux(`kanban-show-policy-signals-${R}`,!0),[ve,ye]=(0,y.useState)([]),[be,xe]=(0,y.useState)(`in-progress`),[B,Se]=(0,y.useState)(null),[Ce,we]=(0,y.useState)(null),[Te,Ee]=(0,y.useState)(r===`create`?{source:`header`,workflowState:`todo`}:null),[V,De]=ux(`board-create-draft`,nS()),[Oe,ke]=(0,y.useState)(`idle`),[Ae,je]=(0,y.useState)(null),[Me,Ne]=(0,y.useState)(null),[Pe,Fe]=(0,y.useState)(null),[Ie,Le]=ux(`issue-detail-drafts`,{}),[Re,ze]=(0,y.useState)(lS()),[Be,Ve]=(0,y.useState)(!1),[He,Ue]=(0,y.useState)(!1),[We,Ge]=(0,y.useState)(!1),[Ke,qe]=(0,y.useState)({items:[],loading:!1,error:null}),Je=(0,y.useRef)(null);(0,y.useEffect)(()=>{let e=I?document.getElementById(`kanban-issue-${I}`):L?document.querySelector(`[data-testid="kanban-card-${L}"]`):null;e&&typeof e.scrollIntoView==`function`&&e.scrollIntoView({behavior:`smooth`,block:`center`})},[I,L]),(0,y.useEffect)(()=>{if(!Te)return;let e=nS(Te.workflowState);if(V.title===e.title&&V.summary===e.summary&&V.description===e.description&&V.workflowState===e.workflowState&&V.status===e.status&&V.priority===e.priority&&uS(V.assigneeIds,e.assigneeIds)&&uS(V.labelIds,e.labelIds)&&dS(V.dependencies,e.dependencies)&&fS(V.acceptanceCriteria,e.acceptanceCriteria)){ke(`idle`);return}ke(`saving`);let t=window.setTimeout(()=>{ke(`saved`)},250);return()=>window.clearTimeout(t)},[Te,V.acceptanceCriteria,V.assigneeIds,V.dependencies,V.description,V.labelIds,V.priority,V.status,V.summary,V.title,V.workflowState]);let Ye=new Map((u?.issues??[]).map(e=>[e.id,e])),H=(I?Ye.get(I):void 0)??(L?u?.issues.find(e=>e.key===L):void 0),Xe=(e?u?.projects.find(t=>t.id===e):void 0)??(o?u?.projects.find(e=>e.id===o):void 0)??(H?u?.projects.find(e=>e.id===H.projectId):void 0)??u?.projects[0],Ze=Xe?d?.projects.find(e=>e.projectId===Xe.id):void 0,Qe=H&&Ze?Ze.cards.find(e=>e.issueId===H.id):void 0,$e=H?Ie[H.id]??cS(H):null,et=u?.issues.find(e=>e.key===`KANBAN-GAP-004`)??u?.issues.find(e=>e.key===`KANBAN-DEBT-003`),tt=iS(ne);if((0,y.useEffect)(()=>{let e=H?.id??null;Je.current!==e&&(Je.current=e,ze(lS()),Ve(!1),Ue(!1),Ge(!1))},[H?.id]),(0,y.useEffect)(()=>{H&&Le(e=>{let t=e[H.id],n=cS(H);return!t||!mS(t,H)?{...e,[H.id]:n}:e})},[H,Le]),(0,y.useEffect)(()=>{if(!H||!$e||!pS(`description`,$e,H)||$e.baseUpdatedAt!==H.updatedAt)return;ze(e=>({...e,description:{status:`saving`,message:null}}));let e=window.setTimeout(()=>{gt(`description`)},450);return()=>window.clearTimeout(e)},[H,$e]),(0,y.useEffect)(()=>{if(!H)return;let e=!1;return qe(e=>({...e,loading:!0,error:null})),tS().then(t=>{e||qe({items:[...t.workspaces],loading:!1,error:null})}).catch(t=>{e||qe({items:[],loading:!1,error:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},[H?.id]),p&&!u)return(0,K.jsx)(`section`,{className:`mb-6 rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`backlog-overview-loading`,children:(0,K.jsxs)(`div`,{className:`animate-pulse space-y-3`,children:[(0,K.jsx)(`div`,{className:`h-4 w-36 rounded bg-background-secondary`}),(0,K.jsx)(`div`,{className:`h-8 w-80 rounded bg-background-secondary`}),(0,K.jsx)(`div`,{className:`grid gap-3 md:grid-cols-4`,children:Array.from({length:4}).map((e,t)=>(0,K.jsx)(`div`,{className:`h-20 rounded-2xl bg-background-secondary`},t))})]})});if(m||!u||!f||!d)return(0,K.jsx)(`section`,{className:`mb-6 rounded-3xl border border-error/25 bg-error-muted p-6 text-sm text-error shadow-lg`,"data-testid":`backlog-overview-error`,children:`Failed to load issue backlog model.`});let nt=Ze?Ze.swimlanes.flatMap(e=>Fx.flatMap(t=>zx(Ze,e.id,t))):[],rt=new Map(nt.map((e,t)=>[e.issueId,t])),it=nt.filter(e=>{let t=Ye.get(e.issueId);return!(!t||ie!==`all`&&e.workflowState!==ie||oe!==`all`&&e.readiness!==oe||ce!==`all`&&!t.assignees.some(e=>e.id===ce)||ue!==`all`&&!t.labels.some(e=>e.id===ue)||tt.length>0&&!aS(e,t).includes(tt))}).slice().sort((e,t)=>fe===`priority`?oS(e.priority)-oS(t.priority)||(rt.get(e.issueId)??0)-(rt.get(t.issueId)??0):fe===`activity`?Date.parse(t.latestActivityAt??``)-Date.parse(e.latestActivityAt??``)||(rt.get(e.issueId)??0)-(rt.get(t.issueId)??0):fe===`title`?e.title.localeCompare(t.title)||e.issueKey.localeCompare(t.issueKey):(rt.get(e.issueId)??0)-(rt.get(t.issueId)??0)),U=new Set(it.map(e=>e.issueId)),at=it.map(e=>e.issueId).join(`|`),ot=it.filter(e=>ve.includes(e.issueId)),st=it.length>0&&it.every(e=>ve.includes(e.issueId)),ct=Xe?.team.members??[],W=Xe?.labels??[],lt=t?`${t}/${te}`:`/`,ut=Fx.filter(e=>ot.every(t=>t.moveTargets.some(t=>t.state===e)));if((0,y.useEffect)(()=>{ye(e=>{let t=e.filter(e=>U.has(e));return t.length===e.length?e:t})},[at]),!Xe||!Ze)return null;if(r===`create`)return(0,K.jsxs)(`section`,{className:`mb-6 space-y-4`,"data-testid":`issue-create-route`,children:[(0,K.jsx)(`div`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Issue authoring`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight text-foreground`,children:`Create a first-class issue`}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:`This route uses the same shared mutation-backed create flow as the board while giving issue authoring its own stable URL.`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:Tt,className:`inline-flex h-11 items-center justify-center rounded-xl border border-border px-4 text-sm font-semibold text-foreground-muted`,children:`Back to board`})]})}),Te?(0,K.jsx)(gS,{draft:V,project:Xe,issues:u.issues.filter(e=>e.projectId===Xe.id),taskTags:l,autosaveStatus:Oe,creatingIssue:j,error:Ae,validationError:Me,onChange:e=>{Ne(null),je(null),De(t=>e(t))},onClose:Tt,onSubmit:()=>void _t()}):null]});if(r===`issue`)return!H||!$e?(0,K.jsx)(`section`,{className:`mb-6 rounded-3xl border border-error/25 bg-error-muted p-6 text-sm text-error shadow-lg`,children:`Issue not found in the current backlog snapshot.`}):(0,K.jsxs)(`section`,{className:`mb-6 space-y-4`,"data-testid":`issue-detail-route`,children:[(0,K.jsx)(`div`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Issue detail`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight text-foreground`,children:H.key}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:`Dedicated issue routes now sit beside the board so issue authoring and maintenance can happen on stable deep links instead of only inside the home-page side panel.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>s.push(Zx(H.projectId)),className:`inline-flex h-11 items-center gap-2 rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary`,children:[(0,K.jsx)(Cm,{className:`h-4 w-4`}),`New issue`]}),(0,K.jsx)(`button`,{type:`button`,onClick:Tt,className:`inline-flex h-11 items-center justify-center rounded-xl border border-border px-4 text-sm font-semibold text-foreground-muted`,children:`Back to board`})]})]})}),(0,K.jsx)(TS,{issue:H,card:Qe,reviewArtifact:F.get(H.id),project:Xe,issues:u.issues.filter(e=>e.projectId===Xe.id),dispatchContextLabels:u.dispatchContextLabels??[],taskTags:l,loading:p,mutating:A===H.id,mutationError:M,draft:$e,fieldStates:Re,priorityEditing:Be,assigneeEditing:He,labelEditing:We,onFocusIssue:wt,onOpenDedicatedPage:e=>s.push(Xx(e.projectId,e.id)),onClose:Tt,onChangeDraft:pt,onResetDraft:ht,onRetryDescriptionSave:()=>void gt(`description`),onSaveField:e=>void gt(e),onSetPriorityEditing:Ve,onSetAssigneeEditing:Ue,onSetLabelEditing:Ge,onResetField:mt,onCreateSubIssue:w,onLinkChildIssue:T,onSaveDispatchContextLabels:C,workspaceInventory:Ke,onRefreshWorkspaceInventory:Et,onCreateIssueWorkspace:Ot,onLinkIssueWorkspace:O,onOpenWorkspacePath:Dt})]});function dt(e,t=`todo`){Tt(),Ee({source:e,workflowState:t}),De(nS(t)),je(null),Ne(null),ke(`idle`),Fe(null)}function ft(){Ee(null),De(nS()),je(null),Ne(null),ke(`idle`)}function pt(e){H&&Le(t=>{let n=t[H.id]??cS(H);return{...t,[H.id]:e(n)}})}function mt(e){if(!H)return;let t=cS(H);pt(n=>({...n,title:e===`metadata`?t.title:n.title,summary:e===`metadata`?t.summary:n.summary,status:e===`metadata`?t.status:n.status,priority:e===`priority`?t.priority:n.priority,assigneeIds:e===`assignees`?t.assigneeIds:n.assigneeIds,labelIds:e===`labels`?t.labelIds:n.labelIds,dependencies:e===`metadata`?t.dependencies:n.dependencies,acceptanceCriteria:e===`metadata`?t.acceptanceCriteria:n.acceptanceCriteria})),ze(t=>({...t,[e]:{status:`idle`,message:null}}))}function ht(){H&&(Le(e=>({...e,[H.id]:cS(H)})),ze(lS()))}async function gt(e){if(!H||!$e)return;let t=e===`metadata`?{title:$e.title,summary:$e.summary,status:$e.status,dependencies:$e.dependencies,acceptanceCriteria:$e.acceptanceCriteria.map(e=>({id:e.id,title:e.title,satisfied:e.satisfied,notes:e.notes.trim()||void 0}))}:e===`description`?{description:$e.description}:e===`priority`?{priority:$e.priority}:e===`assignees`?{assigneeIds:$e.assigneeIds}:{labelIds:$e.labelIds};ze(t=>({...t,[e]:{status:`saving`,message:null}}));try{let n=(await E({issueId:H.id,expectedUpdatedAt:$e.baseUpdatedAt,...t})).snapshot.issues.find(e=>e.id===H.id);n&&Le(e=>({...e,[H.id]:cS(n)})),ze(t=>({...t,[e]:{status:`saved`,message:e===`metadata`?`Issue profile saved.`:e===`description`?`Description saved.`:e===`priority`?`Priority saved.`:e===`assignees`?`Assignees saved.`:`Tags saved.`}})),e===`priority`&&Ve(!1),e===`assignees`&&Ue(!1),e===`labels`&&Ge(!1)}catch(t){ze(n=>({...n,[e]:{status:`error`,message:t instanceof Error?t.message:e===`metadata`?`Issue profile save failed.`:e===`description`?`Description save failed.`:`Field save failed.`}}))}}async function _t(){if(Te){if(!V.title.trim()){Ne(`Title is required before the issue can be created.`);return}if(Ne(null),je(null),!Xe){Ne(`A project must be selected before creating an issue.`);return}try{let t=await b({projectId:e??o??Xe.id,title:V.title.trim(),summary:V.summary.trim()||void 0,description:V.description.trim()||void 0,status:V.status,assigneeIds:V.assigneeIds,labelIds:V.labelIds,dependencies:V.dependencies,acceptanceCriteria:V.acceptanceCriteria.map(e=>({id:e.id,title:e.title,satisfied:e.satisfied,notes:e.notes.trim()||void 0})),priority:V.priority,metadata:{createSource:Te.source,createWorkflowState:V.workflowState,createMode:r===`create`?`route`:`board`}});if(r===`create`){s.push(Xx(t.issue.projectId,t.issue.id));return}Fe(`Created ${t.issue.key} from ${Te.source===`column`?`column header`:`board header`} create mode.`),ft()}catch(e){je(e instanceof Error?e.message:`Failed to create issue.`),ke(`partial`)}}}let vt=e=>{if(t){let n=new URLSearchParams(c.toString()).toString();s.push(n?`${t}/${e}?${n}`:`${t}/${e}`);return}ee(e)},yt=e=>{ye(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},bt=()=>{ye(e=>st?e.filter(e=>!U.has(e)):Array.from(new Set([...e,...it.map(e=>e.issueId)])))},xt=(e,t)=>{h(e,t)};async function St(){if(ot.length===0)return;Se(`move`),we(null);let e=0,t=0;try{for(let n of ot){if(!n.moveTargets.find(e=>e.state===be)?.allowed){t+=1;continue}await h(n.issueId,be),e+=1}ye([]),we(t>0?`Moved ${e} issue${e===1?``:`s`} to ${Rx(be)}. ${t} stayed put because policy checks blocked the transition.`:`Moved ${e} issue${e===1?``:`s`} to ${Rx(be)}.`)}finally{Se(null)}}async function Ct(){if(ot.length===0)return;Se(`workspace`),we(null);let e=0,t=0;try{for(let n of ot){let r=Ye.get(n.issueId);if(!r||(r.workspaceLinks?.length??0)>0){t+=1;continue}await D(n.issueId),e+=1}ye([]),we(t>0?`Provisioned ${e} workspace${e===1?``:`s`}. ${t} issue${t===1?``:`s`} already had a linked workspace.`:`Provisioned ${e} workspace${e===1?``:`s`} from the current selection.`)}finally{Se(null)}}function wt(e){if(r===`issue`){s.push(Xx(e.projectId,e.id));return}ft();let t=new URLSearchParams(c.toString());t.set(`issueId`,e.id),t.set(`issueKey`,e.key),s.push(`${lt}?${t.toString()}`)}function Tt(){if(r===`issue`||r===`create`){s.push(lt);return}let e=new URLSearchParams(c.toString());e.delete(`issueId`),e.delete(`issueKey`);let t=e.toString();s.push(t?`${lt}?${t}`:lt)}function Et(){H&&(qe(e=>({...e,loading:!0,error:null})),tS().then(e=>{qe({items:[...e.workspaces],loading:!1,error:null})}).catch(e=>{qe({items:[],loading:!1,error:e instanceof Error?e.message:String(e)})}))}function Dt(e){s.push(e?Yx(e):`/workspaces`)}function Ot(e){s.push($x(e.projectId,e.id))}let kt=H?`issue`:Te?`create`:null;return(0,K.jsxs)(`section`,{className:`mb-6 rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`backlog-overview`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`max-w-4xl`,children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Kanban Board`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight text-foreground`,children:`Real board mechanics now sit on shared workflow primitives`}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:"The dashboard no longer stops at a backlog summary. Columns, swimlanes, WIP limits, and move validation are computed from shared `agent-mux` board state, and card transitions persist through the backlog service instead of living in a local-only client model."})]}),(0,K.jsxs)(`div`,{className:`min-w-[260px] rounded-2xl border border-border bg-background p-4`,children:[(0,K.jsx)(`div`,{className:`text-xs uppercase tracking-[0.2em] text-foreground-muted`,children:`Primary Project`}),(0,K.jsx)(`div`,{className:`mt-2 text-lg font-semibold text-foreground`,children:Xe.name}),(0,K.jsxs)(`div`,{className:`mt-3 text-sm text-foreground-muted`,children:[Xe.metrics.totalIssues,` issues tracked`]}),Xe.linkedRunSummary?(0,K.jsxs)(`div`,{className:`mt-2 text-sm text-foreground-muted`,children:[Xe.linkedRunSummary.activeRuns,` live runs linked`]}):null]})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 md:grid-cols-4`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(om,{className:`h-4 w-4`}),`Scope`]}),(0,K.jsx)(`div`,{className:`mt-3 text-2xl font-semibold text-foreground`,children:f.issueCount}),(0,K.jsxs)(`div`,{className:`text-sm text-foreground-muted`,children:[f.projectCount,` project models`]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-warning/25 bg-warning-muted p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-warning`,children:[(0,K.jsx)(Xm,{className:`h-4 w-4`}),`Active WIP`]}),(0,K.jsx)(`div`,{className:`mt-3 text-2xl font-semibold text-warning`,children:f.inProgressCount}),(0,K.jsxs)(`div`,{className:`text-sm text-warning/80`,children:[f.needsDecompositionCount,` waiting on decomposition`]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-primary/25 bg-primary/10 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-primary`,children:[(0,K.jsx)(Hm,{className:`h-4 w-4`}),`Review Queue`]}),(0,K.jsx)(`div`,{className:`mt-3 text-2xl font-semibold text-primary`,children:(P.summary?.pendingCount??0)+(P.summary?.changesRequestedCount??0)}),(0,K.jsx)(`div`,{className:`text-sm text-primary/80`,children:`shared issue review artifacts awaiting action`})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-error/25 bg-error-muted p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-error`,children:[(0,K.jsx)(Np,{className:`h-4 w-4`}),`Blocked`]}),(0,K.jsx)(`div`,{className:`mt-3 text-2xl font-semibold text-error`,children:f.blockedCount}),(0,K.jsxs)(`div`,{className:`text-sm text-error/80`,children:[f.completedCount,` completed`]})]})]}),et?(0,K.jsxs)(`div`,{className:`mt-5 rounded-2xl border border-border bg-background p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-primary/25 bg-primary/10 px-2.5 py-1 text-xs font-semibold text-primary`,children:et.key}),(0,K.jsx)(`span`,{className:`text-sm font-semibold text-foreground`,children:et.title}),(0,K.jsx)(`span`,{className:`text-sm text-foreground-muted`,children:et.status})]}),et.summary?(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:et.summary}):null,(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:et.acceptanceCriteria.map(e=>(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-border bg-card px-2.5 py-1 text-xs text-foreground-secondary`,children:[(0,K.jsx)(Pp,{className:`h-3.5 w-3.5`}),e.title]},e.id))})]}):null,Xe.repositories.length>0?(0,K.jsxs)(`div`,{className:`mt-5 rounded-3xl border border-border bg-background p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-foreground-muted`,children:`Repository context`}),(0,K.jsx)(`h3`,{className:`mt-1 text-lg font-semibold text-foreground`,children:"Shared repository settings stay below `packages/agent-mux/webui`"})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1 text-xs text-foreground-muted`,children:[Xe.repositories.length,` linked repos`]})]}),(0,K.jsx)(`div`,{className:`mt-4 grid gap-3 xl:grid-cols-2`,children:Xe.repositories.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-card p-4`,"data-testid":`repository-context-${e.id}`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Xp,{className:`h-4 w-4`}),e.fullName]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:Vx(e.provider)})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`Base `,e.settings.baseBranch]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`CI `,e.settings.ciProvider??`Unconfigured`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`Publish `,e.settings.publishTarget??`Unconfigured`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[e.settings.requiredApprovals,` approvals`]})]})]},e.id))})]}):null,(0,K.jsx)(xS,{project:Xe,mutating:!!A,onSave:x}),(0,K.jsx)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:Ze.policyHooks.map(e=>(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-border bg-background px-3 py-1 text-xs text-foreground-muted`,children:[(0,K.jsx)(Nm,{className:`h-3.5 w-3.5`}),e.name]},e.id))}),(0,K.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-foreground-muted`,children:`Planning surface`}),(0,K.jsx)(`h3`,{className:`mt-1 text-lg font-semibold text-foreground`,children:`Project routes, filters, and bulk actions now shape the same board state`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>vt(`board`),className:`inline-flex h-11 items-center gap-2 rounded-xl border px-3 text-sm font-semibold ${te===`board`?`border-primary/30 bg-primary/10 text-primary`:`border-border bg-background text-foreground-muted`}`,children:[(0,K.jsx)(om,{className:`h-4 w-4`}),`Board view`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>vt(`list`),className:`inline-flex h-11 items-center gap-2 rounded-xl border px-3 text-sm font-semibold ${te===`list`?`border-primary/30 bg-primary/10 text-primary`:`border-border bg-background text-foreground-muted`}`,children:[(0,K.jsx)(um,{className:`h-4 w-4`}),`List view`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>dt(`header`),className:`inline-flex h-11 items-center gap-2 rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary`,"data-testid":`board-header-create`,children:[(0,K.jsx)(Cm,{className:`h-4 w-4`}),`Create issue`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>s.push(Qx(Xe.id)),className:`inline-flex h-11 items-center gap-2 rounded-xl border border-border bg-background px-4 text-sm font-semibold text-foreground`,"data-testid":`board-header-create-workspace`,children:[(0,K.jsx)(Xp,{className:`h-4 w-4`}),`Create workspace`]})]})]}),(0,K.jsxs)(`div`,{className:`mt-4 rounded-3xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-3 xl:grid-cols-[minmax(0,1.5fr)_repeat(4,minmax(0,180px))]`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Search`,(0,K.jsxs)(`div`,{className:`mt-2 flex h-11 items-center gap-2 rounded-xl border border-border bg-card px-3`,children:[(0,K.jsx)(Am,{className:`h-4 w-4 text-foreground-muted`}),(0,K.jsx)(`input`,{value:ne,onChange:e=>re(e.target.value),placeholder:`Search key, title, summary, tags, or assignees`,className:`w-full bg-transparent text-sm text-foreground outline-none`,"aria-label":`Planning search`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Workflow`,(0,K.jsxs)(`select`,{value:ie,onChange:e=>ae(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,"aria-label":`Workflow filter`,children:[(0,K.jsx)(`option`,{value:`all`,children:`All columns`}),Fx.map(e=>(0,K.jsx)(`option`,{value:e,children:Rx(e)},e))]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Readiness`,(0,K.jsxs)(`select`,{value:oe,onChange:e=>se(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,"aria-label":`Readiness filter`,children:[(0,K.jsx)(`option`,{value:`all`,children:`All readiness`}),(0,K.jsx)(`option`,{value:`needs-decomposition`,children:`Needs decomposition`}),(0,K.jsx)(`option`,{value:`ready`,children:`Ready`}),(0,K.jsx)(`option`,{value:`blocked`,children:`Blocked`}),(0,K.jsx)(`option`,{value:`dispatched`,children:`Dispatched`}),(0,K.jsx)(`option`,{value:`completed`,children:`Completed`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Assignee`,(0,K.jsxs)(`select`,{value:ce,onChange:e=>le(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,"aria-label":`Assignee filter`,children:[(0,K.jsx)(`option`,{value:`all`,children:`All assignees`}),ct.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.displayName},e.id))]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Tag`,(0,K.jsxs)(`select`,{value:ue,onChange:e=>de(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,"aria-label":`Tag filter`,children:[(0,K.jsx)(`option`,{value:`all`,children:`All tags`}),W.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Sort`,(0,K.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 rounded-xl border border-border bg-card px-3`,children:[(0,K.jsx)(wp,{className:`h-4 w-4 text-foreground-muted`}),(0,K.jsxs)(`select`,{value:fe,onChange:e=>pe(e.target.value),className:`h-11 bg-transparent pr-2 text-sm text-foreground outline-none`,"aria-label":`Sort cards`,children:[(0,K.jsx)(`option`,{value:`board-order`,children:`Board order`}),(0,K.jsx)(`option`,{value:`priority`,children:`Priority`}),(0,K.jsx)(`option`,{value:`activity`,children:`Recent activity`}),(0,K.jsx)(`option`,{value:`title`,children:`Title`})]})]})]}),(0,K.jsxs)(`label`,{className:`mt-7 inline-flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:me,onChange:e=>he(e.target.checked),className:`h-4 w-4 rounded border border-border`}),`Show empty swimlanes`]}),(0,K.jsxs)(`label`,{className:`mt-7 inline-flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:ge,onChange:e=>_e(e.target.checked),className:`h-4 w-4 rounded border border-border`}),`Show policy feedback`]}),(0,K.jsxs)(`div`,{className:`mt-7 rounded-full border border-border px-3 py-2 text-xs text-foreground-muted`,children:[it.length,` visible of `,nt.length,` issues`]})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3 rounded-2xl border border-border bg-card px-4 py-3`,children:[(0,K.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-sm text-foreground`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:st,onChange:bt,className:`h-4 w-4 rounded border border-border`,"aria-label":`Select visible issues`}),`Select visible`]}),(0,K.jsxs)(`span`,{className:`text-sm text-foreground-muted`,children:[ot.length,` selected`]}),(0,K.jsx)(`select`,{value:be,onChange:e=>xe(e.target.value),className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,"aria-label":`Bulk move target`,children:Fx.map(e=>(0,K.jsxs)(`option`,{value:e,disabled:!ut.includes(e),children:[`Move to `,Rx(e)]},e))}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void St(),disabled:ot.length===0||B!==null||!ut.includes(be),className:`inline-flex h-11 items-center gap-2 rounded-xl border border-border bg-background px-4 text-sm font-semibold text-foreground disabled:opacity-50`,children:`Move selected`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void Ct(),disabled:ot.length===0||B!==null,className:`inline-flex h-11 items-center gap-2 rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:`Create workspaces`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>ye([]),disabled:ot.length===0||B!==null,className:`inline-flex h-11 items-center gap-2 rounded-xl border border-border bg-background px-4 text-sm font-semibold text-foreground-muted disabled:opacity-50`,children:`Clear selection`})]})]}),Pe?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-success/30 bg-success-muted px-4 py-3 text-sm text-success`,children:Pe}):null,Ce?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-primary/20 bg-primary/10 px-4 py-3 text-sm text-primary`,children:Ce}):null,(0,K.jsxs)(`div`,{className:`mt-6 grid gap-5 ${kt?`xl:grid-cols-[minmax(0,1.55fr)_minmax(320px,430px)]`:`grid-cols-1`}`,children:[(0,K.jsxs)(`div`,{className:`space-y-5`,children:[it.length===0?(0,K.jsx)(`div`,{className:`rounded-3xl border border-dashed border-border bg-background/70 p-6 text-sm text-foreground-muted`,children:`No issues match the current planning filters. Adjust search, workflow, readiness, assignee, or tag filters to widen the board.`}):null,te===`board`?(0,K.jsx)(`div`,{className:`space-y-5`,"data-testid":`kanban-board`,children:Ze.swimlanes.filter(e=>{let t=it.filter(t=>t.swimlaneId===e.id).length;return me||t>0}).map(e=>(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-background/70 p-4`,"data-testid":`kanban-swimlane-${e.id}`,children:[(0,K.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-foreground-muted`,children:`Swimlane`}),(0,K.jsx)(`h3`,{className:`mt-1 text-lg font-semibold text-foreground`,children:e.name})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1 text-xs text-foreground-muted`,children:[it.filter(t=>t.swimlaneId===e.id).length,` visible`]})]}),(0,K.jsx)(`div`,{className:`grid gap-4 xl:grid-cols-4`,children:Fx.map(t=>{let n=Ze.columns.find(e=>e.id===t),r=it.filter(n=>n.swimlaneId===e.id&&n.workflowState===t);return n?(0,K.jsxs)(`div`,{className:`rounded-2xl border p-4 ${Lx(t,n.isOverLimit)}`,"data-testid":`kanban-column-${e.id}-${t}`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:Rx(t)}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[r.length,` visible in this lane`]})]}),(0,K.jsxs)(`div`,{className:`text-right text-xs text-foreground-muted`,children:[(0,K.jsxs)(`div`,{children:[n.issueCount,` total`]}),typeof n.wipLimit==`number`?(0,K.jsxs)(`div`,{className:n.isOverLimit?`text-error`:void 0,children:[`WIP `,n.issueCount,`/`,n.wipLimit]}):(0,K.jsx)(`div`,{children:`No WIP cap`})]})]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>dt(`column`,t),className:`mt-4 inline-flex h-10 items-center gap-2 rounded-xl border border-border bg-card px-3 text-xs font-semibold text-foreground`,"data-testid":`create-column-${e.id}-${t}`,children:[(0,K.jsx)(Cm,{className:`h-3.5 w-3.5`}),`Add issue`]}),(0,K.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[r.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No cards`}):null,r.map(e=>{let t=Ye.get(e.issueId),n=t?.parentIssueId?Ye.get(t.parentIssueId):void 0;return(0,K.jsxs)(`article`,{id:`kanban-issue-${e.issueId}`,className:`rounded-2xl border p-4 ${Ix(e)} ${I===e.issueId||L===e.issueKey?`ring-2 ring-primary/50 ring-offset-2 ring-offset-background`:``}`,"data-testid":`kanban-card-${e.issueKey}`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`label`,{className:`inline-flex items-center gap-2 text-xs text-foreground-muted`,children:(0,K.jsx)(`input`,{type:`checkbox`,checked:ve.includes(e.issueId),onChange:()=>yt(e.issueId),className:`h-4 w-4 rounded border border-border`,"aria-label":`Select ${e.issueKey}`})}),(0,K.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.18em]`,children:e.issueKey}),(0,K.jsx)(`span`,{className:`rounded-full border border-current/20 px-2 py-0.5 text-xs`,children:e.priority}),(0,K.jsx)(`span`,{className:`rounded-full border border-current/20 px-2 py-0.5 text-xs`,children:e.readiness})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>t&&wt(t),className:`mt-2 text-left text-base font-semibold underline-offset-4 hover:underline`,"data-testid":`open-issue-${e.issueKey}`,children:e.title}),e.summary?(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 opacity-90`,children:e.summary}):null,n?(0,K.jsxs)(`div`,{className:`mt-3 text-xs text-foreground-muted`,children:[`Parent`,` `,(0,K.jsx)(`button`,{type:`button`,onClick:()=>wt(n),className:`font-semibold text-foreground underline-offset-4 hover:underline`,"data-testid":`open-parent-${e.issueKey}`,children:n.key})]}):null,e.review?(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs opacity-90`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-current/20 px-2 py-0.5`,children:[`Review `,e.review.decision]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-current/20 px-2 py-0.5`,children:[e.review.openCommentCount,` open comments`]})]}):null,(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3 text-xs opacity-80`,children:[(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(Qp,{className:`h-3.5 w-3.5`}),e.dependencyCount,` dependencies`]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(Xm,{className:`h-3.5 w-3.5`}),e.childCount,` child issues`]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(Pp,{className:`h-3.5 w-3.5`}),e.acceptanceProgress.satisfied,`/`,e.acceptanceProgress.total,` accepted`]})]}),ge&&e.policySignals.length>0?(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.policySignals.map((t,n)=>(0,K.jsx)(`div`,{className:`rounded-xl border border-current/15 bg-card/70 px-3 py-2 text-xs`,children:t.message},`${e.issueId}-${t.hookId}-${n}`))}):null,(0,K.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:e.moveTargets.map(t=>(0,K.jsxs)(`button`,{disabled:!t.allowed||k===e.issueId,onClick:()=>xt(e.issueId,t.state),className:`inline-flex h-11 items-center justify-center gap-2 rounded-md border border-border-hover bg-transparent px-3 text-xs font-medium italic tracking-[0.04em] text-foreground transition-all duration-200 hover:bg-card hover:border-primary/30 hover:shadow-sm disabled:pointer-events-none disabled:opacity-50 font-serif`,"data-testid":`move-${e.issueKey}-${t.state}`,children:[(0,K.jsx)(Cp,{className:`h-3.5 w-3.5`}),Rx(t.state)]},`${e.issueId}-${t.state}`))}),ge&&e.moveTargets.some(e=>e.signals.length>0)?(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.moveTargets.flatMap(t=>t.signals.map((n,r)=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-background px-3 py-2 text-xs text-foreground-muted`,children:[Rx(t.state),`: `,n.message]},`${e.issueId}-${t.state}-${n.hookId}-${r}`)))}):null,(0,K.jsx)(wS,{card:e,mutating:k===e.issueId||A===e.issueId,onLinkRepository:g,onUpdateRepositorySettings:_,onCreatePullRequest:v}),(0,K.jsx)(SS,{card:e,project:Xe,activityEntries:u.issues.find(t=>t.id===e.issueId)?.activity??[],mutating:k===e.issueId||A===e.issueId,onSave:S})]},e.issueId)})]})]},`${e.id}-${t}`):null})})]},e.id))}):(0,K.jsxs)(`div`,{className:`space-y-4`,"data-testid":`kanban-list`,children:[(0,K.jsx)(`div`,{className:`rounded-3xl border border-border bg-background/70 p-4`,children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-foreground-muted`,children:`List view`}),(0,K.jsx)(`h3`,{className:`mt-1 text-lg font-semibold text-foreground`,children:`Shared issue inventory in linear order`})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1 text-xs text-foreground-muted`,children:[it.length,` cards`]})]})}),it.map(e=>_S(e,Ye.get(e.issueId),I===e.issueId||L===e.issueKey,wt,ve.includes(e.issueId),yt,xt,k,ge))]})]}),H&&$e?(0,K.jsx)(TS,{issue:H,card:Qe,reviewArtifact:F.get(H.id),project:Xe,issues:u.issues.filter(e=>e.projectId===Xe.id),dispatchContextLabels:u.dispatchContextLabels??[],taskTags:l,loading:p,mutating:A===H.id,mutationError:M,draft:$e,fieldStates:Re,priorityEditing:Be,assigneeEditing:He,labelEditing:We,onFocusIssue:wt,onOpenDedicatedPage:e=>s.push(Xx(e.projectId,e.id)),onClose:Tt,onChangeDraft:pt,onResetDraft:ht,onRetryDescriptionSave:()=>void gt(`description`),onSaveField:e=>void gt(e),onSetPriorityEditing:Ve,onSetAssigneeEditing:Ue,onSetLabelEditing:Ge,onResetField:mt,onCreateSubIssue:w,onLinkChildIssue:T,onSaveDispatchContextLabels:C,workspaceInventory:Ke,onRefreshWorkspaceInventory:Et,onCreateIssueWorkspace:Ot,onLinkIssueWorkspace:O,onOpenWorkspacePath:Dt}):Te?(0,K.jsx)(gS,{draft:V,project:Xe,issues:u.issues.filter(e=>e.projectId===Xe.id),taskTags:l,autosaveStatus:Oe,creatingIssue:j,error:Ae,validationError:Me,onChange:e=>{Ne(null),je(null),De(t=>e(t))},onClose:ft,onSubmit:()=>void _t()}):null]}),(0,K.jsx)(`div`,{className:`mt-6`,children:(0,K.jsx)(jx,{title:`Issue diff and feedback loop`,description:`Issue review artifacts stay in the shared layer, so diff viewing, inline comments, and approval state are the same review record used across the app.`,empty:`No issue reviews are queued yet.`,loading:P.loading,error:P.error,artifacts:P.artifacts,queue:P.queue,summary:P.summary,pendingArtifactId:P.pendingArtifactId,onApprove:e=>P.actOnReview({action:`approve`,artifactId:e}).then(()=>N()),onRequestChanges:e=>P.actOnReview({action:`request-changes`,artifactId:e}).then(()=>N()),onSubmitReview:e=>P.actOnReview({action:`submit-review`,...e}).then(()=>N()),onAddComment:e=>P.actOnReview({action:`add-comment`,...e}).then(()=>N())})})]})}async function DS(e,t,n){let r=n.trim();if(!e||!t||!r)return{success:!1,error:`Run ID, effect ID, and answer are required`};let i=await uh(`/api/runs/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}/approve`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({answer:r}),retries:0});return i.ok?i.data.success===!0?{success:!0}:{success:!1,error:i.data.error??`Breakpoint approval failed`}:{success:!1,error:i.error.message}}var OS=2e4,kS=12e4,AS=`kanban:dismissed-breakpoints`;function jS({bp:e,stale:t,onDismiss:n}){let[r,i]=(0,y.useTransition)(),[a,o]=(0,y.useState)(null);return a?.ok?(0,K.jsxs)(`div`,{className:Y(`group relative flex items-center gap-3 px-4 py-3 rounded-lg`,`bg-success-muted border border-success/30`),children:[(0,K.jsx)(Pp,{className:`h-5 w-5 text-success shrink-0`}),(0,K.jsxs)(`span`,{className:`text-sm text-success font-medium`,children:[`Approved — `,e.projectName]})]}):(0,K.jsxs)(`div`,{className:Y(`group relative flex items-center gap-3 px-4 py-3 rounded-lg`,`bg-warning-muted border border-warning/30`,`shadow-breakpoint-glow animate-breakpoint-glow`,t&&`opacity-70`),children:[(0,K.jsxs)(Z,{href:`/runs/${e.runId}`,className:`flex items-center gap-3 flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,K.jsx)(tm,{className:`h-5 w-5 text-warning animate-pulse-dot`}),(0,K.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-warning animate-ping`})]}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:[(0,K.jsx)(Wm,{className:`h-3 w-3 text-warning shrink-0`}),(0,K.jsx)(`span`,{className:`text-xs font-bold text-warning uppercase tracking-wider`,children:`Approval Needed`}),t&&(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted italic`,"data-testid":`staleness-indicator`,children:`(checking...)`}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted font-medium`,children:e.projectName}),(0,K.jsx)(`span`,{className:`font-mono text-xs text-info`,children:e.runId.slice(0,8)})]}),(0,K.jsx)(`p`,{className:`text-sm text-foreground truncate`,children:e.breakpointQuestion})]})]}),(0,K.jsxs)(`button`,{onClick:t=>{t.preventDefault(),t.stopPropagation(),i(()=>{DS(e.runId,e.effectId,`Approved from dashboard`).then(e=>{o(e.success?{ok:!0}:{ok:!1,msg:e.error})})})},disabled:r||!e.effectId,className:Y(`shrink-0 flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold`,`bg-success/20 text-success border border-success/30`,`hover:bg-success/30 hover:border-success/50`,`disabled:opacity-50 disabled:cursor-not-allowed`,`transition-colors`),title:`Approve this breakpoint`,children:[(0,K.jsx)(Op,{className:`h-3.5 w-3.5`}),r?`Approving...`:`Approve`]}),t&&n&&(0,K.jsx)(`button`,{onClick:e=>{e.preventDefault(),e.stopPropagation(),n()},className:Y(`shrink-0 p-1 rounded text-foreground-muted/50`,`hover:text-foreground-muted hover:bg-foreground-muted/10`,`transition-colors`),title:`Dismiss this stale breakpoint`,"data-testid":`dismiss-breakpoint`,children:(0,K.jsx)(Qm,{className:`h-3.5 w-3.5`})}),a&&!a.ok&&(0,K.jsx)(`span`,{className:`text-xs text-error ml-2`,children:a.msg})]})}function MS({breakpointRuns:e}){let[t,n]=(0,y.useState)([]),r=(0,y.useRef)(new Map),i=(0,y.useRef)(new Map),[a,o]=(0,y.useState)(new Set);(0,y.useLayoutEffect)(()=>{try{let e=localStorage.getItem(AS);e&&o(new Set(JSON.parse(e)))}catch{}},[]);let s=(0,y.useCallback)(e=>{o(t=>{let n=new Set(t);n.add(e);try{localStorage.setItem(AS,JSON.stringify([...n]))}catch{}return n})},[]);(0,y.useEffect)(()=>{let t=new Set(e.map(e=>e.runId));o(e=>{let n=new Set([...e].filter(e=>t.has(e)));if(n.size!==e.size){try{localStorage.setItem(AS,JSON.stringify([...n]))}catch{}return n}return e})},[e]);let[,c]=(0,y.useState)(0);(0,y.useEffect)(()=>{let t=new Set(e.map(e=>e.runId)),a=Date.now(),o=[];for(let[e,n]of r.current)t.has(e)||(o.push({bp:n,resolvedAt:a}),i.current.delete(e));o.length>0&&n(e=>[...e,...o]);for(let t of e)i.current.has(t.runId)||i.current.set(t.runId,a);r.current=new Map(e.map(e=>[e.runId,e]))},[e]),(0,y.useEffect)(()=>{if(e.length===0)return;let t=setInterval(()=>{c(e=>e+1)},1e4);return()=>clearInterval(t)},[e.length]);let l=(0,y.useCallback)(e=>{let t=i.current.get(e);return t?Date.now()-t>kS:!1},[]);(0,y.useEffect)(()=>{if(t.length===0)return;let e=setInterval(()=>{let e=Date.now();n(t=>t.filter(t=>e-t.resolvedAt<OS))},1e3);return()=>clearInterval(e)},[t.length]);let u=e.filter(e=>!a.has(e.runId)),d=u.length>0,f=t.length>0;return!d&&!f?null:(0,K.jsxs)(`div`,{role:`alert`,"aria-live":`assertive`,"aria-atomic":`true`,className:`flex flex-col gap-2 mb-6`,"data-testid":`breakpoint-banner`,children:[u.map(e=>(0,K.jsx)(jS,{bp:e,stale:l(e.runId),onDismiss:()=>s(e.runId)},e.runId)),t.map(e=>(0,K.jsxs)(Z,{href:`/runs/${e.bp.runId}`,className:Y(`group relative flex items-center gap-3 px-4 py-3 rounded-lg`,`bg-success-muted border border-success/30`,`shadow-glow-success`,`hover:border-success/50`,`transition-colors cursor-pointer`),children:[(0,K.jsx)(`div`,{className:`relative shrink-0`,children:(0,K.jsx)(Pp,{className:`h-5 w-5 text-success`})}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:[(0,K.jsx)(Pp,{className:`h-3 w-3 text-success shrink-0`}),(0,K.jsx)(`span`,{className:`text-xs font-bold text-success uppercase tracking-wider`,children:`Approved`}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted font-medium`,children:e.bp.projectName}),(0,K.jsx)(`span`,{className:`font-mono text-xs text-info`,children:e.bp.runId.slice(0,8)})]}),(0,K.jsx)(`p`,{className:`text-sm text-foreground-muted truncate`,children:e.bp.breakpointQuestion})]})]},`resolved-${e.bp.runId}`)),u.length>1&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1`,children:[(0,K.jsx)(tm,{className:`h-3.5 w-3.5 text-warning`}),(0,K.jsxs)(`span`,{className:`text-xs font-semibold text-warning`,children:[u.length,` approvals pending`]})]})]})}function NS(e){if(!e)return null;let t=[];return e.failedRuns>0&&t.push(`${e.failedRuns} failed`),e.pendingBreakpoints>0&&t.push(`${e.pendingBreakpoints} awaiting input`),e.completedRuns>0&&t.push(`${e.completedRuns} completed`),t.length===0?null:t.join(`, `)}function PS({catchUp:e,summary:t}){if(!e.active)return null;let n=NS(t);return(0,K.jsxs)(`div`,{"data-testid":`catch-up-banner`,className:Y(`flex items-center gap-3 px-4 py-2.5 mb-4 rounded-lg`,`bg-info-muted border border-info/20`,`animate-in fade-in slide-in-from-top-2 duration-300`),children:[(0,K.jsx)(`div`,{className:`rounded-md p-1.5 bg-info/10`,children:(0,K.jsx)(rm,{className:`h-4 w-4 text-info`})}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`p`,{className:`text-sm text-foreground`,children:[(0,K.jsx)(`span`,{className:`font-semibold tabular-nums`,children:e.bufferedCount}),` `,`runs updated while you were away`]}),n&&(0,K.jsx)(`p`,{"data-testid":`catch-up-summary`,className:`text-xs text-foreground-muted mt-0.5 truncate`,children:n})]}),(0,K.jsxs)(`button`,{onClick:e.flush,"data-testid":`catch-up-refresh-btn`,className:Y(`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold`,`bg-info/10 border border-info/20 text-info`,`hover:bg-info/20 transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-info/50`),children:[(0,K.jsx)(Dm,{className:`h-3 w-3`}),`Refresh now`]})]})}function FS(e){let t=[],n=`healthy`;if(e.failedRuns>0&&(t.push({text:`${e.failedRuns} run${e.failedRuns===1?``:`s`} failing`,filter:`failed`}),n=`red`),e.pendingBreakpoints>0&&(t.push({text:`${e.pendingBreakpoints} approval${e.pendingBreakpoints===1?``:`s`} need${e.pendingBreakpoints===1?`s`:``} your attention`,filter:`waiting`}),n!==`red`&&(n=`amber`)),e.staleRuns>0&&(t.push({text:`${e.staleRuns} stale run${e.staleRuns===1?``:`s`}`,filter:`stale`}),n!==`red`&&(n=`amber`)),t.length===0){let t=e.totalProjects===1?`project`:`projects`;return{severity:`healthy`,issues:[{text:e.activeRuns>0?`All ${e.totalProjects} ${t} healthy \u2014 ${e.activeRuns} run${e.activeRuns===1?``:`s`} in progress`:`All ${e.totalProjects} ${t} healthy`,filter:null}],icon:(0,K.jsx)(Pp,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`})}}return{severity:n,issues:t,icon:n===`red`?(0,K.jsx)(Ip,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`}):(0,K.jsx)(Wm,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`})}}var IS={healthy:{container:`border-success/25 bg-success-muted shadow-neon-glow-success-sm`,text:`text-success`,iconColor:`text-success`},amber:{container:`border-warning/25 bg-warning-muted shadow-neon-glow-warning-sm`,text:`text-warning`,iconColor:`text-warning`},red:{container:`border-error/25 bg-error-muted shadow-neon-glow-error-sm`,text:`text-error`,iconColor:`text-error`}};function LS({metrics:e,onFilterChange:t,dismissed:n,onDismiss:r}){let i=(0,y.useMemo)(()=>FS(e),[e]),a=IS[i.severity];return n?null:(0,K.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,"data-testid":`executive-summary-banner`,className:Y(`flex items-center gap-2.5 rounded-xl border px-4 py-3 mb-6 shadow-sm transition-all duration-300`,a.container),children:[(0,K.jsx)(`span`,{className:a.iconColor,children:i.icon}),(0,K.jsx)(`p`,{className:Y(`text-sm font-medium leading-snug flex-1`,a.text),children:i.issues.map((e,n)=>(0,K.jsxs)(`span`,{children:[n>0&&`, `,e.filter&&t?(0,K.jsx)(`button`,{onClick:()=>t(e.filter),className:`underline decoration-dotted underline-offset-2 hover:decoration-solid transition-all`,children:e.text}):e.text]},n))}),i.severity!==`healthy`&&r&&(0,K.jsx)(`button`,{"data-testid":`executive-summary-dismiss`,onClick:r,className:Y(`rounded-md p-1.5 min-h-[44px] min-w-[44px] flex items-center justify-center transition-colors`,a.iconColor,`opacity-60 hover:opacity-100`),"aria-label":`Dismiss banner`,children:(0,K.jsx)(Qm,{className:`h-3.5 w-3.5`})})]})}var RS=`h-3.5 w-3.5`,zS={completed:{variant:`success`,icon:(0,K.jsx)(Pp,{className:Y(RS,`drop-shadow-[var(--drop-glow-success)]`)}),label:`Completed`,extraClass:`ring-success/30 shadow-neon-glow-success-sm`},resolved:{variant:`success`,icon:(0,K.jsx)(Pp,{className:Y(RS,`drop-shadow-[var(--drop-glow-success)]`)}),label:`Done`,extraClass:`ring-success/30 shadow-neon-glow-success-sm`},ok:{variant:`success`,icon:(0,K.jsx)(Pp,{className:Y(RS,`drop-shadow-[var(--drop-glow-success)]`)}),label:`OK`,extraClass:`ring-success/30 shadow-neon-glow-success-sm`},failed:{variant:`error`,icon:(0,K.jsx)(Ip,{className:Y(RS,`drop-shadow-[var(--drop-glow-error)]`)}),label:`Failed`,extraClass:`ring-error/30 shadow-neon-glow-error-sm`},error:{variant:`error`,icon:(0,K.jsx)(Ip,{className:Y(RS,`drop-shadow-[var(--drop-glow-error)]`)}),label:`Error`,extraClass:`ring-error/30 shadow-neon-glow-error-sm`},waiting:{variant:`warning`,icon:(0,K.jsx)(zp,{className:Y(RS,`drop-shadow-[var(--drop-glow-warning)]`)}),label:`Waiting`,extraClass:`ring-warning/30 shadow-neon-glow-warning-sm`},waiting_breakpoint:{variant:`warning`,icon:(0,K.jsx)(tm,{className:Y(RS,`animate-pulse drop-shadow-[var(--drop-glow-warning)]`)}),label:`Approval Needed`,extraClass:`ring-warning/40 animate-breakpoint-glow`},waiting_task:{variant:`info`,icon:(0,K.jsx)(dm,{className:Y(RS,`animate-spin drop-shadow-[var(--drop-glow-cyan)]`)}),label:`Working`,extraClass:`ring-info/30 shadow-neon-glow-cyan-sm`},breakpoint_awaiting:{variant:`warning`,icon:(0,K.jsx)(tm,{className:Y(RS,`animate-pulse drop-shadow-[var(--drop-glow-warning)]`)}),label:`Needs Approval`,extraClass:`ring-warning/40 animate-breakpoint-glow`},requested:{variant:`info`,icon:(0,K.jsx)(dm,{className:Y(RS,`animate-spin drop-shadow-[var(--drop-glow-cyan)]`)}),label:`Running`,extraClass:`ring-info/30 shadow-neon-glow-cyan-sm`},pending:{variant:`pending`,icon:(0,K.jsx)(Lp,{className:RS}),label:`Pending`}};function BS({status:e,className:t,waitingKind:n,isStale:r}){let i=zS[e]||zS.pending;e===`waiting`&&n&&(i=zS[`waiting_${n}`]||i);let a=r&&(e===`pending`||e===`waiting`&&!n);return(0,K.jsxs)(My,{"data-testid":`status-badge-${e}`,variant:r?`default`:i.variant,className:Y(`gap-1`,r?`opacity-60 text-zinc-500 ring-zinc-500/20 bg-zinc-500/10 shadow-none`:i.extraClass,t),children:[i.icon,a?`Interrupted`:i.label]})}function VS(){let e=hf(),[t,n]=(0,y.useState)(``),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)([]),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(-1),[p,m]=(0,y.useState)(!1),h=(0,y.useRef)(null),g=(0,y.useRef)(null),_=(0,y.useRef)(null);(0,y.useEffect)(()=>{let e=setTimeout(()=>{i(t.trim())},300);return()=>clearTimeout(e)},[t]),(0,y.useEffect)(()=>{if(!r){o([]),m(!1),f(-1);return}let e=!1;async function t(){u(!0);try{let t=new URLSearchParams({search:r,limit:`10`}),n=await fetch(`/api/runs?${t}`);if(!n.ok)throw Error(`Search failed`);let i=await n.json();e||(o(i.runs??[]),m(!0),f(-1))}catch{e||(o([]),m(!0))}finally{e||u(!1)}}return t(),()=>{e=!0}},[r]);let v=(0,y.useCallback)(t=>{c(!1),n(``),o([]),m(!1),e.push(`/runs/${t}`)},[e]),b=(0,y.useCallback)(e=>{if(s)switch(e.key){case`ArrowDown`:e.preventDefault(),f(e=>e<a.length-1?e+1:0);break;case`ArrowUp`:e.preventDefault(),f(e=>e>0?e-1:a.length-1);break;case`Enter`:e.preventDefault(),d>=0&&d<a.length&&v(a[d].runId);break;case`Escape`:e.preventDefault(),c(!1),h.current?.blur();break}},[s,a,d,v]);(0,y.useEffect)(()=>{d>=0&&_.current&&_.current.querySelectorAll(`[data-search-item]`)[d]?.scrollIntoView({block:`nearest`})},[d]),(0,y.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),h.current?.focus(),c(!0)),e.key===`/`&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!(e.target instanceof HTMLInputElement)&&!(e.target instanceof HTMLTextAreaElement)&&!(e.target instanceof HTMLSelectElement)&&!e.target?.isContentEditable&&(e.preventDefault(),h.current?.focus(),c(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,y.useEffect)(()=>{let e=e=>{g.current&&!g.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let x=s&&t.trim().length>0;return(0,K.jsxs)(`div`,{ref:g,className:`relative w-full max-w-xl mx-auto mb-6`,children:[(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(Am,{className:`absolute left-3.5 top-1/2 -translate-y-1/2 h-4 w-4 text-foreground-muted pointer-events-none`}),(0,K.jsx)(`input`,{ref:h,type:`text`,value:t,onChange:e=>{n(e.target.value),c(!0)},onFocus:()=>{t.trim()&&c(!0)},onKeyDown:b,placeholder:`Search runs by ID, process name, or task title...`,className:Y(`w-full rounded-lg border border-border bg-card/80 backdrop-blur-sm`,`pl-10 pr-20 py-2.5 text-sm text-foreground`,`placeholder:text-foreground-muted/60`,`focus:border-primary/40 focus:outline-none focus:ring-2 focus:ring-primary/30`,`focus:shadow-neon-glow-primary-focus transition-all`),"data-testid":`global-search-input`}),(0,K.jsxs)(`div`,{className:`absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1.5`,children:[t&&(0,K.jsx)(`button`,{onClick:()=>{n(``),o([]),m(!1),c(!1),h.current?.focus()},className:`rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-foreground-secondary transition-colors`,"aria-label":`Clear search`,children:(0,K.jsx)(Qm,{className:`h-3.5 w-3.5`})}),(0,K.jsxs)(`kbd`,{className:`hidden sm:inline-flex items-center gap-0.5 rounded border border-border bg-background-secondary px-1.5 py-0.5 text-xs font-medium text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`text-xs`,children:typeof navigator<`u`&&/Mac/i.test(navigator.userAgent)?`⌘`:`Ctrl`}),(0,K.jsx)(`span`,{children:`K`})]})]})]}),x&&(0,K.jsxs)(`div`,{className:Y(`absolute z-50 top-full left-0 right-0 mt-1.5`,`rounded-lg border border-border bg-card/95 backdrop-blur-md shadow-xl`,`overflow-hidden`),"data-testid":`global-search-dropdown`,children:[l&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-foreground-muted`,children:[(0,K.jsx)(`div`,{className:`h-3 w-3 rounded-full border-2 border-primary/40 border-t-primary animate-spin`}),`Searching...`]}),!l&&p&&a.length===0&&(0,K.jsxs)(`div`,{className:`px-4 py-6 text-center`,children:[(0,K.jsx)(Am,{className:`h-5 w-5 text-foreground-muted/30 mx-auto mb-2`}),(0,K.jsxs)(`p`,{className:`text-xs text-foreground-muted`,children:[`No runs found for “`,r,`”`]})]}),!l&&a.length>0&&(0,K.jsx)(`ul`,{ref:_,className:`max-h-80 overflow-y-auto py-1`,role:`listbox`,children:a.map((e,t)=>(0,K.jsxs)(`li`,{"data-search-item":!0,role:`option`,"aria-selected":t===d,onClick:()=>v(e.runId),className:Y(`flex items-center gap-3 px-4 py-2.5 cursor-pointer transition-colors`,t===d?`bg-primary/10`:`hover:bg-background-secondary/60`),children:[(0,K.jsx)(`span`,{className:Y(`h-2 w-2 rounded-full shrink-0`,e.status===`completed`?`bg-success`:e.status===`failed`?`bg-error`:e.status===`waiting`||e.status===`pending`?`bg-warning`:`bg-foreground-muted`)}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:hh(e.processId)}),(0,K.jsx)(BS,{status:e.status,waitingKind:e.waitingKind,isStale:e.isStale})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:[e.projectName&&(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:e.projectName}),(0,K.jsx)(`span`,{className:`font-mono text-xs text-info`,children:mh(e.runId,8)})]})]}),(0,K.jsx)(Cp,{className:Y(`h-3.5 w-3.5 shrink-0 transition-colors`,t===d?`text-primary`:`text-foreground-muted/40`)})]},e.runId))})]})]})}function HS(e,t=600){let[n,r]=(0,y.useState)(e),i=(0,y.useRef)(null),a=(0,y.useRef)(null),o=(0,y.useRef)(e),s=(0,y.useRef)(e),c=(0,y.useCallback)(e=>1-(1-e)**3,[]);return(0,y.useEffect)(()=>{let n=o.current;if(o.current=e,n===e)return;i.current!==null&&(cancelAnimationFrame(i.current),i.current=null);let l=s.current,u=e-l;if(u===0){r(e),s.current=e;return}if(Math.abs(u)<=2){r(e),s.current=e;return}let d=performance.now();a.current={value:l,time:d};function f(n){let a=n-d,o=Math.min(a/t,1),p=c(o),m=Math.round(l+u*p);s.current=m,r(m),o<1?i.current=requestAnimationFrame(f):(i.current=null,s.current=e,r(e))}return i.current=requestAnimationFrame(f),()=>{i.current!==null&&(cancelAnimationFrame(i.current),i.current=null)}},[e,t,c]),n}var US={primary:{text:`text-primary`,bg:`bg-primary/10`,glow:`shadow-neon-glow-primary-xs`,borderL:``,ring:`ring-primary/50`},success:{text:`text-success`,bg:`bg-success/10`,glow:`shadow-neon-glow-success-sm`,borderL:`border-l-success/60`,ring:`ring-success/50`},warning:{text:`text-warning`,bg:`bg-warning/10`,glow:`shadow-neon-glow-warning-sm`,borderL:`border-l-warning/60`,ring:`ring-warning/50`},error:{text:`text-error`,bg:`bg-error/10`,glow:`shadow-neon-glow-error-sm`,borderL:`border-l-error/60`,ring:`ring-error/50`},muted:{text:`text-zinc-500`,bg:`bg-zinc-500/10`,glow:``,borderL:`border-l-zinc-500/60`,ring:`ring-zinc-500/50`}};function WS({label:e,value:t,icon:n,color:r,pulse:i,testId:a,active:o,onClick:s}){let c=US[r],l=!!s,u=HS(t);return(0,K.jsxs)(`div`,{"data-testid":a,role:l?`button`:void 0,"aria-pressed":l?!!o:void 0,tabIndex:l?0:void 0,onClick:s,onKeyDown:l?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s?.())}:void 0,className:Y(`rounded-xl border border-border bg-card/90 p-3 flex items-center gap-3 transition-all shadow-sm`,t>0&&r!==`primary`&&`border-l-2`,t>0&&r!==`primary`&&c.borderL,c.glow,l&&`cursor-pointer hover:bg-background-secondary/65 hover:shadow-md`,o&&`ring-2`,o&&c.ring),children:[(0,K.jsx)(`div`,{className:Y(`rounded-md p-2`,c.bg),children:(0,K.jsx)(`span`,{className:Y(c.text,i&&`animate-pulse-dot`),children:n})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:Y(`text-lg font-bold tabular-nums leading-none mb-0.5`,c.text),children:u}),(0,K.jsx)(`p`,{className:`text-[11px] leading-tight text-foreground-muted uppercase tracking-[0.12em] font-medium`,children:e})]})]})}function GS({metrics:e,statusFilter:t,hasStaleRuns:n,onToggleFilter:r}){return(0,K.jsxs)(`div`,{"data-testid":`kpi-grid`,"aria-live":`polite`,"aria-label":`Key metrics`,className:Y(`grid gap-3 mb-6`,n?`grid-cols-2 sm:grid-cols-5`:`grid-cols-2 sm:grid-cols-4`),children:[(0,K.jsx)(WS,{label:`Total Runs`,value:e.totalRuns,icon:(0,K.jsx)(om,{className:`h-4 w-4`}),color:`primary`,testId:`metric-tile-total-runs`,onClick:()=>r(`all`),active:t===`all`}),(0,K.jsx)(WS,{label:`In Progress`,value:e.activeRuns,icon:(0,K.jsx)(yp,{className:`h-4 w-4`}),color:`warning`,pulse:e.activeRuns>0,testId:`metric-tile-active`,onClick:()=>r(`waiting`),active:t===`waiting`}),n&&(0,K.jsx)(WS,{label:`Stale`,value:e.staleRuns,icon:(0,K.jsx)(ym,{className:`h-4 w-4`}),color:`muted`,testId:`metric-tile-stale`,onClick:()=>r(`stale`),active:t===`stale`}),(0,K.jsx)(WS,{label:`Completed`,value:e.completedRuns,icon:(0,K.jsx)(Pp,{className:`h-4 w-4`}),color:`success`,testId:`metric-tile-completed`,onClick:()=>r(`completed`),active:t===`completed`}),(0,K.jsx)(WS,{label:`Failed`,value:e.failedRuns,icon:(0,K.jsx)(Np,{className:`h-4 w-4`}),color:`error`,testId:`metric-tile-failed`,onClick:()=>r(`failed`),active:t===`failed`})]})}var KS=class extends y.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught an error:`,e,t)}handleRetry=()=>{this.setState({hasError:!1,error:null})};render(){return this.state.hasError?this.props.section?(0,K.jsxs)(`div`,{className:`rounded-lg border border-error/20 bg-error-muted p-4 text-center`,children:[(0,K.jsxs)(`p`,{className:`text-sm font-medium text-error mb-1`,children:[this.props.section,` failed to load`]}),(0,K.jsx)(`p`,{className:`text-xs text-foreground-muted mb-2`,children:`This section encountered an error. Other sections are unaffected.`}),(0,K.jsx)(Q,{onClick:this.handleRetry,size:`sm`,variant:`primary`,children:`Retry`})]}):(0,K.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-6`,children:(0,K.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,K.jsx)(`h2`,{className:`mb-2 text-lg font-semibold text-foreground`,children:`Something went wrong`}),(0,K.jsx)(`p`,{className:`mb-4 text-sm text-foreground-muted`,children:`An unexpected error occurred. Please try again.`}),(0,K.jsx)(Q,{onClick:()=>window.location.reload(),variant:`primary`,children:`Try Again`})]})}):this.props.children}},qS=[`top`,`right`,`bottom`,`left`],JS=Math.min,YS=Math.max,XS=Math.round,ZS=Math.floor,QS=e=>({x:e,y:e}),$S={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function eC(e,t,n){return YS(e,JS(t,n))}function tC(e,t){return typeof e==`function`?e(t):e}function nC(e){return e.split(`-`)[0]}function rC(e){return e.split(`-`)[1]}function iC(e){return e===`x`?`y`:`x`}function aC(e){return e===`y`?`height`:`width`}function oC(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function sC(e){return iC(oC(e))}function cC(e,t,n){n===void 0&&(n=!1);let r=rC(e),i=sC(e),a=aC(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=_C(o)),[o,_C(o)]}function lC(e){let t=_C(e);return[uC(e),t,uC(t)]}function uC(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var dC=[`left`,`right`],fC=[`right`,`left`],pC=[`top`,`bottom`],mC=[`bottom`,`top`];function hC(e,t,n){switch(e){case`top`:case`bottom`:return n?t?fC:dC:t?dC:fC;case`left`:case`right`:return t?pC:mC;default:return[]}}function gC(e,t,n,r){let i=rC(e),a=hC(nC(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(uC)))),a}function _C(e){let t=nC(e);return $S[t]+e.slice(t.length)}function vC(e){return{top:0,right:0,bottom:0,left:0,...e}}function yC(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:vC(e)}function bC(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function xC(e,t,n){let{reference:r,floating:i}=e,a=oC(t),o=sC(t),s=aC(o),c=nC(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(rC(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function SC(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=tC(t,e),p=yC(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=bC(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=bC(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var CC=50,wC=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:SC},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=xC(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<CC&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=xC(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},TC=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=tC(e,t)||{};if(l==null)return{};let d=yC(u),f={x:n,y:r},p=sC(i),m=aC(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=JS(d[_],T),D=JS(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=eC(O,A,k),M=!c.arrow&&rC(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),EC=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=tC(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=nC(r),_=oC(o),v=nC(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[_C(o)]:lC(o)),x=p!==`none`;!d&&x&&b.push(...gC(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=cC(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==oC(t))||T.every(e=>oC(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=oC(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function DC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function OC(e){return qS.some(t=>e[t]>=0)}var kC=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=tC(e,t);switch(i){case`referenceHidden`:{let e=DC(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:OC(e)}}}case`escaped`:{let e=DC(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:OC(e)}}}default:return{}}}}},AC=new Set([`left`,`top`]);async function jC(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=nC(n),s=rC(n),c=oC(n)===`y`,l=AC.has(o)?-1:1,u=a&&c?-1:1,d=tC(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var MC=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await jC(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},NC=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=tC(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=oC(nC(i)),p=iC(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=eC(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=eC(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},PC=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=tC(e,t),u={x:n,y:r},d=oC(i),f=iC(d),p=u[f],m=u[d],h=tC(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=AC.has(nC(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},FC=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=tC(e,t),u=await o.detectOverflow(t,l),d=nC(i),f=rC(i),p=oC(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=JS(h-u[g],v),x=JS(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=YS(u.left,0),t=YS(u.right,0),n=YS(u.top,0),r=YS(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:YS(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:YS(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function IC(){return typeof window<`u`}function LC(e){return BC(e)?(e.nodeName||``).toLowerCase():`#document`}function RC(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zC(e){return((BC(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function BC(e){return IC()?e instanceof Node||e instanceof RC(e).Node:!1}function VC(e){return IC()?e instanceof Element||e instanceof RC(e).Element:!1}function HC(e){return IC()?e instanceof HTMLElement||e instanceof RC(e).HTMLElement:!1}function UC(e){return!IC()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof RC(e).ShadowRoot}function WC(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=tw(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function GC(e){return/^(table|td|th)$/.test(LC(e))}function KC(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var qC=/transform|translate|scale|rotate|perspective|filter/,JC=/paint|layout|strict|content/,YC=e=>!!e&&e!==`none`,XC;function ZC(e){let t=VC(e)?tw(e):e;return YC(t.transform)||YC(t.translate)||YC(t.scale)||YC(t.rotate)||YC(t.perspective)||!$C()&&(YC(t.backdropFilter)||YC(t.filter))||qC.test(t.willChange||``)||JC.test(t.contain||``)}function QC(e){let t=rw(e);for(;HC(t)&&!ew(t);){if(ZC(t))return t;if(KC(t))return null;t=rw(t)}return null}function $C(){return XC??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),XC}function ew(e){return/^(html|body|#document)$/.test(LC(e))}function tw(e){return RC(e).getComputedStyle(e)}function nw(e){return VC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rw(e){if(LC(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||UC(e)&&e.host||zC(e);return UC(t)?t.host:t}function iw(e){let t=rw(e);return ew(t)?e.ownerDocument?e.ownerDocument.body:e.body:HC(t)&&WC(t)?t:iw(t)}function aw(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=iw(e),i=r===e.ownerDocument?.body,a=RC(r);if(i){let e=ow(a);return t.concat(a,a.visualViewport||[],WC(r)?r:[],e&&n?aw(e):[])}else return t.concat(r,aw(r,[],n))}function ow(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sw(e){let t=tw(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=HC(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=XS(n)!==a||XS(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function cw(e){return VC(e)?e:e.contextElement}function lw(e){let t=cw(e);if(!HC(t))return QS(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=sw(t),o=(a?XS(n.width):n.width)/r,s=(a?XS(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var uw=QS(0);function dw(e){let t=RC(e);return!$C()||!t.visualViewport?uw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fw(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==RC(e)?!1:t}function pw(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=cw(e),o=QS(1);t&&(r?VC(r)&&(o=lw(r)):o=lw(e));let s=fw(a,n,r)?dw(a):QS(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=RC(a),t=r&&VC(r)?RC(r):r,n=e,i=ow(n);for(;i&&r&&t!==n;){let e=lw(i),t=i.getBoundingClientRect(),r=tw(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=RC(i),i=ow(n)}}return bC({width:u,height:d,x:c,y:l})}function mw(e,t){let n=nw(e).scrollLeft;return t?t.left+n:pw(zC(e)).left+n}function hw(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-mw(e,n),y:n.top+t.scrollTop}}function gw(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=zC(r),s=t?KC(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=QS(1),u=QS(0),d=HC(r);if((d||!d&&!a)&&((LC(r)!==`body`||WC(o))&&(c=nw(r)),d)){let e=pw(r);l=lw(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?hw(o,c):QS(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function _w(e){return Array.from(e.getClientRects())}function vw(e){let t=zC(e),n=nw(e),r=e.ownerDocument.body,i=YS(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=YS(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+mw(e),s=-n.scrollTop;return tw(r).direction===`rtl`&&(o+=YS(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var yw=25;function bw(e,t){let n=RC(e),r=zC(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=$C();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=mw(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=yw&&(a-=o)}else l<=yw&&(a+=l);return{width:a,height:o,x:s,y:c}}function xw(e,t){let n=pw(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=HC(e)?lw(e):QS(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Sw(e,t,n){let r;if(t===`viewport`)r=bw(e,n);else if(t===`document`)r=vw(zC(e));else if(VC(t))r=xw(t,n);else{let n=dw(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return bC(r)}function Cw(e,t){let n=rw(e);return n===t||!VC(n)||ew(n)?!1:tw(n).position===`fixed`||Cw(n,t)}function ww(e,t){let n=t.get(e);if(n)return n;let r=aw(e,[],!1).filter(e=>VC(e)&&LC(e)!==`body`),i=null,a=tw(e).position===`fixed`,o=a?rw(e):e;for(;VC(o)&&!ew(o);){let t=tw(o),n=ZC(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||WC(o)&&!n&&Cw(e,o))?r=r.filter(e=>e!==o):i=t,o=rw(o)}return t.set(e,r),r}function Tw(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?KC(t)?[]:ww(t,this._c):[].concat(n),r],o=Sw(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Sw(t,a[e],i);s=YS(n.top,s),c=JS(n.right,c),l=JS(n.bottom,l),u=YS(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ew(e){let{width:t,height:n}=sw(e);return{width:t,height:n}}function Dw(e,t,n){let r=HC(t),i=zC(t),a=n===`fixed`,o=pw(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=QS(0);function l(){c.x=mw(i)}if(r||!r&&!a)if((LC(t)!==`body`||WC(i))&&(s=nw(t)),r){let e=pw(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?hw(i,s):QS(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ow(e){return tw(e).position===`static`}function kw(e,t){if(!HC(e)||tw(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return zC(e)===n&&(n=n.ownerDocument.body),n}function Aw(e,t){let n=RC(e);if(KC(e))return n;if(!HC(e)){let t=rw(e);for(;t&&!ew(t);){if(VC(t)&&!Ow(t))return t;t=rw(t)}return n}let r=kw(e,t);for(;r&&GC(r)&&Ow(r);)r=kw(r,t);return r&&ew(r)&&Ow(r)&&!ZC(r)?n:r||QC(e)||n}var jw=async function(e){let t=this.getOffsetParent||Aw,n=this.getDimensions,r=await n(e.floating);return{reference:Dw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Mw(e){return tw(e).direction===`rtl`}var Nw={convertOffsetParentRelativeRectToViewportRelativeRect:gw,getDocumentElement:zC,getClippingRect:Tw,getOffsetParent:Aw,getElementRects:jw,getClientRects:_w,getDimensions:Ew,getScale:lw,isElement:VC,isRTL:Mw};function Pw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fw(e,t){let n=null,r,i=zC(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=ZS(d),h=ZS(i.clientWidth-(u+f)),g=ZS(i.clientHeight-(d+p)),_=ZS(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:YS(0,JS(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Pw(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Iw(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=cw(e),u=i||a?[...l?aw(l):[],...t?aw(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Fw(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?pw(e):null;c&&g();function g(){let t=pw(e);h&&!Pw(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Lw=MC,Rw=NC,zw=EC,Bw=FC,Vw=kC,Hw=TC,Uw=PC,Ww=(e,t,n)=>{let r=new Map,i={platform:Nw,...n},a={...i.platform,_c:r};return wC(e,t,{...i,platform:a})},Gw=typeof document<`u`?y.useLayoutEffect:function(){};function Kw(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Kw(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Kw(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function qw(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jw(e,t){let n=qw(e);return Math.round(t*n)/n}function Yw(e){let t=y.useRef(e);return Gw(()=>{t.current=e}),t}function Xw(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);Kw(f,r)||p(r);let[m,h]=y.useState(null),[g,_]=y.useState(null),v=y.useCallback(e=>{e!==w.current&&(w.current=e,h(e))},[]),b=y.useCallback(e=>{e!==T.current&&(T.current=e,_(e))},[]),S=a||m,C=o||g,w=y.useRef(null),T=y.useRef(null),E=y.useRef(u),D=c!=null,O=Yw(c),k=Yw(i),A=Yw(l),j=y.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),Ww(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Kw(E.current,t)&&(E.current=t,x.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);Gw(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=y.useRef(!1);Gw(()=>(M.current=!0,()=>{M.current=!1}),[]),Gw(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=y.useMemo(()=>({reference:w,floating:T,setReference:v,setFloating:b}),[v,b]),P=y.useMemo(()=>({reference:S,floating:C}),[S,C]),F=y.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Jw(P.floating,u.x),r=Jw(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...qw(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Zw=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Hw({element:r.current,padding:i}).fn(n):r?Hw({element:r,padding:i}).fn(n):{}}}},Qw=(e,t)=>{let n=Lw(e);return{name:n.name,fn:n.fn,options:[e,t]}},$w=(e,t)=>{let n=Rw(e);return{name:n.name,fn:n.fn,options:[e,t]}},eT=(e,t)=>({fn:Uw(e).fn,options:[e,t]}),tT=(e,t)=>{let n=zw(e);return{name:n.name,fn:n.fn,options:[e,t]}},nT=(e,t)=>{let n=Bw(e);return{name:n.name,fn:n.fn,options:[e,t]}},rT=(e,t)=>{let n=Vw(e);return{name:n.name,fn:n.fn,options:[e,t]}},iT=(e,t)=>{let n=Zw(e);return{name:n.name,fn:n.fn,options:[e,t]}},aT=`Arrow`,oT=y.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,K.jsx)(Bh.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,K.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});oT.displayName=aT;var sT=oT;function cT(e){let[t,n]=y.useState(void 0);return Eh(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var lT=`Popper`,[uT,dT]=wh(lT),[fT,pT]=uT(lT),mT=e=>{let{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return(0,K.jsx)(fT,{scope:t,anchor:r,onAnchorChange:i,children:n})};mT.displayName=lT;var hT=`PopperAnchor`,gT=y.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=pT(hT,n),o=y.useRef(null),s=Sh(t,o),c=y.useRef(null);return y.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,K.jsx)(Bh.div,{...i,ref:s})});gT.displayName=hT;var _T=`PopperContent`,[vT,yT]=uT(_T),bT=y.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=pT(_T,n),[_,v]=y.useState(null),b=Sh(t,e=>v(e)),[x,S]=y.useState(null),C=cT(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(wT),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=Xw({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>Iw(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Qw({mainAxis:i+T,alignmentAxis:o}),c&&$w({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?eT():void 0,...A}),c&&tT({...A}),nT({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&iT({element:x,padding:s}),TT({arrowWidth:w,arrowHeight:T}),f&&rT({strategy:`referenceHidden`,...A})]}),[I,L]=ET(N),R=Hh(m);Eh(()=>{P&&R?.()},[P,R]);let z=F.arrow?.x,ee=F.arrow?.y,te=F.arrow?.centerOffset!==0,[ne,re]=y.useState();return Eh(()=>{_&&re(window.getComputedStyle(_).zIndex)},[_]),(0,K.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ne,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,K.jsx)(vT,{scope:n,placedSide:I,onArrowChange:S,arrowX:z,arrowY:ee,shouldHideArrow:te,children:(0,K.jsx)(Bh.div,{"data-side":I,"data-align":L,...h,ref:b,style:{...h.style,animation:P?void 0:`none`}})})})});bT.displayName=_T;var xT=`PopperArrow`,ST={top:`bottom`,right:`left`,bottom:`top`,left:`right`},CT=y.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=yT(xT,n),a=ST[i.placedSide];return(0,K.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,K.jsx)(sT,{...r,ref:t,style:{...r.style,display:`block`}})})});CT.displayName=xT;function wT(e){return e!==null}var TT=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=ET(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function ET(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var DT=mT,OT=gT,kT=bT,AT=CT,jT=Symbol(`radix.slottable`);function MT(e){let t=({children:e})=>(0,K.jsx)(K.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=jT,t}var NT=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),PT=`VisuallyHidden`,FT=y.forwardRef((e,t)=>(0,K.jsx)(Bh.span,{...e,ref:t,style:{...NT,...e.style}}));FT.displayName=PT;var IT=FT,[LT,RT]=wh(`Tooltip`,[dT]),zT=dT(),BT=`TooltipProvider`,VT=700,HT=`tooltip.open`,[UT,WT]=LT(BT),GT=e=>{let{__scopeTooltip:t,delayDuration:n=VT,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=y.useRef(!0),s=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,K.jsx)(UT,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:y.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};GT.displayName=BT;var KT=`Tooltip`,[qT,JT]=LT(KT),YT=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=WT(KT,e.__scopeTooltip),l=zT(t),[u,d]=y.useState(null),f=kh(),p=y.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=y.useRef(!1),[_,v]=jh({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(HT))):c.onClose(),a?.(e)},caller:KT}),b=y.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),x=y.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),S=y.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),C=y.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return y.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,K.jsx)(DT,{...l,children:(0,K.jsx)(qT,{scope:t,contentId:f,open:_,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:y.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};YT.displayName=KT;var XT=`TooltipTrigger`,ZT=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=JT(XT,n),a=WT(XT,n),o=zT(n),s=Sh(t,y.useRef(null),i.onTriggerChange),c=y.useRef(!1),l=y.useRef(!1),u=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,K.jsx)(OT,{asChild:!0,...o,children:(0,K.jsx)(Bh.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:yh(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:yh(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:yh(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:yh(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:yh(e.onBlur,i.onClose),onClick:yh(e.onClick,i.onClose)})})});ZT.displayName=XT;var QT=`TooltipPortal`,[$T,eE]=LT(QT,{forceMount:void 0}),tE=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=JT(QT,t);return(0,K.jsx)($T,{scope:t,forceMount:n,children:(0,K.jsx)(Sg,{present:n||a.open,children:(0,K.jsx)(bg,{asChild:!0,container:i,children:r})})})};tE.displayName=QT;var nE=`TooltipContent`,rE=y.forwardRef((e,t)=>{let n=eE(nE,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=JT(nE,e.__scopeTooltip);return(0,K.jsx)(Sg,{present:r||o.open,children:o.disableHoverableContent?(0,K.jsx)(cE,{side:i,...a,ref:t}):(0,K.jsx)(iE,{side:i,...a,ref:t})})}),iE=y.forwardRef((e,t)=>{let n=JT(nE,e.__scopeTooltip),r=WT(nE,e.__scopeTooltip),i=y.useRef(null),a=Sh(t,i),[o,s]=y.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=y.useCallback(()=>{s(null),d(!1)},[d]),p=y.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=fE(r,dE(r,n.getBoundingClientRect())),a=pE(t.getBoundingClientRect());s(hE([...i,...a])),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),y.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!mE(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,K.jsx)(cE,{...e,ref:a})}),[aE,oE]=LT(KT,{isInside:!1}),sE=MT(`TooltipContent`),cE=y.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=JT(nE,n),l=zT(n),{onClose:u}=c;return y.useEffect(()=>(document.addEventListener(HT,u),()=>document.removeEventListener(HT,u)),[u]),y.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,K.jsx)(Xh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,K.jsxs)(kT,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,K.jsx)(sE,{children:r}),(0,K.jsx)(aE,{scope:n,isInside:!0,children:(0,K.jsx)(IT,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});rE.displayName=nE;var lE=`TooltipArrow`,uE=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=zT(n);return oE(lE,n).isInside?null:(0,K.jsx)(AT,{...i,...r,ref:t})});uE.displayName=lE;function dE(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function fE(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function pE(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function mE(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function hE(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),gE(t)}function gE(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var _E=GT,vE=YT,yE=ZT,bE=rE;function xE({children:e}){let t=_E;return(0,K.jsx)(t,{delayDuration:200,children:e})}function SE({children:e,open:t,defaultOpen:n,onOpenChange:r}){let i=vE;return(0,K.jsx)(i,{open:t,defaultOpen:n,onOpenChange:r,children:e})}function CE({children:e,asChild:t}){let n=yE;return(0,K.jsx)(n,{asChild:t,children:e})}function wE({className:e,children:t,sideOffset:n=4}){let r=bE;return(0,K.jsx)(r,{sideOffset:n,className:Y(`z-50 overflow-hidden rounded-[3px] border border-black bg-[var(--tkc-surface-dark)] px-3 py-1.5 font-mono text-[10.5px] uppercase tracking-[0.08em] text-[var(--tkc-ink)] shadow-[0_0_0_2px_var(--tkc-brass-deep),0_6px_14px_rgba(0,0,0,.5)]`,e),children:t})}function TE({sessionId:e,active:t=!1,className:n}){let[r,i]=(0,y.useState)(!1);return e?(0,K.jsx)(xE,{children:(0,K.jsxs)(SE,{children:[(0,K.jsx)(CE,{asChild:!0,children:(0,K.jsxs)(`span`,{className:Y(`relative inline-flex items-center gap-1.5 rounded-full bg-background-secondary px-2.5 py-0.5 text-xs font-mono text-foreground-muted cursor-pointer transition-all hover:bg-background-tertiary select-none`,t&&`shadow-neon-glow-cyan-sm`,n),onClick:t=>{t.stopPropagation(),t.preventDefault(),navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)},children:[(0,K.jsx)(`span`,{className:Y(`h-1.5 w-1.5 rounded-full`,t?`bg-secondary shadow-[0_0_6px_var(--secondary)] animate-pulse-dot`:`bg-foreground-muted/40`)}),mh(e,4),r&&(0,K.jsx)(`span`,{className:`absolute -top-7 left-1/2 -translate-x-1/2 rounded-md bg-primary px-2 py-0.5 text-xs leading-tight font-sans font-medium text-primary-foreground whitespace-nowrap animate-slide-in-right`,children:`Copied!`})]})}),(0,K.jsxs)(wE,{children:[(0,K.jsx)(`p`,{className:`font-mono text-xs`,children:r?`Copied!`:`Session: ${e}`}),!r&&(0,K.jsx)(`p`,{className:`text-foreground-muted text-xs leading-tight mt-0.5`,children:`Click to copy`})]})]})}):null}function EE({id:e,chars:t=4,className:n}){let[r,i]=(0,y.useState)(!1),a=t=>{t.stopPropagation(),t.preventDefault(),navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)};return(0,K.jsx)(xE,{children:(0,K.jsxs)(SE,{children:[(0,K.jsx)(CE,{asChild:!0,children:(0,K.jsx)(`span`,{className:Y(`inline-flex items-center justify-center rounded px-2 py-1 min-h-[44px] min-w-[44px] font-mono text-xs`,`bg-background-secondary text-info/80`,`hover:bg-background-tertiary hover:text-info`,`cursor-pointer transition-colors select-none`,r&&`text-primary`,n),onClick:a,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a(e))},children:mh(e,t)})}),(0,K.jsx)(wE,{children:(0,K.jsx)(`p`,{className:`font-mono text-xs`,children:r?(0,K.jsx)(`span`,{className:`text-primary font-semibold`,children:`Copied!`}):e})})]})})}var DE={default:`bg-primary`,success:`bg-success`,error:`bg-error`,warning:`bg-warning`},OE={default:`shadow-progress-glow-primary`,success:`shadow-progress-glow-success`,error:`shadow-progress-glow-error`,warning:`shadow-progress-glow-warning`};function kE({value:e,variant:t=`default`,glow:n=!1,className:r}){let i=Math.min(100,Math.max(0,e)),a=i===100;return(0,K.jsx)(`div`,{className:Y(`h-2 w-full overflow-hidden rounded-full bg-background-muted`,r),children:(0,K.jsx)(`div`,{className:Y(`h-full transition-all duration-500 ease-out`,DE[t],n&&OE[t],a?`rounded-full`:`rounded-l-full`),style:{width:`${i}%`}})})}function AE(e){switch(e){case`completed`:return`success`;case`failed`:return`error`;case`waiting`:return`warning`;default:return`default`}}function jE(e){return e.status===`completed`?100:e.totalTasks>0?Math.round(e.completedTasks/e.totalTasks*100):0}function ME(e){let t=ph(e);return t?`Stale (${t})`:`Stale`}function NE(e,t){if(e.selected!==t.selected)return!1;let n=e.run,r=t.run;return n.runId===r.runId&&n.status===r.status&&n.updatedAt===r.updatedAt&&n.completedTasks===r.completedTasks&&n.totalTasks===r.totalTasks&&n.duration===r.duration&&n.isStale===r.isStale&&n.waitingKind===r.waitingKind&&n.breakpointQuestion===r.breakpointQuestion&&n.failedStep===r.failedStep&&n.failureMessage===r.failureMessage}var PE=(0,y.memo)(function({run:e,selected:t}){let n=jE(e),r=e.status===`waiting`||e.status===`pending`,i=e.isStale===!0,a=e.tasks.find(e=>e.kind===`breakpoint`&&e.status===`requested`),o=e.breakpointQuestion??a?.breakpointQuestion,s=!i&&(!!a||e.status===`waiting`&&e.waitingKind===`breakpoint`),c=e.status===`failed`?e.failedStep||(e.failureMessage?`${e.failureMessage}`:void 0):void 0;return(0,K.jsx)(Z,{href:`/runs/${e.runId}`,children:(0,K.jsxs)(Ny,{className:Y(`cursor-pointer p-4 transition-all card-hover-lift`,`hover:shadow-md`,t&&`ring-1 ring-primary shadow-glow-primary`,r&&!i&&!s&&`border-[var(--border-hover)]`,s&&`border-warning/40 shadow-glow-warning ring-1 ring-warning/20 animate-breakpoint-glow`,i&&`opacity-50`),children:[(0,K.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,K.jsx)(`span`,{className:Y(`h-2 w-2 rounded-full shrink-0`,i?`bg-zinc-500`:s?`bg-warning shadow-[0_0_8px_var(--warning)] animate-pulse-dot`:e.status===`completed`?`bg-success shadow-[0_0_6px_var(--success)]`:e.status===`failed`?`bg-error shadow-[0_0_6px_var(--error)]`:e.status===`waiting`?`bg-warning shadow-[0_0_6px_var(--warning)] animate-pulse-dot`:`bg-pending`)}),(0,K.jsx)(`span`,{className:`text-lg font-semibold italic font-serif text-foreground truncate`,children:hh(e.processId)}),s&&(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-warning/15 border border-warning/30 px-2.5 py-1 text-[11px] leading-tight font-bold text-warning uppercase tracking-[0.12em] shrink-0 animate-pulse-dot`,children:[(0,K.jsx)(tm,{className:`h-2.5 w-2.5`}),`Approval Required`]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap mb-1`,children:[(0,K.jsx)(BS,{status:e.status,waitingKind:e.waitingKind,isStale:i}),i&&(0,K.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-zinc-500/10 border border-zinc-500/20 px-2 py-0.5 text-xs leading-tight font-medium text-zinc-500 shrink-0`,children:ME(e.updatedAt)}),(0,K.jsx)(EE,{id:e.runId,chars:4,className:`text-foreground-secondary`}),e.projectName&&(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-background-secondary px-2 py-0.5 text-xs leading-tight font-medium text-foreground-muted shrink-0`,children:[(0,K.jsx)(Bm,{className:`h-2.5 w-2.5`}),e.projectName]})]}),c&&(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-2 px-2 py-1 rounded-md bg-error-muted border border-error/20 border-l-2 border-l-error shadow-glow-error`,children:[(0,K.jsx)(Np,{className:`h-3.5 w-3.5 text-error shrink-0`}),(0,K.jsxs)(`span`,{className:`text-xs text-error truncate`,children:[`Failed at: `,c.length>80?c.slice(0,80)+`...`:c]})]}),s&&o&&(0,K.jsx)(`div`,{className:`mt-2 px-3 py-2 rounded-md bg-warning-muted border border-warning/25 border-l-2 border-l-warning shadow-breakpoint-glow`,children:(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(tm,{className:`h-4 w-4 text-warning shrink-0 mt-0.5 animate-pulse-dot`}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsx)(`span`,{className:`text-xs font-bold text-warning uppercase tracking-wider block mb-0.5`,children:`Awaiting approval`}),(0,K.jsx)(`span`,{className:`text-sm text-foreground leading-snug block`,children:o})]}),(0,K.jsxs)(`span`,{className:Y(`shrink-0 inline-flex items-center gap-1 px-2 py-1 rounded-md`,`bg-warning/10 border border-warning/20`,`text-xs font-semibold text-warning`,`hover:bg-warning/20 transition-colors`),children:[`Review & Approve`,(0,K.jsx)(Hp,{className:`h-2.5 w-2.5`})]})]})}),s&&!o&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 px-3 py-2 rounded-md bg-warning-muted border border-warning/25 border-l-2 border-l-warning shadow-breakpoint-glow`,children:[(0,K.jsx)(tm,{className:`h-4 w-4 text-warning shrink-0 animate-pulse-dot`}),(0,K.jsx)(`span`,{className:`text-xs font-semibold text-warning`,children:`Approval needed`}),(0,K.jsxs)(`span`,{className:Y(`ml-auto shrink-0 inline-flex items-center gap-1 px-2 py-1 rounded-md`,`bg-warning/10 border border-warning/20`,`text-xs font-semibold text-warning`),children:[`Review & Approve`,(0,K.jsx)(Hp,{className:`h-2.5 w-2.5`})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(TE,{sessionId:e.sessionId,active:r&&!i}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(om,{className:`h-3 w-3`}),e.completedTasks,`/`,e.totalTasks,` tasks`]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(zp,{className:`h-3 w-3`}),fh(e.duration)]})]})]})}),e.totalTasks>0&&(0,K.jsx)(kE,{value:n,variant:AE(e.status),glow:r&&!i,className:`mt-4`})]})})},NE);function FE(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o;n.key&&n.debug?.call(n)&&(o=Date.now());let s=e();if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug?.call(n)&&(c=Date.now()),i=t(...s),n.key&&n.debug?.call(n)){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
|
|
67
|
+
font-size: .6rem;
|
|
68
|
+
font-weight: bold;
|
|
69
|
+
color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i}return o.updateDeps=e=>{r=e},o}function IE(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var LE=(e,t)=>Math.abs(e-t)<1.01,RE=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},zE=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},BE=e=>e,VE=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},HE=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(zE(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(zE(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},UE={passive:!0},WE=typeof window>`u`?!0:`onscrollend`in window,GE=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=e.options.useScrollendEvent&&WE?()=>void 0:RE(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{let{horizontal:o,isRtl:s}=e.options;i=o?n.scrollLeft*(s&&-1||1):n.scrollTop,a(),t(i,r)},s=o(!0),c=o(!1);n.addEventListener(`scroll`,s,UE);let l=e.options.useScrollendEvent&&WE;return l&&n.addEventListener(`scrollend`,c,UE),()=>{n.removeEventListener(`scroll`,s),l&&n.removeEventListener(`scrollend`,c)}},KE=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},qE=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})},JE=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:BE,rangeExtractor:VE,onChange:()=>{},measureElement:KE,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=FE(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=FE(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,n,r,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=FE(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a},o)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let s=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let c=this.measurementsCache.slice(0,s),l=Array(a).fill(void 0);for(let e=0;e<s;e++){let t=c[e];t&&(l[t.lane]=e)}for(let i=s;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,u;if(a!==void 0&&this.options.lanes>1){s=a;let e=l[s],r=e===void 0?void 0:c[e];u=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?c[i-1]:this.getFurthestMeasurement(c,i);u=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(i,s)}let d=o.get(e),f=typeof d==`number`?d:this.options.estimateSize(i),p=u+f;c[i]={index:i,start:u,size:f,end:p,key:e,lane:s},l[s]=i}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=FE(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?XE({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=FE(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{let n=this.measurementsCache[e];if(!n)return;let r=t-(this.itemSizeCache.get(n.key)??n.size);r!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?n.start<this.getScrollOffset()+this.scrollAdjustments:this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this))&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.getVirtualItems=FE(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length!==0)return IE(t[YE(0,t.length-1,e=>IE(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t);this.scrollState={index:null,align:t,behavior:n,startedAt:this.now(),lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e;this.scrollState={index:null,align:`start`,behavior:t,startedAt:this.now(),lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=e[e.length-1]?.end??0;else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&LE(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,n&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior=`auto`,this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}));this.scheduleScrollReconcile()}},YE=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function XE({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){let i=e.length-1,a=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=YE(0,i,a,n),s=o;if(r===1)for(;s<i&&e[s].end<n+t;)s++;else if(r>1){let a=Array(r).fill(0);for(;s<i&&a.some(e=>e<n+t);){let t=e[s];a[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(i,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var ZE=typeof document<`u`?y.useLayoutEffect:y.useEffect;function QE({useFlushSync:e=!0,...t}){let n=y.useReducer(()=>({}),{})[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,x.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=y.useState(()=>new JE(r));return i.setOptions(r),ZE(()=>i._didMount(),[]),ZE(()=>i._willUpdate()),i}function $E(e){return QE({observeElementRect:HE,observeElementOffset:GE,scrollToFn:qE,...e})}var eD=140,tD=3,nD=15;function rD({runs:e,className:t,maxHeight:n=600,renderItem:r}){let i=(0,y.useRef)(null),a=(0,y.useMemo)(()=>e,[e]),o=(0,y.useCallback)(e=>a[e]?.runId??e,[a]),s=$E({count:a.length,getScrollElement:()=>i.current,estimateSize:()=>eD,overscan:tD,getItemKey:o});if(a.length<nD)return(0,K.jsx)(`div`,{className:t,"data-testid":`run-list-flat`,children:(0,K.jsx)(`div`,{className:`flex flex-col gap-2`,children:a.map((e,t)=>r?(0,K.jsx)(`div`,{children:r(e,t)},e.runId):(0,K.jsx)(PE,{run:e},e.runId))})});let c=s.getVirtualItems();return(0,K.jsx)(`div`,{ref:i,className:t,"data-testid":`run-list-virtualized`,style:{maxHeight:n,overflow:`auto`,contain:`strict`},children:(0,K.jsx)(`div`,{style:{height:`${s.getTotalSize()}px`,width:`100%`,position:`relative`},children:c.map(e=>{let t=a[e.index];return t?(0,K.jsx)(`div`,{"data-index":e.index,ref:s.measureElement,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:(0,K.jsx)(`div`,{style:{paddingBottom:8},children:r?r(t,e.index):(0,K.jsx)(PE,{run:t})})},e.key):null})})})}function iD({currentPage:e,totalItems:t,itemsPerPage:n,onPageChange:r,className:i}){let a=Math.ceil(t/n),o=e*n+1,s=Math.min((e+1)*n,t),c=e>0,l=e<a-1;if(t===0)return null;let u=[];if(a<=5)for(let e=0;e<a;e++)u.push(e);else{u.push(0),e>2&&u.push(`ellipsis`);for(let t=Math.max(1,e-1);t<=Math.min(a-2,e+1);t++)u.push(t);e<a-3&&u.push(`ellipsis`),u.push(a-1)}return(0,K.jsxs)(`div`,{className:Y(`flex items-center justify-between border-t border-border pt-3`,i),children:[(0,K.jsxs)(`span`,{className:`text-xs text-foreground-muted tabular-nums`,children:[o,`–`,s,` of `,t]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,K.jsx)(`button`,{onClick:()=>r(e-1),disabled:!c,className:Y(`inline-flex h-11 w-11 items-center justify-center rounded-md text-xs transition-all`,c?`text-foreground hover:bg-primary-muted hover:text-primary hover:shadow-neon-glow-primary-xs cursor-pointer`:`text-foreground-muted cursor-not-allowed opacity-40`),"aria-label":`Previous page`,children:(0,K.jsx)(Ap,{className:`h-4 w-4`})}),u.map((t,n)=>t===`ellipsis`?(0,K.jsx)(`span`,{className:`inline-flex h-11 w-5 items-center justify-center text-xs text-foreground-muted`,children:`...`},`ellipsis-${n}`):(0,K.jsx)(`button`,{onClick:()=>r(t),className:Y(`inline-flex h-11 min-w-[44px] items-center justify-center rounded-md px-1.5 text-xs font-medium tabular-nums transition-all`,t===e?`text-primary bg-primary/10`:`text-foreground-muted hover:bg-background-secondary hover:text-foreground-secondary cursor-pointer`),children:t+1},t)),(0,K.jsx)(`button`,{onClick:()=>r(e+1),disabled:!l,className:Y(`inline-flex h-11 w-11 items-center justify-center rounded-md text-xs transition-all`,l?`text-foreground hover:bg-primary-muted hover:text-primary hover:shadow-neon-glow-primary-xs cursor-pointer`:`text-foreground-muted cursor-not-allowed opacity-40`),"aria-label":`Next page`,children:(0,K.jsx)(jp,{className:`h-4 w-4`})})]})]})}function aD(e,t={}){let{limit:n=10,offset:r=0,search:i=``,status:a=``,sort:o=`status`,enabled:s=!0}=t,c=new URLSearchParams;c.set(`project`,e),c.set(`limit`,String(n)),c.set(`offset`,String(r)),i&&c.set(`search`,i),a&&c.set(`status`,a),o&&o!==`status`&&c.set(`sort`,o);let{data:l,loading:u,error:d,refresh:f}=$v(`/api/runs?${c.toString()}`,{interval:5e3,sseFilter:()=>!0,enabled:s});return{runs:s&&l?l.runs:[],totalCount:s&&l?l.totalCount:0,loading:u,error:d,refresh:f}}function oD(e){return e.failedRuns>0?`failing`:e.activeRuns>0?`active`:e.staleRuns>0?`stale`:`healthy`}var sD={healthy:{dotClass:`bg-success shadow-[0_0_6px_var(--success)]`,borderClass:`border-success/20 hover:border-success/40`,icon:Pp,label:`Healthy`,barColor:`bg-success`},active:{dotClass:`bg-warning shadow-[0_0_6px_var(--warning)] animate-pulse-dot`,borderClass:`border-warning/20 hover:border-warning/40`,icon:yp,label:`Active`,barColor:`bg-warning`},stale:{dotClass:`bg-zinc-500`,borderClass:`border-zinc-500/20 hover:border-zinc-500/40`,icon:ym,label:`Stale`,barColor:`bg-zinc-500`},failing:{dotClass:`bg-error shadow-[0_0_6px_var(--error)]`,borderClass:`border-error/20 hover:border-error/40`,icon:Np,label:`Failing`,barColor:`bg-error`}},cD=5;function lD({project:e,statusFilter:t,sortMode:n=`status`,onHide:r}){let[i,a]=(0,y.useState)(!1),o=(0,y.useCallback)(async t=>{t.stopPropagation(),a(!0);let n=await uh(`/api/config`);if(!n.ok){a(!1);return}let i=n.data.hiddenProjects??[];if(i.includes(e.projectName)){a(!1),r?.(e.projectName);return}let o=[...i,e.projectName],s=await uh(`/api/config`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sources:n.data.sources,pollInterval:n.data.pollInterval,theme:n.data.theme,retentionDays:n.data.retentionDays,hiddenProjects:o})});a(!1),s.ok&&r?.(e.projectName)},[e.projectName,r]),[s,c]=ux(`project-expanded:${e.projectName}`,!1),[l,u]=(0,y.useState)(0),[d,f]=(0,y.useState)(!1),[p,m]=(0,y.useState)(!1),[h,g]=(0,y.useState)(`all`),_=sD[oD(e)],v=_.icon,b=e.totalTasks>0?Math.round(e.completedTasksAggregate/e.totalTasks*100):0,x=h===`all`?t:h,{runs:S,totalCount:C,loading:w}=aD(e.projectName,{limit:cD,offset:l*cD,status:x===`all`?``:x,sort:n,enabled:s}),T=e=>{g(t=>t===e?`all`:e),u(0)};return(0,K.jsxs)(Ny,{"data-testid":`project-card-${e.projectName}`,className:Y(`transition-all duration-200 overflow-hidden card-hover-lift`,_.borderClass,s&&`ring-1 ring-primary/20`),children:[(0,K.jsxs)(`button`,{onClick:()=>c(e=>!e),className:`w-full text-left p-4 hover:bg-background-secondary/30 transition-colors`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 truncate flex-1`,children:[(0,K.jsx)(`h3`,{className:`text-lg font-semibold text-foreground truncate`,children:e.projectName}),e.pendingBreakpoints>0&&(0,K.jsxs)(`span`,{className:Y(`inline-flex items-center gap-1 rounded-full px-2 py-0.5 shrink-0`,`bg-warning/15 border border-warning/30`,`text-xs leading-tight font-bold text-warning`,`animate-pulse-dot`),children:[(0,K.jsx)(tm,{className:`h-2.5 w-2.5`}),e.pendingBreakpoints,` Pending`]})]}),(0,K.jsxs)(`div`,{className:`flex items-center shrink-0 ml-2 gap-1`,children:[(0,K.jsx)(`span`,{role:`button`,tabIndex:0,onClick:o,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o(e))},className:Y(`rounded-md p-2 min-h-[44px] min-w-[44px] inline-flex items-center justify-center transition-colors`,i?`text-foreground-muted cursor-wait`:`text-foreground-muted/40 hover:text-foreground-muted hover:bg-background-secondary`),title:`Hide project from dashboard`,children:i?(0,K.jsx)(dm,{className:`h-3.5 w-3.5 animate-spin`}):(0,K.jsx)(Up,{className:`h-3.5 w-3.5`})}),s?(0,K.jsx)(Mp,{className:`h-4 w-4 text-foreground-muted`}):(0,K.jsx)(kp,{className:`h-4 w-4 text-foreground-muted`})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:Y(`h-2.5 w-2.5 rounded-full shrink-0`,_.dotClass)}),(0,K.jsx)(v,{className:`h-3 w-3`}),_.label]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(om,{className:`h-3 w-3`}),e.totalRuns]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(zp,{className:`h-3 w-3`}),ph(e.latestUpdate)]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[e.activeRuns>0&&(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 rounded-full bg-warning/10 border border-warning/20 px-1.5 py-0.5 text-xs leading-tight font-medium text-warning tabular-nums`,title:`${e.activeRuns} active`,children:[(0,K.jsx)(yp,{className:`h-3 w-3`}),e.activeRuns]}),e.staleRuns>0&&(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 rounded-full bg-zinc-500/10 border border-zinc-500/20 px-1.5 py-0.5 text-xs leading-tight font-medium text-zinc-500 tabular-nums`,title:`${e.staleRuns} stale`,children:[(0,K.jsx)(ym,{className:`h-3 w-3`}),e.staleRuns]}),e.completedRuns>0&&(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 rounded-full bg-success/10 border border-success/20 px-1.5 py-0.5 text-xs leading-tight font-medium text-success tabular-nums`,title:`${e.completedRuns} completed`,children:[(0,K.jsx)(Pp,{className:`h-3 w-3`}),e.completedRuns]}),e.failedRuns>0&&(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 rounded-full bg-error/10 border border-error/20 px-1.5 py-0.5 text-xs leading-tight font-medium text-error tabular-nums`,title:`${e.failedRuns} failed`,children:[(0,K.jsx)(Np,{className:`h-3 w-3`}),e.failedRuns]})]})]}),e.totalTasks>0&&(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,K.jsxs)(`span`,{className:`text-xs leading-tight text-foreground-muted`,children:[e.completedTasksAggregate,`/`,e.totalTasks,` tasks`]}),(0,K.jsxs)(`span`,{className:`text-xs leading-tight text-foreground-muted tabular-nums`,children:[b,`%`]})]}),(0,K.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-background-secondary overflow-hidden`,children:(0,K.jsx)(`div`,{className:Y(`h-full rounded-full transition-all duration-500`,_.barColor),style:{width:`${b}%`}})})]})]}),s&&(()=>{let t=S.filter(e=>e.status===`waiting`||e.status===`pending`||e.isStale),r=S.filter(e=>e.status===`completed`&&!e.isStale),i=S.filter(e=>e.status===`failed`&&!e.isStale),a=t.length>0,o=r.length>0,s=i.length>0;return(0,K.jsxs)(`div`,{className:`border-t border-border px-4 pb-4 pt-3`,children:[w&&S.length===0?(0,K.jsx)(`div`,{className:`flex flex-col gap-2`,children:[1,2].map(e=>(0,K.jsxs)(`div`,{className:`rounded-lg border border-border bg-background p-3 animate-pulse`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,K.jsx)(`div`,{className:`h-2 w-2 rounded-full bg-foreground-muted/20`}),(0,K.jsx)(`div`,{className:`h-3 w-32 rounded bg-foreground-muted/10`})]}),(0,K.jsx)(`div`,{className:`h-2 w-full rounded bg-foreground-muted/10`})]},e))}):S.length===0?(0,K.jsx)(`p`,{className:`text-xs text-foreground-muted text-center py-4`,children:`No matching runs`}):n===`activity`?(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,K.jsxs)(`div`,{className:Y(`grid gap-2 mb-3`,e.staleRuns>0?`grid-cols-4`:`grid-cols-3`),children:[(0,K.jsx)(uD,{icon:(0,K.jsx)(yp,{className:`h-3.5 w-3.5`}),count:e.activeRuns,label:`Active`,colorClass:`text-warning`,bgClass:`bg-warning/10`,pulse:e.activeRuns>0,active:h===`waiting`,onClick:e=>{e.stopPropagation(),T(`waiting`)}}),e.staleRuns>0&&(0,K.jsx)(uD,{icon:(0,K.jsx)(ym,{className:`h-3.5 w-3.5`}),count:e.staleRuns,label:`Stale`,colorClass:`text-zinc-500`,bgClass:`bg-zinc-500/10`,active:h===`waiting`,onClick:e=>{e.stopPropagation(),T(`waiting`)}}),(0,K.jsx)(uD,{icon:(0,K.jsx)(Pp,{className:`h-3.5 w-3.5`}),count:e.completedRuns,label:`Completed`,colorClass:`text-success`,bgClass:`bg-success/10`,active:h===`completed`,onClick:e=>{e.stopPropagation(),T(`completed`)}}),(0,K.jsx)(uD,{icon:(0,K.jsx)(Np,{className:`h-3.5 w-3.5`}),count:e.failedRuns,label:`Failed`,colorClass:`text-error`,bgClass:`bg-error/10`,active:h===`failed`,onClick:e=>{e.stopPropagation(),T(`failed`)}})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,K.jsx)(zp,{className:`h-3.5 w-3.5 text-primary`}),(0,K.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:`Timeline`}),(0,K.jsx)(`span`,{className:`rounded-full bg-primary/10 border border-primary/20 px-2 py-px text-xs font-semibold text-primary tabular-nums`,children:S.length})]}),(0,K.jsx)(rD,{runs:S,maxHeight:500,renderItem:e=>(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(PE,{run:e}),(0,K.jsxs)(`span`,{className:`absolute top-2 right-2 inline-flex items-center gap-1 rounded-full bg-background/80 backdrop-blur-sm border border-border px-2 py-0.5 text-xs text-foreground-muted tabular-nums pointer-events-none z-10`,children:[(0,K.jsx)(zp,{className:`h-2.5 w-2.5`}),ph(e.updatedAt)]})]})})]}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,K.jsxs)(`div`,{className:Y(`grid gap-2 mb-3`,e.staleRuns>0?`grid-cols-4`:`grid-cols-3`),children:[(0,K.jsx)(uD,{icon:(0,K.jsx)(yp,{className:`h-3.5 w-3.5`}),count:e.activeRuns,label:`Active`,colorClass:`text-warning`,bgClass:`bg-warning/10`,pulse:e.activeRuns>0,active:h===`waiting`,onClick:e=>{e.stopPropagation(),T(`waiting`)}}),e.staleRuns>0&&(0,K.jsx)(uD,{icon:(0,K.jsx)(ym,{className:`h-3.5 w-3.5`}),count:e.staleRuns,label:`Stale`,colorClass:`text-zinc-500`,bgClass:`bg-zinc-500/10`,active:h===`waiting`,onClick:e=>{e.stopPropagation(),T(`waiting`)}}),(0,K.jsx)(uD,{icon:(0,K.jsx)(Pp,{className:`h-3.5 w-3.5`}),count:e.completedRuns,label:`Completed`,colorClass:`text-success`,bgClass:`bg-success/10`,active:h===`completed`,onClick:e=>{e.stopPropagation(),T(`completed`)}}),(0,K.jsx)(uD,{icon:(0,K.jsx)(Np,{className:`h-3.5 w-3.5`}),count:e.failedRuns,label:`Failed`,colorClass:`text-error`,bgClass:`bg-error/10`,active:h===`failed`,onClick:e=>{e.stopPropagation(),T(`failed`)}})]}),a&&(0,K.jsxs)(`div`,{className:`mb-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,K.jsx)(yp,{className:`h-3.5 w-3.5 text-warning animate-pulse-dot`}),(0,K.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:`In Progress`}),(0,K.jsx)(`span`,{className:`rounded-full bg-warning/10 border border-warning/20 px-2 py-px text-xs font-semibold text-warning tabular-nums`,children:t.length})]}),(0,K.jsx)(rD,{runs:t,maxHeight:500})]}),s&&(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),m(e=>!e)},className:`flex items-center gap-2 py-1.5 text-xs group w-fit`,children:[(0,K.jsx)(Np,{className:`h-3.5 w-3.5 text-error/70`}),(0,K.jsx)(`span`,{className:`font-semibold text-error/80 group-hover:text-error transition-colors`,children:`Failed Runs`}),(0,K.jsx)(`span`,{className:`rounded-full bg-error/10 border border-error/20 px-2 py-px text-xs font-semibold text-error tabular-nums`,children:i.length}),p?(0,K.jsx)(Mp,{className:`h-3 w-3 text-error/40 group-hover:text-error/60`}):(0,K.jsx)(kp,{className:`h-3 w-3 text-error/40 group-hover:text-error/60`})]}),p&&(0,K.jsx)(`div`,{className:`mt-1 opacity-70`,children:(0,K.jsx)(rD,{runs:i,maxHeight:400})})]}),o&&(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),f(e=>!e)},className:`flex items-center gap-2 py-1.5 text-xs group w-fit`,children:[(0,K.jsx)(nm,{className:`h-3.5 w-3.5 text-foreground-muted/70`}),(0,K.jsx)(`span`,{className:`font-semibold text-foreground-muted group-hover:text-foreground-secondary transition-colors`,children:`Completed History`}),(0,K.jsx)(`span`,{className:`rounded-full bg-background-secondary border border-border px-2 py-px text-xs font-semibold text-foreground-muted tabular-nums`,children:r.length}),d?(0,K.jsx)(Mp,{className:`h-3 w-3 text-foreground-muted/60 group-hover:text-foreground-muted`}):(0,K.jsx)(kp,{className:`h-3 w-3 text-foreground-muted/60 group-hover:text-foreground-muted`})]}),d&&(0,K.jsx)(`div`,{className:`mt-1 opacity-60`,children:(0,K.jsx)(rD,{runs:r,maxHeight:400})})]})]}),C>cD&&(0,K.jsx)(iD,{currentPage:l,totalItems:C,itemsPerPage:cD,onPageChange:u,className:`mt-3`})]})})()]})}function uD({icon:e,count:t,label:n,colorClass:r,bgClass:i,pulse:a,active:o,onClick:s}){let c=!!s;return(0,K.jsxs)(`div`,{role:c?`button`:void 0,tabIndex:c?0:void 0,onClick:s,onKeyDown:c?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s?.(e))}:void 0,className:Y(`rounded-md px-2.5 py-1.5 flex items-center gap-2 transition-all`,i,c&&`cursor-pointer hover:opacity-80`,o&&`ring-2 ring-offset-1 ring-offset-card`,o&&r.replace(`text-`,`ring-`).replace(/\/\d+$/,`/50`)),children:[(0,K.jsx)(`span`,{className:Y(r,a&&`animate-pulse`),children:e}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:Y(`text-sm font-bold tabular-nums leading-none`,r),children:t}),(0,K.jsx)(`p`,{className:`text-xs leading-tight text-foreground-muted uppercase tracking-wider`,children:n})]})]})}function dD(){return(0,K.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 items-start`,children:[1,2,3].map(e=>(0,K.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-4 animate-pulse`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,K.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full bg-foreground-muted/20`}),(0,K.jsx)(`div`,{className:`h-4 w-32 rounded bg-foreground-muted/10`})]}),(0,K.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-foreground-muted/10 mb-3`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`h-5 w-16 rounded-full bg-foreground-muted/10`}),(0,K.jsx)(`div`,{className:`h-5 w-16 rounded-full bg-foreground-muted/10`}),(0,K.jsx)(`div`,{className:`h-3 w-12 rounded bg-foreground-muted/10`})]})]},e))})}function fD({error:e}){return(0,K.jsxs)(`div`,{"data-testid":`error-banner`,className:`rounded-lg border border-error/20 bg-error-muted p-4 text-sm text-error`,children:[`Failed to load projects: `,e]})}function pD(){return(0,K.jsxs)(`div`,{"data-testid":`empty-state`,className:`text-center py-16`,children:[(0,K.jsx)(Zp,{className:`h-10 w-10 text-foreground-muted/30 mx-auto mb-3`}),(0,K.jsx)(`p`,{className:`text-sm text-foreground-muted mb-1`,children:`No projects found`}),(0,K.jsxs)(`p`,{className:`text-xs text-foreground-muted/60`,children:[`Configure watch sources in`,` `,(0,K.jsx)(`button`,{onClick:()=>window.dispatchEvent(new CustomEvent(`open-settings`)),className:`text-primary hover:underline`,children:`Settings`}),` `,`or edit `,(0,K.jsx)(`span`,{className:`font-mono`,children:`~/.a5c/kanban.json`})]})]})}function mD(){return(0,K.jsxs)(`div`,{"data-testid":`idle-empty-state`,className:`text-center py-16`,children:[(0,K.jsx)(Wp,{className:`h-10 w-10 text-foreground-muted/30 mx-auto mb-3`}),(0,K.jsx)(`p`,{className:`text-sm text-foreground-muted mb-1`,children:`All quiet — no active orchestration runs`}),(0,K.jsx)(`p`,{className:`text-xs text-foreground-muted/60`,children:`Runs will appear here when babysitter processes are started`})]})}function hD({loading:e,error:t,filteredProjects:n,activeProjects:r,historyProjects:i,statusFilter:a,sortMode:o,cardStatusFilter:s,historyCollapsed:c,onHistoryCollapsedChange:l,onHideProject:u}){return e?(0,K.jsx)(dD,{}):t?(0,K.jsx)(fD,{error:t}):n.length===0?(0,K.jsx)(pD,{}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[r.length===0&&i.length===0&&(0,K.jsx)(mD,{}),r.length===0&&i.length>0&&(a===`all`||a===`stale`)&&(0,K.jsxs)(`div`,{"data-testid":`idle-with-history-banner`,className:`flex items-center gap-2 px-3 py-2 rounded-md bg-background-secondary/50 border border-border w-fit`,children:[(0,K.jsx)(yp,{className:`h-3.5 w-3.5 text-foreground-muted/50`}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:o===`activity`?`No activity in the last 24 hours`:`No runs in progress`})]}),r.length>0&&(a===`all`||a===`stale`||a===`waiting`)&&(0,K.jsx)(KS,{section:`Active Runs`,children:(0,K.jsxs)(`section`,{"data-testid":`active-runs-section`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[o===`activity`?(0,K.jsx)(zp,{className:`h-4 w-4 text-primary`}):(0,K.jsx)(yp,{className:`h-4 w-4 text-warning animate-pulse-dot`}),(0,K.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:o===`activity`?`Recent Activity`:`In Progress`}),(0,K.jsx)(`span`,{className:Y(`rounded-full px-2 py-px text-xs font-semibold tabular-nums`,o===`activity`?`bg-primary/10 border border-primary/20 text-primary`:`bg-warning/10 border border-warning/20 text-warning`),children:r.length})]}),(0,K.jsx)(`div`,{"data-testid":`project-grid-active`,className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 items-start`,children:r.map(e=>(0,K.jsx)(lD,{project:e,statusFilter:s,sortMode:o,onHide:u},e.projectName))})]})}),(a===`completed`||a===`failed`)&&(0,K.jsx)(KS,{section:`Filtered Results`,children:(0,K.jsx)(`div`,{"data-testid":`project-grid-filtered`,className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 items-start`,children:n.map(e=>(0,K.jsx)(lD,{project:e,statusFilter:s,sortMode:o},e.projectName))})}),i.length>0&&(a===`all`||a===`stale`)&&(0,K.jsx)(KS,{section:`Recent History`,children:(0,K.jsxs)(`section`,{"data-testid":`recent-history-section`,children:[(0,K.jsxs)(`button`,{onClick:()=>l(e=>!e),className:`flex items-center gap-2 mb-3 group w-fit`,children:[(0,K.jsx)(nm,{className:`h-4 w-4 text-foreground-muted/70`}),(0,K.jsx)(`h2`,{className:`text-sm font-semibold text-foreground-muted group-hover:text-foreground-secondary transition-colors`,children:o===`activity`?`Earlier`:`Recent History`}),(0,K.jsx)(`span`,{className:`rounded-full bg-background-secondary border border-border px-2 py-px text-xs font-semibold text-foreground-muted tabular-nums`,children:i.length}),c?(0,K.jsx)(kp,{className:`h-3.5 w-3.5 text-foreground-muted/60 group-hover:text-foreground-muted transition-colors`}):(0,K.jsx)(Mp,{className:`h-3.5 w-3.5 text-foreground-muted/60 group-hover:text-foreground-muted transition-colors`})]}),!c&&(0,K.jsx)(`div`,{className:`opacity-70`,children:(0,K.jsx)(`div`,{"data-testid":`project-grid-history`,className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 items-start`,children:i.map(e=>(0,K.jsx)(lD,{project:e,statusFilter:s,sortMode:o},e.projectName))})})]})})]})}var gD=[{label:`All`,value:`all`},{label:`Running`,value:`waiting`},{label:`Stale`,value:`stale`},{label:`Completed`,value:`completed`},{label:`Failed`,value:`failed`}];function _D({statusFilter:e,onStatusFilterChange:t,filterCounts:n,sortMode:r,onSortModeToggle:i,filteredProjectCount:a}){return(0,K.jsx)(`div`,{className:`mb-5`,children:(0,K.jsxs)(`div`,{"data-testid":`filter-bar`,className:`flex items-center gap-1`,children:[gD.map(r=>{let i=n[r.value]??0;return r.value===`stale`&&i===0?null:(0,K.jsxs)(`button`,{"data-testid":`filter-pill-${r.value}`,"aria-pressed":e===r.value,onClick:()=>t(r.value),className:Y(`rounded-md px-3 py-1.5 min-h-[44px] text-xs font-medium transition-all inline-flex items-center gap-1.5`,e===r.value?r.value===`stale`?`bg-zinc-500/10 text-zinc-500`:`bg-primary/10 text-primary shadow-neon-glow-primary-xs`:`text-foreground-muted hover:text-foreground-secondary hover:bg-background-secondary`),children:[r.label,i>0&&(0,K.jsx)(`span`,{className:Y(`rounded-full px-1.5 py-px text-xs leading-tight font-semibold tabular-nums`,e===r.value?r.value===`stale`?`bg-zinc-500/20 text-zinc-500`:`bg-primary/20 text-primary`:`bg-background-secondary text-foreground-muted`),children:i})]},r.value)}),(0,K.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,K.jsxs)(`button`,{"data-testid":`sort-toggle`,onClick:i,className:Y(`rounded-md px-2.5 py-1.5 min-h-[44px] text-xs font-medium inline-flex items-center gap-1.5`,`transition-all duration-200 ease-in-out`,r===`status`?`bg-warning/10 border border-warning/30 text-warning hover:bg-warning/15 hover:border-warning/40 shadow-sm`:`bg-primary/10 border border-primary/30 text-primary hover:bg-primary/15 hover:border-primary/40 shadow-sm`),title:r===`status`?`Currently sorting by status priority (active first, then failed, then completed). Click to switch to chronological activity view.`:`Currently sorting by most recent activity (newest updates first). Click to switch to status-grouped view.`,children:[r===`status`?(0,K.jsx)(wp,{className:`h-3 w-3 transition-transform duration-200`}):(0,K.jsx)(zp,{className:`h-3 w-3 transition-transform duration-200`}),r===`status`?`By Status`:`By Activity`]}),(0,K.jsxs)(`span`,{"data-testid":`project-count`,className:`text-xs text-foreground-muted tabular-nums`,children:[a,` project`,a===1?``:`s`]})]})]})})}function vD(e,t){return`/projects/${encodeURIComponent(e)}/issues/${encodeURIComponent(t)}`}function yD(e){return`/projects/${encodeURIComponent(e)}/board`}function bD(e){return e===`azure-repos`?`Azure Repos`:`GitHub`}function xD(e){return e.mode===`issue`&&e.issueKey?e.issueKey:e.mode===`host`&&e.projectKey&&e.hostProvider?`${e.projectKey}-${e.hostProvider}`:e.projectKey??`workspace`}function SD(e){let t=hf(),{snapshot:n,loading:r,error:i}=sy(),[a,o]=(0,y.useState)(e.projectId??``),[s,c]=(0,y.useState)(``),[l,u]=(0,y.useState)(``),[d,f]=(0,y.useState)(!1),[p,m]=(0,y.useState)(null),h=n?.projects??[],g=(0,y.useMemo)(()=>h.find(e=>e.id===a)??(e.projectId?void 0:h[0]),[h,e.projectId,a]),_=(0,y.useMemo)(()=>e.issueId?n?.issues.find(t=>t.id===e.issueId&&(!g||t.projectId===g.id)):void 0,[e.issueId,g,n?.issues]),v=g?.integrations??[];(0,y.useEffect)(()=>{!a&&g?.id&&o(g.id)},[g?.id,a]),(0,y.useEffect)(()=>{if(v.length===0){c(``);return}s&&v.some(e=>e.provider===s)||c((v.find(e=>e.prerequisites.every(e=>e.satisfied))??v[0])?.provider??``)},[v,s]),(0,y.useEffect)(()=>{u(xD({mode:e.mode,projectKey:g?.key,issueKey:_?.key,hostProvider:s||void 0}))},[e.mode,s,_?.key,g?.key]);let b=(0,y.useMemo)(()=>v.find(e=>e.provider===s),[v,s]),x=e.mode===`issue`?`Create issue-owned workspace`:e.mode===`project`?`Create project-owned workspace`:`Create host-scoped workspace`,S=e.mode===`issue`?`This route provisions a workspace from the current issue and redirects directly into the workspace shell.`:e.mode===`project`?`This route provisions a workspace owned by the current project without requiring an issue-first entry point.`:`This route starts from the workspace host surface and still records the selected project and host context explicitly.`,C=e.mode===`issue`&&_?vD(_.projectId,_.id):g?yD(g.id):`/workspaces`;async function w(n){if(n.preventDefault(),!(!g||!l.trim())){f(!0),m(null);try{let n=await fetch(`/api/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`provision`,scope:e.mode,projectId:g.id,issueId:e.mode===`issue`?_?.id:void 0,hostProvider:(e.mode===`host`||e.mode,s||void 0),workspaceName:l.trim()})});if(!n.ok){let e=await n.json().catch(()=>null);throw Error(e?.error??`Workspace provisioning failed: ${n.status}`)}let r=await n.json();t.push(`/workspaces?workspace=${encodeURIComponent(r.workspace.workspacePath)}`)}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1)}}}return r&&!n?(0,K.jsx)(`div`,{className:`mx-auto flex w-full max-w-[960px] flex-1 px-4 py-6 sm:px-6`,children:(0,K.jsxs)(`section`,{className:`w-full animate-pulse rounded-3xl border border-border bg-card p-6`,children:[(0,K.jsx)(`div`,{className:`h-5 w-48 rounded bg-background-secondary`}),(0,K.jsx)(`div`,{className:`mt-4 h-20 rounded-2xl bg-background-secondary`})]})}):i||!n?(0,K.jsx)(`div`,{className:`mx-auto flex w-full max-w-[960px] flex-1 px-4 py-6 sm:px-6`,children:(0,K.jsx)(`section`,{className:`w-full rounded-3xl border border-error/25 bg-error-muted p-6 text-sm text-error`,children:`Failed to load workspace provisioning context.`})}):(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[960px] flex-1 flex-col gap-6 px-4 py-6 sm:px-6`,children:[(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Workspace provisioning`}),(0,K.jsx)(`h1`,{className:`mt-2 text-3xl font-semibold tracking-tight text-foreground`,children:x}),(0,K.jsx)(`p`,{className:`mt-3 max-w-3xl text-sm leading-6 text-foreground-muted`,children:S})]}),(0,K.jsx)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:(0,K.jsxs)(`form`,{className:`grid gap-5`,onSubmit:w,children:[e.mode===`host`?(0,K.jsxs)(`label`,{className:`grid gap-2 text-sm font-medium text-foreground`,children:[`Project`,(0,K.jsx)(`select`,{value:a,onChange:e=>o(e.target.value),className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:h.map(e=>(0,K.jsxs)(`option`,{value:e.id,children:[e.key,` - `,e.name]},e.id))})]}):null,g?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 p-4 text-sm text-foreground-muted`,children:[(0,K.jsx)(`div`,{className:`font-semibold text-foreground`,children:g.key}),(0,K.jsx)(`div`,{className:`mt-1`,children:g.name}),_?(0,K.jsxs)(`div`,{className:`mt-3 rounded-xl border border-border bg-card px-3 py-2 text-xs text-foreground-muted`,children:[`Issue owner: `,(0,K.jsx)(`span`,{className:`font-semibold text-foreground`,children:_.key}),` ·`,` `,_.title]}):null]}):null,v.length>0?(0,K.jsxs)(`label`,{className:`grid gap-2 text-sm font-medium text-foreground`,children:[`Host context`,(0,K.jsx)(`select`,{value:s,onChange:e=>c(e.target.value),className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:v.map(e=>(0,K.jsxs)(`option`,{value:e.provider,children:[e.label,` · `,e.accountLabel??e.status]},e.provider))})]}):null,b?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 p-4 text-sm text-foreground-muted`,children:[(0,K.jsxs)(`div`,{className:`font-semibold text-foreground`,children:[bD(b.provider),` ownership metadata will be attached`]}),(0,K.jsx)(`div`,{className:`mt-1`,children:b.guidance})]}):null,(0,K.jsxs)(`label`,{className:`grid gap-2 text-sm font-medium text-foreground`,children:[`Workspace name`,(0,K.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground outline-none`,placeholder:`workspace name`})]}),p?(0,K.jsx)(`div`,{className:`rounded-2xl border border-error/25 bg-error-muted px-4 py-3 text-sm text-error`,children:p}):null,(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,K.jsx)(Q,{type:`submit`,variant:`primary`,disabled:!g||!l.trim(),loading:d,children:`Create workspace`}),(0,K.jsx)(Q,{asChild:!0,variant:`outline`,children:(0,K.jsx)(Z,{href:C,children:`Cancel`})})]})]})})]})}function CD(e){return Array.from(new Set(e.map(e=>e.labelId?.trim()||``).filter(Boolean))).map(e=>({labelId:e}))}function wD(e){let t=Array.from(new Set(e.labelIds??[])),n=e.labels??[],r=e.projectKey?.trim()?e.projectName?.trim()?`${e.projectKey} (${e.projectName})`:e.projectKey:e.projectName?.trim()||e.projectId,i=n.length>0?n.map(e=>`- ${e.key} (${e.labelId}): ${e.label}`).join(`
|
|
70
|
+
`):t.length>0?t.map(e=>`- ${e}`).join(`
|
|
71
|
+
`):`- none`,a=e.renderedContext?.trim()||`- none`,o=(e.runIds??[]).length>0?(e.runIds??[]).join(`, `):`none`,s=(e.sessionIds??[]).length>0?(e.sessionIds??[]).join(`, `):`none`;return[`Execution Context`,`Project: ${r}`,`Issue: ${e.issueKey} (${e.issueId})`,`Title: ${e.issueTitle}`,`Applied Dispatch Context Labels (${t.length}):`,i,`Run IDs: ${o}`,`Session IDs: ${s}`,`Last Dispatched At: ${e.lastDispatchedAt??`none`}`,`Rendered Dispatch Context:`,a].join(`
|
|
72
|
+
`)}function TD(e){let t=CD(e.issue.dispatch.contextLabels).map(e=>e.labelId),n=e.issue.dispatch.contextLabelProjections??[],r=e.issue.dispatch.renderedContext?.trim()||void 0;if(!(t.length===0&&n.length===0&&!r))return{kind:`dispatch-context-labels`,project:{id:e.project?.id??e.issue.projectId,key:e.project?.key,name:e.project?.name},issue:{id:e.issue.id,key:e.issue.key,title:e.issue.title},dispatch:{runIds:Array.from(new Set(e.issue.dispatch.runIds??[])),sessionIds:Array.from(new Set(e.issue.dispatch.sessionIds??[])),labelIds:t,labels:n,renderedContext:r,lastDispatchedAt:e.issue.dispatch.lastDispatchedAt},block:wD({projectId:e.project?.id??e.issue.projectId,projectKey:e.project?.key,projectName:e.project?.name,issueId:e.issue.id,issueKey:e.issue.key,issueTitle:e.issue.title,runIds:e.issue.dispatch.runIds,sessionIds:e.issue.dispatch.sessionIds,labelIds:t,labels:n,renderedContext:r,lastDispatchedAt:e.issue.dispatch.lastDispatchedAt})}}function ED(e,t){let n=new Map(e.projects.map(e=>[e.id,e]));return e.issues.filter(t).map(e=>TD({issue:e,project:n.get(e.projectId)})).filter(e=>!!e).sort((e,t)=>e.issue.key.localeCompare(t.issue.key)||e.issue.id.localeCompare(t.issue.id))}function DD(e,t){let n=t.trim();return n?ED(e,e=>e.dispatch.sessionIds.includes(n)):[]}function OD(e){let t=kD(e),n=y.forwardRef((e,n)=>{let{children:r,...i}=e,a=y.Children.toArray(r),o=a.find(jD);if(o){let e=o.props.children,r=a.map(t=>t===o?y.Children.count(e)>1?y.Children.only(null):y.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:y.isValidElement(e)?y.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function kD(e){let t=y.forwardRef((e,t)=>{let{children:n,...r}=e;if(y.isValidElement(n)){let e=ND(n),i=MD(r,n.props);return n.type!==y.Fragment&&(i.ref=t?xh(t,e):e),y.cloneElement(n,i)}return y.Children.count(n)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AD=Symbol(`radix.slottable`);function jD(e){return y.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===AD}function MD(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ND(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function PD(e){let t=e+`CollectionProvider`,[n,r]=wh(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=y.useRef(null),a=y.useRef(new Map).current;return(0,K.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=OD(s),l=y.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,K.jsx)(c,{ref:Sh(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=OD(u),p=y.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=y.useRef(null),s=Sh(t,o),c=a(u,n);return y.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,K.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return y.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var FD=`Collapsible`,[ID,LD]=wh(FD),[RD,zD]=ID(FD),BD=y.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=jh({prop:r,defaultProp:i??!1,onChange:o,caller:FD});return(0,K.jsx)(RD,{scope:n,disabled:a,contentId:kh(),open:c,onOpenToggle:y.useCallback(()=>l(e=>!e),[l]),children:(0,K.jsx)(Bh.div,{"data-state":KD(c),"data-disabled":a?``:void 0,...s,ref:t})})});BD.displayName=FD;var VD=`CollapsibleTrigger`,HD=y.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=zD(VD,n);return(0,K.jsx)(Bh.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":KD(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:yh(e.onClick,i.onOpenToggle)})});HD.displayName=VD;var UD=`CollapsibleContent`,WD=y.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=zD(UD,e.__scopeCollapsible);return(0,K.jsx)(Sg,{present:n||i.open,children:({present:e})=>(0,K.jsx)(GD,{...r,ref:t,present:e})})});WD.displayName=UD;var GD=y.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=zD(UD,n),[s,c]=y.useState(r),l=y.useRef(null),u=Sh(t,l),d=y.useRef(0),f=d.current,p=y.useRef(0),m=p.current,h=o.open||s,g=y.useRef(h),_=y.useRef(void 0);return y.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),Eh(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,K.jsx)(Bh.div,{"data-state":KD(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function KD(e){return e?`open`:`closed`}var qD=BD,JD=HD,YD=WD,XD=y.createContext(void 0);function ZD(e){let t=y.useContext(XD);return e||t||`ltr`}var QD=`Accordion`,$D=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[eO,tO,nO]=PD(QD),[rO,iO]=wh(QD,[nO,LD]),aO=LD(),oO=y.forwardRef((e,t)=>{let{type:n,...r}=e,i=r,a=r;return(0,K.jsx)(eO.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,K.jsx)(fO,{...a,ref:t}):(0,K.jsx)(dO,{...i,ref:t})})});oO.displayName=QD;var[sO,cO]=rO(QD),[lO,uO]=rO(QD,{collapsible:!1}),dO=y.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[s,c]=jh({prop:n,defaultProp:r??``,onChange:i,caller:QD});return(0,K.jsx)(sO,{scope:e.__scopeAccordion,value:y.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:y.useCallback(()=>a&&c(``),[a,c]),children:(0,K.jsx)(lO,{scope:e.__scopeAccordion,collapsible:a,children:(0,K.jsx)(hO,{...o,ref:t})})})}),fO=y.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=jh({prop:n,defaultProp:r??[],onChange:i,caller:QD}),c=y.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=y.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,K.jsx)(sO,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,K.jsx)(lO,{scope:e.__scopeAccordion,collapsible:!0,children:(0,K.jsx)(hO,{...a,ref:t})})})}),[pO,mO]=rO(QD),hO=y.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=Sh(y.useRef(null),t),c=tO(n),l=ZD(i)===`ltr`,u=yh(e.onKeyDown,e=>{if(!$D.includes(e.key))return;let t=e.target,n=c().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,u=()=>{o=r+1,o>s&&(o=0)},d=()=>{o=r-1,o<0&&(o=s)};switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(l?u():d());break;case`ArrowDown`:a===`vertical`&&u();break;case`ArrowLeft`:a===`horizontal`&&(l?d():u());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,K.jsx)(pO,{scope:n,disabled:r,direction:i,orientation:a,children:(0,K.jsx)(eO.Slot,{scope:n,children:(0,K.jsx)(Bh.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:u})})})}),gO=`AccordionItem`,[_O,vO]=rO(gO),yO=y.forwardRef((e,t)=>{let{__scopeAccordion:n,value:r,...i}=e,a=mO(gO,n),o=cO(gO,n),s=aO(n),c=kh(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,K.jsx)(_O,{scope:n,open:l,disabled:u,triggerId:c,children:(0,K.jsx)(qD,{"data-orientation":a.orientation,"data-state":EO(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})});yO.displayName=gO;var bO=`AccordionHeader`,xO=y.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=mO(QD,n),a=vO(bO,n);return(0,K.jsx)(Bh.h3,{"data-orientation":i.orientation,"data-state":EO(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})});xO.displayName=bO;var SO=`AccordionTrigger`,CO=y.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=mO(QD,n),a=vO(SO,n),o=uO(SO,n),s=aO(n);return(0,K.jsx)(eO.ItemSlot,{scope:n,children:(0,K.jsx)(JD,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})});CO.displayName=SO;var wO=`AccordionContent`,TO=y.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=mO(QD,n),a=vO(wO,n),o=aO(n);return(0,K.jsx)(YD,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})});TO.displayName=wO;function EO(e){return e?`open`:`closed`}var DO=oO,OO=yO,kO=xO,AO=CO,jO=TO;function MO({children:e,className:t,...n}){let r=DO;return(0,K.jsx)(r,{className:t,...n,children:e})}function NO({className:e,children:t,value:n}){let r=OO;return(0,K.jsx)(r,{value:n,className:e,children:t})}function PO({className:e,children:t}){let n=kO,r=AO;return(0,K.jsx)(n,{className:`flex`,children:(0,K.jsxs)(r,{className:Y(`flex flex-1 items-center gap-2 py-3 text-sm font-medium text-[var(--tkc-ink-quiet)] transition-all duration-200 hover:bg-[var(--tkc-panel-muted)] hover:text-[var(--tkc-ink)] [&[data-state=open]>svg]:rotate-90 [&[data-state=open]]:text-[var(--tkc-cinnabar)]`,e),children:[(0,K.jsx)(jp,{className:`h-4 w-4 shrink-0 text-[var(--tkc-ink-quiet)] transition-transform duration-300 ease-in-out`}),t]})})}function FO({className:e,children:t}){let n=jO;return(0,K.jsx)(n,{className:`overflow-hidden text-sm data-[state=open]:animate-[fadeIn_200ms_ease-out] data-[state=closed]:animate-[fadeIn_200ms_ease-out_reverse]`,children:(0,K.jsx)(`div`,{className:Y(`border-t border-[color:var(--tkc-rule-m)] pb-4 pt-3`,e),children:t})})}function IO(e){return e?new Date(e).toLocaleString():`Unavailable`}function LO(e){return!e||!Number.isFinite(e)?`Unavailable`:new Date(e).toLocaleString()}function RO(e){return e===`success`?`border-success/20 bg-success/10 text-success`:e===`warning`?`border-warning/20 bg-warning/10 text-warning`:e===`error`?`border-error/20 bg-error/10 text-error`:`border-border text-foreground-muted`}function zO(e){return e===`approved`||e===`ready`||e===`passing`||e===`published`||e===`merged`?`border-success/20 bg-success/10 text-success`:e===`pending`||e===`in-review`?`border-warning/20 bg-warning/10 text-warning`:e===`changes-requested`||e===`blocked`||e===`failing`||e===`failed`?`border-error/20 bg-error/10 text-error`:`border-border text-foreground-muted`}function BO(e){return e===`azure-repos`?`Azure Repos`:`GitHub`}function VO(e){return e?[...e.terminal.commands].sort((e,t)=>t.startedAt-e.startedAt)[0]??null:null}function HO(e){return[...e].sort((e,t)=>{let n=e=>e===`running`||e===`pending`||e===`waiting`?0:e===`failed`?1:e===`completed`?2:3,r=n(e.status)-n(t.status);return r===0?e.runId.localeCompare(t.runId):r})}function UO(e){return e===`active`||e===`running`||e===`ready`||e===`completed`?`success`:e===`starting`||e===`pending`||e===`queued`?`warning`:e===`inactive`||e===`failed`||e===`error`||e===`blocked`?`error`:`neutral`}function WO(e){let t=e.workspace.notes?.value??``,n=e.workspace.notes?.updatedAt??null,[r,i]=(0,y.useState)(t),a=(0,y.useMemo)(()=>VO(e.runtime),[e.runtime]),o=e.reviewArtifact?.linkedPullRequest,s=e.reviewArtifact?.integration,c=e.runtime?.preview.primaryUrl??e.runtime?.devServer.primaryUrl??null,l=e.workspace.git.root?.split(`/`).filter(Boolean).at(-1)??`Unavailable`,u=!e.workspace.git.root||!e.workspace.git.branch,d=e.workspace.git.uncommittedCount,f=e.workspace.links?.editorHref??null,p=e.workspace.sessions.items.find(t=>t.sessionId===e.sessionId)??(e.sessionId==null?e.workspace.sessions.items[0]??null:null),m=(0,y.useMemo)(()=>HO(e.workspace.runs.items??[]).slice(0,3),[e.workspace.runs.items]),h=m[0]??null,g=e.workspace.git.ahead==null||e.workspace.git.behind==null?`No upstream tracking`:`${e.workspace.git.ahead} ahead / ${e.workspace.git.behind} behind`,[_,v]=(0,y.useState)(s?.provider??o?.provider??`github`),[b,x]=(0,y.useState)(o?.branchName??e.workspace.git.branch??e.workspace.name),[S,C]=(0,y.useState)(o?.baseBranch??e.workspace.git.trackingBranch?.split(`/`).at(-1)??`main`),[w,T]=(0,y.useState)(o?.title??`${e.workspace.name}: ${e.workspace.git.branch??`workspace`} lifecycle`),[E,D]=(0,y.useState)(`kanban-maintainers`),[O,k]=(0,y.useState)(o?.number?String(o.number):``),[A,j]=(0,y.useState)(o?.title??``),M=(0,y.useMemo)(()=>[...e.reviewArtifact?.comments??[]].slice(-2).reverse(),[e.reviewArtifact?.comments]);(0,y.useEffect)(()=>{i(t)},[t,e.workspace.path]),(0,y.useEffect)(()=>{v(s?.provider??o?.provider??`github`),x(o?.branchName??e.workspace.git.branch??e.workspace.name),C(o?.baseBranch??e.workspace.git.trackingBranch?.split(`/`).at(-1)??`main`),T(o?.title??`${e.workspace.name}: ${e.workspace.git.branch??`workspace`} lifecycle`),k(o?.number?String(o.number):``),j(o?.title??``)},[s?.provider,o?.baseBranch,o?.branchName,o?.number,o?.provider,o?.title,e.workspace.git.branch,e.workspace.git.trackingBranch,e.workspace.name]);let N=t=>`${t}:${e.workspace.path}`,P=e.pendingAction!=null||e.reviewPending;return(0,K.jsxs)(`aside`,{className:`rounded-[28px] border border-border bg-card p-4 shadow-lg`,"aria-label":`Workspace details for ${e.workspace.name}`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.22em] text-primary/80`,children:`Operational cockpit`}),(0,K.jsx)(`h2`,{className:`mt-2 text-lg font-semibold tracking-tight`,children:`Details sidebar`})]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-[11px] text-foreground-muted`,children:e.workspace.status})]}),(0,K.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,K.jsx)(GO,{title:`Workspace status`,icon:Np,children:(0,K.jsxs)(`div`,{className:`space-y-3`,"data-testid":`workspace-status-panel`,children:[p?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80 px-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,RO(UO(e.sessionStatus??p.status))),children:e.sessionStatus??p.status}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-foreground-muted`,children:p.agent})]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm font-semibold text-foreground`,children:p.title??p.sessionId}),(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-foreground-muted`,children:[`Session `,p.sessionId]}),(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:(0,K.jsx)(Q,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,K.jsx)(Z,{href:`/sessions/${p.sessionId}`,children:`Open session`})})})]}):(0,K.jsx)(qO,{tone:`neutral`,title:`No active session selected`,body:`Select a workspace session to keep runtime and process status aligned with the conversation surface.`}),e.runtime?(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,K.jsx)(KO,{label:`Runtime updated`,value:LO(e.runtime.updatedAt)}),(0,K.jsx)(KO,{label:`Terminal`,value:`${e.runtime.terminal.status} · ${e.runtime.terminal.commands.length} command${e.runtime.terminal.commands.length===1?``:`s`}`}),(0,K.jsx)(KO,{label:`Dev server`,value:e.runtime.devServer.status}),(0,K.jsx)(KO,{label:`Preview`,value:c?`Available`:`Unavailable`})]}):(0,K.jsx)(qO,{tone:`error`,title:`Runtime disconnected`,body:`Runtime, terminal, and dev-server status are unavailable until a workspace session starts publishing again.`}),h?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80 px-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-foreground-muted`,children:`Recent runs`}),(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,zO(h.status)),children:h.status})]}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-2`,children:m.map(t=>(0,K.jsx)(Z,{href:`/runs/${encodeURIComponent(t.runId)}`,"data-testid":`workspace-status-run-${t.runId}`,className:`rounded-xl border border-border bg-background/70 px-3 py-2 transition-colors hover:border-primary/30`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-xs text-primary`,children:t.runId}),(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-[11px]`,zO(t.status)),children:t.status})]})},`${e.workspace.path}:${t.runId}`))})]}):(0,K.jsx)(qO,{tone:`neutral`,title:`No workspace runs yet`,body:`Run and process status will appear here once this workspace session starts publishing executions.`})]})}),(0,K.jsx)(GO,{title:`Git summary`,icon:Qp,children:u?(0,K.jsx)(qO,{tone:`error`,title:`Repository metadata unavailable`,body:`The workspace path exists, but git root or branch metadata could not be resolved.`}):(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[(0,K.jsx)(KO,{label:`Repository`,value:l,mono:!1}),(0,K.jsx)(KO,{label:`Branch`,value:e.workspace.git.branch??`Unavailable`,mono:!0}),(0,K.jsx)(KO,{label:`Tracking`,value:e.workspace.git.trackingBranch??`Unavailable`,mono:!0}),(0,K.jsx)(KO,{label:`Sync`,value:g}),(0,K.jsx)(KO,{label:`Uncommitted`,value:d==null?`Unavailable`:d===0?`0 changes`:`${d} change${d===1?``:`s`}`})]})}),(0,K.jsx)(GO,{title:`Terminal`,icon:Vm,children:e.runtime?a?(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-[11px] uppercase`,RO(a.status===`completed`?`success`:a.status===`failed`?`error`:`warning`)),children:a.status}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] text-foreground-muted`,children:a.source}),a.toolName?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] text-foreground-muted`,children:a.toolName}):null]}),(0,K.jsx)(`pre`,{className:`overflow-x-auto rounded-2xl border border-border bg-slate-950 px-3 py-2 text-xs text-slate-100`,children:a.command}),(0,K.jsxs)(`p`,{className:`text-xs text-foreground-muted`,children:[`Captured `,LO(a.startedAt),a.exitCode==null?``:` · exit ${a.exitCode}`]}),a.logs.length>0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-border bg-background/80 px-3 py-2 text-xs text-foreground-muted`,children:a.logs.slice(-2).map((e,t)=>(0,K.jsxs)(`p`,{className:`break-words`,children:[(0,K.jsx)(`span`,{className:`font-mono`,children:e.stream}),`: `,e.text]},`${e.timestamp}:${t}`))}):(0,K.jsx)(qO,{tone:`neutral`,title:`No command output yet`,body:`The runtime captured the command but has not attached log lines.`})]}):(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsx)(qO,{tone:`neutral`,title:`No terminal activity yet`,body:`Use the shell affordance below while the runtime waits for its first captured command.`}),(0,K.jsx)(`pre`,{className:`overflow-x-auto rounded-2xl border border-border bg-background/80 px-3 py-2 text-xs text-foreground-muted`,children:`cd ${e.workspace.path}\ngit status --short`})]}):(0,K.jsx)(qO,{tone:`error`,title:`Runtime disconnected`,body:`No active agent-mux runtime is publishing shell state for this workspace.`})}),(0,K.jsx)(GO,{title:`Notes`,icon:Jp,children:(0,K.jsxs)(`div`,{className:`space-y-3`,children:[t.trim().length===0?(0,K.jsx)(qO,{tone:`neutral`,title:`No workspace notes yet`,body:`Capture operator context, next steps, or handoff details for this worktree.`}):(0,K.jsxs)(`p`,{className:`text-xs text-foreground-muted`,children:[`Last updated `,IO(n)]}),(0,K.jsx)(`textarea`,{value:r,onChange:e=>i(e.target.value),className:`min-h-28 w-full rounded-2xl border border-border bg-background/80 px-3 py-2 text-sm outline-none transition focus:border-primary/50`,placeholder:`Add workspace notes, follow-up context, or handoff details.`,"aria-label":`Notes for ${e.workspace.name}`}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(Q,{type:`button`,size:`sm`,variant:`outline`,disabled:e.notesSaving,onClick:()=>e.onSaveNote(e.workspace,r),children:[e.notesSaving?(0,K.jsx)(dm,{className:`mr-2 h-4 w-4 animate-spin`}):null,`Save note`]}),(0,K.jsx)(Q,{type:`button`,size:`sm`,variant:`ghost`,disabled:e.notesSaving||r.length===0,onClick:()=>e.onSaveNote(e.workspace,``),children:`Clear`})]})]})}),(0,K.jsx)(GO,{title:`PR lifecycle`,icon:pm,children:(0,K.jsxs)(`div`,{className:`space-y-3`,children:[o?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80 px-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-foreground-muted`,children:[BO(o.provider),` PR `,o.number?`#${o.number}`:``]}),(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,zO(o.status)),children:o.status}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-foreground-muted`,children:o.linkState===`partially-linked`?`partially linked`:o.linkState})]}),(0,K.jsx)(`h4`,{className:`mt-2 text-sm font-semibold`,children:o.title}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[o.reviewStatus?(0,K.jsxs)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,zO(o.reviewStatus)),children:[`Review `,o.reviewStatus]}):null,o.mergeStatus?(0,K.jsxs)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,zO(o.mergeStatus)),children:[`Merge `,o.mergeStatus]}):null,o.publishStatus?(0,K.jsxs)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,zO(o.publishStatus)),children:[`Publish `,o.publishStatus]}):null]}),o.ciGates?.length?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:o.ciGates.map(t=>(0,K.jsxs)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,zO(t.status)),children:[t.name,`: `,t.status]},`${e.workspace.path}-${t.id}`))}):null,(0,K.jsx)(`p`,{className:`mt-3 text-xs text-foreground-muted`,children:s?.guidance??o.guidance??`No linked PR guidance available.`}),(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:o.url?(0,K.jsx)(Q,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,K.jsxs)(`a`,{href:o.url,target:`_blank`,rel:`noreferrer`,children:[`Open PR`,(0,K.jsx)(Hp,{className:`ml-2 h-4 w-4`})]})}):null})]}):(0,K.jsx)(qO,{tone:`neutral`,title:`No linked PR yet`,body:`Create a linked PR from this workspace or attach an existing one so review, CI, merge, and publish state stay attached to the worktree.`}),s?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 px-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-foreground-muted`,children:BO(s.provider)}),(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,zO(s.status)),children:s.status.replace(/-/g,` `)})]}),(0,K.jsx)(`p`,{className:`mt-2 text-xs text-foreground-muted`,children:s.guidance}),s.actions.reason?(0,K.jsx)(`div`,{className:`mt-3 rounded-xl border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning`,children:s.actions.reason}):null,s.missingScopes?.length?(0,K.jsxs)(`div`,{className:`mt-2 rounded-xl border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning`,children:[`Missing scopes: `,s.missingScopes.join(`, `)]}):null]}):null,o?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`form`,{className:`grid gap-3`,onSubmit:t=>{t.preventDefault(),e.onCreatePullRequest(e.workspace,{provider:_,title:w,reviewers:E,branchName:b,baseBranch:S})},children:[(0,K.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Provider`,(0,K.jsxs)(`select`,{value:_,onChange:e=>v(e.target.value===`azure-repos`?`azure-repos`:`github`),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`github`,children:`GitHub`}),(0,K.jsx)(`option`,{value:`azure-repos`,children:`Azure Repos`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Branch`,(0,K.jsx)(`input`,{value:b,onChange:e=>x(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Base branch`,(0,K.jsx)(`input`,{value:S,onChange:e=>C(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Reviewers`,(0,K.jsx)(`input`,{value:E,onChange:e=>D(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`PR title`,(0,K.jsx)(`input`,{value:w,onChange:e=>T(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsx)(Q,{type:`submit`,size:`sm`,disabled:P||(s?!s.actions.canCreatePullRequest:!1),children:`Create PR`})]}),(0,K.jsxs)(`form`,{className:`grid gap-3 rounded-2xl border border-border bg-background/70 px-3 py-3`,onSubmit:t=>{t.preventDefault(),e.onLinkPullRequest(e.workspace,{provider:_,number:Number(O),title:A,branchName:b,baseBranch:S})},children:[(0,K.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:`Link existing PR`}),(0,K.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`PR number`,(0,K.jsx)(`input`,{type:`number`,min:1,value:O,onChange:e=>k(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`PR title`,(0,K.jsx)(`input`,{value:A,onChange:e=>j(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]})]}),(0,K.jsx)(Q,{type:`submit`,size:`sm`,variant:`outline`,disabled:P||(s?!s.actions.canManagePullRequest:!1),children:`Link PR`})]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 px-3 py-3`,children:[(0,K.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:`Review feedback`}),M.length>0?(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:M.map(t=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card/80 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-[11px] text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:t.author.name}),(0,K.jsx)(`span`,{children:t.anchor.filePath}),(0,K.jsxs)(`span`,{children:[t.anchor.side,`:`,t.anchor.line]})]}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,children:t.body})]},`${e.workspace.path}-${t.id}`))}):(0,K.jsx)(`p`,{className:`mt-2 text-xs text-foreground-muted`,children:`No review comments have been mapped back to this workspace yet.`})]})]})}),(0,K.jsx)(GO,{title:`Quick actions`,icon:Zm,children:(0,K.jsxs)(`div`,{className:`space-y-3`,children:[e.workspace.rebase?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80 px-3 py-3`,children:[(0,K.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:`Rebase workflow`}),(0,K.jsx)(`h4`,{className:`mt-1 text-sm font-semibold`,children:e.workspace.rebase.status===`rebase-needed`?`Rebase required before this workspace can move forward`:e.workspace.rebase.status===`rebase-conflicts`?`Resolve conflicts before returning to review or merge`:`Ready for ${e.workspace.rebase.readyFor}`}),(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-foreground-muted`,children:[`Attempt `,e.workspace.rebase.attemptCount," · target `",e.workspace.rebase.targetBranch??`main`,"`"]}),e.workspace.rebase.followUpInstructions.length>0?(0,K.jsx)(`div`,{className:`mt-3 grid gap-2 text-xs text-foreground-muted`,children:e.workspace.rebase.followUpInstructions.map(e=>(0,K.jsx)(`div`,{className:`rounded-xl border border-border bg-background/70 px-3 py-2`,children:e},e))}):null]}):null,(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(Q,{type:`button`,size:`sm`,variant:`default`,onClick:()=>e.workspace.actions.canRebaseOpenInEditor?e.onAction(`rebase-open-in-editor`,e.workspace):e.onOpenInEditor(e.workspace,f),disabled:P||!f,children:`Open in editor`}),e.sessionId?(0,K.jsx)(Q,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,K.jsx)(Z,{href:`/sessions/${e.sessionId}`,children:`View session`})}):null,c?(0,K.jsx)(Q,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,K.jsxs)(`a`,{href:c,target:`_blank`,rel:`noreferrer`,children:[`Open preview`,(0,K.jsx)(Hp,{className:`ml-2 h-4 w-4`})]})}):(0,K.jsx)(Q,{type:`button`,size:`sm`,variant:`outline`,disabled:!0,children:`Open preview`})]}),e.workspace.rebase?(0,K.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[e.workspace.actions.canRebaseStart?(0,K.jsx)(JO,{disabled:e.pendingAction===N(`rebase-start`),onClick:()=>e.onAction(`rebase-start`,e.workspace),children:`Retry rebase`}):null,e.workspace.actions.canRebaseAutoResolve?(0,K.jsx)(JO,{disabled:e.pendingAction===N(`rebase-auto-resolve`),onClick:()=>e.onAction(`rebase-auto-resolve`,e.workspace),children:`Auto-resolve`}):null,e.workspace.actions.canRebaseMarkResolved?(0,K.jsx)(JO,{disabled:e.pendingAction===N(`rebase-mark-resolved`),onClick:()=>e.onAction(`rebase-mark-resolved`,e.workspace),children:`Mark resolved`}):null,e.workspace.actions.canRebaseAbort?(0,K.jsx)(JO,{disabled:e.pendingAction===N(`rebase-abort`),onClick:()=>e.onAction(`rebase-abort`,e.workspace),children:`Abort rebase`}):null]}):null,e.feedback?(0,K.jsx)(qO,{tone:e.feedback.tone,title:e.feedback.tone===`error`?`Action failed`:`Action updated`,body:e.feedback.message}):(0,K.jsx)(`p`,{className:`text-xs text-foreground-muted`,children:`Preview, editor, and rebase helpers stay visible together so the workspace card remains the operational handoff surface.`})]})})]})]})}function GO(e){let t=e.icon;return(0,K.jsxs)(`section`,{className:`rounded-2xl border border-border bg-background/60 p-3`,children:[(0,K.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:[(0,K.jsx)(t,{className:`h-4 w-4`}),(0,K.jsx)(`h3`,{children:e.title})]}),e.children]})}function KO(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80 px-3 py-2`,children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`p`,{className:Y(`mt-1 text-sm font-medium`,e.mono?`break-all font-mono text-xs`:``),children:e.value})]})}function qO(e){return(0,K.jsxs)(`div`,{className:Y(`rounded-2xl border px-3 py-2`,RO(e.tone===`success`?`success`:e.tone===`error`?`error`:`neutral`)),children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[e.tone===`error`?(0,K.jsx)(Np,{className:`h-4 w-4`}):e.tone===`success`?(0,K.jsx)(wp,{className:`h-4 w-4`}):null,(0,K.jsx)(`span`,{children:e.title})]}),(0,K.jsx)(`p`,{className:`mt-1 text-xs`,children:e.body})]})}function JO(e){return(0,K.jsx)(Q,{type:`button`,size:`sm`,variant:`ghost`,disabled:e.disabled,onClick:e.onClick,className:`justify-start`,children:e.children})}function YO(e){return(0,K.jsxs)(`section`,{className:e.className,children:[(0,K.jsx)(`h3`,{className:`text-lg font-semibold tracking-tight`,children:e.title}),e.audits.length===0?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border bg-background/60 p-4 text-sm text-foreground-muted`,children:e.emptyText}):(0,K.jsx)(`div`,{className:`mt-3 grid gap-3`,children:e.audits.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-xs uppercase tracking-[0.18em] text-foreground-muted`,children:e.issueKey}),(0,K.jsx)(`div`,{className:`mt-1 text-sm font-semibold text-foreground`,children:e.issueTitle})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[e.executionContext.metadata.labelCount,` label`,e.executionContext.metadata.labelCount===1?``:`s`]})]}),(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:e.executionContext.appliedLabels.map(t=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:t.key},`${e.issueId}-${t.labelId}`))}),(0,K.jsxs)(`div`,{className:`mt-3 grid gap-2 text-xs text-foreground-muted md:grid-cols-3`,children:[(0,K.jsx)(XO,{label:`Source`,value:e.executionContext.source}),(0,K.jsx)(XO,{label:`Label ids`,value:e.executionContext.metadata.labelIds.join(`, `)}),(0,K.jsx)(XO,{label:`Last dispatched`,value:e.lastDispatchedAt?new Date(e.lastDispatchedAt).toLocaleString():`Unavailable`})]}),(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap break-words rounded-2xl bg-slate-950 px-4 py-3 text-xs leading-6 text-slate-100`,children:e.executionContext.renderedBlock})]},`${e.issueId}-${e.lastDispatchedAt??`pending`}`))})]})}function XO(e){return(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card/80 px-3 py-2`,children:[(0,K.jsx)(`div`,{className:`uppercase tracking-[0.18em]`,children:e.label}),(0,K.jsx)(`div`,{className:`mt-1 break-words font-mono text-[11px] text-foreground-secondary`,children:e.value})]})}function ZO(e,[t,n]){return Math.min(n,Math.max(t,e))}function QO(e,t){return y.useReducer((e,n)=>t[e][n]??e,e)}var $O=`ScrollArea`,[ek,tk]=wh($O),[nk,rk]=ek($O),ik=y.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=y.useState(null),[l,u]=y.useState(null),[d,f]=y.useState(null),[p,m]=y.useState(null),[h,g]=y.useState(null),[_,v]=y.useState(0),[b,x]=y.useState(0),[S,C]=y.useState(!1),[w,T]=y.useState(!1),E=Sh(t,e=>c(e)),D=ZD(i);return(0,K.jsx)(nk,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:v,onCornerHeightChange:x,children:(0,K.jsx)(Bh.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})});ik.displayName=$O;var ak=`ScrollAreaViewport`,ok=y.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=rk(ak,n),s=Sh(t,y.useRef(null),o.onViewportChange);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,K.jsx)(Bh.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,K.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});ok.displayName=ak;var sk=`ScrollAreaScrollbar`,ck=y.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=rk(sk,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return y.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,K.jsx)(lk,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,K.jsx)(uk,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,K.jsx)(dk,{...r,ref:t,forceMount:n}):i.type===`always`?(0,K.jsx)(fk,{...r,ref:t}):null});ck.displayName=sk;var lk=y.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=rk(sk,e.__scopeScrollArea),[a,o]=y.useState(!1);return y.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,K.jsx)(Sg,{present:n||a,children:(0,K.jsx)(dk,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),uk=y.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=rk(sk,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=Mk(()=>c(`SCROLL_END`),100),[s,c]=QO(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return y.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),y.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,K.jsx)(Sg,{present:n||s!==`hidden`,children:(0,K.jsx)(fk,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:yh(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:yh(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),dk=y.forwardRef((e,t)=>{let n=rk(sk,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=y.useState(!1),s=e.orientation===`horizontal`,c=Mk(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return Nk(n.viewport,c),Nk(n.content,c),(0,K.jsx)(Sg,{present:r||a,children:(0,K.jsx)(fk,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),fk=y.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=rk(sk,e.__scopeScrollArea),a=y.useRef(null),o=y.useRef(0),[s,c]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Tk(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return Dk(e,o.current,s,t)}return n===`horizontal`?(0,K.jsx)(pk,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Ok(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,K.jsx)(mk,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Ok(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),pk=y.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=rk(sk,e.__scopeScrollArea),[o,s]=y.useState(),c=y.useRef(null),l=Sh(t,c,a.onScrollbarXChange);return y.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,K.jsx)(_k,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":Ek(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),Ak(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:wk(o.paddingLeft),paddingEnd:wk(o.paddingRight)}})}})}),mk=y.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=rk(sk,e.__scopeScrollArea),[o,s]=y.useState(),c=y.useRef(null),l=Sh(t,c,a.onScrollbarYChange);return y.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,K.jsx)(_k,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":Ek(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),Ak(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:wk(o.paddingTop),paddingEnd:wk(o.paddingBottom)}})}})}),[hk,gk]=ek(sk),_k=y.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=rk(sk,n),[m,h]=y.useState(null),g=Sh(t,e=>h(e)),_=y.useRef(null),v=y.useRef(``),b=p.viewport,x=r.content-r.viewport,S=Hh(u),C=Hh(c),w=Mk(d,10);function T(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return y.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&S(e,x)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[b,m,x,S]),y.useEffect(C,[r,C]),Nk(m,w),Nk(p.content,w),(0,K.jsx)(hk,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:Hh(a),onThumbPointerUp:Hh(o),onThumbPositionChange:C,onThumbPointerDown:Hh(s),children:(0,K.jsx)(Bh.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:yh(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:yh(e.onPointerMove,T),onPointerUp:yh(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),vk=`ScrollAreaThumb`,yk=y.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=gk(vk,e.__scopeScrollArea);return(0,K.jsx)(Sg,{present:n||i.hasThumb,children:(0,K.jsx)(bk,{ref:t,...r})})}),bk=y.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=rk(vk,n),o=gk(vk,n),{onThumbPositionChange:s}=o,c=Sh(t,e=>o.onThumbChange(e)),l=y.useRef(void 0),u=Mk(()=>{l.current&&=(l.current(),void 0)},100);return y.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=jk(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,K.jsx)(Bh.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:yh(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:yh(e.onPointerUp,o.onThumbPointerUp)})});yk.displayName=vk;var xk=`ScrollAreaCorner`,Sk=y.forwardRef((e,t)=>{let n=rk(xk,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,K.jsx)(Ck,{...e,ref:t}):null});Sk.displayName=xk;var Ck=y.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=rk(xk,n),[a,o]=y.useState(0),[s,c]=y.useState(0),l=!!(a&&s);return Nk(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),Nk(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,K.jsx)(Bh.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function wk(e){return e?parseInt(e,10):0}function Tk(e,t){let n=e/t;return isNaN(n)?0:n}function Ek(e){let t=Tk(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Dk(e,t,n,r=`ltr`){let i=Ek(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return kk([c,l],d)(e)}function Ok(e,t,n=`ltr`){let r=Ek(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=ZO(e,n===`ltr`?[0,o]:[o*-1,0]);return kk([0,o],[0,s])(c)}function kk(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Ak(e,t){return e>0&&e<t}var jk=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function Mk(e,t){let n=Hh(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Nk(e,t){let n=Hh(t);Eh(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var Pk=ik,Fk=ok,Ik=ck,Lk=yk,Rk=y.forwardRef(function({className:e,children:t,...n},r){let i=Pk,a=Fk,o=Ik,s=Lk;return(0,K.jsxs)(i,{ref:r,className:Y(`relative overflow-hidden`,e),...n,children:[(0,K.jsx)(a,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,K.jsx)(o,{orientation:`vertical`,className:`flex touch-none select-none p-0.5 transition-colors data-[orientation=vertical]:w-2`,children:(0,K.jsx)(s,{className:`relative flex-1 rounded-full bg-[var(--tkc-rule-m)] hover:bg-[var(--tkc-brass-deep)] transition-colors duration-200`})})]})}),zk=`rovingFocusGroup.onEntryFocus`,Bk={bubbles:!1,cancelable:!0},Vk=`RovingFocusGroup`,[Hk,Uk,Wk]=PD(Vk),[Gk,Kk]=wh(Vk,[Wk]),[qk,Jk]=Gk(Vk),Yk=y.forwardRef((e,t)=>(0,K.jsx)(Hk.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,K.jsx)(Hk.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,K.jsx)(Xk,{...e,ref:t})})}));Yk.displayName=Vk;var Xk=y.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=y.useRef(null),p=Sh(t,f),m=ZD(a),[h,g]=jh({prop:o,defaultProp:s??null,onChange:c,caller:Vk}),[_,v]=y.useState(!1),b=Hh(l),x=Uk(n),S=y.useRef(!1),[C,w]=y.useState(0);return y.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(zk,b),()=>e.removeEventListener(zk,b)},[b]),(0,K.jsx)(qk,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:y.useCallback(e=>g(e),[g]),onItemShiftTab:y.useCallback(()=>v(!0),[]),onFocusableItemAdd:y.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:y.useCallback(()=>w(e=>e-1),[]),children:(0,K.jsx)(Bh.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:yh(e.onMouseDown,()=>{S.current=!0}),onFocus:yh(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(zk,Bk);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);nA([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:yh(e.onBlur,()=>v(!1))})})}),Zk=`RovingFocusGroupItem`,Qk=y.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=kh(),l=a||c,u=Jk(Zk,n),d=u.currentTabStopId===l,f=Uk(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return y.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,K.jsx)(Hk.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,K.jsx)(Bh.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:yh(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:yh(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:yh(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=tA(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?rA(n,r+1):n.slice(r+1)}setTimeout(()=>nA(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Qk.displayName=Zk;var $k={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function eA(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function tA(e,t,n){let r=eA(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return $k[r]}function nA(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function rA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var iA=Yk,aA=Qk,oA=`Tabs`,[sA,cA]=wh(oA,[Kk]),lA=Kk(),[uA,dA]=sA(oA),fA=y.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=ZD(s),[d,f]=jh({prop:r,onChange:i,defaultProp:a??``,caller:oA});return(0,K.jsx)(uA,{scope:n,baseId:kh(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,K.jsx)(Bh.div,{dir:u,"data-orientation":o,...l,ref:t})})});fA.displayName=oA;var pA=`TabsList`,mA=y.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=dA(pA,n),o=lA(n);return(0,K.jsx)(iA,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,K.jsx)(Bh.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});mA.displayName=pA;var hA=`TabsTrigger`,gA=y.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=dA(hA,n),s=lA(n),c=yA(o.baseId,r),l=bA(o.baseId,r),u=r===o.value;return(0,K.jsx)(aA,{asChild:!0,...s,focusable:!i,active:u,children:(0,K.jsx)(Bh.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:yh(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:yh(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:yh(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});gA.displayName=hA;var _A=`TabsContent`,vA=y.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=dA(_A,n),c=yA(s.baseId,r),l=bA(s.baseId,r),u=r===s.value,d=y.useRef(u);return y.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,K.jsx)(Sg,{present:i||u,children:({present:n})=>(0,K.jsx)(Bh.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});vA.displayName=_A;function yA(e,t){return`${e}-trigger-${t}`}function bA(e,t){return`${e}-content-${t}`}var xA=fA,SA=mA,CA=gA,wA=vA;function TA({className:e,children:t,"data-testid":n,...r}){let i=xA;return(0,K.jsx)(i,{className:e,"data-testid":n,...r,children:t})}function EA({className:e,children:t}){let n=SA;return(0,K.jsx)(n,{className:Y(`tkc-tabs`,e),children:t})}function DA({className:e,children:t,value:n}){let r=CA;return(0,K.jsx)(r,{value:n,className:Y(`tkc-tab inline-flex items-center justify-center gap-1.5 whitespace-nowrap`,`data-[state=active]:border-b-[var(--tkc-cinnabar)] data-[state=active]:text-[var(--tkc-cinnabar)]`,e),children:t})}function OA({className:e,children:t,value:n}){let r=wA;return(0,K.jsx)(r,{value:n,className:Y(`mt-2 focus-visible:outline-none`,e),children:t})}function kA(e){return e.contexts.length===0?null:(0,K.jsxs)(`section`,{className:Y(`rounded-3xl border border-border bg-card p-5 shadow-lg`,e.className),children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Execution context`}),(0,K.jsx)(`h3`,{className:`mt-2 text-xl font-semibold tracking-tight`,children:e.title??`Attached dispatch context`}),e.description?(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm text-foreground-muted`,children:e.description}):null]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-xs text-foreground-muted`,children:[e.contexts.length,` linked issue`,e.contexts.length===1?``:`s`]})]}),(0,K.jsx)(`div`,{className:Y(`mt-4 grid gap-4`,e.compact?``:`xl:grid-cols-2`),children:e.contexts.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e.project.key?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:e.project.key}):null,(0,K.jsx)(`span`,{className:`rounded-full border border-info/20 bg-info/10 px-2 py-0.5 text-xs text-info`,children:e.issue.key}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:e.issue.id})]}),(0,K.jsx)(`h4`,{className:`mt-3 text-sm font-semibold text-foreground`,children:e.issue.title}),(0,K.jsxs)(`div`,{className:`mt-4`,children:[(0,K.jsxs)(`div`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:[`Applied labels (`,e.dispatch.labelIds.length,`)`]}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[e.dispatch.labels.map(e=>(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-card px-2.5 py-1 text-xs text-foreground-secondary`,children:[e.label,` · `,e.key]},e.labelId)),e.dispatch.labels.length===0&&e.dispatch.labelIds.length>0?e.dispatch.labelIds.map(e=>(0,K.jsx)(`span`,{className:`rounded-full border border-border bg-card px-2.5 py-1 text-xs text-foreground-secondary`,children:e},e)):null]})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{children:[`Run IDs: `,e.dispatch.runIds.length>0?e.dispatch.runIds.join(`, `):`none`]}),(0,K.jsxs)(`span`,{children:[`Session IDs: `,e.dispatch.sessionIds.length>0?e.dispatch.sessionIds.join(`, `):`none`]}),(0,K.jsxs)(`span`,{children:[`Last dispatched: `,e.dispatch.lastDispatchedAt??`none`]})]}),(0,K.jsxs)(`div`,{className:`mt-4`,children:[(0,K.jsx)(`div`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:`Rendered block`}),(0,K.jsx)(`pre`,{className:`mt-2 whitespace-pre-wrap break-words rounded-2xl bg-slate-950 px-4 py-3 text-xs leading-6 text-slate-100`,children:e.block})]})]},e.issue.id))})]})}function AA(e){return!e||!Number.isFinite(e)?`unavailable`:new Date(e).toLocaleString()}function jA(e){return e===`running`||e===`ready`||e===`active`?`border-success/20 bg-success/10 text-success`:e===`starting`?`border-info/20 bg-info/10 text-info`:e===`error`||e===`failed`?`border-error/20 bg-error/10 text-error`:`border-border text-foreground-muted`}function MA(e){switch(e){case`mobile`:return Im;case`tablet`:return zm;default:return am}}function NA(e){return e.id===`mobile`?720:e.id===`tablet`?680:640}function PA(e){let t=e.width/e.height;return Math.min(e.width,960,Math.round(NA(e)*t))}function FA(e,t){let n=e.command.trim();return n.length>0?n:`Process ${t+1}`}function IA(e){let t=e.terminal.commands.map((e,t)=>({id:e.id,label:FA(e,t),sourceLabel:e.source,status:e.status,command:e.command,toolName:e.toolName,startedAt:e.startedAt,endedAt:e.endedAt,exitCode:e.exitCode,logs:e.logs}));return e.devServer.status===`idle`&&!e.devServer.command&&e.devServer.logs.length===0&&e.devServer.urls.length===0?t:[...t,{id:`dev-server`,label:e.devServer.command?.trim()||`Dev server`,sourceLabel:`dev server`,status:e.devServer.status,command:e.devServer.command,logs:e.devServer.logs}]}function LA(e){return e.exitCode==null?`Process failed before emitting logs.`:`Process exited with code ${e.exitCode} before emitting logs.`}function RA(e){return(0,K.jsx)(`div`,{className:Y(`rounded-2xl border px-4 py-5 text-sm`,e.tone===`error`?`border-error/20 bg-error/5 text-error`:`border-dashed border-border bg-background/60 text-foreground-muted`),children:e.text})}function zA(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>e.text.toLowerCase().includes(n)):[...e]}function BA(e){let t=e.rebase&&e.rebase.status===`rebase-conflicts`?`rebase`:e.runtime.preview.primaryUrl?`preview`:e.runtime.terminal.commands.length>0?`logs`:`dev-server`,n=e.runtime.preview.deviceProfiles,[r,i]=(0,y.useState)(t),[a,o]=(0,y.useState)(n[0]?.id??`desktop`),[s,c]=(0,y.useState)(``),l=(0,y.useDeferredValue)(s),[u,d]=(0,y.useState)(null),f=(0,y.useMemo)(()=>n.find(e=>e.id===a)??n[0]??{id:`desktop`,label:`Desktop 1440`,width:1440,height:960},[a,n]),p=(0,y.useMemo)(()=>IA(e.runtime),[e.runtime]),m=(0,y.useMemo)(()=>p.find(e=>e.id===u)??p[0]??null,[p,u]),h=(0,y.useMemo)(()=>zA(m?.logs??[],l),[m?.logs,l]),g=e.sessionStatus!=null&&e.sessionStatus!==`active`;return(0,y.useEffect)(()=>{m&&m.id!==u&&d(m.id)},[m,u]),(0,K.jsxs)(`section`,{className:Y(`rounded-3xl border border-border bg-card p-5 shadow-lg`,e.className),children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Runtime surfaces`}),(0,K.jsx)(`h3`,{className:`mt-2 text-xl font-semibold tracking-tight`,children:`Preview, logs, inspect, and dev server`}),(0,K.jsxs)(`p`,{className:`mt-2 text-sm text-foreground-muted`,children:[`Derived from agent-mux session state and recent run events.`,e.sessionId?` Session ${e.sessionId}.`:``]})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-xs text-foreground-muted`,children:[`Updated `,AA(e.runtime.updatedAt)]})]}),(0,K.jsxs)(TA,{className:`mt-5`,value:r,onValueChange:i,children:[(0,K.jsxs)(EA,{className:`flex h-auto w-full flex-wrap gap-2 bg-transparent p-0`,children:[(0,K.jsx)(DA,{value:`preview`,children:`Preview`}),(0,K.jsx)(DA,{value:`logs`,children:`Logs`}),(0,K.jsx)(DA,{value:`terminal`,children:`Terminal`}),(0,K.jsx)(DA,{value:`dev-server`,children:`Dev server`}),(0,K.jsx)(DA,{value:`rebase`,children:`Rebase`}),(0,K.jsx)(DA,{value:`execution-context`,children:`Execution context`}),(0,K.jsx)(DA,{value:`inspect`,children:`Inspect`})]}),(0,K.jsxs)(OA,{value:`preview`,className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>{let t=MA(e.id);return(0,K.jsxs)(Q,{type:`button`,variant:e.id===f.id?`default`:`outline`,size:`sm`,onClick:()=>o(e.id),children:[(0,K.jsx)(t,{className:`h-4 w-4`}),e.label]},e.id)})}),e.runtime.preview.primaryUrl?(0,K.jsx)(Q,{asChild:!0,variant:`ghost`,size:`sm`,children:(0,K.jsxs)(`a`,{href:e.runtime.preview.primaryUrl,target:`_blank`,rel:`noreferrer`,children:[`Open preview`,(0,K.jsx)(Hp,{className:`h-4 w-4`})]})}):null]}),e.runtime.preview.primaryUrl?(0,K.jsx)(`div`,{className:`rounded-[28px] border border-border bg-background/70 p-3 sm:p-4`,children:(0,K.jsxs)(`div`,{className:`mx-auto w-full rounded-[24px] border border-border bg-card p-2 shadow-sm sm:p-3`,style:{maxWidth:`${PA(f)}px`},children:[(0,K.jsxs)(`div`,{className:`mb-3 flex items-center justify-between rounded-2xl border border-border bg-background/75 px-4 py-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:f.label}),(0,K.jsxs)(`span`,{children:[f.width,` x `,f.height]})]}),(0,K.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border bg-white`,style:{aspectRatio:`${f.width} / ${f.height}`},children:(0,K.jsx)(`iframe`,{title:`Preview for ${e.runtime.workspacePath??`workspace`}`,src:e.runtime.preview.primaryUrl,className:`h-full w-full bg-white`})})]})}):(0,K.jsx)(HA,{text:`No preview URL has been detected from the workspace runtime yet.`})]}),(0,K.jsxs)(OA,{value:`logs`,className:`space-y-4`,children:[!m&&g?(0,K.jsx)(HA,{icon:Ym,text:`Logs disconnected. The selected session is not publishing runtime output right now.`}):null,!m&&!g?(0,K.jsx)(HA,{text:`No active processes are publishing logs yet.`}):null,m?(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[minmax(0,260px)_minmax(0,1fr)]`,children:[(0,K.jsx)(TA,{orientation:`vertical`,value:m.id,onValueChange:d,className:`space-y-3`,children:(0,K.jsx)(EA,{className:`flex h-auto flex-col items-stretch gap-2 bg-transparent p-0`,children:p.map(e=>(0,K.jsx)(DA,{value:e.id,"aria-label":e.label,className:`h-auto w-full justify-start rounded-2xl border border-border bg-background/70 px-3 py-3 text-left data-[state=active]:border-primary/30 data-[state=active]:bg-primary/8`,children:(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.label}),(0,K.jsxs)(`div`,{"aria-hidden":`true`,className:`mt-1 flex flex-wrap items-center gap-2 text-[11px] uppercase tracking-[0.16em] text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:e.sourceLabel}),(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5`,jA(e.status)),children:e.status})]})]})},e.id))})}),(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`h4`,{className:`text-sm font-semibold text-foreground`,children:m.label}),(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-xs uppercase`,jA(m.status)),children:m.status}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:m.sourceLabel}),m.toolName?(0,K.jsx)(`span`,{className:`rounded-full border border-info/20 bg-info/10 px-2 py-0.5 text-xs text-info`,children:m.toolName}):null]}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-4 text-xs text-foreground-muted`,children:[m.startedAt?(0,K.jsxs)(`span`,{children:[`Started `,AA(m.startedAt)]}):null,m.endedAt?(0,K.jsxs)(`span`,{children:[`Ended `,AA(m.endedAt)]}):null,m.exitCode==null?null:(0,K.jsxs)(`span`,{children:[`Exit code `,m.exitCode]})]})]}),(0,K.jsxs)(`label`,{className:`flex min-w-[220px] flex-1 items-center gap-2 rounded-2xl border border-border bg-card px-3 py-2 text-sm text-foreground-muted sm:max-w-sm`,children:[(0,K.jsx)(Am,{className:`h-4 w-4`}),(0,K.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),placeholder:`Search logs`,className:`w-full bg-transparent text-sm text-foreground outline-none placeholder:text-foreground-muted`})]})]}),m.command?(0,K.jsx)(`pre`,{className:`mt-4 whitespace-pre-wrap break-words rounded-2xl bg-slate-950 px-4 py-3 text-xs leading-6 text-slate-100`,children:m.command}):null]}),(0,K.jsx)(Rk,{className:`max-h-[460px] rounded-2xl border border-border bg-slate-950`,children:(0,K.jsxs)(`div`,{className:`space-y-2 p-4 font-mono text-xs leading-6 text-slate-100`,children:[m.logs.length===0?m.status===`failed`||m.status===`error`?(0,K.jsx)(RA,{text:LA(m),tone:`error`}):(0,K.jsx)(RA,{text:`Waiting for runtime output from this process.`}):null,m.logs.length>0&&h.length===0?(0,K.jsx)(RA,{text:`No log lines match "${l}" for this process.`}):null,h.map((e,t)=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-slate-800 bg-slate-900/80 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`mb-1 text-[10px] uppercase tracking-[0.18em] text-slate-400`,children:[e.stream,` · `,AA(e.timestamp)]}),(0,K.jsx)(`div`,{className:`whitespace-pre-wrap break-words`,children:e.text})]},`${m.id}:${e.timestamp}:${t}`))]})})]})]}):null]}),(0,K.jsx)(OA,{value:`terminal`,className:`space-y-4`,children:(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[minmax(0,1fr)_360px]`,children:[(0,K.jsx)(Rk,{className:`max-h-[420px] rounded-2xl border border-border bg-background/80`,children:(0,K.jsxs)(`div`,{className:`grid gap-3 p-4`,children:[e.runtime.terminal.commands.map((e,t)=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-card/90 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-xs uppercase`,jA(e.status)),children:e.status}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:e.source}),e.toolName?(0,K.jsx)(`span`,{className:`rounded-full border border-info/20 bg-info/10 px-2 py-0.5 text-xs text-info`,children:e.toolName}):null]}),(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap break-words rounded-2xl bg-slate-950 px-4 py-3 text-xs leading-6 text-slate-100`,children:FA(e,t)}),(0,K.jsxs)(`div`,{className:`mt-3 grid gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{children:[`Started `,AA(e.startedAt)]}),e.endedAt?(0,K.jsxs)(`span`,{children:[`Ended `,AA(e.endedAt)]}):null,e.exitCode==null?null:(0,K.jsxs)(`span`,{children:[`Exit code `,e.exitCode]})]})]},e.id)),e.runtime.terminal.commands.length===0?(0,K.jsx)(HA,{text:`No shell or terminal commands have been captured for this workspace yet.`}):null]})}),(0,K.jsx)(Rk,{className:`max-h-[420px] rounded-2xl border border-border bg-slate-950`,children:(0,K.jsxs)(`div`,{className:`space-y-2 p-4 font-mono text-xs leading-6 text-slate-100`,children:[e.runtime.terminal.commands.flatMap(e=>e.logs.map((t,n)=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-slate-800 bg-slate-900/80 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`mb-1 text-[10px] uppercase tracking-[0.18em] text-slate-400`,children:[t.stream,` · `,AA(t.timestamp)]}),(0,K.jsx)(`div`,{className:`whitespace-pre-wrap break-words`,children:t.text})]},`${e.id}:${n}`))),e.runtime.terminal.commands.every(e=>e.logs.length===0)?(0,K.jsx)(`div`,{className:`rounded-xl border border-slate-800 bg-slate-900/80 px-3 py-2 text-slate-400`,children:`No terminal output captured yet.`}):null]})})]})}),(0,K.jsx)(OA,{value:`dev-server`,className:`space-y-4`,children:(0,K.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(0,1fr)_360px]`,children:[(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-xs uppercase`,jA(e.runtime.devServer.status)),children:e.runtime.devServer.status}),e.runtime.devServer.port?(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[`Port `,e.runtime.devServer.port]}):null]}),e.runtime.devServer.command?(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap break-words rounded-2xl bg-slate-950 px-4 py-3 text-xs leading-6 text-slate-100`,children:e.runtime.devServer.command}):null,(0,K.jsxs)(`div`,{className:`mt-4 grid gap-2 text-sm text-foreground-muted`,children:[e.runtime.devServer.primaryUrl?(0,K.jsxs)(`a`,{href:e.runtime.devServer.primaryUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-2 text-primary`,children:[e.runtime.devServer.primaryUrl,(0,K.jsx)(Hp,{className:`h-4 w-4`})]}):(0,K.jsx)(`span`,{children:`No previewable dev-server endpoint has been detected yet.`}),(0,K.jsxs)(`span`,{children:[`Last signal `,AA(e.runtime.devServer.detectedAt)]})]})]}),(0,K.jsx)(Rk,{className:`max-h-[420px] rounded-2xl border border-border bg-slate-950`,children:(0,K.jsxs)(`div`,{className:`space-y-2 p-4 font-mono text-xs leading-6 text-slate-100`,children:[e.runtime.devServer.logs.map((e,t)=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-slate-800 bg-slate-900/80 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`mb-1 text-[10px] uppercase tracking-[0.18em] text-slate-400`,children:[e.stream,` · `,AA(e.timestamp)]}),(0,K.jsx)(`div`,{className:`whitespace-pre-wrap break-words`,children:e.text})]},`${e.timestamp}:${t}`)),e.runtime.devServer.logs.length===0?(0,K.jsx)(`div`,{className:`rounded-xl border border-slate-800 bg-slate-900/80 px-3 py-2 text-slate-400`,children:`No dev-server logs captured yet.`}):null]})})]})}),(0,K.jsx)(OA,{value:`rebase`,className:`space-y-4`,children:e.rebase?(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-xs uppercase`,jA(e.rebase.status===`rebase-conflicts`?`failed`:e.rebase.status===`rebase-needed`?`starting`:`ready`)),children:e.rebase.status.replace(/-/g,` `)}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[`Attempt `,e.rebase.attemptCount]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[`Ready for `,e.rebase.readyFor]})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 md:grid-cols-2`,children:[(0,K.jsx)(VA,{icon:Qp,label:`Target branch`,value:e.rebase.targetBranch??`main`}),(0,K.jsx)(VA,{icon:Qp,label:`Unresolved`,value:String(e.rebase.unresolvedFiles.length)})]}),e.rebase.followUpInstructions.length>0?(0,K.jsx)(`div`,{className:`mt-4 grid gap-2 text-sm text-foreground-muted`,children:e.rebase.followUpInstructions.map(e=>(0,K.jsx)(`div`,{className:`rounded-xl border border-border bg-card/70 px-3 py-2`,children:e},e))}):null,e.rebase.unresolvedFiles.length>0?(0,K.jsx)(`pre`,{className:`mt-4 whitespace-pre-wrap break-words rounded-2xl bg-slate-950 px-4 py-3 text-xs leading-6 text-slate-100`,children:e.rebase.unresolvedFiles.join(`
|
|
73
|
+
`)}):null]}):(0,K.jsx)(HA,{text:`No rebase workflow state has been detected for this workspace yet.`})}),(0,K.jsx)(OA,{value:`execution-context`,className:`space-y-4`,children:e.executionContexts&&e.executionContexts.length>0?(0,K.jsx)(kA,{contexts:e.executionContexts,compact:!0,className:`border-border/70 bg-card/70 p-4 shadow-none`,title:`Workspace-linked issue context`,description:`The workspace runtime inherits dispatch context from the linked issue session.`}):(0,K.jsx)(HA,{text:`No linked dispatch-context labels have been associated with this workspace session yet.`})}),(0,K.jsxs)(OA,{value:`inspect`,className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-4`,children:[(0,K.jsx)(VA,{icon:Tm,label:`Workspace`,value:e.runtime.workspacePath??`unavailable`,mono:!0}),(0,K.jsx)(VA,{icon:fm,label:`Commands`,value:String(e.runtime.terminal.commands.length)}),(0,K.jsx)(VA,{icon:Rm,label:`Terminal`,value:e.runtime.terminal.status}),(0,K.jsx)(VA,{icon:Hp,label:`Preview origin`,value:e.runtime.preview.primaryUrl??`unavailable`}),(0,K.jsx)(VA,{icon:Qp,label:`Rebase`,value:e.rebase?.status??`unavailable`})]}),(0,K.jsx)(YO,{title:`Dispatch audit envelope`,audits:e.audits??[],emptyText:`No dispatch-context label projection is linked to this workspace runtime yet.`}),(0,K.jsx)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4 text-sm text-foreground-muted`,children:"The inspect surface keeps the workspace path, preview origin, terminal activity, dev-server status, and process logs visible together so the kanban UI can act as the shell while runtime ownership remains in `agent-mux`."})]})]})]})}function VA(e){let t=e.icon;return(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-xs uppercase tracking-[0.18em] text-foreground-muted`,children:[(0,K.jsx)(t,{className:`h-4 w-4`}),e.label]}),(0,K.jsx)(`div`,{className:Y(`mt-3 text-sm font-medium`,e.mono?`break-all font-mono text-xs`:``),children:e.value})]})}function HA(e){let t=e.icon;return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border bg-background/60 p-4 text-sm text-foreground-muted`,children:[t?(0,K.jsx)(t,{className:`mb-2 h-4 w-4`}):null,e.text]})}function UA(e){return e==null||!Number.isFinite(e)?`unavailable`:new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:e>=1?2:4,maximumFractionDigits:4}).format(e)}function WA(e){return e==null||!Number.isFinite(e)||e<=0?`0`:new Intl.NumberFormat(`en-US`).format(e)}function GA(e){return e==null||!Number.isFinite(e)||e<=0?`timestamp unavailable`:new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function KA(e,t){if(e==null||t==null||!Number.isFinite(e)||!Number.isFinite(t)||t<=e)return null;let n=t-e;return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${Math.round(n/1e3)}s`}function qA(e){return!Number.isFinite(e)||e<=0?`0 B`:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function JA(e){return e.startsWith(`/`)||e.startsWith(`\\\\`)||/^[a-zA-Z]:[\\/]/.test(e)}function YA(e,t){let n=e.includes(`\\`)?`\\`:`/`;return`${e.replace(/[\\/]+$/,``)}${n}${t.replace(/^[./\\\/]+/,``)}`}function XA(e,t){return t.trim()?JA(t)?t:e?YA(e,t):null:null}function ZA(e){return`vscode://file${e}`}function QA(e,t){return t.trim()?e.trim()?`${e.trimEnd()}\n${t}`:t:e}function $A(e,t){if(t===`error`||e===`error`)return`border-error/25 bg-error/8`;switch(e){case`user`:return`border-primary/20 bg-primary/6`;case`assistant`:return`border-success/20 bg-success/6`;case`thinking`:return`border-warning/25 bg-warning/8`;case`tool`:return`border-info/25 bg-info/8`;case`system`:return`border-border bg-background/75`;case`branch`:return`border-primary/20 bg-primary/8`;default:return`border-border bg-background/75`}}function ej(e,t){if(t===`error`||e===`error`)return`border-error/25 bg-error/10 text-error`;switch(e){case`user`:return`border-primary/20 bg-primary/10 text-primary`;case`assistant`:return`border-success/20 bg-success/10 text-success`;case`thinking`:return`border-warning/20 bg-warning/10 text-warning`;case`tool`:return`border-info/20 bg-info/10 text-info`;case`branch`:return`border-primary/20 bg-primary/10 text-primary`;default:return`border-border bg-background text-foreground-muted`}}function tj(e){switch(e){case`yolo`:return`Auto approve`;case`deny`:return`Auto deny`;default:return`Prompt`}}function nj(e){let t=Array.isArray(e?.approvalModes)?e.approvalModes.filter(e=>e===`yolo`||e===`prompt`||e===`deny`):[];return t.length>0?t:[`prompt`]}function rj(e){let t=[...e].reverse().find(e=>e.status===`running`);if(!t)return e.length>0?100:0;let n=t.segments.length;if(n===0)return 0;let r=t.segments.filter(e=>e.status!==`running`).length;return Math.round(r/n*100)}function ij(e){return e.reduce((e,t)=>(t.kind===`tool`?e.toolOutputs+=1:t.kind===`system`||t.kind===`lifecycle`?e.systemEvents+=1:t.kind===`error`&&(e.errors+=1),e),{toolOutputs:0,systemEvents:0,errors:0})}async function aj(e){return await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{if(typeof r.result==`string`){t(r.result);return}n(Error(`Failed to read ${e.name}`))},r.onerror=()=>n(r.error??Error(`Failed to read ${e.name}`)),r.readAsDataURL(e)})}async function oj(e){return!e||e.length===0?[]:await Promise.all(Array.from(e).map(async(e,t)=>{let n=await aj(e),[,r=``]=n.split(`,`,2),i=e.type||`application/octet-stream`,a=i.startsWith(`image/`);return{id:typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`${Date.now()}-${t}-${e.name}`,name:e.name,mimeType:i,base64:r,size:e.size,isImage:a,previewUrl:a?n:void 0}}))}function sj(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border px-4 py-6 text-sm`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.title}),(0,K.jsx)(`p`,{className:`mt-2 leading-6 text-foreground-muted`,children:e.body})]})}function cj(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 p-3`,children:[(0,K.jsx)(`div`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`div`,{className:`mt-2 text-sm font-semibold text-foreground`,children:e.value}),e.detail?(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:e.detail}):null]})}function lj(e){return(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-[11px] uppercase tracking-[0.16em]`,e.segment.status===`error`?`border-error/25 bg-error/10 text-error`:e.segment.status===`running`?`border-warning/20 bg-warning/10 text-warning`:`border-border bg-background text-foreground-muted`),children:e.segment.kind})}function uj(e){let t=e.node.filePaths.slice(0,6);return(0,K.jsxs)(`article`,{className:Y(`rounded-2xl border p-4`,$A(e.node.kind,e.node.status)),children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-[11px] uppercase tracking-[0.18em]`,ej(e.node.kind,e.node.status)),children:e.node.kind}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:e.node.label}),(0,K.jsx)(Z,{href:`/runs/${e.node.runId}`,className:`text-xs text-primary`,children:e.node.runId}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:GA(e.node.timestamp)})]}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,K.jsx)(Q,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>e.onReuseText(e.node.text),children:e.node.kind===`user`?`Edit`:`Retry`})})]}),(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap break-words text-sm leading-6 text-foreground-secondary`,children:e.node.text}),t.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:t.map(t=>{let n=XA(e.workspacePath,t);return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-full border border-border bg-background px-3 py-1.5 text-xs`,children:[n?(0,K.jsx)(`a`,{href:ZA(n),target:`_blank`,rel:`noreferrer`,className:`text-primary`,children:t}):(0,K.jsx)(`span`,{className:`text-foreground-secondary`,children:t}),(0,K.jsx)(`button`,{type:`button`,className:`text-foreground-muted hover:text-foreground`,onClick:()=>e.onMentionFile(t),children:`mention`})]},`${e.node.id}-${t}`)})}):null]})}function dj(e){let t=KA(e.item.timestamp,e.item.timestamp);return(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-[11px] uppercase tracking-[0.18em]`,ej(e.item.kind===`lifecycle`?`system`:e.item.kind,e.item.status)),children:e.item.kind}),(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.item.title})]}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[GA(e.item.timestamp),t?` · ${t}`:``]})]}),(0,K.jsx)(Q,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>e.onReuseText(e.item.detail),children:`Use output`})]}),(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap break-words text-sm leading-6 text-foreground-secondary`,children:e.item.detail}),e.item.filePaths.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.item.filePaths.slice(0,6).map(t=>{let n=XA(e.workspacePath,t);return n?(0,K.jsx)(`a`,{href:ZA(n),target:`_blank`,rel:`noreferrer`,className:`rounded-full border border-border px-3 py-1.5 text-xs text-primary`,children:t},`${e.item.id}-${t}`):(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-xs text-foreground-secondary`,children:t},`${e.item.id}-${t}`)})}):null]})}function fj(e){let t=XA(e.workspacePath,e.file.path);return(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[t?(0,K.jsx)(`a`,{href:ZA(t),target:`_blank`,rel:`noreferrer`,className:`text-sm font-medium text-primary`,children:e.file.path}):(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.file.path}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[e.file.runIds.length,` runs · `,e.file.tools.length,` tools`]})]}),(0,K.jsx)(Q,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>e.onMentionFile(e.file.path),children:`Mention file`})]}),(0,K.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-4`,children:[(0,K.jsx)(cj,{label:`Touches`,value:WA(e.file.touches)}),(0,K.jsx)(cj,{label:`Reads`,value:WA(e.file.reads)}),(0,K.jsx)(cj,{label:`Writes`,value:WA(e.file.writes)}),(0,K.jsx)(cj,{label:`Last event`,value:GA(e.file.lastEventAt)})]}),e.file.tools.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.file.tools.map(t=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-xs text-foreground-muted`,children:t},`${e.file.path}-${t}`))}):null]})}function pj(e){let{client:t,store:n}=Mn(),{taskTags:r}=dx(),i=(0,y.useRef)(null),[a,o]=(0,y.useState)(`transcript`),[s,c]=(0,y.useState)(``),[l,u]=(0,y.useState)(e.sessionAgent),[d,f]=(0,y.useState)(e.sessionModel??``),[p,m]=(0,y.useState)(`prompt`),[h,g]=(0,y.useState)([]),[_,v]=(0,y.useState)(!1),[b,x]=(0,y.useState)(null),[S,C]=(0,y.useState)(null),w=Pn(n,e=>e.agents.byId),T=Pn(n,e=>e.hooks.byRunId),E=(0,y.useMemo)(()=>e.runs.map(e=>String(e.runId??``)).filter(e=>e.length>0),[e.runs]),D=(0,y.useMemo)(()=>E.flatMap(e=>T[e]??[]).sort((e,t)=>e.deadlineTs-t.deadlineTs),[T,E]),O=(0,y.useMemo)(()=>En(e.runs,e.eventBuffers),[e.eventBuffers,e.runs]),k=(0,y.useMemo)(()=>hn(E,e.eventBuffers),[e.eventBuffers,E]),A=(0,y.useMemo)(()=>ij(O.timeline),[O.timeline]),j=(0,y.useMemo)(()=>rj(O.lanes),[O.lanes]),M=(0,y.useMemo)(()=>Object.values(w).sort((e,t)=>String(e.displayName??e.agent).localeCompare(String(t.displayName??t.agent))),[w]),N=w[l],P=(0,y.useMemo)(()=>nj(N??null),[N]),F=N?.supportsImageInput===!0,I=N?.supportsFileAttachments===!0,L=F||I;(0,y.useEffect)(()=>{c(``),x(null),g([]),u(e.sessionAgent),f(e.sessionModel??``),m(`prompt`)},[e.sessionAgent,e.sessionId,e.sessionModel]),(0,y.useEffect)(()=>{P.includes(p)||m(P[0]??`prompt`)},[P,p]),(0,y.useEffect)(()=>{L||g([])},[L]);function R(e){c(t=>QA(t,e)),x(null)}function z(e){c(t=>QA(t,e)),o(`transcript`)}async function ee(e){try{let t=await oj(e.currentTarget.files);g(e=>[...e,...t]),x(null)}catch(e){x(e instanceof Error?e.message:String(e))}finally{e.currentTarget.value=``}}async function te(t){if(t.preventDefault(),!(e.disabled||_||!s.trim()&&h.length===0)){v(!0),x(null);try{await e.onSubmit({sessionId:e.sessionId,prompt:s,agent:l,model:d.trim()||void 0,attachments:h.map(({id:e,isImage:t,previewUrl:n,size:r,...i})=>i),approvalMode:p}),c(``),g([])}catch(e){x(e instanceof Error?e.message:String(e))}finally{v(!1)}}}async function ne(e,n){C(e);try{await t.request({type:`hook.decision`,hookRequestId:e,decision:n})}catch(e){x(e instanceof Error?e.message:String(e))}finally{C(null)}}let re=[{id:`transcript`,label:`Transcript`,icon:hm},{id:`flow`,label:`Flow`,icon:Lm},{id:`timeline`,label:`Timeline`,icon:em},{id:`files`,label:`Files`,icon:Yp}];return(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-xs uppercase tracking-[0.18em] text-foreground-muted`,children:`Live operator surface`}),(0,K.jsx)(`div`,{className:`mt-2 text-sm font-medium text-foreground`,children:e.sessionLabel}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1`,children:e.sessionStatus}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1`,children:e.sessionAgent}),e.sessionModel?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1`,children:e.sessionModel}):null,e.runtime?.preview?.status===`ready`?(0,K.jsx)(`span`,{className:`rounded-full border border-success/20 bg-success/10 px-2 py-1 text-success`,children:`preview ready`}):null]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.openSessionHref?(0,K.jsx)(Q,{asChild:!0,size:`sm`,variant:`outline`,children:(0,K.jsx)(Z,{href:e.openSessionHref,children:`Open session`})}):null,e.workspacePath?(0,K.jsx)(Q,{asChild:!0,size:`sm`,variant:`outline`,children:(0,K.jsx)(Z,{href:`/workspaces?workspace=${encodeURIComponent(e.workspacePath)}`,children:`Open workspace`})}):null]})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2 xl:grid-cols-5`,children:[(0,K.jsx)(cj,{label:`Token usage`,value:WA((k?.inputTokens??0)+(k?.outputTokens??0)+(k?.thinkingTokens??0)),detail:`${WA(k?.inputTokens)} in · ${WA(k?.outputTokens)} out`}),(0,K.jsx)(cj,{label:`Cost`,value:UA(k?.totalUsd),detail:`${WA(k?.thinkingTokens)} thinking tokens`}),(0,K.jsx)(cj,{label:`Task progress`,value:`${j}%`,detail:`${O.summary.pendingTools} pending tools`}),(0,K.jsx)(cj,{label:`File changes`,value:WA(O.files.filter(e=>e.writes>0).length),detail:`${WA(O.summary.fileCount)} files touched`}),(0,K.jsx)(cj,{label:`Approvals`,value:WA(D.length),detail:`${A.toolOutputs} tool outputs`})]}),(0,K.jsx)(`div`,{className:`mt-4`,children:(0,K.jsx)(kE,{value:j,variant:D.length>0?`warning`:`default`,glow:!0})})]}),(0,K.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:re.map(e=>{let t=e.icon;return(0,K.jsxs)(Q,{type:`button`,size:`sm`,variant:a===e.id?`default`:`outline`,onClick:()=>o(e.id),children:[(0,K.jsx)(t,{className:`h-4 w-4`}),e.label]},e.id)})}),(0,K.jsxs)(`div`,{className:`mt-4 min-h-0 flex-1 overflow-auto`,children:[a===`transcript`?(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[O.transcript.map(t=>(0,K.jsx)(uj,{node:t,workspacePath:e.workspacePath,onReuseText:R,onMentionFile:z},t.id)),O.transcript.length===0?(0,K.jsx)(sj,{title:e.emptyStateTitle,body:e.emptyStateBody}):null]}):null,a===`flow`?(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[O.lanes.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:e.status}),(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.agent}),(0,K.jsx)(Z,{href:`/runs/${e.runId}`,className:`text-xs text-primary`,children:e.runId})]}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[GA(e.startedAt),` · `,e.segmentCount,` segments · `,e.toolCount,` tools`]})]}),(0,K.jsx)(`div`,{className:`rounded-full border border-border px-3 py-1.5 text-xs text-foreground-muted`,children:UA(e.totalUsd)})]}),(0,K.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:e.segments.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(lj,{segment:e}),(0,K.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e.title})]}),(0,K.jsx)(`div`,{className:`mt-1 max-w-[18rem] text-xs text-foreground-muted`,children:e.detail})]},e.id))})]},e.runId)),O.lanes.length===0?(0,K.jsx)(sj,{title:`No flow events`,body:`Run lanes will appear here once the session starts publishing structured events.`}):null]}):null,a===`timeline`?(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[O.timeline.map(t=>(0,K.jsx)(dj,{item:t,workspacePath:e.workspacePath,onReuseText:R},t.id)),O.timeline.length===0?(0,K.jsx)(sj,{title:`No timeline activity`,body:`The timeline populates when the session emits tool, lifecycle, or system events.`}):null]}):null,a===`files`?(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[O.files.map(t=>(0,K.jsx)(fj,{file:t,workspacePath:e.workspacePath,onMentionFile:z},t.path)),O.files.length===0?(0,K.jsx)(sj,{title:`No file attention yet`,body:`File touches will appear once the session reads or modifies paths through tools or system events.`}):null]}):null]}),D.length>0?(0,K.jsxs)(`section`,{className:`mt-4 rounded-2xl border border-warning/25 bg-warning/8 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,K.jsx)(Pm,{className:`h-4 w-4 text-warning`}),`Approval feedback loop`]}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-3`,children:D.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-warning/25 bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.hookKind}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[`Deadline `,GA(e.deadlineTs),` · run `,e.runId]})]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(Q,{type:`button`,size:`sm`,variant:`outline`,disabled:S===e.hookRequestId,onClick:()=>void ne(e.hookRequestId,`deny`),children:`Deny`}),(0,K.jsx)(Q,{type:`button`,size:`sm`,disabled:S===e.hookRequestId,onClick:()=>void ne(e.hookRequestId,`allow`),children:S===e.hookRequestId?`Sending...`:`Allow`})]})]}),(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap break-words text-xs leading-6 text-foreground-secondary`,children:JSON.stringify(e.payload,null,2)})]},e.hookRequestId))})]}):null,(0,K.jsxs)(`form`,{onSubmit:te,className:`mt-4 grid gap-3 border-t border-border pt-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-3 xl:grid-cols-[minmax(0,1fr)_minmax(16rem,0.9fr)_minmax(12rem,0.7fr)]`,children:[(0,K.jsxs)(`label`,{className:`grid gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Agent`}),(0,K.jsxs)(`select`,{value:l,disabled:e.disabled||M.length===0,onChange:e=>u(e.target.value),className:`rounded-2xl border border-border bg-background/70 px-4 py-3 text-sm text-foreground outline-none transition-colors focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-60`,children:[M.length===0?(0,K.jsx)(`option`,{value:l,children:l}):null,M.map(e=>(0,K.jsx)(`option`,{value:e.agent,children:String(e.displayName??e.agent)},e.agent))]})]}),(0,K.jsxs)(`label`,{className:`grid gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Variant / model`}),(0,K.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),disabled:e.disabled,placeholder:`Leave blank for session default`,className:`rounded-2xl border border-border bg-background/70 px-4 py-3 text-sm text-foreground outline-none transition-colors focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-60`})]}),(0,K.jsxs)(`label`,{className:`grid gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Approvals`}),(0,K.jsx)(`select`,{value:p,onChange:e=>m(e.target.value),disabled:e.disabled,className:`rounded-2xl border border-border bg-background/70 px-4 py-3 text-sm text-foreground outline-none transition-colors focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-60`,children:P.map(e=>(0,K.jsx)(`option`,{value:e,children:tj(e)},e))})]})]}),(0,K.jsxs)(`label`,{className:`grid gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Send another turn`}),(0,K.jsx)(Px,{taskTags:r,value:s,onValueChange:c,disabled:e.disabled,renderTextarea:t=>(0,K.jsx)(`textarea`,{...t,rows:6,placeholder:e.placeholder,className:`min-h-36 rounded-2xl border border-border bg-background/70 px-4 py-3 text-sm text-foreground outline-none transition-colors focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-60`})})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:"Task tags via `@tag`"}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:L?`Attachments enabled`:`This agent does not advertise attachment support`}),F?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:`Image input ready`}):null]}),h.length>0?(0,K.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:h.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.isImage?(0,K.jsx)(Kp,{className:`h-4 w-4 text-primary`}):(0,K.jsx)(qp,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:e.name??`attachment`})]}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[e.mimeType??`application/octet-stream`,` · `,qA(e.size)]})]}),(0,K.jsx)(`button`,{type:`button`,className:`text-xs text-foreground-muted hover:text-foreground`,onClick:()=>g(t=>t.filter(t=>t.id!==e.id)),children:`Remove`})]}),e.previewUrl?(0,K.jsx)(`img`,{src:e.previewUrl,alt:e.name??`attachment preview`,className:`mt-3 max-h-36 rounded-xl border border-border object-cover`}):null]},e.id))}):null,b?(0,K.jsx)(`div`,{className:`rounded-2xl border border-error/20 bg-error-muted px-4 py-3 text-sm text-error`,children:b}):null,(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,K.jsx)(`input`,{ref:i,type:`file`,multiple:!0,accept:I?void 0:F?`image/*`:void 0,className:`hidden`,onChange:e=>void ee(e)}),(0,K.jsx)(Q,{type:`submit`,disabled:e.disabled||_||!s.trim()&&h.length===0,children:_?`Sending...`:e.submitLabel??`Send turn`}),(0,K.jsxs)(Q,{type:`button`,variant:`outline`,disabled:e.disabled||!L,onClick:()=>i.current?.click(),children:[F?(0,K.jsx)(Kp,{className:`h-4 w-4`}):(0,K.jsx)(Yp,{className:`h-4 w-4`}),`Attach`]}),(0,K.jsx)(`div`,{className:`rounded-full border border-border px-3 py-2 text-xs text-foreground-muted`,children:p===`prompt`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Fp,{className:`mr-1 inline h-3.5 w-3.5`}),`Interactive approvals`]}):p===`yolo`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(qm,{className:`mr-1 inline h-3.5 w-3.5`}),`Auto-approve on restart`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Wm,{className:`mr-1 inline h-3.5 w-3.5`}),`Auto-deny on restart`]})}),_?(0,K.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-border px-3 py-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(dm,{className:`h-3.5 w-3.5 animate-spin`}),`Dispatching turn`]}):null,!_&&O.summary.pendingTools>0?(0,K.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-warning/20 bg-warning/8 px-3 py-2 text-xs text-warning`,children:[(0,K.jsx)(Dm,{className:`h-3.5 w-3.5`}),O.summary.pendingTools,` tool calls still running`]}):null,!_&&D.length>0?(0,K.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-warning/20 bg-warning/8 px-3 py-2 text-xs text-warning`,children:[(0,K.jsx)(Ep,{className:`h-3.5 w-3.5`}),D.length,` approvals waiting`]}):null]})]})]})}function mj(e){return e==null||!Number.isFinite(e)||e<=0?`unknown`:new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function hj(e){return!e||typeof e!=`object`?null:e}function gj(e){return e.startsWith(`/`)||e.startsWith(`\\\\`)||/^[a-zA-Z]:[\\/]/.test(e)}function _j(e,t){let n=e.includes(`\\`)?`\\`:`/`;return`${e.replace(/[\\/]+$/,``)}${n}${t.replace(/^[./\\\/]+/,``)}`}function vj(e,t){return t.trim()?gj(t)?t:e?_j(e,t):null:null}function yj(e){return`vscode://file${e}`}function bj(e){return typeof e?.preview?.primaryUrl==`string`&&e.preview.primaryUrl.length>0?e.preview.primaryUrl:typeof e?.devServer?.primaryUrl==`string`&&e.devServer.primaryUrl.length>0?e.devServer.primaryUrl:null}function xj(e){return[`inline-flex items-center gap-1 rounded-full border border-border px-2 py-1 text-xs`,e.external?`text-foreground-muted hover:text-foreground`:`text-primary`].join(` `)}function Sj(e){return e.actions.length===0?null:(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:e.actions.map(e=>e.external?(0,K.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:xj(e),children:e.label},e.key):(0,K.jsx)(Z,{href:e.href,className:xj(e),children:e.label},e.key))})}function Cj(e){let[t,n]=(0,y.useState)(`flow`),r=(0,y.useMemo)(()=>En(e.runs,e.eventBuffers),[e.eventBuffers,e.runs]),i=nx(e.runs),a=bj(e.runtime??null),o=(0,y.useMemo)(()=>{let t=new Map(i.map(e=>[e.runId,e])),n=e.runs.map(n=>{let r=String(n.runId??``),i=t.get(r),o=typeof n.cwd==`string`&&n.cwd.length>0?n.cwd:e.workspacePath??null,s=bj(hj(n.runtime)??e.runtime??null)??a;return[r,{runId:r,runHref:`/runs/${encodeURIComponent(r)}`,workspaceHref:o?yj(o):void 0,runtimeHref:s??void 0,breakpointHref:i?.breakpointEffectId?`/runs/${encodeURIComponent(r)}?effectId=${encodeURIComponent(i.breakpointEffectId)}`:void 0,failedTaskHref:i?.errorEffectId?`/runs/${encodeURIComponent(r)}?effectId=${encodeURIComponent(i.errorEffectId)}`:void 0,fileHref:e=>{let t=vj(o,e);return t?yj(t):null}}]});return new Map(n)},[a,e.runs,e.runtime,e.workspacePath,i]),s=(e,t,n)=>{let r=o.get(e);if(!r)return[];let i=[{key:`${e}:run`,label:`Open run detail`,href:r.runHref}];n?.includeFailures&&r.breakpointHref&&i.push({key:`${e}:breakpoint`,label:`Review breakpoint`,href:r.breakpointHref}),n?.includeFailures&&r.failedTaskHref&&i.push({key:`${e}:failed`,label:`Open failed task`,href:r.failedTaskHref});let a=t.map(e=>({path:e,href:r.fileHref(e)})).find(e=>e.href!=null);return a?.href&&i.push({key:`${e}:file:${a.path}`,label:`Open file`,href:a.href,external:!0}),r.workspaceHref&&i.push({key:`${e}:workspace`,label:`Open workspace`,href:r.workspaceHref,external:!0}),r.runtimeHref&&i.push({key:`${e}:runtime`,label:`Open runtime`,href:r.runtimeHref,external:!0}),i},c=[{value:`flow`,label:`Flow`,badge:r.lanes.length,body:(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[r.lanes.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e.agent}),(0,K.jsxs)(`div`,{className:`text-xs text-foreground-muted`,children:[e.startedAt>0?`${mj(e.startedAt)} · `:``,e.runId]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5`,children:e.status}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5`,children:[e.segmentCount,` phases`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5`,children:[e.toolCount,` tools`]})]})]}),(0,K.jsx)(`div`,{className:`mt-4 flex gap-3 overflow-x-auto pb-1`,children:e.segments.map(t=>(0,K.jsxs)(`article`,{className:`min-w-44 rounded-2xl border border-border bg-card p-4`,style:{flexGrow:t.weight},children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-semibold text-foreground`,children:t.title}),t.secondaryLabel?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] text-foreground-muted`,children:t.secondaryLabel}):null]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-secondary`,children:t.detail}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:t.kind}),(0,K.jsx)(`span`,{children:t.status}),t.filePaths.length>0?(0,K.jsxs)(`span`,{children:[t.filePaths.length,` files`]}):null]}),(0,K.jsx)(Sj,{actions:s(e.runId,t.filePaths,{includeFailures:!0})})]},t.id))})]},e.runId)),r.lanes.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-4 text-sm text-foreground-muted`,children:`No structured execution flow is available for this session yet.`}):null]})},{value:`timeline`,label:`Timeline`,badge:r.timeline.length,body:(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[r.timeline.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e.title}),(0,K.jsxs)(`div`,{className:`text-xs text-foreground-muted`,children:[e.timestamp==null?``:`${mj(e.timestamp)} · `,e.runId]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:e.kind}),(0,K.jsx)(`span`,{children:e.status})]})]}),(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap break-words text-sm leading-6 text-foreground-secondary`,children:e.detail}),(0,K.jsx)(Sj,{actions:s(e.runId,e.filePaths,{includeFailures:!0})})]},e.id)),r.timeline.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-4 text-sm text-foreground-muted`,children:`No timeline events are available for this session yet.`}):null]})},{value:`transcript`,label:`Transcript`,badge:r.transcript.length,body:(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[r.transcript.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:e.kind}),(0,K.jsx)(`span`,{className:`text-sm font-semibold text-foreground`,children:e.label}),(0,K.jsx)(Z,{href:`/runs/${e.runId}`,className:`text-xs text-primary`,children:e.runId})]}),(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap break-words text-sm leading-6 text-foreground-secondary`,children:e.text}),(0,K.jsx)(Sj,{actions:s(e.runId,e.filePaths,{includeFailures:!0})})]},e.id)),r.transcript.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-4 text-sm text-foreground-muted`,children:`No transcript turns are available for this session yet.`}):null]})},{value:`files`,label:`Files`,badge:r.files.length,body:(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[r.files.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-sm text-foreground`,children:e.path}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[e.touches,` touches`]})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{children:[e.reads,` reads`]}),(0,K.jsxs)(`span`,{children:[e.writes,` writes`]}),(0,K.jsxs)(`span`,{children:[e.runIds.length,` runs`]}),e.tools.length>0?(0,K.jsxs)(`span`,{children:[e.tools.length,` tools`]}):null]}),(0,K.jsx)(Sj,{actions:s(e.runIds[0]??``,[e.path],{includeFailures:!0})})]},e.path)),r.files.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-4 text-sm text-foreground-muted`,children:`File attention will appear here once the session touches the workspace.`}):null]})}];return(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Realtime execution`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:`Agent flow reconstructed on the gateway stack`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Flow lanes, transcript turns, tool work, and file attention are projected from the same live event buffers so session review stays aligned with kanban execution.`})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1 text-xs text-foreground-muted`,children:[`Session `,e.sessionId]})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1`,children:[r.summary.totalRuns,` runs`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1`,children:[r.summary.totalSegments,` segments`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1`,children:[r.summary.totalTools,` tools`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1`,children:[r.summary.fileCount,` files`]})]}),(0,K.jsxs)(`div`,{className:`mt-6 grid gap-6 xl:grid-cols-[minmax(0,1.2fr)_360px]`,children:[(0,K.jsx)(`div`,{children:(0,K.jsx)(Fd,{value:t,onChange:e=>n(e),items:c})}),(0,K.jsxs)(`aside`,{className:`space-y-4`,children:[(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Rm,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Artifact shortcuts`})]}),(0,K.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[i.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(Z,{href:`/runs/${e.runId}`,className:`font-mono text-sm text-primary`,children:e.runId}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:e.status})]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm text-foreground`,children:e.processId}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{children:[e.logTaskCount,` log tasks`]}),(0,K.jsxs)(`span`,{children:[e.resultTaskCount,` result payloads`]}),e.failedTaskCount>0?(0,K.jsxs)(`span`,{children:[e.failedTaskCount,` failed tasks`]}):null]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[e.breakpointEffectId?(0,K.jsxs)(Z,{href:`/runs/${e.runId}?effectId=${encodeURIComponent(e.breakpointEffectId)}`,className:`inline-flex items-center gap-1 text-primary`,children:[(0,K.jsx)(tm,{className:`h-3 w-3`}),`Review breakpoint`]}):null,e.errorEffectId?(0,K.jsxs)(Z,{href:`/runs/${e.runId}?effectId=${encodeURIComponent(e.errorEffectId)}`,className:`inline-flex items-center gap-1 text-primary`,children:[(0,K.jsx)(Wm,{className:`h-3 w-3`}),`Open failed task`]}):null,(0,K.jsxs)(Z,{href:`/runs/${e.runId}`,className:`inline-flex items-center gap-1 text-primary`,children:[(0,K.jsx)(Tp,{className:`h-3 w-3`}),`Open run detail`]})]})]},e.runId)),i.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-4 text-sm text-foreground-muted`,children:`Run artifacts will appear here once the session emits execution data.`}):null]})]}),(0,K.jsx)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4 text-sm text-foreground-muted`,children:(0,K.jsxs)(`div`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,K.jsx)(Pp,{className:`h-4 w-4 text-success`}),`Kanban now shows the same reconstructed realtime execution story as agent-mux instead of a reduced overlay summary.`]})})]})]})]})}var wj=[`sidebar`,`conversation`,`context`,`details`],Tj={sidebar:20,conversation:36,context:24,details:20},Ej=1280;function Dj(e){return Object.values(e).some(Boolean)?e:{...e,conversation:!0}}function Oj(e){let t=Dj(e);return wj.filter(e=>t[e])}function kj(e,t){return Dj({...e,[t]:!e[t]})}function Aj(e,t){let n=Dj(t),r=Oj(n),i=r.reduce((t,n)=>t+Math.max(e[n],0),0),a=r.reduce((e,t)=>e+Tj[t],0);return wj.reduce((t,r)=>{if(!n[r])return t[r]=e[r],t;let o=i>0?e[r]:Tj[r],s=i>0?i:a;return t[r]=s>0?o/s*100:0,t},{...e})}function jj(e){let{sizes:t,visibility:n,leftPanel:r,rightPanel:i,deltaPercentage:a,minPercentage:o=14}=e,s=Dj(n);if(!s[r]||!s[i])return t;let c=Aj(t,s),l=c[r],u=c[i],d=o-l,f=u-o,p=Math.max(d,Math.min(a,f));return{...t,[r]:l+p,[i]:u-p}}var Mj=`fixed inset-0 z-50 bg-background/72 backdrop-blur-sm`,Nj=`fixed left-1/2 top-20 z-50 w-[min(42rem,calc(100vw-2rem))] -translate-x-1/2 rounded-[28px] border border-border bg-card/95 p-4 shadow-2xl backdrop-blur-xl`,Pj=`flex min-h-[44px] min-w-[44px] items-center justify-center rounded-full p-2 text-foreground-muted transition-colors hover:bg-background hover:text-foreground`,Fj=[{key:`sidebar`,label:`Sidebar`,shortcut:`Shift+W`,icon:_m},{key:`conversation`,label:`Session`,shortcut:`Shift+C`,icon:hm},{key:`context`,label:`Context`,shortcut:`Shift+X`,icon:Xm},{key:`details`,label:`Runtime`,shortcut:`Shift+D`,icon:vm}];function Ij(e){return`/workspaces?workspace=${encodeURIComponent(e)}`}function Lj(e,t){let n=e.ownership?.project?.projectId??e.issues?.find(e=>e.issueId===t)?.projectId;return n?`/projects/${encodeURIComponent(n)}/issues/${encodeURIComponent(t)}`:`/issues/${encodeURIComponent(t)}`}function Rj(e,t){let n=Oj(e);return n.includes(t)?t:n[0]}function zj(e){return!e||!Number.isFinite(e)?`No live session heartbeat`:new Date(e).toLocaleString()}function Bj(e){return e===`active`?`border-success/20 bg-success/10 text-success`:`border-border text-foreground-muted`}function Vj(e){let[t,n]=(0,y.useState)(``);(0,y.useEffect)(()=>{e.open||n(``)},[e.open]);let r=(0,y.useMemo)(()=>Fj.map(t=>({...t,description:e.visibility[t.key]?`Hide panel`:`Show panel`})).filter(e=>`${e.label} ${e.description}`.toLowerCase().includes(t.trim().toLowerCase())),[e.visibility,t]);return(0,K.jsx)(Nv,{open:e.open,onOpenChange:e.onOpenChange,children:(0,K.jsxs)(Pv,{children:[(0,K.jsx)(Fv,{className:Mj}),(0,K.jsxs)(Iv,{"data-testid":`workspace-command-bar`,className:Nj,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-border bg-background/70 px-4 py-3`,children:[(0,K.jsx)(Am,{className:`h-4 w-4 text-foreground-muted`}),(0,K.jsx)(`input`,{autoFocus:!0,value:t,onChange:e=>n(e.target.value),placeholder:`Toggle workspace panels`,className:`w-full bg-transparent text-sm text-foreground outline-none placeholder:text-foreground-muted`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>e.onOpenChange(!1),className:Pj,"aria-label":`Close command bar`,children:(0,K.jsx)(Qm,{className:`h-4 w-4`})})]}),(0,K.jsxs)(`div`,{className:`mt-3 grid gap-2`,children:[r.map(t=>{let n=t.icon;return(0,K.jsxs)(`button`,{type:`button`,"data-testid":`workspace-command-${t.key}`,onClick:()=>{e.onTogglePanel(t.key),e.onOpenChange(!1)},className:`flex items-center justify-between rounded-2xl border border-border bg-background/60 px-4 py-3 text-left transition-colors hover:border-primary/30 hover:bg-background`,children:[(0,K.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(n,{className:`h-4 w-4 text-primary`}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:t.label}),(0,K.jsx)(`span`,{className:`block text-xs text-foreground-muted`,children:t.description})]})]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1 text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:t.shortcut})]},t.key)}),r.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border px-4 py-6 text-sm text-foreground-muted`,children:`No panel commands match this query.`}):null]})]})]})})}function Hj(e){return(0,K.jsxs)(`section`,{"data-testid":`workspace-panel-${e.panelKey}`,className:`flex h-full min-h-0 flex-col rounded-3xl border border-border bg-card shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`border-b border-border px-4 py-3`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:e.title}),e.subtitle?(0,K.jsx)(`div`,{className:`mt-1 text-sm text-foreground-muted`,children:e.subtitle}):null]}),(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:e.children})]})}function Uj(e){return(0,K.jsx)(`button`,{type:`button`,"data-testid":e.testId,"aria-label":`Resize panels`,onMouseDown:e.onMouseDown,className:`group flex h-full w-full cursor-col-resize items-center justify-center rounded-full bg-transparent text-foreground-muted transition-colors hover:bg-primary/8 hover:text-primary`,children:(0,K.jsx)($p,{className:`h-4 w-4`})})}function Wj(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border px-4 py-6 text-sm`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.title}),(0,K.jsx)(`p`,{className:`mt-2 leading-6 text-foreground-muted`,children:e.body})]})}function Gj(e){let[t,n]=ux(`workspace-layout.sidebar-open`,!0),[r,i]=ux(`workspace-layout.conversation-open`,!0),[a,o]=ux(`workspace-layout.context-open`,!0),[s,c]=ux(`workspace-layout.details-open`,!0),[l,u]=ux(`workspace-layout.desktop-sizes`,Tj),[d,f]=(0,y.useState)(!1),[p,m]=(0,y.useState)(`conversation`),[h,g]=(0,y.useState)(()=>typeof window>`u`?Ej:window.innerWidth),_=(0,y.useRef)(null),v=(0,y.useMemo)(()=>Dj({sidebar:t,conversation:r,context:a,details:s}),[a,r,s,t]),b=(0,y.useMemo)(()=>Oj(v),[v]),x=(0,y.useMemo)(()=>Aj(l,v),[l,v]),S=h<Ej;(0,y.useEffect)(()=>{let e=()=>g(window.innerWidth);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,y.useEffect)(()=>{m(e=>Rj(v,e))},[v]),(0,y.useEffect)(()=>{let e=e=>{let t=e.target;if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`){if(t?.tagName===`INPUT`||t?.tagName===`TEXTAREA`||t?.tagName===`SELECT`||t?.isContentEditable)return;e.preventDefault(),f(!0)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let C=e=>{let t=Dj(e);n(t.sidebar),i(t.conversation),o(t.context),c(t.details),m(e=>Rj(t,e))},w=e=>{C(kj(v,e))},T=(e,t)=>n=>{if(S||!_.current)return;n.preventDefault();let r=_.current.getBoundingClientRect().width||1,i=n.clientX,a=l,o=n=>{u(jj({sizes:a,visibility:v,leftPanel:e,rightPanel:t,deltaPercentage:(n.clientX-i)/r*100}))},s=()=>{window.removeEventListener(`mousemove`,o),window.removeEventListener(`mouseup`,s)};window.addEventListener(`mousemove`,o),window.addEventListener(`mouseup`,s)};Bv([{key:`W`,shift:!0,action:()=>w(`sidebar`),description:`Toggle workspace sidebar`},{key:`C`,shift:!0,action:()=>w(`conversation`),description:`Toggle session panel`},{key:`X`,shift:!0,action:()=>w(`context`),description:`Toggle context panel`},{key:`D`,shift:!0,action:()=>w(`details`),description:`Toggle runtime panel`}]);let E=(0,y.useMemo)(()=>{let e=[];return b.forEach((t,n)=>{e.push(`minmax(0, ${x[t]}fr)`),n<b.length-1&&e.push(`0.85rem`)}),e.join(` `)},[x,b]),D=e.activeSession?.title??e.activeSession?.sessionId??`No session selected`,O=e.activeSession?.runtime,k=t=>t===`sidebar`?(0,K.jsx)(Hj,{panelKey:`sidebar`,title:`Sidebar`,subtitle:`Lifecycle controls, session roster, and operator notes`,children:(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(sm,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Workspace sessions`})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3`,children:[e.sessions.map(t=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>e.onSelectSession(t.sessionId),className:`rounded-2xl border bg-card/80 p-3 text-left transition-colors hover:border-primary/30 ${t.sessionId===e.selectedSessionId?`border-primary/40`:`border-border`}`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:t.title??t.sessionId}),(0,K.jsx)(`span`,{className:`rounded-full border px-2 py-0.5 text-xs ${Bj(t.status)}`,children:t.status})]}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:t.agent}),t.latestRunId?(0,K.jsx)(`span`,{children:t.latestRunId}):null]})]},t.sessionId)),e.sessions.length===0?(0,K.jsx)(Wj,{title:`No attached sessions`,body:`This workspace is present in the lifecycle inventory, but no gateway session is currently publishing into it.`}):null]})]}),(0,K.jsx)(WO,{workspace:e.workspace,runtime:O,reviewArtifact:e.reviewArtifact,sessionId:e.activeSession?.sessionId,sessionStatus:e.activeSession?.status,pendingAction:e.pendingAction,notesSaving:e.notesSaving,reviewPending:e.reviewPending,feedback:e.feedback,onAction:e.onAction,onOpenInEditor:e.onOpenInEditor,onSaveNote:e.onSaveNote,onCreatePullRequest:e.onCreatePullRequest,onLinkPullRequest:e.onLinkPullRequest})]})}):t===`conversation`?(0,K.jsx)(Hj,{panelKey:`conversation`,title:`Session`,subtitle:`Selected session transcript and next-turn input`,children:(0,K.jsx)(pj,{sessionId:e.activeSession?.sessionId??`no-session`,sessionLabel:D,sessionAgent:e.activeSession?.agent??`unknown`,sessionStatus:e.activeSession?.status??`inactive`,sessionModel:null,runs:e.runs,eventBuffers:e.eventBuffers,workspacePath:e.workspace.path,runtime:O,disabled:!e.activeSession,emptyStateTitle:`No transcript events`,emptyStateBody:e.activeSession?`The selected session has not published transcript, tool, or file attention events yet.`:`Select a session from this workspace to inspect transcript activity and continue the conversation.`,openSessionHref:e.activeSession?`/sessions/${e.activeSession.sessionId}`:void 0,placeholder:e.activeSession?`Continue the selected session...`:`Select a session to continue the conversation.`,onSubmit:e.onSubmit})}):t===`context`?(0,K.jsx)(Hj,{panelKey:`context`,title:`Context`,subtitle:`Execution reconstruction for the selected session`,children:e.activeSession?(0,K.jsx)(Cj,{sessionId:e.activeSession.sessionId,runs:e.runs,eventBuffers:e.eventBuffers,workspacePath:e.workspace.path,runtime:O}):(0,K.jsx)(Wj,{title:`No session context`,body:`Choose a session from the context bar or sidebar to unlock flow, timeline, transcript, and file attention views.`})}):(0,K.jsx)(Hj,{panelKey:`details`,title:`Runtime`,subtitle:`Preview, shell, logs, and workspace-linked runtime activity`,children:O?(0,K.jsx)(BA,{runtime:O,rebase:e.workspace.rebase,sessionId:e.activeSession?.sessionId,sessionStatus:e.activeSession?.status??`inactive`,className:`border-0 bg-transparent p-0 shadow-none`}):(0,K.jsx)(Wj,{title:`Runtime details unavailable`,body:`No selected session in this workspace is currently publishing preview, terminal, or dev-server surfaces.`})});return(0,K.jsxs)(`div`,{"data-testid":`workspace-shell`,className:`mx-auto flex w-full max-w-[1800px] flex-1 flex-col gap-6 px-4 py-4 sm:px-6 sm:py-6`,children:[(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-5 shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm text-foreground-muted`,children:[(0,K.jsxs)(Z,{href:`/workspaces`,className:`inline-flex items-center gap-1 text-primary`,children:[(0,K.jsx)(Ap,{className:`h-4 w-4`}),`Workspaces`]}),(0,K.jsx)(`span`,{children:`/`}),(0,K.jsx)(`span`,{className:`font-mono text-xs text-foreground-secondary`,children:e.workspace.path})]}),(0,K.jsx)(`h1`,{className:`mt-3 text-3xl font-semibold tracking-tight`,children:e.workspace.name}),(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`This route keeps the workspace itself at the center: session switching, lifecycle controls, context reconstruction, and runtime surfaces stay in a single resizable shell.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(Q,{type:`button`,variant:`outline`,onClick:()=>e.onOpenInEditor(e.workspace,e.workspace.links.editorHref),children:[(0,K.jsx)(Hp,{className:`h-4 w-4`}),`Open in editor`]}),e.activeSession?(0,K.jsx)(Q,{asChild:!0,type:`button`,variant:`outline`,children:(0,K.jsx)(Z,{href:`/sessions/${e.activeSession.sessionId}`,children:`View session`})}):null,Fj.map(e=>{let t=e.icon;return(0,K.jsxs)(Q,{type:`button`,variant:v[e.key]?`default`:`outline`,size:`sm`,"data-testid":`panel-toggle-${e.key}`,"aria-pressed":v[e.key],onClick:()=>w(e.key),children:[(0,K.jsx)(t,{className:`h-4 w-4`}),e.label]},e.key)}),(0,K.jsxs)(Q,{type:`button`,variant:`outline`,size:`sm`,"data-testid":`workspace-command-bar-trigger`,onClick:()=>f(!0),children:[(0,K.jsx)(Am,{className:`h-4 w-4`}),`Command bar`]})]})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-4 xl:grid-cols-[minmax(0,1.3fr)_minmax(18rem,0.7fr)]`,children:[(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 md:grid-cols-4`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:`Status`}),(0,K.jsx)(`p`,{className:`mt-2 text-base font-semibold text-foreground`,children:e.workspace.status})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:`Branch`}),(0,K.jsx)(`p`,{className:`mt-2 break-all font-mono text-sm text-foreground`,children:e.workspace.git.branch??`Unavailable`})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:`Sessions`}),(0,K.jsxs)(`p`,{className:`mt-2 text-base font-semibold text-foreground`,children:[e.workspace.sessions.active,`/`,e.workspace.sessions.total]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:`Runs`}),(0,K.jsxs)(`p`,{className:`mt-2 text-base font-semibold text-foreground`,children:[e.workspace.runs.active,`/`,e.workspace.runs.total]})]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-4`,"data-testid":`workspace-context-bar`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:`Active session`}),(0,K.jsx)(`p`,{className:`mt-1 text-sm font-medium text-foreground`,children:D}),e.activeSession?(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-foreground-muted`,children:[`Updated `,zj(e.activeSession.updatedAt)]}):null,e.workspace.ownership?(0,K.jsxs)(`div`,{className:`mt-3 text-xs text-foreground-muted`,"data-testid":`workspace-ownership-summary`,children:[(0,K.jsx)(`span`,{className:`font-semibold text-foreground`,children:`Owner:`}),` `,e.workspace.ownership.project?e.workspace.ownership.project.projectKey:`Unassigned`,e.workspace.ownership.issue?` / ${e.workspace.ownership.issue.issueKey}`:``,e.workspace.ownership.host?` · ${e.workspace.ownership.host.label}`:``]}):null]}),(0,K.jsxs)(`label`,{className:`w-full xl:max-w-sm`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:`Select workspace session`}),(0,K.jsxs)(`select`,{"data-testid":`workspace-session-select`,value:e.selectedSessionId??``,onChange:t=>e.onSelectSession(t.target.value),className:`w-full rounded-2xl border border-border bg-card px-4 py-3 text-sm text-foreground outline-none transition-colors focus:border-primary/40`,children:[e.sessions.length===0?(0,K.jsx)(`option`,{value:``,children:`No sessions available`}):null,e.sessions.map(e=>(0,K.jsxs)(`option`,{value:e.sessionId,children:[e.title??e.sessionId,` · `,e.status,` · `,e.agent]},e.sessionId))]})]})]}),(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:(e.workspace.issues??[]).length>0?(e.workspace.issues??[]).map(t=>(0,K.jsx)(Z,{href:Lj(e.workspace,t.issueId),className:`rounded-full border border-border px-3 py-1.5 text-xs text-primary`,"data-testid":`workspace-issue-link-${t.issueKey}`,children:t.issueKey},`${e.workspace.path}-${t.issueId}`)):(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-xs text-foreground-muted`,children:`No linked issues`})})]})]}),(0,K.jsxs)(`div`,{"data-testid":`workspace-navbar`,className:`mt-4 flex gap-2 overflow-x-auto pb-1 text-xs text-foreground-muted [scrollbar-width:none]`,children:[Fj.map(e=>(0,K.jsxs)(`span`,{className:`shrink-0 rounded-full border border-border px-3 py-1.5`,children:[e.label,`: `,e.shortcut]},e.key)),(0,K.jsx)(`span`,{className:`shrink-0 rounded-full border border-border px-3 py-1.5`,children:`Command bar: Ctrl/Cmd+K`}),e.workspace.git.root?(0,K.jsx)(Z,{href:Ij(e.workspace.path),className:`shrink-0 rounded-full border border-border px-3 py-1.5 text-primary`,children:`Canonical workspace link`}):null]})]}),S?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-4 shadow-lg`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,"data-testid":`workspace-mobile-panel-selector`,children:b.map(e=>(0,K.jsx)(Q,{type:`button`,"data-testid":`workspace-mobile-panel-${e}`,variant:p===e?`default`:`outline`,size:`sm`,onClick:()=>m(e),children:Fj.find(t=>t.key===e)?.label??e},e))}),(0,K.jsx)(`div`,{className:`mt-4 min-h-[65vh]`,children:k(p)})]}):(0,K.jsx)(`div`,{ref:_,"data-testid":`workspace-desktop-panels`,className:`grid min-h-[72vh] flex-1 items-stretch`,style:{gridTemplateColumns:E},children:b.map((e,t)=>{let n=b[t+1];return(0,K.jsxs)(`div`,{className:`contents`,children:[k(e),n?(0,K.jsx)(`div`,{className:`flex items-stretch justify-center py-2`,children:(0,K.jsx)(Uj,{testId:`workspace-resize-${e}-${n}`,onMouseDown:T(e,n)})}):null]},e)})}),(0,K.jsx)(Vj,{open:d,visibility:v,onOpenChange:f,onTogglePanel:w})]})}function Kj(e){return e?new Date(e).toLocaleString():`No recent activity`}function qj(e){return e.length<=72?e:`${e.slice(0,32)}...${e.slice(-28)}`}function Jj(e){return`/workspaces?workspace=${encodeURIComponent(e)}`}function Yj(e){return e==null||!Number.isFinite(e)?`unavailable`:new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:e>=1?2:4,maximumFractionDigits:4}).format(e)}function Xj(e){return e===`approved`||e===`ready`||e===`passing`||e===`published`||e===`merged`?`border-success/20 bg-success/10 text-success`:e===`pending`||e===`in-review`?`border-warning/20 bg-warning/10 text-warning`:e===`changes-requested`||e===`blocked`||e===`failing`||e===`failed`?`border-error/20 bg-error/10 text-error`:`border-border text-foreground-muted`}function Zj(e,t){let n=!1,r=0;for(let i of e){let e=t[i];if(e)for(let t of e.events)t.type!==`cost`||!t.cost||typeof t.cost!=`object`||(r+=Number(t.cost.totalUsd??0),n=!0)}return n?r:null}function Qj(e,t,n=[]){return n.length>0?`Explicit ownership: ${n.filter(e=>!!e.ownership?.issue).length} issue, ${n.filter(e=>e.ownership?.source===`created-from-project`).length} project, ${n.filter(e=>e.ownership?.source===`created-from-host`).length} host`:e?`${t.length} live session${t.length===1?``:`s`} attached to the current workspace inventory`:`Gateway disconnected: inventory falls back to local git worktrees and archived workspace metadata`}function $j(e,t){let n=e.ownership?.project?.projectId??e.issues?.find(e=>e.issueId===t)?.projectId;return n?`/projects/${encodeURIComponent(n)}/issues/${encodeURIComponent(t)}`:`/issues/${encodeURIComponent(t)}`}function eM(e){return e.ownership?.issue&&e.ownership.project?`${e.ownership.project.projectKey} / ${e.ownership.issue.issueKey}`:e.ownership?.source===`created-from-host`&&e.ownership.project&&e.ownership.host?`${e.ownership.project.projectKey} / ${e.ownership.host.label}`:e.ownership?.project?`${e.ownership.project.projectKey} project`:e.ownership?.host?`${e.ownership.host.label} host`:null}function tM(e){return e.trim().toLowerCase()}function nM(e){return[e.name,e.path,e.git.branch??``,e.git.root??``,eM(e)??``,...(e.issues??[]).flatMap(e=>[e.issueKey,e.issueTitle,e.projectKey,e.projectName])].join(`
|
|
74
|
+
`).toLowerCase()}function rM(e,t){return t?nM(e).includes(t):!0}function iM(e){return e===`active`?0:e===`idle`?1:e===`archived`?2:3}function aM(e){return[...e].sort((e,t)=>{let n=Number(!!t.pinnedAt)-Number(!!e.pinnedAt);if(n!==0)return n;let r=iM(e.status)-iM(t.status);return r===0?e.path.localeCompare(t.path):r})}async function oM(e){let t=await fetch(`/api/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({sessions:e})});if(!t.ok)throw Error(`Workspace inventory request failed: ${t.status}`);return await t.json()}async function sM(e,t,n,r){let i=await fetch(`/api/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:e,workspacePath:t,sessions:n,note:r})});if(!i.ok){let e=await i.json().catch(()=>null);throw Error(e?.error??`Workspace action failed: ${i.status}`)}return await i.json()}function cM(e){switch(e){case`ready-for-review`:case`ready-for-merge`:return`border-success/20 bg-success/10 text-success`;case`rebase-needed`:return`border-warning/20 bg-warning/10 text-warning`;case`rebase-conflicts`:return`border-error/20 bg-error/10 text-error`;default:return`border-border text-foreground-muted`}}function lM(e){return e.replace(/-/g,` `)}function uM(e){return new Map(e.map(e=>[e.targetId,{decision:e.decision,queueState:e.queueState,commentCount:e.comments.length,openCommentCount:e.comments.filter(e=>e.status===`open`).length,latestActivityAt:e.updatedAt}]))}function dM(e){return new Map(e.map(e=>[e.targetId,e]))}function fM(e){switch(e){case`connected`:return`border-success/20 bg-success/10 text-success`;case`partial-setup`:case`missing-scopes`:return`border-warning/20 bg-warning/10 text-warning`;case`expired-auth`:case`failing`:return`border-error/20 bg-error/10 text-error`;default:return`border-border text-foreground-muted`}}function pM(e){return e===`azure-repos`?`Azure Repos`:`GitHub`}function mM(e){let t=[];return e.status===`missing`&&t.push(`Recovery required`),e.rebase&&t.push(`Rebase ${lM(e.rebase.status)}`),e.review&&(e.review.decision===`changes-requested`?t.push(`Changes requested`):(e.review.decision===`pending`||e.review.queueState!==`completed`)&&t.push(`Review pending`),e.review.openCommentCount>0&&t.push(`${e.review.openCommentCount} open comment${e.review.openCommentCount===1?``:`s`}`)),t}function hM(e){return mM(e).length>0}function gM(e,t,n){let r=[],i=e.status===`active`||e.sessions.active>0||e.runs.active>0;r.push({label:e.status===`missing`?`Missing`:e.status===`archived`?`Archived`:i?`Running`:`Idle`,className:e.status===`missing`?`border-error/20 bg-error/10 text-error`:e.status===`archived`?`border-warning/20 bg-warning/10 text-warning`:i?`border-success/20 bg-success/10 text-success`:`border-border text-foreground-muted`}),hM(e)&&r.push({label:`Needs attention`,className:`border-warning/20 bg-warning/10 text-warning`}),e.pinnedAt&&r.push({label:`Pinned`,className:`border-primary/20 bg-primary/10 text-primary`});let a=t?.runtime?.devServer.status;return a&&r.push({label:`Dev server ${a.replace(/-/g,` `)}`,className:a===`running`?`border-success/20 bg-success/10 text-success`:a===`error`?`border-error/20 bg-error/10 text-error`:`border-border text-foreground-muted`}),n&&r.push({label:`PR ${n.status.replace(/-/g,` `)}`,className:Y(`border px-2 py-0.5 text-xs`,Xj(n.status))}),r}function _M(e){return e.status===`missing`||e.rebase?.status===`rebase-conflicts`?0:e.review?.decision===`changes-requested`?1:e.rebase?.status===`rebase-needed`||e.review?.decision===`pending`||e.review?.queueState===`queued`||e.review?.queueState===`in-review`||(e.review?.openCommentCount??0)>0?2:e.rebase?3:4}function vM(e,t){let n=_M(e)-_M(t);if(n!==0)return n;let r=Date.parse(e.lastActivityAt??``),i=Date.parse(t.lastActivityAt??``),a=(Number.isFinite(i)?i:0)-(Number.isFinite(r)?r:0);return a===0?e.path.localeCompare(t.path):a}function yM(e){let t=_f(),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!0),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(null),[f,p]=(0,y.useState)({}),[m,h]=(0,y.useState)(null),[g,_]=ux(`workspace-sidebar.layout-mode`,`grouped`),[v,b]=ux(`workspace-sidebar.search`,``),[x,S]=(0,y.useTransition)(),{snapshot:C}=sy(),w=Yb({targetType:`workspace`}),T=e.mode??`full`,E=e.selectedWorkspacePath??(t.get(`workspace`)?.trim()||null),D=(0,y.useMemo)(()=>JSON.stringify(e.sessions.map(e=>({sessionId:e.sessionId,status:e.status,cwd:e.cwd??``,updatedAt:e.updatedAt??0}))),[e.sessions]);(0,y.useEffect)(()=>{let t=!1;return s(!0),a(null),oM(e.sessions).then(e=>{t||r(e)}).catch(e=>{t||a(e instanceof Error?e.message:String(e))}).finally(()=>{t||s(!1)}),()=>{t=!0}},[e.sessions,D]);let O=n?.summary??{total:0,active:0,idle:0,archived:0,missing:0},k=(0,y.useMemo)(()=>uM(w.artifacts),[w.artifacts]),A=(0,y.useMemo)(()=>dM(w.artifacts),[w.artifacts]),j=(0,y.useMemo)(()=>(n?.workspaces??[]).map(e=>({...e,review:k.get(e.path)??e.review})),[n?.workspaces,k]),M=(0,y.useMemo)(()=>tM(v),[v]),N=(0,y.useMemo)(()=>aM(j.filter(e=>rM(e,M))),[M,j]),P=(0,y.useMemo)(()=>({pinned:N.filter(e=>!!e.pinnedAt),active:N.filter(e=>e.status===`active`&&!e.pinnedAt),idle:N.filter(e=>e.status===`idle`&&!e.pinnedAt),archived:N.filter(e=>e.status===`archived`&&!e.pinnedAt),missing:N.filter(e=>e.status===`missing`&&!e.pinnedAt)}),[N]),F=j.length-N.length,I=M?`No workspaces match "${v}". Clear the search or adjust the layout to widen the sidebar.`:`No workspaces are currently tracked in the sidebar.`,L=(0,y.useMemo)(()=>[...j].filter(hM).sort(vM),[j]),R=(0,y.useMemo)(()=>({total:L.length,recovery:L.filter(e=>e.status===`missing`).length,rebase:L.filter(e=>!!e.rebase).length,review:L.filter(e=>!!e.review&&(e.review?.decision!==`approved`||e.review?.queueState!==`completed`||(e.review?.openCommentCount??0)>0)).length}),[L]),z=(0,y.useMemo)(()=>C?new Map(e.sessions.map(e=>[e.sessionId,DD(C,e.sessionId)])):new Map,[e.sessions,C]),ee=(0,y.useMemo)(()=>E?j.find(e=>e.path===E)??null:null,[E,j]),te=(0,y.useMemo)(()=>ee?ee.sessions.items.map(t=>e.sessions.find(e=>e.sessionId===t.sessionId)??t).sort((e,t)=>e.status===t.status?Number(t.updatedAt??0)-Number(e.updatedAt??0):e.status===`active`?-1:1):[],[e.sessions,ee]);(0,y.useEffect)(()=>{if(te.length===0){h(null);return}h(e=>e&&te.some(t=>t.sessionId===e)?e:te.find(e=>e.status===`active`)?.sessionId??te[0]?.sessionId??null)},[te]);let ne=(0,y.useMemo)(()=>te.find(e=>e.sessionId===m)??null,[m,te]),re=(0,y.useMemo)(()=>(e.allRuns??[]).filter(e=>String(e.sessionId??``)===m).sort((e,t)=>Number(t.startedAt??0)-Number(e.startedAt??0)),[e.allRuns,m]),ie=e.eventBuffers??{},ae=(0,y.useMemo)(()=>re.map(e=>String(e.runId??``)),[re]),oe=(0,y.useMemo)(()=>Zj(ae,ie),[ie,ae]);(0,y.useEffect)(()=>{if(!E)return;let e=Array.from(document.querySelectorAll(`[data-workspace-path]`)).find(e=>e.getAttribute(`data-workspace-path`)===E);!e||typeof e.scrollIntoView!=`function`||e.scrollIntoView({behavior:`smooth`,block:`center`})},[E,n?.workspaces.length]);function se(){S(()=>{s(!0),a(null),oM(e.sessions).then(e=>r(e)).catch(e=>a(e instanceof Error?e.message:String(e))).finally(()=>s(!1))})}function ce(e,t){p(n=>({...n,[e]:t}))}function le(e,t,n){return typeof window>`u`?!1:t?window.open(t,`_blank`,`noopener,noreferrer`)?(ce(e.path,{tone:`success`,message:n}),!0):(ce(e.path,{tone:`error`,message:`Editor action failed for ${e.path}. The link may have been blocked by the browser or the editor handler is unavailable.`}),!1):(ce(e.path,{tone:`error`,message:`Editor action failed for ${e.path}: no editor link is available.`}),!1)}function ue(t,n){let i=t===`cleanup`?`Remove the git worktree at ${n.path}? This should only be used for archived, inactive workspaces.`:t===`archive`?`Archive ${n.path} in the kanban workspace inventory?`:t===`recover`?`Recover ${n.path} back into the active inventory?`:t===`rebase-abort`?`Abort the current rebase workflow for ${n.path}?`:null;i&&typeof window<`u`&&!window.confirm(i)||(l(`${t}:${n.path}`),a(null),ce(n.path,null),S(()=>{sM(t,n.path,e.sessions).then(e=>{r(e);let i=e.workspaces.find(e=>e.path===n.path),a=e.result?.message??`Updated ${n.path}.`;if(t===`rebase-open-in-editor`&&typeof window<`u`){let e=i?.rebase?.editorHref;if(!le({path:n.path,links:{editorHref:e??i?.links.editorHref??n.links.editorHref}},e??i?.links.editorHref??n.links.editorHref,a))return}ce(n.path,{tone:`success`,message:a})}).catch(e=>{let t=e instanceof Error?e.message:String(e);a(t),ce(n.path,{tone:`error`,message:t})}).finally(()=>l(null))}))}function de(t,n){d(t.path),a(null),ce(t.path,null),S(()=>{sM(`notes-save`,t.path,e.sessions,n).then(e=>{r(e);let n=e.result?.message??`Updated notes for ${t.path}.`;ce(t.path,{tone:`success`,message:n})}).catch(e=>{let n=e instanceof Error?e.message:String(e);a(n),ce(t.path,{tone:`error`,message:n})}).finally(()=>d(null))})}function fe(e,t,n){if(!t){let t=`Workspace review artifact not found for ${e.path}.`;a(t),ce(e.path,{tone:`error`,message:t});return}a(null),ce(e.path,null),S(()=>{w.actOnReview({action:`create-pull-request`,artifactId:t.id,...n}).then(()=>{ce(e.path,{tone:`success`,message:`Created linked PR for ${e.path}.`})}).catch(t=>{let n=t instanceof Error?t.message:String(t);a(n),ce(e.path,{tone:`error`,message:n})})})}function pe(e,t,n){if(!t){let t=`Workspace review artifact not found for ${e.path}.`;a(t),ce(e.path,{tone:`error`,message:t});return}a(null),ce(e.path,null),S(()=>{w.actOnReview({action:`link-pull-request`,artifactId:t.id,...n}).then(()=>{ce(e.path,{tone:`success`,message:`Linked PR #${n.number} to ${e.path}.`})}).catch(t=>{let n=t instanceof Error?t.message:String(t);a(n),ce(e.path,{tone:`error`,message:n})})})}async function me(t){!m||!e.onSendPrompt||await e.onSendPrompt({...t,sessionId:m,agent:t.agent??ne?.agent})}if(E){let e=ee==null?void 0:A.get(ee.path)??void 0;return o?(0,K.jsx)(dy,{children:(0,K.jsx)(fy,{children:(0,K.jsx)(`p`,{className:`text-sm text-foreground-muted`,children:`Loading workspace shell…`})})}):ee?(0,K.jsx)(Gj,{workspace:ee,sessions:te,activeSession:ne,runs:re,eventBuffers:ie,totalCostLabel:Yj(oe),selectedSessionId:m,onSelectSession:h,pendingAction:c,notesSaving:u===ee.path,feedback:f[ee.path]??null,onSubmit:me,onAction:ue,onOpenInEditor:(e,t)=>le(e,t,`Opened ${e.path} in the configured editor.`),onSaveNote:de,reviewArtifact:e,reviewPending:w.pendingArtifactId===e?.id,onCreatePullRequest:(t,n)=>fe(t,e,n),onLinkPullRequest:(t,n)=>pe(t,e,n)}):(0,K.jsx)(dy,{children:(0,K.jsxs)(fy,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Workspace lifecycle`}),(0,K.jsx)(`h1`,{className:`mt-2 text-3xl font-semibold tracking-tight`,children:`Workspace not found`}),(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`The selected workspace is not present in the current inventory snapshot. Refresh the inventory or return to the workspace list.`}),(0,K.jsx)(`div`,{className:`mt-5`,children:(0,K.jsx)(Q,{asChild:!0,variant:`outline`,children:(0,K.jsx)(Z,{href:`/workspaces`,children:`Back to inventory`})})})]})})}return T===`attention`?(0,K.jsxs)(dy,{children:[(0,K.jsxs)(fy,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Inbox`}),(0,K.jsx)(`h1`,{className:`mt-2 text-3xl font-semibold tracking-tight`,children:`Workspaces that need attention`}),(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`Only actionable workspaces appear here. Recovery states, rebase workflows, and review handoffs stay in the inbox so active or idle worktrees do not create noise.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,K.jsx)(Q,{asChild:!0,variant:`outline`,children:(0,K.jsx)(Z,{href:`/workspaces`,children:`Open full inventory`})}),(0,K.jsxs)(Q,{variant:`outline`,onClick:se,disabled:o||x,children:[(0,K.jsx)(Dm,{className:`mr-2 h-4 w-4`}),`Refresh inbox`]})]})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 md:grid-cols-4`,children:[(0,K.jsx)(bM,{label:`Needs attention`,value:String(R.total)}),(0,K.jsx)(bM,{label:`Recovery`,value:String(R.recovery)}),(0,K.jsx)(bM,{label:`Rebase`,value:String(R.rebase)}),(0,K.jsx)(bM,{label:`Review`,value:String(R.review)})]}),(0,K.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:Qj(e.isAuthenticated,e.sessions)}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:`The inbox excludes healthy active and idle workspaces.`})]})]}),i?(0,K.jsx)(`section`,{className:`rounded-3xl border border-error/30 bg-error/10 p-4 text-sm text-error`,children:i}):null,(0,K.jsx)(xM,{title:`Needs attention`,icon:Wm,empty:`No workspaces currently need attention.`,workspaces:L,artifactByPath:A,reviewByPath:k,executionContextsBySessionId:z,pendingAction:c,onAction:ue,onOpenInEditor:(e,t)=>le(e,t,`Opened ${e.path} in the configured editor.`),onSaveNote:de,pendingNotePath:u,feedbackByWorkspacePath:f,selectedWorkspacePath:E,reviewPendingArtifactId:w.pendingArtifactId,onCreatePullRequest:fe,onLinkPullRequest:pe,highlightReasons:!0})]}):(0,K.jsxs)(dy,{children:[(0,K.jsxs)(fy,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Workspace lifecycle`}),(0,K.jsx)(`h1`,{className:`mt-2 text-3xl font-semibold tracking-tight`,children:`Provisioning and worktree control`}),(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-foreground-muted`,children:"This surface keeps `packages/agent-mux/webui` as the browser shell while inventory and lifecycle actions are derived from agent-mux session `cwd` values, Babysitter run discovery, and git worktree state."})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,K.jsx)(Q,{asChild:!0,variant:`primary`,children:(0,K.jsx)(Z,{href:`/workspaces/new`,children:`Provision workspace`})}),(0,K.jsxs)(Q,{variant:`outline`,onClick:se,disabled:o||x,children:[(0,K.jsx)(Dm,{className:`mr-2 h-4 w-4`}),`Refresh inventory`]})]})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 md:grid-cols-5`,children:[(0,K.jsx)(bM,{label:`Known workspaces`,value:String(O.total)}),(0,K.jsx)(bM,{label:`Active`,value:String(O.active)}),(0,K.jsx)(bM,{label:`Idle`,value:String(O.idle)}),(0,K.jsx)(bM,{label:`Archived`,value:String(O.archived)}),(0,K.jsx)(bM,{label:`Missing`,value:String(O.missing)})]}),(0,K.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:Qj(e.isAuthenticated,e.sessions,j)}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:[e.sessions.length,` live session`,e.sessions.length===1?``:`s`,` attached`]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:`Cleanup only unlocks for archived worktrees with no active sessions or pending runs.`})]})]}),i?(0,K.jsx)(`section`,{className:`rounded-3xl border border-error/30 bg-error/10 p-4 text-sm text-error`,children:i}):null,(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`workspace-sidebar-surface`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Workspace sidebar`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:`Search, group, pin, and triage workspaces`}),(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`The sidebar keeps mixed workspace state visible: pinned rows, runtime and dev-server status, linked PR state, archive and recovery actions, and search-driven filtering without hiding what changed.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(Q,{type:`button`,variant:g===`grouped`?`primary`:`outline`,size:`sm`,onClick:()=>_(`grouped`),"aria-pressed":g===`grouped`,children:`Grouped`}),(0,K.jsx)(Q,{type:`button`,variant:g===`flat`?`primary`:`outline`,size:`sm`,onClick:()=>_(`flat`),"aria-pressed":g===`flat`,children:`Flat`})]})]}),(0,K.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-3`,children:[(0,K.jsxs)(`label`,{className:`relative min-w-[260px] flex-1`,children:[(0,K.jsx)(Am,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-foreground-muted`}),(0,K.jsx)(`input`,{value:v,onChange:e=>b(e.target.value),placeholder:`Search workspaces, branches, issues, or ownership`,"aria-label":`Workspace search`,className:`h-11 w-full rounded-2xl border border-border bg-background pl-10 pr-3 text-sm outline-none transition focus:border-primary/40`})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-sm text-foreground-muted`,children:[N.length,` visible`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-sm text-foreground-muted`,children:[P.pinned.length,` pinned`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-sm text-foreground-muted`,children:[L.length,` need attention`]}),F>0?(0,K.jsxs)(`span`,{className:`rounded-full border border-warning/20 bg-warning/10 px-3 py-1.5 text-sm text-warning`,children:[F,` hidden by search`]}):null]}),o&&j.length===0?(0,K.jsx)(`div`,{className:`mt-5 rounded-2xl border border-border bg-background/70 p-4 text-sm text-foreground-muted`,children:`Loading workspace sidebar…`}):null,!o&&N.length===0?(0,K.jsx)(`div`,{className:`mt-5 rounded-2xl border border-border bg-background/70 p-4 text-sm text-foreground-muted`,children:I}):null,!o&&N.length>0?(0,K.jsx)(`div`,{className:`mt-5 space-y-4`,children:g===`flat`?(0,K.jsx)(xM,{title:`Workspace list`,icon:Xp,empty:I,workspaces:N,reviewByPath:k,artifactByPath:A,executionContextsBySessionId:z,pendingAction:c,onAction:ue,onOpenInEditor:(e,t)=>le(e,t,`Opened ${e.path} in the configured editor.`),onSaveNote:de,pendingNotePath:u,feedbackByWorkspacePath:f,selectedWorkspacePath:E,reviewPendingArtifactId:w.pendingArtifactId,onCreatePullRequest:fe,onLinkPullRequest:pe,highlightReasons:!0}):(0,K.jsxs)(MO,{type:`multiple`,defaultValue:[`pinned`,`active`,`idle`,`archived`,`missing`],className:`space-y-4`,children:[P.pinned.length>0?(0,K.jsxs)(NO,{value:`pinned`,className:`rounded-3xl border border-border bg-background/50 px-4`,children:[(0,K.jsxs)(PO,{className:`rounded-2xl px-2`,children:[`Pinned workspaces (`,P.pinned.length,`)`]}),(0,K.jsx)(FO,{className:`border-0 px-0 pt-0`,children:(0,K.jsx)(xM,{title:`Pinned workspaces`,icon:xm,empty:`No pinned workspaces match the current sidebar filters.`,workspaces:P.pinned,reviewByPath:k,artifactByPath:A,executionContextsBySessionId:z,pendingAction:c,onAction:ue,onOpenInEditor:(e,t)=>le(e,t,`Opened ${e.path} in the configured editor.`),onSaveNote:de,pendingNotePath:u,feedbackByWorkspacePath:f,selectedWorkspacePath:E,reviewPendingArtifactId:w.pendingArtifactId,onCreatePullRequest:fe,onLinkPullRequest:pe,highlightReasons:!0})})]}):null,[{key:`active`,title:`Active workspaces`,icon:Xp,empty:`No active workspaces are currently visible.`,workspaces:P.active},{key:`idle`,title:`Idle workspaces`,icon:Zm,empty:`No idle workspaces are currently visible.`,workspaces:P.idle},{key:`archived`,title:`Archived workspaces`,icon:bp,empty:`No archived workspaces are currently visible.`,workspaces:P.archived},{key:`missing`,title:`Recovery queue`,icon:Wm,empty:`No missing workspaces are currently visible.`,workspaces:P.missing}].map(e=>(0,K.jsxs)(NO,{value:e.key,className:`rounded-3xl border border-border bg-background/50 px-4`,children:[(0,K.jsxs)(PO,{className:`rounded-2xl px-2`,children:[e.title,` (`,e.workspaces.length,`)`]}),(0,K.jsx)(FO,{className:`border-0 px-0 pt-0`,children:(0,K.jsx)(xM,{title:e.title,icon:e.icon,empty:e.empty,workspaces:e.workspaces,reviewByPath:k,artifactByPath:A,executionContextsBySessionId:z,pendingAction:c,onAction:ue,onOpenInEditor:(e,t)=>le(e,t,`Opened ${e.path} in the configured editor.`),onSaveNote:de,pendingNotePath:u,feedbackByWorkspacePath:f,selectedWorkspacePath:E,reviewPendingArtifactId:w.pendingArtifactId,onCreatePullRequest:fe,onLinkPullRequest:pe,highlightReasons:!0})})]},e.key))]})}):null]}),(0,K.jsx)(jx,{title:`Workspace diff and approval handoff`,description:`Workspace review is fed by the same shared artifact model as issue review, so lifecycle cards and diff actions stay in sync.`,empty:`No workspace reviews are queued yet.`,loading:w.loading,error:w.error,artifacts:w.artifacts,queue:w.queue,summary:w.summary,pendingArtifactId:w.pendingArtifactId,onApprove:e=>w.actOnReview({action:`approve`,artifactId:e}).then(()=>se()),onRequestChanges:e=>w.actOnReview({action:`request-changes`,artifactId:e}).then(()=>se()),onSubmitReview:e=>w.actOnReview({action:`submit-review`,...e}).then(()=>se()),onAddComment:e=>w.actOnReview({action:`add-comment`,...e}).then(()=>se())})]})}function bM(e){return(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsx)(`p`,{className:`text-xs uppercase tracking-[0.2em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`p`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:e.value})]})}function xM(e){let t=e.icon;return(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-2xl border border-primary/20 bg-primary/10 text-primary`,children:(0,K.jsx)(t,{className:`h-4 w-4`})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:e.title}),(0,K.jsxs)(`p`,{className:`text-sm text-foreground-muted`,children:[e.workspaces.length,` tracked`]})]})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4`,children:[e.workspaces.map(t=>{let n=e.highlightReasons?mM(t):[],r=`pin:${t.path}`,i=`unpin:${t.path}`,a=`archive:${t.path}`,o=`cleanup:${t.path}`,s=`recover:${t.path}`,c=t.sessions.items.find(e=>e.status===`active`&&e.runtime)??t.sessions.items.find(e=>e.runtime),l=e.reviewByPath.get(t.path)??t.review,u=e.artifactByPath.get(t.path),d=u?.linkedPullRequest,f=u?.integration,p=gM(t,c??null,d),m=e.selectedWorkspacePath===t.path;return(0,K.jsxs)(`article`,{"data-workspace-path":t.path,className:Y(`rounded-2xl border bg-background/70 p-4`,m?`border-primary/40 ring-1 ring-primary/20`:`border-border`),children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`strong`,{className:`text-base`,children:t.name}),p.map(e=>(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-xs`,e.className),children:e.label},`${t.path}:${e.label}`)),t.git.branch?(0,K.jsx)(`span`,{className:`rounded-full border border-info/20 bg-info/10 px-2 py-0.5 text-xs text-info`,children:t.git.branch}):null,t.rebase?(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-xs`,cM(t.rebase.status)),children:lM(t.rebase.status)}):null,l?(0,K.jsxs)(`span`,{className:`rounded-full border border-primary/20 bg-primary/10 px-2 py-0.5 text-xs text-primary`,children:[l.decision,` · `,l.openCommentCount,` open`]}):null,d?(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[pM(d.provider),` PR `,d.status.replace(/-/g,` `)]}):null]}),(0,K.jsx)(`p`,{className:`mt-2 font-mono text-xs text-foreground-muted`,title:t.path,children:qj(t.path)}),eM(t)?(0,K.jsxs)(`p`,{className:`mt-2 text-sm text-foreground-muted`,children:[`Owned by `,(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:eM(t)})]}):null,n.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:n.map(e=>(0,K.jsx)(`span`,{className:`rounded-full border border-warning/20 bg-warning/10 px-2 py-0.5 text-xs text-warning`,children:e},`${t.path}:${e}`))}):null]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(Q,{variant:`ghost`,size:`sm`,onClick:()=>e.onAction(t.pinnedAt?`unpin`:`pin`,t),disabled:t.pinnedAt?!t.actions.canUnpin||e.pendingAction===i:!t.actions.canPin||e.pendingAction===r,children:[t.pinnedAt?(0,K.jsx)(bm,{className:`mr-2 h-4 w-4`}):(0,K.jsx)(xm,{className:`mr-2 h-4 w-4`}),t.pinnedAt?`Unpin`:`Pin`]}),(0,K.jsxs)(Q,{variant:`ghost`,size:`sm`,onClick:()=>e.onAction(`archive`,t),disabled:!t.actions.canArchive||e.pendingAction===a,children:[(0,K.jsx)(bp,{className:`mr-2 h-4 w-4`}),`Archive`]}),(0,K.jsxs)(Q,{variant:`ghost`,size:`sm`,onClick:()=>e.onAction(`recover`,t),disabled:!t.actions.canRecover||e.pendingAction===s,children:[(0,K.jsx)(Om,{className:`mr-2 h-4 w-4`}),`Recover`]}),(0,K.jsxs)(Q,{variant:`ghost`,size:`sm`,onClick:()=>e.onAction(`cleanup`,t),disabled:!t.actions.canCleanup||e.pendingAction===o,children:[(0,K.jsx)(Um,{className:`mr-2 h-4 w-4`}),`Cleanup`]}),(0,K.jsx)(Q,{asChild:!0,variant:`outline`,size:`sm`,children:(0,K.jsx)(Z,{href:Jj(t.path),children:`Open shell`})})]})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2 xl:grid-cols-4`,children:[(0,K.jsx)(SM,{label:`Sessions`,value:`${t.sessions.active}/${t.sessions.total}`}),(0,K.jsx)(SM,{label:`Runs`,value:`${t.runs.active}/${t.runs.total}`}),(0,K.jsx)(SM,{label:`Git`,value:t.git.isPrimary?`primary`:t.git.isWorktree?`worktree`:`repo`}),(0,K.jsx)(SM,{label:`Changes`,value:t.git.dirty==null?`unknown`:t.git.dirty?`dirty`:`clean`})]}),(t.issues??[]).length>0?(0,K.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:(t.issues??[]).map(e=>(0,K.jsx)(Z,{href:$j(t,e.issueId),className:`rounded-full border border-border px-2.5 py-1 text-xs text-primary`,children:e.issueKey},`${t.path}-${e.issueId}`))}):null,(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-3 text-sm text-foreground-muted`,children:[t.sessions.items.slice(0,2).map(e=>(0,K.jsxs)(Z,{href:`/sessions/${e.sessionId}`,className:`text-primary`,children:[`Session `,e.sessionId]},e.sessionId)),t.sessions.items.length>2?(0,K.jsxs)(`span`,{children:[`+`,t.sessions.items.length-2,` more sessions`]}):null,t.git.root?(0,K.jsxs)(`span`,{children:[`Root: `,qj(t.git.root)]}):null]}),(0,K.jsxs)(`p`,{className:`mt-3 text-xs text-foreground-muted`,children:[`Last activity: `,Kj(t.lastActivityAt),t.archivedAt?` · archived ${Kj(t.archivedAt)}`:``,t.cleanedAt?` · cleaned ${Kj(t.cleanedAt)}`:``]}),f||d?(0,K.jsxs)(`section`,{className:`mt-4 rounded-2xl border border-border bg-card/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:`Linked review state`}),(0,K.jsx)(`h3`,{className:`mt-1 text-sm font-semibold text-foreground`,children:d?`${pM(d.provider)} PR ${d.number?`#${d.number}`:``} ${d.linkState===`partially-linked`?`is partially linked`:`is linked`}`:`Integration prerequisites are affecting linked review state`})]}),f?(0,K.jsx)(`span`,{className:Y(`rounded-full border px-2 py-0.5 text-xs`,fM(f.status)),children:f.status.replace(/-/g,` `)}):null]}),d?.title?(0,K.jsx)(`p`,{className:`mt-2 text-sm text-foreground`,children:d.title}):null,(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:f?.guidance??d?.guidance??`No additional linked review guidance.`})]}):null,(0,K.jsxs)(`div`,{className:Y(`mt-5 grid gap-4`,c?.runtime?`xl:grid-cols-[minmax(0,1fr)_360px]`:``),children:[c?.runtime?(0,K.jsx)(BA,{className:`border-border/70 bg-card/70`,runtime:c.runtime,rebase:t.rebase,sessionId:c.sessionId,sessionStatus:c.status,executionContexts:e.executionContextsBySessionId.get(c.sessionId)??[]}):null,(0,K.jsx)(WO,{workspace:t,runtime:c?.runtime,reviewArtifact:u,sessionId:c?.sessionId,sessionStatus:c?.status,pendingAction:e.pendingAction,notesSaving:e.pendingNotePath===t.path,reviewPending:e.reviewPendingArtifactId===u?.id,feedback:e.feedbackByWorkspacePath[t.path]??null,onAction:e.onAction,onOpenInEditor:e.onOpenInEditor,onSaveNote:e.onSaveNote,onCreatePullRequest:(t,n)=>e.onCreatePullRequest(t,u,n),onLinkPullRequest:(t,n)=>e.onLinkPullRequest(t,u,n)})]})]},t.path)}),e.workspaces.length===0?(0,K.jsx)(`p`,{className:`text-sm text-foreground-muted`,children:e.empty}):null]})]})}function SM(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card px-3 py-2`,children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`p`,{className:`mt-1 text-sm font-medium`,children:e.value})]})}function CM(e=5e3,t=!1){let{data:n,loading:r,error:i,refresh:a}=$v(`/api/runs?mode=projects`,{interval:e,sseFilter:e=>e.type===`update`||e.type===`new-run`,suppressSseRefetch:t});return{projects:n?.projects||[],recentCompletionWindowMs:n?.recentCompletionWindowMs??144e5,loading:r,error:i,refresh:a}}var wM=5e3,TM=3e3;function EM(e={}){let{sseFilter:t,onFlush:n,enabled:r=!0}=e,[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(0),c=(0,y.useRef)([]),l=(0,y.useRef)(!1),u=(0,y.useRef)(null),d=(0,y.useRef)(t);d.current=t;let f=(0,y.useRef)(n);f.current=n;let p=(0,y.useCallback)(()=>{l.current=!1,a(!1),s(0),c.current=[],u.current&&=(clearTimeout(u.current),null),f.current?.()},[]),m=(0,y.useCallback)(()=>{l.current&&p()},[p]);return(0,y.useEffect)(()=>{if(!r)return;let e=Qv(e=>{if(e.type===`connected`||e.type===`disconnect`||e.type===`error`||d.current&&!d.current(e))return;let t=Date.now();c.current.push(t),c.current=c.current.filter(e=>t-e<wM),l.current?(s(e=>e+1),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{p()},TM)):c.current.length>=10&&(l.current=!0,a(!0),s(c.current.length),u.current=setTimeout(()=>{p()},TM))});return()=>{e(),u.current&&=(clearTimeout(u.current),null)}},[r,p]),{active:i,bufferedCount:o,flush:m}}function DM(){let e=(0,y.useRef)(()=>{}),t=EM({sseFilter:(0,y.useCallback)(e=>e.type===`update`||e.type===`new-run`,[]),onFlush:()=>e.current()}),{projects:n,recentCompletionWindowMs:r,loading:i,error:a,refresh:o}=CM(5e3,t.active);e.current=o;let[s,c]=(0,y.useState)(`all`),[l,u]=ux(`sort-mode`,`status`),[d,f]=ux(`banner-dismissed-fingerprint`,null),p=(0,y.useCallback)(e=>{c(t=>t===e?`all`:e)},[]),m=(0,y.useCallback)(e=>{o()},[o]),h=(0,y.useMemo)(()=>({totalRuns:n.reduce((e,t)=>e+t.totalRuns,0),activeRuns:n.reduce((e,t)=>e+t.activeRuns,0),completedRuns:n.reduce((e,t)=>e+t.completedRuns,0),failedRuns:n.reduce((e,t)=>e+t.failedRuns,0),staleRuns:n.reduce((e,t)=>e+t.staleRuns,0),totalTasks:n.reduce((e,t)=>e+t.totalTasks,0),completedTasks:n.reduce((e,t)=>e+t.completedTasksAggregate,0)}),[n]),g=(0,y.useMemo)(()=>n.flatMap(e=>e.breakpointRuns??[]),[n]),_=(0,y.useMemo)(()=>({totalProjects:n.length,activeRuns:h.activeRuns,failedRuns:h.failedRuns,completedRuns:h.completedRuns,staleRuns:h.staleRuns,pendingBreakpoints:n.reduce((e,t)=>e+t.pendingBreakpoints,0)}),[n,h]),v=`${_.failedRuns}-${_.staleRuns}-${_.pendingBreakpoints}`,b=d===v,x=(0,y.useMemo)(()=>({all:h.totalRuns,waiting:h.activeRuns,stale:h.staleRuns,completed:h.completedRuns,failed:h.failedRuns,pending:0}),[h]),S=(0,y.useMemo)(()=>s===`all`?n:s===`stale`?n.filter(e=>e.staleRuns>0):n.filter(e=>s===`waiting`?e.activeRuns>0:s===`completed`?e.completedRuns>0:s===`failed`?e.failedRuns>0:!1),[n,s]),C=s===`stale`?`all`:s,{activeProjects:w,historyProjects:T}=(0,y.useMemo)(()=>{let e=Date.now();if(l===`activity`){let t=1440*60*1e3;return{activeProjects:S.filter(n=>e-new Date(n.latestUpdate).getTime()<t),historyProjects:S.filter(n=>e-new Date(n.latestUpdate).getTime()>=t)}}return{activeProjects:S.filter(t=>t.activeRuns>0||t.staleRuns>0||e-new Date(t.latestUpdate).getTime()<r),historyProjects:S.filter(t=>t.activeRuns===0&&t.staleRuns===0&&e-new Date(t.latestUpdate).getTime()>=r)}},[S,r,l]),[E,D]=ux(`history-collapsed`,T.length>5);return{projects:n,loading:i,error:a,metrics:h,allBreakpointRuns:g,summaryMetrics:_,bannerFingerprint:v,bannerDismissed:b,filterCounts:x,filteredProjects:S,activeProjects:w,historyProjects:T,statusFilter:s,sortMode:l,historyCollapsed:E,cardStatusFilter:C,hasStaleRuns:h.staleRuns>0,catchUp:t,setStatusFilter:c,setSortMode:u,setHistoryCollapsed:D,setDismissedFingerprint:f,toggleMetricFilter:p,handleHideProject:m}}function OM(e){if(!(!e||typeof e!=`object`))return e}function kM(){return(0,K.jsx)(my,{})}function AM(){return(0,K.jsx)(sb,{})}function jM(){return(0,K.jsx)(Eb,{})}function MM(){let{projectId:e=``}=He();return(0,K.jsx)(dy,{className:`gap-0`,children:(0,K.jsx)(ES,{projectId:e,routeBasePath:`/projects/${e}`,forcedPresentation:`board`})})}function NM(){let{projectId:e=``}=He();return(0,K.jsx)(dy,{className:`gap-0`,children:(0,K.jsx)(ES,{projectId:e,routeBasePath:`/projects/${e}`,forcedPresentation:`list`})})}function PM(){let{projectId:e=``,issueId:t=``}=He();return(0,K.jsx)(ES,{routeMode:`issue`,initialProjectId:e,initialIssueId:t})}function FM(){let{issueId:e=``}=He();return(0,K.jsx)(ES,{routeMode:`issue`,initialIssueId:e})}function IM(){let{projectId:e=``}=He();return(0,K.jsx)(ES,{routeMode:`create`,initialProjectId:e})}function LM(){let{projectId:e=``}=He();return(0,K.jsx)(SD,{mode:`project`,projectId:e})}function RM(){let{projectId:e=``,issueId:t=``}=He();return(0,K.jsx)(SD,{mode:`issue`,projectId:e,issueId:t})}function zM(){return(0,K.jsx)(SD,{mode:`host`})}function BM(){let{isAuthenticated:e}=dd(),{projects:t,loading:n,error:r,metrics:i,allBreakpointRuns:a,summaryMetrics:o,bannerFingerprint:s,bannerDismissed:c,filterCounts:l,filteredProjects:u,activeProjects:d,historyProjects:f,statusFilter:p,sortMode:m,historyCollapsed:h,cardStatusFilter:g,hasStaleRuns:_,catchUp:v,setStatusFilter:y,setSortMode:b,setHistoryCollapsed:x,setDismissedFingerprint:S,toggleMetricFilter:C,handleHideProject:w}=DM(),T=!n&&!r&&t.length>0;return(0,K.jsxs)(dy,{children:[(0,K.jsxs)(py,{children:[(0,K.jsxs)(fy,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Execution overlays`}),(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(Bd,{className:`h-6 w-auto`})}),(0,K.jsx)(`h1`,{className:`mt-2 text-3xl font-semibold tracking-tight`,children:`Runs stay visible without replacing the planning workspace`}),(0,K.jsx)(`p`,{className:`mt-3 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`The project board now owns the main journey. This route keeps Babysitter runs, approvals, search, and status triage available as an execution dashboard.`}),(0,K.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-3`,children:[(0,K.jsx)(Q,{asChild:!0,variant:`primary`,children:(0,K.jsx)(Z,{href:`/projects`,children:`Open projects`})}),(0,K.jsx)(Q,{asChild:!0,variant:`outline`,children:(0,K.jsx)(Z,{href:`/sessions/new`,children:`Start session`})}),(0,K.jsx)(Q,{asChild:!0,variant:`outline`,children:(0,K.jsx)(Z,{href:`/workspaces`,children:`Open workspaces`})}),(0,K.jsx)(Q,{asChild:!0,variant:`ghost`,children:(0,K.jsx)(Z,{href:`/inbox`,children:`Open inbox`})})]})]}),(0,K.jsxs)(fy,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Gateway`}),(0,K.jsx)(`h2`,{className:`mt-2 text-xl font-semibold tracking-tight`,children:e?`agent-mux connected`:`agent-mux disconnected`}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:e?`Live sessions and workspace attention are available now.`:`Connect the gateway to enable session creation, chat continuation, and live workspace context from the same app.`}),(0,K.jsx)(`div`,{className:`mt-5`,children:(0,K.jsx)(Q,{asChild:!0,variant:`outline`,children:(0,K.jsx)(Z,{href:e?`/sessions`:`/login`,children:e?`Open sessions`:`Connect gateway`})})})]})]}),(0,K.jsx)(sx,{}),(0,K.jsx)(VS,{}),T?(0,K.jsx)(KS,{section:`Executive Summary`,children:(0,K.jsx)(LS,{metrics:o,onFilterChange:y,dismissed:c,onDismiss:()=>S(s)})}):null,T?(0,K.jsx)(KS,{section:`KPI Metrics`,children:(0,K.jsx)(GS,{metrics:i,statusFilter:p,hasStaleRuns:_,onToggleFilter:C})}):null,v.active?(0,K.jsx)(PS,{catchUp:v,summary:{failedRuns:o.failedRuns,completedRuns:o.completedRuns,pendingBreakpoints:o.pendingBreakpoints}}):null,!n&&!r&&a.length>0?(0,K.jsx)(KS,{section:`Breakpoint Banner`,children:(0,K.jsx)(`div`,{className:`sticky top-0 z-40`,children:(0,K.jsx)(MS,{breakpointRuns:a})})}):null,(0,K.jsx)(_D,{statusFilter:p,onStatusFilterChange:y,filterCounts:l,sortMode:m,onSortModeToggle:()=>b(e=>e===`status`?`activity`:`status`),filteredProjectCount:u.length}),(0,K.jsx)(hD,{loading:n,error:r,filteredProjects:u,activeProjects:d,historyProjects:f,statusFilter:p,sortMode:m,cardStatusFilter:g,historyCollapsed:h,onHistoryCollapsedChange:x,onHideProject:w})]})}function VM(){return(0,K.jsx)(qb,{children:(0,K.jsx)(HM,{})})}function HM(){let[e]=Nt(),t=e.get(`workspace`),n=fd(),{store:r}=Mn(),i=Pn(r,Hn(e=>Object.values(e.sessions.byId))),a=Pn(r,Hn(e=>Object.values(e.runs.byId))),o=Pn(r,e=>e.events.byRunId),s=(0,y.useMemo)(()=>i.flatMap(e=>{let t=typeof e.sessionId==`string`?e.sessionId:``,n=typeof e.agent==`string`?e.agent:``,r=e.status===`active`?`active`:`inactive`;return!t||!n?[]:[{sessionId:t,agent:n,status:r,cwd:typeof e.cwd==`string`?e.cwd:void 0,title:typeof e.title==`string`?e.title:void 0,updatedAt:typeof e.updatedAt==`number`?e.updatedAt:void 0,activeRunId:typeof e.activeRunId==`string`?e.activeRunId:null,latestRunId:typeof e.latestRunId==`string`?e.latestRunId:null,runtime:OM(e.runtime)}]}),[i]);async function c(e){let t=await n(`/api/v1/sessions/${e.sessionId}/messages`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({prompt:e.prompt,agent:e.agent,model:e.model,attachments:e.attachments,approvalMode:e.approvalMode})});if(!t.ok)throw Error(`Gateway request failed: ${t.status}`);let i=await t.json();i.run?.runId&&r.getState().actions.mergeRun(String(i.run.runId),i.run),i.session?.sessionId&&r.getState().actions.mergeSession(String(i.session.sessionId),i.session)}return(0,K.jsx)(yM,{isAuthenticated:!0,sessions:s,selectedWorkspacePath:t,allRuns:a,eventBuffers:o,onSendPrompt:c})}function UM(){return(0,K.jsx)(qb,{children:(0,K.jsx)(WM,{})})}function WM(){let{store:e}=Mn(),t=Pn(e,Hn(e=>Object.values(e.sessions.byId)));return(0,K.jsx)(yM,{isAuthenticated:!0,sessions:(0,y.useMemo)(()=>t.flatMap(e=>{let t=typeof e.sessionId==`string`?e.sessionId:``,n=typeof e.agent==`string`?e.agent:``,r=e.status===`active`?`active`:`inactive`;return!t||!n?[]:[{sessionId:t,agent:n,status:r,cwd:typeof e.cwd==`string`?e.cwd:void 0,title:typeof e.title==`string`?e.title:void 0,updatedAt:typeof e.updatedAt==`number`?e.updatedAt:void 0,activeRunId:typeof e.activeRunId==`string`?e.activeRunId:null,latestRunId:typeof e.latestRunId==`string`?e.latestRunId:null,runtime:OM(e.runtime)}]}),[t]),mode:`attention`})}function GM(){let{auth:e,logout:t}=dd(),{mode:n,toggle:r}=xd();return(0,K.jsxs)(`section`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Settings`})}),(0,K.jsx)(Qu,{}),(0,K.jsxs)(`div`,{className:`settings-grid`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:`Gateway`}),(0,K.jsx)(`p`,{children:e?.gatewayUrl??`not connected`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:`Theme`}),(0,K.jsxs)(jd,{type:`button`,onClick:r,children:[`Toggle to `,n===`light`?`dark`:`light`]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:`Token`}),(0,K.jsx)(jd,{type:`button`,variant:`ghost`,onClick:t,children:`Forget saved token`})]})]})]})}var KM=s(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),qM=s((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),JM=s((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),YM=s(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),XM=s(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),ZM=s((e=>{var t=qM().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),QM=s((e=>{var t=qM().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),$M=s((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),eN=s((e=>{var t=JM(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),tN=s((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),nN=s((e=>{var t=tN();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),rN=s(((e,t)=>{var n=nN();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),iN=s((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),aN=s((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
|
|
75
|
+
]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^`+t+`$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),oN=s((e=>{var t=iN(),n=aN();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),sN=s((e=>{var t=qM(),n=eN(),r=JM(),i=oN(),a=iN(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),cN=s((e=>{var t=qM(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),lN=s(((e,t)=>{var n=oN();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),uN=s(((e,t)=>{var n=oN(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),dN=s(((e,t)=>{var n=oN();function r(e){this.mode=n.BYTE,typeof e==`string`?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),fN=s(((e,t)=>{var n=oN(),r=qM();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
|
|
76
|
+
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),pN=s(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),mN=s((e=>{var t=oN(),n=lN(),r=uN(),i=dN(),a=fN(),o=aN(),s=qM(),c=pN();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
|
|
77
|
+
Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),hN=s((e=>{var t=qM(),n=JM(),r=YM(),i=XM(),a=ZM(),o=QM(),s=$M(),c=eN(),l=rN(),u=sN(),d=cN(),f=oN(),p=mN();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
|
|
78
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
79
|
+
Minimum version required to store current data is: `+c+`.
|
|
80
|
+
`);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),gN=s((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||={};let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[+!!a[t*i+r]]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),_N=s((e=>{var t=gN();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),vN=s((e=>{var t=gN();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
|
|
81
|
+
`;return typeof a==`function`&&a(null,p),p}})),yN=u(s((e=>{var t=KM(),n=hN(),r=_N(),i=vN();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})}))(),1);async function bN(e){await navigator.clipboard.writeText(e)}function xN(){return Array.from({length:8},()=>Math.floor(Math.random()*10)).join(``)}function SN(){let{auth:e}=dd(),t=fd(),[n]=(0,y.useState)(()=>xN()),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)(null),s=(0,y.useMemo)(()=>JSON.stringify({url:e?.gatewayUrl,token:e?.token}),[e?.gatewayUrl,e?.token]);return(0,y.useEffect)(()=>{yN.toDataURL(s,{margin:1,width:256}).then(i)},[s]),(0,y.useEffect)(()=>{e&&t(`/api/v1/pairing/register`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({code:n,url:e.gatewayUrl,token:e.token})}).then(e=>e.json()).then(e=>o(e.expiresAt))},[e,n,t]),(0,K.jsxs)(`section`,{className:`pairing-layout`,children:[(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Direct QR pairing`})}),(0,K.jsx)(`p`,{children:`Scan this from a phone to attach immediately with the current token.`}),r?(0,K.jsx)(`img`,{className:`qr`,src:r,alt:`Pairing QR code`}):(0,K.jsx)(`p`,{children:`Rendering QR…`})]}),(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Short code pairing`})}),(0,K.jsx)(`p`,{children:`Use this for TV and no-camera flows. Codes expire after five minutes and are consumed once.`}),(0,K.jsx)(`div`,{className:`pairing-code`,children:n}),(0,K.jsxs)(`div`,{className:`actions`,children:[(0,K.jsx)(jd,{type:`button`,onClick:()=>void bN(n),children:`Copy code`}),(0,K.jsx)(jd,{type:`button`,variant:`ghost`,onClick:()=>void bN(s),children:`Copy QR payload`})]}),(0,K.jsx)(`p`,{children:a?`Expires at ${new Date(a).toLocaleTimeString()}`:`Registering code…`})]})]})}function CN(){let e=fd(),[t,n]=(0,y.useState)([]),[r,i]=(0,y.useState)(!0),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(`session-workspace`),[d,f]=(0,y.useState)(`worktree`),[p,m]=(0,y.useState)(``);async function h(){i(!0),c(null);try{let t=await e(`/api/v1/workspaces`);if(!t.ok)throw Error(`Gateway request failed: ${t.status}`);n((await t.json()).workspaces??[])}catch(e){c(e instanceof Error?e.message:String(e))}finally{i(!1)}}(0,y.useEffect)(()=>{h()},[]);async function g(t){t.preventDefault();let n=p.split(`
|
|
82
|
+
`).map(e=>e.trim()).filter(Boolean);if(!(!l.trim()||n.length===0)){o(!0),c(null);try{let t=await e(`/api/v1/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`create`,name:l,mode:d,repos:n.map(e=>({path:e}))})});if(!t.ok)throw Error(`Workspace creation failed: ${t.status}`);m(``),await h()}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}}async function _(t,n){o(!0),c(null);try{let r=await e(`/api/v1/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:n,workspaceId:t,force:n===`delete`})});if(!r.ok)throw Error(`Workspace action failed: ${r.status}`);await h()}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}return(0,K.jsxs)(`section`,{className:`flow-grid`,children:[(0,K.jsxs)(`article`,{className:`panel hero-panel`,children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`Workspaces`}),(0,K.jsx)(`h2`,{children:`Stage temp directories, worktrees, and linked repos`}),(0,K.jsxs)(`p`,{className:`lede`,children:[`Workspaces live under `,(0,K.jsx)(`code`,{children:`~/.a5c/workspaces`}),` and can bind directly to live sessions.`]})]}),(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Create workspace`})}),(0,K.jsxs)(`form`,{className:`stack`,onSubmit:g,children:[(0,K.jsx)(Pd,{label:`Name`,children:(0,K.jsx)(`input`,{value:l,onChange:e=>u(e.target.value)})}),(0,K.jsx)(Pd,{label:`Mode`,children:(0,K.jsx)(Rd,{value:d,onChange:e=>f(e===`symlink`?`symlink`:`worktree`),options:[{label:`Git worktrees`,value:`worktree`},{label:`Symbolic links`,value:`symlink`}]})}),(0,K.jsx)(Pd,{label:`Repo paths`,children:(0,K.jsx)(Nd,{value:p,onChange:e=>m(e.target.value),rows:5,placeholder:`/abs/path/to/repo-one
|
|
83
|
+
/abs/path/to/repo-two`})}),s?(0,K.jsx)(`p`,{className:`error-banner`,children:s}):null,(0,K.jsx)(`div`,{className:`actions`,children:(0,K.jsx)(jd,{type:`submit`,variant:`primary`,loading:a,disabled:a,children:`Create workspace`})})]})]}),(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Tracked workspaces`})}),r?(0,K.jsx)(`p`,{className:`muted-copy`,children:`Loading workspaces…`}):null,!r&&t.length===0?(0,K.jsx)(`p`,{className:`muted-copy`,children:`No workspaces have been created yet.`}):null,(0,K.jsx)(`div`,{className:`stack`,children:t.map(e=>(0,K.jsx)(`article`,{className:`panel panel-muted`,children:(0,K.jsxs)(`div`,{className:`stack`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:e.name}),` `,(0,K.jsxs)(`span`,{className:`muted-copy`,children:[`(`,e.id,`)`]})]}),(0,K.jsx)(`p`,{className:`muted-copy`,children:e.defaultCwd}),e.defaultCwd===e.rootPath?null:(0,K.jsxs)(`p`,{className:`muted-copy`,children:[`root: `,e.rootPath]}),(0,K.jsxs)(`p`,{className:`muted-copy`,children:[e.status,` · `,e.mode,` · `,e.sessions.length,` session`,e.sessions.length===1?``:`s`]}),(0,K.jsxs)(`div`,{className:`actions`,children:[(0,K.jsx)(jd,{variant:`default`,disabled:a,onClick:()=>void _(e.id,`archive`),children:`Archive`}),(0,K.jsx)(jd,{variant:`default`,disabled:a,onClick:()=>void _(e.id,`cleanup`),children:`Cleanup`}),(0,K.jsx)(jd,{variant:`default`,disabled:a,onClick:()=>void _(e.id,`recover`),children:`Recover`}),(0,K.jsx)(jd,{variant:`default`,disabled:a,onClick:()=>void _(e.id,`delete`),children:`Delete`})]})]})},e.id))})]})]})}function wN(e){let t=(0,y.useMemo)(()=>e.actions.map(e=>({id:e.id,label:e.label,onSelect:e.run})),[e.actions]);return(0,K.jsx)(zd,{open:e.open,items:t,placeholder:`Jump, toggle, start…`,onClose:e.onClose})}function TN(e){return e===`/`||e===`/projects`?`Projects`:e===`/runs`?`Runs`:e===`/automations`?`Automations`:e===`/sessions`?`Sessions`:e===`/sessions/new`?`New Session`:e.startsWith(`/sessions/pending/`)?`Creating Session`:e.startsWith(`/sessions/`)?`Session Chat`:e.startsWith(`/projects/`)?`Project`:e.startsWith(`/runs/`)?`Creating Session`:e===`/agents`?`Agents`:e===`/inbox`?`Hook Inbox`:e===`/pair-device`?`Pair Device`:e===`/workspaces`?`Workspaces`:e===`/settings`?`Settings`:e}function EN(e,t=8){return[...e].filter(e=>typeof e.sessionId==`string`&&e.sessionId.length>0).sort((e,t)=>Number(t.updatedAt??0)-Number(e.updatedAt??0)).slice(0,t).map(e=>{let t=e.sessionId,n=typeof e.title==`string`&&e.title.trim().length>0?e.title.trim():t,r=typeof e.agent==`string`&&e.agent.length>0?` · ${e.agent}`:``;return{id:`session:${t}`,label:`Open session ${n}${r}`,to:`/sessions/${t}`}})}function DN(){return(0,K.jsxs)(`aside`,{className:`sidebar`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`agent-mux`}),(0,K.jsx)(`h1`,{children:`Planning control room`})]}),(0,K.jsxs)(`nav`,{className:`nav-stack`,children:[(0,K.jsx)(Ot,{to:`/projects`,children:`Projects`}),(0,K.jsx)(Ot,{to:`/runs`,children:`Runs`}),(0,K.jsx)(Ot,{to:`/agents`,children:`Agents`}),(0,K.jsx)(Ot,{to:`/sessions`,children:`Sessions`}),(0,K.jsx)(Ot,{to:`/sessions/new`,children:`New session`}),(0,K.jsx)(Ot,{to:`/workspaces`,children:`Workspaces`}),(0,K.jsx)(Ot,{to:`/inbox`,children:`Hook inbox`}),(0,K.jsx)(Ot,{to:`/automations`,children:`Automations`}),(0,K.jsx)(Ot,{to:`/pair-device`,children:`Pair device`}),(0,K.jsx)(Ot,{to:`/settings`,children:`Settings`})]})]})}function ON(e){let t=Fn();return(0,K.jsxs)(`header`,{className:`topbar`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`Gateway`}),(0,K.jsx)(`h2`,{children:TN(e.pathname)})]}),(0,K.jsxs)(`div`,{className:`topbar-actions`,children:[(0,K.jsx)(`span`,{className:`connection-pill connection-${t.status}`,children:t.status}),(0,K.jsx)(jd,{type:`button`,size:`sm`,onClick:e.onOpenPalette,children:`Command palette`})]})]})}function kN(e){let t=t=>{(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),e.openPalette())};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)}function AN(){let e=Ie(),t=e.pathname.match(/^\/sessions\/[^/]+\/([^/?#]+)/)?.[1];return(0,K.jsx)(st,{to:t?`/sessions/${t}${e.search}`:`/sessions`,replace:!0})}function jN(e){let{isAuthenticated:t}=dd(),n=Ie();return t?(0,K.jsx)(K.Fragment,{children:e.children}):(0,K.jsx)(st,{to:`/login`,replace:!0,state:{from:n.pathname}})}function MN(){let e=Re(),t=Ie(),{store:n}=Mn(),{logout:r}=dd(),{mode:i,toggle:a}=xd(),[o,s]=(0,y.useState)(!1),c=Pn(n,Hn(e=>Object.values(e.sessions.byId))),l=(0,y.useMemo)(()=>EN(c).map(t=>({id:t.id,label:t.label,run:()=>e(t.to)})),[e,c]),u=(0,y.useMemo)(()=>[{id:`projects`,label:`Open projects`,run:()=>e(`/projects`)},{id:`runs`,label:`Open runs`,run:()=>e(`/runs`)},{id:`new-session`,label:`Start session`,run:()=>e(`/sessions/new`)},{id:`sessions`,label:`Browse sessions`,run:()=>e(`/sessions`)},{id:`workspaces`,label:`Open workspaces`,run:()=>e(`/workspaces`)},{id:`inbox`,label:`Open hook inbox`,run:()=>e(`/inbox`)},{id:`pair`,label:`Pair device`,run:()=>e(`/pair-device`)},{id:`theme`,label:`Switch to ${i===`light`?`dark`:`light`} theme`,run:()=>a()},{id:`logout`,label:`Forget token`,run:()=>r()},...l],[r,i,e,l,a]);return y.useEffect(()=>kN({openPalette:()=>s(!0)}),[]),(0,K.jsxs)(`div`,{className:`webui-shell`,children:[(0,K.jsx)(DN,{}),(0,K.jsxs)(`div`,{className:`webui-main`,children:[(0,K.jsx)(ON,{pathname:t.pathname,onOpenPalette:()=>s(!0)}),(0,K.jsx)(`div`,{className:`webui-page`,children:(0,K.jsxs)(ut,{children:[(0,K.jsx)(W,{path:`/`,element:(0,K.jsx)(st,{to:`/projects`,replace:!0})}),(0,K.jsx)(W,{path:`/agents`,element:(0,K.jsx)(Hd,{})}),(0,K.jsx)(W,{path:`/sessions`,element:(0,K.jsx)(Wd,{})}),(0,K.jsx)(W,{path:`/sessions/new`,element:(0,K.jsx)(ff,{})}),(0,K.jsx)(W,{path:`/sessions/pending/:runId`,element:(0,K.jsx)(cf,{})}),(0,K.jsx)(W,{path:`/runs/:runId`,element:(0,K.jsx)(cf,{})}),(0,K.jsx)(W,{path:`/sessions/:sessionId`,element:(0,K.jsx)(sf,{})}),(0,K.jsx)(W,{path:`/sessions/:agent/:sessionId`,element:(0,K.jsx)(AN,{})}),(0,K.jsx)(W,{path:`/pair-device`,element:(0,K.jsx)(SN,{})}),(0,K.jsxs)(W,{element:(0,K.jsx)(Wv,{}),children:[(0,K.jsx)(W,{path:`/projects`,element:(0,K.jsx)(kM,{})}),(0,K.jsx)(W,{path:`/projects/:projectId/board`,element:(0,K.jsx)(MM,{})}),(0,K.jsx)(W,{path:`/projects/:projectId/list`,element:(0,K.jsx)(NM,{})}),(0,K.jsx)(W,{path:`/projects/:projectId/issues/new`,element:(0,K.jsx)(IM,{})}),(0,K.jsx)(W,{path:`/projects/:projectId/issues/:issueId`,element:(0,K.jsx)(PM,{})}),(0,K.jsx)(W,{path:`/projects/:projectId/workspaces/new`,element:(0,K.jsx)(LM,{})}),(0,K.jsx)(W,{path:`/projects/:projectId/issues/:issueId/workspace/new`,element:(0,K.jsx)(RM,{})}),(0,K.jsx)(W,{path:`/issues/:issueId`,element:(0,K.jsx)(FM,{})}),(0,K.jsx)(W,{path:`/runs`,element:(0,K.jsx)(BM,{})}),(0,K.jsx)(W,{path:`/workspaces`,element:(0,K.jsx)(VM,{})}),(0,K.jsx)(W,{path:`/workspaces/new`,element:(0,K.jsx)(zM,{})}),(0,K.jsx)(W,{path:`/inbox`,element:(0,K.jsx)(UM,{})}),(0,K.jsx)(W,{path:`/automations`,element:(0,K.jsx)(AM,{})}),(0,K.jsx)(W,{path:`/settings`,element:(0,K.jsx)(jM,{})})]}),(0,K.jsx)(W,{path:`/legacy-home`,element:(0,K.jsx)(Sd,{})}),(0,K.jsx)(W,{path:`/legacy-workspaces`,element:(0,K.jsx)(CN,{})}),(0,K.jsx)(W,{path:`/legacy-inbox`,element:(0,K.jsx)(pf,{})}),(0,K.jsx)(W,{path:`/legacy-settings`,element:(0,K.jsx)(GM,{})})]})})]}),(0,K.jsx)(wN,{actions:u,open:o,onClose:()=>s(!1)}),(0,K.jsxs)(`nav`,{className:`webui-rail`,children:[(0,K.jsx)(Ot,{to:`/projects`,children:`Projects`}),(0,K.jsx)(Ot,{to:`/runs`,children:`Runs`}),(0,K.jsx)(Ot,{to:`/agents`,children:`Agents`}),(0,K.jsx)(Ot,{to:`/sessions`,children:`Sessions`}),(0,K.jsx)(Ot,{to:`/sessions/new`,children:`New Session`}),(0,K.jsx)(Ot,{to:`/workspaces`,children:`Workspaces`}),(0,K.jsx)(Ot,{to:`/inbox`,children:`Inbox`}),(0,K.jsx)(Ot,{to:`/automations`,children:`Automations`}),(0,K.jsx)(Ot,{to:`/settings`,children:`Settings`})]})]})}function NN(){return(0,K.jsxs)(ut,{children:[(0,K.jsx)(W,{path:`/login`,element:(0,K.jsx)(Vd,{})}),(0,K.jsx)(W,{path:`*`,element:(0,K.jsx)(jN,{children:(0,K.jsx)(MN,{})})})]})}function PN(){return(0,K.jsx)(wt,{children:(0,K.jsx)(bd,{children:(0,K.jsx)(ud,{children:(0,K.jsx)(gd,{children:(0,K.jsx)(NN,{})})})})})}b.createRoot(document.getElementById(`root`)).render((0,K.jsx)(y.StrictMode,{children:(0,K.jsx)(PN,{})}));
|
|
84
|
+
//# sourceMappingURL=index-DfHuDOVv.js.map
|