orbital-command 0.2.0 → 1.0.0
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 +67 -42
- package/bin/commands/config.js +19 -0
- package/bin/commands/events.js +40 -0
- package/bin/commands/launch.js +126 -0
- package/bin/commands/manifest.js +283 -0
- package/bin/commands/registry.js +104 -0
- package/bin/commands/update.js +24 -0
- package/bin/lib/helpers.js +229 -0
- package/bin/orbital.js +147 -319
- package/dist/assets/Landing-CfQdHR0N.js +11 -0
- package/dist/assets/PrimitivesConfig-DThSipFy.js +32 -0
- package/dist/assets/QualityGates-B4kxM5UU.js +26 -0
- package/dist/assets/SessionTimeline-Bz1iZnmg.js +1 -0
- package/dist/assets/Settings-DLcZwbCT.js +12 -0
- package/dist/assets/SourceControl-BMNIz7Lt.js +36 -0
- package/dist/assets/WorkflowVisualizer-CxuSBOYu.js +69 -0
- package/dist/assets/arrow-down-DVPp6_qp.js +6 -0
- package/dist/assets/bot-NFaJBDn_.js +6 -0
- package/dist/assets/charts-LGLb8hyU.js +68 -0
- package/dist/assets/circle-x-IsFCkBZu.js +6 -0
- package/dist/assets/file-text-J1cebZXF.js +6 -0
- package/dist/assets/globe-WzeyHsUc.js +6 -0
- package/dist/assets/index-BdJ57EhC.css +1 -0
- package/dist/assets/index-o4ScMAuR.js +349 -0
- package/dist/assets/key-CKR8JJSj.js +6 -0
- package/dist/assets/minus-CHBsJyjp.js +6 -0
- package/dist/assets/radio-xqZaR-Uk.js +6 -0
- package/dist/assets/rocket-D_xvvNG6.js +6 -0
- package/dist/assets/shield-TdB1yv_a.js +6 -0
- package/dist/assets/ui-BmsSg9jU.js +53 -0
- package/dist/assets/useSocketListener-0L5yiN5i.js +1 -0
- package/dist/assets/useWorkflowEditor-CqeRWVQX.js +11 -0
- package/dist/assets/{vendor-Dzv9lrRc.js → vendor-Bqt8AJn2.js} +1 -1
- package/dist/assets/workflow-constants-Rw-GmgHZ.js +6 -0
- package/dist/assets/zap-C9wqYMpl.js +6 -0
- package/dist/favicon.svg +1 -0
- package/dist/index.html +6 -5
- package/dist/server/server/__tests__/data-routes.test.js +126 -0
- package/dist/server/server/__tests__/helpers/db.js +17 -0
- package/dist/server/server/__tests__/helpers/mock-emitter.js +8 -0
- package/dist/server/server/__tests__/scope-routes.test.js +138 -0
- package/dist/server/server/__tests__/sprint-routes.test.js +102 -0
- package/dist/server/server/__tests__/workflow-routes.test.js +107 -0
- package/dist/server/server/config-migrator.js +135 -0
- package/dist/server/server/config.js +51 -7
- package/dist/server/server/database.js +21 -28
- package/dist/server/server/global-config.js +143 -0
- package/dist/server/server/index.js +118 -276
- package/dist/server/server/init.js +243 -225
- package/dist/server/server/launch.js +29 -0
- package/dist/server/server/manifest-types.js +8 -0
- package/dist/server/server/manifest.js +454 -0
- package/dist/server/server/migrate-legacy.js +229 -0
- package/dist/server/server/parsers/event-parser.js +4 -1
- package/dist/server/server/parsers/event-parser.test.js +117 -0
- package/dist/server/server/parsers/scope-parser.js +74 -28
- package/dist/server/server/parsers/scope-parser.test.js +230 -0
- package/dist/server/server/project-context.js +265 -0
- package/dist/server/server/project-emitter.js +41 -0
- package/dist/server/server/project-manager.js +297 -0
- package/dist/server/server/routes/aggregate-routes.js +871 -0
- package/dist/server/server/routes/config-routes.js +41 -90
- package/dist/server/server/routes/data-routes.js +25 -123
- package/dist/server/server/routes/dispatch-routes.js +37 -15
- package/dist/server/server/routes/git-routes.js +74 -0
- package/dist/server/server/routes/manifest-routes.js +319 -0
- package/dist/server/server/routes/scope-routes.js +45 -28
- package/dist/server/server/routes/sync-routes.js +134 -0
- package/dist/server/server/routes/version-routes.js +1 -15
- package/dist/server/server/routes/workflow-routes.js +9 -3
- package/dist/server/server/schema.js +3 -0
- package/dist/server/server/services/batch-orchestrator.js +41 -17
- package/dist/server/server/services/claude-session-service.js +17 -14
- package/dist/server/server/services/config-service.js +10 -1
- package/dist/server/server/services/deploy-service.test.js +119 -0
- package/dist/server/server/services/event-service.js +64 -1
- package/dist/server/server/services/event-service.test.js +191 -0
- package/dist/server/server/services/gate-service.test.js +105 -0
- package/dist/server/server/services/git-service.js +108 -4
- package/dist/server/server/services/github-service.js +110 -2
- package/dist/server/server/services/readiness-service.test.js +190 -0
- package/dist/server/server/services/scope-cache.js +5 -1
- package/dist/server/server/services/scope-cache.test.js +142 -0
- package/dist/server/server/services/scope-service.js +222 -131
- package/dist/server/server/services/scope-service.test.js +137 -0
- package/dist/server/server/services/sprint-orchestrator.js +29 -15
- package/dist/server/server/services/sprint-service.js +23 -3
- package/dist/server/server/services/sprint-service.test.js +238 -0
- package/dist/server/server/services/sync-service.js +434 -0
- package/dist/server/server/services/sync-types.js +2 -0
- package/dist/server/server/services/workflow-service.js +26 -5
- package/dist/server/server/services/workflow-service.test.js +159 -0
- package/dist/server/server/settings-sync.js +284 -0
- package/dist/server/server/uninstall.js +195 -0
- package/dist/server/server/update-planner.js +279 -0
- package/dist/server/server/update.js +212 -0
- package/dist/server/server/utils/cc-hooks-parser.js +3 -0
- package/dist/server/server/utils/cc-hooks-parser.test.js +86 -0
- package/dist/server/server/utils/dispatch-utils.js +83 -24
- package/dist/server/server/utils/dispatch-utils.test.js +182 -0
- package/dist/server/server/utils/flag-builder.js +54 -0
- package/dist/server/server/utils/json-fields.js +14 -0
- package/dist/server/server/utils/json-fields.test.js +73 -0
- package/dist/server/server/utils/logger.js +37 -3
- package/dist/server/server/utils/package-info.js +30 -0
- package/dist/server/server/utils/route-helpers.js +47 -0
- package/dist/server/server/utils/route-helpers.test.js +115 -0
- package/dist/server/server/utils/terminal-launcher.js +79 -25
- package/dist/server/server/utils/worktree-manager.js +13 -4
- package/dist/server/server/validator.js +230 -0
- package/dist/server/server/watchers/event-watcher.js +28 -13
- package/dist/server/server/watchers/global-watcher.js +63 -0
- package/dist/server/server/watchers/scope-watcher.js +27 -12
- package/dist/server/server/wizard/config-editor.js +237 -0
- package/dist/server/server/wizard/detect.js +96 -0
- package/dist/server/server/wizard/doctor.js +115 -0
- package/dist/server/server/wizard/index.js +340 -0
- package/dist/server/server/wizard/phases/confirm.js +39 -0
- package/dist/server/server/wizard/phases/project-setup.js +90 -0
- package/dist/server/server/wizard/phases/setup-wizard.js +66 -0
- package/dist/server/server/wizard/phases/welcome.js +32 -0
- package/dist/server/server/wizard/phases/workflow-setup.js +22 -0
- package/dist/server/server/wizard/types.js +29 -0
- package/dist/server/server/wizard/ui.js +73 -0
- package/dist/server/shared/__fixtures__/workflow-configs.js +75 -0
- package/dist/server/shared/api-types.js +80 -1
- package/dist/server/shared/default-workflow.json +65 -0
- package/dist/server/shared/onboarding-tour.test.js +81 -0
- package/dist/server/shared/project-colors.js +24 -0
- package/dist/server/shared/workflow-config.test.js +84 -0
- package/dist/server/shared/workflow-engine.js +1 -1
- package/dist/server/shared/workflow-engine.test.js +302 -0
- package/dist/server/shared/workflow-normalizer.js +101 -0
- package/dist/server/shared/workflow-normalizer.test.js +100 -0
- package/dist/server/src/components/onboarding/tour-steps.js +84 -0
- package/package.json +34 -29
- package/schemas/orbital.config.schema.json +2 -5
- package/scripts/postinstall.js +18 -6
- package/scripts/release.sh +53 -0
- package/server/__tests__/data-routes.test.ts +151 -0
- package/server/__tests__/helpers/db.ts +19 -0
- package/server/__tests__/helpers/mock-emitter.ts +10 -0
- package/server/__tests__/scope-routes.test.ts +158 -0
- package/server/__tests__/sprint-routes.test.ts +118 -0
- package/server/__tests__/workflow-routes.test.ts +120 -0
- package/server/config-migrator.ts +160 -0
- package/server/config.ts +64 -12
- package/server/database.ts +22 -31
- package/server/global-config.ts +204 -0
- package/server/index.ts +139 -316
- package/server/init.ts +266 -234
- package/server/launch.ts +32 -0
- package/server/manifest-types.ts +145 -0
- package/server/manifest.ts +494 -0
- package/server/migrate-legacy.ts +290 -0
- package/server/parsers/event-parser.test.ts +135 -0
- package/server/parsers/event-parser.ts +4 -1
- package/server/parsers/scope-parser.test.ts +270 -0
- package/server/parsers/scope-parser.ts +79 -31
- package/server/project-context.ts +325 -0
- package/server/project-emitter.ts +50 -0
- package/server/project-manager.ts +368 -0
- package/server/routes/aggregate-routes.ts +968 -0
- package/server/routes/config-routes.ts +43 -85
- package/server/routes/data-routes.ts +34 -156
- package/server/routes/dispatch-routes.ts +46 -17
- package/server/routes/git-routes.ts +77 -0
- package/server/routes/manifest-routes.ts +388 -0
- package/server/routes/scope-routes.ts +39 -30
- package/server/routes/sync-routes.ts +175 -0
- package/server/routes/version-routes.ts +1 -16
- package/server/routes/workflow-routes.ts +9 -3
- package/server/schema.ts +3 -0
- package/server/services/batch-orchestrator.ts +41 -17
- package/server/services/claude-session-service.ts +16 -14
- package/server/services/config-service.ts +10 -1
- package/server/services/deploy-service.test.ts +145 -0
- package/server/services/deploy-service.ts +2 -2
- package/server/services/event-service.test.ts +242 -0
- package/server/services/event-service.ts +92 -3
- package/server/services/gate-service.test.ts +131 -0
- package/server/services/gate-service.ts +2 -2
- package/server/services/git-service.ts +137 -4
- package/server/services/github-service.ts +120 -2
- package/server/services/readiness-service.test.ts +217 -0
- package/server/services/scope-cache.test.ts +167 -0
- package/server/services/scope-cache.ts +4 -1
- package/server/services/scope-service.test.ts +169 -0
- package/server/services/scope-service.ts +224 -130
- package/server/services/sprint-orchestrator.ts +30 -15
- package/server/services/sprint-service.test.ts +271 -0
- package/server/services/sprint-service.ts +29 -5
- package/server/services/sync-service.ts +482 -0
- package/server/services/sync-types.ts +77 -0
- package/server/services/workflow-service.test.ts +190 -0
- package/server/services/workflow-service.ts +29 -9
- package/server/settings-sync.ts +359 -0
- package/server/uninstall.ts +214 -0
- package/server/update-planner.ts +346 -0
- package/server/update.ts +263 -0
- package/server/utils/cc-hooks-parser.test.ts +96 -0
- package/server/utils/cc-hooks-parser.ts +4 -0
- package/server/utils/dispatch-utils.test.ts +245 -0
- package/server/utils/dispatch-utils.ts +102 -30
- package/server/utils/flag-builder.ts +56 -0
- package/server/utils/json-fields.test.ts +83 -0
- package/server/utils/json-fields.ts +14 -0
- package/server/utils/logger.ts +40 -3
- package/server/utils/package-info.ts +32 -0
- package/server/utils/route-helpers.test.ts +144 -0
- package/server/utils/route-helpers.ts +50 -0
- package/server/utils/terminal-launcher.ts +85 -25
- package/server/utils/worktree-manager.ts +9 -4
- package/server/validator.ts +270 -0
- package/server/watchers/event-watcher.ts +24 -12
- package/server/watchers/global-watcher.ts +77 -0
- package/server/watchers/scope-watcher.ts +21 -9
- package/server/wizard/config-editor.ts +248 -0
- package/server/wizard/detect.ts +104 -0
- package/server/wizard/doctor.ts +114 -0
- package/server/wizard/index.ts +438 -0
- package/server/wizard/phases/confirm.ts +45 -0
- package/server/wizard/phases/project-setup.ts +106 -0
- package/server/wizard/phases/setup-wizard.ts +78 -0
- package/server/wizard/phases/welcome.ts +39 -0
- package/server/wizard/phases/workflow-setup.ts +28 -0
- package/server/wizard/types.ts +56 -0
- package/server/wizard/ui.ts +92 -0
- package/shared/__fixtures__/workflow-configs.ts +80 -0
- package/shared/api-types.ts +106 -0
- package/shared/onboarding-tour.test.ts +94 -0
- package/shared/project-colors.ts +24 -0
- package/shared/workflow-config.test.ts +111 -0
- package/shared/workflow-config.ts +7 -0
- package/shared/workflow-engine.test.ts +388 -0
- package/shared/workflow-engine.ts +1 -1
- package/shared/workflow-normalizer.test.ts +119 -0
- package/shared/workflow-normalizer.ts +118 -0
- package/templates/agents/QUICK-REFERENCE.md +1 -0
- package/templates/agents/README.md +1 -0
- package/templates/agents/SKILL-TRIGGERS.md +11 -0
- package/templates/agents/green-team/deep-dive.md +361 -0
- package/templates/hooks/end-session.sh +4 -1
- package/templates/hooks/init-session.sh +1 -0
- package/templates/hooks/orbital-emit.sh +2 -2
- package/templates/hooks/orbital-report-deploy.sh +4 -4
- package/templates/hooks/orbital-report-gates.sh +4 -4
- package/templates/hooks/orbital-scope-update.sh +1 -1
- package/templates/hooks/scope-commit-logger.sh +2 -2
- package/templates/hooks/scope-create-cleanup.sh +2 -2
- package/templates/hooks/scope-create-gate.sh +2 -5
- package/templates/hooks/scope-gate.sh +4 -6
- package/templates/hooks/scope-helpers.sh +28 -1
- package/templates/hooks/scope-lifecycle-gate.sh +14 -5
- package/templates/hooks/scope-prepare.sh +67 -12
- package/templates/hooks/scope-transition.sh +14 -6
- package/templates/hooks/time-tracker.sh +2 -5
- package/templates/migrations/renames.json +1 -0
- package/templates/orbital.config.json +8 -6
- package/{shared/default-workflow.json → templates/presets/default.json} +65 -0
- package/templates/presets/development.json +4 -4
- package/templates/presets/gitflow.json +7 -0
- package/templates/prompts/README.md +23 -0
- package/templates/prompts/deep-dive-audit.md +94 -0
- package/templates/quick/rules.md +56 -5
- package/templates/settings-hooks.json +1 -1
- package/templates/skills/git-commit/SKILL.md +27 -7
- package/templates/skills/git-dev/SKILL.md +13 -4
- package/templates/skills/git-main/SKILL.md +13 -3
- package/templates/skills/git-production/SKILL.md +9 -2
- package/templates/skills/git-staging/SKILL.md +11 -3
- package/templates/skills/scope-create/SKILL.md +17 -3
- package/templates/skills/scope-fix-review/SKILL.md +14 -7
- package/templates/skills/scope-implement/SKILL.md +15 -4
- package/templates/skills/scope-post-review/SKILL.md +77 -7
- package/templates/skills/scope-pre-review/SKILL.md +11 -4
- package/templates/skills/scope-verify/SKILL.md +5 -3
- package/templates/skills/test-code-review/SKILL.md +41 -33
- package/templates/skills/test-scaffold/SKILL.md +222 -0
- package/dist/assets/WorkflowVisualizer-BZ21PIIF.js +0 -84
- package/dist/assets/charts-D__PA1zp.js +0 -72
- package/dist/assets/index-D1G6i0nS.css +0 -1
- package/dist/assets/index-DpItvKpf.js +0 -419
- package/dist/assets/ui-BvF022GT.js +0 -53
- package/index.html +0 -15
- package/postcss.config.js +0 -6
- package/src/App.tsx +0 -33
- package/src/components/AgentBadge.tsx +0 -40
- package/src/components/BatchPreflightModal.tsx +0 -115
- package/src/components/CardDisplayToggle.tsx +0 -74
- package/src/components/ColumnHeaderActions.tsx +0 -55
- package/src/components/ColumnMenu.tsx +0 -99
- package/src/components/DeployHistory.tsx +0 -141
- package/src/components/DispatchModal.tsx +0 -164
- package/src/components/DispatchPopover.tsx +0 -139
- package/src/components/DragOverlay.tsx +0 -25
- package/src/components/DriftSidebar.tsx +0 -140
- package/src/components/EnvironmentStrip.tsx +0 -88
- package/src/components/ErrorBoundary.tsx +0 -62
- package/src/components/FilterChip.tsx +0 -105
- package/src/components/GateIndicator.tsx +0 -33
- package/src/components/IdeaDetailModal.tsx +0 -190
- package/src/components/IdeaFormDialog.tsx +0 -113
- package/src/components/KanbanColumn.tsx +0 -201
- package/src/components/MarkdownRenderer.tsx +0 -114
- package/src/components/NeonGrid.tsx +0 -128
- package/src/components/PromotionQueue.tsx +0 -89
- package/src/components/ScopeCard.tsx +0 -234
- package/src/components/ScopeDetailModal.tsx +0 -255
- package/src/components/ScopeFilterBar.tsx +0 -152
- package/src/components/SearchInput.tsx +0 -102
- package/src/components/SessionPanel.tsx +0 -335
- package/src/components/SprintContainer.tsx +0 -303
- package/src/components/SprintDependencyDialog.tsx +0 -78
- package/src/components/SprintPreflightModal.tsx +0 -138
- package/src/components/StatusBar.tsx +0 -168
- package/src/components/SwimCell.tsx +0 -67
- package/src/components/SwimLaneRow.tsx +0 -94
- package/src/components/SwimlaneBoardView.tsx +0 -108
- package/src/components/VersionBadge.tsx +0 -139
- package/src/components/ViewModeSelector.tsx +0 -114
- package/src/components/config/AgentChip.tsx +0 -53
- package/src/components/config/AgentCreateDialog.tsx +0 -321
- package/src/components/config/AgentEditor.tsx +0 -175
- package/src/components/config/DirectoryTree.tsx +0 -582
- package/src/components/config/FileEditor.tsx +0 -550
- package/src/components/config/HookChip.tsx +0 -50
- package/src/components/config/StageCard.tsx +0 -198
- package/src/components/config/TransitionZone.tsx +0 -173
- package/src/components/config/UnifiedWorkflowPipeline.tsx +0 -216
- package/src/components/config/WorkflowPipeline.tsx +0 -161
- package/src/components/source-control/BranchList.tsx +0 -93
- package/src/components/source-control/BranchPanel.tsx +0 -105
- package/src/components/source-control/CommitLog.tsx +0 -100
- package/src/components/source-control/CommitRow.tsx +0 -47
- package/src/components/source-control/GitHubPanel.tsx +0 -110
- package/src/components/source-control/GitHubSetupGuide.tsx +0 -52
- package/src/components/source-control/GitOverviewBar.tsx +0 -101
- package/src/components/source-control/PullRequestList.tsx +0 -69
- package/src/components/source-control/WorktreeList.tsx +0 -80
- package/src/components/ui/badge.tsx +0 -41
- package/src/components/ui/button.tsx +0 -55
- package/src/components/ui/card.tsx +0 -78
- package/src/components/ui/dialog.tsx +0 -94
- package/src/components/ui/popover.tsx +0 -33
- package/src/components/ui/scroll-area.tsx +0 -54
- package/src/components/ui/separator.tsx +0 -28
- package/src/components/ui/tabs.tsx +0 -52
- package/src/components/ui/toggle-switch.tsx +0 -35
- package/src/components/ui/tooltip.tsx +0 -27
- package/src/components/workflow/AddEdgeDialog.tsx +0 -217
- package/src/components/workflow/AddListDialog.tsx +0 -201
- package/src/components/workflow/ChecklistEditor.tsx +0 -239
- package/src/components/workflow/CommandPrefixManager.tsx +0 -118
- package/src/components/workflow/ConfigSettingsPanel.tsx +0 -189
- package/src/components/workflow/DirectionSelector.tsx +0 -133
- package/src/components/workflow/DispatchConfigPanel.tsx +0 -180
- package/src/components/workflow/EdgeDetailPanel.tsx +0 -236
- package/src/components/workflow/EdgePropertyEditor.tsx +0 -251
- package/src/components/workflow/EditToolbar.tsx +0 -138
- package/src/components/workflow/HookDetailPanel.tsx +0 -250
- package/src/components/workflow/HookExecutionLog.tsx +0 -24
- package/src/components/workflow/HookSourceModal.tsx +0 -129
- package/src/components/workflow/HooksDashboard.tsx +0 -363
- package/src/components/workflow/ListPropertyEditor.tsx +0 -251
- package/src/components/workflow/MigrationPreviewDialog.tsx +0 -237
- package/src/components/workflow/MovementRulesPanel.tsx +0 -188
- package/src/components/workflow/NodeDetailPanel.tsx +0 -245
- package/src/components/workflow/PresetSelector.tsx +0 -414
- package/src/components/workflow/SkillCommandBuilder.tsx +0 -174
- package/src/components/workflow/WorkflowEdgeComponent.tsx +0 -145
- package/src/components/workflow/WorkflowNode.tsx +0 -147
- package/src/components/workflow/graphLayout.ts +0 -186
- package/src/components/workflow/mergeHooks.ts +0 -85
- package/src/components/workflow/useEditHistory.ts +0 -88
- package/src/components/workflow/useWorkflowEditor.ts +0 -262
- package/src/components/workflow/validateConfig.ts +0 -70
- package/src/hooks/useActiveDispatches.ts +0 -198
- package/src/hooks/useBoardSettings.ts +0 -170
- package/src/hooks/useCardDisplay.ts +0 -57
- package/src/hooks/useCcHooks.ts +0 -24
- package/src/hooks/useConfigTree.ts +0 -51
- package/src/hooks/useEnforcementRules.ts +0 -46
- package/src/hooks/useEvents.ts +0 -59
- package/src/hooks/useFileEditor.ts +0 -165
- package/src/hooks/useGates.ts +0 -57
- package/src/hooks/useIdeaActions.ts +0 -53
- package/src/hooks/useKanbanDnd.ts +0 -410
- package/src/hooks/useOrbitalConfig.ts +0 -54
- package/src/hooks/usePipeline.ts +0 -47
- package/src/hooks/usePipelineData.ts +0 -338
- package/src/hooks/useReconnect.ts +0 -25
- package/src/hooks/useScopeFilters.ts +0 -125
- package/src/hooks/useScopeSessions.ts +0 -44
- package/src/hooks/useScopes.ts +0 -67
- package/src/hooks/useSearch.ts +0 -67
- package/src/hooks/useSettings.tsx +0 -187
- package/src/hooks/useSocket.ts +0 -25
- package/src/hooks/useSourceControl.ts +0 -105
- package/src/hooks/useSprintPreflight.ts +0 -55
- package/src/hooks/useSprints.ts +0 -154
- package/src/hooks/useStatusBarHighlight.ts +0 -18
- package/src/hooks/useSwimlaneBoardSettings.ts +0 -104
- package/src/hooks/useTheme.ts +0 -9
- package/src/hooks/useTransitionReadiness.ts +0 -53
- package/src/hooks/useVersion.ts +0 -155
- package/src/hooks/useViolations.ts +0 -65
- package/src/hooks/useWorkflow.tsx +0 -125
- package/src/hooks/useZoomModifier.ts +0 -19
- package/src/index.css +0 -797
- package/src/layouts/DashboardLayout.tsx +0 -113
- package/src/lib/collisionDetection.ts +0 -20
- package/src/lib/scope-fields.ts +0 -61
- package/src/lib/swimlane.ts +0 -146
- package/src/lib/utils.ts +0 -15
- package/src/main.tsx +0 -19
- package/src/socket.ts +0 -11
- package/src/types/index.ts +0 -497
- package/src/views/AgentFeed.tsx +0 -339
- package/src/views/DeployPipeline.tsx +0 -59
- package/src/views/EnforcementView.tsx +0 -378
- package/src/views/PrimitivesConfig.tsx +0 -500
- package/src/views/QualityGates.tsx +0 -1012
- package/src/views/ScopeBoard.tsx +0 -454
- package/src/views/SessionTimeline.tsx +0 -516
- package/src/views/Settings.tsx +0 -183
- package/src/views/SourceControl.tsx +0 -95
- package/src/views/WorkflowVisualizer.tsx +0 -382
- package/tailwind.config.js +0 -161
- package/tsconfig.json +0 -25
- package/vite.config.ts +0 -38
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PrimitivesConfig-DThSipFy.js","assets/ui-BmsSg9jU.js","assets/vendor-Bqt8AJn2.js","assets/workflow-constants-Rw-GmgHZ.js","assets/bot-NFaJBDn_.js","assets/useWorkflowEditor-CqeRWVQX.js","assets/zap-C9wqYMpl.js","assets/file-text-J1cebZXF.js","assets/arrow-down-DVPp6_qp.js","assets/globe-WzeyHsUc.js","assets/charts-LGLb8hyU.js","assets/QualityGates-B4kxM5UU.js","assets/useSocketListener-0L5yiN5i.js","assets/shield-TdB1yv_a.js","assets/circle-x-IsFCkBZu.js","assets/SourceControl-BMNIz7Lt.js","assets/key-CKR8JJSj.js","assets/rocket-D_xvvNG6.js","assets/SessionTimeline-Bz1iZnmg.js","assets/Settings-DLcZwbCT.js","assets/minus-CHBsJyjp.js","assets/WorkflowVisualizer-CxuSBOYu.js","assets/radio-xqZaR-Uk.js","assets/WorkflowVisualizer-BZV40eAE.css","assets/Landing-CfQdHR0N.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Gg=Object.defineProperty;var Yg=(e,t,n)=>t in e?Gg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var yt=(e,t,n)=>Yg(e,typeof t!="symbol"?t+"":t,n);import{j as d,C as ff,R as Xg,T as Jg,P as Qg,a as hf,V as Zg,b as ex,S as pf,c as tx,d as mf,e as gf,f as nx,u as xf,h as rx,g as ix,i as qr,k as sx,l as yf,m as ox,F as ax,D as lx,n as cx,o as ux,p as dx,q as fx,r as bf,A as vf,s as hx,O as wf,t as px,v as kf,w as Sf,x as mx,y as gx,z as xx,B as yx}from"./ui-BmsSg9jU.js";import{f as bx,g as Da,a as m,u as Cf,h as jf,i as vx,b as rr,N as lc,O as wx,d as Ie,R as kx,B as Sx,j as Cx,k as Dt,l as cc}from"./vendor-Bqt8AJn2.js";import{c as Ef}from"./charts-LGLb8hyU.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Ti={},uc;function jx(){if(uc)return Ti;uc=1;var e=bx();return Ti.createRoot=e.createRoot,Ti.hydrateRoot=e.hydrateRoot,Ti}var Ex=jx();const Tx=Da(Ex),Nx="modulepreload",Px=function(e){return"/"+e},dc={},Hn=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=o(n.map(c=>{if(c=Px(c),c in dc)return;dc[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":Nx,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((p,g)=>{h.addEventListener("load",p),h.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},Oa="-",Ax=e=>{const t=Rx(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(Oa);return a[0]===""&&a.length!==1&&a.shift(),Tf(a,t)||_x(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Tf=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Tf(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(Oa);return(o=t.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},fc=/^\[(.+)\]$/,_x=e=>{if(fc.test(e)){const t=fc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Rx=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Dx(Object.entries(e.classGroups),n).forEach(([s,o])=>{Ho(o,r,s,t)}),r},Ho=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:hc(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(Mx(i)){Ho(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Ho(o,hc(t,s),n,r)})})},hc=(e,t)=>{let n=e;return t.split(Oa).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Mx=e=>e.isThemeGetter,Dx=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[t+o,a])):s);return[n,i]}):e,Ox=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},Nf="!",Ix=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,o=a=>{const l=[];let c=0,u=0,f;for(let y=0;y<a.length;y++){let x=a[y];if(c===0){if(x===i&&(r||a.slice(y,y+s)===t)){l.push(a.slice(u,y)),u=y+s;continue}if(x==="/"){f=y;continue}}x==="["?c++:x==="]"&&c--}const h=l.length===0?a:a.substring(u),p=h.startsWith(Nf),g=p?h.substring(1):h,b=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:b}};return n?a=>n({className:a,parseClassName:o}):o},Lx=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Fx=e=>({cache:Ox(e.cacheSize),parseClassName:Ix(e),...Ax(e)}),Bx=/\s+/,zx=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(Bx);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let g=!!p,b=r(g?h.substring(0,p):h);if(!b){if(!g){a=c+(a.length>0?" "+a:a);continue}if(b=r(h),!b){a=c+(a.length>0?" "+a:a);continue}g=!1}const y=Lx(u).join(":"),x=f?y+Nf:y,v=x+b;if(s.includes(v))continue;s.push(v);const C=i(b,g);for(let j=0;j<C.length;++j){const w=C[j];s.push(x+w)}a=c+(a.length>0?" "+a:a)}return a};function Vx(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Pf(t))&&(r&&(r+=" "),r+=n);return r}const Pf=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Pf(e[r]))&&(n&&(n+=" "),n+=t);return n};function $x(e,...t){let n,r,i,s=o;function o(l){const c=t.reduce((u,f)=>f(u),e());return n=Fx(c),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=zx(l,n);return i(l,u),u}return function(){return s(Vx.apply(null,arguments))}}const Ae=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Af=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ux=/^\d+\/\d+$/,Wx=new Set(["px","full","screen"]),Hx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qx=/\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$/,Kx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Gx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Yx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qt=e=>ur(e)||Wx.has(e)||Ux.test(e),fn=e=>wr(e,"length",ry),ur=e=>!!e&&!Number.isNaN(Number(e)),Js=e=>wr(e,"number",ur),Rr=e=>!!e&&Number.isInteger(Number(e)),Xx=e=>e.endsWith("%")&&ur(e.slice(0,-1)),re=e=>Af.test(e),hn=e=>Hx.test(e),Jx=new Set(["length","size","percentage"]),Qx=e=>wr(e,Jx,_f),Zx=e=>wr(e,"position",_f),ey=new Set(["image","url"]),ty=e=>wr(e,ey,sy),ny=e=>wr(e,"",iy),Mr=()=>!0,wr=(e,t,n)=>{const r=Af.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},ry=e=>qx.test(e)&&!Kx.test(e),_f=()=>!1,iy=e=>Gx.test(e),sy=e=>Yx.test(e),oy=()=>{const e=Ae("colors"),t=Ae("spacing"),n=Ae("blur"),r=Ae("brightness"),i=Ae("borderColor"),s=Ae("borderRadius"),o=Ae("borderSpacing"),a=Ae("borderWidth"),l=Ae("contrast"),c=Ae("grayscale"),u=Ae("hueRotate"),f=Ae("invert"),h=Ae("gap"),p=Ae("gradientColorStops"),g=Ae("gradientColorStopPositions"),b=Ae("inset"),y=Ae("margin"),x=Ae("opacity"),v=Ae("padding"),C=Ae("saturate"),j=Ae("scale"),w=Ae("sepia"),k=Ae("skew"),P=Ae("space"),N=Ae("translate"),M=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",re,t],A=()=>[re,t],_=()=>["",Qt,fn],L=()=>["auto",ur,re],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",re],S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[ur,re];return{cacheSize:500,separator:":",theme:{colors:[Mr],spacing:[Qt,fn],blur:["none","",hn,re],brightness:H(),borderColor:[e],borderRadius:["none","","full",hn,re],borderSpacing:A(),borderWidth:_(),contrast:H(),grayscale:z(),hueRotate:H(),invert:z(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[Xx,fn],inset:R(),margin:R(),opacity:H(),padding:A(),saturate:H(),scale:H(),sepia:z(),skew:H(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[hn]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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:[...I(),re]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Rr,re]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",Rr,re]}],"grid-cols":[{"grid-cols":[Mr]}],"col-start-end":[{col:["auto",{span:["full",Rr,re]},re]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Mr]}],"row-start-end":[{row:["auto",{span:[Rr,re]},re]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"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:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,t]}],"min-w":[{"min-w":[re,t,"min","max","fit"]}],"max-w":[{"max-w":[re,t,"none","full","min","max","fit","prose",{screen:[hn]},hn]}],h:[{h:[re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",hn,fn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Js]}],"font-family":[{font:[Mr]}],"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",re]}],"line-clamp":[{"line-clamp":["none",ur,Js]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qt,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Qt,fn]}],"underline-offset":[{"underline-offset":["auto",Qt,re]}],"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:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re]}],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",re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),Zx]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Qx]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ty]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:W()}],"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:["",...W()]}],"outline-offset":[{"outline-offset":[Qt,re]}],"outline-w":[{outline:[Qt,fn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Qt,fn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",hn,ny]}],"shadow-color":[{shadow:[Mr]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",hn,re]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"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",re]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Rr,re]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],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",re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Qt,fn,Js]}],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"]}}},ay=$x(oy);function F(...e){return ay(Ef(e))}function _t(e){if(e<=0)return"";if(e<1e3)return`#${String(e).padStart(3,"0")}`;const t=e%1e3,n=Math.floor(e/1e3),r=n===9?"X":String.fromCharCode(96+n);return`#${String(t).padStart(3,"0")}${r}`}const pc=Qg,ly=Xg,cy=Jg,Rf=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>d.jsx(ff,{ref:r,sideOffset:t,className:F("card-glass z-50 overflow-hidden rounded border bg-popover px-2 py-1 text-xxs text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Rf.displayName=ff.displayName;const Kt=Object.create(null);Kt.open="0";Kt.close="1";Kt.ping="2";Kt.pong="3";Kt.message="4";Kt.upgrade="5";Kt.noop="6";const Hi=Object.create(null);Object.keys(Kt).forEach(e=>{Hi[Kt[e]]=e});const qo={type:"error",data:"parser error"},Mf=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Df=typeof ArrayBuffer=="function",Of=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ia=({type:e,data:t},n,r)=>Mf&&t instanceof Blob?n?r(t):mc(t,r):Df&&(t instanceof ArrayBuffer||Of(t))?n?r(t):mc(new Blob([t]),r):r(Kt[e]+(t||"")),mc=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function gc(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Qs;function uy(e,t){if(Mf&&e.data instanceof Blob)return e.data.arrayBuffer().then(gc).then(t);if(Df&&(e.data instanceof ArrayBuffer||Of(e.data)))return t(gc(e.data));Ia(e,!1,n=>{Qs||(Qs=new TextEncoder),t(Qs.encode(n))})}const xc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$r=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<xc.length;e++)$r[xc.charCodeAt(e)]=e;const dy=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)s=$r[e.charCodeAt(r)],o=$r[e.charCodeAt(r+1)],a=$r[e.charCodeAt(r+2)],l=$r[e.charCodeAt(r+3)],u[i++]=s<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c},fy=typeof ArrayBuffer=="function",La=(e,t)=>{if(typeof e!="string")return{type:"message",data:If(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:hy(e.substring(1),t)}:Hi[n]?e.length>1?{type:Hi[n],data:e.substring(1)}:{type:Hi[n]}:qo},hy=(e,t)=>{if(fy){const n=dy(e);return If(n,t)}else return{base64:!0,data:e}},If=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Lf="",py=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{Ia(s,!1,a=>{r[o]=a,++i===n&&t(r.join(Lf))})})},my=(e,t)=>{const n=e.split(Lf),r=[];for(let i=0;i<n.length;i++){const s=La(n[i],t);if(r.push(s),s.type==="error")break}return r};function gy(){return new TransformStream({transform(e,t){uy(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Zs;function Ni(e){return e.reduce((t,n)=>t+n.length,0)}function Pi(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function xy(e,t){Zs||(Zs=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(Ni(n)<1)break;const l=Pi(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Ni(n)<2)break;const l=Pi(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Ni(n)<8)break;const l=Pi(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(qo);break}i=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Ni(n)<i)break;const l=Pi(n,i);a.enqueue(La(s?l:Zs.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(qo);break}}}})}const Ff=4;function Ge(e){if(e)return yy(e)}function yy(e){for(var t in Ge.prototype)e[t]=Ge.prototype[t];return e}Ge.prototype.on=Ge.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Ge.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Ge.prototype.off=Ge.prototype.removeListener=Ge.prototype.removeAllListeners=Ge.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Ge.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Ge.prototype.emitReserved=Ge.prototype.emit;Ge.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Ge.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Cs=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Pt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),by="arraybuffer";function Bf(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const vy=Pt.setTimeout,wy=Pt.clearTimeout;function js(e,t){t.useNativeTimers?(e.setTimeoutFn=vy.bind(Pt),e.clearTimeoutFn=wy.bind(Pt)):(e.setTimeoutFn=Pt.setTimeout.bind(Pt),e.clearTimeoutFn=Pt.clearTimeout.bind(Pt))}const ky=1.33;function Sy(e){return typeof e=="string"?Cy(e):Math.ceil((e.byteLength||e.size)*ky)}function Cy(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function zf(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function jy(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Ey(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class Ty extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Fa extends Ge{constructor(t){super(),this.writable=!1,js(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Ty(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=La(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=jy(t);return n.length?"?"+n:""}}class Ny extends Fa{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};my(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,py(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=zf()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Vf=!1;try{Vf=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Py=Vf;function Ay(){}class _y extends Ny{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Wt extends Ge{constructor(t,n,r){super(),this.createRequest=t,js(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Bf(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Wt.requestsCount++,Wt.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Ay,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Wt.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Wt.requestsCount=0;Wt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",yc);else if(typeof addEventListener=="function"){const e="onpagehide"in Pt?"pagehide":"unload";addEventListener(e,yc,!1)}}function yc(){for(let e in Wt.requests)Wt.requests.hasOwnProperty(e)&&Wt.requests[e].abort()}const Ry=(function(){const e=$f({xdomain:!1});return e&&e.responseType!==null})();class My extends _y{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Ry&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Wt($f,this.uri(),t)}}function $f(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Py))return new XMLHttpRequest}catch{}if(!t)try{return new Pt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Uf=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Dy extends Fa{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Uf?{}:Bf(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Ia(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&Cs(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=zf()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const eo=Pt.WebSocket||Pt.MozWebSocket;class Oy extends Dy{createSocket(t,n,r){return Uf?new eo(t,n,r):n?new eo(t,n):new eo(t)}doWrite(t,n){this.ws.send(n)}}class Iy extends Fa{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=xy(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=gy();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Cs(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Ly={websocket:Oy,webtransport:Iy,polling:My},Fy=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,By=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ko(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=Fy.exec(e||""),s={},o=14;for(;o--;)s[By[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=zy(s,s.path),s.queryKey=Vy(s,s.query),s}function zy(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Vy(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Go=typeof addEventListener=="function"&&typeof removeEventListener=="function",qi=[];Go&&addEventListener("offline",()=>{qi.forEach(e=>e())},!1);class bn extends Ge{constructor(t,n){if(super(),this.binaryType=by,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Ko(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Ko(n.host).host);js(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Ey(this.opts.query)),Go&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},qi.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Ff,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&bn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",bn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Sy(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Cs(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(bn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Go&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=qi.indexOf(this._offlineEventListener);r!==-1&&qi.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}bn.protocol=Ff;class $y extends bn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;bn.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;bn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function s(){r||(r=!0,u(),n.close(),n=null)}const o=f=>{const h=new Error("probe error: "+f);h.transport=n.name,s(),this.emitReserved("upgradeError",h)};function a(){o("transport closed")}function l(){o("socket closed")}function c(f){n&&f.name!==n.name&&s()}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Uy=class extends $y{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>Ly[i]).filter(i=>!!i)),super(t,r)}};function Wy(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Ko(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const Hy=typeof ArrayBuffer=="function",qy=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Wf=Object.prototype.toString,Ky=typeof Blob=="function"||typeof Blob<"u"&&Wf.call(Blob)==="[object BlobConstructor]",Gy=typeof File=="function"||typeof File<"u"&&Wf.call(File)==="[object FileConstructor]";function Ba(e){return Hy&&(e instanceof ArrayBuffer||qy(e))||Ky&&e instanceof Blob||Gy&&e instanceof File}function Ki(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Ki(e[n]))return!0;return!1}if(Ba(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Ki(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Ki(e[n]))return!0;return!1}function Yy(e){const t=[],n=e.data,r=e;return r.data=Yo(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Yo(e,t){if(!e)return e;if(Ba(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Yo(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Yo(e[r],t));return n}return e}function Xy(e,t){return e.data=Xo(e.data,t),delete e.attachments,e}function Xo(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Xo(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Xo(e[n],t));return e}const Jy=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var le;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(le||(le={}));class Qy{constructor(t){this.replacer=t}encode(t){return(t.type===le.EVENT||t.type===le.ACK)&&Ki(t)?this.encodeAsBinary({type:t.type===le.EVENT?le.BINARY_EVENT:le.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===le.BINARY_EVENT||t.type===le.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Yy(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class za extends Ge{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===le.BINARY_EVENT;r||n.type===le.BINARY_ACK?(n.type=r?le.EVENT:le.ACK,this.reconstructor=new Zy(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ba(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(le[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===le.BINARY_EVENT||r.type===le.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(s,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const a=Number(o);if(!eb(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=a}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(za.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case le.CONNECT:return bc(n);case le.DISCONNECT:return n===void 0;case le.CONNECT_ERROR:return typeof n=="string"||bc(n);case le.EVENT:case le.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Jy.indexOf(n[0])===-1);case le.ACK:case le.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Zy{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=Xy(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const eb=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function bc(e){return Object.prototype.toString.call(e)==="[object Object]"}const tb=Object.freeze(Object.defineProperty({__proto__:null,Decoder:za,Encoder:Qy,get PacketType(){return le}},Symbol.toStringTag,{value:"Module"}));function It(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const nb=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Hf extends Ge{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[It(t,"open",this.onopen.bind(this)),It(t,"packet",this.onpacket.bind(this)),It(t,"error",this.onerror.bind(this)),It(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,s;if(nb.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:le.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,f=n.pop();this._registerAckCallback(u,f),o.id=u}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>(this._queue[0],i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:le.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case le.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case le.EVENT:case le.BINARY_EVENT:this.onevent(t);break;case le.ACK:case le.BINARY_ACK:this.onack(t);break;case le.DISCONNECT:this.ondisconnect();break;case le.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:le.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:le.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function kr(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}kr.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};kr.prototype.reset=function(){this.attempts=0};kr.prototype.setMin=function(e){this.ms=e};kr.prototype.setMax=function(e){this.max=e};kr.prototype.setJitter=function(e){this.jitter=e};class Jo extends Ge{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,js(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new kr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||tb;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Uy(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=It(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=It(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(It(t,"ping",this.onping.bind(this)),It(t,"data",this.ondata.bind(this)),It(t,"error",this.onerror.bind(this)),It(t,"close",this.onclose.bind(this)),It(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Cs(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Hf(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Dr={};function Gi(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Wy(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Dr[i]&&s in Dr[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Jo(r,t):(Dr[i]||(Dr[i]=new Jo(r,t)),l=Dr[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Gi,{Manager:Jo,Socket:Hf,io:Gi,connect:Gi});const Q=Gi({autoConnect:!0,reconnection:!0,reconnectionDelay:1e3,reconnectionAttempts:1/0,reconnectionDelayMax:1e4});function rb(e){if(typeof e!="object"||e===null)return!1;const t=e;return t.version===1&&typeof t.name=="string"&&Array.isArray(t.lists)&&Array.isArray(t.edges)&&t.lists.every(ib)&&t.edges.every(ab)&&(t.branchingMode===void 0||t.branchingMode==="trunk"||t.branchingMode==="worktree")}function ib(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&typeof t.label=="string"&&typeof t.order=="number"&&typeof t.color=="string"&&typeof t.hex=="string"&&typeof t.hasDirectory=="boolean"}const sb={guard:"blocker",gate:"advisor",lifecycle:"operator",observer:"silent"};function ob(e){return sb[e.category]}function ab(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.from=="string"&&typeof t.to=="string"&&typeof t.direction=="string"&&typeof t.label=="string"&&typeof t.description=="string"}class lb{constructor(t){yt(this,"config");yt(this,"listMap");yt(this,"edgeMap");yt(this,"edgesByFrom");yt(this,"statusOrder");yt(this,"hookMap");yt(this,"terminalStatuses");yt(this,"allowedPrefixes");this.init(t)}reload(t){this.init(t)}init(t){if(this.config=t,!t.lists.length)throw new Error("WorkflowConfig must have at least 1 list");if(!t.edges.length)throw new Error("WorkflowConfig must have at least 1 edge");const n=t.lists.filter(r=>r.isEntryPoint);if(n.length!==1)throw new Error(`WorkflowConfig must have exactly 1 entry point, found ${n.length}`);this.listMap=new Map(t.lists.map(r=>[r.id,r])),this.edgeMap=new Map(t.edges.map(r=>[`${r.from}:${r.to}`,r])),this.edgesByFrom=new Map;for(const r of t.edges){const i=this.edgesByFrom.get(r.from);i?i.push(r):this.edgesByFrom.set(r.from,[r])}this.statusOrder=new Map(t.lists.map(r=>[r.id,r.order])),this.hookMap=new Map((t.hooks??[]).map(r=>[r.id,r])),this.terminalStatuses=new Set(t.terminalStatuses??[]),this.allowedPrefixes=t.allowedCommandPrefixes??[]}getConfig(){return this.config}getBranchingMode(){return this.config.branchingMode??"trunk"}getLists(){return[...this.config.lists].sort((t,n)=>t.order-n.order)}getList(t){return this.listMap.get(t)}getEntryPoint(){return this.config.lists.find(t=>t.isEntryPoint)}getBatchLists(){return this.config.lists.filter(t=>t.supportsBatch)}getSprintLists(){return this.config.lists.filter(t=>t.supportsSprint)}getBoardColumns(){return this.getLists().map(t=>({id:t.id,label:t.label,color:t.color}))}findEdge(t,n){return this.edgeMap.get(`${t}:${n}`)}isValidTransition(t,n){return this.edgeMap.has(`${t}:${n}`)}getValidTargets(t){return(this.edgesByFrom.get(t)??[]).map(n=>n.to)}getAllEdges(){return this.config.edges}getEdgesByDirection(t){return this.config.edges.filter(n=>n.direction===t)}validateTransition(t,n,r){if(!this.listMap.has(n))return{ok:!1,error:`Invalid status: '${n}'`,code:"INVALID_STATUS"};if(r==="bulk-sync"||r==="rollback")return{ok:!0};if(t===n)return{ok:!0};const i=this.findEdge(t,n);return i?r==="patch"&&i.dispatchOnly?{ok:!1,error:`Transition '${t}' -> '${n}' requires dispatch (use a skill command)`,code:"DISPATCH_REQUIRED"}:{ok:!0}:{ok:!1,error:`Transition '${t}' -> '${n}' is not allowed`,code:"INVALID_TRANSITION"}}isValidStatus(t){return this.listMap.has(t)}isTerminalStatus(t){return this.terminalStatuses.has(t)}buildCommand(t,n){return t.command?t.command.replace("{id}",String(n)):null}isAllowedCommand(t){return this.allowedPrefixes.some(n=>t.startsWith(n))}getBatchTargetStatus(t){const r=(this.edgesByFrom.get(t)??[]).find(i=>(i.direction==="forward"||i.direction==="shortcut")&&i.dispatchOnly);return r==null?void 0:r.to}getBatchCommand(t){const r=(this.edgesByFrom.get(t)??[]).find(i=>(i.direction==="forward"||i.direction==="shortcut")&&i.dispatchOnly);if(r!=null&&r.command)return r.command.replace(" {id}","").replace("{id}","")}inferStatus(t,n,r){var c;const i=(this.config.eventInference??[]).filter(u=>u.eventType===t);if(!i.length)return null;const s=i.filter(u=>u.conditions&&Object.keys(u.conditions).length>0),o=i.filter(u=>!u.conditions||Object.keys(u.conditions).length===0),a=s.find(u=>this.matchesConditions(u.conditions,r))??o[0]??null;if(!a)return null;if(((c=a.conditions)==null?void 0:c.dispatchResolution)===!0)return{dispatchResolution:!0,resolution:r.outcome==="failure"?"failed":"completed"};let l;if(a.targetStatus===""&&a.dataField){const u=String(r[a.dataField]??"");a.dataMap?l=a.dataMap[u]??a.dataMap._default??"":l=u}else l=a.targetStatus;if(!l)return null;if(a.forwardOnly){const u=this.statusOrder.get(n)??-1;if((this.statusOrder.get(l)??-1)<=u)return null}return l}matchesConditions(t,n){for(const[r,i]of Object.entries(t)){if(r==="dispatchResolution")continue;const s=n[r];if(Array.isArray(i)){if(!i.includes(s))return!1}else if(s!==i)return!1}return!0}getListByGitBranch(t){return this.config.lists.find(n=>n.gitBranch===t)}getGitBranch(t){var n;return(n=this.listMap.get(t))==null?void 0:n.gitBranch}getSessionKey(t){var n;return(n=this.listMap.get(t))==null?void 0:n.sessionKey}getActiveHooksForList(t){var n;return((n=this.listMap.get(t))==null?void 0:n.activeHooks)??[]}getAgentsForEdge(t,n){var r;return((r=this.findEdge(t,n))==null?void 0:r.agents)??[]}getStatusOrder(t){return this.statusOrder.get(t)??-1}isForwardMovement(t,n){return this.getStatusOrder(n)>this.getStatusOrder(t)}getHooksForEdge(t,n){var i;const r=this.findEdge(t,n);return(i=r==null?void 0:r.hooks)!=null&&i.length?r.hooks.map(s=>this.hookMap.get(s)).filter(s=>s!==void 0):[]}getAllHooks(){return this.config.hooks??[]}getHookEnforcement(t){return ob(t)}getHooksByCategory(t){return(this.config.hooks??[]).filter(n=>n.category===t)}generateCSSVariables(){return this.getLists().map(t=>`--status-${t.id}: ${t.color};`).join(`
|
|
3
|
+
`)}generateShellManifest(){const t=[],n=this.getLists();t.push("#!/bin/bash"),t.push("# Auto-generated by WorkflowEngine — DO NOT EDIT"),t.push(`# Generated: ${new Date().toISOString()}`),t.push(`# Workflow: "${this.config.name}" (version ${this.config.version})`),t.push(""),t.push("# ─── Branching mode (trunk or worktree) ───"),t.push(`WORKFLOW_BRANCHING_MODE="${this.getBranchingMode()}"`),t.push(""),t.push("# ─── Valid statuses (space-separated) ───"),t.push(`WORKFLOW_STATUSES="${n.map(i=>i.id).join(" ")}"`),t.push(""),t.push("# ─── Statuses that have a scopes/ subdirectory ───");const r=n.filter(i=>i.hasDirectory).map(i=>i.id);t.push(`WORKFLOW_DIR_STATUSES="${r.join(" ")}"`),t.push(""),t.push("# ─── Terminal statuses ───"),t.push(`WORKFLOW_TERMINAL_STATUSES="${[...this.terminalStatuses].join(" ")}"`),t.push(""),t.push("# ─── Entry point status ───"),t.push(`WORKFLOW_ENTRY_STATUS="${this.getEntryPoint().id}"`),t.push(""),t.push("# ─── Transition edges (from:to:sessionKey) ───"),t.push("WORKFLOW_EDGES=(");for(const i of this.config.edges){const s=this.listMap.get(i.to),o=(s==null?void 0:s.sessionKey)??"";t.push(` "${i.from}:${i.to}:${o}"`)}t.push(")"),t.push(""),t.push("# ─── Branch-to-transition mapping (gitBranch:from:to:sessionKey) ───"),t.push("WORKFLOW_BRANCH_MAP=(");for(const i of this.config.edges){const s=this.listMap.get(i.to);if(s!=null&&s.gitBranch){const o=s.sessionKey??"";t.push(` "${s.gitBranch}:${i.from}:${i.to}:${o}"`)}}t.push(")"),t.push(""),t.push("# ─── Commit session branch patterns (regex) ───"),t.push(`WORKFLOW_COMMIT_BRANCHES="${this.config.commitBranchPatterns??""}"`),t.push(""),t.push("# ─── Backward-compat direction aliases (alias:from:to:sessionKey) ───"),t.push("WORKFLOW_DIRECTION_ALIASES=(");for(const i of this.config.edges){if(i.direction!=="forward"||!i.dispatchOnly)continue;const s=this.listMap.get(i.to);if(!s)continue;const o=s.group;if(o!=null&&o.startsWith("deploy")){const a=s.sessionKey??"";t.push(` "to-${i.to}:${i.from}:${i.to}:${a}"`)}}return t.push(")"),t.push(""),t.push("# ─── Helper functions ──────────────────────────────"),t.push(""),t.push("status_to_dir() {"),t.push(' local scope_status="$1"'),t.push(" for s in $WORKFLOW_DIR_STATUSES; do"),t.push(' [ "$s" = "$scope_status" ] && echo "$scope_status" && return 0'),t.push(" done"),t.push(' echo "$WORKFLOW_ENTRY_STATUS"'),t.push("}"),t.push(""),t.push("status_to_branch() {"),t.push(' local status="$1"'),t.push(' for entry in "${WORKFLOW_BRANCH_MAP[@]}"; do'),t.push(` IFS=':' read -r branch from to skey <<< "$entry"`),t.push(' [ "$to" = "$status" ] && echo "$branch" && return 0'),t.push(" done"),t.push(' echo ""'),t.push("}"),t.push(""),t.push("is_valid_status() {"),t.push(' local status="$1"'),t.push(" for s in $WORKFLOW_STATUSES; do"),t.push(' [ "$s" = "$status" ] && return 0'),t.push(" done"),t.push(" return 1"),t.push("}"),t.join(`
|
|
4
|
+
`)+`
|
|
5
|
+
`}}function Es(e){m.useEffect(()=>(Q.on("connect",e),()=>{Q.off("connect",e)}),[e]),m.useEffect(()=>{function t(){document.visibilityState==="visible"&&e()}return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[e])}function qf(e,t=100){const n=m.useRef(e);n.current=e;const r=m.useRef(null);return m.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),m.useCallback(()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,n.current()},t)},[t])}const Kf=m.createContext(null);function cb({children:e}){const[t,n]=m.useState([]),[r,i]=m.useState(!0),[s,o]=Cf(),a=s.get("project"),l=a==="__all__"?null:a??null,c=m.useCallback(j=>{o(w=>{const k=new URLSearchParams(w);return j===null?k.set("project","__all__"):k.set("project",j),k},{replace:!0})},[o]),u=m.useCallback(async()=>{try{const j=await fetch("/api/orbital/projects?include=workflow");if(!j.ok){n([]),i(!1);return}const w=await j.json();n(w);const k=new Map;for(const P of w)P.workflow&&rb(P.workflow)&&k.set(P.id,new lb(P.workflow));k.size>0&&v(k)}catch{n([])}finally{i(!1)}},[]);m.useEffect(()=>{u()},[u]);const f=m.useRef(!1);m.useEffect(()=>{f.current||a||t.length===0||(f.current=!0,t.length===1&&o(j=>{const w=new URLSearchParams(j);return w.set("project",t[0].id),w},{replace:!0}))},[t,a,o]),m.useEffect(()=>{if(r||!l||t.length===0)return;const j=t.find(w=>w.id===l);(!j||!j.enabled)&&c(null)},[t,l,r,c]);const h=qf(u);m.useEffect(()=>(Q.on("project:registered",h),Q.on("project:unregistered",h),Q.on("project:status:changed",h),Q.on("project:updated",h),()=>{Q.off("project:registered",h),Q.off("project:unregistered",h),Q.off("project:status:changed",h),Q.off("project:updated",h)}),[h]),m.useEffect(()=>{function j(){l?Q.emit("subscribe",{projectId:l}):Q.emit("subscribe",{scope:"all"})}return j(),Q.on("connect",j),()=>{Q.off("connect",j),l?Q.emit("unsubscribe",{projectId:l}):Q.emit("unsubscribe",{scope:"all"})}},[l]);const p=m.useCallback(j=>{var w;return((w=t.find(k=>k.id===j))==null?void 0:w.color)??"210 80% 55%"},[t]),g=m.useCallback(j=>{var w;return((w=t.find(k=>k.id===j))==null?void 0:w.name)??j},[t]),b=m.useCallback(j=>{const w=j!==void 0?j:l;return w?`/api/orbital/projects/${w}`:"/api/orbital/aggregate"},[l]),y=t.length>1,[x,v]=m.useState(new Map);m.useEffect(()=>(Q.on("workflow:changed",h),()=>{Q.off("workflow:changed",h)}),[h]),Es(u);const C=m.useMemo(()=>({projects:t,activeProjectId:l,setActiveProjectId:c,getProjectColor:p,getProjectName:g,loading:r,hasMultipleProjects:y,getApiBase:b,projectEngines:x}),[t,l,c,p,g,r,y,b,x]);return d.jsx(Kf.Provider,{value:C,children:e})}function Gt(){const e=m.useContext(Kf);if(!e)throw new Error("useProjects must be used within a ProjectProvider");return e}const Gf=m.createContext(null);function ub({children:e}){var l;const{activeProjectId:t,projects:n,projectEngines:r,loading:i}=Gt(),s=t??((l=n[0])==null?void 0:l.id)??null;let o=s?r.get(s)??null:null;!o&&r.size>0&&(o=r.values().next().value??null),m.useEffect(()=>{if(!o)return;const c=o.generateCSSVariables();for(const u of c.split(`
|
|
6
|
+
`)){const f=u.match(/^(--[\w-]+):\s*(.+);$/);f&&document.documentElement.style.setProperty(f[1],f[2])}},[o]);const a=m.useMemo(()=>o?{engine:o}:null,[o]);return a?d.jsx(Gf.Provider,{value:a,children:e}):i?null:n.length===0?d.jsx("div",{className:"flex h-screen items-center justify-center bg-background",children:d.jsxs("div",{className:"flex flex-col items-center gap-3 max-w-sm text-center",children:[d.jsx("span",{className:"text-sm text-destructive",children:"No Projects"}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:["No projects registered. Run ",d.jsx("code",{children:"orbital register"})," to add a project."]})]})}):d.jsx("div",{className:"flex h-screen items-center justify-center bg-background",children:d.jsxs("div",{className:"flex flex-col items-center gap-3",children:[d.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading workflow..."})]})})}function sn(){const e=m.useContext(Gf);if(!e)throw new Error("useWorkflow must be used within a WorkflowProvider");return e}function ce(e){return e.project_id?`${e.project_id}::${e.id}`:String(e.id)}function db(e){const t=e.indexOf("::");return t>=0?{scopeId:Number(e.slice(t+2)),projectId:e.slice(0,t)}:{scopeId:Number(e)}}const fb={activeScopes:new Set,abandonedScopes:new Map,recoverScope:async()=>{},dismissAbandoned:async()=>{}},Yf=m.createContext(fb);function hb(){const{engine:e}=sn(),{getApiBase:t,activeProjectId:n}=Gt(),r=m.useMemo(()=>new Set(e.getConfig().terminalStatuses??[]),[e]),[i,s]=m.useState(new Set),[o,a]=m.useState(new Map),l=m.useRef(!0),c=m.useRef(n);c.current=n;const u=m.useMemo(()=>n?`${t(n)}/dispatch/active-scopes`:"/api/orbital/aggregate/dispatch/active-scopes",[n,t]),f=m.useCallback((y,x)=>ce({id:y,project_id:x??n??void 0}),[n]),h=m.useCallback(y=>{a(x=>{if(!x.has(y))return x;const v=new Map(x);return v.delete(y),v})},[]),p=m.useCallback(async y=>{try{const x=await fetch(u,{signal:y});if(!x.ok){console.warn("[Orbital] Failed to fetch active scopes:",x.status,x.statusText),s(new Set),a(new Map);return}const v=await x.json();if(!l.current)return;const C=new Set;for(const j of v.scope_ids)typeof j=="number"?C.add(f(j)):C.add(ce({id:j.scope_id,project_id:j.project_id}));if(s(C),v.abandoned_scopes){const j=new Map;for(const w of v.abandoned_scopes){const k=w.project_id?ce({id:w.scope_id,project_id:w.project_id}):f(w.scope_id);j.set(k,{from_status:w.from_status,abandoned_at:w.abandoned_at,project_id:w.project_id})}a(j)}}catch(x){if(x instanceof DOMException&&x.name==="AbortError")return;s(new Set),a(new Map)}},[u,f]),g=m.useCallback(async(y,x,v)=>{try{const C=v??n,j=t(C),w=await fetch(`${j}/dispatch/recover/${y}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from_status:x})});if(!w.ok){const P=await w.json().catch(()=>({error:w.statusText}));console.error("[Orbital] Failed to recover scope:",P.error);return}const k=ce({id:y,project_id:C??void 0});h(k)}catch(C){console.error("[Orbital] Failed to recover scope:",C)}},[h,n,t]),b=m.useCallback(async(y,x)=>{try{const v=x??n,C=t(v),j=await fetch(`${C}/dispatch/dismiss-abandoned/${y}`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!j.ok){const k=await j.json().catch(()=>({error:j.statusText}));console.error("[Orbital] Failed to dismiss abandoned scope:",k.error);return}const w=ce({id:y,project_id:v??void 0});h(w)}catch(v){console.error("[Orbital] Failed to dismiss abandoned scope:",v)}},[h,n,t]);return m.useEffect(()=>{l.current=!0;const y=new AbortController;return p(y.signal),()=>{l.current=!1,y.abort()}},[p]),m.useEffect(()=>{function y(w){return w.project_id}function x(w){if(w.type!=="DISPATCH"||w.data.resolved!=null)return;const k=y(w),P=[];if(w.scope_id!=null&&P.push(w.scope_id),Array.isArray(w.data.scope_ids))for(const N of w.data.scope_ids)P.includes(N)||P.push(N);if(P.length!==0){s(N=>{const T=P.map(A=>ce({id:A,project_id:k??c.current??void 0})).filter(A=>!N.has(A));if(T.length===0)return N;const R=new Set(N);for(const A of T)R.add(A);return R});for(const N of P)h(ce({id:N,project_id:k??c.current??void 0}))}}function v(w){const k=y(w),P=[];if(w.scope_id!=null&&P.push(w.scope_id),Array.isArray(w.scope_ids)&&P.push(...w.scope_ids),P.length===0)return;const N=P.map(M=>ce({id:M,project_id:k??c.current??void 0}));if(s(M=>{const T=N.filter(A=>M.has(A));if(T.length===0)return M;const R=new Set(M);for(const A of T)R.delete(A);return R}),w.outcome==="abandoned")p();else for(const M of N)h(M)}function C(w){if(r.has(w.status)){const k=y(w),P=ce({id:w.id,project_id:k??w.project_id??c.current??void 0});s(N=>{if(!N.has(P))return N;const M=new Set(N);return M.delete(P),M}),h(P)}}function j(){p()}return Q.on("event:new",x),Q.on("dispatch:resolved",v),Q.on("scope:updated",C),Q.on("connect",j),()=>{Q.off("event:new",x),Q.off("dispatch:resolved",v),Q.off("scope:updated",C),Q.off("connect",j)}},[p,h,r]),{activeScopes:i,abandonedScopes:o,recoverScope:g,dismissAbandoned:b}}function Xf(){return m.useContext(Yf)}function Vn(e,t,n){const r=(n==null?void 0:n.serialize)??JSON.stringify,i=(n==null?void 0:n.deserialize)??JSON.parse,s=m.useRef(r),o=m.useRef(i);s.current=r,o.current=i;const[a,l]=m.useState(()=>{try{const u=localStorage.getItem(e);if(u!==null){const f=i(u);return f!==void 0?f:t}}catch{}return t}),c=m.useCallback(u=>{l(f=>{const h=typeof u=="function"?u(f):u;try{localStorage.setItem(e,s.current(h))}catch{}return h})},[e]);return m.useEffect(()=>{function u(f){if(f.key===e)try{if(f.newValue!==null){const h=o.current(f.newValue);h!==void 0&&l(h)}else l(t)}catch{}}return window.addEventListener("storage",u),()=>window.removeEventListener("storage",u)},[e,t]),[a,c]}const Jf={serialize:e=>JSON.stringify([...e]),deserialize:e=>{const t=JSON.parse(e);return Array.isArray(t)?new Set(t):void 0}},Xn=[{id:"welcome",target:"nav-kanban",title:"Welcome to Orbital Command",description:"This is your project management dashboard for Claude Code projects. Let's take a quick tour of what everything does.",page:"/"},{id:"kanban-board",target:"kanban-board",title:"Kanban Board",description:"Your scopes are organized into columns that represent workflow stages. Each column maps to a status in your workflow configuration.",page:"/",placement:"right",maxSpotlightWidth:800},{id:"kanban-column",target:"kanban-column",title:"Workflow Columns",description:"Columns are driven by your workflow DAG — transitions between statuses are defined as edges. Drag scopes between columns to update their status.",page:"/",optional:!0,placement:"bottom"},{id:"scope-card",target:"scope-card",title:"Scope Cards",description:"Each card represents a scope — a unit of work with phases, success criteria, and a definition of done. Click a card to see its full details.",page:"/",optional:!0,placement:"bottom"},{id:"nav-primitives",target:"nav-primitives",title:"Primitives",description:"View and manage the building blocks of your project — hooks, skills, agents, and workflow presets that power your Claude Code setup.",page:"/primitives"},{id:"nav-guards",target:"nav-guards",title:"Guards",description:"Quality gates and enforcement rules that run before transitions. Configure type checks, tests, linting, and custom validation commands.",page:"/guards"},{id:"nav-repo",target:"nav-repo",title:"Repo",description:"Source control integration — view branches, recent commits, and GitHub connection status for your project.",page:"/repo"},{id:"nav-sessions",target:"nav-sessions",title:"Sessions",description:"Track Claude Code agent sessions — see what's running, review session history, and monitor dispatch progress in real time.",page:"/sessions"},{id:"nav-workflow",target:"nav-workflow",title:"Workflow",description:"The visual DAG editor for your workflow configuration. Define statuses, transitions, hooks, and event inference rules that drive the Kanban board.",page:"/workflow"},{id:"nav-settings",target:"nav-settings",title:"Settings",description:"Customize appearance, font, zoom level, and other preferences. You can restart this tour anytime from here."}],Qf=m.createContext(null),pb={isActive:!1,currentStepIndex:-1,currentStep:null,totalSteps:0,targetElement:null,next:()=>{},back:()=>{},skip:()=>{},restart:()=>{},start:()=>{}};function mb(){return m.useContext(Qf)??pb}const gb="cc-onboarding-tour",vc=5e3;function xb({children:e}){const[t,n]=Vn(gb,"pending"),[r,i]=m.useState(-1),[s,o]=m.useState(null),a=jf(),l=vx(),c=m.useRef(l);c.current=l;const u=m.useRef(null),f=m.useRef(null),h=m.useRef(!1),p=r>=0&&r<Xn.length,g=m.useCallback(()=>{u.current&&(u.current.disconnect(),u.current=null),f.current&&(clearTimeout(f.current),f.current=null)},[]),b=m.useCallback(T=>document.querySelector(`[data-tour="${T}"]`),[]),y=m.useCallback((T,R,A)=>{g();const _=b(T.target);if(_){R(_);return}u.current=new MutationObserver(()=>{const L=b(T.target);L&&(g(),R(L))}),u.current.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tour"]}),f.current=setTimeout(()=>{g(),A()},vc)},[g,b]),x=m.useCallback(T=>{if(h.current)return;if(T<0||T>=Xn.length){i(-1),o(null),g();return}h.current=!0;const R=Xn[T],A=c.current.pathname;R.page&&R.page!==A&&a(R.page+c.current.search),y(R,_=>{h.current=!1,i(T),o(_)},()=>{h.current=!1,R.optional?x(T+1):(console.warn(`[Onboarding] Target "${R.target}" not found after ${vc}ms on step "${R.id}"`),i(T),o(null))})},[a,y,g]),v=m.useCallback(()=>{const T=r+1;T>=Xn.length?(n("completed"),i(-1),o(null),g(),c.current.pathname!=="/"&&a("/"+c.current.search)):x(T)},[r,n,x,g]),C=m.useCallback(()=>{r>0&&x(r-1)},[r,x]),j=m.useCallback(()=>{n("dismissed"),i(-1),o(null),g()},[n,g]),w=m.useCallback(()=>{n("pending"),x(0)},[n,x]),k=m.useCallback(()=>{p||x(0)},[p,x]);m.useEffect(()=>{if(!p||!s)return;const T=new MutationObserver(()=>{document.body.contains(s)||(o(null),v())});return T.observe(document.body,{childList:!0,subtree:!0}),()=>T.disconnect()},[p,s,v]),m.useEffect(()=>{t!=="pending"&&p&&(i(-1),o(null),g())},[t,p,g]);const P=m.useRef(!1);m.useEffect(()=>{if(!P.current&&t==="pending"&&!p){const T=setTimeout(()=>{P.current||(P.current=!0,x(0))},500);return()=>clearTimeout(T)}},[t,p,x]),m.useEffect(()=>()=>g(),[g]);const N=p?Xn[r]:null,M={isActive:p,currentStepIndex:r,currentStep:N,totalSteps:Xn.length,targetElement:s,next:v,back:C,skip:j,restart:w,start:k};return d.jsx(Qf.Provider,{value:M,children:e})}/**
|
|
7
|
+
* @license lucide-react v0.577.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Zf=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
12
|
+
* @license lucide-react v0.577.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const yb=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
17
|
+
* @license lucide-react v0.577.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const bb=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
22
|
+
* @license lucide-react v0.577.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const wc=e=>{const t=bb(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
27
|
+
* @license lucide-react v0.577.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/var vb={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"};/**
|
|
32
|
+
* @license lucide-react v0.577.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const wb=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
37
|
+
* @license lucide-react v0.577.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const kb=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>m.createElement("svg",{ref:l,...vb,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Zf("lucide",i),...!s&&!wb(a)&&{"aria-hidden":"true"},...a},[...o.map(([c,u])=>m.createElement(c,u)),...Array.isArray(s)?s:[s]]));/**
|
|
42
|
+
* @license lucide-react v0.577.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const te=(e,t)=>{const n=m.forwardRef(({className:r,...i},s)=>m.createElement(kb,{ref:s,iconNode:t,className:Zf(`lucide-${yb(wc(e))}`,`lucide-${e}`,r),...i}));return n.displayName=wc(e),n};/**
|
|
47
|
+
* @license lucide-react v0.577.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/const Sb=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Cb=te("arrow-left",Sb);/**
|
|
52
|
+
* @license lucide-react v0.577.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const jb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],es=te("arrow-right",jb);/**
|
|
57
|
+
* @license lucide-react v0.577.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/const Eb=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Sr=te("check",Eb);/**
|
|
62
|
+
* @license lucide-react v0.577.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const Tb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],eh=te("chevron-down",Tb);/**
|
|
67
|
+
* @license lucide-react v0.577.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const Nb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ri=te("chevron-right",Nb);/**
|
|
72
|
+
* @license lucide-react v0.577.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const Pb=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ab=te("chevron-up",Pb);/**
|
|
77
|
+
* @license lucide-react v0.577.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const _b=[["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"}]],Rb=te("circle-alert",_b);/**
|
|
82
|
+
* @license lucide-react v0.577.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/const Mb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Db=te("circle-check",Mb);/**
|
|
87
|
+
* @license lucide-react v0.577.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const Ob=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],Ib=te("circle-minus",Ob);/**
|
|
92
|
+
* @license lucide-react v0.577.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const Lb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Fb=te("circle",Lb);/**
|
|
97
|
+
* @license lucide-react v0.577.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const Bb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Qo=te("clock",Bb);/**
|
|
102
|
+
* @license lucide-react v0.577.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const zb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],th=te("columns-3",zb);/**
|
|
107
|
+
* @license lucide-react v0.577.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const Vb=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],$b=te("download",Vb);/**
|
|
112
|
+
* @license lucide-react v0.577.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const Ub=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],Wb=te("ellipsis-vertical",Ub);/**
|
|
117
|
+
* @license lucide-react v0.577.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const Hb=[["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"}]],nh=te("external-link",Hb);/**
|
|
122
|
+
* @license lucide-react v0.577.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const qb=[["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"}]],rh=te("eye-off",qb);/**
|
|
127
|
+
* @license lucide-react v0.577.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const Kb=[["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"}]],ih=te("eye",Kb);/**
|
|
132
|
+
* @license lucide-react v0.577.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const Gb=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Yb=te("folder-plus",Gb);/**
|
|
137
|
+
* @license lucide-react v0.577.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const Xb=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Jb=te("funnel",Xb);/**
|
|
142
|
+
* @license lucide-react v0.577.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const Qb=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Zb=te("git-branch",Qb);/**
|
|
147
|
+
* @license lucide-react v0.577.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const e0=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],t0=te("git-commit-horizontal",e0);/**
|
|
152
|
+
* @license lucide-react v0.577.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const n0=[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]],r0=te("git-fork",n0);/**
|
|
157
|
+
* @license lucide-react v0.577.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const i0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],s0=te("info",i0);/**
|
|
162
|
+
* @license lucide-react v0.577.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const o0=[["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"}]],Ts=te("layers",o0);/**
|
|
167
|
+
* @license lucide-react v0.577.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const a0=[["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"}]],sh=te("layout-dashboard",a0);/**
|
|
172
|
+
* @license lucide-react v0.577.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const l0=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],c0=te("lightbulb",l0);/**
|
|
177
|
+
* @license lucide-react v0.577.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const u0=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Va=te("loader-circle",u0);/**
|
|
182
|
+
* @license lucide-react v0.577.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const d0=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],oh=te("package",d0);/**
|
|
187
|
+
* @license lucide-react v0.577.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const f0=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ts=te("plus",f0);/**
|
|
192
|
+
* @license lucide-react v0.577.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const h0=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],p0=te("puzzle",h0);/**
|
|
197
|
+
* @license lucide-react v0.577.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const m0=[["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"}]],g0=te("refresh-cw",m0);/**
|
|
202
|
+
* @license lucide-react v0.577.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const x0=[["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"}]],y0=te("rotate-ccw",x0);/**
|
|
207
|
+
* @license lucide-react v0.577.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const b0=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],ah=te("rows-3",b0);/**
|
|
212
|
+
* @license lucide-react v0.577.0 - ISC
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the ISC license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const v0=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],w0=te("search",v0);/**
|
|
217
|
+
* @license lucide-react v0.577.0 - ISC
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the ISC license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/const k0=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],S0=te("settings-2",k0);/**
|
|
222
|
+
* @license lucide-react v0.577.0 - ISC
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the ISC license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/const C0=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],j0=te("settings",C0);/**
|
|
227
|
+
* @license lucide-react v0.577.0 - ISC
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the ISC license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/const E0=[["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"}]],T0=te("shield-check",E0);/**
|
|
232
|
+
* @license lucide-react v0.577.0 - ISC
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the ISC license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/const N0=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],P0=te("sliders-horizontal",N0);/**
|
|
237
|
+
* @license lucide-react v0.577.0 - ISC
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the ISC license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/const A0=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],$a=te("sparkles",A0);/**
|
|
242
|
+
* @license lucide-react v0.577.0 - ISC
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the ISC license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/const _0=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],R0=te("square-check-big",_0);/**
|
|
247
|
+
* @license lucide-react v0.577.0 - ISC
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the ISC license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/const M0=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],D0=te("square",M0);/**
|
|
252
|
+
* @license lucide-react v0.577.0 - ISC
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the ISC license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/const O0=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],I0=te("star",O0);/**
|
|
257
|
+
* @license lucide-react v0.577.0 - ISC
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the ISC license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const L0=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Ns=te("terminal",L0);/**
|
|
262
|
+
* @license lucide-react v0.577.0 - ISC
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the ISC license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const F0=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],B0=te("trash-2",F0);/**
|
|
267
|
+
* @license lucide-react v0.577.0 - ISC
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the ISC license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/const z0=[["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"}]],wn=te("triangle-alert",z0);/**
|
|
272
|
+
* @license lucide-react v0.577.0 - ISC
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the ISC license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/const V0=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],$0=te("undo-2",V0);/**
|
|
277
|
+
* @license lucide-react v0.577.0 - ISC
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the ISC license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/const U0=[["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"}]],W0=te("workflow",U0);/**
|
|
282
|
+
* @license lucide-react v0.577.0 - ISC
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the ISC license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/const H0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],wt=te("x",H0);class lh extends m.Component{constructor(){super(...arguments);yt(this,"state",{hasError:!1,error:null});yt(this,"handleReload",()=>{this.setState({hasError:!1,error:null})})}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary]",n,r.componentStack)}render(){var n;return this.state.hasError?d.jsx("div",{className:"flex h-full items-center justify-center p-8",children:d.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 text-center",children:[d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:d.jsx(wn,{className:"h-6 w-6 text-destructive"})}),d.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:((n=this.state.error)==null?void 0:n.message)??"An unexpected error occurred."}),d.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-1.5 rounded bg-surface-light px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-border",children:[d.jsx(y0,{className:"h-3.5 w-3.5"}),"Retry"]})]})}):this.props.children}}function Cr(){return m.useEffect(()=>{document.documentElement.setAttribute("data-theme","neon-glass")},[]),{neonGlass:!0}}const kc={fontFamily:"Space Grotesk",fontScale:1.1,reduceMotion:!1,showBackgroundEffects:!0,showStatusBar:!0,compactMode:!1},Ua="cc-settings",ch=[{family:"JetBrains Mono",category:"monospace",label:"JetBrains Mono"},{family:"Space Mono",category:"monospace",label:"Space Mono"},{family:"Fira Code",category:"monospace",label:"Fira Code"},{family:"IBM Plex Mono",category:"monospace",label:"IBM Plex Mono"},{family:"Source Code Pro",category:"monospace",label:"Source Code Pro"},{family:"Space Grotesk",category:"sans-serif",label:"Space Grotesk"},{family:"Inter",category:"sans-serif",label:"Inter"},{family:"Outfit",category:"sans-serif",label:"Outfit"},{family:"Sora",category:"sans-serif",label:"Sora"},{family:"Orbitron",category:"display",label:"Orbitron"},{family:"Exo 2",category:"display",label:"Exo 2"}],to="cc-dynamic-font",Sc="cc-font-previews";function q0(e){if(e==="JetBrains Mono"){const i=document.getElementById(to);i&&i.remove();return}const n=`https://fonts.googleapis.com/css2?family=${e.replace(/ /g,"+")}:wght@300;400;500;600;700&display=swap`;let r=document.getElementById(to);if(r){if(r.href===n)return;r.href=n}else r=document.createElement("link"),r.id=to,r.rel="stylesheet",r.href=n,document.head.appendChild(r)}function GD(){if(document.getElementById(Sc))return;const t=`https://fonts.googleapis.com/css2?${ch.filter(r=>r.family!=="JetBrains Mono").map(r=>`family=${r.family.replace(/ /g,"+")}:wght@400`).join("&")}&display=swap`,n=document.createElement("link");n.id=Sc,n.rel="stylesheet",n.href=t,document.head.appendChild(n)}function Cc(){try{const e=localStorage.getItem(Ua);if(e)return{...kc,...JSON.parse(e)}}catch{}return{...kc}}function K0(e){try{localStorage.setItem(Ua,JSON.stringify(e))}catch{}}function no(e){var r;const t=document.documentElement,n=((r=ch.find(i=>i.family===e.fontFamily))==null?void 0:r.category)==="monospace"?"monospace":"sans-serif";t.style.setProperty("--font-family",`'${e.fontFamily}', ${n}`),q0(e.fontFamily),t.style.setProperty("--font-scale",e.fontScale.toString()),e.reduceMotion?t.setAttribute("data-reduce-motion","true"):t.removeAttribute("data-reduce-motion"),e.compactMode?t.setAttribute("data-compact","true"):t.removeAttribute("data-compact")}const uh=m.createContext(null);function G0({children:e}){const[t,n]=m.useState(Cc),r=m.useCallback((i,s)=>{n(o=>{const a={...o,[i]:s};return K0(a),no(a),a})},[]);return m.useEffect(()=>{no(t)},[]),m.useEffect(()=>{const i=s=>{if(s.key===Ua){const o=Cc();n(o),no(o)}};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[]),d.jsx(uh.Provider,{value:{settings:t,updateSetting:r},children:e})}function Wa(){const e=m.useContext(uh);if(!e)throw new Error("useSettings must be used within a SettingsProvider");return e}const hr=m.forwardRef(({className:e,children:t,orientation:n="vertical",...r},i)=>d.jsxs(hf,{ref:i,className:F("relative overflow-hidden",e),...r,children:[d.jsx(Zg,{className:"h-full w-full rounded-[inherit]",children:t}),(n==="vertical"||n==="both")&&d.jsx(Zo,{orientation:"vertical"}),(n==="horizontal"||n==="both")&&d.jsx(Zo,{orientation:"horizontal"}),d.jsx(ex,{})]}));hr.displayName=hf.displayName;const Zo=m.forwardRef(({className:e,orientation:t="vertical",...n},r)=>d.jsx(pf,{ref:r,orientation:t,className:F("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-1.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-1.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:d.jsx(tx,{className:"relative flex-1 rounded-full bg-border"})}));Zo.displayName=pf.displayName;function Yt(){const{getApiBase:e,activeProjectId:t}=Gt();return m.useCallback(n=>`${e(t)}${n}`,[e,t])}function Y0(e){const[t,n]=m.useState(!0),[r,i]=m.useState(null),s=m.useRef(!0);m.useEffect(()=>(s.current=!0,()=>{s.current=!1}),[]),m.useEffect(()=>{const a=new AbortController;return n(!0),i(null),e(a.signal).catch(l=>{l instanceof DOMException&&l.name==="AbortError"||s.current&&i(l instanceof Error?l.message:"Fetch failed")}).finally(()=>{!a.signal.aborted&&s.current&&n(!1)}),()=>a.abort()},[e]);const o=m.useRef(()=>{e(new AbortController().signal).catch(()=>{})});return o.current=()=>{e(new AbortController().signal).catch(()=>{})},Es(()=>o.current()),{loading:t,error:r,refetch:o.current}}function dh(){const e=Yt(),{activeProjectId:t}=Gt(),[n,r]=m.useState([]),i=m.useCallback(async()=>{const l=await fetch(e("/scopes"));if(!l.ok)throw new Error(`HTTP ${l.status}`);const c=await l.json();if(t)for(const u of c)u.project_id||(u.project_id=t);r(c)},[e,t]),{loading:s,error:o}=Y0(i),a=qf(i);return m.useEffect(()=>{function l(g){return t?!g.project_id||g.project_id===t:!0}function c(g){l(g)&&(!g.project_id&&t&&(g.project_id=t),r(b=>{const y=b.findIndex(x=>x.id===g.id&&(!g.project_id||x.project_id===g.project_id));if(y>=0){const x=[...b];return x[y]=g,x}return[...b,g].sort((x,v)=>x.id-v.id)}))}function u(g){l(g)&&(!g.project_id&&t&&(g.project_id=t),r(b=>[...b,g].sort((y,x)=>y.id-x.id)))}function f(g){if(!t){a();return}g.project_id&&g.project_id!==t||r(b=>b.filter(y=>y.id!==g.id))}function h(g){if(g.enabled!==void 0&&!(t&&g.id!==t)){if(g.enabled===!1&&g.id===t){r([]);return}a()}}function p(g){t&&g.id!==t||g.status==="active"&&a()}return Q.on("scope:updated",c),Q.on("scope:created",u),Q.on("scope:deleted",f),Q.on("workflow:changed",a),Q.on("project:updated",h),Q.on("project:status:changed",p),()=>{Q.off("scope:updated",c),Q.off("scope:created",u),Q.off("scope:deleted",f),Q.off("workflow:changed",a),Q.off("project:updated",h),Q.off("project:status:changed",p)}},[a,t]),{scopes:n,loading:s,error:o,refetch:i}}const jc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ec=Ef,fh=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ec(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],f=s==null?void 0:s[c];if(u===null)return null;const h=jc(u)||jc(f);return i[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,h]=u;return h===void 0||(c[f]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:h,...p}=u;return Object.entries(p).every(g=>{let[b,y]=g;return Array.isArray(y)?y.includes({...s,...a}[b]):{...s,...a}[b]===y})?[...c,f,h]:c},[]);return Ec(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},X0=fh("inline-flex items-center rounded border px-1.5 py-0.5 text-xxs font-normal transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-[#00c85322] text-[#00c853] glow-green",warning:"border-transparent bg-[#ffab0022] text-[#ffab00] glow-amber",error:"border-transparent bg-[#ff174422] text-[#ff1744] glow-red"}},defaultVariants:{variant:"default"}});function Ve({className:e,variant:t,...n}){return d.jsx("div",{className:F(X0({variant:t}),e),...n})}function J0(e){const t=Q0(e),n=m.forwardRef((r,i)=>{const{children:s,...o}=r,a=m.Children.toArray(s),l=a.find(ev);if(l){const c=l.props.children,u=a.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return d.jsx(t,{...o,ref:i,children:m.isValidElement(c)?m.cloneElement(c,void 0,u):null})}return d.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function Q0(e){const t=m.forwardRef((n,r)=>{const{children:i,...s}=n;if(m.isValidElement(i)){const o=nv(i),a=tv(s,i.props);return i.type!==m.Fragment&&(a.ref=r?mf(r,o):o),m.cloneElement(i,a)}return m.Children.count(i)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Z0=Symbol("radix.slottable");function ev(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Z0}function tv(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function nv(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ps="Popover",[hh]=sx(Ps,[yf]),pi=yf(),[rv,jn]=hh(Ps),ph=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=e,a=pi(t),l=m.useRef(null),[c,u]=m.useState(!1),[f,h]=ux({prop:r,defaultProp:i??!1,onChange:s,caller:Ps});return d.jsx(dx,{...a,children:d.jsx(rv,{scope:t,contentId:fx(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})};ph.displayName=Ps;var mh="PopoverAnchor",iv=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=jn(mh,n),s=pi(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return m.useEffect(()=>(o(),()=>a()),[o,a]),d.jsx(vf,{...s,...r,ref:t})});iv.displayName=mh;var gh="PopoverTrigger",xh=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=jn(gh,n),s=pi(n),o=xf(t,i.triggerRef),a=d.jsx(bf.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":kh(i.open),...r,ref:o,onClick:qr(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:d.jsx(vf,{asChild:!0,...s,children:a})});xh.displayName=gh;var Ha="PopoverPortal",[sv,ov]=hh(Ha,{forceMount:void 0}),yh=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,s=jn(Ha,t);return d.jsx(sv,{scope:t,forceMount:n,children:d.jsx(gf,{present:n||s.open,children:d.jsx(nx,{asChild:!0,container:i,children:r})})})};yh.displayName=Ha;var pr="PopoverContent",bh=m.forwardRef((e,t)=>{const n=ov(pr,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,s=jn(pr,e.__scopePopover);return d.jsx(gf,{present:r||s.open,children:s.modal?d.jsx(lv,{...i,ref:t}):d.jsx(cv,{...i,ref:t})})});bh.displayName=pr;var av=J0("PopoverContent.RemoveScroll"),lv=m.forwardRef((e,t)=>{const n=jn(pr,e.__scopePopover),r=m.useRef(null),i=xf(t,r),s=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return rx(o)},[]),d.jsx(ix,{as:av,allowPinchZoom:!0,children:d.jsx(vh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qr(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:qr(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:qr(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),cv=m.forwardRef((e,t)=>{const n=jn(pr,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return d.jsx(vh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),vh=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,h=jn(pr,n),p=pi(n);return ox(),d.jsx(ax,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:d.jsx(lx,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:d.jsx(cx,{"data-state":kh(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),wh="PopoverClose",uv=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=jn(wh,n);return d.jsx(bf.button,{type:"button",...r,ref:t,onClick:qr(e.onClick,()=>i.onOpenChange(!1))})});uv.displayName=wh;var dv="PopoverArrow",fv=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=pi(n);return d.jsx(hx,{...i,...r,ref:t})});fv.displayName=dv;function kh(e){return e?"open":"closed"}var hv=ph,pv=xh,mv=yh,Sh=bh;const En=hv,Tn=pv,on=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...r},i)=>d.jsx(mv,{children:d.jsx(Sh,{ref:i,align:t,sideOffset:n,className:F("card-glass z-50 min-w-[180px] rounded border border-border bg-popover p-2 text-popover-foreground shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=top]:slide-in-from-bottom-2",e),...r})}));on.displayName=Sh.displayName;function gv(){const[e,t]=m.useState(null),[n,r]=m.useState(!1),[i,s]=m.useState(0),[o,a]=m.useState("idle"),[l,c]=m.useState(null),[u,f]=m.useState(!0),h=m.useCallback(async()=>{try{const y=await fetch("/api/orbital/version");if(!y.ok)throw new Error(`HTTP ${y.status}`);const x=await y.json();t(x)}catch{}finally{f(!1)}},[]),p=m.useCallback(async()=>{const y=await fetch("/api/orbital/version/check");if(!y.ok)throw new Error(`HTTP ${y.status}`);const x=await y.json();r(x.updateAvailable),s(x.behindCount)},[]);m.useEffect(()=>{h()},[h]),Es(h),m.useEffect(()=>{const y=setInterval(async()=>{try{await p()}catch{}},3e5);return()=>clearInterval(y)},[p]),m.useEffect(()=>{function y(v){a(v.stage)}function x(v){v.success?(a("done"),r(!1),s(0),h()):(a("error"),c(v.error??"Unknown error"))}return Q.on("version:updating",y),Q.on("version:updated",x),()=>{Q.off("version:updating",y),Q.off("version:updated",x)}},[]);const g=m.useCallback(async()=>{a("checking"),c(null);try{await p(),a("checked"),setTimeout(()=>a("idle"),4e3)}catch(y){a("error"),c(y.message)}},[p]),b=m.useCallback(async()=>{a("pulling"),c(null);try{const y=await fetch("/api/orbital/version/update",{method:"POST",headers:{"X-Orbital-Action":"update"}});if(!y.ok){const v=await y.json().catch(()=>({error:`HTTP ${y.status}`}));a("error"),c(v.error??"Update failed");return}const x=await y.json().catch(()=>null);x!=null&&x.success&&(a("done"),r(!1),s(0),h())}catch(y){a("error"),c(y.message)}},[h]);return{version:e,updateAvailable:n,behindCount:i,updateStage:o,updateError:l,loading:u,checkForUpdate:g,performUpdate:b}}function xv(){const{version:e,updateAvailable:t,behindCount:n,updateStage:r,updateError:i,loading:s,checkForUpdate:o,performUpdate:a}=gv();if(s)return null;if(!e)return d.jsx("button",{className:"version-badge flex items-center gap-1.5 rounded-lg px-2 py-1 text-[10px] font-mono text-muted-foreground/50",children:d.jsx("span",{children:"v?"})});const l=r==="checking"||r==="pulling"||r==="installing";return d.jsxs(En,{children:[d.jsx(Tn,{asChild:!0,children:d.jsxs("button",{className:"relative cursor-pointer",children:[d.jsxs(Ve,{variant:t?"warning":"success",className:"version-badge font-mono text-[10px] transition-colors",children:["v",e.version]}),t&&d.jsx("span",{className:"version-pulse-dot absolute -top-1 -right-1 h-2 w-2 rounded-full bg-emerald-400"})]})}),d.jsx(on,{side:"top",align:"end",sideOffset:8,className:"w-64 filter-popover-glass",children:d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-xs font-medium text-foreground",children:"Orbital Command"}),d.jsxs(Ve,{variant:"outline",className:"font-mono text-[10px]",children:["v",e.version]})]}),d.jsxs("div",{className:"space-y-1.5 text-[11px] text-muted-foreground",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(t0,{className:"h-3 w-3"}),d.jsx("span",{className:"font-mono",children:e.commitSha})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(Zb,{className:"h-3 w-3"}),d.jsx("span",{className:"font-mono",children:e.branch})]})]}),t&&r!=="done"&&d.jsxs("div",{className:"rounded-md border border-emerald-500/20 bg-emerald-500/5 px-2 py-1.5 text-[11px] text-emerald-400",children:[n," commit",n!==1?"s":""," behind remote"]}),r==="done"&&d.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-emerald-500/20 bg-emerald-500/5 px-2 py-1.5 text-[11px] text-emerald-400",children:[d.jsx(Sr,{className:"h-3 w-3"}),"Updated. Restart server to apply."]}),r==="error"&&d.jsxs("div",{className:"flex items-start gap-1.5 rounded-md border border-destructive/20 bg-destructive/5 px-2 py-1.5 text-[11px] text-destructive",children:[d.jsx(Rb,{className:"h-3 w-3 mt-0.5 shrink-0"}),d.jsx("span",{children:i??"An unknown error occurred"})]}),l&&d.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[d.jsx(Va,{className:"h-3 w-3 animate-spin"}),d.jsxs("span",{children:[r==="checking"&&"Checking for updates...",r==="pulling"&&"Pulling latest changes...",r==="installing"&&"Installing dependencies..."]})]}),d.jsxs("div",{className:"flex gap-2 pt-1",children:[d.jsxs("button",{onClick:o,disabled:l,className:F("flex flex-1 items-center justify-center gap-1.5 rounded-md border border-border px-2 py-1 text-[11px]","text-muted-foreground hover:text-foreground hover:bg-surface-light transition-colors","disabled:opacity-40 disabled:cursor-not-allowed"),children:[d.jsx(g0,{className:F("h-3 w-3",r==="checking"&&"animate-spin")}),"Check"]}),t&&r!=="done"&&d.jsxs("button",{onClick:a,disabled:l,className:F("flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1 text-[11px]","bg-emerald-500/10 border border-emerald-500/20 text-emerald-400","hover:bg-emerald-500/20 transition-colors","disabled:opacity-40 disabled:cursor-not-allowed"),children:[d.jsx($b,{className:"h-3 w-3"}),"Update"]})]})]})})]})}function yv(){const{scopes:e}=dh(),{engine:t}=sn(),{activeScopes:n}=Xf();Cr();const r=jf(),i=m.useMemo(()=>t.getBoardColumns(),[t]),s=m.useMemo(()=>{const f=new Map;return i.forEach((h,p)=>f.set(h.id,p)),f},[i]),o=m.useMemo(()=>{const f=new Map;for(const h of i)f.set(h.id,h.color);return f},[i]),{inProgress:a,needsAttention:l}=m.useMemo(()=>{const f=[],h=[];for(const p of e)n.has(ce(p))&&(p.blocked_by.length>0?h.push(p):f.push(p));return{inProgress:Nc(f,s),needsAttention:Nc(h,s)}},[e,n,s]),c=(f,h)=>{f.stopPropagation(),r(`/?highlight=${encodeURIComponent(h)}`)},u=a.size>0||l.size>0;return d.jsx("div",{className:F("fixed bottom-0 left-24 right-0 z-40 border-t border-border bg-surface/95 backdrop-blur-sm","ticker-glass"),children:d.jsxs("div",{className:"flex items-center px-4 py-2",children:[u&&d.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4 overflow-x-auto",children:[a.size>0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"flex-shrink-0 text-xxs uppercase tracking-wider font-normal text-muted-foreground",children:"In Progress"}),d.jsx(Tc,{groups:a,colorMap:o,onClick:c})]}),a.size>0&&l.size>0&&d.jsx("div",{className:"h-4 w-px flex-shrink-0 bg-border"}),l.size>0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"flex-shrink-0 text-xxs uppercase tracking-wider font-normal text-warning-amber",children:"Needs Attention"}),d.jsx(Tc,{groups:l,colorMap:o,onClick:c})]})]}),!u&&d.jsx("div",{className:"flex-1"}),d.jsx("div",{className:"flex-shrink-0 ml-4",children:d.jsx(xv,{})})]})})}function Tc({groups:e,colorMap:t,onClick:n}){return d.jsx(d.Fragment,{children:Array.from(e.entries()).map(([r,i])=>{const s=t.get(r)??"220 70% 50%",o=bv(s);return i.map(a=>d.jsxs("button",{onClick:l=>n(l,ce(a)),className:"flex flex-shrink-0 items-center gap-1.5 rounded-md border px-2 py-0.5 text-xxs transition-colors hover:brightness-125 cursor-pointer",style:{backgroundColor:`${o}15`,borderColor:`${o}40`},children:[d.jsx("span",{className:"h-2 w-2 rounded-full flex-shrink-0",style:{backgroundColor:`hsl(${s})`}}),d.jsxs("span",{className:"max-w-[120px] truncate",children:[_t(a.id)," ",a.title]})]},ce(a)))})})}function Nc(e,t){const n=new Map;for(const r of e){const i=n.get(r.status);i?i.push(r):n.set(r.status,[r])}return new Map(Array.from(n.entries()).sort(([r],[i])=>(t.get(r)??999)-(t.get(i)??999)))}function bv(e){const t=e.match(/[\d.]+/g);if(!t||t.length<3)return"#888888";const n=parseFloat(t[0]),r=parseFloat(t[1])/100,i=parseFloat(t[2])/100,s=r*Math.min(i,1-i),o=a=>{const l=(a+n/30)%12,c=i-s*Math.max(Math.min(l-3,9-l,1),-1);return Math.round(255*c).toString(16).padStart(2,"0")};return`#${o(0)}${o(8)}${o(4)}`}const Zt=28,Mn=1,In=.12,vv=.6,Pc=`rgba(255, 255, 255, ${In})`,Ai=300,wv=14,ea=Zt*1.8,kv=ea*ea,_i=80,Ac=1e4,ro=800,Sv=500,Cv=50,jv=22,Ev=4e3,io={x:-9999,y:-9999};function Tv(){const e=m.useRef(null),t=m.useRef(io),n=m.useRef(!1),r=m.useRef(0),i=m.useRef(io),s=m.useRef(0),o=m.useRef(null),a=m.useRef([]),l=m.useRef(null),c=m.useRef(null);return m.useEffect(()=>{const u=e.current;if(!u)return;const f=u.getContext("2d");if(!f)return;function h(){if(n.current=!1,!f||!u)return;if(f.clearRect(0,0,u.width,u.height),document.documentElement.hasAttribute("data-reduce-motion")){const me=Math.ceil(u.width/Zt)+1,je=Math.ceil(u.height/Zt)+1;for(let be=0;be<je;be++)for(let de=0;de<me;de++)f.beginPath(),f.arc(de*Zt,be*Zt,Mn,0,Math.PI*2),f.fillStyle=Pc,f.fill();return}const w=t.current.x,k=t.current.y,P=Ai*Ai,N=performance.now();let M=0;{const me=i.current.x,je=i.current.y;if(me>-9e3){const be=w-me,de=k-je,fe=Math.sqrt(be*be+de*de),Te=Math.min(1,fe/60);s.current=s.current*.7+Te*.3}i.current={x:w,y:k},M=s.current}const T=1+M*2,R=1+M*.6;let A=-1,_=0;if(w>-9e3){A=N%2e3/1e3*400;const je=Ai*2;_=A<je?1-A/je:0}const L=Math.sqrt(u.width*u.width+u.height*u.height),I=o.current;let W=0,D=!1;if(I)if(I.releaseTime===0)W=Math.min(1,(N-I.startTime)/Ac),D=!0;else{const me=N-I.releaseTime;me<ro?(W=I.holdStrength*(1-me/ro),D=!0):o.current=null}const $=_i+W*(L-_i),z=(I==null?void 0:I.releaseTime)!==0;let S=!1;const H=a.current.filter(me=>N-me.time<Ev);a.current=H;const oe=Math.ceil(u.width/Zt)+1,E=Math.ceil(u.height/Zt)+1,K=u.width*.1+450,X=100,U=u.width-350,Le=u.height-100,Ce=600,Re=[];let ge=w>-9e3||D||S||H.length>0;for(let me=0;me<E;me++)for(let je=0;je<oe;je++){const be=je*Zt,de=me*Zt,fe=be-w,Te=de-k,nt=fe*fe+Te*Te;let Je=be,Y=de,$e=Pc,ut=Mn;if(_>0&&nt>.01){const Ne=Math.sqrt(nt),De=Math.abs(Ne-A);if(De<60){const Fe=(1-De/60)*_;Je+=fe/Ne*Fe*8,Y+=Te/Ne*Fe*8,$e=`rgba(255, 255, 255, ${In+Fe*.2})`,ut=Mn+Fe*.5}}if(D&&I){const Ne=be-I.x,De=de-I.y,Fe=Ne*Ne+De*De,O=z?I.holdRadius:$,B=O*O;if(Fe<B&&Fe>.01){const J=1-Math.sqrt(Fe)/O,ne=J*J*J,he=150,Ue=Math.min(be,u.width-be)/he,We=Math.min(de,u.height-de)/he,it=Math.min(1,Math.min(Ue,We));if(z){const xe=(N-I.releaseTime)/ro,He=Math.exp(-xe*4),ve=Math.sin(xe*Math.PI*3)*He,Rt=I.holdStrength*ne*it*ve;Je+=Ne*Rt*.8,Y+=De*Rt*.8;const zt=ne*Math.abs(ve)*.5;$e=`rgba(255, 255, 255, ${Math.min(1,In+zt)})`,ut=Mn+ne*Math.abs(ve)*1.2}else{const Be=W*ne*it*.95;Je-=Ne*Be,Y-=De*Be;const xe=ne*W*.3;$e=`rgba(255, 255, 255, ${In+xe})`,ut=Mn+ne*W*.8}}}for(const Ne of H){const De=be-Ne.x,Fe=de-Ne.y,O=De*De+Fe*Fe;if(O<.01)continue;const B=Math.sqrt(O),J=(N-Ne.time)/1e3*Sv,ne=Math.max(0,1-J/L),he=De/B,Ue=Fe/B,We=-Ue,it=he,Be=Cv,xe=B-J;if(Math.abs(xe)<Be*2){const He=xe/(Be*2),ve=Math.max(0,1-Math.abs(He))*ne,Rt=Math.cos(He*Math.PI*.5)*ve*jv;Je+=he*Rt,Y+=Ue*Rt;const zt=Math.sin(He*Math.PI)*ve*14;Je+=We*zt,Y+=it*zt,$e=`rgba(255, 255, 255, ${Math.min(1,In+ve*.5)})`,ut=Mn+ve*1}}let Qe=0;if(nt<P){const Ne=Math.sqrt(nt),De=1-Ne/Ai;Qe=De*De;const Fe=Qe*wv*T;Ne>.1&&(Je+=fe/Ne*Fe,Y+=Te/Ne*Fe);const O=Math.min(1,In+Qe*(vv-In)*R);ut=Mn+Qe*.6;{const B=be-K,G=de-X,J=Math.sqrt(B*B+G*G),ne=Math.max(0,1-J/Ce),he=be-U,Ue=de-Le,We=Math.sqrt(he*he+Ue*Ue),it=Math.max(0,1-We/Ce),Be=Qe*Qe,xe=1+Qe*2,He=Math.min(1,Be*it*xe),ve=Math.min(1,Be*ne*xe),Rt=Math.round(255-He*255+ve*-22),zt=Math.round(255-He*67-ve*225),_r=Math.round(255-He*43-ve*156);$e=`rgba(${Math.max(0,Math.min(255,Rt))}, ${Math.max(0,Math.min(255,zt))}, ${Math.max(0,Math.min(255,_r))}, ${O})`}}Qe>.05&&Re.push({x:Je,y:Y,ease:Qe}),f.beginPath(),f.arc(Je,Y,ut,0,Math.PI*2),f.fillStyle=$e,f.fill()}if(Re.length>1)for(let me=0;me<Re.length;me++)for(let je=me+1;je<Re.length;je++){const be=Re[me],de=Re[je],fe=be.x-de.x,Te=be.y-de.y,nt=fe*fe+Te*Te;if(nt<kv){const Je=1-Math.sqrt(nt)/ea,Y=Math.min(be.ease,de.ease)*Je;f.beginPath(),f.moveTo(be.x,be.y),f.lineTo(de.x,de.y),f.strokeStyle=`rgba(255, 255, 255, ${Y*.25})`,f.lineWidth=.5,f.stroke()}}ge&&(n.current=!0,r.current=requestAnimationFrame(h))}function p(){n.current||(n.current=!0,r.current=requestAnimationFrame(h))}function g(){u&&(u.width=window.innerWidth,u.height=window.innerHeight,p())}function b(j){t.current={x:j.clientX,y:j.clientY};const w=o.current;w&&w.releaseTime===0&&(w.x=j.clientX,w.y=j.clientY),p()}function y(){t.current=io,p()}const x=200;function v(j){const w=j.target,k=w.closest('button, a, input, select, textarea, [role="button"], [role="option"], [role="tab"], [role="menuitem"], [role="checkbox"], [role="radio"], [role="switch"], [role="link"], [role="search"], [data-clickable], [onclick], label'),P=window.getComputedStyle(w).cursor==="pointer";if(k||P)return;const N=performance.now();c.current={x:j.clientX,y:j.clientY,time:N},l.current=setTimeout(()=>{c.current=null,o.current={x:j.clientX,y:j.clientY,startTime:N,releaseTime:0,holdStrength:0,holdRadius:_i},p()},x)}function C(){l.current&&(clearTimeout(l.current),l.current=null);const j=c.current;j&&(c.current=null,a.current.push({x:j.x,y:j.y,time:performance.now()}));const w=o.current;if(w&&w.releaseTime===0){const k=performance.now(),P=Math.sqrt(window.innerWidth**2+window.innerHeight**2),N=Ac,M=_i,T=Math.min(1,(k-w.startTime)/N);w.holdStrength=T,w.holdRadius=M+T*(P-M),w.releaseTime=k,a.current.push({x:w.x,y:w.y,time:k})}p()}return g(),p(),window.addEventListener("resize",g),window.addEventListener("mousemove",b),document.addEventListener("mouseleave",y),window.addEventListener("mousedown",v),window.addEventListener("mouseup",C),()=>{cancelAnimationFrame(r.current),l.current&&clearTimeout(l.current),n.current=!1,window.removeEventListener("resize",g),window.removeEventListener("mousemove",b),document.removeEventListener("mouseleave",y),window.removeEventListener("mousedown",v),window.removeEventListener("mouseup",C)}},[]),d.jsx("canvas",{ref:e,className:"neon-grid-canvas",style:{pointerEvents:"none"}})}const et=8,pn=12;function Nv(e,t){const n=e.getBoundingClientRect(),i=!!e.closest("main")?Math.max(t,.1):1;return{top:n.top/i,left:n.left/i,width:n.width/i,height:n.height/i}}function Pv(e,t){return e===t?"w-4 bg-primary":e<t?"w-1.5 bg-primary/40":"w-1.5 bg-muted-foreground/20"}function Av(){const{isActive:e,currentStep:t,currentStepIndex:n,totalSteps:r,targetElement:i,next:s,back:o,skip:a}=mb(),{settings:l}=Wa(),[c,u]=m.useState(null),f=m.useRef(null),h=m.useRef(null),p=l.reduceMotion,g=l.fontScale,b=m.useCallback(()=>{if(!i){u(null);return}u(Nv(i,g))},[i,g]);m.useEffect(()=>{if(!i){u(null);return}b();const k=new ResizeObserver(()=>{requestAnimationFrame(b)});return k.observe(i),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),()=>{k.disconnect(),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}},[i,b]),m.useEffect(()=>{e&&(h.current=document.activeElement)},[e]),m.useEffect(()=>{e&&f.current&&f.current.focus()},[e,n]);const y=m.useRef(!1);if(m.useEffect(()=>{e?y.current=!0:y.current&&(y.current=!1,h.current&&document.body.contains(h.current)&&h.current.focus(),h.current=null)},[e]),m.useEffect(()=>{if(!e)return;function k(P){if(P.key==="Escape")P.preventDefault(),a();else if(P.key==="ArrowRight")P.preventDefault(),s();else if(P.key==="ArrowLeft")P.preventDefault(),o();else if(P.key==="Tab"){if(!f.current)return;const N=f.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(N.length===0)return;const M=N[0],T=N[N.length-1];P.shiftKey?document.activeElement===M&&(P.preventDefault(),T.focus()):document.activeElement===T&&(P.preventDefault(),M.focus())}}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[e,s,o,a]),!e||!t)return null;const x=t.placement??"right",v=c&&t.maxSpotlightWidth&&c.width>t.maxSpotlightWidth?{...c,width:t.maxSpotlightWidth}:c,C=_v(v,x),j=v?`polygon(
|
|
287
|
+
0% 0%, 0% 100%, 100% 100%, 100% 0%, 0% 0%,
|
|
288
|
+
${v.left-et}px ${v.top-et}px,
|
|
289
|
+
${v.left+v.width+et}px ${v.top-et}px,
|
|
290
|
+
${v.left+v.width+et}px ${v.top+v.height+et}px,
|
|
291
|
+
${v.left-et}px ${v.top+v.height+et}px,
|
|
292
|
+
${v.left-et}px ${v.top-et}px
|
|
293
|
+
)`:void 0,w=p?"none":"clip-path 0.3s ease-out";return rr.createPortal(d.jsxs("div",{className:"fixed inset-0 z-[70]",role:"dialog","aria-modal":"true","aria-labelledby":"tour-step-title","aria-describedby":"tour-step-desc",children:[d.jsx("div",{className:"absolute inset-0 dialog-overlay-glass",style:{clipPath:j,transition:w},onClick:a}),d.jsxs("div",{ref:f,tabIndex:-1,className:"card-glass absolute rounded-xl p-5 shadow-lg outline-none",style:{...C,maxWidth:360,minWidth:280,transition:p?"none":"top 0.3s ease-out, left 0.3s ease-out"},children:[d.jsx("h3",{id:"tour-step-title",className:"text-sm font-medium text-foreground mb-1.5",children:t.title}),d.jsx("p",{id:"tour-step-desc",className:"text-xs text-muted-foreground/80 leading-relaxed mb-4",children:t.description}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:"flex gap-1",children:Array.from({length:r},(k,P)=>d.jsx("div",{className:`h-1.5 rounded-full transition-all ${Pv(P,n)}`},P))}),d.jsxs("div",{className:"flex gap-2",children:[n>0&&d.jsx("button",{onClick:o,className:"text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1",children:"Back"}),d.jsx("button",{onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1",children:"Skip"}),d.jsx("button",{onClick:s,className:"text-xs font-medium text-primary-foreground bg-primary hover:bg-primary/90 rounded-md px-3 py-1 transition-colors",children:n===r-1?"Done":"Next"})]})]}),d.jsxs("div",{className:"mt-2 text-[10px] text-muted-foreground/50 text-right",children:[n+1," / ",r]})]})]}),document.body)}const Jn=200,Ri=16;function _v(e,t){if(!e)return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};const n=320,r=u=>{const f=n/2;return Math.max(Ri+f,Math.min(window.innerWidth-Ri-f,u))},i=u=>Math.max(Ri+Jn/2,Math.min(window.innerHeight-Ri-Jn/2,u)),s=window.innerHeight-(e.top+e.height+et+pn),o=e.top-et-pn,a=window.innerWidth-(e.left+e.width+et+pn),l=e.left-et-pn;let c=t;switch(c==="bottom"&&s<Jn?o>=Jn?c="top":a>=n?c="right":l>=n&&(c="left"):c==="top"&&o<Jn&&(s>=Jn?c="bottom":a>=n?c="right":l>=n&&(c="left")),c){case"top":return{bottom:window.innerHeight-e.top+et+pn,left:r(e.left+e.width/2),transform:"translateX(-50%)"};case"bottom":return{top:e.top+e.height+et+pn,left:r(e.left+e.width/2),transform:"translateX(-50%)"};case"left":return{top:i(e.top+e.height/2),right:window.innerWidth-e.left+et+pn,transform:"translateY(-50%)"};case"right":return{top:i(e.top+e.height/2),left:e.left+e.width+et+pn,transform:"translateY(-50%)"}}}const Rv=[{to:"/",icon:sh,label:"KANBAN",tourId:"nav-kanban"},{to:"/primitives",icon:p0,label:"PRIMITIVES",tourId:"nav-primitives"},{to:"/guards",icon:T0,label:"GUARDS",tourId:"nav-guards"},{to:"/repo",icon:r0,label:"REPO",tourId:"nav-repo"},{to:"/sessions",icon:Qo,label:"SESSIONS",tourId:"nav-sessions"},{to:"/workflow",icon:W0,label:"WORKFLOW",tourId:"nav-workflow"}],Mv=d.jsx("div",{className:"flex flex-1 min-h-0 items-center justify-center",children:d.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"})});function Dv(){const{settings:e}=Wa(),t=new URLSearchParams(window.location.search).toString(),n=t?`?${t}`:"";return Cr(),d.jsxs("div",{className:"flex h-screen bg-background",children:[e.showBackgroundEffects&&d.jsx("div",{className:"neon-bg",children:d.jsx(Tv,{})}),d.jsxs("aside",{className:"flex w-24 flex-col items-center border-r border-border bg-surface sidebar-glass",children:[d.jsx("div",{className:"flex h-20 items-center justify-center",children:d.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-xl text-white overflow-hidden",style:{background:"linear-gradient(135deg, #6FC985 0%, #5ABF87 6.25%, #45B588 12.5%, #2FAA89 18.75%, #15A089 25%, #009588 31.25%, #008A87 37.5%, #007F84 43.75%, #007480 50%, #00697A 56.25%, #005E74 62.5%, #00546C 68.75%, #004964 75%, #023F5B 81.25%, #0A3551 87.5%, #0E2B46 93.75%, #10223B 100%)"},children:d.jsx("img",{src:"/scanner-sweep.png",alt:"Orbital Command",className:"h-12 w-12 object-contain"})})}),d.jsx(hr,{className:"flex-1",children:d.jsx("nav",{className:"flex flex-col items-center gap-3 px-4 py-2",children:Rv.map(({to:r,icon:i,label:s,tourId:o})=>d.jsxs(lc,{to:`${r}${n}`,end:r==="/","data-tour":o,className:({isActive:a})=>F("nav-item-square group relative flex h-16 w-16 flex-col items-center justify-center rounded-xl ",a?"bg-surface-light text-foreground nav-icon-active-glow":"text-muted-foreground hover:bg-surface-light hover:text-foreground"),children:[d.jsx(i,{className:"h-6 w-6"}),d.jsx("span",{className:"nav-item-label whitespace-nowrap text-[9px] font-light max-h-0 opacity-0 group-hover:max-h-3 group-hover:mt-1 group-hover:opacity-100 transition-all duration-200 overflow-hidden tracking-wider",children:s})]},r))})}),d.jsx("div",{className:"px-4 py-3 border-t border-border/40",children:d.jsxs(lc,{to:`/settings${n}`,"data-tour":"nav-settings",className:({isActive:r})=>F("nav-item-square group relative flex h-16 w-16 flex-col items-center justify-center rounded-xl ",r?"bg-surface-light text-foreground nav-icon-active-glow":"text-muted-foreground hover:bg-surface-light hover:text-foreground"),children:[d.jsx(j0,{className:"h-6 w-6"}),d.jsx("span",{className:"nav-item-label whitespace-nowrap text-[9px] font-light max-h-0 opacity-0 group-hover:max-h-3 group-hover:mt-1 group-hover:opacity-100 transition-all duration-200 overflow-hidden tracking-wider",children:"SETTINGS"})]})})]}),d.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden relative z-[1]",style:e.fontScale!==1?{zoom:e.fontScale}:void 0,children:d.jsx("div",{className:"flex flex-1 flex-col overflow-hidden p-4 pt-12 pb-0",children:d.jsx(lh,{children:d.jsx(m.Suspense,{fallback:Mv,children:d.jsx(wx,{})})})})}),e.showStatusBar&&d.jsx(yv,{}),d.jsx(Av,{})]})}function YD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const As=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jr(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function qa(e){return"nodeType"in e}function ht(e){var t,n;return e?jr(e)?e:qa(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Ka(e){const{Document:t}=ht(e);return e instanceof t}function mi(e){return jr(e)?!1:e instanceof ht(e).HTMLElement}function Ch(e){return e instanceof ht(e).SVGElement}function Er(e){return e?jr(e)?e.document:qa(e)?Ka(e)?e:mi(e)||Ch(e)?e.ownerDocument:document:document:document}const nn=As?m.useLayoutEffect:m.useEffect;function _s(e){const t=m.useRef(e);return nn(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function Ov(){const e=m.useRef(null),t=m.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=m.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ii(e,t){t===void 0&&(t=[e]);const n=m.useRef(e);return nn(()=>{n.current!==e&&(n.current=e)},t),n}function gi(e,t){const n=m.useRef();return m.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function ns(e){const t=_s(e),n=m.useRef(null),r=m.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function rs(e){const t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}let so={};function Rs(e,t){return m.useMemo(()=>{if(t)return t;const n=so[e]==null?0:so[e]+1;return so[e]=n,e+"-"+n},[e,t])}function jh(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((s,o)=>{const a=Object.entries(o);for(const[l,c]of a){const u=s[l];u!=null&&(s[l]=u+e*c)}return s},{...t})}}const dr=jh(1),is=jh(-1);function Iv(e){return"clientX"in e&&"clientY"in e}function Ga(e){if(!e)return!1;const{KeyboardEvent:t}=ht(e.target);return t&&e instanceof t}function Lv(e){if(!e)return!1;const{TouchEvent:t}=ht(e.target);return t&&e instanceof t}function ss(e){if(Lv(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Iv(e)?{x:e.clientX,y:e.clientY}:null}const mr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[mr.Translate.toString(e),mr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),_c="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Fv(e){return e.matches(_c)?e:e.querySelector(_c)}const Bv={display:"none"};function zv(e){let{id:t,value:n}=e;return Ie.createElement("div",{id:t,style:Bv},n)}function Vv(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ie.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function $v(){const[e,t]=m.useState("");return{announce:m.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Eh=m.createContext(null);function Uv(e){const t=m.useContext(Eh);m.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Wv(){const[e]=m.useState(()=>new Set),t=m.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[m.useCallback(r=>{let{type:i,event:s}=r;e.forEach(o=>{var a;return(a=o[i])==null?void 0:a.call(o,s)})},[e]),t]}const Hv={draggable:`
|
|
294
|
+
To pick up a draggable item, press the space bar.
|
|
295
|
+
While dragging, use the arrow keys to move the item.
|
|
296
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
297
|
+
`},qv={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Kv(e){let{announcements:t=qv,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Hv}=e;const{announce:s,announcement:o}=$v(),a=Rs("DndLiveRegion"),[l,c]=m.useState(!1);if(m.useEffect(()=>{c(!0)},[]),Uv(m.useMemo(()=>({onDragStart(f){let{active:h}=f;s(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&s(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;s(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;s(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;s(t.onDragCancel({active:h,over:p}))}}),[s,t])),!l)return null;const u=Ie.createElement(Ie.Fragment,null,Ie.createElement(zv,{id:r,value:i.draggable}),Ie.createElement(Vv,{id:a,announcement:o}));return n?rr.createPortal(u,n):u}var Xe;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Xe||(Xe={}));function os(){}function Rc(e,t){return m.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Gv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Ft=Object.freeze({x:0,y:0});function Ya(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Yv(e,t){const n=ss(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Xa(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Xv(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function ta(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Jv(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Mc(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const XD=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=Mc(t,t.left,t.top),s=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=Ya(Mc(l),i);s.push({id:a,data:{droppableContainer:o,value:c}})}}return s.sort(Xa)},JD=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=ta(t),s=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=ta(l),u=i.reduce((h,p,g)=>h+Ya(c[g],p),0),f=Number((u/4).toFixed(4));s.push({id:a,data:{droppableContainer:o,value:f}})}}return s.sort(Xa)};function Qv(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),o=i-r,a=s-n;if(r<i&&n<s){const l=t.width*t.height,c=e.width*e.height,u=o*a,f=u/(l+c-u);return Number(f.toFixed(4))}return 0}const Th=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const s of r){const{id:o}=s,a=n.get(o);if(a){const l=Qv(a,t);l>0&&i.push({id:o,data:{droppableContainer:s,value:l}})}}return i.sort(Xv)};function Zv(e,t){const{top:n,left:r,bottom:i,right:s}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=s}const ew=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const i=[];for(const s of t){const{id:o}=s,a=n.get(o);if(a&&Zv(r,a)){const c=ta(a).reduce((f,h)=>f+Ya(r,h),0),u=Number((c/4).toFixed(4));i.push({id:o,data:{droppableContainer:s,value:u}})}}return i.sort(Xa)};function tw(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Nh(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ft}function nw(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return i.reduce((o,a)=>({...o,top:o.top+e*a.y,bottom:o.bottom+e*a.y,left:o.left+e*a.x,right:o.right+e*a.x}),{...n})}}const rw=nw(1);function Ph(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function iw(e,t,n){const r=Ph(t);if(!r)return e;const{scaleX:i,scaleY:s,x:o,y:a}=r,l=e.left-o-(1-i)*parseFloat(n),c=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,f=s?e.height/s:e.height;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l}}const sw={ignoreTransform:!1};function xi(e,t){t===void 0&&(t=sw);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=ht(e).getComputedStyle(e);c&&(n=iw(n,c,u))}const{top:r,left:i,width:s,height:o,bottom:a,right:l}=n;return{top:r,left:i,width:s,height:o,bottom:a,right:l}}function Dc(e){return xi(e,{ignoreTransform:!0})}function ow(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function aw(e,t){return t===void 0&&(t=ht(e).getComputedStyle(e)),t.position==="fixed"}function lw(e,t){t===void 0&&(t=ht(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=t[i];return typeof s=="string"?n.test(s):!1})}function Ja(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Ka(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!mi(i)||Ch(i)||n.includes(i))return n;const s=ht(e).getComputedStyle(i);return i!==e&&lw(i,s)&&n.push(i),aw(i,s)?n:r(i.parentNode)}return e?r(e):n}function Ah(e){const[t]=Ja(e,1);return t??null}function oo(e){return!As||!e?null:jr(e)?e:qa(e)?Ka(e)||e===Er(e).scrollingElement?window:mi(e)?e:null:null}function _h(e){return jr(e)?e.scrollX:e.scrollLeft}function Rh(e){return jr(e)?e.scrollY:e.scrollTop}function na(e){return{x:_h(e),y:Rh(e)}}var tt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(tt||(tt={}));function Mh(e){return!As||!e?!1:e===document.scrollingElement}function Dh(e){const t={x:0,y:0},n=Mh(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,o=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:i,isLeft:s,isBottom:o,isRight:a,maxScroll:r,minScroll:t}}const cw={x:.2,y:.2};function uw(e,t,n,r,i){let{top:s,left:o,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=cw);const{isTop:c,isBottom:u,isLeft:f,isRight:h}=Dh(e),p={x:0,y:0},g={x:0,y:0},b={height:t.height*i.y,width:t.width*i.x};return!c&&s<=t.top+b.height?(p.y=tt.Backward,g.y=r*Math.abs((t.top+b.height-s)/b.height)):!u&&l>=t.bottom-b.height&&(p.y=tt.Forward,g.y=r*Math.abs((t.bottom-b.height-l)/b.height)),!h&&a>=t.right-b.width?(p.x=tt.Forward,g.x=r*Math.abs((t.right-b.width-a)/b.width)):!f&&o<=t.left+b.width&&(p.x=tt.Backward,g.x=r*Math.abs((t.left+b.width-o)/b.width)),{direction:p,speed:g}}function dw(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:o}=window;return{top:0,left:0,right:s,bottom:o,width:s,height:o}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Oh(e){return e.reduce((t,n)=>dr(t,na(n)),Ft)}function fw(e){return e.reduce((t,n)=>t+_h(n),0)}function hw(e){return e.reduce((t,n)=>t+Rh(n),0)}function Ih(e,t){if(t===void 0&&(t=xi),!e)return;const{top:n,left:r,bottom:i,right:s}=t(e);Ah(e)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const pw=[["x",["left","right"],fw],["y",["top","bottom"],hw]];class Qa{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Ja(n),i=Oh(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,o,a]of pw)for(const l of o)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=i[s]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Kr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function mw(e){const{EventTarget:t}=ht(e);return e instanceof t?e:Er(e)}function ao(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Nt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Nt||(Nt={}));function Oc(e){e.preventDefault()}function gw(e){e.stopPropagation()}var we;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(we||(we={}));const Lh={start:[we.Space,we.Enter],cancel:[we.Esc],end:[we.Space,we.Enter,we.Tab]},xw=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case we.Right:return{...n,x:n.x+25};case we.Left:return{...n,x:n.x-25};case we.Down:return{...n,y:n.y+25};case we.Up:return{...n,y:n.y-25}}};class Za{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Kr(Er(n)),this.windowListeners=new Kr(ht(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Nt.Resize,this.handleCancel),this.windowListeners.add(Nt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Nt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Ih(r),n(Ft)}handleKeyDown(t){if(Ga(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:s=Lh,coordinateGetter:o=xw,scrollBehavior:a="smooth"}=i,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:Ft;this.referenceCoordinates||(this.referenceCoordinates=u);const f=o(t,{active:n,context:r.current,currentCoordinates:u});if(f){const h=is(f,u),p={x:0,y:0},{scrollableAncestors:g}=r.current;for(const b of g){const y=t.code,{isTop:x,isRight:v,isLeft:C,isBottom:j,maxScroll:w,minScroll:k}=Dh(b),P=dw(b),N={x:Math.min(y===we.Right?P.right-P.width/2:P.right,Math.max(y===we.Right?P.left:P.left+P.width/2,f.x)),y:Math.min(y===we.Down?P.bottom-P.height/2:P.bottom,Math.max(y===we.Down?P.top:P.top+P.height/2,f.y))},M=y===we.Right&&!v||y===we.Left&&!C,T=y===we.Down&&!j||y===we.Up&&!x;if(M&&N.x!==f.x){const R=b.scrollLeft+h.x,A=y===we.Right&&R<=w.x||y===we.Left&&R>=k.x;if(A&&!h.y){b.scrollTo({left:R,behavior:a});return}A?p.x=b.scrollLeft-R:p.x=y===we.Right?b.scrollLeft-w.x:b.scrollLeft-k.x,p.x&&b.scrollBy({left:-p.x,behavior:a});break}else if(T&&N.y!==f.y){const R=b.scrollTop+h.y,A=y===we.Down&&R<=w.y||y===we.Up&&R>=k.y;if(A&&!h.x){b.scrollTo({top:R,behavior:a});return}A?p.y=b.scrollTop-R:p.y=y===we.Down?b.scrollTop-w.y:b.scrollTop-k.y,p.y&&b.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,dr(is(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Za.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Lh,onActivation:i}=t,{active:s}=n;const{code:o}=e.nativeEvent;if(r.start.includes(o)){const a=s.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function Ic(e){return!!(e&&"distance"in e)}function Lc(e){return!!(e&&"delay"in e)}class el{constructor(t,n,r){var i;r===void 0&&(r=mw(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:o}=s;this.props=t,this.events=n,this.document=Er(o),this.documentListeners=new Kr(this.document),this.listeners=new Kr(r),this.windowListeners=new Kr(ht(o)),this.initialCoordinates=(i=ss(s))!=null?i:Ft,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Nt.Resize,this.handleCancel),this.windowListeners.add(Nt.DragStart,Oc),this.windowListeners.add(Nt.VisibilityChange,this.handleCancel),this.windowListeners.add(Nt.ContextMenu,Oc),this.documentListeners.add(Nt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Lc(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Ic(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Nt.Click,gw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Nt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:s}=this,{onMove:o,options:{activationConstraint:a}}=s;if(!i)return;const l=(n=ss(t))!=null?n:Ft,c=is(i,l);if(!r&&a){if(Ic(a)){if(a.tolerance!=null&&ao(c,a.tolerance))return this.handleCancel();if(ao(c,a.distance))return this.handleStart()}if(Lc(a)&&ao(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===we.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const yw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class tl extends el{constructor(t){const{event:n}=t,r=Er(n.target);super(t,yw,r)}}tl.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const bw={move:{name:"mousemove"},end:{name:"mouseup"}};var ra;(function(e){e[e.RightClick=2]="RightClick"})(ra||(ra={}));class vw extends el{constructor(t){super(t,bw,Er(t.event.target))}}vw.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===ra.RightClick?!1:(r==null||r({event:n}),!0)}}];const lo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ww extends el{constructor(t){super(t,lo)}static setup(){return window.addEventListener(lo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(lo.move.name,t)};function t(){}}}ww.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Gr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Gr||(Gr={}));var as;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(as||(as={}));function kw(e){let{acceleration:t,activator:n=Gr.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:o=5,order:a=as.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:f,threshold:h}=e;const p=Cw({delta:f,disabled:!s}),[g,b]=Ov(),y=m.useRef({x:0,y:0}),x=m.useRef({x:0,y:0}),v=m.useMemo(()=>{switch(n){case Gr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Gr.DraggableRect:return i}},[n,i,l]),C=m.useRef(null),j=m.useCallback(()=>{const k=C.current;if(!k)return;const P=y.current.x*x.current.x,N=y.current.y*x.current.y;k.scrollBy(P,N)},[]),w=m.useMemo(()=>a===as.TreeOrder?[...c].reverse():c,[a,c]);m.useEffect(()=>{if(!s||!c.length||!v){b();return}for(const k of w){if((r==null?void 0:r(k))===!1)continue;const P=c.indexOf(k),N=u[P];if(!N)continue;const{direction:M,speed:T}=uw(k,N,v,t,h);for(const R of["x","y"])p[R][M[R]]||(T[R]=0,M[R]=0);if(T.x>0||T.y>0){b(),C.current=k,g(j,o),y.current=T,x.current=M;return}}y.current={x:0,y:0},x.current={x:0,y:0},b()},[t,j,r,b,s,o,JSON.stringify(v),JSON.stringify(p),g,c,w,u,JSON.stringify(h)])}const Sw={x:{[tt.Backward]:!1,[tt.Forward]:!1},y:{[tt.Backward]:!1,[tt.Forward]:!1}};function Cw(e){let{delta:t,disabled:n}=e;const r=rs(t);return gi(i=>{if(n||!r||!i)return Sw;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[tt.Backward]:i.x[tt.Backward]||s.x===-1,[tt.Forward]:i.x[tt.Forward]||s.x===1},y:{[tt.Backward]:i.y[tt.Backward]||s.y===-1,[tt.Forward]:i.y[tt.Forward]||s.y===1}}},[n,t,r])}function jw(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return gi(i=>{var s;return t==null?null:(s=r??i)!=null?s:null},[r,t])}function Ew(e,t){return m.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,s=i.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,r)}));return[...n,...s]},[]),[e,t])}var si;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(si||(si={}));var ia;(function(e){e.Optimized="optimized"})(ia||(ia={}));const Fc=new Map;function Tw(e,t){let{dragging:n,dependencies:r,config:i}=t;const[s,o]=m.useState(null),{frequency:a,measure:l,strategy:c}=i,u=m.useRef(e),f=y(),h=ii(f),p=m.useCallback(function(x){x===void 0&&(x=[]),!h.current&&o(v=>v===null?x:v.concat(x.filter(C=>!v.includes(C))))},[h]),g=m.useRef(null),b=gi(x=>{if(f&&!n)return Fc;if(!x||x===Fc||u.current!==e||s!=null){const v=new Map;for(let C of e){if(!C)continue;if(s&&s.length>0&&!s.includes(C.id)&&C.rect.current){v.set(C.id,C.rect.current);continue}const j=C.node.current,w=j?new Qa(l(j),j):null;C.rect.current=w,w&&v.set(C.id,w)}return v}return x},[e,s,n,f,l]);return m.useEffect(()=>{u.current=e},[e]),m.useEffect(()=>{f||p()},[n,f]),m.useEffect(()=>{s&&s.length>0&&o(null)},[JSON.stringify(s)]),m.useEffect(()=>{f||typeof a!="number"||g.current!==null||(g.current=setTimeout(()=>{p(),g.current=null},a))},[a,f,p,...r]),{droppableRects:b,measureDroppableContainers:p,measuringScheduled:s!=null};function y(){switch(c){case si.Always:return!1;case si.BeforeDragging:return n;default:return!n}}}function nl(e,t){return gi(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Nw(e,t){return nl(e,t)}function Pw(e){let{callback:t,disabled:n}=e;const r=_s(t),i=m.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return m.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Ms(e){let{callback:t,disabled:n}=e;const r=_s(t),i=m.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return m.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Aw(e){return new Qa(xi(e),e)}function Bc(e,t,n){t===void 0&&(t=Aw);const[r,i]=m.useState(null);function s(){i(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const o=Pw({callback(l){if(e)for(const c of l){const{type:u,target:f}=c;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),a=Ms({callback:s});return nn(()=>{s(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r}function _w(e){const t=nl(e);return Nh(e,t)}const zc=[];function Rw(e){const t=m.useRef(e),n=gi(r=>e?r&&r!==zc&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ja(e):zc,[e]);return m.useEffect(()=>{t.current=e},[e]),n}function Mw(e){const[t,n]=m.useState(null),r=m.useRef(e),i=m.useCallback(s=>{const o=oo(s.target);o&&n(a=>a?(a.set(o,na(o)),new Map(a)):null)},[]);return m.useEffect(()=>{const s=r.current;if(e!==s){o(s);const a=e.map(l=>{const c=oo(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,na(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{o(e),o(s)};function o(a){a.forEach(l=>{const c=oo(l);c==null||c.removeEventListener("scroll",i)})}},[i,e]),m.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,o)=>dr(s,o),Ft):Oh(e):Ft,[e,t])}function Vc(e,t){t===void 0&&(t=[]);const n=m.useRef(null);return m.useEffect(()=>{n.current=null},t),m.useEffect(()=>{const r=e!==Ft;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?is(e,n.current):Ft}function Dw(e){m.useEffect(()=>{if(!As)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Ow(e,t){return m.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:s}=r;return n[i]=o=>{s(o,t)},n},{}),[e,t])}function Fh(e){return m.useMemo(()=>e?ow(e):null,[e])}const $c=[];function Iw(e,t){t===void 0&&(t=xi);const[n]=e,r=Fh(n?ht(n):null),[i,s]=m.useState($c);function o(){s(()=>e.length?e.map(l=>Mh(l)?r:new Qa(t(l),l)):$c)}const a=Ms({callback:o});return nn(()=>{a==null||a.disconnect(),o(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),i}function Bh(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return mi(t)?t:e}function Lw(e){let{measure:t}=e;const[n,r]=m.useState(null),i=m.useCallback(c=>{for(const{target:u}of c)if(mi(u)){r(f=>{const h=t(u);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),s=Ms({callback:i}),o=m.useCallback(c=>{const u=Bh(c);s==null||s.disconnect(),u&&(s==null||s.observe(u)),r(u?t(u):null)},[t,s]),[a,l]=ns(o);return m.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const Fw=[{sensor:tl,options:{}},{sensor:Za,options:{}}],Bw={current:{}},Yi={draggable:{measure:Dc},droppable:{measure:Dc,strategy:si.WhileDragging,frequency:ia.Optimized},dragOverlay:{measure:xi}};class Yr extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const zw={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Yr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:os},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Yi,measureDroppableContainers:os,windowRect:null,measuringScheduled:!1},zh={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:os,draggableNodes:new Map,over:null,measureDroppableContainers:os},yi=m.createContext(zh),Vh=m.createContext(zw);function Vw(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Yr}}}function $w(e,t){switch(t.type){case Xe.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Xe.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Xe.DragEnd:case Xe.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Xe.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Yr(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Xe.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const o=new Yr(e.droppable.containers);return o.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Xe.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Yr(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Uw(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=m.useContext(yi),s=rs(r),o=rs(n==null?void 0:n.id);return m.useEffect(()=>{if(!t&&!r&&s&&o!=null){if(!Ga(s)||document.activeElement===s.target)return;const a=i.get(o);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const f=Fv(u);if(f){f.focus();break}}})}},[r,t,i,o,s]),null}function $h(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,s)=>s({transform:i,...r}),n):n}function Ww(e){return m.useMemo(()=>({draggable:{...Yi.draggable,...e==null?void 0:e.draggable},droppable:{...Yi.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Yi.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Hw(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const s=m.useRef(!1),{x:o,y:a}=typeof i=="boolean"?{x:i,y:i}:i;nn(()=>{if(!o&&!a||!t){s.current=!1;return}if(s.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const u=n(c),f=Nh(u,r);if(o||(f.x=0),a||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=Ah(c);h&&h.scrollBy({top:f.y,left:f.x})}},[t,o,a,r,n])}const Ds=m.createContext({...Ft,scaleX:1,scaleY:1});var yn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(yn||(yn={}));const qw=m.memo(function(t){var n,r,i,s;let{id:o,accessibility:a,autoScroll:l=!0,children:c,sensors:u=Fw,collisionDetection:f=Th,measuring:h,modifiers:p,...g}=t;const b=m.useReducer($w,void 0,Vw),[y,x]=b,[v,C]=Wv(),[j,w]=m.useState(yn.Uninitialized),k=j===yn.Initialized,{draggable:{active:P,nodes:N,translate:M},droppable:{containers:T}}=y,R=P!=null?N.get(P):null,A=m.useRef({initial:null,translated:null}),_=m.useMemo(()=>{var Ze;return P!=null?{id:P,data:(Ze=R==null?void 0:R.data)!=null?Ze:Bw,rect:A}:null},[P,R]),L=m.useRef(null),[I,W]=m.useState(null),[D,$]=m.useState(null),z=ii(g,Object.values(g)),S=Rs("DndDescribedBy",o),H=m.useMemo(()=>T.getEnabled(),[T]),oe=Ww(h),{droppableRects:E,measureDroppableContainers:K,measuringScheduled:X}=Tw(H,{dragging:k,dependencies:[M.x,M.y],config:oe.droppable}),U=jw(N,P),Le=m.useMemo(()=>D?ss(D):null,[D]),Ce=_r(),Re=Nw(U,oe.draggable.measure);Hw({activeNode:P!=null?N.get(P):null,config:Ce.layoutShiftCompensation,initialRect:Re,measure:oe.draggable.measure});const ge=Bc(U,oe.draggable.measure,Re),me=Bc(U?U.parentElement:null),je=m.useRef({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:E,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),be=T.getNodeFor((n=je.current.over)==null?void 0:n.id),de=Lw({measure:oe.dragOverlay.measure}),fe=(r=de.nodeRef.current)!=null?r:U,Te=k?(i=de.rect)!=null?i:ge:null,nt=!!(de.nodeRef.current&&de.rect),Je=_w(nt?null:ge),Y=Fh(fe?ht(fe):null),$e=Rw(k?be??U:null),ut=Iw($e),Qe=$h(p,{transform:{x:M.x-Je.x,y:M.y-Je.y,scaleX:1,scaleY:1},activatorEvent:D,active:_,activeNodeRect:ge,containerNodeRect:me,draggingNodeRect:Te,over:je.current.over,overlayNodeRect:de.rect,scrollableAncestors:$e,scrollableAncestorRects:ut,windowRect:Y}),Ne=Le?dr(Le,M):null,De=Mw($e),Fe=Vc(De),O=Vc(De,[ge]),B=dr(Qe,Fe),G=Te?rw(Te,Qe):null,J=_&&G?f({active:_,collisionRect:G,droppableRects:E,droppableContainers:H,pointerCoordinates:Ne}):null,ne=Jv(J,"id"),[he,Ue]=m.useState(null),We=nt?Qe:dr(Qe,O),it=tw(We,(s=he==null?void 0:he.rect)!=null?s:null,ge),Be=m.useRef(null),xe=m.useCallback((Ze,st)=>{let{sensor:qe,options:Vt}=st;if(L.current==null)return;const pt=N.get(L.current);if(!pt)return;const dt=Ze.nativeEvent,St=new qe({active:L.current,activeNode:pt,event:dt,options:Vt,context:je,onAbort(Ye){if(!N.get(Ye))return;const{onDragAbort:Ct}=z.current,jt={id:Ye};Ct==null||Ct(jt),v({type:"onDragAbort",event:jt})},onPending(Ye,$t,Ct,jt){if(!N.get(Ye))return;const{onDragPending:un}=z.current,Mt={id:Ye,constraint:$t,initialCoordinates:Ct,offset:jt};un==null||un(Mt),v({type:"onDragPending",event:Mt})},onStart(Ye){const $t=L.current;if($t==null)return;const Ct=N.get($t);if(!Ct)return;const{onDragStart:jt}=z.current,cn={activatorEvent:dt,active:{id:$t,data:Ct.data,rect:A}};rr.unstable_batchedUpdates(()=>{jt==null||jt(cn),w(yn.Initializing),x({type:Xe.DragStart,initialCoordinates:Ye,active:$t}),v({type:"onDragStart",event:cn}),W(Be.current),$(dt)})},onMove(Ye){x({type:Xe.DragMove,coordinates:Ye})},onEnd:Jt(Xe.DragEnd),onCancel:Jt(Xe.DragCancel)});Be.current=St;function Jt(Ye){return async function(){const{active:Ct,collisions:jt,over:cn,scrollAdjustedTranslate:un}=je.current;let Mt=null;if(Ct&&un){const{cancelDrop:dn}=z.current;Mt={activatorEvent:dt,active:Ct,collisions:jt,delta:un,over:cn},Ye===Xe.DragEnd&&typeof dn=="function"&&await Promise.resolve(dn(Mt))&&(Ye=Xe.DragCancel)}L.current=null,rr.unstable_batchedUpdates(()=>{x({type:Ye}),w(yn.Uninitialized),Ue(null),W(null),$(null),Be.current=null;const dn=Ye===Xe.DragEnd?"onDragEnd":"onDragCancel";if(Mt){const Yn=z.current[dn];Yn==null||Yn(Mt),v({type:dn,event:Mt})}})}}},[N]),He=m.useCallback((Ze,st)=>(qe,Vt)=>{const pt=qe.nativeEvent,dt=N.get(Vt);if(L.current!==null||!dt||pt.dndKit||pt.defaultPrevented)return;const St={active:dt};Ze(qe,st.options,St)===!0&&(pt.dndKit={capturedBy:st.sensor},L.current=Vt,xe(qe,st))},[N,xe]),ve=Ew(u,He);Dw(u),nn(()=>{ge&&j===yn.Initializing&&w(yn.Initialized)},[ge,j]),m.useEffect(()=>{const{onDragMove:Ze}=z.current,{active:st,activatorEvent:qe,collisions:Vt,over:pt}=je.current;if(!st||!qe)return;const dt={active:st,activatorEvent:qe,collisions:Vt,delta:{x:B.x,y:B.y},over:pt};rr.unstable_batchedUpdates(()=>{Ze==null||Ze(dt),v({type:"onDragMove",event:dt})})},[B.x,B.y]),m.useEffect(()=>{const{active:Ze,activatorEvent:st,collisions:qe,droppableContainers:Vt,scrollAdjustedTranslate:pt}=je.current;if(!Ze||L.current==null||!st||!pt)return;const{onDragOver:dt}=z.current,St=Vt.get(ne),Jt=St&&St.rect.current?{id:St.id,rect:St.rect.current,data:St.data,disabled:St.disabled}:null,Ye={active:Ze,activatorEvent:st,collisions:qe,delta:{x:pt.x,y:pt.y},over:Jt};rr.unstable_batchedUpdates(()=>{Ue(Jt),dt==null||dt(Ye),v({type:"onDragOver",event:Ye})})},[ne]),nn(()=>{je.current={activatorEvent:D,active:_,activeNode:U,collisionRect:G,collisions:J,droppableRects:E,draggableNodes:N,draggingNode:fe,draggingNodeRect:Te,droppableContainers:T,over:he,scrollableAncestors:$e,scrollAdjustedTranslate:B},A.current={initial:Te,translated:G}},[_,U,J,G,N,fe,Te,E,T,he,$e,B]),kw({...Ce,delta:M,draggingRect:G,pointerCoordinates:Ne,scrollableAncestors:$e,scrollableAncestorRects:ut});const Rt=m.useMemo(()=>({active:_,activeNode:U,activeNodeRect:ge,activatorEvent:D,collisions:J,containerNodeRect:me,dragOverlay:de,draggableNodes:N,droppableContainers:T,droppableRects:E,over:he,measureDroppableContainers:K,scrollableAncestors:$e,scrollableAncestorRects:ut,measuringConfiguration:oe,measuringScheduled:X,windowRect:Y}),[_,U,ge,D,J,me,de,N,T,E,he,K,$e,ut,oe,X,Y]),zt=m.useMemo(()=>({activatorEvent:D,activators:ve,active:_,activeNodeRect:ge,ariaDescribedById:{draggable:S},dispatch:x,draggableNodes:N,over:he,measureDroppableContainers:K}),[D,ve,_,ge,x,S,N,he,K]);return Ie.createElement(Eh.Provider,{value:C},Ie.createElement(yi.Provider,{value:zt},Ie.createElement(Vh.Provider,{value:Rt},Ie.createElement(Ds.Provider,{value:it},c)),Ie.createElement(Uw,{disabled:(a==null?void 0:a.restoreFocus)===!1})),Ie.createElement(Kv,{...a,hiddenTextDescribedById:S}));function _r(){const Ze=(I==null?void 0:I.autoScrollEnabled)===!1,st=typeof l=="object"?l.enabled===!1:l===!1,qe=k&&!Ze&&!st;return typeof l=="object"?{...l,enabled:qe}:{enabled:qe}}}),Kw=m.createContext(null),Uc="button",Gw="Draggable";function Uh(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const s=Rs(Gw),{activators:o,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:h}=m.useContext(yi),{role:p=Uc,roleDescription:g="draggable",tabIndex:b=0}=i??{},y=(l==null?void 0:l.id)===t,x=m.useContext(y?Ds:Kw),[v,C]=ns(),[j,w]=ns(),k=Ow(o,t),P=ii(n);nn(()=>(f.set(t,{id:t,key:s,node:v,activatorNode:j,data:P}),()=>{const M=f.get(t);M&&M.key===s&&f.delete(t)}),[f,t]);const N=m.useMemo(()=>({role:p,tabIndex:b,"aria-disabled":r,"aria-pressed":y&&p===Uc?!0:void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[r,p,b,y,g,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:N,isDragging:y,listeners:r?void 0:k,node:v,over:h,setNodeRef:C,setActivatorNodeRef:w,transform:x}}function Wh(){return m.useContext(Vh)}const Yw="Droppable",Xw={timeout:25};function rl(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const s=Rs(Yw),{active:o,dispatch:a,over:l,measureDroppableContainers:c}=m.useContext(yi),u=m.useRef({disabled:n}),f=m.useRef(!1),h=m.useRef(null),p=m.useRef(null),{disabled:g,updateMeasurementsFor:b,timeout:y}={...Xw,...i},x=ii(b??r),v=m.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(x.current)?x.current:[x.current]),p.current=null},y)},[y]),C=Ms({callback:v,disabled:g||!o}),j=m.useCallback((N,M)=>{C&&(M&&(C.unobserve(M),f.current=!1),N&&C.observe(N))},[C]),[w,k]=ns(j),P=ii(t);return m.useEffect(()=>{!C||!w.current||(C.disconnect(),f.current=!1,C.observe(w.current))},[w,C]),m.useEffect(()=>(a({type:Xe.RegisterDroppable,element:{id:r,key:s,disabled:n,node:w,rect:h,data:P}}),()=>a({type:Xe.UnregisterDroppable,key:s,id:r})),[r]),m.useEffect(()=>{n!==u.current.disabled&&(a({type:Xe.SetDroppableDisabled,id:r,key:s,disabled:n}),u.current.disabled=n)},[r,s,n,a]),{active:o,rect:h,isOver:(l==null?void 0:l.id)===r,node:w,over:l,setNodeRef:k}}function Jw(e){let{animation:t,children:n}=e;const[r,i]=m.useState(null),[s,o]=m.useState(null),a=rs(n);return!n&&!r&&a&&i(a),nn(()=>{if(!s)return;const l=r==null?void 0:r.key,c=r==null?void 0:r.props.id;if(l==null||c==null){i(null);return}Promise.resolve(t(c,s)).then(()=>{i(null)})},[t,r,s]),Ie.createElement(Ie.Fragment,null,n,r?m.cloneElement(r,{ref:o}):null)}const Qw={x:0,y:0,scaleX:1,scaleY:1};function Zw(e){let{children:t}=e;return Ie.createElement(yi.Provider,{value:zh},Ie.createElement(Ds.Provider,{value:Qw},t))}const e1={position:"fixed",touchAction:"none"},t1=e=>Ga(e)?"transform 250ms ease":void 0,n1=m.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:s,className:o,rect:a,style:l,transform:c,transition:u=t1}=e;if(!a)return null;const f=i?c:{...c,scaleX:1,scaleY:1},h={...e1,width:a.width,height:a.height,top:a.top,left:a.left,transform:mr.Transform.toString(f),transformOrigin:i&&r?Yv(r,a):void 0,transition:typeof u=="function"?u(r):u,...l};return Ie.createElement(n,{className:o,style:h,ref:t},s)}),r1=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:s,className:o}=e;if(s!=null&&s.active)for(const[a,l]of Object.entries(s.active))l!==void 0&&(i[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(s!=null&&s.dragOverlay)for(const[a,l]of Object.entries(s.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[l,c]of Object.entries(i))n.node.style.setProperty(l,c);o!=null&&o.active&&n.node.classList.remove(o.active)}},i1=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:mr.Transform.toString(t)},{transform:mr.Transform.toString(n)}]},s1={duration:250,easing:"ease",keyframes:i1,sideEffects:r1({styles:{active:{opacity:"0"}}})};function o1(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return _s((s,o)=>{if(t===null)return;const a=n.get(s);if(!a)return;const l=a.node.current;if(!l)return;const c=Bh(o);if(!c)return;const{transform:u}=ht(o).getComputedStyle(o),f=Ph(u);if(!f)return;const h=typeof t=="function"?t:a1(t);return Ih(l,i.draggable.measure),h({active:{id:s,data:a.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:o,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:f})})}function a1(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...s1,...e};return s=>{let{active:o,dragOverlay:a,transform:l,...c}=s;if(!t)return;const u={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},f={scaleX:l.scaleX!==1?o.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?o.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-u.x,y:l.y-u.y,...f},p=i({...c,active:o,dragOverlay:a,transform:{initial:l,final:h}}),[g]=p,b=p[p.length-1];if(JSON.stringify(g)===JSON.stringify(b))return;const y=r==null?void 0:r({active:o,dragOverlay:a,...c}),x=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(v=>{x.onfinish=()=>{y==null||y(),v()}})}}let Wc=0;function l1(e){return m.useMemo(()=>{if(e!=null)return Wc++,Wc},[e])}const c1=Ie.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:s,modifiers:o,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggableNodes:g,droppableContainers:b,dragOverlay:y,over:x,measuringConfiguration:v,scrollableAncestors:C,scrollableAncestorRects:j,windowRect:w}=Wh(),k=m.useContext(Ds),P=l1(f==null?void 0:f.id),N=$h(o,{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:y.rect,over:x,overlayNodeRect:y.rect,scrollableAncestors:C,scrollableAncestorRects:j,transform:k,windowRect:w}),M=nl(h),T=o1({config:r,draggableNodes:g,droppableContainers:b,measuringConfiguration:v}),R=M?y.setRef:void 0;return Ie.createElement(Zw,null,Ie.createElement(Jw,{animation:T},f&&P?Ie.createElement(n1,{key:P,id:f.id,ref:R,as:a,activatorEvent:u,adjustScale:t,className:l,transition:s,rect:M,style:{zIndex:c,...i},transform:N},n):null))}),u1="cc-card-display",d1={effort:!0,category:!0,priority:!0,tags:!0,project:!0};function f1(){const[e,t]=Vn(u1,d1),n=m.useCallback(s=>{t(o=>({...o,[s]:!o[s]}))},[t]),r=e.effort&&e.category&&e.priority&&e.tags,i=[e.effort,e.category,e.priority,e.tags,e.project].filter(s=>!s).length;return{display:e,toggle:n,isAllVisible:r,hiddenCount:i}}const il=["critical","high","medium","low"],sl=["feature","bugfix","refactor","infrastructure","docs"],Os=["<1H","1-4H","4H+","TBD"],Hh=["has-blockers","blocks-others","no-deps"],qh=[{id:"frontend-designer",label:"Frontend Designer",emoji:"🎨",color:"#EC4899"},{id:"architect",label:"Architect",emoji:"🏗️",color:"#536dfe"},{id:"rules-enforcer",label:"Rules Enforcer",emoji:"📋",color:"#6B7280"}];function h1(e){return Object.fromEntries(qh.map(n=>[n.id,n.emoji]))}function p1(e){return Object.fromEntries(qh.map(n=>[n.id,n.color]))}const QD=h1(),ZD=p1();function m1(e){if(!e)return"TBD";const t=e.toLowerCase().trim(),n=t.match(/(\d+(?:\.\d+)?)\s*(?:-\s*\d+(?:\.\d+)?)?\s*hour/);if(n){const s=parseFloat(n[1]);return s<1?"<1H":s<=4?"1-4H":"4H+"}if(t.match(/(\d+)\s*(?:-\s*\d+)?\s*min/))return"<1H";const i=t.match(/\((\d+(?:\.\d+)?)\s*(?:-\s*\d+(?:\.\d+)?)?\s*(hour|min)/);if(i){const s=parseFloat(i[1]);return i[2].startsWith("min")||s<1?"<1H":s<=4?"1-4H":"4H+"}return t.includes("large")||t.includes("multi")?"4H+":t.includes("medium")||t.includes("half")?"1-4H":t.includes("small")?"<1H":"TBD"}function g1(e){const t=[];return e.blocked_by.length>0&&t.push("has-blockers"),e.blocks.length>0&&t.push("blocks-others"),e.blocked_by.length===0&&e.blocks.length===0&&t.push("no-deps"),t}function ol(e,t){switch(t){case"priority":return e.priority?[e.priority]:[];case"category":return e.category?[e.category]:[];case"tags":return e.tags;case"effort":return[m1(e.effort_estimate)];case"dependencies":return g1(e);case"project":return e.project_id?[e.project_id]:[]}}function x1(e,t,n){return n.size===0?!0:ol(e,t).some(i=>n.has(i))}function Hc(){return{priority:new Set,category:new Set,tags:new Set,effort:new Set,dependencies:new Set}}function y1(e){const[t,n]=m.useState(Hc),r=m.useCallback((c,u)=>{n(f=>{const h={...f,[c]:new Set(f[c])};return h[c].has(u)?h[c].delete(u):h[c].add(u),h})},[]),i=m.useCallback(c=>{n(u=>({...u,[c]:new Set}))},[]),s=m.useCallback(()=>{n(Hc())},[]),o=m.useMemo(()=>Object.values(t).some(c=>c.size>0),[t]),a=m.useMemo(()=>o?e.filter(c=>Object.keys(t).every(u=>x1(c,u,t[u]))):e,[e,t,o]),l=m.useMemo(()=>{const c=new Set;for(const x of e)for(const v of x.tags)c.add(v);const u=[...c].sort();function f(x,v){return e.filter(C=>ol(C,x).includes(v)).length}const h=il.map(x=>({value:x,label:x,count:f("priority",x)})),p=sl.map(x=>({value:x,label:x,count:f("category",x)})),g=u.map(x=>({value:x,label:x,count:f("tags",x)})),b=Os.map(x=>({value:x,label:x,count:f("effort",x)})),y=Hh.map(x=>({value:x,label:x==="has-blockers"?"Has blockers":x==="blocks-others"?"Blocks others":"No dependencies",count:f("dependencies",x)}));return{priority:h,category:p,tags:g,effort:b,dependencies:y}},[e]);return{filters:t,toggleFilter:r,clearField:i,clearAll:s,hasActiveFilters:o,filteredScopes:a,optionsWithCounts:l}}const b1="cc-board-sort",v1="cc-board-collapsed",Kh={id:"asc",priority:"asc",effort:"asc",updated_at:"desc",created_at:"desc",title:"asc"},qc={critical:0,high:1,medium:2,low:3};function Kc(e){if(!e)return 1/0;const t=Os.indexOf(e);return t>=0?t:1/0}const w1={field:"id",direction:"asc"},k1={deserialize:e=>{const t=JSON.parse(e);if(t.field in Kh)return{field:t.field,direction:t.direction==="desc"?"desc":"asc"}}};function sa(e,t,n){return[...e].sort((i,s)=>{const o=S1(i,s,t);return n==="desc"?-o:o})}function S1(e,t,n){switch(n){case"id":return e.id-t.id;case"priority":{const r=e.priority?qc[e.priority]??1/0:1/0,i=t.priority?qc[t.priority]??1/0:1/0;return r-i}case"effort":return Kc(e.effort_estimate)-Kc(t.effort_estimate);case"updated_at":{const r=e.updated_at?new Date(e.updated_at).getTime():0,i=t.updated_at?new Date(t.updated_at).getTime():0;return r-i}case"created_at":{const r=e.created_at?new Date(e.created_at).getTime():0,i=t.created_at?new Date(t.created_at).getTime():0;return r-i}case"title":return e.title.localeCompare(t.title);default:return 0}}function C1(){const[e,t]=Vn(b1,w1,k1),[n,r]=Vn(v1,new Set,Jf),i=m.useCallback(o=>{t(a=>{const l=a.field===o?a.direction==="asc"?"desc":"asc":Kh[o];return{field:o,direction:l}})},[t]),s=m.useCallback(o=>{r(a=>{const l=new Set(a);return l.has(o)?l.delete(o):l.add(o),l})},[r]);return{sortField:e.field,sortDirection:e.direction,setSort:i,collapsed:n,toggleCollapse:s}}const j1="cc-view-mode",E1="cc-swim-group",T1="cc-swim-collapsed",N1={serialize:e=>e,deserialize:e=>e==="kanban"||e==="swimlane"?e:void 0},P1={serialize:e=>e,deserialize:e=>e==="priority"||e==="category"||e==="tags"||e==="effort"||e==="dependencies"||e==="project"?e:void 0};function A1(){const[e,t]=Vn(j1,"kanban",N1),[n,r]=Vn(E1,"priority",P1),[i,s]=Vn(T1,new Set,Jf),o=m.useCallback(l=>{r(l),s(new Set)},[r,s]),a=m.useCallback(l=>{s(c=>{const u=new Set(c);return u.has(l)?u.delete(l):u.add(l),u})},[s]);return{viewMode:e,setViewMode:t,groupField:n,setGroupField:o,collapsedLanes:i,toggleLaneCollapse:a}}function _1(){const{settings:e}=Wa();return m.useMemo(()=>e.fontScale===1?[]:[({transform:n})=>({...n,x:n.x/e.fontScale,y:n.y/e.fontScale})],[e.fontScale])}function R1(e,t){var n;if(e.phase)return e.phase;if(t.includes(e.id)||e.gitBranch)return"shipped";if(e.isEntryPoint||e.group==="planning")return"queued";if(e.sessionKey){if(e.sessionKey.toLowerCase().includes("implement"))return"active";if(e.sessionKey.toLowerCase().includes("review")||e.sessionKey.toLowerCase().includes("gate")||e.sessionKey.toLowerCase().includes("commit")||e.sessionKey.toLowerCase().includes("verify"))return"review";if(e.sessionKey.toLowerCase().includes("push")||e.sessionKey.toLowerCase().includes("deploy"))return"shipped";if(e.sessionKey.toLowerCase().includes("create")||e.sessionKey.toLowerCase().includes("scope"))return"queued"}return e.group==="development"?e.order<=3?"active":"review":e.group==="active"?"active":(n=e.group)!=null&&n.startsWith("deploy")||e.group==="main"?"shipped":"queued"}const M1=[{phase:"queued",label:"Queued",order:0},{phase:"active",label:"Active",order:1},{phase:"review",label:"Review",order:2},{phase:"shipped",label:"Shipped",order:3}];class gr{constructor(t){yt(this,"phaseMap");this.engine=t,this.phaseMap=new Map;const n=t.getLists(),r=t.getConfig().terminalStatuses??[];for(const i of n)this.phaseMap.set(i.id,R1(i,r))}getPhase(t){return this.phaseMap.get(t)??"queued"}getListsForPhase(t){return this.engine.getLists().filter(n=>this.getPhase(n.id)===t)}getPhaseMap(){return this.phaseMap}resolveNormalizedTransition(t,n){return this.engine.getConfig().edges.filter(i=>i.from===t&&this.getPhase(i.to)===n)}}function D1(e){if(e.length<=1)return!0;const t=e[0].getLists().map(n=>n.id).join(",");return e.every(n=>n.getLists().map(r=>r.id).join(",")===t)}async function O1(e,t){try{const n=await fetch(e(`/dispatch/active?scope_id=${t}`));if(!n.ok)return!1;const{active:r}=await n.json();return r!=null}catch{return!1}}function co(e){const t=String(e);if(t.startsWith("sprint-drop-"))return{type:"sprint-drop",sprintId:parseInt(t.slice(12))};if(t.startsWith("sprint-"))return{type:"sprint",sprintId:parseInt(t.slice(7))};if(typeof e=="number"||/^-?\d+$/.test(t))return{type:"scope",scopeId:Number(e)};if(t.startsWith("swim::")){const r=t.lastIndexOf("::");return{type:"column",status:t.slice(r+2)}}const n=t.match(/^(.+?)::(-?\d+)$/);return n?{type:"scope",scopeId:Number(n[2]),projectId:n[1]}:{type:"column",status:t}}const I1={activeScope:null,activeSprint:null,overId:null,overIsValid:!1,overSprintId:null,pending:null,showModal:!1,showPopover:!1,showIdeaForm:!1,dispatching:!1,error:null,pendingSprintDispatch:null,pendingUnmetDeps:null,pendingDepSprintId:null,pendingDisambiguation:null};function L1({scopes:e,sprints:t,onAddToSprint:n,onRemoveFromSprint:r,isPhaseView:i,projectEngines:s,defaultProjectId:o}){const{engine:a}=sn(),l=Yt(),{getApiBase:c,hasMultipleProjects:u}=Gt(),f=m.useCallback((D,$)=>u&&D.project_id?`${c(D.project_id)}${$}`:l($),[l,c,u]),h=m.useCallback(async(D,$)=>{const z=oe=>f(D,oe),S=$.command!=null&&D.id>0?await O1(z,D.id):!1,H=$.confirmLevel==="full";g(oe=>({...oe,pending:{scope:D,transition:$,hasActiveSession:S},showModal:H,showPopover:!H,error:null}))},[f]),[p,g]=m.useState(I1),b=m.useRef(null),y=m.useRef(null);m.useEffect(()=>{b.current=p.activeScope,y.current=p.activeSprint},[p.activeScope,p.activeSprint]);const x=m.useCallback(D=>{const $=co(D.active.id);if($){if($.type==="scope"){const z=e.find(S=>S.id===$.scopeId&&(!$.projectId||S.project_id===$.projectId));z&&g(S=>({...S,activeScope:z,activeSprint:null,overId:null,overIsValid:!1,overSprintId:null,error:null}))}else if($.type==="sprint"){const z=t.find(S=>S.id===$.sprintId);z&&g(S=>({...S,activeScope:null,activeSprint:z,overId:null,overIsValid:!1,overSprintId:null,error:null}))}}},[e,t]),v=m.useCallback(D=>{var oe;const $=(oe=D.over)==null?void 0:oe.id;if(!$){g(E=>({...E,overId:null,overIsValid:!1,overSprintId:null}));return}const z=co($);if(!z)return;const S=y.current,H=b.current;if(S){if(z.type==="column"){const E=S.status!=="assembling"?a.getBatchTargetStatus(S.target_column)??S.target_column:S.target_column,K=a.isValidTransition(E,z.status);g(X=>({...X,overId:K?z.status:null,overIsValid:K,overSprintId:null}))}else g(E=>({...E,overId:null,overIsValid:!1,overSprintId:null}));return}if(H)if(t.some(K=>K.status==="assembling"&&K.scope_ids.includes(H.id))){const K=z.type==="column"&&z.status===H.status;g(X=>({...X,overId:K?z.status:null,overIsValid:K,overSprintId:null}))}else if(z.type==="sprint-drop"){const K=t.find(U=>U.id===z.sprintId),X=(K==null?void 0:K.status)==="assembling"&&H.status===K.target_column&&(!H.project_id||!K.project_id||H.project_id===K.project_id);g(U=>({...U,overId:null,overIsValid:!!X,overSprintId:z.sprintId}))}else if(z.type==="column"){let K;if(i&&H.project_id&&s){const X=s.get(H.project_id);X?K=new gr(X).resolveNormalizedTransition(H.status,z.status).length>0:K=!1}else K=a.isValidTransition(H.status,z.status);g(X=>({...X,overId:z.status,overIsValid:K,overSprintId:null}))}else g(K=>({...K,overId:null,overIsValid:!1,overSprintId:null}))},[t,a,i,s]),C=m.useCallback(async D=>{var oe;const $=(oe=D.over)==null?void 0:oe.id,z=b.current,S=y.current;if(g(E=>({...E,activeScope:null,activeSprint:null,overId:null,overIsValid:!1,overSprintId:null})),!$)return;const H=co($);if(H){if(S&&H.type==="column"){const E=S.status!=="assembling"?a.getBatchTargetStatus(S.target_column)??S.target_column:S.target_column;if(a.isValidTransition(E,H.status)){g(K=>({...K,pendingSprintDispatch:S}));return}}if(z&&H.type==="sprint-drop"){const E=t.find(X=>X.id===H.sprintId);if(E&&(z.status!==E.target_column||z.project_id&&E.project_id&&z.project_id!==E.project_id)){g(X=>({...X,error:z.project_id!==(E==null?void 0:E.project_id)?`Cannot add scope from a different project to this ${E.group_type}`:`Cannot add ${z.status} scope to ${E.target_column} ${E.group_type} — scope status must match ${E.group_type} column`}));return}const K=await n(H.sprintId,[z.id]);K&&K.unmet_dependencies.length>0&&g(X=>({...X,pendingUnmetDeps:K.unmet_dependencies,pendingDepSprintId:H.sprintId}));return}if(z&&H.type==="column"){if(z.status===H.status){const K=t.find(X=>X.status==="assembling"&&X.scope_ids.includes(z.id));K&&await r(K.id,[z.id]);return}let E;if(i&&z.project_id&&s){const K=s.get(z.project_id);if(K){const U=new gr(K).resolveNormalizedTransition(z.status,H.status);if(U.length>1){g(Le=>({...Le,pendingDisambiguation:{scope:z,edges:U}}));return}E=U[0]}}else E=a.findEdge(z.status,H.status);if(!E)return;await h(z,E)}}},[n,r,a,t,h,i,s]),j=m.useCallback(async()=>{const{pending:D}=p;if(!D)return;g(E=>({...E,dispatching:!0,error:null}));const{scope:$,transition:z}=D,S=i&&$.project_id&&(s==null?void 0:s.get($.project_id))||a,H=S.buildCommand(z,$.id),oe=E=>f($,E);try{const E=S.getEntryPoint().id;if($.status===E&&z.direction==="forward"&&$.slug){const X=await fetch(oe(`/ideas/${$.slug}/promote`),{method:"POST"});if(!X.ok){const U=await X.json().catch(()=>({error:"Request failed"}));throw new Error(U.error??`HTTP ${X.status}`)}}else if(H){const X=await fetch(oe("/dispatch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope_id:$.id,command:H,transition:z.skipServerTransition?void 0:{from:z.from,to:z.to}})});if(!X.ok){const U=await X.json().catch(()=>({error:"Request failed"}));throw new Error(U.error??`HTTP ${X.status}`)}}else{const X=await fetch(oe(`/scopes/${$.id}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:z.to})});if(!X.ok){const U=await X.json().catch(()=>({error:"Request failed"}));throw new Error(U.error??`Failed to update scope status: HTTP ${X.status}`)}}g(X=>({...X,pending:null,showModal:!1,showPopover:!1,dispatching:!1}))}catch(E){g(K=>({...K,dispatching:!1,error:E instanceof Error?E.message:"Dispatch failed"}))}},[p,a,f,i,s]),w=m.useCallback(async D=>{const $=p.pendingDisambiguation;$&&(g(z=>({...z,pendingDisambiguation:null})),await h($.scope,D))},[p.pendingDisambiguation,h]),k=m.useCallback(()=>{g(D=>({...D,pendingDisambiguation:null}))},[]),P=m.useCallback(()=>{g(D=>({...D,pending:null,showModal:!1,showPopover:!1,dispatching:!1,error:null}))},[]),N=m.useCallback(()=>{g(D=>({...D,error:null}))},[]),M=m.useCallback(()=>{g(D=>({...D,showPopover:!1,showModal:!0}))},[]),T=m.useCallback(()=>{g(D=>({...D,showIdeaForm:!0}))},[]),R=m.useCallback(()=>{g(D=>({...D,showIdeaForm:!1}))},[]),A=m.useCallback(async(D,$)=>{g(z=>({...z,dispatching:!0,error:null}));try{const z=o?`${c(o)}/ideas`:l("/ideas"),S=await fetch(z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:D,description:$})});if(!S.ok){const H=await S.json().catch(()=>({error:"Request failed"}));throw new Error(H.error??`HTTP ${S.status}`)}g(H=>({...H,dispatching:!1,showIdeaForm:!1}))}catch(z){g(S=>({...S,dispatching:!1,error:z instanceof Error?z.message:"Failed to create idea"}))}},[l,o,c]),_=m.useCallback(()=>{g(D=>({...D,pendingSprintDispatch:null}))},[]),L=m.useCallback(()=>{g(D=>({...D,pendingUnmetDeps:null,pendingDepSprintId:null}))},[]),I=m.useCallback(async D=>{p.pendingDepSprintId!=null&&await n(p.pendingDepSprintId,D),g($=>({...$,pendingUnmetDeps:null,pendingDepSprintId:null}))},[p.pendingDepSprintId,n]),W=m.useCallback((D,$)=>{g(z=>({...z,pendingUnmetDeps:$,pendingDepSprintId:D}))},[]);return{state:p,onDragStart:x,onDragOver:v,onDragEnd:C,confirmTransition:j,cancelTransition:P,dismissError:N,openModalFromPopover:M,openIdeaForm:T,closeIdeaForm:R,submitIdea:A,dismissSprintDispatch:_,dismissUnmetDeps:L,resolveUnmetDeps:I,showUnmetDeps:W,selectDisambiguation:w,dismissDisambiguation:k}}function ir(e){return e.project_id?`${e.project_id}::${e.id}`:String(e.id)}function Mi(e,t,n){return e.id!==t?!1:n?!e.project_id||e.project_id===n:!0}function F1(){const e=Yt(),{activeProjectId:t,getApiBase:n,hasMultipleProjects:r}=Gt(),[i,s]=m.useState([]),[o,a]=m.useState(!0),l=m.useRef(!1),c=m.useCallback(async j=>{try{const w=await fetch(e("/sprints"),{signal:j});if(!w.ok)return;const k=await w.json();if(t)for(const P of k)P.project_id||(P.project_id=t);s(k)}catch(w){if(w instanceof DOMException&&w.name==="AbortError")return;console.warn("[Orbital] Failed to fetch sprints:",w)}finally{j!=null&&j.aborted||a(!1)}},[e,t]);m.useEffect(()=>{const j=new AbortController;return c(j.signal),()=>j.abort()},[c]),Es(c),m.useEffect(()=>{function j(N){l.current||s(M=>{const T=ir(N);return M.some(R=>ir(R)===T)?M:[N,...M]})}function w(N){l.current||s(M=>{const T=M.findIndex(R=>Mi(R,N.id,N.project_id));if(T>=0){const R=[...M];return R[T]=N,R}return[N,...M]})}function k({id:N,project_id:M}){l.current||s(T=>T.filter(R=>!Mi(R,N,M)))}function P(N){l.current||s(M=>{const T=M.findIndex(R=>Mi(R,N.id,N.project_id));if(T>=0){const R=[...M];return R[T]=N,R}return M})}return Q.on("sprint:created",j),Q.on("sprint:updated",w),Q.on("sprint:deleted",k),Q.on("sprint:completed",P),()=>{Q.off("sprint:created",j),Q.off("sprint:updated",w),Q.off("sprint:deleted",k),Q.off("sprint:completed",P)}},[]);const u=m.useCallback(async(j,w)=>{const{projectId:k,...P}=w??{},N=k?`${n(k)}/sprints`:e("/sprints"),M=await fetch(N,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:j,...P})});if(!M.ok)return null;const T=await M.json();return k&&!T.project_id&&(T.project_id=k),T},[e,n]),f=m.useCallback((j,w)=>{if(r){const k=i.find(P=>P.id===j);if(k!=null&&k.project_id)return`${n(k.project_id)}${w}`}return e(w)},[e,n,r,i]),h=m.useCallback(async(j,w)=>(await fetch(f(j,`/sprints/${j}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:w})})).ok,[f]),p=m.useCallback(async j=>(await fetch(f(j,`/sprints/${j}`),{method:"DELETE"})).ok,[f]),g=m.useCallback(async(j,w)=>{const k=await fetch(f(j,`/sprints/${j}/scopes`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope_ids:w})});return k.ok?k.json():null},[f]),b=m.useCallback(async(j,w)=>(await fetch(f(j,`/sprints/${j}/scopes`),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope_ids:w})})).ok,[f]),y=m.useCallback(async j=>(await fetch(f(j,`/sprints/${j}/dispatch`),{method:"POST"})).json(),[f]),x=m.useCallback(async j=>(await fetch(f(j,`/sprints/${j}/cancel`),{method:"POST"})).ok,[f]),v=m.useCallback(async j=>{const w=await fetch(f(j,`/sprints/${j}/graph`));return w.ok?w.json():null},[f]),C=m.useCallback(async(j,w,k)=>{const P=i.find(R=>R.id===j&&R.project_id===w);if(!P||P.scope_ids.length>0||P.status!=="assembling")return null;if(l.current=!0,s(R=>R.map(A=>Mi(A,j,w)?{...A,project_id:k}:A)),!(await fetch(`${n(w)}/sprints/${j}`,{method:"DELETE"})).ok)return l.current=!1,s(R=>R.map(A=>A.id===j&&A.project_id===k?{...A,project_id:w}:A)),null;const M=await fetch(`${n(k)}/sprints`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:P.name,target_column:P.target_column,group_type:P.group_type})});if(!M.ok)return l.current=!1,s(R=>R.filter(A=>!(A.id===j&&A.project_id===k))),null;const T=await M.json();return T.project_id=k,s(R=>{const A=ir(T);let _=!1;return R.reduce((I,W)=>!_&&W.id===j&&W.project_id===k?(_=!0,I.push(T),I):(ir(W)===A||I.push(W),I),[])}),setTimeout(()=>{l.current=!1},500),T},[i,n]);return{sprints:i,loading:o,refetch:c,createSprint:u,renameSprint:h,deleteSprint:p,addScopes:g,removeScopes:b,dispatchSprint:y,cancelSprint:x,getGraph:v,moveSprintToProject:C}}function B1(e,t,n,r){const[i,s]=m.useState(null),[o,a]=m.useState(!1);m.useEffect(()=>{if(!e)return;let u=!1;return a(!0),t(e.id).then(f=>{u||(s(f),a(!1))}),()=>{u=!0}},[e,t]);const l=m.useCallback(async()=>{e&&(await n(e.id),r(),s(null))},[e,n,r]),c=m.useCallback(()=>{r(),s(null)},[r]);return{graph:i,loading:o,showPreflight:e!=null,pendingSprint:e,onConfirm:l,onCancel:c}}function z1(e,t){const n=Yt(),[r,i]=m.useState(!1),s=m.useCallback(async()=>{i(!0);try{const l=await fetch(n("/ideas/surprise"),{method:"POST"});if(!l.ok){const c=await l.json().catch(()=>({error:"Request failed"}));throw new Error(c.error??`HTTP ${l.status}`)}e()}catch(l){console.error("[Orbital] Surprise Me failed:",l)}finally{i(!1)}},[e,n]),o=m.useCallback(async l=>{try{const c=await fetch(n(`/ideas/${l}/approve`),{method:"POST"});if(!c.ok)throw new Error(`HTTP ${c.status}`);t(null)}catch(c){console.error("[Orbital] Failed to approve idea:",c)}},[t,n]),a=m.useCallback(l=>{t(null),fetch(n(`/ideas/${l}`),{method:"DELETE"}).catch(()=>{})},[t,n]);return{surpriseLoading:r,handleSurprise:s,handleApproveGhost:o,handleRejectGhost:a}}function V1(e){return(e.split("/").pop()??"").replace(/\.md$/,"").toLowerCase()}function Gc(e,t){var r,i,s;const n=t.toLowerCase().trim();return!!(!n||e.title.toLowerCase().includes(n)||String(e.id).startsWith(n)||V1(e.file_path).includes(n)||(r=e.category)!=null&&r.toLowerCase().includes(n)||(i=e.priority)!=null&&i.toLowerCase().includes(n)||(s=e.effort_estimate)!=null&&s.toLowerCase().includes(n)||e.status.toLowerCase().includes(n)||e.tags.some(o=>o.toLowerCase().includes(n)))}function $1(e){const[t,n]=m.useState(""),[r,i]=m.useState("filter"),s=m.useDeferredValue(t),o=s.trim().length>0,a=t!==s,{displayScopes:l,dimmedIds:c,matchCount:u}=m.useMemo(()=>{if(!o)return{displayScopes:e,dimmedIds:new Set,matchCount:e.length};if(r==="filter"){const p=e.filter(g=>Gc(g,s));return{displayScopes:p,dimmedIds:new Set,matchCount:p.length}}const f=new Set;let h=0;for(const p of e)Gc(p,s)?h++:f.add(ce(p));return{displayScopes:e,dimmedIds:f,matchCount:h}},[e,s,o,r]);return{query:t,setQuery:n,mode:r,setMode:i,hasSearch:o,isStale:a,displayScopes:l,dimmedIds:c,matchCount:u}}function U1(){const[e,t]=Cf(),n=e.get("highlight")??null,r=m.useCallback(()=>{t(i=>(i.delete("highlight"),i),{replace:!0})},[t]);return{highlightedScopeKey:n,clearHighlight:r}}const al=m.createContext({});function ll(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const Is=m.createContext(null),cl=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class W1 extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function H1({children:e,isPresent:t}){const n=m.useId(),r=m.useRef(null),i=m.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=m.useContext(cl);return m.useInsertionEffect(()=>{const{width:o,height:a,top:l,left:c}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return s&&(u.nonce=s),document.head.appendChild(u),u.sheet&&u.sheet.insertRule(`
|
|
298
|
+
[data-motion-pop-id="${n}"] {
|
|
299
|
+
position: absolute !important;
|
|
300
|
+
width: ${o}px !important;
|
|
301
|
+
height: ${a}px !important;
|
|
302
|
+
top: ${l}px !important;
|
|
303
|
+
left: ${c}px !important;
|
|
304
|
+
}
|
|
305
|
+
`),()=>{document.head.removeChild(u)}},[t]),d.jsx(W1,{isPresent:t,childRef:r,sizeRef:i,children:m.cloneElement(e,{ref:r})})}const q1=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=ll(K1),l=m.useId(),c=m.useCallback(f=>{a.set(f,!0);for(const h of a.values())if(!h)return;r&&r()},[a,r]),u=m.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:c,register:f=>(a.set(f,!1),()=>a.delete(f))}),s?[Math.random(),c]:[n,c]);return m.useMemo(()=>{a.forEach((f,h)=>a.set(h,!1))},[n]),m.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=d.jsx(H1,{isPresent:n,children:e})),d.jsx(Is.Provider,{value:u,children:e})};function K1(){return new Map}function Gh(e=!0){const t=m.useContext(Is);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=m.useId();m.useEffect(()=>{e&&i(s)},[e]);const o=m.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const Di=e=>e.key||"";function Yc(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const ul=typeof window<"u",Yh=ul?m.useLayoutEffect:m.useEffect,ls=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1})=>{const[a,l]=Gh(o),c=m.useMemo(()=>Yc(e),[e]),u=o&&!a?[]:c.map(Di),f=m.useRef(!0),h=m.useRef(c),p=ll(()=>new Map),[g,b]=m.useState(c),[y,x]=m.useState(c);Yh(()=>{f.current=!1,h.current=c;for(let j=0;j<y.length;j++){const w=Di(y[j]);u.includes(w)?p.delete(w):p.get(w)!==!0&&p.set(w,!1)}},[y,u.length,u.join("-")]);const v=[];if(c!==g){let j=[...c];for(let w=0;w<y.length;w++){const k=y[w],P=Di(k);u.includes(P)||(j.splice(w,0,k),v.push(k))}s==="wait"&&v.length&&(j=v),x(Yc(j)),b(c);return}const{forceRender:C}=m.useContext(al);return d.jsx(d.Fragment,{children:y.map(j=>{const w=Di(j),k=o&&!a?!1:c===y||u.includes(w),P=()=>{if(p.has(w))p.set(w,!0);else return;let N=!0;p.forEach(M=>{M||(N=!1)}),N&&(C==null||C(),x(h.current),o&&(l==null||l()),r&&r())};return d.jsx(q1,{isPresent:k,initial:!f.current||n?void 0:!1,custom:k?void 0:t,presenceAffectsLayout:i,mode:s,onExitComplete:k?void 0:P,children:j},w)})})},gt=e=>e;let eO=gt,Xh=gt;function dl(e){let t;return()=>(t===void 0&&(t=e()),t)}const xr=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},en=e=>e*1e3,tn=e=>e/1e3,G1={useManualTiming:!1};function Y1(e){let t=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(l.schedule(c),e()),c(o)}const l={schedule:(c,u=!1,f=!1)=>{const p=f&&r?t:n;return u&&s.add(c),p.has(c)||p.add(c),c},cancel:c=>{n.delete(c),s.delete(c)},process:c=>{if(o=c,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(a),t.clear(),r=!1,i&&(i=!1,l.process(c))}};return l}const Oi=["read","resolveKeyframes","update","preRender","render","postRender"],X1=40;function Jh(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Oi.reduce((x,v)=>(x[v]=Y1(s),x),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:f,postRender:h}=o,p=()=>{const x=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(x-i.timestamp,X1),1),i.timestamp=x,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),f.process(i),h.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},g=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Oi.reduce((x,v)=>{const C=o[v];return x[v]=(j,w=!1,k=!1)=>(n||g(),C.schedule(j,w,k)),x},{}),cancel:x=>{for(let v=0;v<Oi.length;v++)o[Oi[v]].cancel(x)},state:i,steps:o}}const{schedule:_e,cancel:kn,state:rt,steps:uo}=Jh(typeof requestAnimationFrame<"u"?requestAnimationFrame:gt,!0),Qh=m.createContext({strict:!1}),Xc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},yr={};for(const e in Xc)yr[e]={isEnabled:t=>Xc[e].some(n=>!!t[n])};function J1(e){for(const t in e)yr[t]={...yr[t],...e[t]}}const Q1=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function cs(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Q1.has(e)}let Zh=e=>!cs(e);function Z1(e){e&&(Zh=t=>t.startsWith("on")?!cs(t):e(t))}try{Z1(require("@emotion/is-prop-valid").default)}catch{}function ek(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Zh(i)||n===!0&&cs(i)||!t&&!cs(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function tk(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Ls=m.createContext({});function oi(e){return typeof e=="string"||Array.isArray(e)}function Fs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const fl=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],hl=["initial",...fl];function Bs(e){return Fs(e.animate)||hl.some(t=>oi(e[t]))}function ep(e){return!!(Bs(e)||e.variants)}function nk(e,t){if(Bs(e)){const{initial:n,animate:r}=e;return{initial:n===!1||oi(n)?n:void 0,animate:oi(r)?r:void 0}}return e.inherit!==!1?t:{}}function rk(e){const{initial:t,animate:n}=nk(e,m.useContext(Ls));return m.useMemo(()=>({initial:t,animate:n}),[Jc(t),Jc(n)])}function Jc(e){return Array.isArray(e)?e.join(" "):e}const ik=Symbol.for("motionComponentSymbol");function sr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function sk(e,t,n){return m.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):sr(n)&&(n.current=r))},[t])}const pl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ok="framerAppearId",tp="data-"+pl(ok),{schedule:ml}=Jh(queueMicrotask,!1),np=m.createContext({});function ak(e,t,n,r,i){var s,o;const{visualElement:a}=m.useContext(Ls),l=m.useContext(Qh),c=m.useContext(Is),u=m.useContext(cl).reducedMotion,f=m.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=f.current,p=m.useContext(np);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&lk(f.current,n,i,p);const g=m.useRef(!1);m.useInsertionEffect(()=>{h&&g.current&&h.update(n,c)});const b=n[tp],y=m.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,b)));return Yh(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),ml.render(h.render),y.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)===null||x===void 0||x.call(window,b)}),y.current=!1))}),h}function lk(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:rp(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&sr(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function rp(e){if(e)return e.options.allowProjection!==!1?e.projection:rp(e.parent)}function ck({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var s,o;e&&J1(e);function a(c,u){let f;const h={...m.useContext(cl),...c,layoutId:uk(c)},{isStatic:p}=h,g=rk(c),b=r(c,p);if(!p&&ul){dk();const y=fk(h);f=y.MeasureLayout,g.visualElement=ak(i,b,h,t,y.ProjectionNode)}return d.jsxs(Ls.Provider,{value:g,children:[f&&g.visualElement?d.jsx(f,{visualElement:g.visualElement,...h}):null,n(i,c,sk(b,g.visualElement,u),b,p,g.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(o=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&o!==void 0?o:""})`}`;const l=m.forwardRef(a);return l[ik]=i,l}function uk({layoutId:e}){const t=m.useContext(al).id;return t&&e!==void 0?t+"-"+e:e}function dk(e,t){m.useContext(Qh).strict}function fk(e){const{drag:t,layout:n}=yr;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const hk=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function gl(e){return typeof e!="string"||e.includes("-")?!1:!!(hk.indexOf(e)>-1||/[A-Z]/u.test(e))}function Qc(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function xl(e,t,n,r){if(typeof t=="function"){const[i,s]=Qc(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=Qc(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const oa=e=>Array.isArray(e),pk=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),mk=e=>oa(e)?e[e.length-1]||0:e,at=e=>!!(e&&e.getVelocity);function Xi(e){const t=at(e)?e.get():e;return pk(t)?t.toValue():t}function gk({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:xk(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const ip=e=>(t,n)=>{const r=m.useContext(Ls),i=m.useContext(Is),s=()=>gk(e,t,r,i);return n?s():ll(s)};function xk(e,t,n,r){const i={},s=r(e,{});for(const h in s)i[h]=Xi(s[h]);let{initial:o,animate:a}=e;const l=Bs(e),c=ep(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?a:o;if(f&&typeof f!="boolean"&&!Fs(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const g=xl(e,h[p]);if(g){const{transitionEnd:b,transition:y,...x}=g;for(const v in x){let C=x[v];if(Array.isArray(C)){const j=u?C.length-1:0;C=C[j]}C!==null&&(i[v]=C)}for(const v in b)i[v]=b[v]}}}return i}const Tr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],qn=new Set(Tr),sp=e=>t=>typeof t=="string"&&t.startsWith(e),op=sp("--"),yk=sp("var(--"),yl=e=>yk(e)?bk.test(e.split("/*")[0].trim()):!1,bk=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ap=(e,t)=>t&&typeof e=="number"?t.transform(e):e,rn=(e,t,n)=>n>t?t:n<e?e:n,Nr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ai={...Nr,transform:e=>rn(0,1,e)},Ii={...Nr,default:1},bi=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),xn=bi("deg"),Ht=bi("%"),ee=bi("px"),vk=bi("vh"),wk=bi("vw"),Zc={...Ht,parse:e=>Ht.parse(e)/100,transform:e=>Ht.transform(e*100)},kk={borderWidth:ee,borderTopWidth:ee,borderRightWidth:ee,borderBottomWidth:ee,borderLeftWidth:ee,borderRadius:ee,radius:ee,borderTopLeftRadius:ee,borderTopRightRadius:ee,borderBottomRightRadius:ee,borderBottomLeftRadius:ee,width:ee,maxWidth:ee,height:ee,maxHeight:ee,top:ee,right:ee,bottom:ee,left:ee,padding:ee,paddingTop:ee,paddingRight:ee,paddingBottom:ee,paddingLeft:ee,margin:ee,marginTop:ee,marginRight:ee,marginBottom:ee,marginLeft:ee,backgroundPositionX:ee,backgroundPositionY:ee},Sk={rotate:xn,rotateX:xn,rotateY:xn,rotateZ:xn,scale:Ii,scaleX:Ii,scaleY:Ii,scaleZ:Ii,skew:xn,skewX:xn,skewY:xn,distance:ee,translateX:ee,translateY:ee,translateZ:ee,x:ee,y:ee,z:ee,perspective:ee,transformPerspective:ee,opacity:ai,originX:Zc,originY:Zc,originZ:ee},eu={...Nr,transform:Math.round},bl={...kk,...Sk,zIndex:eu,size:ee,fillOpacity:ai,strokeOpacity:ai,numOctaves:eu},Ck={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jk=Tr.length;function Ek(e,t,n){let r="",i=!0;for(let s=0;s<jk;s++){const o=Tr[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=ap(a,bl[o]);if(!l){i=!1;const u=Ck[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function vl(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(qn.has(l)){o=!0;continue}else if(op(l)){i[l]=c;continue}else{const u=ap(c,bl[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=Ek(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const Tk={offset:"stroke-dashoffset",array:"stroke-dasharray"},Nk={offset:"strokeDashoffset",array:"strokeDasharray"};function Pk(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Tk:Nk;e[s.offset]=ee.transform(-r);const o=ee.transform(t),a=ee.transform(n);e[s.array]=`${o} ${a}`}function tu(e,t,n){return typeof e=="string"?e:ee.transform(t+n*e)}function Ak(e,t,n){const r=tu(t,e.x,e.width),i=tu(n,e.y,e.height);return`${r} ${i}`}function wl(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,f){if(vl(e,c,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:g}=e;h.transform&&(g&&(p.transform=h.transform),delete h.transform),g&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=Ak(g,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Pk(h,o,a,l,!1)}const kl=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),lp=()=>({...kl(),attrs:{}}),Sl=e=>typeof e=="string"&&e.toLowerCase()==="svg";function cp(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const up=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function dp(e,t,n,r){cp(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(up.has(i)?i:pl(i),t.attrs[i])}const us={};function _k(e){Object.assign(us,e)}function fp(e,{layout:t,layoutId:n}){return qn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!us[e]||e==="opacity")}function Cl(e,t,n){var r;const{style:i}=e,s={};for(const o in i)(at(i[o])||t.style&&at(t.style[o])||fp(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[o]=i[o]);return s}function hp(e,t,n){const r=Cl(e,t,n);for(const i in e)if(at(e[i])||at(t[i])){const s=Tr.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}function Rk(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const nu=["x","y","width","height","cx","cy","r"],Mk={useVisualState:ip({scrapeMotionValuesFromProps:hp,createRenderState:lp,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in i)if(qn.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<nu.length;a++){const l=nu[a];e[l]!==t[l]&&(o=!0)}o&&_e.read(()=>{Rk(n,r),_e.render(()=>{wl(r,i,Sl(n.tagName),e.transformTemplate),dp(n,r)})})}})},Dk={useVisualState:ip({scrapeMotionValuesFromProps:Cl,createRenderState:kl})};function pp(e,t,n){for(const r in t)!at(t[r])&&!fp(r,n)&&(e[r]=t[r])}function Ok({transformTemplate:e},t){return m.useMemo(()=>{const n=kl();return vl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ik(e,t){const n=e.style||{},r={};return pp(r,n,e),Object.assign(r,Ok(e,t)),r}function Lk(e,t){const n={},r=Ik(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function Fk(e,t,n,r){const i=m.useMemo(()=>{const s=lp();return wl(s,t,Sl(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};pp(s,e.style,e),i.style={...s,...i.style}}return i}function Bk(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(gl(n)?Fk:Lk)(r,s,o,n),c=ek(r,typeof n=="string",e),u=n!==m.Fragment?{...c,...l,ref:i}:{},{children:f}=r,h=m.useMemo(()=>at(f)?f.get():f,[f]);return m.createElement(n,{...u,children:h})}}function zk(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...gl(r)?Mk:Dk,preloadedFeatures:e,useRender:Bk(i),createVisualElement:t,Component:r};return ck(o)}}function mp(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function zs(e,t,n){const r=e.getProps();return xl(r,t,n!==void 0?n:r.custom,e)}const Vk=dl(()=>window.ScrollTimeline!==void 0);class $k{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(Vk()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Uk extends $k{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function jl(e,t){return e?e[t]||e.default||e:void 0}const aa=2e4;function gp(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<aa;)t+=n,r=e.next(t);return t>=aa?1/0:t}function El(e){return typeof e=="function"}function ru(e,t){e.timeline=t,e.onfinish=null}const Tl=e=>Array.isArray(e)&&typeof e[0]=="number",Wk={linearEasing:void 0};function Hk(e,t){const n=dl(e);return()=>{var r;return(r=Wk[t])!==null&&r!==void 0?r:n()}}const ds=Hk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xp=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(xr(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function yp(e){return!!(typeof e=="function"&&ds()||!e||typeof e=="string"&&(e in la||ds())||Tl(e)||Array.isArray(e)&&e.every(yp))}const Ur=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,la={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ur([0,.65,.55,1]),circOut:Ur([.55,0,1,.45]),backIn:Ur([.31,.01,.66,-.59]),backOut:Ur([.33,1.53,.69,.99])};function bp(e,t){if(e)return typeof e=="function"&&ds()?xp(e,t):Tl(e)?Ur(e):Array.isArray(e)?e.map(n=>bp(n,t)||la.easeOut):la[e]}const Ot={x:!1,y:!1};function vp(){return Ot.x||Ot.y}function qk(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function wp(e,t){const n=qk(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function iu(e){return t=>{t.pointerType==="touch"||vp()||e(t)}}function Kk(e,t,n={}){const[r,i,s]=wp(e,n),o=iu(a=>{const{target:l}=a,c=t(a);if(typeof c!="function"||!l)return;const u=iu(f=>{c(f),l.removeEventListener("pointerleave",u)});l.addEventListener("pointerleave",u,i)});return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const kp=(e,t)=>t?e===t?!0:kp(e,t.parentElement):!1,Nl=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Gk=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Yk(e){return Gk.has(e.tagName)||e.tabIndex!==-1}const Wr=new WeakSet;function su(e){return t=>{t.key==="Enter"&&e(t)}}function fo(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Xk=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=su(()=>{if(Wr.has(n))return;fo(n,"down");const i=su(()=>{fo(n,"up")}),s=()=>fo(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ou(e){return Nl(e)&&!vp()}function Jk(e,t,n={}){const[r,i,s]=wp(e,n),o=a=>{const l=a.currentTarget;if(!ou(a)||Wr.has(l))return;Wr.add(l);const c=t(a),u=(p,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!ou(p)||!Wr.has(l))&&(Wr.delete(l),typeof c=="function"&&c(p,{success:g}))},f=p=>{u(p,n.useGlobalTarget||kp(l,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return r.forEach(a=>{!Yk(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",c=>Xk(c,i),i)}),s}function Qk(e){return e==="x"||e==="y"?Ot[e]?null:(Ot[e]=!0,()=>{Ot[e]=!1}):Ot.x||Ot.y?null:(Ot.x=Ot.y=!0,()=>{Ot.x=Ot.y=!1})}const Sp=new Set(["width","height","top","left","right","bottom",...Tr]);let Ji;function Zk(){Ji=void 0}const qt={now:()=>(Ji===void 0&&qt.set(rt.isProcessing||G1.useManualTiming?rt.timestamp:performance.now()),Ji),set:e=>{Ji=e,queueMicrotask(Zk)}};function Pl(e,t){e.indexOf(t)===-1&&e.push(t)}function Al(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class _l{constructor(){this.subscriptions=[]}add(t){return Pl(this.subscriptions,t),()=>Al(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Cp(e,t){return t?e*(1e3/t):0}const au=30,eS=e=>!isNaN(parseFloat(e)),lu={current:void 0};class tS{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=qt.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=qt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=eS(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new _l);const r=this.events[t].add(n);return t==="change"?()=>{r(),_e.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return lu.current&&lu.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=qt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>au)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,au);return Cp(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function li(e,t){return new tS(e,t)}function nS(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,li(n))}function rS(e,t){const n=zs(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=mk(s[o]);nS(e,o,a)}}function iS(e){return!!(at(e)&&e.add)}function ca(e,t){const n=e.getValue("willChange");if(iS(n))return n.add(t)}function jp(e){return e.props[tp]}const Ep=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,sS=1e-7,oS=12;function aS(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=Ep(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>sS&&++a<oS);return o}function vi(e,t,n,r){if(e===t&&n===r)return gt;const i=s=>aS(s,0,1,e,n);return s=>s===0||s===1?s:Ep(i(s),t,r)}const Tp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Np=e=>t=>1-e(1-t),Pp=vi(.33,1.53,.69,.99),Rl=Np(Pp),Ap=Tp(Rl),_p=e=>(e*=2)<1?.5*Rl(e):.5*(2-Math.pow(2,-10*(e-1))),Ml=e=>1-Math.sin(Math.acos(e)),Rp=Np(Ml),Mp=Tp(Ml),Dp=e=>/^0[^.\s]+$/u.test(e);function lS(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Dp(e):!0}const Xr=e=>Math.round(e*1e5)/1e5,Dl=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function cS(e){return e==null}const uS=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ol=(e,t)=>n=>!!(typeof n=="string"&&uS.test(n)&&n.startsWith(e)||t&&!cS(n)&&Object.prototype.hasOwnProperty.call(n,t)),Op=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Dl);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},dS=e=>rn(0,255,e),ho={...Nr,transform:e=>Math.round(dS(e))},zn={test:Ol("rgb","red"),parse:Op("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ho.transform(e)+", "+ho.transform(t)+", "+ho.transform(n)+", "+Xr(ai.transform(r))+")"};function fS(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const ua={test:Ol("#"),parse:fS,transform:zn.transform},or={test:Ol("hsl","hue"),parse:Op("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ht.transform(Xr(t))+", "+Ht.transform(Xr(n))+", "+Xr(ai.transform(r))+")"},ot={test:e=>zn.test(e)||ua.test(e)||or.test(e),parse:e=>zn.test(e)?zn.parse(e):or.test(e)?or.parse(e):ua.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?zn.transform(e):or.transform(e)},hS=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function pS(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Dl))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(hS))===null||n===void 0?void 0:n.length)||0)>0}const Ip="number",Lp="color",mS="var",gS="var(",cu="${}",xS=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ci(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(xS,l=>(ot.test(l)?(r.color.push(s),i.push(Lp),n.push(ot.parse(l))):l.startsWith(gS)?(r.var.push(s),i.push(mS),n.push(l)):(r.number.push(s),i.push(Ip),n.push(parseFloat(l))),++s,cu)).split(cu);return{values:n,split:a,indexes:r,types:i}}function Fp(e){return ci(e).values}function Bp(e){const{split:t,types:n}=ci(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===Ip?s+=Xr(i[o]):a===Lp?s+=ot.transform(i[o]):s+=i[o]}return s}}const yS=e=>typeof e=="number"?0:e;function bS(e){const t=Fp(e);return Bp(e)(t.map(yS))}const Sn={test:pS,parse:Fp,createTransformer:Bp,getAnimatableNone:bS},vS=new Set(["brightness","contrast","saturate","opacity"]);function wS(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Dl)||[];if(!r)return e;const i=n.replace(r,"");let s=vS.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const kS=/\b([a-z-]*)\(.*?\)/gu,da={...Sn,getAnimatableNone:e=>{const t=e.match(kS);return t?t.map(wS).join(" "):e}},SS={...bl,color:ot,backgroundColor:ot,outlineColor:ot,fill:ot,stroke:ot,borderColor:ot,borderTopColor:ot,borderRightColor:ot,borderBottomColor:ot,borderLeftColor:ot,filter:da,WebkitFilter:da},Il=e=>SS[e];function zp(e,t){let n=Il(e);return n!==da&&(n=Sn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const CS=new Set(["auto","none","0"]);function jS(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!CS.has(s)&&ci(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=zp(n,i)}const uu=e=>e===Nr||e===ee,du=(e,t)=>parseFloat(e.split(", ")[t]),fu=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return du(i[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?du(s[1],e):0}},ES=new Set(["x","y","z"]),TS=Tr.filter(e=>!ES.has(e));function NS(e){const t=[];return TS.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const br={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:fu(4,13),y:fu(5,14)};br.translateX=br.x;br.translateY=br.y;const $n=new Set;let fa=!1,ha=!1;function Vp(){if(ha){const e=Array.from($n).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=NS(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ha=!1,fa=!1,$n.forEach(e=>e.complete()),$n.clear()}function $p(){$n.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ha=!0)})}function PS(){$p(),Vp()}class Ll{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?($n.add(this),fa||(fa=!0,_e.read($p),_e.resolveKeyframes(Vp))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),$n.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,$n.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Up=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),AS=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _S(e){const t=AS.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function Wp(e,t,n=1){const[r,i]=_S(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return Up(o)?parseFloat(o):o}return yl(i)?Wp(i,t,n+1):i}const Hp=e=>t=>t.test(e),RS={test:e=>e==="auto",parse:e=>e},qp=[Nr,ee,Ht,xn,wk,vk,RS],hu=e=>qp.find(Hp(e));class Kp extends Ll{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),yl(c))){const u=Wp(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Sp.has(r)||t.length!==2)return;const[i,s]=t,o=hu(i),a=hu(s);if(o!==a)if(uu(o)&&uu(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)lS(t[i])&&r.push(i);r.length&&jS(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=br[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=br[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const pu=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Sn.test(e)||e==="0")&&!e.startsWith("url("));function MS(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function DS(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=pu(i,t),a=pu(s,t);return!o||!a?!1:MS(e)||(n==="spring"||El(n))&&r}const OS=e=>e!==null;function Vs(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(OS),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const IS=40;class Gp{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=qt.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>IS?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&PS(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=qt.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!DS(t,r,i,s))if(o)this.options.duration=0;else{l&&l(Vs(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Me=(e,t,n)=>e+(t-e)*n;function po(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function LS({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=po(l,a,e+1/3),s=po(l,a,e),o=po(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function fs(e,t){return n=>n>0?t:e}const mo=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},FS=[ua,zn,or],BS=e=>FS.find(t=>t.test(e));function mu(e){const t=BS(e);if(!t)return!1;let n=t.parse(e);return t===or&&(n=LS(n)),n}const gu=(e,t)=>{const n=mu(e),r=mu(t);if(!n||!r)return fs(e,t);const i={...n};return s=>(i.red=mo(n.red,r.red,s),i.green=mo(n.green,r.green,s),i.blue=mo(n.blue,r.blue,s),i.alpha=Me(n.alpha,r.alpha,s),zn.transform(i))},zS=(e,t)=>n=>t(e(n)),wi=(...e)=>e.reduce(zS),pa=new Set(["none","hidden"]);function VS(e,t){return pa.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function $S(e,t){return n=>Me(e,t,n)}function Fl(e){return typeof e=="number"?$S:typeof e=="string"?yl(e)?fs:ot.test(e)?gu:HS:Array.isArray(e)?Yp:typeof e=="object"?ot.test(e)?gu:US:fs}function Yp(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Fl(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function US(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Fl(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function WS(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],a=e.indexes[o][i[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[s]=l,i[o]++}return r}const HS=(e,t)=>{const n=Sn.createTransformer(t),r=ci(e),i=ci(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?pa.has(e)&&!i.values.length||pa.has(t)&&!r.values.length?VS(e,t):wi(Yp(WS(r,i),i.values),n):fs(e,t)};function Xp(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Me(e,t,n):Fl(e)(e,t)}const qS=5;function Jp(e,t,n){const r=Math.max(t-qS,0);return Cp(n-e(r),t-r)}const Oe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},go=.001;function KS({duration:e=Oe.duration,bounce:t=Oe.bounce,velocity:n=Oe.velocity,mass:r=Oe.mass}){let i,s,o=1-t;o=rn(Oe.minDamping,Oe.maxDamping,o),e=rn(Oe.minDuration,Oe.maxDuration,tn(e)),o<1?(i=c=>{const u=c*o,f=u*e,h=u-n,p=ma(c,o),g=Math.exp(-f);return go-h/p*g},s=c=>{const f=c*o*e,h=f*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,g=Math.exp(-f),b=ma(Math.pow(c,2),o);return(-i(c)+go>0?-1:1)*((h-p)*g)/b}):(i=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-go+u*f},s=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=YS(i,s,a);if(e=en(e),isNaN(l))return{stiffness:Oe.stiffness,damping:Oe.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const GS=12;function YS(e,t,n){let r=n;for(let i=1;i<GS;i++)r=r-e(r)/t(r);return r}function ma(e,t){return e*Math.sqrt(1-t*t)}const XS=["duration","bounce"],JS=["stiffness","damping","mass"];function xu(e,t){return t.some(n=>e[n]!==void 0)}function QS(e){let t={velocity:Oe.velocity,stiffness:Oe.stiffness,damping:Oe.damping,mass:Oe.mass,isResolvedFromDuration:!1,...e};if(!xu(e,JS)&&xu(e,XS))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*rn(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Oe.mass,stiffness:i,damping:s}}else{const n=KS(e);t={...t,...n,mass:Oe.mass},t.isResolvedFromDuration=!0}return t}function Qp(e=Oe.visualDuration,t=Oe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:p}=QS({...n,velocity:-tn(n.velocity||0)}),g=h||0,b=c/(2*Math.sqrt(l*u)),y=o-s,x=tn(Math.sqrt(l/u)),v=Math.abs(y)<5;r||(r=v?Oe.restSpeed.granular:Oe.restSpeed.default),i||(i=v?Oe.restDelta.granular:Oe.restDelta.default);let C;if(b<1){const w=ma(x,b);C=k=>{const P=Math.exp(-b*x*k);return o-P*((g+b*x*y)/w*Math.sin(w*k)+y*Math.cos(w*k))}}else if(b===1)C=w=>o-Math.exp(-x*w)*(y+(g+x*y)*w);else{const w=x*Math.sqrt(b*b-1);C=k=>{const P=Math.exp(-b*x*k),N=Math.min(w*k,300);return o-P*((g+b*x*y)*Math.sinh(N)+w*y*Math.cosh(N))/w}}const j={calculatedDuration:p&&f||null,next:w=>{const k=C(w);if(p)a.done=w>=f;else{let P=0;b<1&&(P=w===0?en(g):Jp(C,w,k));const N=Math.abs(P)<=r,M=Math.abs(o-k)<=i;a.done=N&&M}return a.value=a.done?o:k,a},toString:()=>{const w=Math.min(gp(j),aa),k=xp(P=>j.next(w*P).value,w,30);return w+"ms "+k}};return j}function yu({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},p=N=>a!==void 0&&N<a||l!==void 0&&N>l,g=N=>a===void 0?l:l===void 0||Math.abs(a-N)<Math.abs(l-N)?a:l;let b=n*t;const y=f+b,x=o===void 0?y:o(y);x!==y&&(b=x-f);const v=N=>-b*Math.exp(-N/r),C=N=>x+v(N),j=N=>{const M=v(N),T=C(N);h.done=Math.abs(M)<=c,h.value=h.done?x:T};let w,k;const P=N=>{p(h.value)&&(w=N,k=Qp({keyframes:[h.value,g(h.value)],velocity:Jp(C,N,h.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return P(0),{calculatedDuration:null,next:N=>{let M=!1;return!k&&w===void 0&&(M=!0,j(N),P(N)),w!==void 0&&N>=w?k.next(N-w):(!M&&j(N),h)}}}const ZS=vi(.42,0,1,1),eC=vi(0,0,.58,1),Zp=vi(.42,0,.58,1),tC=e=>Array.isArray(e)&&typeof e[0]!="number",nC={linear:gt,easeIn:ZS,easeInOut:Zp,easeOut:eC,circIn:Ml,circInOut:Mp,circOut:Rp,backIn:Rl,backInOut:Ap,backOut:Pp,anticipate:_p},bu=e=>{if(Tl(e)){Xh(e.length===4);const[t,n,r,i]=e;return vi(t,n,r,i)}else if(typeof e=="string")return nC[e];return e};function rC(e,t,n){const r=[],i=n||Xp,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||gt:t;a=wi(l,a)}r.push(a)}return r}function iC(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(Xh(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=rC(t,r,i),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=xr(e[f],e[f+1],u);return a[f](h)};return n?u=>c(rn(e[0],e[s-1],u)):c}function sC(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=xr(0,t,r);e.push(Me(n,1,i))}}function oC(e){const t=[0];return sC(t,e.length-1),t}function aC(e,t){return e.map(n=>n*t)}function lC(e,t){return e.map(()=>t||Zp).splice(0,e.length-1)}function hs({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=tC(r)?r.map(bu):bu(r),s={done:!1,value:t[0]},o=aC(n&&n.length===t.length?n:oC(t),e),a=iC(o,t,{ease:Array.isArray(i)?i:lC(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const cC=e=>{const t=({timestamp:n})=>e(n);return{start:()=>_e.update(t,!0),stop:()=>kn(t),now:()=>rt.isProcessing?rt.timestamp:qt.now()}},uC={decay:yu,inertia:yu,tween:hs,keyframes:hs,spring:Qp},dC=e=>e/100;class $s extends Gp{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Ll,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=El(n)?n:uC[n]||hs;let l,c;a!==hs&&typeof t[0]!="number"&&(l=wi(dC,Xp(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=gp(u));const{calculatedDuration:f}=u,h=f+i,p=h*(r+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:N}=this.options;return{done:!0,value:N[N.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return s.next(0);const{delay:h,repeat:p,repeatType:g,repeatDelay:b,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const x=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?x<0:x>u;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let C=this.currentTime,j=s;if(p){const N=Math.min(this.currentTime,u)/f;let M=Math.floor(N),T=N%1;!T&&N>=1&&(T=1),T===1&&M--,M=Math.min(M,p+1),!!(M%2)&&(g==="reverse"?(T=1-T,b&&(T-=b/f)):g==="mirror"&&(j=o)),C=rn(0,1,T)*f}const w=v?{done:!1,value:l[0]}:j.next(C);a&&(w.value=a(w.value));let{done:k}=w;!v&&c!==null&&(k=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return P&&i!==void 0&&(w.value=Vs(l,this.options,i)),y&&y(w.value),P&&this.finish(),w}get duration(){const{resolved:t}=this;return t?tn(t.calculatedDuration):0}get time(){return tn(this.currentTime)}set time(t){t=en(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=tn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=cC,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}function tO(e){return new $s(e)}const fC=new Set(["opacity","clipPath","filter","transform"]);function hC(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=bp(a,i);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const pC=dl(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ps=10,mC=2e4;function gC(e){return El(e.type)||e.type==="spring"||!yp(e.ease)}function xC(e,t){const n=new $s({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<mC;)r=n.sample(s),i.push(r.value),s+=ps;return{times:void 0,keyframes:i,duration:s-ps,ease:"linear"}}const em={anticipate:_p,backInOut:Ap,circInOut:Mp};function yC(e){return e in em}class vu extends Gp{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new Kp(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&ds()&&yC(s)&&(s=em[s]),gC(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:g,...b}=this.options,y=xC(t,b);t=y.keyframes,t.length===1&&(t[1]=t[0]),r=y.duration,i=y.times,s=y.ease,o="keyframes"}const u=hC(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(ru(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;a.set(Vs(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return tn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return tn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=en(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return gt;const{animation:r}=n;ru(r,t)}return gt}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:h,...p}=this.options,g=new $s({...p,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),b=en(this.time);c.setWithVelocity(g.sample(b-ps).value,g.sample(b).value,ps)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return pC()&&r&&fC.has(r)&&!l&&!c&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const bC={type:"spring",stiffness:500,damping:25,restSpeed:10},vC=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),wC={type:"keyframes",duration:.8},kC={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},SC=(e,{keyframes:t})=>t.length>2?wC:qn.has(e)?e.startsWith("scale")?vC(t[1]):bC:kC;function CC({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const Bl=(e,t,n,r={},i,s)=>o=>{const a=jl(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-en(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};CC(a)||(u={...u,...SC(e,u)}),u.duration&&(u.duration=en(u.duration)),u.repeatDelay&&(u.repeatDelay=en(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),f&&!s&&t.get()!==void 0){const h=Vs(u.keyframes,a);if(h!==void 0)return _e.update(()=>{u.onUpdate(h),u.onComplete()}),new Uk([])}return!s&&vu.supports(u)?new vu(u):new $s(u)};function jC({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function tm(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const f in l){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),p=l[f];if(p===void 0||u&&jC(u,f))continue;const g={delay:n,...jl(o||{},f)};let b=!1;if(window.MotionHandoffAnimation){const x=jp(e);if(x){const v=window.MotionHandoffAnimation(x,f,_e);v!==null&&(g.startTime=v,b=!0)}}ca(e,f),h.start(Bl(f,h,p,e.shouldReduceMotion&&Sp.has(f)?{type:!1}:g,e,b));const y=h.animation;y&&c.push(y)}return a&&Promise.all(c).then(()=>{_e.update(()=>{a&&rS(e,a)})}),c}function ga(e,t,n={}){var r;const i=zs(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(tm(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=s;return EC(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,u]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function EC(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(TC).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(ga(c,t,{...s,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function TC(e,t){return e.sortNodePosition(t)}function NC(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>ga(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=ga(e,t,n);else{const i=typeof t=="function"?zs(e,t,n.custom):t;r=Promise.all(tm(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const PC=hl.length;function nm(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?nm(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<PC;n++){const r=hl[n],i=e.props[r];(oi(i)||i===!1)&&(t[r]=i)}return t}const AC=[...fl].reverse(),_C=fl.length;function RC(e){return t=>Promise.all(t.map(({animation:n,options:r})=>NC(e,n,r)))}function MC(e){let t=RC(e),n=wu(),r=!0;const i=l=>(c,u)=>{var f;const h=zs(e,u,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:g,...b}=h;c={...c,...b,...g}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,u=nm(e.parent)||{},f=[],h=new Set;let p={},g=1/0;for(let y=0;y<_C;y++){const x=AC[y],v=n[x],C=c[x]!==void 0?c[x]:u[x],j=oi(C),w=x===l?v.isActive:null;w===!1&&(g=y);let k=C===u[x]&&C!==c[x]&&j;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),v.protectedKeys={...p},!v.isActive&&w===null||!C&&!v.prevProp||Fs(C)||typeof C=="boolean")continue;const P=DC(v.prevProp,C);let N=P||x===l&&v.isActive&&!k&&j||y>g&&j,M=!1;const T=Array.isArray(C)?C:[C];let R=T.reduce(i(x),{});w===!1&&(R={});const{prevResolvedValues:A={}}=v,_={...A,...R},L=D=>{N=!0,h.has(D)&&(M=!0,h.delete(D)),v.needsAnimating[D]=!0;const $=e.getValue(D);$&&($.liveStyle=!1)};for(const D in _){const $=R[D],z=A[D];if(p.hasOwnProperty(D))continue;let S=!1;oa($)&&oa(z)?S=!mp($,z):S=$!==z,S?$!=null?L(D):h.add(D):$!==void 0&&h.has(D)?L(D):v.protectedKeys[D]=!0}v.prevProp=C,v.prevResolvedValues=R,v.isActive&&(p={...p,...R}),r&&e.blockInitialAnimation&&(N=!1),N&&(!(k&&P)||M)&&f.push(...T.map(D=>({animation:D,options:{type:x}})))}if(h.size){const y={};h.forEach(x=>{const v=e.getBaseTarget(x),C=e.getValue(x);C&&(C.liveStyle=!0),y[x]=v??null}),f.push({animation:y})}let b=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,b?t(f):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const f=o(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=wu(),r=!0}}}function DC(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!mp(t,e):!1}function Dn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function wu(){return{animate:Dn(!0),whileInView:Dn(),whileHover:Dn(),whileTap:Dn(),whileDrag:Dn(),whileFocus:Dn(),exit:Dn()}}class Nn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class OC extends Nn{constructor(t){super(t),t.animationState||(t.animationState=MC(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Fs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let IC=0;class LC extends Nn{constructor(){super(...arguments),this.id=IC++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const FC={animation:{Feature:OC},exit:{Feature:LC}};function ui(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ki(e){return{point:{x:e.pageX,y:e.pageY}}}const BC=e=>t=>Nl(t)&&e(t,ki(t));function Jr(e,t,n,r){return ui(e,t,BC(n),r)}const ku=(e,t)=>Math.abs(e-t);function zC(e,t){const n=ku(e.x,t.x),r=ku(e.y,t.y);return Math.sqrt(n**2+r**2)}class rm{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=yo(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=zC(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:g}=f,{timestamp:b}=rt;this.history.push({...g,timestamp:b});const{onStart:y,onMove:x}=this.handlers;h||(y&&y(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=xo(h,this.transformPagePoint),_e.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=yo(f.type==="pointercancel"?this.lastMoveEventInfo:xo(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,y),g&&g(f,y)},!Nl(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=ki(t),a=xo(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=rt;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,yo(a,this.history)),this.removeListeners=wi(Jr(this.contextWindow,"pointermove",this.handlePointerMove),Jr(this.contextWindow,"pointerup",this.handlePointerUp),Jr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),kn(this.updatePoint)}}function xo(e,t){return t?{point:t(e.point)}:e}function Su(e,t){return{x:e.x-t.x,y:e.y-t.y}}function yo({point:e},t){return{point:e,delta:Su(e,im(t)),offset:Su(e,VC(t)),velocity:$C(t,.1)}}function VC(e){return e[0]}function im(e){return e[e.length-1]}function $C(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=im(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>en(t)));)n--;if(!r)return{x:0,y:0};const s=tn(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const sm=1e-4,UC=1-sm,WC=1+sm,om=.01,HC=0-om,qC=0+om;function kt(e){return e.max-e.min}function KC(e,t,n){return Math.abs(e-t)<=n}function Cu(e,t,n,r=.5){e.origin=r,e.originPoint=Me(t.min,t.max,e.origin),e.scale=kt(n)/kt(t),e.translate=Me(n.min,n.max,e.origin)-e.originPoint,(e.scale>=UC&&e.scale<=WC||isNaN(e.scale))&&(e.scale=1),(e.translate>=HC&&e.translate<=qC||isNaN(e.translate))&&(e.translate=0)}function Qr(e,t,n,r){Cu(e.x,t.x,n.x,r?r.originX:void 0),Cu(e.y,t.y,n.y,r?r.originY:void 0)}function ju(e,t,n){e.min=n.min+t.min,e.max=e.min+kt(t)}function GC(e,t,n){ju(e.x,t.x,n.x),ju(e.y,t.y,n.y)}function Eu(e,t,n){e.min=t.min-n.min,e.max=e.min+kt(t)}function Zr(e,t,n){Eu(e.x,t.x,n.x),Eu(e.y,t.y,n.y)}function YC(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Me(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Me(n,e,r.max):Math.min(e,n)),e}function Tu(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function XC(e,{top:t,left:n,bottom:r,right:i}){return{x:Tu(e.x,n,i),y:Tu(e.y,t,r)}}function Nu(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function JC(e,t){return{x:Nu(e.x,t.x),y:Nu(e.y,t.y)}}function QC(e,t){let n=.5;const r=kt(e),i=kt(t);return i>r?n=xr(t.min,t.max-r,e.min):r>i&&(n=xr(e.min,e.max-i,t.min)),rn(0,1,n)}function ZC(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const xa=.35;function ej(e=xa){return e===!1?e=0:e===!0&&(e=xa),{x:Pu(e,"left","right"),y:Pu(e,"top","bottom")}}function Pu(e,t,n){return{min:Au(e,t),max:Au(e,n)}}function Au(e,t){return typeof e=="number"?e:e[t]||0}const _u=()=>({translate:0,scale:1,origin:0,originPoint:0}),ar=()=>({x:_u(),y:_u()}),Ru=()=>({min:0,max:0}),ze=()=>({x:Ru(),y:Ru()});function Tt(e){return[e("x"),e("y")]}function am({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function tj({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function nj(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function bo(e){return e===void 0||e===1}function ya({scale:e,scaleX:t,scaleY:n}){return!bo(e)||!bo(t)||!bo(n)}function Ln(e){return ya(e)||lm(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function lm(e){return Mu(e.x)||Mu(e.y)}function Mu(e){return e&&e!=="0%"}function ms(e,t,n){const r=e-n,i=t*r;return n+i}function Du(e,t,n,r,i){return i!==void 0&&(e=ms(e,i,r)),ms(e,n,r)+t}function ba(e,t=0,n=1,r,i){e.min=Du(e.min,t,n,r,i),e.max=Du(e.max,t,n,r,i)}function cm(e,{x:t,y:n}){ba(e.x,t.translate,t.scale,t.originPoint),ba(e.y,n.translate,n.scale,n.originPoint)}const Ou=.999999999999,Iu=1.0000000000001;function rj(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&cr(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,cm(e,o)),r&&Ln(s.latestValues)&&cr(e,s.latestValues))}t.x<Iu&&t.x>Ou&&(t.x=1),t.y<Iu&&t.y>Ou&&(t.y=1)}function lr(e,t){e.min=e.min+t,e.max=e.max+t}function Lu(e,t,n,r,i=.5){const s=Me(e.min,e.max,i);ba(e,t,n,s,r)}function cr(e,t){Lu(e.x,t.x,t.scaleX,t.scale,t.originX),Lu(e.y,t.y,t.scaleY,t.scale,t.originY)}function um(e,t){return am(nj(e.getBoundingClientRect(),t))}function ij(e,t,n){const r=um(e,n),{scroll:i}=t;return i&&(lr(r.x,i.offset.x),lr(r.y,i.offset.y)),r}const dm=({current:e})=>e?e.ownerDocument.defaultView:null,sj=new WeakMap;class oj{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ze(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ki(u).point)},s=(u,f)=>{const{drag:h,dragPropagation:p,onDragStart:g}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Qk(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tt(y=>{let x=this.getAxisMotionValue(y).get()||0;if(Ht.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const C=v.layout.layoutBox[y];C&&(x=kt(C)*(parseFloat(x)/100))}}this.originPoint[y]=x}),g&&_e.postRender(()=>g(u,f)),ca(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:y}=f;if(p&&this.currentDirection===null){this.currentDirection=aj(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),b&&b(u,f)},a=(u,f)=>this.stop(u,f),l=()=>Tt(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new rm(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:dm(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&_e.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Li(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=YC(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&sr(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=XC(i.layoutBox,n):this.constraints=!1,this.elastic=ej(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Tt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=ZC(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!sr(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=ij(r,i.root,this.visualElement.getTransformPagePoint());let o=JC(i.layout.layoutBox,s);if(n){const a=n(tj(o));this.hasMutatedConstraints=!!a,a&&(o=am(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Tt(u=>{if(!Li(u,n,this.currentDirection))return;let f=l&&l[u]||{};o&&(f={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ca(this.visualElement,t),r.start(Bl(t,r,0,n,this.visualElement,!1))}stopAnimation(){Tt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Tt(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Tt(n=>{const{drag:r}=this.getProps();if(!Li(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-Me(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!sr(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Tt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=QC({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Tt(o=>{if(!Li(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Me(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;sj.set(this.visualElement,this);const t=this.visualElement.current,n=Jr(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();sr(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),_e.read(r);const o=ui(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Tt(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=xa,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Li(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function aj(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class lj extends Nn{constructor(t){super(t),this.removeGroupControls=gt,this.removeListeners=gt,this.controls=new oj(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||gt}unmount(){this.removeGroupControls(),this.removeListeners()}}const Fu=e=>(t,n)=>{e&&_e.postRender(()=>e(t,n))};class cj extends Nn{constructor(){super(...arguments),this.removePointerDownListener=gt}onPointerDown(t){this.session=new rm(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:dm(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Fu(t),onStart:Fu(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&_e.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Jr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Qi={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Bu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Or={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ee.test(e))e=parseFloat(e);else return e;const n=Bu(e,t.target.x),r=Bu(e,t.target.y);return`${n}% ${r}%`}},uj={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Sn.parse(e);if(i.length>5)return r;const s=Sn.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const c=Me(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};class dj extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;_k(fj),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Qi.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||_e.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ml.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function fm(e){const[t,n]=Gh(),r=m.useContext(al);return d.jsx(dj,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(np),isPresent:t,safeToRemove:n})}const fj={borderRadius:{...Or,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Or,borderTopRightRadius:Or,borderBottomLeftRadius:Or,borderBottomRightRadius:Or,boxShadow:uj};function hj(e,t,n){const r=at(e)?e:li(e);return r.start(Bl("",r,t,n)),r.animation}function pj(e){return e instanceof SVGElement&&e.tagName!=="svg"}const mj=(e,t)=>e.depth-t.depth;class gj{constructor(){this.children=[],this.isDirty=!1}add(t){Pl(this.children,t),this.isDirty=!0}remove(t){Al(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(mj),this.isDirty=!1,this.children.forEach(t)}}function xj(e,t){const n=qt.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(kn(r),e(s-t))};return _e.read(r,!0),()=>kn(r)}const hm=["TopLeft","TopRight","BottomLeft","BottomRight"],yj=hm.length,zu=e=>typeof e=="string"?parseFloat(e):e,Vu=e=>typeof e=="number"||ee.test(e);function bj(e,t,n,r,i,s){i?(e.opacity=Me(0,n.opacity!==void 0?n.opacity:1,vj(r)),e.opacityExit=Me(t.opacity!==void 0?t.opacity:1,0,wj(r))):s&&(e.opacity=Me(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<yj;o++){const a=`border${hm[o]}Radius`;let l=$u(t,a),c=$u(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Vu(l)===Vu(c)?(e[a]=Math.max(Me(zu(l),zu(c),r),0),(Ht.test(c)||Ht.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Me(t.rotate||0,n.rotate||0,r))}function $u(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const vj=pm(0,.5,Rp),wj=pm(.5,.95,gt);function pm(e,t,n){return r=>r<e?0:r>t?1:n(xr(e,t,r))}function Uu(e,t){e.min=t.min,e.max=t.max}function Et(e,t){Uu(e.x,t.x),Uu(e.y,t.y)}function Wu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Hu(e,t,n,r,i){return e-=t,e=ms(e,1/n,r),i!==void 0&&(e=ms(e,1/i,r)),e}function kj(e,t=0,n=1,r=.5,i,s=e,o=e){if(Ht.test(t)&&(t=parseFloat(t),t=Me(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Me(s.min,s.max,r);e===s&&(a-=t),e.min=Hu(e.min,t,n,a,i),e.max=Hu(e.max,t,n,a,i)}function qu(e,t,[n,r,i],s,o){kj(e,t[n],t[r],t[i],t.scale,s,o)}const Sj=["x","scaleX","originX"],Cj=["y","scaleY","originY"];function Ku(e,t,n,r){qu(e.x,t,Sj,n?n.x:void 0,r?r.x:void 0),qu(e.y,t,Cj,n?n.y:void 0,r?r.y:void 0)}function Gu(e){return e.translate===0&&e.scale===1}function mm(e){return Gu(e.x)&&Gu(e.y)}function Yu(e,t){return e.min===t.min&&e.max===t.max}function jj(e,t){return Yu(e.x,t.x)&&Yu(e.y,t.y)}function Xu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function gm(e,t){return Xu(e.x,t.x)&&Xu(e.y,t.y)}function Ju(e){return kt(e.x)/kt(e.y)}function Qu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ej{constructor(){this.members=[]}add(t){Pl(this.members,t),t.scheduleRender()}remove(t){if(Al(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Tj(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:h,skewX:p,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Fn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Hr=typeof window<"u"&&window.MotionDebug!==void 0,vo=["","X","Y","Z"],Nj={visibility:"hidden"},Zu=1e3;let Pj=0;function wo(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function xm(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=jp(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",_e,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&xm(r)}function ym({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Pj++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Hr&&(Fn.totalNodes=Fn.resolvedTargetDeltas=Fn.recalculatedProjection=0),this.nodes.forEach(Rj),this.nodes.forEach(Lj),this.nodes.forEach(Fj),this.nodes.forEach(Mj),Hr&&window.MotionDebug.record(Fn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new gj)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new _l),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=pj(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=xj(h,250),Qi.hasAnimatedSinceResize&&(Qi.hasAnimatedSinceResize=!1,this.nodes.forEach(td))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||u.getDefaultTransition()||Uj,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=u.getProps(),v=!this.targetLayout||!gm(this.targetLayout,g)||p,C=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||C||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,C);const j={...jl(b,"layout"),onPlay:y,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j)}else h||td(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,kn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Bj),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&xm(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ed);return}this.isUpdating||this.nodes.forEach(Oj),this.isUpdating=!1,this.nodes.forEach(Ij),this.nodes.forEach(Aj),this.nodes.forEach(_j),this.clearAllSnapshots();const a=qt.now();rt.delta=rn(0,1e3/60,a-rt.timestamp),rt.timestamp=a,rt.isProcessing=!0,uo.update.process(rt),uo.preRender.process(rt),uo.render.process(rt),rt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ml.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Dj),this.sharedNodes.forEach(zj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,_e.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){_e.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ze(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!mm(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(a||Ln(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Wj(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return ze();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(Hj))){const{scroll:u}=this.root;u&&(lr(l.x,u.offset.x),lr(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=ze();if(Et(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Et(l,o),lr(l.x,f.offset.x),lr(l.y,f.offset.y))}return l}applyTransform(o,a=!1){const l=ze();Et(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&cr(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ln(u.latestValues)&&cr(l,u.latestValues)}return Ln(this.latestValues)&&cr(l,this.latestValues),l}removeTransform(o){const a=ze();Et(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Ln(c.latestValues))continue;ya(c.latestValues)&&c.updateSnapshot();const u=ze(),f=c.measurePageBox();Et(u,f),Ku(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Ln(this.latestValues)&&Ku(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==rt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=rt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ze(),this.relativeTargetOrigin=ze(),Zr(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Et(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=ze(),this.targetWithTransforms=ze()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),GC(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Et(this.target,this.layout.layoutBox),cm(this.target,this.targetDelta)):Et(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ze(),this.relativeTargetOrigin=ze(),Zr(this.relativeTargetOrigin,this.target,p.target),Et(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Hr&&Fn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||ya(this.parent.latestValues)||lm(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===rt.timestamp&&(c=!1),c)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;Et(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;rj(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=ze());const{target:g}=a;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Wu(this.prevProjectionDelta.x,this.projectionDelta.x),Wu(this.prevProjectionDelta.y,this.projectionDelta.y)),Qr(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!Qu(this.projectionDelta.x,this.prevProjectionDelta.x)||!Qu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g)),Hr&&Fn.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ar(),this.projectionDelta=ar(),this.projectionDeltaWithTransform=ar()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=ar();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=ze(),p=l?l.source:void 0,g=this.layout?this.layout.source:void 0,b=p!==g,y=this.getStack(),x=!y||y.members.length<=1,v=!!(b&&!x&&this.options.crossfade===!0&&!this.path.some($j));this.animationProgress=0;let C;this.mixTargetDelta=j=>{const w=j/1e3;nd(f.x,o.x,w),nd(f.y,o.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zr(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Vj(this.relativeTarget,this.relativeTargetOrigin,h,w),C&&jj(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=ze()),Et(C,this.relativeTarget)),b&&(this.animationValues=u,bj(u,c,this.latestValues,w,v,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(kn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_e.update(()=>{Qi.hasAnimatedSinceResize=!0,this.currentAnimation=hj(0,Zu,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Zu),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&bm(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ze();const f=kt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=kt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Et(a,l),cr(a,u),Qr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Ej),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&wo("z",o,c,this.animationValues);for(let u=0;u<vo.length;u++)wo(`rotate${vo[u]}`,o,c,this.animationValues),wo(`skew${vo[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Nj;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Xi(o==null?void 0:o.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const b={};return this.options.layoutId&&(b.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,b.pointerEvents=Xi(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ln(this.latestValues)&&(b.transform=u?u({},""):"none",this.hasProjected=!1),b}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Tj(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:p,y:g}=this.projectionDelta;c.transformOrigin=`${p.origin*100}% ${g.origin*100}% 0`,f.animationValues?c.opacity=f===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const b in us){if(h[b]===void 0)continue;const{correct:y,applyTo:x}=us[b],v=c.transform==="none"?h[b]:y(h[b],f);if(x){const C=x.length;for(let j=0;j<C;j++)c[x[j]]=v}else c[b]=v}return this.options.layoutId&&(c.pointerEvents=f===this?Xi(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(ed),this.root.sharedNodes.clear()}}}function Aj(e){e.updateLayout()}function _j(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?Tt(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=kt(h);h.min=r[f].min,h.max=h.min+p}):bm(s,n.layoutBox,r)&&Tt(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=kt(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=ar();Qr(a,r,n.layoutBox);const l=ar();o?Qr(l,e.applyTransform(i,!0),n.measuredBox):Qr(l,r,n.layoutBox);const c=!mm(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const g=ze();Zr(g,n.layoutBox,h.layoutBox);const b=ze();Zr(b,r,p.layoutBox),gm(g,b)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Rj(e){Hr&&Fn.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Mj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Dj(e){e.clearSnapshot()}function ed(e){e.clearMeasurements()}function Oj(e){e.isLayoutDirty=!1}function Ij(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function td(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Lj(e){e.resolveTargetDelta()}function Fj(e){e.calcProjection()}function Bj(e){e.resetSkewAndRotation()}function zj(e){e.removeLeadSnapshot()}function nd(e,t,n){e.translate=Me(t.translate,0,n),e.scale=Me(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function rd(e,t,n,r){e.min=Me(t.min,n.min,r),e.max=Me(t.max,n.max,r)}function Vj(e,t,n,r){rd(e.x,t.x,n.x,r),rd(e.y,t.y,n.y,r)}function $j(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Uj={duration:.45,ease:[.4,0,.1,1]},id=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),sd=id("applewebkit/")&&!id("chrome/")?Math.round:gt;function od(e){e.min=sd(e.min),e.max=sd(e.max)}function Wj(e){od(e.x),od(e.y)}function bm(e,t,n){return e==="position"||e==="preserve-aspect"&&!KC(Ju(t),Ju(n),.2)}function Hj(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const qj=ym({attachResizeListener:(e,t)=>ui(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ko={current:void 0},vm=ym({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ko.current){const e=new qj({});e.mount(window),e.setOptions({layoutScroll:!0}),ko.current=e}return ko.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Kj={pan:{Feature:cj},drag:{Feature:lj,ProjectionNode:vm,MeasureLayout:fm}};function ad(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&_e.postRender(()=>s(t,ki(t)))}class Gj extends Nn{mount(){const{current:t}=this.node;t&&(this.unmount=Kk(t,n=>(ad(this.node,n,"Start"),r=>ad(this.node,r,"End"))))}unmount(){}}class Yj extends Nn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=wi(ui(this.node.current,"focus",()=>this.onFocus()),ui(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ld(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&_e.postRender(()=>s(t,ki(t)))}class Xj extends Nn{mount(){const{current:t}=this.node;t&&(this.unmount=Jk(t,n=>(ld(this.node,n,"Start"),(r,{success:i})=>ld(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const va=new WeakMap,So=new WeakMap,Jj=e=>{const t=va.get(e.target);t&&t(e)},Qj=e=>{e.forEach(Jj)};function Zj({root:e,...t}){const n=e||document;So.has(n)||So.set(n,{});const r=So.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Qj,{root:e,...t})),r[i]}function eE(e,t,n){const r=Zj(t);return va.set(e,n),r.observe(e),()=>{va.delete(e),r.unobserve(e)}}const tE={some:0,all:1};class nE extends Nn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:tE[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=c?u:f;h&&h(l)};return eE(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(rE(t,n))&&this.startObserver()}unmount(){}}function rE({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const iE={inView:{Feature:nE},tap:{Feature:Xj},focus:{Feature:Yj},hover:{Feature:Gj}},sE={layout:{ProjectionNode:vm,MeasureLayout:fm}},wa={current:null},wm={current:!1};function oE(){if(wm.current=!0,!!ul)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>wa.current=e.matches;e.addListener(t),t()}else wa.current=!1}const aE=[...qp,ot,Sn],lE=e=>aE.find(Hp(e)),cd=new WeakMap;function cE(e,t,n){for(const r in t){const i=t[r],s=n[r];if(at(i))e.addValue(r,i);else if(at(s))e.addValue(r,li(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,li(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const ud=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class uE{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ll,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=qt.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,_e.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Bs(n),this.isVariantNode=ep(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const g=h[p];l[p]!==void 0&&at(g)&&g.set(l[p],!1)}}mount(t){this.current=t,cd.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),wm.current||oE(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:wa.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){cd.delete(this.current),this.projection&&this.projection.unmount(),kn(this.notifyUpdate),kn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=qn.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&_e.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in yr){const n=yr[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ze()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<ud.length;r++){const i=ud[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=cE(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=li(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Up(i)||Dp(i))?i=parseFloat(i):!lE(i)&&Sn.test(n)&&(i=zp(t,n)),this.setBaseTarget(t,at(i)?i.get():i)),at(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=xl(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!at(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new _l),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class km extends uE{constructor(){super(...arguments),this.KeyframeResolver=Kp}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;at(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function dE(e){return window.getComputedStyle(e)}class fE extends km{constructor(){super(...arguments),this.type="html",this.renderInstance=cp}readValueFromInstance(t,n){if(qn.has(n)){const r=Il(n);return r&&r.default||0}else{const r=dE(t),i=(op(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return um(t,n)}build(t,n,r){vl(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Cl(t,n,r)}}class hE extends km{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ze}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(qn.has(n)){const r=Il(n);return r&&r.default||0}return n=up.has(n)?n:pl(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return hp(t,n,r)}build(t,n,r){wl(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){dp(t,n,r,i)}mount(t){this.isSVGTag=Sl(t.tagName),super.mount(t)}}const pE=(e,t)=>gl(e)?new hE(t):new fE(t,{allowProjection:e!==m.Fragment}),mE=zk({...FC,...iE,...Kj,...sE},pE),gs=tk(mE),zl=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:F("card-glass rounded border bg-card text-card-foreground shadow-none",e),...t}));zl.displayName="Card";const gE=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:F("flex flex-col space-y-0.5 px-3 py-2",e),...t}));gE.displayName="CardHeader";const xE=m.forwardRef(({className:e,...t},n)=>d.jsx("h3",{ref:n,className:F("text-sm font-light uppercase tracking-wider text-muted-foreground",e),...t}));xE.displayName="CardTitle";const yE=m.forwardRef(({className:e,...t},n)=>d.jsx("p",{ref:n,className:F("text-xs text-muted-foreground",e),...t}));yE.displayName="CardDescription";const Vl=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:F("p-3 pt-0",e),...t}));Vl.displayName="CardContent";const bE=m.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:F("flex items-center p-3 pt-0",e),...t}));bE.displayName="CardFooter";const vE={critical:"border-ask-red text-ask-red",high:"border-warning-amber text-warning-amber",medium:"border-accent-blue text-accent-blue",low:"border-muted-foreground/30 text-muted-foreground"},wE={feature:"border-category-feature text-category-feature",bugfix:"border-category-bugfix text-category-bugfix",refactor:"border-category-refactor text-category-refactor",infrastructure:"border-category-infrastructure text-category-infrastructure",docs:"border-category-docs text-category-docs"},Co="inline-block rounded border px-1.5 py-0 text-[10px] uppercase bg-transparent";function kE({scopeId:e,projectId:t,info:n,onRecover:r,onDismiss:i}){return d.jsxs(En,{children:[d.jsx(Tn,{asChild:!0,onClick:s=>s.stopPropagation(),children:d.jsx("button",{type:"button",className:"flex items-center gap-0.5 text-amber-500 hover:text-amber-400 transition-colors",children:d.jsx(wn,{className:"h-3 w-3"})})}),d.jsxs(on,{className:"w-56 p-3",side:"top",align:"end",onClick:s=>s.stopPropagation(),children:[d.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Session ended without completing work."}),d.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.from_status&&d.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs px-2 py-1.5 rounded bg-amber-500/10 text-amber-500 hover:bg-amber-500/20 transition-colors",onClick:()=>r(e,n.from_status,t),children:[d.jsx($0,{className:"h-3 w-3"}),"Revert to ",n.from_status]}),d.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs px-2 py-1.5 rounded bg-muted text-muted-foreground hover:bg-muted/80 transition-colors",onClick:()=>i(e,t),children:[d.jsx(wt,{className:"h-3 w-3"}),"Keep here"]})]})]})]})}function SE(e){const t=e.toLowerCase().trim(),n=t.match(/^~?(\d+)(?:\s*-\s*\d+)?\s*min/);if(n)return`${n[1]}M`;const r=t.match(/^~?(\d+(?:\.\d+)?)(?:\s*-\s*\d+(?:\.\d+)?)?\s*hour/);if(r)return`${r[1]}H`;const i=t.match(/\((\d+(?:\.\d+)?)(?:\s*-\s*\d+(?:\.\d+)?)?\s*(hour|min)/);return i?`${i[1]}${i[2].startsWith("h")?"H":"M"}`:t.includes("large")||t.includes("multi")?"LG":t.includes("medium")||t.includes("half")?"MD":t.includes("small")?"SM":"TBD"}function Un({scope:e,onClick:t,isDragOverlay:n,cardDisplay:r,dimmed:i,project:s}){const{attributes:o,listeners:a,setNodeRef:l,transform:c,isDragging:u}=Uh({id:ce(e),disabled:n||i}),f=c?{transform:mr.Translate.toString(c)}:void 0,{engine:h}=sn(),{activeScopes:p,abandonedScopes:g,recoverScope:b,dismissAbandoned:y}=Xf(),x=Yt(),v=h.getEntryPoint().id,C=e.status===v,j=C&&!!e.is_ghost,w=ce(e),k=!C&&p.has(w),P=C?void 0:g.get(w),N=!!P&&!k,M=m.useRef(null),[T,R]=m.useState(()=>document.documentElement.getAttribute("data-theme")==="neon-glass");return m.useEffect(()=>{const A=new MutationObserver(()=>{R(document.documentElement.getAttribute("data-theme")==="neon-glass")});return A.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>A.disconnect()},[]),m.useEffect(()=>{if(!k||!M.current)return;let A=0,_;const L=M.current,I=T?D=>`conic-gradient(from ${D}deg, transparent 0%, rgba(var(--neon-pink), 0.9) 8%, rgba(var(--neon-pink), 0.5) 16%, rgba(var(--neon-cyan), 0.15) 24%, transparent 32%)`:D=>`conic-gradient(from ${D}deg, transparent 0%, rgba(233,30,99,0.7) 10%, rgba(233,30,99,0.3) 20%, transparent 30%)`,W=()=>{A=(A+1.5)%360,L.style.background=I(A),_=requestAnimationFrame(W)};return _=requestAnimationFrame(W),()=>cancelAnimationFrame(_)},[k,T]),d.jsxs(zl,{ref:l,"data-tour":"scope-card",style:{...f,...!j&&!C&&s&&(r==null?void 0:r.project)!==!1?{"--project-color":`hsl(${s.color})`}:{}},className:F("scope-card group/scope-card cursor-grab transition-[colors,opacity] duration-200 hover:bg-surface-light active:cursor-grabbing",j?"scope-card-ghost ghost-shimmer opacity-70":C?"border-l-2 border-dashed border-l-warning-amber/60":"",k&&"scope-card-dispatched",N&&"scope-card-abandoned",u&&"opacity-0 pointer-events-none",i&&!u&&"opacity-30 cursor-default"),onClick:()=>{u||t==null||t(e)},...o,...a,children:[k&&d.jsx("div",{ref:M,className:"dispatch-border-overlay"}),d.jsxs(Vl,{className:"px-2.5 py-1.5",children:[d.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[j?d.jsxs("span",{className:"flex items-center gap-1 text-xxs text-purple-400",children:[d.jsx($a,{className:"h-3 w-3"}),"ai suggestion"]}):C?d.jsxs("span",{className:"flex items-center gap-1 text-xxs text-warning-amber",children:[d.jsx(c0,{className:"h-3 w-3"}),"idea"]}):d.jsxs("span",{className:"font-mono text-xxs text-muted-foreground flex items-center gap-1",children:[k&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-pink-500 dispatch-pulse"}),N&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500"}),_t(e.id),d.jsx("button",{type:"button",onClick:A=>{A.stopPropagation(),fetch(x(`/scopes/${e.id}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({favourite:!e.favourite})})},className:F("inline-flex items-center justify-center h-3.5 w-3.5 transition-all duration-150",e.favourite?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover/scope-card:opacity-100 hover:text-primary/70"),"aria-label":e.favourite?"Remove from favourites":"Add to favourites",children:d.jsx(I0,{className:F("h-3 w-3",e.favourite&&"fill-current")})})]}),!C&&d.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[N&&d.jsx(kE,{scopeId:e.id,projectId:e.project_id,info:P,onRecover:b,onDismiss:y}),e.effort_estimate&&(r==null?void 0:r.effort)!==!1&&d.jsx("span",{className:F(Co,"effort-ghost border-muted-foreground/30 text-muted-foreground"),children:SE(e.effort_estimate)}),e.category&&(r==null?void 0:r.category)!==!1&&d.jsx("span",{className:F(Co,wE[e.category]??"border-muted-foreground/30 text-muted-foreground"),children:e.category}),e.priority&&(r==null?void 0:r.priority)!==!1&&d.jsx("span",{className:F(Co,vE[e.priority]??"border-muted-foreground/30 text-muted-foreground"),children:e.priority})]})]}),d.jsx("h3",{className:"text-xs font-light leading-snug line-clamp-2",children:e.title}),!C&&e.tags.length>0&&(r==null?void 0:r.tags)!==!1&&d.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[e.tags.slice(0,3).map(A=>d.jsx("span",{className:"glass-pill inline-block rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:A},A)),e.tags.length>3&&d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["+",e.tags.length-3]})]})]})]})}function CE({projectId:e,disabled:t,onProjectChange:n,className:r}){const{projects:i,hasMultipleProjects:s,getProjectColor:o,getProjectName:a}=Gt(),[l,c]=m.useState(!1);if(!s||!e)return null;const u=o(e),f=a(e),h=i.filter(p=>p.enabled);return d.jsxs(En,{open:l&&!t,onOpenChange:c,children:[d.jsx(Tn,{asChild:!0,children:d.jsxs("button",{disabled:t,className:F("inline-flex items-center gap-1 rounded-full px-1.5 py-0 text-[10px] leading-[16px] transition-all duration-200",t?"opacity-50 cursor-default":"cursor-pointer hover:bg-accent/50",r),style:{borderColor:`hsl(${u} / 0.4)`,color:`hsl(${u})`,borderWidth:"1px",borderStyle:"solid"},onClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[d.jsx("span",{className:"h-1.5 w-1.5 rounded-full shrink-0 transition-all duration-200",style:{backgroundColor:`hsl(${u})`}}),d.jsx("span",{className:"truncate max-w-[60px]",children:f}),!t&&d.jsx(eh,{className:"h-2.5 w-2.5 shrink-0 opacity-60"})]})}),d.jsx(on,{className:"w-44 p-1",align:"start",side:"top",sideOffset:6,onClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:d.jsx("div",{className:"max-h-48 overflow-y-auto",children:h.map(p=>{const g=p.id===e;return d.jsxs("button",{className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors",g?"bg-accent":"hover:bg-accent/50"),onClick:()=>{!g&&n&&n(p.id),c(!1)},children:[d.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:`hsl(${p.color})`}}),d.jsx("span",{className:"truncate flex-1 text-left",children:p.name}),g&&d.jsx(Sr,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]},p.id)})})})]})}const Sm={assembling:"border-dashed border-cyan-500/40",dispatched:"border-solid border-amber-500/50 batch-group-dispatched",in_progress:"border-solid border-amber-500/40 batch-group-dispatched",completed:"border-solid border-green-500/40",failed:"border-solid border-red-500/40",cancelled:"border-solid border-muted-foreground/30 opacity-50"},Cm={assembling:{icon:Ts,label:"Assembling",bg:"bg-cyan-500/15",text:"text-cyan-400"},dispatched:{icon:Qo,label:"In Progress",bg:"bg-amber-500/15",text:"text-amber-400"},in_progress:{icon:Qo,label:"In Progress",bg:"bg-amber-500/15",text:"text-amber-400"},completed:{icon:Sr,label:"Completed",bg:"bg-green-500/15",text:"text-green-400"},failed:{icon:wt,label:"Failed",bg:"bg-red-500/15",text:"text-red-400"},cancelled:{icon:wt,label:"Cancelled",bg:"bg-muted",text:"text-muted-foreground"}};function jE({sprint:e,scopeLookup:t,onDelete:n,onRename:r,onScopeClick:i,cardDisplay:s,dimmedIds:o,looseCount:a,onAddAll:l,projectLookup:c,editingName:u,onEditingDone:f,onProjectChange:h}){var X;const{engine:p}=sn(),g=e.status==="assembling",[b,y]=m.useState(u??!1),[x,v]=m.useState(e.name),C=m.useRef(null);m.useEffect(()=>{u&&(y(!0),v(""))},[u]),m.useEffect(()=>{var U;b&&((U=C.current)==null||U.focus())},[b]);const j=()=>{const U=x.trim();U&&U!==e.name&&r&&r(e.id,U),y(!1),v(U||e.name),f==null||f()},w=e.group_type==="batch",k=e.status==="dispatched"||e.status==="in_progress",{attributes:P,listeners:N,setNodeRef:M,isDragging:T}=Uh({id:`sprint-${e.id}`,disabled:k||e.scope_ids.length===0}),{setNodeRef:R,isOver:A}=rl({id:`sprint-drop-${e.id}`,disabled:!g}),{active:_}=Wh(),L=_?String(_.id):null,I=L&&!L.startsWith("sprint-")?db(L).projectId:void 0,W=g&&L!=null&&!L.startsWith("sprint-")&&(!e.project_id||!I||e.project_id===I),D=e.scope_ids.length,{progress:$}=e,z=w?oh:Ts,S=e.project_id&&(c==null?void 0:c.get(e.project_id)),H=S?`hsl(${S.color})`:void 0,oe=S?`hsl(${S.color} / 0.1)`:void 0,E=H?"":"text-muted-foreground",K=w&&g?"border-muted-foreground/30":Sm[e.status]??"border-muted-foreground/30";return d.jsxs("div",{ref:M,style:{...H?{borderColor:H}:w&&g?{borderColor:(((X=p.getList(e.target_column))==null?void 0:X.hex)??"")+"80"}:void 0},className:F("rounded-lg border bg-card/30 transition-all duration-200",!H&&K,T&&"opacity-0",!k&&e.scope_ids.length>0&&"cursor-grab active:cursor-grabbing"),...P,...N,children:[d.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 border-b border-inherit rounded-t-lg transition-colors duration-200",style:oe?{backgroundColor:oe}:void 0,children:[d.jsx(z,{className:F("h-3 w-3 shrink-0 transition-colors duration-200",E),style:H?{color:H}:void 0}),b?d.jsx("input",{ref:C,className:"min-w-0 flex-1 h-5 rounded bg-muted/50 px-1.5 text-xs font-medium text-foreground border border-cyan-500/30 focus:outline-none focus:ring-1 focus:ring-cyan-500/50",placeholder:w?"Batch name...":"Sprint name...",value:x,onChange:U=>v(U.target.value),onKeyDown:U=>{U.key==="Enter"&&j(),U.key==="Escape"&&(y(!1),v(e.name),f==null||f())},onBlur:j,onClick:U=>U.stopPropagation()}):d.jsx("span",{className:F("text-xs font-medium text-foreground truncate",g&&"cursor-text"),onDoubleClick:()=>{g&&(y(!0),v(e.name))},children:e.name}),d.jsx("div",{className:"flex-1"}),g&&(a??0)>0&&l&&d.jsxs("button",{onClick:U=>{U.stopPropagation(),l(e.id)},className:"shrink-0 flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] bg-muted text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",title:`Add all ${a} remaining scopes`,children:["+ All (",a,")"]}),n&&d.jsx("button",{onClick:U=>{U.stopPropagation(),n(e.id)},disabled:e.status==="dispatched"||e.status==="in_progress",className:F("shrink-0 transition-colors",e.status==="dispatched"||e.status==="in_progress"?"text-muted-foreground/30 cursor-not-allowed":"text-muted-foreground hover:text-[#FFFFFF]"),children:d.jsx(wt,{className:"h-3 w-3"})})]}),d.jsxs("div",{ref:R,className:F("p-1.5 space-y-1 min-h-[40px] transition-colors duration-150",A&&g&&"bg-cyan-500/5 ring-1 ring-inset ring-cyan-500/30 rounded-b-lg"),children:[e.scope_ids.map(U=>{const Le=e.project_id?`${e.project_id}::${U}`:String(U),Ce=t.get(Le);if(!Ce){const Re=e.scopes.find(ge=>ge.scope_id===U);return d.jsxs("div",{className:"rounded border border-muted-foreground/20 bg-card/50 px-2 py-1 text-xs text-muted-foreground",children:[d.jsx("span",{className:"font-mono",children:_t(U)}),Re&&d.jsx("span",{className:"ml-2",children:Re.title})]},U)}return L&&ce(Ce)===L?null:d.jsx(Un,{scope:Ce,onClick:i,cardDisplay:s,dimmed:o==null?void 0:o.has(ce(Ce)),project:Ce.project_id&&c?c.get(Ce.project_id):void 0},ce(Ce))}),W&&d.jsx("div",{className:F("flex h-8 items-center justify-center rounded border border-dashed text-[10px] transition-colors",A?"border-cyan-500/60 bg-cyan-500/10 text-cyan-400":"border-white/20 bg-white/[0.03] text-white/30"),children:"Drop to add"})]}),d.jsxs("div",{className:"flex items-center justify-between border-t border-inherit px-2.5 py-1",children:[d.jsxs("div",{className:"inline-flex items-stretch rounded-full border border-muted-foreground/30 bg-muted/40 pl-0 pr-2 text-[10px] leading-[16px] text-muted-foreground",children:[d.jsx(CE,{projectId:e.project_id,disabled:D>0||!g,onProjectChange:h?U=>h(e.id,U):void 0,className:"-ml-px -my-px"}),d.jsxs("span",{className:"ml-1.5 flex items-center",children:[D," scope",D!==1?"s":""]})]}),(()=>{const U=Cm[e.status];if(!U)return null;const Le=U.icon,Ce=!g&&D>0&&($.completed>0||$.failed>0||$.in_progress>0),Re=d.jsxs("span",{className:F("inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] leading-[16px]",U.bg,U.text),children:[d.jsx(Le,{className:"h-2.5 w-2.5"}),U.label]});if(!Ce)return Re;const ge=[];return $.completed>0&&ge.push(`${$.completed} done`),$.in_progress>0&&ge.push(`${$.in_progress} active`),$.failed>0&&ge.push(`${$.failed} failed`),d.jsxs(ly,{children:[d.jsx(cy,{asChild:!0,children:Re}),d.jsx(Rf,{side:"top",children:ge.join(" · ")})]})})()]}),w&&e.dispatch_result&&(e.dispatch_result.commit_sha||e.dispatch_result.pr_url)&&d.jsxs("div",{className:"border-t border-inherit px-2.5 py-1 text-[10px] text-muted-foreground space-y-0.5",children:[e.dispatch_result.commit_sha&&d.jsx("span",{className:"font-mono",children:e.dispatch_result.commit_sha.slice(0,7)}),e.dispatch_result.pr_url&&d.jsxs("a",{href:e.dispatch_result.pr_url,target:"_blank",rel:"noopener noreferrer",className:"text-cyan-400 hover:underline ml-1",children:["PR #",e.dispatch_result.pr_number??""]})]})]})}function EE({sprint:e,scopeLookup:t,projectLookup:n}){const i=e.group_type==="batch"?oh:Ts,s=e.project_id&&(n==null?void 0:n.get(e.project_id)),o=s?`hsl(${s.color})`:void 0,a=s?`hsl(${s.color} / 0.1)`:void 0,l=o?"":"text-muted-foreground",c=Sm[e.status]??"border-muted-foreground/30",u=Cm[e.status],f=e.scope_ids.length;return d.jsxs("div",{className:F("w-72 rotate-1 opacity-90 shadow-xl shadow-black/40 rounded-lg border bg-card/80 overflow-hidden",!o&&c),style:o?{borderColor:o}:void 0,children:[d.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 border-b border-inherit rounded-t-lg",style:a?{backgroundColor:a}:void 0,children:[d.jsx(i,{className:F("h-3 w-3 shrink-0",l),style:o?{color:o}:void 0}),d.jsx("span",{className:"text-xs font-medium text-foreground truncate",children:e.name})]}),d.jsx("div",{className:"p-1.5 space-y-1",children:e.scope_ids.map(h=>{const p=e.project_id?`${e.project_id}::${h}`:String(h),g=t==null?void 0:t.get(p);if(g)return d.jsx(Un,{scope:g,project:g.project_id&&n?n.get(g.project_id):void 0},ce(g));const b=e.scopes.find(y=>y.scope_id===h);return d.jsxs("div",{className:"rounded border border-muted-foreground/20 bg-card/50 px-2 py-1 text-xs text-muted-foreground",children:[d.jsx("span",{className:"font-mono",children:_t(h)}),b&&d.jsx("span",{className:"ml-2",children:b.title})]},h)})}),d.jsxs("div",{className:"flex items-center justify-between border-t border-inherit px-2.5 py-1",children:[d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[f," scope",f!==1?"s":""]}),u&&(()=>{const h=u.icon;return d.jsxs("span",{className:F("inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px]",u.bg,u.text),children:[d.jsx(h,{className:"h-2.5 w-2.5"}),u.label]})})()]})]})}const TE=[{field:"id",label:"Scope ID"},{field:"priority",label:"Priority"},{field:"effort",label:"Effort"},{field:"updated_at",label:"Last Updated"},{field:"created_at",label:"Created"},{field:"title",label:"Alphabetical"}];function dd({sortField:e,sortDirection:t,onSetSort:n,collapsed:r,onToggleCollapse:i}){const s=t==="asc"?Ab:eh;return d.jsxs(En,{children:[d.jsx(Tn,{asChild:!0,children:d.jsx("button",{className:"ml-1 flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-white/[0.06] hover:text-foreground","aria-label":"Column options",children:d.jsx(Wb,{className:"h-3 w-3"})})}),d.jsxs(on,{className:"filter-popover-glass !bg-transparent w-44",align:"end",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("p",{className:"px-2 pb-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Sort by"}),TE.map(o=>{const a=e===o.field;return d.jsxs("button",{onClick:()=>n(o.field),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",a&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3 w-3 shrink-0 items-center justify-center rounded-full border",a?"border-primary bg-primary":"border-white/15"),children:a&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-white"})}),d.jsx("span",{className:F("flex-1 text-left",a&&"text-foreground"),children:o.label}),a&&d.jsx(s,{className:"h-3 w-3 text-muted-foreground"})]},o.field)})]}),d.jsx("div",{className:"my-1.5 border-t border-white/10"}),d.jsxs("button",{onClick:i,className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors hover:bg-white/[0.06]",children:[r?d.jsx(ih,{className:"h-3 w-3 text-muted-foreground"}):d.jsx(rh,{className:"h-3 w-3 text-muted-foreground"}),d.jsx("span",{children:r?"Expand column":"Collapse column"})]})]})]})}function NE({id:e,label:t,color:n,scopes:r,sprints:i=[],scopeLookup:s=new Map,globalSprintScopeIds:o,onScopeClick:a,onDeleteSprint:l,onRenameSprint:c,editingSprintId:u,onSprintEditingDone:f,isValidDrop:h,isDragActive:p,headerExtra:g,collapsed:b,onToggleCollapse:y,sortField:x,sortDirection:v,onSetSort:C,cardDisplay:j,dimmedIds:w,onAddAllToSprint:k,projectLookup:P,onProjectChange:N}){Cr();const{setNodeRef:M,isOver:T}=rl({id:e}),R=m.useRef(null);m.useEffect(()=>{p&&h&&R.current&&R.current.scrollTo({top:0,behavior:"smooth"})},[p,h]);const A=o??new Set(i.flatMap(D=>D.scope_ids.map($=>D.project_id?`${D.project_id}::${$}`:String($)))),_=r.filter(D=>!A.has(ce(D))),L=_.filter(D=>!D.is_ghost).map(D=>D.id),I=r.length,W=b;return d.jsx("div",{ref:M,"data-tour":"kanban-column",className:F("flex h-full flex-shrink-0 flex-col rounded border bg-card/50 overflow-hidden transition-[width] duration-300 ease-in-out",W?"w-10 cursor-pointer items-center":"w-72","card-glass neon-border-blue",p&&T&&h&&"ring-2 ring-inset ring-green-500/60 border-green-500/40 bg-green-500/5",p&&T&&!h&&"ring-2 ring-inset ring-red-500/50 border-red-500/30 bg-red-500/5",p&&!T&&h&&"border-green-500/20"),onClick:W?y:void 0,children:W?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex items-center justify-center py-1.5",onClick:D=>D.stopPropagation(),children:x&&v&&C&&y&&d.jsx(dd,{sortField:x,sortDirection:v,onSetSort:C,collapsed:!0,onToggleCollapse:y})}),d.jsx("div",{className:"flex items-start justify-center overflow-hidden pt-2",children:d.jsxs("div",{className:"flex items-center gap-2 [writing-mode:vertical-lr]",children:[d.jsx("div",{className:F("h-2.5 w-2.5 rounded-full shrink-0","animate-glow-pulse"),style:{backgroundColor:`hsl(${n})`}}),d.jsx("span",{className:"text-xxs uppercase tracking-wider font-normal text-muted-foreground whitespace-nowrap",children:t})]})}),d.jsx("span",{className:"mt-2 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-normal text-muted-foreground",children:I})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"column-header flex items-center gap-2 border-b px-2.5 py-1.5 cursor-pointer",onClick:y,children:[d.jsx("div",{className:F("h-2.5 w-2.5 rounded-full","animate-glow-pulse"),style:{backgroundColor:`hsl(${n})`}}),d.jsx("h2",{className:"text-xxs uppercase tracking-wider font-normal text-muted-foreground",children:t}),d.jsx("span",{className:"ml-auto rounded-full bg-muted px-2 py-0.5 text-xs font-normal text-muted-foreground",children:I}),g&&d.jsx("span",{className:"flex items-center",onClick:D=>D.stopPropagation(),children:g}),x&&v&&C&&y&&d.jsx("span",{onClick:D=>D.stopPropagation(),children:d.jsx(dd,{sortField:x,sortDirection:v,onSetSort:C,collapsed:!1,onToggleCollapse:y})})]}),d.jsx("div",{ref:R,className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-2",children:d.jsxs("div",{className:"space-y-1.5",children:[i.map(D=>d.jsx(jE,{sprint:D,scopeLookup:s,onDelete:l,onRename:c,onScopeClick:a,cardDisplay:j,dimmedIds:w,projectLookup:P,editingName:ir(D)===u,onEditingDone:f,onProjectChange:N,looseCount:D.status==="assembling"?L.length:0,onAddAll:D.status==="assembling"&&k?$=>k($,L):void 0},`sprint-${D.id}`)),p&&h&&d.jsx("div",{className:F("flex h-10 items-center justify-center rounded border-2 border-dashed text-xs transition-colors",T?"border-cyan-500/60 bg-cyan-500/10 text-cyan-400":"border-white/20 bg-white/[0.03] text-white/30"),children:"Drop here"}),d.jsx(ls,{initial:!1,children:_.filter(D=>!D.is_ghost).map(D=>d.jsx(gs.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(Un,{scope:D,onClick:a,cardDisplay:j,dimmed:w==null?void 0:w.has(ce(D)),project:D.project_id&&P?P.get(D.project_id):void 0})},ce(D)))}),_.some(D=>D.is_ghost)&&_.some(D=>!D.is_ghost)&&d.jsx("div",{className:"my-2 border-t border-dashed border-purple-500/20"}),d.jsx(ls,{initial:!1,children:_.filter(D=>D.is_ghost).map(D=>d.jsx(gs.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(Un,{scope:D,onClick:a,cardDisplay:j,dimmed:w==null?void 0:w.has(ce(D)),project:D.project_id&&P?P.get(D.project_id):void 0})},ce(D)))})]})})]})})}var PE=Symbol.for("react.lazy"),xs=kx[" use ".trim().toString()];function AE(e){return typeof e=="object"&&e!==null&&"then"in e}function jm(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===PE&&"_payload"in e&&AE(e._payload)}function Em(e){const t=RE(e),n=m.forwardRef((r,i)=>{let{children:s,...o}=r;jm(s)&&typeof xs=="function"&&(s=xs(s._payload));const a=m.Children.toArray(s),l=a.find(DE);if(l){const c=l.props.children,u=a.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return d.jsx(t,{...o,ref:i,children:m.isValidElement(c)?m.cloneElement(c,void 0,u):null})}return d.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var _E=Em("Slot");function RE(e){const t=m.forwardRef((n,r)=>{let{children:i,...s}=n;if(jm(i)&&typeof xs=="function"&&(i=xs(i._payload)),m.isValidElement(i)){const o=IE(i),a=OE(s,i.props);return i.type!==m.Fragment&&(a.ref=r?mf(r,o):o),m.cloneElement(i,a)}return m.Children.count(i)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ME=Symbol("radix.slottable");function DE(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ME}function OE(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function IE(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const LE=fh("inline-flex items-center justify-center whitespace-nowrap rounded text-xs font-normal ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 glow-blue",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-border bg-background hover:bg-surface-light hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-surface-light hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 px-3 py-1.5",sm:"h-7 rounded px-2.5",lg:"h-9 rounded px-5",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),ke=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const o=r?_E:"button";return d.jsx(o,{className:F(LE({variant:t,size:n,className:e})),ref:s,...i})});ke.displayName="Button";const FE=[{key:"effort",label:"Effort"},{key:"category",label:"Category"},{key:"priority",label:"Priority"},{key:"tags",label:"Tags"},{key:"project",label:"Project colors"}];function BE({display:e,onToggle:t,hiddenCount:n}){return d.jsxs(En,{children:[d.jsx(Tn,{asChild:!0,children:d.jsxs(ke,{variant:"outline",size:"sm",className:"gap-1.5 backdrop-blur-sm bg-white/[0.03] border-white/10","aria-label":"Toggle card display",children:[d.jsx(P0,{className:"h-3 w-3"}),"Cards",n>0&&d.jsx("span",{className:"ml-0.5 rounded-full bg-white/10 px-1.5 text-[10px]",children:n})]})}),d.jsx(on,{align:"end",className:"filter-popover-glass !bg-transparent w-40",children:d.jsx("div",{className:"space-y-0.5",children:FE.map(({key:r,label:i})=>{const s=e[r];return d.jsxs("button",{onClick:()=>t(r),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",s&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border",s?"border-primary bg-primary text-primary-foreground":"border-white/15"),children:s&&d.jsx("svg",{className:"h-2.5 w-2.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),d.jsx("span",{className:F("capitalize",s&&"text-foreground"),children:i})]},r)})})})]})}const zE=[{value:"kanban",label:"Kanban",Icon:th},{value:"swimlane",label:"Swimlane",Icon:ah}],VE=[{value:"priority",label:"Priority"},{value:"category",label:"Category"},{value:"tags",label:"Tags"},{value:"effort",label:"Effort"},{value:"dependencies",label:"Dependencies"},{value:"project",label:"Project"}];function $E({viewMode:e,groupField:t,onViewModeChange:n,onGroupFieldChange:r}){const i=e==="swimlane"?ah:th;return d.jsxs(En,{children:[d.jsx(Tn,{asChild:!0,children:d.jsxs(ke,{variant:"outline",size:"sm",className:"gap-1.5 backdrop-blur-sm bg-white/[0.03] border-white/10","aria-label":"Toggle view mode",children:[d.jsx(i,{className:"h-3 w-3"}),"Board"]})}),d.jsxs(on,{align:"end",className:"filter-popover-glass !bg-transparent w-44",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("p",{className:"px-2 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:"View"}),zE.map(({value:s,label:o,Icon:a})=>d.jsxs("button",{onClick:()=>n(s),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",e===s&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border",e===s?"border-primary bg-primary":"border-white/15"),children:e===s&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary-foreground"})}),d.jsx(a,{className:"h-3 w-3 text-muted-foreground"}),d.jsx("span",{className:F(e===s&&"text-foreground"),children:o})]},s))]}),e==="swimlane"&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"my-2 border-t border-white/[0.06]"}),d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("p",{className:"px-2 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:"Group by"}),VE.map(({value:s,label:o})=>d.jsxs("button",{onClick:()=>r(s),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",t===s&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border",t===s?"border-primary bg-primary":"border-white/15"),children:t===s&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary-foreground"})}),d.jsx("span",{className:F(t===s&&"text-foreground"),children:o})]},s))]})]})]})]})}function UE({laneValue:e,status:t,scopes:n=[],onScopeClick:r,cardDisplay:i,dimmedIds:s,isDragActive:o,isValidDrop:a,isCollapsed:l,projectLookup:c}){const u=`swim::${e}::${t}`,{setNodeRef:f,isOver:h}=rl({id:u});return l?null:d.jsx("div",{ref:f,className:F("swim-cell min-h-[48px] overflow-hidden rounded border border-white/[0.04] p-1 transition-colors",o&&h&&a&&"ring-2 ring-inset ring-green-500/60 border-green-500/40 bg-green-500/5",o&&h&&!a&&"ring-2 ring-inset ring-red-500/50 border-red-500/30 bg-red-500/5",o&&!h&&a&&"border-green-500/20",n.length===0&&"border-dashed border-white/[0.06]"),children:d.jsxs("div",{className:"space-y-1.5",children:[o&&a&&d.jsx("div",{className:F("flex h-8 items-center justify-center rounded border-2 border-dashed text-[10px] transition-colors",h?"border-cyan-500/60 bg-cyan-500/10 text-cyan-400":"border-white/20 bg-white/[0.03] text-white/30"),children:"Drop here"}),d.jsx(ls,{initial:!1,children:n.filter(p=>!p.is_ghost).map(p=>d.jsx(gs.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(Un,{scope:p,onClick:r,cardDisplay:i,dimmed:s==null?void 0:s.has(ce(p)),project:p.project_id&&c?c.get(p.project_id):void 0})},ce(p)))}),d.jsx(ls,{initial:!1,children:n.filter(p=>p.is_ghost).map(p=>d.jsx(gs.div,{layout:!0,transition:{duration:.25,ease:"easeInOut"},children:d.jsx(Un,{scope:p,onClick:r,cardDisplay:i,dimmed:s==null?void 0:s.has(ce(p)),project:p.project_id&&c?c.get(p.project_id):void 0})},ce(p)))})]})})}function WE({lane:e,columns:t,collapsedColumns:n,isLaneCollapsed:r,onToggleLane:i,onScopeClick:s,cardDisplay:o,dimmedIds:a,isDragActive:l,validTargets:c,projectLookup:u}){return r?d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:i,className:"swim-lane-header flex items-center gap-2 rounded-l px-3 py-1.5 text-left hover:bg-white/[0.04] transition-colors cursor-pointer sticky left-0 z-10 bg-background/60 backdrop-blur-sm",children:[d.jsx("div",{className:F("h-full w-0.5 rounded-full shrink-0 self-stretch",!e.colorHsl&&e.color),style:e.colorHsl?{backgroundColor:`hsl(${e.colorHsl})`}:void 0}),d.jsx(ri,{className:"h-3 w-3 text-muted-foreground shrink-0"}),d.jsx("span",{className:"text-xxs font-medium text-muted-foreground truncate capitalize",children:e.label}),d.jsx("span",{className:"ml-auto rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground shrink-0",children:e.count})]}),t.map(f=>d.jsx("div",{className:F(n.has(f.id)&&"hidden")},f.id))]}):d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:i,className:"swim-lane-header flex items-start gap-2 rounded-l px-3 py-2 text-left hover:bg-white/[0.04] transition-colors cursor-pointer sticky left-0 z-10 bg-background/60 backdrop-blur-sm",children:[d.jsx("div",{className:F("w-0.5 rounded-full shrink-0 min-h-[32px] self-stretch",!e.colorHsl&&e.color),style:e.colorHsl?{backgroundColor:`hsl(${e.colorHsl})`}:void 0}),d.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(ri,{className:"h-3 w-3 text-muted-foreground shrink-0 rotate-90 transition-transform"}),d.jsx("span",{className:"swim-lane-label text-xxs font-medium text-foreground/80 truncate capitalize",children:e.label})]}),d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[e.count," scope",e.count!==1?"s":""]})]})]}),t.map(f=>d.jsx(UE,{laneValue:e.value,status:f.id,scopes:e.cells[f.id],onScopeClick:s,cardDisplay:o,dimmedIds:a,isDragActive:l,isValidDrop:c.has(f.id),isCollapsed:n.has(f.id),projectLookup:u},f.id))]})}function HE({lanes:e,columns:t,collapsedColumns:n,collapsedLanes:r,onToggleLane:i,onToggleCollapse:s,onScopeClick:o,cardDisplay:a,dimmedIds:l,isDragActive:c,validTargets:u,sprints:f,projectLookup:h}){Cr();const p=t.filter(y=>!n.has(y.id)),g=`140px ${p.map(()=>"288px").join(" ")}`,b=f.some(y=>y.group_type==="sprint"||y.group_type==="batch"&&y.status!=="completed");return d.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[b&&d.jsxs("div",{className:"mb-2 flex items-center gap-2 rounded border border-primary/20 bg-primary/5 px-3 py-1.5 text-xs text-muted-foreground",children:[d.jsx(s0,{className:"h-3.5 w-3.5 text-primary shrink-0"}),"Sprint groups are hidden in swimlane view"]}),d.jsxs("div",{className:"grid gap-px pb-4",style:{gridTemplateColumns:g,width:"max-content"},children:[d.jsx("div",{className:"sticky top-0 z-20 bg-background"}),p.map(y=>d.jsxs("button",{onClick:()=>s(y.id),className:F("sticky top-0 z-20 flex items-center gap-1.5 rounded-t border-b border-white/[0.06] bg-background px-2 py-1.5 text-left cursor-pointer hover:bg-white/[0.03] transition-colors","border-b-white/[0.08]"),children:[d.jsx("div",{className:F("h-2 w-2 rounded-full shrink-0","animate-glow-pulse"),style:{backgroundColor:`hsl(${y.color})`}}),d.jsx("span",{className:"text-xxs uppercase tracking-wider font-normal text-muted-foreground truncate",children:y.label})]},y.id)),e.map(y=>d.jsx(WE,{lane:y,columns:p,collapsedColumns:n,isLaneCollapsed:r.has(y.value),onToggleLane:()=>i(y.value),onScopeClick:o,cardDisplay:a,dimmedIds:l,isDragActive:c,validTargets:u,projectLookup:h},y.value)),e.length===0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{}),d.jsx("div",{className:F("col-span-full py-12 text-center text-xs text-muted-foreground"),children:"No scopes to display"})]})]})]})}function qE({activeScope:e,activeSprint:t,cardDisplay:n,projectLookup:r,scopeLookup:i}){return d.jsxs(c1,{dropAnimation:null,children:[e&&d.jsx("div",{className:"w-72 rotate-2 shadow-xl shadow-black/40",children:d.jsx(Un,{scope:e,cardDisplay:n,project:e.project_id&&r?r.get(e.project_id):void 0})}),t&&d.jsx(EE,{sprint:t,scopeLookup:i,projectLookup:r})]})}const Pn=mx,rO=yx,KE=px,iO=Sf,Tm=m.forwardRef(({className:e,...t},n)=>d.jsx(wf,{ref:n,className:F("fixed inset-0 z-50 bg-black/70 dialog-overlay-glass data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Tm.displayName=wf.displayName;const an=m.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(KE,{children:[d.jsx(Tm,{}),d.jsxs(kf,{ref:r,className:F("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-full border bg-background shadow-lg duration-200","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]","data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]","card-glass card-glass-heavy rounded border-border",e),...n,children:[t,d.jsxs(Sf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[d.jsx(wt,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));an.displayName=kf.displayName;function Kn({className:e,...t}){return d.jsx("div",{className:F("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function An({className:e,...t}){return d.jsx(gx,{className:F("text-sm font-normal leading-none tracking-tight",e),...t})}function _n({className:e,...t}){return d.jsx(xx,{className:F("text-sm text-muted-foreground",e),...t})}function GE({open:e,scope:t,transition:n,hasActiveSession:r,dispatching:i,error:s,onConfirm:o,onCancel:a,onViewDetails:l}){var y;const c=m.useRef(null);if(m.useEffect(()=>{if(!e)return;const x=setTimeout(()=>{var v;return(v=c.current)==null?void 0:v.focus()},100);return()=>clearTimeout(x)},[e]),!t||!n)return null;const u=((y=n.command)==null?void 0:y.replace("{id}",String(t.id)))??null,f=n.direction==="forward"&&!n.command&&n.from!==n.to,h=t.status===n.from&&f,p=h?"/scope-create":u,g=h||u?"Launch":"Move";function b(){o()}return d.jsx(Pn,{open:e,onOpenChange:x=>{x||a()},children:d.jsxs(an,{className:"max-w-xs p-3 gap-0",children:[d.jsx(An,{className:"sr-only",children:h?"Promote idea":"Confirm transition"}),d.jsx(_n,{className:"sr-only",children:h?`Create a scope from idea "${t.title}"`:`Move ${_t(t.id)} from ${n.from} to ${n.to}`}),d.jsxs("div",{className:"mb-2.5 flex items-center gap-2",children:[d.jsx(Ve,{variant:"outline",className:"text-xxs capitalize",children:n.from}),d.jsx(es,{className:"h-3 w-3 text-muted-foreground"}),d.jsx(Ve,{variant:"default",className:"text-xxs capitalize [color:#000]",children:n.to})]}),d.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:h?d.jsx("span",{className:"font-light",children:t.title}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"font-mono",children:_t(t.id)})," ",d.jsx("span",{className:"font-light",children:t.title})]})}),p&&d.jsxs("div",{className:"mb-3 flex items-center gap-1.5 rounded bg-surface/30 px-2 py-1.5",children:[d.jsx(Ns,{className:"h-3 w-3 shrink-0 text-primary"}),d.jsx("code",{className:"text-xxs font-mono text-primary",children:p})]}),h&&d.jsx("p",{className:"mb-3 text-xxs text-muted-foreground",children:"Creates a scope document from this idea"}),r&&d.jsxs("div",{className:F("mb-3 flex items-start gap-1.5 rounded border px-2 py-1.5 text-xxs","border-warning-amber/30 bg-warning-amber/10 text-warning-amber"),children:[d.jsx(wn,{className:"mt-0.5 h-3 w-3 shrink-0"}),d.jsx("span",{children:"A CLI session is already running for this scope."})]}),s&&d.jsxs("div",{className:"mb-3 flex items-start gap-1.5 rounded border border-red-500/30 bg-red-500/10 px-2 py-1.5 text-xxs text-red-400",children:[d.jsx(wn,{className:"mt-0.5 h-3 w-3 shrink-0"}),d.jsx("span",{children:s})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ke,{ref:c,size:"sm",onClick:b,disabled:i,className:"flex-1",children:i?"Launching...":g}),d.jsx(ke,{size:"sm",variant:"ghost",onClick:a,disabled:i,children:"Cancel"})]}),(u||h)&&d.jsxs("button",{onClick:l,className:"mt-2 flex items-center gap-1 text-xxs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(nh,{className:"h-2.5 w-2.5"}),"View Details"]})]})})}function YE({open:e,scope:t,transition:n,hasActiveSession:r,dispatching:i,error:s,onConfirm:o,onCancel:a}){var b;const[l,c]=m.useState(new Set),u=(n==null?void 0:n.checklist)??[],f=u.length===0||l.size===u.length;if(m.useEffect(()=>{e&&c(new Set)},[e]),!t||!n)return null;const h=((b=n.command)==null?void 0:b.replace("{id}",String(t.id)))??null;function p(y){c(x=>{const v=new Set(x);return v.has(y)?v.delete(y):v.add(y),v})}function g(){o()}return d.jsx(Pn,{open:e,onOpenChange:y=>{y||a()},children:d.jsxs(an,{className:"max-w-md p-0 gap-0",children:[d.jsxs(Kn,{className:"px-5 pt-4 pb-3",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(Ve,{variant:"outline",className:"text-xxs capitalize",children:n.from}),d.jsx(es,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsx(Ve,{variant:"default",className:"text-xxs capitalize [color:#000]",children:n.to})]}),d.jsx(An,{className:"text-sm font-normal",children:n.label}),d.jsx(_n,{className:"text-xs text-muted-foreground mt-1",children:n.description})]}),d.jsxs("div",{className:"px-5 pb-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{className:"font-mono text-muted-foreground",children:_t(t.id)}),d.jsx("span",{className:"font-light truncate",children:t.title}),t.category&&d.jsx(Ve,{variant:"secondary",className:"ml-auto text-xxs",children:t.category})]}),h&&d.jsxs("div",{className:"flex items-center gap-2 rounded border border-border bg-surface/30 px-3 py-2",children:[d.jsx(Ns,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),d.jsx("code",{className:"text-xs font-mono text-primary",children:h})]}),u.length>0&&d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("p",{className:"text-xxs font-medium text-muted-foreground uppercase tracking-wider",children:"Pre-launch checklist"}),u.map((y,x)=>d.jsxs("button",{onClick:()=>p(x),className:F("flex w-full items-center gap-2 rounded px-2.5 py-1.5 text-xs text-left transition-colors",l.has(x)?"bg-primary/10 text-foreground":"bg-muted/30 text-muted-foreground hover:bg-muted/50"),children:[d.jsx("div",{className:F("flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border transition-colors",l.has(x)?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/30"),children:l.has(x)&&d.jsx(Sr,{className:"h-2.5 w-2.5"})}),d.jsx("span",{className:"font-light",children:y})]},y))]}),r&&d.jsxs("div",{className:F("flex items-start gap-2 rounded border px-3 py-2 text-xs","border-warning-amber/30 bg-warning-amber/10 text-warning-amber"),children:[d.jsx(wn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:"A CLI session is already running for this scope. Launching will start a new one."})]}),s&&d.jsxs("div",{className:"flex items-start gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[d.jsx(wn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:s})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[d.jsx(ke,{onClick:g,disabled:!f||i,className:"flex-1",children:i?"Launching...":h?"Launch in iTerm":"Confirm Move"}),d.jsx(ke,{variant:"ghost",onClick:a,disabled:i,children:"Cancel"})]})]})]})})}var XE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],JE=XE.reduce((e,t)=>{const n=Em(`Primitive.${t}`),r=m.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),QE="Separator",fd="horizontal",ZE=["horizontal","vertical"],Nm=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=fd,...i}=e,s=eT(r)?r:fd,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return d.jsx(JE.div,{"data-orientation":s,...a,...i,ref:t})});Nm.displayName=QE;function eT(e){return ZE.includes(e)}var Pm=Nm;const ys=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>d.jsx(Pm,{ref:i,decorative:n,orientation:t,className:F("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ys.displayName=Pm.displayName;function tT(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const nT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iT={};function hd(e,t){return(iT.jsx?rT:nT).test(e)}const sT=/[ \t\n\f\r]/g;function oT(e){return typeof e=="object"?e.type==="text"?pd(e.value):!1:pd(e)}function pd(e){return e.replace(sT,"")===""}class Si{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Si.prototype.normal={};Si.prototype.property={};Si.prototype.space=void 0;function Am(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Si(n,r,t)}function ka(e){return e.toLowerCase()}class xt{constructor(t,n){this.attribute=n,this.property=t}}xt.prototype.attribute="";xt.prototype.booleanish=!1;xt.prototype.boolean=!1;xt.prototype.commaOrSpaceSeparated=!1;xt.prototype.commaSeparated=!1;xt.prototype.defined=!1;xt.prototype.mustUseProperty=!1;xt.prototype.number=!1;xt.prototype.overloadedBoolean=!1;xt.prototype.property="";xt.prototype.spaceSeparated=!1;xt.prototype.space=void 0;let aT=0;const ie=Gn(),Ke=Gn(),Sa=Gn(),V=Gn(),Ee=Gn(),fr=Gn(),bt=Gn();function Gn(){return 2**++aT}const Ca=Object.freeze(Object.defineProperty({__proto__:null,boolean:ie,booleanish:Ke,commaOrSpaceSeparated:bt,commaSeparated:fr,number:V,overloadedBoolean:Sa,spaceSeparated:Ee},Symbol.toStringTag,{value:"Module"})),jo=Object.keys(Ca);class $l extends xt{constructor(t,n,r,i){let s=-1;if(super(t,n),md(this,"space",i),typeof r=="number")for(;++s<jo.length;){const o=jo[s];md(this,jo[s],(r&Ca[o])===Ca[o])}}}$l.prototype.defined=!0;function md(e,t,n){n&&(e[t]=n)}function Pr(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new $l(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[ka(r)]=r,n[ka(s.attribute)]=r}return new Si(t,n,e.space)}const _m=Pr({properties:{ariaActiveDescendant:null,ariaAtomic:Ke,ariaAutoComplete:null,ariaBusy:Ke,ariaChecked:Ke,ariaColCount:V,ariaColIndex:V,ariaColSpan:V,ariaControls:Ee,ariaCurrent:null,ariaDescribedBy:Ee,ariaDetails:null,ariaDisabled:Ke,ariaDropEffect:Ee,ariaErrorMessage:null,ariaExpanded:Ke,ariaFlowTo:Ee,ariaGrabbed:Ke,ariaHasPopup:null,ariaHidden:Ke,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ee,ariaLevel:V,ariaLive:null,ariaModal:Ke,ariaMultiLine:Ke,ariaMultiSelectable:Ke,ariaOrientation:null,ariaOwns:Ee,ariaPlaceholder:null,ariaPosInSet:V,ariaPressed:Ke,ariaReadOnly:Ke,ariaRelevant:null,ariaRequired:Ke,ariaRoleDescription:Ee,ariaRowCount:V,ariaRowIndex:V,ariaRowSpan:V,ariaSelected:Ke,ariaSetSize:V,ariaSort:null,ariaValueMax:V,ariaValueMin:V,ariaValueNow:V,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Rm(e,t){return t in e?e[t]:t}function Mm(e,t){return Rm(e,t.toLowerCase())}const lT=Pr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fr,acceptCharset:Ee,accessKey:Ee,action:null,allow:null,allowFullScreen:ie,allowPaymentRequest:ie,allowUserMedia:ie,alt:null,as:null,async:ie,autoCapitalize:null,autoComplete:Ee,autoFocus:ie,autoPlay:ie,blocking:Ee,capture:null,charSet:null,checked:ie,cite:null,className:Ee,cols:V,colSpan:null,content:null,contentEditable:Ke,controls:ie,controlsList:Ee,coords:V|fr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ie,defer:ie,dir:null,dirName:null,disabled:ie,download:Sa,draggable:Ke,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ie,formTarget:null,headers:Ee,height:V,hidden:Sa,high:V,href:null,hrefLang:null,htmlFor:Ee,httpEquiv:Ee,id:null,imageSizes:null,imageSrcSet:null,inert:ie,inputMode:null,integrity:null,is:null,isMap:ie,itemId:null,itemProp:Ee,itemRef:Ee,itemScope:ie,itemType:Ee,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ie,low:V,manifest:null,max:null,maxLength:V,media:null,method:null,min:null,minLength:V,multiple:ie,muted:ie,name:null,nonce:null,noModule:ie,noValidate:ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ie,optimum:V,pattern:null,ping:Ee,placeholder:null,playsInline:ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ie,referrerPolicy:null,rel:Ee,required:ie,reversed:ie,rows:V,rowSpan:V,sandbox:Ee,scope:null,scoped:ie,seamless:ie,selected:ie,shadowRootClonable:ie,shadowRootDelegatesFocus:ie,shadowRootMode:null,shape:null,size:V,sizes:null,slot:null,span:V,spellCheck:Ke,src:null,srcDoc:null,srcLang:null,srcSet:null,start:V,step:null,style:null,tabIndex:V,target:null,title:null,translate:null,type:null,typeMustMatch:ie,useMap:null,value:Ke,width:V,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ee,axis:null,background:null,bgColor:null,border:V,borderColor:null,bottomMargin:V,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ie,declare:ie,event:null,face:null,frame:null,frameBorder:null,hSpace:V,leftMargin:V,link:null,longDesc:null,lowSrc:null,marginHeight:V,marginWidth:V,noResize:ie,noHref:ie,noShade:ie,noWrap:ie,object:null,profile:null,prompt:null,rev:null,rightMargin:V,rules:null,scheme:null,scrolling:Ke,standby:null,summary:null,text:null,topMargin:V,valueType:null,version:null,vAlign:null,vLink:null,vSpace:V,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ie,disableRemotePlayback:ie,prefix:null,property:null,results:V,security:null,unselectable:null},space:"html",transform:Mm}),cT=Pr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bt,accentHeight:V,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:V,amplitude:V,arabicForm:null,ascent:V,attributeName:null,attributeType:null,azimuth:V,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:V,by:null,calcMode:null,capHeight:V,className:Ee,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:V,diffuseConstant:V,direction:null,display:null,dur:null,divisor:V,dominantBaseline:null,download:ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:V,enableBackground:null,end:null,event:null,exponent:V,externalResourcesRequired:null,fill:null,fillOpacity:V,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fr,g2:fr,glyphName:fr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:V,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:V,horizOriginX:V,horizOriginY:V,id:null,ideographic:V,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:V,k:V,k1:V,k2:V,k3:V,k4:V,kernelMatrix:bt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:V,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:V,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:V,overlineThickness:V,paintOrder:null,panose1:null,path:null,pathLength:V,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ee,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:V,pointsAtY:V,pointsAtZ:V,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bt,rev:bt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bt,requiredFeatures:bt,requiredFonts:bt,requiredFormats:bt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:V,specularExponent:V,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:V,strikethroughThickness:V,string:null,stroke:null,strokeDashArray:bt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:V,strokeOpacity:V,strokeWidth:null,style:null,surfaceScale:V,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bt,tabIndex:V,tableValues:null,target:null,targetX:V,targetY:V,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:V,underlineThickness:V,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:V,values:null,vAlphabetic:V,vMathematical:V,vectorEffect:null,vHanging:V,vIdeographic:V,version:null,vertAdvY:V,vertOriginX:V,vertOriginY:V,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:V,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Rm}),Dm=Pr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Om=Pr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Mm}),Im=Pr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),uT={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},dT=/[A-Z]/g,gd=/-[a-z]/g,fT=/^data[-\w.:]+$/i;function hT(e,t){const n=ka(t);let r=t,i=xt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&fT.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(gd,mT);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!gd.test(s)){let o=s.replace(dT,pT);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=$l}return new i(r,t)}function pT(e){return"-"+e.toLowerCase()}function mT(e){return e.charAt(1).toUpperCase()}const gT=Am([_m,lT,Dm,Om,Im],"html"),Ul=Am([_m,cT,Dm,Om,Im],"svg");function xT(e){return e.join(" ").trim()}var Qn={},Eo,xd;function yT(){if(xd)return Eo;xd=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
|
|
306
|
+
`,c="/",u="*",f="",h="comment",p="declaration";function g(y,x){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];x=x||{};var v=1,C=1;function j(L){var I=L.match(t);I&&(v+=I.length);var W=L.lastIndexOf(l);C=~W?L.length-W:C+L.length}function w(){var L={line:v,column:C};return function(I){return I.position=new k(L),M(),I}}function k(L){this.start=L,this.end={line:v,column:C},this.source=x.source}k.prototype.content=y;function P(L){var I=new Error(x.source+":"+v+":"+C+": "+L);if(I.reason=L,I.filename=x.source,I.line=v,I.column=C,I.source=y,!x.silent)throw I}function N(L){var I=L.exec(y);if(I){var W=I[0];return j(W),y=y.slice(W.length),I}}function M(){N(n)}function T(L){var I;for(L=L||[];I=R();)I!==!1&&L.push(I);return L}function R(){var L=w();if(!(c!=y.charAt(0)||u!=y.charAt(1))){for(var I=2;f!=y.charAt(I)&&(u!=y.charAt(I)||c!=y.charAt(I+1));)++I;if(I+=2,f===y.charAt(I-1))return P("End of comment missing");var W=y.slice(2,I-2);return C+=2,j(W),y=y.slice(I),C+=2,L({type:h,comment:W})}}function A(){var L=w(),I=N(r);if(I){if(R(),!N(i))return P("property missing ':'");var W=N(s),D=L({type:p,property:b(I[0].replace(e,f)),value:W?b(W[0].replace(e,f)):f});return N(o),D}}function _(){var L=[];T(L);for(var I;I=A();)I!==!1&&(L.push(I),T(L));return L}return M(),_()}function b(y){return y?y.replace(a,f):f}return Eo=g,Eo}var yd;function bT(){if(yd)return Qn;yd=1;var e=Qn&&Qn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.default=n;const t=e(yT());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const o=(0,t.default)(r),a=typeof i=="function";return o.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;a?i(c,u,l):u&&(s=s||{},s[c]=u)}),s}return Qn}var Ir={},bd;function vT(){if(bd)return Ir;bd=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},o=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),s(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,a):c=c.replace(r,a),c.replace(t,o))};return Ir.camelCase=l,Ir}var Lr,vd;function wT(){if(vd)return Lr;vd=1;var e=Lr&&Lr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(bT()),n=vT();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(a,l){a&&l&&(o[(0,n.camelCase)(a,s)]=l)}),o}return r.default=r,Lr=r,Lr}var kT=wT();const ST=Da(kT),Lm=Fm("end"),Wl=Fm("start");function Fm(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function CT(e){const t=Wl(e),n=Lm(e);if(t&&n)return{start:t,end:n}}function ei(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?wd(e.position):"start"in e||"end"in e?wd(e):"line"in e||"column"in e?ja(e):""}function ja(e){return kd(e&&e.line)+":"+kd(e&&e.column)}function wd(e){return ja(e&&e.start)+"-"+ja(e&&e.end)}function kd(e){return e&&typeof e=="number"?e:1}class ct extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=ei(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ct.prototype.file="";ct.prototype.name="";ct.prototype.reason="";ct.prototype.message="";ct.prototype.stack="";ct.prototype.column=void 0;ct.prototype.line=void 0;ct.prototype.ancestors=void 0;ct.prototype.cause=void 0;ct.prototype.fatal=void 0;ct.prototype.place=void 0;ct.prototype.ruleId=void 0;ct.prototype.source=void 0;const Hl={}.hasOwnProperty,jT=new Map,ET=/[A-Z]/g,TT=new Set(["table","tbody","thead","tfoot","tr"]),NT=new Set(["td","th"]),Bm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function PT(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=LT(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=IT(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ul:gT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=zm(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function zm(e,t,n){if(t.type==="element")return AT(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return _T(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return MT(e,t,n);if(t.type==="mdxjsEsm")return RT(e,t);if(t.type==="root")return DT(e,t,n);if(t.type==="text")return OT(e,t)}function AT(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ul,e.schema=i),e.ancestors.push(t);const s=$m(e,t.tagName,!1),o=FT(e,t);let a=Kl(e,t);return TT.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!oT(l):!0})),Vm(e,o,s,t),ql(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function _T(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}di(e,t.position)}function RT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);di(e,t.position)}function MT(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ul,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:$m(e,t.name,!0),o=BT(e,t),a=Kl(e,t);return Vm(e,o,s,t),ql(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function DT(e,t,n){const r={};return ql(r,Kl(e,t)),e.create(t,e.Fragment,r,n)}function OT(e,t){return t.value}function Vm(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ql(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function IT(e,t,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:t;return a?c(s,o,a):c(s,o)}}function LT(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=Wl(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function FT(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Hl.call(t.properties,i)){const s=zT(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&NT.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function BT(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else di(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else di(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Kl(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:jT;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=zm(e,s,o);a!==void 0&&n.push(a)}return n}function zT(e,t,n){const r=hT(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?tT(n):xT(n)),r.property==="style"){let i=typeof n=="object"?n:VT(e,String(n));return e.stylePropertyNameCase==="css"&&(i=$T(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?uT[r.property]||r.property:r.attribute,n]}}function VT(e,t){try{return ST(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ct("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Bm+"#cannot-parse-style-attribute",i}}function $m(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=hd(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=hd(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Hl.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);di(e)}function di(e,t){const n=new ct("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Bm+"#cannot-handle-mdx-estrees-without-createevaluater",n}function $T(e){const t={};let n;for(n in e)Hl.call(e,n)&&(t[UT(n)]=e[n]);return t}function UT(e){let t=e.replace(ET,WT);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function WT(e){return"-"+e.toLowerCase()}const To={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},HT={};function Gl(e,t){const n=HT,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Um(e,r,i)}function Um(e,t,n){if(qT(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Sd(e.children,t,n)}return Array.isArray(e)?Sd(e,t,n):""}function Sd(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Um(e[i],t,n);return r.join("")}function qT(e){return!!(e&&typeof e=="object")}const Cd=document.createElement("i");function Yl(e){const t="&"+e+";";Cd.innerHTML=t;const n=Cd.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function vt(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function At(e,t){return e.length>0?(vt(e,e.length,0,t),e):t}const jd={}.hasOwnProperty;function Wm(e){const t={};let n=-1;for(;++n<e.length;)KT(t,e[n]);return t}function KT(e,t){let n;for(n in t){const i=(jd.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){jd.call(i,o)||(i[o]=[]);const a=s[o];GT(i[o],Array.isArray(a)?a:a?[a]:[])}}}function GT(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);vt(e,0,0,r)}function Hm(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Lt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ft=Rn(/[A-Za-z]/),lt=Rn(/[\dA-Za-z]/),YT=Rn(/[#-'*+\--9=?A-Z^-~]/);function bs(e){return e!==null&&(e<32||e===127)}const Ea=Rn(/\d/),XT=Rn(/[\dA-Fa-f]/),JT=Rn(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function Se(e){return e!==null&&(e<0||e===32)}function ae(e){return e===-2||e===-1||e===32}const Us=Rn(new RegExp("\\p{P}|\\p{S}","u")),Wn=Rn(/\s/);function Rn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ar(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&<(e.charCodeAt(n+1))&<(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ue(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return ae(l)?(e.enter(n),a(l)):t(l)}function a(l){return ae(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const QT={tokenize:ZT};function ZT(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ue(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Z(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const eN={tokenize:tN},Ed={tokenize:nN};function tN(e){const t=this,n=[];let r=0,i,s,o;return a;function a(C){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,l,c)(C)}return c(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const j=t.events.length;let w=j,k;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){k=t.events[w][1].end;break}x(r);let P=j;for(;P<t.events.length;)t.events[P][1].end={...k},P++;return vt(t.events,w+1,0,t.events.slice(j)),t.events.length=P,c(C)}return a(C)}function c(C){if(r===n.length){if(!i)return h(C);if(i.currentConstruct&&i.currentConstruct.concrete)return g(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ed,u,f)(C)}function u(C){return i&&v(),x(r),h(C)}function f(C){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(C)}function h(C){return t.containerState={},e.attempt(Ed,p,g)(C)}function p(C){return r++,n.push([t.currentConstruct,t.containerState]),h(C)}function g(C){if(C===null){i&&v(),x(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),b(C)}function b(C){if(C===null){y(e.exit("chunkFlow"),!0),x(0),e.consume(C);return}return Z(C)?(e.consume(C),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),b)}function y(C,j){const w=t.sliceStream(C);if(j&&w.push(null),C.previous=s,s&&(s.next=C),s=C,i.defineSkip(C.start),i.write(w),t.parser.lazy[C.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<o&&(!i.events[k][1].end||i.events[k][1].end.offset>o))return;const P=t.events.length;let N=P,M,T;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(M){T=t.events[N][1].end;break}M=!0}for(x(r),k=P;k<t.events.length;)t.events[k][1].end={...T},k++;vt(t.events,N+1,0,t.events.slice(P)),t.events.length=k}}function x(C){let j=n.length;for(;j-- >C;){const w=n[j];t.containerState=w[1],w[0].exit.call(t,e)}n.length=C}function v(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function nN(e,t,n){return ue(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function vr(e){if(e===null||Se(e)||Wn(e))return 1;if(Us(e))return 2}function Ws(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Ta={name:"attention",resolveAll:rN,tokenize:iN};function rN(e,t){let n=-1,r,i,s,o,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};Td(f,-l),Td(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=At(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=At(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=At(c,Ws(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=At(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=At(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,vt(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function iN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=vr(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const c=e.exit("attentionSequence"),u=vr(l),f=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?f:f&&(i||!h)),c._close=!!(s===42?h:h&&(u||!f)),t(l)}}function Td(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const sN={name:"autolink",tokenize:oN};function oN(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return ft(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||lt(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||lt(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||bs(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):YT(p)?(e.consume(p),c):n(p)}function u(p){return lt(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||lt(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const Ci={partial:!0,tokenize:aN};function aN(e,t,n){return r;function r(s){return ae(s)?ue(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||Z(s)?t(s):n(s)}}const qm={continuation:{tokenize:cN},exit:uN,name:"blockQuote",tokenize:lN};function lN(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return ae(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function cN(e,t,n){const r=this;return i;function i(o){return ae(o)?ue(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(qm,t,n)(o)}}function uN(e){e.exit("blockQuote")}const Km={name:"characterEscape",tokenize:dN};function dN(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return JT(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Gm={name:"characterReference",tokenize:fN};function fN(e,t,n){const r=this;let i=0,s,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=lt,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=XT,u):(e.enter("characterReferenceValue"),s=7,o=Ea,u(f))}function u(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return o===lt&&!Yl(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&i++<s?(e.consume(f),u):n(f)}}const Nd={partial:!0,tokenize:pN},Pd={concrete:!0,name:"codeFenced",tokenize:hN};function hN(e,t,n){const r=this,i={partial:!0,tokenize:w};let s=0,o=0,a;return l;function l(k){return c(k)}function c(k){const P=r.events[r.events.length-1];return s=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(k)}function u(k){return k===a?(o++,e.consume(k),u):o<3?n(k):(e.exit("codeFencedFenceSequence"),ae(k)?ue(e,f,"whitespace")(k):f(k))}function f(k){return k===null||Z(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(Nd,b,j)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||Z(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(k)):ae(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ue(e,p,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),h)}function p(k){return k===null||Z(k)?f(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||Z(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(k)):k===96&&k===a?n(k):(e.consume(k),g)}function b(k){return e.attempt(i,j,y)(k)}function y(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),x}function x(k){return s>0&&ae(k)?ue(e,v,"linePrefix",s+1)(k):v(k)}function v(k){return k===null||Z(k)?e.check(Nd,b,j)(k):(e.enter("codeFlowValue"),C(k))}function C(k){return k===null||Z(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),C)}function j(k){return e.exit("codeFenced"),t(k)}function w(k,P,N){let M=0;return T;function T(I){return k.enter("lineEnding"),k.consume(I),k.exit("lineEnding"),R}function R(I){return k.enter("codeFencedFence"),ae(I)?ue(k,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):A(I)}function A(I){return I===a?(k.enter("codeFencedFenceSequence"),_(I)):N(I)}function _(I){return I===a?(M++,k.consume(I),_):M>=o?(k.exit("codeFencedFenceSequence"),ae(I)?ue(k,L,"whitespace")(I):L(I)):N(I)}function L(I){return I===null||Z(I)?(k.exit("codeFencedFence"),P(I)):N(I)}}}function pN(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const No={name:"codeIndented",tokenize:gN},mN={partial:!0,tokenize:xN};function gN(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ue(e,s,"linePrefix",5)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):Z(c)?e.attempt(mN,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Z(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function xN(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):ue(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):Z(o)?i(o):n(o)}}const yN={name:"codeText",previous:vN,resolve:bN,tokenize:wN};function bN(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function vN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wN(e,t,n){let r=0,i,s;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(s=e.enter("codeTextSequence"),i=0,u(f)):Z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Z(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",c(f))}}class kN{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Fr(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Fr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Fr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Fr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Fr(this.left,n.reverse())}}}function Fr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ym(e){const t={};let n=-1,r,i,s,o,a,l,c;const u=new kN(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,SN(u,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=u.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return vt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function SN(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let u,f,h=-1,p=n,g=0,b=0;const y=[b];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(b=h+1,y.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),h=y.length;h--;){const x=a.slice(y[h],y[h+1]),v=s.pop();l.push([v,v+x.length-1]),e.splice(v,2,x)}for(l.reverse(),h=-1;++h<l.length;)c[g+l[h][0]]=g+l[h][1],g+=l[h][1]-l[h][0]-1;return c}const CN={resolve:EN,tokenize:TN},jN={partial:!0,tokenize:NN};function EN(e){return Ym(e),e}function TN(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):Z(a)?e.check(jN,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function NN(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ue(e,s,"linePrefix")}function s(o){if(o===null||Z(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Xm(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(x){return x===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(x),e.exit(s),h):x===null||x===32||x===41||bs(x)?n(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(x))}function h(x){return x===62?(e.enter(s),e.consume(x),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(e.exit("chunkString"),e.exit(a),h(x)):x===null||x===60||Z(x)?n(x):(e.consume(x),x===92?g:p)}function g(x){return x===60||x===62||x===92?(e.consume(x),p):p(x)}function b(x){return!u&&(x===null||x===41||Se(x))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,b):x===41?(e.consume(x),u--,b):x===null||x===32||x===40||bs(x)?n(x):(e.consume(x),x===92?y:b)}function y(x){return x===40||x===41||x===92?(e.consume(x),b):b(x)}}function Jm(e,t,n,r,i,s){const o=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Z(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!ae(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function Qm(e,t,n,r,i,s){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),c(h))}function c(h){return h===o?(e.exit(s),l(o)):h===null?n(h):Z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ue(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||Z(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:u)}function f(h){return h===o||h===92?(e.consume(h),u):u(h)}}function ti(e,t){let n;return r;function r(i){return Z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ae(i)?ue(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const PN={name:"definition",tokenize:_N},AN={partial:!0,tokenize:RN};function _N(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return Jm.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Lt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return Se(p)?ti(e,c)(p):c(p)}function c(p){return Xm(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(AN,f,f)(p)}function f(p){return ae(p)?ue(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Z(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function RN(e,t,n){return r;function r(a){return Se(a)?ti(e,i)(a):n(a)}function i(a){return Qm(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return ae(a)?ue(e,o,"whitespace")(a):o(a)}function o(a){return a===null||Z(a)?t(a):n(a)}}const MN={name:"hardBreakEscape",tokenize:DN};function DN(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return Z(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const ON={name:"headingAtx",resolve:IN,tokenize:LN};function IN(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},vt(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function LN(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||Se(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Z(u)?(e.exit("atxHeading"),t(u)):ae(u)?ue(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Se(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const FN=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ad=["pre","script","style","textarea"],BN={concrete:!0,name:"htmlFlow",resolveTo:$N,tokenize:UN},zN={partial:!0,tokenize:HN},VN={partial:!0,tokenize:WN};function $N(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function UN(e,t,n){const r=this;let i,s,o,a,l;return c;function c(E){return u(E)}function u(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),f}function f(E){return E===33?(e.consume(E),h):E===47?(e.consume(E),s=!0,b):E===63?(e.consume(E),i=3,r.interrupt?t:S):ft(E)?(e.consume(E),o=String.fromCharCode(E),y):n(E)}function h(E){return E===45?(e.consume(E),i=2,p):E===91?(e.consume(E),i=5,a=0,g):ft(E)?(e.consume(E),i=4,r.interrupt?t:S):n(E)}function p(E){return E===45?(e.consume(E),r.interrupt?t:S):n(E)}function g(E){const K="CDATA[";return E===K.charCodeAt(a++)?(e.consume(E),a===K.length?r.interrupt?t:A:g):n(E)}function b(E){return ft(E)?(e.consume(E),o=String.fromCharCode(E),y):n(E)}function y(E){if(E===null||E===47||E===62||Se(E)){const K=E===47,X=o.toLowerCase();return!K&&!s&&Ad.includes(X)?(i=1,r.interrupt?t(E):A(E)):FN.includes(o.toLowerCase())?(i=6,K?(e.consume(E),x):r.interrupt?t(E):A(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):s?v(E):C(E))}return E===45||lt(E)?(e.consume(E),o+=String.fromCharCode(E),y):n(E)}function x(E){return E===62?(e.consume(E),r.interrupt?t:A):n(E)}function v(E){return ae(E)?(e.consume(E),v):T(E)}function C(E){return E===47?(e.consume(E),T):E===58||E===95||ft(E)?(e.consume(E),j):ae(E)?(e.consume(E),C):T(E)}function j(E){return E===45||E===46||E===58||E===95||lt(E)?(e.consume(E),j):w(E)}function w(E){return E===61?(e.consume(E),k):ae(E)?(e.consume(E),w):C(E)}function k(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),l=E,P):ae(E)?(e.consume(E),k):N(E)}function P(E){return E===l?(e.consume(E),l=null,M):E===null||Z(E)?n(E):(e.consume(E),P)}function N(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||Se(E)?w(E):(e.consume(E),N)}function M(E){return E===47||E===62||ae(E)?C(E):n(E)}function T(E){return E===62?(e.consume(E),R):n(E)}function R(E){return E===null||Z(E)?A(E):ae(E)?(e.consume(E),R):n(E)}function A(E){return E===45&&i===2?(e.consume(E),W):E===60&&i===1?(e.consume(E),D):E===62&&i===4?(e.consume(E),H):E===63&&i===3?(e.consume(E),S):E===93&&i===5?(e.consume(E),z):Z(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(zN,oe,_)(E)):E===null||Z(E)?(e.exit("htmlFlowData"),_(E)):(e.consume(E),A)}function _(E){return e.check(VN,L,oe)(E)}function L(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),I}function I(E){return E===null||Z(E)?_(E):(e.enter("htmlFlowData"),A(E))}function W(E){return E===45?(e.consume(E),S):A(E)}function D(E){return E===47?(e.consume(E),o="",$):A(E)}function $(E){if(E===62){const K=o.toLowerCase();return Ad.includes(K)?(e.consume(E),H):A(E)}return ft(E)&&o.length<8?(e.consume(E),o+=String.fromCharCode(E),$):A(E)}function z(E){return E===93?(e.consume(E),S):A(E)}function S(E){return E===62?(e.consume(E),H):E===45&&i===2?(e.consume(E),S):A(E)}function H(E){return E===null||Z(E)?(e.exit("htmlFlowData"),oe(E)):(e.consume(E),H)}function oe(E){return e.exit("htmlFlow"),t(E)}}function WN(e,t,n){const r=this;return i;function i(o){return Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function HN(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ci,t,n)}}const qN={name:"htmlText",tokenize:KN};function KN(e,t,n){const r=this;let i,s,o;return a;function a(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),l}function l(S){return S===33?(e.consume(S),c):S===47?(e.consume(S),w):S===63?(e.consume(S),C):ft(S)?(e.consume(S),N):n(S)}function c(S){return S===45?(e.consume(S),u):S===91?(e.consume(S),s=0,g):ft(S)?(e.consume(S),v):n(S)}function u(S){return S===45?(e.consume(S),p):n(S)}function f(S){return S===null?n(S):S===45?(e.consume(S),h):Z(S)?(o=f,D(S)):(e.consume(S),f)}function h(S){return S===45?(e.consume(S),p):f(S)}function p(S){return S===62?W(S):S===45?h(S):f(S)}function g(S){const H="CDATA[";return S===H.charCodeAt(s++)?(e.consume(S),s===H.length?b:g):n(S)}function b(S){return S===null?n(S):S===93?(e.consume(S),y):Z(S)?(o=b,D(S)):(e.consume(S),b)}function y(S){return S===93?(e.consume(S),x):b(S)}function x(S){return S===62?W(S):S===93?(e.consume(S),x):b(S)}function v(S){return S===null||S===62?W(S):Z(S)?(o=v,D(S)):(e.consume(S),v)}function C(S){return S===null?n(S):S===63?(e.consume(S),j):Z(S)?(o=C,D(S)):(e.consume(S),C)}function j(S){return S===62?W(S):C(S)}function w(S){return ft(S)?(e.consume(S),k):n(S)}function k(S){return S===45||lt(S)?(e.consume(S),k):P(S)}function P(S){return Z(S)?(o=P,D(S)):ae(S)?(e.consume(S),P):W(S)}function N(S){return S===45||lt(S)?(e.consume(S),N):S===47||S===62||Se(S)?M(S):n(S)}function M(S){return S===47?(e.consume(S),W):S===58||S===95||ft(S)?(e.consume(S),T):Z(S)?(o=M,D(S)):ae(S)?(e.consume(S),M):W(S)}function T(S){return S===45||S===46||S===58||S===95||lt(S)?(e.consume(S),T):R(S)}function R(S){return S===61?(e.consume(S),A):Z(S)?(o=R,D(S)):ae(S)?(e.consume(S),R):M(S)}function A(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,_):Z(S)?(o=A,D(S)):ae(S)?(e.consume(S),A):(e.consume(S),L)}function _(S){return S===i?(e.consume(S),i=void 0,I):S===null?n(S):Z(S)?(o=_,D(S)):(e.consume(S),_)}function L(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||Se(S)?M(S):(e.consume(S),L)}function I(S){return S===47||S===62||Se(S)?M(S):n(S)}function W(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function D(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),$}function $(S){return ae(S)?ue(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):z(S)}function z(S){return e.enter("htmlTextData"),o(S)}}const Xl={name:"labelEnd",resolveAll:JN,resolveTo:QN,tokenize:ZN},GN={tokenize:eP},YN={tokenize:tP},XN={tokenize:nP};function JN(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&vt(e,0,e.length,n),e}function QN(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=At(a,e.slice(s+1,s+r+3)),a=At(a,[["enter",u,t]]),a=At(a,Ws(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=At(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=At(a,e.slice(o+1)),a=At(a,[["exit",l,t]]),vt(e,s,e.length,a),e}function ZN(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(h){return s?s._inactive?f(h):(o=r.parser.defined.includes(Lt(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(GN,u,o?u:f)(h):h===91?e.attempt(YN,u,o?c:f)(h):o?u(h):f(h)}function c(h){return e.attempt(XN,u,f)(h)}function u(h){return t(h)}function f(h){return s._balanced=!0,n(h)}}function eP(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return Se(f)?ti(e,s)(f):s(f)}function s(f){return f===41?u(f):Xm(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return Se(f)?ti(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?Qm(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return Se(f)?ti(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function tP(e,t,n){const r=this;return i;function i(a){return Jm.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Lt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function nP(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const rP={name:"labelStartImage",resolveAll:Xl.resolveAll,tokenize:iP};function iP(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const sP={name:"labelStartLink",resolveAll:Xl.resolveAll,tokenize:oP};function oP(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Po={name:"lineEnding",tokenize:aP};function aP(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ue(e,t,"linePrefix")}}const Zi={name:"thematicBreak",tokenize:lP};function lP(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Z(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),ae(c)?ue(e,a,"whitespace")(c):a(c))}}const mt={continuation:{tokenize:fP},exit:pP,name:"list",tokenize:dP},cP={partial:!0,tokenize:mP},uP={partial:!0,tokenize:hP};function dP(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Ea(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Zi,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Ea(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ci,r.interrupt?n:u,e.attempt(cP,h,f))}function u(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function f(p){return ae(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function fP(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ci,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ue(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!ae(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(uP,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ue(e,e.attempt(mt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function hP(e,t,n){const r=this;return ue(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function pP(e){e.exit(this.containerState.type)}function mP(e,t,n){const r=this;return ue(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!ae(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const _d={name:"setextUnderline",resolveTo:gP,tokenize:xP};function gP(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function xP(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),ae(c)?ue(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Z(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const yP={tokenize:bP};function bP(e){const t=this,n=e.attempt(Ci,r,e.attempt(this.parser.constructs.flowInitial,i,ue(e,e.attempt(this.parser.constructs.flow,i,e.attempt(CN,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const vP={resolveAll:eg()},wP=Zm("string"),kP=Zm("text");function Zm(e){return{resolveAll:eg(e==="text"?SP:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(u){return c(u)?s(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function eg(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function SP(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const CP={42:mt,43:mt,45:mt,48:mt,49:mt,50:mt,51:mt,52:mt,53:mt,54:mt,55:mt,56:mt,57:mt,62:qm},jP={91:PN},EP={[-2]:No,[-1]:No,32:No},TP={35:ON,42:Zi,45:[_d,Zi],60:BN,61:_d,95:Zi,96:Pd,126:Pd},NP={38:Gm,92:Km},PP={[-5]:Po,[-4]:Po,[-3]:Po,33:rP,38:Gm,42:Ta,60:[sN,qN],91:sP,92:[MN,Km],93:Xl,95:Ta,96:yN},AP={null:[Ta,vP]},_P={null:[42,95]},RP={null:[]},MP=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_P,contentInitial:jP,disable:RP,document:CP,flow:TP,flowInitial:EP,insideSpan:AP,string:NP,text:PP},Symbol.toStringTag,{value:"Module"}));function DP(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:P(w),check:P(k),consume:v,enter:C,exit:j,interrupt:P(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function f(R){return o=At(o,R),y(),o[o.length-1]!==null?[]:(N(t,0),c.events=Ws(s,c.events,c),c.events)}function h(R,A){return IP(p(R),A)}function p(R){return OP(o,R)}function g(){const{_bufferIndex:R,_index:A,line:_,column:L,offset:I}=r;return{_bufferIndex:R,_index:A,line:_,column:L,offset:I}}function b(R){i[R.line]=R.column,T()}function y(){let R;for(;r._index<o.length;){const A=o[r._index];if(typeof A=="string")for(R=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===R&&r._bufferIndex<A.length;)x(A.charCodeAt(r._bufferIndex));else x(A)}}function x(R){u=u(R)}function v(R){Z(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,T()):R!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=R}function C(R,A){const _=A||{};return _.type=R,_.start=g(),c.events.push(["enter",_,c]),a.push(_),_}function j(R){const A=a.pop();return A.end=g(),c.events.push(["exit",A,c]),A}function w(R,A){N(R,A.from)}function k(R,A){A.restore()}function P(R,A){return _;function _(L,I,W){let D,$,z,S;return Array.isArray(L)?oe(L):"tokenize"in L?oe([L]):H(L);function H(U){return Le;function Le(Ce){const Re=Ce!==null&&U[Ce],ge=Ce!==null&&U.null,me=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return oe(me)(Ce)}}function oe(U){return D=U,$=0,U.length===0?W:E(U[$])}function E(U){return Le;function Le(Ce){return S=M(),z=U,U.partial||(c.currentConstruct=U),U.name&&c.parser.constructs.disable.null.includes(U.name)?X():U.tokenize.call(A?Object.assign(Object.create(c),A):c,l,K,X)(Ce)}}function K(U){return R(z,S),I}function X(U){return S.restore(),++$<D.length?E(D[$]):W}}}function N(R,A){R.resolveAll&&!s.includes(R)&&s.push(R),R.resolve&&vt(c.events,A,c.events.length-A,R.resolve(c.events.slice(A),c)),R.resolveTo&&(c.events=R.resolveTo(c.events,c))}function M(){const R=g(),A=c.previous,_=c.currentConstruct,L=c.events.length,I=Array.from(a);return{from:L,restore:W};function W(){r=R,c.previous=A,c.currentConstruct=_,c.events.length=L,a=I,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function OP(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function IP(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
307
|
+
`;break}case-3:{o=`\r
|
|
308
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function LP(e){const r={constructs:Wm([MP,...(e||{}).extensions||[]]),content:i(QT),defined:[],document:i(eN),flow:i(yP),lazy:{},string:i(wP),text:i(kP)};return r;function i(s){return o;function o(a){return DP(r,s,a)}}}function FP(e){for(;!Ym(e););return e}const Rd=/[\0\t\n\r]/g;function BP(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let c,u,f,h,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),f=0,t="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f<s.length;){if(Rd.lastIndex=f,c=Rd.exec(s),h=c&&c.index!==void 0?c.index:s.length,p=s.charCodeAt(h),!c){t=s.slice(f);break}if(p===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(s.slice(f,h)),e+=h-f),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const zP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function VP(e){return e.replace(zP,$P)}function $P(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Hm(n.slice(s?2:1),s?16:10)}return Yl(n)||e}const tg={}.hasOwnProperty;function UP(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),WP(n)(FP(LP(n).document().write(BP()(e,t,!0))))}function WP(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Y),autolinkProtocol:M,autolinkEmail:M,atxHeading:s(fe),blockQuote:s(ge),characterEscape:M,characterReference:M,codeFenced:s(me),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(me,o),codeText:s(je,o),codeTextData:M,data:M,codeFlowValue:M,definition:s(be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(de),hardBreakEscape:s(Te),hardBreakTrailing:s(Te),htmlFlow:s(nt,o),htmlFlowData:M,htmlText:s(nt,o),htmlTextData:M,image:s(Je),label:o,link:s(Y),listItem:s(ut),listItemValue:h,listOrdered:s($e,f),listUnordered:s($e),paragraph:s(Qe),reference:E,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(fe),strong:s(Ne),thematicBreak:s(Fe)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:Re,autolinkProtocol:Ce,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:U,characterReference:Le,codeFenced:l(y),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:T,codeIndented:l(x),codeText:l(I),codeTextData:T,data:T,definition:l(),definitionDestinationString:j,definitionLabelString:v,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(_),htmlFlowData:T,htmlText:l(L),htmlTextData:T,image:l(D),label:z,labelText:$,lineEnding:R,link:l(W),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:K,resourceDestinationString:S,resourceTitleString:H,resource:oe,setextHeading:l(N),setextHeadingLineSequence:P,setextHeadingText:k,strong:l(),thematicBreak:l()}};ng(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(O){let B={type:"root",children:[]};const G={stack:[B],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},J=[];let ne=-1;for(;++ne<O.length;)if(O[ne][1].type==="listOrdered"||O[ne][1].type==="listUnordered")if(O[ne][0]==="enter")J.push(ne);else{const he=J.pop();ne=i(O,he,ne)}for(ne=-1;++ne<O.length;){const he=t[O[ne][0]];tg.call(he,O[ne][1].type)&&he[O[ne][1].type].call(Object.assign({sliceSerialize:O[ne][2].sliceSerialize},G),O[ne][1])}if(G.tokenStack.length>0){const he=G.tokenStack[G.tokenStack.length-1];(he[1]||Md).call(G,void 0,he[0])}for(B.position={start:mn(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:mn(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},ne=-1;++ne<t.transforms.length;)B=t.transforms[ne](B)||B;return B}function i(O,B,G){let J=B-1,ne=-1,he=!1,Ue,We,it,Be;for(;++J<=G;){const xe=O[J];switch(xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{xe[0]==="enter"?ne++:ne--,Be=void 0;break}case"lineEndingBlank":{xe[0]==="enter"&&(Ue&&!Be&&!ne&&!it&&(it=J),Be=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Be=void 0}if(!ne&&xe[0]==="enter"&&xe[1].type==="listItemPrefix"||ne===-1&&xe[0]==="exit"&&(xe[1].type==="listUnordered"||xe[1].type==="listOrdered")){if(Ue){let He=J;for(We=void 0;He--;){const ve=O[He];if(ve[1].type==="lineEnding"||ve[1].type==="lineEndingBlank"){if(ve[0]==="exit")continue;We&&(O[We][1].type="lineEndingBlank",he=!0),ve[1].type="lineEnding",We=He}else if(!(ve[1].type==="linePrefix"||ve[1].type==="blockQuotePrefix"||ve[1].type==="blockQuotePrefixWhitespace"||ve[1].type==="blockQuoteMarker"||ve[1].type==="listItemIndent"))break}it&&(!We||it<We)&&(Ue._spread=!0),Ue.end=Object.assign({},We?O[We][1].start:xe[1].end),O.splice(We||J,0,["exit",Ue,xe[2]]),J++,G++}if(xe[1].type==="listItemPrefix"){const He={type:"listItem",_spread:!1,start:Object.assign({},xe[1].start),end:void 0};Ue=He,O.splice(J,0,["enter",He,xe[2]]),J++,G++,it=void 0,Be=!0}}}return O[B][1]._spread=he,G}function s(O,B){return G;function G(J){a.call(this,O(J),J),B&&B.call(this,J)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(O,B,G){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([B,G||void 0]),O.position={start:mn(B.start),end:void 0}}function l(O){return B;function B(G){O&&O.call(this,G),c.call(this,G)}}function c(O,B){const G=this.stack.pop(),J=this.tokenStack.pop();if(J)J[0].type!==O.type&&(B?B.call(this,O,J[0]):(J[1]||Md).call(this,O,J[0]));else throw new Error("Cannot close `"+O.type+"` ("+ei({start:O.start,end:O.end})+"): it’s not open");G.position.end=mn(O.end)}function u(){return Gl(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(O){if(this.data.expectingFirstListItemValue){const B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function p(){const O=this.resume(),B=this.stack[this.stack.length-1];B.lang=O}function g(){const O=this.resume(),B=this.stack[this.stack.length-1];B.meta=O}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/(\r?\n|\r)$/g,"")}function v(O){const B=this.resume(),G=this.stack[this.stack.length-1];G.label=B,G.identifier=Lt(this.sliceSerialize(O)).toLowerCase()}function C(){const O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function j(){const O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function w(O){const B=this.stack[this.stack.length-1];if(!B.depth){const G=this.sliceSerialize(O).length;B.depth=G}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function P(O){const B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function M(O){const G=this.stack[this.stack.length-1].children;let J=G[G.length-1];(!J||J.type!=="text")&&(J=De(),J.position={start:mn(O.start),end:void 0},G.push(J)),this.stack.push(J)}function T(O){const B=this.stack.pop();B.value+=this.sliceSerialize(O),B.position.end=mn(O.end)}function R(O){const B=this.stack[this.stack.length-1];if(this.data.atHardBreak){const G=B.children[B.children.length-1];G.position.end=mn(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(B.type)&&(M.call(this,O),T.call(this,O))}function A(){this.data.atHardBreak=!0}function _(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function L(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function I(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function W(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function D(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function $(O){const B=this.sliceSerialize(O),G=this.stack[this.stack.length-2];G.label=VP(B),G.identifier=Lt(B).toLowerCase()}function z(){const O=this.stack[this.stack.length-1],B=this.resume(),G=this.stack[this.stack.length-1];if(this.data.inReference=!0,G.type==="link"){const J=O.children;G.children=J}else G.alt=B}function S(){const O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function H(){const O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function oe(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function K(O){const B=this.resume(),G=this.stack[this.stack.length-1];G.label=B,G.identifier=Lt(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function X(O){this.data.characterReferenceType=O.type}function U(O){const B=this.sliceSerialize(O),G=this.data.characterReferenceType;let J;G?(J=Hm(B,G==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):J=Yl(B);const ne=this.stack[this.stack.length-1];ne.value+=J}function Le(O){const B=this.stack.pop();B.position.end=mn(O.end)}function Ce(O){T.call(this,O);const B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(O)}function Re(O){T.call(this,O);const B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(O)}function ge(){return{type:"blockquote",children:[]}}function me(){return{type:"code",lang:null,meta:null,value:""}}function je(){return{type:"inlineCode",value:""}}function be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function de(){return{type:"emphasis",children:[]}}function fe(){return{type:"heading",depth:0,children:[]}}function Te(){return{type:"break"}}function nt(){return{type:"html",value:""}}function Je(){return{type:"image",title:null,url:"",alt:null}}function Y(){return{type:"link",title:null,url:"",children:[]}}function $e(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function ut(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function Ne(){return{type:"strong",children:[]}}function De(){return{type:"text",value:""}}function Fe(){return{type:"thematicBreak"}}}function mn(e){return{line:e.line,column:e.column,offset:e.offset}}function ng(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ng(e,r):HP(e,r)}}function HP(e,t){let n;for(n in t)if(tg.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Md(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ei({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ei({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ei({start:t.start,end:t.end})+") is still open")}function qP(e){const t=this;t.parser=n;function n(r){return UP(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function KP(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function GP(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
309
|
+
`}]}function YP(e,t){const n=t.value?t.value+`
|
|
310
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function XP(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JP(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function QP(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ar(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function ZP(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function rg(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function tA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rg(e,t);const i={src:Ar(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function nA(e,t){const n={src:Ar(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function rA(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function iA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rg(e,t);const i={href:Ar(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function sA(e,t){const n={href:Ar(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function oA(e,t,n){const r=e.all(t),i=n?aA(n):ig(t),s={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
|
|
311
|
+
`}),u.type==="element"&&u.tagName==="p"&&!i?o.push(...u.children):o.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
|
|
312
|
+
`});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function aA(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=ig(n[r])}return t}function ig(e){const t=e.spread;return t??e.children.length>1}function lA(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function cA(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uA(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function dA(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fA(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Wl(t.children[1]),l=Lm(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function hA(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],h={},p=o?o[l]:void 0;p&&(h.align=p);let g={type:"element",tagName:s,properties:h,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function pA(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Dd=9,Od=32;function mA(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Id(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Id(t.slice(i),i>0,!1)),s.join("")}function Id(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Dd||s===Od;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Dd||s===Od;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function gA(e,t){const n={type:"text",value:mA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function xA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const yA={blockquote:KP,break:GP,code:YP,delete:XP,emphasis:JP,footnoteReference:QP,heading:ZP,html:eA,imageReference:tA,image:nA,inlineCode:rA,linkReference:iA,link:sA,listItem:oA,list:lA,paragraph:cA,root:uA,strong:dA,table:fA,tableCell:pA,tableRow:hA,text:gA,thematicBreak:xA,toml:Fi,yaml:Fi,definition:Fi,footnoteDefinition:Fi};function Fi(){}const sg=-1,Hs=0,ni=1,vs=2,Jl=3,Ql=4,Zl=5,ec=6,og=7,ag=8,Ld=typeof self=="object"?self:globalThis,bA=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Hs:case sg:return n(o,i);case ni:{const a=n([],i);for(const l of o)a.push(r(l));return a}case vs:{const a=n({},i);for(const[l,c]of o)a[r(l)]=r(c);return a}case Jl:return n(new Date(o),i);case Ql:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case Zl:{const a=n(new Map,i);for(const[l,c]of o)a.set(r(l),r(c));return a}case ec:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case og:{const{name:a,message:l}=o;return n(new Ld[a](l),i)}case ag:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new Ld[s](o),i)};return r},Fd=e=>bA(new Map,e)(0),Zn="",{toString:vA}={},{keys:wA}=Object,Br=e=>{const t=typeof e;if(t!=="object"||!e)return[Hs,t];const n=vA.call(e).slice(8,-1);switch(n){case"Array":return[ni,Zn];case"Object":return[vs,Zn];case"Date":return[Jl,Zn];case"RegExp":return[Ql,Zn];case"Map":return[Zl,Zn];case"Set":return[ec,Zn];case"DataView":return[ni,n]}return n.includes("Array")?[ni,n]:n.includes("Error")?[og,n]:[vs,n]},Bi=([e,t])=>e===Hs&&(t==="function"||t==="symbol"),kA=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=Br(o);switch(a){case Hs:{let u=o;switch(l){case"bigint":a=ag,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([sg],o)}return i([a,u],o)}case ni:{if(l){let h=o;return l==="DataView"?h=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(o)),i([l,[...h]],o)}const u=[],f=i([a,u],o);for(const h of o)u.push(s(h));return f}case vs:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const u=[],f=i([a,u],o);for(const h of wA(o))(e||!Bi(Br(o[h])))&&u.push([s(h),s(o[h])]);return f}case Jl:return i([a,o.toISOString()],o);case Ql:{const{source:u,flags:f}=o;return i([a,{source:u,flags:f}],o)}case Zl:{const u=[],f=i([a,u],o);for(const[h,p]of o)(e||!(Bi(Br(h))||Bi(Br(p))))&&u.push([s(h),s(p)]);return f}case ec:{const u=[],f=i([a,u],o);for(const h of o)(e||!Bi(Br(h)))&&u.push(s(h));return f}}const{message:c}=o;return i([a,{name:l,message:c}],o)};return s},Bd=(e,{json:t,lossy:n}={})=>{const r=[];return kA(!(t||n),!!t,new Map,r)(e),r},ws=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Fd(Bd(e,t)):structuredClone(e):(e,t)=>Fd(Bd(e,t));function SA(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function CA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function jA(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||SA,r=e.options.footnoteBackLabel||CA,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),f=String(c.identifier).toUpperCase(),h=Ar(f.toLowerCase());let p=0;const g=[],b=e.footnoteCounts.get(f);for(;b!==void 0&&++p<=b;){g.length>0&&g.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,p);typeof v=="string"&&(v={type:"text",value:v}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const v=y.children[y.children.length-1];v&&v.type==="text"?v.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else u.push(...g);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...ws(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
313
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
314
|
+
`}]}}const qs=(function(e){if(e==null)return PA;if(typeof e=="function")return Ks(e);if(typeof e=="object")return Array.isArray(e)?EA(e):TA(e);if(typeof e=="string")return NA(e);throw new Error("Expected function, string, or object as test")});function EA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=qs(e[n]);return Ks(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function TA(e){const t=e;return Ks(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function NA(e){return Ks(t);function t(n){return n&&n.type===e}}function Ks(e){return t;function t(n,r,i){return!!(AA(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function PA(){return!0}function AA(e){return e!==null&&typeof e=="object"&&"type"in e}const lg=[],_A=!0,Na=!1,RA="skip";function cg(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=qs(i),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=lg,g,b,y;if((!t||s(l,c,u[u.length-1]||void 0))&&(p=MA(n(l,u)),p[0]===Na))return p;if("children"in l&&l.children){const x=l;if(x.children&&p[0]!==RA)for(b=(r?x.children.length:-1)+o,y=u.concat(x);b>-1&&b<x.children.length;){const v=x.children[b];if(g=a(v,b,y)(),g[0]===Na)return g;b=typeof g[1]=="number"?g[1]:b+o}}return p}}}function MA(e){return Array.isArray(e)?e:typeof e=="number"?[_A,e]:e==null?lg:[e]}function tc(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),cg(e,s,a,i);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return o(l,f,u)}}const Pa={}.hasOwnProperty,DA={};function OA(e,t){const n=t||DA,r=new Map,i=new Map,s=new Map,o={...yA,...n.handlers},a={all:c,applyData:LA,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:IA,wrap:BA};return tc(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();f.has(h)||f.set(h,u)}}),a;function l(u,f){const h=u.type,p=a.handlers[h];if(Pa.call(a.handlers,h)&&p)return p(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:b,...y}=u,x=ws(y);return x.children=a.all(u),x}return ws(u)}return(a.options.unknownHandler||FA)(a,u,f)}function c(u){const f=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const g=a.one(h[p],u);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=zd(g.value)),!Array.isArray(g)&&g.type==="element")){const b=g.children[0];b&&b.type==="text"&&(b.value=zd(b.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function IA(e,t){e.position&&(t.position=CT(e))}function LA(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,ws(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function FA(e,t){const n=t.data||{},r="value"in t&&!(Pa.call(n,"hProperties")||Pa.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function BA(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
315
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
316
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
317
|
+
`}),n}function zd(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Vd(e,t){const n=OA(e,t),r=n.one(e,void 0),i=jA(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
318
|
+
`},i),s}function zA(e,t){return e&&"run"in e?async function(n,r){const i=Vd(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Vd(n,{file:r,...e||t})}}function $d(e){if(e)throw e}var Ao,Ud;function VA(){if(Ud)return Ao;Ud=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},s=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),f=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!f)return!1;var h;for(h in c);return typeof h>"u"||e.call(c,h)},o=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return Ao=function l(){var c,u,f,h,p,g,b=arguments[0],y=1,x=arguments.length,v=!1;for(typeof b=="boolean"&&(v=b,b=arguments[1]||{},y=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});y<x;++y)if(c=arguments[y],c!=null)for(u in c)f=a(b,u),h=a(c,u),b!==h&&(v&&h&&(s(h)||(p=i(h)))?(p?(p=!1,g=f&&i(f)?f:[]):g=f&&s(f)?f:{},o(b,{name:u,newValue:l(v,g,h)})):typeof h<"u"&&o(b,{name:u,newValue:h}));return b},Ao}var $A=VA();const _o=Da($A);function Aa(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function UA(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...c){const u=e[++s];let f=-1;if(l){o(l);return}for(;++f<i.length;)(c[f]===null||c[f]===void 0)&&(c[f]=i[f]);i=c,u?WA(u,a)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function WA(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const Ut={basename:HA,dirname:qA,extname:KA,join:GA,sep:"/"};function HA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ji(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function qA(e){if(ji(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function KA(e){ji(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function GA(...e){let t=-1,n;for(;++t<e.length;)ji(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":YA(n)}function YA(e){ji(e);const t=e.codePointAt(0)===47;let n=XA(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function XA(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function ji(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const JA={cwd:QA};function QA(){return"/"}function _a(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ZA(e){if(typeof e=="string")e=new URL(e);else if(!_a(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return e_(e)}function e_(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Ro=["history","path","basename","stem","extname","dirname"];class ug{constructor(t){let n;t?_a(t)?n={path:t}:typeof t=="string"||t_(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":JA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ro.length;){const s=Ro[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Ro.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ut.basename(this.path):void 0}set basename(t){Do(t,"basename"),Mo(t,"basename"),this.path=Ut.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ut.dirname(this.path):void 0}set dirname(t){Wd(this.basename,"dirname"),this.path=Ut.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ut.extname(this.path):void 0}set extname(t){if(Mo(t,"extname"),Wd(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ut.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){_a(t)&&(t=ZA(t)),Do(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ut.basename(this.path,this.extname):void 0}set stem(t){Do(t,"stem"),Mo(t,"stem"),this.path=Ut.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new ct(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Mo(e,t){if(e&&e.includes(Ut.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ut.sep+"`")}function Do(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Wd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function t_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const n_=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),r_={}.hasOwnProperty;class nc extends n_{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=UA()}copy(){const t=new nc;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(_o(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Lo("data",this.frozen),this.namespace[t]=n,this):r_.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Lo("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=zi(t),r=this.parser||this.Parser;return Oo("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Oo("process",this.parser||this.Parser),Io("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=zi(t),l=r.parse(a);r.run(l,a,function(u,f,h){if(u||!f||!h)return c(u);const p=f,g=r.stringify(p,h);o_(g)?h.value=g:h.result=g,c(u,h)});function c(u,f){u||!f?o(u):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Oo("processSync",this.parser||this.Parser),Io("processSync",this.compiler||this.Compiler),this.process(t,i),qd("processSync","process",n),r;function i(s,o){n=!0,$d(s),r=o}}run(t,n,r){Hd(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=zi(n);i.run(t,l,c);function c(u,f,h){const p=f||t;u?a(u):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),qd("runSync","run",r),i;function s(o,a){$d(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=zi(n),i=this.compiler||this.Compiler;return Io("stringify",i),Hd(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Lo("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=_o(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];s(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===c){h=f;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[p,...g]=u;const b=r[h][1];Aa(b)&&Aa(p)&&(p=_o(!0,b,p)),r[h]=[c,p,...g]}}}}const i_=new nc().freeze();function Oo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Io(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Lo(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Hd(e){if(!Aa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function qd(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function zi(e){return s_(e)?e:new ug(e)}function s_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function o_(e){return typeof e=="string"||a_(e)}function a_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const l_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Kd=[],Gd={allowDangerousHtml:!0},c_=/^(https?|ircs?|mailto|xmpp)$/i,u_=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function d_(e){const t=f_(e),n=h_(e);return p_(t.runSync(t.parse(n),n),e)}function f_(e){const t=e.rehypePlugins||Kd,n=e.remarkPlugins||Kd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gd}:Gd;return i_().use(qP).use(n).use(zA,r).use(t)}function h_(e){const t=e.children||"",n=new ug;return typeof t=="string"&&(n.value=t),n}function p_(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||m_;for(const u of u_)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+l_+u.id,void 0);return tc(e,c),PT(e,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(u,f,h){if(u.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:u.value},f;if(u.type==="element"){let p;for(p in To)if(Object.hasOwn(To,p)&&Object.hasOwn(u.properties,p)){const g=u.properties[p],b=To[p];(b===null||b.includes(u.tagName))&&(u.properties[p]=l(String(g||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):s?s.includes(u.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(u,f,h)),p&&h&&typeof f=="number")return a&&u.children?h.children.splice(f,1,...u.children):h.children.splice(f,1),f}}}function m_(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||c_.test(e.slice(0,t))?e:""}function Yd(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function g_(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function x_(e,t,n){const i=qs((n||{}).ignore||[]),s=y_(t);let o=-1;for(;++o<s.length;)cg(e,"text",a);function a(c,u){let f=-1,h;for(;++f<u.length;){const p=u[f],g=h?h.children:void 0;if(i(p,g?g.indexOf(p):void 0,h))return;h=p}if(h)return l(c,u)}function l(c,u){const f=u[u.length-1],h=s[o][0],p=s[o][1];let g=0;const y=f.children.indexOf(c);let x=!1,v=[];h.lastIndex=0;let C=h.exec(c.value);for(;C;){const j=C.index,w={index:C.index,input:C.input,stack:[...u,c]};let k=p(...C,w);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?h.lastIndex=j+1:(g!==j&&v.push({type:"text",value:c.value.slice(g,j)}),Array.isArray(k)?v.push(...k):k&&v.push(k),g=j+C[0].length,x=!0),!h.global)break;C=h.exec(c.value)}return x?(g<c.value.length&&v.push({type:"text",value:c.value.slice(g)}),f.children.splice(y,1,...v)):v=[c],y+v.length}}function y_(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([b_(i[0]),v_(i[1])])}return t}function b_(e){return typeof e=="string"?new RegExp(g_(e),"g"):e}function v_(e){return typeof e=="function"?e:function(){return e}}const Fo="phrasing",Bo=["autolink","link","image","label"];function w_(){return{transforms:[N_],enter:{literalAutolink:S_,literalAutolinkEmail:zo,literalAutolinkHttp:zo,literalAutolinkWww:zo},exit:{literalAutolink:T_,literalAutolinkEmail:E_,literalAutolinkHttp:C_,literalAutolinkWww:j_}}}function k_(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Fo,notInConstruct:Bo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Fo,notInConstruct:Bo},{character:":",before:"[ps]",after:"\\/",inConstruct:Fo,notInConstruct:Bo}]}}function S_(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function zo(e){this.config.enter.autolinkProtocol.call(this,e)}function C_(e){this.config.exit.autolinkProtocol.call(this,e)}function j_(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function E_(e){this.config.exit.autolinkEmail.call(this,e)}function T_(e){this.exit(e)}function N_(e){x_(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,P_],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),A_]],{ignore:["link","linkReference"]})}function P_(e,t,n,r,i){let s="";if(!dg(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!__(n)))return!1;const o=R_(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function A_(e,t,n,r){return!dg(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function __(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function R_(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Yd(e,"(");let s=Yd(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function dg(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Wn(n)||Us(n))&&(!t||n!==47)}fg.peek=V_;function M_(){this.buffer()}function D_(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function O_(){this.buffer()}function I_(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function L_(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function F_(e){this.exit(e)}function B_(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function z_(e){this.exit(e)}function V_(){return"["}function fg(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function $_(){return{enter:{gfmFootnoteCallString:M_,gfmFootnoteCall:D_,gfmFootnoteDefinitionLabelString:O_,gfmFootnoteDefinition:I_},exit:{gfmFootnoteCallString:L_,gfmFootnoteCall:F_,gfmFootnoteDefinitionLabelString:B_,gfmFootnoteDefinition:z_}}}function U_(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:fg},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const c=s.enter("footnoteDefinition"),u=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),u(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
|
|
319
|
+
`:" ")+s.indentLines(s.containerFlow(r,a.current()),t?hg:W_))),c(),l}}function W_(e,t,n){return t===0?e:hg(e,t,n)}function hg(e,t,n){return(n?"":" ")+e}const H_=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];pg.peek=X_;function q_(){return{canContainEols:["delete"],enter:{strikethrough:G_},exit:{strikethrough:Y_}}}function K_(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:H_}],handlers:{delete:pg}}}function G_(e){this.enter({type:"delete",children:[]},e)}function Y_(e){this.exit(e)}function pg(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function X_(){return"~"}function J_(e){return e.length}function Q_(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||J_,s=[],o=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const b=[],y=[];let x=-1;for(e[u].length>c&&(c=e[u].length);++x<e[u].length;){const v=Z_(e[u][x]);if(n.alignDelimiters!==!1){const C=i(v);y[x]=C,(l[x]===void 0||C>l[x])&&(l[x]=C)}b.push(v)}o[u]=b,a[u]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<c;)s[f]=Xd(r[f]);else{const b=Xd(r);for(;++f<c;)s[f]=b}f=-1;const h=[],p=[];for(;++f<c;){const b=s[f];let y="",x="";b===99?(y=":",x=":"):b===108?y=":":b===114&&(x=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[f]-y.length-x.length);const C=y+"-".repeat(v)+x;n.alignDelimiters!==!1&&(v=y.length+v+x.length,v>l[f]&&(l[f]=v),p[f]=v),h[f]=C}o.splice(1,0,h),a.splice(1,0,p),u=-1;const g=[];for(;++u<o.length;){const b=o[u],y=a[u];f=-1;const x=[];for(;++f<c;){const v=b[f]||"";let C="",j="";if(n.alignDelimiters!==!1){const w=l[f]-(y[f]||0),k=s[f];k===114?C=" ".repeat(w):k===99?w%2?(C=" ".repeat(w/2+.5),j=" ".repeat(w/2-.5)):(C=" ".repeat(w/2),j=C):j=" ".repeat(w)}n.delimiterStart!==!1&&!f&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||f)&&x.push(" "),n.alignDelimiters!==!1&&x.push(C),x.push(v),n.alignDelimiters!==!1&&x.push(j),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||f!==c-1)&&x.push("|")}g.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return g.join(`
|
|
320
|
+
`)}function Z_(e){return e==null?"":String(e)}function Xd(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function e2(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),t2);return i(),o}function t2(e,t,n){return">"+(n?"":" ")+e}function n2(e,t){return Jd(e,t.inConstruct,!0)&&!Jd(e,t.notInConstruct,!1)}function Jd(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Qd(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
321
|
+
`&&n2(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
322
|
+
`}function r2(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function i2(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function s2(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function o2(e,t,n,r){const i=s2(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(i2(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,a2);return f(),h}const a=n.createTracker(r),l=i.repeat(Math.max(r2(s,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const f=n.enter(`codeFencedLang${o}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
|
|
323
|
+
`,encode:["`"],...a.current()})),f()}return u+=a.move(`
|
|
324
|
+
`),s&&(u+=a.move(s+`
|
|
325
|
+
`)),u+=a.move(l),c(),u}function a2(e,t,n){return(n?"":" ")+e}function rc(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function l2(e,t,n,r){const i=rc(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
|
|
326
|
+
`,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),o(),c}function c2(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function fi(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ks(e,t,n){const r=vr(e),i=vr(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}mg.peek=u2;function mg(e,t,n,r){const i=c2(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=ks(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=fi(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=ks(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+fi(f));const p=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}function u2(e,t,n){return n.options.emphasis||"*"}function d2(e,t){let n=!1;return tc(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Na}),!!((!e.depth||e.depth<3)&&Gl(e)&&(t.options.setext||n))}function f2(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(d2(e,n)){const u=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
|
|
327
|
+
`,after:`
|
|
328
|
+
`});return f(),u(),h+`
|
|
329
|
+
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
330
|
+
`))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
331
|
+
`,...s.current()});return/^[\t ]/.test(c)&&(c=fi(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}gg.peek=h2;function gg(e){return e.value||""}function h2(){return"<"}xg.peek=p2;function xg(e,t,n,r){const i=rc(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),o(),c}function p2(){return"!"}yg.peek=m2;function yg(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function m2(){return"!"}bg.peek=g2;function bg(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function g2(){return"`"}function vg(e,t){const n=Gl(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}wg.peek=x2;function wg(e,t,n,r){const i=rc(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(vg(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),a(),n.stack=u,f}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),a(),c}function x2(e,t,n){return vg(e,n)?"<":"["}kg.peek=y2;function kg(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function y2(){return"["}function ic(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function b2(e){const t=ic(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function v2(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Sg(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function w2(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?v2(n):ic(n);const a=e.ordered?o==="."?")":".":b2(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Sg(n)===o&&u){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),c}function k2(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function S2(e,t,n,r){const i=k2(n);let s=n.bulletCurrent||ic(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(f,h,p){return h?(p?"":" ".repeat(o))+f:(p?s:s+" ".repeat(o-s.length))+f}}function C2(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const j2=qs(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function E2(e,t,n,r){return(e.children.some(function(o){return j2(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function T2(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Cg.peek=N2;function Cg(e,t,n,r){const i=T2(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=ks(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=fi(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=ks(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+fi(f));const p=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}function N2(e,t,n){return n.options.strong||"*"}function P2(e,t,n,r){return n.safe(e.value,r)}function A2(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function _2(e,t,n){const r=(Sg(n)+(n.options.ruleSpaces?" ":"")).repeat(A2(n));return n.options.ruleSpaces?r.slice(0,-1):r}const jg={blockquote:e2,break:Qd,code:o2,definition:l2,emphasis:mg,hardBreak:Qd,heading:f2,html:gg,image:xg,imageReference:yg,inlineCode:bg,link:wg,linkReference:kg,list:w2,listItem:S2,paragraph:C2,root:E2,strong:Cg,text:P2,thematicBreak:_2};function R2(){return{enter:{table:M2,tableData:Zd,tableHeader:Zd,tableRow:O2},exit:{codeText:I2,table:D2,tableData:Vo,tableHeader:Vo,tableRow:Vo}}}function M2(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function D2(e){this.exit(e),this.data.inTable=void 0}function O2(e){this.enter({type:"tableRow",children:[]},e)}function Vo(e){this.exit(e)}function Zd(e){this.enter({type:"tableCell",children:[]},e)}function I2(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,L2));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function L2(e,t){return t==="|"?t:e}function F2(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
332
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:l,tableRow:a}};function o(p,g,b,y){return c(u(p,b,y),p.align)}function a(p,g,b,y){const x=f(p,b,y),v=c([x]);return v.slice(0,v.indexOf(`
|
|
333
|
+
`))}function l(p,g,b,y){const x=b.enter("tableCell"),v=b.enter("phrasing"),C=b.containerPhrasing(p,{...y,before:s,after:s});return v(),x(),C}function c(p,g){return Q_(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function u(p,g,b){const y=p.children;let x=-1;const v=[],C=g.enter("table");for(;++x<y.length;)v[x]=f(y[x],g,b);return C(),v}function f(p,g,b){const y=p.children;let x=-1;const v=[],C=g.enter("tableRow");for(;++x<y.length;)v[x]=l(y[x],p,g,b);return C(),v}function h(p,g,b){let y=jg.inlineCode(p,g,b);return b.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function B2(){return{exit:{taskListCheckValueChecked:ef,taskListCheckValueUnchecked:ef,paragraph:V2}}}function z2(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:$2}}}function ef(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function V2(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function $2(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=jg.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+o}}function U2(){return[w_(),$_(),q_(),R2(),B2()]}function W2(e){return{extensions:[k_(),U_(e),K_(),F2(e),z2()]}}const H2={tokenize:J2,partial:!0},Eg={tokenize:Q2,partial:!0},Tg={tokenize:Z2,partial:!0},Ng={tokenize:eR,partial:!0},q2={tokenize:tR,partial:!0},Pg={name:"wwwAutolink",tokenize:Y2,previous:_g},Ag={name:"protocolAutolink",tokenize:X2,previous:Rg},ln={name:"emailAutolink",tokenize:G2,previous:Mg},Xt={};function K2(){return{text:Xt}}let On=48;for(;On<123;)Xt[On]=ln,On++,On===58?On=65:On===91&&(On=97);Xt[43]=ln;Xt[45]=ln;Xt[46]=ln;Xt[95]=ln;Xt[72]=[ln,Ag];Xt[104]=[ln,Ag];Xt[87]=[ln,Pg];Xt[119]=[ln,Pg];function G2(e,t,n){const r=this;let i,s;return o;function o(f){return!Ra(f)||!Mg.call(r,r.previous)||sc(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return Ra(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(q2,u,c)(f):f===45||f===95||lt(f)?(s=!0,e.consume(f),l):u(f)}function c(f){return e.consume(f),i=!0,l}function u(f){return s&&i&&ft(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function Y2(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!_g.call(r,r.previous)||sc(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(H2,e.attempt(Eg,e.attempt(Tg,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function X2(e,t,n){const r=this;let i="",s=!1;return o;function o(f){return(f===72||f===104)&&Rg.call(r,r.previous)&&!sc(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(ft(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),s?c:(s=!0,l)):n(f)}function c(f){return f===null||bs(f)||Se(f)||Wn(f)||Us(f)?n(f):e.attempt(Eg,e.attempt(Tg,u),n)(f)}function u(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function J2(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function Q2(e,t,n){let r,i,s;return o;function o(c){return c===46||c===95?e.check(Ng,l,a)(c):c===null||Se(c)||Wn(c)||c!==45&&Us(c)?l(c):(s=!0,e.consume(c),o)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),o}function l(c){return i||r||!s?n(c):t(c)}}function Z2(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Ng,t,s)(o):o===null||Se(o)||Wn(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function eR(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||Se(a)||Wn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Se(a)||Wn(a)?t(a):r(a)}function s(a){return ft(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):ft(a)?(e.consume(a),o):n(a)}}function tR(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return lt(s)?n(s):t(s)}}function _g(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Se(e)}function Rg(e){return!ft(e)}function Mg(e){return!(e===47||Ra(e))}function Ra(e){return e===43||e===45||e===46||e===95||lt(e)}function sc(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const nR={tokenize:uR,partial:!0};function rR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:aR,continuation:{tokenize:lR},exit:cR}},text:{91:{name:"gfmFootnoteCall",tokenize:oR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:iR,resolveTo:sR}}}}function iR(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=Lt(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function sR(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function oR(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(s>999||f===93&&!o||f===null||f===91||Se(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Lt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Se(f)||(o=!0),s++,e.consume(f),f===92?u:c}function u(f){return f===91||f===92||f===93?(e.consume(f),s++,c):c(f)}}function aR(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(g)}function u(g){if(o>999||g===93&&!a||g===null||g===91||Se(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=Lt(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Se(g)||(a=!0),o++,e.consume(g),g===92?f:u}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,u):u(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),ue(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function lR(e,t,n){return e.check(Ci,t,e.attempt(nR,t,n))}function cR(e){e.exit("gfmFootnoteDefinition")}function uR(e,t,n){const r=this;return ue(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function dR(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},f={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},h=[["enter",u,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",f,a]],p=a.parser.constructs.insideSpan.null;p&&vt(h,h.length,0,Ws(p,o.slice(c+1,l),a)),vt(h,h.length,0,[["exit",f,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",u,a]]),vt(o,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const c=this.previous,u=this.events;let f=0;return h;function h(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(o.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const b=vr(c);if(g===126)return f>1?l(g):(o.consume(g),f++,p);if(f<2&&!n)return l(g);const y=o.exit("strikethroughSequenceTemporary"),x=vr(g);return y._open=!x||x===2&&!!b,y._close=!b||b===2&&!!x,a(g)}}}class fR{constructor(){this.map=[]}add(t,n,r){hR(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function hR(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function pR(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function mR(){return{flow:{null:{name:"table",tokenize:gR,resolveAll:xR}}}}function gR(e,t,n){const r=this;let i=0,s=0,o;return a;function a(T){let R=r.events.length-1;for(;R>-1;){const L=r.events[R][1].type;if(L==="lineEnding"||L==="linePrefix")R--;else break}const A=R>-1?r.events[R][1].type:null,_=A==="tableHead"||A==="tableRow"?k:l;return _===k&&r.parser.lazy[r.now().line]?n(T):_(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),c(T)}function c(T){return T===124||(o=!0,s+=1),u(T)}function u(T){return T===null?n(T):Z(T)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),p):n(T):ae(T)?ue(e,u,"whitespace")(T):(s+=1,o&&(o=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||Se(T)?(e.exit("data"),u(T)):(e.consume(T),T===92?h:f)}function h(T){return T===92||T===124?(e.consume(T),f):f(T)}function p(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,ae(T)?ue(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):g(T))}function g(T){return T===45||T===58?y(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),b):w(T)}function b(T){return ae(T)?ue(e,y,"whitespace")(T):y(T)}function y(T){return T===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):T===45?(s+=1,x(T)):T===null||Z(T)?j(T):w(T)}function x(T){return T===45?(e.enter("tableDelimiterFiller"),v(T)):w(T)}function v(T){return T===45?(e.consume(T),v):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(T))}function C(T){return ae(T)?ue(e,j,"whitespace")(T):j(T)}function j(T){return T===124?g(T):T===null||Z(T)?!o||i!==s?w(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):w(T)}function w(T){return n(T)}function k(T){return e.enter("tableRow"),P(T)}function P(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),P):T===null||Z(T)?(e.exit("tableRow"),t(T)):ae(T)?ue(e,P,"whitespace")(T):(e.enter("data"),N(T))}function N(T){return T===null||T===124||Se(T)?(e.exit("data"),P(T)):(e.consume(T),T===92?M:N)}function M(T){return T===92||T===124?(e.consume(T),N):N(T)}}function xR(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,u,f;const h=new fR;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(a=!1,l!==0&&(tf(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])),i=g.type==="tableDelimiterRow"?2:u?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],f=Vi(h,t,s,i,void 0,f),s=[0,0,0,0]),o[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],f=Vi(h,t,s,i,void 0,f)),s=o,o=[s[1],n,0,0])):g.type==="tableHead"?(a=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],f=Vi(h,t,s,i,n,f)):o[1]!==0&&(f=Vi(h,t,o,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&tf(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=pR(t.events,n))}return e}function Vi(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},tr(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=tr(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=tr(t.events,n[2]),u=tr(t.events,n[3]),f={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;e.add(g,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(s.end=Object.assign({},tr(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function tf(e,t,n,r,i){const s=[],o=tr(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function tr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const yR={name:"tasklistCheck",tokenize:vR};function bR(){return{text:{91:yR}}}function vR(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return Se(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return Z(l)?t(l):ae(l)?e.check({tokenize:wR},t,n)(l):n(l)}}function wR(e,t,n){return ue(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function kR(e){return Wm([K2(),rR(),dR(e),mR(),bR()])}const SR={};function CR(e){const t=this,n=e||SR,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(kR(n)),s.push(U2()),o.push(W2(n))}function Dg({content:e,className:t}){return d.jsx("div",{className:F("space-y-4 text-[13px] leading-[1.7]",t),children:d.jsx(d_,{remarkPlugins:[CR],components:{h1:({children:n})=>d.jsx("h1",{className:"text-base font-semibold text-foreground border-b border-border pb-2 mb-3",children:n}),h2:({children:n})=>d.jsx("h2",{className:"text-sm font-semibold text-foreground mt-6 mb-2 border-b border-border/50 pb-1.5",children:n}),h3:({children:n})=>d.jsx("h3",{className:"text-[13px] font-semibold text-foreground mt-5 mb-1.5",children:n}),h4:({children:n})=>d.jsx("h4",{className:"text-[13px] font-medium text-foreground/90 mt-4 mb-1",children:n}),p:({children:n})=>d.jsx("p",{className:"text-foreground/70 mb-2",children:n}),a:({href:n,children:r})=>d.jsx("a",{href:n,className:"text-accent-blue hover:text-accent-blue/80 underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:r}),ul:({children:n})=>d.jsx("ul",{className:"ml-5 space-y-1.5 list-disc text-foreground/70 marker:text-muted-foreground",children:n}),ol:({children:n})=>d.jsx("ol",{className:"ml-5 space-y-1.5 list-decimal text-foreground/70 marker:text-muted-foreground",children:n}),li:({children:n,...r})=>{var s,o;const i=(o=(s=r.node)==null?void 0:s.properties)==null?void 0:o.className;return i&&String(i).includes("task-list-item")?d.jsx("li",{className:"list-none ml-[-1.25rem] flex items-start gap-2",children:n}):d.jsx("li",{className:"pl-1",children:n})},input:({checked:n})=>d.jsx("input",{type:"checkbox",checked:n,readOnly:!0,className:"mt-1 h-3.5 w-3.5 rounded border-border accent-primary"}),code:({children:n,className:r})=>(r==null?void 0:r.startsWith("language-"))?d.jsx("code",{className:F("block rounded p-3 font-mono text-xxs overflow-x-auto","bg-[#0d0d14] border border-border/50",r),children:n}):d.jsx("code",{className:"bg-[#0d0d14] border border-border/30 rounded px-1.5 py-0.5 font-mono text-xxs text-accent-blue/90",children:n}),pre:({children:n})=>d.jsx("pre",{className:"overflow-x-auto my-3",children:n}),blockquote:({children:n})=>d.jsx("blockquote",{className:"border-l-2 border-accent-blue/40 pl-4 py-1 text-foreground/60 italic bg-surface/50 rounded-r",children:n}),table:({children:n})=>d.jsx("div",{className:"overflow-x-auto my-3 rounded border border-border",children:d.jsx("table",{className:"w-full text-xs",children:n})}),thead:({children:n})=>d.jsx("thead",{className:"bg-[#0d0d14] text-muted-foreground",children:n}),tr:({children:n})=>d.jsx("tr",{className:"border-b border-border/50 even:bg-surface/30",children:n}),th:({children:n})=>d.jsx("th",{className:"px-3 py-2 text-left text-xxs font-medium uppercase tracking-wider",children:n}),td:({children:n})=>d.jsx("td",{className:"px-3 py-2 text-foreground/70",children:n}),hr:()=>d.jsx("hr",{className:"border-border/50 my-4"}),strong:({children:n})=>d.jsx("strong",{className:"font-semibold text-foreground",children:n})},children:e})})}const Og=6048e5,jR=864e5,sO=43200,oO=1440,nf=Symbol.for("constructDateFrom");function Cn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&nf in e?e[nf](t):e instanceof Date?new e.constructor(t):new Date(t)}function Bt(e,t){return Cn(t||e,e)}let ER={};function Gs(){return ER}function hi(e,t){var a,l,c,u;const n=Gs(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,i=Bt(e,t==null?void 0:t.in),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Ss(e,t){return hi(e,{...t,weekStartsOn:1})}function Ig(e,t){const n=Bt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Cn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=Ss(i),o=Cn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=Ss(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function rf(e){const t=Bt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function TR(e,...t){const n=Cn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function sf(e,t){const n=Bt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function NR(e,t,n){const[r,i]=TR(n==null?void 0:n.in,e,t),s=sf(r),o=sf(i),a=+s-rf(s),l=+o-rf(o);return Math.round((a-l)/jR)}function PR(e,t){const n=Ig(e,t),r=Cn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ss(r)}function AR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _R(e){return!(!AR(e)&&typeof e!="number"||isNaN(+Bt(e)))}function RR(e,t){const n=Bt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const MR={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},DR=(e,t,n)=>{let r;const i=MR[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function $o(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const OR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},IR={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},LR={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},FR={date:$o({formats:OR,defaultWidth:"full"}),time:$o({formats:IR,defaultWidth:"full"}),dateTime:$o({formats:LR,defaultWidth:"full"})},BR={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zR=(e,t,n,r)=>BR[e];function zr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const VR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$R={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},UR={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},WR={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},HR={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},qR={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},KR=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},GR={ordinalNumber:KR,era:zr({values:VR,defaultWidth:"wide"}),quarter:zr({values:$R,defaultWidth:"wide",argumentCallback:e=>e-1}),month:zr({values:UR,defaultWidth:"wide"}),day:zr({values:WR,defaultWidth:"wide"}),dayPeriod:zr({values:HR,defaultWidth:"wide",formattingValues:qR,defaultFormattingWidth:"wide"})};function Vr(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?XR(a,f=>f.test(o)):YR(a,f=>f.test(o));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function YR(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function XR(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function JR(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const QR=/^(\d+)(th|st|nd|rd)?/i,ZR=/\d+/i,eM={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},tM={any:[/^b/i,/^(a|c)/i]},nM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rM={any:[/1/i,/2/i,/3/i,/4/i]},iM={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},sM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},oM={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},aM={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},lM={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},cM={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},uM={ordinalNumber:JR({matchPattern:QR,parsePattern:ZR,valueCallback:e=>parseInt(e,10)}),era:Vr({matchPatterns:eM,defaultMatchWidth:"wide",parsePatterns:tM,defaultParseWidth:"any"}),quarter:Vr({matchPatterns:nM,defaultMatchWidth:"wide",parsePatterns:rM,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Vr({matchPatterns:iM,defaultMatchWidth:"wide",parsePatterns:sM,defaultParseWidth:"any"}),day:Vr({matchPatterns:oM,defaultMatchWidth:"wide",parsePatterns:aM,defaultParseWidth:"any"}),dayPeriod:Vr({matchPatterns:lM,defaultMatchWidth:"any",parsePatterns:cM,defaultParseWidth:"any"})},dM={code:"en-US",formatDistance:DR,formatLong:FR,formatRelative:zR,localize:GR,match:uM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function fM(e,t){const n=Bt(e,t==null?void 0:t.in);return NR(n,RR(n))+1}function hM(e,t){const n=Bt(e,t==null?void 0:t.in),r=+Ss(n)-+PR(n);return Math.round(r/Og)+1}function Lg(e,t){var u,f,h,p;const n=Bt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Gs(),s=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(h=i.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=Cn((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=hi(o,t),l=Cn((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=hi(l,t);return+n>=+a?r+1:+n>=+c?r:r-1}function pM(e,t){var a,l,c,u;const n=Gs(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,i=Lg(e,t),s=Cn((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),hi(s,t)}function mM(e,t){const n=Bt(e,t==null?void 0:t.in),r=+hi(n,t)-+pM(n,t);return Math.round(r/Og)+1}function ye(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const gn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ye(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ye(n+1,2)},d(e,t){return ye(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ye(e.getHours()%12||12,t.length)},H(e,t){return ye(e.getHours(),t.length)},m(e,t){return ye(e.getMinutes(),t.length)},s(e,t){return ye(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return ye(i,t.length)}},er={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},of={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return gn.y(e,t)},Y:function(e,t,n,r){const i=Lg(e,r),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return ye(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):ye(s,t.length)},R:function(e,t){const n=Ig(e);return ye(n,t.length)},u:function(e,t){const n=e.getFullYear();return ye(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ye(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ye(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return gn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ye(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=mM(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):ye(i,t.length)},I:function(e,t,n){const r=hM(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ye(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):gn.d(e,t)},D:function(e,t,n){const r=fM(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ye(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ye(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ye(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return ye(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=er.noon:r===0?i=er.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=er.evening:r>=12?i=er.afternoon:r>=4?i=er.morning:i=er.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return gn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):gn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ye(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ye(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):gn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):gn.s(e,t)},S:function(e,t){return gn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return lf(r);case"XXXX":case"XX":return Bn(r);case"XXXXX":case"XXX":default:return Bn(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return lf(r);case"xxxx":case"xx":return Bn(r);case"xxxxx":case"xxx":default:return Bn(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+af(r,":");case"OOOO":default:return"GMT"+Bn(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+af(r,":");case"zzzz":default:return"GMT"+Bn(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ye(r,t.length)},T:function(e,t,n){return ye(+e,t.length)}};function af(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+ye(s,2)}function lf(e,t){return e%60===0?(e>0?"-":"+")+ye(Math.abs(e)/60,2):Bn(e,t)}function Bn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=ye(Math.trunc(r/60),2),s=ye(r%60,2);return n+i+t+s}const cf=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Fg=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},gM=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return cf(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",cf(r,t)).replace("{{time}}",Fg(i,t))},xM={p:Fg,P:gM},yM=/^D+$/,bM=/^Y+$/,vM=["D","DD","YY","YYYY"];function wM(e){return yM.test(e)}function kM(e){return bM.test(e)}function SM(e,t,n){const r=CM(e,t,n);if(console.warn(r),vM.includes(e))throw new RangeError(r)}function CM(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const jM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,EM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,TM=/^'([^]*?)'?$/,NM=/''/g,PM=/[a-zA-Z]/;function $i(e,t,n){var u,f,h,p;const r=Gs(),i=r.locale??dM,s=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,o=r.weekStartsOn??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,a=Bt(e,n==null?void 0:n.in);if(!_R(a))throw new RangeError("Invalid time value");let l=t.match(EM).map(g=>{const b=g[0];if(b==="p"||b==="P"){const y=xM[b];return y(g,i.formatLong)}return g}).join("").match(jM).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const b=g[0];if(b==="'")return{isToken:!1,value:AM(g)};if(of[b])return{isToken:!0,value:g};if(b.match(PM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:g}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(g=>{if(!g.isToken)return g.value;const b=g.value;(kM(b)||wM(b))&&SM(b,t,String(e));const y=of[b[0]];return y(a,b,i.localize,c)}).join("")}function AM(e){const t=e.match(TM);return t?t[1].replace(NM,"'"):e}const _M={createScope:"Created",reviewScope:"Reviewed",implementScope:"Implemented",verifyScope:"Verified",commit:"Committed",pushToMain:"Pushed to Main",pushToDev:"Pushed to Dev",pushToStaging:"PR to Staging",pushToProduction:"PR to Production"};function Ui(e){return e?_M[e]??e:null}function RM({sessions:e,loading:t}){const n=Yt(),[r,i]=m.useState(null),[s,o]=m.useState(null),[a,l]=m.useState(!1),[c,u]=m.useState(!1),f=m.useRef();m.useEffect(()=>()=>{clearTimeout(f.current)},[]);const h=m.useCallback(async g=>{i(g),l(!0);try{const b=await fetch(n(`/sessions/${g.id}/content`));b.ok&&o(await b.json())}catch{}finally{l(!1)}},[n]),p=m.useCallback(async()=>{const g=r==null?void 0:r.claude_session_id;if(g){u(!0);try{await fetch(n(`/sessions/${r.id}/resume`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({claude_session_id:g})})}catch{}finally{f.current=setTimeout(()=>u(!1),2e3)}}},[r,n]);if(t)return d.jsx("div",{className:"flex h-32 items-center justify-center",children:d.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent"})});if(r){const g=Array.isArray(r.discoveries)?r.discoveries:[],b=Array.isArray(r.next_steps)?r.next_steps:[],y=!!r.claude_session_id,x=(s==null?void 0:s.meta)??null,v=(x==null?void 0:x.summary)??r.summary??null,C=v?uf(v,100):null;return d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2 pb-3",children:[d.jsx(ke,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{i(null),o(null)},children:d.jsx(Cb,{className:"h-4 w-4"})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-xxs text-muted-foreground",children:r.started_at&&$i(new Date(r.started_at),"MMM d, yyyy")}),d.jsx("p",{className:"truncate text-sm font-light",children:C||"Untitled Session"})]})]}),d.jsx(ys,{className:"mb-3"}),d.jsx(hr,{className:"flex-1 -mr-2 pr-2",children:a?d.jsx("div",{className:"flex h-20 items-center justify-center",children:d.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):d.jsx("table",{className:"w-full text-xs",children:d.jsxs("tbody",{className:"[&_td]:border-b [&_td]:border-border/30 [&_td]:py-2 [&_td]:align-top [&_td:first-child]:pr-3 [&_td:first-child]:text-muted-foreground [&_td:first-child]:whitespace-nowrap",children:[d.jsxs("tr",{children:[d.jsx("td",{children:"Scope"}),d.jsx("td",{children:r.scope_id})]}),Ui(r.action)&&d.jsxs("tr",{children:[d.jsx("td",{children:"Action"}),d.jsx("td",{children:Ui(r.action)})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Summary"}),d.jsx("td",{children:r.summary?uf(r.summary,200):"—"})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Started"}),d.jsx("td",{children:r.started_at?$i(new Date(r.started_at),"MMM d, h:mm a"):"—"})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Ended"}),d.jsx("td",{children:r.ended_at?$i(new Date(r.ended_at),"MMM d, h:mm a"):"—"})]}),x&&d.jsxs(d.Fragment,{children:[x.branch&&x.branch!=="unknown"&&d.jsxs("tr",{children:[d.jsx("td",{children:"Branch"}),d.jsx("td",{className:"font-mono text-xxs",children:x.branch})]}),x.fileSize>0&&d.jsxs("tr",{children:[d.jsx("td",{children:"File size"}),d.jsx("td",{children:MM(x.fileSize)})]}),d.jsxs("tr",{children:[d.jsx("td",{children:"Plan"}),d.jsx("td",{className:"text-muted-foreground",children:x.slug})]})]}),r.handoff_file&&d.jsxs("tr",{children:[d.jsx("td",{children:"Handoff"}),d.jsx("td",{className:"font-mono text-xxs",children:r.handoff_file})]}),g.length>0&&d.jsxs("tr",{children:[d.jsx("td",{children:"Completed"}),d.jsx("td",{children:d.jsx("ul",{className:"space-y-0.5",children:g.map(j=>d.jsxs("li",{className:"text-muted-foreground",children:[d.jsx("span",{className:"text-bid-green mr-1",children:"•"}),j]},j))})})]}),b.length>0&&d.jsxs("tr",{children:[d.jsx("td",{children:"Next steps"}),d.jsx("td",{children:d.jsx("ul",{className:"space-y-0.5",children:b.map(j=>d.jsxs("li",{className:"text-muted-foreground",children:[d.jsx("span",{className:"text-accent-blue mr-1",children:"•"}),j]},j))})})]}),r.claude_session_id&&d.jsxs("tr",{children:[d.jsx("td",{children:"Session ID"}),d.jsx("td",{className:"font-mono text-xxs text-muted-foreground",children:r.claude_session_id})]})]})})}),d.jsxs("div",{className:"pt-3",children:[d.jsxs(ke,{className:"w-full",disabled:!y||c,onClick:p,title:y?"Open in iTerm":"No Claude Code session found",children:[d.jsx(Ns,{className:"mr-2 h-4 w-4"}),c?"Opening iTerm...":"Resume Session"]}),!y&&d.jsx("p",{className:"mt-1.5 text-center text-xs text-muted-foreground",children:"No matching Claude Code session found"})]})]})}return d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2 pb-3",children:[d.jsx("h3",{className:"text-xs font-normal",children:"Sessions"}),d.jsx(Ve,{variant:"secondary",className:"text-xxs",children:e.length})]}),e.length===0?d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx("p",{className:"text-xs text-muted-foreground",children:"No sessions recorded yet"})}):d.jsx(hr,{className:"flex-1 -mr-2 pr-2",children:d.jsx("div",{className:"space-y-2",children:e.map(g=>{const b=Array.isArray(g.discoveries)?g.discoveries:[],y=Array.isArray(g.next_steps)?g.next_steps:[];return d.jsx(zl,{className:F("cursor-pointer transition-colors hover:border-primary/30",g.claude_session_id&&"border-l-2 border-l-primary/50","glow-blue-sm"),onClick:()=>h(g),children:d.jsxs(Vl,{className:"p-2.5",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-xxs text-muted-foreground",children:g.started_at&&$i(new Date(g.started_at),"MMM d")}),Ui(g.action)&&d.jsx(Ve,{variant:"outline",className:"text-xxs px-1 py-0 font-light",children:Ui(g.action)})]}),d.jsx(ri,{className:"h-3.5 w-3.5 text-muted-foreground/50"})]}),d.jsx("p",{className:"mt-1 truncate text-xs font-normal",children:g.summary||"Untitled Session"}),d.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-xxs text-muted-foreground",children:[b.length>0&&d.jsxs("span",{className:"text-bid-green",children:[b.length," completed"]}),y.length>0&&d.jsxs("span",{className:"text-accent-blue",children:[y.length," next"]}),g.claude_session_id&&d.jsx("span",{className:"text-primary/70",children:"resumable"})]})]})},g.id)})})})]})}function uf(e,t){return e.length>t?e.slice(0,t)+"...":e}function MM(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function DM({title:e,defaultOpen:t=!0,badge:n,children:r,className:i}){const[s,o]=m.useState(t);return d.jsxs("div",{className:F("border-b border-border/50 last:border-b-0",i),children:[d.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-4 py-2 text-left text-xs font-medium text-foreground/80 hover:text-foreground transition-colors",onClick:()=>o(a=>!a),"aria-expanded":s,children:[d.jsx(ri,{className:F("h-3.5 w-3.5 shrink-0 transition-transform duration-200",s&&"rotate-90")}),d.jsx("span",{className:"flex-1 truncate",children:e}),n&&d.jsx("span",{className:"shrink-0",children:n})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:s?"1fr":"0fr"},children:d.jsx("div",{className:"overflow-hidden",children:d.jsx("div",{className:"px-4 pb-3",children:r})})})]})}function vn({content:e}){return d.jsx(Dg,{content:e,className:"section-markdown"})}function OM({meta:e,content:t}){const n=e.total>0?e.done/e.total*100:0;return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"h-1.5 flex-1 rounded-full bg-muted",children:d.jsx("div",{className:F("h-full rounded-full transition-all duration-500",n===100?"bg-bid-green":"bg-accent-blue"),style:{width:`${n}%`}})}),d.jsxs("span",{className:"text-xxs text-muted-foreground",children:[e.done,"/",e.total]})]}),d.jsx("div",{className:"space-y-1",children:e.phases.map((r,i)=>{const s=/⏳|in.?progress|pending/i.test(r.status)&&!r.done;return d.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1 text-xxs",children:[r.done?d.jsx(Db,{className:"h-3 w-3 shrink-0 text-bid-green"}):s?d.jsx(Va,{className:"h-3 w-3 shrink-0 text-accent-blue animate-spin"}):d.jsx(Fb,{className:"h-3 w-3 shrink-0 text-muted-foreground/40"}),d.jsx("span",{className:"font-mono text-muted-foreground/50 w-4",children:r.name}),d.jsx("span",{className:F("flex-1",r.done?"text-muted-foreground":"text-foreground/80"),children:r.description})]},i)})}),t.split(`
|
|
334
|
+
`).some(r=>r.trim()&&!/^\|/.test(r.trim()))&&d.jsx("div",{className:"pt-1",children:d.jsx(vn,{content:t.split(`
|
|
335
|
+
`).filter(r=>!r.trim().startsWith("|")).join(`
|
|
336
|
+
`).trim()})})]})}function IM({meta:e,content:t}){const n=[];let r=null,i=0;for(const s of t.split(`
|
|
337
|
+
`)){const o=s.match(/^####\s+(.+)/);if(o){r=o[1].trim();continue}if(s.match(/^[\s]*-\s+\[([ xX])\]\s+(.*)/)){const c=e.items[i];if(c){const u=n[n.length-1];!u||u.heading!==r?n.push({heading:r,items:[{text:c.text,checked:c.checked}]}):u.items.push({text:c.text,checked:c.checked}),i++}continue}const l=s.match(/^[\s]*-\s+(.+)/);if(l){const c=n[n.length-1],u={text:l[1].trim(),checked:null};!c||c.heading!==r?n.push({heading:r,items:[u]}):c.items.push(u)}}return n.length===0&&e.items.length>0&&n.push({heading:null,items:e.items.map(s=>({text:s.text,checked:s.checked}))}),d.jsx("div",{className:"space-y-3",children:n.map((s,o)=>d.jsxs("div",{children:[s.heading&&d.jsx("p",{className:"mb-1.5 text-xxs font-medium uppercase tracking-wide text-muted-foreground/70",children:s.heading}),d.jsx("div",{className:"space-y-0.5",children:s.items.map((a,l)=>d.jsxs("div",{className:F("flex items-start gap-2 rounded px-1 py-0.5 text-xxs",a.checked===!0&&"opacity-50"),children:[a.checked===!0?d.jsx(R0,{className:"mt-0.5 h-3 w-3 shrink-0 text-bid-green"}):a.checked===!1?d.jsx(D0,{className:"mt-0.5 h-3 w-3 shrink-0 text-muted-foreground/40"}):d.jsx(Ib,{className:"mt-0.5 h-3 w-3 shrink-0 text-muted-foreground/30"}),d.jsx("span",{className:F("text-foreground/80",a.checked===!0&&"line-through text-muted-foreground",a.checked===null&&"text-muted-foreground"),children:a.text})]},l))})]},o))})}function LM({content:e}){const t=e.replace(/^>\s*/gm,"").replace(/\n/g," ").trim(),n=t.split("|").map(i=>i.trim()).filter(Boolean),r=[];for(const i of n){const s=i.match(/\*\*(.+?)\*\*[:\s]*(.+)/);s&&r.push({label:s[1].trim(),value:s[2].trim()})}return r.length===0?d.jsx("p",{className:"text-xxs text-muted-foreground",children:t}):d.jsx("div",{className:"flex flex-wrap items-center gap-2",children:r.map(({label:i,value:s})=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-xxs text-muted-foreground",children:i}),d.jsx(Ve,{variant:"outline",className:"h-5 px-1.5 text-xxs",children:s})]},i))})}function FM({meta:e,content:t}){return d.jsxs("div",{className:"space-y-3",children:[e&&d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.verdict&&d.jsx(Ve,{variant:"outline",className:e.verdict.toUpperCase()==="PASS"?"border-bid-green/40 bg-bid-green/10 text-bid-green":"border-ask-red/40 bg-ask-red/10 text-ask-red",children:e.verdict}),e.blockers>0&&d.jsxs(Ve,{variant:"outline",className:"border-ask-red/40 bg-ask-red/10 text-ask-red",children:[e.blockers," blocker",e.blockers!==1?"s":""]}),e.warnings>0&&d.jsxs(Ve,{variant:"outline",className:"border-warning-amber/40 bg-warning-amber/10 text-warning-amber",children:[e.warnings," warning",e.warnings!==1?"s":""]}),e.suggestions>0&&d.jsxs(Ve,{variant:"outline",className:"border-accent-blue/40 bg-accent-blue/10 text-accent-blue",children:[e.suggestions," suggestion",e.suggestions!==1?"s":""]})]}),d.jsx(vn,{content:t})]})}function BM({content:e}){const t=e.split(`
|
|
338
|
+
`).filter(o=>o.trim().startsWith("|"));if(t.length<2)return d.jsx(vn,{content:e});const n=o=>o.split("|").map(a=>a.trim()).filter(Boolean),r=n(t[0]),i=t.slice(2).map(n);if(r.length===0)return d.jsx(vn,{content:e});const s=e.split(`
|
|
339
|
+
`).filter(o=>!o.trim().startsWith("|")).join(`
|
|
340
|
+
`).trim();return d.jsxs("div",{className:"space-y-3",children:[d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-xxs",children:[d.jsx("thead",{children:d.jsx("tr",{className:"border-b border-border/50",children:r.map((o,a)=>d.jsx("th",{className:"px-2 py-1.5 text-left text-xxs font-medium uppercase tracking-wide text-muted-foreground/70",children:o},a))})}),d.jsx("tbody",{children:i.map((o,a)=>d.jsx("tr",{className:"border-b border-border/20",children:r.map((l,c)=>{var u,f;return d.jsx("td",{className:"px-2 py-1.5 text-foreground/70",children:c===0&&((u=o[c])!=null&&u.startsWith("`"))?d.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xxs font-mono",children:((f=o[c])==null?void 0:f.replace(/`/g,""))??""}):o[c]??""},c)})},a))})]})}),s&&d.jsx(vn,{content:s})]})}function zM({section:e}){if(!e.meta)return null;if(e.meta.kind==="progress"){const{done:t,total:n}=e.meta,r=t===n?"text-bid-green":"text-muted-foreground";return d.jsxs("span",{className:`text-xxs ${r}`,children:[t,"/",n]})}if(e.meta.kind==="checklist"){const{done:t,total:n}=e.meta,r=n>0?t/n:0,i=r===1?"text-bid-green":r>=.5?"text-warning-amber":"text-muted-foreground";return d.jsxs("span",{className:`text-xxs ${i}`,children:[t,"/",n]})}if(e.meta.kind==="review"){const{blockers:t,warnings:n,suggestions:r,verdict:i}=e.meta;return d.jsxs("span",{className:"flex items-center gap-1.5",children:[i&&d.jsx(Ve,{variant:"outline",className:`h-4 px-1 text-xxs ${i.toUpperCase()==="PASS"?"border-bid-green/40 text-bid-green":"border-ask-red/40 text-ask-red"}`,children:i}),t>0&&d.jsxs("span",{className:"text-xxs text-ask-red",children:[t,"B"]}),n>0&&d.jsxs("span",{className:"text-xxs text-warning-amber",children:[n,"W"]}),r>0&&d.jsxs("span",{className:"text-xxs text-accent-blue",children:[r,"S"]})]})}return null}function VM({section:e}){var t,n,r;switch(e.type){case"quick-status":return d.jsx(LM,{content:e.content});case"progress":return((t=e.meta)==null?void 0:t.kind)==="progress"?d.jsx(OM,{meta:e.meta,content:e.content}):d.jsx(vn,{content:e.content});case"requirements":case"success-criteria":case"definition-of-done":case"next-actions":return((n=e.meta)==null?void 0:n.kind)==="checklist"?d.jsx(IM,{meta:e.meta,content:e.content}):d.jsx(vn,{content:e.content});case"files-summary":case"risks":return d.jsx(BM,{content:e.content});case"agent-review":return d.jsx(FM,{meta:((r=e.meta)==null?void 0:r.kind)==="review"?e.meta:void 0,content:e.content});default:return d.jsx(vn,{content:e.content})}}function $M({sections:e}){const t=m.useMemo(()=>{const n=[];let r="";for(const i of e)i.part!==r?(r=i.part,n.push({part:r,sections:[i]})):n[n.length-1].sections.push(i);return n},[e]);return d.jsx("div",{className:"divide-y-0",children:t.map((n,r)=>d.jsxs("div",{children:[r>0&&d.jsx("div",{className:"px-4 pt-4 pb-1",children:d.jsx("span",{className:"text-xxs font-medium uppercase tracking-widest text-muted-foreground/50",children:n.part})}),n.sections.map(i=>d.jsx(DM,{title:i.title,defaultOpen:!i.defaultCollapsed,badge:d.jsx(zM,{section:i}),children:d.jsx(VM,{section:i})},i.id))]},n.part))})}const UM={"quick status":"quick-status",progress:"progress","recent activity":"activity","next actions":"next-actions",overview:"overview",requirements:"requirements","technical approach":"approach","implementation phases":"phases","files summary":"files-summary","success criteria":"success-criteria","risk assessment":"risks","definition of done":"definition-of-done","review status":"agent-review",synthesis:"agent-review"},WM={"exploration log":"exploration","decisions & reasoning":"decisions",decisions:"decisions","implementation log":"implementation-log","deviations from spec":"deviations",deviations:"deviations"},HM=new Set(["Process","Agent Review"]),qM=/^[═=]{10,}\s*$/,KM=/^##\s+(?:PART\s+\d+:\s*)?(.+)/i;function GM(e){return e.replace(/<!--[\s\S]*?-->/g,"").trim()}function YM(e){const t=e.split(`
|
|
341
|
+
`),n=t.findIndex(i=>/\|\s*Phase\s*\|.*Description\s*\|.*Status\s*\|/i.test(i));if(n===-1)return;const r=[];for(let i=n+2;i<t.length;i++){const s=t[i].trim();if(!s.startsWith("|"))break;const o=s.split("|").map(a=>a.trim()).filter(Boolean);if(o.length>=3){const a=o[2];r.push({name:o[0],description:o[1],status:a,done:/✅|done|complete/i.test(a)})}}if(r.length!==0)return{kind:"progress",phases:r,done:r.filter(i=>i.done).length,total:r.length}}function XM(e){const t=[];for(const n of e.split(`
|
|
342
|
+
`)){const r=n.match(/^[\s]*-\s+\[([ xX])\]\s+(.*)/);r&&t.push({text:r[2].trim(),checked:r[1]!==" "})}if(t.length!==0)return{kind:"checklist",items:t,done:t.filter(n=>n.checked).length,total:t.length}}function Bg(e){let t=0,n=0,r=0,i=null,s;for(const o of e.split(`
|
|
343
|
+
`)){const a=o.trim();if(/\*\*BLOCKERS?\*\*/i.test(a)){i="blockers";continue}if(/\*\*WARNINGS?\*\*/i.test(a)){i="warnings";continue}if(/\*\*SUGGESTIONS?\*\*/i.test(a)){i="suggestions";continue}if(/\*\*VERIFIED/i.test(a)||/^###/i.test(a)){i=null;continue}i&&a.startsWith("- ")&&!/^-\s+none/i.test(a)&&(i==="blockers"?t++:i==="warnings"?n++:r++);const l=a.match(/\*\*Verdict\*\*:\s*(\w+)/i);l&&(s=l[1])}if(!(t===0&&n===0&&r===0&&!s))return{kind:"review",blockers:t,warnings:n,suggestions:r,verdict:s}}function zg(e,t){switch(e){case"progress":return YM(t);case"requirements":case"success-criteria":case"definition-of-done":case"next-actions":return XM(t);case"agent-review":return Bg(t);default:return}}function JM(e){const t=e.toLowerCase().trim();for(const[n,r]of Object.entries(UM))if(t.includes(n))return r;return"unknown"}function QM(e,t){const n=[],r=/<details>\s*\n\s*<summary>(.*?)<\/summary>([\s\S]*?)<\/details>/gi;let i;for(;(i=r.exec(e))!==null;){const s=i[1].replace(/[📝🤔📜⚠️]/gu,"").trim(),o=i[2].trim(),a=s.toLowerCase().trim();let l="unknown";for(const[c,u]of Object.entries(WM))if(a.includes(c)){l=u;break}n.push({id:l!=="unknown"?l:`process-${n.length}`,type:l,title:s,part:t,content:o,defaultCollapsed:!0,meta:zg(l,o)})}return n}function Uo(e,t){const n=[],r=e.split(`
|
|
344
|
+
`);let i=null,s=[];const o=HM.has(t);function a(){if(i===null)return;const l=s.join(`
|
|
345
|
+
`).trim();if(!l)return;const c=GM(l);if(!c)return;const u=JM(i);n.push({id:u!=="unknown"?u:`${t.toLowerCase().replace(/\s+/g,"-")}-${n.length}`,type:u,title:i,part:t,content:c,defaultCollapsed:o,meta:zg(u,c)})}for(const l of r){const c=l.match(/^###\s+(.+)/);c?(a(),i=c[1].trim(),s=[]):s.push(l)}return a(),n}function ZM(e){if(!e)return null;const t=e.split(`
|
|
346
|
+
`),n=[];for(let s=0;s<t.length;s++)qM.test(t[s])&&n.push(s);if(n.length<2)return null;const r=[];for(let s=0;s<n.length-1;s+=2){const o=n[s],a=n[s+1];for(let l=o+1;l<a;l++){const c=KM.exec(t[l]);if(c){const u=a+1,f=s+2<n.length?n[s+2]:t.length;let h=c[1].trim();/dashboard/i.test(h)?h="Dashboard":/specification/i.test(h)?h="Specification":/process/i.test(h)?h="Process":/agent\s*review/i.test(h)&&(h="Agent Review"),r.push({name:h,startLine:u,endLine:f});break}}}if(r.length===0)return null;const i=[];for(const s of r){const o=t.slice(s.startLine,s.endLine).join(`
|
|
347
|
+
`);if(s.name==="Process"){const a=QM(o,s.name);a.length>0?i.push(...a):i.push(...Uo(o,s.name))}else if(s.name==="Agent Review"){const a=Uo(o,s.name);if(a.length>0){const l=a.map(u=>u.content).join(`
|
|
348
|
+
|
|
349
|
+
`),c=Bg(l);i.push({id:"agent-review",type:"agent-review",title:"Agent Review",part:s.name,content:l,defaultCollapsed:!0,meta:c})}}else i.push(...Uo(o,s.name))}return i.length>0?i:null}function eD(e){const[t,n]=m.useState([]),[r,i]=m.useState(!1),s=Yt(),o=m.useCallback(async()=>{if(e==null){n([]);return}i(!0);try{const a=await fetch(s(`/scopes/${e}/sessions`));a.ok&&n(await a.json())}catch{}finally{i(!1)}},[e,s]);return m.useEffect(()=>{o()},[o]),m.useEffect(()=>{function a(){o()}return Q.on("session:updated",a),()=>{Q.off("session:updated",a)}},[o]),{sessions:t,loading:r}}const Wi="h-7 w-full rounded border border-border bg-transparent px-2 text-xxs text-foreground/80 focus:outline-none focus:ring-1 focus:ring-primary/50",nr="text-xxs font-medium uppercase tracking-wide text-muted-foreground/70 mb-1";function tD(e){return{title:e.title,status:e.status,priority:e.priority??"",effort_estimate:e.effort_estimate??"",category:e.category??"",tags:[...e.tags],blocked_by:[...e.blocked_by],blocks:[...e.blocks]}}function nD(e,t){return e.title===t.title&&e.status===t.status&&e.priority===t.priority&&e.effort_estimate===t.effort_estimate&&e.category===t.category&&JSON.stringify(e.tags)===JSON.stringify(t.tags)&&JSON.stringify(e.blocked_by)===JSON.stringify(t.blocked_by)&&JSON.stringify(e.blocks)===JSON.stringify(t.blocks)}function df({label:e,ids:t,onRemove:n,onAdd:r}){const[i,s]=m.useState(!1),[o,a]=m.useState("");return d.jsxs("div",{children:[d.jsx("p",{className:nr,children:e}),d.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[t.map(l=>d.jsxs("span",{className:"group inline-flex items-center gap-0.5 rounded border border-border px-1.5 py-0.5 text-xxs text-foreground/70",children:[_t(l),d.jsx("button",{onClick:()=>n(l),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:d.jsx(wt,{className:"h-2.5 w-2.5"})})]},l)),i?d.jsx("input",{autoFocus:!0,className:"h-5 w-12 rounded bg-transparent px-1 text-xxs border border-primary/30 focus:outline-none",placeholder:"ID",value:o,onChange:l=>a(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(r(o),s(!1),a("")),l.key==="Escape"&&s(!1)},onBlur:()=>s(!1)}):d.jsx("button",{onClick:()=>s(!0),className:"hover:text-foreground transition-colors text-muted-foreground",children:d.jsx(ts,{className:"h-3 w-3"})}),t.length===0&&!i&&d.jsx("span",{className:"text-xxs text-muted-foreground/50",children:"None"})]})]})}function rD({scope:e,open:t,onClose:n}){const{engine:r}=sn(),i=Yt(),{getApiBase:s,hasMultipleProjects:o}=Gt(),a=m.useCallback(_=>o&&(e!=null&&e.project_id)?`${s(e.project_id)}${_}`:i(_),[i,s,o,e==null?void 0:e.project_id]),{sessions:l,loading:c}=eD((e==null?void 0:e.id)??null),[u,f]=m.useState(null),[h,p]=m.useState(null),[g,b]=m.useState(!1),[y,x]=m.useState(null),[v,C]=m.useState(""),j=u&&h?!nD(u,h):!1,w=m.useMemo(()=>ZM(e==null?void 0:e.raw_content),[e==null?void 0:e.raw_content]);m.useEffect(()=>{if(e&&t){const _=tD(e);f(_),p(_),x(null),C("")}},[e==null?void 0:e.id,e==null?void 0:e.updated_at,t]);const k=m.useCallback(async()=>{if(!(!e||!u||!j||g)){b(!0),x(null);try{const _={};h&&(u.title!==h.title&&(_.title=u.title),u.status!==h.status&&(_.status=u.status),u.priority!==h.priority&&(_.priority=u.priority||null),u.effort_estimate!==h.effort_estimate&&(_.effort_estimate=u.effort_estimate||null),u.category!==h.category&&(_.category=u.category||null),JSON.stringify(u.tags)!==JSON.stringify(h.tags)&&(_.tags=u.tags),JSON.stringify(u.blocked_by)!==JSON.stringify(h.blocked_by)&&(_.blocked_by=u.blocked_by),JSON.stringify(u.blocks)!==JSON.stringify(h.blocks)&&(_.blocks=u.blocks));const L=await fetch(a(`/scopes/${e.id}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)});if(!L.ok){const I=await L.json().catch(()=>({error:"Save failed"}));x(I.error??`HTTP ${L.status}`);return}p({...u})}catch{x("Network error — could not save")}finally{b(!1)}}},[e,u,h,j,g,a]);function P(){if(j&&window.confirm("Save changes before closing?")){k().then(n);return}n()}function N(_){f(L=>L&&{...L,..._}),x(null)}function M(_){const L=_.trim().toLowerCase();!L||!u||(u.tags.includes(L)||N({tags:[...u.tags,L]}),C(""))}function T(_,L){const I=parseInt(L,10);isNaN(I)||I<=0||!u||u[_].includes(I)||N({[_]:[...u[_],I]})}if(!e||!u)return null;const R=r.getValidTargets(e.status),A=[e.status,...R.filter(_=>_!==e.status)];return d.jsx(Pn,{open:t,onOpenChange:_=>{_||P()},children:d.jsxs(an,{className:"max-w-[min(72rem,calc(100vw_-_2rem))] h-[85vh] flex flex-col p-0 gap-0 overflow-hidden",children:[d.jsx(Kn,{className:"px-4 pt-3 pb-2",children:d.jsxs("div",{className:"flex items-start gap-3 pr-8",children:[d.jsx("span",{className:"font-mono text-xxs text-muted-foreground mt-1.5",children:_t(e.id)}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx(An,{asChild:!0,children:d.jsx("input",{className:"w-full bg-transparent text-sm font-normal text-foreground border-none focus:outline-none focus:ring-0 placeholder:text-muted-foreground leading-tight",value:u.title,onChange:_=>N({title:_.target.value}),placeholder:"Scope title..."})}),d.jsx(_n,{asChild:!0,children:d.jsxs("span",{className:"mt-1 flex items-center gap-1 text-xxs text-muted-foreground",children:[d.jsx(nh,{className:"h-3 w-3"}),d.jsx("span",{className:"truncate max-w-[400px]",children:e.file_path})]})})]})]})}),d.jsx(ys,{}),y&&d.jsxs("div",{className:"mx-4 mt-2 flex items-center gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-1.5 text-xs text-red-400",children:[d.jsx("span",{className:"flex-1",children:y}),d.jsx("button",{onClick:()=>x(null),className:"shrink-0 hover:text-red-200 transition-colors",children:d.jsx(wt,{className:"h-3.5 w-3.5"})})]}),d.jsxs("div",{className:"flex flex-1 min-h-0",children:[d.jsx("div",{className:"flex-[65] min-w-0 border-r",children:d.jsx(hr,{className:"h-full",children:w?d.jsx("div",{className:"py-2",children:d.jsx($M,{sections:w})}):d.jsx("div",{className:"px-6 py-5",children:e.raw_content?d.jsx(Dg,{content:e.raw_content}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No content available"})})})}),d.jsx("div",{className:"flex-[35] min-w-0 flex flex-col",children:d.jsxs(hr,{className:"h-full",children:[d.jsxs("div",{className:"p-4 space-y-3",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:nr,children:"Status"}),d.jsx("select",{className:Wi,value:u.status,onChange:_=>N({status:_.target.value}),children:A.map(_=>d.jsx("option",{value:_,children:_},_))})]}),d.jsxs("div",{children:[d.jsx("p",{className:nr,children:"Priority"}),d.jsxs("select",{className:Wi,value:u.priority,onChange:_=>N({priority:_.target.value}),children:[d.jsx("option",{value:"",children:"—"}),il.map(_=>d.jsx("option",{value:_,children:_},_))]})]}),d.jsxs("div",{children:[d.jsx("p",{className:nr,children:"Effort"}),d.jsxs("select",{className:Wi,value:u.effort_estimate,onChange:_=>N({effort_estimate:_.target.value}),children:[d.jsx("option",{value:"",children:"—"}),Os.map(_=>d.jsx("option",{value:_,children:_},_))]})]}),d.jsxs("div",{children:[d.jsx("p",{className:nr,children:"Category"}),d.jsxs("select",{className:Wi,value:u.category,onChange:_=>N({category:_.target.value}),children:[d.jsx("option",{value:"",children:"—"}),sl.map(_=>d.jsx("option",{value:_,children:_},_))]})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:nr,children:"Tags"}),d.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[u.tags.map(_=>d.jsxs("span",{className:"group inline-flex items-center gap-0.5 glass-pill rounded border border-border px-1.5 py-0.5 text-xxs text-muted-foreground",children:[_,d.jsx("button",{onClick:()=>N({tags:u.tags.filter(L=>L!==_)}),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:d.jsx(wt,{className:"h-2.5 w-2.5"})})]},_)),d.jsx("input",{className:"h-5 w-16 rounded bg-transparent text-xxs text-muted-foreground placeholder:text-muted-foreground/50 border-none focus:outline-none",placeholder:"+tag",value:v,onChange:_=>C(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),M(v))},onBlur:()=>{v.trim()&&M(v)}})]})]}),d.jsx(df,{label:"Blocked by",ids:u.blocked_by,onRemove:_=>N({blocked_by:u.blocked_by.filter(L=>L!==_)}),onAdd:_=>T("blocked_by",_)}),d.jsx(df,{label:"Blocks",ids:u.blocks,onRemove:_=>N({blocks:u.blocks.filter(L=>L!==_)}),onAdd:_=>T("blocks",_)})]}),d.jsx(ys,{}),d.jsx("div",{className:"p-4 flex-1",children:d.jsx(RM,{sessions:l,loading:c})})]})})]}),j&&d.jsxs("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded border border-border px-3 py-2",children:[d.jsx(Ve,{variant:"outline",children:"Unsaved changes"}),d.jsx("div",{className:"flex-1"}),d.jsx(ke,{variant:"ghost",size:"sm",onClick:()=>{f(h),x(null)},children:"Discard"}),d.jsx(ke,{size:"sm",onClick:()=>k(),disabled:g,children:g?"Saving...":"Save"}),y&&d.jsx("span",{className:"text-xs text-destructive ml-2",children:y})]})]})})}function iD({open:e,loading:t,onSubmit:n,onCancel:r,onSurprise:i,surpriseLoading:s}){const[o,a]=m.useState(""),[l,c]=m.useState(""),u=m.useRef(null);m.useEffect(()=>{e&&(a(""),c(""),setTimeout(()=>{var p;return(p=u.current)==null?void 0:p.focus()},100))},[e]);function f(){o.trim()&&n(o.trim(),l.trim())}function h(p){(p.metaKey||p.ctrlKey)&&p.key==="Enter"&&(p.preventDefault(),f())}return d.jsx(Pn,{open:e,onOpenChange:p=>{p||r()},children:d.jsxs(an,{className:"max-w-lg p-5 gap-0",onKeyDown:h,children:[d.jsxs(Kn,{className:"mb-4",children:[d.jsx(An,{className:"text-sm font-normal",children:"New Idea"}),d.jsx(_n,{className:"text-xxs text-muted-foreground",children:"Capture a feature idea for the icebox"})]}),d.jsx("input",{ref:u,className:"mb-3 w-full rounded bg-muted/50 px-3 py-2 text-sm text-foreground border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 placeholder:text-muted-foreground",placeholder:"Feature name...",value:o,onChange:p=>a(p.target.value)}),d.jsx("textarea",{className:"mb-4 w-full rounded bg-muted/50 px-3 py-2.5 text-xs text-foreground border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 resize-y placeholder:text-muted-foreground",placeholder:"Describe the idea... What problem does it solve? Any notes on approach?",rows:6,value:l,onChange:p=>c(p.target.value)}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ke,{size:"sm",onClick:f,disabled:t||!o.trim(),className:"flex-1",children:t?"Creating...":"Create"}),d.jsx(ke,{size:"sm",variant:"ghost",onClick:r,disabled:t,children:"Cancel"}),d.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground/50",children:["⌘","+Enter"]})]}),d.jsxs("div",{className:"mt-4 pt-4 border-t border-border",children:[d.jsx(ke,{size:"sm",variant:"outline",className:"w-full text-purple-400 border-purple-500/30 hover:bg-purple-500/10 hover:border-purple-500/50",onClick:i,disabled:s,children:s?d.jsxs(d.Fragment,{children:[d.jsx(Va,{className:"h-3.5 w-3.5 mr-2 animate-spin"}),"Generating ideas..."]}):d.jsxs(d.Fragment,{children:[d.jsx($a,{className:"h-3.5 w-3.5 mr-2"}),"Surprise Me"]})}),d.jsx("p",{className:"mt-1.5 text-center text-[10px] text-muted-foreground",children:"AI analyzes the codebase and suggests feature ideas"})]})]})})}function sD({scope:e,open:t,onClose:n,onDelete:r,onApprove:i,onReject:s}){const o=Yt(),[a,l]=m.useState(""),[c,u]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState(""),[b,y]=m.useState(!1),[x,v]=m.useState(!1),C=m.useRef(null),j=!!(e!=null&&e.is_ghost),w=a!==f||c!==p;m.useEffect(()=>{if(e&&t){const M=e.title??"",T=e.raw_content??"";l(M),u(T),h(M),g(T),v(!1);const R=j?void 0:setTimeout(()=>{var A;return(A=C.current)==null?void 0:A.focus()},100);return()=>{clearTimeout(R)}}},[e==null?void 0:e.id,t]);const k=m.useCallback(async()=>{if(!(!(e!=null&&e.slug)||!w||b||j)){y(!0);try{const M=await fetch(o(`/ideas/${e.slug}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:a,description:c})});M.ok?(h(a),g(c)):console.error("[Orbital] Failed to save idea:",M.status,M.statusText)}finally{y(!1)}}},[e,a,c,w,b,j,o]);m.useEffect(()=>{if(!w||!t||j)return;const M=setInterval(()=>{k()},1e4);return()=>clearInterval(M)},[w,t,k,j]);function P(){if(w&&!j&&window.confirm("Save changes before closing?")){k().then(n);return}n()}function N(){if(!x){v(!0);return}e!=null&&e.slug&&r(e.slug)}return e?d.jsx(Pn,{open:t,onOpenChange:M=>{M||P()},children:d.jsxs(an,{className:"max-w-md p-0 gap-0 flex flex-col max-h-[70vh]",children:[d.jsx(An,{className:"sr-only",children:j?"AI suggested idea":"Edit idea"}),d.jsx(_n,{className:"sr-only",children:j?"Review and approve or reject this AI-suggested idea":"Edit idea title and description, or delete the idea"}),d.jsx(Kn,{className:"px-4 pt-3 pb-2",children:d.jsxs("div",{className:"flex items-center gap-2 pr-8",children:[d.jsx("div",{className:"flex-1 min-w-0",children:j?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx($a,{className:"h-3.5 w-3.5 text-purple-400 shrink-0"}),d.jsx("span",{className:"text-sm font-normal text-foreground truncate",children:a})]}):d.jsx("input",{ref:C,className:"w-full bg-transparent text-sm font-normal text-foreground border-none focus:outline-none focus:ring-0 placeholder:text-muted-foreground",placeholder:"Idea title...",value:a,onChange:M=>l(M.target.value)})}),j?d.jsx("span",{className:"shrink-0 rounded border border-purple-500/30 bg-purple-500/10 px-1.5 py-0.5 text-[10px] text-purple-400 uppercase",children:"ai suggestion"}):x?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(ke,{size:"sm",variant:"destructive",className:"h-6 text-xxs",onClick:N,children:"Confirm"}),d.jsx(ke,{size:"sm",variant:"ghost",className:"h-6 text-xxs",onClick:()=>v(!1),children:"No"})]}):d.jsx(ke,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0 text-muted-foreground hover:text-destructive",onClick:N,title:"Delete idea",children:d.jsx(B0,{className:"h-3.5 w-3.5"})})]})}),d.jsx("div",{className:"flex-1 min-h-0 px-4 pb-4",children:j?d.jsx("div",{className:"w-full min-h-[200px] rounded bg-transparent px-3 py-2.5 text-xs text-foreground/80 border border-border/50 whitespace-pre-wrap",children:c||d.jsx("span",{className:"text-muted-foreground italic",children:"No description"})}):d.jsx("textarea",{className:"w-full h-full min-h-[200px] rounded bg-transparent px-3 py-2.5 text-xs text-foreground border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 resize-none placeholder:text-muted-foreground",placeholder:"Describe the idea... What problem does it solve? Any notes on approach?",value:c,onChange:M=>u(M.target.value)})}),j?d.jsxs("div",{className:"px-4 pb-3 flex items-center gap-2",children:[d.jsxs(ke,{size:"sm",className:"flex-1 bg-green-600/20 border border-green-500/30 text-green-400 hover:bg-green-600/30 hover:text-green-300",onClick:()=>e.slug&&i(e.slug),disabled:!e.slug,children:[d.jsx(Sr,{className:"h-3.5 w-3.5 mr-1.5"}),"Approve"]}),d.jsxs(ke,{size:"sm",variant:"ghost",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>e.slug&&s(e.slug),disabled:!e.slug,children:[d.jsx(wt,{className:"h-3.5 w-3.5 mr-1.5"}),"Reject"]})]}):d.jsxs("div",{className:"px-4 pb-3 flex items-center justify-between text-xxs text-muted-foreground",children:[d.jsx("span",{children:b?"Saving...":w?"Unsaved changes":"Saved"}),d.jsx(ke,{size:"sm",variant:"ghost",className:"h-6",onClick:()=>k(),disabled:!w||b,children:"Save"})]})]})}):null}const Wo=[{field:"priority",label:"Priority"},{field:"category",label:"Category"},{field:"tags",label:"Tags"},{field:"effort",label:"Effort"},{field:"dependencies",label:"Dependencies"}],oD={priority:"Priority",category:"Category",tags:"Tag",effort:"Effort",dependencies:"Dep"},aD={feature:"#536dfe",bugfix:"#ff1744",refactor:"#8B5CF6",infrastructure:"#40c4ff",docs:"#6B7280"},lD={priority:"text-warning-amber",category:"text-accent-blue",tags:"text-info-cyan",effort:"text-muted-foreground",dependencies:"text-ask-red"};function cD({filters:e,optionsWithCounts:t,onToggle:n,onClearField:r,onClearAll:i,hasActiveFilters:s}){Cr();const[o,a]=m.useState(null),l=Wo.reduce((u,{field:f})=>u+e[f].size,0),c=[];for(const{field:u}of Wo){if(e[u].size===0)continue;const f=[];for(const h of e[u]){const p=t[u].find(g=>g.value===h);f.push({value:h,label:(p==null?void 0:p.label)??h})}c.push({field:u,values:f})}return d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs(En,{onOpenChange:()=>a(null),children:[d.jsx(Tn,{asChild:!0,children:d.jsxs(ke,{variant:"outline",size:"sm",className:F("card-glass gap-1.5 bg-white/[0.03] border-white/10",s&&"border-white/20 text-foreground"),"aria-label":"Filter scopes",children:[d.jsx(Jb,{className:"h-3 w-3"}),"Filters",l>0&&d.jsx("span",{className:"ml-0.5 rounded-full bg-white/10 px-1.5 text-[10px]",children:l})]})}),d.jsxs(on,{align:"start",className:"filter-popover-glass !bg-transparent w-52",children:[d.jsx("div",{className:"space-y-0.5",children:Wo.map(({field:u,label:f})=>{const h=t[u];if(h.length===0)return null;const p=o===u,g=e[u].size;return d.jsxs("div",{children:[d.jsxs("button",{type:"button",onClick:()=>a(p?null:u),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",p&&"bg-white/[0.06]"),children:[d.jsx(ri,{className:F("h-3 w-3 shrink-0 text-muted-foreground transition-transform duration-150",p&&"rotate-90")}),d.jsx("span",{className:F(g>0&&"text-foreground"),children:f}),g>0&&d.jsx("span",{className:"ml-auto rounded-full bg-white/10 px-1.5 text-[10px]",children:g})]}),p&&d.jsxs("div",{className:"ml-2 border-l border-white/[0.06] pl-2 mt-0.5 mb-1 space-y-0.5",children:[h.map(b=>{const y=e[u].has(b.value);return d.jsxs("button",{type:"button",onClick:()=>n(u,b.value),className:F("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors","hover:bg-white/[0.06]",y&&"bg-white/[0.06]"),children:[d.jsx("span",{className:F("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border",y?F("border-primary bg-primary text-primary-foreground",lD[u]):"border-white/15"),children:y&&d.jsx("svg",{className:"h-2.5 w-2.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),d.jsx("span",{className:F("capitalize",y&&"text-foreground"),children:b.label}),d.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground",children:b.count})]},b.value)}),g>0&&d.jsxs("button",{type:"button",onClick:()=>r(u),className:"w-full rounded px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors text-left",children:["Clear ",f.toLowerCase()]})]})]},u)})}),s&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"my-2 border-t border-white/[0.06]"}),d.jsx("button",{type:"button",onClick:i,className:"w-full rounded px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors text-center",children:"Clear all filters"})]})]})]}),c.map(({field:u,values:f})=>d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsxs("span",{className:"text-[10px] text-muted-foreground capitalize",children:[oD[u],":"]}),f.map(({value:h,label:p})=>{const g=u==="category";return d.jsxs(Ve,{variant:g?"outline":"secondary",className:F("gap-0.5 capitalize cursor-pointer hover:bg-secondary/60 py-0 px-1 text-[10px] font-light",!g&&"glass-pill",g&&"bg-[rgba(var(--neon-blue),0.08)]"),style:g?{borderColor:aD[h]}:void 0,onClick:()=>n(u,h),children:[p,d.jsx(wt,{className:"h-2 w-2 opacity-60"})]},h)})]},u))]})}function uD({query:e,mode:t,isStale:n,onQueryChange:r,onModeChange:i}){Cr();const s=m.useRef(null),o=m.useRef(null),[a,l]=m.useState(!!e),c=m.useCallback(()=>{requestAnimationFrame(()=>{var f;!((f=o.current)!=null&&f.contains(document.activeElement))&&!e&&l(!1)})},[e]);m.useEffect(()=>{function f(h){h.key==="/"&&!(h.target instanceof HTMLInputElement)&&!(h.target instanceof HTMLTextAreaElement)&&(h.preventDefault(),l(!0))}return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[]),m.useEffect(()=>{if(a){const f=setTimeout(()=>{var h;return(h=s.current)==null?void 0:h.focus()},50);return()=>clearTimeout(f)}},[a]);const u=m.useCallback(f=>{var h;f.key==="Escape"&&(e?r(""):(h=s.current)==null||h.blur())},[e,r]);return d.jsxs("div",{ref:o,className:F("flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs","backdrop-blur-sm bg-white/[0.03] border-white/10","transition-all duration-200 ease-out",a?"focus-within:border-white/20":"cursor-pointer hover:bg-white/[0.06]",a&&"focus-within:glow-blue"),role:"search","aria-label":"Search scopes",onClick:a?void 0:()=>l(!0),onBlur:a?c:void 0,children:[d.jsx(w0,{className:F("h-3 w-3 shrink-0 text-muted-foreground",n&&"animate-pulse")}),d.jsx("span",{className:F("text-xs font-medium whitespace-nowrap overflow-hidden transition-all duration-200 ease-out",a?"w-0 opacity-0":"w-10 opacity-100"),children:"Search"}),d.jsx("input",{ref:s,type:"text",value:e,onChange:f=>r(f.target.value.slice(0,100)),onKeyDown:u,placeholder:"Search scopes...",className:F("min-w-0 overflow-hidden bg-transparent text-xs text-foreground placeholder:text-muted-foreground/60 focus:outline-none","transition-all duration-200 ease-out",a?"w-48 opacity-100":"w-0 opacity-0"),tabIndex:a?0:-1,"aria-label":"Search scopes"}),a&&e&&d.jsx("button",{onClick:()=>{var f;r(""),(f=s.current)==null||f.focus()},className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors animate-in fade-in zoom-in-75 duration-150","aria-label":"Clear search",children:d.jsx(wt,{className:"h-3 w-3"})}),d.jsxs("div",{className:F("flex shrink-0 overflow-hidden -my-1 -mr-2 rounded-r-md","transition-all duration-200 ease-out",a?"max-w-[150px] opacity-100 border-l border-white/10":"max-w-0 opacity-0 border-l border-transparent"),children:[d.jsx("button",{onClick:()=>i("filter"),className:F("px-2 py-1 text-[10px] whitespace-nowrap transition-colors",t==="filter"?"bg-white/10 text-foreground":"text-muted-foreground hover:text-foreground hover:bg-white/[0.04]"),tabIndex:a?0:-1,"aria-pressed":t==="filter",children:"Filter"}),d.jsx("button",{onClick:()=>i("highlight"),className:F("px-2 py-1 text-[10px] whitespace-nowrap transition-colors",t==="highlight"?"bg-white/10 text-foreground":"text-muted-foreground hover:text-foreground hover:bg-white/[0.04]"),tabIndex:a?0:-1,"aria-pressed":t==="highlight",children:"Highlight"})]})]})}function dD({open:e,sprint:t,graph:n,loading:r,onConfirm:i,onCancel:s}){const{engine:o}=sn(),[a,l]=m.useState(!1);if(m.useEffect(()=>{e&&l(!1)},[e]),!t)return null;const c=new Map(t.scopes.map(y=>[y.scope_id,y])),u=(n==null?void 0:n.layers)??[],f=t.scope_ids.length,h=o.getBatchTargetStatus(t.target_column),p=h?o.findEdge(t.target_column,h):void 0,g=o.getBatchCommand(t.target_column)??null,b=async()=>{l(!0),i()};return d.jsx(Pn,{open:e,onOpenChange:y=>!y&&s(),children:d.jsxs(an,{className:"sm:max-w-lg p-0 gap-0",children:[d.jsxs(Kn,{className:"px-5 pt-4 pb-3",children:[h&&d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(Ve,{variant:"outline",className:"text-xxs capitalize",children:t.target_column}),d.jsx(es,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsx(Ve,{variant:"default",className:"text-xxs capitalize [color:#000]",children:h})]}),d.jsx(An,{className:"text-sm font-normal",children:(p==null?void 0:p.label)??"Dispatch Sprint"}),d.jsxs(_n,{className:"text-xs text-muted-foreground mt-1",children:[f," scope",f!==1?"s":""," in"," ",u.length," layer",u.length!==1?"s":"",", max"," ",t.concurrency_cap," concurrent"]})]}),d.jsxs("div",{className:"px-5 pb-4 space-y-3",children:[g&&d.jsxs("div",{className:"flex items-center gap-2 rounded border border-border bg-surface/30 px-3 py-2",children:[d.jsx(Ns,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),d.jsx("code",{className:"text-xs font-mono text-primary",children:g})]}),d.jsx("div",{className:"max-h-64 overflow-y-auto space-y-3 rounded border border-border bg-surface/30 px-3 py-2",children:u.map((y,x)=>d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsxs(Ve,{variant:"outline",className:"text-xxs",children:["Layer ",x]}),x===0&&d.jsx("span",{className:"text-xxs text-primary",children:"Launches first"}),x>0&&d.jsxs("span",{className:"text-xxs text-muted-foreground",children:["Waits for Layer ",x-1]})]}),d.jsx("div",{className:"ml-4 space-y-1",children:y.map(v=>{const C=c.get(v);return d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{className:"font-mono text-muted-foreground w-8 shrink-0",children:_t(v)}),d.jsx("span",{className:"truncate flex-1 font-light",children:(C==null?void 0:C.title)??"Unknown"}),(C==null?void 0:C.effort_estimate)&&d.jsx("span",{className:"text-xxs text-muted-foreground shrink-0",children:C.effort_estimate})]},v)})}),x<u.length-1&&d.jsx("div",{className:"flex justify-center my-1",children:d.jsx(es,{className:"h-3 w-3 text-muted-foreground rotate-90"})})]},y.join("-")))}),u.length===0&&!r&&d.jsxs("div",{className:F("flex items-start gap-2 rounded border px-3 py-2 text-xs","border-warning-amber/30 bg-warning-amber/10 text-warning-amber"),children:[d.jsx(wn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),d.jsx("span",{children:"Could not compute execution layers. Sprint may have issues."})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[d.jsx(ke,{onClick:b,disabled:a||r||u.length===0,className:"flex-1",children:a?"Dispatching...":g?"Launch in iTerm":"Dispatch Sprint"}),d.jsx(ke,{variant:"ghost",onClick:s,disabled:a,children:"Cancel"})]})]})]})})}function fD({open:e,unmetDeps:t,onAddAll:n,onCancel:r}){const i=new Map;for(const s of t)for(const o of s.missing)i.has(o.scope_id)||i.set(o.scope_id,{title:o.title,status:o.status});return d.jsx(Pn,{open:e,onOpenChange:s=>!s&&r(),children:d.jsxs(an,{className:"sm:max-w-md",children:[d.jsxs(Kn,{children:[d.jsxs(An,{className:"flex items-center gap-2 text-sm",children:[d.jsx(wn,{className:"h-4 w-4 text-warning-amber"}),"Unmet Dependencies"]}),d.jsx(_n,{className:"text-xs",children:"Some scopes you added depend on scopes not yet in this sprint."})]}),d.jsx("div",{className:"space-y-3 my-2",children:t.map(s=>d.jsxs("div",{className:"text-xs",children:[d.jsx("span",{className:"font-mono text-muted-foreground",children:_t(s.scope_id)}),d.jsx("span",{className:"ml-1",children:"depends on:"}),d.jsx("div",{className:"ml-4 mt-1 space-y-1",children:s.missing.map(o=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-muted-foreground",children:_t(o.scope_id)}),d.jsx("span",{className:"truncate",children:o.title}),d.jsx(Ve,{variant:"outline",className:"text-[10px] ml-auto shrink-0",children:o.status})]},o.scope_id))})]},s.scope_id))}),d.jsxs("div",{className:"flex justify-end gap-2 pt-2 border-t",children:[d.jsxs(ke,{variant:"ghost",size:"sm",onClick:r,children:[d.jsx(wt,{className:"h-3 w-3 mr-1"})," Cancel"]}),d.jsxs(ke,{size:"sm",onClick:()=>n([...i.keys()]),children:[d.jsx(ts,{className:"h-3 w-3 mr-1"})," Add All Dependencies"]})]})]})})}function hD({columnId:e,dispatching:t,onOpenIdeaForm:n,onCreateGroup:r}){const{engine:i}=sn(),s=i.getEntryPoint().id,o=i.getList(e),a=(o==null?void 0:o.supportsBatch)??!1,l=(o==null?void 0:o.supportsSprint)??!1;if(e===s&&n)return d.jsx(ke,{variant:"ghost",size:"icon",className:"ml-1 h-5 w-5",onClick:n,disabled:t,title:"Add idea",children:d.jsx(ts,{className:"h-3 w-3"})});if((l||a)&&r){const u=a?"batch":"sprint",f=a?"Batch":"Sprint";return d.jsx(ke,{variant:"ghost",size:"icon",className:"ml-1 h-5 w-5",onClick:()=>r(`New ${f}`,{target_column:e,group_type:u}),title:`Create ${f.toLowerCase()}`,children:d.jsx(ts,{className:"h-3 w-3"})})}return null}const pD=e=>{const t=ew(e),n=t.find(r=>String(r.id).startsWith("sprint-drop-"));return n?[n]:t.length>0?t:Th(e)};function Ma(e){if(!e.some(r=>r.favourite))return e;const t=[],n=[];for(const r of e)(r.favourite?t:n).push(r);return[...t,...n]}const mD={critical:"bg-ask-red",high:"bg-warning-amber",medium:"bg-accent-blue",low:"bg-muted-foreground/30"},gD={feature:"bg-category-feature",bugfix:"bg-category-bugfix",refactor:"bg-category-refactor",infrastructure:"bg-category-infrastructure",docs:"bg-category-docs"},xD={"has-blockers":"Has blockers","blocks-others":"Blocks others","no-deps":"No dependencies"},yD={priority:il,category:sl,effort:Os,dependencies:Hh,tags:[],project:[]};function bD(e,t){return e==="priority"?mD[t]??"bg-muted-foreground/30":e==="category"?gD[t]??"bg-primary/40":"bg-primary/40"}function vD(e,t){return e==="dependencies"?xD[t]??t:t}function wD(){return new Proxy({},{get(e,t){return t in e||(e[t]=[]),e[t]}})}function kD(e,t,n,r,i,s){const o=new Map,a=new Map;for(const h of e){const p=ol(h,t),g=p.length>0?p:["Unset"];for(const b of g){o.has(b)||(o.set(b,wD()),a.set(b,0));const y=o.get(b),x=i?i(h):h.status;y[x]?y[x].push(h):y.planning.push(h),a.set(b,(a.get(b)??0)+1)}}for(const h of o.values())for(const p of Object.keys(h))h[p]=Ma(sa(h[p],n,r));const l=yD[t],c=[...o.keys()],u=[];for(const h of l)o.has(h)&&u.push(h);const f=c.filter(h=>h!=="Unset"&&!l.includes(h)).sort();return u.push(...f),o.has("Unset")&&u.push("Unset"),u.map(h=>{const p=t==="project"&&h!=="Unset"?s==null?void 0:s.get(h):void 0;return{value:h,label:h==="Unset"?"Unset":p?p.name:vD(t,h),color:h==="Unset"?"bg-muted-foreground/20":p?"":bD(t,h),colorHsl:p==null?void 0:p.color,count:a.get(h)??0,cells:o.get(h)}})}const SD={queued:"210 50% 50%",active:"0 70% 55%",review:"45 80% 50%",shipped:"153 70% 45%"};function CD(e,t){var a,l,c,u;const n=[...t.values()];if(n.length===0)return{isUnified:!0,columns:[],scopesByColumn:{}};if(D1(n)){const f=n[0],p=f.getBoardColumns().map(y=>({id:y.id,label:y.label,color:y.color,phase:new gr(f).getPhase(y.id)})),g={};for(const y of p)g[y.id]=[];const b=f.getEntryPoint().id;for(const y of e){const x=g[y.status]?y.status:b;(a=g[x])==null||a.push(y)}return{isUnified:!0,columns:p,scopesByColumn:g}}const i=new Map;for(const[f,h]of t)i.set(f,new gr(h));const s=M1.map(f=>({id:f.phase,label:f.label,color:SD[f.phase],phase:f.phase})),o={};for(const f of s)o[f.id]=[];for(const f of e){const h=f.project_id;if(!h){(l=o.queued)==null||l.push(f);continue}const p=i.get(h);if(p){const g=p.getPhase(f.status);(c=o[g])==null||c.push(f)}else(u=o.queued)==null||u.push(f)}return{isUnified:!1,columns:s,scopesByColumn:o}}const jD=["0 90% 62%","20 95% 60%","40 95% 56%","58 90% 52%","76 85% 50%","100 80% 48%","130 80% 48%","158 85% 46%","178 90% 46%","194 95% 52%","212 90% 60%","232 88% 64%","254 85% 66%","272 85% 64%","292 82% 62%","312 85% 58%","330 88% 58%","348 92% 60%","150 82% 52%","56 95% 62%"];function ED({open:e,onClose:t,projects:n}){const[r,i]=m.useState(!1),[s,o]=m.useState(null),[a,l]=m.useState(null),c=m.useRef(null),[u,f]=m.useState(null);async function h(g,b){l(g),f(null);try{const y=await fetch(`/api/orbital/projects/${g}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(!y.ok){const x=await y.json().catch(()=>({}));f(x.error??`Failed to update project (HTTP ${y.status})`)}}catch{f("Failed to update project")}finally{l(null)}}async function p(g){if(!g||g.length===0)return;const y=g[0].webkitRelativePath.split("/")[0];o(null),i(!0);try{const x=await fetch("/api/orbital/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:y})});if(!x.ok){const v=await x.json().catch(()=>({}));throw new Error(v.error??`HTTP ${x.status}`)}}catch(x){o(x instanceof Error?x.message:"Failed to add project")}finally{i(!1),c.current&&(c.current.value="")}}return d.jsx(Pn,{open:e,onOpenChange:g=>{g||t()},children:d.jsxs(an,{className:"max-w-[440px] max-h-[80vh] p-0 gap-0 flex flex-col",children:[d.jsxs(Kn,{className:"border-b border-white/[0.08] px-4 py-3",children:[d.jsx(An,{children:"Project Settings"}),d.jsx(_n,{className:"sr-only",children:"Manage registered projects, colors, names, and visibility"})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-1.5",children:[n.map(g=>d.jsx(TD,{project:g,updating:a===g.id,onUpdate:b=>h(g.id,b)},g.id)),d.jsxs("div",{onClick:()=>{var g;return!r&&((g=c.current)==null?void 0:g.click())},className:F("flex items-center gap-3 rounded border border-dashed border-white/[0.08] px-3 py-2","text-muted-foreground hover:text-foreground hover:border-primary/30 hover:bg-white/[0.03]","transition-colors cursor-pointer",r&&"opacity-50 pointer-events-none"),children:[d.jsx(Yb,{className:"h-3.5 w-3.5 shrink-0"}),d.jsx("span",{className:"text-xs",children:"Add Project"})]}),d.jsx("input",{ref:c,type:"file",webkitdirectory:"",className:"hidden",onChange:g=>p(g.target.files)}),(s||u)&&d.jsx("p",{className:"px-3 text-[11px] text-destructive",children:s||u})]})]})})}function TD({project:e,updating:t,onUpdate:n}){const[r,i]=m.useState(!1),[s,o]=m.useState(e.name),a=m.useRef(null);m.useEffect(()=>{var u;r&&((u=a.current)==null||u.focus())},[r]),m.useEffect(()=>{r||o(e.name)},[e.name,r]);const l=s.trim()!==""&&s.trim()!==e.name,c=m.useCallback(()=>{i(!1);const u=s.trim();u&&u!==e.name?n({name:u}):o(e.name)},[s,e.name,n]);return d.jsxs("div",{className:F("flex items-center gap-3 rounded border border-white/[0.08] px-3 py-2","transition-colors hover:border-[rgba(var(--neon-cyan),0.2)]",!e.enabled&&"opacity-50"),children:[d.jsx(ND,{value:e.color,onChange:u=>n({color:u}),disabled:t}),d.jsxs("div",{className:"flex-1 min-w-0",children:[r?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("input",{ref:a,value:s,onChange:u=>o(u.target.value),onBlur:()=>{o(e.name),i(!1)},onKeyDown:u=>{u.key==="Enter"&&c(),u.key==="Escape"&&(o(e.name),i(!1))},className:"flex-1 min-w-0 bg-transparent text-xs font-medium outline-none border-b border-primary/50 pb-0.5"}),l&&d.jsx("button",{onMouseDown:u=>{u.preventDefault(),c()},className:"shrink-0 text-primary hover:text-primary/80 transition-colors",title:"Save name",children:d.jsx(Sr,{className:"h-3.5 w-3.5"})})]}):d.jsx("div",{className:"text-xs font-medium truncate cursor-text hover:text-primary transition-colors",onClick:()=>i(!0),title:"Click to rename",children:e.name}),d.jsx("div",{className:"text-[10px] text-muted-foreground/60 font-mono truncate",children:e.path})]}),d.jsx("button",{onClick:()=>n({enabled:!e.enabled}),disabled:t,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",title:e.enabled?"Hide project":"Show project",children:e.enabled?d.jsx(ih,{className:"h-3.5 w-3.5"}):d.jsx(rh,{className:"h-3.5 w-3.5"})})]})}function ND({value:e,onChange:t,disabled:n}){return d.jsxs(En,{children:[d.jsx(Tn,{asChild:!0,children:d.jsx("button",{disabled:n,className:"h-5 w-5 rounded-full border border-white/20 shrink-0 transition-shadow hover:shadow-[0_0_8px_currentColor] disabled:opacity-50",style:{backgroundColor:`hsl(${e})`},title:"Change color"})}),d.jsx(on,{side:"bottom",align:"start",className:"w-auto p-2",children:d.jsx("div",{className:"grid grid-cols-5 gap-2",children:jD.map(r=>d.jsx("button",{onClick:()=>t(r),className:F("h-6 w-6 rounded-full border-2 transition-transform hover:scale-110",r===e?"border-white shadow-[0_0_8px_hsl(var(--primary))]":"border-transparent hover:border-white/40"),style:{backgroundColor:`hsl(${r})`}},r))})})]})}function PD({countOverrides:e}={}){const{projects:t,activeProjectId:n,setActiveProjectId:r,hasMultipleProjects:i}=Gt(),[s,o]=m.useState(!1);if(!i)return null;const a=n===null;return d.jsxs("div",{className:"project-tab-bar -mt-8 mb-3 flex items-center gap-0.5 overflow-x-auto rounded border border-white/[0.08] px-1 py-1",children:[d.jsxs("button",{type:"button",onClick:()=>r(null),className:F("flex items-center gap-1.5 rounded px-3 py-1.5 text-xs font-medium whitespace-nowrap","transition-all duration-300 ease-in-out border-b-2",a?"text-foreground":"text-muted-foreground border-transparent hover:text-foreground hover:bg-white/[0.06]"),style:a?{background:"rgba(255, 255, 255, 0.08)",boxShadow:"0 2px 12px rgba(255, 255, 255, 0.12)",borderBottomColor:"rgba(255, 255, 255, 0.50)"}:void 0,children:[d.jsx(Ts,{className:"h-3 w-3"}),"All Projects",d.jsx("span",{className:F("ml-1 rounded-full px-1.5 py-0.5 text-[10px] tabular-nums border",a?"glass-pill":"bg-muted border-transparent"),children:e?t.filter(l=>l.enabled).reduce((l,c)=>l+(e[c.id]??0),0):t.filter(l=>l.enabled).reduce((l,c)=>l+c.scopeCount,0)})]}),d.jsx("div",{className:"mx-0.5 h-4 w-px bg-white/[0.08]"}),t.filter(l=>l.enabled).map(l=>{const c=n===l.id;return d.jsxs("button",{type:"button",onClick:()=>r(l.id),className:F("flex items-center gap-1.5 rounded px-3 py-1.5 text-xs font-medium whitespace-nowrap","transition-all duration-300 ease-in-out border-b-2",c?"text-foreground":"text-muted-foreground border-transparent hover:text-foreground hover:bg-white/[0.06]"),style:c?{background:`hsl(${l.color} / 0.10)`,boxShadow:`0 2px 12px hsl(${l.color} / 0.25)`,borderBottomColor:`hsl(${l.color} / 0.50)`}:void 0,children:[d.jsx("span",{className:F("h-2 w-2 rounded-full shrink-0 transition-shadow duration-300",c&&"shadow-[0_0_6px_currentColor]"),style:{backgroundColor:`hsl(${l.color})`}}),l.name,d.jsx("span",{className:F("ml-1 rounded-full px-1.5 py-0.5 text-[10px] tabular-nums border",c?"glass-pill":"bg-muted border-transparent"),children:e?e[l.id]??0:l.scopeCount}),l.status==="offline"&&d.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"(offline)"})]},l.id)}),d.jsx("div",{className:"ml-auto shrink-0 pl-1",children:d.jsx("button",{type:"button",onClick:()=>o(!0),className:"flex items-center justify-center rounded p-1.5 text-muted-foreground/60 hover:text-foreground hover:bg-white/[0.06] transition-colors",title:"Project settings",children:d.jsx(S0,{className:"h-3.5 w-3.5"})})}),d.jsx(ED,{open:s,onClose:()=>o(!1),projects:t})]})}function AD({open:e,edges:t,onSelect:n,onCancel:r}){return!e||t.length===0?null:d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:d.jsxs("div",{className:"card-glass w-80 rounded-lg border border-border bg-card p-4 shadow-xl space-y-3",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Choose Transition"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Multiple transitions are available for this move. Select one:"}),d.jsx("div",{className:"space-y-1.5",children:t.map(i=>d.jsxs("button",{onClick:()=>n(i),className:"flex w-full items-center gap-2 rounded border border-border px-3 py-2 text-left text-xs hover:bg-muted/50 transition-colors",children:[d.jsx("span",{className:"font-medium",children:i.label??`${i.from} → ${i.to}`}),i.description&&d.jsx("span",{className:"text-muted-foreground/70 truncate",children:i.description})]},`${i.from}-${i.to}`))}),d.jsx("div",{className:"flex justify-end pt-1",children:d.jsx("button",{onClick:r,className:"rounded px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"})})]})})}function _D(){var jt,cn,un,Mt,dn,Yn,oc,ac;const e=Yt(),{scopes:t,loading:n}=dh(),{engine:r}=sn(),{activeProjectId:i,projects:s,projectEngines:o,hasMultipleProjects:a}=Gt(),{sortField:l,sortDirection:c,setSort:u,collapsed:f,toggleCollapse:h}=C1(),{viewMode:p,setViewMode:g,groupField:b,setGroupField:y,collapsedLanes:x,toggleLaneCollapse:v}=A1(),{display:C,toggle:j,hiddenCount:w}=f1(),[k,P]=m.useState(null),N=m.useMemo(()=>t.find(q=>ce(q)===k)??null,[t,k]),[M,T]=m.useState(null),R=m.useMemo(()=>r.getBoardColumns(),[r]),A=a&&i===null,_=m.useMemo(()=>!A||o.size===0?null:CD(t,o),[A,t,o]),L=(_==null?void 0:_.columns)??R,I=m.useMemo(()=>{const q=new Map;for(const se of s)q.set(se.id,se);return q.size>0?q:void 0},[s]),{sprints:W,createSprint:D,renameSprint:$,deleteSprint:z,addScopes:S,removeScopes:H,dispatchSprint:oe,getGraph:E,moveSprintToProject:K}=F1(),[X,U]=m.useState(null),Le=A?(jt=s.find(q=>q.enabled))==null?void 0:jt.id:void 0,{filters:Ce,toggleFilter:Re,clearField:ge,clearAll:me,hasActiveFilters:je,filteredScopes:be,optionsWithCounts:de}=y1(t),fe=$1(be),{highlightedScopeKey:Te,clearHighlight:nt}=U1(),Je=m.useMemo(()=>{if(Te==null)return fe.dimmedIds;const q=new Set;for(const se of fe.displayScopes)ce(se)!==Te&&q.add(ce(se));return q},[Te,fe.dimmedIds,fe.displayScopes]);m.useEffect(()=>{if(Te==null)return;const q=setTimeout(()=>{document.addEventListener("click",nt,{once:!0})},100);return()=>{clearTimeout(q),document.removeEventListener("click",nt)}},[Te,nt]);const{state:Y,onDragStart:$e,onDragOver:ut,onDragEnd:Qe,confirmTransition:Ne,cancelTransition:De,dismissError:Fe,openModalFromPopover:O,openIdeaForm:B,closeIdeaForm:G,submitIdea:J,dismissSprintDispatch:ne,dismissUnmetDeps:he,resolveUnmetDeps:Ue,showUnmetDeps:We,selectDisambiguation:it,dismissDisambiguation:Be}=L1({scopes:fe.displayScopes,sprints:W,onAddToSprint:S,onRemoveFromSprint:H,isPhaseView:A&&_!=null&&!_.isUnified,projectEngines:A?o:void 0,defaultProjectId:Le}),xe=Gv(Rc(tl,{activationConstraint:{distance:8}}),Rc(Za)),He=_1(),ve=m.useMemo(()=>{const q=new Map;for(const se of t)q.set(ce(se),se);return q},[t]),Rt=m.useMemo(()=>{var pe;if(_){const Pe={};for(const Ei of _.columns)Pe[Ei.id]=[];for(const[Ei,Ys]of Object.entries(_.scopesByColumn)){const Kg=new Set(fe.displayScopes.map(Xs=>ce(Xs)));Pe[Ei]=Ma(sa(Ys.filter(Xs=>Kg.has(ce(Xs))),l,c))}return Pe}const q={};for(const Pe of R)q[Pe.id]=[];const se=r.getEntryPoint().id;for(const Pe of fe.displayScopes)q[Pe.status]?q[Pe.status].push(Pe):(pe=q[se])==null||pe.push(Pe);for(const Pe of Object.keys(q))q[Pe]=Ma(sa(q[Pe],l,c));return q},[fe.displayScopes,l,c,R,r,_]),zt=m.useMemo(()=>{const q={};for(const se of W){const pe=se.status!=="assembling"?r.getBatchTargetStatus(se.target_column)??se.target_column:se.target_column;(q[pe]??(q[pe]=[])).push(se)}return q},[W,r]),_r=m.useMemo(()=>{const q=new Set;for(const se of W){const pe=se.project_id??"";for(const Pe of se.scope_ids)q.add(pe?`${pe}::${Pe}`:String(Pe))}return q},[W]),Ze=m.useMemo(()=>{if(p!=="swimlane")return[];let q;if(A&&_&&!_.isUnified){const se=new Map;for(const[pe,Pe]of o)se.set(pe,new gr(Pe));q=pe=>{const Pe=se.get(pe.project_id??"");return Pe?Pe.getPhase(pe.status):"queued"}}return kD(fe.displayScopes,b,l,c,q,I)},[p,fe.displayScopes,b,l,c,A,_,o,I]),st=m.useMemo(()=>{if(Y.activeScope){if(W.some(se=>se.status==="assembling"&&se.scope_ids.includes(Y.activeScope.id)))return new Set([Y.activeScope.status]);if(A&&_&&!_.isUnified&&Y.activeScope.project_id){const se=o.get(Y.activeScope.project_id);if(se){const pe=se.getValidTargets(Y.activeScope.status),Pe=new gr(se);return new Set(pe.map(Ys=>Pe.getPhase(Ys)))}}return new Set(r.getValidTargets(Y.activeScope.status))}if(Y.activeSprint){const q=Y.activeSprint,se=q.status!=="assembling"?r.getBatchTargetStatus(q.target_column)??q.target_column:q.target_column;return new Set(r.getValidTargets(se))}return new Set},[Y.activeScope,Y.activeSprint,r,W,A,_,o]),qe=B1(Y.pendingSprintDispatch,E,oe,ne),{surpriseLoading:Vt,handleSurprise:pt,handleApproveGhost:dt,handleRejectGhost:St}=z1(G,T),Jt=m.useCallback(q=>{q.status===r.getEntryPoint().id?T(q):P(ce(q))},[r]),Ye=m.useCallback(async(q,se)=>{const pe=await S(q,se);pe&&pe.unmet_dependencies.length>0&&We(q,pe.unmet_dependencies)},[S,We]),$t=m.useCallback(async(q,se)=>{const pe=await D(q,{...se,projectId:Le});return pe&&U(ir(pe)),pe},[D,Le]),Ct=m.useCallback(async(q,se)=>{const pe=W.find(Pe=>Pe.id===q);pe!=null&&pe.project_id&&await K(q,pe.project_id,se)},[W,K]);return n&&t.length===0?d.jsx("div",{className:"flex h-64 items-center justify-center",children:d.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):d.jsx(qw,{sensors:xe,modifiers:He,collisionDetection:pD,onDragStart:$e,onDragOver:ut,onDragEnd:Qe,children:d.jsxs("div",{className:"flex flex-1 min-h-0 flex-col",children:[d.jsx(PD,{}),d.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[d.jsx(sh,{className:"h-4 w-4 text-primary shrink-0"}),d.jsx("h1",{className:"text-xl font-light shrink-0",children:"Kanban"}),d.jsxs("div",{className:"ml-auto flex items-center gap-2 shrink-0",children:[d.jsx(uD,{query:fe.query,mode:fe.mode,isStale:fe.isStale,onQueryChange:fe.setQuery,onModeChange:fe.setMode}),d.jsx(cD,{filters:Ce,optionsWithCounts:de,onToggle:Re,onClearField:ge,onClearAll:me,hasActiveFilters:je}),d.jsx($E,{viewMode:p,groupField:b,onViewModeChange:g,onGroupFieldChange:y}),d.jsx(BE,{display:C,onToggle:j,hiddenCount:w})]})]}),Y.error&&d.jsxs("div",{className:"mb-3 flex items-center gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[d.jsx("span",{className:"flex-1",children:Y.error}),d.jsx("button",{onClick:Fe,className:"shrink-0 hover:text-red-200 transition-colors",children:d.jsx(wt,{className:"h-3.5 w-3.5"})})]}),p==="swimlane"?d.jsx(HE,{lanes:Ze,columns:L,collapsedColumns:f,collapsedLanes:x,onToggleLane:v,onToggleCollapse:h,onScopeClick:Jt,cardDisplay:C,dimmedIds:Je,isDragActive:!!(Y.activeScope||Y.activeSprint),validTargets:st,sprints:W,projectLookup:I}):d.jsx("div",{className:"min-h-0 flex-1 overflow-x-auto overflow-y-hidden","data-tour":"kanban-board",children:d.jsx("div",{className:"flex h-full w-max gap-2 pb-4",children:L.map(q=>d.jsx(NE,{id:q.id,label:q.label,color:q.color,scopes:Rt[q.id]??[],sprints:zt[q.id],scopeLookup:ve,globalSprintScopeIds:_r,onScopeClick:Jt,onDeleteSprint:z,onRenameSprint:(se,pe)=>$(se,pe),editingSprintId:X,onSprintEditingDone:()=>U(null),onAddAllToSprint:Ye,isDragActive:!!(Y.activeScope||Y.activeSprint),isValidDrop:st.has(q.id),sortField:l,sortDirection:c,onSetSort:u,collapsed:f.has(q.id),onToggleCollapse:()=>h(q.id),cardDisplay:C,dimmedIds:Je,projectLookup:I,onProjectChange:Ct,headerExtra:A&&_&&!_.isUnified?void 0:d.jsx(hD,{columnId:q.id,dispatching:Y.dispatching,onOpenIdeaForm:B,onCreateGroup:$t})},q.id))})}),d.jsx(qE,{activeScope:Y.activeScope,activeSprint:Y.activeSprint,cardDisplay:C,projectLookup:I,scopeLookup:ve}),d.jsx(GE,{open:Y.showPopover,scope:((cn=Y.pending)==null?void 0:cn.scope)??null,transition:((un=Y.pending)==null?void 0:un.transition)??null,hasActiveSession:((Mt=Y.pending)==null?void 0:Mt.hasActiveSession)??!1,dispatching:Y.dispatching,error:Y.error,onConfirm:Ne,onCancel:De,onViewDetails:O}),d.jsx(YE,{open:Y.showModal,scope:((dn=Y.pending)==null?void 0:dn.scope)??null,transition:((Yn=Y.pending)==null?void 0:Yn.transition)??null,hasActiveSession:((oc=Y.pending)==null?void 0:oc.hasActiveSession)??!1,dispatching:Y.dispatching,error:Y.error,onConfirm:Ne,onCancel:De}),d.jsx(rD,{scope:N,open:!!N,onClose:()=>P(null)}),d.jsx(iD,{open:Y.showIdeaForm,loading:Y.dispatching,onSubmit:J,onCancel:G,onSurprise:pt,surpriseLoading:Vt}),d.jsx(sD,{scope:M,open:!!M,onClose:()=>T(null),onDelete:q=>{T(null),fetch(e(`/ideas/${q}`),{method:"DELETE"}).catch(()=>{})},onApprove:dt,onReject:St}),d.jsx(dD,{open:qe.showPreflight,sprint:qe.pendingSprint,graph:qe.graph,loading:qe.loading,onConfirm:qe.onConfirm,onCancel:qe.onCancel}),d.jsx(fD,{open:Y.pendingUnmetDeps!=null,unmetDeps:Y.pendingUnmetDeps??[],onAddAll:Ue,onCancel:he}),d.jsx(AD,{open:Y.pendingDisambiguation!=null,edges:((ac=Y.pendingDisambiguation)==null?void 0:ac.edges)??[],onSelect:it,onCancel:Be})]})})}const Vg=()=>Hn(()=>import("./PrimitivesConfig-DThSipFy.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.PrimitivesConfig})),$g=()=>Hn(()=>import("./QualityGates-B4kxM5UU.js"),__vite__mapDeps([11,1,2,12,3,13,6,7,14,10])).then(e=>({default:e.QualityGates})),Ug=()=>Hn(()=>import("./SourceControl-BMNIz7Lt.js"),__vite__mapDeps([15,1,2,12,10,8,9,16,17,14])).then(e=>({default:e.SourceControl})),Wg=()=>Hn(()=>import("./SessionTimeline-Bz1iZnmg.js"),__vite__mapDeps([18,1,2,7,10])).then(e=>({default:e.SessionTimeline})),Hg=()=>Hn(()=>import("./Settings-DLcZwbCT.js"),__vite__mapDeps([19,1,2,20,10])).then(e=>({default:e.Settings})),qg=()=>Hn(()=>import("./WorkflowVisualizer-CxuSBOYu.js"),__vite__mapDeps([21,1,2,10,6,3,16,9,22,5,20,13,4,14,23])),RD=()=>Hn(()=>import("./Landing-CfQdHR0N.js"),__vite__mapDeps([24,1,2,6,4,17,22,10])).then(e=>({default:e.Landing})),MD=m.lazy(Vg),DD=m.lazy($g),OD=m.lazy(Ug),ID=m.lazy(Wg),LD=m.lazy(Hg),FD=m.lazy(qg),BD=m.lazy(RD);requestIdleCallback(()=>{Vg(),$g(),Ug(),Wg(),Hg(),qg()});class zD extends m.Component{constructor(){super(...arguments);yt(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){console.error("Onboarding error:",n)}render(){return this.state.hasError?d.jsx(pc,{children:this.props.children}):d.jsx(xb,{children:d.jsx(pc,{children:this.props.children})})}}function VD(){const e=hb();return d.jsx(Yf.Provider,{value:e,children:d.jsx(zD,{children:d.jsxs(Cx,{children:[d.jsx(Dt,{path:"landing",element:d.jsx(m.Suspense,{fallback:null,children:d.jsx(BD,{})})}),d.jsxs(Dt,{element:d.jsx(Dv,{}),children:[d.jsx(Dt,{index:!0,element:d.jsx(_D,{})}),d.jsx(Dt,{path:"primitives",element:d.jsx(MD,{})}),d.jsx(Dt,{path:"guards",element:d.jsx(DD,{})}),d.jsx(Dt,{path:"gates",element:d.jsx(cc,{to:"/guards",replace:!0})}),d.jsx(Dt,{path:"enforcement",element:d.jsx(cc,{to:"/guards",replace:!0})}),d.jsx(Dt,{path:"repo",element:d.jsx(OD,{})}),d.jsx(Dt,{path:"sessions",element:d.jsx(ID,{})}),d.jsx(Dt,{path:"workflow",element:d.jsx(FD,{})}),d.jsx(Dt,{path:"settings",element:d.jsx(LD,{})})]})]})})})}function $D(){return d.jsx(Sx,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:d.jsx(cb,{children:d.jsx(ub,{children:d.jsx(VD,{})})})})}try{CSS.registerProperty({name:"--dispatch-angle",syntax:"<angle>",initialValue:"0deg",inherits:!1})}catch{}Tx.createRoot(document.getElementById("root")).render(d.jsx(Ie.StrictMode,{children:d.jsx(lh,{children:d.jsx(G0,{children:d.jsx($D,{})})})}));export{Rf as $,ZD as A,Ve as B,eh as C,qw as D,ih as E,Db as F,Zb as G,D0 as H,t0 as I,es as J,dh as K,Ts as L,gE as M,xE as N,Vl as O,ts as P,Ib as Q,Va as R,T0 as S,wn as T,Qo as U,Es as V,lb as W,wt as X,ly as Y,cy as Z,Fb as _,F as a,Cp as a$,r0 as a0,Pn as a1,rO as a2,an as a3,Kn as a4,An as a5,_n as a6,nh as a7,Sr as a8,$i as a9,GD as aA,j0 as aB,Cb as aC,we as aD,JD as aE,Jv as aF,Ja as aG,is as aH,Wh as aI,Rs as aJ,nn as aK,YD as aL,Ga as aM,mr as aN,xi as aO,Za as aP,XD as aQ,R0 as aR,s0 as aS,$0 as aT,D1 as aU,W0 as aV,rb as aW,_e as aX,kn as aY,qk as aZ,xr as a_,Bt as aa,Cn as ab,TR as ac,dM as ad,rf as ae,oO as af,sO as ag,Gs as ah,Cr as ai,_t as aj,ys as ak,oh as al,y0 as am,iO as an,gv as ao,g0 as ap,$b as aq,Yb as ar,rh as as,En as at,Tn as au,on as av,jD as aw,Wa as ax,ch as ay,mb as az,ri as b,iC as b0,oC as b1,rn as b2,rt as b3,gt as b4,Vk as b5,ll as b6,Yh as b7,eO as b8,li as b9,cl as ba,at as bb,tO as bc,lu as bd,gs as be,$a as bf,sh as bg,te as c,B0 as d,Yt as e,Ns as f,hr as g,ke as h,Rb as i,Y0 as j,sn as k,ob as l,QD as m,rl as n,zl as o,I0 as p,Gt as q,Gv as r,Q as s,Rc as t,Uh as u,_1 as v,PD as w,p0 as x,c1 as y,tl as z};
|