@akiojin/gwt 4.12.1 → 6.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.ja.md +173 -203
- package/README.md +170 -212
- package/bin/gwt +0 -0
- package/bin/gwt.js +42 -33
- package/package.json +20 -107
- package/scripts/postinstall.js +152 -0
- package/dist/claude-history.d.ts +0 -60
- package/dist/claude-history.d.ts.map +0 -1
- package/dist/claude-history.js +0 -606
- package/dist/claude-history.js.map +0 -1
- package/dist/claude.d.ts +0 -42
- package/dist/claude.d.ts.map +0 -1
- package/dist/claude.js +0 -429
- package/dist/claude.js.map +0 -1
- package/dist/cli/ui/App.solid.d.ts +0 -29
- package/dist/cli/ui/App.solid.d.ts.map +0 -1
- package/dist/cli/ui/App.solid.js +0 -1427
- package/dist/cli/ui/App.solid.js.map +0 -1
- package/dist/cli/ui/components/solid/Footer.d.ts +0 -10
- package/dist/cli/ui/components/solid/Footer.d.ts.map +0 -1
- package/dist/cli/ui/components/solid/Footer.js +0 -10
- package/dist/cli/ui/components/solid/Footer.js.map +0 -1
- package/dist/cli/ui/components/solid/Header.d.ts +0 -32
- package/dist/cli/ui/components/solid/Header.d.ts.map +0 -1
- package/dist/cli/ui/components/solid/Header.js +0 -13
- package/dist/cli/ui/components/solid/Header.js.map +0 -1
- package/dist/cli/ui/components/solid/HelpOverlay.d.ts +0 -8
- package/dist/cli/ui/components/solid/HelpOverlay.d.ts.map +0 -1
- package/dist/cli/ui/components/solid/HelpOverlay.js +0 -118
- package/dist/cli/ui/components/solid/HelpOverlay.js.map +0 -1
- package/dist/cli/ui/components/solid/QuickStartStep.d.ts +0 -17
- package/dist/cli/ui/components/solid/QuickStartStep.d.ts.map +0 -1
- package/dist/cli/ui/components/solid/QuickStartStep.js +0 -152
- package/dist/cli/ui/components/solid/QuickStartStep.js.map +0 -1
- package/dist/cli/ui/components/solid/SelectInput.d.ts +0 -22
- package/dist/cli/ui/components/solid/SelectInput.d.ts.map +0 -1
- package/dist/cli/ui/components/solid/SelectInput.js +0 -45
- package/dist/cli/ui/components/solid/SelectInput.js.map +0 -1
- package/dist/cli/ui/components/solid/TextInput.d.ts +0 -12
- package/dist/cli/ui/components/solid/TextInput.d.ts.map +0 -1
- package/dist/cli/ui/components/solid/TextInput.js +0 -9
- package/dist/cli/ui/components/solid/TextInput.js.map +0 -1
- package/dist/cli/ui/components/solid/WizardController.d.ts +0 -34
- package/dist/cli/ui/components/solid/WizardController.d.ts.map +0 -1
- package/dist/cli/ui/components/solid/WizardController.js +0 -269
- package/dist/cli/ui/components/solid/WizardController.js.map +0 -1
- package/dist/cli/ui/components/solid/WizardPopup.d.ts +0 -26
- package/dist/cli/ui/components/solid/WizardPopup.d.ts.map +0 -1
- package/dist/cli/ui/components/solid/WizardPopup.js +0 -68
- package/dist/cli/ui/components/solid/WizardPopup.js.map +0 -1
- package/dist/cli/ui/components/solid/WizardSteps.d.ts +0 -57
- package/dist/cli/ui/components/solid/WizardSteps.d.ts.map +0 -1
- package/dist/cli/ui/components/solid/WizardSteps.js +0 -442
- package/dist/cli/ui/components/solid/WizardSteps.js.map +0 -1
- package/dist/cli/ui/core/index.d.ts +0 -12
- package/dist/cli/ui/core/index.d.ts.map +0 -1
- package/dist/cli/ui/core/index.js +0 -15
- package/dist/cli/ui/core/index.js.map +0 -1
- package/dist/cli/ui/core/keybindings.d.ts +0 -106
- package/dist/cli/ui/core/keybindings.d.ts.map +0 -1
- package/dist/cli/ui/core/keybindings.js +0 -270
- package/dist/cli/ui/core/keybindings.js.map +0 -1
- package/dist/cli/ui/core/theme.d.ts +0 -123
- package/dist/cli/ui/core/theme.d.ts.map +0 -1
- package/dist/cli/ui/core/theme.js +0 -191
- package/dist/cli/ui/core/theme.js.map +0 -1
- package/dist/cli/ui/core/types.d.ts +0 -156
- package/dist/cli/ui/core/types.d.ts.map +0 -1
- package/dist/cli/ui/core/types.js +0 -10
- package/dist/cli/ui/core/types.js.map +0 -1
- package/dist/cli/ui/hooks/solid/useScrollableList.d.ts +0 -26
- package/dist/cli/ui/hooks/solid/useScrollableList.d.ts.map +0 -1
- package/dist/cli/ui/hooks/solid/useScrollableList.js +0 -89
- package/dist/cli/ui/hooks/solid/useScrollableList.js.map +0 -1
- package/dist/cli/ui/hooks/solid/useTerminalSize.d.ts +0 -10
- package/dist/cli/ui/hooks/solid/useTerminalSize.d.ts.map +0 -1
- package/dist/cli/ui/hooks/solid/useTerminalSize.js +0 -16
- package/dist/cli/ui/hooks/solid/useTerminalSize.js.map +0 -1
- package/dist/cli/ui/index.solid.d.ts +0 -5
- package/dist/cli/ui/index.solid.d.ts.map +0 -1
- package/dist/cli/ui/index.solid.js +0 -21
- package/dist/cli/ui/index.solid.js.map +0 -1
- package/dist/cli/ui/screens/solid/BranchListScreen.d.ts +0 -53
- package/dist/cli/ui/screens/solid/BranchListScreen.d.ts.map +0 -1
- package/dist/cli/ui/screens/solid/BranchListScreen.js +0 -829
- package/dist/cli/ui/screens/solid/BranchListScreen.js.map +0 -1
- package/dist/cli/ui/screens/solid/ConfirmScreen.d.ts +0 -11
- package/dist/cli/ui/screens/solid/ConfirmScreen.d.ts.map +0 -1
- package/dist/cli/ui/screens/solid/ConfirmScreen.js +0 -45
- package/dist/cli/ui/screens/solid/ConfirmScreen.js.map +0 -1
- package/dist/cli/ui/screens/solid/EnvironmentScreen.d.ts +0 -14
- package/dist/cli/ui/screens/solid/EnvironmentScreen.d.ts.map +0 -1
- package/dist/cli/ui/screens/solid/EnvironmentScreen.js +0 -90
- package/dist/cli/ui/screens/solid/EnvironmentScreen.js.map +0 -1
- package/dist/cli/ui/screens/solid/ErrorScreen.d.ts +0 -8
- package/dist/cli/ui/screens/solid/ErrorScreen.d.ts.map +0 -1
- package/dist/cli/ui/screens/solid/ErrorScreen.js +0 -18
- package/dist/cli/ui/screens/solid/ErrorScreen.js.map +0 -1
- package/dist/cli/ui/screens/solid/InputScreen.d.ts +0 -13
- package/dist/cli/ui/screens/solid/InputScreen.d.ts.map +0 -1
- package/dist/cli/ui/screens/solid/InputScreen.js +0 -17
- package/dist/cli/ui/screens/solid/InputScreen.js.map +0 -1
- package/dist/cli/ui/screens/solid/LoadingIndicator.d.ts +0 -9
- package/dist/cli/ui/screens/solid/LoadingIndicator.d.ts.map +0 -1
- package/dist/cli/ui/screens/solid/LoadingIndicator.js +0 -43
- package/dist/cli/ui/screens/solid/LoadingIndicator.js.map +0 -1
- package/dist/cli/ui/screens/solid/LogDetailScreen.d.ts +0 -14
- package/dist/cli/ui/screens/solid/LogDetailScreen.d.ts.map +0 -1
- package/dist/cli/ui/screens/solid/LogDetailScreen.js +0 -34
- package/dist/cli/ui/screens/solid/LogDetailScreen.js.map +0 -1
- package/dist/cli/ui/screens/solid/LogScreen.d.ts +0 -25
- package/dist/cli/ui/screens/solid/LogScreen.d.ts.map +0 -1
- package/dist/cli/ui/screens/solid/LogScreen.js +0 -333
- package/dist/cli/ui/screens/solid/LogScreen.js.map +0 -1
- package/dist/cli/ui/screens/solid/ProfileEnvScreen.d.ts +0 -17
- package/dist/cli/ui/screens/solid/ProfileEnvScreen.d.ts.map +0 -1
- package/dist/cli/ui/screens/solid/ProfileEnvScreen.js +0 -115
- package/dist/cli/ui/screens/solid/ProfileEnvScreen.js.map +0 -1
- package/dist/cli/ui/screens/solid/ProfileScreen.d.ts +0 -17
- package/dist/cli/ui/screens/solid/ProfileScreen.d.ts.map +0 -1
- package/dist/cli/ui/screens/solid/ProfileScreen.js +0 -50
- package/dist/cli/ui/screens/solid/ProfileScreen.js.map +0 -1
- package/dist/cli/ui/screens/solid/SelectorScreen.d.ts +0 -20
- package/dist/cli/ui/screens/solid/SelectorScreen.d.ts.map +0 -1
- package/dist/cli/ui/screens/solid/SelectorScreen.js +0 -98
- package/dist/cli/ui/screens/solid/SelectorScreen.js.map +0 -1
- package/dist/cli/ui/screens/solid/WorktreeCreateScreen.d.ts +0 -13
- package/dist/cli/ui/screens/solid/WorktreeCreateScreen.d.ts.map +0 -1
- package/dist/cli/ui/screens/solid/WorktreeCreateScreen.js +0 -59
- package/dist/cli/ui/screens/solid/WorktreeCreateScreen.js.map +0 -1
- package/dist/cli/ui/stores/appStore.d.ts +0 -143
- package/dist/cli/ui/stores/appStore.d.ts.map +0 -1
- package/dist/cli/ui/stores/appStore.js +0 -158
- package/dist/cli/ui/stores/appStore.js.map +0 -1
- package/dist/cli/ui/stores/branchStore.d.ts +0 -159
- package/dist/cli/ui/stores/branchStore.d.ts.map +0 -1
- package/dist/cli/ui/stores/branchStore.js +0 -275
- package/dist/cli/ui/stores/branchStore.js.map +0 -1
- package/dist/cli/ui/stores/index.d.ts +0 -11
- package/dist/cli/ui/stores/index.d.ts.map +0 -1
- package/dist/cli/ui/stores/index.js +0 -14
- package/dist/cli/ui/stores/index.js.map +0 -1
- package/dist/cli/ui/stores/uiStore.d.ts +0 -146
- package/dist/cli/ui/stores/uiStore.d.ts.map +0 -1
- package/dist/cli/ui/stores/uiStore.js +0 -166
- package/dist/cli/ui/stores/uiStore.js.map +0 -1
- package/dist/cli/ui/types.d.ts +0 -293
- package/dist/cli/ui/types.d.ts.map +0 -1
- package/dist/cli/ui/types.js +0 -2
- package/dist/cli/ui/types.js.map +0 -1
- package/dist/cli/ui/utils/baseBranch.d.ts +0 -4
- package/dist/cli/ui/utils/baseBranch.d.ts.map +0 -1
- package/dist/cli/ui/utils/baseBranch.js +0 -17
- package/dist/cli/ui/utils/baseBranch.js.map +0 -1
- package/dist/cli/ui/utils/branchFormatter.d.ts +0 -19
- package/dist/cli/ui/utils/branchFormatter.d.ts.map +0 -1
- package/dist/cli/ui/utils/branchFormatter.js +0 -199
- package/dist/cli/ui/utils/branchFormatter.js.map +0 -1
- package/dist/cli/ui/utils/clipboard.d.ts +0 -7
- package/dist/cli/ui/utils/clipboard.d.ts.map +0 -1
- package/dist/cli/ui/utils/clipboard.js +0 -21
- package/dist/cli/ui/utils/clipboard.js.map +0 -1
- package/dist/cli/ui/utils/continueSession.d.ts +0 -36
- package/dist/cli/ui/utils/continueSession.d.ts.map +0 -1
- package/dist/cli/ui/utils/continueSession.js +0 -155
- package/dist/cli/ui/utils/continueSession.js.map +0 -1
- package/dist/cli/ui/utils/installedVersionCache.d.ts +0 -33
- package/dist/cli/ui/utils/installedVersionCache.d.ts.map +0 -1
- package/dist/cli/ui/utils/installedVersionCache.js +0 -59
- package/dist/cli/ui/utils/installedVersionCache.js.map +0 -1
- package/dist/cli/ui/utils/modelOptions.d.ts +0 -10
- package/dist/cli/ui/utils/modelOptions.d.ts.map +0 -1
- package/dist/cli/ui/utils/modelOptions.js +0 -155
- package/dist/cli/ui/utils/modelOptions.js.map +0 -1
- package/dist/cli/ui/utils/statisticsCalculator.d.ts +0 -9
- package/dist/cli/ui/utils/statisticsCalculator.d.ts.map +0 -1
- package/dist/cli/ui/utils/statisticsCalculator.js +0 -37
- package/dist/cli/ui/utils/statisticsCalculator.js.map +0 -1
- package/dist/cli/ui/utils/versionCache.d.ts +0 -37
- package/dist/cli/ui/utils/versionCache.d.ts.map +0 -1
- package/dist/cli/ui/utils/versionCache.js +0 -70
- package/dist/cli/ui/utils/versionCache.js.map +0 -1
- package/dist/cli/ui/utils/versionFetcher.d.ts +0 -41
- package/dist/cli/ui/utils/versionFetcher.d.ts.map +0 -1
- package/dist/cli/ui/utils/versionFetcher.js +0 -89
- package/dist/cli/ui/utils/versionFetcher.js.map +0 -1
- package/dist/client/assets/index-BbfV7Wuj.css +0 -1
- package/dist/client/assets/index-CoAyq5x1.js +0 -78
- package/dist/client/index.html +0 -13
- package/dist/codex.d.ts +0 -55
- package/dist/codex.d.ts.map +0 -1
- package/dist/codex.js +0 -329
- package/dist/codex.js.map +0 -1
- package/dist/config/builtin-coding-agents.d.ts +0 -27
- package/dist/config/builtin-coding-agents.d.ts.map +0 -1
- package/dist/config/builtin-coding-agents.js +0 -78
- package/dist/config/builtin-coding-agents.js.map +0 -1
- package/dist/config/constants.d.ts +0 -76
- package/dist/config/constants.d.ts.map +0 -1
- package/dist/config/constants.js +0 -92
- package/dist/config/constants.js.map +0 -1
- package/dist/config/env-history.d.ts +0 -4
- package/dist/config/env-history.d.ts.map +0 -1
- package/dist/config/env-history.js +0 -34
- package/dist/config/env-history.js.map +0 -1
- package/dist/config/index.d.ts +0 -51
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -225
- package/dist/config/index.js.map +0 -1
- package/dist/config/profiles.d.ts +0 -94
- package/dist/config/profiles.d.ts.map +0 -1
- package/dist/config/profiles.js +0 -284
- package/dist/config/profiles.js.map +0 -1
- package/dist/config/shared-env.d.ts +0 -41
- package/dist/config/shared-env.d.ts.map +0 -1
- package/dist/config/shared-env.js +0 -114
- package/dist/config/shared-env.js.map +0 -1
- package/dist/config/tools.d.ts +0 -50
- package/dist/config/tools.d.ts.map +0 -1
- package/dist/config/tools.js +0 -239
- package/dist/config/tools.js.map +0 -1
- package/dist/gemini.d.ts +0 -35
- package/dist/gemini.d.ts.map +0 -1
- package/dist/gemini.js +0 -299
- package/dist/gemini.js.map +0 -1
- package/dist/git.d.ts +0 -154
- package/dist/git.d.ts.map +0 -1
- package/dist/git.js +0 -1012
- package/dist/git.js.map +0 -1
- package/dist/github.d.ts +0 -14
- package/dist/github.d.ts.map +0 -1
- package/dist/github.js +0 -123
- package/dist/github.js.map +0 -1
- package/dist/index.d.ts +0 -16
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -782
- package/dist/index.js.map +0 -1
- package/dist/launcher.d.ts +0 -30
- package/dist/launcher.d.ts.map +0 -1
- package/dist/launcher.js +0 -185
- package/dist/launcher.js.map +0 -1
- package/dist/logging/agentOutput.d.ts +0 -21
- package/dist/logging/agentOutput.d.ts.map +0 -1
- package/dist/logging/agentOutput.js +0 -164
- package/dist/logging/agentOutput.js.map +0 -1
- package/dist/logging/formatter.d.ts +0 -15
- package/dist/logging/formatter.d.ts.map +0 -1
- package/dist/logging/formatter.js +0 -95
- package/dist/logging/formatter.js.map +0 -1
- package/dist/logging/logger.d.ts +0 -24
- package/dist/logging/logger.d.ts.map +0 -1
- package/dist/logging/logger.js +0 -79
- package/dist/logging/logger.js.map +0 -1
- package/dist/logging/reader.d.ts +0 -34
- package/dist/logging/reader.d.ts.map +0 -1
- package/dist/logging/reader.js +0 -178
- package/dist/logging/reader.js.map +0 -1
- package/dist/logging/rotation.d.ts +0 -6
- package/dist/logging/rotation.d.ts.map +0 -1
- package/dist/logging/rotation.js +0 -26
- package/dist/logging/rotation.js.map +0 -1
- package/dist/opentui/highlights-eq9cgrbb.scm +0 -604
- package/dist/opentui/highlights-ghv9g403.scm +0 -205
- package/dist/opentui/highlights-hk7bwhj4.scm +0 -284
- package/dist/opentui/highlights-r812a2qc.scm +0 -150
- package/dist/opentui/highlights-x6tmsnaa.scm +0 -115
- package/dist/opentui/index.solid.d.ts +0 -2
- package/dist/opentui/index.solid.d.ts.map +0 -1
- package/dist/opentui/index.solid.js +0 -53721
- package/dist/opentui/index.solid.js.map +0 -1
- package/dist/opentui/injections-73j83es3.scm +0 -27
- package/dist/opentui/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/opentui/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/opentui/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/opentui/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/opentui/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/dist/repositories/git.repository.d.ts +0 -38
- package/dist/repositories/git.repository.d.ts.map +0 -1
- package/dist/repositories/git.repository.js +0 -117
- package/dist/repositories/git.repository.js.map +0 -1
- package/dist/repositories/github.repository.d.ts +0 -16
- package/dist/repositories/github.repository.d.ts.map +0 -1
- package/dist/repositories/github.repository.js +0 -61
- package/dist/repositories/github.repository.js.map +0 -1
- package/dist/repositories/worktree.repository.d.ts +0 -19
- package/dist/repositories/worktree.repository.d.ts.map +0 -1
- package/dist/repositories/worktree.repository.js +0 -64
- package/dist/repositories/worktree.repository.js.map +0 -1
- package/dist/services/BatchMergeService.d.ts +0 -45
- package/dist/services/BatchMergeService.d.ts.map +0 -1
- package/dist/services/BatchMergeService.js +0 -197
- package/dist/services/BatchMergeService.js.map +0 -1
- package/dist/services/WorktreeOrchestrator.d.ts +0 -37
- package/dist/services/WorktreeOrchestrator.d.ts.map +0 -1
- package/dist/services/WorktreeOrchestrator.js +0 -74
- package/dist/services/WorktreeOrchestrator.js.map +0 -1
- package/dist/services/codingAgentCommandResolver.d.ts +0 -10
- package/dist/services/codingAgentCommandResolver.d.ts.map +0 -1
- package/dist/services/codingAgentCommandResolver.js +0 -81
- package/dist/services/codingAgentCommandResolver.js.map +0 -1
- package/dist/services/codingAgentResolver.d.ts +0 -43
- package/dist/services/codingAgentResolver.d.ts.map +0 -1
- package/dist/services/codingAgentResolver.js +0 -269
- package/dist/services/codingAgentResolver.js.map +0 -1
- package/dist/services/dependency-installer.d.ts +0 -26
- package/dist/services/dependency-installer.d.ts.map +0 -1
- package/dist/services/dependency-installer.js +0 -134
- package/dist/services/dependency-installer.js.map +0 -1
- package/dist/services/git.service.d.ts +0 -27
- package/dist/services/git.service.d.ts.map +0 -1
- package/dist/services/git.service.js +0 -97
- package/dist/services/git.service.js.map +0 -1
- package/dist/services/github.service.d.ts +0 -14
- package/dist/services/github.service.d.ts.map +0 -1
- package/dist/services/github.service.js +0 -52
- package/dist/services/github.service.js.map +0 -1
- package/dist/services/worktree.service.d.ts +0 -20
- package/dist/services/worktree.service.d.ts.map +0 -1
- package/dist/services/worktree.service.js +0 -52
- package/dist/services/worktree.service.js.map +0 -1
- package/dist/shared/codingAgentConstants.d.ts +0 -12
- package/dist/shared/codingAgentConstants.d.ts.map +0 -1
- package/dist/shared/codingAgentConstants.js +0 -95
- package/dist/shared/codingAgentConstants.js.map +0 -1
- package/dist/types/api.d.ts +0 -225
- package/dist/types/api.d.ts.map +0 -1
- package/dist/types/api.js +0 -8
- package/dist/types/api.js.map +0 -1
- package/dist/types/coding-agent.d.ts +0 -62
- package/dist/types/coding-agent.d.ts.map +0 -1
- package/dist/types/coding-agent.js +0 -29
- package/dist/types/coding-agent.js.map +0 -1
- package/dist/types/profiles.d.ts +0 -54
- package/dist/types/profiles.d.ts.map +0 -1
- package/dist/types/profiles.js +0 -33
- package/dist/types/profiles.js.map +0 -1
- package/dist/types/tools.d.ts +0 -230
- package/dist/types/tools.d.ts.map +0 -1
- package/dist/types/tools.js +0 -8
- package/dist/types/tools.js.map +0 -1
- package/dist/utils/bun-runtime.d.ts +0 -12
- package/dist/utils/bun-runtime.d.ts.map +0 -1
- package/dist/utils/bun-runtime.js +0 -13
- package/dist/utils/bun-runtime.js.map +0 -1
- package/dist/utils/coding-agent-colors.d.ts +0 -88
- package/dist/utils/coding-agent-colors.d.ts.map +0 -1
- package/dist/utils/coding-agent-colors.js +0 -137
- package/dist/utils/coding-agent-colors.js.map +0 -1
- package/dist/utils/command.d.ts +0 -62
- package/dist/utils/command.d.ts.map +0 -1
- package/dist/utils/command.js +0 -186
- package/dist/utils/command.js.map +0 -1
- package/dist/utils/error-utils.d.ts +0 -27
- package/dist/utils/error-utils.d.ts.map +0 -1
- package/dist/utils/error-utils.js +0 -98
- package/dist/utils/error-utils.js.map +0 -1
- package/dist/utils/npmRegistry.d.ts +0 -61
- package/dist/utils/npmRegistry.d.ts.map +0 -1
- package/dist/utils/npmRegistry.js +0 -180
- package/dist/utils/npmRegistry.js.map +0 -1
- package/dist/utils/prompt.d.ts +0 -18
- package/dist/utils/prompt.d.ts.map +0 -1
- package/dist/utils/prompt.js +0 -107
- package/dist/utils/prompt.js.map +0 -1
- package/dist/utils/session/common.d.ts +0 -108
- package/dist/utils/session/common.d.ts.map +0 -1
- package/dist/utils/session/common.js +0 -439
- package/dist/utils/session/common.js.map +0 -1
- package/dist/utils/session/index.d.ts +0 -16
- package/dist/utils/session/index.d.ts.map +0 -1
- package/dist/utils/session/index.js +0 -20
- package/dist/utils/session/index.js.map +0 -1
- package/dist/utils/session/parsers/claude.d.ts +0 -62
- package/dist/utils/session/parsers/claude.d.ts.map +0 -1
- package/dist/utils/session/parsers/claude.js +0 -224
- package/dist/utils/session/parsers/claude.js.map +0 -1
- package/dist/utils/session/parsers/codex.d.ts +0 -37
- package/dist/utils/session/parsers/codex.d.ts.map +0 -1
- package/dist/utils/session/parsers/codex.js +0 -139
- package/dist/utils/session/parsers/codex.js.map +0 -1
- package/dist/utils/session/parsers/gemini.d.ts +0 -22
- package/dist/utils/session/parsers/gemini.d.ts.map +0 -1
- package/dist/utils/session/parsers/gemini.js +0 -118
- package/dist/utils/session/parsers/gemini.js.map +0 -1
- package/dist/utils/session/parsers/index.d.ts +0 -8
- package/dist/utils/session/parsers/index.d.ts.map +0 -1
- package/dist/utils/session/parsers/index.js +0 -12
- package/dist/utils/session/parsers/index.js.map +0 -1
- package/dist/utils/session/parsers/opencode.d.ts +0 -23
- package/dist/utils/session/parsers/opencode.d.ts.map +0 -1
- package/dist/utils/session/parsers/opencode.js +0 -126
- package/dist/utils/session/parsers/opencode.js.map +0 -1
- package/dist/utils/session/types.d.ts +0 -49
- package/dist/utils/session/types.d.ts.map +0 -1
- package/dist/utils/session/types.js +0 -5
- package/dist/utils/session/types.js.map +0 -1
- package/dist/utils/session.d.ts +0 -16
- package/dist/utils/session.d.ts.map +0 -1
- package/dist/utils/session.js +0 -16
- package/dist/utils/session.js.map +0 -1
- package/dist/utils/spinner.d.ts +0 -6
- package/dist/utils/spinner.d.ts.map +0 -1
- package/dist/utils/spinner.js +0 -47
- package/dist/utils/spinner.js.map +0 -1
- package/dist/utils/terminal.d.ts +0 -64
- package/dist/utils/terminal.d.ts.map +0 -1
- package/dist/utils/terminal.js +0 -270
- package/dist/utils/terminal.js.map +0 -1
- package/dist/utils/webui.d.ts +0 -8
- package/dist/utils/webui.d.ts.map +0 -1
- package/dist/utils/webui.js +0 -35
- package/dist/utils/webui.js.map +0 -1
- package/dist/utils.d.ts +0 -18
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -79
- package/dist/utils.js.map +0 -1
- package/dist/web/client/src/components/BranchGraph.d.ts +0 -13
- package/dist/web/client/src/components/BranchGraph.d.ts.map +0 -1
- package/dist/web/client/src/components/BranchGraph.js +0 -49
- package/dist/web/client/src/components/BranchGraph.js.map +0 -1
- package/dist/web/client/src/components/CodingAgentLaunchModal.d.ts +0 -9
- package/dist/web/client/src/components/CodingAgentLaunchModal.d.ts.map +0 -1
- package/dist/web/client/src/components/CodingAgentLaunchModal.js +0 -354
- package/dist/web/client/src/components/CodingAgentLaunchModal.js.map +0 -1
- package/dist/web/client/src/components/CustomCodingAgentForm.d.ts +0 -23
- package/dist/web/client/src/components/CustomCodingAgentForm.d.ts.map +0 -1
- package/dist/web/client/src/components/CustomCodingAgentForm.js +0 -209
- package/dist/web/client/src/components/CustomCodingAgentForm.js.map +0 -1
- package/dist/web/client/src/components/CustomCodingAgentList.d.ts +0 -10
- package/dist/web/client/src/components/CustomCodingAgentList.d.ts.map +0 -1
- package/dist/web/client/src/components/CustomCodingAgentList.js +0 -57
- package/dist/web/client/src/components/CustomCodingAgentList.js.map +0 -1
- package/dist/web/client/src/components/EnvEditor.d.ts +0 -20
- package/dist/web/client/src/components/EnvEditor.d.ts.map +0 -1
- package/dist/web/client/src/components/EnvEditor.js +0 -75
- package/dist/web/client/src/components/EnvEditor.js.map +0 -1
- package/dist/web/client/src/components/EnvironmentEditor.d.ts +0 -17
- package/dist/web/client/src/components/EnvironmentEditor.d.ts.map +0 -1
- package/dist/web/client/src/components/EnvironmentEditor.js +0 -22
- package/dist/web/client/src/components/EnvironmentEditor.js.map +0 -1
- package/dist/web/client/src/components/Terminal.d.ts +0 -15
- package/dist/web/client/src/components/Terminal.d.ts.map +0 -1
- package/dist/web/client/src/components/Terminal.js +0 -119
- package/dist/web/client/src/components/Terminal.js.map +0 -1
- package/dist/web/client/src/components/branch-detail/BranchInfoCards.d.ts +0 -10
- package/dist/web/client/src/components/branch-detail/BranchInfoCards.d.ts.map +0 -1
- package/dist/web/client/src/components/branch-detail/BranchInfoCards.js +0 -107
- package/dist/web/client/src/components/branch-detail/BranchInfoCards.js.map +0 -1
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.d.ts +0 -22
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.d.ts.map +0 -1
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.js +0 -80
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.js.map +0 -1
- package/dist/web/client/src/components/branch-detail/TerminalPanel.d.ts +0 -11
- package/dist/web/client/src/components/branch-detail/TerminalPanel.d.ts.map +0 -1
- package/dist/web/client/src/components/branch-detail/TerminalPanel.js +0 -32
- package/dist/web/client/src/components/branch-detail/TerminalPanel.js.map +0 -1
- package/dist/web/client/src/components/branch-detail/ToolLauncher.d.ts +0 -40
- package/dist/web/client/src/components/branch-detail/ToolLauncher.d.ts.map +0 -1
- package/dist/web/client/src/components/branch-detail/ToolLauncher.js +0 -147
- package/dist/web/client/src/components/branch-detail/ToolLauncher.js.map +0 -1
- package/dist/web/client/src/components/branch-detail/index.d.ts +0 -5
- package/dist/web/client/src/components/branch-detail/index.d.ts.map +0 -1
- package/dist/web/client/src/components/branch-detail/index.js +0 -5
- package/dist/web/client/src/components/branch-detail/index.js.map +0 -1
- package/dist/web/client/src/components/common/BranchCard.d.ts +0 -17
- package/dist/web/client/src/components/common/BranchCard.d.ts.map +0 -1
- package/dist/web/client/src/components/common/BranchCard.js +0 -36
- package/dist/web/client/src/components/common/BranchCard.js.map +0 -1
- package/dist/web/client/src/components/common/MetricCard.d.ts +0 -10
- package/dist/web/client/src/components/common/MetricCard.d.ts.map +0 -1
- package/dist/web/client/src/components/common/MetricCard.js +0 -10
- package/dist/web/client/src/components/common/MetricCard.js.map +0 -1
- package/dist/web/client/src/components/common/PageHeader.d.ts +0 -12
- package/dist/web/client/src/components/common/PageHeader.d.ts.map +0 -1
- package/dist/web/client/src/components/common/PageHeader.js +0 -14
- package/dist/web/client/src/components/common/PageHeader.js.map +0 -1
- package/dist/web/client/src/components/common/SearchInput.d.ts +0 -14
- package/dist/web/client/src/components/common/SearchInput.d.ts.map +0 -1
- package/dist/web/client/src/components/common/SearchInput.js +0 -15
- package/dist/web/client/src/components/common/SearchInput.js.map +0 -1
- package/dist/web/client/src/components/common/StatusBadge.d.ts +0 -10
- package/dist/web/client/src/components/common/StatusBadge.d.ts.map +0 -1
- package/dist/web/client/src/components/common/StatusBadge.js +0 -15
- package/dist/web/client/src/components/common/StatusBadge.js.map +0 -1
- package/dist/web/client/src/components/common/index.d.ts +0 -6
- package/dist/web/client/src/components/common/index.d.ts.map +0 -1
- package/dist/web/client/src/components/common/index.js +0 -6
- package/dist/web/client/src/components/common/index.js.map +0 -1
- package/dist/web/client/src/components/graph/BranchDetailPanel.d.ts +0 -15
- package/dist/web/client/src/components/graph/BranchDetailPanel.d.ts.map +0 -1
- package/dist/web/client/src/components/graph/BranchDetailPanel.js +0 -57
- package/dist/web/client/src/components/graph/BranchDetailPanel.js.map +0 -1
- package/dist/web/client/src/components/graph/BranchNode.d.ts +0 -13
- package/dist/web/client/src/components/graph/BranchNode.d.ts.map +0 -1
- package/dist/web/client/src/components/graph/BranchNode.js +0 -103
- package/dist/web/client/src/components/graph/BranchNode.js.map +0 -1
- package/dist/web/client/src/components/graph/ClusterNode.d.ts +0 -13
- package/dist/web/client/src/components/graph/ClusterNode.d.ts.map +0 -1
- package/dist/web/client/src/components/graph/ClusterNode.js +0 -109
- package/dist/web/client/src/components/graph/ClusterNode.js.map +0 -1
- package/dist/web/client/src/components/graph/SynapticCanvas.d.ts +0 -17
- package/dist/web/client/src/components/graph/SynapticCanvas.d.ts.map +0 -1
- package/dist/web/client/src/components/graph/SynapticCanvas.js +0 -94
- package/dist/web/client/src/components/graph/SynapticCanvas.js.map +0 -1
- package/dist/web/client/src/components/graph/SynapticEdge.d.ts +0 -13
- package/dist/web/client/src/components/graph/SynapticEdge.d.ts.map +0 -1
- package/dist/web/client/src/components/graph/SynapticEdge.js +0 -113
- package/dist/web/client/src/components/graph/SynapticEdge.js.map +0 -1
- package/dist/web/client/src/components/graph/graphUtils.d.ts +0 -67
- package/dist/web/client/src/components/graph/graphUtils.d.ts.map +0 -1
- package/dist/web/client/src/components/graph/graphUtils.js +0 -175
- package/dist/web/client/src/components/graph/graphUtils.js.map +0 -1
- package/dist/web/client/src/components/graph/index.d.ts +0 -10
- package/dist/web/client/src/components/graph/index.d.ts.map +0 -1
- package/dist/web/client/src/components/graph/index.js +0 -10
- package/dist/web/client/src/components/graph/index.js.map +0 -1
- package/dist/web/client/src/components/ui/alert.d.ts +0 -9
- package/dist/web/client/src/components/ui/alert.d.ts.map +0 -1
- package/dist/web/client/src/components/ui/alert.js +0 -25
- package/dist/web/client/src/components/ui/alert.js.map +0 -1
- package/dist/web/client/src/components/ui/badge.d.ts +0 -10
- package/dist/web/client/src/components/ui/badge.d.ts.map +0 -1
- package/dist/web/client/src/components/ui/badge.js +0 -25
- package/dist/web/client/src/components/ui/badge.js.map +0 -1
- package/dist/web/client/src/components/ui/button.d.ts +0 -12
- package/dist/web/client/src/components/ui/button.d.ts.map +0 -1
- package/dist/web/client/src/components/ui/button.js +0 -33
- package/dist/web/client/src/components/ui/button.js.map +0 -1
- package/dist/web/client/src/components/ui/card.d.ts +0 -9
- package/dist/web/client/src/components/ui/card.d.ts.map +0 -1
- package/dist/web/client/src/components/ui/card.js +0 -16
- package/dist/web/client/src/components/ui/card.js.map +0 -1
- package/dist/web/client/src/components/ui/index.d.ts +0 -8
- package/dist/web/client/src/components/ui/index.d.ts.map +0 -1
- package/dist/web/client/src/components/ui/index.js +0 -8
- package/dist/web/client/src/components/ui/index.js.map +0 -1
- package/dist/web/client/src/components/ui/input.d.ts +0 -4
- package/dist/web/client/src/components/ui/input.d.ts.map +0 -1
- package/dist/web/client/src/components/ui/input.js +0 -8
- package/dist/web/client/src/components/ui/input.js.map +0 -1
- package/dist/web/client/src/components/ui/select.d.ts +0 -14
- package/dist/web/client/src/components/ui/select.d.ts.map +0 -1
- package/dist/web/client/src/components/ui/select.js +0 -39
- package/dist/web/client/src/components/ui/select.js.map +0 -1
- package/dist/web/client/src/components/ui/table.d.ts +0 -11
- package/dist/web/client/src/components/ui/table.d.ts.map +0 -1
- package/dist/web/client/src/components/ui/table.js +0 -21
- package/dist/web/client/src/components/ui/table.js.map +0 -1
- package/dist/web/client/src/hooks/useBranches.d.ts +0 -16
- package/dist/web/client/src/hooks/useBranches.d.ts.map +0 -1
- package/dist/web/client/src/hooks/useBranches.js +0 -35
- package/dist/web/client/src/hooks/useBranches.js.map +0 -1
- package/dist/web/client/src/hooks/useConfig.d.ts +0 -13
- package/dist/web/client/src/hooks/useConfig.d.ts.map +0 -1
- package/dist/web/client/src/hooks/useConfig.js +0 -27
- package/dist/web/client/src/hooks/useConfig.js.map +0 -1
- package/dist/web/client/src/hooks/useSessions.d.ts +0 -21
- package/dist/web/client/src/hooks/useSessions.d.ts.map +0 -1
- package/dist/web/client/src/hooks/useSessions.js +0 -54
- package/dist/web/client/src/hooks/useSessions.js.map +0 -1
- package/dist/web/client/src/hooks/useWorktrees.d.ts +0 -17
- package/dist/web/client/src/hooks/useWorktrees.d.ts.map +0 -1
- package/dist/web/client/src/hooks/useWorktrees.js +0 -41
- package/dist/web/client/src/hooks/useWorktrees.js.map +0 -1
- package/dist/web/client/src/lib/api.d.ts +0 -82
- package/dist/web/client/src/lib/api.d.ts.map +0 -1
- package/dist/web/client/src/lib/api.js +0 -147
- package/dist/web/client/src/lib/api.js.map +0 -1
- package/dist/web/client/src/lib/coding-agent-colors.d.ts +0 -86
- package/dist/web/client/src/lib/coding-agent-colors.d.ts.map +0 -1
- package/dist/web/client/src/lib/coding-agent-colors.js +0 -135
- package/dist/web/client/src/lib/coding-agent-colors.js.map +0 -1
- package/dist/web/client/src/lib/utils.d.ts +0 -7
- package/dist/web/client/src/lib/utils.d.ts.map +0 -1
- package/dist/web/client/src/lib/utils.js +0 -10
- package/dist/web/client/src/lib/utils.js.map +0 -1
- package/dist/web/client/src/lib/websocket.d.ts +0 -59
- package/dist/web/client/src/lib/websocket.d.ts.map +0 -1
- package/dist/web/client/src/lib/websocket.js +0 -182
- package/dist/web/client/src/lib/websocket.js.map +0 -1
- package/dist/web/client/src/main.d.ts +0 -2
- package/dist/web/client/src/main.d.ts.map +0 -1
- package/dist/web/client/src/main.js +0 -23
- package/dist/web/client/src/main.js.map +0 -1
- package/dist/web/client/src/pages/BranchDetailPage.d.ts +0 -3
- package/dist/web/client/src/pages/BranchDetailPage.d.ts.map +0 -1
- package/dist/web/client/src/pages/BranchDetailPage.js +0 -365
- package/dist/web/client/src/pages/BranchDetailPage.js.map +0 -1
- package/dist/web/client/src/pages/BranchListPage.d.ts +0 -3
- package/dist/web/client/src/pages/BranchListPage.d.ts.map +0 -1
- package/dist/web/client/src/pages/BranchListPage.js +0 -118
- package/dist/web/client/src/pages/BranchListPage.js.map +0 -1
- package/dist/web/client/src/pages/ConfigManagementPage.d.ts +0 -3
- package/dist/web/client/src/pages/ConfigManagementPage.d.ts.map +0 -1
- package/dist/web/client/src/pages/ConfigManagementPage.js +0 -132
- package/dist/web/client/src/pages/ConfigManagementPage.js.map +0 -1
- package/dist/web/client/src/pages/ConfigPage.d.ts +0 -3
- package/dist/web/client/src/pages/ConfigPage.d.ts.map +0 -1
- package/dist/web/client/src/pages/ConfigPage.js +0 -220
- package/dist/web/client/src/pages/ConfigPage.js.map +0 -1
- package/dist/web/client/src/router.d.ts +0 -9
- package/dist/web/client/src/router.d.ts.map +0 -1
- package/dist/web/client/src/router.js +0 -27
- package/dist/web/client/src/router.js.map +0 -1
- package/dist/web/client/vite.config.d.ts +0 -3
- package/dist/web/client/vite.config.d.ts.map +0 -1
- package/dist/web/client/vite.config.js +0 -28
- package/dist/web/client/vite.config.js.map +0 -1
- package/dist/web/server/env/importer.d.ts +0 -3
- package/dist/web/server/env/importer.d.ts.map +0 -1
- package/dist/web/server/env/importer.js +0 -51
- package/dist/web/server/env/importer.js.map +0 -1
- package/dist/web/server/index.d.ts +0 -33
- package/dist/web/server/index.d.ts.map +0 -1
- package/dist/web/server/index.js +0 -102
- package/dist/web/server/index.js.map +0 -1
- package/dist/web/server/pty/manager.d.ts +0 -54
- package/dist/web/server/pty/manager.d.ts.map +0 -1
- package/dist/web/server/pty/manager.js +0 -303
- package/dist/web/server/pty/manager.js.map +0 -1
- package/dist/web/server/routes/branches.d.ts +0 -11
- package/dist/web/server/routes/branches.d.ts.map +0 -1
- package/dist/web/server/routes/branches.js +0 -97
- package/dist/web/server/routes/branches.js.map +0 -1
- package/dist/web/server/routes/config.d.ts +0 -6
- package/dist/web/server/routes/config.d.ts.map +0 -1
- package/dist/web/server/routes/config.js +0 -162
- package/dist/web/server/routes/config.js.map +0 -1
- package/dist/web/server/routes/index.d.ts +0 -13
- package/dist/web/server/routes/index.d.ts.map +0 -1
- package/dist/web/server/routes/index.js +0 -29
- package/dist/web/server/routes/index.js.map +0 -1
- package/dist/web/server/routes/sessions.d.ts +0 -12
- package/dist/web/server/routes/sessions.d.ts.map +0 -1
- package/dist/web/server/routes/sessions.js +0 -176
- package/dist/web/server/routes/sessions.js.map +0 -1
- package/dist/web/server/routes/worktrees.d.ts +0 -11
- package/dist/web/server/routes/worktrees.d.ts.map +0 -1
- package/dist/web/server/routes/worktrees.js +0 -80
- package/dist/web/server/routes/worktrees.js.map +0 -1
- package/dist/web/server/services/branches.d.ts +0 -17
- package/dist/web/server/services/branches.d.ts.map +0 -1
- package/dist/web/server/services/branches.js +0 -275
- package/dist/web/server/services/branches.js.map +0 -1
- package/dist/web/server/services/worktrees.d.ts +0 -24
- package/dist/web/server/services/worktrees.d.ts.map +0 -1
- package/dist/web/server/services/worktrees.js +0 -66
- package/dist/web/server/services/worktrees.js.map +0 -1
- package/dist/web/server/tray.d.ts +0 -25
- package/dist/web/server/tray.d.ts.map +0 -1
- package/dist/web/server/tray.js +0 -116
- package/dist/web/server/tray.js.map +0 -1
- package/dist/web/server/types.d.ts +0 -4
- package/dist/web/server/types.d.ts.map +0 -1
- package/dist/web/server/types.js +0 -2
- package/dist/web/server/types.js.map +0 -1
- package/dist/web/server/websocket/handler.d.ts +0 -57
- package/dist/web/server/websocket/handler.d.ts.map +0 -1
- package/dist/web/server/websocket/handler.js +0 -220
- package/dist/web/server/websocket/handler.js.map +0 -1
- package/dist/worktree.d.ts +0 -117
- package/dist/worktree.d.ts.map +0 -1
- package/dist/worktree.js +0 -788
- package/dist/worktree.js.map +0 -1
- package/src/claude-history.ts +0 -717
- package/src/claude.ts +0 -557
- package/src/cli/ui/App.solid.tsx +0 -2145
- package/src/cli/ui/__tests__/solid/AppSolid.cleanup.test.tsx +0 -1175
- package/src/cli/ui/__tests__/solid/BranchListScreen.test.tsx +0 -343
- package/src/cli/ui/__tests__/solid/ConfirmScreen.test.tsx +0 -77
- package/src/cli/ui/__tests__/solid/LogScreen.test.tsx +0 -351
- package/src/cli/ui/__tests__/solid/components/QuickStartStep.test.tsx +0 -308
- package/src/cli/ui/__tests__/solid/components/WizardController.test.tsx +0 -71
- package/src/cli/ui/__tests__/solid/components/WizardPopup.test.tsx +0 -231
- package/src/cli/ui/__tests__/solid/components/WizardSteps.test.tsx +0 -331
- package/src/cli/ui/__tests__/utils/branchFormatter.test.ts +0 -702
- package/src/cli/ui/__tests__/utils/clipboard.test.ts +0 -65
- package/src/cli/ui/__tests__/utils/statisticsCalculator.test.ts +0 -243
- package/src/cli/ui/components/solid/Footer.tsx +0 -36
- package/src/cli/ui/components/solid/Header.tsx +0 -67
- package/src/cli/ui/components/solid/HelpOverlay.tsx +0 -194
- package/src/cli/ui/components/solid/QuickStartStep.tsx +0 -209
- package/src/cli/ui/components/solid/ScrollableList.tsx +0 -23
- package/src/cli/ui/components/solid/SearchInput.tsx +0 -42
- package/src/cli/ui/components/solid/SelectInput.tsx +0 -88
- package/src/cli/ui/components/solid/Stats.tsx +0 -92
- package/src/cli/ui/components/solid/TextInput.tsx +0 -49
- package/src/cli/ui/components/solid/WizardController.tsx +0 -457
- package/src/cli/ui/components/solid/WizardPopup.tsx +0 -135
- package/src/cli/ui/components/solid/WizardSteps.tsx +0 -781
- package/src/cli/ui/core/index.ts +0 -17
- package/src/cli/ui/core/keybindings.ts +0 -367
- package/src/cli/ui/core/theme.ts +0 -266
- package/src/cli/ui/core/types.ts +0 -235
- package/src/cli/ui/hooks/solid/useAsyncOperation.ts +0 -78
- package/src/cli/ui/hooks/solid/useFilter.ts +0 -86
- package/src/cli/ui/hooks/solid/useGitOperations.ts +0 -81
- package/src/cli/ui/hooks/solid/useKeyHandler.ts +0 -103
- package/src/cli/ui/hooks/solid/useScrollableList.ts +0 -149
- package/src/cli/ui/hooks/solid/useSelection.ts +0 -77
- package/src/cli/ui/hooks/solid/useTerminalSize.ts +0 -22
- package/src/cli/ui/index.solid.ts +0 -28
- package/src/cli/ui/screens/solid/BranchListScreen.tsx +0 -1153
- package/src/cli/ui/screens/solid/ConfirmScreen.tsx +0 -86
- package/src/cli/ui/screens/solid/EnvironmentScreen.tsx +0 -161
- package/src/cli/ui/screens/solid/ErrorScreen.tsx +0 -42
- package/src/cli/ui/screens/solid/InputScreen.tsx +0 -55
- package/src/cli/ui/screens/solid/LoadingIndicator.tsx +0 -77
- package/src/cli/ui/screens/solid/LogDetailScreen.tsx +0 -75
- package/src/cli/ui/screens/solid/LogScreen.tsx +0 -504
- package/src/cli/ui/screens/solid/ProfileEnvScreen.tsx +0 -196
- package/src/cli/ui/screens/solid/ProfileScreen.tsx +0 -98
- package/src/cli/ui/screens/solid/SelectorScreen.tsx +0 -181
- package/src/cli/ui/screens/solid/SettingsScreen.tsx +0 -52
- package/src/cli/ui/screens/solid/WorktreeCreateScreen.tsx +0 -136
- package/src/cli/ui/screens/solid/WorktreeDeleteScreen.tsx +0 -40
- package/src/cli/ui/stores/appStore.ts +0 -208
- package/src/cli/ui/stores/branchStore.ts +0 -357
- package/src/cli/ui/stores/index.ts +0 -31
- package/src/cli/ui/stores/uiStore.ts +0 -226
- package/src/cli/ui/types.ts +0 -371
- package/src/cli/ui/utils/__tests__/branchFormatter.test.ts +0 -227
- package/src/cli/ui/utils/__tests__/installedVersionCache.test.ts +0 -46
- package/src/cli/ui/utils/baseBranch.ts +0 -34
- package/src/cli/ui/utils/branchFormatter.ts +0 -222
- package/src/cli/ui/utils/clipboard.ts +0 -31
- package/src/cli/ui/utils/continueSession.ts +0 -231
- package/src/cli/ui/utils/installedVersionCache.ts +0 -84
- package/src/cli/ui/utils/modelOptions.test.ts +0 -98
- package/src/cli/ui/utils/modelOptions.ts +0 -169
- package/src/cli/ui/utils/statisticsCalculator.ts +0 -44
- package/src/cli/ui/utils/versionCache.ts +0 -93
- package/src/cli/ui/utils/versionFetcher.ts +0 -120
- package/src/codex.ts +0 -445
- package/src/config/__tests__/saveSession.test.ts +0 -143
- package/src/config/builtin-coding-agents.ts +0 -87
- package/src/config/constants.ts +0 -102
- package/src/config/env-history.ts +0 -45
- package/src/config/index.ts +0 -311
- package/src/config/profiles.ts +0 -359
- package/src/config/shared-env.ts +0 -139
- package/src/config/tools.ts +0 -319
- package/src/gemini.ts +0 -405
- package/src/git.ts +0 -1263
- package/src/github.ts +0 -158
- package/src/index.test.ts +0 -93
- package/src/index.ts +0 -1024
- package/src/launcher.ts +0 -235
- package/src/logging/agentOutput.ts +0 -216
- package/src/logging/formatter.ts +0 -125
- package/src/logging/logger.ts +0 -106
- package/src/logging/reader.ts +0 -240
- package/src/logging/rotation.ts +0 -25
- package/src/opentui/index.solid.ts +0 -1
- package/src/repositories/git.repository.ts +0 -129
- package/src/repositories/github.repository.ts +0 -83
- package/src/repositories/worktree.repository.ts +0 -77
- package/src/services/BatchMergeService.ts +0 -251
- package/src/services/WorktreeOrchestrator.ts +0 -115
- package/src/services/__tests__/BatchMergeService.test.ts +0 -534
- package/src/services/__tests__/WorktreeOrchestrator.test.ts +0 -259
- package/src/services/codingAgentCommandResolver.ts +0 -118
- package/src/services/codingAgentResolver.ts +0 -375
- package/src/services/dependency-installer.ts +0 -192
- package/src/services/git.service.ts +0 -115
- package/src/services/github.service.ts +0 -61
- package/src/services/worktree.service.ts +0 -66
- package/src/shared/codingAgentConstants.ts +0 -103
- package/src/trayicon.d.ts +0 -30
- package/src/types/api.ts +0 -256
- package/src/types/coding-agent.ts +0 -85
- package/src/types/profiles.ts +0 -64
- package/src/types/tools.ts +0 -269
- package/src/utils/__tests__/npmRegistry.test.ts +0 -250
- package/src/utils/__tests__/prompt.test.ts +0 -125
- package/src/utils/bun-runtime.ts +0 -29
- package/src/utils/coding-agent-colors.ts +0 -165
- package/src/utils/command.ts +0 -234
- package/src/utils/error-utils.ts +0 -133
- package/src/utils/npmRegistry.ts +0 -249
- package/src/utils/prompt.ts +0 -149
- package/src/utils/session/common.ts +0 -474
- package/src/utils/session/index.ts +0 -50
- package/src/utils/session/parsers/claude.ts +0 -283
- package/src/utils/session/parsers/codex.ts +0 -166
- package/src/utils/session/parsers/gemini.ts +0 -135
- package/src/utils/session/parsers/index.ts +0 -31
- package/src/utils/session/parsers/opencode.ts +0 -151
- package/src/utils/session/types.ts +0 -51
- package/src/utils/session.ts +0 -16
- package/src/utils/spinner.ts +0 -54
- package/src/utils/terminal.ts +0 -327
- package/src/utils/webui.ts +0 -43
- package/src/utils.test.ts +0 -43
- package/src/utils.ts +0 -93
- package/src/web/client/components.json +0 -21
- package/src/web/client/index.html +0 -12
- package/src/web/client/src/components/BranchGraph.tsx +0 -95
- package/src/web/client/src/components/CodingAgentLaunchModal.tsx +0 -570
- package/src/web/client/src/components/CustomCodingAgentForm.tsx +0 -386
- package/src/web/client/src/components/CustomCodingAgentList.tsx +0 -119
- package/src/web/client/src/components/EnvEditor.tsx +0 -188
- package/src/web/client/src/components/EnvironmentEditor.tsx +0 -97
- package/src/web/client/src/components/Terminal.tsx +0 -145
- package/src/web/client/src/components/branch-detail/BranchInfoCards.tsx +0 -193
- package/src/web/client/src/components/branch-detail/SessionHistoryTable.tsx +0 -187
- package/src/web/client/src/components/branch-detail/TerminalPanel.tsx +0 -92
- package/src/web/client/src/components/branch-detail/ToolLauncher.tsx +0 -332
- package/src/web/client/src/components/branch-detail/index.ts +0 -4
- package/src/web/client/src/components/common/BranchCard.tsx +0 -117
- package/src/web/client/src/components/common/MetricCard.tsx +0 -22
- package/src/web/client/src/components/common/PageHeader.tsx +0 -44
- package/src/web/client/src/components/common/SearchInput.tsx +0 -40
- package/src/web/client/src/components/common/StatusBadge.tsx +0 -37
- package/src/web/client/src/components/common/index.ts +0 -5
- package/src/web/client/src/components/graph/BranchDetailPanel.tsx +0 -152
- package/src/web/client/src/components/graph/BranchNode.tsx +0 -200
- package/src/web/client/src/components/graph/ClusterNode.tsx +0 -211
- package/src/web/client/src/components/graph/SynapticCanvas.tsx +0 -171
- package/src/web/client/src/components/graph/SynapticEdge.tsx +0 -311
- package/src/web/client/src/components/graph/graphUtils.ts +0 -265
- package/src/web/client/src/components/graph/index.ts +0 -10
- package/src/web/client/src/components/ui/alert.tsx +0 -63
- package/src/web/client/src/components/ui/badge.tsx +0 -44
- package/src/web/client/src/components/ui/button.tsx +0 -57
- package/src/web/client/src/components/ui/card.tsx +0 -82
- package/src/web/client/src/components/ui/index.ts +0 -32
- package/src/web/client/src/components/ui/input.tsx +0 -21
- package/src/web/client/src/components/ui/select.tsx +0 -156
- package/src/web/client/src/components/ui/table.tsx +0 -119
- package/src/web/client/src/hooks/useBranches.ts +0 -41
- package/src/web/client/src/hooks/useConfig.ts +0 -31
- package/src/web/client/src/hooks/useSessions.ts +0 -68
- package/src/web/client/src/hooks/useWorktrees.ts +0 -47
- package/src/web/client/src/index.css +0 -349
- package/src/web/client/src/lib/api.ts +0 -184
- package/src/web/client/src/lib/coding-agent-colors.ts +0 -149
- package/src/web/client/src/lib/utils.ts +0 -10
- package/src/web/client/src/lib/websocket.ts +0 -222
- package/src/web/client/src/main.tsx +0 -29
- package/src/web/client/src/pages/BranchDetailPage.tsx +0 -555
- package/src/web/client/src/pages/BranchListPage.tsx +0 -242
- package/src/web/client/src/pages/ConfigManagementPage.tsx +0 -248
- package/src/web/client/src/pages/ConfigPage.tsx +0 -368
- package/src/web/client/src/router.tsx +0 -27
- package/src/web/client/vite.config.ts +0 -28
- package/src/web/server/env/importer.ts +0 -62
- package/src/web/server/index.ts +0 -143
- package/src/web/server/pty/manager.ts +0 -443
- package/src/web/server/routes/branches.ts +0 -126
- package/src/web/server/routes/config.ts +0 -226
- package/src/web/server/routes/index.ts +0 -37
- package/src/web/server/routes/sessions.ts +0 -252
- package/src/web/server/routes/worktrees.ts +0 -108
- package/src/web/server/services/branches.ts +0 -387
- package/src/web/server/services/worktrees.ts +0 -93
- package/src/web/server/tray.ts +0 -136
- package/src/web/server/types.ts +0 -14
- package/src/web/server/websocket/handler.ts +0 -299
- package/src/worktree.ts +0 -1109
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
function mR(e,n){for(var i=0;i<n.length;i++){const s=n[i];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in e)){const h=Object.getOwnPropertyDescriptor(s,a);h&&Object.defineProperty(e,a,h.get?h:{enumerable:!0,get:()=>s[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const h of a)if(h.type==="childList")for(const d of h.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(a){const h={};return a.integrity&&(h.integrity=a.integrity),a.referrerPolicy&&(h.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?h.credentials="include":a.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function s(a){if(a.ep)return;a.ep=!0;const h=i(a);fetch(a.href,h)}})();function ph(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qd={exports:{}},il={};var J0;function pR(){if(J0)return il;J0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(s,a,h){var d=null;if(h!==void 0&&(d=""+h),a.key!==void 0&&(d=""+a.key),"key"in a){h={};for(var l in a)l!=="key"&&(h[l]=a[l])}else h=a;return a=h.ref,{$$typeof:e,type:s,key:d,ref:a!==void 0?a:null,props:h}}return il.Fragment=n,il.jsx=i,il.jsxs=i,il}var ey;function gR(){return ey||(ey=1,qd.exports=pR()),qd.exports}var M=gR(),Wd={exports:{}},Ie={};var ty;function vR(){if(ty)return Ie;ty=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),d=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),_=Symbol.iterator;function x(B){return B===null||typeof B!="object"?null:(B=_&&B[_]||B["@@iterator"],typeof B=="function"?B:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,p={};function g(B,I,Q){this.props=B,this.context=I,this.refs=p,this.updater=Q||C}g.prototype.isReactComponent={},g.prototype.setState=function(B,I){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,I,"setState")},g.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function b(){}b.prototype=g.prototype;function y(B,I,Q){this.props=B,this.context=I,this.refs=p,this.updater=Q||C}var E=y.prototype=new b;E.constructor=y,S(E,g.prototype),E.isPureReactComponent=!0;var T=Array.isArray;function O(){}var D={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function N(B,I,Q){var J=Q.ref;return{$$typeof:e,type:B,key:I,ref:J!==void 0?J:null,props:Q}}function q(B,I){return N(B.type,I,B.props)}function P(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function z(B){var I={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(Q){return I[Q]})}var W=/\/+/g;function U(B,I){return typeof B=="object"&&B!==null&&B.key!=null?z(""+B.key):I.toString(36)}function G(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(O,O):(B.status="pending",B.then(function(I){B.status==="pending"&&(B.status="fulfilled",B.value=I)},function(I){B.status==="pending"&&(B.status="rejected",B.reason=I)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function H(B,I,Q,J,ae){var Z=typeof B;(Z==="undefined"||Z==="boolean")&&(B=null);var X=!1;if(B===null)X=!0;else switch(Z){case"bigint":case"string":case"number":X=!0;break;case"object":switch(B.$$typeof){case e:case n:X=!0;break;case v:return X=B._init,H(X(B._payload),I,Q,J,ae)}}if(X)return ae=ae(B),X=J===""?"."+U(B,0):J,T(ae)?(Q="",X!=null&&(Q=X.replace(W,"$&/")+"/"),H(ae,I,Q,"",function(de){return de})):ae!=null&&(P(ae)&&(ae=q(ae,Q+(ae.key==null||B&&B.key===ae.key?"":(""+ae.key).replace(W,"$&/")+"/")+X)),I.push(ae)),1;X=0;var V=J===""?".":J+":";if(T(B))for(var ie=0;ie<B.length;ie++)J=B[ie],Z=V+U(J,ie),X+=H(J,I,Q,Z,ae);else if(ie=x(B),typeof ie=="function")for(B=ie.call(B),ie=0;!(J=B.next()).done;)J=J.value,Z=V+U(J,ie++),X+=H(J,I,Q,Z,ae);else if(Z==="object"){if(typeof B.then=="function")return H(G(B),I,Q,J,ae);throw I=String(B),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return X}function K(B,I,Q){if(B==null)return B;var J=[],ae=0;return H(B,J,"","",function(Z){return I.call(Q,Z,ae++)}),J}function F(B){if(B._status===-1){var I=B._result;I=I(),I.then(function(Q){(B._status===0||B._status===-1)&&(B._status=1,B._result=Q)},function(Q){(B._status===0||B._status===-1)&&(B._status=2,B._result=Q)}),B._status===-1&&(B._status=0,B._result=I)}if(B._status===1)return B._result.default;throw B._result}var k=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},$={map:K,forEach:function(B,I,Q){K(B,function(){I.apply(this,arguments)},Q)},count:function(B){var I=0;return K(B,function(){I++}),I},toArray:function(B){return K(B,function(I){return I})||[]},only:function(B){if(!P(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Ie.Activity=m,Ie.Children=$,Ie.Component=g,Ie.Fragment=i,Ie.Profiler=a,Ie.PureComponent=y,Ie.StrictMode=s,Ie.Suspense=u,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(B){return D.H.useMemoCache(B)}},Ie.cache=function(B){return function(){return B.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(B,I,Q){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var J=S({},B.props),ae=B.key;if(I!=null)for(Z in I.key!==void 0&&(ae=""+I.key),I)!A.call(I,Z)||Z==="key"||Z==="__self"||Z==="__source"||Z==="ref"&&I.ref===void 0||(J[Z]=I[Z]);var Z=arguments.length-2;if(Z===1)J.children=Q;else if(1<Z){for(var X=Array(Z),V=0;V<Z;V++)X[V]=arguments[V+2];J.children=X}return N(B.type,ae,J)},Ie.createContext=function(B){return B={$$typeof:d,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:h,_context:B},B},Ie.createElement=function(B,I,Q){var J,ae={},Z=null;if(I!=null)for(J in I.key!==void 0&&(Z=""+I.key),I)A.call(I,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(ae[J]=I[J]);var X=arguments.length-2;if(X===1)ae.children=Q;else if(1<X){for(var V=Array(X),ie=0;ie<X;ie++)V[ie]=arguments[ie+2];ae.children=V}if(B&&B.defaultProps)for(J in X=B.defaultProps,X)ae[J]===void 0&&(ae[J]=X[J]);return N(B,Z,ae)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(B){return{$$typeof:l,render:B}},Ie.isValidElement=P,Ie.lazy=function(B){return{$$typeof:v,_payload:{_status:-1,_result:B},_init:F}},Ie.memo=function(B,I){return{$$typeof:c,type:B,compare:I===void 0?null:I}},Ie.startTransition=function(B){var I=D.T,Q={};D.T=Q;try{var J=B(),ae=D.S;ae!==null&&ae(Q,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(O,k)}catch(Z){k(Z)}finally{I!==null&&Q.types!==null&&(I.types=Q.types),D.T=I}},Ie.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ie.use=function(B){return D.H.use(B)},Ie.useActionState=function(B,I,Q){return D.H.useActionState(B,I,Q)},Ie.useCallback=function(B,I){return D.H.useCallback(B,I)},Ie.useContext=function(B){return D.H.useContext(B)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(B,I){return D.H.useDeferredValue(B,I)},Ie.useEffect=function(B,I){return D.H.useEffect(B,I)},Ie.useEffectEvent=function(B){return D.H.useEffectEvent(B)},Ie.useId=function(){return D.H.useId()},Ie.useImperativeHandle=function(B,I,Q){return D.H.useImperativeHandle(B,I,Q)},Ie.useInsertionEffect=function(B,I){return D.H.useInsertionEffect(B,I)},Ie.useLayoutEffect=function(B,I){return D.H.useLayoutEffect(B,I)},Ie.useMemo=function(B,I){return D.H.useMemo(B,I)},Ie.useOptimistic=function(B,I){return D.H.useOptimistic(B,I)},Ie.useReducer=function(B,I,Q){return D.H.useReducer(B,I,Q)},Ie.useRef=function(B){return D.H.useRef(B)},Ie.useState=function(B){return D.H.useState(B)},Ie.useSyncExternalStore=function(B,I,Q){return D.H.useSyncExternalStore(B,I,Q)},Ie.useTransition=function(){return D.H.useTransition()},Ie.version="19.2.3",Ie}var ny;function Pl(){return ny||(ny=1,Wd.exports=vR()),Wd.exports}var L=Pl();const Nr=ph(L),gh=mR({__proto__:null,default:Nr},[L]);var Yd={exports:{}},sl={},Kd={exports:{}},Gd={};var ry;function _R(){return ry||(ry=1,(function(e){function n(H,K){var F=H.length;H.push(K);e:for(;0<F;){var k=F-1>>>1,$=H[k];if(0<a($,K))H[k]=K,H[F]=$,F=k;else break e}}function i(H){return H.length===0?null:H[0]}function s(H){if(H.length===0)return null;var K=H[0],F=H.pop();if(F!==K){H[0]=F;e:for(var k=0,$=H.length,B=$>>>1;k<B;){var I=2*(k+1)-1,Q=H[I],J=I+1,ae=H[J];if(0>a(Q,F))J<$&&0>a(ae,Q)?(H[k]=ae,H[J]=F,k=J):(H[k]=Q,H[I]=F,k=I);else if(J<$&&0>a(ae,F))H[k]=ae,H[J]=F,k=J;else break e}}return K}function a(H,K){var F=H.sortIndex-K.sortIndex;return F!==0?F:H.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var d=Date,l=d.now();e.unstable_now=function(){return d.now()-l}}var u=[],c=[],v=1,m=null,_=3,x=!1,C=!1,S=!1,p=!1,g=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function E(H){for(var K=i(c);K!==null;){if(K.callback===null)s(c);else if(K.startTime<=H)s(c),K.sortIndex=K.expirationTime,n(u,K);else break;K=i(c)}}function T(H){if(S=!1,E(H),!C)if(i(u)!==null)C=!0,O||(O=!0,z());else{var K=i(c);K!==null&&G(T,K.startTime-H)}}var O=!1,D=-1,A=5,N=-1;function q(){return p?!0:!(e.unstable_now()-N<A)}function P(){if(p=!1,O){var H=e.unstable_now();N=H;var K=!0;try{e:{C=!1,S&&(S=!1,b(D),D=-1),x=!0;var F=_;try{t:{for(E(H),m=i(u);m!==null&&!(m.expirationTime>H&&q());){var k=m.callback;if(typeof k=="function"){m.callback=null,_=m.priorityLevel;var $=k(m.expirationTime<=H);if(H=e.unstable_now(),typeof $=="function"){m.callback=$,E(H),K=!0;break t}m===i(u)&&s(u),E(H)}else s(u);m=i(u)}if(m!==null)K=!0;else{var B=i(c);B!==null&&G(T,B.startTime-H),K=!1}}break e}finally{m=null,_=F,x=!1}K=void 0}}finally{K?z():O=!1}}}var z;if(typeof y=="function")z=function(){y(P)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,U=W.port2;W.port1.onmessage=P,z=function(){U.postMessage(null)}}else z=function(){g(P,0)};function G(H,K){D=g(function(){H(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(H){switch(_){case 1:case 2:case 3:var K=3;break;default:K=_}var F=_;_=K;try{return H()}finally{_=F}},e.unstable_requestPaint=function(){p=!0},e.unstable_runWithPriority=function(H,K){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var F=_;_=H;try{return K()}finally{_=F}},e.unstable_scheduleCallback=function(H,K,F){var k=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?k+F:k):F=k,H){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=F+$,H={id:v++,callback:K,priorityLevel:H,startTime:F,expirationTime:$,sortIndex:-1},F>k?(H.sortIndex=F,n(c,H),i(u)===null&&H===i(c)&&(S?(b(D),D=-1):S=!0,G(T,F-k))):(H.sortIndex=$,n(u,H),C||x||(C=!0,O||(O=!0,z()))),H},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(H){var K=_;return function(){var F=_;_=K;try{return H.apply(this,arguments)}finally{_=F}}}})(Gd)),Gd}var iy;function yR(){return iy||(iy=1,Kd.exports=_R()),Kd.exports}var Xd={exports:{}},un={};var sy;function bR(){if(sy)return un;sy=1;var e=Pl();function n(u){var c="https://react.dev/errors/"+u;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)c+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+u+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},a=Symbol.for("react.portal");function h(u,c,v){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:u,containerInfo:c,implementation:v}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(u,c){if(u==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return un.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,un.createPortal=function(u,c){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(n(299));return h(u,c,null,v)},un.flushSync=function(u){var c=d.T,v=s.p;try{if(d.T=null,s.p=2,u)return u()}finally{d.T=c,s.p=v,s.d.f()}},un.preconnect=function(u,c){typeof u=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,s.d.C(u,c))},un.prefetchDNS=function(u){typeof u=="string"&&s.d.D(u)},un.preinit=function(u,c){if(typeof u=="string"&&c&&typeof c.as=="string"){var v=c.as,m=l(v,c.crossOrigin),_=typeof c.integrity=="string"?c.integrity:void 0,x=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;v==="style"?s.d.S(u,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:m,integrity:_,fetchPriority:x}):v==="script"&&s.d.X(u,{crossOrigin:m,integrity:_,fetchPriority:x,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},un.preinitModule=function(u,c){if(typeof u=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var v=l(c.as,c.crossOrigin);s.d.M(u,{crossOrigin:v,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&s.d.M(u)},un.preload=function(u,c){if(typeof u=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var v=c.as,m=l(v,c.crossOrigin);s.d.L(u,v,{crossOrigin:m,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},un.preloadModule=function(u,c){if(typeof u=="string")if(c){var v=l(c.as,c.crossOrigin);s.d.m(u,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:v,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else s.d.m(u)},un.requestFormReset=function(u){s.d.r(u)},un.unstable_batchedUpdates=function(u,c){return u(c)},un.useFormState=function(u,c,v){return d.H.useFormState(u,c,v)},un.useFormStatus=function(){return d.H.useHostTransitionStatus()},un.version="19.2.3",un}var oy;function WS(){if(oy)return Xd.exports;oy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Xd.exports=bR(),Xd.exports}var ay;function SR(){if(ay)return sl;ay=1;var e=yR(),n=Pl(),i=WS();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function h(t){var r=t,o=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(o=r.return),t=r.return;while(t)}return r.tag===3?o:null}function d(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function l(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function u(t){if(h(t)!==t)throw Error(s(188))}function c(t){var r=t.alternate;if(!r){if(r=h(t),r===null)throw Error(s(188));return r!==t?null:t}for(var o=t,f=r;;){var w=o.return;if(w===null)break;var R=w.alternate;if(R===null){if(f=w.return,f!==null){o=f;continue}break}if(w.child===R.child){for(R=w.child;R;){if(R===o)return u(w),t;if(R===f)return u(w),r;R=R.sibling}throw Error(s(188))}if(o.return!==f.return)o=w,f=R;else{for(var j=!1,Y=w.child;Y;){if(Y===o){j=!0,o=w,f=R;break}if(Y===f){j=!0,f=w,o=R;break}Y=Y.sibling}if(!j){for(Y=R.child;Y;){if(Y===o){j=!0,o=R,f=w;break}if(Y===f){j=!0,f=R,o=w;break}Y=Y.sibling}if(!j)throw Error(s(189))}}if(o.alternate!==f)throw Error(s(190))}if(o.tag!==3)throw Error(s(188));return o.stateNode.current===o?t:r}function v(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=v(t),r!==null)return r;t=t.sibling}return null}var m=Object.assign,_=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),y=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function z(t){return t===null||typeof t!="object"?null:(t=P&&t[P]||t["@@iterator"],typeof t=="function"?t:null)}var W=Symbol.for("react.client.reference");function U(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===W?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case S:return"Fragment";case g:return"Profiler";case p:return"StrictMode";case T:return"Suspense";case O:return"SuspenseList";case N:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case C:return"Portal";case y:return t.displayName||"Context";case b:return(t._context.displayName||"Context")+".Consumer";case E:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case D:return r=t.displayName||null,r!==null?r:U(t.type)||"Memo";case A:r=t._payload,t=t._init;try{return U(t(r))}catch{}}return null}var G=Array.isArray,H=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},k=[],$=-1;function B(t){return{current:t}}function I(t){0>$||(t.current=k[$],k[$]=null,$--)}function Q(t,r){$++,k[$]=t.current,t.current=r}var J=B(null),ae=B(null),Z=B(null),X=B(null);function V(t,r){switch(Q(Z,r),Q(ae,t),Q(J,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?x0(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=x0(r),t=w0(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}I(J),Q(J,t)}function ie(){I(J),I(ae),I(Z)}function de(t){t.memoizedState!==null&&Q(X,t);var r=J.current,o=w0(r,t.type);r!==o&&(Q(ae,t),Q(J,o))}function re(t){ae.current===t&&(I(J),I(ae)),X.current===t&&(I(X),el._currentValue=F)}var le,_e;function Ee(t){if(le===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);le=r&&r[1]||"",_e=-1<o.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+le+t+_e}var He=!1;function ke(t,r){if(!t||He)return"";He=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(r){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(me){var he=me}Reflect.construct(t,[],ve)}else{try{ve.call()}catch(me){he=me}t.call(ve.prototype)}}else{try{throw Error()}catch(me){he=me}(ve=t())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(me){if(me&&he&&typeof me.stack=="string")return[me.stack,he.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var w=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");w&&w.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var R=f.DetermineComponentFrameRoot(),j=R[0],Y=R[1];if(j&&Y){var te=j.split(`
|
|
4
|
-
`),ue=Y.split(`
|
|
5
|
-
`);for(w=f=0;f<te.length&&!te[f].includes("DetermineComponentFrameRoot");)f++;for(;w<ue.length&&!ue[w].includes("DetermineComponentFrameRoot");)w++;if(f===te.length||w===ue.length)for(f=te.length-1,w=ue.length-1;1<=f&&0<=w&&te[f]!==ue[w];)w--;for(;1<=f&&0<=w;f--,w--)if(te[f]!==ue[w]){if(f!==1||w!==1)do if(f--,w--,0>w||te[f]!==ue[w]){var pe=`
|
|
6
|
-
`+te[f].replace(" at new "," at ");return t.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",t.displayName)),pe}while(1<=f&&0<=w);break}}}finally{He=!1,Error.prepareStackTrace=o}return(o=t?t.displayName||t.name:"")?Ee(o):""}function Ce(t,r){switch(t.tag){case 26:case 27:case 5:return Ee(t.type);case 16:return Ee("Lazy");case 13:return t.child!==r&&r!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return ke(t.type,!1);case 11:return ke(t.type.render,!1);case 1:return ke(t.type,!0);case 31:return Ee("Activity");default:return""}}function $t(t){try{var r="",o=null;do r+=Ce(t,o),o=t,t=t.return;while(t);return r}catch(f){return`
|
|
7
|
-
Error generating stack: `+f.message+`
|
|
8
|
-
`+f.stack}}var Bt=Object.prototype.hasOwnProperty,tn=e.unstable_scheduleCallback,fn=e.unstable_cancelCallback,_n=e.unstable_shouldYield,At=e.unstable_requestPaint,it=e.unstable_now,Et=e.unstable_getCurrentPriorityLevel,Gt=e.unstable_ImmediatePriority,ln=e.unstable_UserBlockingPriority,dt=e.unstable_NormalPriority,Xt=e.unstable_LowPriority,Qt=e.unstable_IdlePriority,ar=e.log,st=e.unstable_setDisableYieldValue,lr=null,gt=null;function Mn(t){if(typeof ar=="function"&&st(t),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(lr,t)}catch{}}var Zt=Math.clz32?Math.clz32:ro,no=Math.log,ma=Math.LN2;function ro(t){return t>>>=0,t===0?32:31-(no(t)/ma|0)|0}var cr=256,Kr=262144,Er=4194304;function ur(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Gr(t,r,o){var f=t.pendingLanes;if(f===0)return 0;var w=0,R=t.suspendedLanes,j=t.pingedLanes;t=t.warmLanes;var Y=f&134217727;return Y!==0?(f=Y&~R,f!==0?w=ur(f):(j&=Y,j!==0?w=ur(j):o||(o=Y&~t,o!==0&&(w=ur(o))))):(Y=f&~R,Y!==0?w=ur(Y):j!==0?w=ur(j):o||(o=f&~t,o!==0&&(w=ur(o)))),w===0?0:r!==0&&r!==w&&(r&R)===0&&(R=w&-w,o=r&-r,R>=o||R===32&&(o&4194048)!==0)?r:w}function Xr(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function io(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Qr(){var t=Er;return Er<<=1,(Er&62914560)===0&&(Er=4194304),t}function Rr(t){for(var r=[],o=0;31>o;o++)r.push(t);return r}function Ar(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function pa(t,r,o,f,w,R){var j=t.pendingLanes;t.pendingLanes=o,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=o,t.entangledLanes&=o,t.errorRecoveryDisabledLanes&=o,t.shellSuspendCounter=0;var Y=t.entanglements,te=t.expirationTimes,ue=t.hiddenUpdates;for(o=j&~o;0<o;){var pe=31-Zt(o),ve=1<<pe;Y[pe]=0,te[pe]=-1;var he=ue[pe];if(he!==null)for(ue[pe]=null,pe=0;pe<he.length;pe++){var me=he[pe];me!==null&&(me.lane&=-536870913)}o&=~ve}f!==0&&so(t,f,0),R!==0&&w===0&&t.tag!==0&&(t.suspendedLanes|=R&~(j&~r))}function so(t,r,o){t.pendingLanes|=r,t.suspendedLanes&=~r;var f=31-Zt(r);t.entangledLanes|=r,t.entanglements[f]=t.entanglements[f]|1073741824|o&261930}function ee(t,r){var o=t.entangledLanes|=r;for(t=t.entanglements;o;){var f=31-Zt(o),w=1<<f;w&r|t[f]&r&&(t[f]|=r),o&=~w}}function se(t,r){var o=r&-r;return o=(o&42)!==0?1:fe(o),(o&(t.suspendedLanes|r))!==0?0:o}function fe(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function ye(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function be(){var t=K.p;return t!==0?t:(t=window.event,t===void 0?32:W0(t.type))}function Me(t,r){var o=K.p;try{return K.p=t,r()}finally{K.p=o}}var xe=Math.random().toString(36).slice(2),Se="__reactFiber$"+xe,we="__reactProps$"+xe,Te="__reactContainer$"+xe,Be="__reactEvents$"+xe,Le="__reactListeners$"+xe,Qe="__reactHandles$"+xe,qe="__reactResources$"+xe,vt="__reactMarker$"+xe;function bt(t){delete t[Se],delete t[we],delete t[Be],delete t[Le],delete t[Qe]}function St(t){var r=t[Se];if(r)return r;for(var o=t.parentNode;o;){if(r=o[Te]||o[Se]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(t=M0(t);t!==null;){if(o=t[Se])return o;t=M0(t)}return r}t=o,o=t.parentNode}return null}function We(t){if(t=t[Se]||t[Te]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Mt(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function cn(t){var r=t[qe];return r||(r=t[qe]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function mt(t){t[vt]=!0}var On=new Set,dn={};function Ln(t,r){yn(t,r),yn(t+"Capture",r)}function yn(t,r){for(dn[t]=r,t=0;t<r.length;t++)On.add(r[t])}var hr=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Dr={},Zr={};function Ye(t){return Bt.call(Zr,t)?!0:Bt.call(Dr,t)?!1:hr.test(t)?Zr[t]=!0:(Dr[t]=!0,!1)}function Rt(t,r,o){if(Ye(r))if(o===null)t.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var f=r.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+o)}}function Nn(t,r,o){if(o===null)t.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+o)}}function Vt(t,r,o,f){if(f===null)t.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(o);return}t.setAttributeNS(r,o,""+f)}}function Ke(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Jr(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function oo(t,r,o){var f=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var w=f.get,R=f.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return w.call(this)},set:function(j){o=""+j,R.call(this,j)}}),Object.defineProperty(t,r,{enumerable:f.enumerable}),{getValue:function(){return o},setValue:function(j){o=""+j},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Ti(t){if(!t._valueTracker){var r=Jr(t)?"checked":"value";t._valueTracker=oo(t,r,""+t[r])}}function tc(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var o=r.getValue(),f="";return t&&(f=Jr(t)?t.checked?"true":"false":t.value),t=f,t!==o?(r.setValue(t),!0):!1}function gs(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var zh=/[\n"\\]/g;function bn(t){return t.replace(zh,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function vs(t,r,o,f,w,R,j,Y){t.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?t.type=j:t.removeAttribute("type"),r!=null?j==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Ke(r)):t.value!==""+Ke(r)&&(t.value=""+Ke(r)):j!=="submit"&&j!=="reset"||t.removeAttribute("value"),r!=null?ga(t,j,Ke(r)):o!=null?ga(t,j,Ke(o)):f!=null&&t.removeAttribute("value"),w==null&&R!=null&&(t.defaultChecked=!!R),w!=null&&(t.checked=w&&typeof w!="function"&&typeof w!="symbol"),Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?t.name=""+Ke(Y):t.removeAttribute("name")}function nc(t,r,o,f,w,R,j,Y){if(R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(t.type=R),r!=null||o!=null){if(!(R!=="submit"&&R!=="reset"||r!=null)){Ti(t);return}o=o!=null?""+Ke(o):"",r=r!=null?""+Ke(r):o,Y||r===t.value||(t.value=r),t.defaultValue=r}f=f??w,f=typeof f!="function"&&typeof f!="symbol"&&!!f,t.checked=Y?t.checked:!!f,t.defaultChecked=!!f,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(t.name=j),Ti(t)}function ga(t,r,o){r==="number"&&gs(t.ownerDocument)===t||t.defaultValue===""+o||(t.defaultValue=""+o)}function ei(t,r,o,f){if(t=t.options,r){r={};for(var w=0;w<o.length;w++)r["$"+o[w]]=!0;for(o=0;o<t.length;o++)w=r.hasOwnProperty("$"+t[o].value),t[o].selected!==w&&(t[o].selected=w),w&&f&&(t[o].defaultSelected=!0)}else{for(o=""+Ke(o),r=null,w=0;w<t.length;w++){if(t[w].value===o){t[w].selected=!0,f&&(t[w].defaultSelected=!0);return}r!==null||t[w].disabled||(r=t[w])}r!==null&&(r.selected=!0)}}function vg(t,r,o){if(r!=null&&(r=""+Ke(r),r!==t.value&&(t.value=r),o==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=o!=null?""+Ke(o):""}function _g(t,r,o,f){if(r==null){if(f!=null){if(o!=null)throw Error(s(92));if(G(f)){if(1<f.length)throw Error(s(93));f=f[0]}o=f}o==null&&(o=""),r=o}o=Ke(r),t.defaultValue=o,f=t.textContent,f===o&&f!==""&&f!==null&&(t.value=f),Ti(t)}function ao(t,r){if(r){var o=t.firstChild;if(o&&o===t.lastChild&&o.nodeType===3){o.nodeValue=r;return}}t.textContent=r}var cE=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function yg(t,r,o){var f=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?f?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":f?t.setProperty(r,o):typeof o!="number"||o===0||cE.has(r)?r==="float"?t.cssFloat=o:t[r]=(""+o).trim():t[r]=o+"px"}function bg(t,r,o){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,o!=null){for(var f in o)!o.hasOwnProperty(f)||r!=null&&r.hasOwnProperty(f)||(f.indexOf("--")===0?t.setProperty(f,""):f==="float"?t.cssFloat="":t[f]="");for(var w in r)f=r[w],r.hasOwnProperty(w)&&o[w]!==f&&yg(t,w,f)}else for(var R in r)r.hasOwnProperty(R)&&yg(t,R,r[R])}function Ih(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var uE=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),hE=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function rc(t){return hE.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ti(){}var Uh=null;function Fh(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var lo=null,co=null;function Sg(t){var r=We(t);if(r&&(t=r.stateNode)){var o=t[we]||null;e:switch(t=r.stateNode,r.type){case"input":if(vs(t,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=t;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+bn(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var f=o[r];if(f!==t&&f.form===t.form){var w=f[we]||null;if(!w)throw Error(s(90));vs(f,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name)}}for(r=0;r<o.length;r++)f=o[r],f.form===t.form&&tc(f)}break e;case"textarea":vg(t,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&ei(t,!!o.multiple,r,!1)}}}var $h=!1;function xg(t,r,o){if($h)return t(r,o);$h=!0;try{var f=t(r);return f}finally{if($h=!1,(lo!==null||co!==null)&&(Vc(),lo&&(r=lo,t=co,co=lo=null,Sg(r),t)))for(r=0;r<t.length;r++)Sg(t[r])}}function va(t,r){var o=t.stateNode;if(o===null)return null;var f=o[we]||null;if(f===null)return null;o=f[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(t=t.type,f=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!f;break e;default:t=!1}if(t)return null;if(o&&typeof o!="function")throw Error(s(231,r,typeof o));return o}var ni=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vh=!1;if(ni)try{var _a={};Object.defineProperty(_a,"passive",{get:function(){Vh=!0}}),window.addEventListener("test",_a,_a),window.removeEventListener("test",_a,_a)}catch{Vh=!1}var Mi=null,qh=null,ic=null;function wg(){if(ic)return ic;var t,r=qh,o=r.length,f,w="value"in Mi?Mi.value:Mi.textContent,R=w.length;for(t=0;t<o&&r[t]===w[t];t++);var j=o-t;for(f=1;f<=j&&r[o-f]===w[R-f];f++);return ic=w.slice(t,1<f?1-f:void 0)}function sc(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function oc(){return!0}function Cg(){return!1}function Sn(t){function r(o,f,w,R,j){this._reactName=o,this._targetInst=w,this.type=f,this.nativeEvent=R,this.target=j,this.currentTarget=null;for(var Y in t)t.hasOwnProperty(Y)&&(o=t[Y],this[Y]=o?o(R):R[Y]);return this.isDefaultPrevented=(R.defaultPrevented!=null?R.defaultPrevented:R.returnValue===!1)?oc:Cg,this.isPropagationStopped=Cg,this}return m(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=oc)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=oc)},persist:function(){},isPersistent:oc}),r}var _s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ac=Sn(_s),ya=m({},_s,{view:0,detail:0}),fE=Sn(ya),Wh,Yh,ba,lc=m({},ya,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gh,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ba&&(ba&&t.type==="mousemove"?(Wh=t.screenX-ba.screenX,Yh=t.screenY-ba.screenY):Yh=Wh=0,ba=t),Wh)},movementY:function(t){return"movementY"in t?t.movementY:Yh}}),Eg=Sn(lc),dE=m({},lc,{dataTransfer:0}),mE=Sn(dE),pE=m({},ya,{relatedTarget:0}),Kh=Sn(pE),gE=m({},_s,{animationName:0,elapsedTime:0,pseudoElement:0}),vE=Sn(gE),_E=m({},_s,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),yE=Sn(_E),bE=m({},_s,{data:0}),Rg=Sn(bE),SE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xE={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},wE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function CE(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=wE[t])?!!r[t]:!1}function Gh(){return CE}var EE=m({},ya,{key:function(t){if(t.key){var r=SE[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=sc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?xE[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gh,charCode:function(t){return t.type==="keypress"?sc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?sc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),RE=Sn(EE),AE=m({},lc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ag=Sn(AE),DE=m({},ya,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gh}),TE=Sn(DE),ME=m({},_s,{propertyName:0,elapsedTime:0,pseudoElement:0}),OE=Sn(ME),LE=m({},lc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),NE=Sn(LE),kE=m({},_s,{newState:0,oldState:0}),BE=Sn(kE),jE=[9,13,27,32],Xh=ni&&"CompositionEvent"in window,Sa=null;ni&&"documentMode"in document&&(Sa=document.documentMode);var HE=ni&&"TextEvent"in window&&!Sa,Dg=ni&&(!Xh||Sa&&8<Sa&&11>=Sa),Tg=" ",Mg=!1;function Og(t,r){switch(t){case"keyup":return jE.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var uo=!1;function PE(t,r){switch(t){case"compositionend":return Lg(r);case"keypress":return r.which!==32?null:(Mg=!0,Tg);case"textInput":return t=r.data,t===Tg&&Mg?null:t;default:return null}}function zE(t,r){if(uo)return t==="compositionend"||!Xh&&Og(t,r)?(t=wg(),ic=qh=Mi=null,uo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Dg&&r.locale!=="ko"?null:r.data;default:return null}}var IE={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ng(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!IE[t.type]:r==="textarea"}function kg(t,r,o,f){lo?co?co.push(f):co=[f]:lo=f,r=Qc(r,"onChange"),0<r.length&&(o=new ac("onChange","change",null,o,f),t.push({event:o,listeners:r}))}var xa=null,wa=null;function UE(t){g0(t,0)}function cc(t){var r=Mt(t);if(tc(r))return t}function Bg(t,r){if(t==="change")return r}var jg=!1;if(ni){var Qh;if(ni){var Zh="oninput"in document;if(!Zh){var Hg=document.createElement("div");Hg.setAttribute("oninput","return;"),Zh=typeof Hg.oninput=="function"}Qh=Zh}else Qh=!1;jg=Qh&&(!document.documentMode||9<document.documentMode)}function Pg(){xa&&(xa.detachEvent("onpropertychange",zg),wa=xa=null)}function zg(t){if(t.propertyName==="value"&&cc(wa)){var r=[];kg(r,wa,t,Fh(t)),xg(UE,r)}}function FE(t,r,o){t==="focusin"?(Pg(),xa=r,wa=o,xa.attachEvent("onpropertychange",zg)):t==="focusout"&&Pg()}function $E(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return cc(wa)}function VE(t,r){if(t==="click")return cc(r)}function qE(t,r){if(t==="input"||t==="change")return cc(r)}function WE(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var kn=typeof Object.is=="function"?Object.is:WE;function Ca(t,r){if(kn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var o=Object.keys(t),f=Object.keys(r);if(o.length!==f.length)return!1;for(f=0;f<o.length;f++){var w=o[f];if(!Bt.call(r,w)||!kn(t[w],r[w]))return!1}return!0}function Ig(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Ug(t,r){var o=Ig(t);t=0;for(var f;o;){if(o.nodeType===3){if(f=t+o.textContent.length,t<=r&&f>=r)return{node:o,offset:r-t};t=f}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Ig(o)}}function Fg(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Fg(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function $g(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=gs(t.document);r instanceof t.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)t=r.contentWindow;else break;r=gs(t.document)}return r}function Jh(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var YE=ni&&"documentMode"in document&&11>=document.documentMode,ho=null,ef=null,Ea=null,tf=!1;function Vg(t,r,o){var f=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;tf||ho==null||ho!==gs(f)||(f=ho,"selectionStart"in f&&Jh(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Ea&&Ca(Ea,f)||(Ea=f,f=Qc(ef,"onSelect"),0<f.length&&(r=new ac("onSelect","select",null,r,o),t.push({event:r,listeners:f}),r.target=ho)))}function ys(t,r){var o={};return o[t.toLowerCase()]=r.toLowerCase(),o["Webkit"+t]="webkit"+r,o["Moz"+t]="moz"+r,o}var fo={animationend:ys("Animation","AnimationEnd"),animationiteration:ys("Animation","AnimationIteration"),animationstart:ys("Animation","AnimationStart"),transitionrun:ys("Transition","TransitionRun"),transitionstart:ys("Transition","TransitionStart"),transitioncancel:ys("Transition","TransitionCancel"),transitionend:ys("Transition","TransitionEnd")},nf={},qg={};ni&&(qg=document.createElement("div").style,"AnimationEvent"in window||(delete fo.animationend.animation,delete fo.animationiteration.animation,delete fo.animationstart.animation),"TransitionEvent"in window||delete fo.transitionend.transition);function bs(t){if(nf[t])return nf[t];if(!fo[t])return t;var r=fo[t],o;for(o in r)if(r.hasOwnProperty(o)&&o in qg)return nf[t]=r[o];return t}var Wg=bs("animationend"),Yg=bs("animationiteration"),Kg=bs("animationstart"),KE=bs("transitionrun"),GE=bs("transitionstart"),XE=bs("transitioncancel"),Gg=bs("transitionend"),Xg=new Map,rf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");rf.push("scrollEnd");function fr(t,r){Xg.set(t,r),Ln(r,[t])}var uc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Wn=[],mo=0,sf=0;function hc(){for(var t=mo,r=sf=mo=0;r<t;){var o=Wn[r];Wn[r++]=null;var f=Wn[r];Wn[r++]=null;var w=Wn[r];Wn[r++]=null;var R=Wn[r];if(Wn[r++]=null,f!==null&&w!==null){var j=f.pending;j===null?w.next=w:(w.next=j.next,j.next=w),f.pending=w}R!==0&&Qg(o,w,R)}}function fc(t,r,o,f){Wn[mo++]=t,Wn[mo++]=r,Wn[mo++]=o,Wn[mo++]=f,sf|=f,t.lanes|=f,t=t.alternate,t!==null&&(t.lanes|=f)}function of(t,r,o,f){return fc(t,r,o,f),dc(t)}function Ss(t,r){return fc(t,null,null,r),dc(t)}function Qg(t,r,o){t.lanes|=o;var f=t.alternate;f!==null&&(f.lanes|=o);for(var w=!1,R=t.return;R!==null;)R.childLanes|=o,f=R.alternate,f!==null&&(f.childLanes|=o),R.tag===22&&(t=R.stateNode,t===null||t._visibility&1||(w=!0)),t=R,R=R.return;return t.tag===3?(R=t.stateNode,w&&r!==null&&(w=31-Zt(o),t=R.hiddenUpdates,f=t[w],f===null?t[w]=[r]:f.push(r),r.lane=o|536870912),R):null}function dc(t){if(50<Ya)throw Ya=0,pd=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var po={};function QE(t,r,o,f){this.tag=t,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bn(t,r,o,f){return new QE(t,r,o,f)}function af(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ri(t,r){var o=t.alternate;return o===null?(o=Bn(t.tag,r,t.key,t.mode),o.elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=r,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=t.flags&65011712,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,r=t.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o.refCleanup=t.refCleanup,o}function Zg(t,r){t.flags&=65011714;var o=t.alternate;return o===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=o.childLanes,t.lanes=o.lanes,t.child=o.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=o.memoizedProps,t.memoizedState=o.memoizedState,t.updateQueue=o.updateQueue,t.type=o.type,r=o.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function mc(t,r,o,f,w,R){var j=0;if(f=t,typeof t=="function")af(t)&&(j=1);else if(typeof t=="string")j=nR(t,o,J.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case N:return t=Bn(31,o,r,w),t.elementType=N,t.lanes=R,t;case S:return xs(o.children,w,R,r);case p:j=8,w|=24;break;case g:return t=Bn(12,o,r,w|2),t.elementType=g,t.lanes=R,t;case T:return t=Bn(13,o,r,w),t.elementType=T,t.lanes=R,t;case O:return t=Bn(19,o,r,w),t.elementType=O,t.lanes=R,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case y:j=10;break e;case b:j=9;break e;case E:j=11;break e;case D:j=14;break e;case A:j=16,f=null;break e}j=29,o=Error(s(130,t===null?"null":typeof t,"")),f=null}return r=Bn(j,o,r,w),r.elementType=t,r.type=f,r.lanes=R,r}function xs(t,r,o,f){return t=Bn(7,t,f,r),t.lanes=o,t}function lf(t,r,o){return t=Bn(6,t,null,r),t.lanes=o,t}function Jg(t){var r=Bn(18,null,null,0);return r.stateNode=t,r}function cf(t,r,o){return r=Bn(4,t.children!==null?t.children:[],t.key,r),r.lanes=o,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var ev=new WeakMap;function Yn(t,r){if(typeof t=="object"&&t!==null){var o=ev.get(t);return o!==void 0?o:(r={value:t,source:r,stack:$t(r)},ev.set(t,r),r)}return{value:t,source:r,stack:$t(r)}}var go=[],vo=0,pc=null,Ra=0,Kn=[],Gn=0,Oi=null,Tr=1,Mr="";function ii(t,r){go[vo++]=Ra,go[vo++]=pc,pc=t,Ra=r}function tv(t,r,o){Kn[Gn++]=Tr,Kn[Gn++]=Mr,Kn[Gn++]=Oi,Oi=t;var f=Tr;t=Mr;var w=32-Zt(f)-1;f&=~(1<<w),o+=1;var R=32-Zt(r)+w;if(30<R){var j=w-w%5;R=(f&(1<<j)-1).toString(32),f>>=j,w-=j,Tr=1<<32-Zt(r)+w|o<<w|f,Mr=R+t}else Tr=1<<R|o<<w|f,Mr=t}function uf(t){t.return!==null&&(ii(t,1),tv(t,1,0))}function hf(t){for(;t===pc;)pc=go[--vo],go[vo]=null,Ra=go[--vo],go[vo]=null;for(;t===Oi;)Oi=Kn[--Gn],Kn[Gn]=null,Mr=Kn[--Gn],Kn[Gn]=null,Tr=Kn[--Gn],Kn[Gn]=null}function nv(t,r){Kn[Gn++]=Tr,Kn[Gn++]=Mr,Kn[Gn++]=Oi,Tr=r.id,Mr=r.overflow,Oi=t}var nn=null,_t=null,et=!1,Li=null,Xn=!1,ff=Error(s(519));function Ni(t){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Aa(Yn(r,t)),ff}function rv(t){var r=t.stateNode,o=t.type,f=t.memoizedProps;switch(r[Se]=t,r[we]=f,o){case"dialog":Xe("cancel",r),Xe("close",r);break;case"iframe":case"object":case"embed":Xe("load",r);break;case"video":case"audio":for(o=0;o<Ga.length;o++)Xe(Ga[o],r);break;case"source":Xe("error",r);break;case"img":case"image":case"link":Xe("error",r),Xe("load",r);break;case"details":Xe("toggle",r);break;case"input":Xe("invalid",r),nc(r,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Xe("invalid",r);break;case"textarea":Xe("invalid",r),_g(r,f.value,f.defaultValue,f.children)}o=f.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||f.suppressHydrationWarning===!0||b0(r.textContent,o)?(f.popover!=null&&(Xe("beforetoggle",r),Xe("toggle",r)),f.onScroll!=null&&Xe("scroll",r),f.onScrollEnd!=null&&Xe("scrollend",r),f.onClick!=null&&(r.onclick=ti),r=!0):r=!1,r||Ni(t,!0)}function iv(t){for(nn=t.return;nn;)switch(nn.tag){case 5:case 31:case 13:Xn=!1;return;case 27:case 3:Xn=!0;return;default:nn=nn.return}}function _o(t){if(t!==nn)return!1;if(!et)return iv(t),et=!0,!1;var r=t.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=t.type,o=!(o!=="form"&&o!=="button")||Md(t.type,t.memoizedProps)),o=!o),o&&_t&&Ni(t),iv(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));_t=T0(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));_t=T0(t)}else r===27?(r=_t,Yi(t.type)?(t=Bd,Bd=null,_t=t):_t=r):_t=nn?Zn(t.stateNode.nextSibling):null;return!0}function ws(){_t=nn=null,et=!1}function df(){var t=Li;return t!==null&&(En===null?En=t:En.push.apply(En,t),Li=null),t}function Aa(t){Li===null?Li=[t]:Li.push(t)}var mf=B(null),Cs=null,si=null;function ki(t,r,o){Q(mf,r._currentValue),r._currentValue=o}function oi(t){t._currentValue=mf.current,I(mf)}function pf(t,r,o){for(;t!==null;){var f=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,f!==null&&(f.childLanes|=r)):f!==null&&(f.childLanes&r)!==r&&(f.childLanes|=r),t===o)break;t=t.return}}function gf(t,r,o,f){var w=t.child;for(w!==null&&(w.return=t);w!==null;){var R=w.dependencies;if(R!==null){var j=w.child;R=R.firstContext;e:for(;R!==null;){var Y=R;R=w;for(var te=0;te<r.length;te++)if(Y.context===r[te]){R.lanes|=o,Y=R.alternate,Y!==null&&(Y.lanes|=o),pf(R.return,o,t),f||(j=null);break e}R=Y.next}}else if(w.tag===18){if(j=w.return,j===null)throw Error(s(341));j.lanes|=o,R=j.alternate,R!==null&&(R.lanes|=o),pf(j,o,t),j=null}else j=w.child;if(j!==null)j.return=w;else for(j=w;j!==null;){if(j===t){j=null;break}if(w=j.sibling,w!==null){w.return=j.return,j=w;break}j=j.return}w=j}}function yo(t,r,o,f){t=null;for(var w=r,R=!1;w!==null;){if(!R){if((w.flags&524288)!==0)R=!0;else if((w.flags&262144)!==0)break}if(w.tag===10){var j=w.alternate;if(j===null)throw Error(s(387));if(j=j.memoizedProps,j!==null){var Y=w.type;kn(w.pendingProps.value,j.value)||(t!==null?t.push(Y):t=[Y])}}else if(w===X.current){if(j=w.alternate,j===null)throw Error(s(387));j.memoizedState.memoizedState!==w.memoizedState.memoizedState&&(t!==null?t.push(el):t=[el])}w=w.return}t!==null&&gf(r,t,o,f),r.flags|=262144}function gc(t){for(t=t.firstContext;t!==null;){if(!kn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Es(t){Cs=t,si=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function rn(t){return sv(Cs,t)}function vc(t,r){return Cs===null&&Es(t),sv(t,r)}function sv(t,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},si===null){if(t===null)throw Error(s(308));si=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else si=si.next=r;return o}var ZE=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(o,f){t.push(f)}};this.abort=function(){r.aborted=!0,t.forEach(function(o){return o()})}},JE=e.unstable_scheduleCallback,e2=e.unstable_NormalPriority,jt={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vf(){return{controller:new ZE,data:new Map,refCount:0}}function Da(t){t.refCount--,t.refCount===0&&JE(e2,function(){t.controller.abort()})}var Ta=null,_f=0,bo=0,So=null;function t2(t,r){if(Ta===null){var o=Ta=[];_f=0,bo=Sd(),So={status:"pending",value:void 0,then:function(f){o.push(f)}}}return _f++,r.then(ov,ov),r}function ov(){if(--_f===0&&Ta!==null){So!==null&&(So.status="fulfilled");var t=Ta;Ta=null,bo=0,So=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function n2(t,r){var o=[],f={status:"pending",value:null,reason:null,then:function(w){o.push(w)}};return t.then(function(){f.status="fulfilled",f.value=r;for(var w=0;w<o.length;w++)(0,o[w])(r)},function(w){for(f.status="rejected",f.reason=w,w=0;w<o.length;w++)(0,o[w])(void 0)}),f}var av=H.S;H.S=function(t,r){V_=it(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&t2(t,r),av!==null&&av(t,r)};var Rs=B(null);function yf(){var t=Rs.current;return t!==null?t:ft.pooledCache}function _c(t,r){r===null?Q(Rs,Rs.current):Q(Rs,r.pool)}function lv(){var t=yf();return t===null?null:{parent:jt._currentValue,pool:t}}var xo=Error(s(460)),bf=Error(s(474)),yc=Error(s(542)),bc={then:function(){}};function cv(t){return t=t.status,t==="fulfilled"||t==="rejected"}function uv(t,r,o){switch(o=t[o],o===void 0?t.push(r):o!==r&&(r.then(ti,ti),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,fv(t),t;default:if(typeof r.status=="string")r.then(ti,ti);else{if(t=ft,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(f){if(r.status==="pending"){var w=r;w.status="fulfilled",w.value=f}},function(f){if(r.status==="pending"){var w=r;w.status="rejected",w.reason=f}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,fv(t),t}throw Ds=r,xo}}function As(t){try{var r=t._init;return r(t._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Ds=o,xo):o}}var Ds=null;function hv(){if(Ds===null)throw Error(s(459));var t=Ds;return Ds=null,t}function fv(t){if(t===xo||t===yc)throw Error(s(483))}var wo=null,Ma=0;function Sc(t){var r=Ma;return Ma+=1,wo===null&&(wo=[]),uv(wo,t,r)}function Oa(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function xc(t,r){throw r.$$typeof===_?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function dv(t){function r(oe,ne){if(t){var ce=oe.deletions;ce===null?(oe.deletions=[ne],oe.flags|=16):ce.push(ne)}}function o(oe,ne){if(!t)return null;for(;ne!==null;)r(oe,ne),ne=ne.sibling;return null}function f(oe){for(var ne=new Map;oe!==null;)oe.key!==null?ne.set(oe.key,oe):ne.set(oe.index,oe),oe=oe.sibling;return ne}function w(oe,ne){return oe=ri(oe,ne),oe.index=0,oe.sibling=null,oe}function R(oe,ne,ce){return oe.index=ce,t?(ce=oe.alternate,ce!==null?(ce=ce.index,ce<ne?(oe.flags|=67108866,ne):ce):(oe.flags|=67108866,ne)):(oe.flags|=1048576,ne)}function j(oe){return t&&oe.alternate===null&&(oe.flags|=67108866),oe}function Y(oe,ne,ce,ge){return ne===null||ne.tag!==6?(ne=lf(ce,oe.mode,ge),ne.return=oe,ne):(ne=w(ne,ce),ne.return=oe,ne)}function te(oe,ne,ce,ge){var je=ce.type;return je===S?pe(oe,ne,ce.props.children,ge,ce.key):ne!==null&&(ne.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===A&&As(je)===ne.type)?(ne=w(ne,ce.props),Oa(ne,ce),ne.return=oe,ne):(ne=mc(ce.type,ce.key,ce.props,null,oe.mode,ge),Oa(ne,ce),ne.return=oe,ne)}function ue(oe,ne,ce,ge){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ce.containerInfo||ne.stateNode.implementation!==ce.implementation?(ne=cf(ce,oe.mode,ge),ne.return=oe,ne):(ne=w(ne,ce.children||[]),ne.return=oe,ne)}function pe(oe,ne,ce,ge,je){return ne===null||ne.tag!==7?(ne=xs(ce,oe.mode,ge,je),ne.return=oe,ne):(ne=w(ne,ce),ne.return=oe,ne)}function ve(oe,ne,ce){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=lf(""+ne,oe.mode,ce),ne.return=oe,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case x:return ce=mc(ne.type,ne.key,ne.props,null,oe.mode,ce),Oa(ce,ne),ce.return=oe,ce;case C:return ne=cf(ne,oe.mode,ce),ne.return=oe,ne;case A:return ne=As(ne),ve(oe,ne,ce)}if(G(ne)||z(ne))return ne=xs(ne,oe.mode,ce,null),ne.return=oe,ne;if(typeof ne.then=="function")return ve(oe,Sc(ne),ce);if(ne.$$typeof===y)return ve(oe,vc(oe,ne),ce);xc(oe,ne)}return null}function he(oe,ne,ce,ge){var je=ne!==null?ne.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return je!==null?null:Y(oe,ne,""+ce,ge);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:return ce.key===je?te(oe,ne,ce,ge):null;case C:return ce.key===je?ue(oe,ne,ce,ge):null;case A:return ce=As(ce),he(oe,ne,ce,ge)}if(G(ce)||z(ce))return je!==null?null:pe(oe,ne,ce,ge,null);if(typeof ce.then=="function")return he(oe,ne,Sc(ce),ge);if(ce.$$typeof===y)return he(oe,ne,vc(oe,ce),ge);xc(oe,ce)}return null}function me(oe,ne,ce,ge,je){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return oe=oe.get(ce)||null,Y(ne,oe,""+ge,je);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:return oe=oe.get(ge.key===null?ce:ge.key)||null,te(ne,oe,ge,je);case C:return oe=oe.get(ge.key===null?ce:ge.key)||null,ue(ne,oe,ge,je);case A:return ge=As(ge),me(oe,ne,ce,ge,je)}if(G(ge)||z(ge))return oe=oe.get(ce)||null,pe(ne,oe,ge,je,null);if(typeof ge.then=="function")return me(oe,ne,ce,Sc(ge),je);if(ge.$$typeof===y)return me(oe,ne,ce,vc(ne,ge),je);xc(ne,ge)}return null}function Re(oe,ne,ce,ge){for(var je=null,nt=null,Oe=ne,Fe=ne=0,Je=null;Oe!==null&&Fe<ce.length;Fe++){Oe.index>Fe?(Je=Oe,Oe=null):Je=Oe.sibling;var rt=he(oe,Oe,ce[Fe],ge);if(rt===null){Oe===null&&(Oe=Je);break}t&&Oe&&rt.alternate===null&&r(oe,Oe),ne=R(rt,ne,Fe),nt===null?je=rt:nt.sibling=rt,nt=rt,Oe=Je}if(Fe===ce.length)return o(oe,Oe),et&&ii(oe,Fe),je;if(Oe===null){for(;Fe<ce.length;Fe++)Oe=ve(oe,ce[Fe],ge),Oe!==null&&(ne=R(Oe,ne,Fe),nt===null?je=Oe:nt.sibling=Oe,nt=Oe);return et&&ii(oe,Fe),je}for(Oe=f(Oe);Fe<ce.length;Fe++)Je=me(Oe,oe,Fe,ce[Fe],ge),Je!==null&&(t&&Je.alternate!==null&&Oe.delete(Je.key===null?Fe:Je.key),ne=R(Je,ne,Fe),nt===null?je=Je:nt.sibling=Je,nt=Je);return t&&Oe.forEach(function(Zi){return r(oe,Zi)}),et&&ii(oe,Fe),je}function Pe(oe,ne,ce,ge){if(ce==null)throw Error(s(151));for(var je=null,nt=null,Oe=ne,Fe=ne=0,Je=null,rt=ce.next();Oe!==null&&!rt.done;Fe++,rt=ce.next()){Oe.index>Fe?(Je=Oe,Oe=null):Je=Oe.sibling;var Zi=he(oe,Oe,rt.value,ge);if(Zi===null){Oe===null&&(Oe=Je);break}t&&Oe&&Zi.alternate===null&&r(oe,Oe),ne=R(Zi,ne,Fe),nt===null?je=Zi:nt.sibling=Zi,nt=Zi,Oe=Je}if(rt.done)return o(oe,Oe),et&&ii(oe,Fe),je;if(Oe===null){for(;!rt.done;Fe++,rt=ce.next())rt=ve(oe,rt.value,ge),rt!==null&&(ne=R(rt,ne,Fe),nt===null?je=rt:nt.sibling=rt,nt=rt);return et&&ii(oe,Fe),je}for(Oe=f(Oe);!rt.done;Fe++,rt=ce.next())rt=me(Oe,oe,Fe,rt.value,ge),rt!==null&&(t&&rt.alternate!==null&&Oe.delete(rt.key===null?Fe:rt.key),ne=R(rt,ne,Fe),nt===null?je=rt:nt.sibling=rt,nt=rt);return t&&Oe.forEach(function(dR){return r(oe,dR)}),et&&ii(oe,Fe),je}function ht(oe,ne,ce,ge){if(typeof ce=="object"&&ce!==null&&ce.type===S&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:e:{for(var je=ce.key;ne!==null;){if(ne.key===je){if(je=ce.type,je===S){if(ne.tag===7){o(oe,ne.sibling),ge=w(ne,ce.props.children),ge.return=oe,oe=ge;break e}}else if(ne.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===A&&As(je)===ne.type){o(oe,ne.sibling),ge=w(ne,ce.props),Oa(ge,ce),ge.return=oe,oe=ge;break e}o(oe,ne);break}else r(oe,ne);ne=ne.sibling}ce.type===S?(ge=xs(ce.props.children,oe.mode,ge,ce.key),ge.return=oe,oe=ge):(ge=mc(ce.type,ce.key,ce.props,null,oe.mode,ge),Oa(ge,ce),ge.return=oe,oe=ge)}return j(oe);case C:e:{for(je=ce.key;ne!==null;){if(ne.key===je)if(ne.tag===4&&ne.stateNode.containerInfo===ce.containerInfo&&ne.stateNode.implementation===ce.implementation){o(oe,ne.sibling),ge=w(ne,ce.children||[]),ge.return=oe,oe=ge;break e}else{o(oe,ne);break}else r(oe,ne);ne=ne.sibling}ge=cf(ce,oe.mode,ge),ge.return=oe,oe=ge}return j(oe);case A:return ce=As(ce),ht(oe,ne,ce,ge)}if(G(ce))return Re(oe,ne,ce,ge);if(z(ce)){if(je=z(ce),typeof je!="function")throw Error(s(150));return ce=je.call(ce),Pe(oe,ne,ce,ge)}if(typeof ce.then=="function")return ht(oe,ne,Sc(ce),ge);if(ce.$$typeof===y)return ht(oe,ne,vc(oe,ce),ge);xc(oe,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,ne!==null&&ne.tag===6?(o(oe,ne.sibling),ge=w(ne,ce),ge.return=oe,oe=ge):(o(oe,ne),ge=lf(ce,oe.mode,ge),ge.return=oe,oe=ge),j(oe)):o(oe,ne)}return function(oe,ne,ce,ge){try{Ma=0;var je=ht(oe,ne,ce,ge);return wo=null,je}catch(Oe){if(Oe===xo||Oe===yc)throw Oe;var nt=Bn(29,Oe,null,oe.mode);return nt.lanes=ge,nt.return=oe,nt}}}var Ts=dv(!0),mv=dv(!1),Bi=!1;function Sf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xf(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ji(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Hi(t,r,o){var f=t.updateQueue;if(f===null)return null;if(f=f.shared,(ot&2)!==0){var w=f.pending;return w===null?r.next=r:(r.next=w.next,w.next=r),f.pending=r,r=dc(t),Qg(t,null,o),r}return fc(t,f,r,o),dc(t)}function La(t,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var f=r.lanes;f&=t.pendingLanes,o|=f,r.lanes=o,ee(t,o)}}function wf(t,r){var o=t.updateQueue,f=t.alternate;if(f!==null&&(f=f.updateQueue,o===f)){var w=null,R=null;if(o=o.firstBaseUpdate,o!==null){do{var j={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};R===null?w=R=j:R=R.next=j,o=o.next}while(o!==null);R===null?w=R=r:R=R.next=r}else w=R=r;o={baseState:f.baseState,firstBaseUpdate:w,lastBaseUpdate:R,shared:f.shared,callbacks:f.callbacks},t.updateQueue=o;return}t=o.lastBaseUpdate,t===null?o.firstBaseUpdate=r:t.next=r,o.lastBaseUpdate=r}var Cf=!1;function Na(){if(Cf){var t=So;if(t!==null)throw t}}function ka(t,r,o,f){Cf=!1;var w=t.updateQueue;Bi=!1;var R=w.firstBaseUpdate,j=w.lastBaseUpdate,Y=w.shared.pending;if(Y!==null){w.shared.pending=null;var te=Y,ue=te.next;te.next=null,j===null?R=ue:j.next=ue,j=te;var pe=t.alternate;pe!==null&&(pe=pe.updateQueue,Y=pe.lastBaseUpdate,Y!==j&&(Y===null?pe.firstBaseUpdate=ue:Y.next=ue,pe.lastBaseUpdate=te))}if(R!==null){var ve=w.baseState;j=0,pe=ue=te=null,Y=R;do{var he=Y.lane&-536870913,me=he!==Y.lane;if(me?(Ze&he)===he:(f&he)===he){he!==0&&he===bo&&(Cf=!0),pe!==null&&(pe=pe.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var Re=t,Pe=Y;he=r;var ht=o;switch(Pe.tag){case 1:if(Re=Pe.payload,typeof Re=="function"){ve=Re.call(ht,ve,he);break e}ve=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Pe.payload,he=typeof Re=="function"?Re.call(ht,ve,he):Re,he==null)break e;ve=m({},ve,he);break e;case 2:Bi=!0}}he=Y.callback,he!==null&&(t.flags|=64,me&&(t.flags|=8192),me=w.callbacks,me===null?w.callbacks=[he]:me.push(he))}else me={lane:he,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},pe===null?(ue=pe=me,te=ve):pe=pe.next=me,j|=he;if(Y=Y.next,Y===null){if(Y=w.shared.pending,Y===null)break;me=Y,Y=me.next,me.next=null,w.lastBaseUpdate=me,w.shared.pending=null}}while(!0);pe===null&&(te=ve),w.baseState=te,w.firstBaseUpdate=ue,w.lastBaseUpdate=pe,R===null&&(w.shared.lanes=0),Fi|=j,t.lanes=j,t.memoizedState=ve}}function pv(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function gv(t,r){var o=t.callbacks;if(o!==null)for(t.callbacks=null,t=0;t<o.length;t++)pv(o[t],r)}var Co=B(null),wc=B(0);function vv(t,r){t=pi,Q(wc,t),Q(Co,r),pi=t|r.baseLanes}function Ef(){Q(wc,pi),Q(Co,Co.current)}function Rf(){pi=wc.current,I(Co),I(wc)}var jn=B(null),Qn=null;function Pi(t){var r=t.alternate;Q(Ot,Ot.current&1),Q(jn,t),Qn===null&&(r===null||Co.current!==null||r.memoizedState!==null)&&(Qn=t)}function Af(t){Q(Ot,Ot.current),Q(jn,t),Qn===null&&(Qn=t)}function _v(t){t.tag===22?(Q(Ot,Ot.current),Q(jn,t),Qn===null&&(Qn=t)):zi()}function zi(){Q(Ot,Ot.current),Q(jn,jn.current)}function Hn(t){I(jn),Qn===t&&(Qn=null),I(Ot)}var Ot=B(0);function Cc(t){for(var r=t;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Nd(o)||kd(o)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var ai=0,Ue=null,ct=null,Ht=null,Ec=!1,Eo=!1,Ms=!1,Rc=0,Ba=0,Ro=null,r2=0;function Dt(){throw Error(s(321))}function Df(t,r){if(r===null)return!1;for(var o=0;o<r.length&&o<t.length;o++)if(!kn(t[o],r[o]))return!1;return!0}function Tf(t,r,o,f,w,R){return ai=R,Ue=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,H.H=t===null||t.memoizedState===null?t_:Vf,Ms=!1,R=o(f,w),Ms=!1,Eo&&(R=bv(r,o,f,w)),yv(t),R}function yv(t){H.H=Pa;var r=ct!==null&&ct.next!==null;if(ai=0,Ht=ct=Ue=null,Ec=!1,Ba=0,Ro=null,r)throw Error(s(300));t===null||Pt||(t=t.dependencies,t!==null&&gc(t)&&(Pt=!0))}function bv(t,r,o,f){Ue=t;var w=0;do{if(Eo&&(Ro=null),Ba=0,Eo=!1,25<=w)throw Error(s(301));if(w+=1,Ht=ct=null,t.updateQueue!=null){var R=t.updateQueue;R.lastEffect=null,R.events=null,R.stores=null,R.memoCache!=null&&(R.memoCache.index=0)}H.H=n_,R=r(o,f)}while(Eo);return R}function i2(){var t=H.H,r=t.useState()[0];return r=typeof r.then=="function"?ja(r):r,t=t.useState()[0],(ct!==null?ct.memoizedState:null)!==t&&(Ue.flags|=1024),r}function Mf(){var t=Rc!==0;return Rc=0,t}function Of(t,r,o){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~o}function Lf(t){if(Ec){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Ec=!1}ai=0,Ht=ct=Ue=null,Eo=!1,Ba=Rc=0,Ro=null}function mn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?Ue.memoizedState=Ht=t:Ht=Ht.next=t,Ht}function Lt(){if(ct===null){var t=Ue.alternate;t=t!==null?t.memoizedState:null}else t=ct.next;var r=Ht===null?Ue.memoizedState:Ht.next;if(r!==null)Ht=r,ct=t;else{if(t===null)throw Ue.alternate===null?Error(s(467)):Error(s(310));ct=t,t={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},Ht===null?Ue.memoizedState=Ht=t:Ht=Ht.next=t}return Ht}function Ac(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ja(t){var r=Ba;return Ba+=1,Ro===null&&(Ro=[]),t=uv(Ro,t,r),r=Ue,(Ht===null?r.memoizedState:Ht.next)===null&&(r=r.alternate,H.H=r===null||r.memoizedState===null?t_:Vf),t}function Dc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ja(t);if(t.$$typeof===y)return rn(t)}throw Error(s(438,String(t)))}function Nf(t){var r=null,o=Ue.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var f=Ue.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(r={data:f.data.map(function(w){return w.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=Ac(),Ue.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(t),f=0;f<t;f++)o[f]=q;return r.index++,o}function li(t,r){return typeof r=="function"?r(t):r}function Tc(t){var r=Lt();return kf(r,ct,t)}function kf(t,r,o){var f=t.queue;if(f===null)throw Error(s(311));f.lastRenderedReducer=o;var w=t.baseQueue,R=f.pending;if(R!==null){if(w!==null){var j=w.next;w.next=R.next,R.next=j}r.baseQueue=w=R,f.pending=null}if(R=t.baseState,w===null)t.memoizedState=R;else{r=w.next;var Y=j=null,te=null,ue=r,pe=!1;do{var ve=ue.lane&-536870913;if(ve!==ue.lane?(Ze&ve)===ve:(ai&ve)===ve){var he=ue.revertLane;if(he===0)te!==null&&(te=te.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),ve===bo&&(pe=!0);else if((ai&he)===he){ue=ue.next,he===bo&&(pe=!0);continue}else ve={lane:0,revertLane:ue.revertLane,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},te===null?(Y=te=ve,j=R):te=te.next=ve,Ue.lanes|=he,Fi|=he;ve=ue.action,Ms&&o(R,ve),R=ue.hasEagerState?ue.eagerState:o(R,ve)}else he={lane:ve,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},te===null?(Y=te=he,j=R):te=te.next=he,Ue.lanes|=ve,Fi|=ve;ue=ue.next}while(ue!==null&&ue!==r);if(te===null?j=R:te.next=Y,!kn(R,t.memoizedState)&&(Pt=!0,pe&&(o=So,o!==null)))throw o;t.memoizedState=R,t.baseState=j,t.baseQueue=te,f.lastRenderedState=R}return w===null&&(f.lanes=0),[t.memoizedState,f.dispatch]}function Bf(t){var r=Lt(),o=r.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=t;var f=o.dispatch,w=o.pending,R=r.memoizedState;if(w!==null){o.pending=null;var j=w=w.next;do R=t(R,j.action),j=j.next;while(j!==w);kn(R,r.memoizedState)||(Pt=!0),r.memoizedState=R,r.baseQueue===null&&(r.baseState=R),o.lastRenderedState=R}return[R,f]}function Sv(t,r,o){var f=Ue,w=Lt(),R=et;if(R){if(o===void 0)throw Error(s(407));o=o()}else o=r();var j=!kn((ct||w).memoizedState,o);if(j&&(w.memoizedState=o,Pt=!0),w=w.queue,Pf(Cv.bind(null,f,w,t),[t]),w.getSnapshot!==r||j||Ht!==null&&Ht.memoizedState.tag&1){if(f.flags|=2048,Ao(9,{destroy:void 0},wv.bind(null,f,w,o,r),null),ft===null)throw Error(s(349));R||(ai&127)!==0||xv(f,r,o)}return o}function xv(t,r,o){t.flags|=16384,t={getSnapshot:r,value:o},r=Ue.updateQueue,r===null?(r=Ac(),Ue.updateQueue=r,r.stores=[t]):(o=r.stores,o===null?r.stores=[t]:o.push(t))}function wv(t,r,o,f){r.value=o,r.getSnapshot=f,Ev(r)&&Rv(t)}function Cv(t,r,o){return o(function(){Ev(r)&&Rv(t)})}function Ev(t){var r=t.getSnapshot;t=t.value;try{var o=r();return!kn(t,o)}catch{return!0}}function Rv(t){var r=Ss(t,2);r!==null&&Rn(r,t,2)}function jf(t){var r=mn();if(typeof t=="function"){var o=t;if(t=o(),Ms){Mn(!0);try{o()}finally{Mn(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:li,lastRenderedState:t},r}function Av(t,r,o,f){return t.baseState=o,kf(t,ct,typeof f=="function"?f:li)}function s2(t,r,o,f,w){if(Lc(t))throw Error(s(485));if(t=r.action,t!==null){var R={payload:w,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){R.listeners.push(j)}};H.T!==null?o(!0):R.isTransition=!1,f(R),o=r.pending,o===null?(R.next=r.pending=R,Dv(r,R)):(R.next=o.next,r.pending=o.next=R)}}function Dv(t,r){var o=r.action,f=r.payload,w=t.state;if(r.isTransition){var R=H.T,j={};H.T=j;try{var Y=o(w,f),te=H.S;te!==null&&te(j,Y),Tv(t,r,Y)}catch(ue){Hf(t,r,ue)}finally{R!==null&&j.types!==null&&(R.types=j.types),H.T=R}}else try{R=o(w,f),Tv(t,r,R)}catch(ue){Hf(t,r,ue)}}function Tv(t,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(f){Mv(t,r,f)},function(f){return Hf(t,r,f)}):Mv(t,r,o)}function Mv(t,r,o){r.status="fulfilled",r.value=o,Ov(r),t.state=o,r=t.pending,r!==null&&(o=r.next,o===r?t.pending=null:(o=o.next,r.next=o,Dv(t,o)))}function Hf(t,r,o){var f=t.pending;if(t.pending=null,f!==null){f=f.next;do r.status="rejected",r.reason=o,Ov(r),r=r.next;while(r!==f)}t.action=null}function Ov(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Lv(t,r){return r}function Nv(t,r){if(et){var o=ft.formState;if(o!==null){e:{var f=Ue;if(et){if(_t){t:{for(var w=_t,R=Xn;w.nodeType!==8;){if(!R){w=null;break t}if(w=Zn(w.nextSibling),w===null){w=null;break t}}R=w.data,w=R==="F!"||R==="F"?w:null}if(w){_t=Zn(w.nextSibling),f=w.data==="F!";break e}}Ni(f)}f=!1}f&&(r=o[0])}}return o=mn(),o.memoizedState=o.baseState=r,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lv,lastRenderedState:r},o.queue=f,o=Zv.bind(null,Ue,f),f.dispatch=o,f=jf(!1),R=$f.bind(null,Ue,!1,f.queue),f=mn(),w={state:r,dispatch:null,action:t,pending:null},f.queue=w,o=s2.bind(null,Ue,w,R,o),w.dispatch=o,f.memoizedState=t,[r,o,!1]}function kv(t){var r=Lt();return Bv(r,ct,t)}function Bv(t,r,o){if(r=kf(t,r,Lv)[0],t=Tc(li)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var f=ja(r)}catch(j){throw j===xo?yc:j}else f=r;r=Lt();var w=r.queue,R=w.dispatch;return o!==r.memoizedState&&(Ue.flags|=2048,Ao(9,{destroy:void 0},o2.bind(null,w,o),null)),[f,R,t]}function o2(t,r){t.action=r}function jv(t){var r=Lt(),o=ct;if(o!==null)return Bv(r,o,t);Lt(),r=r.memoizedState,o=Lt();var f=o.queue.dispatch;return o.memoizedState=t,[r,f,!1]}function Ao(t,r,o,f){return t={tag:t,create:o,deps:f,inst:r,next:null},r=Ue.updateQueue,r===null&&(r=Ac(),Ue.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=t.next=t:(f=o.next,o.next=t,t.next=f,r.lastEffect=t),t}function Hv(){return Lt().memoizedState}function Mc(t,r,o,f){var w=mn();Ue.flags|=t,w.memoizedState=Ao(1|r,{destroy:void 0},o,f===void 0?null:f)}function Oc(t,r,o,f){var w=Lt();f=f===void 0?null:f;var R=w.memoizedState.inst;ct!==null&&f!==null&&Df(f,ct.memoizedState.deps)?w.memoizedState=Ao(r,R,o,f):(Ue.flags|=t,w.memoizedState=Ao(1|r,R,o,f))}function Pv(t,r){Mc(8390656,8,t,r)}function Pf(t,r){Oc(2048,8,t,r)}function a2(t){Ue.flags|=4;var r=Ue.updateQueue;if(r===null)r=Ac(),Ue.updateQueue=r,r.events=[t];else{var o=r.events;o===null?r.events=[t]:o.push(t)}}function zv(t){var r=Lt().memoizedState;return a2({ref:r,nextImpl:t}),function(){if((ot&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function Iv(t,r){return Oc(4,2,t,r)}function Uv(t,r){return Oc(4,4,t,r)}function Fv(t,r){if(typeof r=="function"){t=t();var o=r(t);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function $v(t,r,o){o=o!=null?o.concat([t]):null,Oc(4,4,Fv.bind(null,r,t),o)}function zf(){}function Vv(t,r){var o=Lt();r=r===void 0?null:r;var f=o.memoizedState;return r!==null&&Df(r,f[1])?f[0]:(o.memoizedState=[t,r],t)}function qv(t,r){var o=Lt();r=r===void 0?null:r;var f=o.memoizedState;if(r!==null&&Df(r,f[1]))return f[0];if(f=t(),Ms){Mn(!0);try{t()}finally{Mn(!1)}}return o.memoizedState=[f,r],f}function If(t,r,o){return o===void 0||(ai&1073741824)!==0&&(Ze&261930)===0?t.memoizedState=r:(t.memoizedState=o,t=W_(),Ue.lanes|=t,Fi|=t,o)}function Wv(t,r,o,f){return kn(o,r)?o:Co.current!==null?(t=If(t,o,f),kn(t,r)||(Pt=!0),t):(ai&42)===0||(ai&1073741824)!==0&&(Ze&261930)===0?(Pt=!0,t.memoizedState=o):(t=W_(),Ue.lanes|=t,Fi|=t,r)}function Yv(t,r,o,f,w){var R=K.p;K.p=R!==0&&8>R?R:8;var j=H.T,Y={};H.T=Y,$f(t,!1,r,o);try{var te=w(),ue=H.S;if(ue!==null&&ue(Y,te),te!==null&&typeof te=="object"&&typeof te.then=="function"){var pe=n2(te,f);Ha(t,r,pe,In(t))}else Ha(t,r,f,In(t))}catch(ve){Ha(t,r,{then:function(){},status:"rejected",reason:ve},In())}finally{K.p=R,j!==null&&Y.types!==null&&(j.types=Y.types),H.T=j}}function l2(){}function Uf(t,r,o,f){if(t.tag!==5)throw Error(s(476));var w=Kv(t).queue;Yv(t,w,r,F,o===null?l2:function(){return Gv(t),o(f)})}function Kv(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:li,lastRenderedState:F},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:li,lastRenderedState:o},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Gv(t){var r=Kv(t);r.next===null&&(r=t.alternate.memoizedState),Ha(t,r.next.queue,{},In())}function Ff(){return rn(el)}function Xv(){return Lt().memoizedState}function Qv(){return Lt().memoizedState}function c2(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var o=In();t=ji(o);var f=Hi(r,t,o);f!==null&&(Rn(f,r,o),La(f,r,o)),r={cache:vf()},t.payload=r;return}r=r.return}}function u2(t,r,o){var f=In();o={lane:f,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Lc(t)?Jv(r,o):(o=of(t,r,o,f),o!==null&&(Rn(o,t,f),e_(o,r,f)))}function Zv(t,r,o){var f=In();Ha(t,r,o,f)}function Ha(t,r,o,f){var w={lane:f,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Lc(t))Jv(r,w);else{var R=t.alternate;if(t.lanes===0&&(R===null||R.lanes===0)&&(R=r.lastRenderedReducer,R!==null))try{var j=r.lastRenderedState,Y=R(j,o);if(w.hasEagerState=!0,w.eagerState=Y,kn(Y,j))return fc(t,r,w,0),ft===null&&hc(),!1}catch{}if(o=of(t,r,w,f),o!==null)return Rn(o,t,f),e_(o,r,f),!0}return!1}function $f(t,r,o,f){if(f={lane:2,revertLane:Sd(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Lc(t)){if(r)throw Error(s(479))}else r=of(t,o,f,2),r!==null&&Rn(r,t,2)}function Lc(t){var r=t.alternate;return t===Ue||r!==null&&r===Ue}function Jv(t,r){Eo=Ec=!0;var o=t.pending;o===null?r.next=r:(r.next=o.next,o.next=r),t.pending=r}function e_(t,r,o){if((o&4194048)!==0){var f=r.lanes;f&=t.pendingLanes,o|=f,r.lanes=o,ee(t,o)}}var Pa={readContext:rn,use:Dc,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useLayoutEffect:Dt,useInsertionEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useSyncExternalStore:Dt,useId:Dt,useHostTransitionStatus:Dt,useFormState:Dt,useActionState:Dt,useOptimistic:Dt,useMemoCache:Dt,useCacheRefresh:Dt};Pa.useEffectEvent=Dt;var t_={readContext:rn,use:Dc,useCallback:function(t,r){return mn().memoizedState=[t,r===void 0?null:r],t},useContext:rn,useEffect:Pv,useImperativeHandle:function(t,r,o){o=o!=null?o.concat([t]):null,Mc(4194308,4,Fv.bind(null,r,t),o)},useLayoutEffect:function(t,r){return Mc(4194308,4,t,r)},useInsertionEffect:function(t,r){Mc(4,2,t,r)},useMemo:function(t,r){var o=mn();r=r===void 0?null:r;var f=t();if(Ms){Mn(!0);try{t()}finally{Mn(!1)}}return o.memoizedState=[f,r],f},useReducer:function(t,r,o){var f=mn();if(o!==void 0){var w=o(r);if(Ms){Mn(!0);try{o(r)}finally{Mn(!1)}}}else w=r;return f.memoizedState=f.baseState=w,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:w},f.queue=t,t=t.dispatch=u2.bind(null,Ue,t),[f.memoizedState,t]},useRef:function(t){var r=mn();return t={current:t},r.memoizedState=t},useState:function(t){t=jf(t);var r=t.queue,o=Zv.bind(null,Ue,r);return r.dispatch=o,[t.memoizedState,o]},useDebugValue:zf,useDeferredValue:function(t,r){var o=mn();return If(o,t,r)},useTransition:function(){var t=jf(!1);return t=Yv.bind(null,Ue,t.queue,!0,!1),mn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,o){var f=Ue,w=mn();if(et){if(o===void 0)throw Error(s(407));o=o()}else{if(o=r(),ft===null)throw Error(s(349));(Ze&127)!==0||xv(f,r,o)}w.memoizedState=o;var R={value:o,getSnapshot:r};return w.queue=R,Pv(Cv.bind(null,f,R,t),[t]),f.flags|=2048,Ao(9,{destroy:void 0},wv.bind(null,f,R,o,r),null),o},useId:function(){var t=mn(),r=ft.identifierPrefix;if(et){var o=Mr,f=Tr;o=(f&~(1<<32-Zt(f)-1)).toString(32)+o,r="_"+r+"R_"+o,o=Rc++,0<o&&(r+="H"+o.toString(32)),r+="_"}else o=r2++,r="_"+r+"r_"+o.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Ff,useFormState:Nv,useActionState:Nv,useOptimistic:function(t){var r=mn();r.memoizedState=r.baseState=t;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=$f.bind(null,Ue,!0,o),o.dispatch=r,[t,r]},useMemoCache:Nf,useCacheRefresh:function(){return mn().memoizedState=c2.bind(null,Ue)},useEffectEvent:function(t){var r=mn(),o={impl:t};return r.memoizedState=o,function(){if((ot&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}},Vf={readContext:rn,use:Dc,useCallback:Vv,useContext:rn,useEffect:Pf,useImperativeHandle:$v,useInsertionEffect:Iv,useLayoutEffect:Uv,useMemo:qv,useReducer:Tc,useRef:Hv,useState:function(){return Tc(li)},useDebugValue:zf,useDeferredValue:function(t,r){var o=Lt();return Wv(o,ct.memoizedState,t,r)},useTransition:function(){var t=Tc(li)[0],r=Lt().memoizedState;return[typeof t=="boolean"?t:ja(t),r]},useSyncExternalStore:Sv,useId:Xv,useHostTransitionStatus:Ff,useFormState:kv,useActionState:kv,useOptimistic:function(t,r){var o=Lt();return Av(o,ct,t,r)},useMemoCache:Nf,useCacheRefresh:Qv};Vf.useEffectEvent=zv;var n_={readContext:rn,use:Dc,useCallback:Vv,useContext:rn,useEffect:Pf,useImperativeHandle:$v,useInsertionEffect:Iv,useLayoutEffect:Uv,useMemo:qv,useReducer:Bf,useRef:Hv,useState:function(){return Bf(li)},useDebugValue:zf,useDeferredValue:function(t,r){var o=Lt();return ct===null?If(o,t,r):Wv(o,ct.memoizedState,t,r)},useTransition:function(){var t=Bf(li)[0],r=Lt().memoizedState;return[typeof t=="boolean"?t:ja(t),r]},useSyncExternalStore:Sv,useId:Xv,useHostTransitionStatus:Ff,useFormState:jv,useActionState:jv,useOptimistic:function(t,r){var o=Lt();return ct!==null?Av(o,ct,t,r):(o.baseState=t,[t,o.queue.dispatch])},useMemoCache:Nf,useCacheRefresh:Qv};n_.useEffectEvent=zv;function qf(t,r,o,f){r=t.memoizedState,o=o(f,r),o=o==null?r:m({},r,o),t.memoizedState=o,t.lanes===0&&(t.updateQueue.baseState=o)}var Wf={enqueueSetState:function(t,r,o){t=t._reactInternals;var f=In(),w=ji(f);w.payload=r,o!=null&&(w.callback=o),r=Hi(t,w,f),r!==null&&(Rn(r,t,f),La(r,t,f))},enqueueReplaceState:function(t,r,o){t=t._reactInternals;var f=In(),w=ji(f);w.tag=1,w.payload=r,o!=null&&(w.callback=o),r=Hi(t,w,f),r!==null&&(Rn(r,t,f),La(r,t,f))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var o=In(),f=ji(o);f.tag=2,r!=null&&(f.callback=r),r=Hi(t,f,o),r!==null&&(Rn(r,t,o),La(r,t,o))}};function r_(t,r,o,f,w,R,j){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(f,R,j):r.prototype&&r.prototype.isPureReactComponent?!Ca(o,f)||!Ca(w,R):!0}function i_(t,r,o,f){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,f),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,f),r.state!==t&&Wf.enqueueReplaceState(r,r.state,null)}function Os(t,r){var o=r;if("ref"in r){o={};for(var f in r)f!=="ref"&&(o[f]=r[f])}if(t=t.defaultProps){o===r&&(o=m({},o));for(var w in t)o[w]===void 0&&(o[w]=t[w])}return o}function s_(t){uc(t)}function o_(t){console.error(t)}function a_(t){uc(t)}function Nc(t,r){try{var o=t.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(f){setTimeout(function(){throw f})}}function l_(t,r,o){try{var f=t.onCaughtError;f(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(w){setTimeout(function(){throw w})}}function Yf(t,r,o){return o=ji(o),o.tag=3,o.payload={element:null},o.callback=function(){Nc(t,r)},o}function c_(t){return t=ji(t),t.tag=3,t}function u_(t,r,o,f){var w=o.type.getDerivedStateFromError;if(typeof w=="function"){var R=f.value;t.payload=function(){return w(R)},t.callback=function(){l_(r,o,f)}}var j=o.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(t.callback=function(){l_(r,o,f),typeof w!="function"&&($i===null?$i=new Set([this]):$i.add(this));var Y=f.stack;this.componentDidCatch(f.value,{componentStack:Y!==null?Y:""})})}function h2(t,r,o,f,w){if(o.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(r=o.alternate,r!==null&&yo(r,o,w,!0),o=jn.current,o!==null){switch(o.tag){case 31:case 13:return Qn===null?qc():o.alternate===null&&Tt===0&&(Tt=3),o.flags&=-257,o.flags|=65536,o.lanes=w,f===bc?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([f]):r.add(f),_d(t,f,w)),!1;case 22:return o.flags|=65536,f===bc?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([f])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([f]):o.add(f)),_d(t,f,w)),!1}throw Error(s(435,o.tag))}return _d(t,f,w),qc(),!1}if(et)return r=jn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=w,f!==ff&&(t=Error(s(422),{cause:f}),Aa(Yn(t,o)))):(f!==ff&&(r=Error(s(423),{cause:f}),Aa(Yn(r,o))),t=t.current.alternate,t.flags|=65536,w&=-w,t.lanes|=w,f=Yn(f,o),w=Yf(t.stateNode,f,w),wf(t,w),Tt!==4&&(Tt=2)),!1;var R=Error(s(520),{cause:f});if(R=Yn(R,o),Wa===null?Wa=[R]:Wa.push(R),Tt!==4&&(Tt=2),r===null)return!0;f=Yn(f,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,t=w&-w,o.lanes|=t,t=Yf(o.stateNode,f,t),wf(o,t),!1;case 1:if(r=o.type,R=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&($i===null||!$i.has(R))))return o.flags|=65536,w&=-w,o.lanes|=w,w=c_(w),u_(w,t,o,f),wf(o,w),!1}o=o.return}while(o!==null);return!1}var Kf=Error(s(461)),Pt=!1;function sn(t,r,o,f){r.child=t===null?mv(r,null,o,f):Ts(r,t.child,o,f)}function h_(t,r,o,f,w){o=o.render;var R=r.ref;if("ref"in f){var j={};for(var Y in f)Y!=="ref"&&(j[Y]=f[Y])}else j=f;return Es(r),f=Tf(t,r,o,j,R,w),Y=Mf(),t!==null&&!Pt?(Of(t,r,w),ci(t,r,w)):(et&&Y&&uf(r),r.flags|=1,sn(t,r,f,w),r.child)}function f_(t,r,o,f,w){if(t===null){var R=o.type;return typeof R=="function"&&!af(R)&&R.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=R,d_(t,r,R,f,w)):(t=mc(o.type,null,f,r,r.mode,w),t.ref=r.ref,t.return=r,r.child=t)}if(R=t.child,!nd(t,w)){var j=R.memoizedProps;if(o=o.compare,o=o!==null?o:Ca,o(j,f)&&t.ref===r.ref)return ci(t,r,w)}return r.flags|=1,t=ri(R,f),t.ref=r.ref,t.return=r,r.child=t}function d_(t,r,o,f,w){if(t!==null){var R=t.memoizedProps;if(Ca(R,f)&&t.ref===r.ref)if(Pt=!1,r.pendingProps=f=R,nd(t,w))(t.flags&131072)!==0&&(Pt=!0);else return r.lanes=t.lanes,ci(t,r,w)}return Gf(t,r,o,f,w)}function m_(t,r,o,f){var w=f.children,R=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((r.flags&128)!==0){if(R=R!==null?R.baseLanes|o:o,t!==null){for(f=r.child=t.child,w=0;f!==null;)w=w|f.lanes|f.childLanes,f=f.sibling;f=w&~R}else f=0,r.child=null;return p_(t,r,R,o,f)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&_c(r,R!==null?R.cachePool:null),R!==null?vv(r,R):Ef(),_v(r);else return f=r.lanes=536870912,p_(t,r,R!==null?R.baseLanes|o:o,o,f)}else R!==null?(_c(r,R.cachePool),vv(r,R),zi(),r.memoizedState=null):(t!==null&&_c(r,null),Ef(),zi());return sn(t,r,w,o),r.child}function za(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function p_(t,r,o,f,w){var R=yf();return R=R===null?null:{parent:jt._currentValue,pool:R},r.memoizedState={baseLanes:o,cachePool:R},t!==null&&_c(r,null),Ef(),_v(r),t!==null&&yo(t,r,f,!0),r.childLanes=w,null}function kc(t,r){return r=jc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function g_(t,r,o){return Ts(r,t.child,null,o),t=kc(r,r.pendingProps),t.flags|=2,Hn(r),r.memoizedState=null,t}function f2(t,r,o){var f=r.pendingProps,w=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(et){if(f.mode==="hidden")return t=kc(r,f),r.lanes=536870912,za(null,t);if(Af(r),(t=_t)?(t=D0(t,Xn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Oi!==null?{id:Tr,overflow:Mr}:null,retryLane:536870912,hydrationErrors:null},o=Jg(t),o.return=r,r.child=o,nn=r,_t=null)):t=null,t===null)throw Ni(r);return r.lanes=536870912,null}return kc(r,f)}var R=t.memoizedState;if(R!==null){var j=R.dehydrated;if(Af(r),w)if(r.flags&256)r.flags&=-257,r=g_(t,r,o);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(Pt||yo(t,r,o,!1),w=(o&t.childLanes)!==0,Pt||w){if(f=ft,f!==null&&(j=se(f,o),j!==0&&j!==R.retryLane))throw R.retryLane=j,Ss(t,j),Rn(f,t,j),Kf;qc(),r=g_(t,r,o)}else t=R.treeContext,_t=Zn(j.nextSibling),nn=r,et=!0,Li=null,Xn=!1,t!==null&&nv(r,t),r=kc(r,f),r.flags|=4096;return r}return t=ri(t.child,{mode:f.mode,children:f.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Bc(t,r){var o=r.ref;if(o===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(s(284));(t===null||t.ref!==o)&&(r.flags|=4194816)}}function Gf(t,r,o,f,w){return Es(r),o=Tf(t,r,o,f,void 0,w),f=Mf(),t!==null&&!Pt?(Of(t,r,w),ci(t,r,w)):(et&&f&&uf(r),r.flags|=1,sn(t,r,o,w),r.child)}function v_(t,r,o,f,w,R){return Es(r),r.updateQueue=null,o=bv(r,f,o,w),yv(t),f=Mf(),t!==null&&!Pt?(Of(t,r,R),ci(t,r,R)):(et&&f&&uf(r),r.flags|=1,sn(t,r,o,R),r.child)}function __(t,r,o,f,w){if(Es(r),r.stateNode===null){var R=po,j=o.contextType;typeof j=="object"&&j!==null&&(R=rn(j)),R=new o(f,R),r.memoizedState=R.state!==null&&R.state!==void 0?R.state:null,R.updater=Wf,r.stateNode=R,R._reactInternals=r,R=r.stateNode,R.props=f,R.state=r.memoizedState,R.refs={},Sf(r),j=o.contextType,R.context=typeof j=="object"&&j!==null?rn(j):po,R.state=r.memoizedState,j=o.getDerivedStateFromProps,typeof j=="function"&&(qf(r,o,j,f),R.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof R.getSnapshotBeforeUpdate=="function"||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(j=R.state,typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount(),j!==R.state&&Wf.enqueueReplaceState(R,R.state,null),ka(r,f,R,w),Na(),R.state=r.memoizedState),typeof R.componentDidMount=="function"&&(r.flags|=4194308),f=!0}else if(t===null){R=r.stateNode;var Y=r.memoizedProps,te=Os(o,Y);R.props=te;var ue=R.context,pe=o.contextType;j=po,typeof pe=="object"&&pe!==null&&(j=rn(pe));var ve=o.getDerivedStateFromProps;pe=typeof ve=="function"||typeof R.getSnapshotBeforeUpdate=="function",Y=r.pendingProps!==Y,pe||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(Y||ue!==j)&&i_(r,R,f,j),Bi=!1;var he=r.memoizedState;R.state=he,ka(r,f,R,w),Na(),ue=r.memoizedState,Y||he!==ue||Bi?(typeof ve=="function"&&(qf(r,o,ve,f),ue=r.memoizedState),(te=Bi||r_(r,o,te,f,he,ue,j))?(pe||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(r.flags|=4194308)):(typeof R.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=f,r.memoizedState=ue),R.props=f,R.state=ue,R.context=j,f=te):(typeof R.componentDidMount=="function"&&(r.flags|=4194308),f=!1)}else{R=r.stateNode,xf(t,r),j=r.memoizedProps,pe=Os(o,j),R.props=pe,ve=r.pendingProps,he=R.context,ue=o.contextType,te=po,typeof ue=="object"&&ue!==null&&(te=rn(ue)),Y=o.getDerivedStateFromProps,(ue=typeof Y=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(j!==ve||he!==te)&&i_(r,R,f,te),Bi=!1,he=r.memoizedState,R.state=he,ka(r,f,R,w),Na();var me=r.memoizedState;j!==ve||he!==me||Bi||t!==null&&t.dependencies!==null&&gc(t.dependencies)?(typeof Y=="function"&&(qf(r,o,Y,f),me=r.memoizedState),(pe=Bi||r_(r,o,pe,f,he,me,te)||t!==null&&t.dependencies!==null&&gc(t.dependencies))?(ue||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(f,me,te),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(f,me,te)),typeof R.componentDidUpdate=="function"&&(r.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof R.componentDidUpdate!="function"||j===t.memoizedProps&&he===t.memoizedState||(r.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||j===t.memoizedProps&&he===t.memoizedState||(r.flags|=1024),r.memoizedProps=f,r.memoizedState=me),R.props=f,R.state=me,R.context=te,f=pe):(typeof R.componentDidUpdate!="function"||j===t.memoizedProps&&he===t.memoizedState||(r.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||j===t.memoizedProps&&he===t.memoizedState||(r.flags|=1024),f=!1)}return R=f,Bc(t,r),f=(r.flags&128)!==0,R||f?(R=r.stateNode,o=f&&typeof o.getDerivedStateFromError!="function"?null:R.render(),r.flags|=1,t!==null&&f?(r.child=Ts(r,t.child,null,w),r.child=Ts(r,null,o,w)):sn(t,r,o,w),r.memoizedState=R.state,t=r.child):t=ci(t,r,w),t}function y_(t,r,o,f){return ws(),r.flags|=256,sn(t,r,o,f),r.child}var Xf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qf(t){return{baseLanes:t,cachePool:lv()}}function Zf(t,r,o){return t=t!==null?t.childLanes&~o:0,r&&(t|=zn),t}function b_(t,r,o){var f=r.pendingProps,w=!1,R=(r.flags&128)!==0,j;if((j=R)||(j=t!==null&&t.memoizedState===null?!1:(Ot.current&2)!==0),j&&(w=!0,r.flags&=-129),j=(r.flags&32)!==0,r.flags&=-33,t===null){if(et){if(w?Pi(r):zi(),(t=_t)?(t=D0(t,Xn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Oi!==null?{id:Tr,overflow:Mr}:null,retryLane:536870912,hydrationErrors:null},o=Jg(t),o.return=r,r.child=o,nn=r,_t=null)):t=null,t===null)throw Ni(r);return kd(t)?r.lanes=32:r.lanes=536870912,null}var Y=f.children;return f=f.fallback,w?(zi(),w=r.mode,Y=jc({mode:"hidden",children:Y},w),f=xs(f,w,o,null),Y.return=r,f.return=r,Y.sibling=f,r.child=Y,f=r.child,f.memoizedState=Qf(o),f.childLanes=Zf(t,j,o),r.memoizedState=Xf,za(null,f)):(Pi(r),Jf(r,Y))}var te=t.memoizedState;if(te!==null&&(Y=te.dehydrated,Y!==null)){if(R)r.flags&256?(Pi(r),r.flags&=-257,r=ed(t,r,o)):r.memoizedState!==null?(zi(),r.child=t.child,r.flags|=128,r=null):(zi(),Y=f.fallback,w=r.mode,f=jc({mode:"visible",children:f.children},w),Y=xs(Y,w,o,null),Y.flags|=2,f.return=r,Y.return=r,f.sibling=Y,r.child=f,Ts(r,t.child,null,o),f=r.child,f.memoizedState=Qf(o),f.childLanes=Zf(t,j,o),r.memoizedState=Xf,r=za(null,f));else if(Pi(r),kd(Y)){if(j=Y.nextSibling&&Y.nextSibling.dataset,j)var ue=j.dgst;j=ue,f=Error(s(419)),f.stack="",f.digest=j,Aa({value:f,source:null,stack:null}),r=ed(t,r,o)}else if(Pt||yo(t,r,o,!1),j=(o&t.childLanes)!==0,Pt||j){if(j=ft,j!==null&&(f=se(j,o),f!==0&&f!==te.retryLane))throw te.retryLane=f,Ss(t,f),Rn(j,t,f),Kf;Nd(Y)||qc(),r=ed(t,r,o)}else Nd(Y)?(r.flags|=192,r.child=t.child,r=null):(t=te.treeContext,_t=Zn(Y.nextSibling),nn=r,et=!0,Li=null,Xn=!1,t!==null&&nv(r,t),r=Jf(r,f.children),r.flags|=4096);return r}return w?(zi(),Y=f.fallback,w=r.mode,te=t.child,ue=te.sibling,f=ri(te,{mode:"hidden",children:f.children}),f.subtreeFlags=te.subtreeFlags&65011712,ue!==null?Y=ri(ue,Y):(Y=xs(Y,w,o,null),Y.flags|=2),Y.return=r,f.return=r,f.sibling=Y,r.child=f,za(null,f),f=r.child,Y=t.child.memoizedState,Y===null?Y=Qf(o):(w=Y.cachePool,w!==null?(te=jt._currentValue,w=w.parent!==te?{parent:te,pool:te}:w):w=lv(),Y={baseLanes:Y.baseLanes|o,cachePool:w}),f.memoizedState=Y,f.childLanes=Zf(t,j,o),r.memoizedState=Xf,za(t.child,f)):(Pi(r),o=t.child,t=o.sibling,o=ri(o,{mode:"visible",children:f.children}),o.return=r,o.sibling=null,t!==null&&(j=r.deletions,j===null?(r.deletions=[t],r.flags|=16):j.push(t)),r.child=o,r.memoizedState=null,o)}function Jf(t,r){return r=jc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function jc(t,r){return t=Bn(22,t,null,r),t.lanes=0,t}function ed(t,r,o){return Ts(r,t.child,null,o),t=Jf(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function S_(t,r,o){t.lanes|=r;var f=t.alternate;f!==null&&(f.lanes|=r),pf(t.return,r,o)}function td(t,r,o,f,w,R){var j=t.memoizedState;j===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:f,tail:o,tailMode:w,treeForkCount:R}:(j.isBackwards=r,j.rendering=null,j.renderingStartTime=0,j.last=f,j.tail=o,j.tailMode=w,j.treeForkCount=R)}function x_(t,r,o){var f=r.pendingProps,w=f.revealOrder,R=f.tail;f=f.children;var j=Ot.current,Y=(j&2)!==0;if(Y?(j=j&1|2,r.flags|=128):j&=1,Q(Ot,j),sn(t,r,f,o),f=et?Ra:0,!Y&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&S_(t,o,r);else if(t.tag===19)S_(t,o,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(w){case"forwards":for(o=r.child,w=null;o!==null;)t=o.alternate,t!==null&&Cc(t)===null&&(w=o),o=o.sibling;o=w,o===null?(w=r.child,r.child=null):(w=o.sibling,o.sibling=null),td(r,!1,w,o,R,f);break;case"backwards":case"unstable_legacy-backwards":for(o=null,w=r.child,r.child=null;w!==null;){if(t=w.alternate,t!==null&&Cc(t)===null){r.child=w;break}t=w.sibling,w.sibling=o,o=w,w=t}td(r,!0,o,null,R,f);break;case"together":td(r,!1,null,null,void 0,f);break;default:r.memoizedState=null}return r.child}function ci(t,r,o){if(t!==null&&(r.dependencies=t.dependencies),Fi|=r.lanes,(o&r.childLanes)===0)if(t!==null){if(yo(t,r,o,!1),(o&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,o=ri(t,t.pendingProps),r.child=o,o.return=r;t.sibling!==null;)t=t.sibling,o=o.sibling=ri(t,t.pendingProps),o.return=r;o.sibling=null}return r.child}function nd(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&gc(t)))}function d2(t,r,o){switch(r.tag){case 3:V(r,r.stateNode.containerInfo),ki(r,jt,t.memoizedState.cache),ws();break;case 27:case 5:de(r);break;case 4:V(r,r.stateNode.containerInfo);break;case 10:ki(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Af(r),null;break;case 13:var f=r.memoizedState;if(f!==null)return f.dehydrated!==null?(Pi(r),r.flags|=128,null):(o&r.child.childLanes)!==0?b_(t,r,o):(Pi(r),t=ci(t,r,o),t!==null?t.sibling:null);Pi(r);break;case 19:var w=(t.flags&128)!==0;if(f=(o&r.childLanes)!==0,f||(yo(t,r,o,!1),f=(o&r.childLanes)!==0),w){if(f)return x_(t,r,o);r.flags|=128}if(w=r.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),Q(Ot,Ot.current),f)break;return null;case 22:return r.lanes=0,m_(t,r,o,r.pendingProps);case 24:ki(r,jt,t.memoizedState.cache)}return ci(t,r,o)}function w_(t,r,o){if(t!==null)if(t.memoizedProps!==r.pendingProps)Pt=!0;else{if(!nd(t,o)&&(r.flags&128)===0)return Pt=!1,d2(t,r,o);Pt=(t.flags&131072)!==0}else Pt=!1,et&&(r.flags&1048576)!==0&&tv(r,Ra,r.index);switch(r.lanes=0,r.tag){case 16:e:{var f=r.pendingProps;if(t=As(r.elementType),r.type=t,typeof t=="function")af(t)?(f=Os(t,f),r.tag=1,r=__(null,r,t,f,o)):(r.tag=0,r=Gf(null,r,t,f,o));else{if(t!=null){var w=t.$$typeof;if(w===E){r.tag=11,r=h_(null,r,t,f,o);break e}else if(w===D){r.tag=14,r=f_(null,r,t,f,o);break e}}throw r=U(t)||t,Error(s(306,r,""))}}return r;case 0:return Gf(t,r,r.type,r.pendingProps,o);case 1:return f=r.type,w=Os(f,r.pendingProps),__(t,r,f,w,o);case 3:e:{if(V(r,r.stateNode.containerInfo),t===null)throw Error(s(387));f=r.pendingProps;var R=r.memoizedState;w=R.element,xf(t,r),ka(r,f,null,o);var j=r.memoizedState;if(f=j.cache,ki(r,jt,f),f!==R.cache&&gf(r,[jt],o,!0),Na(),f=j.element,R.isDehydrated)if(R={element:f,isDehydrated:!1,cache:j.cache},r.updateQueue.baseState=R,r.memoizedState=R,r.flags&256){r=y_(t,r,f,o);break e}else if(f!==w){w=Yn(Error(s(424)),r),Aa(w),r=y_(t,r,f,o);break e}else for(t=r.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,_t=Zn(t.firstChild),nn=r,et=!0,Li=null,Xn=!0,o=mv(r,null,f,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ws(),f===w){r=ci(t,r,o);break e}sn(t,r,f,o)}r=r.child}return r;case 26:return Bc(t,r),t===null?(o=k0(r.type,null,r.pendingProps,null))?r.memoizedState=o:et||(o=r.type,t=r.pendingProps,f=Zc(Z.current).createElement(o),f[Se]=r,f[we]=t,on(f,o,t),mt(f),r.stateNode=f):r.memoizedState=k0(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return de(r),t===null&&et&&(f=r.stateNode=O0(r.type,r.pendingProps,Z.current),nn=r,Xn=!0,w=_t,Yi(r.type)?(Bd=w,_t=Zn(f.firstChild)):_t=w),sn(t,r,r.pendingProps.children,o),Bc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&et&&((w=f=_t)&&(f=$2(f,r.type,r.pendingProps,Xn),f!==null?(r.stateNode=f,nn=r,_t=Zn(f.firstChild),Xn=!1,w=!0):w=!1),w||Ni(r)),de(r),w=r.type,R=r.pendingProps,j=t!==null?t.memoizedProps:null,f=R.children,Md(w,R)?f=null:j!==null&&Md(w,j)&&(r.flags|=32),r.memoizedState!==null&&(w=Tf(t,r,i2,null,null,o),el._currentValue=w),Bc(t,r),sn(t,r,f,o),r.child;case 6:return t===null&&et&&((t=o=_t)&&(o=V2(o,r.pendingProps,Xn),o!==null?(r.stateNode=o,nn=r,_t=null,t=!0):t=!1),t||Ni(r)),null;case 13:return b_(t,r,o);case 4:return V(r,r.stateNode.containerInfo),f=r.pendingProps,t===null?r.child=Ts(r,null,f,o):sn(t,r,f,o),r.child;case 11:return h_(t,r,r.type,r.pendingProps,o);case 7:return sn(t,r,r.pendingProps,o),r.child;case 8:return sn(t,r,r.pendingProps.children,o),r.child;case 12:return sn(t,r,r.pendingProps.children,o),r.child;case 10:return f=r.pendingProps,ki(r,r.type,f.value),sn(t,r,f.children,o),r.child;case 9:return w=r.type._context,f=r.pendingProps.children,Es(r),w=rn(w),f=f(w),r.flags|=1,sn(t,r,f,o),r.child;case 14:return f_(t,r,r.type,r.pendingProps,o);case 15:return d_(t,r,r.type,r.pendingProps,o);case 19:return x_(t,r,o);case 31:return f2(t,r,o);case 22:return m_(t,r,o,r.pendingProps);case 24:return Es(r),f=rn(jt),t===null?(w=yf(),w===null&&(w=ft,R=vf(),w.pooledCache=R,R.refCount++,R!==null&&(w.pooledCacheLanes|=o),w=R),r.memoizedState={parent:f,cache:w},Sf(r),ki(r,jt,w)):((t.lanes&o)!==0&&(xf(t,r),ka(r,null,null,o),Na()),w=t.memoizedState,R=r.memoizedState,w.parent!==f?(w={parent:f,cache:f},r.memoizedState=w,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=w),ki(r,jt,f)):(f=R.cache,ki(r,jt,f),f!==w.cache&&gf(r,[jt],o,!0))),sn(t,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function ui(t){t.flags|=4}function rd(t,r,o,f,w){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(w&335544128)===w)if(t.stateNode.complete)t.flags|=8192;else if(X_())t.flags|=8192;else throw Ds=bc,bf}else t.flags&=-16777217}function C_(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!z0(r))if(X_())t.flags|=8192;else throw Ds=bc,bf}function Hc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?Qr():536870912,t.lanes|=r,Oo|=r)}function Ia(t,r){if(!et)switch(t.tailMode){case"hidden":r=t.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?t.tail=null:o.sibling=null;break;case"collapsed":o=t.tail;for(var f=null;o!==null;)o.alternate!==null&&(f=o),o=o.sibling;f===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:f.sibling=null}}function yt(t){var r=t.alternate!==null&&t.alternate.child===t.child,o=0,f=0;if(r)for(var w=t.child;w!==null;)o|=w.lanes|w.childLanes,f|=w.subtreeFlags&65011712,f|=w.flags&65011712,w.return=t,w=w.sibling;else for(w=t.child;w!==null;)o|=w.lanes|w.childLanes,f|=w.subtreeFlags,f|=w.flags,w.return=t,w=w.sibling;return t.subtreeFlags|=f,t.childLanes=o,r}function m2(t,r,o){var f=r.pendingProps;switch(hf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(r),null;case 1:return yt(r),null;case 3:return o=r.stateNode,f=null,t!==null&&(f=t.memoizedState.cache),r.memoizedState.cache!==f&&(r.flags|=2048),oi(jt),ie(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(t===null||t.child===null)&&(_o(r)?ui(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,df())),yt(r),null;case 26:var w=r.type,R=r.memoizedState;return t===null?(ui(r),R!==null?(yt(r),C_(r,R)):(yt(r),rd(r,w,null,f,o))):R?R!==t.memoizedState?(ui(r),yt(r),C_(r,R)):(yt(r),r.flags&=-16777217):(t=t.memoizedProps,t!==f&&ui(r),yt(r),rd(r,w,t,f,o)),null;case 27:if(re(r),o=Z.current,w=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==f&&ui(r);else{if(!f){if(r.stateNode===null)throw Error(s(166));return yt(r),null}t=J.current,_o(r)?rv(r):(t=O0(w,f,o),r.stateNode=t,ui(r))}return yt(r),null;case 5:if(re(r),w=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==f&&ui(r);else{if(!f){if(r.stateNode===null)throw Error(s(166));return yt(r),null}if(R=J.current,_o(r))rv(r);else{var j=Zc(Z.current);switch(R){case 1:R=j.createElementNS("http://www.w3.org/2000/svg",w);break;case 2:R=j.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;default:switch(w){case"svg":R=j.createElementNS("http://www.w3.org/2000/svg",w);break;case"math":R=j.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;case"script":R=j.createElement("div"),R.innerHTML="<script><\/script>",R=R.removeChild(R.firstChild);break;case"select":R=typeof f.is=="string"?j.createElement("select",{is:f.is}):j.createElement("select"),f.multiple?R.multiple=!0:f.size&&(R.size=f.size);break;default:R=typeof f.is=="string"?j.createElement(w,{is:f.is}):j.createElement(w)}}R[Se]=r,R[we]=f;e:for(j=r.child;j!==null;){if(j.tag===5||j.tag===6)R.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===r)break e;for(;j.sibling===null;){if(j.return===null||j.return===r)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}r.stateNode=R;e:switch(on(R,w,f),w){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&ui(r)}}return yt(r),rd(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,o),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==f&&ui(r);else{if(typeof f!="string"&&r.stateNode===null)throw Error(s(166));if(t=Z.current,_o(r)){if(t=r.stateNode,o=r.memoizedProps,f=null,w=nn,w!==null)switch(w.tag){case 27:case 5:f=w.memoizedProps}t[Se]=r,t=!!(t.nodeValue===o||f!==null&&f.suppressHydrationWarning===!0||b0(t.nodeValue,o)),t||Ni(r,!0)}else t=Zc(t).createTextNode(f),t[Se]=r,r.stateNode=t}return yt(r),null;case 31:if(o=r.memoizedState,t===null||t.memoizedState!==null){if(f=_o(r),o!==null){if(t===null){if(!f)throw Error(s(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[Se]=r}else ws(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;yt(r),t=!1}else o=df(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=o),t=!0;if(!t)return r.flags&256?(Hn(r),r):(Hn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return yt(r),null;case 13:if(f=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(w=_o(r),f!==null&&f.dehydrated!==null){if(t===null){if(!w)throw Error(s(318));if(w=r.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(s(317));w[Se]=r}else ws(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;yt(r),w=!1}else w=df(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=w),w=!0;if(!w)return r.flags&256?(Hn(r),r):(Hn(r),null)}return Hn(r),(r.flags&128)!==0?(r.lanes=o,r):(o=f!==null,t=t!==null&&t.memoizedState!==null,o&&(f=r.child,w=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(w=f.alternate.memoizedState.cachePool.pool),R=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(R=f.memoizedState.cachePool.pool),R!==w&&(f.flags|=2048)),o!==t&&o&&(r.child.flags|=8192),Hc(r,r.updateQueue),yt(r),null);case 4:return ie(),t===null&&Ed(r.stateNode.containerInfo),yt(r),null;case 10:return oi(r.type),yt(r),null;case 19:if(I(Ot),f=r.memoizedState,f===null)return yt(r),null;if(w=(r.flags&128)!==0,R=f.rendering,R===null)if(w)Ia(f,!1);else{if(Tt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(R=Cc(t),R!==null){for(r.flags|=128,Ia(f,!1),t=R.updateQueue,r.updateQueue=t,Hc(r,t),r.subtreeFlags=0,t=o,o=r.child;o!==null;)Zg(o,t),o=o.sibling;return Q(Ot,Ot.current&1|2),et&&ii(r,f.treeForkCount),r.child}t=t.sibling}f.tail!==null&&it()>Fc&&(r.flags|=128,w=!0,Ia(f,!1),r.lanes=4194304)}else{if(!w)if(t=Cc(R),t!==null){if(r.flags|=128,w=!0,t=t.updateQueue,r.updateQueue=t,Hc(r,t),Ia(f,!0),f.tail===null&&f.tailMode==="hidden"&&!R.alternate&&!et)return yt(r),null}else 2*it()-f.renderingStartTime>Fc&&o!==536870912&&(r.flags|=128,w=!0,Ia(f,!1),r.lanes=4194304);f.isBackwards?(R.sibling=r.child,r.child=R):(t=f.last,t!==null?t.sibling=R:r.child=R,f.last=R)}return f.tail!==null?(t=f.tail,f.rendering=t,f.tail=t.sibling,f.renderingStartTime=it(),t.sibling=null,o=Ot.current,Q(Ot,w?o&1|2:o&1),et&&ii(r,f.treeForkCount),t):(yt(r),null);case 22:case 23:return Hn(r),Rf(),f=r.memoizedState!==null,t!==null?t.memoizedState!==null!==f&&(r.flags|=8192):f&&(r.flags|=8192),f?(o&536870912)!==0&&(r.flags&128)===0&&(yt(r),r.subtreeFlags&6&&(r.flags|=8192)):yt(r),o=r.updateQueue,o!==null&&Hc(r,o.retryQueue),o=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),f=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(f=r.memoizedState.cachePool.pool),f!==o&&(r.flags|=2048),t!==null&&I(Rs),null;case 24:return o=null,t!==null&&(o=t.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),oi(jt),yt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function p2(t,r){switch(hf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return oi(jt),ie(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return re(r),null;case 31:if(r.memoizedState!==null){if(Hn(r),r.alternate===null)throw Error(s(340));ws()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(Hn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));ws()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return I(Ot),null;case 4:return ie(),null;case 10:return oi(r.type),null;case 22:case 23:return Hn(r),Rf(),t!==null&&I(Rs),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return oi(jt),null;case 25:return null;default:return null}}function E_(t,r){switch(hf(r),r.tag){case 3:oi(jt),ie();break;case 26:case 27:case 5:re(r);break;case 4:ie();break;case 31:r.memoizedState!==null&&Hn(r);break;case 13:Hn(r);break;case 19:I(Ot);break;case 10:oi(r.type);break;case 22:case 23:Hn(r),Rf(),t!==null&&I(Rs);break;case 24:oi(jt)}}function Ua(t,r){try{var o=r.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var w=f.next;o=w;do{if((o.tag&t)===t){f=void 0;var R=o.create,j=o.inst;f=R(),j.destroy=f}o=o.next}while(o!==w)}}catch(Y){lt(r,r.return,Y)}}function Ii(t,r,o){try{var f=r.updateQueue,w=f!==null?f.lastEffect:null;if(w!==null){var R=w.next;f=R;do{if((f.tag&t)===t){var j=f.inst,Y=j.destroy;if(Y!==void 0){j.destroy=void 0,w=r;var te=o,ue=Y;try{ue()}catch(pe){lt(w,te,pe)}}}f=f.next}while(f!==R)}}catch(pe){lt(r,r.return,pe)}}function R_(t){var r=t.updateQueue;if(r!==null){var o=t.stateNode;try{gv(r,o)}catch(f){lt(t,t.return,f)}}}function A_(t,r,o){o.props=Os(t.type,t.memoizedProps),o.state=t.memoizedState;try{o.componentWillUnmount()}catch(f){lt(t,r,f)}}function Fa(t,r){try{var o=t.ref;if(o!==null){switch(t.tag){case 26:case 27:case 5:var f=t.stateNode;break;case 30:f=t.stateNode;break;default:f=t.stateNode}typeof o=="function"?t.refCleanup=o(f):o.current=f}}catch(w){lt(t,r,w)}}function Or(t,r){var o=t.ref,f=t.refCleanup;if(o!==null)if(typeof f=="function")try{f()}catch(w){lt(t,r,w)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(w){lt(t,r,w)}else o.current=null}function D_(t){var r=t.type,o=t.memoizedProps,f=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&f.focus();break e;case"img":o.src?f.src=o.src:o.srcSet&&(f.srcset=o.srcSet)}}catch(w){lt(t,t.return,w)}}function id(t,r,o){try{var f=t.stateNode;H2(f,t.type,o,r),f[we]=r}catch(w){lt(t,t.return,w)}}function T_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Yi(t.type)||t.tag===4}function sd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||T_(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Yi(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function od(t,r,o){var f=t.tag;if(f===5||f===6)t=t.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(t,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(t),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=ti));else if(f!==4&&(f===27&&Yi(t.type)&&(o=t.stateNode,r=null),t=t.child,t!==null))for(od(t,r,o),t=t.sibling;t!==null;)od(t,r,o),t=t.sibling}function Pc(t,r,o){var f=t.tag;if(f===5||f===6)t=t.stateNode,r?o.insertBefore(t,r):o.appendChild(t);else if(f!==4&&(f===27&&Yi(t.type)&&(o=t.stateNode),t=t.child,t!==null))for(Pc(t,r,o),t=t.sibling;t!==null;)Pc(t,r,o),t=t.sibling}function M_(t){var r=t.stateNode,o=t.memoizedProps;try{for(var f=t.type,w=r.attributes;w.length;)r.removeAttributeNode(w[0]);on(r,f,o),r[Se]=t,r[we]=o}catch(R){lt(t,t.return,R)}}var hi=!1,zt=!1,ad=!1,O_=typeof WeakSet=="function"?WeakSet:Set,Jt=null;function g2(t,r){if(t=t.containerInfo,Dd=su,t=$g(t),Jh(t)){if("selectionStart"in t)var o={start:t.selectionStart,end:t.selectionEnd};else e:{o=(o=t.ownerDocument)&&o.defaultView||window;var f=o.getSelection&&o.getSelection();if(f&&f.rangeCount!==0){o=f.anchorNode;var w=f.anchorOffset,R=f.focusNode;f=f.focusOffset;try{o.nodeType,R.nodeType}catch{o=null;break e}var j=0,Y=-1,te=-1,ue=0,pe=0,ve=t,he=null;t:for(;;){for(var me;ve!==o||w!==0&&ve.nodeType!==3||(Y=j+w),ve!==R||f!==0&&ve.nodeType!==3||(te=j+f),ve.nodeType===3&&(j+=ve.nodeValue.length),(me=ve.firstChild)!==null;)he=ve,ve=me;for(;;){if(ve===t)break t;if(he===o&&++ue===w&&(Y=j),he===R&&++pe===f&&(te=j),(me=ve.nextSibling)!==null)break;ve=he,he=ve.parentNode}ve=me}o=Y===-1||te===-1?null:{start:Y,end:te}}else o=null}o=o||{start:0,end:0}}else o=null;for(Td={focusedElem:t,selectionRange:o},su=!1,Jt=r;Jt!==null;)if(r=Jt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Jt=t;else for(;Jt!==null;){switch(r=Jt,R=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(o=0;o<t.length;o++)w=t[o],w.ref.impl=w.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&R!==null){t=void 0,o=r,w=R.memoizedProps,R=R.memoizedState,f=o.stateNode;try{var Re=Os(o.type,w);t=f.getSnapshotBeforeUpdate(Re,R),f.__reactInternalSnapshotBeforeUpdate=t}catch(Pe){lt(o,o.return,Pe)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,o=t.nodeType,o===9)Ld(t);else if(o===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ld(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=r.sibling,t!==null){t.return=r.return,Jt=t;break}Jt=r.return}}function L_(t,r,o){var f=o.flags;switch(o.tag){case 0:case 11:case 15:di(t,o),f&4&&Ua(5,o);break;case 1:if(di(t,o),f&4)if(t=o.stateNode,r===null)try{t.componentDidMount()}catch(j){lt(o,o.return,j)}else{var w=Os(o.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(w,r,t.__reactInternalSnapshotBeforeUpdate)}catch(j){lt(o,o.return,j)}}f&64&&R_(o),f&512&&Fa(o,o.return);break;case 3:if(di(t,o),f&64&&(t=o.updateQueue,t!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{gv(t,r)}catch(j){lt(o,o.return,j)}}break;case 27:r===null&&f&4&&M_(o);case 26:case 5:di(t,o),r===null&&f&4&&D_(o),f&512&&Fa(o,o.return);break;case 12:di(t,o);break;case 31:di(t,o),f&4&&B_(t,o);break;case 13:di(t,o),f&4&&j_(t,o),f&64&&(t=o.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(o=E2.bind(null,o),q2(t,o))));break;case 22:if(f=o.memoizedState!==null||hi,!f){r=r!==null&&r.memoizedState!==null||zt,w=hi;var R=zt;hi=f,(zt=r)&&!R?mi(t,o,(o.subtreeFlags&8772)!==0):di(t,o),hi=w,zt=R}break;case 30:break;default:di(t,o)}}function N_(t){var r=t.alternate;r!==null&&(t.alternate=null,N_(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&bt(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var xt=null,xn=!1;function fi(t,r,o){for(o=o.child;o!==null;)k_(t,r,o),o=o.sibling}function k_(t,r,o){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(lr,o)}catch{}switch(o.tag){case 26:zt||Or(o,r),fi(t,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:zt||Or(o,r);var f=xt,w=xn;Yi(o.type)&&(xt=o.stateNode,xn=!1),fi(t,r,o),Qa(o.stateNode),xt=f,xn=w;break;case 5:zt||Or(o,r);case 6:if(f=xt,w=xn,xt=null,fi(t,r,o),xt=f,xn=w,xt!==null)if(xn)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(o.stateNode)}catch(R){lt(o,r,R)}else try{xt.removeChild(o.stateNode)}catch(R){lt(o,r,R)}break;case 18:xt!==null&&(xn?(t=xt,R0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,o.stateNode),zo(t)):R0(xt,o.stateNode));break;case 4:f=xt,w=xn,xt=o.stateNode.containerInfo,xn=!0,fi(t,r,o),xt=f,xn=w;break;case 0:case 11:case 14:case 15:Ii(2,o,r),zt||Ii(4,o,r),fi(t,r,o);break;case 1:zt||(Or(o,r),f=o.stateNode,typeof f.componentWillUnmount=="function"&&A_(o,r,f)),fi(t,r,o);break;case 21:fi(t,r,o);break;case 22:zt=(f=zt)||o.memoizedState!==null,fi(t,r,o),zt=f;break;default:fi(t,r,o)}}function B_(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{zo(t)}catch(o){lt(r,r.return,o)}}}function j_(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{zo(t)}catch(o){lt(r,r.return,o)}}function v2(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new O_),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new O_),r;default:throw Error(s(435,t.tag))}}function zc(t,r){var o=v2(t);r.forEach(function(f){if(!o.has(f)){o.add(f);var w=R2.bind(null,t,f);f.then(w,w)}})}function wn(t,r){var o=r.deletions;if(o!==null)for(var f=0;f<o.length;f++){var w=o[f],R=t,j=r,Y=j;e:for(;Y!==null;){switch(Y.tag){case 27:if(Yi(Y.type)){xt=Y.stateNode,xn=!1;break e}break;case 5:xt=Y.stateNode,xn=!1;break e;case 3:case 4:xt=Y.stateNode.containerInfo,xn=!0;break e}Y=Y.return}if(xt===null)throw Error(s(160));k_(R,j,w),xt=null,xn=!1,R=w.alternate,R!==null&&(R.return=null),w.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)H_(r,t),r=r.sibling}var dr=null;function H_(t,r){var o=t.alternate,f=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:wn(r,t),Cn(t),f&4&&(Ii(3,t,t.return),Ua(3,t),Ii(5,t,t.return));break;case 1:wn(r,t),Cn(t),f&512&&(zt||o===null||Or(o,o.return)),f&64&&hi&&(t=t.updateQueue,t!==null&&(f=t.callbacks,f!==null&&(o=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=o===null?f:o.concat(f))));break;case 26:var w=dr;if(wn(r,t),Cn(t),f&512&&(zt||o===null||Or(o,o.return)),f&4){var R=o!==null?o.memoizedState:null;if(f=t.memoizedState,o===null)if(f===null)if(t.stateNode===null){e:{f=t.type,o=t.memoizedProps,w=w.ownerDocument||w;t:switch(f){case"title":R=w.getElementsByTagName("title")[0],(!R||R[vt]||R[Se]||R.namespaceURI==="http://www.w3.org/2000/svg"||R.hasAttribute("itemprop"))&&(R=w.createElement(f),w.head.insertBefore(R,w.querySelector("head > title"))),on(R,f,o),R[Se]=t,mt(R),f=R;break e;case"link":var j=H0("link","href",w).get(f+(o.href||""));if(j){for(var Y=0;Y<j.length;Y++)if(R=j[Y],R.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&R.getAttribute("rel")===(o.rel==null?null:o.rel)&&R.getAttribute("title")===(o.title==null?null:o.title)&&R.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){j.splice(Y,1);break t}}R=w.createElement(f),on(R,f,o),w.head.appendChild(R);break;case"meta":if(j=H0("meta","content",w).get(f+(o.content||""))){for(Y=0;Y<j.length;Y++)if(R=j[Y],R.getAttribute("content")===(o.content==null?null:""+o.content)&&R.getAttribute("name")===(o.name==null?null:o.name)&&R.getAttribute("property")===(o.property==null?null:o.property)&&R.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&R.getAttribute("charset")===(o.charSet==null?null:o.charSet)){j.splice(Y,1);break t}}R=w.createElement(f),on(R,f,o),w.head.appendChild(R);break;default:throw Error(s(468,f))}R[Se]=t,mt(R),f=R}t.stateNode=f}else P0(w,t.type,t.stateNode);else t.stateNode=j0(w,f,t.memoizedProps);else R!==f?(R===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):R.count--,f===null?P0(w,t.type,t.stateNode):j0(w,f,t.memoizedProps)):f===null&&t.stateNode!==null&&id(t,t.memoizedProps,o.memoizedProps)}break;case 27:wn(r,t),Cn(t),f&512&&(zt||o===null||Or(o,o.return)),o!==null&&f&4&&id(t,t.memoizedProps,o.memoizedProps);break;case 5:if(wn(r,t),Cn(t),f&512&&(zt||o===null||Or(o,o.return)),t.flags&32){w=t.stateNode;try{ao(w,"")}catch(Re){lt(t,t.return,Re)}}f&4&&t.stateNode!=null&&(w=t.memoizedProps,id(t,w,o!==null?o.memoizedProps:w)),f&1024&&(ad=!0);break;case 6:if(wn(r,t),Cn(t),f&4){if(t.stateNode===null)throw Error(s(162));f=t.memoizedProps,o=t.stateNode;try{o.nodeValue=f}catch(Re){lt(t,t.return,Re)}}break;case 3:if(tu=null,w=dr,dr=Jc(r.containerInfo),wn(r,t),dr=w,Cn(t),f&4&&o!==null&&o.memoizedState.isDehydrated)try{zo(r.containerInfo)}catch(Re){lt(t,t.return,Re)}ad&&(ad=!1,P_(t));break;case 4:f=dr,dr=Jc(t.stateNode.containerInfo),wn(r,t),Cn(t),dr=f;break;case 12:wn(r,t),Cn(t);break;case 31:wn(r,t),Cn(t),f&4&&(f=t.updateQueue,f!==null&&(t.updateQueue=null,zc(t,f)));break;case 13:wn(r,t),Cn(t),t.child.flags&8192&&t.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Uc=it()),f&4&&(f=t.updateQueue,f!==null&&(t.updateQueue=null,zc(t,f)));break;case 22:w=t.memoizedState!==null;var te=o!==null&&o.memoizedState!==null,ue=hi,pe=zt;if(hi=ue||w,zt=pe||te,wn(r,t),zt=pe,hi=ue,Cn(t),f&8192)e:for(r=t.stateNode,r._visibility=w?r._visibility&-2:r._visibility|1,w&&(o===null||te||hi||zt||Ls(t)),o=null,r=t;;){if(r.tag===5||r.tag===26){if(o===null){te=o=r;try{if(R=te.stateNode,w)j=R.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{Y=te.stateNode;var ve=te.memoizedProps.style,he=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;Y.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(Re){lt(te,te.return,Re)}}}else if(r.tag===6){if(o===null){te=r;try{te.stateNode.nodeValue=w?"":te.memoizedProps}catch(Re){lt(te,te.return,Re)}}}else if(r.tag===18){if(o===null){te=r;try{var me=te.stateNode;w?A0(me,!0):A0(te.stateNode,!1)}catch(Re){lt(te,te.return,Re)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}f&4&&(f=t.updateQueue,f!==null&&(o=f.retryQueue,o!==null&&(f.retryQueue=null,zc(t,o))));break;case 19:wn(r,t),Cn(t),f&4&&(f=t.updateQueue,f!==null&&(t.updateQueue=null,zc(t,f)));break;case 30:break;case 21:break;default:wn(r,t),Cn(t)}}function Cn(t){var r=t.flags;if(r&2){try{for(var o,f=t.return;f!==null;){if(T_(f)){o=f;break}f=f.return}if(o==null)throw Error(s(160));switch(o.tag){case 27:var w=o.stateNode,R=sd(t);Pc(t,R,w);break;case 5:var j=o.stateNode;o.flags&32&&(ao(j,""),o.flags&=-33);var Y=sd(t);Pc(t,Y,j);break;case 3:case 4:var te=o.stateNode.containerInfo,ue=sd(t);od(t,ue,te);break;default:throw Error(s(161))}}catch(pe){lt(t,t.return,pe)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function P_(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;P_(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function di(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)L_(t,r.alternate,r),r=r.sibling}function Ls(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Ii(4,r,r.return),Ls(r);break;case 1:Or(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&A_(r,r.return,o),Ls(r);break;case 27:Qa(r.stateNode);case 26:case 5:Or(r,r.return),Ls(r);break;case 22:r.memoizedState===null&&Ls(r);break;case 30:Ls(r);break;default:Ls(r)}t=t.sibling}}function mi(t,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var f=r.alternate,w=t,R=r,j=R.flags;switch(R.tag){case 0:case 11:case 15:mi(w,R,o),Ua(4,R);break;case 1:if(mi(w,R,o),f=R,w=f.stateNode,typeof w.componentDidMount=="function")try{w.componentDidMount()}catch(ue){lt(f,f.return,ue)}if(f=R,w=f.updateQueue,w!==null){var Y=f.stateNode;try{var te=w.shared.hiddenCallbacks;if(te!==null)for(w.shared.hiddenCallbacks=null,w=0;w<te.length;w++)pv(te[w],Y)}catch(ue){lt(f,f.return,ue)}}o&&j&64&&R_(R),Fa(R,R.return);break;case 27:M_(R);case 26:case 5:mi(w,R,o),o&&f===null&&j&4&&D_(R),Fa(R,R.return);break;case 12:mi(w,R,o);break;case 31:mi(w,R,o),o&&j&4&&B_(w,R);break;case 13:mi(w,R,o),o&&j&4&&j_(w,R);break;case 22:R.memoizedState===null&&mi(w,R,o),Fa(R,R.return);break;case 30:break;default:mi(w,R,o)}r=r.sibling}}function ld(t,r){var o=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==o&&(t!=null&&t.refCount++,o!=null&&Da(o))}function cd(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Da(t))}function mr(t,r,o,f){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)z_(t,r,o,f),r=r.sibling}function z_(t,r,o,f){var w=r.flags;switch(r.tag){case 0:case 11:case 15:mr(t,r,o,f),w&2048&&Ua(9,r);break;case 1:mr(t,r,o,f);break;case 3:mr(t,r,o,f),w&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Da(t)));break;case 12:if(w&2048){mr(t,r,o,f),t=r.stateNode;try{var R=r.memoizedProps,j=R.id,Y=R.onPostCommit;typeof Y=="function"&&Y(j,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(te){lt(r,r.return,te)}}else mr(t,r,o,f);break;case 31:mr(t,r,o,f);break;case 13:mr(t,r,o,f);break;case 23:break;case 22:R=r.stateNode,j=r.alternate,r.memoizedState!==null?R._visibility&2?mr(t,r,o,f):$a(t,r):R._visibility&2?mr(t,r,o,f):(R._visibility|=2,Do(t,r,o,f,(r.subtreeFlags&10256)!==0||!1)),w&2048&&ld(j,r);break;case 24:mr(t,r,o,f),w&2048&&cd(r.alternate,r);break;default:mr(t,r,o,f)}}function Do(t,r,o,f,w){for(w=w&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var R=t,j=r,Y=o,te=f,ue=j.flags;switch(j.tag){case 0:case 11:case 15:Do(R,j,Y,te,w),Ua(8,j);break;case 23:break;case 22:var pe=j.stateNode;j.memoizedState!==null?pe._visibility&2?Do(R,j,Y,te,w):$a(R,j):(pe._visibility|=2,Do(R,j,Y,te,w)),w&&ue&2048&&ld(j.alternate,j);break;case 24:Do(R,j,Y,te,w),w&&ue&2048&&cd(j.alternate,j);break;default:Do(R,j,Y,te,w)}r=r.sibling}}function $a(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=t,f=r,w=f.flags;switch(f.tag){case 22:$a(o,f),w&2048&&ld(f.alternate,f);break;case 24:$a(o,f),w&2048&&cd(f.alternate,f);break;default:$a(o,f)}r=r.sibling}}var Va=8192;function To(t,r,o){if(t.subtreeFlags&Va)for(t=t.child;t!==null;)I_(t,r,o),t=t.sibling}function I_(t,r,o){switch(t.tag){case 26:To(t,r,o),t.flags&Va&&t.memoizedState!==null&&rR(o,dr,t.memoizedState,t.memoizedProps);break;case 5:To(t,r,o);break;case 3:case 4:var f=dr;dr=Jc(t.stateNode.containerInfo),To(t,r,o),dr=f;break;case 22:t.memoizedState===null&&(f=t.alternate,f!==null&&f.memoizedState!==null?(f=Va,Va=16777216,To(t,r,o),Va=f):To(t,r,o));break;default:To(t,r,o)}}function U_(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function qa(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var f=r[o];Jt=f,$_(f,t)}U_(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)F_(t),t=t.sibling}function F_(t){switch(t.tag){case 0:case 11:case 15:qa(t),t.flags&2048&&Ii(9,t,t.return);break;case 3:qa(t);break;case 12:qa(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Ic(t)):qa(t);break;default:qa(t)}}function Ic(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var f=r[o];Jt=f,$_(f,t)}U_(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Ii(8,r,r.return),Ic(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,Ic(r));break;default:Ic(r)}t=t.sibling}}function $_(t,r){for(;Jt!==null;){var o=Jt;switch(o.tag){case 0:case 11:case 15:Ii(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var f=o.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Da(o.memoizedState.cache)}if(f=o.child,f!==null)f.return=o,Jt=f;else e:for(o=t;Jt!==null;){f=Jt;var w=f.sibling,R=f.return;if(N_(f),f===o){Jt=null;break e}if(w!==null){w.return=R,Jt=w;break e}Jt=R}}}var _2={getCacheForType:function(t){var r=rn(jt),o=r.data.get(t);return o===void 0&&(o=t(),r.data.set(t,o)),o},cacheSignal:function(){return rn(jt).controller.signal}},y2=typeof WeakMap=="function"?WeakMap:Map,ot=0,ft=null,Ge=null,Ze=0,at=0,Pn=null,Ui=!1,Mo=!1,ud=!1,pi=0,Tt=0,Fi=0,Ns=0,hd=0,zn=0,Oo=0,Wa=null,En=null,fd=!1,Uc=0,V_=0,Fc=1/0,$c=null,$i=null,qt=0,Vi=null,Lo=null,gi=0,dd=0,md=null,q_=null,Ya=0,pd=null;function In(){return(ot&2)!==0&&Ze!==0?Ze&-Ze:H.T!==null?Sd():be()}function W_(){if(zn===0)if((Ze&536870912)===0||et){var t=Kr;Kr<<=1,(Kr&3932160)===0&&(Kr=262144),zn=t}else zn=536870912;return t=jn.current,t!==null&&(t.flags|=32),zn}function Rn(t,r,o){(t===ft&&(at===2||at===9)||t.cancelPendingCommit!==null)&&(No(t,0),qi(t,Ze,zn,!1)),Ar(t,o),((ot&2)===0||t!==ft)&&(t===ft&&((ot&2)===0&&(Ns|=o),Tt===4&&qi(t,Ze,zn,!1)),Lr(t))}function Y_(t,r,o){if((ot&6)!==0)throw Error(s(327));var f=!o&&(r&127)===0&&(r&t.expiredLanes)===0||Xr(t,r),w=f?x2(t,r):vd(t,r,!0),R=f;do{if(w===0){Mo&&!f&&qi(t,r,0,!1);break}else{if(o=t.current.alternate,R&&!b2(o)){w=vd(t,r,!1),R=!1;continue}if(w===2){if(R=r,t.errorRecoveryDisabledLanes&R)var j=0;else j=t.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){r=j;e:{var Y=t;w=Wa;var te=Y.current.memoizedState.isDehydrated;if(te&&(No(Y,j).flags|=256),j=vd(Y,j,!1),j!==2){if(ud&&!te){Y.errorRecoveryDisabledLanes|=R,Ns|=R,w=4;break e}R=En,En=w,R!==null&&(En===null?En=R:En.push.apply(En,R))}w=j}if(R=!1,w!==2)continue}}if(w===1){No(t,0),qi(t,r,0,!0);break}e:{switch(f=t,R=w,R){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:qi(f,r,zn,!Ui);break e;case 2:En=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(w=Uc+300-it(),10<w)){if(qi(f,r,zn,!Ui),Gr(f,0,!0)!==0)break e;gi=r,f.timeoutHandle=C0(K_.bind(null,f,o,En,$c,fd,r,zn,Ns,Oo,Ui,R,"Throttled",-0,0),w);break e}K_(f,o,En,$c,fd,r,zn,Ns,Oo,Ui,R,null,-0,0)}}break}while(!0);Lr(t)}function K_(t,r,o,f,w,R,j,Y,te,ue,pe,ve,he,me){if(t.timeoutHandle=-1,ve=r.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ti},I_(r,R,ve);var Re=(R&62914560)===R?Uc-it():(R&4194048)===R?V_-it():0;if(Re=iR(ve,Re),Re!==null){gi=R,t.cancelPendingCommit=Re(n0.bind(null,t,r,R,o,f,w,j,Y,te,pe,ve,null,he,me)),qi(t,R,j,!ue);return}}n0(t,r,R,o,f,w,j,Y,te)}function b2(t){for(var r=t;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var f=0;f<o.length;f++){var w=o[f],R=w.getSnapshot;w=w.value;try{if(!kn(R(),w))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function qi(t,r,o,f){r&=~hd,r&=~Ns,t.suspendedLanes|=r,t.pingedLanes&=~r,f&&(t.warmLanes|=r),f=t.expirationTimes;for(var w=r;0<w;){var R=31-Zt(w),j=1<<R;f[R]=-1,w&=~j}o!==0&&so(t,o,r)}function Vc(){return(ot&6)===0?(Ka(0),!1):!0}function gd(){if(Ge!==null){if(at===0)var t=Ge.return;else t=Ge,si=Cs=null,Lf(t),wo=null,Ma=0,t=Ge;for(;t!==null;)E_(t.alternate,t),t=t.return;Ge=null}}function No(t,r){var o=t.timeoutHandle;o!==-1&&(t.timeoutHandle=-1,I2(o)),o=t.cancelPendingCommit,o!==null&&(t.cancelPendingCommit=null,o()),gi=0,gd(),ft=t,Ge=o=ri(t.current,null),Ze=r,at=0,Pn=null,Ui=!1,Mo=Xr(t,r),ud=!1,Oo=zn=hd=Ns=Fi=Tt=0,En=Wa=null,fd=!1,(r&8)!==0&&(r|=r&32);var f=t.entangledLanes;if(f!==0)for(t=t.entanglements,f&=r;0<f;){var w=31-Zt(f),R=1<<w;r|=t[w],f&=~R}return pi=r,hc(),o}function G_(t,r){Ue=null,H.H=Pa,r===xo||r===yc?(r=hv(),at=3):r===bf?(r=hv(),at=4):at=r===Kf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Pn=r,Ge===null&&(Tt=1,Nc(t,Yn(r,t.current)))}function X_(){var t=jn.current;return t===null?!0:(Ze&4194048)===Ze?Qn===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?t===Qn:!1}function Q_(){var t=H.H;return H.H=Pa,t===null?Pa:t}function Z_(){var t=H.A;return H.A=_2,t}function qc(){Tt=4,Ui||(Ze&4194048)!==Ze&&jn.current!==null||(Mo=!0),(Fi&134217727)===0&&(Ns&134217727)===0||ft===null||qi(ft,Ze,zn,!1)}function vd(t,r,o){var f=ot;ot|=2;var w=Q_(),R=Z_();(ft!==t||Ze!==r)&&($c=null,No(t,r)),r=!1;var j=Tt;e:do try{if(at!==0&&Ge!==null){var Y=Ge,te=Pn;switch(at){case 8:gd(),j=6;break e;case 3:case 2:case 9:case 6:jn.current===null&&(r=!0);var ue=at;if(at=0,Pn=null,ko(t,Y,te,ue),o&&Mo){j=0;break e}break;default:ue=at,at=0,Pn=null,ko(t,Y,te,ue)}}S2(),j=Tt;break}catch(pe){G_(t,pe)}while(!0);return r&&t.shellSuspendCounter++,si=Cs=null,ot=f,H.H=w,H.A=R,Ge===null&&(ft=null,Ze=0,hc()),j}function S2(){for(;Ge!==null;)J_(Ge)}function x2(t,r){var o=ot;ot|=2;var f=Q_(),w=Z_();ft!==t||Ze!==r?($c=null,Fc=it()+500,No(t,r)):Mo=Xr(t,r);e:do try{if(at!==0&&Ge!==null){r=Ge;var R=Pn;t:switch(at){case 1:at=0,Pn=null,ko(t,r,R,1);break;case 2:case 9:if(cv(R)){at=0,Pn=null,e0(r);break}r=function(){at!==2&&at!==9||ft!==t||(at=7),Lr(t)},R.then(r,r);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:cv(R)?(at=0,Pn=null,e0(r)):(at=0,Pn=null,ko(t,r,R,7));break;case 5:var j=null;switch(Ge.tag){case 26:j=Ge.memoizedState;case 5:case 27:var Y=Ge;if(j?z0(j):Y.stateNode.complete){at=0,Pn=null;var te=Y.sibling;if(te!==null)Ge=te;else{var ue=Y.return;ue!==null?(Ge=ue,Wc(ue)):Ge=null}break t}}at=0,Pn=null,ko(t,r,R,5);break;case 6:at=0,Pn=null,ko(t,r,R,6);break;case 8:gd(),Tt=6;break e;default:throw Error(s(462))}}w2();break}catch(pe){G_(t,pe)}while(!0);return si=Cs=null,H.H=f,H.A=w,ot=o,Ge!==null?0:(ft=null,Ze=0,hc(),Tt)}function w2(){for(;Ge!==null&&!_n();)J_(Ge)}function J_(t){var r=w_(t.alternate,t,pi);t.memoizedProps=t.pendingProps,r===null?Wc(t):Ge=r}function e0(t){var r=t,o=r.alternate;switch(r.tag){case 15:case 0:r=v_(o,r,r.pendingProps,r.type,void 0,Ze);break;case 11:r=v_(o,r,r.pendingProps,r.type.render,r.ref,Ze);break;case 5:Lf(r);default:E_(o,r),r=Ge=Zg(r,pi),r=w_(o,r,pi)}t.memoizedProps=t.pendingProps,r===null?Wc(t):Ge=r}function ko(t,r,o,f){si=Cs=null,Lf(r),wo=null,Ma=0;var w=r.return;try{if(h2(t,w,r,o,Ze)){Tt=1,Nc(t,Yn(o,t.current)),Ge=null;return}}catch(R){if(w!==null)throw Ge=w,R;Tt=1,Nc(t,Yn(o,t.current)),Ge=null;return}r.flags&32768?(et||f===1?t=!0:Mo||(Ze&536870912)!==0?t=!1:(Ui=t=!0,(f===2||f===9||f===3||f===6)&&(f=jn.current,f!==null&&f.tag===13&&(f.flags|=16384))),t0(r,t)):Wc(r)}function Wc(t){var r=t;do{if((r.flags&32768)!==0){t0(r,Ui);return}t=r.return;var o=m2(r.alternate,r,pi);if(o!==null){Ge=o;return}if(r=r.sibling,r!==null){Ge=r;return}Ge=r=t}while(r!==null);Tt===0&&(Tt=5)}function t0(t,r){do{var o=p2(t.alternate,t);if(o!==null){o.flags&=32767,Ge=o;return}if(o=t.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(t=t.sibling,t!==null)){Ge=t;return}Ge=t=o}while(t!==null);Tt=6,Ge=null}function n0(t,r,o,f,w,R,j,Y,te){t.cancelPendingCommit=null;do Yc();while(qt!==0);if((ot&6)!==0)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(R=r.lanes|r.childLanes,R|=sf,pa(t,o,R,j,Y,te),t===ft&&(Ge=ft=null,Ze=0),Lo=r,Vi=t,gi=o,dd=R,md=w,q_=f,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,A2(dt,function(){return a0(),null})):(t.callbackNode=null,t.callbackPriority=0),f=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||f){f=H.T,H.T=null,w=K.p,K.p=2,j=ot,ot|=4;try{g2(t,r,o)}finally{ot=j,K.p=w,H.T=f}}qt=1,r0(),i0(),s0()}}function r0(){if(qt===1){qt=0;var t=Vi,r=Lo,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=H.T,H.T=null;var f=K.p;K.p=2;var w=ot;ot|=4;try{H_(r,t);var R=Td,j=$g(t.containerInfo),Y=R.focusedElem,te=R.selectionRange;if(j!==Y&&Y&&Y.ownerDocument&&Fg(Y.ownerDocument.documentElement,Y)){if(te!==null&&Jh(Y)){var ue=te.start,pe=te.end;if(pe===void 0&&(pe=ue),"selectionStart"in Y)Y.selectionStart=ue,Y.selectionEnd=Math.min(pe,Y.value.length);else{var ve=Y.ownerDocument||document,he=ve&&ve.defaultView||window;if(he.getSelection){var me=he.getSelection(),Re=Y.textContent.length,Pe=Math.min(te.start,Re),ht=te.end===void 0?Pe:Math.min(te.end,Re);!me.extend&&Pe>ht&&(j=ht,ht=Pe,Pe=j);var oe=Ug(Y,Pe),ne=Ug(Y,ht);if(oe&&ne&&(me.rangeCount!==1||me.anchorNode!==oe.node||me.anchorOffset!==oe.offset||me.focusNode!==ne.node||me.focusOffset!==ne.offset)){var ce=ve.createRange();ce.setStart(oe.node,oe.offset),me.removeAllRanges(),Pe>ht?(me.addRange(ce),me.extend(ne.node,ne.offset)):(ce.setEnd(ne.node,ne.offset),me.addRange(ce))}}}}for(ve=[],me=Y;me=me.parentNode;)me.nodeType===1&&ve.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Y<ve.length;Y++){var ge=ve[Y];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}su=!!Dd,Td=Dd=null}finally{ot=w,K.p=f,H.T=o}}t.current=r,qt=2}}function i0(){if(qt===2){qt=0;var t=Vi,r=Lo,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=H.T,H.T=null;var f=K.p;K.p=2;var w=ot;ot|=4;try{L_(t,r.alternate,r)}finally{ot=w,K.p=f,H.T=o}}qt=3}}function s0(){if(qt===4||qt===3){qt=0,At();var t=Vi,r=Lo,o=gi,f=q_;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?qt=5:(qt=0,Lo=Vi=null,o0(t,t.pendingLanes));var w=t.pendingLanes;if(w===0&&($i=null),ye(o),r=r.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(lr,r,void 0,(r.current.flags&128)===128)}catch{}if(f!==null){r=H.T,w=K.p,K.p=2,H.T=null;try{for(var R=t.onRecoverableError,j=0;j<f.length;j++){var Y=f[j];R(Y.value,{componentStack:Y.stack})}}finally{H.T=r,K.p=w}}(gi&3)!==0&&Yc(),Lr(t),w=t.pendingLanes,(o&261930)!==0&&(w&42)!==0?t===pd?Ya++:(Ya=0,pd=t):Ya=0,Ka(0)}}function o0(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Da(r)))}function Yc(){return r0(),i0(),s0(),a0()}function a0(){if(qt!==5)return!1;var t=Vi,r=dd;dd=0;var o=ye(gi),f=H.T,w=K.p;try{K.p=32>o?32:o,H.T=null,o=md,md=null;var R=Vi,j=gi;if(qt=0,Lo=Vi=null,gi=0,(ot&6)!==0)throw Error(s(331));var Y=ot;if(ot|=4,F_(R.current),z_(R,R.current,j,o),ot=Y,Ka(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(lr,R)}catch{}return!0}finally{K.p=w,H.T=f,o0(t,r)}}function l0(t,r,o){r=Yn(o,r),r=Yf(t.stateNode,r,2),t=Hi(t,r,2),t!==null&&(Ar(t,2),Lr(t))}function lt(t,r,o){if(t.tag===3)l0(t,t,o);else for(;r!==null;){if(r.tag===3){l0(r,t,o);break}else if(r.tag===1){var f=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&($i===null||!$i.has(f))){t=Yn(o,t),o=c_(2),f=Hi(r,o,2),f!==null&&(u_(o,f,r,t),Ar(f,2),Lr(f));break}}r=r.return}}function _d(t,r,o){var f=t.pingCache;if(f===null){f=t.pingCache=new y2;var w=new Set;f.set(r,w)}else w=f.get(r),w===void 0&&(w=new Set,f.set(r,w));w.has(o)||(ud=!0,w.add(o),t=C2.bind(null,t,r,o),r.then(t,t))}function C2(t,r,o){var f=t.pingCache;f!==null&&f.delete(r),t.pingedLanes|=t.suspendedLanes&o,t.warmLanes&=~o,ft===t&&(Ze&o)===o&&(Tt===4||Tt===3&&(Ze&62914560)===Ze&&300>it()-Uc?(ot&2)===0&&No(t,0):hd|=o,Oo===Ze&&(Oo=0)),Lr(t)}function c0(t,r){r===0&&(r=Qr()),t=Ss(t,r),t!==null&&(Ar(t,r),Lr(t))}function E2(t){var r=t.memoizedState,o=0;r!==null&&(o=r.retryLane),c0(t,o)}function R2(t,r){var o=0;switch(t.tag){case 31:case 13:var f=t.stateNode,w=t.memoizedState;w!==null&&(o=w.retryLane);break;case 19:f=t.stateNode;break;case 22:f=t.stateNode._retryCache;break;default:throw Error(s(314))}f!==null&&f.delete(r),c0(t,o)}function A2(t,r){return tn(t,r)}var Kc=null,Bo=null,yd=!1,Gc=!1,bd=!1,Wi=0;function Lr(t){t!==Bo&&t.next===null&&(Bo===null?Kc=Bo=t:Bo=Bo.next=t),Gc=!0,yd||(yd=!0,T2())}function Ka(t,r){if(!bd&&Gc){bd=!0;do for(var o=!1,f=Kc;f!==null;){if(t!==0){var w=f.pendingLanes;if(w===0)var R=0;else{var j=f.suspendedLanes,Y=f.pingedLanes;R=(1<<31-Zt(42|t)+1)-1,R&=w&~(j&~Y),R=R&201326741?R&201326741|1:R?R|2:0}R!==0&&(o=!0,d0(f,R))}else R=Ze,R=Gr(f,f===ft?R:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(R&3)===0||Xr(f,R)||(o=!0,d0(f,R));f=f.next}while(o);bd=!1}}function D2(){u0()}function u0(){Gc=yd=!1;var t=0;Wi!==0&&z2()&&(t=Wi);for(var r=it(),o=null,f=Kc;f!==null;){var w=f.next,R=h0(f,r);R===0?(f.next=null,o===null?Kc=w:o.next=w,w===null&&(Bo=o)):(o=f,(t!==0||(R&3)!==0)&&(Gc=!0)),f=w}qt!==0&&qt!==5||Ka(t),Wi!==0&&(Wi=0)}function h0(t,r){for(var o=t.suspendedLanes,f=t.pingedLanes,w=t.expirationTimes,R=t.pendingLanes&-62914561;0<R;){var j=31-Zt(R),Y=1<<j,te=w[j];te===-1?((Y&o)===0||(Y&f)!==0)&&(w[j]=io(Y,r)):te<=r&&(t.expiredLanes|=Y),R&=~Y}if(r=ft,o=Ze,o=Gr(t,t===r?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),f=t.callbackNode,o===0||t===r&&(at===2||at===9)||t.cancelPendingCommit!==null)return f!==null&&f!==null&&fn(f),t.callbackNode=null,t.callbackPriority=0;if((o&3)===0||Xr(t,o)){if(r=o&-o,r===t.callbackPriority)return r;switch(f!==null&&fn(f),ye(o)){case 2:case 8:o=ln;break;case 32:o=dt;break;case 268435456:o=Qt;break;default:o=dt}return f=f0.bind(null,t),o=tn(o,f),t.callbackPriority=r,t.callbackNode=o,r}return f!==null&&f!==null&&fn(f),t.callbackPriority=2,t.callbackNode=null,2}function f0(t,r){if(qt!==0&&qt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var o=t.callbackNode;if(Yc()&&t.callbackNode!==o)return null;var f=Ze;return f=Gr(t,t===ft?f:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),f===0?null:(Y_(t,f,r),h0(t,it()),t.callbackNode!=null&&t.callbackNode===o?f0.bind(null,t):null)}function d0(t,r){if(Yc())return null;Y_(t,r,!0)}function T2(){U2(function(){(ot&6)!==0?tn(Gt,D2):u0()})}function Sd(){if(Wi===0){var t=bo;t===0&&(t=cr,cr<<=1,(cr&261888)===0&&(cr=256)),Wi=t}return Wi}function m0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:rc(""+t)}function p0(t,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,t.id&&o.setAttribute("form",t.id),r.parentNode.insertBefore(o,r),t=new FormData(t),o.parentNode.removeChild(o),t}function M2(t,r,o,f,w){if(r==="submit"&&o&&o.stateNode===w){var R=m0((w[we]||null).action),j=f.submitter;j&&(r=(r=j[we]||null)?m0(r.formAction):j.getAttribute("formAction"),r!==null&&(R=r,j=null));var Y=new ac("action","action",null,f,w);t.push({event:Y,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Wi!==0){var te=j?p0(w,j):new FormData(w);Uf(o,{pending:!0,data:te,method:w.method,action:R},null,te)}}else typeof R=="function"&&(Y.preventDefault(),te=j?p0(w,j):new FormData(w),Uf(o,{pending:!0,data:te,method:w.method,action:R},R,te))},currentTarget:w}]})}}for(var xd=0;xd<rf.length;xd++){var wd=rf[xd],O2=wd.toLowerCase(),L2=wd[0].toUpperCase()+wd.slice(1);fr(O2,"on"+L2)}fr(Wg,"onAnimationEnd"),fr(Yg,"onAnimationIteration"),fr(Kg,"onAnimationStart"),fr("dblclick","onDoubleClick"),fr("focusin","onFocus"),fr("focusout","onBlur"),fr(KE,"onTransitionRun"),fr(GE,"onTransitionStart"),fr(XE,"onTransitionCancel"),fr(Gg,"onTransitionEnd"),yn("onMouseEnter",["mouseout","mouseover"]),yn("onMouseLeave",["mouseout","mouseover"]),yn("onPointerEnter",["pointerout","pointerover"]),yn("onPointerLeave",["pointerout","pointerover"]),Ln("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ln("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ln("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ln("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ln("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ln("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ga="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),N2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ga));function g0(t,r){r=(r&4)!==0;for(var o=0;o<t.length;o++){var f=t[o],w=f.event;f=f.listeners;e:{var R=void 0;if(r)for(var j=f.length-1;0<=j;j--){var Y=f[j],te=Y.instance,ue=Y.currentTarget;if(Y=Y.listener,te!==R&&w.isPropagationStopped())break e;R=Y,w.currentTarget=ue;try{R(w)}catch(pe){uc(pe)}w.currentTarget=null,R=te}else for(j=0;j<f.length;j++){if(Y=f[j],te=Y.instance,ue=Y.currentTarget,Y=Y.listener,te!==R&&w.isPropagationStopped())break e;R=Y,w.currentTarget=ue;try{R(w)}catch(pe){uc(pe)}w.currentTarget=null,R=te}}}}function Xe(t,r){var o=r[Be];o===void 0&&(o=r[Be]=new Set);var f=t+"__bubble";o.has(f)||(v0(r,t,2,!1),o.add(f))}function Cd(t,r,o){var f=0;r&&(f|=4),v0(o,t,f,r)}var Xc="_reactListening"+Math.random().toString(36).slice(2);function Ed(t){if(!t[Xc]){t[Xc]=!0,On.forEach(function(o){o!=="selectionchange"&&(N2.has(o)||Cd(o,!1,t),Cd(o,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Xc]||(r[Xc]=!0,Cd("selectionchange",!1,r))}}function v0(t,r,o,f){switch(W0(r)){case 2:var w=aR;break;case 8:w=lR;break;default:w=Id}o=w.bind(null,r,o,t),w=void 0,!Vh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(w=!0),f?w!==void 0?t.addEventListener(r,o,{capture:!0,passive:w}):t.addEventListener(r,o,!0):w!==void 0?t.addEventListener(r,o,{passive:w}):t.addEventListener(r,o,!1)}function Rd(t,r,o,f,w){var R=f;if((r&1)===0&&(r&2)===0&&f!==null)e:for(;;){if(f===null)return;var j=f.tag;if(j===3||j===4){var Y=f.stateNode.containerInfo;if(Y===w)break;if(j===4)for(j=f.return;j!==null;){var te=j.tag;if((te===3||te===4)&&j.stateNode.containerInfo===w)return;j=j.return}for(;Y!==null;){if(j=St(Y),j===null)return;if(te=j.tag,te===5||te===6||te===26||te===27){f=R=j;continue e}Y=Y.parentNode}}f=f.return}xg(function(){var ue=R,pe=Fh(o),ve=[];e:{var he=Xg.get(t);if(he!==void 0){var me=ac,Re=t;switch(t){case"keypress":if(sc(o)===0)break e;case"keydown":case"keyup":me=RE;break;case"focusin":Re="focus",me=Kh;break;case"focusout":Re="blur",me=Kh;break;case"beforeblur":case"afterblur":me=Kh;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=Eg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=mE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=TE;break;case Wg:case Yg:case Kg:me=vE;break;case Gg:me=OE;break;case"scroll":case"scrollend":me=fE;break;case"wheel":me=NE;break;case"copy":case"cut":case"paste":me=yE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Ag;break;case"toggle":case"beforetoggle":me=BE}var Pe=(r&4)!==0,ht=!Pe&&(t==="scroll"||t==="scrollend"),oe=Pe?he!==null?he+"Capture":null:he;Pe=[];for(var ne=ue,ce;ne!==null;){var ge=ne;if(ce=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||ce===null||oe===null||(ge=va(ne,oe),ge!=null&&Pe.push(Xa(ne,ge,ce))),ht)break;ne=ne.return}0<Pe.length&&(he=new me(he,Re,null,o,pe),ve.push({event:he,listeners:Pe}))}}if((r&7)===0){e:{if(he=t==="mouseover"||t==="pointerover",me=t==="mouseout"||t==="pointerout",he&&o!==Uh&&(Re=o.relatedTarget||o.fromElement)&&(St(Re)||Re[Te]))break e;if((me||he)&&(he=pe.window===pe?pe:(he=pe.ownerDocument)?he.defaultView||he.parentWindow:window,me?(Re=o.relatedTarget||o.toElement,me=ue,Re=Re?St(Re):null,Re!==null&&(ht=h(Re),Pe=Re.tag,Re!==ht||Pe!==5&&Pe!==27&&Pe!==6)&&(Re=null)):(me=null,Re=ue),me!==Re)){if(Pe=Eg,ge="onMouseLeave",oe="onMouseEnter",ne="mouse",(t==="pointerout"||t==="pointerover")&&(Pe=Ag,ge="onPointerLeave",oe="onPointerEnter",ne="pointer"),ht=me==null?he:Mt(me),ce=Re==null?he:Mt(Re),he=new Pe(ge,ne+"leave",me,o,pe),he.target=ht,he.relatedTarget=ce,ge=null,St(pe)===ue&&(Pe=new Pe(oe,ne+"enter",Re,o,pe),Pe.target=ce,Pe.relatedTarget=ht,ge=Pe),ht=ge,me&&Re)t:{for(Pe=k2,oe=me,ne=Re,ce=0,ge=oe;ge;ge=Pe(ge))ce++;ge=0;for(var je=ne;je;je=Pe(je))ge++;for(;0<ce-ge;)oe=Pe(oe),ce--;for(;0<ge-ce;)ne=Pe(ne),ge--;for(;ce--;){if(oe===ne||ne!==null&&oe===ne.alternate){Pe=oe;break t}oe=Pe(oe),ne=Pe(ne)}Pe=null}else Pe=null;me!==null&&_0(ve,he,me,Pe,!1),Re!==null&&ht!==null&&_0(ve,ht,Re,Pe,!0)}}e:{if(he=ue?Mt(ue):window,me=he.nodeName&&he.nodeName.toLowerCase(),me==="select"||me==="input"&&he.type==="file")var nt=Bg;else if(Ng(he))if(jg)nt=qE;else{nt=$E;var Oe=FE}else me=he.nodeName,!me||me.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?ue&&Ih(ue.elementType)&&(nt=Bg):nt=VE;if(nt&&(nt=nt(t,ue))){kg(ve,nt,o,pe);break e}Oe&&Oe(t,he,ue),t==="focusout"&&ue&&he.type==="number"&&ue.memoizedProps.value!=null&&ga(he,"number",he.value)}switch(Oe=ue?Mt(ue):window,t){case"focusin":(Ng(Oe)||Oe.contentEditable==="true")&&(ho=Oe,ef=ue,Ea=null);break;case"focusout":Ea=ef=ho=null;break;case"mousedown":tf=!0;break;case"contextmenu":case"mouseup":case"dragend":tf=!1,Vg(ve,o,pe);break;case"selectionchange":if(YE)break;case"keydown":case"keyup":Vg(ve,o,pe)}var Fe;if(Xh)e:{switch(t){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else uo?Og(t,o)&&(Je="onCompositionEnd"):t==="keydown"&&o.keyCode===229&&(Je="onCompositionStart");Je&&(Dg&&o.locale!=="ko"&&(uo||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&uo&&(Fe=wg()):(Mi=pe,qh="value"in Mi?Mi.value:Mi.textContent,uo=!0)),Oe=Qc(ue,Je),0<Oe.length&&(Je=new Rg(Je,t,null,o,pe),ve.push({event:Je,listeners:Oe}),Fe?Je.data=Fe:(Fe=Lg(o),Fe!==null&&(Je.data=Fe)))),(Fe=HE?PE(t,o):zE(t,o))&&(Je=Qc(ue,"onBeforeInput"),0<Je.length&&(Oe=new Rg("onBeforeInput","beforeinput",null,o,pe),ve.push({event:Oe,listeners:Je}),Oe.data=Fe)),M2(ve,t,ue,o,pe)}g0(ve,r)})}function Xa(t,r,o){return{instance:t,listener:r,currentTarget:o}}function Qc(t,r){for(var o=r+"Capture",f=[];t!==null;){var w=t,R=w.stateNode;if(w=w.tag,w!==5&&w!==26&&w!==27||R===null||(w=va(t,o),w!=null&&f.unshift(Xa(t,w,R)),w=va(t,r),w!=null&&f.push(Xa(t,w,R))),t.tag===3)return f;t=t.return}return[]}function k2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function _0(t,r,o,f,w){for(var R=r._reactName,j=[];o!==null&&o!==f;){var Y=o,te=Y.alternate,ue=Y.stateNode;if(Y=Y.tag,te!==null&&te===f)break;Y!==5&&Y!==26&&Y!==27||ue===null||(te=ue,w?(ue=va(o,R),ue!=null&&j.unshift(Xa(o,ue,te))):w||(ue=va(o,R),ue!=null&&j.push(Xa(o,ue,te)))),o=o.return}j.length!==0&&t.push({event:r,listeners:j})}var B2=/\r\n?/g,j2=/\u0000|\uFFFD/g;function y0(t){return(typeof t=="string"?t:""+t).replace(B2,`
|
|
9
|
-
`).replace(j2,"")}function b0(t,r){return r=y0(r),y0(t)===r}function ut(t,r,o,f,w,R){switch(o){case"children":typeof f=="string"?r==="body"||r==="textarea"&&f===""||ao(t,f):(typeof f=="number"||typeof f=="bigint")&&r!=="body"&&ao(t,""+f);break;case"className":Nn(t,"class",f);break;case"tabIndex":Nn(t,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Nn(t,o,f);break;case"style":bg(t,f,R);break;case"data":if(r!=="object"){Nn(t,"data",f);break}case"src":case"href":if(f===""&&(r!=="a"||o!=="href")){t.removeAttribute(o);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){t.removeAttribute(o);break}f=rc(""+f),t.setAttribute(o,f);break;case"action":case"formAction":if(typeof f=="function"){t.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof R=="function"&&(o==="formAction"?(r!=="input"&&ut(t,r,"name",w.name,w,null),ut(t,r,"formEncType",w.formEncType,w,null),ut(t,r,"formMethod",w.formMethod,w,null),ut(t,r,"formTarget",w.formTarget,w,null)):(ut(t,r,"encType",w.encType,w,null),ut(t,r,"method",w.method,w,null),ut(t,r,"target",w.target,w,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){t.removeAttribute(o);break}f=rc(""+f),t.setAttribute(o,f);break;case"onClick":f!=null&&(t.onclick=ti);break;case"onScroll":f!=null&&Xe("scroll",t);break;case"onScrollEnd":f!=null&&Xe("scrollend",t);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(s(61));if(o=f.__html,o!=null){if(w.children!=null)throw Error(s(60));t.innerHTML=o}}break;case"multiple":t.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":t.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){t.removeAttribute("xlink:href");break}o=rc(""+f),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?t.setAttribute(o,""+f):t.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?t.setAttribute(o,""):t.removeAttribute(o);break;case"capture":case"download":f===!0?t.setAttribute(o,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?t.setAttribute(o,f):t.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?t.setAttribute(o,f):t.removeAttribute(o);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?t.removeAttribute(o):t.setAttribute(o,f);break;case"popover":Xe("beforetoggle",t),Xe("toggle",t),Rt(t,"popover",f);break;case"xlinkActuate":Vt(t,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Vt(t,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Vt(t,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Vt(t,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Vt(t,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Vt(t,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Vt(t,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Vt(t,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Vt(t,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Rt(t,"is",f);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=uE.get(o)||o,Rt(t,o,f))}}function Ad(t,r,o,f,w,R){switch(o){case"style":bg(t,f,R);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(s(61));if(o=f.__html,o!=null){if(w.children!=null)throw Error(s(60));t.innerHTML=o}}break;case"children":typeof f=="string"?ao(t,f):(typeof f=="number"||typeof f=="bigint")&&ao(t,""+f);break;case"onScroll":f!=null&&Xe("scroll",t);break;case"onScrollEnd":f!=null&&Xe("scrollend",t);break;case"onClick":f!=null&&(t.onclick=ti);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dn.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(w=o.endsWith("Capture"),r=o.slice(2,w?o.length-7:void 0),R=t[we]||null,R=R!=null?R[o]:null,typeof R=="function"&&t.removeEventListener(r,R,w),typeof f=="function")){typeof R!="function"&&R!==null&&(o in t?t[o]=null:t.hasAttribute(o)&&t.removeAttribute(o)),t.addEventListener(r,f,w);break e}o in t?t[o]=f:f===!0?t.setAttribute(o,""):Rt(t,o,f)}}}function on(t,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xe("error",t),Xe("load",t);var f=!1,w=!1,R;for(R in o)if(o.hasOwnProperty(R)){var j=o[R];if(j!=null)switch(R){case"src":f=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:ut(t,r,R,j,o,null)}}w&&ut(t,r,"srcSet",o.srcSet,o,null),f&&ut(t,r,"src",o.src,o,null);return;case"input":Xe("invalid",t);var Y=R=j=w=null,te=null,ue=null;for(f in o)if(o.hasOwnProperty(f)){var pe=o[f];if(pe!=null)switch(f){case"name":w=pe;break;case"type":j=pe;break;case"checked":te=pe;break;case"defaultChecked":ue=pe;break;case"value":R=pe;break;case"defaultValue":Y=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(s(137,r));break;default:ut(t,r,f,pe,o,null)}}nc(t,R,Y,te,ue,j,w,!1);return;case"select":Xe("invalid",t),f=j=R=null;for(w in o)if(o.hasOwnProperty(w)&&(Y=o[w],Y!=null))switch(w){case"value":R=Y;break;case"defaultValue":j=Y;break;case"multiple":f=Y;default:ut(t,r,w,Y,o,null)}r=R,o=j,t.multiple=!!f,r!=null?ei(t,!!f,r,!1):o!=null&&ei(t,!!f,o,!0);return;case"textarea":Xe("invalid",t),R=w=f=null;for(j in o)if(o.hasOwnProperty(j)&&(Y=o[j],Y!=null))switch(j){case"value":f=Y;break;case"defaultValue":w=Y;break;case"children":R=Y;break;case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(91));break;default:ut(t,r,j,Y,o,null)}_g(t,f,w,R);return;case"option":for(te in o)o.hasOwnProperty(te)&&(f=o[te],f!=null)&&(te==="selected"?t.selected=f&&typeof f!="function"&&typeof f!="symbol":ut(t,r,te,f,o,null));return;case"dialog":Xe("beforetoggle",t),Xe("toggle",t),Xe("cancel",t),Xe("close",t);break;case"iframe":case"object":Xe("load",t);break;case"video":case"audio":for(f=0;f<Ga.length;f++)Xe(Ga[f],t);break;case"image":Xe("error",t),Xe("load",t);break;case"details":Xe("toggle",t);break;case"embed":case"source":case"link":Xe("error",t),Xe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in o)if(o.hasOwnProperty(ue)&&(f=o[ue],f!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:ut(t,r,ue,f,o,null)}return;default:if(Ih(r)){for(pe in o)o.hasOwnProperty(pe)&&(f=o[pe],f!==void 0&&Ad(t,r,pe,f,o,void 0));return}}for(Y in o)o.hasOwnProperty(Y)&&(f=o[Y],f!=null&&ut(t,r,Y,f,o,null))}function H2(t,r,o,f){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,R=null,j=null,Y=null,te=null,ue=null,pe=null;for(me in o){var ve=o[me];if(o.hasOwnProperty(me)&&ve!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":te=ve;default:f.hasOwnProperty(me)||ut(t,r,me,null,f,ve)}}for(var he in f){var me=f[he];if(ve=o[he],f.hasOwnProperty(he)&&(me!=null||ve!=null))switch(he){case"type":R=me;break;case"name":w=me;break;case"checked":ue=me;break;case"defaultChecked":pe=me;break;case"value":j=me;break;case"defaultValue":Y=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(s(137,r));break;default:me!==ve&&ut(t,r,he,me,f,ve)}}vs(t,j,Y,te,ue,pe,R,w);return;case"select":me=j=Y=he=null;for(R in o)if(te=o[R],o.hasOwnProperty(R)&&te!=null)switch(R){case"value":break;case"multiple":me=te;default:f.hasOwnProperty(R)||ut(t,r,R,null,f,te)}for(w in f)if(R=f[w],te=o[w],f.hasOwnProperty(w)&&(R!=null||te!=null))switch(w){case"value":he=R;break;case"defaultValue":Y=R;break;case"multiple":j=R;default:R!==te&&ut(t,r,w,R,f,te)}r=Y,o=j,f=me,he!=null?ei(t,!!o,he,!1):!!f!=!!o&&(r!=null?ei(t,!!o,r,!0):ei(t,!!o,o?[]:"",!1));return;case"textarea":me=he=null;for(Y in o)if(w=o[Y],o.hasOwnProperty(Y)&&w!=null&&!f.hasOwnProperty(Y))switch(Y){case"value":break;case"children":break;default:ut(t,r,Y,null,f,w)}for(j in f)if(w=f[j],R=o[j],f.hasOwnProperty(j)&&(w!=null||R!=null))switch(j){case"value":he=w;break;case"defaultValue":me=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(s(91));break;default:w!==R&&ut(t,r,j,w,f,R)}vg(t,he,me);return;case"option":for(var Re in o)he=o[Re],o.hasOwnProperty(Re)&&he!=null&&!f.hasOwnProperty(Re)&&(Re==="selected"?t.selected=!1:ut(t,r,Re,null,f,he));for(te in f)he=f[te],me=o[te],f.hasOwnProperty(te)&&he!==me&&(he!=null||me!=null)&&(te==="selected"?t.selected=he&&typeof he!="function"&&typeof he!="symbol":ut(t,r,te,he,f,me));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Pe in o)he=o[Pe],o.hasOwnProperty(Pe)&&he!=null&&!f.hasOwnProperty(Pe)&&ut(t,r,Pe,null,f,he);for(ue in f)if(he=f[ue],me=o[ue],f.hasOwnProperty(ue)&&he!==me&&(he!=null||me!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,r));break;default:ut(t,r,ue,he,f,me)}return;default:if(Ih(r)){for(var ht in o)he=o[ht],o.hasOwnProperty(ht)&&he!==void 0&&!f.hasOwnProperty(ht)&&Ad(t,r,ht,void 0,f,he);for(pe in f)he=f[pe],me=o[pe],!f.hasOwnProperty(pe)||he===me||he===void 0&&me===void 0||Ad(t,r,pe,he,f,me);return}}for(var oe in o)he=o[oe],o.hasOwnProperty(oe)&&he!=null&&!f.hasOwnProperty(oe)&&ut(t,r,oe,null,f,he);for(ve in f)he=f[ve],me=o[ve],!f.hasOwnProperty(ve)||he===me||he==null&&me==null||ut(t,r,ve,he,f,me)}function S0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function P2(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,o=performance.getEntriesByType("resource"),f=0;f<o.length;f++){var w=o[f],R=w.transferSize,j=w.initiatorType,Y=w.duration;if(R&&Y&&S0(j)){for(j=0,Y=w.responseEnd,f+=1;f<o.length;f++){var te=o[f],ue=te.startTime;if(ue>Y)break;var pe=te.transferSize,ve=te.initiatorType;pe&&S0(ve)&&(te=te.responseEnd,j+=pe*(te<Y?1:(Y-ue)/(te-ue)))}if(--f,r+=8*(R+j)/(w.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Dd=null,Td=null;function Zc(t){return t.nodeType===9?t:t.ownerDocument}function x0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function w0(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function Md(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Od=null;function z2(){var t=window.event;return t&&t.type==="popstate"?t===Od?!1:(Od=t,!0):(Od=null,!1)}var C0=typeof setTimeout=="function"?setTimeout:void 0,I2=typeof clearTimeout=="function"?clearTimeout:void 0,E0=typeof Promise=="function"?Promise:void 0,U2=typeof queueMicrotask=="function"?queueMicrotask:typeof E0<"u"?function(t){return E0.resolve(null).then(t).catch(F2)}:C0;function F2(t){setTimeout(function(){throw t})}function Yi(t){return t==="head"}function R0(t,r){var o=r,f=0;do{var w=o.nextSibling;if(t.removeChild(o),w&&w.nodeType===8)if(o=w.data,o==="/$"||o==="/&"){if(f===0){t.removeChild(w),zo(r);return}f--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")f++;else if(o==="html")Qa(t.ownerDocument.documentElement);else if(o==="head"){o=t.ownerDocument.head,Qa(o);for(var R=o.firstChild;R;){var j=R.nextSibling,Y=R.nodeName;R[vt]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&R.rel.toLowerCase()==="stylesheet"||o.removeChild(R),R=j}}else o==="body"&&Qa(t.ownerDocument.body);o=w}while(o);zo(r)}function A0(t,r){var o=t;t=0;do{var f=o.nextSibling;if(o.nodeType===1?r?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(r?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),f&&f.nodeType===8)if(o=f.data,o==="/$"){if(t===0)break;t--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||t++;o=f}while(o)}function Ld(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Ld(o),bt(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}t.removeChild(o)}}function $2(t,r,o,f){for(;t.nodeType===1;){var w=o;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!f&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(f){if(!t[vt])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(R=t.getAttribute("rel"),R==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(R!==w.rel||t.getAttribute("href")!==(w.href==null||w.href===""?null:w.href)||t.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin)||t.getAttribute("title")!==(w.title==null?null:w.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(R=t.getAttribute("src"),(R!==(w.src==null?null:w.src)||t.getAttribute("type")!==(w.type==null?null:w.type)||t.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin))&&R&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var R=w.name==null?null:""+w.name;if(w.type==="hidden"&&t.getAttribute("name")===R)return t}else return t;if(t=Zn(t.nextSibling),t===null)break}return null}function V2(t,r,o){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!o||(t=Zn(t.nextSibling),t===null))return null;return t}function D0(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Zn(t.nextSibling),t===null))return null;return t}function Nd(t){return t.data==="$?"||t.data==="$~"}function kd(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function q2(t,r){var o=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||o.readyState!=="loading")r();else{var f=function(){r(),o.removeEventListener("DOMContentLoaded",f)};o.addEventListener("DOMContentLoaded",f),t._reactRetry=f}}function Zn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var Bd=null;function T0(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var o=t.data;if(o==="/$"||o==="/&"){if(r===0)return Zn(t.nextSibling);r--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||r++}t=t.nextSibling}return null}function M0(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var o=t.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(r===0)return t;r--}else o!=="/$"&&o!=="/&"||r++}t=t.previousSibling}return null}function O0(t,r,o){switch(r=Zc(o),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Qa(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);bt(t)}var Jn=new Map,L0=new Set;function Jc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var vi=K.d;K.d={f:W2,r:Y2,D:K2,C:G2,L:X2,m:Q2,X:J2,S:Z2,M:eR};function W2(){var t=vi.f(),r=Vc();return t||r}function Y2(t){var r=We(t);r!==null&&r.tag===5&&r.type==="form"?Gv(r):vi.r(t)}var jo=typeof document>"u"?null:document;function N0(t,r,o){var f=jo;if(f&&typeof r=="string"&&r){var w=bn(r);w='link[rel="'+t+'"][href="'+w+'"]',typeof o=="string"&&(w+='[crossorigin="'+o+'"]'),L0.has(w)||(L0.add(w),t={rel:t,crossOrigin:o,href:r},f.querySelector(w)===null&&(r=f.createElement("link"),on(r,"link",t),mt(r),f.head.appendChild(r)))}}function K2(t){vi.D(t),N0("dns-prefetch",t,null)}function G2(t,r){vi.C(t,r),N0("preconnect",t,r)}function X2(t,r,o){vi.L(t,r,o);var f=jo;if(f&&t&&r){var w='link[rel="preload"][as="'+bn(r)+'"]';r==="image"&&o&&o.imageSrcSet?(w+='[imagesrcset="'+bn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(w+='[imagesizes="'+bn(o.imageSizes)+'"]')):w+='[href="'+bn(t)+'"]';var R=w;switch(r){case"style":R=Ho(t);break;case"script":R=Po(t)}Jn.has(R)||(t=m({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:t,as:r},o),Jn.set(R,t),f.querySelector(w)!==null||r==="style"&&f.querySelector(Za(R))||r==="script"&&f.querySelector(Ja(R))||(r=f.createElement("link"),on(r,"link",t),mt(r),f.head.appendChild(r)))}}function Q2(t,r){vi.m(t,r);var o=jo;if(o&&t){var f=r&&typeof r.as=="string"?r.as:"script",w='link[rel="modulepreload"][as="'+bn(f)+'"][href="'+bn(t)+'"]',R=w;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":R=Po(t)}if(!Jn.has(R)&&(t=m({rel:"modulepreload",href:t},r),Jn.set(R,t),o.querySelector(w)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Ja(R)))return}f=o.createElement("link"),on(f,"link",t),mt(f),o.head.appendChild(f)}}}function Z2(t,r,o){vi.S(t,r,o);var f=jo;if(f&&t){var w=cn(f).hoistableStyles,R=Ho(t);r=r||"default";var j=w.get(R);if(!j){var Y={loading:0,preload:null};if(j=f.querySelector(Za(R)))Y.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":r},o),(o=Jn.get(R))&&jd(t,o);var te=j=f.createElement("link");mt(te),on(te,"link",t),te._p=new Promise(function(ue,pe){te.onload=ue,te.onerror=pe}),te.addEventListener("load",function(){Y.loading|=1}),te.addEventListener("error",function(){Y.loading|=2}),Y.loading|=4,eu(j,r,f)}j={type:"stylesheet",instance:j,count:1,state:Y},w.set(R,j)}}}function J2(t,r){vi.X(t,r);var o=jo;if(o&&t){var f=cn(o).hoistableScripts,w=Po(t),R=f.get(w);R||(R=o.querySelector(Ja(w)),R||(t=m({src:t,async:!0},r),(r=Jn.get(w))&&Hd(t,r),R=o.createElement("script"),mt(R),on(R,"link",t),o.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},f.set(w,R))}}function eR(t,r){vi.M(t,r);var o=jo;if(o&&t){var f=cn(o).hoistableScripts,w=Po(t),R=f.get(w);R||(R=o.querySelector(Ja(w)),R||(t=m({src:t,async:!0,type:"module"},r),(r=Jn.get(w))&&Hd(t,r),R=o.createElement("script"),mt(R),on(R,"link",t),o.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},f.set(w,R))}}function k0(t,r,o,f){var w=(w=Z.current)?Jc(w):null;if(!w)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=Ho(o.href),o=cn(w).hoistableStyles,f=o.get(r),f||(f={type:"style",instance:null,count:0,state:null},o.set(r,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){t=Ho(o.href);var R=cn(w).hoistableStyles,j=R.get(t);if(j||(w=w.ownerDocument||w,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},R.set(t,j),(R=w.querySelector(Za(t)))&&!R._p&&(j.instance=R,j.state.loading=5),Jn.has(t)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Jn.set(t,o),R||tR(w,t,o,j.state))),r&&f===null)throw Error(s(528,""));return j}if(r&&f!==null)throw Error(s(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Po(o),o=cn(w).hoistableScripts,f=o.get(r),f||(f={type:"script",instance:null,count:0,state:null},o.set(r,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Ho(t){return'href="'+bn(t)+'"'}function Za(t){return'link[rel="stylesheet"]['+t+"]"}function B0(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function tR(t,r,o,f){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?f.loading=1:(r=t.createElement("link"),f.preload=r,r.addEventListener("load",function(){return f.loading|=1}),r.addEventListener("error",function(){return f.loading|=2}),on(r,"link",o),mt(r),t.head.appendChild(r))}function Po(t){return'[src="'+bn(t)+'"]'}function Ja(t){return"script[async]"+t}function j0(t,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var f=t.querySelector('style[data-href~="'+bn(o.href)+'"]');if(f)return r.instance=f,mt(f),f;var w=m({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return f=(t.ownerDocument||t).createElement("style"),mt(f),on(f,"style",w),eu(f,o.precedence,t),r.instance=f;case"stylesheet":w=Ho(o.href);var R=t.querySelector(Za(w));if(R)return r.state.loading|=4,r.instance=R,mt(R),R;f=B0(o),(w=Jn.get(w))&&jd(f,w),R=(t.ownerDocument||t).createElement("link"),mt(R);var j=R;return j._p=new Promise(function(Y,te){j.onload=Y,j.onerror=te}),on(R,"link",f),r.state.loading|=4,eu(R,o.precedence,t),r.instance=R;case"script":return R=Po(o.src),(w=t.querySelector(Ja(R)))?(r.instance=w,mt(w),w):(f=o,(w=Jn.get(R))&&(f=m({},o),Hd(f,w)),t=t.ownerDocument||t,w=t.createElement("script"),mt(w),on(w,"link",f),t.head.appendChild(w),r.instance=w);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(f=r.instance,r.state.loading|=4,eu(f,o.precedence,t));return r.instance}function eu(t,r,o){for(var f=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=f.length?f[f.length-1]:null,R=w,j=0;j<f.length;j++){var Y=f[j];if(Y.dataset.precedence===r)R=Y;else if(R!==w)break}R?R.parentNode.insertBefore(t,R.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(t,r.firstChild))}function jd(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Hd(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var tu=null;function H0(t,r,o){if(tu===null){var f=new Map,w=tu=new Map;w.set(o,f)}else w=tu,f=w.get(o),f||(f=new Map,w.set(o,f));if(f.has(t))return f;for(f.set(t,null),o=o.getElementsByTagName(t),w=0;w<o.length;w++){var R=o[w];if(!(R[vt]||R[Se]||t==="link"&&R.getAttribute("rel")==="stylesheet")&&R.namespaceURI!=="http://www.w3.org/2000/svg"){var j=R.getAttribute(r)||"";j=t+j;var Y=f.get(j);Y?Y.push(R):f.set(j,[R])}}return f}function P0(t,r,o){t=t.ownerDocument||t,t.head.insertBefore(o,r==="title"?t.querySelector("head > title"):null)}function nR(t,r,o){if(o===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function z0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function rR(t,r,o,f){if(o.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var w=Ho(f.href),R=r.querySelector(Za(w));if(R){r=R._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=nu.bind(t),r.then(t,t)),o.state.loading|=4,o.instance=R,mt(R);return}R=r.ownerDocument||r,f=B0(f),(w=Jn.get(w))&&jd(f,w),R=R.createElement("link"),mt(R);var j=R;j._p=new Promise(function(Y,te){j.onload=Y,j.onerror=te}),on(R,"link",f),o.instance=R}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(o,r),(r=o.state.preload)&&(o.state.loading&3)===0&&(t.count++,o=nu.bind(t),r.addEventListener("load",o),r.addEventListener("error",o))}}var Pd=0;function iR(t,r){return t.stylesheets&&t.count===0&&iu(t,t.stylesheets),0<t.count||0<t.imgCount?function(o){var f=setTimeout(function(){if(t.stylesheets&&iu(t,t.stylesheets),t.unsuspend){var R=t.unsuspend;t.unsuspend=null,R()}},6e4+r);0<t.imgBytes&&Pd===0&&(Pd=62500*P2());var w=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&iu(t,t.stylesheets),t.unsuspend)){var R=t.unsuspend;t.unsuspend=null,R()}},(t.imgBytes>Pd?50:800)+r);return t.unsuspend=o,function(){t.unsuspend=null,clearTimeout(f),clearTimeout(w)}}:null}function nu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)iu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var ru=null;function iu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,ru=new Map,r.forEach(sR,t),ru=null,nu.call(t))}function sR(t,r){if(!(r.state.loading&4)){var o=ru.get(t);if(o)var f=o.get(null);else{o=new Map,ru.set(t,o);for(var w=t.querySelectorAll("link[data-precedence],style[data-precedence]"),R=0;R<w.length;R++){var j=w[R];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(o.set(j.dataset.precedence,j),f=j)}f&&o.set(null,f)}w=r.instance,j=w.getAttribute("data-precedence"),R=o.get(j)||f,R===f&&o.set(null,w),o.set(j,w),this.count++,f=nu.bind(this),w.addEventListener("load",f),w.addEventListener("error",f),R?R.parentNode.insertBefore(w,R.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(w,t.firstChild)),r.state.loading|=4}}var el={$$typeof:y,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function oR(t,r,o,f,w,R,j,Y,te){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Rr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rr(0),this.hiddenUpdates=Rr(null),this.identifierPrefix=f,this.onUncaughtError=w,this.onCaughtError=R,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=te,this.incompleteTransitions=new Map}function I0(t,r,o,f,w,R,j,Y,te,ue,pe,ve){return t=new oR(t,r,o,j,te,ue,pe,ve,Y),r=1,R===!0&&(r|=24),R=Bn(3,null,null,r),t.current=R,R.stateNode=t,r=vf(),r.refCount++,t.pooledCache=r,r.refCount++,R.memoizedState={element:f,isDehydrated:o,cache:r},Sf(R),t}function U0(t){return t?(t=po,t):po}function F0(t,r,o,f,w,R){w=U0(w),f.context===null?f.context=w:f.pendingContext=w,f=ji(r),f.payload={element:o},R=R===void 0?null:R,R!==null&&(f.callback=R),o=Hi(t,f,r),o!==null&&(Rn(o,t,r),La(o,t,r))}function $0(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var o=t.retryLane;t.retryLane=o!==0&&o<r?o:r}}function zd(t,r){$0(t,r),(t=t.alternate)&&$0(t,r)}function V0(t){if(t.tag===13||t.tag===31){var r=Ss(t,67108864);r!==null&&Rn(r,t,67108864),zd(t,67108864)}}function q0(t){if(t.tag===13||t.tag===31){var r=In();r=fe(r);var o=Ss(t,r);o!==null&&Rn(o,t,r),zd(t,r)}}var su=!0;function aR(t,r,o,f){var w=H.T;H.T=null;var R=K.p;try{K.p=2,Id(t,r,o,f)}finally{K.p=R,H.T=w}}function lR(t,r,o,f){var w=H.T;H.T=null;var R=K.p;try{K.p=8,Id(t,r,o,f)}finally{K.p=R,H.T=w}}function Id(t,r,o,f){if(su){var w=Ud(f);if(w===null)Rd(t,r,f,ou,o),Y0(t,f);else if(uR(w,t,r,o,f))f.stopPropagation();else if(Y0(t,f),r&4&&-1<cR.indexOf(t)){for(;w!==null;){var R=We(w);if(R!==null)switch(R.tag){case 3:if(R=R.stateNode,R.current.memoizedState.isDehydrated){var j=ur(R.pendingLanes);if(j!==0){var Y=R;for(Y.pendingLanes|=2,Y.entangledLanes|=2;j;){var te=1<<31-Zt(j);Y.entanglements[1]|=te,j&=~te}Lr(R),(ot&6)===0&&(Fc=it()+500,Ka(0))}}break;case 31:case 13:Y=Ss(R,2),Y!==null&&Rn(Y,R,2),Vc(),zd(R,2)}if(R=Ud(f),R===null&&Rd(t,r,f,ou,o),R===w)break;w=R}w!==null&&f.stopPropagation()}else Rd(t,r,f,null,o)}}function Ud(t){return t=Fh(t),Fd(t)}var ou=null;function Fd(t){if(ou=null,t=St(t),t!==null){var r=h(t);if(r===null)t=null;else{var o=r.tag;if(o===13){if(t=d(r),t!==null)return t;t=null}else if(o===31){if(t=l(r),t!==null)return t;t=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return ou=t,null}function W0(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Et()){case Gt:return 2;case ln:return 8;case dt:case Xt:return 32;case Qt:return 268435456;default:return 32}default:return 32}}var $d=!1,Ki=null,Gi=null,Xi=null,tl=new Map,nl=new Map,Qi=[],cR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Y0(t,r){switch(t){case"focusin":case"focusout":Ki=null;break;case"dragenter":case"dragleave":Gi=null;break;case"mouseover":case"mouseout":Xi=null;break;case"pointerover":case"pointerout":tl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":nl.delete(r.pointerId)}}function rl(t,r,o,f,w,R){return t===null||t.nativeEvent!==R?(t={blockedOn:r,domEventName:o,eventSystemFlags:f,nativeEvent:R,targetContainers:[w]},r!==null&&(r=We(r),r!==null&&V0(r)),t):(t.eventSystemFlags|=f,r=t.targetContainers,w!==null&&r.indexOf(w)===-1&&r.push(w),t)}function uR(t,r,o,f,w){switch(r){case"focusin":return Ki=rl(Ki,t,r,o,f,w),!0;case"dragenter":return Gi=rl(Gi,t,r,o,f,w),!0;case"mouseover":return Xi=rl(Xi,t,r,o,f,w),!0;case"pointerover":var R=w.pointerId;return tl.set(R,rl(tl.get(R)||null,t,r,o,f,w)),!0;case"gotpointercapture":return R=w.pointerId,nl.set(R,rl(nl.get(R)||null,t,r,o,f,w)),!0}return!1}function K0(t){var r=St(t.target);if(r!==null){var o=h(r);if(o!==null){if(r=o.tag,r===13){if(r=d(o),r!==null){t.blockedOn=r,Me(t.priority,function(){q0(o)});return}}else if(r===31){if(r=l(o),r!==null){t.blockedOn=r,Me(t.priority,function(){q0(o)});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){t.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}t.blockedOn=null}function au(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var o=Ud(t.nativeEvent);if(o===null){o=t.nativeEvent;var f=new o.constructor(o.type,o);Uh=f,o.target.dispatchEvent(f),Uh=null}else return r=We(o),r!==null&&V0(r),t.blockedOn=o,!1;r.shift()}return!0}function G0(t,r,o){au(t)&&o.delete(r)}function hR(){$d=!1,Ki!==null&&au(Ki)&&(Ki=null),Gi!==null&&au(Gi)&&(Gi=null),Xi!==null&&au(Xi)&&(Xi=null),tl.forEach(G0),nl.forEach(G0)}function lu(t,r){t.blockedOn===r&&(t.blockedOn=null,$d||($d=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,hR)))}var cu=null;function X0(t){cu!==t&&(cu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){cu===t&&(cu=null);for(var r=0;r<t.length;r+=3){var o=t[r],f=t[r+1],w=t[r+2];if(typeof f!="function"){if(Fd(f||o)===null)continue;break}var R=We(o);R!==null&&(t.splice(r,3),r-=3,Uf(R,{pending:!0,data:w,method:o.method,action:f},f,w))}}))}function zo(t){function r(te){return lu(te,t)}Ki!==null&&lu(Ki,t),Gi!==null&&lu(Gi,t),Xi!==null&&lu(Xi,t),tl.forEach(r),nl.forEach(r);for(var o=0;o<Qi.length;o++){var f=Qi[o];f.blockedOn===t&&(f.blockedOn=null)}for(;0<Qi.length&&(o=Qi[0],o.blockedOn===null);)K0(o),o.blockedOn===null&&Qi.shift();if(o=(t.ownerDocument||t).$$reactFormReplay,o!=null)for(f=0;f<o.length;f+=3){var w=o[f],R=o[f+1],j=w[we]||null;if(typeof R=="function")j||X0(o);else if(j){var Y=null;if(R&&R.hasAttribute("formAction")){if(w=R,j=R[we]||null)Y=j.formAction;else if(Fd(w)!==null)continue}else Y=j.action;typeof Y=="function"?o[f+1]=Y:(o.splice(f,3),f-=3),X0(o)}}}function Q0(){function t(R){R.canIntercept&&R.info==="react-transition"&&R.intercept({handler:function(){return new Promise(function(j){return w=j})},focusReset:"manual",scroll:"manual"})}function r(){w!==null&&(w(),w=null),f||setTimeout(o,20)}function o(){if(!f&&!navigation.transition){var R=navigation.currentEntry;R&&R.url!=null&&navigation.navigate(R.url,{state:R.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,w=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(o,100),function(){f=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),w!==null&&(w(),w=null)}}}function Vd(t){this._internalRoot=t}uu.prototype.render=Vd.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var o=r.current,f=In();F0(o,f,t,r,null,null)},uu.prototype.unmount=Vd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;F0(t.current,2,null,t,null,null),Vc(),r[Te]=null}};function uu(t){this._internalRoot=t}uu.prototype.unstable_scheduleHydration=function(t){if(t){var r=be();t={blockedOn:null,target:t,priority:r};for(var o=0;o<Qi.length&&r!==0&&r<Qi[o].priority;o++);Qi.splice(o,0,t),o===0&&K0(t)}};var Z0=n.version;if(Z0!=="19.2.3")throw Error(s(527,Z0,"19.2.3"));K.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=c(r),t=t!==null?v(t):null,t=t===null?null:t.stateNode,t};var fR={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hu.isDisabled&&hu.supportsFiber)try{lr=hu.inject(fR),gt=hu}catch{}}return sl.createRoot=function(t,r){if(!a(t))throw Error(s(299));var o=!1,f="",w=s_,R=o_,j=a_;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(f=r.identifierPrefix),r.onUncaughtError!==void 0&&(w=r.onUncaughtError),r.onCaughtError!==void 0&&(R=r.onCaughtError),r.onRecoverableError!==void 0&&(j=r.onRecoverableError)),r=I0(t,1,!1,null,null,o,f,null,w,R,j,Q0),t[Te]=r.current,Ed(t),new Vd(r)},sl.hydrateRoot=function(t,r,o){if(!a(t))throw Error(s(299));var f=!1,w="",R=s_,j=o_,Y=a_,te=null;return o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(w=o.identifierPrefix),o.onUncaughtError!==void 0&&(R=o.onUncaughtError),o.onCaughtError!==void 0&&(j=o.onCaughtError),o.onRecoverableError!==void 0&&(Y=o.onRecoverableError),o.formState!==void 0&&(te=o.formState)),r=I0(t,1,!0,r,o??null,f,w,te,R,j,Y,Q0),r.context=U0(null),o=r.current,f=In(),f=fe(f),w=ji(f),w.callback=null,Hi(o,w,f),o=f,r.current.lanes=o,Ar(r,o),Lr(r),t[Te]=r.current,Ed(t),new uu(r)},sl.version="19.2.3",sl}var ly;function xR(){if(ly)return Yd.exports;ly=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Yd.exports=SR(),Yd.exports}var wR=xR();const CR=ph(wR);var la=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ER={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},RR=class{#e=ER;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,n){return this.#e.setTimeout(e,n)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,n){return this.#e.setInterval(e,n)}clearInterval(e){this.#e.clearInterval(e)}},js=new RR;function AR(e){setTimeout(e,0)}var Fs=typeof window>"u"||"Deno"in globalThis;function pn(){}function DR(e,n){return typeof e=="function"?e(n):e}function Mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function YS(e,n){return Math.max(e+(n||0)-Date.now(),0)}function cs(e,n){return typeof e=="function"?e(n):e}function nr(e,n){return typeof e=="function"?e(n):e}function cy(e,n){const{type:i="all",exact:s,fetchStatus:a,predicate:h,queryKey:d,stale:l}=e;if(d){if(s){if(n.queryHash!==dp(d,n.options))return!1}else if(!Sl(n.queryKey,d))return!1}if(i!=="all"){const u=n.isActive();if(i==="active"&&!u||i==="inactive"&&u)return!1}return!(typeof l=="boolean"&&n.isStale()!==l||a&&a!==n.state.fetchStatus||h&&!h(n))}function uy(e,n){const{exact:i,status:s,predicate:a,mutationKey:h}=e;if(h){if(!n.options.mutationKey)return!1;if(i){if($s(n.options.mutationKey)!==$s(h))return!1}else if(!Sl(n.options.mutationKey,h))return!1}return!(s&&n.state.status!==s||a&&!a(n))}function dp(e,n){return(n?.queryKeyHashFn||$s)(e)}function $s(e){return JSON.stringify(e,(n,i)=>Om(i)?Object.keys(i).sort().reduce((s,a)=>(s[a]=i[a],s),{}):i)}function Sl(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(i=>Sl(e[i],n[i])):!1}var TR=Object.prototype.hasOwnProperty;function KS(e,n){if(e===n)return e;const i=hy(e)&&hy(n);if(!i&&!(Om(e)&&Om(n)))return n;const a=(i?e:Object.keys(e)).length,h=i?n:Object.keys(n),d=h.length,l=i?new Array(d):{};let u=0;for(let c=0;c<d;c++){const v=i?c:h[c],m=e[v],_=n[v];if(m===_){l[v]=m,(i?c<a:TR.call(e,v))&&u++;continue}if(m===null||_===null||typeof m!="object"||typeof _!="object"){l[v]=_;continue}const x=KS(m,_);l[v]=x,x===m&&u++}return a===d&&u===a?e:l}function Wu(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const i in e)if(e[i]!==n[i])return!1;return!0}function hy(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Om(e){if(!fy(e))return!1;const n=e.constructor;if(n===void 0)return!0;const i=n.prototype;return!(!fy(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function fy(e){return Object.prototype.toString.call(e)==="[object Object]"}function MR(e){return new Promise(n=>{js.setTimeout(n,e)})}function Lm(e,n,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,n):i.structuralSharing!==!1?KS(e,n):n}function OR(e,n,i=0){const s=[...e,n];return i&&s.length>i?s.slice(1):s}function LR(e,n,i=0){const s=[n,...e];return i&&s.length>i?s.slice(0,-1):s}var mp=Symbol();function GS(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===mp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function pp(e,n){return typeof e=="function"?e(...n):!!e}function NR(e,n,i){let s=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??=n(),s||(s=!0,a.aborted?i():a.addEventListener("abort",i,{once:!0})),a)}),e}var kR=class extends la{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Fs&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},gp=new kR;function Nm(){let e,n;const i=new Promise((a,h)=>{e=a,n=h});i.status="pending",i.catch(()=>{});function s(a){Object.assign(i,a),delete i.resolve,delete i.reject}return i.resolve=a=>{s({status:"fulfilled",value:a}),e(a)},i.reject=a=>{s({status:"rejected",reason:a}),n(a)},i}var BR=AR;function jR(){let e=[],n=0,i=l=>{l()},s=l=>{l()},a=BR;const h=l=>{n?e.push(l):a(()=>{i(l)})},d=()=>{const l=e;e=[],l.length&&a(()=>{s(()=>{l.forEach(u=>{i(u)})})})};return{batch:l=>{let u;n++;try{u=l()}finally{n--,n||d()}return u},batchCalls:l=>(...u)=>{h(()=>{l(...u)})},schedule:h,setNotifyFunction:l=>{i=l},setBatchNotifyFunction:l=>{s=l},setScheduler:l=>{a=l}}}var Yt=jR(),HR=class extends la{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Fs&&window.addEventListener){const n=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#e}},Yu=new HR;function PR(e){return Math.min(1e3*2**e,3e4)}function XS(e){return(e??"online")==="online"?Yu.isOnline():!0}var km=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function QS(e){let n=!1,i=0,s;const a=Nm(),h=()=>a.status!=="pending",d=S=>{if(!h()){const p=new km(S);_(p),e.onCancel?.(p)}},l=()=>{n=!0},u=()=>{n=!1},c=()=>gp.isFocused()&&(e.networkMode==="always"||Yu.isOnline())&&e.canRun(),v=()=>XS(e.networkMode)&&e.canRun(),m=S=>{h()||(s?.(),a.resolve(S))},_=S=>{h()||(s?.(),a.reject(S))},x=()=>new Promise(S=>{s=p=>{(h()||c())&&S(p)},e.onPause?.()}).then(()=>{s=void 0,h()||e.onContinue?.()}),C=()=>{if(h())return;let S;const p=i===0?e.initialPromise:void 0;try{S=p??e.fn()}catch(g){S=Promise.reject(g)}Promise.resolve(S).then(m).catch(g=>{if(h())return;const b=e.retry??(Fs?0:3),y=e.retryDelay??PR,E=typeof y=="function"?y(i,g):y,T=b===!0||typeof b=="number"&&i<b||typeof b=="function"&&b(i,g);if(n||!T){_(g);return}i++,e.onFail?.(i,g),MR(E).then(()=>c()?void 0:x()).then(()=>{n?_(g):C()})})};return{promise:a,status:()=>a.status,cancel:d,continue:()=>(s?.(),a),cancelRetry:l,continueRetry:u,canStart:v,start:()=>(v()?C():x().then(C),a)}}var ZS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Mm(this.gcTime)&&(this.#e=js.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fs?1/0:300*1e3))}clearGcTimeout(){this.#e&&(js.clearTimeout(this.#e),this.#e=void 0)}},zR=class extends ZS{#e;#t;#n;#i;#r;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=my(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=my(this.options);n.data!==void 0&&(this.setState(dy(n.data,n.dataUpdatedAt)),this.#e=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,n){const i=Lm(this.state.data,e,this.options);return this.#s({data:i,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),i}setState(e,n){this.#s({type:"setState",state:e,setStateOptions:n})}cancel(e){const n=this.#r?.promise;return this.#r?.cancel(e),n?n.then(pn).catch(pn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>nr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>cs(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!YS(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(u=>u.options.queryFn);l&&this.setOptions(l.options)}const i=new AbortController,s=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#a=!0,i.signal)})},a=()=>{const l=GS(this.options,n),c=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return s(v),v})();return this.#a=!1,this.options.persister?this.options.persister(l,c,this):l(c)},d=(()=>{const l={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:a};return s(l),l})();this.options.behavior?.onFetch(d,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#s({type:"fetch",meta:d.fetchOptions?.meta}),this.#r=QS({initialPromise:n?.initialPromise,fn:d.fetchFn,onCancel:l=>{l instanceof km&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),i.abort()},onFail:(l,u)=>{this.#s({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const l=await this.#r.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#n.config.onSuccess?.(l,this),this.#n.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof km){if(l.silent)return this.#r.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#s({type:"error",error:l}),this.#n.config.onError?.(l,this),this.#n.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#s(e){const n=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...JS(i.data,this.options),fetchMeta:e.meta??null};case"success":const s={...i,...dy(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const a=e.error;return{...i,error:a,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=n(this.state),Yt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function JS(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:XS(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function dy(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function my(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,i=n!==void 0,s=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var IR=class extends la{constructor(e,n){super(),this.options=n,this.#e=e,this.#s=null,this.#a=Nm(),this.bindMethods(),this.setOptions(n)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#o;#a;#s;#p;#f;#d;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),py(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Bm(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Bm(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const n=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof nr(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#t.setOptions(this.options),n._defaulted&&!Wu(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&gy(this.#t,i,this.options,n)&&this.#h(),this.updateResult(),s&&(this.#t!==i||nr(this.options.enabled,this.#t)!==nr(n.enabled,this.#t)||cs(this.options.staleTime,this.#t)!==cs(n.staleTime,this.#t))&&this.#g();const a=this.#v();s&&(this.#t!==i||nr(this.options.enabled,this.#t)!==nr(n.enabled,this.#t)||a!==this.#l)&&this.#_(a)}getOptimisticResult(e){const n=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(n,e);return FR(this,i)&&(this.#i=i,this.#o=this.options,this.#r=this.#t.state),i}getCurrentResult(){return this.#i}trackResult(e,n){return new Proxy(e,{get:(i,s)=>(this.trackProp(s),n?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,s))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#e.defaultQueryOptions(e),i=this.#e.getQueryCache().build(this.#e,n);return i.fetch().then(()=>this.createResult(i,n))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#h(e){this.#x();let n=this.#t.fetch(this.options,e);return e?.throwOnError||(n=n.catch(pn)),n}#g(){this.#b();const e=cs(this.options.staleTime,this.#t);if(Fs||this.#i.isStale||!Mm(e))return;const i=YS(this.#i.dataUpdatedAt,e)+1;this.#c=js.setTimeout(()=>{this.#i.isStale||this.updateResult()},i)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#_(e){this.#S(),this.#l=e,!(Fs||nr(this.options.enabled,this.#t)===!1||!Mm(this.#l)||this.#l===0)&&(this.#u=js.setInterval(()=>{(this.options.refetchIntervalInBackground||gp.isFocused())&&this.#h()},this.#l))}#y(){this.#g(),this.#_(this.#v())}#b(){this.#c&&(js.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(js.clearInterval(this.#u),this.#u=void 0)}createResult(e,n){const i=this.#t,s=this.options,a=this.#i,h=this.#r,d=this.#o,u=e!==i?e.state:this.#n,{state:c}=e;let v={...c},m=!1,_;if(n._optimisticResults){const A=this.hasListeners(),N=!A&&py(e,n),q=A&&gy(e,i,n,s);(N||q)&&(v={...v,...JS(c.data,e.options)}),n._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:C,status:S}=v;_=v.data;let p=!1;if(n.placeholderData!==void 0&&_===void 0&&S==="pending"){let A;a?.isPlaceholderData&&n.placeholderData===d?.placeholderData?(A=a.data,p=!0):A=typeof n.placeholderData=="function"?n.placeholderData(this.#d?.state.data,this.#d):n.placeholderData,A!==void 0&&(S="success",_=Lm(a?.data,A,n),m=!0)}if(n.select&&_!==void 0&&!p)if(a&&_===h?.data&&n.select===this.#p)_=this.#f;else try{this.#p=n.select,_=n.select(_),_=Lm(a?.data,_,n),this.#f=_,this.#s=null}catch(A){this.#s=A}this.#s&&(x=this.#s,_=this.#f,C=Date.now(),S="error");const g=v.fetchStatus==="fetching",b=S==="pending",y=S==="error",E=b&&g,T=_!==void 0,D={status:S,fetchStatus:v.fetchStatus,isPending:b,isSuccess:S==="success",isError:y,isInitialLoading:E,isLoading:E,data:_,dataUpdatedAt:v.dataUpdatedAt,error:x,errorUpdatedAt:C,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>u.dataUpdateCount||v.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!b,isLoadingError:y&&!T,isPaused:v.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:y&&T,isStale:vp(e,n),refetch:this.refetch,promise:this.#a,isEnabled:nr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=P=>{D.status==="error"?P.reject(D.error):D.data!==void 0&&P.resolve(D.data)},N=()=>{const P=this.#a=D.promise=Nm();A(P)},q=this.#a;switch(q.status){case"pending":e.queryHash===i.queryHash&&A(q);break;case"fulfilled":(D.status==="error"||D.data!==q.value)&&N();break;case"rejected":(D.status!=="error"||D.error!==q.reason)&&N();break}}return D}updateResult(){const e=this.#i,n=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#o=this.options,this.#r.data!==void 0&&(this.#d=this.#t),Wu(n,e))return;this.#i=n;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!this.#m.size)return!0;const h=new Set(a??this.#m);return this.options.throwOnError&&h.add("error"),Object.keys(this.#i).some(d=>{const l=d;return this.#i[l]!==e[l]&&h.has(l)})};this.#w({listeners:i()})}#x(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const n=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#w(e){Yt.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function UR(e,n){return nr(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&n.retryOnMount===!1)}function py(e,n){return UR(e,n)||e.state.data!==void 0&&Bm(e,n,n.refetchOnMount)}function Bm(e,n,i){if(nr(n.enabled,e)!==!1&&cs(n.staleTime,e)!=="static"){const s=typeof i=="function"?i(e):i;return s==="always"||s!==!1&&vp(e,n)}return!1}function gy(e,n,i,s){return(e!==n||nr(s.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&vp(e,i)}function vp(e,n){return nr(n.enabled,e)!==!1&&e.isStaleByTime(cs(n.staleTime,e))}function FR(e,n){return!Wu(e.getCurrentResult(),n)}function vy(e){return{onFetch:(n,i)=>{const s=n.options,a=n.fetchOptions?.meta?.fetchMore?.direction,h=n.state.data?.pages||[],d=n.state.data?.pageParams||[];let l={pages:[],pageParams:[]},u=0;const c=async()=>{let v=!1;const m=C=>{NR(C,()=>n.signal,()=>v=!0)},_=GS(n.options,n.fetchOptions),x=async(C,S,p)=>{if(v)return Promise.reject();if(S==null&&C.pages.length)return Promise.resolve(C);const b=(()=>{const O={client:n.client,queryKey:n.queryKey,pageParam:S,direction:p?"backward":"forward",meta:n.options.meta};return m(O),O})(),y=await _(b),{maxPages:E}=n.options,T=p?LR:OR;return{pages:T(C.pages,y,E),pageParams:T(C.pageParams,S,E)}};if(a&&h.length){const C=a==="backward",S=C?$R:_y,p={pages:h,pageParams:d},g=S(s,p);l=await x(p,g,C)}else{const C=e??h.length;do{const S=u===0?d[0]??s.initialPageParam:_y(s,l);if(u>0&&S==null)break;l=await x(l,S),u++}while(u<C)}return l};n.options.persister?n.fetchFn=()=>n.options.persister?.(c,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},i):n.fetchFn=c}}}function _y(e,{pages:n,pageParams:i}){const s=n.length-1;return n.length>0?e.getNextPageParam(n[s],n,i[s],i):void 0}function $R(e,{pages:n,pageParams:i}){return n.length>0?e.getPreviousPageParam?.(n[0],n,i[0],i):void 0}var VR=class extends ZS{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ex(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#r({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=QS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(h,d)=>{this.#r({type:"failed",failureCount:h,error:d})},onPause:()=>{this.#r({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",a=!this.#i.canStart();try{if(s)n();else{this.#r({type:"pending",variables:e,isPaused:a}),await this.#n.config.onMutate?.(e,this,i);const d=await this.options.onMutate?.(e,i);d!==this.state.context&&this.#r({type:"pending",context:d,variables:e,isPaused:a})}const h=await this.#i.start();return await this.#n.config.onSuccess?.(h,e,this.state.context,this,i),await this.options.onSuccess?.(h,e,this.state.context,i),await this.#n.config.onSettled?.(h,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(h,null,e,this.state.context,i),this.#r({type:"success",data:h}),h}catch(h){try{await this.#n.config.onError?.(h,e,this.state.context,this,i)}catch(d){Promise.reject(d)}try{await this.options.onError?.(h,e,this.state.context,i)}catch(d){Promise.reject(d)}try{await this.#n.config.onSettled?.(void 0,h,this.state.variables,this.state.context,this,i)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,h,e,this.state.context,i)}catch(d){Promise.reject(d)}throw this.#r({type:"error",error:h}),h}finally{this.#n.runNext(this)}}#r(e){const n=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Yt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function ex(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var qR=class extends la{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,i){const s=new VR({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:i});return this.add(s),s}add(e){this.#e.add(e);const n=fu(e);if(typeof n=="string"){const i=this.#t.get(n);i?i.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=fu(e);if(typeof n=="string"){const i=this.#t.get(n);if(i)if(i.length>1){const s=i.indexOf(e);s!==-1&&i.splice(s,1)}else i[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=fu(e);if(typeof n=="string"){const s=this.#t.get(n)?.find(a=>a.state.status==="pending");return!s||s===e}else return!0}runNext(e){const n=fu(e);return typeof n=="string"?this.#t.get(n)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Yt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(i=>uy(n,i))}findAll(e={}){return this.getAll().filter(n=>uy(e,n))}notify(e){Yt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Yt.batch(()=>Promise.all(e.map(n=>n.continue().catch(pn))))}};function fu(e){return e.options.scope?.id}var WR=class extends la{#e;#t=void 0;#n;#i;constructor(n,i){super(),this.#e=n,this.setOptions(i),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){const i=this.options;this.options=this.#e.defaultMutationOptions(n),Wu(this.options,i)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),i?.mutationKey&&this.options.mutationKey&&$s(i.mutationKey)!==$s(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(n){this.#r(),this.#o(n)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#o()}mutate(n,i){return this.#i=i,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(n)}#r(){const n=this.#n?.state??ex();this.#t={...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset}}#o(n){Yt.batch(()=>{if(this.#i&&this.hasListeners()){const i=this.#t.variables,s=this.#t.context,a={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(n?.type==="success"){try{this.#i.onSuccess?.(n.data,i,s,a)}catch(h){Promise.reject(h)}try{this.#i.onSettled?.(n.data,null,i,s,a)}catch(h){Promise.reject(h)}}else if(n?.type==="error"){try{this.#i.onError?.(n.error,i,s,a)}catch(h){Promise.reject(h)}try{this.#i.onSettled?.(void 0,n.error,i,s,a)}catch(h){Promise.reject(h)}}}this.listeners.forEach(i=>{i(this.#t)})})}},YR=class extends la{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){const s=n.queryKey,a=n.queryHash??dp(s,n);let h=this.get(a);return h||(h=new zR({client:e,queryKey:s,queryHash:a,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(s)}),this.add(h)),h}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Yt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(i=>cy(n,i))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(i=>cy(e,i)):n}notify(e){Yt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Yt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Yt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},KR=class{#e;#t;#n;#i;#r;#o;#a;#s;constructor(e={}){this.#e=e.queryCache||new YR,this.#t=e.mutationCache||new qR,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=gp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Yu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),i=this.#e.build(this,n),s=i.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(cs(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:i})=>{const s=i.data;return[n,s]})}setQueryData(e,n,i){const s=this.defaultQueryOptions({queryKey:e}),h=this.#e.get(s.queryHash)?.state.data,d=DR(n,h);if(d!==void 0)return this.#e.build(this,s).setData(d,{...i,manual:!0})}setQueriesData(e,n,i){return Yt.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,n,i)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;Yt.batch(()=>{n.findAll(e).forEach(i=>{n.remove(i)})})}resetQueries(e,n){const i=this.#e;return Yt.batch(()=>(i.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const i={revert:!0,...n},s=Yt.batch(()=>this.#e.findAll(e).map(a=>a.cancel(i)));return Promise.all(s).then(pn).catch(pn)}invalidateQueries(e,n={}){return Yt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const i={...n,cancelRefetch:n.cancelRefetch??!0},s=Yt.batch(()=>this.#e.findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let h=a.fetch(void 0,i);return i.throwOnError||(h=h.catch(pn)),a.state.fetchStatus==="paused"?Promise.resolve():h}));return Promise.all(s).then(pn)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const i=this.#e.build(this,n);return i.isStaleByTime(cs(n.staleTime,i))?i.fetch(n):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(pn).catch(pn)}fetchInfiniteQuery(e){return e.behavior=vy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(pn).catch(pn)}ensureInfiniteQueryData(e){return e.behavior=vy(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Yu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#i.set($s(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#i.values()],i={};return n.forEach(s=>{Sl(e,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(e,n){this.#r.set($s(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#r.values()],i={};return n.forEach(s=>{Sl(e,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=dp(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===mp&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},tx=L.createContext(void 0),Zs=e=>{const n=L.useContext(tx);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},GR=({client:e,children:n})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),M.jsx(tx.Provider,{value:e,children:n})),nx=L.createContext(!1),XR=()=>L.useContext(nx);nx.Provider;function QR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ZR=L.createContext(QR()),JR=()=>L.useContext(ZR),eA=(e,n,i)=>{const s=i?.state.error&&typeof e.throwOnError=="function"?pp(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(n.isReset()||(e.retryOnMount=!1))},tA=e=>{L.useEffect(()=>{e.clearReset()},[e])},nA=({result:e,errorResetBoundary:n,throwOnError:i,query:s,suspense:a})=>e.isError&&!n.isReset()&&!e.isFetching&&s&&(a&&e.data===void 0||pp(i,[e.error,s])),rA=e=>{if(e.suspense){const i=a=>a==="static"?a:Math.max(a??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...a)=>i(s(...a)):i(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},iA=(e,n)=>e.isLoading&&e.isFetching&&!n,sA=(e,n)=>e?.suspense&&n.isPending,yy=(e,n,i)=>n.fetchOptimistic(e).catch(()=>{i.clearReset()});function oA(e,n,i){const s=XR(),a=JR(),h=Zs(),d=h.defaultQueryOptions(e);h.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const l=h.getQueryCache().get(d.queryHash);d._optimisticResults=s?"isRestoring":"optimistic",rA(d),eA(d,a,l),tA(a);const u=!h.getQueryCache().get(d.queryHash),[c]=L.useState(()=>new n(h,d)),v=c.getOptimisticResult(d),m=!s&&e.subscribed!==!1;if(L.useSyncExternalStore(L.useCallback(_=>{const x=m?c.subscribe(Yt.batchCalls(_)):pn;return c.updateResult(),x},[c,m]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),L.useEffect(()=>{c.setOptions(d)},[d,c]),sA(d,v))throw yy(d,c,a);if(nA({result:v,errorResetBoundary:a,throwOnError:d.throwOnError,query:l,suspense:d.suspense}))throw v.error;return h.getDefaultOptions().queries?._experimental_afterQuery?.(d,v),d.experimental_prefetchInRender&&!Fs&&iA(v,s)&&(u?yy(d,c,a):l?.promise)?.catch(pn).finally(()=>{c.updateResult()}),d.notifyOnChangeProps?v:c.trackResult(v)}function vh(e,n){return oA(e,IR)}function zl(e,n){const i=Zs(),[s]=L.useState(()=>new WR(i,e));L.useEffect(()=>{s.setOptions(e)},[s,e]);const a=L.useSyncExternalStore(L.useCallback(d=>s.subscribe(Yt.batchCalls(d)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),h=L.useCallback((d,l)=>{s.mutate(d,l).catch(pn)},[s]);if(a.error&&pp(s.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:h,mutateAsync:a.mutate}}var rx=e=>{throw TypeError(e)},aA=(e,n,i)=>n.has(e)||rx("Cannot "+i),Qd=(e,n,i)=>(aA(e,n,"read from private field"),i?i.call(e):n.get(e)),lA=(e,n,i)=>n.has(e)?rx("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),by="popstate";function cA(e={}){function n(s,a){let{pathname:h,search:d,hash:l}=s.location;return xl("",{pathname:h,search:d,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function i(s,a){return typeof a=="string"?a:Fr(a)}return hA(n,i,null,e)}function Ve(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Nt(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function uA(){return Math.random().toString(36).substring(2,10)}function Sy(e,n){return{usr:e.state,key:e.key,idx:n}}function xl(e,n,i=null,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?ds(n):n,state:i,key:n&&n.key||s||uA()}}function Fr({pathname:e="/",search:n="",hash:i=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function ds(e){let n={};if(e){let i=e.indexOf("#");i>=0&&(n.hash=e.substring(i),e=e.substring(0,i));let s=e.indexOf("?");s>=0&&(n.search=e.substring(s),e=e.substring(0,s)),e&&(n.pathname=e)}return n}function hA(e,n,i,s={}){let{window:a=document.defaultView,v5Compat:h=!1}=s,d=a.history,l="POP",u=null,c=v();c==null&&(c=0,d.replaceState({...d.state,idx:c},""));function v(){return(d.state||{idx:null}).idx}function m(){l="POP";let p=v(),g=p==null?null:p-c;c=p,u&&u({action:l,location:S.location,delta:g})}function _(p,g){l="PUSH";let b=xl(S.location,p,g);c=v()+1;let y=Sy(b,c),E=S.createHref(b);try{d.pushState(y,"",E)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;a.location.assign(E)}h&&u&&u({action:l,location:S.location,delta:1})}function x(p,g){l="REPLACE";let b=xl(S.location,p,g);c=v();let y=Sy(b,c),E=S.createHref(b);d.replaceState(y,"",E),h&&u&&u({action:l,location:S.location,delta:0})}function C(p){return ix(p)}let S={get action(){return l},get location(){return e(a,d)},listen(p){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(by,m),u=p,()=>{a.removeEventListener(by,m),u=null}},createHref(p){return n(a,p)},createURL:C,encodeLocation(p){let g=C(p);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:_,replace:x,go(p){return d.go(p)}};return S}function ix(e,n=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),Ve(i,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Fr(e);return s=s.replace(/ $/,"%20"),!n&&s.startsWith("//")&&(s=i+s),new URL(s,i)}var fl,xy=class{constructor(e){if(lA(this,fl,new Map),e)for(let[n,i]of e)this.set(n,i)}get(e){if(Qd(this,fl).has(e))return Qd(this,fl).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,n){Qd(this,fl).set(e,n)}};fl=new WeakMap;var fA=new Set(["lazy","caseSensitive","path","id","index","children"]);function dA(e){return fA.has(e)}var mA=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function pA(e){return mA.has(e)}function gA(e){return e.index===!0}function wl(e,n,i=[],s={},a=!1){return e.map((h,d)=>{let l=[...i,String(d)],u=typeof h.id=="string"?h.id:l.join("-");if(Ve(h.index!==!0||!h.children,"Cannot specify children on an index route"),Ve(a||!s[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),gA(h)){let c={...h,id:u};return s[u]=wy(c,n(c)),c}else{let c={...h,id:u,children:void 0};return s[u]=wy(c,n(c)),h.children&&(c.children=wl(h.children,n,l,s,a)),c}})}function wy(e,n){return Object.assign(e,{...n,...typeof n.lazy=="object"&&n.lazy!=null?{lazy:{...e.lazy,...n.lazy}}:{}})}function rs(e,n,i="/"){return dl(e,n,i,!1)}function dl(e,n,i,s){let a=typeof n=="string"?ds(n):n,h=sr(a.pathname||"/",i);if(h==null)return null;let d=sx(e);_A(d);let l=null;for(let u=0;l==null&&u<d.length;++u){let c=TA(h);l=AA(d[u],c,s)}return l}function vA(e,n){let{route:i,pathname:s,params:a}=e;return{id:i.id,pathname:s,params:a,data:n[i.id],loaderData:n[i.id],handle:i.handle}}function sx(e,n=[],i=[],s="",a=!1){let h=(d,l,u=a,c)=>{let v={relativePath:c===void 0?d.path||"":c,caseSensitive:d.caseSensitive===!0,childrenIndex:l,route:d};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(s)&&u)return;Ve(v.relativePath.startsWith(s),`Absolute route path "${v.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(s.length)}let m=zr([s,v.relativePath]),_=i.concat(v);d.children&&d.children.length>0&&(Ve(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),sx(d.children,n,_,m,u)),!(d.path==null&&!d.index)&&n.push({path:m,score:EA(m,d.index),routesMeta:_})};return e.forEach((d,l)=>{if(d.path===""||!d.path?.includes("?"))h(d,l);else for(let u of ox(d.path))h(d,l,!0,u)}),n}function ox(e){let n=e.split("/");if(n.length===0)return[];let[i,...s]=n,a=i.endsWith("?"),h=i.replace(/\?$/,"");if(s.length===0)return a?[h,""]:[h];let d=ox(s.join("/")),l=[];return l.push(...d.map(u=>u===""?h:[h,u].join("/"))),a&&l.push(...d),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function _A(e){e.sort((n,i)=>n.score!==i.score?i.score-n.score:RA(n.routesMeta.map(s=>s.childrenIndex),i.routesMeta.map(s=>s.childrenIndex)))}var yA=/^:[\w-]+$/,bA=3,SA=2,xA=1,wA=10,CA=-2,Cy=e=>e==="*";function EA(e,n){let i=e.split("/"),s=i.length;return i.some(Cy)&&(s+=CA),n&&(s+=SA),i.filter(a=>!Cy(a)).reduce((a,h)=>a+(yA.test(h)?bA:h===""?xA:wA),s)}function RA(e,n){return e.length===n.length&&e.slice(0,-1).every((s,a)=>s===n[a])?e[e.length-1]-n[n.length-1]:0}function AA(e,n,i=!1){let{routesMeta:s}=e,a={},h="/",d=[];for(let l=0;l<s.length;++l){let u=s[l],c=l===s.length-1,v=h==="/"?n:n.slice(h.length)||"/",m=Ku({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},v),_=u.route;if(!m&&c&&i&&!s[s.length-1].route.index&&(m=Ku({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},v)),!m)return null;Object.assign(a,m.params),d.push({params:a,pathname:zr([h,m.pathname]),pathnameBase:LA(zr([h,m.pathnameBase])),route:_}),m.pathnameBase!=="/"&&(h=zr([h,m.pathnameBase]))}return d}function Ku(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[i,s]=DA(e.path,e.caseSensitive,e.end),a=n.match(i);if(!a)return null;let h=a[0],d=h.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:s.reduce((c,{paramName:v,isOptional:m},_)=>{if(v==="*"){let C=l[_]||"";d=h.slice(0,h.length-C.length).replace(/(.)\/+$/,"$1")}const x=l[_];return m&&!x?c[v]=void 0:c[v]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:h,pathnameBase:d,pattern:e}}function DA(e,n=!1,i=!0){Nt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,l,u)=>(s.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,n?void 0:"i"),s]}function TA(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Nt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function sr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let i=n.endsWith("/")?n.length-1:n.length,s=e.charAt(i);return s&&s!=="/"?null:e.slice(i)||"/"}function MA({basename:e,pathname:n}){return n==="/"?e:zr([e,n])}var ax=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_h=e=>ax.test(e);function OA(e,n="/"){let{pathname:i,search:s="",hash:a=""}=typeof e=="string"?ds(e):e,h;if(i)if(_h(i))h=i;else{if(i.includes("//")){let d=i;i=i.replace(/\/\/+/g,"/"),Nt(!1,`Pathnames cannot have embedded double slashes - normalizing ${d} -> ${i}`)}i.startsWith("/")?h=Ey(i.substring(1),"/"):h=Ey(i,n)}else h=n;return{pathname:h,search:NA(s),hash:kA(a)}}function Ey(e,n){let i=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?i.length>1&&i.pop():a!=="."&&i.push(a)}),i.length>1?i.join("/"):"/"}function Zd(e,n,i,s){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function lx(e){return e.filter((n,i)=>i===0||n.route.path&&n.route.path.length>0)}function _p(e){let n=lx(e);return n.map((i,s)=>s===n.length-1?i.pathname:i.pathnameBase)}function yp(e,n,i,s=!1){let a;typeof e=="string"?a=ds(e):(a={...e},Ve(!a.pathname||!a.pathname.includes("?"),Zd("?","pathname","search",a)),Ve(!a.pathname||!a.pathname.includes("#"),Zd("#","pathname","hash",a)),Ve(!a.search||!a.search.includes("#"),Zd("#","search","hash",a)));let h=e===""||a.pathname==="",d=h?"/":a.pathname,l;if(d==null)l=i;else{let m=n.length-1;if(!s&&d.startsWith("..")){let _=d.split("/");for(;_[0]==="..";)_.shift(),m-=1;a.pathname=_.join("/")}l=m>=0?n[m]:"/"}let u=OA(a,l),c=d&&d!=="/"&&d.endsWith("/"),v=(h||d===".")&&i.endsWith("/");return!u.pathname.endsWith("/")&&(c||v)&&(u.pathname+="/"),u}var zr=e=>e.join("/").replace(/\/\/+/g,"/"),LA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),NA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Il=class{constructor(e,n,i,s=!1){this.status=e,this.statusText=n||"",this.internal=s,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Cl(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Ul(e){return e.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var cx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ux(e,n){let i=e;if(typeof i!="string"||!ax.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let s=i,a=!1;if(cx)try{let h=new URL(window.location.href),d=i.startsWith("//")?new URL(h.protocol+i):new URL(i),l=sr(d.pathname,n);d.origin===h.origin&&l!=null?i=l+d.search+d.hash:a=!0}catch{Nt(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:a,to:i}}var os=Symbol("Uninstrumented");function BA(e,n){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:n.id,index:n.index,path:n.path,instrument(h){let d=Object.keys(i);for(let l of d)h[l]&&i[l].push(h[l])}}));let s={};if(typeof n.lazy=="function"&&i.lazy.length>0){let a=Wo(i.lazy,n.lazy,()=>{});a&&(s.lazy=a)}if(typeof n.lazy=="object"){let a=n.lazy;["middleware","loader","action"].forEach(h=>{let d=a[h],l=i[`lazy.${h}`];if(typeof d=="function"&&l.length>0){let u=Wo(l,d,()=>{});u&&(s.lazy=Object.assign(s.lazy||{},{[h]:u}))}})}return["loader","action"].forEach(a=>{let h=n[a];if(typeof h=="function"&&i[a].length>0){let d=h[os]??h,l=Wo(i[a],d,(...u)=>Ry(u[0]));l&&(l[os]=d,s[a]=l)}}),n.middleware&&n.middleware.length>0&&i.middleware.length>0&&(s.middleware=n.middleware.map(a=>{let h=a[os]??a,d=Wo(i.middleware,h,(...l)=>Ry(l[0]));return d?(d[os]=h,d):a})),s}function jA(e,n){let i={navigate:[],fetch:[]};if(n.forEach(s=>s({instrument(a){let h=Object.keys(a);for(let d of h)a[d]&&i[d].push(a[d])}})),i.navigate.length>0){let s=e.navigate[os]??e.navigate,a=Wo(i.navigate,s,(...h)=>{let[d,l]=h;return{to:typeof d=="number"||typeof d=="string"?d:d?Fr(d):".",...Ay(e,l??{})}});a&&(a[os]=s,e.navigate=a)}if(i.fetch.length>0){let s=e.fetch[os]??e.fetch,a=Wo(i.fetch,s,(...h)=>{let[d,,l,u]=h;return{href:l??".",fetcherKey:d,...Ay(e,u??{})}});a&&(a[os]=s,e.fetch=a)}return e}function Wo(e,n,i){return e.length===0?null:async(...s)=>{let a=await hx(e,i(...s),()=>n(...s),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function hx(e,n,i,s){let a=e[s],h;if(a){let d,l=async()=>(d?console.error("You cannot call instrumented handlers more than once"):d=hx(e,n,i,s-1),h=await d,Ve(h,"Expected a result"),h.type==="error"&&h.value instanceof Error?{status:"error",error:h.value}:{status:"success",error:void 0});try{await a(l,n)}catch(u){console.error("An instrumentation function threw an error:",u)}d||await l(),await d}else try{h={type:"success",value:await i()}}catch(d){h={type:"error",value:d}}return h||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Ry(e){let{request:n,context:i,params:s,unstable_pattern:a}=e;return{request:HA(n),params:{...s},unstable_pattern:a,context:PA(i)}}function Ay(e,n){return{currentUrl:Fr(e.state.location),..."formMethod"in n?{formMethod:n.formMethod}:{},..."formEncType"in n?{formEncType:n.formEncType}:{},..."formData"in n?{formData:n.formData}:{},..."body"in n?{body:n.body}:{}}}function HA(e){return{method:e.method,url:e.url,headers:{get:(...n)=>e.headers.get(...n)}}}function PA(e){if(IA(e)){let n={...e};return Object.freeze(n),n}else return{get:n=>e.get(n)}}var zA=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function IA(e){if(e===null||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null||Object.getOwnPropertyNames(n).sort().join("\0")===zA}var fx=["POST","PUT","PATCH","DELETE"],UA=new Set(fx),FA=["GET",...fx],$A=new Set(FA),dx=new Set([301,302,303,307,308]),VA=new Set([307,308]),Jd={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},qA={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ol={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},WA=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),mx="remix-router-transitions",px=Symbol("ResetLoaderData");function YA(e){const n=e.window?e.window:typeof window<"u"?window:void 0,i=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u";Ve(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=e.hydrationRouteProperties||[],a=e.mapRouteProperties||WA,h=a;if(e.unstable_instrumentations){let ee=e.unstable_instrumentations;h=se=>({...a(se),...BA(ee.map(fe=>fe.route).filter(Boolean),se)})}let d={},l=wl(e.routes,h,void 0,d),u,c=e.basename||"/";c.startsWith("/")||(c=`/${c}`);let v=e.dataStrategy||ZA,m={...e.future},_=null,x=new Set,C=null,S=null,p=null,g=e.hydrationData!=null,b=rs(l,e.history.location,c),y=!1,E=null,T;if(b==null&&!e.patchRoutesOnNavigation){let ee=er(404,{pathname:e.history.location.pathname}),{matches:se,route:fe}=du(l);T=!0,b=se,E={[fe.id]:ee}}else if(b&&!e.hydrationData&&Qr(b,l,e.history.location.pathname).active&&(b=null),b)if(b.some(ee=>ee.route.lazy))T=!1;else if(!b.some(ee=>bp(ee.route)))T=!0;else{let ee=e.hydrationData?e.hydrationData.loaderData:null,se=e.hydrationData?e.hydrationData.errors:null;if(se){let fe=b.findIndex(ye=>se[ye.route.id]!==void 0);T=b.slice(0,fe+1).every(ye=>!Hm(ye.route,ee,se))}else T=b.every(fe=>!Hm(fe.route,ee,se))}else{T=!1,b=[];let ee=Qr(null,l,e.history.location.pathname);ee.active&&ee.matches&&(y=!0,b=ee.matches)}let O,D={historyAction:e.history.action,location:e.history.location,matches:b,initialized:T,navigation:Jd,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},A="POP",N=null,q=!1,P,z=!1,W=new Map,U=null,G=!1,H=!1,K=new Set,F=new Map,k=0,$=-1,B=new Map,I=new Set,Q=new Map,J=new Map,ae=new Set,Z=new Map,X,V=null;function ie(){if(_=e.history.listen(({action:ee,location:se,delta:fe})=>{if(X){X(),X=void 0;return}Nt(Z.size===0||fe!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ye=Kr({currentLocation:D.location,nextLocation:se,historyAction:ee});if(ye&&fe!=null){let be=new Promise(Me=>{X=Me});e.history.go(fe*-1),cr(ye,{state:"blocked",location:se,proceed(){cr(ye,{state:"proceeding",proceed:void 0,reset:void 0,location:se}),be.then(()=>e.history.go(fe))},reset(){let Me=new Map(D.blockers);Me.set(ye,ol),le({blockers:Me})}}),N?.resolve(),N=null;return}return ke(ee,se)}),i){gD(n,W);let ee=()=>vD(n,W);n.addEventListener("pagehide",ee),U=()=>n.removeEventListener("pagehide",ee)}return D.initialized||ke("POP",D.location,{initialHydration:!0}),O}function de(){_&&_(),U&&U(),x.clear(),P&&P.abort(),D.fetchers.forEach((ee,se)=>st(se)),D.blockers.forEach((ee,se)=>ro(se))}function re(ee){return x.add(ee),()=>x.delete(ee)}function le(ee,se={}){ee.matches&&(ee.matches=ee.matches.map(be=>{let Me=d[be.route.id],xe=be.route;return xe.element!==Me.element||xe.errorElement!==Me.errorElement||xe.hydrateFallbackElement!==Me.hydrateFallbackElement?{...be,route:Me}:be})),D={...D,...ee};let fe=[],ye=[];D.fetchers.forEach((be,Me)=>{be.state==="idle"&&(ae.has(Me)?fe.push(Me):ye.push(Me))}),ae.forEach(be=>{!D.fetchers.has(be)&&!F.has(be)&&fe.push(be)}),[...x].forEach(be=>be(D,{deletedFetchers:fe,newErrors:ee.errors??null,viewTransitionOpts:se.viewTransitionOpts,flushSync:se.flushSync===!0})),fe.forEach(be=>st(be)),ye.forEach(be=>D.fetchers.delete(be))}function _e(ee,se,{flushSync:fe}={}){let ye=D.actionData!=null&&D.navigation.formMethod!=null&&hn(D.navigation.formMethod)&&D.navigation.state==="loading"&&ee.state?._isRedirect!==!0,be;se.actionData?Object.keys(se.actionData).length>0?be=se.actionData:be=null:ye?be=D.actionData:be=null;let Me=se.loaderData?Hy(D.loaderData,se.loaderData,se.matches||[],se.errors):D.loaderData,xe=D.blockers;xe.size>0&&(xe=new Map(xe),xe.forEach((Be,Le)=>xe.set(Le,ol)));let Se=G?!1:io(ee,se.matches||D.matches),we=q===!0||D.navigation.formMethod!=null&&hn(D.navigation.formMethod)&&ee.state?._isRedirect!==!0;u&&(l=u,u=void 0),G||A==="POP"||(A==="PUSH"?e.history.push(ee,ee.state):A==="REPLACE"&&e.history.replace(ee,ee.state));let Te;if(A==="POP"){let Be=W.get(D.location.pathname);Be&&Be.has(ee.pathname)?Te={currentLocation:D.location,nextLocation:ee}:W.has(ee.pathname)&&(Te={currentLocation:ee,nextLocation:D.location})}else if(z){let Be=W.get(D.location.pathname);Be?Be.add(ee.pathname):(Be=new Set([ee.pathname]),W.set(D.location.pathname,Be)),Te={currentLocation:D.location,nextLocation:ee}}le({...se,actionData:be,loaderData:Me,historyAction:A,location:ee,initialized:!0,navigation:Jd,revalidation:"idle",restoreScrollPosition:Se,preventScrollReset:we,blockers:xe},{viewTransitionOpts:Te,flushSync:fe===!0}),A="POP",q=!1,z=!1,G=!1,H=!1,N?.resolve(),N=null,V?.resolve(),V=null}async function Ee(ee,se){if(N?.resolve(),N=null,typeof ee=="number"){N||(N=Uy());let qe=N.promise;return e.history.go(ee),qe}let fe=jm(D.location,D.matches,c,ee,se?.fromRouteId,se?.relative),{path:ye,submission:be,error:Me}=Dy(!1,fe,se),xe=D.location,Se=xl(D.location,ye,se&&se.state);Se={...Se,...e.history.encodeLocation(Se)};let we=se&&se.replace!=null?se.replace:void 0,Te="PUSH";we===!0?Te="REPLACE":we===!1||be!=null&&hn(be.formMethod)&&be.formAction===D.location.pathname+D.location.search&&(Te="REPLACE");let Be=se&&"preventScrollReset"in se?se.preventScrollReset===!0:void 0,Le=(se&&se.flushSync)===!0,Qe=Kr({currentLocation:xe,nextLocation:Se,historyAction:Te});if(Qe){cr(Qe,{state:"blocked",location:Se,proceed(){cr(Qe,{state:"proceeding",proceed:void 0,reset:void 0,location:Se}),Ee(ee,se)},reset(){let qe=new Map(D.blockers);qe.set(Qe,ol),le({blockers:qe})}});return}await ke(Te,Se,{submission:be,pendingError:Me,preventScrollReset:Be,replace:se&&se.replace,enableViewTransition:se&&se.viewTransition,flushSync:Le,callSiteDefaultShouldRevalidate:se&&se.unstable_defaultShouldRevalidate})}function He(){V||(V=Uy()),ln(),le({revalidation:"loading"});let ee=V.promise;return D.navigation.state==="submitting"?ee:D.navigation.state==="idle"?(ke(D.historyAction,D.location,{startUninterruptedRevalidation:!0}),ee):(ke(A||D.historyAction,D.navigation.location,{overrideNavigation:D.navigation,enableViewTransition:z===!0}),ee)}async function ke(ee,se,fe){P&&P.abort(),P=null,A=ee,G=(fe&&fe.startUninterruptedRevalidation)===!0,Xr(D.location,D.matches),q=(fe&&fe.preventScrollReset)===!0,z=(fe&&fe.enableViewTransition)===!0;let ye=u||l,be=fe&&fe.overrideNavigation,Me=fe?.initialHydration&&D.matches&&D.matches.length>0&&!y?D.matches:rs(ye,se,c),xe=(fe&&fe.flushSync)===!0;if(Me&&D.initialized&&!H&&oD(D.location,se)&&!(fe&&fe.submission&&hn(fe.submission.formMethod))){_e(se,{matches:Me},{flushSync:xe});return}let Se=Qr(Me,ye,se.pathname);if(Se.active&&Se.matches&&(Me=Se.matches),!Me){let{error:bt,notFoundMatches:St,route:We}=Er(se.pathname);_e(se,{matches:St,loaderData:{},errors:{[We.id]:bt}},{flushSync:xe});return}P=new AbortController;let we=qo(e.history,se,P.signal,fe&&fe.submission),Te=e.getContext?await e.getContext():new xy,Be;if(fe&&fe.pendingError)Be=[is(Me).route.id,{type:"error",error:fe.pendingError}];else if(fe&&fe.submission&&hn(fe.submission.formMethod)){let bt=await Ce(we,se,fe.submission,Me,Te,Se.active,fe&&fe.initialHydration===!0,{replace:fe.replace,flushSync:xe});if(bt.shortCircuited)return;if(bt.pendingActionResult){let[St,We]=bt.pendingActionResult;if(Un(We)&&Cl(We.error)&&We.error.status===404){P=null,_e(se,{matches:bt.matches,loaderData:{},errors:{[St]:We.error}});return}}Me=bt.matches||Me,Be=bt.pendingActionResult,be=em(se,fe.submission),xe=!1,Se.active=!1,we=qo(e.history,we.url,we.signal)}let{shortCircuited:Le,matches:Qe,loaderData:qe,errors:vt}=await $t(we,se,Me,Te,Se.active,be,fe&&fe.submission,fe&&fe.fetcherSubmission,fe&&fe.replace,fe&&fe.initialHydration===!0,xe,Be,fe&&fe.callSiteDefaultShouldRevalidate);Le||(P=null,_e(se,{matches:Qe||Me,...Py(Be),loaderData:qe,errors:vt}))}async function Ce(ee,se,fe,ye,be,Me,xe,Se={}){ln();let we=mD(se,fe);if(le({navigation:we},{flushSync:Se.flushSync===!0}),Me){let Le=await Rr(ye,se.pathname,ee.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){if(Le.partialMatches.length===0){let{matches:qe,route:vt}=du(l);return{matches:qe,pendingActionResult:[vt.id,{type:"error",error:Le.error}]}}let Qe=is(Le.partialMatches).route.id;return{matches:Le.partialMatches,pendingActionResult:[Qe,{type:"error",error:Le.error}]}}else if(Le.matches)ye=Le.matches;else{let{notFoundMatches:Qe,error:qe,route:vt}=Er(se.pathname);return{matches:Qe,pendingActionResult:[vt.id,{type:"error",error:qe}]}}}let Te,Be=Bu(ye,se);if(!Be.route.action&&!Be.route.lazy)Te={type:"error",error:er(405,{method:ee.method,pathname:se.pathname,routeId:Be.route.id})};else{let Le=Go(h,d,ee,ye,Be,xe?[]:s,be),Qe=await Et(ee,Le,be,null);if(Te=Qe[Be.route.id],!Te){for(let qe of ye)if(Qe[qe.route.id]){Te=Qe[qe.route.id];break}}if(ee.signal.aborted)return{shortCircuited:!0}}if(Hs(Te)){let Le;return Se&&Se.replace!=null?Le=Se.replace:Le=ky(Te.response.headers.get("Location"),new URL(ee.url),c)===D.location.pathname+D.location.search,await it(ee,Te,!0,{submission:fe,replace:Le}),{shortCircuited:!0}}if(Un(Te)){let Le=is(ye,Be.route.id);return(Se&&Se.replace)!==!0&&(A="PUSH"),{matches:ye,pendingActionResult:[Le.route.id,Te,Be.route.id]}}return{matches:ye,pendingActionResult:[Be.route.id,Te]}}async function $t(ee,se,fe,ye,be,Me,xe,Se,we,Te,Be,Le,Qe){let qe=Me||em(se,xe),vt=xe||Se||Iy(qe),bt=!G&&!Te;if(be){if(bt){let Rt=Bt(Le);le({navigation:qe,...Rt!==void 0?{actionData:Rt}:{}},{flushSync:Be})}let Ye=await Rr(fe,se.pathname,ee.signal);if(Ye.type==="aborted")return{shortCircuited:!0};if(Ye.type==="error"){if(Ye.partialMatches.length===0){let{matches:Nn,route:Vt}=du(l);return{matches:Nn,loaderData:{},errors:{[Vt.id]:Ye.error}}}let Rt=is(Ye.partialMatches).route.id;return{matches:Ye.partialMatches,loaderData:{},errors:{[Rt]:Ye.error}}}else if(Ye.matches)fe=Ye.matches;else{let{error:Rt,notFoundMatches:Nn,route:Vt}=Er(se.pathname);return{matches:Nn,loaderData:{},errors:{[Vt.id]:Rt}}}}let St=u||l,{dsMatches:We,revalidatingFetchers:Mt}=Ty(ee,ye,h,d,e.history,D,fe,vt,se,Te?[]:s,Te===!0,H,K,ae,Q,I,St,c,e.patchRoutesOnNavigation!=null,Le,Qe);if($=++k,!e.dataStrategy&&!We.some(Ye=>Ye.shouldLoad)&&!We.some(Ye=>Ye.route.middleware&&Ye.route.middleware.length>0)&&Mt.length===0){let Ye=Zt();return _e(se,{matches:fe,loaderData:{},errors:Le&&Un(Le[1])?{[Le[0]]:Le[1].error}:null,...Py(Le),...Ye?{fetchers:new Map(D.fetchers)}:{}},{flushSync:Be}),{shortCircuited:!0}}if(bt){let Ye={};if(!be){Ye.navigation=qe;let Rt=Bt(Le);Rt!==void 0&&(Ye.actionData=Rt)}Mt.length>0&&(Ye.fetchers=tn(Mt)),le(Ye,{flushSync:Be})}Mt.forEach(Ye=>{gt(Ye.key),Ye.controller&&F.set(Ye.key,Ye.controller)});let cn=()=>Mt.forEach(Ye=>gt(Ye.key));P&&P.signal.addEventListener("abort",cn);let{loaderResults:mt,fetcherResults:On}=await Gt(We,Mt,ee,ye);if(ee.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",cn),Mt.forEach(Ye=>F.delete(Ye.key));let dn=mu(mt);if(dn)return await it(ee,dn.result,!0,{replace:we}),{shortCircuited:!0};if(dn=mu(On),dn)return I.add(dn.key),await it(ee,dn.result,!0,{replace:we}),{shortCircuited:!0};let{loaderData:Ln,errors:yn}=jy(D,fe,mt,Le,Mt,On);Te&&D.errors&&(yn={...D.errors,...yn});let hr=Zt(),Dr=no($),Zr=hr||Dr||Mt.length>0;return{matches:fe,loaderData:Ln,errors:yn,...Zr?{fetchers:new Map(D.fetchers)}:{}}}function Bt(ee){if(ee&&!Un(ee[1]))return{[ee[0]]:ee[1].data};if(D.actionData)return Object.keys(D.actionData).length===0?null:D.actionData}function tn(ee){return ee.forEach(se=>{let fe=D.fetchers.get(se.key),ye=al(void 0,fe?fe.data:void 0);D.fetchers.set(se.key,ye)}),new Map(D.fetchers)}async function fn(ee,se,fe,ye){gt(ee);let be=(ye&&ye.flushSync)===!0,Me=u||l,xe=jm(D.location,D.matches,c,fe,se,ye?.relative),Se=rs(Me,xe,c),we=Qr(Se,Me,xe);if(we.active&&we.matches&&(Se=we.matches),!Se){Xt(ee,se,er(404,{pathname:xe}),{flushSync:be});return}let{path:Te,submission:Be,error:Le}=Dy(!0,xe,ye);if(Le){Xt(ee,se,Le,{flushSync:be});return}let Qe=e.getContext?await e.getContext():new xy,qe=(ye&&ye.preventScrollReset)===!0;if(Be&&hn(Be.formMethod)){await _n(ee,se,Te,Se,Qe,we.active,be,qe,Be,ye&&ye.unstable_defaultShouldRevalidate);return}Q.set(ee,{routeId:se,path:Te}),await At(ee,se,Te,Se,Qe,we.active,be,qe,Be)}async function _n(ee,se,fe,ye,be,Me,xe,Se,we,Te){ln(),Q.delete(ee);let Be=D.fetchers.get(ee);dt(ee,pD(we,Be),{flushSync:xe});let Le=new AbortController,Qe=qo(e.history,fe,Le.signal,we);if(Me){let Ke=await Rr(ye,new URL(Qe.url).pathname,Qe.signal,ee);if(Ke.type==="aborted")return;if(Ke.type==="error"){Xt(ee,se,Ke.error,{flushSync:xe});return}else if(Ke.matches)ye=Ke.matches;else{Xt(ee,se,er(404,{pathname:fe}),{flushSync:xe});return}}let qe=Bu(ye,fe);if(!qe.route.action&&!qe.route.lazy){let Ke=er(405,{method:we.formMethod,pathname:fe,routeId:se});Xt(ee,se,Ke,{flushSync:xe});return}F.set(ee,Le);let vt=k,bt=Go(h,d,Qe,ye,qe,s,be),St=await Et(Qe,bt,be,ee),We=St[qe.route.id];if(!We){for(let Ke of bt)if(St[Ke.route.id]){We=St[Ke.route.id];break}}if(Qe.signal.aborted){F.get(ee)===Le&&F.delete(ee);return}if(ae.has(ee)){if(Hs(We)||Un(We)){dt(ee,bi(void 0));return}}else{if(Hs(We))if(F.delete(ee),$>vt){dt(ee,bi(void 0));return}else return I.add(ee),dt(ee,al(we)),it(Qe,We,!1,{fetcherSubmission:we,preventScrollReset:Se});if(Un(We)){Xt(ee,se,We.error);return}}let Mt=D.navigation.location||D.location,cn=qo(e.history,Mt,Le.signal),mt=u||l,On=D.navigation.state!=="idle"?rs(mt,D.navigation.location,c):D.matches;Ve(On,"Didn't find any matches after fetcher action");let dn=++k;B.set(ee,dn);let Ln=al(we,We.data);D.fetchers.set(ee,Ln);let{dsMatches:yn,revalidatingFetchers:hr}=Ty(cn,be,h,d,e.history,D,On,we,Mt,s,!1,H,K,ae,Q,I,mt,c,e.patchRoutesOnNavigation!=null,[qe.route.id,We],Te);hr.filter(Ke=>Ke.key!==ee).forEach(Ke=>{let Jr=Ke.key,oo=D.fetchers.get(Jr),Ti=al(void 0,oo?oo.data:void 0);D.fetchers.set(Jr,Ti),gt(Jr),Ke.controller&&F.set(Jr,Ke.controller)}),le({fetchers:new Map(D.fetchers)});let Dr=()=>hr.forEach(Ke=>gt(Ke.key));Le.signal.addEventListener("abort",Dr);let{loaderResults:Zr,fetcherResults:Ye}=await Gt(yn,hr,cn,be);if(Le.signal.aborted)return;if(Le.signal.removeEventListener("abort",Dr),B.delete(ee),F.delete(ee),hr.forEach(Ke=>F.delete(Ke.key)),D.fetchers.has(ee)){let Ke=bi(We.data);D.fetchers.set(ee,Ke)}let Rt=mu(Zr);if(Rt)return it(cn,Rt.result,!1,{preventScrollReset:Se});if(Rt=mu(Ye),Rt)return I.add(Rt.key),it(cn,Rt.result,!1,{preventScrollReset:Se});let{loaderData:Nn,errors:Vt}=jy(D,On,Zr,void 0,hr,Ye);no(dn),D.navigation.state==="loading"&&dn>$?(Ve(A,"Expected pending action"),P&&P.abort(),_e(D.navigation.location,{matches:On,loaderData:Nn,errors:Vt,fetchers:new Map(D.fetchers)})):(le({errors:Vt,loaderData:Hy(D.loaderData,Nn,On,Vt),fetchers:new Map(D.fetchers)}),H=!1)}async function At(ee,se,fe,ye,be,Me,xe,Se,we){let Te=D.fetchers.get(ee);dt(ee,al(we,Te?Te.data:void 0),{flushSync:xe});let Be=new AbortController,Le=qo(e.history,fe,Be.signal);if(Me){let We=await Rr(ye,new URL(Le.url).pathname,Le.signal,ee);if(We.type==="aborted")return;if(We.type==="error"){Xt(ee,se,We.error,{flushSync:xe});return}else if(We.matches)ye=We.matches;else{Xt(ee,se,er(404,{pathname:fe}),{flushSync:xe});return}}let Qe=Bu(ye,fe);F.set(ee,Be);let qe=k,vt=Go(h,d,Le,ye,Qe,s,be),St=(await Et(Le,vt,be,ee))[Qe.route.id];if(F.get(ee)===Be&&F.delete(ee),!Le.signal.aborted){if(ae.has(ee)){dt(ee,bi(void 0));return}if(Hs(St))if($>qe){dt(ee,bi(void 0));return}else{I.add(ee),await it(Le,St,!1,{preventScrollReset:Se});return}if(Un(St)){Xt(ee,se,St.error);return}dt(ee,bi(St.data))}}async function it(ee,se,fe,{submission:ye,fetcherSubmission:be,preventScrollReset:Me,replace:xe}={}){fe||(N?.resolve(),N=null),se.response.headers.has("X-Remix-Revalidate")&&(H=!0);let Se=se.response.headers.get("Location");Ve(Se,"Expected a Location header on the redirect Response"),Se=ky(Se,new URL(ee.url),c);let we=xl(D.location,Se,{_isRedirect:!0});if(i){let vt=!1;if(se.response.headers.has("X-Remix-Reload-Document"))vt=!0;else if(_h(Se)){const bt=ix(Se,!0);vt=bt.origin!==n.location.origin||sr(bt.pathname,c)==null}if(vt){xe?n.location.replace(Se):n.location.assign(Se);return}}P=null;let Te=xe===!0||se.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Be,formAction:Le,formEncType:Qe}=D.navigation;!ye&&!be&&Be&&Le&&Qe&&(ye=Iy(D.navigation));let qe=ye||be;if(VA.has(se.response.status)&&qe&&hn(qe.formMethod))await ke(Te,we,{submission:{...qe,formAction:Se},preventScrollReset:Me||q,enableViewTransition:fe?z:void 0});else{let vt=em(we,ye);await ke(Te,we,{overrideNavigation:vt,fetcherSubmission:be,preventScrollReset:Me||q,enableViewTransition:fe?z:void 0})}}async function Et(ee,se,fe,ye){let be,Me={};try{be=await eD(v,ee,se,ye,fe,!1)}catch(xe){return se.filter(Se=>Se.shouldLoad).forEach(Se=>{Me[Se.route.id]={type:"error",error:xe}}),Me}if(ee.signal.aborted)return Me;if(!hn(ee.method))for(let xe of se){if(be[xe.route.id]?.type==="error")break;!be.hasOwnProperty(xe.route.id)&&!D.loaderData.hasOwnProperty(xe.route.id)&&(!D.errors||!D.errors.hasOwnProperty(xe.route.id))&&xe.shouldCallHandler()&&(be[xe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${xe.route.id}`)})}for(let[xe,Se]of Object.entries(be))if(uD(Se)){let we=Se.result;Me[xe]={type:"redirect",response:iD(we,ee,xe,se,c)}}else Me[xe]=await rD(Se);return Me}async function Gt(ee,se,fe,ye){let be=Et(fe,ee,ye,null),Me=Promise.all(se.map(async we=>{if(we.matches&&we.match&&we.request&&we.controller){let Be=(await Et(we.request,we.matches,ye,we.key))[we.match.route.id];return{[we.key]:Be}}else return Promise.resolve({[we.key]:{type:"error",error:er(404,{pathname:we.path})}})})),xe=await be,Se=(await Me).reduce((we,Te)=>Object.assign(we,Te),{});return{loaderResults:xe,fetcherResults:Se}}function ln(){H=!0,Q.forEach((ee,se)=>{F.has(se)&&K.add(se),gt(se)})}function dt(ee,se,fe={}){D.fetchers.set(ee,se),le({fetchers:new Map(D.fetchers)},{flushSync:(fe&&fe.flushSync)===!0})}function Xt(ee,se,fe,ye={}){let be=is(D.matches,se);st(ee),le({errors:{[be.route.id]:fe},fetchers:new Map(D.fetchers)},{flushSync:(ye&&ye.flushSync)===!0})}function Qt(ee){return J.set(ee,(J.get(ee)||0)+1),ae.has(ee)&&ae.delete(ee),D.fetchers.get(ee)||qA}function ar(ee,se){gt(ee,se?.reason),dt(ee,bi(null))}function st(ee){let se=D.fetchers.get(ee);F.has(ee)&&!(se&&se.state==="loading"&&B.has(ee))&>(ee),Q.delete(ee),B.delete(ee),I.delete(ee),ae.delete(ee),K.delete(ee),D.fetchers.delete(ee)}function lr(ee){let se=(J.get(ee)||0)-1;se<=0?(J.delete(ee),ae.add(ee)):J.set(ee,se),le({fetchers:new Map(D.fetchers)})}function gt(ee,se){let fe=F.get(ee);fe&&(fe.abort(se),F.delete(ee))}function Mn(ee){for(let se of ee){let fe=Qt(se),ye=bi(fe.data);D.fetchers.set(se,ye)}}function Zt(){let ee=[],se=!1;for(let fe of I){let ye=D.fetchers.get(fe);Ve(ye,`Expected fetcher: ${fe}`),ye.state==="loading"&&(I.delete(fe),ee.push(fe),se=!0)}return Mn(ee),se}function no(ee){let se=[];for(let[fe,ye]of B)if(ye<ee){let be=D.fetchers.get(fe);Ve(be,`Expected fetcher: ${fe}`),be.state==="loading"&&(gt(fe),B.delete(fe),se.push(fe))}return Mn(se),se.length>0}function ma(ee,se){let fe=D.blockers.get(ee)||ol;return Z.get(ee)!==se&&Z.set(ee,se),fe}function ro(ee){D.blockers.delete(ee),Z.delete(ee)}function cr(ee,se){let fe=D.blockers.get(ee)||ol;Ve(fe.state==="unblocked"&&se.state==="blocked"||fe.state==="blocked"&&se.state==="blocked"||fe.state==="blocked"&&se.state==="proceeding"||fe.state==="blocked"&&se.state==="unblocked"||fe.state==="proceeding"&&se.state==="unblocked",`Invalid blocker state transition: ${fe.state} -> ${se.state}`);let ye=new Map(D.blockers);ye.set(ee,se),le({blockers:ye})}function Kr({currentLocation:ee,nextLocation:se,historyAction:fe}){if(Z.size===0)return;Z.size>1&&Nt(!1,"A router only supports one blocker at a time");let ye=Array.from(Z.entries()),[be,Me]=ye[ye.length-1],xe=D.blockers.get(be);if(!(xe&&xe.state==="proceeding")&&Me({currentLocation:ee,nextLocation:se,historyAction:fe}))return be}function Er(ee){let se=er(404,{pathname:ee}),fe=u||l,{matches:ye,route:be}=du(fe);return{notFoundMatches:ye,route:be,error:se}}function ur(ee,se,fe){if(C=ee,p=se,S=fe||null,!g&&D.navigation===Jd){g=!0;let ye=io(D.location,D.matches);ye!=null&&le({restoreScrollPosition:ye})}return()=>{C=null,p=null,S=null}}function Gr(ee,se){return S&&S(ee,se.map(ye=>vA(ye,D.loaderData)))||ee.key}function Xr(ee,se){if(C&&p){let fe=Gr(ee,se);C[fe]=p()}}function io(ee,se){if(C){let fe=Gr(ee,se),ye=C[fe];if(typeof ye=="number")return ye}return null}function Qr(ee,se,fe){if(e.patchRoutesOnNavigation)if(ee){if(Object.keys(ee[0].params).length>0)return{active:!0,matches:dl(se,fe,c,!0)}}else return{active:!0,matches:dl(se,fe,c,!0)||[]};return{active:!1,matches:null}}async function Rr(ee,se,fe,ye){if(!e.patchRoutesOnNavigation)return{type:"success",matches:ee};let be=ee;for(;;){let Me=u==null,xe=u||l,Se=d;try{await e.patchRoutesOnNavigation({signal:fe,path:se,matches:be,fetcherKey:ye,patch:(Be,Le)=>{fe.aborted||My(Be,Le,xe,Se,h,!1)}})}catch(Be){return{type:"error",error:Be,partialMatches:be}}finally{Me&&!fe.aborted&&(l=[...l])}if(fe.aborted)return{type:"aborted"};let we=rs(xe,se,c),Te=null;if(we){if(Object.keys(we[0].params).length===0)return{type:"success",matches:we};if(Te=dl(xe,se,c,!0),!(Te&&be.length<Te.length&&Ar(be,Te.slice(0,be.length))))return{type:"success",matches:we}}if(Te||(Te=dl(xe,se,c,!0)),!Te||Ar(be,Te))return{type:"success",matches:null};be=Te}}function Ar(ee,se){return ee.length===se.length&&ee.every((fe,ye)=>fe.route.id===se[ye].route.id)}function pa(ee){d={},u=wl(ee,h,void 0,d)}function so(ee,se,fe=!1){let ye=u==null;My(ee,se,u||l,d,h,fe),ye&&(l=[...l],le({}))}return O={get basename(){return c},get future(){return m},get state(){return D},get routes(){return l},get window(){return n},initialize:ie,subscribe:re,enableScrollRestoration:ur,navigate:Ee,fetch:fn,revalidate:He,createHref:ee=>e.history.createHref(ee),encodeLocation:ee=>e.history.encodeLocation(ee),getFetcher:Qt,resetFetcher:ar,deleteFetcher:lr,dispose:de,getBlocker:ma,deleteBlocker:ro,patchRoutes:so,_internalFetchControllers:F,_internalSetRoutes:pa,_internalSetStateDoNotUseOrYouWillBreakYourApp(ee){le(ee)}},e.unstable_instrumentations&&(O=jA(O,e.unstable_instrumentations.map(ee=>ee.router).filter(Boolean))),O}function KA(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function jm(e,n,i,s,a,h){let d,l;if(a){d=[];for(let c of n)if(d.push(c),c.route.id===a){l=c;break}}else d=n,l=n[n.length-1];let u=yp(s||".",_p(d),sr(e.pathname,i)||e.pathname,h==="path");if(s==null&&(u.search=e.search,u.hash=e.hash),(s==null||s===""||s===".")&&l){let c=xp(u.search);if(l.route.index&&!c)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&c){let v=new URLSearchParams(u.search),m=v.getAll("index");v.delete("index"),m.filter(x=>x).forEach(x=>v.append("index",x));let _=v.toString();u.search=_?`?${_}`:""}}return i!=="/"&&(u.pathname=MA({basename:i,pathname:u.pathname})),Fr(u)}function Dy(e,n,i){if(!i||!KA(i))return{path:n};if(i.formMethod&&!dD(i.formMethod))return{path:n,error:er(405,{method:i.formMethod})};let s=()=>({path:n,error:er(400,{type:"invalid-body"})}),h=(i.formMethod||"get").toUpperCase(),d=Sx(n);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!hn(h))return s();let m=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((_,[x,C])=>`${_}${x}=${C}
|
|
10
|
-
`,""):String(i.body);return{path:n,submission:{formMethod:h,formAction:d,formEncType:i.formEncType,formData:void 0,json:void 0,text:m}}}else if(i.formEncType==="application/json"){if(!hn(h))return s();try{let m=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:n,submission:{formMethod:h,formAction:d,formEncType:i.formEncType,formData:void 0,json:m,text:void 0}}}catch{return s()}}}Ve(typeof FormData=="function","FormData is not available in this environment");let l,u;if(i.formData)l=zm(i.formData),u=i.formData;else if(i.body instanceof FormData)l=zm(i.body),u=i.body;else if(i.body instanceof URLSearchParams)l=i.body,u=By(l);else if(i.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(i.body),u=By(l)}catch{return s()}let c={formMethod:h,formAction:d,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(hn(c.formMethod))return{path:n,submission:c};let v=ds(n);return e&&v.search&&xp(v.search)&&l.append("index",""),v.search=`?${l}`,{path:Fr(v),submission:c}}function Ty(e,n,i,s,a,h,d,l,u,c,v,m,_,x,C,S,p,g,b,y,E){let T=y?Un(y[1])?y[1].error:y[1].data:void 0,O=a.createURL(h.location),D=a.createURL(u),A;if(v&&h.errors){let G=Object.keys(h.errors)[0];A=d.findIndex(H=>H.route.id===G)}else if(y&&Un(y[1])){let G=y[0];A=d.findIndex(H=>H.route.id===G)-1}let N=y?y[1].statusCode:void 0,q=N&&N>=400,P={currentUrl:O,currentParams:h.matches[0]?.params||{},nextUrl:D,nextParams:d[0].params,...l,actionResult:T,actionStatus:N},z=Ul(d),W=d.map((G,H)=>{let{route:K}=G,F=null;if(A!=null&&H>A?F=!1:K.lazy?F=!0:bp(K)?v?F=Hm(K,h.loaderData,h.errors):GA(h.loaderData,h.matches[H],G)&&(F=!0):F=!1,F!==null)return Pm(i,s,e,z,G,c,n,F);let k=!1;typeof E=="boolean"?k=E:q?k=!1:(m||O.pathname+O.search===D.pathname+D.search||O.search!==D.search||XA(h.matches[H],G))&&(k=!0);let $={...P,defaultShouldRevalidate:k},B=_l(G,$);return Pm(i,s,e,z,G,c,n,B,$,E)}),U=[];return C.forEach((G,H)=>{if(v||!d.some(J=>J.route.id===G.routeId)||x.has(H))return;let K=h.fetchers.get(H),F=K&&K.state!=="idle"&&K.data===void 0,k=rs(p,G.path,g);if(!k){if(b&&F)return;U.push({key:H,routeId:G.routeId,path:G.path,matches:null,match:null,request:null,controller:null});return}if(S.has(H))return;let $=Bu(k,G.path),B=new AbortController,I=qo(a,G.path,B.signal),Q=null;if(_.has(H))_.delete(H),Q=Go(i,s,I,k,$,c,n);else if(F)m&&(Q=Go(i,s,I,k,$,c,n));else{let J;typeof E=="boolean"?J=E:q?J=!1:J=m;let ae={...P,defaultShouldRevalidate:J};_l($,ae)&&(Q=Go(i,s,I,k,$,c,n,ae))}Q&&U.push({key:H,routeId:G.routeId,path:G.path,matches:Q,match:$,request:I,controller:B})}),{dsMatches:W,revalidatingFetchers:U}}function bp(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Hm(e,n,i){if(e.lazy)return!0;if(!bp(e))return!1;let s=n!=null&&e.id in n,a=i!=null&&i[e.id]!==void 0;return!s&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!s&&!a}function GA(e,n,i){let s=!n||i.route.id!==n.route.id,a=!e.hasOwnProperty(i.route.id);return s||a}function XA(e,n){let i=e.route.path;return e.pathname!==n.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==n.params["*"]}function _l(e,n){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(n);if(typeof i=="boolean")return i}return n.defaultShouldRevalidate}function My(e,n,i,s,a,h){let d;if(e){let c=s[e];Ve(c,`No route found to patch children into: routeId = ${e}`),c.children||(c.children=[]),d=c.children}else d=i;let l=[],u=[];if(n.forEach(c=>{let v=d.find(m=>gx(c,m));v?u.push({existingRoute:v,newRoute:c}):l.push(c)}),l.length>0){let c=wl(l,a,[e||"_","patch",String(d?.length||"0")],s);d.push(...c)}if(h&&u.length>0)for(let c=0;c<u.length;c++){let{existingRoute:v,newRoute:m}=u[c],_=v,[x]=wl([m],a,[],{},!0);Object.assign(_,{element:x.element?x.element:_.element,errorElement:x.errorElement?x.errorElement:_.errorElement,hydrateFallbackElement:x.hydrateFallbackElement?x.hydrateFallbackElement:_.hydrateFallbackElement})}}function gx(e,n){return"id"in e&&"id"in n&&e.id===n.id?!0:e.index===n.index&&e.path===n.path&&e.caseSensitive===n.caseSensitive?(!e.children||e.children.length===0)&&(!n.children||n.children.length===0)?!0:e.children.every((i,s)=>n.children?.some(a=>gx(i,a))):!1}var Oy=new WeakMap,vx=({key:e,route:n,manifest:i,mapRouteProperties:s})=>{let a=i[n.id];if(Ve(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let h=a.lazy[e];if(!h)return;let d=Oy.get(a);d||(d={},Oy.set(a,d));let l=d[e];if(l)return l;let u=(async()=>{let c=dA(e),m=a[e]!==void 0&&e!=="hasErrorBoundary";if(c)Nt(!c,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),d[e]=Promise.resolve();else if(m)Nt(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let _=await h();_!=null&&(Object.assign(a,{[e]:_}),Object.assign(a,s(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(_=>_===void 0)&&(a.lazy=void 0))})();return d[e]=u,u},Ly=new WeakMap;function QA(e,n,i,s,a){let h=i[e.id];if(Ve(h,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let v=Ly.get(h);if(v)return{lazyRoutePromise:v,lazyHandlerPromise:v};let m=(async()=>{Ve(typeof e.lazy=="function","No lazy route function found");let _=await e.lazy(),x={};for(let C in _){let S=_[C];if(S===void 0)continue;let p=pA(C),b=h[C]!==void 0&&C!=="hasErrorBoundary";p?Nt(!p,"Route property "+C+" is not a supported property to be returned from a lazy route function. This property will be ignored."):b?Nt(!b,`Route "${h.id}" has a static property "${C}" defined but its lazy function is also returning a value for this property. The lazy route property "${C}" will be ignored.`):x[C]=S}Object.assign(h,x),Object.assign(h,{...s(h),lazy:void 0})})();return Ly.set(h,m),m.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:m}}let d=Object.keys(e.lazy),l=[],u;for(let v of d){if(a&&a.includes(v))continue;let m=vx({key:v,route:e,manifest:i,mapRouteProperties:s});m&&(l.push(m),v===n&&(u=m))}let c=l.length>0?Promise.all(l).then(()=>{}):void 0;return c?.catch(()=>{}),u?.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:u}}async function Ny(e){let n=e.matches.filter(a=>a.shouldLoad),i={};return(await Promise.all(n.map(a=>a.resolve()))).forEach((a,h)=>{i[n[h].route.id]=a}),i}async function ZA(e){return e.matches.some(n=>n.route.middleware)?_x(e,()=>Ny(e)):Ny(e)}function _x(e,n){return JA(e,n,s=>{if(fD(s))throw s;return s},lD,i);function i(s,a,h){if(h)return Promise.resolve(Object.assign(h.value,{[a]:{type:"error",result:s}}));{let{matches:d}=e,l=Math.min(Math.max(d.findIndex(c=>c.route.id===a),0),Math.max(d.findIndex(c=>c.shouldCallHandler()),0)),u=is(d,d[l].route.id).route.id;return Promise.resolve({[u]:{type:"error",result:s}})}}}async function JA(e,n,i,s,a){let{matches:h,request:d,params:l,context:u,unstable_pattern:c}=e,v=h.flatMap(_=>_.route.middleware?_.route.middleware.map(x=>[_.route.id,x]):[]);return await yx({request:d,params:l,context:u,unstable_pattern:c},v,n,i,s,a)}async function yx(e,n,i,s,a,h,d=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let u=n[d];if(!u)return await i();let[c,v]=u,m,_=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");try{return m={value:await yx(e,n,i,s,a,h,d+1)},m.value}catch(x){return m={value:await h(x,c,m)},m.value}};try{let x=await v(e,_),C=x!=null?s(x):void 0;return a(C)?C:m?C??m.value:(m={value:await _()},m.value)}catch(x){return await h(x,c,m)}}function bx(e,n,i,s,a){let h=vx({key:"middleware",route:s.route,manifest:n,mapRouteProperties:e}),d=QA(s.route,hn(i.method)?"action":"loader",n,e,a);return{middleware:h,route:d.lazyRoutePromise,handler:d.lazyHandlerPromise}}function Pm(e,n,i,s,a,h,d,l,u=null,c){let v=!1,m=bx(e,n,i,a,h);return{...a,_lazyPromises:m,shouldLoad:l,shouldRevalidateArgs:u,shouldCallHandler(_){return v=!0,u?typeof c=="boolean"?_l(a,{...u,defaultShouldRevalidate:c}):typeof _=="boolean"?_l(a,{...u,defaultShouldRevalidate:_}):_l(a,u):l},resolve(_){let{lazy:x,loader:C,middleware:S}=a.route,p=v||l||_&&!hn(i.method)&&(x||C),g=S&&S.length>0&&!C&&!x;return p&&(hn(i.method)||!g)?tD({request:i,unstable_pattern:s,match:a,lazyHandlerPromise:m?.handler,lazyRoutePromise:m?.route,handlerOverride:_,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function Go(e,n,i,s,a,h,d,l=null){return s.map(u=>u.route.id!==a.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:bx(e,n,i,u,h),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Pm(e,n,i,Ul(s),u,h,d,!0,l))}async function eD(e,n,i,s,a,h){i.some(c=>c._lazyPromises?.middleware)&&await Promise.all(i.map(c=>c._lazyPromises?.middleware));let d={request:n,unstable_pattern:Ul(i),params:i[0].params,context:a,matches:i},u=await e({...d,fetcherKey:s,runClientMiddleware:c=>{let v=d;return _x(v,()=>c({...v,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(i.flatMap(c=>[c._lazyPromises?.handler,c._lazyPromises?.route]))}catch{}return u}async function tD({request:e,unstable_pattern:n,match:i,lazyHandlerPromise:s,lazyRoutePromise:a,handlerOverride:h,scopedContext:d}){let l,u,c=hn(e.method),v=c?"action":"loader",m=_=>{let x,C=new Promise((g,b)=>x=b);u=()=>x(),e.signal.addEventListener("abort",u);let S=g=>typeof _!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${i.route.id}]`)):_({request:e,unstable_pattern:n,params:i.params,context:d},...g!==void 0?[g]:[]),p=(async()=>{try{return{type:"data",result:await(h?h(b=>S(b)):S())}}catch(g){return{type:"error",result:g}}})();return Promise.race([p,C])};try{let _=c?i.route.action:i.route.loader;if(s||a)if(_){let x,[C]=await Promise.all([m(_).catch(S=>{x=S}),s,a]);if(x!==void 0)throw x;l=C}else{await s;let x=c?i.route.action:i.route.loader;if(x)[l]=await Promise.all([m(x),a]);else if(v==="action"){let C=new URL(e.url),S=C.pathname+C.search;throw er(405,{method:e.method,pathname:S,routeId:i.route.id})}else return{type:"data",result:void 0}}else if(_)l=await m(_);else{let x=new URL(e.url),C=x.pathname+x.search;throw er(404,{pathname:C})}}catch(_){return{type:"error",result:_}}finally{u&&e.signal.removeEventListener("abort",u)}return l}async function nD(e){let n=e.headers.get("Content-Type");return n&&/\bapplication\/json\b/.test(n)?e.body==null?null:e.json():e.text()}async function rD(e){let{result:n,type:i}=e;if(Sp(n)){let s;try{s=await nD(n)}catch(a){return{type:"error",error:a}}return i==="error"?{type:"error",error:new Il(n.status,n.statusText,s),statusCode:n.status,headers:n.headers}:{type:"data",data:s,statusCode:n.status,headers:n.headers}}return i==="error"?zy(n)?n.data instanceof Error?{type:"error",error:n.data,statusCode:n.init?.status,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"error",error:aD(n),statusCode:Cl(n)?n.status:void 0,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"error",error:n,statusCode:Cl(n)?n.status:void 0}:zy(n)?{type:"data",data:n.data,statusCode:n.init?.status,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"data",data:n}}function iD(e,n,i,s,a){let h=e.headers.get("Location");if(Ve(h,"Redirects returned/thrown from loaders/actions must have a Location header"),!_h(h)){let d=s.slice(0,s.findIndex(l=>l.route.id===i)+1);h=jm(new URL(n.url),d,a,h),e.headers.set("Location",h)}return e}function ky(e,n,i){if(_h(e)){let s=e,a=s.startsWith("//")?new URL(n.protocol+s):new URL(s),h=sr(a.pathname,i)!=null;if(a.origin===n.origin&&h)return a.pathname+a.search+a.hash}return e}function qo(e,n,i,s){let a=e.createURL(Sx(n)).toString(),h={signal:i};if(s&&hn(s.formMethod)){let{formMethod:d,formEncType:l}=s;h.method=d.toUpperCase(),l==="application/json"?(h.headers=new Headers({"Content-Type":l}),h.body=JSON.stringify(s.json)):l==="text/plain"?h.body=s.text:l==="application/x-www-form-urlencoded"&&s.formData?h.body=zm(s.formData):h.body=s.formData}return new Request(a,h)}function zm(e){let n=new URLSearchParams;for(let[i,s]of e.entries())n.append(i,typeof s=="string"?s:s.name);return n}function By(e){let n=new FormData;for(let[i,s]of e.entries())n.append(i,s);return n}function sD(e,n,i,s=!1,a=!1){let h={},d=null,l,u=!1,c={},v=i&&Un(i[1])?i[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in n))return;let _=m.route.id,x=n[_];if(Ve(!Hs(x),"Cannot handle redirect results in processLoaderData"),Un(x)){let C=x.error;if(v!==void 0&&(C=v,v=void 0),d=d||{},a)d[_]=C;else{let S=is(e,_);d[S.route.id]==null&&(d[S.route.id]=C)}s||(h[_]=px),u||(u=!0,l=Cl(x.error)?x.error.status:500),x.headers&&(c[_]=x.headers)}else h[_]=x.data,x.statusCode&&x.statusCode!==200&&!u&&(l=x.statusCode),x.headers&&(c[_]=x.headers)}),v!==void 0&&i&&(d={[i[0]]:v},i[2]&&(h[i[2]]=void 0)),{loaderData:h,errors:d,statusCode:l||200,loaderHeaders:c}}function jy(e,n,i,s,a,h){let{loaderData:d,errors:l}=sD(n,i,s);return a.filter(u=>!u.matches||u.matches.some(c=>c.shouldLoad)).forEach(u=>{let{key:c,match:v,controller:m}=u;if(m&&m.signal.aborted)return;let _=h[c];if(Ve(_,"Did not find corresponding fetcher result"),Un(_)){let x=is(e.matches,v?.route.id);l&&l[x.route.id]||(l={...l,[x.route.id]:_.error}),e.fetchers.delete(c)}else if(Hs(_))Ve(!1,"Unhandled fetcher revalidation redirect");else{let x=bi(_.data);e.fetchers.set(c,x)}}),{loaderData:d,errors:l}}function Hy(e,n,i,s){let a=Object.entries(n).filter(([,h])=>h!==px).reduce((h,[d,l])=>(h[d]=l,h),{});for(let h of i){let d=h.route.id;if(!n.hasOwnProperty(d)&&e.hasOwnProperty(d)&&h.route.loader&&(a[d]=e[d]),s&&s.hasOwnProperty(d))break}return a}function Py(e){return e?Un(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function is(e,n){return(n?e.slice(0,e.findIndex(s=>s.route.id===n)+1):[...e]).reverse().find(s=>s.route.hasErrorBoundary===!0)||e[0]}function du(e){let n=e.length===1?e[0]:e.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function er(e,{pathname:n,routeId:i,method:s,type:a,message:h}={}){let d="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(d="Bad Request",s&&n&&i?l=`You made a ${s} request to "${n}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:a==="invalid-body"&&(l="Unable to encode submission body")):e===403?(d="Forbidden",l=`Route "${i}" does not match URL "${n}"`):e===404?(d="Not Found",l=`No route matches URL "${n}"`):e===405&&(d="Method Not Allowed",s&&n&&i?l=`You made a ${s.toUpperCase()} request to "${n}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:s&&(l=`Invalid request method "${s.toUpperCase()}"`)),new Il(e||500,d,new Error(l),!0)}function mu(e){let n=Object.entries(e);for(let i=n.length-1;i>=0;i--){let[s,a]=n[i];if(Hs(a))return{key:s,result:a}}}function Sx(e){let n=typeof e=="string"?ds(e):e;return Fr({...n,hash:""})}function oD(e,n){return e.pathname!==n.pathname||e.search!==n.search?!1:e.hash===""?n.hash!=="":e.hash===n.hash?!0:n.hash!==""}function aD(e){return new Il(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function lD(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([n,i])=>typeof n=="string"&&cD(i))}function cD(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function uD(e){return Sp(e.result)&&dx.has(e.result.status)}function Un(e){return e.type==="error"}function Hs(e){return(e&&e.type)==="redirect"}function zy(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Sp(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function hD(e){return dx.has(e)}function fD(e){return Sp(e)&&hD(e.status)&&e.headers.has("Location")}function dD(e){return $A.has(e.toUpperCase())}function hn(e){return UA.has(e.toUpperCase())}function xp(e){return new URLSearchParams(e).getAll("index").some(n=>n==="")}function Bu(e,n){let i=typeof n=="string"?ds(n).search:n.search;if(e[e.length-1].route.index&&xp(i||""))return e[e.length-1];let s=lx(e);return s[s.length-1]}function Iy(e){let{formMethod:n,formAction:i,formEncType:s,text:a,formData:h,json:d}=e;if(!(!n||!i||!s)){if(a!=null)return{formMethod:n,formAction:i,formEncType:s,formData:void 0,json:void 0,text:a};if(h!=null)return{formMethod:n,formAction:i,formEncType:s,formData:h,json:void 0,text:void 0};if(d!==void 0)return{formMethod:n,formAction:i,formEncType:s,formData:void 0,json:d,text:void 0}}}function em(e,n){return n?{state:"loading",location:e,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function mD(e,n){return{state:"submitting",location:e,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}function al(e,n){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function pD(e,n){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n?n.data:void 0}}function bi(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function gD(e,n){try{let i=e.sessionStorage.getItem(mx);if(i){let s=JSON.parse(i);for(let[a,h]of Object.entries(s||{}))h&&Array.isArray(h)&&n.set(a,new Set(h||[]))}}catch{}}function vD(e,n){if(n.size>0){let i={};for(let[s,a]of n)i[s]=[...a];try{e.sessionStorage.setItem(mx,JSON.stringify(i))}catch(s){Nt(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function Uy(){let e,n,i=new Promise((s,a)=>{e=async h=>{s(h);try{await i}catch{}},n=async h=>{a(h);try{await i}catch{}}});return{promise:i,resolve:e,reject:n}}var Js=L.createContext(null);Js.displayName="DataRouter";var Fl=L.createContext(null);Fl.displayName="DataRouterState";var xx=L.createContext(!1);function _D(){return L.useContext(xx)}var wp=L.createContext({isTransitioning:!1});wp.displayName="ViewTransition";var wx=L.createContext(new Map);wx.displayName="Fetchers";var yD=L.createContext(null);yD.displayName="Await";var or=L.createContext(null);or.displayName="Navigation";var yh=L.createContext(null);yh.displayName="Location";var qr=L.createContext({outlet:null,matches:[],isDataRoute:!1});qr.displayName="Route";var Cp=L.createContext(null);Cp.displayName="RouteError";var Cx="REACT_ROUTER_ERROR",bD="REDIRECT",SD="ROUTE_ERROR_RESPONSE";function xD(e){if(e.startsWith(`${Cx}:${bD}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function wD(e){if(e.startsWith(`${Cx}:${SD}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Il(n.status,n.statusText,n.data)}catch{}}function CD(e,{relative:n}={}){Ve($l(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:s}=L.useContext(or),{hash:a,pathname:h,search:d}=Vl(e,{relative:n}),l=h;return i!=="/"&&(l=h==="/"?i:zr([i,h])),s.createHref({pathname:l,search:d,hash:a})}function $l(){return L.useContext(yh)!=null}function eo(){return Ve($l(),"useLocation() may be used only in the context of a <Router> component."),L.useContext(yh).location}var Ex="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Rx(e){L.useContext(or).static||L.useLayoutEffect(e)}function ED(){let{isDataRoute:e}=L.useContext(qr);return e?zD():RD()}function RD(){Ve($l(),"useNavigate() may be used only in the context of a <Router> component.");let e=L.useContext(Js),{basename:n,navigator:i}=L.useContext(or),{matches:s}=L.useContext(qr),{pathname:a}=eo(),h=JSON.stringify(_p(s)),d=L.useRef(!1);return Rx(()=>{d.current=!0}),L.useCallback((u,c={})=>{if(Nt(d.current,Ex),!d.current)return;if(typeof u=="number"){i.go(u);return}let v=yp(u,JSON.parse(h),a,c.relative==="path");e==null&&n!=="/"&&(v.pathname=v.pathname==="/"?n:zr([n,v.pathname])),(c.replace?i.replace:i.push)(v,c.state,c)},[n,i,h,a,e])}L.createContext(null);function AD(){let{matches:e}=L.useContext(qr),n=e[e.length-1];return n?n.params:{}}function Vl(e,{relative:n}={}){let{matches:i}=L.useContext(qr),{pathname:s}=eo(),a=JSON.stringify(_p(i));return L.useMemo(()=>yp(e,JSON.parse(a),s,n==="path"),[e,a,s,n])}function DD(e,n,i,s,a){Ve($l(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:h}=L.useContext(or),{matches:d}=L.useContext(qr),l=d[d.length-1],u=l?l.params:{},c=l?l.pathname:"/",v=l?l.pathnameBase:"/",m=l&&l.route;{let b=m&&m.path||"";Dx(c,!m||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${b}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
|
-
|
|
12
|
-
Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let _=eo(),x;x=_;let C=x.pathname||"/",S=C;if(v!=="/"){let b=v.replace(/^\//,"").split("/");S="/"+C.replace(/^\//,"").split("/").slice(b.length).join("/")}let p=rs(e,{pathname:S});return Nt(m||p!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Nt(p==null||p[p.length-1].route.element!==void 0||p[p.length-1].route.Component!==void 0||p[p.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),ND(p&&p.map(b=>Object.assign({},b,{params:Object.assign({},u,b.params),pathname:zr([v,h.encodeLocation?h.encodeLocation(b.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?v:zr([v,h.encodeLocation?h.encodeLocation(b.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),d,i,s,a)}function TD(){let e=PD(),n=Cl(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:s},h={padding:"2px 4px",backgroundColor:s},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=L.createElement(L.Fragment,null,L.createElement("p",null,"💿 Hey developer 👋"),L.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",L.createElement("code",{style:h},"ErrorBoundary")," or"," ",L.createElement("code",{style:h},"errorElement")," prop on your route.")),L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},n),i?L.createElement("pre",{style:a},i):null,d)}var MD=L.createElement(TD,null),Ax=class extends L.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const i=wD(e.digest);i&&(e=i)}let n=e!==void 0?L.createElement(qr.Provider,{value:this.props.routeContext},L.createElement(Cp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?L.createElement(OD,{error:e},n):n}};Ax.contextType=xx;var tm=new WeakMap;function OD({children:e,error:n}){let{basename:i}=L.useContext(or);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=xD(n.digest);if(s){let a=tm.get(n);if(a)throw a;let h=ux(s.location,i);if(cx&&!tm.get(n))if(h.isExternal||s.reloadDocument)window.location.href=h.absoluteURL||h.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(h.to,{replace:s.replace}));throw tm.set(n,d),d}return L.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h.absoluteURL||h.to}`})}}return e}function LD({routeContext:e,match:n,children:i}){let s=L.useContext(Js);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),L.createElement(qr.Provider,{value:e},i)}function ND(e,n=[],i=null,s=null,a=null){if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(n.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let h=e,d=i?.errors;if(d!=null){let v=h.findIndex(m=>m.route.id&&d?.[m.route.id]!==void 0);Ve(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),h=h.slice(0,Math.min(h.length,v+1))}let l=!1,u=-1;if(i)for(let v=0;v<h.length;v++){let m=h[v];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(u=v),m.route.id){let{loaderData:_,errors:x}=i,C=m.route.loader&&!_.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||C){l=!0,u>=0?h=h.slice(0,u+1):h=[h[0]];break}}}let c=i&&s?(v,m)=>{s(v,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:Ul(i.matches),errorInfo:m})}:void 0;return h.reduceRight((v,m,_)=>{let x,C=!1,S=null,p=null;i&&(x=d&&m.route.id?d[m.route.id]:void 0,S=m.route.errorElement||MD,l&&(u<0&&_===0?(Dx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,p=null):u===_&&(C=!0,p=m.route.hydrateFallbackElement||null)));let g=n.concat(h.slice(0,_+1)),b=()=>{let y;return x?y=S:C?y=p:m.route.Component?y=L.createElement(m.route.Component,null):m.route.element?y=m.route.element:y=v,L.createElement(LD,{match:m,routeContext:{outlet:v,matches:g,isDataRoute:i!=null},children:y})};return i&&(m.route.ErrorBoundary||m.route.errorElement||_===0)?L.createElement(Ax,{location:i.location,revalidation:i.revalidation,component:S,error:x,children:b(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:c}):b()},null)}function Ep(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kD(e){let n=L.useContext(Js);return Ve(n,Ep(e)),n}function BD(e){let n=L.useContext(Fl);return Ve(n,Ep(e)),n}function jD(e){let n=L.useContext(qr);return Ve(n,Ep(e)),n}function Rp(e){let n=jD(e),i=n.matches[n.matches.length-1];return Ve(i.route.id,`${e} can only be used on routes that contain a unique "id"`),i.route.id}function HD(){return Rp("useRouteId")}function PD(){let e=L.useContext(Cp),n=BD("useRouteError"),i=Rp("useRouteError");return e!==void 0?e:n.errors?.[i]}function zD(){let{router:e}=kD("useNavigate"),n=Rp("useNavigate"),i=L.useRef(!1);return Rx(()=>{i.current=!0}),L.useCallback(async(a,h={})=>{Nt(i.current,Ex),i.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:n,...h}))},[e,n])}var Fy={};function Dx(e,n,i){!n&&!Fy[e]&&(Fy[e]=!0,Nt(!1,i))}var $y={};function Vy(e,n){!e&&!$y[n]&&($y[n]=!0,console.warn(n))}var ID="useOptimistic",qy=gh[ID],UD=()=>{};function FD(e){return qy?qy(e):[e,UD]}function $D(e){let n={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Nt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:L.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Nt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:L.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Nt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:L.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),n}var VD=["HydrateFallback","hydrateFallbackElement"],qD=class{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=i=>{this.status==="pending"&&(this.status="resolved",e(i))},this.reject=i=>{this.status==="pending"&&(this.status="rejected",n(i))}})}};function WD({router:e,flushSync:n,onError:i,unstable_useTransitions:s}){s=_D()||s;let[h,d]=L.useState(e.state),[l,u]=FD(h),[c,v]=L.useState(),[m,_]=L.useState({isTransitioning:!1}),[x,C]=L.useState(),[S,p]=L.useState(),[g,b]=L.useState(),y=L.useRef(new Map),E=L.useCallback((A,{deletedFetchers:N,newErrors:q,flushSync:P,viewTransitionOpts:z})=>{q&&i&&Object.values(q).forEach(U=>i(U,{location:A.location,params:A.matches[0]?.params??{},unstable_pattern:Ul(A.matches)})),A.fetchers.forEach((U,G)=>{U.data!==void 0&&y.current.set(G,U.data)}),N.forEach(U=>y.current.delete(U)),Vy(P===!1||n!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let W=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Vy(z==null||W,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!z||!W){n&&P?n(()=>d(A)):s===!1?d(A):L.startTransition(()=>{s===!0&&u(U=>Wy(U,A)),d(A)});return}if(n&&P){n(()=>{S&&(x?.resolve(),S.skipTransition()),_({isTransitioning:!0,flushSync:!0,currentLocation:z.currentLocation,nextLocation:z.nextLocation})});let U=e.window.document.startViewTransition(()=>{n(()=>d(A))});U.finished.finally(()=>{n(()=>{C(void 0),p(void 0),v(void 0),_({isTransitioning:!1})})}),n(()=>p(U));return}S?(x?.resolve(),S.skipTransition(),b({state:A,currentLocation:z.currentLocation,nextLocation:z.nextLocation})):(v(A),_({isTransitioning:!0,flushSync:!1,currentLocation:z.currentLocation,nextLocation:z.nextLocation}))},[e.window,n,S,x,s,u,i]);L.useLayoutEffect(()=>e.subscribe(E),[e,E]),L.useEffect(()=>{m.isTransitioning&&!m.flushSync&&C(new qD)},[m]),L.useEffect(()=>{if(x&&c&&e.window){let A=c,N=x.promise,q=e.window.document.startViewTransition(async()=>{s===!1?d(A):L.startTransition(()=>{s===!0&&u(P=>Wy(P,A)),d(A)}),await N});q.finished.finally(()=>{C(void 0),p(void 0),v(void 0),_({isTransitioning:!1})}),p(q)}},[c,x,e.window,s,u]),L.useEffect(()=>{x&&c&&l.location.key===c.location.key&&x.resolve()},[x,S,l.location,c]),L.useEffect(()=>{!m.isTransitioning&&g&&(v(g.state),_({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),b(void 0))},[m.isTransitioning,g]);let T=L.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:A=>e.navigate(A),push:(A,N,q)=>e.navigate(A,{state:N,preventScrollReset:q?.preventScrollReset}),replace:(A,N,q)=>e.navigate(A,{replace:!0,state:N,preventScrollReset:q?.preventScrollReset})}),[e]),O=e.basename||"/",D=L.useMemo(()=>({router:e,navigator:T,static:!1,basename:O,onError:i}),[e,T,O,i]);return L.createElement(L.Fragment,null,L.createElement(Js.Provider,{value:D},L.createElement(Fl.Provider,{value:l},L.createElement(wx.Provider,{value:y.current},L.createElement(wp.Provider,{value:m},L.createElement(GD,{basename:O,location:l.location,navigationType:l.historyAction,navigator:T,unstable_useTransitions:s},L.createElement(YD,{routes:e.routes,future:e.future,state:l,onError:i})))))),null)}function Wy(e,n){return{...e,navigation:n.navigation.state!=="idle"?n.navigation:e.navigation,revalidation:n.revalidation!=="idle"?n.revalidation:e.revalidation,actionData:n.navigation.state!=="submitting"?n.actionData:e.actionData,fetchers:n.fetchers}}var YD=L.memo(KD);function KD({routes:e,future:n,state:i,onError:s}){return DD(e,void 0,i,s,n)}function GD({basename:e="/",children:n=null,location:i,navigationType:s="POP",navigator:a,static:h=!1,unstable_useTransitions:d}){Ve(!$l(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),u=L.useMemo(()=>({basename:l,navigator:a,static:h,unstable_useTransitions:d,future:{}}),[l,a,h,d]);typeof i=="string"&&(i=ds(i));let{pathname:c="/",search:v="",hash:m="",state:_=null,key:x="default"}=i,C=L.useMemo(()=>{let S=sr(c,l);return S==null?null:{location:{pathname:S,search:v,hash:m,state:_,key:x},navigationType:s}},[l,c,v,m,_,x,s]);return Nt(C!=null,`<Router basename="${l}"> is not able to match the URL "${c}${v}${m}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:L.createElement(or.Provider,{value:u},L.createElement(yh.Provider,{children:n,value:C}))}var ju="get",Hu="application/x-www-form-urlencoded";function bh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function XD(e){return bh(e)&&e.tagName.toLowerCase()==="button"}function QD(e){return bh(e)&&e.tagName.toLowerCase()==="form"}function ZD(e){return bh(e)&&e.tagName.toLowerCase()==="input"}function JD(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function eT(e,n){return e.button===0&&(!n||n==="_self")&&!JD(e)}var pu=null;function tT(){if(pu===null)try{new FormData(document.createElement("form"),0),pu=!1}catch{pu=!0}return pu}var nT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nm(e){return e!=null&&!nT.has(e)?(Nt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Hu}"`),null):e}function rT(e,n){let i,s,a,h,d;if(QD(e)){let l=e.getAttribute("action");s=l?sr(l,n):null,i=e.getAttribute("method")||ju,a=nm(e.getAttribute("enctype"))||Hu,h=new FormData(e)}else if(XD(e)||ZD(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||l.getAttribute("action");if(s=u?sr(u,n):null,i=e.getAttribute("formmethod")||l.getAttribute("method")||ju,a=nm(e.getAttribute("formenctype"))||nm(l.getAttribute("enctype"))||Hu,h=new FormData(l,e),!tT()){let{name:c,type:v,value:m}=e;if(v==="image"){let _=c?`${c}.`:"";h.append(`${_}x`,"0"),h.append(`${_}y`,"0")}else c&&h.append(c,m)}}else{if(bh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=ju,s=null,a=Hu,d=e}return h&&a==="text/plain"&&(d=h,h=void 0),{action:s,method:i.toLowerCase(),encType:a,formData:h,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ap(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function iT(e,n,i){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return s.pathname==="/"?s.pathname=`_root.${i}`:n&&sr(s.pathname,n)==="/"?s.pathname=`${n.replace(/\/$/,"")}/_root.${i}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${i}`,s}async function sT(e,n){if(e.id in n)return n[e.id];try{let i=await import(e.module);return n[e.id]=i,i}catch(i){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function oT(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function aT(e,n,i){let s=await Promise.all(e.map(async a=>{let h=n.routes[a.route.id];if(h){let d=await sT(h,i);return d.links?d.links():[]}return[]}));return hT(s.flat(1).filter(oT).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Yy(e,n,i,s,a,h){let d=(u,c)=>i[c]?u.route.id!==i[c].route.id:!0,l=(u,c)=>i[c].pathname!==u.pathname||i[c].route.path?.endsWith("*")&&i[c].params["*"]!==u.params["*"];return h==="assets"?n.filter((u,c)=>d(u,c)||l(u,c)):h==="data"?n.filter((u,c)=>{let v=s.routes[u.route.id];if(!v||!v.hasLoader)return!1;if(d(u,c)||l(u,c))return!0;if(u.route.shouldRevalidate){let m=u.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:i[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function lT(e,n,{includeHydrateFallback:i}={}){return cT(e.map(s=>{let a=n.routes[s.route.id];if(!a)return[];let h=[a.module];return a.clientActionModule&&(h=h.concat(a.clientActionModule)),a.clientLoaderModule&&(h=h.concat(a.clientLoaderModule)),i&&a.hydrateFallbackModule&&(h=h.concat(a.hydrateFallbackModule)),a.imports&&(h=h.concat(a.imports)),h}).flat(1))}function cT(e){return[...new Set(e)]}function uT(e){let n={},i=Object.keys(e).sort();for(let s of i)n[s]=e[s];return n}function hT(e,n){let i=new Set;return new Set(n),e.reduce((s,a)=>{let h=JSON.stringify(uT(a));return i.has(h)||(i.add(h),s.push({key:h,link:a})),s},[])}function Tx(){let e=L.useContext(Js);return Ap(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function fT(){let e=L.useContext(Fl);return Ap(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Dp=L.createContext(void 0);Dp.displayName="FrameworkContext";function Mx(){let e=L.useContext(Dp);return Ap(e,"You must render this element inside a <HydratedRouter> element"),e}function dT(e,n){let i=L.useContext(Dp),[s,a]=L.useState(!1),[h,d]=L.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:c,onMouseLeave:v,onTouchStart:m}=n,_=L.useRef(null);L.useEffect(()=>{if(e==="render"&&d(!0),e==="viewport"){let S=g=>{g.forEach(b=>{d(b.isIntersecting)})},p=new IntersectionObserver(S,{threshold:.5});return _.current&&p.observe(_.current),()=>{p.disconnect()}}},[e]),L.useEffect(()=>{if(s){let S=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(S)}}},[s]);let x=()=>{a(!0)},C=()=>{a(!1),d(!1)};return i?e!=="intent"?[h,_,{}]:[h,_,{onFocus:ll(l,x),onBlur:ll(u,C),onMouseEnter:ll(c,x),onMouseLeave:ll(v,C),onTouchStart:ll(m,x)}]:[!1,_,{}]}function ll(e,n){return i=>{e&&e(i),i.defaultPrevented||n(i)}}function mT({page:e,...n}){let{router:i}=Tx(),s=L.useMemo(()=>rs(i.routes,e,i.basename),[i.routes,e,i.basename]);return s?L.createElement(gT,{page:e,matches:s,...n}):null}function pT(e){let{manifest:n,routeModules:i}=Mx(),[s,a]=L.useState([]);return L.useEffect(()=>{let h=!1;return aT(e,n,i).then(d=>{h||a(d)}),()=>{h=!0}},[e,n,i]),s}function gT({page:e,matches:n,...i}){let s=eo(),{manifest:a,routeModules:h}=Mx(),{basename:d}=Tx(),{loaderData:l,matches:u}=fT(),c=L.useMemo(()=>Yy(e,n,u,a,s,"data"),[e,n,u,a,s]),v=L.useMemo(()=>Yy(e,n,u,a,s,"assets"),[e,n,u,a,s]),m=L.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let C=new Set,S=!1;if(n.forEach(g=>{let b=a.routes[g.route.id];!b||!b.hasLoader||(!c.some(y=>y.route.id===g.route.id)&&g.route.id in l&&h[g.route.id]?.shouldRevalidate||b.hasClientLoader?S=!0:C.add(g.route.id))}),C.size===0)return[];let p=iT(e,d,"data");return S&&C.size>0&&p.searchParams.set("_routes",n.filter(g=>C.has(g.route.id)).map(g=>g.route.id).join(",")),[p.pathname+p.search]},[d,l,s,a,c,n,e,h]),_=L.useMemo(()=>lT(v,a),[v,a]),x=pT(v);return L.createElement(L.Fragment,null,m.map(C=>L.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...i})),_.map(C=>L.createElement("link",{key:C,rel:"modulepreload",href:C,...i})),x.map(({key:C,link:S})=>L.createElement("link",{key:C,nonce:i.nonce,...S})))}function vT(...e){return n=>{e.forEach(i=>{typeof i=="function"?i(n):i!=null&&(i.current=n)})}}var _T=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{_T&&(window.__reactRouterVersion="7.11.0")}catch{}function yT(e,n){return YA({basename:n?.basename,getContext:n?.getContext,future:n?.future,history:cA({window:n?.window}),hydrationData:bT(),routes:e,mapRouteProperties:$D,hydrationRouteProperties:VD,dataStrategy:n?.dataStrategy,patchRoutesOnNavigation:n?.patchRoutesOnNavigation,window:n?.window,unstable_instrumentations:n?.unstable_instrumentations}).initialize()}function bT(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:ST(e.errors)}),e}function ST(e){if(!e)return null;let n=Object.entries(e),i={};for(let[s,a]of n)if(a&&a.__type==="RouteErrorResponse")i[s]=new Il(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let h=window[a.__subType];if(typeof h=="function")try{let d=new h(a.message);d.stack="",i[s]=d}catch{}}if(i[s]==null){let h=new Error(a.message);h.stack="",i[s]=h}}else i[s]=a;return i}var Ox=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_r=L.forwardRef(function({onClick:n,discover:i="render",prefetch:s="none",relative:a,reloadDocument:h,replace:d,state:l,target:u,to:c,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:_,...x},C){let{basename:S,unstable_useTransitions:p}=L.useContext(or),g=typeof c=="string"&&Ox.test(c),b=ux(c,S);c=b.to;let y=CD(c,{relative:a}),[E,T,O]=dT(s,x),D=ET(c,{replace:d,state:l,target:u,preventScrollReset:v,relative:a,viewTransition:m,unstable_defaultShouldRevalidate:_,unstable_useTransitions:p});function A(q){n&&n(q),q.defaultPrevented||D(q)}let N=L.createElement("a",{...x,...O,href:b.absoluteURL||y,onClick:b.isExternal||h?n:A,ref:vT(C,T),target:u,"data-discover":!g&&i==="render"?"true":void 0});return E&&!g?L.createElement(L.Fragment,null,N,L.createElement(mT,{page:y})):N});_r.displayName="Link";var xT=L.forwardRef(function({"aria-current":n="page",caseSensitive:i=!1,className:s="",end:a=!1,style:h,to:d,viewTransition:l,children:u,...c},v){let m=Vl(d,{relative:c.relative}),_=eo(),x=L.useContext(Fl),{navigator:C,basename:S}=L.useContext(or),p=x!=null&&MT(m)&&l===!0,g=C.encodeLocation?C.encodeLocation(m).pathname:m.pathname,b=_.pathname,y=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;i||(b=b.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&S&&(y=sr(y,S)||y);const E=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let T=b===g||!a&&b.startsWith(g)&&b.charAt(E)==="/",O=y!=null&&(y===g||!a&&y.startsWith(g)&&y.charAt(g.length)==="/"),D={isActive:T,isPending:O,isTransitioning:p},A=T?n:void 0,N;typeof s=="function"?N=s(D):N=[s,T?"active":null,O?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let q=typeof h=="function"?h(D):h;return L.createElement(_r,{...c,"aria-current":A,className:N,ref:v,style:q,to:d,viewTransition:l},typeof u=="function"?u(D):u)});xT.displayName="NavLink";var wT=L.forwardRef(({discover:e="render",fetcherKey:n,navigate:i,reloadDocument:s,replace:a,state:h,method:d=ju,action:l,onSubmit:u,relative:c,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:_,...x},C)=>{let{unstable_useTransitions:S}=L.useContext(or),p=DT(),g=TT(l,{relative:c}),b=d.toLowerCase()==="get"?"get":"post",y=typeof l=="string"&&Ox.test(l),E=T=>{if(u&&u(T),T.defaultPrevented)return;T.preventDefault();let O=T.nativeEvent.submitter,D=O?.getAttribute("formmethod")||d,A=()=>p(O||T.currentTarget,{fetcherKey:n,method:D,navigate:i,replace:a,state:h,relative:c,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:_});S&&i!==!1?L.startTransition(()=>A()):A()};return L.createElement("form",{ref:C,method:b,action:g,onSubmit:s?u:E,...x,"data-discover":!y&&e==="render"?"true":void 0})});wT.displayName="Form";function CT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Lx(e){let n=L.useContext(Js);return Ve(n,CT(e)),n}function ET(e,{target:n,replace:i,state:s,preventScrollReset:a,relative:h,viewTransition:d,unstable_defaultShouldRevalidate:l,unstable_useTransitions:u}={}){let c=ED(),v=eo(),m=Vl(e,{relative:h});return L.useCallback(_=>{if(eT(_,n)){_.preventDefault();let x=i!==void 0?i:Fr(v)===Fr(m),C=()=>c(e,{replace:x,state:s,preventScrollReset:a,relative:h,viewTransition:d,unstable_defaultShouldRevalidate:l});u?L.startTransition(()=>C()):C()}},[v,c,m,i,s,n,e,a,h,d,l,u])}var RT=0,AT=()=>`__${String(++RT)}__`;function DT(){let{router:e}=Lx("useSubmit"),{basename:n}=L.useContext(or),i=HD(),s=e.fetch,a=e.navigate;return L.useCallback(async(h,d={})=>{let{action:l,method:u,encType:c,formData:v,body:m}=rT(h,n);if(d.navigate===!1){let _=d.fetcherKey||AT();await s(_,i,d.action||l,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:m,formMethod:d.method||u,formEncType:d.encType||c,flushSync:d.flushSync})}else await a(d.action||l,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:m,formMethod:d.method||u,formEncType:d.encType||c,replace:d.replace,state:d.state,fromRouteId:i,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,a,n,i])}function TT(e,{relative:n}={}){let{basename:i}=L.useContext(or),s=L.useContext(qr);Ve(s,"useFormAction must be used inside a RouteContext");let[a]=s.matches.slice(-1),h={...Vl(e||".",{relative:n})},d=eo();if(e==null){h.search=d.search;let l=new URLSearchParams(h.search),u=l.getAll("index");if(u.some(v=>v==="")){l.delete("index"),u.filter(m=>m).forEach(m=>l.append("index",m));let v=l.toString();h.search=v?`?${v}`:""}}return(!e||e===".")&&a.route.index&&(h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(h.pathname=h.pathname==="/"?i:zr([i,h.pathname])),Fr(h)}function MT(e,{relative:n}={}){let i=L.useContext(wp);Ve(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=Lx("useViewTransitionState"),a=Vl(e,{relative:n});if(!i.isTransitioning)return!1;let h=sr(i.currentLocation.pathname,s)||i.currentLocation.pathname,d=sr(i.nextLocation.pathname,s)||i.nextLocation.pathname;return Ku(a.pathname,d)!=null||Ku(a.pathname,h)!=null}var to=WS();const OT=ph(to);function LT(e){return L.createElement(WD,{flushSync:to.flushSync,...e})}const rr="/api";class Nx extends Error{constructor(n,i,s){super(n),this.statusCode=i,this.details=s,this.name="ApiError"}}async function ir(e,n){const i=await fetch(e,{...n,headers:{"Content-Type":"application/json",...n?.headers}}),s=await i.json();if(!i.ok||!s.success)throw new Nx(s.error||"API request failed",i.status,s.details);return s.data}const Tp={list:async()=>ir(`${rr}/branches`),get:async e=>{const n=encodeURIComponent(e);return ir(`${rr}/branches/${n}`)},sync:async(e,n)=>{const i=encodeURIComponent(e);return ir(`${rr}/branches/${i}/sync`,{method:"POST",body:JSON.stringify(n)})}},NT={list:async()=>ir(`${rr}/worktrees`),create:async e=>ir(`${rr}/worktrees`,{method:"POST",body:JSON.stringify(e)}),delete:async e=>{const n=new URL(`${rr}/worktrees/delete`,window.location.origin);n.searchParams.set("path",e),await ir(n.toString(),{method:"DELETE"})}},Mp={list:async()=>ir(`${rr}/sessions`),start:async e=>ir(`${rr}/sessions`,{method:"POST",body:JSON.stringify(e)}),get:async e=>ir(`${rr}/sessions/${e}`),delete:async e=>{await ir(`${rr}/sessions/${e}`,{method:"DELETE"})}},kx={get:async()=>ir(`${rr}/config`),update:async e=>ir(`${rr}/config`,{method:"PUT",body:JSON.stringify(e)})};function kT(){return vh({queryKey:["branches"],queryFn:Tp.list})}function BT(e){return vh({queryKey:["branches",e],queryFn:()=>Tp.get(e),enabled:!!e})}function jT(e){const n=Zs();return zl({mutationFn:i=>Tp.sync(e,i),onSuccess:i=>{n.setQueryData(["branches",e],i.branch),n.invalidateQueries({queryKey:["branches"]})}})}function Bx(e){var n,i,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(n=0;n<a;n++)e[n]&&(i=Bx(e[n]))&&(s&&(s+=" "),s+=i)}else for(i in e)e[i]&&(s&&(s+=" "),s+=i);return s}function jx(){for(var e,n,i=0,s="",a=arguments.length;i<a;i++)(e=arguments[i])&&(n=Bx(e))&&(s&&(s+=" "),s+=n);return s}const HT=(e,n)=>{const i=new Array(e.length+n.length);for(let s=0;s<e.length;s++)i[s]=e[s];for(let s=0;s<n.length;s++)i[e.length+s]=n[s];return i},PT=(e,n)=>({classGroupId:e,validator:n}),Hx=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),Gu="-",Ky=[],zT="arbitrary..",IT=e=>{const n=FT(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return UT(d);const l=d.split(Gu),u=l[0]===""&&l.length>1?1:0;return Px(l,u,n)},getConflictingClassGroupIds:(d,l)=>{if(l){const u=s[d],c=i[d];return u?c?HT(c,u):u:c||Ky}return i[d]||Ky}}},Px=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const a=e[n],h=i.nextPart.get(a);if(h){const c=Px(e,n+1,h);if(c)return c}const d=i.validators;if(d===null)return;const l=n===0?e.join(Gu):e.slice(n).join(Gu),u=d.length;for(let c=0;c<u;c++){const v=d[c];if(v.validator(l))return v.classGroupId}},UT=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),i=n.indexOf(":"),s=n.slice(0,i);return s?zT+s:void 0})(),FT=e=>{const{theme:n,classGroups:i}=e;return $T(i,n)},$T=(e,n)=>{const i=Hx();for(const s in e){const a=e[s];Op(a,i,s,n)}return i},Op=(e,n,i,s)=>{const a=e.length;for(let h=0;h<a;h++){const d=e[h];VT(d,n,i,s)}},VT=(e,n,i,s)=>{if(typeof e=="string"){qT(e,n,i);return}if(typeof e=="function"){WT(e,n,i,s);return}YT(e,n,i,s)},qT=(e,n,i)=>{const s=e===""?n:zx(n,e);s.classGroupId=i},WT=(e,n,i,s)=>{if(KT(e)){Op(e(s),n,i,s);return}n.validators===null&&(n.validators=[]),n.validators.push(PT(i,e))},YT=(e,n,i,s)=>{const a=Object.entries(e),h=a.length;for(let d=0;d<h;d++){const[l,u]=a[d];Op(u,zx(n,l),i,s)}},zx=(e,n)=>{let i=e;const s=n.split(Gu),a=s.length;for(let h=0;h<a;h++){const d=s[h];let l=i.nextPart.get(d);l||(l=Hx(),i.nextPart.set(d,l)),i=l}return i},KT=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,GT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,i=Object.create(null),s=Object.create(null);const a=(h,d)=>{i[h]=d,n++,n>e&&(n=0,s=i,i=Object.create(null))};return{get(h){let d=i[h];if(d!==void 0)return d;if((d=s[h])!==void 0)return a(h,d),d},set(h,d){h in i?i[h]=d:a(h,d)}}},Im="!",Gy=":",XT=[],Xy=(e,n,i,s,a)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:s,isExternal:a}),QT=e=>{const{prefix:n,experimentalParseClassName:i}=e;let s=a=>{const h=[];let d=0,l=0,u=0,c;const v=a.length;for(let S=0;S<v;S++){const p=a[S];if(d===0&&l===0){if(p===Gy){h.push(a.slice(u,S)),u=S+1;continue}if(p==="/"){c=S;continue}}p==="["?d++:p==="]"?d--:p==="("?l++:p===")"&&l--}const m=h.length===0?a:a.slice(u);let _=m,x=!1;m.endsWith(Im)?(_=m.slice(0,-1),x=!0):m.startsWith(Im)&&(_=m.slice(1),x=!0);const C=c&&c>u?c-u:void 0;return Xy(h,x,_,C)};if(n){const a=n+Gy,h=s;s=d=>d.startsWith(a)?h(d.slice(a.length)):Xy(XT,!1,d,void 0,!0)}if(i){const a=s;s=h=>i({className:h,parseClassName:a})}return s},ZT=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((i,s)=>{n.set(i,1e6+s)}),i=>{const s=[];let a=[];for(let h=0;h<i.length;h++){const d=i[h],l=d[0]==="[",u=n.has(d);l||u?(a.length>0&&(a.sort(),s.push(...a),a=[]),s.push(d)):a.push(d)}return a.length>0&&(a.sort(),s.push(...a)),s}},JT=e=>({cache:GT(e.cacheSize),parseClassName:QT(e),sortModifiers:ZT(e),...IT(e)}),eM=/\s+/,tM=(e,n)=>{const{parseClassName:i,getClassGroupId:s,getConflictingClassGroupIds:a,sortModifiers:h}=n,d=[],l=e.trim().split(eM);let u="";for(let c=l.length-1;c>=0;c-=1){const v=l[c],{isExternal:m,modifiers:_,hasImportantModifier:x,baseClassName:C,maybePostfixModifierPosition:S}=i(v);if(m){u=v+(u.length>0?" "+u:u);continue}let p=!!S,g=s(p?C.substring(0,S):C);if(!g){if(!p){u=v+(u.length>0?" "+u:u);continue}if(g=s(C),!g){u=v+(u.length>0?" "+u:u);continue}p=!1}const b=_.length===0?"":_.length===1?_[0]:h(_).join(":"),y=x?b+Im:b,E=y+g;if(d.indexOf(E)>-1)continue;d.push(E);const T=a(g,p);for(let O=0;O<T.length;++O){const D=T[O];d.push(y+D)}u=v+(u.length>0?" "+u:u)}return u},nM=(...e)=>{let n=0,i,s,a="";for(;n<e.length;)(i=e[n++])&&(s=Ix(i))&&(a&&(a+=" "),a+=s);return a},Ix=e=>{if(typeof e=="string")return e;let n,i="";for(let s=0;s<e.length;s++)e[s]&&(n=Ix(e[s]))&&(i&&(i+=" "),i+=n);return i},rM=(e,...n)=>{let i,s,a,h;const d=u=>{const c=n.reduce((v,m)=>m(v),e());return i=JT(c),s=i.cache.get,a=i.cache.set,h=l,l(u)},l=u=>{const c=s(u);if(c)return c;const v=tM(u,i);return a(u,v),v};return h=d,(...u)=>h(nM(...u))},iM=[],Wt=e=>{const n=i=>i[e]||iM;return n.isThemeGetter=!0,n},Ux=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,sM=/^\d+\/\d+$/,oM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aM=/\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$/,lM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Io=e=>sM.test(e),$e=e=>!!e&&!Number.isNaN(Number(e)),Ji=e=>!!e&&Number.isInteger(Number(e)),rm=e=>e.endsWith("%")&&$e(e.slice(0,-1)),_i=e=>oM.test(e),hM=()=>!0,fM=e=>aM.test(e)&&!lM.test(e),$x=()=>!1,dM=e=>cM.test(e),mM=e=>uM.test(e),pM=e=>!Ae(e)&&!De(e),gM=e=>ca(e,Wx,$x),Ae=e=>Ux.test(e),ks=e=>ca(e,Yx,fM),im=e=>ca(e,SM,$e),Qy=e=>ca(e,Vx,$x),vM=e=>ca(e,qx,mM),gu=e=>ca(e,Kx,dM),De=e=>Fx.test(e),cl=e=>ua(e,Yx),_M=e=>ua(e,xM),Zy=e=>ua(e,Vx),yM=e=>ua(e,Wx),bM=e=>ua(e,qx),vu=e=>ua(e,Kx,!0),ca=(e,n,i)=>{const s=Ux.exec(e);return s?s[1]?n(s[1]):i(s[2]):!1},ua=(e,n,i=!1)=>{const s=Fx.exec(e);return s?s[1]?n(s[1]):i:!1},Vx=e=>e==="position"||e==="percentage",qx=e=>e==="image"||e==="url",Wx=e=>e==="length"||e==="size"||e==="bg-size",Yx=e=>e==="length",SM=e=>e==="number",xM=e=>e==="family-name",Kx=e=>e==="shadow",wM=()=>{const e=Wt("color"),n=Wt("font"),i=Wt("text"),s=Wt("font-weight"),a=Wt("tracking"),h=Wt("leading"),d=Wt("breakpoint"),l=Wt("container"),u=Wt("spacing"),c=Wt("radius"),v=Wt("shadow"),m=Wt("inset-shadow"),_=Wt("text-shadow"),x=Wt("drop-shadow"),C=Wt("blur"),S=Wt("perspective"),p=Wt("aspect"),g=Wt("ease"),b=Wt("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...E(),De,Ae],O=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],A=()=>[De,Ae,u],N=()=>[Io,"full","auto",...A()],q=()=>[Ji,"none","subgrid",De,Ae],P=()=>["auto",{span:["full",Ji,De,Ae]},Ji,De,Ae],z=()=>[Ji,"auto",De,Ae],W=()=>["auto","min","max","fr",De,Ae],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...A()],K=()=>[Io,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],F=()=>[e,De,Ae],k=()=>[...E(),Zy,Qy,{position:[De,Ae]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",yM,gM,{size:[De,Ae]}],I=()=>[rm,cl,ks],Q=()=>["","none","full",c,De,Ae],J=()=>["",$e,cl,ks],ae=()=>["solid","dashed","dotted","double"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[$e,rm,Zy,Qy],V=()=>["","none",C,De,Ae],ie=()=>["none",$e,De,Ae],de=()=>["none",$e,De,Ae],re=()=>[$e,De,Ae],le=()=>[Io,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_i],breakpoint:[_i],color:[hM],container:[_i],"drop-shadow":[_i],ease:["in","out","in-out"],font:[pM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_i],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_i],shadow:[_i],spacing:["px",$e],text:[_i],"text-shadow":[_i],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Io,Ae,De,p]}],container:["container"],columns:[{columns:[$e,Ae,De,l]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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"],sr:["sr-only","not-sr-only"],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:T()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{start:N()}],end:[{end:N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[Ji,"auto",De,Ae]}],basis:[{basis:[Io,"full","auto",l,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[$e,Io,"auto","initial","none",Ae]}],grow:[{grow:["",$e,De,Ae]}],shrink:[{shrink:["",$e,De,Ae]}],order:[{order:[Ji,"first","last","none",De,Ae]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[l,"screen",...K()]}],"min-w":[{"min-w":[l,"screen","none",...K()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[d]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",i,cl,ks]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,De,im]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rm,Ae]}],"font-family":[{font:[_M,Ae,n]}],"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:[a,De,Ae]}],"line-clamp":[{"line-clamp":[$e,"none",De,im]}],leading:[{leading:[h,...A()]}],"list-image":[{"list-image":["none",De,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[$e,"from-font","auto",De,ks]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[$e,"auto",De,Ae]}],"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",De,Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",De,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ji,De,Ae],radial:["",De,Ae],conic:[Ji,De,Ae]},bM,vM]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[$e,De,Ae]}],"outline-w":[{outline:["",$e,cl,ks]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",v,vu,gu]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",m,vu,gu]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[$e,ks]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",_,vu,gu]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[$e,De,Ae]}],"mix-blend":[{"mix-blend":[...Z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[$e]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[De,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[$e]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,Ae]}],filter:[{filter:["","none",De,Ae]}],blur:[{blur:V()}],brightness:[{brightness:[$e,De,Ae]}],contrast:[{contrast:[$e,De,Ae]}],"drop-shadow":[{"drop-shadow":["","none",x,vu,gu]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",$e,De,Ae]}],"hue-rotate":[{"hue-rotate":[$e,De,Ae]}],invert:[{invert:["",$e,De,Ae]}],saturate:[{saturate:[$e,De,Ae]}],sepia:[{sepia:["",$e,De,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",De,Ae]}],"backdrop-blur":[{"backdrop-blur":V()}],"backdrop-brightness":[{"backdrop-brightness":[$e,De,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[$e,De,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",$e,De,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[$e,De,Ae]}],"backdrop-invert":[{"backdrop-invert":["",$e,De,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[$e,De,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[$e,De,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",$e,De,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",De,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[$e,"initial",De,Ae]}],ease:[{ease:["linear","initial",g,De,Ae]}],delay:[{delay:[$e,De,Ae]}],animate:[{animate:["none",b,De,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,De,Ae]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[De,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",De,Ae]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],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",De,Ae]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[$e,cl,ks,im]}],stroke:[{stroke:["none",...F()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},CM=rM(wM);function ze(...e){return CM(jx(e))}const Kt=L.forwardRef(({className:e,...n},i)=>M.jsx("div",{ref:i,className:ze("rounded-lg border border-border bg-card text-card-foreground shadow",e),...n}));Kt.displayName="Card";const An=L.forwardRef(({className:e,...n},i)=>M.jsx("div",{ref:i,className:ze("flex flex-col space-y-1.5 p-6",e),...n}));An.displayName="CardHeader";const EM=L.forwardRef(({className:e,...n},i)=>M.jsx("div",{ref:i,className:ze("font-semibold leading-none tracking-tight",e),...n}));EM.displayName="CardTitle";const RM=L.forwardRef(({className:e,...n},i)=>M.jsx("div",{ref:i,className:ze("text-sm text-muted-foreground",e),...n}));RM.displayName="CardDescription";const en=L.forwardRef(({className:e,...n},i)=>M.jsx("div",{ref:i,className:ze("p-6 pt-0",e),...n}));en.displayName="CardContent";const Lp=L.forwardRef(({className:e,...n},i)=>M.jsx("div",{ref:i,className:ze("flex items-center p-6 pt-0",e),...n}));Lp.displayName="CardFooter";const Jy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,eb=jx,Np=(e,n)=>i=>{var s;if(n?.variants==null)return eb(e,i?.class,i?.className);const{variants:a,defaultVariants:h}=n,d=Object.keys(a).map(c=>{const v=i?.[c],m=h?.[c];if(v===null)return null;const _=Jy(v)||Jy(m);return a[c][_]}),l=i&&Object.entries(i).reduce((c,v)=>{let[m,_]=v;return _===void 0||(c[m]=_),c},{}),u=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((c,v)=>{let{class:m,className:_,...x}=v;return Object.entries(x).every(C=>{let[S,p]=C;return Array.isArray(p)?p.includes({...h,...l}[S]):{...h,...l}[S]===p})?[...c,m,_]:c},[]);return eb(e,d,u,i?.class,i?.className)},AM=Np("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold 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 shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-500/15 text-green-400 border-green-500/30",warning:"border-transparent bg-yellow-500/15 text-yellow-400 border-yellow-500/30",local:"border-transparent bg-purple-500/15 text-purple-400 border-purple-500/30",remote:"border-transparent bg-blue-500/15 text-blue-400 border-blue-500/30"}},defaultVariants:{variant:"default"}});function pt({className:e,variant:n,...i}){return M.jsx("div",{className:ze(AM({variant:n}),e),...i})}function Ft(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let i=0,s;i<e.length;i++)(s=Ft(e[i]))!==""&&(n+=(n&&" ")+s);else for(let i in e)e[i]&&(n+=(n&&" ")+i);return n}var DM={value:()=>{}};function ql(){for(var e=0,n=arguments.length,i={},s;e<n;++e){if(!(s=arguments[e]+"")||s in i||/[\s.]/.test(s))throw new Error("illegal type: "+s);i[s]=[]}return new Pu(i)}function Pu(e){this._=e}function TM(e,n){return e.trim().split(/^|\s+/).map(function(i){var s="",a=i.indexOf(".");if(a>=0&&(s=i.slice(a+1),i=i.slice(0,a)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:s}})}Pu.prototype=ql.prototype={constructor:Pu,on:function(e,n){var i=this._,s=TM(e+"",i),a,h=-1,d=s.length;if(arguments.length<2){for(;++h<d;)if((a=(e=s[h]).type)&&(a=MM(i[a],e.name)))return a;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++h<d;)if(a=(e=s[h]).type)i[a]=tb(i[a],e.name,n);else if(n==null)for(a in i)i[a]=tb(i[a],e.name,null);return this},copy:function(){var e={},n=this._;for(var i in n)e[i]=n[i].slice();return new Pu(e)},call:function(e,n){if((a=arguments.length-2)>0)for(var i=new Array(a),s=0,a,h;s<a;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(h=this._[e],s=0,a=h.length;s<a;++s)h[s].value.apply(n,i)},apply:function(e,n,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],a=0,h=s.length;a<h;++a)s[a].value.apply(n,i)}};function MM(e,n){for(var i=0,s=e.length,a;i<s;++i)if((a=e[i]).name===n)return a.value}function tb(e,n,i){for(var s=0,a=e.length;s<a;++s)if(e[s].name===n){e[s]=DM,e=e.slice(0,s).concat(e.slice(s+1));break}return i!=null&&e.push({name:n,value:i}),e}var Um="http://www.w3.org/1999/xhtml";const nb={svg:"http://www.w3.org/2000/svg",xhtml:Um,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Sh(e){var n=e+="",i=n.indexOf(":");return i>=0&&(n=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),nb.hasOwnProperty(n)?{space:nb[n],local:e}:e}function OM(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===Um&&n.documentElement.namespaceURI===Um?n.createElement(e):n.createElementNS(i,e)}}function LM(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Gx(e){var n=Sh(e);return(n.local?LM:OM)(n)}function NM(){}function kp(e){return e==null?NM:function(){return this.querySelector(e)}}function kM(e){typeof e!="function"&&(e=kp(e));for(var n=this._groups,i=n.length,s=new Array(i),a=0;a<i;++a)for(var h=n[a],d=h.length,l=s[a]=new Array(d),u,c,v=0;v<d;++v)(u=h[v])&&(c=e.call(u,u.__data__,v,h))&&("__data__"in u&&(c.__data__=u.__data__),l[v]=c);return new qn(s,this._parents)}function BM(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function jM(){return[]}function Xx(e){return e==null?jM:function(){return this.querySelectorAll(e)}}function HM(e){return function(){return BM(e.apply(this,arguments))}}function PM(e){typeof e=="function"?e=HM(e):e=Xx(e);for(var n=this._groups,i=n.length,s=[],a=[],h=0;h<i;++h)for(var d=n[h],l=d.length,u,c=0;c<l;++c)(u=d[c])&&(s.push(e.call(u,u.__data__,c,d)),a.push(u));return new qn(s,a)}function Qx(e){return function(){return this.matches(e)}}function Zx(e){return function(n){return n.matches(e)}}var zM=Array.prototype.find;function IM(e){return function(){return zM.call(this.children,e)}}function UM(){return this.firstElementChild}function FM(e){return this.select(e==null?UM:IM(typeof e=="function"?e:Zx(e)))}var $M=Array.prototype.filter;function VM(){return Array.from(this.children)}function qM(e){return function(){return $M.call(this.children,e)}}function WM(e){return this.selectAll(e==null?VM:qM(typeof e=="function"?e:Zx(e)))}function YM(e){typeof e!="function"&&(e=Qx(e));for(var n=this._groups,i=n.length,s=new Array(i),a=0;a<i;++a)for(var h=n[a],d=h.length,l=s[a]=[],u,c=0;c<d;++c)(u=h[c])&&e.call(u,u.__data__,c,h)&&l.push(u);return new qn(s,this._parents)}function Jx(e){return new Array(e.length)}function KM(){return new qn(this._enter||this._groups.map(Jx),this._parents)}function Xu(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Xu.prototype={constructor:Xu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function GM(e){return function(){return e}}function XM(e,n,i,s,a,h){for(var d=0,l,u=n.length,c=h.length;d<c;++d)(l=n[d])?(l.__data__=h[d],s[d]=l):i[d]=new Xu(e,h[d]);for(;d<u;++d)(l=n[d])&&(a[d]=l)}function QM(e,n,i,s,a,h,d){var l,u,c=new Map,v=n.length,m=h.length,_=new Array(v),x;for(l=0;l<v;++l)(u=n[l])&&(_[l]=x=d.call(u,u.__data__,l,n)+"",c.has(x)?a[l]=u:c.set(x,u));for(l=0;l<m;++l)x=d.call(e,h[l],l,h)+"",(u=c.get(x))?(s[l]=u,u.__data__=h[l],c.delete(x)):i[l]=new Xu(e,h[l]);for(l=0;l<v;++l)(u=n[l])&&c.get(_[l])===u&&(a[l]=u)}function ZM(e){return e.__data__}function JM(e,n){if(!arguments.length)return Array.from(this,ZM);var i=n?QM:XM,s=this._parents,a=this._groups;typeof e!="function"&&(e=GM(e));for(var h=a.length,d=new Array(h),l=new Array(h),u=new Array(h),c=0;c<h;++c){var v=s[c],m=a[c],_=m.length,x=eO(e.call(v,v&&v.__data__,c,s)),C=x.length,S=l[c]=new Array(C),p=d[c]=new Array(C),g=u[c]=new Array(_);i(v,m,S,p,g,x,n);for(var b=0,y=0,E,T;b<C;++b)if(E=S[b]){for(b>=y&&(y=b+1);!(T=p[y])&&++y<C;);E._next=T||null}}return d=new qn(d,s),d._enter=l,d._exit=u,d}function eO(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function tO(){return new qn(this._exit||this._groups.map(Jx),this._parents)}function nO(e,n,i){var s=this.enter(),a=this,h=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),n!=null&&(a=n(a),a&&(a=a.selection())),i==null?h.remove():i(h),s&&a?s.merge(a).order():a}function rO(e){for(var n=e.selection?e.selection():e,i=this._groups,s=n._groups,a=i.length,h=s.length,d=Math.min(a,h),l=new Array(a),u=0;u<d;++u)for(var c=i[u],v=s[u],m=c.length,_=l[u]=new Array(m),x,C=0;C<m;++C)(x=c[C]||v[C])&&(_[C]=x);for(;u<a;++u)l[u]=i[u];return new qn(l,this._parents)}function iO(){for(var e=this._groups,n=-1,i=e.length;++n<i;)for(var s=e[n],a=s.length-1,h=s[a],d;--a>=0;)(d=s[a])&&(h&&d.compareDocumentPosition(h)^4&&h.parentNode.insertBefore(d,h),h=d);return this}function sO(e){e||(e=oO);function n(m,_){return m&&_?e(m.__data__,_.__data__):!m-!_}for(var i=this._groups,s=i.length,a=new Array(s),h=0;h<s;++h){for(var d=i[h],l=d.length,u=a[h]=new Array(l),c,v=0;v<l;++v)(c=d[v])&&(u[v]=c);u.sort(n)}return new qn(a,this._parents).order()}function oO(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function aO(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function lO(){return Array.from(this)}function cO(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var s=e[n],a=0,h=s.length;a<h;++a){var d=s[a];if(d)return d}return null}function uO(){let e=0;for(const n of this)++e;return e}function hO(){return!this.node()}function fO(e){for(var n=this._groups,i=0,s=n.length;i<s;++i)for(var a=n[i],h=0,d=a.length,l;h<d;++h)(l=a[h])&&e.call(l,l.__data__,h,a);return this}function dO(e){return function(){this.removeAttribute(e)}}function mO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function pO(e,n){return function(){this.setAttribute(e,n)}}function gO(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function vO(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function _O(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function yO(e,n){var i=Sh(e);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((n==null?i.local?mO:dO:typeof n=="function"?i.local?_O:vO:i.local?gO:pO)(i,n))}function ew(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function bO(e){return function(){this.style.removeProperty(e)}}function SO(e,n,i){return function(){this.style.setProperty(e,n,i)}}function xO(e,n,i){return function(){var s=n.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,i)}}function wO(e,n,i){return arguments.length>1?this.each((n==null?bO:typeof n=="function"?xO:SO)(e,n,i??"")):ea(this.node(),e)}function ea(e,n){return e.style.getPropertyValue(n)||ew(e).getComputedStyle(e,null).getPropertyValue(n)}function CO(e){return function(){delete this[e]}}function EO(e,n){return function(){this[e]=n}}function RO(e,n){return function(){var i=n.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function AO(e,n){return arguments.length>1?this.each((n==null?CO:typeof n=="function"?RO:EO)(e,n)):this.node()[e]}function tw(e){return e.trim().split(/^|\s+/)}function Bp(e){return e.classList||new nw(e)}function nw(e){this._node=e,this._names=tw(e.getAttribute("class")||"")}nw.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function rw(e,n){for(var i=Bp(e),s=-1,a=n.length;++s<a;)i.add(n[s])}function iw(e,n){for(var i=Bp(e),s=-1,a=n.length;++s<a;)i.remove(n[s])}function DO(e){return function(){rw(this,e)}}function TO(e){return function(){iw(this,e)}}function MO(e,n){return function(){(n.apply(this,arguments)?rw:iw)(this,e)}}function OO(e,n){var i=tw(e+"");if(arguments.length<2){for(var s=Bp(this.node()),a=-1,h=i.length;++a<h;)if(!s.contains(i[a]))return!1;return!0}return this.each((typeof n=="function"?MO:n?DO:TO)(i,n))}function LO(){this.textContent=""}function NO(e){return function(){this.textContent=e}}function kO(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function BO(e){return arguments.length?this.each(e==null?LO:(typeof e=="function"?kO:NO)(e)):this.node().textContent}function jO(){this.innerHTML=""}function HO(e){return function(){this.innerHTML=e}}function PO(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function zO(e){return arguments.length?this.each(e==null?jO:(typeof e=="function"?PO:HO)(e)):this.node().innerHTML}function IO(){this.nextSibling&&this.parentNode.appendChild(this)}function UO(){return this.each(IO)}function FO(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $O(){return this.each(FO)}function VO(e){var n=typeof e=="function"?e:Gx(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function qO(){return null}function WO(e,n){var i=typeof e=="function"?e:Gx(e),s=n==null?qO:typeof n=="function"?n:kp(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function YO(){var e=this.parentNode;e&&e.removeChild(this)}function KO(){return this.each(YO)}function GO(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function XO(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function QO(e){return this.select(e?XO:GO)}function ZO(e){return arguments.length?this.property("__data__",e):this.node().__data__}function JO(e){return function(n){e.call(this,n,this.__data__)}}function e3(e){return e.trim().split(/^|\s+/).map(function(n){var i="",s=n.indexOf(".");return s>=0&&(i=n.slice(s+1),n=n.slice(0,s)),{type:n,name:i}})}function t3(e){return function(){var n=this.__on;if(n){for(var i=0,s=-1,a=n.length,h;i<a;++i)h=n[i],(!e.type||h.type===e.type)&&h.name===e.name?this.removeEventListener(h.type,h.listener,h.options):n[++s]=h;++s?n.length=s:delete this.__on}}}function n3(e,n,i){return function(){var s=this.__on,a,h=JO(n);if(s){for(var d=0,l=s.length;d<l;++d)if((a=s[d]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=h,a.options=i),a.value=n;return}}this.addEventListener(e.type,h,i),a={type:e.type,name:e.name,value:n,listener:h,options:i},s?s.push(a):this.__on=[a]}}function r3(e,n,i){var s=e3(e+""),a,h=s.length,d;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,c=l.length,v;u<c;++u)for(a=0,v=l[u];a<h;++a)if((d=s[a]).type===v.type&&d.name===v.name)return v.value}return}for(l=n?n3:t3,a=0;a<h;++a)this.each(l(s[a],n,i));return this}function sw(e,n,i){var s=ew(e),a=s.CustomEvent;typeof a=="function"?a=new a(n,i):(a=s.document.createEvent("Event"),i?(a.initEvent(n,i.bubbles,i.cancelable),a.detail=i.detail):a.initEvent(n,!1,!1)),e.dispatchEvent(a)}function i3(e,n){return function(){return sw(this,e,n)}}function s3(e,n){return function(){return sw(this,e,n.apply(this,arguments))}}function o3(e,n){return this.each((typeof n=="function"?s3:i3)(e,n))}function*a3(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var s=e[n],a=0,h=s.length,d;a<h;++a)(d=s[a])&&(yield d)}var ow=[null];function qn(e,n){this._groups=e,this._parents=n}function Wl(){return new qn([[document.documentElement]],ow)}function l3(){return this}qn.prototype=Wl.prototype={constructor:qn,select:kM,selectAll:PM,selectChild:FM,selectChildren:WM,filter:YM,data:JM,enter:KM,exit:tO,join:nO,merge:rO,selection:l3,order:iO,sort:sO,call:aO,nodes:lO,node:cO,size:uO,empty:hO,each:fO,attr:yO,style:wO,property:AO,classed:OO,text:BO,html:zO,raise:UO,lower:$O,append:VO,insert:WO,remove:KO,clone:QO,datum:ZO,on:r3,dispatch:o3,[Symbol.iterator]:a3};function $n(e){return typeof e=="string"?new qn([[document.querySelector(e)]],[document.documentElement]):new qn([[e]],ow)}function c3(e){let n;for(;n=e.sourceEvent;)e=n;return e}function gr(e,n){if(e=c3(e),n===void 0&&(n=e.currentTarget),n){var i=n.ownerSVGElement||n;if(i.createSVGPoint){var s=i.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(n.getScreenCTM().inverse()),[s.x,s.y]}if(n.getBoundingClientRect){var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}}return[e.pageX,e.pageY]}const u3={passive:!1},El={capture:!0,passive:!1};function sm(e){e.stopImmediatePropagation()}function Xo(e){e.preventDefault(),e.stopImmediatePropagation()}function aw(e){var n=e.document.documentElement,i=$n(e).on("dragstart.drag",Xo,El);"onselectstart"in n?i.on("selectstart.drag",Xo,El):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function lw(e,n){var i=e.document.documentElement,s=$n(e).on("dragstart.drag",null);n&&(s.on("click.drag",Xo,El),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in i?s.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const _u=e=>()=>e;function Fm(e,{sourceEvent:n,subject:i,target:s,identifier:a,active:h,x:d,y:l,dx:u,dy:c,dispatch:v}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:h,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:v}})}Fm.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function h3(e){return!e.ctrlKey&&!e.button}function f3(){return this.parentNode}function d3(e,n){return n??{x:e.x,y:e.y}}function m3(){return navigator.maxTouchPoints||"ontouchstart"in this}function cw(){var e=h3,n=f3,i=d3,s=m3,a={},h=ql("start","drag","end"),d=0,l,u,c,v,m=0;function _(E){E.on("mousedown.drag",x).filter(s).on("touchstart.drag",p).on("touchmove.drag",g,u3).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(E,T){if(!(v||!e.call(this,E,T))){var O=y(this,n.call(this,E,T),E,T,"mouse");O&&($n(E.view).on("mousemove.drag",C,El).on("mouseup.drag",S,El),aw(E.view),sm(E),c=!1,l=E.clientX,u=E.clientY,O("start",E))}}function C(E){if(Xo(E),!c){var T=E.clientX-l,O=E.clientY-u;c=T*T+O*O>m}a.mouse("drag",E)}function S(E){$n(E.view).on("mousemove.drag mouseup.drag",null),lw(E.view,c),Xo(E),a.mouse("end",E)}function p(E,T){if(e.call(this,E,T)){var O=E.changedTouches,D=n.call(this,E,T),A=O.length,N,q;for(N=0;N<A;++N)(q=y(this,D,E,T,O[N].identifier,O[N]))&&(sm(E),q("start",E,O[N]))}}function g(E){var T=E.changedTouches,O=T.length,D,A;for(D=0;D<O;++D)(A=a[T[D].identifier])&&(Xo(E),A("drag",E,T[D]))}function b(E){var T=E.changedTouches,O=T.length,D,A;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),D=0;D<O;++D)(A=a[T[D].identifier])&&(sm(E),A("end",E,T[D]))}function y(E,T,O,D,A,N){var q=h.copy(),P=gr(N||O,T),z,W,U;if((U=i.call(E,new Fm("beforestart",{sourceEvent:O,target:_,identifier:A,active:d,x:P[0],y:P[1],dx:0,dy:0,dispatch:q}),D))!=null)return z=U.x-P[0]||0,W=U.y-P[1]||0,function G(H,K,F){var k=P,$;switch(H){case"start":a[A]=G,$=d++;break;case"end":delete a[A],--d;case"drag":P=gr(F||K,T),$=d;break}q.call(H,E,new Fm(H,{sourceEvent:K,subject:U,target:_,identifier:A,active:$,x:P[0]+z,y:P[1]+W,dx:P[0]-k[0],dy:P[1]-k[1],dispatch:q}),D)}}return _.filter=function(E){return arguments.length?(e=typeof E=="function"?E:_u(!!E),_):e},_.container=function(E){return arguments.length?(n=typeof E=="function"?E:_u(E),_):n},_.subject=function(E){return arguments.length?(i=typeof E=="function"?E:_u(E),_):i},_.touchable=function(E){return arguments.length?(s=typeof E=="function"?E:_u(!!E),_):s},_.on=function(){var E=h.on.apply(h,arguments);return E===h?_:E},_.clickDistance=function(E){return arguments.length?(m=(E=+E)*E,_):Math.sqrt(m)},_}function jp(e,n,i){e.prototype=n.prototype=i,i.constructor=e}function uw(e,n){var i=Object.create(e.prototype);for(var s in n)i[s]=n[s];return i}function Yl(){}var Rl=.7,Qu=1/Rl,Qo="\\s*([+-]?\\d+)\\s*",Al="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ir="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",p3=/^#([0-9a-f]{3,8})$/,g3=new RegExp(`^rgb\\(${Qo},${Qo},${Qo}\\)$`),v3=new RegExp(`^rgb\\(${Ir},${Ir},${Ir}\\)$`),_3=new RegExp(`^rgba\\(${Qo},${Qo},${Qo},${Al}\\)$`),y3=new RegExp(`^rgba\\(${Ir},${Ir},${Ir},${Al}\\)$`),b3=new RegExp(`^hsl\\(${Al},${Ir},${Ir}\\)$`),S3=new RegExp(`^hsla\\(${Al},${Ir},${Ir},${Al}\\)$`),rb={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};jp(Yl,Vs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ib,formatHex:ib,formatHex8:x3,formatHsl:w3,formatRgb:sb,toString:sb});function ib(){return this.rgb().formatHex()}function x3(){return this.rgb().formatHex8()}function w3(){return hw(this).formatHsl()}function sb(){return this.rgb().formatRgb()}function Vs(e){var n,i;return e=(e+"").trim().toLowerCase(),(n=p3.exec(e))?(i=n[1].length,n=parseInt(n[1],16),i===6?ob(n):i===3?new Dn(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?yu(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?yu(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=g3.exec(e))?new Dn(n[1],n[2],n[3],1):(n=v3.exec(e))?new Dn(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=_3.exec(e))?yu(n[1],n[2],n[3],n[4]):(n=y3.exec(e))?yu(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=b3.exec(e))?cb(n[1],n[2]/100,n[3]/100,1):(n=S3.exec(e))?cb(n[1],n[2]/100,n[3]/100,n[4]):rb.hasOwnProperty(e)?ob(rb[e]):e==="transparent"?new Dn(NaN,NaN,NaN,0):null}function ob(e){return new Dn(e>>16&255,e>>8&255,e&255,1)}function yu(e,n,i,s){return s<=0&&(e=n=i=NaN),new Dn(e,n,i,s)}function C3(e){return e instanceof Yl||(e=Vs(e)),e?(e=e.rgb(),new Dn(e.r,e.g,e.b,e.opacity)):new Dn}function $m(e,n,i,s){return arguments.length===1?C3(e):new Dn(e,n,i,s??1)}function Dn(e,n,i,s){this.r=+e,this.g=+n,this.b=+i,this.opacity=+s}jp(Dn,$m,uw(Yl,{brighter(e){return e=e==null?Qu:Math.pow(Qu,e),new Dn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Rl:Math.pow(Rl,e),new Dn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Dn(zs(this.r),zs(this.g),zs(this.b),Zu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ab,formatHex:ab,formatHex8:E3,formatRgb:lb,toString:lb}));function ab(){return`#${Ps(this.r)}${Ps(this.g)}${Ps(this.b)}`}function E3(){return`#${Ps(this.r)}${Ps(this.g)}${Ps(this.b)}${Ps((isNaN(this.opacity)?1:this.opacity)*255)}`}function lb(){const e=Zu(this.opacity);return`${e===1?"rgb(":"rgba("}${zs(this.r)}, ${zs(this.g)}, ${zs(this.b)}${e===1?")":`, ${e})`}`}function Zu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ps(e){return e=zs(e),(e<16?"0":"")+e.toString(16)}function cb(e,n,i,s){return s<=0?e=n=i=NaN:i<=0||i>=1?e=n=NaN:n<=0&&(e=NaN),new vr(e,n,i,s)}function hw(e){if(e instanceof vr)return new vr(e.h,e.s,e.l,e.opacity);if(e instanceof Yl||(e=Vs(e)),!e)return new vr;if(e instanceof vr)return e;e=e.rgb();var n=e.r/255,i=e.g/255,s=e.b/255,a=Math.min(n,i,s),h=Math.max(n,i,s),d=NaN,l=h-a,u=(h+a)/2;return l?(n===h?d=(i-s)/l+(i<s)*6:i===h?d=(s-n)/l+2:d=(n-i)/l+4,l/=u<.5?h+a:2-h-a,d*=60):l=u>0&&u<1?0:d,new vr(d,l,u,e.opacity)}function R3(e,n,i,s){return arguments.length===1?hw(e):new vr(e,n,i,s??1)}function vr(e,n,i,s){this.h=+e,this.s=+n,this.l=+i,this.opacity=+s}jp(vr,R3,uw(Yl,{brighter(e){return e=e==null?Qu:Math.pow(Qu,e),new vr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Rl:Math.pow(Rl,e),new vr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,s=i+(i<.5?i:1-i)*n,a=2*i-s;return new Dn(om(e>=240?e-240:e+120,a,s),om(e,a,s),om(e<120?e+240:e-120,a,s),this.opacity)},clamp(){return new vr(ub(this.h),bu(this.s),bu(this.l),Zu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Zu(this.opacity);return`${e===1?"hsl(":"hsla("}${ub(this.h)}, ${bu(this.s)*100}%, ${bu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ub(e){return e=(e||0)%360,e<0?e+360:e}function bu(e){return Math.max(0,Math.min(1,e||0))}function om(e,n,i){return(e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n)*255}const Hp=e=>()=>e;function A3(e,n){return function(i){return e+i*n}}function D3(e,n,i){return e=Math.pow(e,i),n=Math.pow(n,i)-e,i=1/i,function(s){return Math.pow(e+s*n,i)}}function T3(e){return(e=+e)==1?fw:function(n,i){return i-n?D3(n,i,e):Hp(isNaN(n)?i:n)}}function fw(e,n){var i=n-e;return i?A3(e,i):Hp(isNaN(e)?n:e)}const Ju=(function e(n){var i=T3(n);function s(a,h){var d=i((a=$m(a)).r,(h=$m(h)).r),l=i(a.g,h.g),u=i(a.b,h.b),c=fw(a.opacity,h.opacity);return function(v){return a.r=d(v),a.g=l(v),a.b=u(v),a.opacity=c(v),a+""}}return s.gamma=e,s})(1);function M3(e,n){n||(n=[]);var i=e?Math.min(n.length,e.length):0,s=n.slice(),a;return function(h){for(a=0;a<i;++a)s[a]=e[a]*(1-h)+n[a]*h;return s}}function O3(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function L3(e,n){var i=n?n.length:0,s=e?Math.min(i,e.length):0,a=new Array(s),h=new Array(i),d;for(d=0;d<s;++d)a[d]=yl(e[d],n[d]);for(;d<i;++d)h[d]=n[d];return function(l){for(d=0;d<s;++d)h[d]=a[d](l);return h}}function N3(e,n){var i=new Date;return e=+e,n=+n,function(s){return i.setTime(e*(1-s)+n*s),i}}function kr(e,n){return e=+e,n=+n,function(i){return e*(1-i)+n*i}}function k3(e,n){var i={},s={},a;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(a in n)a in e?i[a]=yl(e[a],n[a]):s[a]=n[a];return function(h){for(a in i)s[a]=i[a](h);return s}}var Vm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,am=new RegExp(Vm.source,"g");function B3(e){return function(){return e}}function j3(e){return function(n){return e(n)+""}}function dw(e,n){var i=Vm.lastIndex=am.lastIndex=0,s,a,h,d=-1,l=[],u=[];for(e=e+"",n=n+"";(s=Vm.exec(e))&&(a=am.exec(n));)(h=a.index)>i&&(h=n.slice(i,h),l[d]?l[d]+=h:l[++d]=h),(s=s[0])===(a=a[0])?l[d]?l[d]+=a:l[++d]=a:(l[++d]=null,u.push({i:d,x:kr(s,a)})),i=am.lastIndex;return i<n.length&&(h=n.slice(i),l[d]?l[d]+=h:l[++d]=h),l.length<2?u[0]?j3(u[0].x):B3(n):(n=u.length,function(c){for(var v=0,m;v<n;++v)l[(m=u[v]).i]=m.x(c);return l.join("")})}function yl(e,n){var i=typeof n,s;return n==null||i==="boolean"?Hp(n):(i==="number"?kr:i==="string"?(s=Vs(n))?(n=s,Ju):dw:n instanceof Vs?Ju:n instanceof Date?N3:O3(n)?M3:Array.isArray(n)?L3:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?k3:kr)(e,n)}var hb=180/Math.PI,qm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mw(e,n,i,s,a,h){var d,l,u;return(d=Math.sqrt(e*e+n*n))&&(e/=d,n/=d),(u=e*i+n*s)&&(i-=e*u,s-=n*u),(l=Math.sqrt(i*i+s*s))&&(i/=l,s/=l,u/=l),e*s<n*i&&(e=-e,n=-n,u=-u,d=-d),{translateX:a,translateY:h,rotate:Math.atan2(n,e)*hb,skewX:Math.atan(u)*hb,scaleX:d,scaleY:l}}var Su;function H3(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?qm:mw(n.a,n.b,n.c,n.d,n.e,n.f)}function P3(e){return e==null||(Su||(Su=document.createElementNS("http://www.w3.org/2000/svg","g")),Su.setAttribute("transform",e),!(e=Su.transform.baseVal.consolidate()))?qm:(e=e.matrix,mw(e.a,e.b,e.c,e.d,e.e,e.f))}function pw(e,n,i,s){function a(c){return c.length?c.pop()+" ":""}function h(c,v,m,_,x,C){if(c!==m||v!==_){var S=x.push("translate(",null,n,null,i);C.push({i:S-4,x:kr(c,m)},{i:S-2,x:kr(v,_)})}else(m||_)&&x.push("translate("+m+n+_+i)}function d(c,v,m,_){c!==v?(c-v>180?v+=360:v-c>180&&(c+=360),_.push({i:m.push(a(m)+"rotate(",null,s)-2,x:kr(c,v)})):v&&m.push(a(m)+"rotate("+v+s)}function l(c,v,m,_){c!==v?_.push({i:m.push(a(m)+"skewX(",null,s)-2,x:kr(c,v)}):v&&m.push(a(m)+"skewX("+v+s)}function u(c,v,m,_,x,C){if(c!==m||v!==_){var S=x.push(a(x)+"scale(",null,",",null,")");C.push({i:S-4,x:kr(c,m)},{i:S-2,x:kr(v,_)})}else(m!==1||_!==1)&&x.push(a(x)+"scale("+m+","+_+")")}return function(c,v){var m=[],_=[];return c=e(c),v=e(v),h(c.translateX,c.translateY,v.translateX,v.translateY,m,_),d(c.rotate,v.rotate,m,_),l(c.skewX,v.skewX,m,_),u(c.scaleX,c.scaleY,v.scaleX,v.scaleY,m,_),c=v=null,function(x){for(var C=-1,S=_.length,p;++C<S;)m[(p=_[C]).i]=p.x(x);return m.join("")}}}var z3=pw(H3,"px, ","px)","deg)"),I3=pw(P3,", ",")",")"),U3=1e-12;function fb(e){return((e=Math.exp(e))+1/e)/2}function F3(e){return((e=Math.exp(e))-1/e)/2}function $3(e){return((e=Math.exp(2*e))-1)/(e+1)}const zu=(function e(n,i,s){function a(h,d){var l=h[0],u=h[1],c=h[2],v=d[0],m=d[1],_=d[2],x=v-l,C=m-u,S=x*x+C*C,p,g;if(S<U3)g=Math.log(_/c)/n,p=function(D){return[l+D*x,u+D*C,c*Math.exp(n*D*g)]};else{var b=Math.sqrt(S),y=(_*_-c*c+s*S)/(2*c*i*b),E=(_*_-c*c-s*S)/(2*_*i*b),T=Math.log(Math.sqrt(y*y+1)-y),O=Math.log(Math.sqrt(E*E+1)-E);g=(O-T)/n,p=function(D){var A=D*g,N=fb(T),q=c/(i*b)*(N*$3(n*A+T)-F3(T));return[l+q*x,u+q*C,c*N/fb(n*A+T)]}}return p.duration=g*1e3*n/Math.SQRT2,p}return a.rho=function(h){var d=Math.max(.001,+h),l=d*d,u=l*l;return e(d,l,u)},a})(Math.SQRT2,2,4);var ta=0,ml=0,ul=0,gw=1e3,eh,pl,th=0,qs=0,xh=0,Dl=typeof performance=="object"&&performance.now?performance:Date,vw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Pp(){return qs||(vw(V3),qs=Dl.now()+xh)}function V3(){qs=0}function nh(){this._call=this._time=this._next=null}nh.prototype=zp.prototype={constructor:nh,restart:function(e,n,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Pp():+i)+(n==null?0:+n),!this._next&&pl!==this&&(pl?pl._next=this:eh=this,pl=this),this._call=e,this._time=i,Wm()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wm())}};function zp(e,n,i){var s=new nh;return s.restart(e,n,i),s}function q3(){Pp(),++ta;for(var e=eh,n;e;)(n=qs-e._time)>=0&&e._call.call(void 0,n),e=e._next;--ta}function db(){qs=(th=Dl.now())+xh,ta=ml=0;try{q3()}finally{ta=0,Y3(),qs=0}}function W3(){var e=Dl.now(),n=e-th;n>gw&&(xh-=n,th=e)}function Y3(){for(var e,n=eh,i,s=1/0;n;)n._call?(s>n._time&&(s=n._time),e=n,n=n._next):(i=n._next,n._next=null,n=e?e._next=i:eh=i);pl=e,Wm(s)}function Wm(e){if(!ta){ml&&(ml=clearTimeout(ml));var n=e-qs;n>24?(e<1/0&&(ml=setTimeout(db,e-Dl.now()-xh)),ul&&(ul=clearInterval(ul))):(ul||(th=Dl.now(),ul=setInterval(W3,gw)),ta=1,vw(db))}}function mb(e,n,i){var s=new nh;return n=n==null?0:+n,s.restart(a=>{s.stop(),e(a+n)},n,i),s}var K3=ql("start","end","cancel","interrupt"),G3=[],_w=0,pb=1,Ym=2,Iu=3,gb=4,Km=5,Uu=6;function wh(e,n,i,s,a,h){var d=e.__transition;if(!d)e.__transition={};else if(i in d)return;X3(e,i,{name:n,index:s,group:a,on:K3,tween:G3,time:h.time,delay:h.delay,duration:h.duration,ease:h.ease,timer:null,state:_w})}function Ip(e,n){var i=Cr(e,n);if(i.state>_w)throw new Error("too late; already scheduled");return i}function Wr(e,n){var i=Cr(e,n);if(i.state>Iu)throw new Error("too late; already running");return i}function Cr(e,n){var i=e.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function X3(e,n,i){var s=e.__transition,a;s[n]=i,i.timer=zp(h,0,i.time);function h(c){i.state=pb,i.timer.restart(d,i.delay,i.time),i.delay<=c&&d(c-i.delay)}function d(c){var v,m,_,x;if(i.state!==pb)return u();for(v in s)if(x=s[v],x.name===i.name){if(x.state===Iu)return mb(d);x.state===gb?(x.state=Uu,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete s[v]):+v<n&&(x.state=Uu,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete s[v])}if(mb(function(){i.state===Iu&&(i.state=gb,i.timer.restart(l,i.delay,i.time),l(c))}),i.state=Ym,i.on.call("start",e,e.__data__,i.index,i.group),i.state===Ym){for(i.state=Iu,a=new Array(_=i.tween.length),v=0,m=-1;v<_;++v)(x=i.tween[v].value.call(e,e.__data__,i.index,i.group))&&(a[++m]=x);a.length=m+1}}function l(c){for(var v=c<i.duration?i.ease.call(null,c/i.duration):(i.timer.restart(u),i.state=Km,1),m=-1,_=a.length;++m<_;)a[m].call(e,v);i.state===Km&&(i.on.call("end",e,e.__data__,i.index,i.group),u())}function u(){i.state=Uu,i.timer.stop(),delete s[n];for(var c in s)return;delete e.__transition}}function Fu(e,n){var i=e.__transition,s,a,h=!0,d;if(i){n=n==null?null:n+"";for(d in i){if((s=i[d]).name!==n){h=!1;continue}a=s.state>Ym&&s.state<Km,s.state=Uu,s.timer.stop(),s.on.call(a?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete i[d]}h&&delete e.__transition}}function Q3(e){return this.each(function(){Fu(this,e)})}function Z3(e,n){var i,s;return function(){var a=Wr(this,e),h=a.tween;if(h!==i){s=i=h;for(var d=0,l=s.length;d<l;++d)if(s[d].name===n){s=s.slice(),s.splice(d,1);break}}a.tween=s}}function J3(e,n,i){var s,a;if(typeof i!="function")throw new Error;return function(){var h=Wr(this,e),d=h.tween;if(d!==s){a=(s=d).slice();for(var l={name:n,value:i},u=0,c=a.length;u<c;++u)if(a[u].name===n){a[u]=l;break}u===c&&a.push(l)}h.tween=a}}function eL(e,n){var i=this._id;if(e+="",arguments.length<2){for(var s=Cr(this.node(),i).tween,a=0,h=s.length,d;a<h;++a)if((d=s[a]).name===e)return d.value;return null}return this.each((n==null?Z3:J3)(i,e,n))}function Up(e,n,i){var s=e._id;return e.each(function(){var a=Wr(this,s);(a.value||(a.value={}))[n]=i.apply(this,arguments)}),function(a){return Cr(a,s).value[n]}}function yw(e,n){var i;return(typeof n=="number"?kr:n instanceof Vs?Ju:(i=Vs(n))?(n=i,Ju):dw)(e,n)}function tL(e){return function(){this.removeAttribute(e)}}function nL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rL(e,n,i){var s,a=i+"",h;return function(){var d=this.getAttribute(e);return d===a?null:d===s?h:h=n(s=d,i)}}function iL(e,n,i){var s,a=i+"",h;return function(){var d=this.getAttributeNS(e.space,e.local);return d===a?null:d===s?h:h=n(s=d,i)}}function sL(e,n,i){var s,a,h;return function(){var d,l=i(this),u;return l==null?void this.removeAttribute(e):(d=this.getAttribute(e),u=l+"",d===u?null:d===s&&u===a?h:(a=u,h=n(s=d,l)))}}function oL(e,n,i){var s,a,h;return function(){var d,l=i(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(d=this.getAttributeNS(e.space,e.local),u=l+"",d===u?null:d===s&&u===a?h:(a=u,h=n(s=d,l)))}}function aL(e,n){var i=Sh(e),s=i==="transform"?I3:yw;return this.attrTween(e,typeof n=="function"?(i.local?oL:sL)(i,s,Up(this,"attr."+e,n)):n==null?(i.local?nL:tL)(i):(i.local?iL:rL)(i,s,n))}function lL(e,n){return function(i){this.setAttribute(e,n.call(this,i))}}function cL(e,n){return function(i){this.setAttributeNS(e.space,e.local,n.call(this,i))}}function uL(e,n){var i,s;function a(){var h=n.apply(this,arguments);return h!==s&&(i=(s=h)&&cL(e,h)),i}return a._value=n,a}function hL(e,n){var i,s;function a(){var h=n.apply(this,arguments);return h!==s&&(i=(s=h)&&lL(e,h)),i}return a._value=n,a}function fL(e,n){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var s=Sh(e);return this.tween(i,(s.local?uL:hL)(s,n))}function dL(e,n){return function(){Ip(this,e).delay=+n.apply(this,arguments)}}function mL(e,n){return n=+n,function(){Ip(this,e).delay=n}}function pL(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?dL:mL)(n,e)):Cr(this.node(),n).delay}function gL(e,n){return function(){Wr(this,e).duration=+n.apply(this,arguments)}}function vL(e,n){return n=+n,function(){Wr(this,e).duration=n}}function _L(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?gL:vL)(n,e)):Cr(this.node(),n).duration}function yL(e,n){if(typeof n!="function")throw new Error;return function(){Wr(this,e).ease=n}}function bL(e){var n=this._id;return arguments.length?this.each(yL(n,e)):Cr(this.node(),n).ease}function SL(e,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;Wr(this,e).ease=i}}function xL(e){if(typeof e!="function")throw new Error;return this.each(SL(this._id,e))}function wL(e){typeof e!="function"&&(e=Qx(e));for(var n=this._groups,i=n.length,s=new Array(i),a=0;a<i;++a)for(var h=n[a],d=h.length,l=s[a]=[],u,c=0;c<d;++c)(u=h[c])&&e.call(u,u.__data__,c,h)&&l.push(u);return new Ei(s,this._parents,this._name,this._id)}function CL(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,i=e._groups,s=n.length,a=i.length,h=Math.min(s,a),d=new Array(s),l=0;l<h;++l)for(var u=n[l],c=i[l],v=u.length,m=d[l]=new Array(v),_,x=0;x<v;++x)(_=u[x]||c[x])&&(m[x]=_);for(;l<s;++l)d[l]=n[l];return new Ei(d,this._parents,this._name,this._id)}function EL(e){return(e+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function RL(e,n,i){var s,a,h=EL(n)?Ip:Wr;return function(){var d=h(this,e),l=d.on;l!==s&&(a=(s=l).copy()).on(n,i),d.on=a}}function AL(e,n){var i=this._id;return arguments.length<2?Cr(this.node(),i).on.on(e):this.each(RL(i,e,n))}function DL(e){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==e)return;n&&n.removeChild(this)}}function TL(){return this.on("end.remove",DL(this._id))}function ML(e){var n=this._name,i=this._id;typeof e!="function"&&(e=kp(e));for(var s=this._groups,a=s.length,h=new Array(a),d=0;d<a;++d)for(var l=s[d],u=l.length,c=h[d]=new Array(u),v,m,_=0;_<u;++_)(v=l[_])&&(m=e.call(v,v.__data__,_,l))&&("__data__"in v&&(m.__data__=v.__data__),c[_]=m,wh(c[_],n,i,_,c,Cr(v,i)));return new Ei(h,this._parents,n,i)}function OL(e){var n=this._name,i=this._id;typeof e!="function"&&(e=Xx(e));for(var s=this._groups,a=s.length,h=[],d=[],l=0;l<a;++l)for(var u=s[l],c=u.length,v,m=0;m<c;++m)if(v=u[m]){for(var _=e.call(v,v.__data__,m,u),x,C=Cr(v,i),S=0,p=_.length;S<p;++S)(x=_[S])&&wh(x,n,i,S,_,C);h.push(_),d.push(v)}return new Ei(h,d,n,i)}var LL=Wl.prototype.constructor;function NL(){return new LL(this._groups,this._parents)}function kL(e,n){var i,s,a;return function(){var h=ea(this,e),d=(this.style.removeProperty(e),ea(this,e));return h===d?null:h===i&&d===s?a:a=n(i=h,s=d)}}function bw(e){return function(){this.style.removeProperty(e)}}function BL(e,n,i){var s,a=i+"",h;return function(){var d=ea(this,e);return d===a?null:d===s?h:h=n(s=d,i)}}function jL(e,n,i){var s,a,h;return function(){var d=ea(this,e),l=i(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),ea(this,e))),d===u?null:d===s&&u===a?h:(a=u,h=n(s=d,l))}}function HL(e,n){var i,s,a,h="style."+n,d="end."+h,l;return function(){var u=Wr(this,e),c=u.on,v=u.value[h]==null?l||(l=bw(n)):void 0;(c!==i||a!==v)&&(s=(i=c).copy()).on(d,a=v),u.on=s}}function PL(e,n,i){var s=(e+="")=="transform"?z3:yw;return n==null?this.styleTween(e,kL(e,s)).on("end.style."+e,bw(e)):typeof n=="function"?this.styleTween(e,jL(e,s,Up(this,"style."+e,n))).each(HL(this._id,e)):this.styleTween(e,BL(e,s,n),i).on("end.style."+e,null)}function zL(e,n,i){return function(s){this.style.setProperty(e,n.call(this,s),i)}}function IL(e,n,i){var s,a;function h(){var d=n.apply(this,arguments);return d!==a&&(s=(a=d)&&zL(e,d,i)),s}return h._value=n,h}function UL(e,n,i){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(n==null)return this.tween(s,null);if(typeof n!="function")throw new Error;return this.tween(s,IL(e,n,i??""))}function FL(e){return function(){this.textContent=e}}function $L(e){return function(){var n=e(this);this.textContent=n??""}}function VL(e){return this.tween("text",typeof e=="function"?$L(Up(this,"text",e)):FL(e==null?"":e+""))}function qL(e){return function(n){this.textContent=e.call(this,n)}}function WL(e){var n,i;function s(){var a=e.apply(this,arguments);return a!==i&&(n=(i=a)&&qL(a)),n}return s._value=e,s}function YL(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,WL(e))}function KL(){for(var e=this._name,n=this._id,i=Sw(),s=this._groups,a=s.length,h=0;h<a;++h)for(var d=s[h],l=d.length,u,c=0;c<l;++c)if(u=d[c]){var v=Cr(u,n);wh(u,e,i,c,d,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new Ei(s,this._parents,e,i)}function GL(){var e,n,i=this,s=i._id,a=i.size();return new Promise(function(h,d){var l={value:d},u={value:function(){--a===0&&h()}};i.each(function(){var c=Wr(this,s),v=c.on;v!==e&&(n=(e=v).copy(),n._.cancel.push(l),n._.interrupt.push(l),n._.end.push(u)),c.on=n}),a===0&&h()})}var XL=0;function Ei(e,n,i,s){this._groups=e,this._parents=n,this._name=i,this._id=s}function Sw(){return++XL}var yi=Wl.prototype;Ei.prototype={constructor:Ei,select:ML,selectAll:OL,selectChild:yi.selectChild,selectChildren:yi.selectChildren,filter:wL,merge:CL,selection:NL,transition:KL,call:yi.call,nodes:yi.nodes,node:yi.node,size:yi.size,empty:yi.empty,each:yi.each,on:AL,attr:aL,attrTween:fL,style:PL,styleTween:UL,text:VL,textTween:YL,remove:TL,tween:eL,delay:pL,duration:_L,ease:bL,easeVarying:xL,end:GL,[Symbol.iterator]:yi[Symbol.iterator]};function QL(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ZL={time:null,delay:0,duration:250,ease:QL};function JL(e,n){for(var i;!(i=e.__transition)||!(i=i[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return i}function eN(e){var n,i;e instanceof Ei?(n=e._id,e=e._name):(n=Sw(),(i=ZL).time=Pp(),e=e==null?null:e+"");for(var s=this._groups,a=s.length,h=0;h<a;++h)for(var d=s[h],l=d.length,u,c=0;c<l;++c)(u=d[c])&&wh(u,e,n,c,d,i||JL(u,n));return new Ei(s,this._parents,e,n)}Wl.prototype.interrupt=Q3;Wl.prototype.transition=eN;const xu=e=>()=>e;function tN(e,{sourceEvent:n,target:i,transform:s,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:a}})}function Si(e,n,i){this.k=e,this.x=n,this.y=i}Si.prototype={constructor:Si,scale:function(e){return e===1?this:new Si(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Si(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ch=new Si(1,0,0);xw.prototype=Si.prototype;function xw(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ch;return e.__zoom}function lm(e){e.stopImmediatePropagation()}function hl(e){e.preventDefault(),e.stopImmediatePropagation()}function nN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function rN(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function vb(){return this.__zoom||Ch}function iN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sN(){return navigator.maxTouchPoints||"ontouchstart"in this}function oN(e,n,i){var s=e.invertX(n[0][0])-i[0][0],a=e.invertX(n[1][0])-i[1][0],h=e.invertY(n[0][1])-i[0][1],d=e.invertY(n[1][1])-i[1][1];return e.translate(a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a),d>h?(h+d)/2:Math.min(0,h)||Math.max(0,d))}function ww(){var e=nN,n=rN,i=oN,s=iN,a=sN,h=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],l=250,u=zu,c=ql("start","zoom","end"),v,m,_,x=500,C=150,S=0,p=10;function g(U){U.property("__zoom",vb).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",q).filter(a).on("touchstart.zoom",P).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(U,G,H,K){var F=U.selection?U.selection():U;F.property("__zoom",vb),U!==F?T(U,G,H,K):F.interrupt().each(function(){O(this,arguments).event(K).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},g.scaleBy=function(U,G,H,K){g.scaleTo(U,function(){var F=this.__zoom.k,k=typeof G=="function"?G.apply(this,arguments):G;return F*k},H,K)},g.scaleTo=function(U,G,H,K){g.transform(U,function(){var F=n.apply(this,arguments),k=this.__zoom,$=H==null?E(F):typeof H=="function"?H.apply(this,arguments):H,B=k.invert($),I=typeof G=="function"?G.apply(this,arguments):G;return i(y(b(k,I),$,B),F,d)},H,K)},g.translateBy=function(U,G,H,K){g.transform(U,function(){return i(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof H=="function"?H.apply(this,arguments):H),n.apply(this,arguments),d)},null,K)},g.translateTo=function(U,G,H,K,F){g.transform(U,function(){var k=n.apply(this,arguments),$=this.__zoom,B=K==null?E(k):typeof K=="function"?K.apply(this,arguments):K;return i(Ch.translate(B[0],B[1]).scale($.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof H=="function"?-H.apply(this,arguments):-H),k,d)},K,F)};function b(U,G){return G=Math.max(h[0],Math.min(h[1],G)),G===U.k?U:new Si(G,U.x,U.y)}function y(U,G,H){var K=G[0]-H[0]*U.k,F=G[1]-H[1]*U.k;return K===U.x&&F===U.y?U:new Si(U.k,K,F)}function E(U){return[(+U[0][0]+ +U[1][0])/2,(+U[0][1]+ +U[1][1])/2]}function T(U,G,H,K){U.on("start.zoom",function(){O(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(K).end()}).tween("zoom",function(){var F=this,k=arguments,$=O(F,k).event(K),B=n.apply(F,k),I=H==null?E(B):typeof H=="function"?H.apply(F,k):H,Q=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),J=F.__zoom,ae=typeof G=="function"?G.apply(F,k):G,Z=u(J.invert(I).concat(Q/J.k),ae.invert(I).concat(Q/ae.k));return function(X){if(X===1)X=ae;else{var V=Z(X),ie=Q/V[2];X=new Si(ie,I[0]-V[0]*ie,I[1]-V[1]*ie)}$.zoom(null,X)}})}function O(U,G,H){return!H&&U.__zooming||new D(U,G)}function D(U,G){this.that=U,this.args=G,this.active=0,this.sourceEvent=null,this.extent=n.apply(U,G),this.taps=0}D.prototype={event:function(U){return U&&(this.sourceEvent=U),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(U,G){return this.mouse&&U!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&U!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&U!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(U){var G=$n(this.that).datum();c.call(U,this.that,new tN(U,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:c}),G)}};function A(U,...G){if(!e.apply(this,arguments))return;var H=O(this,G).event(U),K=this.__zoom,F=Math.max(h[0],Math.min(h[1],K.k*Math.pow(2,s.apply(this,arguments)))),k=gr(U);if(H.wheel)(H.mouse[0][0]!==k[0]||H.mouse[0][1]!==k[1])&&(H.mouse[1]=K.invert(H.mouse[0]=k)),clearTimeout(H.wheel);else{if(K.k===F)return;H.mouse=[k,K.invert(k)],Fu(this),H.start()}hl(U),H.wheel=setTimeout($,C),H.zoom("mouse",i(y(b(K,F),H.mouse[0],H.mouse[1]),H.extent,d));function $(){H.wheel=null,H.end()}}function N(U,...G){if(_||!e.apply(this,arguments))return;var H=U.currentTarget,K=O(this,G,!0).event(U),F=$n(U.view).on("mousemove.zoom",I,!0).on("mouseup.zoom",Q,!0),k=gr(U,H),$=U.clientX,B=U.clientY;aw(U.view),lm(U),K.mouse=[k,this.__zoom.invert(k)],Fu(this),K.start();function I(J){if(hl(J),!K.moved){var ae=J.clientX-$,Z=J.clientY-B;K.moved=ae*ae+Z*Z>S}K.event(J).zoom("mouse",i(y(K.that.__zoom,K.mouse[0]=gr(J,H),K.mouse[1]),K.extent,d))}function Q(J){F.on("mousemove.zoom mouseup.zoom",null),lw(J.view,K.moved),hl(J),K.event(J).end()}}function q(U,...G){if(e.apply(this,arguments)){var H=this.__zoom,K=gr(U.changedTouches?U.changedTouches[0]:U,this),F=H.invert(K),k=H.k*(U.shiftKey?.5:2),$=i(y(b(H,k),K,F),n.apply(this,G),d);hl(U),l>0?$n(this).transition().duration(l).call(T,$,K,U):$n(this).call(g.transform,$,K,U)}}function P(U,...G){if(e.apply(this,arguments)){var H=U.touches,K=H.length,F=O(this,G,U.changedTouches.length===K).event(U),k,$,B,I;for(lm(U),$=0;$<K;++$)B=H[$],I=gr(B,this),I=[I,this.__zoom.invert(I),B.identifier],F.touch0?!F.touch1&&F.touch0[2]!==I[2]&&(F.touch1=I,F.taps=0):(F.touch0=I,k=!0,F.taps=1+!!v);v&&(v=clearTimeout(v)),k&&(F.taps<2&&(m=I[0],v=setTimeout(function(){v=null},x)),Fu(this),F.start())}}function z(U,...G){if(this.__zooming){var H=O(this,G).event(U),K=U.changedTouches,F=K.length,k,$,B,I;for(hl(U),k=0;k<F;++k)$=K[k],B=gr($,this),H.touch0&&H.touch0[2]===$.identifier?H.touch0[0]=B:H.touch1&&H.touch1[2]===$.identifier&&(H.touch1[0]=B);if($=H.that.__zoom,H.touch1){var Q=H.touch0[0],J=H.touch0[1],ae=H.touch1[0],Z=H.touch1[1],X=(X=ae[0]-Q[0])*X+(X=ae[1]-Q[1])*X,V=(V=Z[0]-J[0])*V+(V=Z[1]-J[1])*V;$=b($,Math.sqrt(X/V)),B=[(Q[0]+ae[0])/2,(Q[1]+ae[1])/2],I=[(J[0]+Z[0])/2,(J[1]+Z[1])/2]}else if(H.touch0)B=H.touch0[0],I=H.touch0[1];else return;H.zoom("touch",i(y($,B,I),H.extent,d))}}function W(U,...G){if(this.__zooming){var H=O(this,G).event(U),K=U.changedTouches,F=K.length,k,$;for(lm(U),_&&clearTimeout(_),_=setTimeout(function(){_=null},x),k=0;k<F;++k)$=K[k],H.touch0&&H.touch0[2]===$.identifier?delete H.touch0:H.touch1&&H.touch1[2]===$.identifier&&delete H.touch1;if(H.touch1&&!H.touch0&&(H.touch0=H.touch1,delete H.touch1),H.touch0)H.touch0[1]=this.__zoom.invert(H.touch0[0]);else if(H.end(),H.taps===2&&($=gr($,this),Math.hypot(m[0]-$[0],m[1]-$[1])<p)){var B=$n(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return g.wheelDelta=function(U){return arguments.length?(s=typeof U=="function"?U:xu(+U),g):s},g.filter=function(U){return arguments.length?(e=typeof U=="function"?U:xu(!!U),g):e},g.touchable=function(U){return arguments.length?(a=typeof U=="function"?U:xu(!!U),g):a},g.extent=function(U){return arguments.length?(n=typeof U=="function"?U:xu([[+U[0][0],+U[0][1]],[+U[1][0],+U[1][1]]]),g):n},g.scaleExtent=function(U){return arguments.length?(h[0]=+U[0],h[1]=+U[1],g):[h[0],h[1]]},g.translateExtent=function(U){return arguments.length?(d[0][0]=+U[0][0],d[1][0]=+U[1][0],d[0][1]=+U[0][1],d[1][1]=+U[1][1],g):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},g.constrain=function(U){return arguments.length?(i=U,g):i},g.duration=function(U){return arguments.length?(l=+U,g):l},g.interpolate=function(U){return arguments.length?(u=U,g):u},g.on=function(){var U=c.on.apply(c,arguments);return U===c?g:U},g.clickDistance=function(U){return arguments.length?(S=(U=+U)*U,g):Math.sqrt(S)},g.tapDistance=function(U){return arguments.length?(p=+U,g):p},g}const $r={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:i,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?i:s}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Tl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Cw=["Enter"," ","Escape"],Ew={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:i})=>`Moved selected node ${e}. New position, x: ${n}, y: ${i}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var na;(function(e){e.Strict="strict",e.Loose="loose"})(na||(na={}));var Is;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Is||(Is={}));var Ml;(function(e){e.Partial="partial",e.Full="full"})(Ml||(Ml={}));const Rw={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ss;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ss||(ss={}));var rh;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(rh||(rh={}));var Ne;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ne||(Ne={}));const _b={[Ne.Left]:Ne.Right,[Ne.Right]:Ne.Left,[Ne.Top]:Ne.Bottom,[Ne.Bottom]:Ne.Top};function Aw(e){return e===null?null:e?"valid":"invalid"}const Dw=e=>"id"in e&&"source"in e&&"target"in e,aN=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Fp=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Kl=(e,n=[0,0])=>{const{width:i,height:s}=Di(e),a=e.origin??n,h=i*a[0],d=s*a[1];return{x:e.position.x-h,y:e.position.y-d}},lN=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((s,a)=>{const h=typeof a=="string";let d=!n.nodeLookup&&!h?a:void 0;n.nodeLookup&&(d=h?n.nodeLookup.get(a):Fp(a)?a:n.nodeLookup.get(a.id));const l=d?ih(d,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Eh(s,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Rh(i)},Gl=(e,n={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(a=>{(n.filter===void 0||n.filter(a))&&(i=Eh(i,ih(a)),s=!0)}),s?Rh(i):{x:0,y:0,width:0,height:0}},$p=(e,n,[i,s,a]=[0,0,1],h=!1,d=!1)=>{const l={...Ql(n,[i,s,a]),width:n.width/a,height:n.height/a},u=[];for(const c of e.values()){const{measured:v,selectable:m=!0,hidden:_=!1}=c;if(d&&!m||_)continue;const x=v.width??c.width??c.initialWidth??null,C=v.height??c.height??c.initialHeight??null,S=Ol(l,ia(c)),p=(x??0)*(C??0),g=h&&S>0;(!c.internals.handleBounds||g||S>=p||c.dragging)&&u.push(c)}return u},cN=(e,n)=>{const i=new Set;return e.forEach(s=>{i.add(s.id)}),n.filter(s=>i.has(s.source)||i.has(s.target))};function uN(e,n){const i=new Map,s=n?.nodes?new Set(n.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&(n?.includeHiddenNodes||!a.hidden)&&(!s||s.has(a.id))&&i.set(a.id,a)}),i}async function hN({nodes:e,width:n,height:i,panZoom:s,minZoom:a,maxZoom:h},d){if(e.size===0)return Promise.resolve(!0);const l=uN(e,d),u=Gl(l),c=Vp(u,n,i,d?.minZoom??a,d?.maxZoom??h,d?.padding??.1);return await s.setViewport(c,{duration:d?.duration,ease:d?.ease,interpolate:d?.interpolate}),Promise.resolve(!0)}function Tw({nodeId:e,nextPosition:n,nodeLookup:i,nodeOrigin:s=[0,0],nodeExtent:a,onError:h}){const d=i.get(e),l=d.parentId?i.get(d.parentId):void 0,{x:u,y:c}=l?l.internals.positionAbsolute:{x:0,y:0},v=d.origin??s;let m=d.extent||a;if(d.extent==="parent"&&!d.expandParent)if(!l)h?.("005",$r.error005());else{const x=l.measured.width,C=l.measured.height;x&&C&&(m=[[u,c],[u+x,c+C]])}else l&&sa(d.extent)&&(m=[[d.extent[0][0]+u,d.extent[0][1]+c],[d.extent[1][0]+u,d.extent[1][1]+c]]);const _=sa(m)?Ws(n,m,d.measured):n;return(d.measured.width===void 0||d.measured.height===void 0)&&h?.("015",$r.error015()),{position:{x:_.x-u+(d.measured.width??0)*v[0],y:_.y-c+(d.measured.height??0)*v[1]},positionAbsolute:_}}async function fN({nodesToRemove:e=[],edgesToRemove:n=[],nodes:i,edges:s,onBeforeDelete:a}){const h=new Set(e.map(_=>_.id)),d=[];for(const _ of i){if(_.deletable===!1)continue;const x=h.has(_.id),C=!x&&_.parentId&&d.find(S=>S.id===_.parentId);(x||C)&&d.push(_)}const l=new Set(n.map(_=>_.id)),u=s.filter(_=>_.deletable!==!1),v=cN(d,u);for(const _ of u)l.has(_.id)&&!v.find(C=>C.id===_.id)&&v.push(_);if(!a)return{edges:v,nodes:d};const m=await a({nodes:d,edges:v});return typeof m=="boolean"?m?{edges:v,nodes:d}:{edges:[],nodes:[]}:m}const ra=(e,n=0,i=1)=>Math.min(Math.max(e,n),i),Ws=(e={x:0,y:0},n,i)=>({x:ra(e.x,n[0][0],n[1][0]-(i?.width??0)),y:ra(e.y,n[0][1],n[1][1]-(i?.height??0))});function Mw(e,n,i){const{width:s,height:a}=Di(i),{x:h,y:d}=i.internals.positionAbsolute;return Ws(e,[[h,d],[h+s,d+a]],n)}const yb=(e,n,i)=>e<n?ra(Math.abs(e-n),1,n)/n:e>i?-ra(Math.abs(e-i),1,n)/n:0,Ow=(e,n,i=15,s=40)=>{const a=yb(e.x,s,n.width-s)*i,h=yb(e.y,s,n.height-s)*i;return[a,h]},Eh=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Gm=({x:e,y:n,width:i,height:s})=>({x:e,y:n,x2:e+i,y2:n+s}),Rh=({x:e,y:n,x2:i,y2:s})=>({x:e,y:n,width:i-e,height:s-n}),ia=(e,n=[0,0])=>{const{x:i,y:s}=Fp(e)?e.internals.positionAbsolute:Kl(e,n);return{x:i,y:s,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},ih=(e,n=[0,0])=>{const{x:i,y:s}=Fp(e)?e.internals.positionAbsolute:Kl(e,n);return{x:i,y:s,x2:i+(e.measured?.width??e.width??e.initialWidth??0),y2:s+(e.measured?.height??e.height??e.initialHeight??0)}},Lw=(e,n)=>Rh(Eh(Gm(e),Gm(n))),Ol=(e,n)=>{const i=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),s=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(i*s)},bb=e=>yr(e.width)&&yr(e.height)&&yr(e.x)&&yr(e.y),yr=e=>!isNaN(e)&&isFinite(e),dN=(e,n)=>{},Xl=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),Ql=({x:e,y:n},[i,s,a],h=!1,d=[1,1])=>{const l={x:(e-i)/a,y:(n-s)/a};return h?Xl(l,d):l},sh=({x:e,y:n},[i,s,a])=>({x:e*a+i,y:n*a+s});function Uo(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(i)}if(typeof e=="string"&&e.endsWith("%")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(n*i*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function mN(e,n,i){if(typeof e=="string"||typeof e=="number"){const s=Uo(e,i),a=Uo(e,n);return{top:s,right:a,bottom:s,left:a,x:a*2,y:s*2}}if(typeof e=="object"){const s=Uo(e.top??e.y??0,i),a=Uo(e.bottom??e.y??0,i),h=Uo(e.left??e.x??0,n),d=Uo(e.right??e.x??0,n);return{top:s,right:d,bottom:a,left:h,x:h+d,y:s+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function pN(e,n,i,s,a,h){const{x:d,y:l}=sh(e,[n,i,s]),{x:u,y:c}=sh({x:e.x+e.width,y:e.y+e.height},[n,i,s]),v=a-u,m=h-c;return{left:Math.floor(d),top:Math.floor(l),right:Math.floor(v),bottom:Math.floor(m)}}const Vp=(e,n,i,s,a,h)=>{const d=mN(h,n,i),l=(n-d.x)/e.width,u=(i-d.y)/e.height,c=Math.min(l,u),v=ra(c,s,a),m=e.x+e.width/2,_=e.y+e.height/2,x=n/2-m*v,C=i/2-_*v,S=pN(e,x,C,v,n,i),p={left:Math.min(S.left-d.left,0),top:Math.min(S.top-d.top,0),right:Math.min(S.right-d.right,0),bottom:Math.min(S.bottom-d.bottom,0)};return{x:x-p.left+p.right,y:C-p.top+p.bottom,zoom:v}},Ll=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function sa(e){return e!=null&&e!=="parent"}function Di(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Nw(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function kw(e,n={width:0,height:0},i,s,a){const h={...e},d=s.get(i);if(d){const l=d.origin||a;h.x+=d.internals.positionAbsolute.x-(n.width??0)*l[0],h.y+=d.internals.positionAbsolute.y-(n.height??0)*l[1]}return h}function Sb(e,n){if(e.size!==n.size)return!1;for(const i of e)if(!n.has(i))return!1;return!0}function gN(){let e,n;return{promise:new Promise((s,a)=>{e=s,n=a}),resolve:e,reject:n}}function vN(e){return{...Ew,...e||{}}}function bl(e,{snapGrid:n=[0,0],snapToGrid:i=!1,transform:s,containerBounds:a}){const{x:h,y:d}=br(e),l=Ql({x:h-(a?.left??0),y:d-(a?.top??0)},s),{x:u,y:c}=i?Xl(l,n):l;return{xSnapped:u,ySnapped:c,...l}}const qp=e=>({width:e.offsetWidth,height:e.offsetHeight}),Bw=e=>e?.getRootNode?.()||window?.document,_N=["INPUT","SELECT","TEXTAREA"];function jw(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:_N.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const Hw=e=>"clientX"in e,br=(e,n)=>{const i=Hw(e),s=i?e.clientX:e.touches?.[0].clientX,a=i?e.clientY:e.touches?.[0].clientY;return{x:s-(n?.left??0),y:a-(n?.top??0)}},xb=(e,n,i,s,a)=>{const h=n.querySelectorAll(`.${e}`);return!h||!h.length?null:Array.from(h).map(d=>{const l=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:e,nodeId:a,position:d.getAttribute("data-handlepos"),x:(l.left-i.left)/s,y:(l.top-i.top)/s,...qp(d)}})};function Pw({sourceX:e,sourceY:n,targetX:i,targetY:s,sourceControlX:a,sourceControlY:h,targetControlX:d,targetControlY:l}){const u=e*.125+a*.375+d*.375+i*.125,c=n*.125+h*.375+l*.375+s*.125,v=Math.abs(u-e),m=Math.abs(c-n);return[u,c,v,m]}function wu(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function wb({pos:e,x1:n,y1:i,x2:s,y2:a,c:h}){switch(e){case Ne.Left:return[n-wu(n-s,h),i];case Ne.Right:return[n+wu(s-n,h),i];case Ne.Top:return[n,i-wu(i-a,h)];case Ne.Bottom:return[n,i+wu(a-i,h)]}}function Wp({sourceX:e,sourceY:n,sourcePosition:i=Ne.Bottom,targetX:s,targetY:a,targetPosition:h=Ne.Top,curvature:d=.25}){const[l,u]=wb({pos:i,x1:e,y1:n,x2:s,y2:a,c:d}),[c,v]=wb({pos:h,x1:s,y1:a,x2:e,y2:n,c:d}),[m,_,x,C]=Pw({sourceX:e,sourceY:n,targetX:s,targetY:a,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:v});return[`M${e},${n} C${l},${u} ${c},${v} ${s},${a}`,m,_,x,C]}function zw({sourceX:e,sourceY:n,targetX:i,targetY:s}){const a=Math.abs(i-e)/2,h=i<e?i+a:i-a,d=Math.abs(s-n)/2,l=s<n?s+d:s-d;return[h,l,a,d]}function yN({sourceNode:e,targetNode:n,selected:i=!1,zIndex:s=0,elevateOnSelect:a=!1,zIndexMode:h="basic"}){if(h==="manual")return s;const d=a&&i?s+1e3:s,l=Math.max(e.parentId||a&&e.selected?e.internals.z:0,n.parentId||a&&n.selected?n.internals.z:0);return d+l}function bN({sourceNode:e,targetNode:n,width:i,height:s,transform:a}){const h=Eh(ih(e),ih(n));h.x===h.x2&&(h.x2+=1),h.y===h.y2&&(h.y2+=1);const d={x:-a[0]/a[2],y:-a[1]/a[2],width:i/a[2],height:s/a[2]};return Ol(d,Rh(h))>0}const SN=({source:e,sourceHandle:n,target:i,targetHandle:s})=>`xy-edge__${e}${n||""}-${i}${s||""}`,xN=(e,n)=>n.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),wN=(e,n,i={})=>{if(!e.source||!e.target)return n;const s=i.getEdgeId||SN;let a;return Dw(e)?a={...e}:a={...e,id:s(e)},xN(a,n)?n:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,n.concat(a))};function Iw({sourceX:e,sourceY:n,targetX:i,targetY:s}){const[a,h,d,l]=zw({sourceX:e,sourceY:n,targetX:i,targetY:s});return[`M ${e},${n}L ${i},${s}`,a,h,d,l]}const Cb={[Ne.Left]:{x:-1,y:0},[Ne.Right]:{x:1,y:0},[Ne.Top]:{x:0,y:-1},[Ne.Bottom]:{x:0,y:1}},CN=({source:e,sourcePosition:n=Ne.Bottom,target:i})=>n===Ne.Left||n===Ne.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},Eb=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function EN({source:e,sourcePosition:n=Ne.Bottom,target:i,targetPosition:s=Ne.Top,center:a,offset:h,stepPosition:d}){const l=Cb[n],u=Cb[s],c={x:e.x+l.x*h,y:e.y+l.y*h},v={x:i.x+u.x*h,y:i.y+u.y*h},m=CN({source:c,sourcePosition:n,target:v}),_=m.x!==0?"x":"y",x=m[_];let C=[],S,p;const g={x:0,y:0},b={x:0,y:0},[,,y,E]=zw({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(l[_]*u[_]===-1){_==="x"?(S=a.x??c.x+(v.x-c.x)*d,p=a.y??(c.y+v.y)/2):(S=a.x??(c.x+v.x)/2,p=a.y??c.y+(v.y-c.y)*d);const O=[{x:S,y:c.y},{x:S,y:v.y}],D=[{x:c.x,y:p},{x:v.x,y:p}];l[_]===x?C=_==="x"?O:D:C=_==="x"?D:O}else{const O=[{x:c.x,y:v.y}],D=[{x:v.x,y:c.y}];if(_==="x"?C=l.x===x?D:O:C=l.y===x?O:D,n===s){const z=Math.abs(e[_]-i[_]);if(z<=h){const W=Math.min(h-1,h-z);l[_]===x?g[_]=(c[_]>e[_]?-1:1)*W:b[_]=(v[_]>i[_]?-1:1)*W}}if(n!==s){const z=_==="x"?"y":"x",W=l[_]===u[z],U=c[z]>v[z],G=c[z]<v[z];(l[_]===1&&(!W&&U||W&&G)||l[_]!==1&&(!W&&G||W&&U))&&(C=_==="x"?O:D)}const A={x:c.x+g.x,y:c.y+g.y},N={x:v.x+b.x,y:v.y+b.y},q=Math.max(Math.abs(A.x-C[0].x),Math.abs(N.x-C[0].x)),P=Math.max(Math.abs(A.y-C[0].y),Math.abs(N.y-C[0].y));q>=P?(S=(A.x+N.x)/2,p=C[0].y):(S=C[0].x,p=(A.y+N.y)/2)}return[[e,{x:c.x+g.x,y:c.y+g.y},...C,{x:v.x+b.x,y:v.y+b.y},i],S,p,y,E]}function RN(e,n,i,s){const a=Math.min(Eb(e,n)/2,Eb(n,i)/2,s),{x:h,y:d}=n;if(e.x===h&&h===i.x||e.y===d&&d===i.y)return`L${h} ${d}`;if(e.y===d){const c=e.x<i.x?-1:1,v=e.y<i.y?1:-1;return`L ${h+a*c},${d}Q ${h},${d} ${h},${d+a*v}`}const l=e.x<i.x?1:-1,u=e.y<i.y?-1:1;return`L ${h},${d+a*u}Q ${h},${d} ${h+a*l},${d}`}function Xm({sourceX:e,sourceY:n,sourcePosition:i=Ne.Bottom,targetX:s,targetY:a,targetPosition:h=Ne.Top,borderRadius:d=5,centerX:l,centerY:u,offset:c=20,stepPosition:v=.5}){const[m,_,x,C,S]=EN({source:{x:e,y:n},sourcePosition:i,target:{x:s,y:a},targetPosition:h,center:{x:l,y:u},offset:c,stepPosition:v});return[m.reduce((g,b,y)=>{let E="";return y>0&&y<m.length-1?E=RN(m[y-1],b,m[y+1],d):E=`${y===0?"M":"L"}${b.x} ${b.y}`,g+=E,g},""),_,x,C,S]}function Rb(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function AN(e){const{sourceNode:n,targetNode:i}=e;if(!Rb(n)||!Rb(i))return null;const s=n.internals.handleBounds||Ab(n.handles),a=i.internals.handleBounds||Ab(i.handles),h=Db(s?.source??[],e.sourceHandle),d=Db(e.connectionMode===na.Strict?a?.target??[]:(a?.target??[]).concat(a?.source??[]),e.targetHandle);if(!h||!d)return e.onError?.("008",$r.error008(h?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=h?.position||Ne.Bottom,u=d?.position||Ne.Top,c=Ys(n,h,l),v=Ys(i,d,u);return{sourceX:c.x,sourceY:c.y,targetX:v.x,targetY:v.y,sourcePosition:l,targetPosition:u}}function Ab(e){if(!e)return null;const n=[],i=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?n.push(s):s.type==="target"&&i.push(s);return{source:n,target:i}}function Ys(e,n,i=Ne.Left,s=!1){const a=(n?.x??0)+e.internals.positionAbsolute.x,h=(n?.y??0)+e.internals.positionAbsolute.y,{width:d,height:l}=n??Di(e);if(s)return{x:a+d/2,y:h+l/2};switch(n?.position??i){case Ne.Top:return{x:a+d/2,y:h};case Ne.Right:return{x:a+d,y:h+l/2};case Ne.Bottom:return{x:a+d/2,y:h+l};case Ne.Left:return{x:a,y:h+l/2}}}function Db(e,n){return e&&(n?e.find(i=>i.id===n):e[0])||null}function Qm(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function DN(e,{id:n,defaultColor:i,defaultMarkerStart:s,defaultMarkerEnd:a}){const h=new Set;return e.reduce((d,l)=>([l.markerStart||s,l.markerEnd||a].forEach(u=>{if(u&&typeof u=="object"){const c=Qm(u,n);h.has(c)||(d.push({id:c,color:u.color||i,...u}),h.add(c))}}),d),[]).sort((d,l)=>d.id.localeCompare(l.id))}const Uw=1e3,TN=10,Yp={nodeOrigin:[0,0],nodeExtent:Tl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},MN={...Yp,checkEquality:!0};function Kp(e,n){const i={...e};for(const s in n)n[s]!==void 0&&(i[s]=n[s]);return i}function ON(e,n,i){const s=Kp(Yp,i);for(const a of e.values())if(a.parentId)Xp(a,e,n,s);else{const h=Kl(a,s.nodeOrigin),d=sa(a.extent)?a.extent:s.nodeExtent,l=Ws(h,d,Di(a));a.internals.positionAbsolute=l}}function LN(e,n){if(!e.handles)return e.measured?n?.internals.handleBounds:void 0;const i=[],s=[];for(const a of e.handles){const h={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?i.push(h):a.type==="target"&&s.push(h)}return{source:i,target:s}}function Gp(e){return e==="manual"}function Zm(e,n,i,s={}){const a=Kp(MN,s),h={i:0},d=new Map(n),l=a?.elevateNodesOnSelect&&!Gp(a.zIndexMode)?Uw:0;let u=e.length>0;n.clear(),i.clear();for(const c of e){let v=d.get(c.id);if(a.checkEquality&&c===v?.internals.userNode)n.set(c.id,v);else{const m=Kl(c,a.nodeOrigin),_=sa(c.extent)?c.extent:a.nodeExtent,x=Ws(m,_,Di(c));v={...a.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:x,handleBounds:LN(c,v),z:Fw(c,l,a.zIndexMode),userNode:c}},n.set(c.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(u=!1),c.parentId&&Xp(v,n,i,s,h)}return u}function NN(e,n){if(!e.parentId)return;const i=n.get(e.parentId);i?i.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function Xp(e,n,i,s,a){const{elevateNodesOnSelect:h,nodeOrigin:d,nodeExtent:l,zIndexMode:u}=Kp(Yp,s),c=e.parentId,v=n.get(c);if(!v){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}NN(e,i),a&&!v.parentId&&v.internals.rootParentIndex===void 0&&u==="auto"&&(v.internals.rootParentIndex=++a.i,v.internals.z=v.internals.z+a.i*TN),a&&v.internals.rootParentIndex!==void 0&&(a.i=v.internals.rootParentIndex);const m=h&&!Gp(u)?Uw:0,{x:_,y:x,z:C}=kN(e,v,d,l,m,u),{positionAbsolute:S}=e.internals,p=_!==S.x||x!==S.y;(p||C!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:p?{x:_,y:x}:S,z:C}})}function Fw(e,n,i){const s=yr(e.zIndex)?e.zIndex:0;return Gp(i)?s:s+(e.selected?n:0)}function kN(e,n,i,s,a,h){const{x:d,y:l}=n.internals.positionAbsolute,u=Di(e),c=Kl(e,i),v=sa(e.extent)?Ws(c,e.extent,u):c;let m=Ws({x:d+v.x,y:l+v.y},s,u);e.extent==="parent"&&(m=Mw(m,u,n));const _=Fw(e,a,h),x=n.internals.z??0;return{x:m.x,y:m.y,z:x>=_?x+1:_}}function Qp(e,n,i,s=[0,0]){const a=[],h=new Map;for(const d of e){const l=n.get(d.parentId);if(!l)continue;const u=h.get(d.parentId)?.expandedRect??ia(l),c=Lw(u,d.rect);h.set(d.parentId,{expandedRect:c,parent:l})}return h.size>0&&h.forEach(({expandedRect:d,parent:l},u)=>{const c=l.internals.positionAbsolute,v=Di(l),m=l.origin??s,_=d.x<c.x?Math.round(Math.abs(c.x-d.x)):0,x=d.y<c.y?Math.round(Math.abs(c.y-d.y)):0,C=Math.max(v.width,Math.round(d.width)),S=Math.max(v.height,Math.round(d.height)),p=(C-v.width)*m[0],g=(S-v.height)*m[1];(_>0||x>0||p||g)&&(a.push({id:u,type:"position",position:{x:l.position.x-_+p,y:l.position.y-x+g}}),i.get(u)?.forEach(b=>{e.some(y=>y.id===b.id)||a.push({id:b.id,type:"position",position:{x:b.position.x+_,y:b.position.y+x}})})),(v.width<d.width||v.height<d.height||_||x)&&a.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:C+(_?m[0]*_-p:0),height:S+(x?m[1]*x-g:0)}})}),a}function BN(e,n,i,s,a,h,d){const l=s?.querySelector(".xyflow__viewport");let u=!1;if(!l)return{changes:[],updatedInternals:u};const c=[],v=window.getComputedStyle(l),{m22:m}=new window.DOMMatrixReadOnly(v.transform),_=[];for(const x of e.values()){const C=n.get(x.id);if(!C)continue;if(C.hidden){n.set(C.id,{...C,internals:{...C.internals,handleBounds:void 0}}),u=!0;continue}const S=qp(x.nodeElement),p=C.measured.width!==S.width||C.measured.height!==S.height;if(!!(S.width&&S.height&&(p||!C.internals.handleBounds||x.force))){const b=x.nodeElement.getBoundingClientRect(),y=sa(C.extent)?C.extent:h;let{positionAbsolute:E}=C.internals;C.parentId&&C.extent==="parent"?E=Mw(E,S,n.get(C.parentId)):y&&(E=Ws(E,y,S));const T={...C,measured:S,internals:{...C.internals,positionAbsolute:E,handleBounds:{source:xb("source",x.nodeElement,b,m,C.id),target:xb("target",x.nodeElement,b,m,C.id)}}};n.set(C.id,T),C.parentId&&Xp(T,n,i,{nodeOrigin:a,zIndexMode:d}),u=!0,p&&(c.push({id:C.id,type:"dimensions",dimensions:S}),C.expandParent&&C.parentId&&_.push({id:C.id,parentId:C.parentId,rect:ia(T,a)}))}}if(_.length>0){const x=Qp(_,n,i,a);c.push(...x)}return{changes:c,updatedInternals:u}}async function jN({delta:e,panZoom:n,transform:i,translateExtent:s,width:a,height:h}){if(!n||!e.x&&!e.y)return Promise.resolve(!1);const d=await n.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[a,h]],s),l=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(l)}function Tb(e,n,i,s,a,h){let d=a;const l=s.get(d)||new Map;s.set(d,l.set(i,n)),d=`${a}-${e}`;const u=s.get(d)||new Map;if(s.set(d,u.set(i,n)),h){d=`${a}-${e}-${h}`;const c=s.get(d)||new Map;s.set(d,c.set(i,n))}}function $w(e,n,i){e.clear(),n.clear();for(const s of i){const{source:a,target:h,sourceHandle:d=null,targetHandle:l=null}=s,u={edgeId:s.id,source:a,target:h,sourceHandle:d,targetHandle:l},c=`${a}-${d}--${h}-${l}`,v=`${h}-${l}--${a}-${d}`;Tb("source",u,v,e,a,d),Tb("target",u,c,e,h,l),n.set(s.id,s)}}function Vw(e,n){if(!e.parentId)return!1;const i=n.get(e.parentId);return i?i.selected?!0:Vw(i,n):!1}function Mb(e,n,i){let s=e;do{if(s?.matches?.(n))return!0;if(s===i)return!1;s=s?.parentElement}while(s);return!1}function HN(e,n,i,s){const a=new Map;for(const[h,d]of e)if((d.selected||d.id===s)&&(!d.parentId||!Vw(d,e))&&(d.draggable||n&&typeof d.draggable>"u")){const l=e.get(h);l&&a.set(h,{id:h,position:l.position||{x:0,y:0},distance:{x:i.x-l.internals.positionAbsolute.x,y:i.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return a}function cm({nodeId:e,dragItems:n,nodeLookup:i,dragging:s=!0}){const a=[];for(const[d,l]of n){const u=i.get(d)?.internals.userNode;u&&a.push({...u,position:l.position,dragging:s})}if(!e)return[a[0],a];const h=i.get(e)?.internals.userNode;return[h?{...h,position:n.get(e)?.position||h.position,dragging:s}:a[0],a]}function PN({dragItems:e,snapGrid:n,x:i,y:s}){const a=e.values().next().value;if(!a)return null;const h={x:i-a.distance.x,y:s-a.distance.y},d=Xl(h,n);return{x:d.x-h.x,y:d.y-h.y}}function zN({onNodeMouseDown:e,getStoreItems:n,onDragStart:i,onDrag:s,onDragStop:a}){let h={x:null,y:null},d=0,l=new Map,u=!1,c={x:0,y:0},v=null,m=!1,_=null,x=!1,C=!1,S=null;function p({noDragClassName:b,handleSelector:y,domNode:E,isSelectable:T,nodeId:O,nodeClickDistance:D=0}){_=$n(E);function A({x:z,y:W}){const{nodeLookup:U,nodeExtent:G,snapGrid:H,snapToGrid:K,nodeOrigin:F,onNodeDrag:k,onSelectionDrag:$,onError:B,updateNodePositions:I}=n();h={x:z,y:W};let Q=!1;const J=l.size>1,ae=J&&G?Gm(Gl(l)):null,Z=J&&K?PN({dragItems:l,snapGrid:H,x:z,y:W}):null;for(const[X,V]of l){if(!U.has(X))continue;let ie={x:z-V.distance.x,y:W-V.distance.y};K&&(ie=Z?{x:Math.round(ie.x+Z.x),y:Math.round(ie.y+Z.y)}:Xl(ie,H));let de=null;if(J&&G&&!V.extent&&ae){const{positionAbsolute:_e}=V.internals,Ee=_e.x-ae.x+G[0][0],He=_e.x+V.measured.width-ae.x2+G[1][0],ke=_e.y-ae.y+G[0][1],Ce=_e.y+V.measured.height-ae.y2+G[1][1];de=[[Ee,ke],[He,Ce]]}const{position:re,positionAbsolute:le}=Tw({nodeId:X,nextPosition:ie,nodeLookup:U,nodeExtent:de||G,nodeOrigin:F,onError:B});Q=Q||V.position.x!==re.x||V.position.y!==re.y,V.position=re,V.internals.positionAbsolute=le}if(C=C||Q,!!Q&&(I(l,!0),S&&(s||k||!O&&$))){const[X,V]=cm({nodeId:O,dragItems:l,nodeLookup:U});s?.(S,l,X,V),k?.(S,X,V),O||$?.(S,V)}}async function N(){if(!v)return;const{transform:z,panBy:W,autoPanSpeed:U,autoPanOnNodeDrag:G}=n();if(!G){u=!1,cancelAnimationFrame(d);return}const[H,K]=Ow(c,v,U);(H!==0||K!==0)&&(h.x=(h.x??0)-H/z[2],h.y=(h.y??0)-K/z[2],await W({x:H,y:K})&&A(h)),d=requestAnimationFrame(N)}function q(z){const{nodeLookup:W,multiSelectionActive:U,nodesDraggable:G,transform:H,snapGrid:K,snapToGrid:F,selectNodesOnDrag:k,onNodeDragStart:$,onSelectionDragStart:B,unselectNodesAndEdges:I}=n();m=!0,(!k||!T)&&!U&&O&&(W.get(O)?.selected||I()),T&&k&&O&&e?.(O);const Q=bl(z.sourceEvent,{transform:H,snapGrid:K,snapToGrid:F,containerBounds:v});if(h=Q,l=HN(W,G,Q,O),l.size>0&&(i||$||!O&&B)){const[J,ae]=cm({nodeId:O,dragItems:l,nodeLookup:W});i?.(z.sourceEvent,l,J,ae),$?.(z.sourceEvent,J,ae),O||B?.(z.sourceEvent,ae)}}const P=cw().clickDistance(D).on("start",z=>{const{domNode:W,nodeDragThreshold:U,transform:G,snapGrid:H,snapToGrid:K}=n();v=W?.getBoundingClientRect()||null,x=!1,C=!1,S=z.sourceEvent,U===0&&q(z),h=bl(z.sourceEvent,{transform:G,snapGrid:H,snapToGrid:K,containerBounds:v}),c=br(z.sourceEvent,v)}).on("drag",z=>{const{autoPanOnNodeDrag:W,transform:U,snapGrid:G,snapToGrid:H,nodeDragThreshold:K,nodeLookup:F}=n(),k=bl(z.sourceEvent,{transform:U,snapGrid:G,snapToGrid:H,containerBounds:v});if(S=z.sourceEvent,(z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1||O&&!F.has(O))&&(x=!0),!x){if(!u&&W&&m&&(u=!0,N()),!m){const $=br(z.sourceEvent,v),B=$.x-c.x,I=$.y-c.y;Math.sqrt(B*B+I*I)>K&&q(z)}(h.x!==k.xSnapped||h.y!==k.ySnapped)&&l&&m&&(c=br(z.sourceEvent,v),A(k))}}).on("end",z=>{if(!(!m||x)&&(u=!1,m=!1,cancelAnimationFrame(d),l.size>0)){const{nodeLookup:W,updateNodePositions:U,onNodeDragStop:G,onSelectionDragStop:H}=n();if(C&&(U(l,!1),C=!1),a||G||!O&&H){const[K,F]=cm({nodeId:O,dragItems:l,nodeLookup:W,dragging:!1});a?.(z.sourceEvent,l,K,F),G?.(z.sourceEvent,K,F),O||H?.(z.sourceEvent,F)}}}).filter(z=>{const W=z.target;return!z.button&&(!b||!Mb(W,`.${b}`,E))&&(!y||Mb(W,y,E))});_.call(P)}function g(){_?.on(".drag",null)}return{update:p,destroy:g}}function IN(e,n,i){const s=[],a={x:e.x-i,y:e.y-i,width:i*2,height:i*2};for(const h of n.values())Ol(a,ia(h))>0&&s.push(h);return s}const UN=250;function FN(e,n,i,s){let a=[],h=1/0;const d=IN(e,i,n+UN);for(const l of d){const u=[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]];for(const c of u){if(s.nodeId===c.nodeId&&s.type===c.type&&s.id===c.id)continue;const{x:v,y:m}=Ys(l,c,c.position,!0),_=Math.sqrt(Math.pow(v-e.x,2)+Math.pow(m-e.y,2));_>n||(_<h?(a=[{...c,x:v,y:m}],h=_):_===h&&a.push({...c,x:v,y:m}))}}if(!a.length)return null;if(a.length>1){const l=s.type==="source"?"target":"source";return a.find(u=>u.type===l)??a[0]}return a[0]}function qw(e,n,i,s,a,h=!1){const d=s.get(e);if(!d)return null;const l=a==="strict"?d.internals.handleBounds?.[n]:[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]],u=(i?l?.find(c=>c.id===i):l?.[0])??null;return u&&h?{...u,...Ys(d,u,u.position,!0)}:u}function Ww(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function $N(e,n){let i=null;return n?i=!0:e&&!n&&(i=!1),i}const Yw=()=>!0;function VN(e,{connectionMode:n,connectionRadius:i,handleId:s,nodeId:a,edgeUpdaterType:h,isTarget:d,domNode:l,nodeLookup:u,lib:c,autoPanOnConnect:v,flowId:m,panBy:_,cancelConnection:x,onConnectStart:C,onConnect:S,onConnectEnd:p,isValidConnection:g=Yw,onReconnectEnd:b,updateConnection:y,getTransform:E,getFromHandle:T,autoPanSpeed:O,dragThreshold:D=1,handleDomNode:A}){const N=Bw(e.target);let q=0,P;const{x:z,y:W}=br(e),U=Ww(h,A),G=l?.getBoundingClientRect();let H=!1;if(!G||!U)return;const K=qw(a,U,s,u,n);if(!K)return;let F=br(e,G),k=!1,$=null,B=!1,I=null;function Q(){if(!v||!G)return;const[re,le]=Ow(F,G,O);_({x:re,y:le}),q=requestAnimationFrame(Q)}const J={...K,nodeId:a,type:U,position:K.position},ae=u.get(a);let X={inProgress:!0,isValid:null,from:Ys(ae,J,Ne.Left,!0),fromHandle:J,fromPosition:J.position,fromNode:ae,to:F,toHandle:null,toPosition:_b[J.position],toNode:null,pointer:F};function V(){H=!0,y(X),C?.(e,{nodeId:a,handleId:s,handleType:U})}D===0&&V();function ie(re){if(!H){const{x:Ce,y:$t}=br(re),Bt=Ce-z,tn=$t-W;if(!(Bt*Bt+tn*tn>D*D))return;V()}if(!T()||!J){de(re);return}const le=E();F=br(re,G),P=FN(Ql(F,le,!1,[1,1]),i,u,J),k||(Q(),k=!0);const _e=Kw(re,{handle:P,connectionMode:n,fromNodeId:a,fromHandleId:s,fromType:d?"target":"source",isValidConnection:g,doc:N,lib:c,flowId:m,nodeLookup:u});I=_e.handleDomNode,$=_e.connection,B=$N(!!P,_e.isValid);const Ee=u.get(a),He=Ee?Ys(Ee,J,Ne.Left,!0):X.from,ke={...X,from:He,isValid:B,to:_e.toHandle&&B?sh({x:_e.toHandle.x,y:_e.toHandle.y},le):F,toHandle:_e.toHandle,toPosition:B&&_e.toHandle?_e.toHandle.position:_b[J.position],toNode:_e.toHandle?u.get(_e.toHandle.nodeId):null,pointer:F};y(ke),X=ke}function de(re){if(!("touches"in re&&re.touches.length>0)){if(H){(P||I)&&$&&B&&S?.($);const{inProgress:le,..._e}=X,Ee={..._e,toPosition:X.toHandle?X.toPosition:null};p?.(re,Ee),h&&b?.(re,Ee)}x(),cancelAnimationFrame(q),k=!1,B=!1,$=null,I=null,N.removeEventListener("mousemove",ie),N.removeEventListener("mouseup",de),N.removeEventListener("touchmove",ie),N.removeEventListener("touchend",de)}}N.addEventListener("mousemove",ie),N.addEventListener("mouseup",de),N.addEventListener("touchmove",ie),N.addEventListener("touchend",de)}function Kw(e,{handle:n,connectionMode:i,fromNodeId:s,fromHandleId:a,fromType:h,doc:d,lib:l,flowId:u,isValidConnection:c=Yw,nodeLookup:v}){const m=h==="target",_=n?d.querySelector(`.${l}-flow__handle[data-id="${u}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x,y:C}=br(e),S=d.elementFromPoint(x,C),p=S?.classList.contains(`${l}-flow__handle`)?S:_,g={handleDomNode:p,isValid:!1,connection:null,toHandle:null};if(p){const b=Ww(void 0,p),y=p.getAttribute("data-nodeid"),E=p.getAttribute("data-handleid"),T=p.classList.contains("connectable"),O=p.classList.contains("connectableend");if(!y||!b)return g;const D={source:m?y:s,sourceHandle:m?E:a,target:m?s:y,targetHandle:m?a:E};g.connection=D;const N=T&&O&&(i===na.Strict?m&&b==="source"||!m&&b==="target":y!==s||E!==a);g.isValid=N&&c(D),g.toHandle=qw(y,b,E,v,i,!0)}return g}const Jm={onPointerDown:VN,isValid:Kw};function qN({domNode:e,panZoom:n,getTransform:i,getViewScale:s}){const a=$n(e);function h({translateExtent:l,width:u,height:c,zoomStep:v=1,pannable:m=!0,zoomable:_=!0,inversePan:x=!1}){const C=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const E=i(),T=y.sourceEvent.ctrlKey&&Ll()?10:1,O=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*v,D=E[2]*Math.pow(2,O*T);n.scaleTo(D)};let S=[0,0];const p=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},g=y=>{const E=i();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const T=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],O=[T[0]-S[0],T[1]-S[1]];S=T;const D=s()*Math.max(E[2],Math.log(E[2]))*(x?-1:1),A={x:E[0]-O[0]*D,y:E[1]-O[1]*D},N=[[0,0],[u,c]];n.setViewportConstrained({x:A.x,y:A.y,zoom:E[2]},N,l)},b=ww().on("start",p).on("zoom",m?g:null).on("zoom.wheel",_?C:null);a.call(b,{})}function d(){a.on("zoom",null)}return{update:h,destroy:d,pointer:gr}}const Ah=e=>({x:e.x,y:e.y,zoom:e.k}),um=({x:e,y:n,zoom:i})=>Ch.translate(e,n).scale(i),Yo=(e,n)=>e.target.closest(`.${n}`),Gw=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),WN=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,hm=(e,n=0,i=WN,s=()=>{})=>{const a=typeof n=="number"&&n>0;return a||s(),a?e.transition().duration(n).ease(i).on("end",s):e},Xw=e=>{const n=e.ctrlKey&&Ll()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function YN({zoomPanValues:e,noWheelClassName:n,d3Selection:i,d3Zoom:s,panOnScrollMode:a,panOnScrollSpeed:h,zoomOnPinch:d,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:c}){return v=>{if(Yo(v,n))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const m=i.property("__zoom").k||1;if(v.ctrlKey&&d){const p=gr(v),g=Xw(v),b=m*Math.pow(2,g);s.scaleTo(i,b,p,v);return}const _=v.deltaMode===1?20:1;let x=a===Is.Vertical?0:v.deltaX*_,C=a===Is.Horizontal?0:v.deltaY*_;!Ll()&&v.shiftKey&&a!==Is.Vertical&&(x=v.deltaY*_,C=0),s.translateBy(i,-(x/m)*h,-(C/m)*h,{internal:!0});const S=Ah(i.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u?.(v,S),e.panScrollTimeout=setTimeout(()=>{c?.(v,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l?.(v,S))}}function KN({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:i}){return function(s,a){const h=s.type==="wheel",d=!n&&h&&!s.ctrlKey,l=Yo(s,e);if(s.ctrlKey&&h&&l&&s.preventDefault(),d||l)return null;s.preventDefault(),i.call(this,s,a)}}function GN({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:i}){return s=>{if(s.sourceEvent?.internal)return;const a=Ah(s.transform);e.mouseButton=s.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=a,s.sourceEvent?.type==="mousedown"&&n(!0),i&&i?.(s.sourceEvent,a)}}function XN({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:i,onTransformChange:s,onPanZoom:a}){return h=>{e.usedRightMouseButton=!!(i&&Gw(n,e.mouseButton??0)),h.sourceEvent?.sync||s([h.transform.x,h.transform.y,h.transform.k]),a&&!h.sourceEvent?.internal&&a?.(h.sourceEvent,Ah(h.transform))}}function QN({zoomPanValues:e,panOnDrag:n,panOnScroll:i,onDraggingChange:s,onPanZoomEnd:a,onPaneContextMenu:h}){return d=>{if(!d.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,h&&Gw(n,e.mouseButton??0)&&!e.usedRightMouseButton&&d.sourceEvent&&h(d.sourceEvent),e.usedRightMouseButton=!1,s(!1),a)){const l=Ah(d.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a?.(d.sourceEvent,l)},i?150:0)}}}function ZN({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:i,panOnDrag:s,panOnScroll:a,zoomOnDoubleClick:h,userSelectionActive:d,noWheelClassName:l,noPanClassName:u,lib:c,connectionInProgress:v}){return m=>{const _=e||n,x=i&&m.ctrlKey,C=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(Yo(m,`${c}-flow__node`)||Yo(m,`${c}-flow__edge`)))return!0;if(!s&&!_&&!a&&!h&&!i||d||v&&!C||Yo(m,l)&&C||Yo(m,u)&&(!C||a&&C&&!e)||!i&&m.ctrlKey&&C)return!1;if(!i&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!_&&!a&&!x&&C||!s&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(s)&&!s.includes(m.button)&&m.type==="mousedown")return!1;const S=Array.isArray(s)&&s.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||C)&&S}}function JN({domNode:e,minZoom:n,maxZoom:i,translateExtent:s,viewport:a,onPanZoom:h,onPanZoomStart:d,onPanZoomEnd:l,onDraggingChange:u}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=e.getBoundingClientRect(),m=ww().scaleExtent([n,i]).translateExtent(s),_=$n(e).call(m);b({x:a.x,y:a.y,zoom:ra(a.zoom,n,i)},[[0,0],[v.width,v.height]],s);const x=_.on("wheel.zoom"),C=_.on("dblclick.zoom");m.wheelDelta(Xw);function S(P,z){return _?new Promise(W=>{m?.interpolate(z?.interpolate==="linear"?yl:zu).transform(hm(_,z?.duration,z?.ease,()=>W(!0)),P)}):Promise.resolve(!1)}function p({noWheelClassName:P,noPanClassName:z,onPaneContextMenu:W,userSelectionActive:U,panOnScroll:G,panOnDrag:H,panOnScrollMode:K,panOnScrollSpeed:F,preventScrolling:k,zoomOnPinch:$,zoomOnScroll:B,zoomOnDoubleClick:I,zoomActivationKeyPressed:Q,lib:J,onTransformChange:ae,connectionInProgress:Z,paneClickDistance:X,selectionOnDrag:V}){U&&!c.isZoomingOrPanning&&g();const ie=G&&!Q&&!U;m.clickDistance(V?1/0:!yr(X)||X<0?0:X);const de=ie?YN({zoomPanValues:c,noWheelClassName:P,d3Selection:_,d3Zoom:m,panOnScrollMode:K,panOnScrollSpeed:F,zoomOnPinch:$,onPanZoomStart:d,onPanZoom:h,onPanZoomEnd:l}):KN({noWheelClassName:P,preventScrolling:k,d3ZoomHandler:x});if(_.on("wheel.zoom",de,{passive:!1}),!U){const le=GN({zoomPanValues:c,onDraggingChange:u,onPanZoomStart:d});m.on("start",le);const _e=XN({zoomPanValues:c,panOnDrag:H,onPaneContextMenu:!!W,onPanZoom:h,onTransformChange:ae});m.on("zoom",_e);const Ee=QN({zoomPanValues:c,panOnDrag:H,panOnScroll:G,onPaneContextMenu:W,onPanZoomEnd:l,onDraggingChange:u});m.on("end",Ee)}const re=ZN({zoomActivationKeyPressed:Q,panOnDrag:H,zoomOnScroll:B,panOnScroll:G,zoomOnDoubleClick:I,zoomOnPinch:$,userSelectionActive:U,noPanClassName:z,noWheelClassName:P,lib:J,connectionInProgress:Z});m.filter(re),I?_.on("dblclick.zoom",C):_.on("dblclick.zoom",null)}function g(){m.on("zoom",null)}async function b(P,z,W){const U=um(P),G=m?.constrain()(U,z,W);return G&&await S(G),new Promise(H=>H(G))}async function y(P,z){const W=um(P);return await S(W,z),new Promise(U=>U(W))}function E(P){if(_){const z=um(P),W=_.property("__zoom");(W.k!==P.zoom||W.x!==P.x||W.y!==P.y)&&m?.transform(_,z,null,{sync:!0})}}function T(){const P=_?xw(_.node()):{x:0,y:0,k:1};return{x:P.x,y:P.y,zoom:P.k}}function O(P,z){return _?new Promise(W=>{m?.interpolate(z?.interpolate==="linear"?yl:zu).scaleTo(hm(_,z?.duration,z?.ease,()=>W(!0)),P)}):Promise.resolve(!1)}function D(P,z){return _?new Promise(W=>{m?.interpolate(z?.interpolate==="linear"?yl:zu).scaleBy(hm(_,z?.duration,z?.ease,()=>W(!0)),P)}):Promise.resolve(!1)}function A(P){m?.scaleExtent(P)}function N(P){m?.translateExtent(P)}function q(P){const z=!yr(P)||P<0?0:P;m?.clickDistance(z)}return{update:p,destroy:g,setViewport:y,setViewportConstrained:b,getViewport:T,scaleTo:O,scaleBy:D,setScaleExtent:A,setTranslateExtent:N,syncViewport:E,setClickDistance:q}}var oa;(function(e){e.Line="line",e.Handle="handle"})(oa||(oa={}));function ek({width:e,prevWidth:n,height:i,prevHeight:s,affectsX:a,affectsY:h}){const d=e-n,l=i-s,u=[d>0?1:d<0?-1:0,l>0?1:l<0?-1:0];return d&&a&&(u[0]=u[0]*-1),l&&h&&(u[1]=u[1]*-1),u}function Ob(e){const n=e.includes("right")||e.includes("left"),i=e.includes("bottom")||e.includes("top"),s=e.includes("left"),a=e.includes("top");return{isHorizontal:n,isVertical:i,affectsX:s,affectsY:a}}function es(e,n){return Math.max(0,n-e)}function ts(e,n){return Math.max(0,e-n)}function Cu(e,n,i){return Math.max(0,n-e,e-i)}function Lb(e,n){return e?!n:n}function tk(e,n,i,s,a,h,d,l){let{affectsX:u,affectsY:c}=n;const{isHorizontal:v,isVertical:m}=n,_=v&&m,{xSnapped:x,ySnapped:C}=i,{minWidth:S,maxWidth:p,minHeight:g,maxHeight:b}=s,{x:y,y:E,width:T,height:O,aspectRatio:D}=e;let A=Math.floor(v?x-e.pointerX:0),N=Math.floor(m?C-e.pointerY:0);const q=T+(u?-A:A),P=O+(c?-N:N),z=-h[0]*T,W=-h[1]*O;let U=Cu(q,S,p),G=Cu(P,g,b);if(d){let F=0,k=0;u&&A<0?F=es(y+A+z,d[0][0]):!u&&A>0&&(F=ts(y+q+z,d[1][0])),c&&N<0?k=es(E+N+W,d[0][1]):!c&&N>0&&(k=ts(E+P+W,d[1][1])),U=Math.max(U,F),G=Math.max(G,k)}if(l){let F=0,k=0;u&&A>0?F=ts(y+A,l[0][0]):!u&&A<0&&(F=es(y+q,l[1][0])),c&&N>0?k=ts(E+N,l[0][1]):!c&&N<0&&(k=es(E+P,l[1][1])),U=Math.max(U,F),G=Math.max(G,k)}if(a){if(v){const F=Cu(q/D,g,b)*D;if(U=Math.max(U,F),d){let k=0;!u&&!c||u&&!c&&_?k=ts(E+W+q/D,d[1][1])*D:k=es(E+W+(u?A:-A)/D,d[0][1])*D,U=Math.max(U,k)}if(l){let k=0;!u&&!c||u&&!c&&_?k=es(E+q/D,l[1][1])*D:k=ts(E+(u?A:-A)/D,l[0][1])*D,U=Math.max(U,k)}}if(m){const F=Cu(P*D,S,p)/D;if(G=Math.max(G,F),d){let k=0;!u&&!c||c&&!u&&_?k=ts(y+P*D+z,d[1][0])/D:k=es(y+(c?N:-N)*D+z,d[0][0])/D,G=Math.max(G,k)}if(l){let k=0;!u&&!c||c&&!u&&_?k=es(y+P*D,l[1][0])/D:k=ts(y+(c?N:-N)*D,l[0][0])/D,G=Math.max(G,k)}}}N=N+(N<0?G:-G),A=A+(A<0?U:-U),a&&(_?q>P*D?N=(Lb(u,c)?-A:A)/D:A=(Lb(u,c)?-N:N)*D:v?(N=A/D,c=u):(A=N*D,u=c));const H=u?y+A:y,K=c?E+N:E;return{width:T+(u?-A:A),height:O+(c?-N:N),x:h[0]*A*(u?-1:1)+H,y:h[1]*N*(c?-1:1)+K}}const Qw={width:0,height:0,x:0,y:0},nk={...Qw,pointerX:0,pointerY:0,aspectRatio:1};function rk(e){return[[0,0],[e.measured.width,e.measured.height]]}function ik(e,n,i){const s=n.position.x+e.position.x,a=n.position.y+e.position.y,h=e.measured.width??0,d=e.measured.height??0,l=i[0]*h,u=i[1]*d;return[[s-l,a-u],[s+h-l,a+d-u]]}function sk({domNode:e,nodeId:n,getStoreItems:i,onChange:s,onEnd:a}){const h=$n(e);let d={controlDirection:Ob("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:c,boundaries:v,keepAspectRatio:m,resizeDirection:_,onResizeStart:x,onResize:C,onResizeEnd:S,shouldResize:p}){let g={...Qw},b={...nk};d={boundaries:v,resizeDirection:_,keepAspectRatio:m,controlDirection:Ob(c)};let y,E=null,T=[],O,D,A,N=!1;const q=cw().on("start",P=>{const{nodeLookup:z,transform:W,snapGrid:U,snapToGrid:G,nodeOrigin:H,paneDomNode:K}=i();if(y=z.get(n),!y)return;E=K?.getBoundingClientRect()??null;const{xSnapped:F,ySnapped:k}=bl(P.sourceEvent,{transform:W,snapGrid:U,snapToGrid:G,containerBounds:E});g={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},b={...g,pointerX:F,pointerY:k,aspectRatio:g.width/g.height},O=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(O=z.get(y.parentId),D=O&&y.extent==="parent"?rk(O):void 0),T=[],A=void 0;for(const[$,B]of z)if(B.parentId===n&&(T.push({id:$,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const I=ik(B,y,B.origin??H);A?A=[[Math.min(I[0][0],A[0][0]),Math.min(I[0][1],A[0][1])],[Math.max(I[1][0],A[1][0]),Math.max(I[1][1],A[1][1])]]:A=I}x?.(P,{...g})}).on("drag",P=>{const{transform:z,snapGrid:W,snapToGrid:U,nodeOrigin:G}=i(),H=bl(P.sourceEvent,{transform:z,snapGrid:W,snapToGrid:U,containerBounds:E}),K=[];if(!y)return;const{x:F,y:k,width:$,height:B}=g,I={},Q=y.origin??G,{width:J,height:ae,x:Z,y:X}=tk(b,d.controlDirection,H,d.boundaries,d.keepAspectRatio,Q,D,A),V=J!==$,ie=ae!==B,de=Z!==F&&V,re=X!==k&&ie;if(!de&&!re&&!V&&!ie)return;if((de||re||Q[0]===1||Q[1]===1)&&(I.x=de?Z:g.x,I.y=re?X:g.y,g.x=I.x,g.y=I.y,T.length>0)){const He=Z-F,ke=X-k;for(const Ce of T)Ce.position={x:Ce.position.x-He+Q[0]*(J-$),y:Ce.position.y-ke+Q[1]*(ae-B)},K.push(Ce)}if((V||ie)&&(I.width=V&&(!d.resizeDirection||d.resizeDirection==="horizontal")?J:g.width,I.height=ie&&(!d.resizeDirection||d.resizeDirection==="vertical")?ae:g.height,g.width=I.width,g.height=I.height),O&&y.expandParent){const He=Q[0]*(I.width??0);I.x&&I.x<He&&(g.x=He,b.x=b.x-(I.x-He));const ke=Q[1]*(I.height??0);I.y&&I.y<ke&&(g.y=ke,b.y=b.y-(I.y-ke))}const le=ek({width:g.width,prevWidth:$,height:g.height,prevHeight:B,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),_e={...g,direction:le};p?.(P,_e)!==!1&&(N=!0,C?.(P,_e),s(I,K))}).on("end",P=>{N&&(S?.(P,{...g}),a?.({...g}),N=!1)});h.call(q)}function u(){h.on(".drag",null)}return{update:l,destroy:u}}var fm={exports:{}},dm={},mm={exports:{}},pm={};var Nb;function ok(){if(Nb)return pm;Nb=1;var e=Pl();function n(m,_){return m===_&&(m!==0||1/m===1/_)||m!==m&&_!==_}var i=typeof Object.is=="function"?Object.is:n,s=e.useState,a=e.useEffect,h=e.useLayoutEffect,d=e.useDebugValue;function l(m,_){var x=_(),C=s({inst:{value:x,getSnapshot:_}}),S=C[0].inst,p=C[1];return h(function(){S.value=x,S.getSnapshot=_,u(S)&&p({inst:S})},[m,x,_]),a(function(){return u(S)&&p({inst:S}),m(function(){u(S)&&p({inst:S})})},[m]),d(x),x}function u(m){var _=m.getSnapshot;m=m.value;try{var x=_();return!i(m,x)}catch{return!0}}function c(m,_){return _()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return pm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,pm}var kb;function ak(){return kb||(kb=1,mm.exports=ok()),mm.exports}var Bb;function lk(){if(Bb)return dm;Bb=1;var e=Pl(),n=ak();function i(c,v){return c===v&&(c!==0||1/c===1/v)||c!==c&&v!==v}var s=typeof Object.is=="function"?Object.is:i,a=n.useSyncExternalStore,h=e.useRef,d=e.useEffect,l=e.useMemo,u=e.useDebugValue;return dm.useSyncExternalStoreWithSelector=function(c,v,m,_,x){var C=h(null);if(C.current===null){var S={hasValue:!1,value:null};C.current=S}else S=C.current;C=l(function(){function g(O){if(!b){if(b=!0,y=O,O=_(O),x!==void 0&&S.hasValue){var D=S.value;if(x(D,O))return E=D}return E=O}if(D=E,s(y,O))return D;var A=_(O);return x!==void 0&&x(D,A)?(y=O,D):(y=O,E=A)}var b=!1,y,E,T=m===void 0?null:m;return[function(){return g(v())},T===null?void 0:function(){return g(T())}]},[v,m,_,x]);var p=a(c,C[0],C[1]);return d(function(){S.hasValue=!0,S.value=p},[p]),u(p),p},dm}var jb;function ck(){return jb||(jb=1,fm.exports=lk()),fm.exports}var uk=ck();const hk=ph(uk),fk={},Hb=e=>{let n;const i=new Set,s=(v,m)=>{const _=typeof v=="function"?v(n):v;if(!Object.is(_,n)){const x=n;n=m??(typeof _!="object"||_===null)?_:Object.assign({},n,_),i.forEach(C=>C(n,x))}},a=()=>n,u={setState:s,getState:a,getInitialState:()=>c,subscribe:v=>(i.add(v),()=>i.delete(v)),destroy:()=>{(fk?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},c=n=e(s,a,u);return u},dk=e=>e?Hb(e):Hb,{useDebugValue:mk}=Nr,{useSyncExternalStoreWithSelector:pk}=hk,gk=e=>e;function Zw(e,n=gk,i){const s=pk(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,i);return mk(s),s}const Pb=(e,n)=>{const i=dk(e),s=(a,h=n)=>Zw(i,a,h);return Object.assign(s,i),s},vk=(e,n)=>e?Pb(e,n):Pb;function wt(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[s,a]of e)if(!Object.is(a,n.get(s)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!1;for(const s of i)if(!Object.prototype.hasOwnProperty.call(n,s)||!Object.is(e[s],n[s]))return!1;return!0}const Dh=L.createContext(null),_k=Dh.Provider,Jw=$r.error001();function tt(e,n){const i=L.useContext(Dh);if(i===null)throw new Error(Jw);return Zw(i,e,n)}function Ct(){const e=L.useContext(Dh);if(e===null)throw new Error(Jw);return L.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const zb={display:"none"},yk={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},e1="react-flow__node-desc",t1="react-flow__edge-desc",bk="react-flow__aria-live",Sk=e=>e.ariaLiveMessage,xk=e=>e.ariaLabelConfig;function wk({rfId:e}){const n=tt(Sk);return M.jsx("div",{id:`${bk}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:yk,children:n})}function Ck({rfId:e,disableKeyboardA11y:n}){const i=tt(xk);return M.jsxs(M.Fragment,{children:[M.jsx("div",{id:`${e1}-${e}`,style:zb,children:n?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),M.jsx("div",{id:`${t1}-${e}`,style:zb,children:i["edge.a11yDescription.default"]}),!n&&M.jsx(wk,{rfId:e})]})}const Th=L.forwardRef(({position:e="top-left",children:n,className:i,style:s,...a},h)=>{const d=`${e}`.split("-");return M.jsx("div",{className:Ft(["react-flow__panel",i,...d]),style:s,ref:h,...a,children:n})});Th.displayName="Panel";function Ek({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:M.jsx(Th,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:M.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Rk=e=>{const n=[],i=[];for(const[,s]of e.nodeLookup)s.selected&&n.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&i.push(s);return{selectedNodes:n,selectedEdges:i}},Eu=e=>e.id;function Ak(e,n){return wt(e.selectedNodes.map(Eu),n.selectedNodes.map(Eu))&&wt(e.selectedEdges.map(Eu),n.selectedEdges.map(Eu))}function Dk({onSelectionChange:e}){const n=Ct(),{selectedNodes:i,selectedEdges:s}=tt(Rk,Ak);return L.useEffect(()=>{const a={nodes:i,edges:s};e?.(a),n.getState().onSelectionChangeHandlers.forEach(h=>h(a))},[i,s,e]),null}const Tk=e=>!!e.onSelectionChangeHandlers;function Mk({onSelectionChange:e}){const n=tt(Tk);return e||n?M.jsx(Dk,{onSelectionChange:e}):null}const n1=[0,0],Ok={x:0,y:0,zoom:1},Lk=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Ib=[...Lk,"rfId"],Nk=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Ub={translateExtent:Tl,nodeOrigin:n1,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function kk(e){const{setNodes:n,setEdges:i,setMinZoom:s,setMaxZoom:a,setTranslateExtent:h,setNodeExtent:d,reset:l,setDefaultNodesAndEdges:u}=tt(Nk,wt),c=Ct();L.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{v.current=Ub,l()}),[]);const v=L.useRef(Ub);return L.useEffect(()=>{for(const m of Ib){const _=e[m],x=v.current[m];_!==x&&(typeof e[m]>"u"||(m==="nodes"?n(_):m==="edges"?i(_):m==="minZoom"?s(_):m==="maxZoom"?a(_):m==="translateExtent"?h(_):m==="nodeExtent"?d(_):m==="ariaLabelConfig"?c.setState({ariaLabelConfig:vN(_)}):m==="fitView"?c.setState({fitViewQueued:_}):m==="fitViewOptions"?c.setState({fitViewOptions:_}):c.setState({[m]:_})))}v.current=e},Ib.map(m=>e[m])),null}function Fb(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Bk(e){const[n,i]=L.useState(e==="system"?null:e);return L.useEffect(()=>{if(e!=="system"){i(e);return}const s=Fb(),a=()=>i(s?.matches?"dark":"light");return a(),s?.addEventListener("change",a),()=>{s?.removeEventListener("change",a)}},[e]),n!==null?n:Fb()?.matches?"dark":"light"}const $b=typeof document<"u"?document:null;function Nl(e=null,n={target:$b,actInsideInputWithModifier:!0}){const[i,s]=L.useState(!1),a=L.useRef(!1),h=L.useRef(new Set([])),[d,l]=L.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
|
|
13
|
-
`).replace(`
|
|
14
|
-
|
|
15
|
-
`,`
|
|
16
|
-
+`).split(`
|
|
17
|
-
`)),v=c.reduce((m,_)=>m.concat(..._),[]);return[c,v]}return[[],[]]},[e]);return L.useEffect(()=>{const u=n?.target??$b,c=n?.actInsideInputWithModifier??!0;if(e!==null){const v=x=>{if(a.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!a.current||a.current&&!c)&&jw(x))return!1;const S=qb(x.code,l);if(h.current.add(x[S]),Vb(d,h.current,!1)){const p=x.composedPath?.()?.[0]||x.target,g=p?.nodeName==="BUTTON"||p?.nodeName==="A";n.preventDefault!==!1&&(a.current||!g)&&x.preventDefault(),s(!0)}},m=x=>{const C=qb(x.code,l);Vb(d,h.current,!0)?(s(!1),h.current.clear()):h.current.delete(x[C]),x.key==="Meta"&&h.current.clear(),a.current=!1},_=()=>{h.current.clear(),s(!1)};return u?.addEventListener("keydown",v),u?.addEventListener("keyup",m),window.addEventListener("blur",_),window.addEventListener("contextmenu",_),()=>{u?.removeEventListener("keydown",v),u?.removeEventListener("keyup",m),window.removeEventListener("blur",_),window.removeEventListener("contextmenu",_)}}},[e,s]),i}function Vb(e,n,i){return e.filter(s=>i||s.length===n.size).some(s=>s.every(a=>n.has(a)))}function qb(e,n){return n.includes(e)?"code":"key"}const jk=()=>{const e=Ct();return L.useMemo(()=>({zoomIn:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1/1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomTo:(n,i)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(n,{duration:i?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(n,i)=>{const{transform:[s,a,h],panZoom:d}=e.getState();return d?(await d.setViewport({x:n.x??s,y:n.y??a,zoom:n.zoom??h},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,i,s]=e.getState().transform;return{x:n,y:i,zoom:s}},setCenter:async(n,i,s)=>e.getState().setCenter(n,i,s),fitBounds:async(n,i)=>{const{width:s,height:a,minZoom:h,maxZoom:d,panZoom:l}=e.getState(),u=Vp(n,s,a,h,d,i?.padding??.1);return l?(await l.setViewport(u,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,i={})=>{const{transform:s,snapGrid:a,snapToGrid:h,domNode:d}=e.getState();if(!d)return n;const{x:l,y:u}=d.getBoundingClientRect(),c={x:n.x-l,y:n.y-u},v=i.snapGrid??a,m=i.snapToGrid??h;return Ql(c,s,m,v)},flowToScreenPosition:n=>{const{transform:i,domNode:s}=e.getState();if(!s)return n;const{x:a,y:h}=s.getBoundingClientRect(),d=sh(n,i);return{x:d.x+a,y:d.y+h}}}),[])};function r1(e,n){const i=[],s=new Map,a=[];for(const h of e)if(h.type==="add"){a.push(h);continue}else if(h.type==="remove"||h.type==="replace")s.set(h.id,[h]);else{const d=s.get(h.id);d?d.push(h):s.set(h.id,[h])}for(const h of n){const d=s.get(h.id);if(!d){i.push(h);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){i.push({...d[0].item});continue}const l={...h};for(const u of d)Hk(u,l);i.push(l)}return a.length&&a.forEach(h=>{h.index!==void 0?i.splice(h.index,0,{...h.item}):i.push({...h.item})}),i}function Hk(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function i1(e,n){return r1(e,n)}function s1(e,n){return r1(e,n)}function Bs(e,n){return{id:e,type:"select",selected:n}}function Ko(e,n=new Set,i=!1){const s=[];for(const[a,h]of e){const d=n.has(a);!(h.selected===void 0&&!d)&&h.selected!==d&&(i&&(h.selected=d),s.push(Bs(h.id,d)))}return s}function Wb({items:e=[],lookup:n}){const i=[],s=new Map(e.map(a=>[a.id,a]));for(const[a,h]of e.entries()){const d=n.get(h.id),l=d?.internals?.userNode??d;l!==void 0&&l!==h&&i.push({id:h.id,item:h,type:"replace"}),l===void 0&&i.push({item:h,type:"add",index:a})}for(const[a]of n)s.get(a)===void 0&&i.push({id:a,type:"remove"});return i}function Yb(e){return{id:e.id,type:"remove"}}const Kb=e=>aN(e),Pk=e=>Dw(e);function o1(e){return L.forwardRef(e)}const zk=typeof window<"u"?L.useLayoutEffect:L.useEffect;function Gb(e){const[n,i]=L.useState(BigInt(0)),[s]=L.useState(()=>Ik(()=>i(a=>a+BigInt(1))));return zk(()=>{const a=s.get();a.length&&(e(a),s.reset())},[n]),s}function Ik(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:i=>{n.push(i),e()}}}const a1=L.createContext(null);function Uk({children:e}){const n=Ct(),i=L.useCallback(l=>{const{nodes:u=[],setNodes:c,hasDefaultNodes:v,onNodesChange:m,nodeLookup:_,fitViewQueued:x,onNodesChangeMiddlewareMap:C}=n.getState();let S=u;for(const g of l)S=typeof g=="function"?g(S):g;let p=Wb({items:S,lookup:_});for(const g of C.values())p=g(p);v&&c(S),p.length>0?m?.(p):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:b,setNodes:y}=n.getState();g&&y(b)})},[]),s=Gb(i),a=L.useCallback(l=>{const{edges:u=[],setEdges:c,hasDefaultEdges:v,onEdgesChange:m,edgeLookup:_}=n.getState();let x=u;for(const C of l)x=typeof C=="function"?C(x):C;v?c(x):m&&m(Wb({items:x,lookup:_}))},[]),h=Gb(a),d=L.useMemo(()=>({nodeQueue:s,edgeQueue:h}),[]);return M.jsx(a1.Provider,{value:d,children:e})}function Fk(){const e=L.useContext(a1);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const $k=e=>!!e.panZoom;function Zp(){const e=jk(),n=Ct(),i=Fk(),s=tt($k),a=L.useMemo(()=>{const h=m=>n.getState().nodeLookup.get(m),d=m=>{i.nodeQueue.push(m)},l=m=>{i.edgeQueue.push(m)},u=m=>{const{nodeLookup:_,nodeOrigin:x}=n.getState(),C=Kb(m)?m:_.get(m.id),S=C.parentId?kw(C.position,C.measured,C.parentId,_,x):C.position,p={...C,position:S,width:C.measured?.width??C.width,height:C.measured?.height??C.height};return ia(p)},c=(m,_,x={replace:!1})=>{d(C=>C.map(S=>{if(S.id===m){const p=typeof _=="function"?_(S):_;return x.replace&&Kb(p)?p:{...S,...p}}return S}))},v=(m,_,x={replace:!1})=>{l(C=>C.map(S=>{if(S.id===m){const p=typeof _=="function"?_(S):_;return x.replace&&Pk(p)?p:{...S,...p}}return S}))};return{getNodes:()=>n.getState().nodes.map(m=>({...m})),getNode:m=>h(m)?.internals.userNode,getInternalNode:h,getEdges:()=>{const{edges:m=[]}=n.getState();return m.map(_=>({..._}))},getEdge:m=>n.getState().edgeLookup.get(m),setNodes:d,setEdges:l,addNodes:m=>{const _=Array.isArray(m)?m:[m];i.nodeQueue.push(x=>[...x,..._])},addEdges:m=>{const _=Array.isArray(m)?m:[m];i.edgeQueue.push(x=>[...x,..._])},toObject:()=>{const{nodes:m=[],edges:_=[],transform:x}=n.getState(),[C,S,p]=x;return{nodes:m.map(g=>({...g})),edges:_.map(g=>({...g})),viewport:{x:C,y:S,zoom:p}}},deleteElements:async({nodes:m=[],edges:_=[]})=>{const{nodes:x,edges:C,onNodesDelete:S,onEdgesDelete:p,triggerNodeChanges:g,triggerEdgeChanges:b,onDelete:y,onBeforeDelete:E}=n.getState(),{nodes:T,edges:O}=await fN({nodesToRemove:m,edgesToRemove:_,nodes:x,edges:C,onBeforeDelete:E}),D=O.length>0,A=T.length>0;if(D){const N=O.map(Yb);p?.(O),b(N)}if(A){const N=T.map(Yb);S?.(T),g(N)}return(A||D)&&y?.({nodes:T,edges:O}),{deletedNodes:T,deletedEdges:O}},getIntersectingNodes:(m,_=!0,x)=>{const C=bb(m),S=C?m:u(m),p=x!==void 0;return S?(x||n.getState().nodes).filter(g=>{const b=n.getState().nodeLookup.get(g.id);if(b&&!C&&(g.id===m.id||!b.internals.positionAbsolute))return!1;const y=ia(p?g:b),E=Ol(y,S);return _&&E>0||E>=y.width*y.height||E>=S.width*S.height}):[]},isNodeIntersecting:(m,_,x=!0)=>{const S=bb(m)?m:u(m);if(!S)return!1;const p=Ol(S,_);return x&&p>0||p>=_.width*_.height||p>=S.width*S.height},updateNode:c,updateNodeData:(m,_,x={replace:!1})=>{c(m,C=>{const S=typeof _=="function"?_(C):_;return x.replace?{...C,data:S}:{...C,data:{...C.data,...S}}},x)},updateEdge:v,updateEdgeData:(m,_,x={replace:!1})=>{v(m,C=>{const S=typeof _=="function"?_(C):_;return x.replace?{...C,data:S}:{...C,data:{...C.data,...S}}},x)},getNodesBounds:m=>{const{nodeLookup:_,nodeOrigin:x}=n.getState();return lN(m,{nodeLookup:_,nodeOrigin:x})},getHandleConnections:({type:m,id:_,nodeId:x})=>Array.from(n.getState().connectionLookup.get(`${x}-${m}${_?`-${_}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:_,nodeId:x})=>Array.from(n.getState().connectionLookup.get(`${x}${m?_?`-${m}-${_}`:`-${m}`:""}`)?.values()??[]),fitView:async m=>{const _=n.getState().fitViewResolver??gN();return n.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:_}),i.nodeQueue.push(x=>[...x]),_.promise}}},[]);return L.useMemo(()=>({...a,...e,viewportInitialized:s}),[s])}const Xb=e=>e.selected,Vk=typeof window<"u"?window:void 0;function qk({deleteKeyCode:e,multiSelectionKeyCode:n}){const i=Ct(),{deleteElements:s}=Zp(),a=Nl(e,{actInsideInputWithModifier:!1}),h=Nl(n,{target:Vk});L.useEffect(()=>{if(a){const{edges:d,nodes:l}=i.getState();s({nodes:l.filter(Xb),edges:d.filter(Xb)}),i.setState({nodesSelectionActive:!1})}},[a]),L.useEffect(()=>{i.setState({multiSelectionActive:h})},[h])}function Wk(e){const n=Ct();L.useEffect(()=>{const i=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const s=qp(e.current);(s.height===0||s.width===0)&&n.getState().onError?.("004",$r.error004()),n.setState({width:s.width||500,height:s.height||500})};if(e.current){i(),window.addEventListener("resize",i);const s=new ResizeObserver(()=>i());return s.observe(e.current),()=>{window.removeEventListener("resize",i),s&&e.current&&s.unobserve(e.current)}}},[])}const Mh={position:"absolute",width:"100%",height:"100%",top:0,left:0},Yk=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Kk({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:h=Is.Free,zoomOnDoubleClick:d=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:c,minZoom:v,maxZoom:m,zoomActivationKeyCode:_,preventScrolling:x=!0,children:C,noWheelClassName:S,noPanClassName:p,onViewportChange:g,isControlledViewport:b,paneClickDistance:y,selectionOnDrag:E}){const T=Ct(),O=L.useRef(null),{userSelectionActive:D,lib:A,connectionInProgress:N}=tt(Yk,wt),q=Nl(_),P=L.useRef();Wk(O);const z=L.useCallback(W=>{g?.({x:W[0],y:W[1],zoom:W[2]}),b||T.setState({transform:W})},[g,b]);return L.useEffect(()=>{if(O.current){P.current=JN({domNode:O.current,minZoom:v,maxZoom:m,translateExtent:c,viewport:u,onDraggingChange:H=>T.setState({paneDragging:H}),onPanZoomStart:(H,K)=>{const{onViewportChangeStart:F,onMoveStart:k}=T.getState();k?.(H,K),F?.(K)},onPanZoom:(H,K)=>{const{onViewportChange:F,onMove:k}=T.getState();k?.(H,K),F?.(K)},onPanZoomEnd:(H,K)=>{const{onViewportChangeEnd:F,onMoveEnd:k}=T.getState();k?.(H,K),F?.(K)}});const{x:W,y:U,zoom:G}=P.current.getViewport();return T.setState({panZoom:P.current,transform:[W,U,G],domNode:O.current.closest(".react-flow")}),()=>{P.current?.destroy()}}},[]),L.useEffect(()=>{P.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:i,panOnScroll:s,panOnScrollSpeed:a,panOnScrollMode:h,zoomOnDoubleClick:d,panOnDrag:l,zoomActivationKeyPressed:q,preventScrolling:x,noPanClassName:p,userSelectionActive:D,noWheelClassName:S,lib:A,onTransformChange:z,connectionInProgress:N,selectionOnDrag:E,paneClickDistance:y})},[e,n,i,s,a,h,d,l,q,x,p,D,S,A,z,N,E,y]),M.jsx("div",{className:"react-flow__renderer",ref:O,style:Mh,children:C})}const Gk=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Xk(){const{userSelectionActive:e,userSelectionRect:n}=tt(Gk,wt);return e&&n?M.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const gm=(e,n)=>i=>{i.target===n.current&&e?.(i)},Qk=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function Zk({isSelecting:e,selectionKeyPressed:n,selectionMode:i=Ml.Full,panOnDrag:s,paneClickDistance:a,selectionOnDrag:h,onSelectionStart:d,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:v,onPaneMouseEnter:m,onPaneMouseMove:_,onPaneMouseLeave:x,children:C}){const S=Ct(),{userSelectionActive:p,elementsSelectable:g,dragging:b,connectionInProgress:y}=tt(Qk,wt),E=g&&(e||p),T=L.useRef(null),O=L.useRef(),D=L.useRef(new Set),A=L.useRef(new Set),N=L.useRef(!1),q=F=>{if(N.current||y){N.current=!1;return}u?.(F),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},P=F=>{if(Array.isArray(s)&&s?.includes(2)){F.preventDefault();return}c?.(F)},z=v?F=>v(F):void 0,W=F=>{N.current&&(F.stopPropagation(),N.current=!1)},U=F=>{const{domNode:k}=S.getState();if(O.current=k?.getBoundingClientRect(),!O.current)return;const $=F.target===T.current;if(!$&&!!F.target.closest(".nokey")||!e||!(h&&$||n)||F.button!==0||!F.isPrimary)return;F.target?.setPointerCapture?.(F.pointerId),N.current=!1;const{x:Q,y:J}=br(F.nativeEvent,O.current);S.setState({userSelectionRect:{width:0,height:0,startX:Q,startY:J,x:Q,y:J}}),$||(F.stopPropagation(),F.preventDefault())},G=F=>{const{userSelectionRect:k,transform:$,nodeLookup:B,edgeLookup:I,connectionLookup:Q,triggerNodeChanges:J,triggerEdgeChanges:ae,defaultEdgeOptions:Z,resetSelectedElements:X}=S.getState();if(!O.current||!k)return;const{x:V,y:ie}=br(F.nativeEvent,O.current),{startX:de,startY:re}=k;if(!N.current){const ke=n?0:a;if(Math.hypot(V-de,ie-re)<=ke)return;X(),d?.(F)}N.current=!0;const le={startX:de,startY:re,x:V<de?V:de,y:ie<re?ie:re,width:Math.abs(V-de),height:Math.abs(ie-re)},_e=D.current,Ee=A.current;D.current=new Set($p(B,le,$,i===Ml.Partial,!0).map(ke=>ke.id)),A.current=new Set;const He=Z?.selectable??!0;for(const ke of D.current){const Ce=Q.get(ke);if(Ce)for(const{edgeId:$t}of Ce.values()){const Bt=I.get($t);Bt&&(Bt.selectable??He)&&A.current.add($t)}}if(!Sb(_e,D.current)){const ke=Ko(B,D.current,!0);J(ke)}if(!Sb(Ee,A.current)){const ke=Ko(I,A.current);ae(ke)}S.setState({userSelectionRect:le,userSelectionActive:!0,nodesSelectionActive:!1})},H=F=>{F.button===0&&(F.target?.releasePointerCapture?.(F.pointerId),!p&&F.target===T.current&&S.getState().userSelectionRect&&q?.(F),S.setState({userSelectionActive:!1,userSelectionRect:null}),N.current&&(l?.(F),S.setState({nodesSelectionActive:D.current.size>0})))},K=s===!0||Array.isArray(s)&&s.includes(0);return M.jsxs("div",{className:Ft(["react-flow__pane",{draggable:K,dragging:b,selection:e}]),onClick:E?void 0:gm(q,T),onContextMenu:gm(P,T),onWheel:gm(z,T),onPointerEnter:E?void 0:m,onPointerMove:E?G:_,onPointerUp:E?H:void 0,onPointerDownCapture:E?U:void 0,onClickCapture:E?W:void 0,onPointerLeave:x,ref:T,style:Mh,children:[C,M.jsx(Xk,{})]})}function ep({id:e,store:n,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:a,unselectNodesAndEdges:h,multiSelectionActive:d,nodeLookup:l,onError:u}=n.getState(),c=l.get(e);if(!c){u?.("012",$r.error012(e));return}n.setState({nodesSelectionActive:!1}),c.selected?(i||c.selected&&d)&&(h({nodes:[c],edges:[]}),requestAnimationFrame(()=>s?.current?.blur())):a([e])}function l1({nodeRef:e,disabled:n=!1,noDragClassName:i,handleSelector:s,nodeId:a,isSelectable:h,nodeClickDistance:d}){const l=Ct(),[u,c]=L.useState(!1),v=L.useRef();return L.useEffect(()=>{v.current=zN({getStoreItems:()=>l.getState(),onNodeMouseDown:m=>{ep({id:m,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),L.useEffect(()=>{if(n)v.current?.destroy();else if(e.current)return v.current?.update({noDragClassName:i,handleSelector:s,domNode:e.current,isSelectable:h,nodeId:a,nodeClickDistance:d}),()=>{v.current?.destroy()}},[i,s,n,h,e,a]),u}const Jk=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function c1(){const e=Ct();return L.useCallback(i=>{const{nodeExtent:s,snapToGrid:a,snapGrid:h,nodesDraggable:d,onError:l,updateNodePositions:u,nodeLookup:c,nodeOrigin:v}=e.getState(),m=new Map,_=Jk(d),x=a?h[0]:5,C=a?h[1]:5,S=i.direction.x*x*i.factor,p=i.direction.y*C*i.factor;for(const[,g]of c){if(!_(g))continue;let b={x:g.internals.positionAbsolute.x+S,y:g.internals.positionAbsolute.y+p};a&&(b=Xl(b,h));const{position:y,positionAbsolute:E}=Tw({nodeId:g.id,nextPosition:b,nodeLookup:c,nodeExtent:s,nodeOrigin:v,onError:l});g.position=y,g.internals.positionAbsolute=E,m.set(g.id,g)}u(m)},[])}const Jp=L.createContext(null),e5=Jp.Provider;Jp.Consumer;const u1=()=>L.useContext(Jp),t5=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),n5=(e,n,i)=>s=>{const{connectionClickStartHandle:a,connectionMode:h,connection:d}=s,{fromHandle:l,toHandle:u,isValid:c}=d,v=u?.nodeId===e&&u?.id===n&&u?.type===i;return{connectingFrom:l?.nodeId===e&&l?.id===n&&l?.type===i,connectingTo:v,clickConnecting:a?.nodeId===e&&a?.id===n&&a?.type===i,isPossibleEndHandle:h===na.Strict?l?.type!==i:e!==l?.nodeId||n!==l?.id,connectionInProcess:!!l,clickConnectionInProcess:!!a,valid:v&&c}};function r5({type:e="source",position:n=Ne.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:a=!0,isConnectableEnd:h=!0,id:d,onConnect:l,children:u,className:c,onMouseDown:v,onTouchStart:m,..._},x){const C=d||null,S=e==="target",p=Ct(),g=u1(),{connectOnClick:b,noPanClassName:y,rfId:E}=tt(t5,wt),{connectingFrom:T,connectingTo:O,clickConnecting:D,isPossibleEndHandle:A,connectionInProcess:N,clickConnectionInProcess:q,valid:P}=tt(n5(g,C,e),wt);g||p.getState().onError?.("010",$r.error010());const z=G=>{const{defaultEdgeOptions:H,onConnect:K,hasDefaultEdges:F}=p.getState(),k={...H,...G};if(F){const{edges:$,setEdges:B}=p.getState();B(wN(k,$))}K?.(k),l?.(k)},W=G=>{if(!g)return;const H=Hw(G.nativeEvent);if(a&&(H&&G.button===0||!H)){const K=p.getState();Jm.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:K.autoPanOnConnect,connectionMode:K.connectionMode,connectionRadius:K.connectionRadius,domNode:K.domNode,nodeLookup:K.nodeLookup,lib:K.lib,isTarget:S,handleId:C,nodeId:g,flowId:K.rfId,panBy:K.panBy,cancelConnection:K.cancelConnection,onConnectStart:K.onConnectStart,onConnectEnd:K.onConnectEnd,updateConnection:K.updateConnection,onConnect:z,isValidConnection:i||K.isValidConnection,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,autoPanSpeed:K.autoPanSpeed,dragThreshold:K.connectionDragThreshold})}H?v?.(G):m?.(G)},U=G=>{const{onClickConnectStart:H,onClickConnectEnd:K,connectionClickStartHandle:F,connectionMode:k,isValidConnection:$,lib:B,rfId:I,nodeLookup:Q,connection:J}=p.getState();if(!g||!F&&!a)return;if(!F){H?.(G.nativeEvent,{nodeId:g,handleId:C,handleType:e}),p.setState({connectionClickStartHandle:{nodeId:g,type:e,id:C}});return}const ae=Bw(G.target),Z=i||$,{connection:X,isValid:V}=Jm.isValid(G.nativeEvent,{handle:{nodeId:g,id:C,type:e},connectionMode:k,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:Z,flowId:I,doc:ae,lib:B,nodeLookup:Q});V&&X&&z(X);const ie=structuredClone(J);delete ie.inProgress,ie.toPosition=ie.toHandle?ie.toHandle.position:null,K?.(G,ie),p.setState({connectionClickStartHandle:null})};return M.jsx("div",{"data-handleid":C,"data-nodeid":g,"data-handlepos":n,"data-id":`${E}-${g}-${C}-${e}`,className:Ft(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,c,{source:!S,target:S,connectable:s,connectablestart:a,connectableend:h,clickconnecting:D,connectingfrom:T,connectingto:O,valid:P,connectionindicator:s&&(!N||A)&&(N||q?h:a)}]),onMouseDown:W,onTouchStart:W,onClick:b?U:void 0,ref:x,..._,children:u})}const us=L.memo(o1(r5));function i5({data:e,isConnectable:n,sourcePosition:i=Ne.Bottom}){return M.jsxs(M.Fragment,{children:[e?.label,M.jsx(us,{type:"source",position:i,isConnectable:n})]})}function s5({data:e,isConnectable:n,targetPosition:i=Ne.Top,sourcePosition:s=Ne.Bottom}){return M.jsxs(M.Fragment,{children:[M.jsx(us,{type:"target",position:i,isConnectable:n}),e?.label,M.jsx(us,{type:"source",position:s,isConnectable:n})]})}function o5(){return null}function a5({data:e,isConnectable:n,targetPosition:i=Ne.Top}){return M.jsxs(M.Fragment,{children:[M.jsx(us,{type:"target",position:i,isConnectable:n}),e?.label]})}const oh={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Qb={input:i5,default:s5,output:a5,group:o5};function l5(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const c5=e=>{const{width:n,height:i,x:s,y:a}=Gl(e.nodeLookup,{filter:h=>!!h.selected});return{width:yr(n)?n:null,height:yr(i)?i:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${a}px)`}};function u5({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:i}){const s=Ct(),{width:a,height:h,transformString:d,userSelectionActive:l}=tt(c5,wt),u=c1(),c=L.useRef(null);if(L.useEffect(()=>{i||c.current?.focus({preventScroll:!0})},[i]),l1({nodeRef:c}),l||!a||!h)return null;const v=e?_=>{const x=s.getState().nodes.filter(C=>C.selected);e(_,x)}:void 0,m=_=>{Object.prototype.hasOwnProperty.call(oh,_.key)&&(_.preventDefault(),u({direction:oh[_.key],factor:_.shiftKey?4:1}))};return M.jsx("div",{className:Ft(["react-flow__nodesselection","react-flow__container",n]),style:{transform:d},children:M.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:v,tabIndex:i?void 0:-1,onKeyDown:i?void 0:m,style:{width:a,height:h}})})}const Zb=typeof window<"u"?window:void 0,h5=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function h1({children:e,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:h,onPaneScroll:d,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:c,selectionOnDrag:v,selectionMode:m,onSelectionStart:_,onSelectionEnd:x,multiSelectionKeyCode:C,panActivationKeyCode:S,zoomActivationKeyCode:p,elementsSelectable:g,zoomOnScroll:b,zoomOnPinch:y,panOnScroll:E,panOnScrollSpeed:T,panOnScrollMode:O,zoomOnDoubleClick:D,panOnDrag:A,defaultViewport:N,translateExtent:q,minZoom:P,maxZoom:z,preventScrolling:W,onSelectionContextMenu:U,noWheelClassName:G,noPanClassName:H,disableKeyboardA11y:K,onViewportChange:F,isControlledViewport:k}){const{nodesSelectionActive:$,userSelectionActive:B}=tt(h5,wt),I=Nl(c,{target:Zb}),Q=Nl(S,{target:Zb}),J=Q||A,ae=Q||E,Z=v&&J!==!0,X=I||B||Z;return qk({deleteKeyCode:u,multiSelectionKeyCode:C}),M.jsx(Kk,{onPaneContextMenu:h,elementsSelectable:g,zoomOnScroll:b,zoomOnPinch:y,panOnScroll:ae,panOnScrollSpeed:T,panOnScrollMode:O,zoomOnDoubleClick:D,panOnDrag:!I&&J,defaultViewport:N,translateExtent:q,minZoom:P,maxZoom:z,zoomActivationKeyCode:p,preventScrolling:W,noWheelClassName:G,noPanClassName:H,onViewportChange:F,isControlledViewport:k,paneClickDistance:l,selectionOnDrag:Z,children:M.jsxs(Zk,{onSelectionStart:_,onSelectionEnd:x,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:h,onPaneScroll:d,panOnDrag:J,isSelecting:!!X,selectionMode:m,selectionKeyPressed:I,paneClickDistance:l,selectionOnDrag:Z,children:[e,$&&M.jsx(u5,{onSelectionContextMenu:U,noPanClassName:H,disableKeyboardA11y:K})]})})}h1.displayName="FlowRenderer";const f5=L.memo(h1),d5=e=>n=>e?$p(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(i=>i.id):Array.from(n.nodeLookup.keys());function m5(e){return tt(L.useCallback(d5(e),[e]),wt)}const p5=e=>e.updateNodeInternals;function g5(){const e=tt(p5),[n]=L.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const s=new Map;i.forEach(a=>{const h=a.target.getAttribute("data-id");s.set(h,{id:h,nodeElement:a.target,force:!0})}),e(s)}));return L.useEffect(()=>()=>{n?.disconnect()},[n]),n}function v5({node:e,nodeType:n,hasDimensions:i,resizeObserver:s}){const a=Ct(),h=L.useRef(null),d=L.useRef(null),l=L.useRef(e.sourcePosition),u=L.useRef(e.targetPosition),c=L.useRef(n),v=i&&!!e.internals.handleBounds;return L.useEffect(()=>{h.current&&!e.hidden&&(!v||d.current!==h.current)&&(d.current&&s?.unobserve(d.current),s?.observe(h.current),d.current=h.current)},[v,e.hidden]),L.useEffect(()=>()=>{d.current&&(s?.unobserve(d.current),d.current=null)},[]),L.useEffect(()=>{if(h.current){const m=c.current!==n,_=l.current!==e.sourcePosition,x=u.current!==e.targetPosition;(m||_||x)&&(c.current=n,l.current=e.sourcePosition,u.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:h.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),h}function _5({id:e,onClick:n,onMouseEnter:i,onMouseMove:s,onMouseLeave:a,onContextMenu:h,onDoubleClick:d,nodesDraggable:l,elementsSelectable:u,nodesConnectable:c,nodesFocusable:v,resizeObserver:m,noDragClassName:_,noPanClassName:x,disableKeyboardA11y:C,rfId:S,nodeTypes:p,nodeClickDistance:g,onError:b}){const{node:y,internals:E,isParent:T}=tt(V=>{const ie=V.nodeLookup.get(e),de=V.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:de}},wt);let O=y.type||"default",D=p?.[O]||Qb[O];D===void 0&&(b?.("003",$r.error003(O)),O="default",D=p?.default||Qb.default);const A=!!(y.draggable||l&&typeof y.draggable>"u"),N=!!(y.selectable||u&&typeof y.selectable>"u"),q=!!(y.connectable||c&&typeof y.connectable>"u"),P=!!(y.focusable||v&&typeof y.focusable>"u"),z=Ct(),W=Nw(y),U=v5({node:y,nodeType:O,hasDimensions:W,resizeObserver:m}),G=l1({nodeRef:U,disabled:y.hidden||!A,noDragClassName:_,handleSelector:y.dragHandle,nodeId:e,isSelectable:N,nodeClickDistance:g}),H=c1();if(y.hidden)return null;const K=Di(y),F=l5(y),k=N||A||n||i||s||a,$=i?V=>i(V,{...E.userNode}):void 0,B=s?V=>s(V,{...E.userNode}):void 0,I=a?V=>a(V,{...E.userNode}):void 0,Q=h?V=>h(V,{...E.userNode}):void 0,J=d?V=>d(V,{...E.userNode}):void 0,ae=V=>{const{selectNodesOnDrag:ie,nodeDragThreshold:de}=z.getState();N&&(!ie||!A||de>0)&&ep({id:e,store:z,nodeRef:U}),n&&n(V,{...E.userNode})},Z=V=>{if(!(jw(V.nativeEvent)||C)){if(Cw.includes(V.key)&&N){const ie=V.key==="Escape";ep({id:e,store:z,unselect:ie,nodeRef:U})}else if(A&&y.selected&&Object.prototype.hasOwnProperty.call(oh,V.key)){V.preventDefault();const{ariaLabelConfig:ie}=z.getState();z.setState({ariaLiveMessage:ie["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~E.positionAbsolute.x,y:~~E.positionAbsolute.y})}),H({direction:oh[V.key],factor:V.shiftKey?4:1})}}},X=()=>{if(C||!U.current?.matches(":focus-visible"))return;const{transform:V,width:ie,height:de,autoPanOnNodeFocus:re,setCenter:le}=z.getState();if(!re)return;$p(new Map([[e,y]]),{x:0,y:0,width:ie,height:de},V,!0).length>0||le(y.position.x+K.width/2,y.position.y+K.height/2,{zoom:V[2]})};return M.jsx("div",{className:Ft(["react-flow__node",`react-flow__node-${O}`,{[x]:A},y.className,{selected:y.selected,selectable:N,parent:T,draggable:A,dragging:G}]),ref:U,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:k?"all":"none",visibility:W?"visible":"hidden",...y.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:$,onMouseMove:B,onMouseLeave:I,onContextMenu:Q,onClick:ae,onDoubleClick:J,onKeyDown:P?Z:void 0,tabIndex:P?0:void 0,onFocus:P?X:void 0,role:y.ariaRole??(P?"group":void 0),"aria-roledescription":"node","aria-describedby":C?void 0:`${e1}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:M.jsx(e5,{value:e,children:M.jsx(D,{id:e,data:y.data,type:O,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:y.selected??!1,selectable:N,draggable:A,deletable:y.deletable??!0,isConnectable:q,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:G,dragHandle:y.dragHandle,zIndex:E.z,parentId:y.parentId,...K})})})}var y5=L.memo(_5);const b5=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function f1(e){const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:s,elementsSelectable:a,onError:h}=tt(b5,wt),d=m5(e.onlyRenderVisibleElements),l=g5();return M.jsx("div",{className:"react-flow__nodes",style:Mh,children:d.map(u=>M.jsx(y5,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:n,nodesConnectable:i,nodesFocusable:s,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:h},u))})}f1.displayName="NodeRenderer";const S5=L.memo(f1);function x5(e){return tt(L.useCallback(i=>{if(!e)return i.edges.map(a=>a.id);const s=[];if(i.width&&i.height)for(const a of i.edges){const h=i.nodeLookup.get(a.source),d=i.nodeLookup.get(a.target);h&&d&&bN({sourceNode:h,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&s.push(a.id)}return s},[e]),wt)}const w5=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e}};return M.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},C5=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e,fill:e}};return M.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Jb={[rh.Arrow]:w5,[rh.ArrowClosed]:C5};function E5(e){const n=Ct();return L.useMemo(()=>Object.prototype.hasOwnProperty.call(Jb,e)?Jb[e]:(n.getState().onError?.("009",$r.error009(e)),null),[e])}const R5=({id:e,type:n,color:i,width:s=12.5,height:a=12.5,markerUnits:h="strokeWidth",strokeWidth:d,orient:l="auto-start-reverse"})=>{const u=E5(n);return u?M.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:h,orient:l,refX:"0",refY:"0",children:M.jsx(u,{color:i,strokeWidth:d})}):null},d1=({defaultColor:e,rfId:n})=>{const i=tt(h=>h.edges),s=tt(h=>h.defaultEdgeOptions),a=L.useMemo(()=>DN(i,{id:n,defaultColor:e,defaultMarkerStart:s?.markerStart,defaultMarkerEnd:s?.markerEnd}),[i,s,n,e]);return a.length?M.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:M.jsx("defs",{children:a.map(h=>M.jsx(R5,{id:h.id,type:h.type,color:h.color,width:h.width,height:h.height,markerUnits:h.markerUnits,strokeWidth:h.strokeWidth,orient:h.orient},h.id))})}):null};d1.displayName="MarkerDefinitions";var A5=L.memo(d1);function m1({x:e,y:n,label:i,labelStyle:s,labelShowBg:a=!0,labelBgStyle:h,labelBgPadding:d=[2,4],labelBgBorderRadius:l=2,children:u,className:c,...v}){const[m,_]=L.useState({x:1,y:0,width:0,height:0}),x=Ft(["react-flow__edge-textwrapper",c]),C=L.useRef(null);return L.useEffect(()=>{if(C.current){const S=C.current.getBBox();_({x:S.x,y:S.y,width:S.width,height:S.height})}},[i]),i?M.jsxs("g",{transform:`translate(${e-m.width/2} ${n-m.height/2})`,className:x,visibility:m.width?"visible":"hidden",...v,children:[a&&M.jsx("rect",{width:m.width+2*d[0],x:-d[0],y:-d[1],height:m.height+2*d[1],className:"react-flow__edge-textbg",style:h,rx:l,ry:l}),M.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:C,style:s,children:i}),u]}):null}m1.displayName="EdgeText";const D5=L.memo(m1);function as({path:e,labelX:n,labelY:i,label:s,labelStyle:a,labelShowBg:h,labelBgStyle:d,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:c=20,...v}){return M.jsxs(M.Fragment,{children:[M.jsx("path",{...v,d:e,fill:"none",className:Ft(["react-flow__edge-path",v.className])}),c?M.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,s&&yr(n)&&yr(i)?M.jsx(D5,{x:n,y:i,label:s,labelStyle:a,labelShowBg:h,labelBgStyle:d,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function eS({pos:e,x1:n,y1:i,x2:s,y2:a}){return e===Ne.Left||e===Ne.Right?[.5*(n+s),i]:[n,.5*(i+a)]}function p1({sourceX:e,sourceY:n,sourcePosition:i=Ne.Bottom,targetX:s,targetY:a,targetPosition:h=Ne.Top}){const[d,l]=eS({pos:i,x1:e,y1:n,x2:s,y2:a}),[u,c]=eS({pos:h,x1:s,y1:a,x2:e,y2:n}),[v,m,_,x]=Pw({sourceX:e,sourceY:n,targetX:s,targetY:a,sourceControlX:d,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${n} C${d},${l} ${u},${c} ${s},${a}`,v,m,_,x]}function g1(e){return L.memo(({id:n,sourceX:i,sourceY:s,targetX:a,targetY:h,sourcePosition:d,targetPosition:l,label:u,labelStyle:c,labelShowBg:v,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:x,style:C,markerEnd:S,markerStart:p,interactionWidth:g})=>{const[b,y,E]=p1({sourceX:i,sourceY:s,sourcePosition:d,targetX:a,targetY:h,targetPosition:l}),T=e.isInternal?void 0:n;return M.jsx(as,{id:T,path:b,labelX:y,labelY:E,label:u,labelStyle:c,labelShowBg:v,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:x,style:C,markerEnd:S,markerStart:p,interactionWidth:g})})}const T5=g1({isInternal:!1}),v1=g1({isInternal:!0});T5.displayName="SimpleBezierEdge";v1.displayName="SimpleBezierEdgeInternal";function _1(e){return L.memo(({id:n,sourceX:i,sourceY:s,targetX:a,targetY:h,label:d,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:v,labelBgBorderRadius:m,style:_,sourcePosition:x=Ne.Bottom,targetPosition:C=Ne.Top,markerEnd:S,markerStart:p,pathOptions:g,interactionWidth:b})=>{const[y,E,T]=Xm({sourceX:i,sourceY:s,sourcePosition:x,targetX:a,targetY:h,targetPosition:C,borderRadius:g?.borderRadius,offset:g?.offset,stepPosition:g?.stepPosition}),O=e.isInternal?void 0:n;return M.jsx(as,{id:O,path:y,labelX:E,labelY:T,label:d,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:v,labelBgBorderRadius:m,style:_,markerEnd:S,markerStart:p,interactionWidth:b})})}const y1=_1({isInternal:!1}),b1=_1({isInternal:!0});y1.displayName="SmoothStepEdge";b1.displayName="SmoothStepEdgeInternal";function S1(e){return L.memo(({id:n,...i})=>{const s=e.isInternal?void 0:n;return M.jsx(y1,{...i,id:s,pathOptions:L.useMemo(()=>({borderRadius:0,offset:i.pathOptions?.offset}),[i.pathOptions?.offset])})})}const M5=S1({isInternal:!1}),x1=S1({isInternal:!0});M5.displayName="StepEdge";x1.displayName="StepEdgeInternal";function w1(e){return L.memo(({id:n,sourceX:i,sourceY:s,targetX:a,targetY:h,label:d,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:v,labelBgBorderRadius:m,style:_,markerEnd:x,markerStart:C,interactionWidth:S})=>{const[p,g,b]=Iw({sourceX:i,sourceY:s,targetX:a,targetY:h}),y=e.isInternal?void 0:n;return M.jsx(as,{id:y,path:p,labelX:g,labelY:b,label:d,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:v,labelBgBorderRadius:m,style:_,markerEnd:x,markerStart:C,interactionWidth:S})})}const O5=w1({isInternal:!1}),C1=w1({isInternal:!0});O5.displayName="StraightEdge";C1.displayName="StraightEdgeInternal";function E1(e){return L.memo(({id:n,sourceX:i,sourceY:s,targetX:a,targetY:h,sourcePosition:d=Ne.Bottom,targetPosition:l=Ne.Top,label:u,labelStyle:c,labelShowBg:v,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:x,style:C,markerEnd:S,markerStart:p,pathOptions:g,interactionWidth:b})=>{const[y,E,T]=Wp({sourceX:i,sourceY:s,sourcePosition:d,targetX:a,targetY:h,targetPosition:l,curvature:g?.curvature}),O=e.isInternal?void 0:n;return M.jsx(as,{id:O,path:y,labelX:E,labelY:T,label:u,labelStyle:c,labelShowBg:v,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:x,style:C,markerEnd:S,markerStart:p,interactionWidth:b})})}const L5=E1({isInternal:!1}),R1=E1({isInternal:!0});L5.displayName="BezierEdge";R1.displayName="BezierEdgeInternal";const tS={default:R1,straight:C1,step:x1,smoothstep:b1,simplebezier:v1},nS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},N5=(e,n,i)=>i===Ne.Left?e-n:i===Ne.Right?e+n:e,k5=(e,n,i)=>i===Ne.Top?e-n:i===Ne.Bottom?e+n:e,rS="react-flow__edgeupdater";function iS({position:e,centerX:n,centerY:i,radius:s=10,onMouseDown:a,onMouseEnter:h,onMouseOut:d,type:l}){return M.jsx("circle",{onMouseDown:a,onMouseEnter:h,onMouseOut:d,className:Ft([rS,`${rS}-${l}`]),cx:N5(n,s,e),cy:k5(i,s,e),r:s,stroke:"transparent",fill:"transparent"})}function B5({isReconnectable:e,reconnectRadius:n,edge:i,sourceX:s,sourceY:a,targetX:h,targetY:d,sourcePosition:l,targetPosition:u,onReconnect:c,onReconnectStart:v,onReconnectEnd:m,setReconnecting:_,setUpdateHover:x}){const C=Ct(),S=(E,T)=>{if(E.button!==0)return;const{autoPanOnConnect:O,domNode:D,isValidConnection:A,connectionMode:N,connectionRadius:q,lib:P,onConnectStart:z,onConnectEnd:W,cancelConnection:U,nodeLookup:G,rfId:H,panBy:K,updateConnection:F}=C.getState(),k=T.type==="target",$=(Q,J)=>{_(!1),m?.(Q,i,T.type,J)},B=Q=>c?.(i,Q),I=(Q,J)=>{_(!0),v?.(E,i,T.type),z?.(Q,J)};Jm.onPointerDown(E.nativeEvent,{autoPanOnConnect:O,connectionMode:N,connectionRadius:q,domNode:D,handleId:T.id,nodeId:T.nodeId,nodeLookup:G,isTarget:k,edgeUpdaterType:T.type,lib:P,flowId:H,cancelConnection:U,panBy:K,isValidConnection:A,onConnect:B,onConnectStart:I,onConnectEnd:W,onReconnectEnd:$,updateConnection:F,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,dragThreshold:C.getState().connectionDragThreshold,handleDomNode:E.currentTarget})},p=E=>S(E,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),g=E=>S(E,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),b=()=>x(!0),y=()=>x(!1);return M.jsxs(M.Fragment,{children:[(e===!0||e==="source")&&M.jsx(iS,{position:l,centerX:s,centerY:a,radius:n,onMouseDown:p,onMouseEnter:b,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&M.jsx(iS,{position:u,centerX:h,centerY:d,radius:n,onMouseDown:g,onMouseEnter:b,onMouseOut:y,type:"target"})]})}function j5({id:e,edgesFocusable:n,edgesReconnectable:i,elementsSelectable:s,onClick:a,onDoubleClick:h,onContextMenu:d,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,reconnectRadius:v,onReconnect:m,onReconnectStart:_,onReconnectEnd:x,rfId:C,edgeTypes:S,noPanClassName:p,onError:g,disableKeyboardA11y:b}){let y=tt(le=>le.edgeLookup.get(e));const E=tt(le=>le.defaultEdgeOptions);y=E?{...E,...y}:y;let T=y.type||"default",O=S?.[T]||tS[T];O===void 0&&(g?.("011",$r.error011(T)),T="default",O=S?.default||tS.default);const D=!!(y.focusable||n&&typeof y.focusable>"u"),A=typeof m<"u"&&(y.reconnectable||i&&typeof y.reconnectable>"u"),N=!!(y.selectable||s&&typeof y.selectable>"u"),q=L.useRef(null),[P,z]=L.useState(!1),[W,U]=L.useState(!1),G=Ct(),{zIndex:H,sourceX:K,sourceY:F,targetX:k,targetY:$,sourcePosition:B,targetPosition:I}=tt(L.useCallback(le=>{const _e=le.nodeLookup.get(y.source),Ee=le.nodeLookup.get(y.target);if(!_e||!Ee)return{zIndex:y.zIndex,...nS};const He=AN({id:e,sourceNode:_e,targetNode:Ee,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:le.connectionMode,onError:g});return{zIndex:yN({selected:y.selected,zIndex:y.zIndex,sourceNode:_e,targetNode:Ee,elevateOnSelect:le.elevateEdgesOnSelect,zIndexMode:le.zIndexMode}),...He||nS}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),wt),Q=L.useMemo(()=>y.markerStart?`url('#${Qm(y.markerStart,C)}')`:void 0,[y.markerStart,C]),J=L.useMemo(()=>y.markerEnd?`url('#${Qm(y.markerEnd,C)}')`:void 0,[y.markerEnd,C]);if(y.hidden||K===null||F===null||k===null||$===null)return null;const ae=le=>{const{addSelectedEdges:_e,unselectNodesAndEdges:Ee,multiSelectionActive:He}=G.getState();N&&(G.setState({nodesSelectionActive:!1}),y.selected&&He?(Ee({nodes:[],edges:[y]}),q.current?.blur()):_e([e])),a&&a(le,y)},Z=h?le=>{h(le,{...y})}:void 0,X=d?le=>{d(le,{...y})}:void 0,V=l?le=>{l(le,{...y})}:void 0,ie=u?le=>{u(le,{...y})}:void 0,de=c?le=>{c(le,{...y})}:void 0,re=le=>{if(!b&&Cw.includes(le.key)&&N){const{unselectNodesAndEdges:_e,addSelectedEdges:Ee}=G.getState();le.key==="Escape"?(q.current?.blur(),_e({edges:[y]})):Ee([e])}};return M.jsx("svg",{style:{zIndex:H},children:M.jsxs("g",{className:Ft(["react-flow__edge",`react-flow__edge-${T}`,y.className,p,{selected:y.selected,animated:y.animated,inactive:!N&&!a,updating:P,selectable:N}]),onClick:ae,onDoubleClick:Z,onContextMenu:X,onMouseEnter:V,onMouseMove:ie,onMouseLeave:de,onKeyDown:D?re:void 0,tabIndex:D?0:void 0,role:y.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":D?`${t1}-${C}`:void 0,ref:q,...y.domAttributes,children:[!W&&M.jsx(O,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:N,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:K,sourceY:F,targetX:k,targetY:$,sourcePosition:B,targetPosition:I,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:Q,markerEnd:J,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),A&&M.jsx(B5,{edge:y,isReconnectable:A,reconnectRadius:v,onReconnect:m,onReconnectStart:_,onReconnectEnd:x,sourceX:K,sourceY:F,targetX:k,targetY:$,sourcePosition:B,targetPosition:I,setUpdateHover:z,setReconnecting:U})]})})}var H5=L.memo(j5);const P5=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function A1({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:i,edgeTypes:s,noPanClassName:a,onReconnect:h,onEdgeContextMenu:d,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:v,reconnectRadius:m,onEdgeDoubleClick:_,onReconnectStart:x,onReconnectEnd:C,disableKeyboardA11y:S}){const{edgesFocusable:p,edgesReconnectable:g,elementsSelectable:b,onError:y}=tt(P5,wt),E=x5(n);return M.jsxs("div",{className:"react-flow__edges",children:[M.jsx(A5,{defaultColor:e,rfId:i}),E.map(T=>M.jsx(H5,{id:T,edgesFocusable:p,edgesReconnectable:g,elementsSelectable:b,noPanClassName:a,onReconnect:h,onContextMenu:d,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,onClick:v,reconnectRadius:m,onDoubleClick:_,onReconnectStart:x,onReconnectEnd:C,rfId:i,onError:y,edgeTypes:s,disableKeyboardA11y:S},T))]})}A1.displayName="EdgeRenderer";const z5=L.memo(A1),I5=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function U5({children:e}){const n=tt(I5);return M.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function F5(e){const n=Zp(),i=L.useRef(!1);L.useEffect(()=>{!i.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),i.current=!0)},[e,n.viewportInitialized])}const $5=e=>e.panZoom?.syncViewport;function V5(e){const n=tt($5),i=Ct();return L.useEffect(()=>{e&&(n?.(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function q5(e){return e.connection.inProgress?{...e.connection,to:Ql(e.connection.to,e.transform)}:{...e.connection}}function W5(e){return q5}function Y5(e){const n=W5();return tt(n,wt)}const K5=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function G5({containerStyle:e,style:n,type:i,component:s}){const{nodesConnectable:a,width:h,height:d,isValid:l,inProgress:u}=tt(K5,wt);return!(h&&a&&u)?null:M.jsx("svg",{style:e,width:h,height:d,className:"react-flow__connectionline react-flow__container",children:M.jsx("g",{className:Ft(["react-flow__connection",Aw(l)]),children:M.jsx(D1,{style:n,type:i,CustomComponent:s,isValid:l})})})}const D1=({style:e,type:n=ss.Bezier,CustomComponent:i,isValid:s})=>{const{inProgress:a,from:h,fromNode:d,fromHandle:l,fromPosition:u,to:c,toNode:v,toHandle:m,toPosition:_,pointer:x}=Y5();if(!a)return;if(i)return M.jsx(i,{connectionLineType:n,connectionLineStyle:e,fromNode:d,fromHandle:l,fromX:h.x,fromY:h.y,toX:c.x,toY:c.y,fromPosition:u,toPosition:_,connectionStatus:Aw(s),toNode:v,toHandle:m,pointer:x});let C="";const S={sourceX:h.x,sourceY:h.y,sourcePosition:u,targetX:c.x,targetY:c.y,targetPosition:_};switch(n){case ss.Bezier:[C]=Wp(S);break;case ss.SimpleBezier:[C]=p1(S);break;case ss.Step:[C]=Xm({...S,borderRadius:0});break;case ss.SmoothStep:[C]=Xm(S);break;default:[C]=Iw(S)}return M.jsx("path",{d:C,fill:"none",className:"react-flow__connection-path",style:e})};D1.displayName="ConnectionLine";const X5={};function sS(e=X5){L.useRef(e),Ct(),L.useEffect(()=>{},[e])}function Q5(){Ct(),L.useRef(!1),L.useEffect(()=>{},[])}function T1({nodeTypes:e,edgeTypes:n,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:h,onEdgeDoubleClick:d,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:v,onSelectionContextMenu:m,onSelectionStart:_,onSelectionEnd:x,connectionLineType:C,connectionLineStyle:S,connectionLineComponent:p,connectionLineContainerStyle:g,selectionKeyCode:b,selectionOnDrag:y,selectionMode:E,multiSelectionKeyCode:T,panActivationKeyCode:O,zoomActivationKeyCode:D,deleteKeyCode:A,onlyRenderVisibleElements:N,elementsSelectable:q,defaultViewport:P,translateExtent:z,minZoom:W,maxZoom:U,preventScrolling:G,defaultMarkerColor:H,zoomOnScroll:K,zoomOnPinch:F,panOnScroll:k,panOnScrollSpeed:$,panOnScrollMode:B,zoomOnDoubleClick:I,panOnDrag:Q,onPaneClick:J,onPaneMouseEnter:ae,onPaneMouseMove:Z,onPaneMouseLeave:X,onPaneScroll:V,onPaneContextMenu:ie,paneClickDistance:de,nodeClickDistance:re,onEdgeContextMenu:le,onEdgeMouseEnter:_e,onEdgeMouseMove:Ee,onEdgeMouseLeave:He,reconnectRadius:ke,onReconnect:Ce,onReconnectStart:$t,onReconnectEnd:Bt,noDragClassName:tn,noWheelClassName:fn,noPanClassName:_n,disableKeyboardA11y:At,nodeExtent:it,rfId:Et,viewport:Gt,onViewportChange:ln}){return sS(e),sS(n),Q5(),F5(i),V5(Gt),M.jsx(f5,{onPaneClick:J,onPaneMouseEnter:ae,onPaneMouseMove:Z,onPaneMouseLeave:X,onPaneContextMenu:ie,onPaneScroll:V,paneClickDistance:de,deleteKeyCode:A,selectionKeyCode:b,selectionOnDrag:y,selectionMode:E,onSelectionStart:_,onSelectionEnd:x,multiSelectionKeyCode:T,panActivationKeyCode:O,zoomActivationKeyCode:D,elementsSelectable:q,zoomOnScroll:K,zoomOnPinch:F,zoomOnDoubleClick:I,panOnScroll:k,panOnScrollSpeed:$,panOnScrollMode:B,panOnDrag:Q,defaultViewport:P,translateExtent:z,minZoom:W,maxZoom:U,onSelectionContextMenu:m,preventScrolling:G,noDragClassName:tn,noWheelClassName:fn,noPanClassName:_n,disableKeyboardA11y:At,onViewportChange:ln,isControlledViewport:!!Gt,children:M.jsxs(U5,{children:[M.jsx(z5,{edgeTypes:n,onEdgeClick:a,onEdgeDoubleClick:d,onReconnect:Ce,onReconnectStart:$t,onReconnectEnd:Bt,onlyRenderVisibleElements:N,onEdgeContextMenu:le,onEdgeMouseEnter:_e,onEdgeMouseMove:Ee,onEdgeMouseLeave:He,reconnectRadius:ke,defaultMarkerColor:H,noPanClassName:_n,disableKeyboardA11y:At,rfId:Et}),M.jsx(G5,{style:S,type:C,component:p,containerStyle:g}),M.jsx("div",{className:"react-flow__edgelabel-renderer"}),M.jsx(S5,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:h,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:v,nodeClickDistance:re,onlyRenderVisibleElements:N,noPanClassName:_n,noDragClassName:tn,disableKeyboardA11y:At,nodeExtent:it,rfId:Et}),M.jsx("div",{className:"react-flow__viewport-portal"})]})})}T1.displayName="GraphView";const Z5=L.memo(T1),oS=({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,width:a,height:h,fitView:d,fitViewOptions:l,minZoom:u=.5,maxZoom:c=2,nodeOrigin:v,nodeExtent:m,zIndexMode:_="basic"}={})=>{const x=new Map,C=new Map,S=new Map,p=new Map,g=s??n??[],b=i??e??[],y=v??[0,0],E=m??Tl;$w(S,p,g);const T=Zm(b,x,C,{nodeOrigin:y,nodeExtent:E,zIndexMode:_});let O=[0,0,1];if(d&&a&&h){const D=Gl(x,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:A,y:N,zoom:q}=Vp(D,a,h,u,c,l?.padding??.1);O=[A,N,q]}return{rfId:"1",width:a??0,height:h??0,transform:O,nodes:b,nodesInitialized:T,nodeLookup:x,parentLookup:C,edges:g,edgeLookup:p,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:u,maxZoom:c,translateExtent:Tl,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:na.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:d??!1,fitViewOptions:l,fitViewResolver:null,connection:{...Rw},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:dN,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Ew,zIndexMode:_,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},J5=({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,width:a,height:h,fitView:d,fitViewOptions:l,minZoom:u,maxZoom:c,nodeOrigin:v,nodeExtent:m,zIndexMode:_})=>vk((x,C)=>{async function S(){const{nodeLookup:p,panZoom:g,fitViewOptions:b,fitViewResolver:y,width:E,height:T,minZoom:O,maxZoom:D}=C();g&&(await hN({nodes:p,width:E,height:T,panZoom:g,minZoom:O,maxZoom:D},b),y?.resolve(!0),x({fitViewResolver:null}))}return{...oS({nodes:e,edges:n,width:a,height:h,fitView:d,fitViewOptions:l,minZoom:u,maxZoom:c,nodeOrigin:v,nodeExtent:m,defaultNodes:i,defaultEdges:s,zIndexMode:_}),setNodes:p=>{const{nodeLookup:g,parentLookup:b,nodeOrigin:y,elevateNodesOnSelect:E,fitViewQueued:T,zIndexMode:O}=C(),D=Zm(p,g,b,{nodeOrigin:y,nodeExtent:m,elevateNodesOnSelect:E,checkEquality:!0,zIndexMode:O});T&&D?(S(),x({nodes:p,nodesInitialized:D,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:p,nodesInitialized:D})},setEdges:p=>{const{connectionLookup:g,edgeLookup:b}=C();$w(g,b,p),x({edges:p})},setDefaultNodesAndEdges:(p,g)=>{if(p){const{setNodes:b}=C();b(p),x({hasDefaultNodes:!0})}if(g){const{setEdges:b}=C();b(g),x({hasDefaultEdges:!0})}},updateNodeInternals:p=>{const{triggerNodeChanges:g,nodeLookup:b,parentLookup:y,domNode:E,nodeOrigin:T,nodeExtent:O,debug:D,fitViewQueued:A,zIndexMode:N}=C(),{changes:q,updatedInternals:P}=BN(p,b,y,E,T,O,N);P&&(ON(b,y,{nodeOrigin:T,nodeExtent:O,zIndexMode:N}),A?(S(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),q?.length>0&&(D&&console.log("React Flow: trigger node changes",q),g?.(q)))},updateNodePositions:(p,g=!1)=>{const b=[];let y=[];const{nodeLookup:E,triggerNodeChanges:T,connection:O,updateConnection:D,onNodesChangeMiddlewareMap:A}=C();for(const[N,q]of p){const P=E.get(N),z=!!(P?.expandParent&&P?.parentId&&q?.position),W={id:N,type:"position",position:z?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:g};if(P&&O.inProgress&&O.fromNode.id===P.id){const U=Ys(P,O.fromHandle,Ne.Left,!0);D({...O,from:U})}z&&P.parentId&&b.push({id:N,parentId:P.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),y.push(W)}if(b.length>0){const{parentLookup:N,nodeOrigin:q}=C(),P=Qp(b,E,N,q);y.push(...P)}for(const N of A.values())y=N(y);T(y)},triggerNodeChanges:p=>{const{onNodesChange:g,setNodes:b,nodes:y,hasDefaultNodes:E,debug:T}=C();if(p?.length){if(E){const O=i1(p,y);b(O)}T&&console.log("React Flow: trigger node changes",p),g?.(p)}},triggerEdgeChanges:p=>{const{onEdgesChange:g,setEdges:b,edges:y,hasDefaultEdges:E,debug:T}=C();if(p?.length){if(E){const O=s1(p,y);b(O)}T&&console.log("React Flow: trigger edge changes",p),g?.(p)}},addSelectedNodes:p=>{const{multiSelectionActive:g,edgeLookup:b,nodeLookup:y,triggerNodeChanges:E,triggerEdgeChanges:T}=C();if(g){const O=p.map(D=>Bs(D,!0));E(O);return}E(Ko(y,new Set([...p]),!0)),T(Ko(b))},addSelectedEdges:p=>{const{multiSelectionActive:g,edgeLookup:b,nodeLookup:y,triggerNodeChanges:E,triggerEdgeChanges:T}=C();if(g){const O=p.map(D=>Bs(D,!0));T(O);return}T(Ko(b,new Set([...p]))),E(Ko(y,new Set,!0))},unselectNodesAndEdges:({nodes:p,edges:g}={})=>{const{edges:b,nodes:y,nodeLookup:E,triggerNodeChanges:T,triggerEdgeChanges:O}=C(),D=p||y,A=g||b,N=D.map(P=>{const z=E.get(P.id);return z&&(z.selected=!1),Bs(P.id,!1)}),q=A.map(P=>Bs(P.id,!1));T(N),O(q)},setMinZoom:p=>{const{panZoom:g,maxZoom:b}=C();g?.setScaleExtent([p,b]),x({minZoom:p})},setMaxZoom:p=>{const{panZoom:g,minZoom:b}=C();g?.setScaleExtent([b,p]),x({maxZoom:p})},setTranslateExtent:p=>{C().panZoom?.setTranslateExtent(p),x({translateExtent:p})},resetSelectedElements:()=>{const{edges:p,nodes:g,triggerNodeChanges:b,triggerEdgeChanges:y,elementsSelectable:E}=C();if(!E)return;const T=g.reduce((D,A)=>A.selected?[...D,Bs(A.id,!1)]:D,[]),O=p.reduce((D,A)=>A.selected?[...D,Bs(A.id,!1)]:D,[]);b(T),y(O)},setNodeExtent:p=>{const{nodes:g,nodeLookup:b,parentLookup:y,nodeOrigin:E,elevateNodesOnSelect:T,nodeExtent:O,zIndexMode:D}=C();p[0][0]===O[0][0]&&p[0][1]===O[0][1]&&p[1][0]===O[1][0]&&p[1][1]===O[1][1]||(Zm(g,b,y,{nodeOrigin:E,nodeExtent:p,elevateNodesOnSelect:T,checkEquality:!1,zIndexMode:D}),x({nodeExtent:p}))},panBy:p=>{const{transform:g,width:b,height:y,panZoom:E,translateExtent:T}=C();return jN({delta:p,panZoom:E,transform:g,translateExtent:T,width:b,height:y})},setCenter:async(p,g,b)=>{const{width:y,height:E,maxZoom:T,panZoom:O}=C();if(!O)return Promise.resolve(!1);const D=typeof b?.zoom<"u"?b.zoom:T;return await O.setViewport({x:y/2-p*D,y:E/2-g*D,zoom:D},{duration:b?.duration,ease:b?.ease,interpolate:b?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...Rw}})},updateConnection:p=>{x({connection:p})},reset:()=>x({...oS()})}},Object.is);function e4({initialNodes:e,initialEdges:n,defaultNodes:i,defaultEdges:s,initialWidth:a,initialHeight:h,initialMinZoom:d,initialMaxZoom:l,initialFitViewOptions:u,fitView:c,nodeOrigin:v,nodeExtent:m,zIndexMode:_,children:x}){const[C]=L.useState(()=>J5({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,width:a,height:h,fitView:c,minZoom:d,maxZoom:l,fitViewOptions:u,nodeOrigin:v,nodeExtent:m,zIndexMode:_}));return M.jsx(_k,{value:C,children:M.jsx(Uk,{children:x})})}function t4({children:e,nodes:n,edges:i,defaultNodes:s,defaultEdges:a,width:h,height:d,fitView:l,fitViewOptions:u,minZoom:c,maxZoom:v,nodeOrigin:m,nodeExtent:_,zIndexMode:x}){return L.useContext(Dh)?M.jsx(M.Fragment,{children:e}):M.jsx(e4,{initialNodes:n,initialEdges:i,defaultNodes:s,defaultEdges:a,initialWidth:h,initialHeight:d,fitView:l,initialFitViewOptions:u,initialMinZoom:c,initialMaxZoom:v,nodeOrigin:m,nodeExtent:_,zIndexMode:x,children:e})}const n4={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function r4({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,className:a,nodeTypes:h,edgeTypes:d,onNodeClick:l,onEdgeClick:u,onInit:c,onMove:v,onMoveStart:m,onMoveEnd:_,onConnect:x,onConnectStart:C,onConnectEnd:S,onClickConnectStart:p,onClickConnectEnd:g,onNodeMouseEnter:b,onNodeMouseMove:y,onNodeMouseLeave:E,onNodeContextMenu:T,onNodeDoubleClick:O,onNodeDragStart:D,onNodeDrag:A,onNodeDragStop:N,onNodesDelete:q,onEdgesDelete:P,onDelete:z,onSelectionChange:W,onSelectionDragStart:U,onSelectionDrag:G,onSelectionDragStop:H,onSelectionContextMenu:K,onSelectionStart:F,onSelectionEnd:k,onBeforeDelete:$,connectionMode:B,connectionLineType:I=ss.Bezier,connectionLineStyle:Q,connectionLineComponent:J,connectionLineContainerStyle:ae,deleteKeyCode:Z="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:V=!1,selectionMode:ie=Ml.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:re=Ll()?"Meta":"Control",zoomActivationKeyCode:le=Ll()?"Meta":"Control",snapToGrid:_e,snapGrid:Ee,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:ke,nodesDraggable:Ce,autoPanOnNodeFocus:$t,nodesConnectable:Bt,nodesFocusable:tn,nodeOrigin:fn=n1,edgesFocusable:_n,edgesReconnectable:At,elementsSelectable:it=!0,defaultViewport:Et=Ok,minZoom:Gt=.5,maxZoom:ln=2,translateExtent:dt=Tl,preventScrolling:Xt=!0,nodeExtent:Qt,defaultMarkerColor:ar="#b1b1b7",zoomOnScroll:st=!0,zoomOnPinch:lr=!0,panOnScroll:gt=!1,panOnScrollSpeed:Mn=.5,panOnScrollMode:Zt=Is.Free,zoomOnDoubleClick:no=!0,panOnDrag:ma=!0,onPaneClick:ro,onPaneMouseEnter:cr,onPaneMouseMove:Kr,onPaneMouseLeave:Er,onPaneScroll:ur,onPaneContextMenu:Gr,paneClickDistance:Xr=1,nodeClickDistance:io=0,children:Qr,onReconnect:Rr,onReconnectStart:Ar,onReconnectEnd:pa,onEdgeContextMenu:so,onEdgeDoubleClick:ee,onEdgeMouseEnter:se,onEdgeMouseMove:fe,onEdgeMouseLeave:ye,reconnectRadius:be=10,onNodesChange:Me,onEdgesChange:xe,noDragClassName:Se="nodrag",noWheelClassName:we="nowheel",noPanClassName:Te="nopan",fitView:Be,fitViewOptions:Le,connectOnClick:Qe,attributionPosition:qe,proOptions:vt,defaultEdgeOptions:bt,elevateNodesOnSelect:St=!0,elevateEdgesOnSelect:We=!1,disableKeyboardA11y:Mt=!1,autoPanOnConnect:cn,autoPanOnNodeDrag:mt,autoPanSpeed:On,connectionRadius:dn,isValidConnection:Ln,onError:yn,style:hr,id:Dr,nodeDragThreshold:Zr,connectionDragThreshold:Ye,viewport:Rt,onViewportChange:Nn,width:Vt,height:Ke,colorMode:Jr="light",debug:oo,onScroll:Ti,ariaLabelConfig:tc,zIndexMode:gs="basic",...zh},bn){const vs=Dr||"1",nc=Bk(Jr),ga=L.useCallback(ei=>{ei.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ti?.(ei)},[Ti]);return M.jsx("div",{"data-testid":"rf__wrapper",...zh,onScroll:ga,style:{...hr,...n4},ref:bn,className:Ft(["react-flow",a,nc]),id:Dr,role:"application",children:M.jsxs(t4,{nodes:e,edges:n,width:Vt,height:Ke,fitView:Be,fitViewOptions:Le,minZoom:Gt,maxZoom:ln,nodeOrigin:fn,nodeExtent:Qt,zIndexMode:gs,children:[M.jsx(Z5,{onInit:c,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:b,onNodeMouseMove:y,onNodeMouseLeave:E,onNodeContextMenu:T,onNodeDoubleClick:O,nodeTypes:h,edgeTypes:d,connectionLineType:I,connectionLineStyle:Q,connectionLineComponent:J,connectionLineContainerStyle:ae,selectionKeyCode:X,selectionOnDrag:V,selectionMode:ie,deleteKeyCode:Z,multiSelectionKeyCode:re,panActivationKeyCode:de,zoomActivationKeyCode:le,onlyRenderVisibleElements:He,defaultViewport:Et,translateExtent:dt,minZoom:Gt,maxZoom:ln,preventScrolling:Xt,zoomOnScroll:st,zoomOnPinch:lr,zoomOnDoubleClick:no,panOnScroll:gt,panOnScrollSpeed:Mn,panOnScrollMode:Zt,panOnDrag:ma,onPaneClick:ro,onPaneMouseEnter:cr,onPaneMouseMove:Kr,onPaneMouseLeave:Er,onPaneScroll:ur,onPaneContextMenu:Gr,paneClickDistance:Xr,nodeClickDistance:io,onSelectionContextMenu:K,onSelectionStart:F,onSelectionEnd:k,onReconnect:Rr,onReconnectStart:Ar,onReconnectEnd:pa,onEdgeContextMenu:so,onEdgeDoubleClick:ee,onEdgeMouseEnter:se,onEdgeMouseMove:fe,onEdgeMouseLeave:ye,reconnectRadius:be,defaultMarkerColor:ar,noDragClassName:Se,noWheelClassName:we,noPanClassName:Te,rfId:vs,disableKeyboardA11y:Mt,nodeExtent:Qt,viewport:Rt,onViewportChange:Nn}),M.jsx(kk,{nodes:e,edges:n,defaultNodes:i,defaultEdges:s,onConnect:x,onConnectStart:C,onConnectEnd:S,onClickConnectStart:p,onClickConnectEnd:g,nodesDraggable:Ce,autoPanOnNodeFocus:$t,nodesConnectable:Bt,nodesFocusable:tn,edgesFocusable:_n,edgesReconnectable:At,elementsSelectable:it,elevateNodesOnSelect:St,elevateEdgesOnSelect:We,minZoom:Gt,maxZoom:ln,nodeExtent:Qt,onNodesChange:Me,onEdgesChange:xe,snapToGrid:_e,snapGrid:Ee,connectionMode:B,translateExtent:dt,connectOnClick:Qe,defaultEdgeOptions:bt,fitView:Be,fitViewOptions:Le,onNodesDelete:q,onEdgesDelete:P,onDelete:z,onNodeDragStart:D,onNodeDrag:A,onNodeDragStop:N,onSelectionDrag:G,onSelectionDragStart:U,onSelectionDragStop:H,onMove:v,onMoveStart:m,onMoveEnd:_,noPanClassName:Te,nodeOrigin:fn,rfId:vs,autoPanOnConnect:cn,autoPanOnNodeDrag:mt,autoPanSpeed:On,onError:yn,connectionRadius:dn,isValidConnection:Ln,selectNodesOnDrag:ke,nodeDragThreshold:Zr,connectionDragThreshold:Ye,onBeforeDelete:$,debug:oo,ariaLabelConfig:tc,zIndexMode:gs}),M.jsx(Mk,{onSelectionChange:W}),Qr,M.jsx(Ek,{proOptions:vt,position:qe}),M.jsx(Ck,{rfId:vs,disableKeyboardA11y:Mt})]})})}var i4=o1(r4);const s4=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function vm({children:e}){const n=tt(s4);return n?to.createPortal(e,n):null}function o4(e){const[n,i]=L.useState(e),s=L.useCallback(a=>i(h=>i1(a,h)),[]);return[n,i,s]}function a4(e){const[n,i]=L.useState(e),s=L.useCallback(a=>i(h=>s1(a,h)),[]);return[n,i,s]}function l4({dimensions:e,lineWidth:n,variant:i,className:s}){return M.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ft(["react-flow__background-pattern",i,s])})}function c4({radius:e,className:n}){return M.jsx("circle",{cx:e,cy:e,r:e,className:Ft(["react-flow__background-pattern","dots",n])})}var xi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(xi||(xi={}));const u4={[xi.Dots]:1,[xi.Lines]:1,[xi.Cross]:6},h4=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function M1({id:e,variant:n=xi.Dots,gap:i=20,size:s,lineWidth:a=1,offset:h=0,color:d,bgColor:l,style:u,className:c,patternClassName:v}){const m=L.useRef(null),{transform:_,patternId:x}=tt(h4,wt),C=s||u4[n],S=n===xi.Dots,p=n===xi.Cross,g=Array.isArray(i)?i:[i,i],b=[g[0]*_[2]||1,g[1]*_[2]||1],y=C*_[2],E=Array.isArray(h)?h:[h,h],T=p?[y,y]:b,O=[E[0]*_[2]||1+T[0]/2,E[1]*_[2]||1+T[1]/2],D=`${x}${e||""}`;return M.jsxs("svg",{className:Ft(["react-flow__background",c]),style:{...u,...Mh,"--xy-background-color-props":l,"--xy-background-pattern-color-props":d},ref:m,"data-testid":"rf__background",children:[M.jsx("pattern",{id:D,x:_[0]%b[0],y:_[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${O[0]},-${O[1]})`,children:S?M.jsx(c4,{radius:y/2,className:v}):M.jsx(l4,{dimensions:T,lineWidth:a,variant:n,className:v})}),M.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}M1.displayName="Background";const f4=L.memo(M1);function d4(){return M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:M.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function m4(){return M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:M.jsx("path",{d:"M0 0h32v4.2H0z"})})}function p4(){return M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:M.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function g4(){return M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:M.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function v4(){return M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:M.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Ru({children:e,className:n,...i}){return M.jsx("button",{type:"button",className:Ft(["react-flow__controls-button",n]),...i,children:e})}const _4=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function O1({style:e,showZoom:n=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:a,onZoomIn:h,onZoomOut:d,onFitView:l,onInteractiveChange:u,className:c,children:v,position:m="bottom-left",orientation:_="vertical","aria-label":x}){const C=Ct(),{isInteractive:S,minZoomReached:p,maxZoomReached:g,ariaLabelConfig:b}=tt(_4,wt),{zoomIn:y,zoomOut:E,fitView:T}=Zp(),O=()=>{y(),h?.()},D=()=>{E(),d?.()},A=()=>{T(a),l?.()},N=()=>{C.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),u?.(!S)},q=_==="horizontal"?"horizontal":"vertical";return M.jsxs(Th,{className:Ft(["react-flow__controls",q,c]),position:m,style:e,"data-testid":"rf__controls","aria-label":x??b["controls.ariaLabel"],children:[n&&M.jsxs(M.Fragment,{children:[M.jsx(Ru,{onClick:O,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:g,children:M.jsx(d4,{})}),M.jsx(Ru,{onClick:D,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:p,children:M.jsx(m4,{})})]}),i&&M.jsx(Ru,{className:"react-flow__controls-fitview",onClick:A,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:M.jsx(p4,{})}),s&&M.jsx(Ru,{className:"react-flow__controls-interactive",onClick:N,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:S?M.jsx(v4,{}):M.jsx(g4,{})}),v]})}O1.displayName="Controls";const y4=L.memo(O1);function b4({id:e,x:n,y:i,width:s,height:a,style:h,color:d,strokeColor:l,strokeWidth:u,className:c,borderRadius:v,shapeRendering:m,selected:_,onClick:x}){const{background:C,backgroundColor:S}=h||{},p=d||C||S;return M.jsx("rect",{className:Ft(["react-flow__minimap-node",{selected:_},c]),x:n,y:i,rx:v,ry:v,width:s,height:a,style:{fill:p,stroke:l,strokeWidth:u},shapeRendering:m,onClick:x?g=>x(g,e):void 0})}const S4=L.memo(b4),x4=e=>e.nodes.map(n=>n.id),_m=e=>e instanceof Function?e:()=>e;function w4({nodeStrokeColor:e,nodeColor:n,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:h=S4,onClick:d}){const l=tt(x4,wt),u=_m(n),c=_m(e),v=_m(i),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return M.jsx(M.Fragment,{children:l.map(_=>M.jsx(E4,{id:_,nodeColorFunc:u,nodeStrokeColorFunc:c,nodeClassNameFunc:v,nodeBorderRadius:s,nodeStrokeWidth:a,NodeComponent:h,onClick:d,shapeRendering:m},_))})}function C4({id:e,nodeColorFunc:n,nodeStrokeColorFunc:i,nodeClassNameFunc:s,nodeBorderRadius:a,nodeStrokeWidth:h,shapeRendering:d,NodeComponent:l,onClick:u}){const{node:c,x:v,y:m,width:_,height:x}=tt(C=>{const{internals:S}=C.nodeLookup.get(e),p=S.userNode,{x:g,y:b}=S.positionAbsolute,{width:y,height:E}=Di(p);return{node:p,x:g,y:b,width:y,height:E}},wt);return!c||c.hidden||!Nw(c)?null:M.jsx(l,{x:v,y:m,width:_,height:x,style:c.style,selected:!!c.selected,className:s(c),color:n(c),borderRadius:a,strokeColor:i(c),strokeWidth:h,shapeRendering:d,onClick:u,id:c.id})}const E4=L.memo(C4);var R4=L.memo(w4);const A4=200,D4=150,T4=e=>!e.hidden,M4=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?Lw(Gl(e.nodeLookup,{filter:T4}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},O4="react-flow__minimap-desc";function L1({style:e,className:n,nodeStrokeColor:i,nodeColor:s,nodeClassName:a="",nodeBorderRadius:h=5,nodeStrokeWidth:d,nodeComponent:l,bgColor:u,maskColor:c,maskStrokeColor:v,maskStrokeWidth:m,position:_="bottom-right",onClick:x,onNodeClick:C,pannable:S=!1,zoomable:p=!1,ariaLabel:g,inversePan:b,zoomStep:y=1,offsetScale:E=5}){const T=Ct(),O=L.useRef(null),{boundingRect:D,viewBB:A,rfId:N,panZoom:q,translateExtent:P,flowWidth:z,flowHeight:W,ariaLabelConfig:U}=tt(M4,wt),G=e?.width??A4,H=e?.height??D4,K=D.width/G,F=D.height/H,k=Math.max(K,F),$=k*G,B=k*H,I=E*k,Q=D.x-($-D.width)/2-I,J=D.y-(B-D.height)/2-I,ae=$+I*2,Z=B+I*2,X=`${O4}-${N}`,V=L.useRef(0),ie=L.useRef();V.current=k,L.useEffect(()=>{if(O.current&&q)return ie.current=qN({domNode:O.current,panZoom:q,getTransform:()=>T.getState().transform,getViewScale:()=>V.current}),()=>{ie.current?.destroy()}},[q]),L.useEffect(()=>{ie.current?.update({translateExtent:P,width:z,height:W,inversePan:b,pannable:S,zoomStep:y,zoomable:p})},[S,p,b,y,P,z,W]);const de=x?_e=>{const[Ee,He]=ie.current?.pointer(_e)||[0,0];x(_e,{x:Ee,y:He})}:void 0,re=C?L.useCallback((_e,Ee)=>{const He=T.getState().nodeLookup.get(Ee).internals.userNode;C(_e,He)},[]):void 0,le=g??U["minimap.ariaLabel"];return M.jsx(Th,{position:_,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*k:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:Ft(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:M.jsxs("svg",{width:G,height:H,viewBox:`${Q} ${J} ${ae} ${Z}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:O,onClick:de,children:[le&&M.jsx("title",{id:X,children:le}),M.jsx(R4,{onClick:re,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:h,nodeClassName:a,nodeStrokeWidth:d,nodeComponent:l}),M.jsx("path",{className:"react-flow__minimap-mask",d:`M${Q-I},${J-I}h${ae+I*2}v${Z+I*2}h${-ae-I*2}z
|
|
18
|
-
M${A.x},${A.y}h${A.width}v${A.height}h${-A.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}L1.displayName="MiniMap";const L4=L.memo(L1),N4=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,k4={[oa.Line]:"right",[oa.Handle]:"bottom-right"};function B4({nodeId:e,position:n,variant:i=oa.Handle,className:s,style:a=void 0,children:h,color:d,minWidth:l=10,minHeight:u=10,maxWidth:c=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:_,autoScale:x=!0,shouldResize:C,onResizeStart:S,onResize:p,onResizeEnd:g}){const b=u1(),y=typeof e=="string"?e:b,E=Ct(),T=L.useRef(null),O=i===oa.Handle,D=tt(L.useCallback(N4(O&&x),[O,x]),wt),A=L.useRef(null),N=n??k4[i];L.useEffect(()=>{if(!(!T.current||!y))return A.current||(A.current=sk({domNode:T.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:P,transform:z,snapGrid:W,snapToGrid:U,nodeOrigin:G,domNode:H}=E.getState();return{nodeLookup:P,transform:z,snapGrid:W,snapToGrid:U,nodeOrigin:G,paneDomNode:H}},onChange:(P,z)=>{const{triggerNodeChanges:W,nodeLookup:U,parentLookup:G,nodeOrigin:H}=E.getState(),K=[],F={x:P.x,y:P.y},k=U.get(y);if(k&&k.expandParent&&k.parentId){const $=k.origin??H,B=P.width??k.measured.width??0,I=P.height??k.measured.height??0,Q={id:k.id,parentId:k.parentId,rect:{width:B,height:I,...kw({x:P.x??k.position.x,y:P.y??k.position.y},{width:B,height:I},k.parentId,U,$)}},J=Qp([Q],U,G,H);K.push(...J),F.x=P.x?Math.max($[0]*B,P.x):void 0,F.y=P.y?Math.max($[1]*I,P.y):void 0}if(F.x!==void 0&&F.y!==void 0){const $={id:y,type:"position",position:{...F}};K.push($)}if(P.width!==void 0&&P.height!==void 0){const B={id:y,type:"dimensions",resizing:!0,setAttributes:_?_==="horizontal"?"width":"height":!0,dimensions:{width:P.width,height:P.height}};K.push(B)}for(const $ of z){const B={...$,type:"position"};K.push(B)}W(K)},onEnd:({width:P,height:z})=>{const W={id:y,type:"dimensions",resizing:!1,dimensions:{width:P,height:z}};E.getState().triggerNodeChanges([W])}})),A.current.update({controlPosition:N,boundaries:{minWidth:l,minHeight:u,maxWidth:c,maxHeight:v},keepAspectRatio:m,resizeDirection:_,onResizeStart:S,onResize:p,onResizeEnd:g,shouldResize:C}),()=>{A.current?.destroy()}},[N,l,u,c,v,m,S,p,g,C]);const q=N.split("-");return M.jsx("div",{className:Ft(["react-flow__resize-control","nodrag",...q,i,s]),ref:T,style:{...a,scale:D,...d&&{[O?"backgroundColor":"borderColor"]:d}},children:h})}L.memo(B4);function j4(e,n){var i,s=1;e==null&&(e=0),n==null&&(n=0);function a(){var h,d=i.length,l,u=0,c=0;for(h=0;h<d;++h)l=i[h],u+=l.x,c+=l.y;for(u=(u/d-e)*s,c=(c/d-n)*s,h=0;h<d;++h)l=i[h],l.x-=u,l.y-=c}return a.initialize=function(h){i=h},a.x=function(h){return arguments.length?(e=+h,a):e},a.y=function(h){return arguments.length?(n=+h,a):n},a.strength=function(h){return arguments.length?(s=+h,a):s},a}function H4(e){const n=+this._x.call(null,e),i=+this._y.call(null,e);return N1(this.cover(n,i),n,i,e)}function N1(e,n,i,s){if(isNaN(n)||isNaN(i))return e;var a,h=e._root,d={data:s},l=e._x0,u=e._y0,c=e._x1,v=e._y1,m,_,x,C,S,p,g,b;if(!h)return e._root=d,e;for(;h.length;)if((S=n>=(m=(l+c)/2))?l=m:c=m,(p=i>=(_=(u+v)/2))?u=_:v=_,a=h,!(h=h[g=p<<1|S]))return a[g]=d,e;if(x=+e._x.call(null,h.data),C=+e._y.call(null,h.data),n===x&&i===C)return d.next=h,a?a[g]=d:e._root=d,e;do a=a?a[g]=new Array(4):e._root=new Array(4),(S=n>=(m=(l+c)/2))?l=m:c=m,(p=i>=(_=(u+v)/2))?u=_:v=_;while((g=p<<1|S)===(b=(C>=_)<<1|x>=m));return a[b]=h,a[g]=d,e}function P4(e){var n,i,s=e.length,a,h,d=new Array(s),l=new Array(s),u=1/0,c=1/0,v=-1/0,m=-1/0;for(i=0;i<s;++i)isNaN(a=+this._x.call(null,n=e[i]))||isNaN(h=+this._y.call(null,n))||(d[i]=a,l[i]=h,a<u&&(u=a),a>v&&(v=a),h<c&&(c=h),h>m&&(m=h));if(u>v||c>m)return this;for(this.cover(u,c).cover(v,m),i=0;i<s;++i)N1(this,d[i],l[i],e[i]);return this}function z4(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var i=this._x0,s=this._y0,a=this._x1,h=this._y1;if(isNaN(i))a=(i=Math.floor(e))+1,h=(s=Math.floor(n))+1;else{for(var d=a-i||1,l=this._root,u,c;i>e||e>=a||s>n||n>=h;)switch(c=(n<s)<<1|e<i,u=new Array(4),u[c]=l,l=u,d*=2,c){case 0:a=i+d,h=s+d;break;case 1:i=a-d,h=s+d;break;case 2:a=i+d,s=h-d;break;case 3:i=a-d,s=h-d;break}this._root&&this._root.length&&(this._root=l)}return this._x0=i,this._y0=s,this._x1=a,this._y1=h,this}function I4(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function U4(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function gn(e,n,i,s,a){this.node=e,this.x0=n,this.y0=i,this.x1=s,this.y1=a}function F4(e,n,i){var s,a=this._x0,h=this._y0,d,l,u,c,v=this._x1,m=this._y1,_=[],x=this._root,C,S;for(x&&_.push(new gn(x,a,h,v,m)),i==null?i=1/0:(a=e-i,h=n-i,v=e+i,m=n+i,i*=i);C=_.pop();)if(!(!(x=C.node)||(d=C.x0)>v||(l=C.y0)>m||(u=C.x1)<a||(c=C.y1)<h))if(x.length){var p=(d+u)/2,g=(l+c)/2;_.push(new gn(x[3],p,g,u,c),new gn(x[2],d,g,p,c),new gn(x[1],p,l,u,g),new gn(x[0],d,l,p,g)),(S=(n>=g)<<1|e>=p)&&(C=_[_.length-1],_[_.length-1]=_[_.length-1-S],_[_.length-1-S]=C)}else{var b=e-+this._x.call(null,x.data),y=n-+this._y.call(null,x.data),E=b*b+y*y;if(E<i){var T=Math.sqrt(i=E);a=e-T,h=n-T,v=e+T,m=n+T,s=x.data}}return s}function $4(e){if(isNaN(v=+this._x.call(null,e))||isNaN(m=+this._y.call(null,e)))return this;var n,i=this._root,s,a,h,d=this._x0,l=this._y0,u=this._x1,c=this._y1,v,m,_,x,C,S,p,g;if(!i)return this;if(i.length)for(;;){if((C=v>=(_=(d+u)/2))?d=_:u=_,(S=m>=(x=(l+c)/2))?l=x:c=x,n=i,!(i=i[p=S<<1|C]))return this;if(!i.length)break;(n[p+1&3]||n[p+2&3]||n[p+3&3])&&(s=n,g=p)}for(;i.data!==e;)if(a=i,!(i=i.next))return this;return(h=i.next)&&delete i.next,a?(h?a.next=h:delete a.next,this):n?(h?n[p]=h:delete n[p],(i=n[0]||n[1]||n[2]||n[3])&&i===(n[3]||n[2]||n[1]||n[0])&&!i.length&&(s?s[g]=i:this._root=i),this):(this._root=h,this)}function V4(e){for(var n=0,i=e.length;n<i;++n)this.remove(e[n]);return this}function q4(){return this._root}function W4(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function Y4(e){var n=[],i,s=this._root,a,h,d,l,u;for(s&&n.push(new gn(s,this._x0,this._y0,this._x1,this._y1));i=n.pop();)if(!e(s=i.node,h=i.x0,d=i.y0,l=i.x1,u=i.y1)&&s.length){var c=(h+l)/2,v=(d+u)/2;(a=s[3])&&n.push(new gn(a,c,v,l,u)),(a=s[2])&&n.push(new gn(a,h,v,c,u)),(a=s[1])&&n.push(new gn(a,c,d,l,v)),(a=s[0])&&n.push(new gn(a,h,d,c,v))}return this}function K4(e){var n=[],i=[],s;for(this._root&&n.push(new gn(this._root,this._x0,this._y0,this._x1,this._y1));s=n.pop();){var a=s.node;if(a.length){var h,d=s.x0,l=s.y0,u=s.x1,c=s.y1,v=(d+u)/2,m=(l+c)/2;(h=a[0])&&n.push(new gn(h,d,l,v,m)),(h=a[1])&&n.push(new gn(h,v,l,u,m)),(h=a[2])&&n.push(new gn(h,d,m,v,c)),(h=a[3])&&n.push(new gn(h,v,m,u,c))}i.push(s)}for(;s=i.pop();)e(s.node,s.x0,s.y0,s.x1,s.y1);return this}function G4(e){return e[0]}function X4(e){return arguments.length?(this._x=e,this):this._x}function Q4(e){return e[1]}function Z4(e){return arguments.length?(this._y=e,this):this._y}function eg(e,n,i){var s=new tg(n??G4,i??Q4,NaN,NaN,NaN,NaN);return e==null?s:s.addAll(e)}function tg(e,n,i,s,a,h){this._x=e,this._y=n,this._x0=i,this._y0=s,this._x1=a,this._y1=h,this._root=void 0}function aS(e){for(var n={data:e.data},i=n;e=e.next;)i=i.next={data:e.data};return n}var vn=eg.prototype=tg.prototype;vn.copy=function(){var e=new tg(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,i,s;if(!n)return e;if(!n.length)return e._root=aS(n),e;for(i=[{source:n,target:e._root=new Array(4)}];n=i.pop();)for(var a=0;a<4;++a)(s=n.source[a])&&(s.length?i.push({source:s,target:n.target[a]=new Array(4)}):n.target[a]=aS(s));return e};vn.add=H4;vn.addAll=P4;vn.cover=z4;vn.data=I4;vn.extent=U4;vn.find=F4;vn.remove=$4;vn.removeAll=V4;vn.root=q4;vn.size=W4;vn.visit=Y4;vn.visitAfter=K4;vn.x=X4;vn.y=Z4;function Us(e){return function(){return e}}function ls(e){return(e()-.5)*1e-6}function J4(e){return e.x+e.vx}function eB(e){return e.y+e.vy}function tB(e){var n,i,s,a=1,h=1;typeof e!="function"&&(e=Us(e==null?1:+e));function d(){for(var c,v=n.length,m,_,x,C,S,p,g=0;g<h;++g)for(m=eg(n,J4,eB).visitAfter(l),c=0;c<v;++c)_=n[c],S=i[_.index],p=S*S,x=_.x+_.vx,C=_.y+_.vy,m.visit(b);function b(y,E,T,O,D){var A=y.data,N=y.r,q=S+N;if(A){if(A.index>_.index){var P=x-A.x-A.vx,z=C-A.y-A.vy,W=P*P+z*z;W<q*q&&(P===0&&(P=ls(s),W+=P*P),z===0&&(z=ls(s),W+=z*z),W=(q-(W=Math.sqrt(W)))/W*a,_.vx+=(P*=W)*(q=(N*=N)/(p+N)),_.vy+=(z*=W)*q,A.vx-=P*(q=1-q),A.vy-=z*q)}return}return E>x+q||O<x-q||T>C+q||D<C-q}}function l(c){if(c.data)return c.r=i[c.data.index];for(var v=c.r=0;v<4;++v)c[v]&&c[v].r>c.r&&(c.r=c[v].r)}function u(){if(n){var c,v=n.length,m;for(i=new Array(v),c=0;c<v;++c)m=n[c],i[m.index]=+e(m,c,n)}}return d.initialize=function(c,v){n=c,s=v,u()},d.iterations=function(c){return arguments.length?(h=+c,d):h},d.strength=function(c){return arguments.length?(a=+c,d):a},d.radius=function(c){return arguments.length?(e=typeof c=="function"?c:Us(+c),u(),d):e},d}function nB(e){return e.index}function lS(e,n){var i=e.get(n);if(!i)throw new Error("node not found: "+n);return i}function rB(e){var n=nB,i=m,s,a=Us(30),h,d,l,u,c,v=1;e==null&&(e=[]);function m(p){return 1/Math.min(l[p.source.index],l[p.target.index])}function _(p){for(var g=0,b=e.length;g<v;++g)for(var y=0,E,T,O,D,A,N,q;y<b;++y)E=e[y],T=E.source,O=E.target,D=O.x+O.vx-T.x-T.vx||ls(c),A=O.y+O.vy-T.y-T.vy||ls(c),N=Math.sqrt(D*D+A*A),N=(N-h[y])/N*p*s[y],D*=N,A*=N,O.vx-=D*(q=u[y]),O.vy-=A*q,T.vx+=D*(q=1-q),T.vy+=A*q}function x(){if(d){var p,g=d.length,b=e.length,y=new Map(d.map((T,O)=>[n(T,O,d),T])),E;for(p=0,l=new Array(g);p<b;++p)E=e[p],E.index=p,typeof E.source!="object"&&(E.source=lS(y,E.source)),typeof E.target!="object"&&(E.target=lS(y,E.target)),l[E.source.index]=(l[E.source.index]||0)+1,l[E.target.index]=(l[E.target.index]||0)+1;for(p=0,u=new Array(b);p<b;++p)E=e[p],u[p]=l[E.source.index]/(l[E.source.index]+l[E.target.index]);s=new Array(b),C(),h=new Array(b),S()}}function C(){if(d)for(var p=0,g=e.length;p<g;++p)s[p]=+i(e[p],p,e)}function S(){if(d)for(var p=0,g=e.length;p<g;++p)h[p]=+a(e[p],p,e)}return _.initialize=function(p,g){d=p,c=g,x()},_.links=function(p){return arguments.length?(e=p,x(),_):e},_.id=function(p){return arguments.length?(n=p,_):n},_.iterations=function(p){return arguments.length?(v=+p,_):v},_.strength=function(p){return arguments.length?(i=typeof p=="function"?p:Us(+p),C(),_):i},_.distance=function(p){return arguments.length?(a=typeof p=="function"?p:Us(+p),S(),_):a},_}const iB=1664525,sB=1013904223,cS=4294967296;function oB(){let e=1;return()=>(e=(iB*e+sB)%cS)/cS}function aB(e){return e.x}function lB(e){return e.y}var cB=10,uB=Math.PI*(3-Math.sqrt(5));function hB(e){var n,i=1,s=.001,a=1-Math.pow(s,1/300),h=0,d=.6,l=new Map,u=zp(m),c=ql("tick","end"),v=oB();e==null&&(e=[]);function m(){_(),c.call("tick",n),i<s&&(u.stop(),c.call("end",n))}function _(S){var p,g=e.length,b;S===void 0&&(S=1);for(var y=0;y<S;++y)for(i+=(h-i)*a,l.forEach(function(E){E(i)}),p=0;p<g;++p)b=e[p],b.fx==null?b.x+=b.vx*=d:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=d:(b.y=b.fy,b.vy=0);return n}function x(){for(var S=0,p=e.length,g;S<p;++S){if(g=e[S],g.index=S,g.fx!=null&&(g.x=g.fx),g.fy!=null&&(g.y=g.fy),isNaN(g.x)||isNaN(g.y)){var b=cB*Math.sqrt(.5+S),y=S*uB;g.x=b*Math.cos(y),g.y=b*Math.sin(y)}(isNaN(g.vx)||isNaN(g.vy))&&(g.vx=g.vy=0)}}function C(S){return S.initialize&&S.initialize(e,v),S}return x(),n={tick:_,restart:function(){return u.restart(m),n},stop:function(){return u.stop(),n},nodes:function(S){return arguments.length?(e=S,x(),l.forEach(C),n):e},alpha:function(S){return arguments.length?(i=+S,n):i},alphaMin:function(S){return arguments.length?(s=+S,n):s},alphaDecay:function(S){return arguments.length?(a=+S,n):+a},alphaTarget:function(S){return arguments.length?(h=+S,n):h},velocityDecay:function(S){return arguments.length?(d=1-S,n):1-d},randomSource:function(S){return arguments.length?(v=S,l.forEach(C),n):v},force:function(S,p){return arguments.length>1?(p==null?l.delete(S):l.set(S,C(p)),n):l.get(S)},find:function(S,p,g){var b=0,y=e.length,E,T,O,D,A;for(g==null?g=1/0:g*=g,b=0;b<y;++b)D=e[b],E=S-D.x,T=p-D.y,O=E*E+T*T,O<g&&(A=D,g=O);return A},on:function(S,p){return arguments.length>1?(c.on(S,p),n):c.on(S)}}}function fB(){var e,n,i,s,a=Us(-30),h,d=1,l=1/0,u=.81;function c(x){var C,S=e.length,p=eg(e,aB,lB).visitAfter(m);for(s=x,C=0;C<S;++C)n=e[C],p.visit(_)}function v(){if(e){var x,C=e.length,S;for(h=new Array(C),x=0;x<C;++x)S=e[x],h[S.index]=+a(S,x,e)}}function m(x){var C=0,S,p,g=0,b,y,E;if(x.length){for(b=y=E=0;E<4;++E)(S=x[E])&&(p=Math.abs(S.value))&&(C+=S.value,g+=p,b+=p*S.x,y+=p*S.y);x.x=b/g,x.y=y/g}else{S=x,S.x=S.data.x,S.y=S.data.y;do C+=h[S.data.index];while(S=S.next)}x.value=C}function _(x,C,S,p){if(!x.value)return!0;var g=x.x-n.x,b=x.y-n.y,y=p-C,E=g*g+b*b;if(y*y/u<E)return E<l&&(g===0&&(g=ls(i),E+=g*g),b===0&&(b=ls(i),E+=b*b),E<d&&(E=Math.sqrt(d*E)),n.vx+=g*x.value*s/E,n.vy+=b*x.value*s/E),!0;if(x.length||E>=l)return;(x.data!==n||x.next)&&(g===0&&(g=ls(i),E+=g*g),b===0&&(b=ls(i),E+=b*b),E<d&&(E=Math.sqrt(d*E)));do x.data!==n&&(y=h[x.data.index]*s/E,n.vx+=g*y,n.vy+=b*y);while(x=x.next)}return c.initialize=function(x,C){e=x,i=C,v()},c.strength=function(x){return arguments.length?(a=typeof x=="function"?x:Us(+x),v(),c):a},c.distanceMin=function(x){return arguments.length?(d=x*x,c):Math.sqrt(d)},c.distanceMax=function(x){return arguments.length?(l=x*x,c):Math.sqrt(l)},c.theta=function(x){return arguments.length?(u=x*x,c):Math.sqrt(u)},c}function dB(e){const n=new Map;for(const i of e){const s=i.baseBranch??"__root__";n.has(s)||n.set(s,{id:`cluster-${s}`,baseBranch:s,branches:[],isExpanded:!1}),n.get(s)?.branches.push(i)}return Array.from(n.values()).sort((i,s)=>i.baseBranch==="__root__"?-1:s.baseBranch==="__root__"?1:s.branches.length-i.branches.length)}function mB(e,n,i,s){return new Promise(a=>{const h=hB(e).force("link",rB(n).id(d=>d.id).distance(120).strength(.8)).force("charge",fB().strength(-400)).force("center",j4(i/2,s/2)).force("collide",tB().radius(60).strength(.7));for(let d=0;d<100;d++)h.tick();h.stop(),a(e)})}async function pB(e,n,i,s){const a=dB(e);new Map(e.map(m=>[m.name,m]));const h=[],d=[],l=new Map;for(const m of a){const _=n.has(m.id);if(m.branches.length===1||_)for(const x of m.branches)l.set(x.name,x.name);else for(const x of m.branches)l.set(x.name,m.id)}for(const m of a){const _=n.has(m.id);if(m.branches.length===1||_){for(const x of m.branches)if(h.push({id:x.name,branch:x,isCluster:!1}),x.baseBranch){const C=l.get(x.baseBranch);C&&C!==x.name&&d.push({source:C,target:x.name})}}else if(h.push({id:m.id,isCluster:!0,clusterSize:m.branches.length}),m.baseBranch!=="__root__"){const x=l.get(m.baseBranch);x&&x!==m.id&&d.push({source:x,target:m.id})}}const c=(await mB(h,d,i,s)).map(m=>({id:m.id,type:m.isCluster?"cluster":"branch",position:{x:m.x??0,y:m.y??0},data:{branch:m.branch,isCluster:m.isCluster,clusterSize:m.clusterSize??0,expanded:n.has(m.id)}})),v=d.map((m,_)=>{const x=typeof m.source=="string"?m.source:m.source.id,C=typeof m.target=="string"?m.target:m.target.id;return{id:`edge-${_}`,source:x,target:C,type:"synaptic",animated:!0,data:{strength:1}}});return{nodes:c,edges:v}}function gB(e){return e.worktreePath?"hsl(var(--success))":e.type==="local"?"hsl(var(--local))":"hsl(var(--remote))"}function vB(e){if(!e.divergence)return 40;const i=e.divergence.ahead+e.divergence.behind;return Math.min(40+i*2,80)}const _B=L.memo(function({data:n,selected:i}){const{branch:s}=n;if(!s)return null;const a=vB(s);gB(s);const h=!!s.worktreePath,d=s.mergeStatus==="merged",l=L.useMemo(()=>s.name.length>18?`${s.name.slice(0,15)}...`:s.name,[s.name]),u=L.useMemo(()=>h?{primary:"hsl(160 90% 45%)",glow:"hsl(160 90% 45% / 0.4)",inner:"hsl(160 90% 50% / 0.2)"}:s.type==="local"?{primary:"hsl(280 85% 65%)",glow:"hsl(280 85% 65% / 0.4)",inner:"hsl(280 85% 70% / 0.2)"}:{primary:"hsl(200 90% 55%)",glow:"hsl(200 90% 55% / 0.4)",inner:"hsl(200 90% 60% / 0.2)"},[h,s.type]);return M.jsxs(M.Fragment,{children:[M.jsx(us,{type:"target",position:Ne.Top,className:"!h-3 !w-3 !rounded-full !border-2 !bg-transparent transition-all duration-300",style:{borderColor:u.primary,boxShadow:`0 0 8px ${u.glow}`}}),M.jsxs("div",{className:ze("group relative flex cursor-pointer items-center justify-center rounded-full","transition-all duration-500 ease-out",h&&"animate-active-synapse",!h&&"animate-soma-pulse",i&&"ring-2 ring-offset-4 ring-offset-background",d&&"opacity-50"),style:{width:a,height:a,background:`radial-gradient(circle at 30% 30%, ${u.inner}, transparent 60%)`,border:`2px solid ${u.primary}`,boxShadow:i?`0 0 30px ${u.glow}, inset 0 0 20px ${u.inner}, 0 0 0 4px ${u.primary}`:void 0},children:[M.jsx("div",{className:"absolute -inset-2 rounded-full opacity-30 blur-md",style:{backgroundColor:u.primary}}),M.jsx("div",{className:"absolute inset-2 rounded-full border opacity-40",style:{borderColor:u.primary}}),M.jsx("div",{className:"relative z-10 flex items-center justify-center rounded-full shadow-lg",style:{width:a*.45,height:a*.45,background:`linear-gradient(135deg, ${u.primary}, ${u.inner})`,boxShadow:`0 0 15px ${u.glow}`},children:M.jsx("span",{className:"text-xs font-bold text-background",children:s.type==="local"?"L":"R"})}),!d&&M.jsxs(M.Fragment,{children:[M.jsx("div",{className:"absolute h-1.5 w-1.5 rounded-full animate-vesicle-release",style:{backgroundColor:u.primary,top:"20%",right:"25%",animationDelay:"0s"}}),M.jsx("div",{className:"absolute h-1 w-1 rounded-full animate-vesicle-release",style:{backgroundColor:u.primary,bottom:"25%",left:"20%",animationDelay:"0.7s"}})]}),h&&M.jsx("div",{className:"absolute -right-1 -top-1 flex h-4 w-4 items-center justify-center rounded-full animate-synapse-spark",style:{backgroundColor:"hsl(160 90% 45%)",boxShadow:"0 0 10px hsl(160 90% 45% / 0.8)"},children:M.jsx("span",{className:"text-[8px] font-bold text-background",children:"W"})}),d&&M.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-full bg-background/60 backdrop-blur-sm",children:M.jsx("span",{className:"text-[10px] font-medium text-muted-foreground",children:"merged"})}),M.jsxs("div",{className:ze("absolute -bottom-12 left-1/2 z-50 -translate-x-1/2","rounded-lg border border-border/50 bg-card/95 px-3 py-1.5 backdrop-blur-md","opacity-0 shadow-xl transition-all duration-300","group-hover:opacity-100 group-hover:-translate-y-1"),style:{boxShadow:`0 4px 20px hsl(220 30% 0% / 0.5), 0 0 20px ${u.glow}`},children:[M.jsx("p",{className:"whitespace-nowrap text-xs font-medium text-foreground",children:l}),M.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[s.type==="local"?"Local":"Remote",h&&" • Active"]})]})]}),M.jsx(us,{type:"source",position:Ne.Bottom,className:"!h-3 !w-3 !rounded-full !border-2 !bg-transparent transition-all duration-300",style:{borderColor:u.primary,boxShadow:`0 0 8px ${u.glow}`}})]})}),yB=L.memo(function({data:n,selected:i}){const{clusterSize:s=0,expanded:a}=n,d=Math.min(70+s*5,120),l=Math.min(s,8),u=L.useMemo(()=>Array.from({length:l}).map((c,v)=>{const m=360/l*v,_=v*.5,x=d*.28;return{angle:m,delay:_,orbitRadius:x}}),[l,d]);return M.jsxs(M.Fragment,{children:[M.jsx(us,{type:"target",position:Ne.Top,className:"!h-3 !w-3 !rounded-full !border-2 !bg-transparent transition-all duration-300",style:{borderColor:"hsl(185 100% 65%)",boxShadow:"0 0 8px hsl(185 100% 65% / 0.4)"}}),M.jsxs("div",{className:ze("group relative flex cursor-pointer items-center justify-center","transition-all duration-500 ease-out","animate-membrane-morph",i&&"ring-2 ring-primary ring-offset-4 ring-offset-background"),style:{width:d,height:d,background:a?"radial-gradient(circle at 40% 40%, hsl(185 100% 65% / 0.15), hsl(310 85% 60% / 0.08) 50%, transparent 70%)":"radial-gradient(circle at 40% 40%, hsl(220 30% 15% / 0.8), hsl(220 25% 10% / 0.6) 60%, transparent 80%)",border:a?"2px solid hsl(185 100% 65% / 0.6)":"2px dashed hsl(200 30% 30%)",boxShadow:a?"0 0 30px hsl(185 100% 65% / 0.3), inset 0 0 30px hsl(185 100% 65% / 0.1)":"0 0 20px hsl(220 30% 0% / 0.5), inset 0 0 20px hsl(220 30% 5% / 0.5)"},children:[M.jsx("div",{className:ze("absolute -inset-3 rounded-full blur-lg transition-opacity duration-500",a?"opacity-40":"opacity-20"),style:{backgroundColor:a?"hsl(185 100% 65%)":"hsl(200 30% 40%)",borderRadius:"inherit"}}),M.jsx("div",{className:"absolute inset-3 rounded-full border border-dashed opacity-30",style:{borderColor:a?"hsl(185 100% 65%)":"hsl(200 30% 40%)",borderRadius:"inherit"}}),M.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:u.map((c,v)=>M.jsx("div",{className:"absolute animate-nucleus-orbit",style:{animationDelay:`${-c.delay}s`,animationDuration:`${8+v*.5}s`},children:M.jsx("div",{className:"h-2.5 w-2.5 rounded-full animate-vesicle-release",style:{backgroundColor:a?`hsl(${185+v*15} 80% 60%)`:`hsl(${200+v*10} 50% 50%)`,boxShadow:a?`0 0 8px hsl(${185+v*15} 80% 60% / 0.8)`:`0 0 4px hsl(${200+v*10} 50% 50% / 0.5)`,animationDelay:`${c.delay*.3}s`,transform:`translateX(${c.orbitRadius}px)`}})},v))}),M.jsx("div",{className:ze("relative z-10 flex items-center justify-center rounded-full","border-2 backdrop-blur-sm transition-all duration-300"),style:{width:d*.4,height:d*.4,backgroundColor:a?"hsl(220 30% 8% / 0.9)":"hsl(220 30% 10% / 0.95)",borderColor:a?"hsl(185 100% 65% / 0.8)":"hsl(200 30% 35%)",boxShadow:a?"0 0 20px hsl(185 100% 65% / 0.4), inset 0 0 15px hsl(185 100% 65% / 0.1)":"0 0 10px hsl(220 30% 0% / 0.5)"},children:M.jsx("span",{className:ze("text-sm font-bold transition-colors duration-300",a?"text-primary":"text-muted-foreground"),children:s})}),M.jsx("div",{className:ze("absolute -right-2 -top-2 flex h-6 w-6 items-center justify-center rounded-full","border-2 text-xs font-bold transition-all duration-300"),style:{backgroundColor:a?"hsl(185 100% 65%)":"hsl(220 30% 12%)",borderColor:a?"hsl(185 100% 70%)":"hsl(200 30% 25%)",color:a?"hsl(220 30% 5%)":"hsl(185 100% 65%)",boxShadow:a?"0 0 15px hsl(185 100% 65% / 0.6)":"0 0 8px hsl(220 30% 0% / 0.5)"},children:a?"−":"+"}),M.jsxs("div",{className:ze("absolute -bottom-14 left-1/2 z-50 -translate-x-1/2","rounded-lg border border-border/50 bg-card/95 px-3 py-2 backdrop-blur-md","opacity-0 shadow-xl transition-all duration-300","group-hover:opacity-100 group-hover:-translate-y-1"),style:{boxShadow:"0 4px 20px hsl(220 30% 0% / 0.5), 0 0 20px hsl(185 100% 65% / 0.2)"},children:[M.jsxs("p",{className:"whitespace-nowrap text-xs font-medium text-foreground",children:[s," branches"]}),M.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Click to ",a?"collapse":"expand"]})]})]}),M.jsx(us,{type:"source",position:Ne.Bottom,className:"!h-3 !w-3 !rounded-full !border-2 !bg-transparent transition-all duration-300",style:{borderColor:a?"hsl(185 100% 65%)":"hsl(200 30% 40%)",boxShadow:a?"0 0 8px hsl(185 100% 65% / 0.4)":"0 0 6px hsl(200 30% 40% / 0.3)"}})]})}),bB=L.memo(function({id:n,sourceX:i,sourceY:s,targetX:a,targetY:h,sourcePosition:d,targetPosition:l,style:u={},markerEnd:c}){const[v,m,_]=Wp({sourceX:i,sourceY:s,sourcePosition:d,targetX:a,targetY:h,targetPosition:l,curvature:.25}),x=L.useMemo(()=>{const S=a-i,p=h-s;return Math.sqrt(S*S+p*p)},[i,s,a,h]),C=Math.max(2,Math.min(4,Math.floor(x/100)));return M.jsxs(M.Fragment,{children:[M.jsx(as,{id:`${n}-outer-glow`,path:v,style:{...u,strokeWidth:12,stroke:"hsl(185 100% 65% / 0.08)",filter:"blur(8px)"}}),M.jsx(as,{id:`${n}-mid-glow`,path:v,style:{...u,strokeWidth:6,stroke:"hsl(185 100% 65% / 0.15)",filter:"blur(4px)"}}),M.jsx(as,{id:n,path:v,...c?{markerEnd:c}:{},style:{...u,strokeWidth:2,stroke:"hsl(185 100% 65% / 0.5)",strokeLinecap:"round"}}),M.jsx(as,{id:`${n}-core`,path:v,style:{...u,strokeWidth:1,stroke:"hsl(185 100% 75% / 0.6)",strokeLinecap:"round"}}),M.jsx(vm,{children:M.jsxs("svg",{style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},children:[M.jsxs("defs",{children:[M.jsxs("linearGradient",{id:`vesicle-pulse-${n}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[M.jsx("stop",{offset:"0%",stopColor:"transparent",children:M.jsx("animate",{attributeName:"offset",values:"-0.3;1",dur:"2.5s",repeatCount:"indefinite"})}),M.jsx("stop",{offset:"5%",stopColor:"hsl(185 100% 70% / 0.3)",children:M.jsx("animate",{attributeName:"offset",values:"-0.25;1.05",dur:"2.5s",repeatCount:"indefinite"})}),M.jsx("stop",{offset:"10%",stopColor:"hsl(185 100% 80%)",children:M.jsx("animate",{attributeName:"offset",values:"-0.2;1.1",dur:"2.5s",repeatCount:"indefinite"})}),M.jsx("stop",{offset:"15%",stopColor:"hsl(185 100% 70% / 0.3)",children:M.jsx("animate",{attributeName:"offset",values:"-0.15;1.15",dur:"2.5s",repeatCount:"indefinite"})}),M.jsx("stop",{offset:"20%",stopColor:"transparent",children:M.jsx("animate",{attributeName:"offset",values:"-0.1;1.2",dur:"2.5s",repeatCount:"indefinite"})})]}),M.jsxs("linearGradient",{id:`synapse-pulse-${n}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[M.jsx("stop",{offset:"0%",stopColor:"transparent",children:M.jsx("animate",{attributeName:"offset",values:"-0.4;1",dur:"3s",begin:"0.8s",repeatCount:"indefinite"})}),M.jsx("stop",{offset:"8%",stopColor:"hsl(310 85% 65% / 0.6)",children:M.jsx("animate",{attributeName:"offset",values:"-0.32;1.08",dur:"3s",begin:"0.8s",repeatCount:"indefinite"})}),M.jsx("stop",{offset:"16%",stopColor:"transparent",children:M.jsx("animate",{attributeName:"offset",values:"-0.24;1.16",dur:"3s",begin:"0.8s",repeatCount:"indefinite"})})]}),M.jsxs("filter",{id:`glow-${n}`,x:"-50%",y:"-50%",width:"200%",height:"200%",children:[M.jsx("feGaussianBlur",{stdDeviation:"2",result:"coloredBlur"}),M.jsxs("feMerge",{children:[M.jsx("feMergeNode",{in:"coloredBlur"}),M.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),M.jsx("path",{d:v,fill:"none",stroke:`url(#vesicle-pulse-${n})`,strokeWidth:4,strokeLinecap:"round",filter:`url(#glow-${n})`,style:{mixBlendMode:"screen"}}),M.jsx("path",{d:v,fill:"none",stroke:`url(#synapse-pulse-${n})`,strokeWidth:3,strokeLinecap:"round",style:{mixBlendMode:"screen"}})]})}),M.jsx(vm,{children:M.jsx("svg",{style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},children:Array.from({length:C}).map((S,p)=>M.jsxs("circle",{r:3-p*.3,fill:"hsl(185 100% 80%)",opacity:0,children:[M.jsx("animateMotion",{dur:`${2+p*.3}s`,repeatCount:"indefinite",path:v,begin:`${p*.6}s`}),M.jsx("animate",{attributeName:"opacity",values:"0;1;1;0",keyTimes:"0;0.1;0.9;1",dur:`${2+p*.3}s`,repeatCount:"indefinite",begin:`${p*.6}s`})]},p))})}),M.jsx(vm,{children:M.jsxs("div",{className:"absolute",style:{transform:`translate(-50%, -50%) translate(${m}px, ${_}px)`},children:[M.jsx("div",{className:"absolute -inset-3 rounded-full opacity-30",style:{background:"radial-gradient(circle, hsl(185 100% 65%) 0%, transparent 70%)",animation:"synapse-spark 3s ease-in-out infinite"}}),M.jsx("div",{className:"h-2 w-2 rounded-full",style:{background:"radial-gradient(circle at 30% 30%, hsl(185 100% 80%), hsl(185 100% 60%))",boxShadow:"0 0 10px hsl(185 100% 65% / 0.8), 0 0 20px hsl(185 100% 65% / 0.4)",animation:"vesicle-release 2s ease-in-out infinite"}})]})})]})}),SB={branch:_B,cluster:yB},xB={synaptic:bB};function wB({branches:e,onNodeClick:n,className:i}){const[s,a,h]=o4([]),[d,l,u]=a4([]),[c,v]=L.useState(new Set),[m,_]=L.useState(!1);L.useEffect(()=>{if(e.length===0)return;_(!0),pB(e,c,800,600).then(({nodes:g,edges:b})=>{a(g),l(b)}).catch(g=>{console.error("Failed to calculate graph layout:",g)}).finally(()=>{_(!1)})},[e,c,a,l]);const x=L.useCallback((S,p)=>{p.data.isCluster?v(g=>{const b=new Set(g);return b.has(p.id)?b.delete(p.id):b.add(p.id),b}):n?.(p.data.branch??null)},[n]),C=L.useCallback(S=>S.data.isCluster?"hsl(var(--muted-foreground))":S.data.branch?.worktreePath?"hsl(var(--success))":S.data.branch?.type==="local"?"hsl(var(--local))":"hsl(var(--remote))",[]);return M.jsxs("div",{className:i,style:{width:"100%",height:"100%"},children:[M.jsxs(i4,{nodes:s,edges:d,onNodesChange:h,onEdgesChange:u,onNodeClick:x,nodeTypes:SB,edgeTypes:xB,fitView:!0,fitViewOptions:{padding:.2,maxZoom:1.5},minZoom:.1,maxZoom:2,attributionPosition:"bottom-left",proOptions:{hideAttribution:!0},className:"bg-gradient-to-br from-background via-background to-muted/20",children:[M.jsx(f4,{variant:xi.Dots,gap:20,size:1,color:"hsl(var(--muted-foreground) / 0.15)"}),M.jsx(y4,{showInteractive:!1,className:"!bg-card !border !border-border !shadow-md"}),M.jsx(L4,{nodeColor:C,maskColor:"hsl(var(--background) / 0.8)",className:"!bg-card !border !border-border !shadow-md"})]}),m&&M.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 backdrop-blur-sm",children:M.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-card px-4 py-2 shadow-lg",children:[M.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"}),M.jsx("span",{className:"text-sm text-muted-foreground",children:"Calculating layout..."})]})})]})}const CB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),EB=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,s)=>s?s.toUpperCase():i.toLowerCase()),uS=e=>{const n=EB(e);return n.charAt(0).toUpperCase()+n.slice(1)},k1=(...e)=>e.filter((n,i,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===i).join(" ").trim(),RB=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var AB={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"};const DB=L.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:s,className:a="",children:h,iconNode:d,...l},u)=>L.createElement("svg",{ref:u,...AB,width:n,height:n,stroke:e,strokeWidth:s?Number(i)*24/Number(n):i,className:k1("lucide",a),...!h&&!RB(l)&&{"aria-hidden":"true"},...l},[...d.map(([c,v])=>L.createElement(c,v)),...Array.isArray(h)?h:[h]]));const Zl=(e,n)=>{const i=L.forwardRef(({className:s,...a},h)=>L.createElement(DB,{ref:h,iconNode:n,className:k1(`lucide-${CB(uS(e))}`,`lucide-${e}`,s),...a}));return i.displayName=uS(e),i};const TB=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],MB=Zl("check",TB);const OB=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],B1=Zl("chevron-down",OB);const LB=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],NB=Zl("chevron-up",LB);const kB=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],BB=Zl("search",kB);const jB=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],HB=Zl("x",jB);function hS(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Jl(...e){return n=>{let i=!1;const s=e.map(a=>{const h=hS(a,n);return!i&&typeof h=="function"&&(i=!0),h});if(i)return()=>{for(let a=0;a<s.length;a++){const h=s[a];typeof h=="function"?h():hS(e[a],null)}}}}function an(...e){return L.useCallback(Jl(...e),e)}var PB=Symbol.for("react.lazy"),ah=gh[" use ".trim().toString()];function zB(e){return typeof e=="object"&&e!==null&&"then"in e}function j1(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===PB&&"_payload"in e&&zB(e._payload)}function IB(e){const n=FB(e),i=L.forwardRef((s,a)=>{let{children:h,...d}=s;j1(h)&&typeof ah=="function"&&(h=ah(h._payload));const l=L.Children.toArray(h),u=l.find(VB);if(u){const c=u.props.children,v=l.map(m=>m===u?L.Children.count(c)>1?L.Children.only(null):L.isValidElement(c)?c.props.children:null:m);return M.jsx(n,{...d,ref:a,children:L.isValidElement(c)?L.cloneElement(c,void 0,v):null})}return M.jsx(n,{...d,ref:a,children:h})});return i.displayName=`${e}.Slot`,i}var UB=IB("Slot");function FB(e){const n=L.forwardRef((i,s)=>{let{children:a,...h}=i;if(j1(a)&&typeof ah=="function"&&(a=ah(a._payload)),L.isValidElement(a)){const d=WB(a),l=qB(h,a.props);return a.type!==L.Fragment&&(l.ref=s?Jl(s,d):d),L.cloneElement(a,l)}return L.Children.count(a)>1?L.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var $B=Symbol("radix.slottable");function VB(e){return L.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$B}function qB(e,n){const i={...n};for(const s in n){const a=e[s],h=n[s];/^on[A-Z]/.test(s)?a&&h?i[s]=(...l)=>{const u=h(...l);return a(...l),u}:a&&(i[s]=a):s==="style"?i[s]={...a,...h}:s==="className"&&(i[s]=[a,h].filter(Boolean).join(" "))}return{...e,...i}}function WB(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}const YB=Np("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ut=L.forwardRef(({className:e,variant:n,size:i,asChild:s=!1,...a},h)=>{const d=s?UB:"button";return M.jsx(d,{className:ze(YB({variant:n,size:i,className:e})),ref:h,...a})});Ut.displayName="Button";function KB({branch:e,onClose:n,className:i}){if(!e)return null;const s=!!e.worktreePath;return M.jsx("div",{className:ze("absolute right-0 top-0 h-full w-80 border-l bg-card/95 backdrop-blur-sm","animate-in slide-in-from-right duration-300",i),children:M.jsxs(Kt,{className:"h-full rounded-none border-0",children:[M.jsxs(An,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[M.jsxs("div",{className:"flex items-center gap-2",children:[M.jsx(pt,{variant:e.type==="local"?"local":"remote",children:e.type==="local"?"Local":"Remote"}),s&&M.jsx(pt,{variant:"success",children:"Worktree"})]}),M.jsx(Ut,{variant:"ghost",size:"icon",onClick:n,className:"h-8 w-8",children:M.jsx(HB,{className:"h-4 w-4"})})]}),M.jsxs(en,{className:"space-y-4",children:[M.jsxs("div",{children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Branch Name"}),M.jsx("p",{className:"mt-1 break-all font-mono text-sm",children:e.name})]}),M.jsxs("div",{children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Base Branch"}),M.jsx("p",{className:"mt-1 font-mono text-sm",children:e.baseBranch??"Unknown"})]}),M.jsxs("div",{children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Last Commit"}),M.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:e.commitMessage??"No commit message"})]}),e.divergence&&M.jsxs("div",{children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Divergence"}),M.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[M.jsxs(pt,{variant:"outline",className:"text-xs",children:["↑ ",e.divergence.ahead," ahead"]}),M.jsxs(pt,{variant:"outline",className:"text-xs",children:["↓ ",e.divergence.behind," behind"]}),M.jsx(pt,{variant:e.divergence.upToDate?"success":"warning",className:"text-xs",children:e.divergence.upToDate?"Up to date":"Needs sync"})]})]}),s&&M.jsxs("div",{children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Worktree Path"}),M.jsx("p",{className:"mt-1 break-all font-mono text-xs text-muted-foreground",children:e.worktreePath})]}),e.mergeStatus&&M.jsxs("div",{children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Merge Status"}),M.jsx(pt,{variant:e.mergeStatus==="merged"?"success":"outline",className:"mt-1",children:e.mergeStatus})]})]}),M.jsx(Lp,{className:"flex flex-col gap-2",children:M.jsx(Ut,{asChild:!0,className:"w-full",children:M.jsx(_r,{to:`/${encodeURIComponent(e.name)}`,children:"View Details"})})})]})})}function GB({branches:e}){const[n,i]=L.useState(null),s=L.useCallback(h=>{i(h)},[]),a=L.useCallback(()=>{i(null)},[]);return e.length?M.jsxs(Kt,{className:"relative overflow-hidden",children:[M.jsx(An,{className:"pb-4",children:M.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[M.jsxs("div",{children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"SYNAPTIC GRAPH"}),M.jsx("h2",{className:"mt-1 text-lg font-semibold",children:"ブランチネットワーク"}),M.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"クリックでノードを展開・詳細表示。ドラッグで移動、スクロールでズーム。"})]}),M.jsxs("div",{className:"flex flex-wrap gap-2",children:[M.jsxs(pt,{variant:"outline",className:"flex items-center gap-1",children:[M.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/30"}),"Cluster"]}),M.jsxs(pt,{variant:"local",className:"flex items-center gap-1",children:[M.jsx("span",{className:"h-2 w-2 rounded-full bg-local"}),"Local"]}),M.jsxs(pt,{variant:"remote",className:"flex items-center gap-1",children:[M.jsx("span",{className:"h-2 w-2 rounded-full bg-remote"}),"Remote"]}),M.jsxs(pt,{variant:"success",className:"flex items-center gap-1",children:[M.jsx("span",{className:"h-2 w-2 rounded-full bg-success"}),"Worktree"]})]})]})}),M.jsx(en,{className:"relative p-0",children:M.jsxs("div",{className:"relative h-[500px] w-full",children:[M.jsx(wB,{branches:e,onNodeClick:s,className:"h-full w-full"}),M.jsx(KB,{branch:n,onClose:a})]})})]}):M.jsx(Kt,{className:"border-dashed",children:M.jsxs(en,{className:"flex flex-col items-center justify-center py-12 text-center",children:[M.jsx("p",{className:"text-muted-foreground",children:"グラフ表示できるブランチがありません。"}),M.jsx("p",{className:"text-sm text-muted-foreground",children:"fetch済みのブランチやWorktreeを追加すると関係図が表示されます。"})]})})}function Sr({eyebrow:e,title:n,subtitle:i,actions:s,children:a,className:h}){return M.jsx("header",{className:ze("border-b border-border bg-card/50 px-6 py-8",h),children:M.jsxs("div",{className:"mx-auto max-w-7xl",children:[e&&M.jsx("p",{className:"mb-2 text-xs font-medium uppercase tracking-widest text-muted-foreground",children:e}),M.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[M.jsxs("div",{children:[M.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:n}),i&&M.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i}),a]}),s&&M.jsx("div",{className:"flex gap-2",children:s})]})]})})}function Au({label:e,value:n,hint:i,className:s}){return M.jsxs(Kt,{className:ze("p-5",s),children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:e}),M.jsx("p",{className:"mt-1 text-3xl font-semibold tabular-nums",children:n}),i&&M.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i})]})}const kl=L.forwardRef(({className:e,type:n,...i},s)=>M.jsx("input",{type:n,className:ze("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:s,...i}));kl.displayName="Input";function XB({value:e,onChange:n,placeholder:i="Search...",className:s,count:a}){return M.jsxs("div",{className:ze("flex items-center gap-3",s),children:[M.jsxs("div",{className:"relative flex-1",children:[M.jsx(BB,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),M.jsx(kl,{type:"text",value:e,onChange:h=>n(h.target.value),placeholder:i,className:"pl-9"})]}),a&&M.jsxs("span",{className:"text-sm text-muted-foreground",children:[a.filtered," / ",a.total]})]})}const QB=Np("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",success:"border-green-500/50 bg-green-500/10 text-green-400 [&>svg]:text-green-400",warning:"border-yellow-500/50 bg-yellow-500/10 text-yellow-400 [&>svg]:text-yellow-400",info:"border-blue-500/50 bg-blue-500/10 text-blue-400 [&>svg]:text-blue-400"}},defaultVariants:{variant:"default"}}),wi=L.forwardRef(({className:e,variant:n,...i},s)=>M.jsx("div",{ref:s,role:"alert",className:ze(QB({variant:n}),e),...i}));wi.displayName="Alert";const ZB=L.forwardRef(({className:e,...n},i)=>M.jsx("h5",{ref:i,className:ze("mb-1 font-medium leading-none tracking-tight",e),...n}));ZB.displayName="AlertTitle";const Ci=L.forwardRef(({className:e,...n},i)=>M.jsx("div",{ref:i,className:ze("text-sm [&_p]:leading-relaxed",e),...n}));Ci.displayName="AlertDescription";const Du=new Intl.NumberFormat("ja-JP");function JB(){const{data:e,isLoading:n,error:i}=kT(),[s,a]=L.useState(""),h=e??[],d=L.useMemo(()=>{const c=h.filter(_=>!!_.worktreePath).length,v=h.filter(_=>_.type==="remote").length,m=h.filter(_=>_.divergence?.upToDate).length;return{total:h.length,worktrees:c,remote:v,healthy:m}},[h]),l=s.trim().toLowerCase(),u=L.useMemo(()=>l?h.filter(c=>[c.name,c.type,c.mergeStatus,c.commitMessage??"",c.worktreePath??""].join(" ").toLowerCase().includes(l)):h,[h,l]);return n?M.jsxs("div",{className:"min-h-screen bg-background",children:[M.jsx(Sr,{eyebrow:"WORKTREE DASHBOARD",title:"gwt Control Center",subtitle:"Loading branch data..."}),M.jsx("main",{className:"mx-auto max-w-7xl px-6 py-8",children:M.jsx("div",{className:"flex items-center justify-center py-20",children:M.jsxs("div",{className:"text-center",children:[M.jsx("div",{className:"mb-4 text-4xl",children:"⏳"}),M.jsx("p",{className:"text-muted-foreground",children:"Loading branches..."})]})})})]}):i?M.jsxs("div",{className:"min-h-screen bg-background",children:[M.jsx(Sr,{eyebrow:"WORKTREE DASHBOARD",title:"gwt Control Center"}),M.jsx("main",{className:"mx-auto max-w-7xl px-6 py-8",children:M.jsx(wi,{variant:"destructive",children:M.jsx(Ci,{children:i instanceof Error?i.message:"Failed to load branches"})})})]}):h.length?M.jsxs("div",{className:"min-h-screen bg-background",children:[M.jsx(Sr,{eyebrow:"WORKTREE DASHBOARD",title:"gwt Control Center",subtitle:"Manage Git branches and AI tools from your browser"}),M.jsxs("main",{className:"mx-auto max-w-7xl space-y-6 px-6 py-8",children:[u.length>0&&M.jsx(GB,{branches:u}),M.jsxs("section",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[M.jsx(Au,{label:"Total Branches",value:Du.format(d.total),hint:"Local + Remote"}),M.jsx(Au,{label:"Active Worktrees",value:Du.format(d.worktrees),hint:"Ready for AI tools"}),M.jsx(Au,{label:"Remote Tracking",value:Du.format(d.remote),hint:"Synced with origin"}),M.jsx(Au,{label:"Up to Date",value:Du.format(d.healthy),hint:"No divergence"})]}),M.jsx(XB,{value:s,onChange:a,placeholder:"Search branches by name, type, or commit...",count:{filtered:u.length,total:d.total}}),u.length===0?M.jsx(Kt,{className:"border-dashed",children:M.jsxs(en,{className:"flex flex-col items-center justify-center py-12",children:[M.jsx("h3",{className:"mb-2 text-lg font-semibold",children:"No matching branches"}),M.jsx("p",{className:"text-sm text-muted-foreground",children:"Try a different search term or clear the filter."})]})}):M.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:u.map(c=>M.jsx(e6,{branch:c},c.name))})]})]}):M.jsxs("div",{className:"min-h-screen bg-background",children:[M.jsx(Sr,{eyebrow:"WORKTREE DASHBOARD",title:"gwt Control Center"}),M.jsx("main",{className:"mx-auto max-w-7xl px-6 py-8",children:M.jsx(Kt,{className:"border-dashed",children:M.jsxs(en,{className:"flex flex-col items-center justify-center py-12",children:[M.jsx("div",{className:"mb-4 text-4xl",children:"📭"}),M.jsx("h3",{className:"mb-2 text-lg font-semibold",children:"No branches found"}),M.jsxs("p",{className:"text-sm text-muted-foreground",children:["Try running"," ",M.jsx("code",{className:"rounded bg-muted px-1",children:"git fetch origin"})," ","to sync branches."]})]})})})]})}function e6({branch:e}){return M.jsxs(Kt,{className:"flex flex-col transition-colors hover:border-muted-foreground/50",children:[M.jsx(An,{className:"pb-3",children:M.jsxs("div",{className:"flex items-start justify-between gap-2",children:[M.jsxs("div",{className:"min-w-0 flex-1",children:[M.jsxs("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[e.type==="local"?"Local":"Remote"," Branch"]}),M.jsx("h3",{className:"mt-1 truncate font-semibold",title:e.name,children:e.name})]}),M.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[M.jsx(pt,{variant:e.type==="local"?"local":"remote",children:e.type==="local"?"L":"R"}),e.worktreePath&&M.jsx(pt,{variant:"success",children:"WT"})]})]})}),M.jsxs(en,{className:"flex-1 pb-3",children:[M.jsx("p",{className:"line-clamp-2 text-sm text-muted-foreground",children:e.commitMessage??"No commit message"}),e.divergence&&M.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[e.divergence.ahead>0&&M.jsxs(pt,{variant:"outline",className:"text-xs",children:["↑ ",e.divergence.ahead]}),e.divergence.behind>0&&M.jsxs(pt,{variant:"outline",className:"text-xs",children:["↓ ",e.divergence.behind]}),M.jsx(pt,{variant:e.divergence.upToDate?"success":"warning",className:"text-xs",children:e.divergence.upToDate?"Up to date":"Needs sync"})]})]}),M.jsx(Lp,{className:"pt-0",children:M.jsx(Ut,{variant:"ghost",size:"sm",asChild:!0,className:"w-full",children:M.jsx(_r,{to:`/${encodeURIComponent(e.name)}`,children:"View Details →"})})})]})}function t6(){const e=Zs();return zl({mutationFn:n=>NT.create(n),onSuccess:()=>{e.invalidateQueries({queryKey:["worktrees"]}),e.invalidateQueries({queryKey:["branches"]})}})}function n6(){return vh({queryKey:["sessions"],queryFn:Mp.list})}function r6(){const e=Zs();return zl({mutationFn:n=>Mp.start(n),onSuccess:n=>{e.setQueryData(["sessions"],i=>{const s=i?.filter(a=>a.sessionId!==n.sessionId)??[];return[n,...s]}),e.invalidateQueries({queryKey:["sessions"]})}})}function i6(){const e=Zs();return zl({mutationFn:n=>Mp.delete(n),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function H1(){return vh({queryKey:["config"],queryFn:kx.get})}function s6(){const e=Zs();return zl({mutationFn:kx.update,onSuccess:n=>{e.setQueryData(["config"],n)}})}const ng=L.forwardRef(({className:e,...n},i)=>M.jsx("div",{className:"relative w-full overflow-auto",children:M.jsx("table",{ref:i,className:ze("w-full caption-bottom text-sm",e),...n})}));ng.displayName="Table";const rg=L.forwardRef(({className:e,...n},i)=>M.jsx("thead",{ref:i,className:ze("[&_tr]:border-b",e),...n}));rg.displayName="TableHeader";const ig=L.forwardRef(({className:e,...n},i)=>M.jsx("tbody",{ref:i,className:ze("[&_tr:last-child]:border-0",e),...n}));ig.displayName="TableBody";const o6=L.forwardRef(({className:e,...n},i)=>M.jsx("tfoot",{ref:i,className:ze("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...n}));o6.displayName="TableFooter";const Bl=L.forwardRef(({className:e,...n},i)=>M.jsx("tr",{ref:i,className:ze("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n}));Bl.displayName="TableRow";const Br=L.forwardRef(({className:e,...n},i)=>M.jsx("th",{ref:i,className:ze("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n}));Br.displayName="TableHead";const jr=L.forwardRef(({className:e,...n},i)=>M.jsx("td",{ref:i,className:ze("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n}));jr.displayName="TableCell";const a6=L.forwardRef(({className:e,...n},i)=>M.jsx("caption",{ref:i,className:ze("mt-4 text-sm text-muted-foreground",e),...n}));a6.displayName="TableCaption";const tr={CLAUDE_CODE:"claude-code",CODEX_CLI:"codex-cli",GEMINI_CLI:"gemini-cli",OPENCODE:"opencode"},P1={[tr.CLAUDE_CODE]:{hex:"#f6e05e",tailwind:"text-yellow-400",bgTailwind:"bg-yellow-400/20",borderTailwind:"border-yellow-400"},[tr.CODEX_CLI]:{hex:"#4fd1c5",tailwind:"text-cyan-400",bgTailwind:"bg-cyan-400/20",borderTailwind:"border-cyan-400"},[tr.GEMINI_CLI]:{hex:"#d53f8c",tailwind:"text-pink-500",bgTailwind:"bg-pink-500/20",borderTailwind:"border-pink-500"},[tr.OPENCODE]:{hex:"#48bb78",tailwind:"text-green-400",bgTailwind:"bg-green-400/20",borderTailwind:"border-green-400"}},lh={tailwind:"text-gray-400",bgTailwind:"bg-gray-400/20"};function sg(e){return e?P1[e]?.tailwind??lh.tailwind:lh.tailwind}function l6(e){return e?P1[e]?.bgTailwind??lh.bgTailwind:lh.bgTailwind}function c6(e){if(!e)return null;const n=e.toLowerCase().trim();return n==="claude-code"||n==="claude"?tr.CLAUDE_CODE:n==="codex-cli"||n==="codex"?tr.CODEX_CLI:n==="gemini-cli"||n==="gemini"?tr.GEMINI_CLI:n==="opencode"||n==="open-code"?tr.OPENCODE:n.includes("claude")?tr.CLAUDE_CODE:n.includes("codex")?tr.CODEX_CLI:n.includes("gemini")?tr.GEMINI_CLI:n.includes("opencode")?tr.OPENCODE:e}const u6={pending:"outline",running:"success",completed:"default",failed:"destructive"},h6={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed"};function fS(e){if(!e)return"--";try{return new Intl.DateTimeFormat("ja-JP",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return e}}function f6(e,n){return e==="custom"?n??"Custom":e==="codex-cli"?"Codex CLI":"Claude Code"}function d6({sessions:e,isLoading:n,terminatingSessionId:i,isDeleting:s,onTerminate:a,onSelectSession:h}){return M.jsxs(Kt,{children:[M.jsxs(An,{className:"pb-3",children:[M.jsxs("div",{className:"flex items-center justify-between",children:[M.jsxs("div",{children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Session History"}),M.jsx("h3",{className:"mt-1 text-lg font-semibold",children:"セッション履歴"})]}),n&&M.jsx(pt,{variant:"outline",className:"animate-pulse",children:"読み込み中..."})]}),M.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"この Worktree に紐づいた Coding Agent セッション履歴です。CLI からの起動分も共有されます。"})]}),M.jsx(en,{children:e.length===0?M.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"セッション履歴はまだありません。"}):M.jsx("div",{className:"overflow-x-auto rounded-md border",children:M.jsxs(ng,{children:[M.jsx(rg,{children:M.jsxs(Bl,{children:[M.jsx(Br,{className:"w-24",children:"状態"}),M.jsx(Br,{children:"ツール"}),M.jsx(Br,{className:"w-20",children:"モード"}),M.jsx(Br,{children:"開始"}),M.jsx(Br,{children:"終了"}),M.jsx(Br,{className:"w-24 text-right",children:"操作"})]})}),M.jsx(ig,{children:e.slice(0,5).map(d=>M.jsxs(Bl,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>{d.status==="running"&&h(d.sessionId)},children:[M.jsx(jr,{children:M.jsx(pt,{variant:u6[d.status],children:h6[d.status]})}),M.jsx(jr,{className:`font-medium ${sg(c6(d.agentType))}`,children:f6(d.agentType,d.agentName)}),M.jsx(jr,{children:M.jsx("span",{className:"text-muted-foreground",children:d.mode})}),M.jsx(jr,{className:"text-muted-foreground",children:fS(d.startedAt)}),M.jsx(jr,{className:"text-muted-foreground",children:fS(d.endedAt)}),M.jsx(jr,{className:"text-right",children:d.status==="running"?M.jsx(Ut,{variant:"ghost",size:"sm",onClick:l=>{l.stopPropagation(),a(d.sessionId)},disabled:i===d.sessionId||s,children:i===d.sessionId?"終了中...":"終了"}):M.jsx("span",{className:"text-sm text-muted-foreground",children:"--"})})]},d.sessionId))})]})})})]})}function dS(e,[n,i]){return Math.min(i,Math.max(n,e))}function It(e,n,{checkForDefaultPrevented:i=!0}={}){return function(a){if(e?.(a),i===!1||!a.defaultPrevented)return n?.(a)}}function og(e,n=[]){let i=[];function s(h,d){const l=L.createContext(d),u=i.length;i=[...i,d];const c=m=>{const{scope:_,children:x,...C}=m,S=_?.[e]?.[u]||l,p=L.useMemo(()=>C,Object.values(C));return M.jsx(S.Provider,{value:p,children:x})};c.displayName=h+"Provider";function v(m,_){const x=_?.[e]?.[u]||l,C=L.useContext(x);if(C)return C;if(d!==void 0)return d;throw new Error(`\`${m}\` must be used within \`${h}\``)}return[c,v]}const a=()=>{const h=i.map(d=>L.createContext(d));return function(l){const u=l?.[e]||h;return L.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return a.scopeName=e,[s,m6(a,...n)]}function m6(...e){const n=e[0];if(e.length===1)return n;const i=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(h){const d=s.reduce((l,{useScope:u,scopeName:c})=>{const m=u(h)[`__scope${c}`];return{...l,...m}},{});return L.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return i.scopeName=n.scopeName,i}function mS(e){const n=p6(e),i=L.forwardRef((s,a)=>{const{children:h,...d}=s,l=L.Children.toArray(h),u=l.find(v6);if(u){const c=u.props.children,v=l.map(m=>m===u?L.Children.count(c)>1?L.Children.only(null):L.isValidElement(c)?c.props.children:null:m);return M.jsx(n,{...d,ref:a,children:L.isValidElement(c)?L.cloneElement(c,void 0,v):null})}return M.jsx(n,{...d,ref:a,children:h})});return i.displayName=`${e}.Slot`,i}function p6(e){const n=L.forwardRef((i,s)=>{const{children:a,...h}=i;if(L.isValidElement(a)){const d=y6(a),l=_6(h,a.props);return a.type!==L.Fragment&&(l.ref=s?Jl(s,d):d),L.cloneElement(a,l)}return L.Children.count(a)>1?L.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var g6=Symbol("radix.slottable");function v6(e){return L.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===g6}function _6(e,n){const i={...n};for(const s in n){const a=e[s],h=n[s];/^on[A-Z]/.test(s)?a&&h?i[s]=(...l)=>{const u=h(...l);return a(...l),u}:a&&(i[s]=a):s==="style"?i[s]={...a,...h}:s==="className"&&(i[s]=[a,h].filter(Boolean).join(" "))}return{...e,...i}}function y6(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}function b6(e){const n=e+"CollectionProvider",[i,s]=og(n),[a,h]=i(n,{collectionRef:{current:null},itemMap:new Map}),d=S=>{const{scope:p,children:g}=S,b=Nr.useRef(null),y=Nr.useRef(new Map).current;return M.jsx(a,{scope:p,itemMap:y,collectionRef:b,children:g})};d.displayName=n;const l=e+"CollectionSlot",u=mS(l),c=Nr.forwardRef((S,p)=>{const{scope:g,children:b}=S,y=h(l,g),E=an(p,y.collectionRef);return M.jsx(u,{ref:E,children:b})});c.displayName=l;const v=e+"CollectionItemSlot",m="data-radix-collection-item",_=mS(v),x=Nr.forwardRef((S,p)=>{const{scope:g,children:b,...y}=S,E=Nr.useRef(null),T=an(p,E),O=h(v,g);return Nr.useEffect(()=>(O.itemMap.set(E,{ref:E,...y}),()=>{O.itemMap.delete(E)})),M.jsx(_,{[m]:"",ref:T,children:b})});x.displayName=v;function C(S){const p=h(e+"CollectionConsumer",S);return Nr.useCallback(()=>{const b=p.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${m}]`));return Array.from(p.itemMap.values()).sort((O,D)=>y.indexOf(O.ref.current)-y.indexOf(D.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:d,Slot:c,ItemSlot:x},C,s]}var S6=L.createContext(void 0);function x6(e){const n=L.useContext(S6);return e||n||"ltr"}function w6(e){const n=C6(e),i=L.forwardRef((s,a)=>{const{children:h,...d}=s,l=L.Children.toArray(h),u=l.find(R6);if(u){const c=u.props.children,v=l.map(m=>m===u?L.Children.count(c)>1?L.Children.only(null):L.isValidElement(c)?c.props.children:null:m);return M.jsx(n,{...d,ref:a,children:L.isValidElement(c)?L.cloneElement(c,void 0,v):null})}return M.jsx(n,{...d,ref:a,children:h})});return i.displayName=`${e}.Slot`,i}function C6(e){const n=L.forwardRef((i,s)=>{const{children:a,...h}=i;if(L.isValidElement(a)){const d=D6(a),l=A6(h,a.props);return a.type!==L.Fragment&&(l.ref=s?Jl(s,d):d),L.cloneElement(a,l)}return L.Children.count(a)>1?L.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var E6=Symbol("radix.slottable");function R6(e){return L.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===E6}function A6(e,n){const i={...n};for(const s in n){const a=e[s],h=n[s];/^on[A-Z]/.test(s)?a&&h?i[s]=(...l)=>{const u=h(...l);return a(...l),u}:a&&(i[s]=a):s==="style"?i[s]={...a,...h}:s==="className"&&(i[s]=[a,h].filter(Boolean).join(" "))}return{...e,...i}}function D6(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var T6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kt=T6.reduce((e,n)=>{const i=w6(`Primitive.${n}`),s=L.forwardRef((a,h)=>{const{asChild:d,...l}=a,u=d?i:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),M.jsx(u,{...l,ref:h})});return s.displayName=`Primitive.${n}`,{...e,[n]:s}},{});function M6(e,n){e&&to.flushSync(()=>e.dispatchEvent(n))}function Ks(e){const n=L.useRef(e);return L.useEffect(()=>{n.current=e}),L.useMemo(()=>(...i)=>n.current?.(...i),[])}function O6(e,n=globalThis?.document){const i=Ks(e);L.useEffect(()=>{const s=a=>{a.key==="Escape"&&i(a)};return n.addEventListener("keydown",s,{capture:!0}),()=>n.removeEventListener("keydown",s,{capture:!0})},[i,n])}var L6="DismissableLayer",tp="dismissableLayer.update",N6="dismissableLayer.pointerDownOutside",k6="dismissableLayer.focusOutside",pS,z1=L.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),I1=L.forwardRef((e,n)=>{const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:h,onInteractOutside:d,onDismiss:l,...u}=e,c=L.useContext(z1),[v,m]=L.useState(null),_=v?.ownerDocument??globalThis?.document,[,x]=L.useState({}),C=an(n,D=>m(D)),S=Array.from(c.layers),[p]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=S.indexOf(p),b=v?S.indexOf(v):-1,y=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=g,T=H6(D=>{const A=D.target,N=[...c.branches].some(q=>q.contains(A));!E||N||(a?.(D),d?.(D),D.defaultPrevented||l?.())},_),O=P6(D=>{const A=D.target;[...c.branches].some(q=>q.contains(A))||(h?.(D),d?.(D),D.defaultPrevented||l?.())},_);return O6(D=>{b===c.layers.size-1&&(s?.(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))},_),L.useEffect(()=>{if(v)return i&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(pS=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(v)),c.layers.add(v),gS(),()=>{i&&c.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=pS)}},[v,_,i,c]),L.useEffect(()=>()=>{v&&(c.layers.delete(v),c.layersWithOutsidePointerEventsDisabled.delete(v),gS())},[v,c]),L.useEffect(()=>{const D=()=>x({});return document.addEventListener(tp,D),()=>document.removeEventListener(tp,D)},[]),M.jsx(kt.div,{...u,ref:C,style:{pointerEvents:y?E?"auto":"none":void 0,...e.style},onFocusCapture:It(e.onFocusCapture,O.onFocusCapture),onBlurCapture:It(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:It(e.onPointerDownCapture,T.onPointerDownCapture)})});I1.displayName=L6;var B6="DismissableLayerBranch",j6=L.forwardRef((e,n)=>{const i=L.useContext(z1),s=L.useRef(null),a=an(n,s);return L.useEffect(()=>{const h=s.current;if(h)return i.branches.add(h),()=>{i.branches.delete(h)}},[i.branches]),M.jsx(kt.div,{...e,ref:a})});j6.displayName=B6;function H6(e,n=globalThis?.document){const i=Ks(e),s=L.useRef(!1),a=L.useRef(()=>{});return L.useEffect(()=>{const h=l=>{if(l.target&&!s.current){let u=function(){U1(N6,i,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(n.removeEventListener("click",a.current),a.current=u,n.addEventListener("click",a.current,{once:!0})):u()}else n.removeEventListener("click",a.current);s.current=!1},d=window.setTimeout(()=>{n.addEventListener("pointerdown",h)},0);return()=>{window.clearTimeout(d),n.removeEventListener("pointerdown",h),n.removeEventListener("click",a.current)}},[n,i]),{onPointerDownCapture:()=>s.current=!0}}function P6(e,n=globalThis?.document){const i=Ks(e),s=L.useRef(!1);return L.useEffect(()=>{const a=h=>{h.target&&!s.current&&U1(k6,i,{originalEvent:h},{discrete:!1})};return n.addEventListener("focusin",a),()=>n.removeEventListener("focusin",a)},[n,i]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function gS(){const e=new CustomEvent(tp);document.dispatchEvent(e)}function U1(e,n,i,{discrete:s}){const a=i.originalEvent.target,h=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:i});n&&a.addEventListener(e,n,{once:!0}),s?M6(a,h):a.dispatchEvent(h)}var ym=0;function z6(){L.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??vS()),document.body.insertAdjacentElement("beforeend",e[1]??vS()),ym++,()=>{ym===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),ym--}},[])}function vS(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var bm="focusScope.autoFocusOnMount",Sm="focusScope.autoFocusOnUnmount",_S={bubbles:!1,cancelable:!0},I6="FocusScope",F1=L.forwardRef((e,n)=>{const{loop:i=!1,trapped:s=!1,onMountAutoFocus:a,onUnmountAutoFocus:h,...d}=e,[l,u]=L.useState(null),c=Ks(a),v=Ks(h),m=L.useRef(null),_=an(n,S=>u(S)),x=L.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;L.useEffect(()=>{if(s){let S=function(y){if(x.paused||!l)return;const E=y.target;l.contains(E)?m.current=E:ns(m.current,{select:!0})},p=function(y){if(x.paused||!l)return;const E=y.relatedTarget;E!==null&&(l.contains(E)||ns(m.current,{select:!0}))},g=function(y){if(document.activeElement===document.body)for(const T of y)T.removedNodes.length>0&&ns(l)};document.addEventListener("focusin",S),document.addEventListener("focusout",p);const b=new MutationObserver(g);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",p),b.disconnect()}}},[s,l,x.paused]),L.useEffect(()=>{if(l){bS.add(x);const S=document.activeElement;if(!l.contains(S)){const g=new CustomEvent(bm,_S);l.addEventListener(bm,c),l.dispatchEvent(g),g.defaultPrevented||(U6(W6($1(l)),{select:!0}),document.activeElement===S&&ns(l))}return()=>{l.removeEventListener(bm,c),setTimeout(()=>{const g=new CustomEvent(Sm,_S);l.addEventListener(Sm,v),l.dispatchEvent(g),g.defaultPrevented||ns(S??document.body,{select:!0}),l.removeEventListener(Sm,v),bS.remove(x)},0)}}},[l,c,v,x]);const C=L.useCallback(S=>{if(!i&&!s||x.paused)return;const p=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,g=document.activeElement;if(p&&g){const b=S.currentTarget,[y,E]=F6(b);y&&E?!S.shiftKey&&g===E?(S.preventDefault(),i&&ns(y,{select:!0})):S.shiftKey&&g===y&&(S.preventDefault(),i&&ns(E,{select:!0})):g===b&&S.preventDefault()}},[i,s,x.paused]);return M.jsx(kt.div,{tabIndex:-1,...d,ref:_,onKeyDown:C})});F1.displayName=I6;function U6(e,{select:n=!1}={}){const i=document.activeElement;for(const s of e)if(ns(s,{select:n}),document.activeElement!==i)return}function F6(e){const n=$1(e),i=yS(n,e),s=yS(n.reverse(),e);return[i,s]}function $1(e){const n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)n.push(i.currentNode);return n}function yS(e,n){for(const i of e)if(!$6(i,{upTo:n}))return i}function $6(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function V6(e){return e instanceof HTMLInputElement&&"select"in e}function ns(e,{select:n=!1}={}){if(e&&e.focus){const i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&V6(e)&&n&&e.select()}}var bS=q6();function q6(){let e=[];return{add(n){const i=e[0];n!==i&&i?.pause(),e=SS(e,n),e.unshift(n)},remove(n){e=SS(e,n),e[0]?.resume()}}}function SS(e,n){const i=[...e],s=i.indexOf(n);return s!==-1&&i.splice(s,1),i}function W6(e){return e.filter(n=>n.tagName!=="A")}var Tn=globalThis?.document?L.useLayoutEffect:()=>{},Y6=gh[" useId ".trim().toString()]||(()=>{}),K6=0;function ag(e){const[n,i]=L.useState(Y6());return Tn(()=>{i(s=>s??String(K6++))},[e]),n?`radix-${n}`:""}const G6=["top","right","bottom","left"],hs=Math.min,Fn=Math.max,ch=Math.round,Tu=Math.floor,Ur=e=>({x:e,y:e}),X6={left:"right",right:"left",bottom:"top",top:"bottom"},Q6={start:"end",end:"start"};function np(e,n,i){return Fn(e,hs(n,i))}function Ri(e,n){return typeof e=="function"?e(n):e}function Ai(e){return e.split("-")[0]}function ha(e){return e.split("-")[1]}function lg(e){return e==="x"?"y":"x"}function cg(e){return e==="y"?"height":"width"}const Z6=new Set(["top","bottom"]);function Pr(e){return Z6.has(Ai(e))?"y":"x"}function ug(e){return lg(Pr(e))}function J6(e,n,i){i===void 0&&(i=!1);const s=ha(e),a=ug(e),h=cg(a);let d=a==="x"?s===(i?"end":"start")?"right":"left":s==="start"?"bottom":"top";return n.reference[h]>n.floating[h]&&(d=uh(d)),[d,uh(d)]}function ej(e){const n=uh(e);return[rp(e),n,rp(n)]}function rp(e){return e.replace(/start|end/g,n=>Q6[n])}const xS=["left","right"],wS=["right","left"],tj=["top","bottom"],nj=["bottom","top"];function rj(e,n,i){switch(e){case"top":case"bottom":return i?n?wS:xS:n?xS:wS;case"left":case"right":return n?tj:nj;default:return[]}}function ij(e,n,i,s){const a=ha(e);let h=rj(Ai(e),i==="start",s);return a&&(h=h.map(d=>d+"-"+a),n&&(h=h.concat(h.map(rp)))),h}function uh(e){return e.replace(/left|right|bottom|top/g,n=>X6[n])}function sj(e){return{top:0,right:0,bottom:0,left:0,...e}}function V1(e){return typeof e!="number"?sj(e):{top:e,right:e,bottom:e,left:e}}function hh(e){const{x:n,y:i,width:s,height:a}=e;return{width:s,height:a,top:i,left:n,right:n+s,bottom:i+a,x:n,y:i}}function CS(e,n,i){let{reference:s,floating:a}=e;const h=Pr(n),d=ug(n),l=cg(d),u=Ai(n),c=h==="y",v=s.x+s.width/2-a.width/2,m=s.y+s.height/2-a.height/2,_=s[l]/2-a[l]/2;let x;switch(u){case"top":x={x:v,y:s.y-a.height};break;case"bottom":x={x:v,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:m};break;case"left":x={x:s.x-a.width,y:m};break;default:x={x:s.x,y:s.y}}switch(ha(n)){case"start":x[d]-=_*(i&&c?-1:1);break;case"end":x[d]+=_*(i&&c?-1:1);break}return x}const oj=async(e,n,i)=>{const{placement:s="bottom",strategy:a="absolute",middleware:h=[],platform:d}=i,l=h.filter(Boolean),u=await(d.isRTL==null?void 0:d.isRTL(n));let c=await d.getElementRects({reference:e,floating:n,strategy:a}),{x:v,y:m}=CS(c,s,u),_=s,x={},C=0;for(let S=0;S<l.length;S++){const{name:p,fn:g}=l[S],{x:b,y,data:E,reset:T}=await g({x:v,y:m,initialPlacement:s,placement:_,strategy:a,middlewareData:x,rects:c,platform:d,elements:{reference:e,floating:n}});v=b??v,m=y??m,x={...x,[p]:{...x[p],...E}},T&&C<=50&&(C++,typeof T=="object"&&(T.placement&&(_=T.placement),T.rects&&(c=T.rects===!0?await d.getElementRects({reference:e,floating:n,strategy:a}):T.rects),{x:v,y:m}=CS(c,_,u)),S=-1)}return{x:v,y:m,placement:_,strategy:a,middlewareData:x}};async function jl(e,n){var i;n===void 0&&(n={});const{x:s,y:a,platform:h,rects:d,elements:l,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:v="viewport",elementContext:m="floating",altBoundary:_=!1,padding:x=0}=Ri(n,e),C=V1(x),p=l[_?m==="floating"?"reference":"floating":m],g=hh(await h.getClippingRect({element:(i=await(h.isElement==null?void 0:h.isElement(p)))==null||i?p:p.contextElement||await(h.getDocumentElement==null?void 0:h.getDocumentElement(l.floating)),boundary:c,rootBoundary:v,strategy:u})),b=m==="floating"?{x:s,y:a,width:d.floating.width,height:d.floating.height}:d.reference,y=await(h.getOffsetParent==null?void 0:h.getOffsetParent(l.floating)),E=await(h.isElement==null?void 0:h.isElement(y))?await(h.getScale==null?void 0:h.getScale(y))||{x:1,y:1}:{x:1,y:1},T=hh(h.convertOffsetParentRelativeRectToViewportRelativeRect?await h.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:y,strategy:u}):b);return{top:(g.top-T.top+C.top)/E.y,bottom:(T.bottom-g.bottom+C.bottom)/E.y,left:(g.left-T.left+C.left)/E.x,right:(T.right-g.right+C.right)/E.x}}const aj=e=>({name:"arrow",options:e,async fn(n){const{x:i,y:s,placement:a,rects:h,platform:d,elements:l,middlewareData:u}=n,{element:c,padding:v=0}=Ri(e,n)||{};if(c==null)return{};const m=V1(v),_={x:i,y:s},x=ug(a),C=cg(x),S=await d.getDimensions(c),p=x==="y",g=p?"top":"left",b=p?"bottom":"right",y=p?"clientHeight":"clientWidth",E=h.reference[C]+h.reference[x]-_[x]-h.floating[C],T=_[x]-h.reference[x],O=await(d.getOffsetParent==null?void 0:d.getOffsetParent(c));let D=O?O[y]:0;(!D||!await(d.isElement==null?void 0:d.isElement(O)))&&(D=l.floating[y]||h.floating[C]);const A=E/2-T/2,N=D/2-S[C]/2-1,q=hs(m[g],N),P=hs(m[b],N),z=q,W=D-S[C]-P,U=D/2-S[C]/2+A,G=np(z,U,W),H=!u.arrow&&ha(a)!=null&&U!==G&&h.reference[C]/2-(U<z?q:P)-S[C]/2<0,K=H?U<z?U-z:U-W:0;return{[x]:_[x]+K,data:{[x]:G,centerOffset:U-G-K,...H&&{alignmentOffset:K}},reset:H}}}),lj=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var i,s;const{placement:a,middlewareData:h,rects:d,initialPlacement:l,platform:u,elements:c}=n,{mainAxis:v=!0,crossAxis:m=!0,fallbackPlacements:_,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:S=!0,...p}=Ri(e,n);if((i=h.arrow)!=null&&i.alignmentOffset)return{};const g=Ai(a),b=Pr(l),y=Ai(l)===l,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),T=_||(y||!S?[uh(l)]:ej(l)),O=C!=="none";!_&&O&&T.push(...ij(l,S,C,E));const D=[l,...T],A=await jl(n,p),N=[];let q=((s=h.flip)==null?void 0:s.overflows)||[];if(v&&N.push(A[g]),m){const U=J6(a,d,E);N.push(A[U[0]],A[U[1]])}if(q=[...q,{placement:a,overflows:N}],!N.every(U=>U<=0)){var P,z;const U=(((P=h.flip)==null?void 0:P.index)||0)+1,G=D[U];if(G&&(!(m==="alignment"?b!==Pr(G):!1)||q.every(F=>Pr(F.placement)===b?F.overflows[0]>0:!0)))return{data:{index:U,overflows:q},reset:{placement:G}};let H=(z=q.filter(K=>K.overflows[0]<=0).sort((K,F)=>K.overflows[1]-F.overflows[1])[0])==null?void 0:z.placement;if(!H)switch(x){case"bestFit":{var W;const K=(W=q.filter(F=>{if(O){const k=Pr(F.placement);return k===b||k==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(k=>k>0).reduce((k,$)=>k+$,0)]).sort((F,k)=>F[1]-k[1])[0])==null?void 0:W[0];K&&(H=K);break}case"initialPlacement":H=l;break}if(a!==H)return{reset:{placement:H}}}return{}}}};function ES(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function RS(e){return G6.some(n=>e[n]>=0)}const cj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:i}=n,{strategy:s="referenceHidden",...a}=Ri(e,n);switch(s){case"referenceHidden":{const h=await jl(n,{...a,elementContext:"reference"}),d=ES(h,i.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:RS(d)}}}case"escaped":{const h=await jl(n,{...a,altBoundary:!0}),d=ES(h,i.floating);return{data:{escapedOffsets:d,escaped:RS(d)}}}default:return{}}}}},q1=new Set(["left","top"]);async function uj(e,n){const{placement:i,platform:s,elements:a}=e,h=await(s.isRTL==null?void 0:s.isRTL(a.floating)),d=Ai(i),l=ha(i),u=Pr(i)==="y",c=q1.has(d)?-1:1,v=h&&u?-1:1,m=Ri(n,e);let{mainAxis:_,crossAxis:x,alignmentAxis:C}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof C=="number"&&(x=l==="end"?C*-1:C),u?{x:x*v,y:_*c}:{x:_*c,y:x*v}}const hj=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var i,s;const{x:a,y:h,placement:d,middlewareData:l}=n,u=await uj(n,e);return d===((i=l.offset)==null?void 0:i.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:a+u.x,y:h+u.y,data:{...u,placement:d}}}}},fj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:i,y:s,placement:a}=n,{mainAxis:h=!0,crossAxis:d=!1,limiter:l={fn:p=>{let{x:g,y:b}=p;return{x:g,y:b}}},...u}=Ri(e,n),c={x:i,y:s},v=await jl(n,u),m=Pr(Ai(a)),_=lg(m);let x=c[_],C=c[m];if(h){const p=_==="y"?"top":"left",g=_==="y"?"bottom":"right",b=x+v[p],y=x-v[g];x=np(b,x,y)}if(d){const p=m==="y"?"top":"left",g=m==="y"?"bottom":"right",b=C+v[p],y=C-v[g];C=np(b,C,y)}const S=l.fn({...n,[_]:x,[m]:C});return{...S,data:{x:S.x-i,y:S.y-s,enabled:{[_]:h,[m]:d}}}}}},dj=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:i,y:s,placement:a,rects:h,middlewareData:d}=n,{offset:l=0,mainAxis:u=!0,crossAxis:c=!0}=Ri(e,n),v={x:i,y:s},m=Pr(a),_=lg(m);let x=v[_],C=v[m];const S=Ri(l,n),p=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(u){const y=_==="y"?"height":"width",E=h.reference[_]-h.floating[y]+p.mainAxis,T=h.reference[_]+h.reference[y]-p.mainAxis;x<E?x=E:x>T&&(x=T)}if(c){var g,b;const y=_==="y"?"width":"height",E=q1.has(Ai(a)),T=h.reference[m]-h.floating[y]+(E&&((g=d.offset)==null?void 0:g[m])||0)+(E?0:p.crossAxis),O=h.reference[m]+h.reference[y]+(E?0:((b=d.offset)==null?void 0:b[m])||0)-(E?p.crossAxis:0);C<T?C=T:C>O&&(C=O)}return{[_]:x,[m]:C}}}},mj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var i,s;const{placement:a,rects:h,platform:d,elements:l}=n,{apply:u=()=>{},...c}=Ri(e,n),v=await jl(n,c),m=Ai(a),_=ha(a),x=Pr(a)==="y",{width:C,height:S}=h.floating;let p,g;m==="top"||m==="bottom"?(p=m,g=_===(await(d.isRTL==null?void 0:d.isRTL(l.floating))?"start":"end")?"left":"right"):(g=m,p=_==="end"?"top":"bottom");const b=S-v.top-v.bottom,y=C-v.left-v.right,E=hs(S-v[p],b),T=hs(C-v[g],y),O=!n.middlewareData.shift;let D=E,A=T;if((i=n.middlewareData.shift)!=null&&i.enabled.x&&(A=y),(s=n.middlewareData.shift)!=null&&s.enabled.y&&(D=b),O&&!_){const q=Fn(v.left,0),P=Fn(v.right,0),z=Fn(v.top,0),W=Fn(v.bottom,0);x?A=C-2*(q!==0||P!==0?q+P:Fn(v.left,v.right)):D=S-2*(z!==0||W!==0?z+W:Fn(v.top,v.bottom))}await u({...n,availableWidth:A,availableHeight:D});const N=await d.getDimensions(l.floating);return C!==N.width||S!==N.height?{reset:{rects:!0}}:{}}}};function Oh(){return typeof window<"u"}function fa(e){return W1(e)?(e.nodeName||"").toLowerCase():"#document"}function Vn(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Yr(e){var n;return(n=(W1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function W1(e){return Oh()?e instanceof Node||e instanceof Vn(e).Node:!1}function xr(e){return Oh()?e instanceof Element||e instanceof Vn(e).Element:!1}function Vr(e){return Oh()?e instanceof HTMLElement||e instanceof Vn(e).HTMLElement:!1}function AS(e){return!Oh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Vn(e).ShadowRoot}const pj=new Set(["inline","contents"]);function ec(e){const{overflow:n,overflowX:i,overflowY:s,display:a}=wr(e);return/auto|scroll|overlay|hidden|clip/.test(n+s+i)&&!pj.has(a)}const gj=new Set(["table","td","th"]);function vj(e){return gj.has(fa(e))}const _j=[":popover-open",":modal"];function Lh(e){return _j.some(n=>{try{return e.matches(n)}catch{return!1}})}const yj=["transform","translate","scale","rotate","perspective"],bj=["transform","translate","scale","rotate","perspective","filter"],Sj=["paint","layout","strict","content"];function hg(e){const n=fg(),i=xr(e)?wr(e):e;return yj.some(s=>i[s]?i[s]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!n&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!n&&(i.filter?i.filter!=="none":!1)||bj.some(s=>(i.willChange||"").includes(s))||Sj.some(s=>(i.contain||"").includes(s))}function xj(e){let n=fs(e);for(;Vr(n)&&!aa(n);){if(hg(n))return n;if(Lh(n))return null;n=fs(n)}return null}function fg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wj=new Set(["html","body","#document"]);function aa(e){return wj.has(fa(e))}function wr(e){return Vn(e).getComputedStyle(e)}function Nh(e){return xr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fs(e){if(fa(e)==="html")return e;const n=e.assignedSlot||e.parentNode||AS(e)&&e.host||Yr(e);return AS(n)?n.host:n}function Y1(e){const n=fs(e);return aa(n)?e.ownerDocument?e.ownerDocument.body:e.body:Vr(n)&&ec(n)?n:Y1(n)}function Hl(e,n,i){var s;n===void 0&&(n=[]),i===void 0&&(i=!0);const a=Y1(e),h=a===((s=e.ownerDocument)==null?void 0:s.body),d=Vn(a);if(h){const l=ip(d);return n.concat(d,d.visualViewport||[],ec(a)?a:[],l&&i?Hl(l):[])}return n.concat(a,Hl(a,[],i))}function ip(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function K1(e){const n=wr(e);let i=parseFloat(n.width)||0,s=parseFloat(n.height)||0;const a=Vr(e),h=a?e.offsetWidth:i,d=a?e.offsetHeight:s,l=ch(i)!==h||ch(s)!==d;return l&&(i=h,s=d),{width:i,height:s,$:l}}function dg(e){return xr(e)?e:e.contextElement}function Zo(e){const n=dg(e);if(!Vr(n))return Ur(1);const i=n.getBoundingClientRect(),{width:s,height:a,$:h}=K1(n);let d=(h?ch(i.width):i.width)/s,l=(h?ch(i.height):i.height)/a;return(!d||!Number.isFinite(d))&&(d=1),(!l||!Number.isFinite(l))&&(l=1),{x:d,y:l}}const Cj=Ur(0);function G1(e){const n=Vn(e);return!fg()||!n.visualViewport?Cj:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Ej(e,n,i){return n===void 0&&(n=!1),!i||n&&i!==Vn(e)?!1:n}function Gs(e,n,i,s){n===void 0&&(n=!1),i===void 0&&(i=!1);const a=e.getBoundingClientRect(),h=dg(e);let d=Ur(1);n&&(s?xr(s)&&(d=Zo(s)):d=Zo(e));const l=Ej(h,i,s)?G1(h):Ur(0);let u=(a.left+l.x)/d.x,c=(a.top+l.y)/d.y,v=a.width/d.x,m=a.height/d.y;if(h){const _=Vn(h),x=s&&xr(s)?Vn(s):s;let C=_,S=ip(C);for(;S&&s&&x!==C;){const p=Zo(S),g=S.getBoundingClientRect(),b=wr(S),y=g.left+(S.clientLeft+parseFloat(b.paddingLeft))*p.x,E=g.top+(S.clientTop+parseFloat(b.paddingTop))*p.y;u*=p.x,c*=p.y,v*=p.x,m*=p.y,u+=y,c+=E,C=Vn(S),S=ip(C)}}return hh({width:v,height:m,x:u,y:c})}function kh(e,n){const i=Nh(e).scrollLeft;return n?n.left+i:Gs(Yr(e)).left+i}function X1(e,n){const i=e.getBoundingClientRect(),s=i.left+n.scrollLeft-kh(e,i),a=i.top+n.scrollTop;return{x:s,y:a}}function Rj(e){let{elements:n,rect:i,offsetParent:s,strategy:a}=e;const h=a==="fixed",d=Yr(s),l=n?Lh(n.floating):!1;if(s===d||l&&h)return i;let u={scrollLeft:0,scrollTop:0},c=Ur(1);const v=Ur(0),m=Vr(s);if((m||!m&&!h)&&((fa(s)!=="body"||ec(d))&&(u=Nh(s)),Vr(s))){const x=Gs(s);c=Zo(s),v.x=x.x+s.clientLeft,v.y=x.y+s.clientTop}const _=d&&!m&&!h?X1(d,u):Ur(0);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-u.scrollLeft*c.x+v.x+_.x,y:i.y*c.y-u.scrollTop*c.y+v.y+_.y}}function Aj(e){return Array.from(e.getClientRects())}function Dj(e){const n=Yr(e),i=Nh(e),s=e.ownerDocument.body,a=Fn(n.scrollWidth,n.clientWidth,s.scrollWidth,s.clientWidth),h=Fn(n.scrollHeight,n.clientHeight,s.scrollHeight,s.clientHeight);let d=-i.scrollLeft+kh(e);const l=-i.scrollTop;return wr(s).direction==="rtl"&&(d+=Fn(n.clientWidth,s.clientWidth)-a),{width:a,height:h,x:d,y:l}}const DS=25;function Tj(e,n){const i=Vn(e),s=Yr(e),a=i.visualViewport;let h=s.clientWidth,d=s.clientHeight,l=0,u=0;if(a){h=a.width,d=a.height;const v=fg();(!v||v&&n==="fixed")&&(l=a.offsetLeft,u=a.offsetTop)}const c=kh(s);if(c<=0){const v=s.ownerDocument,m=v.body,_=getComputedStyle(m),x=v.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,C=Math.abs(s.clientWidth-m.clientWidth-x);C<=DS&&(h-=C)}else c<=DS&&(h+=c);return{width:h,height:d,x:l,y:u}}const Mj=new Set(["absolute","fixed"]);function Oj(e,n){const i=Gs(e,!0,n==="fixed"),s=i.top+e.clientTop,a=i.left+e.clientLeft,h=Vr(e)?Zo(e):Ur(1),d=e.clientWidth*h.x,l=e.clientHeight*h.y,u=a*h.x,c=s*h.y;return{width:d,height:l,x:u,y:c}}function TS(e,n,i){let s;if(n==="viewport")s=Tj(e,i);else if(n==="document")s=Dj(Yr(e));else if(xr(n))s=Oj(n,i);else{const a=G1(e);s={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return hh(s)}function Q1(e,n){const i=fs(e);return i===n||!xr(i)||aa(i)?!1:wr(i).position==="fixed"||Q1(i,n)}function Lj(e,n){const i=n.get(e);if(i)return i;let s=Hl(e,[],!1).filter(l=>xr(l)&&fa(l)!=="body"),a=null;const h=wr(e).position==="fixed";let d=h?fs(e):e;for(;xr(d)&&!aa(d);){const l=wr(d),u=hg(d);!u&&l.position==="fixed"&&(a=null),(h?!u&&!a:!u&&l.position==="static"&&!!a&&Mj.has(a.position)||ec(d)&&!u&&Q1(e,d))?s=s.filter(v=>v!==d):a=l,d=fs(d)}return n.set(e,s),s}function Nj(e){let{element:n,boundary:i,rootBoundary:s,strategy:a}=e;const d=[...i==="clippingAncestors"?Lh(n)?[]:Lj(n,this._c):[].concat(i),s],l=d[0],u=d.reduce((c,v)=>{const m=TS(n,v,a);return c.top=Fn(m.top,c.top),c.right=hs(m.right,c.right),c.bottom=hs(m.bottom,c.bottom),c.left=Fn(m.left,c.left),c},TS(n,l,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function kj(e){const{width:n,height:i}=K1(e);return{width:n,height:i}}function Bj(e,n,i){const s=Vr(n),a=Yr(n),h=i==="fixed",d=Gs(e,!0,h,n);let l={scrollLeft:0,scrollTop:0};const u=Ur(0);function c(){u.x=kh(a)}if(s||!s&&!h)if((fa(n)!=="body"||ec(a))&&(l=Nh(n)),s){const x=Gs(n,!0,h,n);u.x=x.x+n.clientLeft,u.y=x.y+n.clientTop}else a&&c();h&&!s&&a&&c();const v=a&&!s&&!h?X1(a,l):Ur(0),m=d.left+l.scrollLeft-u.x-v.x,_=d.top+l.scrollTop-u.y-v.y;return{x:m,y:_,width:d.width,height:d.height}}function xm(e){return wr(e).position==="static"}function MS(e,n){if(!Vr(e)||wr(e).position==="fixed")return null;if(n)return n(e);let i=e.offsetParent;return Yr(e)===i&&(i=i.ownerDocument.body),i}function Z1(e,n){const i=Vn(e);if(Lh(e))return i;if(!Vr(e)){let a=fs(e);for(;a&&!aa(a);){if(xr(a)&&!xm(a))return a;a=fs(a)}return i}let s=MS(e,n);for(;s&&vj(s)&&xm(s);)s=MS(s,n);return s&&aa(s)&&xm(s)&&!hg(s)?i:s||xj(e)||i}const jj=async function(e){const n=this.getOffsetParent||Z1,i=this.getDimensions,s=await i(e.floating);return{reference:Bj(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Hj(e){return wr(e).direction==="rtl"}const Pj={convertOffsetParentRelativeRectToViewportRelativeRect:Rj,getDocumentElement:Yr,getClippingRect:Nj,getOffsetParent:Z1,getElementRects:jj,getClientRects:Aj,getDimensions:kj,getScale:Zo,isElement:xr,isRTL:Hj};function J1(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function zj(e,n){let i=null,s;const a=Yr(e);function h(){var l;clearTimeout(s),(l=i)==null||l.disconnect(),i=null}function d(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),h();const c=e.getBoundingClientRect(),{left:v,top:m,width:_,height:x}=c;if(l||n(),!_||!x)return;const C=Tu(m),S=Tu(a.clientWidth-(v+_)),p=Tu(a.clientHeight-(m+x)),g=Tu(v),y={rootMargin:-C+"px "+-S+"px "+-p+"px "+-g+"px",threshold:Fn(0,hs(1,u))||1};let E=!0;function T(O){const D=O[0].intersectionRatio;if(D!==u){if(!E)return d();D?d(!1,D):s=setTimeout(()=>{d(!1,1e-7)},1e3)}D===1&&!J1(c,e.getBoundingClientRect())&&d(),E=!1}try{i=new IntersectionObserver(T,{...y,root:a.ownerDocument})}catch{i=new IntersectionObserver(T,y)}i.observe(e)}return d(!0),h}function Ij(e,n,i,s){s===void 0&&(s={});const{ancestorScroll:a=!0,ancestorResize:h=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=s,c=dg(e),v=a||h?[...c?Hl(c):[],...Hl(n)]:[];v.forEach(g=>{a&&g.addEventListener("scroll",i,{passive:!0}),h&&g.addEventListener("resize",i)});const m=c&&l?zj(c,i):null;let _=-1,x=null;d&&(x=new ResizeObserver(g=>{let[b]=g;b&&b.target===c&&x&&(x.unobserve(n),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var y;(y=x)==null||y.observe(n)})),i()}),c&&!u&&x.observe(c),x.observe(n));let C,S=u?Gs(e):null;u&&p();function p(){const g=Gs(e);S&&!J1(S,g)&&i(),S=g,C=requestAnimationFrame(p)}return i(),()=>{var g;v.forEach(b=>{a&&b.removeEventListener("scroll",i),h&&b.removeEventListener("resize",i)}),m?.(),(g=x)==null||g.disconnect(),x=null,u&&cancelAnimationFrame(C)}}const Uj=hj,Fj=fj,$j=lj,Vj=mj,qj=cj,OS=aj,Wj=dj,Yj=(e,n,i)=>{const s=new Map,a={platform:Pj,...i},h={...a.platform,_c:s};return oj(e,n,{...a,platform:h})};var Kj=typeof document<"u",Gj=function(){},$u=Kj?L.useLayoutEffect:Gj;function fh(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let i,s,a;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(i=e.length,i!==n.length)return!1;for(s=i;s--!==0;)if(!fh(e[s],n[s]))return!1;return!0}if(a=Object.keys(e),i=a.length,i!==Object.keys(n).length)return!1;for(s=i;s--!==0;)if(!{}.hasOwnProperty.call(n,a[s]))return!1;for(s=i;s--!==0;){const h=a[s];if(!(h==="_owner"&&e.$$typeof)&&!fh(e[h],n[h]))return!1}return!0}return e!==e&&n!==n}function eC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function LS(e,n){const i=eC(e);return Math.round(n*i)/i}function wm(e){const n=L.useRef(e);return $u(()=>{n.current=e}),n}function Xj(e){e===void 0&&(e={});const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:a,elements:{reference:h,floating:d}={},transform:l=!0,whileElementsMounted:u,open:c}=e,[v,m]=L.useState({x:0,y:0,strategy:i,placement:n,middlewareData:{},isPositioned:!1}),[_,x]=L.useState(s);fh(_,s)||x(s);const[C,S]=L.useState(null),[p,g]=L.useState(null),b=L.useCallback(F=>{F!==O.current&&(O.current=F,S(F))},[]),y=L.useCallback(F=>{F!==D.current&&(D.current=F,g(F))},[]),E=h||C,T=d||p,O=L.useRef(null),D=L.useRef(null),A=L.useRef(v),N=u!=null,q=wm(u),P=wm(a),z=wm(c),W=L.useCallback(()=>{if(!O.current||!D.current)return;const F={placement:n,strategy:i,middleware:_};P.current&&(F.platform=P.current),Yj(O.current,D.current,F).then(k=>{const $={...k,isPositioned:z.current!==!1};U.current&&!fh(A.current,$)&&(A.current=$,to.flushSync(()=>{m($)}))})},[_,n,i,P,z]);$u(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,m(F=>({...F,isPositioned:!1})))},[c]);const U=L.useRef(!1);$u(()=>(U.current=!0,()=>{U.current=!1}),[]),$u(()=>{if(E&&(O.current=E),T&&(D.current=T),E&&T){if(q.current)return q.current(E,T,W);W()}},[E,T,W,q,N]);const G=L.useMemo(()=>({reference:O,floating:D,setReference:b,setFloating:y}),[b,y]),H=L.useMemo(()=>({reference:E,floating:T}),[E,T]),K=L.useMemo(()=>{const F={position:i,left:0,top:0};if(!H.floating)return F;const k=LS(H.floating,v.x),$=LS(H.floating,v.y);return l?{...F,transform:"translate("+k+"px, "+$+"px)",...eC(H.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:k,top:$}},[i,l,H.floating,v.x,v.y]);return L.useMemo(()=>({...v,update:W,refs:G,elements:H,floatingStyles:K}),[v,W,G,H,K])}const Qj=e=>{function n(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){const{element:s,padding:a}=typeof e=="function"?e(i):e;return s&&n(s)?s.current!=null?OS({element:s.current,padding:a}).fn(i):{}:s?OS({element:s,padding:a}).fn(i):{}}}},Zj=(e,n)=>({...Uj(e),options:[e,n]}),Jj=(e,n)=>({...Fj(e),options:[e,n]}),e8=(e,n)=>({...Wj(e),options:[e,n]}),t8=(e,n)=>({...$j(e),options:[e,n]}),n8=(e,n)=>({...Vj(e),options:[e,n]}),r8=(e,n)=>({...qj(e),options:[e,n]}),i8=(e,n)=>({...Qj(e),options:[e,n]});var s8="Arrow",tC=L.forwardRef((e,n)=>{const{children:i,width:s=10,height:a=5,...h}=e;return M.jsx(kt.svg,{...h,ref:n,width:s,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?i:M.jsx("polygon",{points:"0,0 30,0 15,10"})})});tC.displayName=s8;var o8=tC;function a8(e){const[n,i]=L.useState(void 0);return Tn(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const h=a[0];let d,l;if("borderBoxSize"in h){const u=h.borderBoxSize,c=Array.isArray(u)?u[0]:u;d=c.inlineSize,l=c.blockSize}else d=e.offsetWidth,l=e.offsetHeight;i({width:d,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else i(void 0)},[e]),n}var mg="Popper",[nC,rC]=og(mg),[l8,iC]=nC(mg),sC=e=>{const{__scopePopper:n,children:i}=e,[s,a]=L.useState(null);return M.jsx(l8,{scope:n,anchor:s,onAnchorChange:a,children:i})};sC.displayName=mg;var oC="PopperAnchor",aC=L.forwardRef((e,n)=>{const{__scopePopper:i,virtualRef:s,...a}=e,h=iC(oC,i),d=L.useRef(null),l=an(n,d),u=L.useRef(null);return L.useEffect(()=>{const c=u.current;u.current=s?.current||d.current,c!==u.current&&h.onAnchorChange(u.current)}),s?null:M.jsx(kt.div,{...a,ref:l})});aC.displayName=oC;var pg="PopperContent",[c8,u8]=nC(pg),lC=L.forwardRef((e,n)=>{const{__scopePopper:i,side:s="bottom",sideOffset:a=0,align:h="center",alignOffset:d=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:v=0,sticky:m="partial",hideWhenDetached:_=!1,updatePositionStrategy:x="optimized",onPlaced:C,...S}=e,p=iC(pg,i),[g,b]=L.useState(null),y=an(n,X=>b(X)),[E,T]=L.useState(null),O=a8(E),D=O?.width??0,A=O?.height??0,N=s+(h!=="center"?"-"+h:""),q=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},P=Array.isArray(c)?c:[c],z=P.length>0,W={padding:q,boundary:P.filter(f8),altBoundary:z},{refs:U,floatingStyles:G,placement:H,isPositioned:K,middlewareData:F}=Xj({strategy:"fixed",placement:N,whileElementsMounted:(...X)=>Ij(...X,{animationFrame:x==="always"}),elements:{reference:p.anchor},middleware:[Zj({mainAxis:a+A,alignmentAxis:d}),u&&Jj({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?e8():void 0,...W}),u&&t8({...W}),n8({...W,apply:({elements:X,rects:V,availableWidth:ie,availableHeight:de})=>{const{width:re,height:le}=V.reference,_e=X.floating.style;_e.setProperty("--radix-popper-available-width",`${ie}px`),_e.setProperty("--radix-popper-available-height",`${de}px`),_e.setProperty("--radix-popper-anchor-width",`${re}px`),_e.setProperty("--radix-popper-anchor-height",`${le}px`)}}),E&&i8({element:E,padding:l}),d8({arrowWidth:D,arrowHeight:A}),_&&r8({strategy:"referenceHidden",...W})]}),[k,$]=hC(H),B=Ks(C);Tn(()=>{K&&B?.()},[K,B]);const I=F.arrow?.x,Q=F.arrow?.y,J=F.arrow?.centerOffset!==0,[ae,Z]=L.useState();return Tn(()=>{g&&Z(window.getComputedStyle(g).zIndex)},[g]),M.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:K?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:M.jsx(c8,{scope:i,placedSide:k,onArrowChange:T,arrowX:I,arrowY:Q,shouldHideArrow:J,children:M.jsx(kt.div,{"data-side":k,"data-align":$,...S,ref:y,style:{...S.style,animation:K?void 0:"none"}})})})});lC.displayName=pg;var cC="PopperArrow",h8={top:"bottom",right:"left",bottom:"top",left:"right"},uC=L.forwardRef(function(n,i){const{__scopePopper:s,...a}=n,h=u8(cC,s),d=h8[h.placedSide];return M.jsx("span",{ref:h.onArrowChange,style:{position:"absolute",left:h.arrowX,top:h.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[h.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[h.placedSide],visibility:h.shouldHideArrow?"hidden":void 0},children:M.jsx(o8,{...a,ref:i,style:{...a.style,display:"block"}})})});uC.displayName=cC;function f8(e){return e!==null}var d8=e=>({name:"transformOrigin",options:e,fn(n){const{placement:i,rects:s,middlewareData:a}=n,d=a.arrow?.centerOffset!==0,l=d?0:e.arrowWidth,u=d?0:e.arrowHeight,[c,v]=hC(i),m={start:"0%",center:"50%",end:"100%"}[v],_=(a.arrow?.x??0)+l/2,x=(a.arrow?.y??0)+u/2;let C="",S="";return c==="bottom"?(C=d?m:`${_}px`,S=`${-u}px`):c==="top"?(C=d?m:`${_}px`,S=`${s.floating.height+u}px`):c==="right"?(C=`${-u}px`,S=d?m:`${x}px`):c==="left"&&(C=`${s.floating.width+u}px`,S=d?m:`${x}px`),{data:{x:C,y:S}}}});function hC(e){const[n,i="center"]=e.split("-");return[n,i]}var m8=sC,p8=aC,g8=lC,v8=uC,_8="Portal",fC=L.forwardRef((e,n)=>{const{container:i,...s}=e,[a,h]=L.useState(!1);Tn(()=>h(!0),[]);const d=i||a&&globalThis?.document?.body;return d?OT.createPortal(M.jsx(kt.div,{...s,ref:n}),d):null});fC.displayName=_8;function y8(e){const n=b8(e),i=L.forwardRef((s,a)=>{const{children:h,...d}=s,l=L.Children.toArray(h),u=l.find(x8);if(u){const c=u.props.children,v=l.map(m=>m===u?L.Children.count(c)>1?L.Children.only(null):L.isValidElement(c)?c.props.children:null:m);return M.jsx(n,{...d,ref:a,children:L.isValidElement(c)?L.cloneElement(c,void 0,v):null})}return M.jsx(n,{...d,ref:a,children:h})});return i.displayName=`${e}.Slot`,i}function b8(e){const n=L.forwardRef((i,s)=>{const{children:a,...h}=i;if(L.isValidElement(a)){const d=C8(a),l=w8(h,a.props);return a.type!==L.Fragment&&(l.ref=s?Jl(s,d):d),L.cloneElement(a,l)}return L.Children.count(a)>1?L.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var S8=Symbol("radix.slottable");function x8(e){return L.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S8}function w8(e,n){const i={...n};for(const s in n){const a=e[s],h=n[s];/^on[A-Z]/.test(s)?a&&h?i[s]=(...l)=>{const u=h(...l);return a(...l),u}:a&&(i[s]=a):s==="style"?i[s]={...a,...h}:s==="className"&&(i[s]=[a,h].filter(Boolean).join(" "))}return{...e,...i}}function C8(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var E8=gh[" useInsertionEffect ".trim().toString()]||Tn;function NS({prop:e,defaultProp:n,onChange:i=()=>{},caller:s}){const[a,h,d]=R8({defaultProp:n,onChange:i}),l=e!==void 0,u=l?e:a;{const v=L.useRef(e!==void 0);L.useEffect(()=>{const m=v.current;m!==l&&console.warn(`${s} is changing from ${m?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=l},[l,s])}const c=L.useCallback(v=>{if(l){const m=A8(v)?v(e):v;m!==e&&d.current?.(m)}else h(v)},[l,e,h,d]);return[u,c]}function R8({defaultProp:e,onChange:n}){const[i,s]=L.useState(e),a=L.useRef(i),h=L.useRef(n);return E8(()=>{h.current=n},[n]),L.useEffect(()=>{a.current!==i&&(h.current?.(i),a.current=i)},[i,a]),[i,s,h]}function A8(e){return typeof e=="function"}function D8(e){const n=L.useRef({value:e,previous:e});return L.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}var dC=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),T8="VisuallyHidden",M8=L.forwardRef((e,n)=>M.jsx(kt.span,{...e,ref:n,style:{...dC,...e.style}}));M8.displayName=T8;var O8=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Fo=new WeakMap,Mu=new WeakMap,Ou={},Cm=0,mC=function(e){return e&&(e.host||mC(e.parentNode))},L8=function(e,n){return n.map(function(i){if(e.contains(i))return i;var s=mC(i);return s&&e.contains(s)?s:(console.error("aria-hidden",i,"in not contained inside",e,". Doing nothing"),null)}).filter(function(i){return!!i})},N8=function(e,n,i,s){var a=L8(n,Array.isArray(e)?e:[e]);Ou[i]||(Ou[i]=new WeakMap);var h=Ou[i],d=[],l=new Set,u=new Set(a),c=function(m){!m||l.has(m)||(l.add(m),c(m.parentNode))};a.forEach(c);var v=function(m){!m||u.has(m)||Array.prototype.forEach.call(m.children,function(_){if(l.has(_))v(_);else try{var x=_.getAttribute(s),C=x!==null&&x!=="false",S=(Fo.get(_)||0)+1,p=(h.get(_)||0)+1;Fo.set(_,S),h.set(_,p),d.push(_),S===1&&C&&Mu.set(_,!0),p===1&&_.setAttribute(i,"true"),C||_.setAttribute(s,"true")}catch(g){console.error("aria-hidden: cannot operate on ",_,g)}})};return v(n),l.clear(),Cm++,function(){d.forEach(function(m){var _=Fo.get(m)-1,x=h.get(m)-1;Fo.set(m,_),h.set(m,x),_||(Mu.has(m)||m.removeAttribute(s),Mu.delete(m)),x||m.removeAttribute(i)}),Cm--,Cm||(Fo=new WeakMap,Fo=new WeakMap,Mu=new WeakMap,Ou={})}},k8=function(e,n,i){i===void 0&&(i="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),a=O8(e);return a?(s.push.apply(s,Array.from(a.querySelectorAll("[aria-live], script"))),N8(s,a,i,"aria-hidden")):function(){return null}},Hr=function(){return Hr=Object.assign||function(n){for(var i,s=1,a=arguments.length;s<a;s++){i=arguments[s];for(var h in i)Object.prototype.hasOwnProperty.call(i,h)&&(n[h]=i[h])}return n},Hr.apply(this,arguments)};function pC(e,n){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&n.indexOf(s)<0&&(i[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)n.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(i[s[a]]=e[s[a]]);return i}function B8(e,n,i){if(i||arguments.length===2)for(var s=0,a=n.length,h;s<a;s++)(h||!(s in n))&&(h||(h=Array.prototype.slice.call(n,0,s)),h[s]=n[s]);return e.concat(h||Array.prototype.slice.call(n))}var Vu="right-scroll-bar-position",qu="width-before-scroll-bar",j8="with-scroll-bars-hidden",H8="--removed-body-scroll-bar-size";function Em(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function P8(e,n){var i=L.useState(function(){return{value:e,callback:n,facade:{get current(){return i.value},set current(s){var a=i.value;a!==s&&(i.value=s,i.callback(s,a))}}}})[0];return i.callback=n,i.facade}var z8=typeof window<"u"?L.useLayoutEffect:L.useEffect,kS=new WeakMap;function I8(e,n){var i=P8(null,function(s){return e.forEach(function(a){return Em(a,s)})});return z8(function(){var s=kS.get(i);if(s){var a=new Set(s),h=new Set(e),d=i.current;a.forEach(function(l){h.has(l)||Em(l,null)}),h.forEach(function(l){a.has(l)||Em(l,d)})}kS.set(i,e)},[e]),i}function U8(e){return e}function F8(e,n){n===void 0&&(n=U8);var i=[],s=!1,a={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:e},useMedium:function(h){var d=n(h,s);return i.push(d),function(){i=i.filter(function(l){return l!==d})}},assignSyncMedium:function(h){for(s=!0;i.length;){var d=i;i=[],d.forEach(h)}i={push:function(l){return h(l)},filter:function(){return i}}},assignMedium:function(h){s=!0;var d=[];if(i.length){var l=i;i=[],l.forEach(h),d=i}var u=function(){var v=d;d=[],v.forEach(h)},c=function(){return Promise.resolve().then(u)};c(),i={push:function(v){d.push(v),c()},filter:function(v){return d=d.filter(v),i}}}};return a}function $8(e){e===void 0&&(e={});var n=F8(null);return n.options=Hr({async:!0,ssr:!1},e),n}var gC=function(e){var n=e.sideCar,i=pC(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=n.read();if(!s)throw new Error("Sidecar medium not found");return L.createElement(s,Hr({},i))};gC.isSideCarExport=!0;function V8(e,n){return e.useMedium(n),gC}var vC=$8(),Rm=function(){},Bh=L.forwardRef(function(e,n){var i=L.useRef(null),s=L.useState({onScrollCapture:Rm,onWheelCapture:Rm,onTouchMoveCapture:Rm}),a=s[0],h=s[1],d=e.forwardProps,l=e.children,u=e.className,c=e.removeScrollBar,v=e.enabled,m=e.shards,_=e.sideCar,x=e.noRelative,C=e.noIsolation,S=e.inert,p=e.allowPinchZoom,g=e.as,b=g===void 0?"div":g,y=e.gapMode,E=pC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=_,O=I8([i,n]),D=Hr(Hr({},E),a);return L.createElement(L.Fragment,null,v&&L.createElement(T,{sideCar:vC,removeScrollBar:c,shards:m,noRelative:x,noIsolation:C,inert:S,setCallbacks:h,allowPinchZoom:!!p,lockRef:i,gapMode:y}),d?L.cloneElement(L.Children.only(l),Hr(Hr({},D),{ref:O})):L.createElement(b,Hr({},D,{className:u,ref:O}),l))});Bh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bh.classNames={fullWidth:qu,zeroRight:Vu};var q8=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function W8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=q8();return n&&e.setAttribute("nonce",n),e}function Y8(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function K8(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var G8=function(){var e=0,n=null;return{add:function(i){e==0&&(n=W8())&&(Y8(n,i),K8(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},X8=function(){var e=G8();return function(n,i){L.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&i])}},_C=function(){var e=X8(),n=function(i){var s=i.styles,a=i.dynamic;return e(s,a),null};return n},Q8={left:0,top:0,right:0,gap:0},Am=function(e){return parseInt(e||"",10)||0},Z8=function(e){var n=window.getComputedStyle(document.body),i=n[e==="padding"?"paddingLeft":"marginLeft"],s=n[e==="padding"?"paddingTop":"marginTop"],a=n[e==="padding"?"paddingRight":"marginRight"];return[Am(i),Am(s),Am(a)]},J8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Q8;var n=Z8(e),i=document.documentElement.clientWidth,s=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,s-i+n[2]-n[0])}},eH=_C(),Jo="data-scroll-locked",tH=function(e,n,i,s){var a=e.left,h=e.top,d=e.right,l=e.gap;return i===void 0&&(i="margin"),`
|
|
19
|
-
.`.concat(j8,` {
|
|
20
|
-
overflow: hidden `).concat(s,`;
|
|
21
|
-
padding-right: `).concat(l,"px ").concat(s,`;
|
|
22
|
-
}
|
|
23
|
-
body[`).concat(Jo,`] {
|
|
24
|
-
overflow: hidden `).concat(s,`;
|
|
25
|
-
overscroll-behavior: contain;
|
|
26
|
-
`).concat([n&&"position: relative ".concat(s,";"),i==="margin"&&`
|
|
27
|
-
padding-left: `.concat(a,`px;
|
|
28
|
-
padding-top: `).concat(h,`px;
|
|
29
|
-
padding-right: `).concat(d,`px;
|
|
30
|
-
margin-left:0;
|
|
31
|
-
margin-top:0;
|
|
32
|
-
margin-right: `).concat(l,"px ").concat(s,`;
|
|
33
|
-
`),i==="padding"&&"padding-right: ".concat(l,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.`).concat(Vu,` {
|
|
37
|
-
right: `).concat(l,"px ").concat(s,`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.`).concat(qu,` {
|
|
41
|
-
margin-right: `).concat(l,"px ").concat(s,`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.`).concat(Vu," .").concat(Vu,` {
|
|
45
|
-
right: 0 `).concat(s,`;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.`).concat(qu," .").concat(qu,` {
|
|
49
|
-
margin-right: 0 `).concat(s,`;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
body[`).concat(Jo,`] {
|
|
53
|
-
`).concat(H8,": ").concat(l,`px;
|
|
54
|
-
}
|
|
55
|
-
`)},BS=function(){var e=parseInt(document.body.getAttribute(Jo)||"0",10);return isFinite(e)?e:0},nH=function(){L.useEffect(function(){return document.body.setAttribute(Jo,(BS()+1).toString()),function(){var e=BS()-1;e<=0?document.body.removeAttribute(Jo):document.body.setAttribute(Jo,e.toString())}},[])},rH=function(e){var n=e.noRelative,i=e.noImportant,s=e.gapMode,a=s===void 0?"margin":s;nH();var h=L.useMemo(function(){return J8(a)},[a]);return L.createElement(eH,{styles:tH(h,!n,a,i?"":"!important")})},sp=!1;if(typeof window<"u")try{var Lu=Object.defineProperty({},"passive",{get:function(){return sp=!0,!0}});window.addEventListener("test",Lu,Lu),window.removeEventListener("test",Lu,Lu)}catch{sp=!1}var $o=sp?{passive:!1}:!1,iH=function(e){return e.tagName==="TEXTAREA"},yC=function(e,n){if(!(e instanceof Element))return!1;var i=window.getComputedStyle(e);return i[n]!=="hidden"&&!(i.overflowY===i.overflowX&&!iH(e)&&i[n]==="visible")},sH=function(e){return yC(e,"overflowY")},oH=function(e){return yC(e,"overflowX")},jS=function(e,n){var i=n.ownerDocument,s=n;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var a=bC(e,s);if(a){var h=SC(e,s),d=h[1],l=h[2];if(d>l)return!0}s=s.parentNode}while(s&&s!==i.body);return!1},aH=function(e){var n=e.scrollTop,i=e.scrollHeight,s=e.clientHeight;return[n,i,s]},lH=function(e){var n=e.scrollLeft,i=e.scrollWidth,s=e.clientWidth;return[n,i,s]},bC=function(e,n){return e==="v"?sH(n):oH(n)},SC=function(e,n){return e==="v"?aH(n):lH(n)},cH=function(e,n){return e==="h"&&n==="rtl"?-1:1},uH=function(e,n,i,s,a){var h=cH(e,window.getComputedStyle(n).direction),d=h*s,l=i.target,u=n.contains(l),c=!1,v=d>0,m=0,_=0;do{if(!l)break;var x=SC(e,l),C=x[0],S=x[1],p=x[2],g=S-p-h*C;(C||g)&&bC(e,l)&&(m+=g,_+=C);var b=l.parentNode;l=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!u&&l!==document.body||u&&(n.contains(l)||n===l));return(v&&Math.abs(m)<1||!v&&Math.abs(_)<1)&&(c=!0),c},Nu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},HS=function(e){return[e.deltaX,e.deltaY]},PS=function(e){return e&&"current"in e?e.current:e},hH=function(e,n){return e[0]===n[0]&&e[1]===n[1]},fH=function(e){return`
|
|
56
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
57
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
58
|
-
`)},dH=0,Vo=[];function mH(e){var n=L.useRef([]),i=L.useRef([0,0]),s=L.useRef(),a=L.useState(dH++)[0],h=L.useState(_C)[0],d=L.useRef(e);L.useEffect(function(){d.current=e},[e]),L.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var S=B8([e.lockRef.current],(e.shards||[]).map(PS),!0).filter(Boolean);return S.forEach(function(p){return p.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),S.forEach(function(p){return p.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=L.useCallback(function(S,p){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var g=Nu(S),b=i.current,y="deltaX"in S?S.deltaX:b[0]-g[0],E="deltaY"in S?S.deltaY:b[1]-g[1],T,O=S.target,D=Math.abs(y)>Math.abs(E)?"h":"v";if("touches"in S&&D==="h"&&O.type==="range")return!1;var A=window.getSelection(),N=A&&A.anchorNode,q=N?N===O||N.contains(O):!1;if(q)return!1;var P=jS(D,O);if(!P)return!0;if(P?T=D:(T=D==="v"?"h":"v",P=jS(D,O)),!P)return!1;if(!s.current&&"changedTouches"in S&&(y||E)&&(s.current=T),!T)return!0;var z=s.current||T;return uH(z,p,S,z==="h"?y:E)},[]),u=L.useCallback(function(S){var p=S;if(!(!Vo.length||Vo[Vo.length-1]!==h)){var g="deltaY"in p?HS(p):Nu(p),b=n.current.filter(function(T){return T.name===p.type&&(T.target===p.target||p.target===T.shadowParent)&&hH(T.delta,g)})[0];if(b&&b.should){p.cancelable&&p.preventDefault();return}if(!b){var y=(d.current.shards||[]).map(PS).filter(Boolean).filter(function(T){return T.contains(p.target)}),E=y.length>0?l(p,y[0]):!d.current.noIsolation;E&&p.cancelable&&p.preventDefault()}}},[]),c=L.useCallback(function(S,p,g,b){var y={name:S,delta:p,target:g,should:b,shadowParent:pH(g)};n.current.push(y),setTimeout(function(){n.current=n.current.filter(function(E){return E!==y})},1)},[]),v=L.useCallback(function(S){i.current=Nu(S),s.current=void 0},[]),m=L.useCallback(function(S){c(S.type,HS(S),S.target,l(S,e.lockRef.current))},[]),_=L.useCallback(function(S){c(S.type,Nu(S),S.target,l(S,e.lockRef.current))},[]);L.useEffect(function(){return Vo.push(h),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:_}),document.addEventListener("wheel",u,$o),document.addEventListener("touchmove",u,$o),document.addEventListener("touchstart",v,$o),function(){Vo=Vo.filter(function(S){return S!==h}),document.removeEventListener("wheel",u,$o),document.removeEventListener("touchmove",u,$o),document.removeEventListener("touchstart",v,$o)}},[]);var x=e.removeScrollBar,C=e.inert;return L.createElement(L.Fragment,null,C?L.createElement(h,{styles:fH(a)}):null,x?L.createElement(rH,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function pH(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const gH=V8(vC,mH);var xC=L.forwardRef(function(e,n){return L.createElement(Bh,Hr({},e,{ref:n,sideCar:gH}))});xC.classNames=Bh.classNames;var vH=[" ","Enter","ArrowUp","ArrowDown"],_H=[" ","Enter"],Xs="Select",[jh,Hh,yH]=b6(Xs),[da]=og(Xs,[yH,rC]),Ph=rC(),[bH,ms]=da(Xs),[SH,xH]=da(Xs),wC=e=>{const{__scopeSelect:n,children:i,open:s,defaultOpen:a,onOpenChange:h,value:d,defaultValue:l,onValueChange:u,dir:c,name:v,autoComplete:m,disabled:_,required:x,form:C}=e,S=Ph(n),[p,g]=L.useState(null),[b,y]=L.useState(null),[E,T]=L.useState(!1),O=x6(c),[D,A]=NS({prop:s,defaultProp:a??!1,onChange:h,caller:Xs}),[N,q]=NS({prop:d,defaultProp:l,onChange:u,caller:Xs}),P=L.useRef(null),z=p?C||!!p.closest("form"):!0,[W,U]=L.useState(new Set),G=Array.from(W).map(H=>H.props.value).join(";");return M.jsx(m8,{...S,children:M.jsxs(bH,{required:x,scope:n,trigger:p,onTriggerChange:g,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:E,onValueNodeHasChildrenChange:T,contentId:ag(),value:N,onValueChange:q,open:D,onOpenChange:A,dir:O,triggerPointerDownPosRef:P,disabled:_,children:[M.jsx(jh.Provider,{scope:n,children:M.jsx(SH,{scope:e.__scopeSelect,onNativeOptionAdd:L.useCallback(H=>{U(K=>new Set(K).add(H))},[]),onNativeOptionRemove:L.useCallback(H=>{U(K=>{const F=new Set(K);return F.delete(H),F})},[]),children:i})}),z?M.jsxs(YC,{"aria-hidden":!0,required:x,tabIndex:-1,name:v,autoComplete:m,value:N,onChange:H=>q(H.target.value),disabled:_,form:C,children:[N===void 0?M.jsx("option",{value:""}):null,Array.from(W)]},G):null]})})};wC.displayName=Xs;var CC="SelectTrigger",EC=L.forwardRef((e,n)=>{const{__scopeSelect:i,disabled:s=!1,...a}=e,h=Ph(i),d=ms(CC,i),l=d.disabled||s,u=an(n,d.onTriggerChange),c=Hh(i),v=L.useRef("touch"),[m,_,x]=GC(S=>{const p=c().filter(y=>!y.disabled),g=p.find(y=>y.value===d.value),b=XC(p,S,g);b!==void 0&&d.onValueChange(b.value)}),C=S=>{l||(d.onOpenChange(!0),x()),S&&(d.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return M.jsx(p8,{asChild:!0,...h,children:M.jsx(kt.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":KC(d.value)?"":void 0,...a,ref:u,onClick:It(a.onClick,S=>{S.currentTarget.focus(),v.current!=="mouse"&&C(S)}),onPointerDown:It(a.onPointerDown,S=>{v.current=S.pointerType;const p=S.target;p.hasPointerCapture(S.pointerId)&&p.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(C(S),S.preventDefault())}),onKeyDown:It(a.onKeyDown,S=>{const p=m.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&_(S.key),!(p&&S.key===" ")&&vH.includes(S.key)&&(C(),S.preventDefault())})})})});EC.displayName=CC;var RC="SelectValue",AC=L.forwardRef((e,n)=>{const{__scopeSelect:i,className:s,style:a,children:h,placeholder:d="",...l}=e,u=ms(RC,i),{onValueNodeHasChildrenChange:c}=u,v=h!==void 0,m=an(n,u.onValueNodeChange);return Tn(()=>{c(v)},[c,v]),M.jsx(kt.span,{...l,ref:m,style:{pointerEvents:"none"},children:KC(u.value)?M.jsx(M.Fragment,{children:d}):h})});AC.displayName=RC;var wH="SelectIcon",DC=L.forwardRef((e,n)=>{const{__scopeSelect:i,children:s,...a}=e;return M.jsx(kt.span,{"aria-hidden":!0,...a,ref:n,children:s||"▼"})});DC.displayName=wH;var CH="SelectPortal",TC=e=>M.jsx(fC,{asChild:!0,...e});TC.displayName=CH;var Qs="SelectContent",MC=L.forwardRef((e,n)=>{const i=ms(Qs,e.__scopeSelect),[s,a]=L.useState();if(Tn(()=>{a(new DocumentFragment)},[]),!i.open){const h=s;return h?to.createPortal(M.jsx(OC,{scope:e.__scopeSelect,children:M.jsx(jh.Slot,{scope:e.__scopeSelect,children:M.jsx("div",{children:e.children})})}),h):null}return M.jsx(LC,{...e,ref:n})});MC.displayName=Qs;var pr=10,[OC,ps]=da(Qs),EH="SelectContentImpl",RH=y8("SelectContent.RemoveScroll"),LC=L.forwardRef((e,n)=>{const{__scopeSelect:i,position:s="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:h,onPointerDownOutside:d,side:l,sideOffset:u,align:c,alignOffset:v,arrowPadding:m,collisionBoundary:_,collisionPadding:x,sticky:C,hideWhenDetached:S,avoidCollisions:p,...g}=e,b=ms(Qs,i),[y,E]=L.useState(null),[T,O]=L.useState(null),D=an(n,X=>E(X)),[A,N]=L.useState(null),[q,P]=L.useState(null),z=Hh(i),[W,U]=L.useState(!1),G=L.useRef(!1);L.useEffect(()=>{if(y)return k8(y)},[y]),z6();const H=L.useCallback(X=>{const[V,...ie]=z().map(le=>le.ref.current),[de]=ie.slice(-1),re=document.activeElement;for(const le of X)if(le===re||(le?.scrollIntoView({block:"nearest"}),le===V&&T&&(T.scrollTop=0),le===de&&T&&(T.scrollTop=T.scrollHeight),le?.focus(),document.activeElement!==re))return},[z,T]),K=L.useCallback(()=>H([A,y]),[H,A,y]);L.useEffect(()=>{W&&K()},[W,K]);const{onOpenChange:F,triggerPointerDownPosRef:k}=b;L.useEffect(()=>{if(y){let X={x:0,y:0};const V=de=>{X={x:Math.abs(Math.round(de.pageX)-(k.current?.x??0)),y:Math.abs(Math.round(de.pageY)-(k.current?.y??0))}},ie=de=>{X.x<=10&&X.y<=10?de.preventDefault():y.contains(de.target)||F(!1),document.removeEventListener("pointermove",V),k.current=null};return k.current!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",ie,{capture:!0})}}},[y,F,k]),L.useEffect(()=>{const X=()=>F(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[F]);const[$,B]=GC(X=>{const V=z().filter(re=>!re.disabled),ie=V.find(re=>re.ref.current===document.activeElement),de=XC(V,X,ie);de&&setTimeout(()=>de.ref.current.focus())}),I=L.useCallback((X,V,ie)=>{const de=!G.current&&!ie;(b.value!==void 0&&b.value===V||de)&&(N(X),de&&(G.current=!0))},[b.value]),Q=L.useCallback(()=>y?.focus(),[y]),J=L.useCallback((X,V,ie)=>{const de=!G.current&&!ie;(b.value!==void 0&&b.value===V||de)&&P(X)},[b.value]),ae=s==="popper"?op:NC,Z=ae===op?{side:l,sideOffset:u,align:c,alignOffset:v,arrowPadding:m,collisionBoundary:_,collisionPadding:x,sticky:C,hideWhenDetached:S,avoidCollisions:p}:{};return M.jsx(OC,{scope:i,content:y,viewport:T,onViewportChange:O,itemRefCallback:I,selectedItem:A,onItemLeave:Q,itemTextRefCallback:J,focusSelectedItem:K,selectedItemText:q,position:s,isPositioned:W,searchRef:$,children:M.jsx(xC,{as:RH,allowPinchZoom:!0,children:M.jsx(F1,{asChild:!0,trapped:b.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:It(a,X=>{b.trigger?.focus({preventScroll:!0}),X.preventDefault()}),children:M.jsx(I1,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:M.jsx(ae,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:X=>X.preventDefault(),...g,...Z,onPlaced:()=>U(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:It(g.onKeyDown,X=>{const V=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!V&&X.key.length===1&&B(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let de=z().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes(X.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const re=X.target,le=de.indexOf(re);de=de.slice(le+1)}setTimeout(()=>H(de)),X.preventDefault()}})})})})})})});LC.displayName=EH;var AH="SelectItemAlignedPosition",NC=L.forwardRef((e,n)=>{const{__scopeSelect:i,onPlaced:s,...a}=e,h=ms(Qs,i),d=ps(Qs,i),[l,u]=L.useState(null),[c,v]=L.useState(null),m=an(n,D=>v(D)),_=Hh(i),x=L.useRef(!1),C=L.useRef(!0),{viewport:S,selectedItem:p,selectedItemText:g,focusSelectedItem:b}=d,y=L.useCallback(()=>{if(h.trigger&&h.valueNode&&l&&c&&S&&p&&g){const D=h.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),N=h.valueNode.getBoundingClientRect(),q=g.getBoundingClientRect();if(h.dir!=="rtl"){const re=q.left-A.left,le=N.left-re,_e=D.left-le,Ee=D.width+_e,He=Math.max(Ee,A.width),ke=window.innerWidth-pr,Ce=dS(le,[pr,Math.max(pr,ke-He)]);l.style.minWidth=Ee+"px",l.style.left=Ce+"px"}else{const re=A.right-q.right,le=window.innerWidth-N.right-re,_e=window.innerWidth-D.right-le,Ee=D.width+_e,He=Math.max(Ee,A.width),ke=window.innerWidth-pr,Ce=dS(le,[pr,Math.max(pr,ke-He)]);l.style.minWidth=Ee+"px",l.style.right=Ce+"px"}const P=_(),z=window.innerHeight-pr*2,W=S.scrollHeight,U=window.getComputedStyle(c),G=parseInt(U.borderTopWidth,10),H=parseInt(U.paddingTop,10),K=parseInt(U.borderBottomWidth,10),F=parseInt(U.paddingBottom,10),k=G+H+W+F+K,$=Math.min(p.offsetHeight*5,k),B=window.getComputedStyle(S),I=parseInt(B.paddingTop,10),Q=parseInt(B.paddingBottom,10),J=D.top+D.height/2-pr,ae=z-J,Z=p.offsetHeight/2,X=p.offsetTop+Z,V=G+H+X,ie=k-V;if(V<=J){const re=P.length>0&&p===P[P.length-1].ref.current;l.style.bottom="0px";const le=c.clientHeight-S.offsetTop-S.offsetHeight,_e=Math.max(ae,Z+(re?Q:0)+le+K),Ee=V+_e;l.style.height=Ee+"px"}else{const re=P.length>0&&p===P[0].ref.current;l.style.top="0px";const _e=Math.max(J,G+S.offsetTop+(re?I:0)+Z)+ie;l.style.height=_e+"px",S.scrollTop=V-J+S.offsetTop}l.style.margin=`${pr}px 0`,l.style.minHeight=$+"px",l.style.maxHeight=z+"px",s?.(),requestAnimationFrame(()=>x.current=!0)}},[_,h.trigger,h.valueNode,l,c,S,p,g,h.dir,s]);Tn(()=>y(),[y]);const[E,T]=L.useState();Tn(()=>{c&&T(window.getComputedStyle(c).zIndex)},[c]);const O=L.useCallback(D=>{D&&C.current===!0&&(y(),b?.(),C.current=!1)},[y,b]);return M.jsx(TH,{scope:i,contentWrapper:l,shouldExpandOnScrollRef:x,onScrollButtonChange:O,children:M.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:M.jsx(kt.div,{...a,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});NC.displayName=AH;var DH="SelectPopperPosition",op=L.forwardRef((e,n)=>{const{__scopeSelect:i,align:s="start",collisionPadding:a=pr,...h}=e,d=Ph(i);return M.jsx(g8,{...d,...h,ref:n,align:s,collisionPadding:a,style:{boxSizing:"border-box",...h.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});op.displayName=DH;var[TH,gg]=da(Qs,{}),ap="SelectViewport",kC=L.forwardRef((e,n)=>{const{__scopeSelect:i,nonce:s,...a}=e,h=ps(ap,i),d=gg(ap,i),l=an(n,h.onViewportChange),u=L.useRef(0);return M.jsxs(M.Fragment,{children:[M.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),M.jsx(jh.Slot,{scope:i,children:M.jsx(kt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:It(a.onScroll,c=>{const v=c.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:_}=d;if(_?.current&&m){const x=Math.abs(u.current-v.scrollTop);if(x>0){const C=window.innerHeight-pr*2,S=parseFloat(m.style.minHeight),p=parseFloat(m.style.height),g=Math.max(S,p);if(g<C){const b=g+x,y=Math.min(C,b),E=b-y;m.style.height=y+"px",m.style.bottom==="0px"&&(v.scrollTop=E>0?E:0,m.style.justifyContent="flex-end")}}}u.current=v.scrollTop})})})]})});kC.displayName=ap;var BC="SelectGroup",[MH,OH]=da(BC),LH=L.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,a=ag();return M.jsx(MH,{scope:i,id:a,children:M.jsx(kt.div,{role:"group","aria-labelledby":a,...s,ref:n})})});LH.displayName=BC;var jC="SelectLabel",HC=L.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,a=OH(jC,i);return M.jsx(kt.div,{id:a.id,...s,ref:n})});HC.displayName=jC;var dh="SelectItem",[NH,PC]=da(dh),zC=L.forwardRef((e,n)=>{const{__scopeSelect:i,value:s,disabled:a=!1,textValue:h,...d}=e,l=ms(dh,i),u=ps(dh,i),c=l.value===s,[v,m]=L.useState(h??""),[_,x]=L.useState(!1),C=an(n,b=>u.itemRefCallback?.(b,s,a)),S=ag(),p=L.useRef("touch"),g=()=>{a||(l.onValueChange(s),l.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return M.jsx(NH,{scope:i,value:s,disabled:a,textId:S,isSelected:c,onItemTextChange:L.useCallback(b=>{m(y=>y||(b?.textContent??"").trim())},[]),children:M.jsx(jh.ItemSlot,{scope:i,value:s,disabled:a,textValue:v,children:M.jsx(kt.div,{role:"option","aria-labelledby":S,"data-highlighted":_?"":void 0,"aria-selected":c&&_,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...d,ref:C,onFocus:It(d.onFocus,()=>x(!0)),onBlur:It(d.onBlur,()=>x(!1)),onClick:It(d.onClick,()=>{p.current!=="mouse"&&g()}),onPointerUp:It(d.onPointerUp,()=>{p.current==="mouse"&&g()}),onPointerDown:It(d.onPointerDown,b=>{p.current=b.pointerType}),onPointerMove:It(d.onPointerMove,b=>{p.current=b.pointerType,a?u.onItemLeave?.():p.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:It(d.onPointerLeave,b=>{b.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:It(d.onKeyDown,b=>{u.searchRef?.current!==""&&b.key===" "||(_H.includes(b.key)&&g(),b.key===" "&&b.preventDefault())})})})})});zC.displayName=dh;var gl="SelectItemText",IC=L.forwardRef((e,n)=>{const{__scopeSelect:i,className:s,style:a,...h}=e,d=ms(gl,i),l=ps(gl,i),u=PC(gl,i),c=xH(gl,i),[v,m]=L.useState(null),_=an(n,g=>m(g),u.onItemTextChange,g=>l.itemTextRefCallback?.(g,u.value,u.disabled)),x=v?.textContent,C=L.useMemo(()=>M.jsx("option",{value:u.value,disabled:u.disabled,children:x},u.value),[u.disabled,u.value,x]),{onNativeOptionAdd:S,onNativeOptionRemove:p}=c;return Tn(()=>(S(C),()=>p(C)),[S,p,C]),M.jsxs(M.Fragment,{children:[M.jsx(kt.span,{id:u.textId,...h,ref:_}),u.isSelected&&d.valueNode&&!d.valueNodeHasChildren?to.createPortal(h.children,d.valueNode):null]})});IC.displayName=gl;var UC="SelectItemIndicator",FC=L.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e;return PC(UC,i).isSelected?M.jsx(kt.span,{"aria-hidden":!0,...s,ref:n}):null});FC.displayName=UC;var lp="SelectScrollUpButton",$C=L.forwardRef((e,n)=>{const i=ps(lp,e.__scopeSelect),s=gg(lp,e.__scopeSelect),[a,h]=L.useState(!1),d=an(n,s.onScrollButtonChange);return Tn(()=>{if(i.viewport&&i.isPositioned){let l=function(){const c=u.scrollTop>0;h(c)};const u=i.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[i.viewport,i.isPositioned]),a?M.jsx(qC,{...e,ref:d,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=i;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});$C.displayName=lp;var cp="SelectScrollDownButton",VC=L.forwardRef((e,n)=>{const i=ps(cp,e.__scopeSelect),s=gg(cp,e.__scopeSelect),[a,h]=L.useState(!1),d=an(n,s.onScrollButtonChange);return Tn(()=>{if(i.viewport&&i.isPositioned){let l=function(){const c=u.scrollHeight-u.clientHeight,v=Math.ceil(u.scrollTop)<c;h(v)};const u=i.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[i.viewport,i.isPositioned]),a?M.jsx(qC,{...e,ref:d,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=i;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});VC.displayName=cp;var qC=L.forwardRef((e,n)=>{const{__scopeSelect:i,onAutoScroll:s,...a}=e,h=ps("SelectScrollButton",i),d=L.useRef(null),l=Hh(i),u=L.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return L.useEffect(()=>()=>u(),[u]),Tn(()=>{l().find(v=>v.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),M.jsx(kt.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:It(a.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(s,50))}),onPointerMove:It(a.onPointerMove,()=>{h.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(s,50))}),onPointerLeave:It(a.onPointerLeave,()=>{u()})})}),kH="SelectSeparator",WC=L.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e;return M.jsx(kt.div,{"aria-hidden":!0,...s,ref:n})});WC.displayName=kH;var up="SelectArrow",BH=L.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,a=Ph(i),h=ms(up,i),d=ps(up,i);return h.open&&d.position==="popper"?M.jsx(v8,{...a,...s,ref:n}):null});BH.displayName=up;var jH="SelectBubbleInput",YC=L.forwardRef(({__scopeSelect:e,value:n,...i},s)=>{const a=L.useRef(null),h=an(s,a),d=D8(n);return L.useEffect(()=>{const l=a.current;if(!l)return;const u=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(u,"value").set;if(d!==n&&v){const m=new Event("change",{bubbles:!0});v.call(l,n),l.dispatchEvent(m)}},[d,n]),M.jsx(kt.select,{...i,style:{...dC,...i.style},ref:h,defaultValue:n})});YC.displayName=jH;function KC(e){return e===""||e===void 0}function GC(e){const n=Ks(e),i=L.useRef(""),s=L.useRef(0),a=L.useCallback(d=>{const l=i.current+d;n(l),(function u(c){i.current=c,window.clearTimeout(s.current),c!==""&&(s.current=window.setTimeout(()=>u(""),1e3))})(l)},[n]),h=L.useCallback(()=>{i.current="",window.clearTimeout(s.current)},[]);return L.useEffect(()=>()=>window.clearTimeout(s.current),[]),[i,a,h]}function XC(e,n,i){const a=n.length>1&&Array.from(n).every(c=>c===n[0])?n[0]:n,h=i?e.indexOf(i):-1;let d=HH(e,Math.max(h,0));a.length===1&&(d=d.filter(c=>c!==i));const u=d.find(c=>c.textValue.toLowerCase().startsWith(a.toLowerCase()));return u!==i?u:void 0}function HH(e,n){return e.map((i,s)=>e[(n+s)%e.length])}var PH=wC,QC=EC,zH=AC,IH=DC,UH=TC,ZC=MC,FH=kC,JC=HC,eE=zC,$H=IC,VH=FC,tE=$C,nE=VC,rE=WC;const zS=PH,IS=zH,hp=L.forwardRef(({className:e,children:n,...i},s)=>M.jsxs(QC,{ref:s,className:ze("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...i,children:[n,M.jsx(IH,{asChild:!0,children:M.jsx(B1,{className:"h-4 w-4 opacity-50"})})]}));hp.displayName=QC.displayName;const iE=L.forwardRef(({className:e,...n},i)=>M.jsx(tE,{ref:i,className:ze("flex cursor-default items-center justify-center py-1",e),...n,children:M.jsx(NB,{className:"h-4 w-4"})}));iE.displayName=tE.displayName;const sE=L.forwardRef(({className:e,...n},i)=>M.jsx(nE,{ref:i,className:ze("flex cursor-default items-center justify-center py-1",e),...n,children:M.jsx(B1,{className:"h-4 w-4"})}));sE.displayName=nE.displayName;const fp=L.forwardRef(({className:e,children:n,position:i="popper",...s},a)=>M.jsx(UH,{children:M.jsxs(ZC,{ref:a,className:ze("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",i==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:i,...s,children:[M.jsx(iE,{}),M.jsx(FH,{className:ze("p-1",i==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),M.jsx(sE,{})]})}));fp.displayName=ZC.displayName;const qH=L.forwardRef(({className:e,...n},i)=>M.jsx(JC,{ref:i,className:ze("px-2 py-1.5 text-sm font-semibold",e),...n}));qH.displayName=JC.displayName;const vl=L.forwardRef(({className:e,children:n,...i},s)=>M.jsxs(eE,{ref:s,className:ze("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...i,children:[M.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:M.jsx(VH,{children:M.jsx(MB,{className:"h-4 w-4"})})}),M.jsx($H,{children:n})]}));vl.displayName=eE.displayName;const WH=L.forwardRef(({className:e,...n},i)=>M.jsx(rE,{ref:i,className:ze("-mx-1 my-1 h-px bg-muted",e),...n}));WH.displayName=rE.displayName;const YH={"claude-code":{command:"claude",defaultArgs:[],modeArgs:{normal:[],continue:["-c"],resume:["-r"]},permissionSkipArgs:["--dangerously-skip-permissions"]},"codex-cli":{command:"codex",defaultArgs:["--auto-approve","--verbose"],modeArgs:{normal:[],continue:["resume","--last"],resume:["resume"]}}};function KH({branch:e,availableTools:n,selectedToolId:i,selectedMode:s,skipPermissions:a,extraArgsText:h,isConfigLoading:d,configError:l,isStartingSession:u,isSyncingBranch:c,needsRemoteSync:v,hasConflictingDivergence:m,onToolChange:_,onModeChange:x,onSkipPermissionsChange:C,onExtraArgsChange:S,onStartSession:p,onSyncBranch:g}){const b=!!e.worktreePath,y=n.find(O=>O.id===i),E=L.useMemo(()=>y?y.target==="custom"?{command:y.definition.command,defaultArgs:y.definition.defaultArgs??null,modeArgs:y.definition.modeArgs,permissionSkipArgs:y.definition.permissionSkipArgs??null}:YH[y.id]??null:null,[y]),T=L.useMemo(()=>{if(!E)return null;const O=[];E.defaultArgs?.length&&O.push(...E.defaultArgs);const D=E.modeArgs?.[s];D?.length&&O.push(...D),a&&E.permissionSkipArgs?.length&&O.push(...E.permissionSkipArgs);const A=h.split(/\s+/).map(N=>N.trim()).filter(Boolean);return A.length&&O.push(...A),{command:E.command,args:O}},[E,s,a,h]);return M.jsxs(Kt,{children:[M.jsxs(An,{className:"pb-3",children:[M.jsxs("div",{className:"flex items-center justify-between",children:[M.jsxs("div",{children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Tool Launcher"}),M.jsx("h3",{className:"mt-1 text-lg font-semibold",children:"Coding Agent"})]}),l&&M.jsx(pt,{variant:"warning",children:"設定の取得に失敗"})]}),M.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Web UI から直接 Coding Agent を起動できます。設定したカスタムエージェントも一覧に表示されます。"})]}),M.jsx(en,{className:"space-y-4",children:b?M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[M.jsxs("div",{className:"space-y-2",children:[M.jsx("label",{className:"text-sm font-medium",children:"Coding Agent"}),M.jsxs(zS,{value:i,onValueChange:_,disabled:d??!1,children:[M.jsx(hp,{children:M.jsx(IS,{placeholder:"Select Coding Agent"})}),M.jsx(fp,{children:n.map(O=>M.jsx(vl,{value:O.id,className:sg(O.id),children:O.label},O.id))})]})]}),M.jsxs("div",{className:"space-y-2",children:[M.jsx("label",{className:"text-sm font-medium",children:"起動モード"}),M.jsxs(zS,{value:s,onValueChange:O=>x(O),children:[M.jsx(hp,{children:M.jsx(IS,{})}),M.jsxs(fp,{children:[M.jsx(vl,{value:"normal",children:"Normal"}),M.jsx(vl,{value:"continue",children:"Continue"}),M.jsx(vl,{value:"resume",children:"Resume"})]})]})]}),M.jsxs("div",{className:"space-y-2 sm:col-span-2 lg:col-span-1",children:[M.jsx("label",{className:"text-sm font-medium",children:"追加引数"}),M.jsx(kl,{type:"text",value:h,onChange:O=>S(O.target.value),placeholder:"--flag value"})]})]}),M.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[M.jsx("input",{type:"checkbox",checked:a,onChange:O=>C(O.target.checked),className:"h-4 w-4 rounded border-border"}),M.jsx("span",{children:"権限チェックをスキップ (自己責任)"})]}),a&&M.jsx(wi,{variant:"warning",children:M.jsx(Ci,{children:"権限チェックをスキップすることで、CLI での `--dangerously-skip-permissions` 指定と同様のリスクを負います。"})}),v&&M.jsx(wi,{variant:"info","data-testid":"sync-required",children:M.jsxs(Ci,{children:[M.jsxs("p",{children:["リモートに未取得の更新 (",e.divergence?.behind??0," ","commits) があるため、Coding Agent を起動する前に同期してください。"]}),M.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"CLI の `git fetch --all` と `git pull --ff-only` と同じ処理を Web UI から実行できます。"})]})}),m&&M.jsx(wi,{variant:"warning","data-testid":"divergence-warning",children:M.jsxs(Ci,{children:[M.jsx("p",{children:"リモートとローカルの両方に未解決の差分があります。起動は可能ですが、 衝突を避けるために差分の解消を推奨します。"}),M.jsxs("ul",{className:"mt-2 list-inside list-disc text-xs text-muted-foreground",children:[M.jsxs("li",{children:["git fetch && git pull --ff-only origin ",e.name]}),M.jsxs("li",{children:["git push origin ",e.name," でローカル進捗を共有"]})]})]})}),M.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[M.jsx(Ut,{onClick:p,disabled:u||!y||v||c,children:u?"起動中...":"セッションを起動"}),M.jsx(Ut,{variant:"secondary",onClick:g,disabled:!e.worktreePath||c,children:c?"同期中...":"最新の変更を同期"}),M.jsx(Ut,{variant:"ghost",asChild:!0,children:M.jsx(_r,{to:"/config",children:"設定を編集"})})]}),E&&M.jsxs("div",{className:"space-y-2 rounded-lg border bg-muted/30 p-4",children:[M.jsxs("div",{className:"grid gap-2 text-sm sm:grid-cols-2",children:[M.jsxs("div",{children:[M.jsx("span",{className:"text-muted-foreground",children:"コマンド:"})," ",M.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono",children:E.command})]}),M.jsxs("div",{children:[M.jsx("span",{className:"text-muted-foreground",children:"defaultArgs:"})," ",M.jsx("span",{className:ze(!E.defaultArgs?.length&&"text-muted-foreground/50"),children:E.defaultArgs?.join(" ")||"未設定"})]})]}),T&&M.jsxs("div",{className:"border-t pt-2",children:[M.jsx("span",{className:"text-xs text-muted-foreground",children:"最終コマンド:"}),M.jsxs("pre",{className:"mt-1 overflow-x-auto rounded bg-background p-2 font-mono text-sm",children:[T.command," ",T.args.join(" ")]})]})]})]}):M.jsx("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"Worktreeが未作成のため、先にWorktreeを作成してください。"})})]})}function GH(e,n){return e==="claude-code"?"Claude":e==="codex-cli"?"Codex":e==="gemini-cli"?"Gemini":n||"Custom"}function XH(e){const n=e.mode==="normal"?"New":e.mode==="continue"?"Continue":e.mode==="resume"?"Resume":null;return[GH(e.toolId,e.toolLabel),n,e.model].filter(Boolean).join(" | ")}function QH(e){try{return new Intl.DateTimeFormat("ja-JP",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return"--"}}function ZH({branch:e,formattedCommitDate:n,latestToolUsage:i}){return M.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[M.jsxs(Kt,{children:[M.jsxs(An,{className:"pb-2",children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Branch Insights"}),M.jsx("h3",{className:"text-lg font-semibold",children:"ブランチインサイト"})]}),M.jsx(en,{children:M.jsxs("dl",{className:"grid gap-3 text-sm",children:[M.jsxs("div",{className:"flex justify-between border-b border-border/50 pb-2",children:[M.jsx("dt",{className:"text-muted-foreground",children:"コミット"}),M.jsx("dd",{className:"font-mono text-xs",children:e.commitHash})]}),M.jsxs("div",{className:"flex justify-between border-b border-border/50 pb-2",children:[M.jsx("dt",{className:"text-muted-foreground",children:"Author"}),M.jsx("dd",{children:e.author??"N/A"})]}),M.jsxs("div",{className:"flex justify-between border-b border-border/50 pb-2",children:[M.jsx("dt",{className:"text-muted-foreground",children:"更新日"}),M.jsx("dd",{children:n})]}),M.jsxs("div",{className:"flex justify-between",children:[M.jsx("dt",{className:"text-muted-foreground",children:"Worktree"}),M.jsx("dd",{className:"max-w-[200px] truncate text-right",title:e.worktreePath??void 0,children:e.worktreePath??"未作成"})]})]})})]}),M.jsxs(Kt,{children:[M.jsxs(An,{className:"pb-2",children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Latest Commit"}),M.jsx("h3",{className:"text-lg font-semibold",children:"コミット情報"})]}),M.jsx(en,{children:M.jsx("p",{className:"text-sm text-muted-foreground",children:e.commitMessage??"コミットメッセージがありません。"})})]}),e.divergence&&M.jsxs(Kt,{children:[M.jsxs(An,{className:"pb-2",children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Divergence"}),M.jsx("h3",{className:"text-lg font-semibold",children:"差分状況"})]}),M.jsx(en,{children:M.jsxs("div",{className:"flex flex-wrap gap-2",children:[M.jsxs(pt,{variant:"outline",children:["↑ Ahead ",e.divergence.ahead]}),M.jsxs(pt,{variant:"outline",children:["↓ Behind ",e.divergence.behind]}),M.jsx(pt,{variant:e.divergence.upToDate?"success":"warning",children:e.divergence.upToDate?"最新":"更新あり"})]})})]}),M.jsxs(Kt,{children:[M.jsxs(An,{className:"pb-2",children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Worktree"}),M.jsx("h3",{className:"text-lg font-semibold",children:"Worktree情報"})]}),M.jsxs(en,{className:"space-y-2 text-sm text-muted-foreground",children:[M.jsxs("p",{children:["パス:"," ",M.jsx("strong",{className:"text-foreground",children:e.worktreePath??"未作成"})]}),M.jsxs("ul",{className:"list-inside list-disc space-y-1 text-xs",children:[M.jsx("li",{children:"AIツールの起動にはクリーンなワークツリーであることを推奨"}),M.jsx("li",{children:"Worktree再作成で既存のローカル変更が失われる可能性あり"})]})]})]}),i&&M.jsxs(Kt,{className:"lg:col-span-2",children:[M.jsxs(An,{className:"pb-2",children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Last Activity"}),M.jsx("h3",{className:"text-lg font-semibold",children:"最終ツール使用"})]}),M.jsx(en,{children:M.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[M.jsx(pt,{variant:"outline",className:`${sg(i.toolId)} ${l6(i.toolId)}`,children:XH(i)}),M.jsx("span",{className:"text-muted-foreground",children:QH(i.timestamp)}),i.worktreePath&&M.jsxs("span",{className:"text-xs text-muted-foreground",children:["@ ",i.worktreePath]}),i.sessionId&&M.jsxs("span",{className:"text-xs text-muted-foreground",children:["Session ID:"," ",M.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono",children:i.sessionId})]})]})})]})]})}var Dm={exports:{}},US;function JH(){return US||(US=1,(function(e,n){(function(i,s){e.exports=s()})(globalThis,(()=>(()=>{var i={4567:function(d,l,u){var c=this&&this.__decorate||function(g,b,y,E){var T,O=arguments.length,D=O<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,b,y,E);else for(var A=g.length-1;A>=0;A--)(T=g[A])&&(D=(O<3?T(D):O>3?T(b,y,D):T(b,y))||D);return O>3&&D&&Object.defineProperty(b,y,D),D},v=this&&this.__param||function(g,b){return function(y,E){b(y,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const m=u(9042),_=u(9924),x=u(844),C=u(4725),S=u(2585);let p=l.AccessibilityManager=class extends x.Disposable{constructor(g,b,y,E){super(),this._terminal=g,this._coreBrowserService=y,this._renderService=E,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let T=0;T<this._terminal.rows;T++)this._rowElements[T]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[T]);if(this._topBoundaryFocusListener=T=>this._handleBoundaryFocus(T,0),this._bottomBoundaryFocusListener=T=>this._handleBoundaryFocus(T,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((T=>this._handleResize(T.rows)))),this.register(this._terminal.onRender((T=>this._refreshRows(T.start,T.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((T=>this._handleChar(T)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
59
|
-
`)))),this.register(this._terminal.onA11yTab((T=>this._handleTab(T)))),this.register(this._terminal.onKey((T=>this._handleKey(T.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(g){for(let b=0;b<g;b++)this._handleChar(" ")}_handleChar(g){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==g&&(this._charsToAnnounce+=g):this._charsToAnnounce+=g,g===`
|
|
60
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=m.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,b){this._liveRegionDebouncer.refresh(g,b,this._terminal.rows)}_renderRows(g,b){const y=this._terminal.buffer,E=y.lines.length.toString();for(let T=g;T<=b;T++){const O=y.translateBufferLineToString(y.ydisp+T,!0),D=(y.ydisp+T+1).toString(),A=this._rowElements[T];A&&(O.length===0?A.innerText=" ":A.textContent=O,A.setAttribute("aria-posinset",D),A.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(g,b){const y=g.target,E=this._rowElements[b===0?1:this._rowElements.length-2];if(y.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==E)return;let T,O;if(b===0?(T=y,O=this._rowElements.pop(),this._rowContainer.removeChild(O)):(T=this._rowElements.shift(),O=y,this._rowContainer.removeChild(T)),T.removeEventListener("focus",this._topBoundaryFocusListener),O.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const D=this._createAccessibilityTreeNode();this._rowElements.unshift(D),this._rowContainer.insertAdjacentElement("afterbegin",D)}else{const D=this._createAccessibilityTreeNode();this._rowElements.push(D),this._rowContainer.appendChild(D)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=this._coreBrowserService.mainDocument.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=p=c([v(1,S.IInstantiationService),v(2,C.ICoreBrowserService),v(3,C.IRenderService)],p)},3614:(d,l)=>{function u(_){return _.replace(/\r?\n/g,"\r")}function c(_,x){return x?"\x1B[200~"+_+"\x1B[201~":_}function v(_,x,C,S){_=c(_=u(_),C.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(_,!0),x.value=""}function m(_,x,C){const S=C.getBoundingClientRect(),p=_.clientX-S.left-10,g=_.clientY-S.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${p}px`,x.style.top=`${g}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=c,l.copyHandler=function(_,x){_.clipboardData&&_.clipboardData.setData("text/plain",x.selectionText),_.preventDefault()},l.handlePasteEvent=function(_,x,C,S){_.stopPropagation(),_.clipboardData&&v(_.clipboardData.getData("text/plain"),x,C,S)},l.paste=v,l.moveTextAreaUnderMouseCursor=m,l.rightClickHandler=function(_,x,C,S,p){m(_,x,C),p&&S.rightClickSelect(_),x.value=S.selectionText,x.select()}},7239:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const c=u(1505);l.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(v,m,_){this._css.set(v,m,_)}getCss(v,m){return this._css.get(v,m)}setColor(v,m,_){this._color.set(v,m,_)}getColor(v,m){return this._color.get(v,m)}clear(){this._color.clear(),this._css.clear()}}},3656:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,c,v,m){u.addEventListener(c,v,m);let _=!1;return{dispose:()=>{_||(_=!0,u.removeEventListener(c,v,m))}}}},6465:function(d,l,u){var c=this&&this.__decorate||function(p,g,b,y){var E,T=arguments.length,O=T<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,g,b,y);else for(var D=p.length-1;D>=0;D--)(E=p[D])&&(O=(T<3?E(O):T>3?E(g,b,O):E(g,b))||O);return T>3&&O&&Object.defineProperty(g,b,O),O},v=this&&this.__param||function(p,g){return function(b,y){g(b,y,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier2=void 0;const m=u(3656),_=u(8460),x=u(844),C=u(2585);let S=l.Linkifier2=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(p){super(),this._bufferService=p,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{this._lastMouseEvent=void 0}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0})))}registerLinkProvider(p){return this._linkProviders.push(p),{dispose:()=>{const g=this._linkProviders.indexOf(p);g!==-1&&this._linkProviders.splice(g,1)}}}attachToDom(p,g,b){this._element=p,this._mouseService=g,this._renderService=b,this.register((0,m.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,m.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(p){if(this._lastMouseEvent=p,!this._element||!this._mouseService)return;const g=this._positionFromMouseEvent(p,this._element,this._mouseService);if(!g)return;this._isMouseOut=!1;const b=p.composedPath();for(let y=0;y<b.length;y++){const E=b[y];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&g.x===this._lastBufferCell.x&&g.y===this._lastBufferCell.y||(this._handleHover(g),this._lastBufferCell=g)}_handleHover(p){if(this._activeLine!==p.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(p,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,p)||(this._clearCurrentLink(),this._askForLink(p,!0))}_askForLink(p,g){this._activeProviderReplies&&g||(this._activeProviderReplies?.forEach((y=>{y?.forEach((E=>{E.link.dispose&&E.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=p.y);let b=!1;for(const[y,E]of this._linkProviders.entries())g?this._activeProviderReplies?.get(y)&&(b=this._checkLinkProviderResult(y,p,b)):E.provideLinks(p.y,(T=>{if(this._isMouseOut)return;const O=T?.map((D=>({link:D})));this._activeProviderReplies?.set(y,O),b=this._checkLinkProviderResult(y,p,b),this._activeProviderReplies?.size===this._linkProviders.length&&this._removeIntersectingLinks(p.y,this._activeProviderReplies)}))}_removeIntersectingLinks(p,g){const b=new Set;for(let y=0;y<g.size;y++){const E=g.get(y);if(E)for(let T=0;T<E.length;T++){const O=E[T],D=O.link.range.start.y<p?0:O.link.range.start.x,A=O.link.range.end.y>p?this._bufferService.cols:O.link.range.end.x;for(let N=D;N<=A;N++){if(b.has(N)){E.splice(T--,1);break}b.add(N)}}}}_checkLinkProviderResult(p,g,b){if(!this._activeProviderReplies)return b;const y=this._activeProviderReplies.get(p);let E=!1;for(let T=0;T<p;T++)this._activeProviderReplies.has(T)&&!this._activeProviderReplies.get(T)||(E=!0);if(!E&&y){const T=y.find((O=>this._linkAtPosition(O.link,g)));T&&(b=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviders.length&&!b)for(let T=0;T<this._activeProviderReplies.size;T++){const O=this._activeProviderReplies.get(T)?.find((D=>this._linkAtPosition(D.link,g)));if(O){b=!0,this._handleNewLink(O);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(p){if(!this._element||!this._mouseService||!this._currentLink)return;const g=this._positionFromMouseEvent(p,this._element,this._mouseService);g&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,g)&&this._currentLink.link.activate(p,this._currentLink.link.text)}_clearCurrentLink(p,g){this._element&&this._currentLink&&this._lastMouseEvent&&(!p||!g||this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=g)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(p){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._linkAtPosition(p.link,g)&&(this._currentLink=p,this._currentLink.state={decorations:{underline:p.link.decorations===void 0||p.link.decorations.underline,pointerCursor:p.link.decorations===void 0||p.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,p.link,this._lastMouseEvent),p.link.decorations={},Object.defineProperties(p.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:b=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element?.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:b=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(p.link,b))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const y=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(y,E),this._lastMouseEvent&&this._element)){const T=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);T&&this._askForLink(T,!1)}}))))}_linkHover(p,g,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!0),this._currentLink.state.decorations.pointerCursor&&p.classList.add("xterm-cursor-pointer")),g.hover&&g.hover(b,g.text)}_fireUnderlineEvent(p,g){const b=p.range,y=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-y-1,b.end.x,b.end.y-y-1,void 0);(g?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(p,g,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!1),this._currentLink.state.decorations.pointerCursor&&p.classList.remove("xterm-cursor-pointer")),g.leave&&g.leave(b,g.text)}_linkAtPosition(p,g){const b=p.range.start.y*this._bufferService.cols+p.range.start.x,y=p.range.end.y*this._bufferService.cols+p.range.end.x,E=g.y*this._bufferService.cols+g.x;return b<=E&&E<=y}_positionFromMouseEvent(p,g,b){const y=b.getCoords(p,g,this._bufferService.cols,this._bufferService.rows);if(y)return{x:y[0],y:y[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(p,g,b,y,E){return{x1:p,y1:g,x2:b,y2:y,cols:this._bufferService.cols,fg:E}}};l.Linkifier2=S=c([v(0,C.IBufferService)],S)},9042:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(d,l,u){var c=this&&this.__decorate||function(S,p,g,b){var y,E=arguments.length,T=E<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,p,g,b);else for(var O=S.length-1;O>=0;O--)(y=S[O])&&(T=(E<3?y(T):E>3?y(p,g,T):y(p,g))||T);return E>3&&T&&Object.defineProperty(p,g,T),T},v=this&&this.__param||function(S,p){return function(g,b){p(g,b,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const m=u(511),_=u(2585);let x=l.OscLinkProvider=class{constructor(S,p,g){this._bufferService=S,this._optionsService=p,this._oscLinkService=g}provideLinks(S,p){const g=this._bufferService.buffer.lines.get(S-1);if(!g)return void p(void 0);const b=[],y=this._optionsService.rawOptions.linkHandler,E=new m.CellData,T=g.getTrimmedLength();let O=-1,D=-1,A=!1;for(let N=0;N<T;N++)if(D!==-1||g.hasContent(N)){if(g.loadCell(N,E),E.hasExtendedAttrs()&&E.extended.urlId){if(D===-1){D=N,O=E.extended.urlId;continue}A=E.extended.urlId!==O}else D!==-1&&(A=!0);if(A||D!==-1&&N===T-1){const q=this._oscLinkService.getLinkData(O)?.uri;if(q){const P={start:{x:D+1,y:S},end:{x:N+(A||N!==T-1?0:1),y:S}};let z=!1;if(!y?.allowNonHttpProtocols)try{const W=new URL(q);["http:","https:"].includes(W.protocol)||(z=!0)}catch{z=!0}z||b.push({text:q,range:P,activate:(W,U)=>y?y.activate(W,U,P):C(0,U),hover:(W,U)=>y?.hover?.(W,U,P),leave:(W,U)=>y?.leave?.(W,U,P)})}A=!1,E.hasExtendedAttrs()&&E.extended.urlId?(D=N,O=E.extended.urlId):(D=-1,O=-1)}}p(b)}};function C(S,p){if(confirm(`Do you want to navigate to ${p}?
|
|
61
|
-
|
|
62
|
-
WARNING: This link could potentially be dangerous`)){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=x=c([v(0,_.IBufferService),v(1,_.IOptionsService),v(2,_.IOscLinkService)],x)},6193:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,c){this._parentWindow=u,this._renderCallback=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,c,v){this._rowCount=v,u=u!==void 0?u:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const c=u(3614),v=u(3656),m=u(6465),_=u(9042),x=u(3730),C=u(1680),S=u(3107),p=u(5744),g=u(2950),b=u(1296),y=u(428),E=u(4269),T=u(5114),O=u(8934),D=u(3230),A=u(9312),N=u(4725),q=u(6731),P=u(8055),z=u(8969),W=u(8460),U=u(844),G=u(6114),H=u(8437),K=u(2584),F=u(7399),k=u(5941),$=u(9074),B=u(2585),I=u(5435),Q=u(4567);class J extends z.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Z={}){super(Z),this.browser=G,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new U.MutableDisposable),this._onCursorMove=this.register(new W.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new W.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new W.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new W.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new W.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new W.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new W.EventEmitter),this._onBlur=this.register(new W.EventEmitter),this._onA11yCharEmitter=this.register(new W.EventEmitter),this._onA11yTabEmitter=this.register(new W.EventEmitter),this._onWillOpen=this.register(new W.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(m.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance($.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((X,V)=>this.refresh(X,V)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((X=>this._reportWindowsOptions(X)))),this.register(this._inputHandler.onColor((X=>this._handleColorEvent(X)))),this.register((0,W.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,W.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,W.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,W.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((X=>this._afterResize(X.cols,X.rows)))),this.register((0,U.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Z){if(this._themeService)for(const X of Z){let V,ie="";switch(X.index){case 256:V="foreground",ie="10";break;case 257:V="background",ie="11";break;case 258:V="cursor",ie="12";break;default:V="ansi",ie="4;"+X.index}switch(X.type){case 0:const de=P.color.toColorRGB(V==="ansi"?this._themeService.colors.ansi[X.index]:this._themeService.colors[V]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${ie};${(0,k.toRgbString)(de)}${K.C1_ESCAPED.ST}`);break;case 1:if(V==="ansi")this._themeService.modifyColors((re=>re.ansi[X.index]=P.rgba.toColor(...X.color)));else{const re=V;this._themeService.modifyColors((le=>le[re]=P.rgba.toColor(...X.color)))}break;case 2:this._themeService.restoreColor(X.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Z){Z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.updateCursorStyle(Z),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Z=this.buffer.ybase+this.buffer.y,X=this.buffer.lines.get(Z);if(!X)return;const V=Math.min(this.buffer.x,this.cols-1),ie=this._renderService.dimensions.css.cell.height,de=X.getWidth(V),re=this._renderService.dimensions.css.cell.width*de,le=this.buffer.y*this._renderService.dimensions.css.cell.height,_e=V*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_e+"px",this.textarea.style.top=le+"px",this.textarea.style.width=re+"px",this.textarea.style.height=ie+"px",this.textarea.style.lineHeight=ie+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",(X=>{this.hasSelection()&&(0,c.copyHandler)(X,this._selectionService)})));const Z=X=>(0,c.handlePasteEvent)(X,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",Z)),this.register((0,v.addDisposableDomListener)(this.element,"paste",Z)),G.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(X=>{X.button===2&&(0,c.rightClickHandler)(X,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",(X=>{(0,c.rightClickHandler)(X,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),G.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",(X=>{X.button===1&&(0,c.moveTextAreaUnderMouseCursor)(X,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",(Z=>this._keyUp(Z)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",(Z=>this._keyDown(Z)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",(Z=>this._keyPress(Z)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",(Z=>this._compositionHelper.compositionupdate(Z)))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,v.addDisposableDomListener)(this.textarea,"input",(Z=>this._inputEvent(Z)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Z){if(!Z)throw new Error("Terminal requires a parent element.");if(Z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Z.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Z.appendChild(this.element);const X=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),X.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),X.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),G.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(T.CoreBrowserService,this.textarea,Z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(N.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",(V=>this._handleTextAreaFocus(V)))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(N.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(q.ThemeService),this._instantiationService.setService(N.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(N.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(N.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((V=>this._onRender.fire(V)))),this.onResize((V=>this._renderService.resize(V.cols,V.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(g.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(X);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(O.MouseService),this._instantiationService.setService(N.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((V=>this.scrollLines(V.amount,V.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(A.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(N.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((V=>this.scrollLines(V.amount,V.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((V=>this._renderService.handleSelectionChanged(V.start,V.end,V.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((V=>{this.textarea.value=V,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((V=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(V=>this._selectionService.handleMouseDown(V)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(V=>this._handleScreenReaderModeOptionChange(V)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(V=>{!this._overviewRulerRenderer&&V&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(b.DomRenderer,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier2)}bindMouse(){const Z=this,X=this.element;function V(re){const le=Z._mouseService.getMouseReportCoords(re,Z.screenElement);if(!le)return!1;let _e,Ee;switch(re.overrideType||re.type){case"mousemove":Ee=32,re.buttons===void 0?(_e=3,re.button!==void 0&&(_e=re.button<3?re.button:3)):_e=1&re.buttons?0:4&re.buttons?1:2&re.buttons?2:3;break;case"mouseup":Ee=0,_e=re.button<3?re.button:3;break;case"mousedown":Ee=1,_e=re.button<3?re.button:3;break;case"wheel":if(Z.viewport.getLinesScrolled(re)===0)return!1;Ee=re.deltaY<0?0:1,_e=4;break;default:return!1}return!(Ee===void 0||_e===void 0||_e>4)&&Z.coreMouseService.triggerMouseEvent({col:le.col,row:le.row,x:le.x,y:le.y,button:_e,action:Ee,ctrl:re.ctrlKey,alt:re.altKey,shift:re.shiftKey})}const ie={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:re=>(V(re),re.buttons||(this._document.removeEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.removeEventListener("mousemove",ie.mousedrag)),this.cancel(re)),wheel:re=>(V(re),this.cancel(re,!0)),mousedrag:re=>{re.buttons&&V(re)},mousemove:re=>{re.buttons||V(re)}};this.register(this.coreMouseService.onProtocolChange((re=>{re?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(re)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&re?ie.mousemove||(X.addEventListener("mousemove",de.mousemove),ie.mousemove=de.mousemove):(X.removeEventListener("mousemove",ie.mousemove),ie.mousemove=null),16&re?ie.wheel||(X.addEventListener("wheel",de.wheel,{passive:!1}),ie.wheel=de.wheel):(X.removeEventListener("wheel",ie.wheel),ie.wheel=null),2&re?ie.mouseup||(ie.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",ie.mouseup),ie.mouseup=null),4&re?ie.mousedrag||(ie.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",ie.mousedrag),ie.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(X,"mousedown",(re=>{if(re.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(re))return V(re),ie.mouseup&&this._document.addEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.addEventListener("mousemove",ie.mousedrag),this.cancel(re)}))),this.register((0,v.addDisposableDomListener)(X,"wheel",(re=>{if(!ie.wheel){if(!this.buffer.hasScrollback){const le=this.viewport.getLinesScrolled(re);if(le===0)return;const _e=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(re.deltaY<0?"A":"B");let Ee="";for(let He=0;He<Math.abs(le);He++)Ee+=_e;return this.coreService.triggerDataEvent(Ee,!0),this.cancel(re,!0)}return this.viewport.handleWheel(re)?this.cancel(re):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)(X,"touchstart",(re=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(re),this.cancel(re)}),{passive:!0})),this.register((0,v.addDisposableDomListener)(X,"touchmove",(re=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(re)?void 0:this.cancel(re)}),{passive:!1}))}refresh(Z,X){this._renderService?.refreshRows(Z,X)}updateCursorStyle(Z){this._selectionService?.shouldColumnSelect(Z)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Z,X,V=0){V===1?(super.scrollLines(Z,X,V),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(Z)}paste(Z){(0,c.paste)(Z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Z){this._customKeyEventHandler=Z}registerLinkProvider(Z){return this.linkifier2.registerLinkProvider(Z)}registerCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const X=this._characterJoinerService.register(Z);return this.refresh(0,this.rows-1),X}deregisterCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Z)}registerDecoration(Z){return this._decorationService.registerDecoration(Z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Z,X,V){this._selectionService.setSelection(Z,X,V)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(Z,X){this._selectionService?.selectLines(Z,X)}_keyDown(Z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;const X=this.browser.isMac&&this.options.macOptionIsMeta&&Z.altKey;if(!X&&!this._compositionHelper.keydown(Z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;X||Z.key!=="Dead"&&Z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const V=(0,F.evaluateKeyboardEvent)(Z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Z),V.type===3||V.type===2){const ie=this.rows-1;return this.scrollLines(V.type===2?-ie:ie),this.cancel(Z,!0)}return V.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Z)||(V.cancel&&this.cancel(Z,!0),!V.key||!!(Z.key&&!Z.ctrlKey&&!Z.altKey&&!Z.metaKey&&Z.key.length===1&&Z.key.charCodeAt(0)>=65&&Z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(V.key!==K.C0.ETX&&V.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:V.key,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(V.key,!0),!this.optionsService.rawOptions.screenReaderMode||Z.altKey||Z.ctrlKey?this.cancel(Z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Z,X){const V=Z.isMac&&!this.options.macOptionIsMeta&&X.altKey&&!X.ctrlKey&&!X.metaKey||Z.isWindows&&X.altKey&&X.ctrlKey&&!X.metaKey||Z.isWindows&&X.getModifierState("AltGraph");return X.type==="keypress"?V:V&&(!X.keyCode||X.keyCode>47)}_keyUp(Z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1||((function(X){return X.keyCode===16||X.keyCode===17||X.keyCode===18})(Z)||this.focus(),this.updateCursorStyle(Z),this._keyPressHandled=!1)}_keyPress(Z){let X;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;if(this.cancel(Z),Z.charCode)X=Z.charCode;else if(Z.which===null||Z.which===void 0)X=Z.keyCode;else{if(Z.which===0||Z.charCode===0)return!1;X=Z.which}return!(!X||(Z.altKey||Z.ctrlKey||Z.metaKey)&&!this._isThirdLevelShift(this.browser,Z)||(X=String.fromCharCode(X),this._onKey.fire({key:X,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(X,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Z){if(Z.data&&Z.inputType==="insertText"&&(!Z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const X=Z.data;return this.coreService.triggerDataEvent(X,!0),this.cancel(Z),!0}return!1}resize(Z,X){Z!==this.cols||X!==this.rows?super.resize(Z,X):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Z,X){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let Z=1;Z<this.rows;Z++)this.buffer.lines.push(this.buffer.getBlankLine(H.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const Z=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=Z,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(Z){if(this._renderService)switch(Z){case I.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const X=this._renderService.dimensions.css.canvas.width.toFixed(0),V=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${V};${X}t`);break;case I.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ie=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${de};${ie}t`)}}cancel(Z,X){if(this.options.cancelEvents||X)return Z.preventDefault(),Z.stopPropagation(),!1}}l.Terminal=J},9924:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,c=1e3){this._renderCallback=u,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,c,v){this._rowCount=v,u=u!==void 0?u:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const m=Date.now();if(m-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=m,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=m-this._lastRefreshMs,x=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,c)}}},1680:function(d,l,u){var c=this&&this.__decorate||function(g,b,y,E){var T,O=arguments.length,D=O<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,b,y,E);else for(var A=g.length-1;A>=0;A--)(T=g[A])&&(D=(O<3?T(D):O>3?T(b,y,D):T(b,y))||D);return O>3&&D&&Object.defineProperty(b,y,D),D},v=this&&this.__param||function(g,b){return function(y,E){b(y,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const m=u(3656),_=u(4725),x=u(8460),C=u(844),S=u(2585);let p=l.Viewport=class extends C.Disposable{constructor(g,b,y,E,T,O,D,A){super(),this._viewportElement=g,this._scrollArea=b,this._bufferService=y,this._optionsService=E,this._charSizeService=T,this._renderService=O,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((N=>this._activeBuffer=N.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((N=>this._renderDimensions=N))),this._handleThemeChange(A.colors),this.register(A.onChangeColors((N=>this._handleThemeChange(N)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(g){this._viewportElement.style.backgroundColor=g.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(g){if(g)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const b=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==b&&(this._lastRecordedBufferHeight=b,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const g=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==g&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=g),this._refreshAnimationFrame=null}syncScrollArea(g=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(g);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(g)}_handleScroll(g){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const b=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:b,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const g=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(g*(this._smoothScrollState.target-this._smoothScrollState.origin)),g<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(g,b){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(b<0&&this._viewportElement.scrollTop!==0||b>0&&y<this._lastRecordedBufferHeight)||(g.cancelable&&g.preventDefault(),!1)}handleWheel(g){const b=this._getPixelsScrolled(g);return b!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+b:this._smoothScrollState.target+=b,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=b,this._bubbleScroll(g,b))}scrollLines(g){if(g!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const b=g*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+b,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!1})}_getPixelsScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let b=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_LINE?b*=this._currentRowHeight:g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(b*=this._currentRowHeight*this._bufferService.rows),b}getBufferElements(g,b){let y,E="";const T=[],O=b??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let A=g;A<O;A++){const N=D.get(A);if(!N)continue;const q=D.get(A+1)?.isWrapped;if(E+=N.translateToString(!q),!q||A===D.length-1){const P=document.createElement("div");P.textContent=E,T.push(P),E.length>0&&(y=P),E=""}}return{bufferElements:T,cursorElement:y}}getLinesScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let b=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(b/=this._currentRowHeight+0,this._wheelPartialScroll+=b,b=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(b*=this._bufferService.rows),b}_applyScrollModifier(g,b){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&b.altKey||y==="ctrl"&&b.ctrlKey||y==="shift"&&b.shiftKey?g*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:g*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(g){this._lastTouchY=g.touches[0].pageY}handleTouchMove(g){const b=this._lastTouchY-g.touches[0].pageY;return this._lastTouchY=g.touches[0].pageY,b!==0&&(this._viewportElement.scrollTop+=b,this._bubbleScroll(g,b))}};l.Viewport=p=c([v(2,S.IBufferService),v(3,S.IOptionsService),v(4,_.ICharSizeService),v(5,_.IRenderService),v(6,_.ICoreBrowserService),v(7,_.IThemeService)],p)},3107:function(d,l,u){var c=this&&this.__decorate||function(S,p,g,b){var y,E=arguments.length,T=E<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,p,g,b);else for(var O=S.length-1;O>=0;O--)(y=S[O])&&(T=(E<3?y(T):E>3?y(p,g,T):y(p,g))||T);return E>3&&T&&Object.defineProperty(p,g,T),T},v=this&&this.__param||function(S,p){return function(g,b){p(g,b,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const m=u(4725),_=u(844),x=u(2585);let C=l.BufferDecorationRenderer=class extends _.Disposable{constructor(S,p,g,b,y){super(),this._screenElement=S,this._bufferService=p,this._coreBrowserService=g,this._decorationService=b,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,_.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){const p=this._coreBrowserService.mainDocument.createElement("div");p.classList.add("xterm-decoration"),p.classList.toggle("xterm-decoration-top-layer",S?.options?.layer==="top"),p.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,p.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",p.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",p.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const g=S.options.x??0;return g&&g>this._bufferService.cols&&(p.style.display="none"),this._refreshXPosition(S,p),p}_refreshStyle(S){const p=S.marker.line-this._bufferService.buffers.active.ydisp;if(p<0||p>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let g=this._decorationElements.get(S);g||(g=this._createElement(S),S.element=g,this._decorationElements.set(S,g),this._container.appendChild(g),S.onDispose((()=>{this._decorationElements.delete(S),g.remove()}))),g.style.top=p*this._renderService.dimensions.css.cell.height+"px",g.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(g)}}_refreshXPosition(S,p=S.element){if(!p)return;const g=S.options.x??0;(S.options.anchor||"left")==="right"?p.style.right=g?g*this._renderService.dimensions.css.cell.width+"px":"":p.style.left=g?g*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){this._decorationElements.get(S)?.remove(),this._decorationElements.delete(S),S.dispose()}};l.BufferDecorationRenderer=C=c([v(1,x.IBufferService),v(2,m.ICoreBrowserService),v(3,x.IDecorationService),v(4,m.IRenderService)],C)},5871:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const c of this._zones)if(c.color===u.options.overviewRulerOptions.color&&c.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,u.marker.line))return;if(this._lineAdjacentToZone(c,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(c,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,c){return c>=u.startBufferLine&&c<=u.endBufferLine}_lineAdjacentToZone(u,c,v){return c>=u.startBufferLine-this._linePadding[v||"full"]&&c<=u.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(u,c){u.startBufferLine=Math.min(u.startBufferLine,c),u.endBufferLine=Math.max(u.endBufferLine,c)}}},5744:function(d,l,u){var c=this&&this.__decorate||function(y,E,T,O){var D,A=arguments.length,N=A<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,T):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,E,T,O);else for(var q=y.length-1;q>=0;q--)(D=y[q])&&(N=(A<3?D(N):A>3?D(E,T,N):D(E,T))||N);return A>3&&N&&Object.defineProperty(E,T,N),N},v=this&&this.__param||function(y,E){return function(T,O){E(T,O,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const m=u(5871),_=u(4725),x=u(844),C=u(2585),S={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0};let b=l.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,E,T,O,D,A,N){super(),this._viewportElement=y,this._screenElement=E,this._bufferService=T,this._decorationService=O,this._renderService=D,this._optionsService=A,this._coreBrowserService=N,this._colorZoneStore=new m.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const q=this._canvas.getContext("2d");if(!q)throw new Error("Ctx cannot be null");this._ctx=q,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);p.full=this._canvas.width,p.left=y,p.center=E,p.right=y,this._refreshDrawHeightConstants(),g.full=0,g.left=0,g.center=p.left,g.right=p.left+p.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);S.left=E,S.center=E,S.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const E of y)E.position!=="full"&&this._renderColorZone(E);for(const E of y)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(g[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-S[y.position||"full"]/2),p[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[y.position||"full"]))}_queueRefresh(y,E){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=b=c([v(2,C.IBufferService),v(3,C.IDecorationService),v(4,_.IRenderService),v(5,C.IOptionsService),v(6,_.ICoreBrowserService)],b)},2950:function(d,l,u){var c=this&&this.__decorate||function(S,p,g,b){var y,E=arguments.length,T=E<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,p,g,b);else for(var O=S.length-1;O>=0;O--)(y=S[O])&&(T=(E<3?y(T):E>3?y(p,g,T):y(p,g))||T);return E>3&&T&&Object.defineProperty(p,g,T),T},v=this&&this.__param||function(S,p){return function(g,b){p(g,b,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const m=u(4725),_=u(2585),x=u(2584);let C=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,p,g,b,y,E){this._textarea=S,this._compositionView=p,this._bufferService=g,this._optionsService=b,this._coreService=y,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const p={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let g;this._isSendingComposition=!1,p.start+=this._dataAlreadySent.length,g=this._isComposing?this._textarea.value.substring(p.start,p.end):this._textarea.value.substring(p.start),g.length>0&&this._coreService.triggerDataEvent(g,!0)}}),0)}else{this._isSendingComposition=!1;const p=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(p,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const p=this._textarea.value,g=p.replace(S,"");this._dataAlreadySent=g,p.length>S.length?this._coreService.triggerDataEvent(g,!0):p.length<S.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):p.length===S.length&&p!==S&&this._coreService.triggerDataEvent(p,!0)}}),0)}updateCompositionElements(S){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const p=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),g=this._renderService.dimensions.css.cell.height,b=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=p*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=b+"px",this._compositionView.style.height=g+"px",this._compositionView.style.lineHeight=g+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=b+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}S||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=C=c([v(2,_.IBufferService),v(3,_.IOptionsService),v(4,_.ICoreService),v(5,m.IRenderService)],C)},9806:(d,l)=>{function u(c,v,m){const _=m.getBoundingClientRect(),x=c.getComputedStyle(m),C=parseInt(x.getPropertyValue("padding-left")),S=parseInt(x.getPropertyValue("padding-top"));return[v.clientX-_.left-C,v.clientY-_.top-S]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(c,v,m,_,x,C,S,p,g){if(!C)return;const b=u(c,v,m);return b?(b[0]=Math.ceil((b[0]+(g?S/2:0))/S),b[1]=Math.ceil(b[1]/p),b[0]=Math.min(Math.max(b[0],1),_+(g?1:0)),b[1]=Math.min(Math.max(b[1],1),x),b):void 0}},9504:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const c=u(2584);function v(p,g,b,y){const E=p-m(p,b),T=g-m(g,b),O=Math.abs(E-T)-(function(D,A,N){let q=0;const P=D-m(D,N),z=A-m(A,N);for(let W=0;W<Math.abs(P-z);W++){const U=_(D,A)==="A"?-1:1;N.buffer.lines.get(P+U*W)?.isWrapped&&q++}return q})(p,g,b);return S(O,C(_(p,g),y))}function m(p,g){let b=0,y=g.buffer.lines.get(p),E=y?.isWrapped;for(;E&&p>=0&&p<g.rows;)b++,y=g.buffer.lines.get(--p),E=y?.isWrapped;return b}function _(p,g){return p>g?"A":"B"}function x(p,g,b,y,E,T){let O=p,D=g,A="";for(;O!==b||D!==y;)O+=E?1:-1,E&&O>T.cols-1?(A+=T.buffer.translateBufferLineToString(D,!1,p,O),O=0,p=0,D++):!E&&O<0&&(A+=T.buffer.translateBufferLineToString(D,!1,0,p+1),O=T.cols-1,p=O,D--);return A+T.buffer.translateBufferLineToString(D,!1,p,O)}function C(p,g){const b=g?"O":"[";return c.C0.ESC+b+p}function S(p,g){p=Math.floor(p);let b="";for(let y=0;y<p;y++)b+=g;return b}l.moveToCellSequence=function(p,g,b,y){const E=b.buffer.x,T=b.buffer.y;if(!b.buffer.hasScrollback)return(function(A,N,q,P,z,W){return v(N,P,z,W).length===0?"":S(x(A,N,A,N-m(N,z),!1,z).length,C("D",W))})(E,T,0,g,b,y)+v(T,g,b,y)+(function(A,N,q,P,z,W){let U;U=v(N,P,z,W).length>0?P-m(P,z):N;const G=P,H=(function(K,F,k,$,B,I){let Q;return Q=v(k,$,B,I).length>0?$-m($,B):F,K<k&&Q<=$||K>=k&&Q<$?"C":"D"})(A,N,q,P,z,W);return S(x(A,U,q,G,H==="C",z).length,C(H,W))})(E,T,p,g,b,y);let O;if(T===g)return O=E>p?"D":"C",S(Math.abs(E-p),C(O,y));O=T>g?"D":"C";const D=Math.abs(T-g);return S((function(A,N){return N.cols-A})(T>g?p:E,b)+(D-1)*b.cols+1+((T>g?E:p)-1),C(O,y))}},1296:function(d,l,u){var c=this&&this.__decorate||function(z,W,U,G){var H,K=arguments.length,F=K<3?W:G===null?G=Object.getOwnPropertyDescriptor(W,U):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(z,W,U,G);else for(var k=z.length-1;k>=0;k--)(H=z[k])&&(F=(K<3?H(F):K>3?H(W,U,F):H(W,U))||F);return K>3&&F&&Object.defineProperty(W,U,F),F},v=this&&this.__param||function(z,W){return function(U,G){W(U,G,z)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const m=u(3787),_=u(2550),x=u(2223),C=u(6171),S=u(4725),p=u(8055),g=u(8460),b=u(844),y=u(2585),E="xterm-dom-renderer-owner-",T="xterm-rows",O="xterm-fg-",D="xterm-bg-",A="xterm-focus",N="xterm-selection";let q=1,P=l.DomRenderer=class extends b.Disposable{constructor(z,W,U,G,H,K,F,k,$,B,I,Q){super(),this._document=z,this._element=W,this._screenElement=U,this._viewportElement=G,this._helperContainer=H,this._linkifier2=K,this._charSizeService=k,this._optionsService=$,this._bufferService=B,this._coreBrowserService=I,this._themeService=Q,this._terminalClass=q++,this._rowElements=[],this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(T),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(N),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((J=>this._injectCss(J)))),this._injectCss(this._themeService.colors),this._rowFactory=F.createInstance(m.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((J=>this._handleLinkHover(J)))),this.register(this._linkifier2.onHideLinkUnderline((J=>this._handleLinkLeave(J)))),this.register((0,b.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const z=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*z,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*z),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/z),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/z),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const U of this._rowElements)U.style.width=`${this.dimensions.css.canvas.width}px`,U.style.height=`${this.dimensions.css.cell.height}px`,U.style.lineHeight=`${this.dimensions.css.cell.height}px`,U.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const W=`${this._terminalSelector} .${T} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=W,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(z){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let W=`${this._terminalSelector} .${T} { color: ${z.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;W+=`${this._terminalSelector} .${T} .xterm-dim { color: ${p.color.multiplyOpacity(z.foreground,.5).css};}`,W+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,W+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",W+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${z.cursor.css}; color: ${z.cursorAccent.css}; } 50% { background-color: inherit; color: ${z.cursor.css}; }}`,W+=`${this._terminalSelector} .${T}.${A} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${T}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-block { background-color: ${z.cursor.css} !important; color: ${z.cursorAccent.css} !important;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${z.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${z.cursor.css} inset;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${z.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,W+=`${this._terminalSelector} .${N} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${N} div { position: absolute; background-color: ${z.selectionBackgroundOpaque.css};}${this._terminalSelector} .${N} div { position: absolute; background-color: ${z.selectionInactiveBackgroundOpaque.css};}`;for(const[U,G]of z.ansi.entries())W+=`${this._terminalSelector} .${O}${U} { color: ${G.css}; }${this._terminalSelector} .${O}${U}.xterm-dim { color: ${p.color.multiplyOpacity(G,.5).css}; }${this._terminalSelector} .${D}${U} { background-color: ${G.css}; }`;W+=`${this._terminalSelector} .${O}${x.INVERTED_DEFAULT_COLOR} { color: ${p.color.opaque(z.background).css}; }${this._terminalSelector} .${O}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${p.color.multiplyOpacity(p.color.opaque(z.background),.5).css}; }${this._terminalSelector} .${D}${x.INVERTED_DEFAULT_COLOR} { background-color: ${z.foreground.css}; }`,this._themeStyleElement.textContent=W}_setDefaultSpacing(){const z=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${z}px`,this._rowFactory.defaultSpacing=z}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(z,W){for(let U=this._rowElements.length;U<=W;U++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>W;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(z,W){this._refreshRowElements(z,W),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(A),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(A),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(z,W,U){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(z,W,U),this.renderRows(0,this._bufferService.rows-1),!z||!W)return;const G=z[1]-this._bufferService.buffer.ydisp,H=W[1]-this._bufferService.buffer.ydisp,K=Math.max(G,0),F=Math.min(H,this._bufferService.rows-1);if(K>=this._bufferService.rows||F<0)return;const k=this._document.createDocumentFragment();if(U){const $=z[0]>W[0];k.appendChild(this._createSelectionElement(K,$?W[0]:z[0],$?z[0]:W[0],F-K+1))}else{const $=G===K?z[0]:0,B=K===H?W[0]:this._bufferService.cols;k.appendChild(this._createSelectionElement(K,$,B));const I=F-K-1;if(k.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,I)),K!==F){const Q=H===F?W[0]:this._bufferService.cols;k.appendChild(this._createSelectionElement(F,0,Q))}}this._selectionContainer.appendChild(k)}_createSelectionElement(z,W,U,G=1){const H=this._document.createElement("div");return H.style.height=G*this.dimensions.css.cell.height+"px",H.style.top=z*this.dimensions.css.cell.height+"px",H.style.left=W*this.dimensions.css.cell.width+"px",H.style.width=this.dimensions.css.cell.width*(U-W)+"px",H}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const z of this._rowElements)z.replaceChildren()}renderRows(z,W){const U=this._bufferService.buffer,G=U.ybase+U.y,H=Math.min(U.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,F=this._optionsService.rawOptions.cursorStyle,k=this._optionsService.rawOptions.cursorInactiveStyle;for(let $=z;$<=W;$++){const B=$+U.ydisp,I=this._rowElements[$],Q=U.lines.get(B);if(!I||!Q)break;I.replaceChildren(...this._rowFactory.createRow(Q,B,B===G,F,k,H,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(z){this._setCellUnderline(z.x1,z.x2,z.y1,z.y2,z.cols,!0)}_handleLinkLeave(z){this._setCellUnderline(z.x1,z.x2,z.y1,z.y2,z.cols,!1)}_setCellUnderline(z,W,U,G,H,K){U<0&&(z=0),G<0&&(W=0);const F=this._bufferService.rows-1;U=Math.max(Math.min(U,F),0),G=Math.max(Math.min(G,F),0),H=Math.min(H,this._bufferService.cols);const k=this._bufferService.buffer,$=k.ybase+k.y,B=Math.min(k.x,H-1),I=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let ae=U;ae<=G;++ae){const Z=ae+k.ydisp,X=this._rowElements[ae],V=k.lines.get(Z);if(!X||!V)break;X.replaceChildren(...this._rowFactory.createRow(V,Z,Z===$,Q,J,B,I,this.dimensions.css.cell.width,this._widthCache,K?ae===U?z:0:-1,K?(ae===G?W:H)-1:-1))}}};l.DomRenderer=P=c([v(6,y.IInstantiationService),v(7,S.ICharSizeService),v(8,y.IOptionsService),v(9,y.IBufferService),v(10,S.ICoreBrowserService),v(11,S.IThemeService)],P)},3787:function(d,l,u){var c=this&&this.__decorate||function(O,D,A,N){var q,P=arguments.length,z=P<3?D:N===null?N=Object.getOwnPropertyDescriptor(D,A):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(O,D,A,N);else for(var W=O.length-1;W>=0;W--)(q=O[W])&&(z=(P<3?q(z):P>3?q(D,A,z):q(D,A))||z);return P>3&&z&&Object.defineProperty(D,A,z),z},v=this&&this.__param||function(O,D){return function(A,N){D(A,N,O)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const m=u(2223),_=u(643),x=u(511),C=u(2585),S=u(8055),p=u(4725),g=u(4269),b=u(6171),y=u(3734);let E=l.DomRendererRowFactory=class{constructor(O,D,A,N,q,P,z){this._document=O,this._characterJoinerService=D,this._optionsService=A,this._coreBrowserService=N,this._coreService=q,this._decorationService=P,this._themeService=z,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(O,D,A){this._selectionStart=O,this._selectionEnd=D,this._columnSelectMode=A}createRow(O,D,A,N,q,P,z,W,U,G,H){const K=[],F=this._characterJoinerService.getJoinedCharacters(D),k=this._themeService.colors;let $,B=O.getNoBgTrimmedLength();A&&B<P+1&&(B=P+1);let I=0,Q="",J=0,ae=0,Z=0,X=!1,V=0,ie=!1,de=0;const re=[],le=G!==-1&&H!==-1;for(let _e=0;_e<B;_e++){O.loadCell(_e,this._workCell);let Ee=this._workCell.getWidth();if(Ee===0)continue;let He=!1,ke=_e,Ce=this._workCell;if(F.length>0&&_e===F[0][0]){He=!0;const st=F.shift();Ce=new g.JoinedCellData(this._workCell,O.translateToString(!0,st[0],st[1]),st[1]-st[0]),ke=st[1]-1,Ee=Ce.getWidth()}const $t=this._isCellInSelection(_e,D),Bt=A&&_e===P,tn=le&&_e>=G&&_e<=H;let fn=!1;this._decorationService.forEachDecorationAtCell(_e,D,void 0,(st=>{fn=!0}));let _n=Ce.getChars()||_.WHITESPACE_CELL_CHAR;if(_n===" "&&(Ce.isUnderline()||Ce.isOverline())&&(_n=" "),de=Ee*W-U.get(_n,Ce.isBold(),Ce.isItalic()),$){if(I&&($t&&ie||!$t&&!ie&&Ce.bg===J)&&($t&&ie&&k.selectionForeground||Ce.fg===ae)&&Ce.extended.ext===Z&&tn===X&&de===V&&!Bt&&!He&&!fn){Ce.isInvisible()?Q+=_.WHITESPACE_CELL_CHAR:Q+=_n,I++;continue}I&&($.textContent=Q),$=this._document.createElement("span"),I=0,Q=""}else $=this._document.createElement("span");if(J=Ce.bg,ae=Ce.fg,Z=Ce.extended.ext,X=tn,V=de,ie=$t,He&&P>=_e&&P<=ke&&(P=_e),!this._coreService.isCursorHidden&&Bt&&this._coreService.isCursorInitialized){if(re.push("xterm-cursor"),this._coreBrowserService.isFocused)z&&re.push("xterm-cursor-blink"),re.push(N==="bar"?"xterm-cursor-bar":N==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(q)switch(q){case"outline":re.push("xterm-cursor-outline");break;case"block":re.push("xterm-cursor-block");break;case"bar":re.push("xterm-cursor-bar");break;case"underline":re.push("xterm-cursor-underline")}}if(Ce.isBold()&&re.push("xterm-bold"),Ce.isItalic()&&re.push("xterm-italic"),Ce.isDim()&&re.push("xterm-dim"),Q=Ce.isInvisible()?_.WHITESPACE_CELL_CHAR:Ce.getChars()||_.WHITESPACE_CELL_CHAR,Ce.isUnderline()&&(re.push(`xterm-underline-${Ce.extended.underlineStyle}`),Q===" "&&(Q=" "),!Ce.isUnderlineColorDefault()))if(Ce.isUnderlineColorRGB())$.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Ce.getUnderlineColor()).join(",")})`;else{let st=Ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ce.isBold()&&st<8&&(st+=8),$.style.textDecorationColor=k.ansi[st].css}Ce.isOverline()&&(re.push("xterm-overline"),Q===" "&&(Q=" ")),Ce.isStrikethrough()&&re.push("xterm-strikethrough"),tn&&($.style.textDecoration="underline");let At=Ce.getFgColor(),it=Ce.getFgColorMode(),Et=Ce.getBgColor(),Gt=Ce.getBgColorMode();const ln=!!Ce.isInverse();if(ln){const st=At;At=Et,Et=st;const lr=it;it=Gt,Gt=lr}let dt,Xt,Qt,ar=!1;switch(this._decorationService.forEachDecorationAtCell(_e,D,void 0,(st=>{st.options.layer!=="top"&&ar||(st.backgroundColorRGB&&(Gt=50331648,Et=st.backgroundColorRGB.rgba>>8&16777215,dt=st.backgroundColorRGB),st.foregroundColorRGB&&(it=50331648,At=st.foregroundColorRGB.rgba>>8&16777215,Xt=st.foregroundColorRGB),ar=st.options.layer==="top")})),!ar&&$t&&(dt=this._coreBrowserService.isFocused?k.selectionBackgroundOpaque:k.selectionInactiveBackgroundOpaque,Et=dt.rgba>>8&16777215,Gt=50331648,ar=!0,k.selectionForeground&&(it=50331648,At=k.selectionForeground.rgba>>8&16777215,Xt=k.selectionForeground)),ar&&re.push("xterm-decoration-top"),Gt){case 16777216:case 33554432:Qt=k.ansi[Et],re.push(`xterm-bg-${Et}`);break;case 50331648:Qt=S.rgba.toColor(Et>>16,Et>>8&255,255&Et),this._addStyle($,`background-color:#${T((Et>>>0).toString(16),"0",6)}`);break;default:ln?(Qt=k.foreground,re.push(`xterm-bg-${m.INVERTED_DEFAULT_COLOR}`)):Qt=k.background}switch(dt||Ce.isDim()&&(dt=S.color.multiplyOpacity(Qt,.5)),it){case 16777216:case 33554432:Ce.isBold()&&At<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(At+=8),this._applyMinimumContrast($,Qt,k.ansi[At],Ce,dt,void 0)||re.push(`xterm-fg-${At}`);break;case 50331648:const st=S.rgba.toColor(At>>16&255,At>>8&255,255&At);this._applyMinimumContrast($,Qt,st,Ce,dt,Xt)||this._addStyle($,`color:#${T(At.toString(16),"0",6)}`);break;default:this._applyMinimumContrast($,Qt,k.foreground,Ce,dt,Xt)||ln&&re.push(`xterm-fg-${m.INVERTED_DEFAULT_COLOR}`)}re.length&&($.className=re.join(" "),re.length=0),Bt||He||fn?$.textContent=Q:I++,de!==this.defaultSpacing&&($.style.letterSpacing=`${de}px`),K.push($),_e=ke}return $&&I&&($.textContent=Q),K}_applyMinimumContrast(O,D,A,N,q,P){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,b.excludeFromContrastRatioDemands)(N.getCode()))return!1;const z=this._getContrastCache(N);let W;if(q||P||(W=z.getColor(D.rgba,A.rgba)),W===void 0){const U=this._optionsService.rawOptions.minimumContrastRatio/(N.isDim()?2:1);W=S.color.ensureContrastRatio(q||D,P||A,U),z.setColor((q||D).rgba,(P||A).rgba,W??null)}return!!W&&(this._addStyle(O,`color:${W.css}`),!0)}_getContrastCache(O){return O.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(O,D){O.setAttribute("style",`${O.getAttribute("style")||""}${D};`)}_isCellInSelection(O,D){const A=this._selectionStart,N=this._selectionEnd;return!(!A||!N)&&(this._columnSelectMode?A[0]<=N[0]?O>=A[0]&&D>=A[1]&&O<N[0]&&D<=N[1]:O<A[0]&&D>=A[1]&&O>=N[0]&&D<=N[1]:D>A[1]&&D<N[1]||A[1]===N[1]&&D===A[1]&&O>=A[0]&&O<N[0]||A[1]<N[1]&&D===N[1]&&O<N[0]||A[1]<N[1]&&D===A[1]&&O>=A[0])}};function T(O,D,A){for(;O.length<A;)O=D+O;return O}l.DomRendererRowFactory=E=c([v(1,p.ICharacterJoinerService),v(2,C.IOptionsService),v(3,p.ICoreBrowserService),v(4,C.ICoreService),v(5,C.IDecorationService),v(6,p.IThemeService)],E)},2550:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const v=u.createElement("span");v.classList.add("xterm-char-measure-element");const m=u.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold";const _=u.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const x=u.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[v,m,_,x],this._container.appendChild(v),this._container.appendChild(m),this._container.appendChild(_),this._container.appendChild(x),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,c,v,m){u===this._font&&c===this._fontSize&&v===this._weight&&m===this._weightBold||(this._font=u,this._fontSize=c,this._weight=v,this._weightBold=m,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${m}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${m}`,this.clear())}get(u,c,v){let m=0;if(!c&&!v&&u.length===1&&(m=u.charCodeAt(0))<256)return this._flat[m]!==-9999?this._flat[m]:this._flat[m]=this._measure(u,0);let _=u;c&&(_+="B"),v&&(_+="I");let x=this._holey.get(_);if(x===void 0){let C=0;c&&(C|=1),v&&(C|=2),x=this._measure(u,C),this._holey.set(_,x)}return x}_measure(u,c){const v=this._measureElements[c];return v.textContent=u.repeat(32),v.offsetWidth/32}}},2223:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const c=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(d,l)=>{function u(c){return 57508<=c&&c<=57558}Object.defineProperty(l,"__esModule",{value:!0}),l.createRenderDimensions=l.excludeFromContrastRatioDemands=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},l.excludeFromContrastRatioDemands=function(c){return u(c)||(function(v){return 9472<=v&&v<=9631})(c)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,c=this.selectionEnd;return!(!u||!c)&&(u[1]>c[1]||u[1]===c[1]&&u[0]>c[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(d,l,u){var c=this&&this.__decorate||function(p,g,b,y){var E,T=arguments.length,O=T<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,g,b,y);else for(var D=p.length-1;D>=0;D--)(E=p[D])&&(O=(T<3?E(O):T>3?E(g,b,O):E(g,b))||O);return T>3&&O&&Object.defineProperty(g,b,O),O},v=this&&this.__param||function(p,g){return function(b,y){g(b,y,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const m=u(2585),_=u(8460),x=u(844);let C=l.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(p,g,b){super(),this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new S(p,g,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const p=this._measureStrategy.measure();p.width===this.width&&p.height===this.height||(this.width=p.width,this.height=p.height,this._onCharSizeChange.fire())}};l.CharSizeService=C=c([v(2,m.IOptionsService)],C);class S{constructor(g,b,y){this._document=g,this._parentElement=b,this._optionsService=y,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const g={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return g.width!==0&&g.height!==0&&(this._result.width=g.width/32,this._result.height=Math.ceil(g.height)),this._result}}},4269:function(d,l,u){var c=this&&this.__decorate||function(g,b,y,E){var T,O=arguments.length,D=O<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,b,y,E);else for(var A=g.length-1;A>=0;A--)(T=g[A])&&(D=(O<3?T(D):O>3?T(b,y,D):T(b,y))||D);return O>3&&D&&Object.defineProperty(b,y,D),D},v=this&&this.__param||function(g,b){return function(y,E){b(y,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const m=u(3734),_=u(643),x=u(511),C=u(2585);class S extends m.AttributeData{constructor(b,y,E){super(),this.content=0,this.combinedData="",this.fg=b.fg,this.bg=b.bg,this.combinedData=y,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(b){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=S;let p=l.CharacterJoinerService=class oE{constructor(b){this._bufferService=b,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(b){const y={id:this._nextCharacterJoinerId++,handler:b};return this._characterJoiners.push(y),y.id}deregister(b){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===b)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(b){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(b);if(!y||y.length===0)return[];const E=[],T=y.translateToString(!0);let O=0,D=0,A=0,N=y.getFg(0),q=y.getBg(0);for(let P=0;P<y.getTrimmedLength();P++)if(y.loadCell(P,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==N||this._workCell.bg!==q){if(P-O>1){const z=this._getJoinedRanges(T,A,D,y,O);for(let W=0;W<z.length;W++)E.push(z[W])}O=P,A=D,N=this._workCell.fg,q=this._workCell.bg}D+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-O>1){const P=this._getJoinedRanges(T,A,D,y,O);for(let z=0;z<P.length;z++)E.push(P[z])}return E}_getJoinedRanges(b,y,E,T,O){const D=b.substring(y,E);let A=[];try{A=this._characterJoiners[0].handler(D)}catch(N){console.error(N)}for(let N=1;N<this._characterJoiners.length;N++)try{const q=this._characterJoiners[N].handler(D);for(let P=0;P<q.length;P++)oE._mergeRanges(A,q[P])}catch(q){console.error(q)}return this._stringRangesToCellRanges(A,T,O),A}_stringRangesToCellRanges(b,y,E){let T=0,O=!1,D=0,A=b[T];if(A){for(let N=E;N<this._bufferService.cols;N++){const q=y.getWidth(N),P=y.getString(N).length||_.WHITESPACE_CELL_CHAR.length;if(q!==0){if(!O&&A[0]<=D&&(A[0]=N,O=!0),A[1]<=D){if(A[1]=N,A=b[++T],!A)break;A[0]<=D?(A[0]=N,O=!0):O=!1}D+=P}}A&&(A[1]=this._bufferService.cols)}}static _mergeRanges(b,y){let E=!1;for(let T=0;T<b.length;T++){const O=b[T];if(E){if(y[1]<=O[0])return b[T-1][1]=y[1],b;if(y[1]<=O[1])return b[T-1][1]=Math.max(y[1],O[1]),b.splice(T,1),b;b.splice(T,1),T--}else{if(y[1]<=O[0])return b.splice(T,0,y),b;if(y[1]<=O[1])return O[0]=Math.min(y[0],O[0]),b;y[0]<O[1]&&(O[0]=Math.min(y[0],O[0]),E=!0)}}return E?b[b.length-1][1]=y[1]:b.push(y),b}};l.CharacterJoinerService=p=c([v(0,C.IBufferService)],p)},5114:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const c=u(844),v=u(8460),m=u(3656);class _ extends c.Disposable{constructor(S,p,g){super(),this._textarea=S,this._window=p,this.mainDocument=g,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new v.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((b=>this._screenDprMonitor.setWindow(b)))),this.register((0,v.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(S){this._window!==S&&(this._window=S,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}l.CoreBrowserService=_;class x extends c.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,m.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},8934:function(d,l,u){var c=this&&this.__decorate||function(C,S,p,g){var b,y=arguments.length,E=y<3?S:g===null?g=Object.getOwnPropertyDescriptor(S,p):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(C,S,p,g);else for(var T=C.length-1;T>=0;T--)(b=C[T])&&(E=(y<3?b(E):y>3?b(S,p,E):b(S,p))||E);return y>3&&E&&Object.defineProperty(S,p,E),E},v=this&&this.__param||function(C,S){return function(p,g){S(p,g,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const m=u(4725),_=u(9806);let x=l.MouseService=class{constructor(C,S){this._renderService=C,this._charSizeService=S}getCoords(C,S,p,g,b){return(0,_.getCoords)(window,C,S,p,g,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,b)}getMouseReportCoords(C,S){const p=(0,_.getCoordsRelativeToElement)(window,C,S);if(this._charSizeService.hasValidSize)return p[0]=Math.min(Math.max(p[0],0),this._renderService.dimensions.css.canvas.width-1),p[1]=Math.min(Math.max(p[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(p[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(p[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(p[0]),y:Math.floor(p[1])}}};l.MouseService=x=c([v(0,m.IRenderService),v(1,m.ICharSizeService)],x)},3230:function(d,l,u){var c=this&&this.__decorate||function(b,y,E,T){var O,D=arguments.length,A=D<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,y,E,T);else for(var N=b.length-1;N>=0;N--)(O=b[N])&&(A=(D<3?O(A):D>3?O(y,E,A):O(y,E))||A);return D>3&&A&&Object.defineProperty(y,E,A),A},v=this&&this.__param||function(b,y){return function(E,T){y(E,T,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const m=u(6193),_=u(4725),x=u(8460),C=u(844),S=u(7226),p=u(2585);let g=l.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(b,y,E,T,O,D,A,N,q){if(super(),this._rowCount=b,this._charSizeService=T,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new m.RenderDebouncer(A.window,((P,z)=>this._renderRows(P,z))),this.register(this._renderDebouncer),this.register(A.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(O.onDecorationRegistered((()=>this._fullRefresh()))),this.register(O.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(q.onChangeColors((()=>this._fullRefresh()))),"IntersectionObserver"in A.window){const P=new A.window.IntersectionObserver((z=>this._handleIntersectionChange(z[z.length-1])),{threshold:0});P.observe(y),this.register({dispose:()=>P.disconnect()})}}_handleIntersectionChange(b){this._isPaused=b.isIntersecting===void 0?b.intersectionRatio===0:!b.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(b,y,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(b,y,this._rowCount))}_renderRows(b,y){this._renderer.value&&(b=Math.min(b,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(b,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:b,end:y}),this._onRender.fire({start:b,end:y}),this._isNextRenderRedrawOnly=!0)}resize(b,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(b){this._renderer.value=b,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(b){return this._renderDebouncer.addRefreshCallback(b)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(b,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value.handleResize(b,y))):this._renderer.value.handleResize(b,y),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(b,y,E){this._selectionState.start=b,this._selectionState.end=y,this._selectionState.columnSelectMode=E,this._renderer.value?.handleSelectionChanged(b,y,E)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};l.RenderService=g=c([v(2,p.IOptionsService),v(3,_.ICharSizeService),v(4,p.IDecorationService),v(5,p.IBufferService),v(6,_.ICoreBrowserService),v(7,p.IInstantiationService),v(8,_.IThemeService)],g)},9312:function(d,l,u){var c=this&&this.__decorate||function(A,N,q,P){var z,W=arguments.length,U=W<3?N:P===null?P=Object.getOwnPropertyDescriptor(N,q):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(A,N,q,P);else for(var G=A.length-1;G>=0;G--)(z=A[G])&&(U=(W<3?z(U):W>3?z(N,q,U):z(N,q))||U);return W>3&&U&&Object.defineProperty(N,q,U),U},v=this&&this.__param||function(A,N){return function(q,P){N(q,P,A)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const m=u(9806),_=u(9504),x=u(456),C=u(4725),S=u(8460),p=u(844),g=u(6114),b=u(4841),y=u(511),E=u(2585),T=" ",O=new RegExp(T,"g");let D=l.SelectionService=class extends p.Disposable{constructor(A,N,q,P,z,W,U,G,H){super(),this._element=A,this._screenElement=N,this._linkifier=q,this._bufferService=P,this._coreService=z,this._mouseService=W,this._optionsService=U,this._renderService=G,this._coreBrowserService=H,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((K=>this._handleTrim(K))),this.register(this._bufferService.buffers.onBufferActivate((K=>this._handleBufferActivate(K)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,p.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const A=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;return!(!A||!N||A[0]===N[0]&&A[1]===N[1])}get selectionText(){const A=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;if(!A||!N)return"";const q=this._bufferService.buffer,P=[];if(this._activeSelectionMode===3){if(A[0]===N[0])return"";const z=A[0]<N[0]?A[0]:N[0],W=A[0]<N[0]?N[0]:A[0];for(let U=A[1];U<=N[1];U++){const G=q.translateBufferLineToString(U,!0,z,W);P.push(G)}}else{const z=A[1]===N[1]?N[0]:void 0;P.push(q.translateBufferLineToString(A[1],!0,A[0],z));for(let W=A[1]+1;W<=N[1]-1;W++){const U=q.lines.get(W),G=q.translateBufferLineToString(W,!0);U?.isWrapped?P[P.length-1]+=G:P.push(G)}if(A[1]!==N[1]){const W=q.lines.get(N[1]),U=q.translateBufferLineToString(N[1],!0,0,N[0]);W&&W.isWrapped?P[P.length-1]+=U:P.push(U)}}return P.map((z=>z.replace(O," "))).join(g.isWindows?`\r
|
|
63
|
-
`:`
|
|
64
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),g.isLinux&&A&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(A){const N=this._getMouseBufferCoords(A),q=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!!(q&&P&&N)&&this._areCoordsInSelection(N,q,P)}isCellInSelection(A,N){const q=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!q||!P)&&this._areCoordsInSelection([A,N],q,P)}_areCoordsInSelection(A,N,q){return A[1]>N[1]&&A[1]<q[1]||N[1]===q[1]&&A[1]===N[1]&&A[0]>=N[0]&&A[0]<q[0]||N[1]<q[1]&&A[1]===q[1]&&A[0]<q[0]||N[1]<q[1]&&A[1]===N[1]&&A[0]>=N[0]}_selectWordAtCursor(A,N){const q=this._linkifier.currentLink?.link?.range;if(q)return this._model.selectionStart=[q.start.x-1,q.start.y-1],this._model.selectionStartLength=(0,b.getRangeLength)(q,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const P=this._getMouseBufferCoords(A);return!!P&&(this._selectWordAt(P,N),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,N){this._model.clearSelection(),A=Math.max(A,0),N=Math.min(N,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,N],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const N=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(N)return N[0]--,N[1]--,N[1]+=this._bufferService.buffer.ydisp,N}_getMouseEventScrollAmount(A){let N=(0,m.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const q=this._renderService.dimensions.css.canvas.height;return N>=0&&N<=q?0:(N>q&&(N-=q),N=Math.min(Math.max(N,-50),50),N/=50,N/Math.abs(N)+Math.round(14*N))}shouldForceSelection(A){return g.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const N=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);N&&N.length!==this._model.selectionStart[0]&&N.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const N=this._getMouseBufferCoords(A);N&&(this._activeSelectionMode=2,this._selectLineAt(N[1]))}shouldColumnSelect(A){return A.altKey&&!(g.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.stopImmediatePropagation(),!this._model.selectionStart)return;const N=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(A),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(A),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const q=this._bufferService.buffer;if(this._model.selectionEnd[1]<q.lines.length){const P=q.lines.get(this._model.selectionEnd[1]);P&&P.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}N&&N[0]===this._model.selectionEnd[0]&&N[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const N=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&N<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const q=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(q&&q[0]!==void 0&&q[1]!==void 0){const P=(0,_.moveToCellSequence)(q[0]-1,q[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(P,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,N=this._model.finalSelectionEnd,q=!(!A||!N||A[0]===N[0]&&A[1]===N[1]);q?A&&N&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&N[0]===this._oldSelectionEnd[0]&&N[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,N,q)):this._oldHasSelection&&this._fireOnSelectionChange(A,N,q)}_fireOnSelectionChange(A,N,q){this._oldSelectionStart=A,this._oldSelectionEnd=N,this._oldHasSelection=q,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((N=>this._handleTrim(N)))}_convertViewportColToCharacterIndex(A,N){let q=N;for(let P=0;N>=P;P++){const z=A.loadCell(P,this._workCell).getChars().length;this._workCell.getWidth()===0?q--:z>1&&N!==P&&(q+=z-1)}return q}setSelection(A,N,q){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,N],this._model.selectionStartLength=q,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,N,q=!0,P=!0){if(A[0]>=this._bufferService.cols)return;const z=this._bufferService.buffer,W=z.lines.get(A[1]);if(!W)return;const U=z.translateBufferLineToString(A[1],!1);let G=this._convertViewportColToCharacterIndex(W,A[0]),H=G;const K=A[0]-G;let F=0,k=0,$=0,B=0;if(U.charAt(G)===" "){for(;G>0&&U.charAt(G-1)===" ";)G--;for(;H<U.length&&U.charAt(H+1)===" ";)H++}else{let J=A[0],ae=A[0];W.getWidth(J)===0&&(F++,J--),W.getWidth(ae)===2&&(k++,ae++);const Z=W.getString(ae).length;for(Z>1&&(B+=Z-1,H+=Z-1);J>0&&G>0&&!this._isCharWordSeparator(W.loadCell(J-1,this._workCell));){W.loadCell(J-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(F++,J--):X>1&&($+=X-1,G-=X-1),G--,J--}for(;ae<W.length&&H+1<U.length&&!this._isCharWordSeparator(W.loadCell(ae+1,this._workCell));){W.loadCell(ae+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(k++,ae++):X>1&&(B+=X-1,H+=X-1),H++,ae++}}H++;let I=G+K-F+$,Q=Math.min(this._bufferService.cols,H-G+F+k-$-B);if(N||U.slice(G,H).trim()!==""){if(q&&I===0&&W.getCodePoint(0)!==32){const J=z.lines.get(A[1]-1);if(J&&W.isWrapped&&J.getCodePoint(this._bufferService.cols-1)!==32){const ae=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(ae){const Z=this._bufferService.cols-ae.start;I-=Z,Q+=Z}}}if(P&&I+Q===this._bufferService.cols&&W.getCodePoint(this._bufferService.cols-1)!==32){const J=z.lines.get(A[1]+1);if(J?.isWrapped&&J.getCodePoint(0)!==32){const ae=this._getWordAt([0,A[1]+1],!1,!1,!0);ae&&(Q+=ae.length)}}return{start:I,length:Q}}}_selectWordAt(A,N){const q=this._getWordAt(A,N);if(q){for(;q.start<0;)q.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[q.start,A[1]],this._model.selectionStartLength=q.length}}_selectToWordAt(A){const N=this._getWordAt(A,!0);if(N){let q=A[1];for(;N.start<0;)N.start+=this._bufferService.cols,q--;if(!this._model.areSelectionValuesReversed())for(;N.start+N.length>this._bufferService.cols;)N.length-=this._bufferService.cols,q++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?N.start:N.start+N.length,q]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const N=this._bufferService.buffer.getWrappedRangeForLine(A),q={start:{x:0,y:N.first},end:{x:this._bufferService.cols-1,y:N.last}};this._model.selectionStart=[0,N.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,b.getRangeLength)(q,this._bufferService.cols)}};l.SelectionService=D=c([v(3,E.IBufferService),v(4,E.ICoreService),v(5,C.IMouseService),v(6,E.IOptionsService),v(7,C.IRenderService),v(8,C.ICoreBrowserService)],D)},4725:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const c=u(8343);l.ICharSizeService=(0,c.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),l.IMouseService=(0,c.createDecorator)("MouseService"),l.IRenderService=(0,c.createDecorator)("RenderService"),l.ISelectionService=(0,c.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,c.createDecorator)("ThemeService")},6731:function(d,l,u){var c=this&&this.__decorate||function(D,A,N,q){var P,z=arguments.length,W=z<3?A:q===null?q=Object.getOwnPropertyDescriptor(A,N):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(D,A,N,q);else for(var U=D.length-1;U>=0;U--)(P=D[U])&&(W=(z<3?P(W):z>3?P(A,N,W):P(A,N))||W);return z>3&&W&&Object.defineProperty(A,N,W),W},v=this&&this.__param||function(D,A){return function(N,q){A(N,q,D)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const m=u(7239),_=u(8055),x=u(8460),C=u(844),S=u(2585),p=_.css.toColor("#ffffff"),g=_.css.toColor("#000000"),b=_.css.toColor("#ffffff"),y=_.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let N=0;N<216;N++){const q=A[N/36%6|0],P=A[N/6%6|0],z=A[N%6];D.push({css:_.channels.toCss(q,P,z),rgba:_.channels.toRgba(q,P,z)})}for(let N=0;N<24;N++){const q=8+10*N;D.push({css:_.channels.toCss(q,q,q),rgba:_.channels.toRgba(q,q,q)})}return D})());let T=l.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new m.ColorContrastCache,this._halfContrastCache=new m.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:p,background:g,cursor:b,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:_.color.blend(g,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:_.color.blend(g,E),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const A=this._colors;if(A.foreground=O(D.foreground,p),A.background=O(D.background,g),A.cursor=O(D.cursor,b),A.cursorAccent=O(D.cursorAccent,y),A.selectionBackgroundTransparent=O(D.selectionBackground,E),A.selectionBackgroundOpaque=_.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=O(D.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=_.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=D.selectionForeground?O(D.selectionForeground,_.NULL_COLOR):void 0,A.selectionForeground===_.NULL_COLOR&&(A.selectionForeground=void 0),_.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=_.color.opacity(A.selectionBackgroundTransparent,.3)),_.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=_.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=l.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=O(D.black,l.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=O(D.red,l.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=O(D.green,l.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=O(D.yellow,l.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=O(D.blue,l.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=O(D.magenta,l.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=O(D.cyan,l.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=O(D.white,l.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=O(D.brightBlack,l.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=O(D.brightRed,l.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=O(D.brightGreen,l.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=O(D.brightYellow,l.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=O(D.brightBlue,l.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=O(D.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=O(D.brightCyan,l.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=O(D.brightWhite,l.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const N=Math.min(A.ansi.length-16,D.extendedAnsi.length);for(let q=0;q<N;q++)A.ansi[q+16]=O(D.extendedAnsi[q],l.DEFAULT_ANSI_COLORS[q+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function O(D,A){if(D!==void 0)try{return _.css.toColor(D)}catch{}return A}l.ThemeService=T=c([v(0,S.IOptionsService)],T)},6349:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const c=u(8460),v=u(844);class m extends v.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const C=new Array(x);for(let S=0;S<Math.min(x,this.length);S++)C[S]=this._array[this._getCyclicIndex(S)];this._array=C,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let C=this._length;C<x;C++)this._array[C]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,C){this._array[this._getCyclicIndex(x)]=C}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(x,C,...S){if(C){for(let p=x;p<this._length-C;p++)this._array[this._getCyclicIndex(p)]=this._array[this._getCyclicIndex(p+C)];this._length-=C,this.onDeleteEmitter.fire({index:x,amount:C})}for(let p=this._length-1;p>=x;p--)this._array[this._getCyclicIndex(p+S.length)]=this._array[this._getCyclicIndex(p)];for(let p=0;p<S.length;p++)this._array[this._getCyclicIndex(x+p)]=S[p];if(S.length&&this.onInsertEmitter.fire({index:x,amount:S.length}),this._length+S.length>this._maxLength){const p=this._length+S.length-this._maxLength;this._startIndex+=p,this._length=this._maxLength,this.onTrimEmitter.fire(p)}else this._length+=S.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,C,S){if(!(C<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let g=C-1;g>=0;g--)this.set(x+g+S,this.get(x+g));const p=x+C+S-this._length;if(p>0)for(this._length+=p;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let p=0;p<C;p++)this.set(x+p+S,this.get(x+p))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}l.CircularList=m},1439:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(c,v=5){if(typeof c!="object")return c;const m=Array.isArray(c)?[]:{};for(const _ in c)m[_]=v<=1?c[_]:c[_]&&u(c[_],v-1);return m}},8055:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;const c=u(6114);let v=0,m=0,_=0,x=0;var C,S,p,g,b;function y(T){const O=T.toString(16);return O.length<2?"0"+O:O}function E(T,O){return T<O?(O+.05)/(T+.05):(T+.05)/(O+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(T){T.toCss=function(O,D,A,N){return N!==void 0?`#${y(O)}${y(D)}${y(A)}${y(N)}`:`#${y(O)}${y(D)}${y(A)}`},T.toRgba=function(O,D,A,N=255){return(O<<24|D<<16|A<<8|N)>>>0}})(C||(l.channels=C={})),(function(T){function O(D,A){return x=Math.round(255*A),[v,m,_]=b.toChannels(D.rgba),{css:C.toCss(v,m,_,x),rgba:C.toRgba(v,m,_,x)}}T.blend=function(D,A){if(x=(255&A.rgba)/255,x===1)return{css:A.css,rgba:A.rgba};const N=A.rgba>>24&255,q=A.rgba>>16&255,P=A.rgba>>8&255,z=D.rgba>>24&255,W=D.rgba>>16&255,U=D.rgba>>8&255;return v=z+Math.round((N-z)*x),m=W+Math.round((q-W)*x),_=U+Math.round((P-U)*x),{css:C.toCss(v,m,_),rgba:C.toRgba(v,m,_)}},T.isOpaque=function(D){return(255&D.rgba)==255},T.ensureContrastRatio=function(D,A,N){const q=b.ensureContrastRatio(D.rgba,A.rgba,N);if(q)return b.toColor(q>>24&255,q>>16&255,q>>8&255)},T.opaque=function(D){const A=(255|D.rgba)>>>0;return[v,m,_]=b.toChannels(A),{css:C.toCss(v,m,_),rgba:A}},T.opacity=O,T.multiplyOpacity=function(D,A){return x=255&D.rgba,O(D,x*A/255)},T.toColorRGB=function(D){return[D.rgba>>24&255,D.rgba>>16&255,D.rgba>>8&255]}})(S||(l.color=S={})),(function(T){let O,D;if(!c.isNode){const A=document.createElement("canvas");A.width=1,A.height=1;const N=A.getContext("2d",{willReadFrequently:!0});N&&(O=N,O.globalCompositeOperation="copy",D=O.createLinearGradient(0,0,1,1))}T.toColor=function(A){if(A.match(/#[\da-f]{3,8}/i))switch(A.length){case 4:return v=parseInt(A.slice(1,2).repeat(2),16),m=parseInt(A.slice(2,3).repeat(2),16),_=parseInt(A.slice(3,4).repeat(2),16),b.toColor(v,m,_);case 5:return v=parseInt(A.slice(1,2).repeat(2),16),m=parseInt(A.slice(2,3).repeat(2),16),_=parseInt(A.slice(3,4).repeat(2),16),x=parseInt(A.slice(4,5).repeat(2),16),b.toColor(v,m,_,x);case 7:return{css:A,rgba:(parseInt(A.slice(1),16)<<8|255)>>>0};case 9:return{css:A,rgba:parseInt(A.slice(1),16)>>>0}}const N=A.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(N)return v=parseInt(N[1]),m=parseInt(N[2]),_=parseInt(N[3]),x=Math.round(255*(N[5]===void 0?1:parseFloat(N[5]))),b.toColor(v,m,_,x);if(!O||!D)throw new Error("css.toColor: Unsupported css format");if(O.fillStyle=D,O.fillStyle=A,typeof O.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(O.fillRect(0,0,1,1),[v,m,_,x]=O.getImageData(0,0,1,1).data,x!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(v,m,_,x),css:A}}})(p||(l.css=p={})),(function(T){function O(D,A,N){const q=D/255,P=A/255,z=N/255;return .2126*(q<=.03928?q/12.92:Math.pow((q+.055)/1.055,2.4))+.7152*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))+.0722*(z<=.03928?z/12.92:Math.pow((z+.055)/1.055,2.4))}T.relativeLuminance=function(D){return O(D>>16&255,D>>8&255,255&D)},T.relativeLuminance2=O})(g||(l.rgb=g={})),(function(T){function O(A,N,q){const P=A>>24&255,z=A>>16&255,W=A>>8&255;let U=N>>24&255,G=N>>16&255,H=N>>8&255,K=E(g.relativeLuminance2(U,G,H),g.relativeLuminance2(P,z,W));for(;K<q&&(U>0||G>0||H>0);)U-=Math.max(0,Math.ceil(.1*U)),G-=Math.max(0,Math.ceil(.1*G)),H-=Math.max(0,Math.ceil(.1*H)),K=E(g.relativeLuminance2(U,G,H),g.relativeLuminance2(P,z,W));return(U<<24|G<<16|H<<8|255)>>>0}function D(A,N,q){const P=A>>24&255,z=A>>16&255,W=A>>8&255;let U=N>>24&255,G=N>>16&255,H=N>>8&255,K=E(g.relativeLuminance2(U,G,H),g.relativeLuminance2(P,z,W));for(;K<q&&(U<255||G<255||H<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),G=Math.min(255,G+Math.ceil(.1*(255-G))),H=Math.min(255,H+Math.ceil(.1*(255-H))),K=E(g.relativeLuminance2(U,G,H),g.relativeLuminance2(P,z,W));return(U<<24|G<<16|H<<8|255)>>>0}T.ensureContrastRatio=function(A,N,q){const P=g.relativeLuminance(A>>8),z=g.relativeLuminance(N>>8);if(E(P,z)<q){if(z<P){const G=O(A,N,q),H=E(P,g.relativeLuminance(G>>8));if(H<q){const K=D(A,N,q);return H>E(P,g.relativeLuminance(K>>8))?G:K}return G}const W=D(A,N,q),U=E(P,g.relativeLuminance(W>>8));if(U<q){const G=O(A,N,q);return U>E(P,g.relativeLuminance(G>>8))?W:G}return W}},T.reduceLuminance=O,T.increaseLuminance=D,T.toChannels=function(A){return[A>>24&255,A>>16&255,A>>8&255,255&A]},T.toColor=function(A,N,q,P){return{css:C.toCss(A,N,q,P),rgba:C.toRgba(A,N,q,P)}}})(b||(l.rgba=b={})),l.toPaddedHex=y,l.contrastRatio=E},8969:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const c=u(844),v=u(2585),m=u(4348),_=u(7866),x=u(744),C=u(7302),S=u(6975),p=u(8460),g=u(1753),b=u(1480),y=u(7994),E=u(9282),T=u(5435),O=u(5981),D=u(2660);let A=!1;class N extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new p.EventEmitter),this._onScroll.event((P=>{this._onScrollApi?.fire(P.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(P){for(const z in P)this.optionsService.options[z]=P[z]}constructor(P){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new p.EventEmitter),this._instantiationService=new m.InstantiationService,this.optionsService=this.register(new C.OptionsService(P)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(g.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(b.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new T.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,p.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,p.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,p.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,p.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((z=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((z=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new O.WriteBuffer(((z,W)=>this._inputHandler.parse(z,W)))),this.register((0,p.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(P,z){this._writeBuffer.write(P,z)}writeSync(P,z){this._logService.logLevel<=v.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(P,z)}resize(P,z){isNaN(P)||isNaN(z)||(P=Math.max(P,x.MINIMUM_COLS),z=Math.max(z,x.MINIMUM_ROWS),this._bufferService.resize(P,z))}scroll(P,z=!1){this._bufferService.scroll(P,z)}scrollLines(P,z,W){this._bufferService.scrollLines(P,z,W)}scrollPages(P){this.scrollLines(P*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(P){const z=P-this._bufferService.buffer.ydisp;z!==0&&this.scrollLines(z)}registerEscHandler(P,z){return this._inputHandler.registerEscHandler(P,z)}registerDcsHandler(P,z){return this._inputHandler.registerDcsHandler(P,z)}registerCsiHandler(P,z){return this._inputHandler.registerCsiHandler(P,z)}registerOscHandler(P,z){return this._inputHandler.registerOscHandler(P,z)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let P=!1;const z=this.optionsService.rawOptions.windowsPty;z&&z.buildNumber!==void 0&&z.buildNumber!==void 0?P=z.backend==="conpty"&&z.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(P=!0),P?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const P=[];P.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),P.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const z of P)z.dispose()}))}}}l.CoreTerminal=N},8460:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===u)return void this._listeners.splice(c,1)}}})),this._event}fire(u,c){const v=[];for(let m=0;m<this._listeners.length;m++)v.push(this._listeners[m]);for(let m=0;m<v.length;m++)v[m].call(void 0,u,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(u,c){return u((v=>c.fire(v)))},l.runAndSubscribe=function(u,c){return c(void 0),u((v=>c(v)))}},5435:function(d,l,u){var c=this&&this.__decorate||function(F,k,$,B){var I,Q=arguments.length,J=Q<3?k:B===null?B=Object.getOwnPropertyDescriptor(k,$):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(F,k,$,B);else for(var ae=F.length-1;ae>=0;ae--)(I=F[ae])&&(J=(Q<3?I(J):Q>3?I(k,$,J):I(k,$))||J);return Q>3&&J&&Object.defineProperty(k,$,J),J},v=this&&this.__param||function(F,k){return function($,B){k($,B,F)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const m=u(2584),_=u(7116),x=u(2015),C=u(844),S=u(482),p=u(8437),g=u(8460),b=u(643),y=u(511),E=u(3734),T=u(2585),O=u(1480),D=u(6242),A=u(6351),N=u(5941),q={"(":0,")":1,"*":2,"+":3,"-":1,".":2},P=131072;function z(F,k){if(F>24)return k.setWinLines||!1;switch(F){case 1:return!!k.restoreWin;case 2:return!!k.minimizeWin;case 3:return!!k.setWinPosition;case 4:return!!k.setWinSizePixels;case 5:return!!k.raiseWin;case 6:return!!k.lowerWin;case 7:return!!k.refreshWin;case 8:return!!k.setWinSizeChars;case 9:return!!k.maximizeWin;case 10:return!!k.fullscreenWin;case 11:return!!k.getWinState;case 13:return!!k.getWinPosition;case 14:return!!k.getWinSizePixels;case 15:return!!k.getScreenSizePixels;case 16:return!!k.getCellSizePixels;case 18:return!!k.getWinSizeChars;case 19:return!!k.getScreenSizeChars;case 20:return!!k.getIconTitle;case 21:return!!k.getWinTitle;case 22:return!!k.pushTitle;case 23:return!!k.popTitle;case 24:return!!k.setWinLines}return!1}var W;(function(F){F[F.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",F[F.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(W||(l.WindowsOptionsReportType=W={}));let U=0;class G extends C.Disposable{getAttrData(){return this._curAttrData}constructor(k,$,B,I,Q,J,ae,Z,X=new x.EscapeSequenceParser){super(),this._bufferService=k,this._charsetService=$,this._coreService=B,this._logService=I,this._optionsService=Q,this._oscLinkService=J,this._coreMouseService=ae,this._unicodeService=Z,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new g.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new g.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new g.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new g.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new g.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new g.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new g.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new g.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new g.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new g.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new g.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new g.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new H(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((V=>this._activeBuffer=V.activeBuffer))),this._parser.setCsiHandlerFallback(((V,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(V),params:ie.toArray()})})),this._parser.setEscHandlerFallback((V=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(V)})})),this._parser.setExecuteHandlerFallback((V=>{this._logService.debug("Unknown EXECUTE code: ",{code:V})})),this._parser.setOscHandlerFallback(((V,ie,de)=>{this._logService.debug("Unknown OSC code: ",{identifier:V,action:ie,data:de})})),this._parser.setDcsHandlerFallback(((V,ie,de)=>{ie==="HOOK"&&(de=de.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(V),action:ie,payload:de})})),this._parser.setPrintHandler(((V,ie,de)=>this.print(V,ie,de))),this._parser.registerCsiHandler({final:"@"},(V=>this.insertChars(V))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(V=>this.scrollLeft(V))),this._parser.registerCsiHandler({final:"A"},(V=>this.cursorUp(V))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(V=>this.scrollRight(V))),this._parser.registerCsiHandler({final:"B"},(V=>this.cursorDown(V))),this._parser.registerCsiHandler({final:"C"},(V=>this.cursorForward(V))),this._parser.registerCsiHandler({final:"D"},(V=>this.cursorBackward(V))),this._parser.registerCsiHandler({final:"E"},(V=>this.cursorNextLine(V))),this._parser.registerCsiHandler({final:"F"},(V=>this.cursorPrecedingLine(V))),this._parser.registerCsiHandler({final:"G"},(V=>this.cursorCharAbsolute(V))),this._parser.registerCsiHandler({final:"H"},(V=>this.cursorPosition(V))),this._parser.registerCsiHandler({final:"I"},(V=>this.cursorForwardTab(V))),this._parser.registerCsiHandler({final:"J"},(V=>this.eraseInDisplay(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(V=>this.eraseInDisplay(V,!0))),this._parser.registerCsiHandler({final:"K"},(V=>this.eraseInLine(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(V=>this.eraseInLine(V,!0))),this._parser.registerCsiHandler({final:"L"},(V=>this.insertLines(V))),this._parser.registerCsiHandler({final:"M"},(V=>this.deleteLines(V))),this._parser.registerCsiHandler({final:"P"},(V=>this.deleteChars(V))),this._parser.registerCsiHandler({final:"S"},(V=>this.scrollUp(V))),this._parser.registerCsiHandler({final:"T"},(V=>this.scrollDown(V))),this._parser.registerCsiHandler({final:"X"},(V=>this.eraseChars(V))),this._parser.registerCsiHandler({final:"Z"},(V=>this.cursorBackwardTab(V))),this._parser.registerCsiHandler({final:"`"},(V=>this.charPosAbsolute(V))),this._parser.registerCsiHandler({final:"a"},(V=>this.hPositionRelative(V))),this._parser.registerCsiHandler({final:"b"},(V=>this.repeatPrecedingCharacter(V))),this._parser.registerCsiHandler({final:"c"},(V=>this.sendDeviceAttributesPrimary(V))),this._parser.registerCsiHandler({prefix:">",final:"c"},(V=>this.sendDeviceAttributesSecondary(V))),this._parser.registerCsiHandler({final:"d"},(V=>this.linePosAbsolute(V))),this._parser.registerCsiHandler({final:"e"},(V=>this.vPositionRelative(V))),this._parser.registerCsiHandler({final:"f"},(V=>this.hVPosition(V))),this._parser.registerCsiHandler({final:"g"},(V=>this.tabClear(V))),this._parser.registerCsiHandler({final:"h"},(V=>this.setMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(V=>this.setModePrivate(V))),this._parser.registerCsiHandler({final:"l"},(V=>this.resetMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(V=>this.resetModePrivate(V))),this._parser.registerCsiHandler({final:"m"},(V=>this.charAttributes(V))),this._parser.registerCsiHandler({final:"n"},(V=>this.deviceStatus(V))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(V=>this.deviceStatusPrivate(V))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(V=>this.softReset(V))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(V=>this.setCursorStyle(V))),this._parser.registerCsiHandler({final:"r"},(V=>this.setScrollRegion(V))),this._parser.registerCsiHandler({final:"s"},(V=>this.saveCursor(V))),this._parser.registerCsiHandler({final:"t"},(V=>this.windowOptions(V))),this._parser.registerCsiHandler({final:"u"},(V=>this.restoreCursor(V))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(V=>this.insertColumns(V))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(V=>this.deleteColumns(V))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(V=>this.selectProtected(V))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(V=>this.requestMode(V,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(V=>this.requestMode(V,!1))),this._parser.setExecuteHandler(m.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(m.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(m.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(m.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(m.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(m.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(m.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(m.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(m.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((V=>(this.setTitle(V),this.setIconName(V),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((V=>this.setIconName(V)))),this._parser.registerOscHandler(2,new D.OscHandler((V=>this.setTitle(V)))),this._parser.registerOscHandler(4,new D.OscHandler((V=>this.setOrReportIndexedColor(V)))),this._parser.registerOscHandler(8,new D.OscHandler((V=>this.setHyperlink(V)))),this._parser.registerOscHandler(10,new D.OscHandler((V=>this.setOrReportFgColor(V)))),this._parser.registerOscHandler(11,new D.OscHandler((V=>this.setOrReportBgColor(V)))),this._parser.registerOscHandler(12,new D.OscHandler((V=>this.setOrReportCursorColor(V)))),this._parser.registerOscHandler(104,new D.OscHandler((V=>this.restoreIndexedColor(V)))),this._parser.registerOscHandler(110,new D.OscHandler((V=>this.restoreFgColor(V)))),this._parser.registerOscHandler(111,new D.OscHandler((V=>this.restoreBgColor(V)))),this._parser.registerOscHandler(112,new D.OscHandler((V=>this.restoreCursorColor(V)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const V in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:V},(()=>this.selectCharset("("+V))),this._parser.registerEscHandler({intermediates:")",final:V},(()=>this.selectCharset(")"+V))),this._parser.registerEscHandler({intermediates:"*",final:V},(()=>this.selectCharset("*"+V))),this._parser.registerEscHandler({intermediates:"+",final:V},(()=>this.selectCharset("+"+V))),this._parser.registerEscHandler({intermediates:"-",final:V},(()=>this.selectCharset("-"+V))),this._parser.registerEscHandler({intermediates:".",final:V},(()=>this.selectCharset("."+V))),this._parser.registerEscHandler({intermediates:"/",final:V},(()=>this.selectCharset("/"+V)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((V=>(this._logService.error("Parsing error: ",V),V))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new A.DcsHandler(((V,ie)=>this.requestStatusString(V,ie))))}_preserveStack(k,$,B,I){this._parseStack.paused=!0,this._parseStack.cursorStartX=k,this._parseStack.cursorStartY=$,this._parseStack.decodedLength=B,this._parseStack.position=I}_logSlowResolvingAsync(k){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([k,new Promise((($,B)=>setTimeout((()=>B("#SLOW_TIMEOUT")),5e3)))]).catch(($=>{if($!=="#SLOW_TIMEOUT")throw $;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(k,$){let B,I=this._activeBuffer.x,Q=this._activeBuffer.y,J=0;const ae=this._parseStack.paused;if(ae){if(B=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,$))return this._logSlowResolvingAsync(B),B;I=this._parseStack.cursorStartX,Q=this._parseStack.cursorStartY,this._parseStack.paused=!1,k.length>P&&(J=this._parseStack.position+P)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof k=="string"?` "${k}"`:` "${Array.prototype.map.call(k,(V=>String.fromCharCode(V))).join("")}"`),typeof k=="string"?k.split("").map((V=>V.charCodeAt(0))):k),this._parseBuffer.length<k.length&&this._parseBuffer.length<P&&(this._parseBuffer=new Uint32Array(Math.min(k.length,P))),ae||this._dirtyRowTracker.clearRange(),k.length>P)for(let V=J;V<k.length;V+=P){const ie=V+P<k.length?V+P:k.length,de=typeof k=="string"?this._stringDecoder.decode(k.substring(V,ie),this._parseBuffer):this._utf8Decoder.decode(k.subarray(V,ie),this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,de))return this._preserveStack(I,Q,de,V),this._logSlowResolvingAsync(B),B}else if(!ae){const V=typeof k=="string"?this._stringDecoder.decode(k,this._parseBuffer):this._utf8Decoder.decode(k,this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,V))return this._preserveStack(I,Q,V,0),this._logSlowResolvingAsync(B),B}this._activeBuffer.x===I&&this._activeBuffer.y===Q||this._onCursorMove.fire();const Z=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(Z,this._bufferService.rows-1))}print(k,$,B){let I,Q;const J=this._charsetService.charset,ae=this._optionsService.rawOptions.screenReaderMode,Z=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,V=this._coreService.modes.insertMode,ie=this._curAttrData;let de=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&B-$>0&&de.getWidth(this._activeBuffer.x-1)===2&&de.setCellFromCodePoint(this._activeBuffer.x-1,0,1,ie.fg,ie.bg,ie.extended);let re=this._parser.precedingJoinState;for(let le=$;le<B;++le){if(I=k[le],I<127&&J){const ke=J[String.fromCharCode(I)];ke&&(I=ke.charCodeAt(0))}const _e=this._unicodeService.charProperties(I,re);Q=O.UnicodeService.extractWidth(_e);const Ee=O.UnicodeService.extractShouldJoin(_e),He=Ee?O.UnicodeService.extractWidth(re):0;if(re=_e,ae&&this._onA11yChar.fire((0,S.stringFromCodePoint)(I)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Q-He>Z){if(X){const ke=de;let Ce=this._activeBuffer.x-He;for(this._activeBuffer.x=He,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),de=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),He>0&&de instanceof p.BufferLine&&de.copyCellsFrom(ke,Ce,0,He,!1);Ce<Z;)ke.setCellFromCodePoint(Ce++,0,1,ie.fg,ie.bg,ie.extended)}else if(this._activeBuffer.x=Z-1,Q===2)continue}if(Ee&&this._activeBuffer.x){const ke=de.getWidth(this._activeBuffer.x-1)?1:2;de.addCodepointToCell(this._activeBuffer.x-ke,I,Q);for(let Ce=Q-He;--Ce>=0;)de.setCellFromCodePoint(this._activeBuffer.x++,0,0,ie.fg,ie.bg,ie.extended)}else if(V&&(de.insertCells(this._activeBuffer.x,Q-He,this._activeBuffer.getNullCell(ie),ie),de.getWidth(Z-1)===2&&de.setCellFromCodePoint(Z-1,b.NULL_CELL_CODE,b.NULL_CELL_WIDTH,ie.fg,ie.bg,ie.extended)),de.setCellFromCodePoint(this._activeBuffer.x++,I,Q,ie.fg,ie.bg,ie.extended),Q>0)for(;--Q;)de.setCellFromCodePoint(this._activeBuffer.x++,0,0,ie.fg,ie.bg,ie.extended)}this._parser.precedingJoinState=re,this._activeBuffer.x<Z&&B-$>0&&de.getWidth(this._activeBuffer.x)===0&&!de.hasContent(this._activeBuffer.x)&&de.setCellFromCodePoint(this._activeBuffer.x,0,1,ie.fg,ie.bg,ie.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(k,$){return k.final!=="t"||k.prefix||k.intermediates?this._parser.registerCsiHandler(k,$):this._parser.registerCsiHandler(k,(B=>!z(B.params[0],this._optionsService.rawOptions.windowOptions)||$(B)))}registerDcsHandler(k,$){return this._parser.registerDcsHandler(k,new A.DcsHandler($))}registerEscHandler(k,$){return this._parser.registerEscHandler(k,$)}registerOscHandler(k,$){return this._parser.registerOscHandler(k,new D.OscHandler($))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);k.hasWidth(this._activeBuffer.x)&&!k.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const k=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-k),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(k=this._bufferService.cols-1){this._activeBuffer.x=Math.min(k,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(k,$){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=k,this._activeBuffer.y=this._activeBuffer.scrollTop+$):(this._activeBuffer.x=k,this._activeBuffer.y=$),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(k,$){this._restrictCursor(),this._setCursor(this._activeBuffer.x+k,this._activeBuffer.y+$)}cursorUp(k){const $=this._activeBuffer.y-this._activeBuffer.scrollTop;return $>=0?this._moveCursor(0,-Math.min($,k.params[0]||1)):this._moveCursor(0,-(k.params[0]||1)),!0}cursorDown(k){const $=this._activeBuffer.scrollBottom-this._activeBuffer.y;return $>=0?this._moveCursor(0,Math.min($,k.params[0]||1)):this._moveCursor(0,k.params[0]||1),!0}cursorForward(k){return this._moveCursor(k.params[0]||1,0),!0}cursorBackward(k){return this._moveCursor(-(k.params[0]||1),0),!0}cursorNextLine(k){return this.cursorDown(k),this._activeBuffer.x=0,!0}cursorPrecedingLine(k){return this.cursorUp(k),this._activeBuffer.x=0,!0}cursorCharAbsolute(k){return this._setCursor((k.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(k){return this._setCursor(k.length>=2?(k.params[1]||1)-1:0,(k.params[0]||1)-1),!0}charPosAbsolute(k){return this._setCursor((k.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(k){return this._moveCursor(k.params[0]||1,0),!0}linePosAbsolute(k){return this._setCursor(this._activeBuffer.x,(k.params[0]||1)-1),!0}vPositionRelative(k){return this._moveCursor(0,k.params[0]||1),!0}hVPosition(k){return this.cursorPosition(k),!0}tabClear(k){const $=k.params[0];return $===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:$===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(k){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=k.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(k){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=k.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(k){const $=k.params[0];return $===1&&(this._curAttrData.bg|=536870912),$!==2&&$!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(k,$,B,I=!1,Q=!1){const J=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);J.replaceCells($,B,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),Q),I&&(J.isWrapped=!1)}_resetBufferLine(k,$=!1){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);B&&(B.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),$),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+k),B.isWrapped=!1)}eraseInDisplay(k,$=!1){let B;switch(this._restrictCursor(this._bufferService.cols),k.params[0]){case 0:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);B<this._bufferService.rows;B++)this._resetBufferLine(B,$);this._dirtyRowTracker.markDirty(B);break;case 1:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B,0,this._activeBuffer.x+1,!0,$),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(B+1).isWrapped=!1);B--;)this._resetBufferLine(B,$);this._dirtyRowTracker.markDirty(0);break;case 2:for(B=this._bufferService.rows,this._dirtyRowTracker.markDirty(B-1);B--;)this._resetBufferLine(B,$);this._dirtyRowTracker.markDirty(0);break;case 3:const I=this._activeBuffer.lines.length-this._bufferService.rows;I>0&&(this._activeBuffer.lines.trimStart(I),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-I,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-I,0),this._onScroll.fire(0))}return!0}eraseInLine(k,$=!1){switch(this._restrictCursor(this._bufferService.cols),k.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,$);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,$)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(k){this._restrictCursor();let $=k.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y,I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Q=this._bufferService.rows-1+this._activeBuffer.ybase-I+1;for(;$--;)this._activeBuffer.lines.splice(Q-1,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(k){this._restrictCursor();let $=k.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y;let I;for(I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-I;$--;)this._activeBuffer.lines.splice(B,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(k){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.insertCells(this._activeBuffer.x,k.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(k){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.deleteCells(this._activeBuffer.x,k.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(k){let $=k.params[0]||1;for(;$--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(k){let $=k.params[0]||1;for(;$--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(p.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=k.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);I.deleteCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=k.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);I.insertCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=k.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);I.insertCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=k.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);I.deleteCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(k){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(k.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(k){const $=this._parser.precedingJoinState;if(!$)return!0;const B=k.params[0]||1,I=O.UnicodeService.extractWidth($),Q=this._activeBuffer.x-I,J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Q),ae=new Uint32Array(J.length*B);let Z=0;for(let V=0;V<J.length;){const ie=J.codePointAt(V)||0;ae[Z++]=ie,V+=ie>65535?2:1}let X=Z;for(let V=1;V<B;++V)ae.copyWithin(X,0,Z),X+=Z;return this.print(ae,0,X),!0}sendDeviceAttributesPrimary(k){return k.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(m.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(m.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(k){return k.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(m.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(m.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(k.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(m.C0.ESC+"[>83;40003;0c")),!0}_is(k){return(this._optionsService.rawOptions.termName+"").indexOf(k)===0}setMode(k){for(let $=0;$<k.length;$++)switch(k.params[$]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(k){for(let $=0;$<k.length;$++)switch(k.params[$]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(k){for(let $=0;$<k.length;$++)switch(k.params[$]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(k){for(let $=0;$<k.length;$++)switch(k.params[$]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),k.params[$]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(k,$){const B=this._coreService.decPrivateModes,{activeProtocol:I,activeEncoding:Q}=this._coreMouseService,J=this._coreService,{buffers:ae,cols:Z}=this._bufferService,{active:X,alt:V}=ae,ie=this._optionsService.rawOptions,de=Ee=>Ee?1:2,re=k.params[0];return le=re,_e=$?re===2?4:re===4?de(J.modes.insertMode):re===12?3:re===20?de(ie.convertEol):0:re===1?de(B.applicationCursorKeys):re===3?ie.windowOptions.setWinLines?Z===80?2:Z===132?1:0:0:re===6?de(B.origin):re===7?de(B.wraparound):re===8?3:re===9?de(I==="X10"):re===12?de(ie.cursorBlink):re===25?de(!J.isCursorHidden):re===45?de(B.reverseWraparound):re===66?de(B.applicationKeypad):re===67?4:re===1e3?de(I==="VT200"):re===1002?de(I==="DRAG"):re===1003?de(I==="ANY"):re===1004?de(B.sendFocus):re===1005?4:re===1006?de(Q==="SGR"):re===1015?4:re===1016?de(Q==="SGR_PIXELS"):re===1048?1:re===47||re===1047||re===1049?de(X===V):re===2004?de(B.bracketedPasteMode):0,J.triggerDataEvent(`${m.C0.ESC}[${$?"":"?"}${le};${_e}$y`),!0;var le,_e}_updateAttrColor(k,$,B,I,Q){return $===2?(k|=50331648,k&=-16777216,k|=E.AttributeData.fromColorRGB([B,I,Q])):$===5&&(k&=-50331904,k|=33554432|255&B),k}_extractColor(k,$,B){const I=[0,0,-1,0,0,0];let Q=0,J=0;do{if(I[J+Q]=k.params[$+J],k.hasSubParams($+J)){const ae=k.getSubParams($+J);let Z=0;do I[1]===5&&(Q=1),I[J+Z+1+Q]=ae[Z];while(++Z<ae.length&&Z+J+1+Q<I.length);break}if(I[1]===5&&J+Q>=2||I[1]===2&&J+Q>=5)break;I[1]&&(Q=1)}while(++J+$<k.length&&J+Q<I.length);for(let ae=2;ae<I.length;++ae)I[ae]===-1&&(I[ae]=0);switch(I[0]){case 38:B.fg=this._updateAttrColor(B.fg,I[1],I[3],I[4],I[5]);break;case 48:B.bg=this._updateAttrColor(B.bg,I[1],I[3],I[4],I[5]);break;case 58:B.extended=B.extended.clone(),B.extended.underlineColor=this._updateAttrColor(B.extended.underlineColor,I[1],I[3],I[4],I[5])}return J}_processUnderline(k,$){$.extended=$.extended.clone(),(!~k||k>5)&&(k=1),$.extended.underlineStyle=k,$.fg|=268435456,k===0&&($.fg&=-268435457),$.updateExtended()}_processSGR0(k){k.fg=p.DEFAULT_ATTR_DATA.fg,k.bg=p.DEFAULT_ATTR_DATA.bg,k.extended=k.extended.clone(),k.extended.underlineStyle=0,k.extended.underlineColor&=-67108864,k.updateExtended()}charAttributes(k){if(k.length===1&&k.params[0]===0)return this._processSGR0(this._curAttrData),!0;const $=k.length;let B;const I=this._curAttrData;for(let Q=0;Q<$;Q++)B=k.params[Q],B>=30&&B<=37?(I.fg&=-50331904,I.fg|=16777216|B-30):B>=40&&B<=47?(I.bg&=-50331904,I.bg|=16777216|B-40):B>=90&&B<=97?(I.fg&=-50331904,I.fg|=16777224|B-90):B>=100&&B<=107?(I.bg&=-50331904,I.bg|=16777224|B-100):B===0?this._processSGR0(I):B===1?I.fg|=134217728:B===3?I.bg|=67108864:B===4?(I.fg|=268435456,this._processUnderline(k.hasSubParams(Q)?k.getSubParams(Q)[0]:1,I)):B===5?I.fg|=536870912:B===7?I.fg|=67108864:B===8?I.fg|=1073741824:B===9?I.fg|=2147483648:B===2?I.bg|=134217728:B===21?this._processUnderline(2,I):B===22?(I.fg&=-134217729,I.bg&=-134217729):B===23?I.bg&=-67108865:B===24?(I.fg&=-268435457,this._processUnderline(0,I)):B===25?I.fg&=-536870913:B===27?I.fg&=-67108865:B===28?I.fg&=-1073741825:B===29?I.fg&=2147483647:B===39?(I.fg&=-67108864,I.fg|=16777215&p.DEFAULT_ATTR_DATA.fg):B===49?(I.bg&=-67108864,I.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):B===38||B===48||B===58?Q+=this._extractColor(k,Q,I):B===53?I.bg|=1073741824:B===55?I.bg&=-1073741825:B===59?(I.extended=I.extended.clone(),I.extended.underlineColor=-1,I.updateExtended()):B===100?(I.fg&=-67108864,I.fg|=16777215&p.DEFAULT_ATTR_DATA.fg,I.bg&=-67108864,I.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",B);return!0}deviceStatus(k){switch(k.params[0]){case 5:this._coreService.triggerDataEvent(`${m.C0.ESC}[0n`);break;case 6:const $=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[${$};${B}R`)}return!0}deviceStatusPrivate(k){if(k.params[0]===6){const $=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[?${$};${B}R`)}return!0}softReset(k){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=p.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(k){const $=k.params[0]||1;switch($){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const B=$%2==1;return this._optionsService.options.cursorBlink=B,!0}setScrollRegion(k){const $=k.params[0]||1;let B;return(k.length<2||(B=k.params[1])>this._bufferService.rows||B===0)&&(B=this._bufferService.rows),B>$&&(this._activeBuffer.scrollTop=$-1,this._activeBuffer.scrollBottom=B-1,this._setCursor(0,0)),!0}windowOptions(k){if(!z(k.params[0],this._optionsService.rawOptions.windowOptions))return!0;const $=k.length>1?k.params[1]:0;switch(k.params[0]){case 14:$!==2&&this._onRequestWindowsOptionsReport.fire(W.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(W.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${m.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:$!==0&&$!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),$!==0&&$!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:$!==0&&$!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),$!==0&&$!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(k){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(k){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(k){return this._windowTitle=k,this._onTitleChange.fire(k),!0}setIconName(k){return this._iconName=k,!0}setOrReportIndexedColor(k){const $=[],B=k.split(";");for(;B.length>1;){const I=B.shift(),Q=B.shift();if(/^\d+$/.exec(I)){const J=parseInt(I);if(K(J))if(Q==="?")$.push({type:0,index:J});else{const ae=(0,N.parseColor)(Q);ae&&$.push({type:1,index:J,color:ae})}}}return $.length&&this._onColor.fire($),!0}setHyperlink(k){const $=k.split(";");return!($.length<2)&&($[1]?this._createHyperlink($[0],$[1]):!$[0]&&this._finishHyperlink())}_createHyperlink(k,$){this._getCurrentLinkId()&&this._finishHyperlink();const B=k.split(":");let I;const Q=B.findIndex((J=>J.startsWith("id=")));return Q!==-1&&(I=B[Q].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:I,uri:$}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(k,$){const B=k.split(";");for(let I=0;I<B.length&&!($>=this._specialColors.length);++I,++$)if(B[I]==="?")this._onColor.fire([{type:0,index:this._specialColors[$]}]);else{const Q=(0,N.parseColor)(B[I]);Q&&this._onColor.fire([{type:1,index:this._specialColors[$],color:Q}])}return!0}setOrReportFgColor(k){return this._setOrReportSpecialColor(k,0)}setOrReportBgColor(k){return this._setOrReportSpecialColor(k,1)}setOrReportCursorColor(k){return this._setOrReportSpecialColor(k,2)}restoreIndexedColor(k){if(!k)return this._onColor.fire([{type:2}]),!0;const $=[],B=k.split(";");for(let I=0;I<B.length;++I)if(/^\d+$/.exec(B[I])){const Q=parseInt(B[I]);K(Q)&&$.push({type:2,index:Q})}return $.length&&this._onColor.fire($),!0}restoreFgColor(k){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(k){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(k){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),!0}selectCharset(k){return k.length!==2?(this.selectDefaultCharset(),!0):(k[0]==="/"||this._charsetService.setgCharset(q[k[0]],_.CHARSETS[k[1]]||_.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const k=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,k,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(k){return this._charsetService.setgLevel(k),!0}screenAlignmentPattern(){const k=new y.CellData;k.content=4194373,k.fg=this._curAttrData.fg,k.bg=this._curAttrData.bg,this._setCursor(0,0);for(let $=0;$<this._bufferService.rows;++$){const B=this._activeBuffer.ybase+this._activeBuffer.y+$,I=this._activeBuffer.lines.get(B);I&&(I.fill(k),I.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(k,$){const B=this._bufferService.buffer,I=this._optionsService.rawOptions;return(Q=>(this._coreService.triggerDataEvent(`${m.C0.ESC}${Q}${m.C0.ESC}\\`),!0))(k==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:k==='"p'?'P1$r61;1"p':k==="r"?`P1$r${B.scrollTop+1};${B.scrollBottom+1}r`:k==="m"?"P1$r0m":k===" q"?`P1$r${{block:2,underline:4,bar:6}[I.cursorStyle]-(I.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(k,$){this._dirtyRowTracker.markRangeDirty(k,$)}}l.InputHandler=G;let H=class{constructor(F){this._bufferService=F,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(F){F<this.start?this.start=F:F>this.end&&(this.end=F)}markRangeDirty(F,k){F>k&&(U=F,F=k,k=U),F<this.start&&(this.start=F),k>this.end&&(this.end=k)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(F){return 0<=F&&F<256}H=c([v(0,T.IBufferService)],H)},844:(d,l)=>{function u(c){for(const v of c)v.dispose();c.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const v=this._disposables.indexOf(c);v!==-1&&this._disposables.splice(v,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){this._isDisposed||c===this._value||(this._value?.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},l.toDisposable=function(c){return{dispose:c}},l.disposeArray=u,l.getDisposeArrayDisposable=function(c){return{dispose:()=>u(c)}}},1505:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(v,m,_){this._data[v]||(this._data[v]={}),this._data[v][m]=_}get(v,m){return this._data[v]?this._data[v][m]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(c,v,m,_,x){this._data.get(c,v)||this._data.set(c,v,new u),this._data.get(c,v).set(m,_,x)}get(c,v,m,_){return this._data.get(c,v)?.get(m,_)}clear(){this._data.clear()}}},6114:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u";const u=l.isNode?"node":navigator.userAgent,c=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const v=u.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),l.isIpad=c==="iPad",l.isIphone=c==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),l.isLinux=c.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(u=this._search(this._getKey(c)),this._array.splice(u,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const v=this._getKey(c);if(v===void 0||(u=this._search(v),u===-1)||this._getKey(this._array[u])!==v)return!1;do if(this._array[u]===c)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===v);return!1}*getKeyIterator(c){if(this._array.length!==0&&(u=this._search(c),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===c))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===c)}forEachByKey(c,v){if(this._array.length!==0&&(u=this._search(c),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===c))do v(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===c)}values(){return[...this._array].values()}_search(c){let v=0,m=this._array.length-1;for(;m>=v;){let _=v+m>>1;const x=this._getKey(this._array[_]);if(x>c)m=_-1;else{if(!(x<c)){for(;_>0&&this._getKey(this._array[_-1])===c;)_--;return _}v=_+1}}return v}}},7226:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const c=u(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let C=0,S=0,p=x.timeRemaining(),g=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),S=Math.max(C,S),g=x.timeRemaining(),1.5*S>g)return p-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(p-C))}ms`),void this._start();p=g}this.clear()}}class m extends v{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const C=Date.now()+x;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}l.PriorityTaskQueue=m,l.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:m,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const c=u(643);l.updateWindowsModeWrappedState=function(v){const m=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),_=m?.get(v.cols-1),x=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);x&&_&&(x.isWrapped=_[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&_[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(m){return[m>>>16&255,m>>>8&255,255&m]}static fromColorRGB(m){return(255&m[0])<<16|(255&m[1])<<8|255&m[2]}clone(){const m=new u;return m.fg=this.fg,m.bg=this.bg,m.extended=this.extended.clone(),m}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}l.AttributeData=u;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(m){this._ext=m}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(m){this._ext&=-469762049,this._ext|=m<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(m){this._ext&=-67108864,this._ext|=67108863&m}get urlId(){return this._urlId}set urlId(m){this._urlId=m}constructor(m=0,_=0){this._ext=0,this._urlId=0,this._ext=m,this._urlId=_}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=c},9092:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const c=u(6349),v=u(7226),m=u(3734),_=u(8437),x=u(4634),C=u(511),S=u(643),p=u(4863),g=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(b,y,E){this._hasScrollback=b,this._optionsService=y,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=g.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(b){return b?(this._nullCell.fg=b.fg,this._nullCell.bg=b.bg,this._nullCell.extended=b.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new m.ExtendedAttrs),this._nullCell}getWhitespaceCell(b){return b?(this._whitespaceCell.fg=b.fg,this._whitespaceCell.bg=b.bg,this._whitespaceCell.extended=b.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new m.ExtendedAttrs),this._whitespaceCell}getBlankLine(b,y){return new _.BufferLine(this._bufferService.cols,this.getNullCell(b),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const b=this.ybase+this.y-this.ydisp;return b>=0&&b<this._rows}_getCorrectBufferLength(b){if(!this._hasScrollback)return b;const y=b+this._optionsService.rawOptions.scrollback;return y>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(b){if(this.lines.length===0){b===void 0&&(b=_.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(b))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(b,y){const E=this.getNullCell(_.DEFAULT_ATTR_DATA);let T=0;const O=this._getCorrectBufferLength(y);if(O>this.lines.maxLength&&(this.lines.maxLength=O),this.lines.length>0){if(this._cols<b)for(let A=0;A<this.lines.length;A++)T+=+this.lines.get(A).resize(b,E);let D=0;if(this._rows<y)for(let A=this._rows;A<y;A++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(b,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(b,E)));else for(let A=this._rows;A>y;A--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(O<this.lines.maxLength){const A=this.lines.length-O;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=O}this.x=Math.min(this.x,b-1),this.y=Math.min(this.y,y-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,b-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(b,y),this._cols>b))for(let D=0;D<this.lines.length;D++)T+=+this.lines.get(D).resize(b,E);this._cols=b,this._rows=y,this._memoryCleanupQueue.clear(),T>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let b=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,b=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return b}get _isReflowEnabled(){const b=this._optionsService.rawOptions.windowsPty;return b&&b.buildNumber?this._hasScrollback&&b.backend==="conpty"&&b.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(b,y){this._cols!==b&&(b>this._cols?this._reflowLarger(b,y):this._reflowSmaller(b,y))}_reflowLarger(b,y){const E=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,b,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(E.length>0){const T=(0,x.reflowLargerCreateNewLayout)(this.lines,E);(0,x.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(b,y,T.countRemoved)}}_reflowLargerAdjustViewport(b,y,E){const T=this.getNullCell(_.DEFAULT_ATTR_DATA);let O=E;for(;O-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new _.BufferLine(b,T))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(b,y){const E=this.getNullCell(_.DEFAULT_ATTR_DATA),T=[];let O=0;for(let D=this.lines.length-1;D>=0;D--){let A=this.lines.get(D);if(!A||!A.isWrapped&&A.getTrimmedLength()<=b)continue;const N=[A];for(;A.isWrapped&&D>0;)A=this.lines.get(--D),N.unshift(A);const q=this.ybase+this.y;if(q>=D&&q<D+N.length)continue;const P=N[N.length-1].getTrimmedLength(),z=(0,x.reflowSmallerGetNewLineLengths)(N,this._cols,b),W=z.length-N.length;let U;U=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+W):Math.max(0,this.lines.length-this.lines.maxLength+W);const G=[];for(let B=0;B<W;B++){const I=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);G.push(I)}G.length>0&&(T.push({start:D+N.length+O,newLines:G}),O+=G.length),N.push(...G);let H=z.length-1,K=z[H];K===0&&(H--,K=z[H]);let F=N.length-W-1,k=P;for(;F>=0;){const B=Math.min(k,K);if(N[H]===void 0)break;if(N[H].copyCellsFrom(N[F],k-B,K-B,B,!0),K-=B,K===0&&(H--,K=z[H]),k-=B,k===0){F--;const I=Math.max(F,0);k=(0,x.getWrappedLineTrimmedLength)(N,I,this._cols)}}for(let B=0;B<N.length;B++)z[B]<b&&N[B].setCell(z[B],E);let $=W-U;for(;$-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+O)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+W,this.ybase+y-1)}if(T.length>0){const D=[],A=[];for(let H=0;H<this.lines.length;H++)A.push(this.lines.get(H));const N=this.lines.length;let q=N-1,P=0,z=T[P];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+O);let W=0;for(let H=Math.min(this.lines.maxLength-1,N+O-1);H>=0;H--)if(z&&z.start>q+W){for(let K=z.newLines.length-1;K>=0;K--)this.lines.set(H--,z.newLines[K]);H++,D.push({index:q+1,amount:z.newLines.length}),W+=z.newLines.length,z=T[++P]}else this.lines.set(H,A[q--]);let U=0;for(let H=D.length-1;H>=0;H--)D[H].index+=U,this.lines.onInsertEmitter.fire(D[H]),U+=D[H].amount;const G=Math.max(0,N+O-this.lines.maxLength);G>0&&this.lines.onTrimEmitter.fire(G)}}translateBufferLineToString(b,y,E=0,T){const O=this.lines.get(b);return O?O.translateToString(y,E,T):""}getWrappedRangeForLine(b){let y=b,E=b;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:y,last:E}}setupTabStops(b){for(b!=null?this.tabs[b]||(b=this.prevStop(b)):(this.tabs={},b=0);b<this._cols;b+=this._optionsService.rawOptions.tabStopWidth)this.tabs[b]=!0}prevStop(b){for(b==null&&(b=this.x);!this.tabs[--b]&&b>0;);return b>=this._cols?this._cols-1:b<0?0:b}nextStop(b){for(b==null&&(b=this.x);!this.tabs[++b]&&b<this._cols;);return b>=this._cols?this._cols-1:b<0?0:b}clearMarkers(b){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===b&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].dispose(),this.markers.splice(b--,1);this._isClearing=!1}addMarker(b){const y=new p.Marker(b);return this.markers.push(y),y.register(this.lines.onTrim((E=>{y.line-=E,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((E=>{y.line>=E.index&&(y.line+=E.amount)}))),y.register(this.lines.onDelete((E=>{y.line>=E.index&&y.line<E.index+E.amount&&y.dispose(),y.line>E.index&&(y.line-=E.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(b){this._isClearing||this.markers.splice(this.markers.indexOf(b),1)}}},8437:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const c=u(3734),v=u(511),m=u(643),_=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let x=0;class C{constructor(p,g,b=!1){this.isWrapped=b,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*p);const y=g||v.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]);for(let E=0;E<p;++E)this.setCell(E,y);this.length=p}get(p){const g=this._data[3*p+0],b=2097151&g;return[this._data[3*p+1],2097152&g?this._combined[p]:b?(0,_.stringFromCodePoint)(b):"",g>>22,2097152&g?this._combined[p].charCodeAt(this._combined[p].length-1):b]}set(p,g){this._data[3*p+1]=g[m.CHAR_DATA_ATTR_INDEX],g[m.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[p]=g[1],this._data[3*p+0]=2097152|p|g[m.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*p+0]=g[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[m.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(p){return this._data[3*p+0]>>22}hasWidth(p){return 12582912&this._data[3*p+0]}getFg(p){return this._data[3*p+1]}getBg(p){return this._data[3*p+2]}hasContent(p){return 4194303&this._data[3*p+0]}getCodePoint(p){const g=this._data[3*p+0];return 2097152&g?this._combined[p].charCodeAt(this._combined[p].length-1):2097151&g}isCombined(p){return 2097152&this._data[3*p+0]}getString(p){const g=this._data[3*p+0];return 2097152&g?this._combined[p]:2097151&g?(0,_.stringFromCodePoint)(2097151&g):""}isProtected(p){return 536870912&this._data[3*p+2]}loadCell(p,g){return x=3*p,g.content=this._data[x+0],g.fg=this._data[x+1],g.bg=this._data[x+2],2097152&g.content&&(g.combinedData=this._combined[p]),268435456&g.bg&&(g.extended=this._extendedAttrs[p]),g}setCell(p,g){2097152&g.content&&(this._combined[p]=g.combinedData),268435456&g.bg&&(this._extendedAttrs[p]=g.extended),this._data[3*p+0]=g.content,this._data[3*p+1]=g.fg,this._data[3*p+2]=g.bg}setCellFromCodePoint(p,g,b,y,E,T){268435456&E&&(this._extendedAttrs[p]=T),this._data[3*p+0]=g|b<<22,this._data[3*p+1]=y,this._data[3*p+2]=E}addCodepointToCell(p,g,b){let y=this._data[3*p+0];2097152&y?this._combined[p]+=(0,_.stringFromCodePoint)(g):2097151&y?(this._combined[p]=(0,_.stringFromCodePoint)(2097151&y)+(0,_.stringFromCodePoint)(g),y&=-2097152,y|=2097152):y=g|4194304,b&&(y&=-12582913,y|=b<<22),this._data[3*p+0]=y}insertCells(p,g,b,y){if((p%=this.length)&&this.getWidth(p-1)===2&&this.setCellFromCodePoint(p-1,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs),g<this.length-p){const E=new v.CellData;for(let T=this.length-p-g-1;T>=0;--T)this.setCell(p+g+T,this.loadCell(p+T,E));for(let T=0;T<g;++T)this.setCell(p+T,b)}else for(let E=p;E<this.length;++E)this.setCell(E,b);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs)}deleteCells(p,g,b,y){if(p%=this.length,g<this.length-p){const E=new v.CellData;for(let T=0;T<this.length-p-g;++T)this.setCell(p+T,this.loadCell(p+g+T,E));for(let T=this.length-g;T<this.length;++T)this.setCell(T,b)}else for(let E=p;E<this.length;++E)this.setCell(E,b);p&&this.getWidth(p-1)===2&&this.setCellFromCodePoint(p-1,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs),this.getWidth(p)!==0||this.hasContent(p)||this.setCellFromCodePoint(p,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs)}replaceCells(p,g,b,y,E=!1){if(E)for(p&&this.getWidth(p-1)===2&&!this.isProtected(p-1)&&this.setCellFromCodePoint(p-1,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs),g<this.length&&this.getWidth(g-1)===2&&!this.isProtected(g)&&this.setCellFromCodePoint(g,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs);p<g&&p<this.length;)this.isProtected(p)||this.setCell(p,b),p++;else for(p&&this.getWidth(p-1)===2&&this.setCellFromCodePoint(p-1,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs),g<this.length&&this.getWidth(g-1)===2&&this.setCellFromCodePoint(g,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs);p<g&&p<this.length;)this.setCell(p++,b)}resize(p,g){if(p===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const b=3*p;if(p>this.length){if(this._data.buffer.byteLength>=4*b)this._data=new Uint32Array(this._data.buffer,0,b);else{const y=new Uint32Array(b);y.set(this._data),this._data=y}for(let y=this.length;y<p;++y)this.setCell(y,g)}else{this._data=this._data.subarray(0,b);const y=Object.keys(this._combined);for(let T=0;T<y.length;T++){const O=parseInt(y[T],10);O>=p&&delete this._combined[O]}const E=Object.keys(this._extendedAttrs);for(let T=0;T<E.length;T++){const O=parseInt(E[T],10);O>=p&&delete this._extendedAttrs[O]}}return this.length=p,4*b*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const p=new Uint32Array(this._data.length);return p.set(this._data),this._data=p,1}return 0}fill(p,g=!1){if(g)for(let b=0;b<this.length;++b)this.isProtected(b)||this.setCell(b,p);else{this._combined={},this._extendedAttrs={};for(let b=0;b<this.length;++b)this.setCell(b,p)}}copyFrom(p){this.length!==p.length?this._data=new Uint32Array(p._data):this._data.set(p._data),this.length=p.length,this._combined={};for(const g in p._combined)this._combined[g]=p._combined[g];this._extendedAttrs={};for(const g in p._extendedAttrs)this._extendedAttrs[g]=p._extendedAttrs[g];this.isWrapped=p.isWrapped}clone(){const p=new C(0);p._data=new Uint32Array(this._data),p.length=this.length;for(const g in this._combined)p._combined[g]=this._combined[g];for(const g in this._extendedAttrs)p._extendedAttrs[g]=this._extendedAttrs[g];return p.isWrapped=this.isWrapped,p}getTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0])return p+(this._data[3*p+0]>>22);return 0}getNoBgTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0]||50331648&this._data[3*p+2])return p+(this._data[3*p+0]>>22);return 0}copyCellsFrom(p,g,b,y,E){const T=p._data;if(E)for(let D=y-1;D>=0;D--){for(let A=0;A<3;A++)this._data[3*(b+D)+A]=T[3*(g+D)+A];268435456&T[3*(g+D)+2]&&(this._extendedAttrs[b+D]=p._extendedAttrs[g+D])}else for(let D=0;D<y;D++){for(let A=0;A<3;A++)this._data[3*(b+D)+A]=T[3*(g+D)+A];268435456&T[3*(g+D)+2]&&(this._extendedAttrs[b+D]=p._extendedAttrs[g+D])}const O=Object.keys(p._combined);for(let D=0;D<O.length;D++){const A=parseInt(O[D],10);A>=g&&(this._combined[A-g+b]=p._combined[A])}}translateToString(p=!1,g=0,b=this.length){p&&(b=Math.min(b,this.getTrimmedLength()));let y="";for(;g<b;){const E=this._data[3*g+0],T=2097151&E;y+=2097152&E?this._combined[g]:T?(0,_.stringFromCodePoint)(T):m.WHITESPACE_CELL_CHAR,g+=E>>22||1}return y}}l.BufferLine=C},4841:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,c){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return c*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(d,l)=>{function u(c,v,m){if(v===c.length-1)return c[v].getTrimmedLength();const _=!c[v].hasContent(m-1)&&c[v].getWidth(m-1)===1,x=c[v+1].getWidth(0)===2;return _&&x?m-1:m}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(c,v,m,_,x){const C=[];for(let S=0;S<c.length-1;S++){let p=S,g=c.get(++p);if(!g.isWrapped)continue;const b=[c.get(S)];for(;p<c.length&&g.isWrapped;)b.push(g),g=c.get(++p);if(_>=S&&_<p){S+=b.length-1;continue}let y=0,E=u(b,y,v),T=1,O=0;for(;T<b.length;){const A=u(b,T,v),N=A-O,q=m-E,P=Math.min(N,q);b[y].copyCellsFrom(b[T],O,E,P,!1),E+=P,E===m&&(y++,E=0),O+=P,O===A&&(T++,O=0),E===0&&y!==0&&b[y-1].getWidth(m-1)===2&&(b[y].copyCellsFrom(b[y-1],m-1,E++,1,!1),b[y-1].setCell(m-1,x))}b[y].replaceCells(E,m,x);let D=0;for(let A=b.length-1;A>0&&(A>y||b[A].getTrimmedLength()===0);A--)D++;D>0&&(C.push(S+b.length-D),C.push(D)),S+=b.length-1}return C},l.reflowLargerCreateNewLayout=function(c,v){const m=[];let _=0,x=v[_],C=0;for(let S=0;S<c.length;S++)if(x===S){const p=v[++_];c.onDeleteEmitter.fire({index:S-C,amount:p}),S+=p-1,C+=p,x=v[++_]}else m.push(S);return{layout:m,countRemoved:C}},l.reflowLargerApplyNewLayout=function(c,v){const m=[];for(let _=0;_<v.length;_++)m.push(c.get(v[_]));for(let _=0;_<m.length;_++)c.set(_,m[_]);c.length=v.length},l.reflowSmallerGetNewLineLengths=function(c,v,m){const _=[],x=c.map(((g,b)=>u(c,b,v))).reduce(((g,b)=>g+b));let C=0,S=0,p=0;for(;p<x;){if(x-p<m){_.push(x-p);break}C+=m;const g=u(c,S,v);C>g&&(C-=g,S++);const b=c[S].getWidth(C-1)===2;b&&C--;const y=b?m-1:m;_.push(y),p+=y}return _},l.getWrappedLineTrimmedLength=u},5295:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const c=u(8460),v=u(844),m=u(9092);class _ extends v.Disposable{constructor(C,S){super(),this._optionsService=C,this._bufferService=S,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new m.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new m.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(C,S){this._normal.resize(C,S),this._alt.resize(C,S),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}l.BufferSet=_},511:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const c=u(482),v=u(643),m=u(3734);class _ extends m.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new m.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const S=new _;return S.setFromCharData(C),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(C[v.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(C[v.CHAR_DATA_CHAR_INDEX].length===2){const p=C[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=p&&p<=56319){const g=C[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=g&&g<=57343?this.content=1024*(p-55296)+g-56320+65536|C[v.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=C[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[v.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=C[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=_},643:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const c=u(8460),v=u(844);class m{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=m._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}l.Marker=m,m._nextId=1},7116:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(d,l)=>{var u,c,v;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(m){m.NUL="\0",m.SOH="",m.STX="",m.ETX="",m.EOT="",m.ENQ="",m.ACK="",m.BEL="\x07",m.BS="\b",m.HT=" ",m.LF=`
|
|
65
|
-
`,m.VT="\v",m.FF="\f",m.CR="\r",m.SO="",m.SI="",m.DLE="",m.DC1="",m.DC2="",m.DC3="",m.DC4="",m.NAK="",m.SYN="",m.ETB="",m.CAN="",m.EM="",m.SUB="",m.ESC="\x1B",m.FS="",m.GS="",m.RS="",m.US="",m.SP=" ",m.DEL=""})(u||(l.C0=u={})),(function(m){m.PAD="",m.HOP="",m.BPH="",m.NBH="",m.IND="",m.NEL="
",m.SSA="",m.ESA="",m.HTS="",m.HTJ="",m.VTS="",m.PLD="",m.PLU="",m.RI="",m.SS2="",m.SS3="",m.DCS="",m.PU1="",m.PU2="",m.STS="",m.CCH="",m.MW="",m.SPA="",m.EPA="",m.SOS="",m.SGCI="",m.SCI="",m.CSI="",m.ST="",m.OSC="",m.PM="",m.APC=""})(c||(l.C1=c={})),(function(m){m.ST=`${u.ESC}\\`})(v||(l.C1_ESCAPED=v={}))},7399:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const c=u(2584),v={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};l.evaluateKeyboardEvent=function(m,_,x,C){const S={type:0,cancel:!1,key:void 0},p=(m.shiftKey?1:0)|(m.altKey?2:0)|(m.ctrlKey?4:0)|(m.metaKey?8:0);switch(m.keyCode){case 0:m.key==="UIKeyInputUpArrow"?S.key=_?c.C0.ESC+"OA":c.C0.ESC+"[A":m.key==="UIKeyInputLeftArrow"?S.key=_?c.C0.ESC+"OD":c.C0.ESC+"[D":m.key==="UIKeyInputRightArrow"?S.key=_?c.C0.ESC+"OC":c.C0.ESC+"[C":m.key==="UIKeyInputDownArrow"&&(S.key=_?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:if(m.altKey){S.key=c.C0.ESC+c.C0.DEL;break}S.key=c.C0.DEL;break;case 9:if(m.shiftKey){S.key=c.C0.ESC+"[Z";break}S.key=c.C0.HT,S.cancel=!0;break;case 13:S.key=m.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,S.cancel=!0;break;case 27:S.key=c.C0.ESC,m.altKey&&(S.key=c.C0.ESC+c.C0.ESC),S.cancel=!0;break;case 37:if(m.metaKey)break;p?(S.key=c.C0.ESC+"[1;"+(p+1)+"D",S.key===c.C0.ESC+"[1;3D"&&(S.key=c.C0.ESC+(x?"b":"[1;5D"))):S.key=_?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(m.metaKey)break;p?(S.key=c.C0.ESC+"[1;"+(p+1)+"C",S.key===c.C0.ESC+"[1;3C"&&(S.key=c.C0.ESC+(x?"f":"[1;5C"))):S.key=_?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(m.metaKey)break;p?(S.key=c.C0.ESC+"[1;"+(p+1)+"A",x||S.key!==c.C0.ESC+"[1;3A"||(S.key=c.C0.ESC+"[1;5A")):S.key=_?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(m.metaKey)break;p?(S.key=c.C0.ESC+"[1;"+(p+1)+"B",x||S.key!==c.C0.ESC+"[1;3B"||(S.key=c.C0.ESC+"[1;5B")):S.key=_?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:m.shiftKey||m.ctrlKey||(S.key=c.C0.ESC+"[2~");break;case 46:S.key=p?c.C0.ESC+"[3;"+(p+1)+"~":c.C0.ESC+"[3~";break;case 36:S.key=p?c.C0.ESC+"[1;"+(p+1)+"H":_?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:S.key=p?c.C0.ESC+"[1;"+(p+1)+"F":_?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:m.shiftKey?S.type=2:m.ctrlKey?S.key=c.C0.ESC+"[5;"+(p+1)+"~":S.key=c.C0.ESC+"[5~";break;case 34:m.shiftKey?S.type=3:m.ctrlKey?S.key=c.C0.ESC+"[6;"+(p+1)+"~":S.key=c.C0.ESC+"[6~";break;case 112:S.key=p?c.C0.ESC+"[1;"+(p+1)+"P":c.C0.ESC+"OP";break;case 113:S.key=p?c.C0.ESC+"[1;"+(p+1)+"Q":c.C0.ESC+"OQ";break;case 114:S.key=p?c.C0.ESC+"[1;"+(p+1)+"R":c.C0.ESC+"OR";break;case 115:S.key=p?c.C0.ESC+"[1;"+(p+1)+"S":c.C0.ESC+"OS";break;case 116:S.key=p?c.C0.ESC+"[15;"+(p+1)+"~":c.C0.ESC+"[15~";break;case 117:S.key=p?c.C0.ESC+"[17;"+(p+1)+"~":c.C0.ESC+"[17~";break;case 118:S.key=p?c.C0.ESC+"[18;"+(p+1)+"~":c.C0.ESC+"[18~";break;case 119:S.key=p?c.C0.ESC+"[19;"+(p+1)+"~":c.C0.ESC+"[19~";break;case 120:S.key=p?c.C0.ESC+"[20;"+(p+1)+"~":c.C0.ESC+"[20~";break;case 121:S.key=p?c.C0.ESC+"[21;"+(p+1)+"~":c.C0.ESC+"[21~";break;case 122:S.key=p?c.C0.ESC+"[23;"+(p+1)+"~":c.C0.ESC+"[23~";break;case 123:S.key=p?c.C0.ESC+"[24;"+(p+1)+"~":c.C0.ESC+"[24~";break;default:if(!m.ctrlKey||m.shiftKey||m.altKey||m.metaKey)if(x&&!C||!m.altKey||m.metaKey)!x||m.altKey||m.ctrlKey||m.shiftKey||!m.metaKey?m.key&&!m.ctrlKey&&!m.altKey&&!m.metaKey&&m.keyCode>=48&&m.key.length===1?S.key=m.key:m.key&&m.ctrlKey&&(m.key==="_"&&(S.key=c.C0.US),m.key==="@"&&(S.key=c.C0.NUL)):m.keyCode===65&&(S.type=1);else{const g=v[m.keyCode],b=g?.[m.shiftKey?1:0];if(b)S.key=c.C0.ESC+b;else if(m.keyCode>=65&&m.keyCode<=90){const y=m.ctrlKey?m.keyCode-64:m.keyCode+32;let E=String.fromCharCode(y);m.shiftKey&&(E=E.toUpperCase()),S.key=c.C0.ESC+E}else if(m.keyCode===32)S.key=c.C0.ESC+(m.ctrlKey?c.C0.NUL:" ");else if(m.key==="Dead"&&m.code.startsWith("Key")){let y=m.code.slice(3,4);m.shiftKey||(y=y.toLowerCase()),S.key=c.C0.ESC+y,S.cancel=!0}}else m.keyCode>=65&&m.keyCode<=90?S.key=String.fromCharCode(m.keyCode-64):m.keyCode===32?S.key=c.C0.NUL:m.keyCode>=51&&m.keyCode<=55?S.key=String.fromCharCode(m.keyCode-51+27):m.keyCode===56?S.key=c.C0.DEL:m.keyCode===219?S.key=c.C0.ESC:m.keyCode===220?S.key=c.C0.FS:m.keyCode===221&&(S.key=c.C0.GS)}return S}},482:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,c=0,v=u.length){let m="";for(let _=c;_<v;++_){let x=u[_];x>65535?(x-=65536,m+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):m+=String.fromCharCode(x)}return m},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,c){const v=u.length;if(!v)return 0;let m=0,_=0;if(this._interim){const x=u.charCodeAt(_++);56320<=x&&x<=57343?c[m++]=1024*(this._interim-55296)+x-56320+65536:(c[m++]=this._interim,c[m++]=x),this._interim=0}for(let x=_;x<v;++x){const C=u.charCodeAt(x);if(55296<=C&&C<=56319){if(++x>=v)return this._interim=C,m;const S=u.charCodeAt(x);56320<=S&&S<=57343?c[m++]=1024*(C-55296)+S-56320+65536:(c[m++]=C,c[m++]=S)}else C!==65279&&(c[m++]=C)}return m}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,c){const v=u.length;if(!v)return 0;let m,_,x,C,S=0,p=0,g=0;if(this.interim[0]){let E=!1,T=this.interim[0];T&=(224&T)==192?31:(240&T)==224?15:7;let O,D=0;for(;(O=63&this.interim[++D])&&D<4;)T<<=6,T|=O;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,N=A-D;for(;g<N;){if(g>=v)return 0;if(O=u[g++],(192&O)!=128){g--,E=!0;break}this.interim[D++]=O,T<<=6,T|=63&O}E||(A===2?T<128?g--:c[S++]=T:A===3?T<2048||T>=55296&&T<=57343||T===65279||(c[S++]=T):T<65536||T>1114111||(c[S++]=T)),this.interim.fill(0)}const b=v-4;let y=g;for(;y<v;){for(;!(!(y<b)||128&(m=u[y])||128&(_=u[y+1])||128&(x=u[y+2])||128&(C=u[y+3]));)c[S++]=m,c[S++]=_,c[S++]=x,c[S++]=C,y+=4;if(m=u[y++],m<128)c[S++]=m;else if((224&m)==192){if(y>=v)return this.interim[0]=m,S;if(_=u[y++],(192&_)!=128){y--;continue}if(p=(31&m)<<6|63&_,p<128){y--;continue}c[S++]=p}else if((240&m)==224){if(y>=v)return this.interim[0]=m,S;if(_=u[y++],(192&_)!=128){y--;continue}if(y>=v)return this.interim[0]=m,this.interim[1]=_,S;if(x=u[y++],(192&x)!=128){y--;continue}if(p=(15&m)<<12|(63&_)<<6|63&x,p<2048||p>=55296&&p<=57343||p===65279)continue;c[S++]=p}else if((248&m)==240){if(y>=v)return this.interim[0]=m,S;if(_=u[y++],(192&_)!=128){y--;continue}if(y>=v)return this.interim[0]=m,this.interim[1]=_,S;if(x=u[y++],(192&x)!=128){y--;continue}if(y>=v)return this.interim[0]=m,this.interim[1]=_,this.interim[2]=x,S;if(C=u[y++],(192&C)!=128){y--;continue}if(p=(7&m)<<18|(63&_)<<12|(63&x)<<6|63&C,p<65536||p>1114111)continue;c[S++]=p}}return S}}},225:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const c=u(1480),v=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],m=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;l.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let x=0;x<v.length;++x)_.fill(0,v[x][0],v[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?_[x]:(function(C,S){let p,g=0,b=S.length-1;if(C<S[0][0]||C>S[b][1])return!1;for(;b>=g;)if(p=g+b>>1,C>S[p][1])g=p+1;else{if(!(C<S[p][0]))return!0;b=p-1}return!1})(x,m)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,C){let S=this.wcwidth(x),p=S===0&&C!==0;if(p){const g=c.UnicodeService.extractWidth(C);g===0?p=!1:g>S&&(S=g)}return c.UnicodeService.createPropertyValue(0,S,p)}}},5981:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const c=u(8460),v=u(844);class m extends v.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const p=this._callbacks.shift();p&&p()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C)}_innerWrite(x=0,C=!0){const S=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const p=this._writeBuffer[this._bufferOffset],g=this._action(p,C);if(g){const y=E=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(S,E);return void g.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(y)}const b=this._callbacks[this._bufferOffset];if(b&&b(),this._bufferOffset++,this._pendingData-=p.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}l.WriteBuffer=m},5941:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function v(m,_){const x=m.toString(16),C=x.length<2?"0"+x:x;switch(_){case 4:return x[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}l.parseColor=function(m){if(!m)return;let _=m.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const x=u.exec(_);if(x){const C=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/C*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/C*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/C*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),c.exec(_)&&[3,6,9,12].includes(_.length))){const x=_.length/3,C=[0,0,0];for(let S=0;S<3;++S){const p=parseInt(_.slice(x*S,x*S+x),16);C[S]=x===1?p<<4:x===2?p:x===3?p>>4:p>>8}return C}},l.toRgbString=function(m,_=16){const[x,C,S]=m;return`rgb:${v(x,_)}/${v(C,_)}/${v(S,_)}`}},5770:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const c=u(482),v=u(8742),m=u(5770),_=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(C,S){this._handlers[C]===void 0&&(this._handlers[C]=[]);const p=this._handlers[C];return p.push(S),{dispose:()=>{const g=p.indexOf(S);g!==-1&&p.splice(g,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(C,S){if(this.reset(),this._ident=C,this._active=this._handlers[C]||_,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(C,S,p){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(C,S,p);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(C,S,p))}unhook(C,S=!0){if(this._active.length){let p=!1,g=this._active.length-1,b=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,p=S,b=this._stack.fallThrough,this._stack.paused=!1),!b&&p===!1){for(;g>=0&&(p=this._active[g].unhook(C),p!==!0);g--)if(p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,p;g--}for(;g>=0;g--)if(p=this._active[g].unhook(!1),p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,p}else this._handlerFb(this._ident,"UNHOOK",C);this._active=_,this._ident=0}};const x=new v.Params;x.addParam(0),l.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=x,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():x,this._data="",this._hitLimit=!1}put(C,S,p){this._hitLimit||(this._data+=(0,c.utf32ToString)(C,S,p),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let S=!1;if(this._hitLimit)S=!1;else if(C&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((p=>(this._params=x,this._data="",this._hitLimit=!1,p)));return this._params=x,this._data="",this._hitLimit=!1,S}}},2015:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const c=u(844),v=u(8742),m=u(6242),_=u(6351);class x{constructor(g){this.table=new Uint8Array(g)}setDefault(g,b){this.table.fill(g<<4|b)}add(g,b,y,E){this.table[b<<8|g]=y<<4|E}addMany(g,b,y,E){for(let T=0;T<g.length;T++)this.table[b<<8|g[T]]=y<<4|E}}l.TransitionTable=x;const C=160;l.VT500_TRANSITION_TABLE=(function(){const p=new x(4095),g=Array.apply(null,Array(256)).map(((D,A)=>A)),b=(D,A)=>g.slice(D,A),y=b(32,127),E=b(0,24);E.push(25),E.push.apply(E,b(28,32));const T=b(0,14);let O;for(O in p.setDefault(1,0),p.addMany(y,0,2,0),T)p.addMany([24,26,153,154],O,3,0),p.addMany(b(128,144),O,3,0),p.addMany(b(144,152),O,3,0),p.add(156,O,0,0),p.add(27,O,11,1),p.add(157,O,4,8),p.addMany([152,158,159],O,0,7),p.add(155,O,11,3),p.add(144,O,11,9);return p.addMany(E,0,3,0),p.addMany(E,1,3,1),p.add(127,1,0,1),p.addMany(E,8,0,8),p.addMany(E,3,3,3),p.add(127,3,0,3),p.addMany(E,4,3,4),p.add(127,4,0,4),p.addMany(E,6,3,6),p.addMany(E,5,3,5),p.add(127,5,0,5),p.addMany(E,2,3,2),p.add(127,2,0,2),p.add(93,1,4,8),p.addMany(y,8,5,8),p.add(127,8,5,8),p.addMany([156,27,24,26,7],8,6,0),p.addMany(b(28,32),8,0,8),p.addMany([88,94,95],1,0,7),p.addMany(y,7,0,7),p.addMany(E,7,0,7),p.add(156,7,0,0),p.add(127,7,0,7),p.add(91,1,11,3),p.addMany(b(64,127),3,7,0),p.addMany(b(48,60),3,8,4),p.addMany([60,61,62,63],3,9,4),p.addMany(b(48,60),4,8,4),p.addMany(b(64,127),4,7,0),p.addMany([60,61,62,63],4,0,6),p.addMany(b(32,64),6,0,6),p.add(127,6,0,6),p.addMany(b(64,127),6,0,0),p.addMany(b(32,48),3,9,5),p.addMany(b(32,48),5,9,5),p.addMany(b(48,64),5,0,6),p.addMany(b(64,127),5,7,0),p.addMany(b(32,48),4,9,5),p.addMany(b(32,48),1,9,2),p.addMany(b(32,48),2,9,2),p.addMany(b(48,127),2,10,0),p.addMany(b(48,80),1,10,0),p.addMany(b(81,88),1,10,0),p.addMany([89,90,92],1,10,0),p.addMany(b(96,127),1,10,0),p.add(80,1,11,9),p.addMany(E,9,0,9),p.add(127,9,0,9),p.addMany(b(28,32),9,0,9),p.addMany(b(32,48),9,9,12),p.addMany(b(48,60),9,8,10),p.addMany([60,61,62,63],9,9,10),p.addMany(E,11,0,11),p.addMany(b(32,128),11,0,11),p.addMany(b(28,32),11,0,11),p.addMany(E,10,0,10),p.add(127,10,0,10),p.addMany(b(28,32),10,0,10),p.addMany(b(48,60),10,8,10),p.addMany([60,61,62,63],10,0,11),p.addMany(b(32,48),10,9,12),p.addMany(E,12,0,12),p.add(127,12,0,12),p.addMany(b(28,32),12,0,12),p.addMany(b(32,48),12,9,12),p.addMany(b(48,64),12,0,11),p.addMany(b(64,127),12,12,13),p.addMany(b(64,127),10,12,13),p.addMany(b(64,127),9,12,13),p.addMany(E,13,13,13),p.addMany(y,13,13,13),p.add(127,13,0,13),p.addMany([27,156,24,26],13,14,0),p.add(C,0,2,0),p.add(C,8,5,8),p.add(C,6,0,6),p.add(C,11,0,11),p.add(C,13,13,13),p})();class S extends c.Disposable{constructor(g=l.VT500_TRANSITION_TABLE){super(),this._transitions=g,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new v.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(b,y,E)=>{},this._executeHandlerFb=b=>{},this._csiHandlerFb=(b,y)=>{},this._escHandlerFb=b=>{},this._errorHandlerFb=b=>b,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new m.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(g,b=[64,126]){let y=0;if(g.prefix){if(g.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=g.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(g.intermediates){if(g.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let T=0;T<g.intermediates.length;++T){const O=g.intermediates.charCodeAt(T);if(32>O||O>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=O}}if(g.final.length!==1)throw new Error("final must be a single byte");const E=g.final.charCodeAt(0);if(b[0]>E||E>b[1])throw new Error(`final must be in range ${b[0]} .. ${b[1]}`);return y<<=8,y|=E,y}identToString(g){const b=[];for(;g;)b.push(String.fromCharCode(255&g)),g>>=8;return b.reverse().join("")}setPrintHandler(g){this._printHandler=g}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(g,b){const y=this._identifier(g,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const E=this._escHandlers[y];return E.push(b),{dispose:()=>{const T=E.indexOf(b);T!==-1&&E.splice(T,1)}}}clearEscHandler(g){this._escHandlers[this._identifier(g,[48,126])]&&delete this._escHandlers[this._identifier(g,[48,126])]}setEscHandlerFallback(g){this._escHandlerFb=g}setExecuteHandler(g,b){this._executeHandlers[g.charCodeAt(0)]=b}clearExecuteHandler(g){this._executeHandlers[g.charCodeAt(0)]&&delete this._executeHandlers[g.charCodeAt(0)]}setExecuteHandlerFallback(g){this._executeHandlerFb=g}registerCsiHandler(g,b){const y=this._identifier(g);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const E=this._csiHandlers[y];return E.push(b),{dispose:()=>{const T=E.indexOf(b);T!==-1&&E.splice(T,1)}}}clearCsiHandler(g){this._csiHandlers[this._identifier(g)]&&delete this._csiHandlers[this._identifier(g)]}setCsiHandlerFallback(g){this._csiHandlerFb=g}registerDcsHandler(g,b){return this._dcsParser.registerHandler(this._identifier(g),b)}clearDcsHandler(g){this._dcsParser.clearHandler(this._identifier(g))}setDcsHandlerFallback(g){this._dcsParser.setHandlerFallback(g)}registerOscHandler(g,b){return this._oscParser.registerHandler(g,b)}clearOscHandler(g){this._oscParser.clearHandler(g)}setOscHandlerFallback(g){this._oscParser.setHandlerFallback(g)}setErrorHandler(g){this._errorHandler=g}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(g,b,y,E,T){this._parseStack.state=g,this._parseStack.handlers=b,this._parseStack.handlerPos=y,this._parseStack.transition=E,this._parseStack.chunkPos=T}parse(g,b,y){let E,T=0,O=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let N=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&N>-1){for(;N>=0&&(E=A[N](this._params),E!==!0);N--)if(E instanceof Promise)return this._parseStack.handlerPos=N,E}this._parseStack.handlers=[];break;case 4:if(y===!1&&N>-1){for(;N>=0&&(E=A[N](),E!==!0);N--)if(E instanceof Promise)return this._parseStack.handlerPos=N,E}this._parseStack.handlers=[];break;case 6:if(T=g[this._parseStack.chunkPos],E=this._dcsParser.unhook(T!==24&&T!==26,y),E)return E;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=g[this._parseStack.chunkPos],E=this._oscParser.end(T!==24&&T!==26,y),E)return E;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let A=D;A<b;++A){switch(T=g[A],O=this._transitions.table[this.currentState<<8|(T<160?T:C)],O>>4){case 2:for(let W=A+1;;++W){if(W>=b||(T=g[W])<32||T>126&&T<C){this._printHandler(g,A,W),A=W-1;break}if(++W>=b||(T=g[W])<32||T>126&&T<C){this._printHandler(g,A,W),A=W-1;break}if(++W>=b||(T=g[W])<32||T>126&&T<C){this._printHandler(g,A,W),A=W-1;break}if(++W>=b||(T=g[W])<32||T>126&&T<C){this._printHandler(g,A,W),A=W-1;break}}break;case 3:this._executeHandlers[T]?this._executeHandlers[T]():this._executeHandlerFb(T),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:A,code:T,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const N=this._csiHandlers[this._collect<<8|T];let q=N?N.length-1:-1;for(;q>=0&&(E=N[q](this._params),E!==!0);q--)if(E instanceof Promise)return this._preserveStack(3,N,q,O,A),E;q<0&&this._csiHandlerFb(this._collect<<8|T,this._params),this.precedingJoinState=0;break;case 8:do switch(T){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(T-48)}while(++A<b&&(T=g[A])>47&&T<60);A--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const P=this._escHandlers[this._collect<<8|T];let z=P?P.length-1:-1;for(;z>=0&&(E=P[z](),E!==!0);z--)if(E instanceof Promise)return this._preserveStack(4,P,z,O,A),E;z<0&&this._escHandlerFb(this._collect<<8|T),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|T,this._params);break;case 13:for(let W=A+1;;++W)if(W>=b||(T=g[W])===24||T===26||T===27||T>127&&T<C){this._dcsParser.put(g,A,W),A=W-1;break}break;case 14:if(E=this._dcsParser.unhook(T!==24&&T!==26),E)return this._preserveStack(6,[],0,O,A),E;T===27&&(O|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let W=A+1;;W++)if(W>=b||(T=g[W])<32||T>127&&T<C){this._oscParser.put(g,A,W),A=W-1;break}break;case 6:if(E=this._oscParser.end(T!==24&&T!==26),E)return this._preserveStack(5,[],0,O,A),E;T===27&&(O|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&O}}}l.EscapeSequenceParser=S},6242:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const c=u(5770),v=u(482),m=[];l.OscParser=class{constructor(){this._state=0,this._active=m,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,x){this._handlers[_]===void 0&&(this._handlers[_]=[]);const C=this._handlers[_];return C.push(x),{dispose:()=>{const S=C.indexOf(x);S!==-1&&C.splice(S,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=m,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||m,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,x,C){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(_,x,C);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(_,x,C))}start(){this.reset(),this._state=1}put(_,x,C){if(this._state!==3){if(this._state===1)for(;x<C;){const S=_[x++];if(S===59){this._state=2,this._start();break}if(S<48||57<S)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+S-48}this._state===2&&C-x>0&&this._put(_,x,C)}}end(_,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,S=this._active.length-1,p=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,C=x,p=this._stack.fallThrough,this._stack.paused=!1),!p&&C===!1){for(;S>=0&&(C=this._active[S].end(_),C!==!0);S--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,C;S--}for(;S>=0;S--)if(C=this._active[S].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",_);this._active=m,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,x,C){this._hitLimit||(this._data+=(0,v.utf32ToString)(_,x,C),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let x=!1;if(this._hitLimit)x=!1;else if(_&&(x=this._handler(this._data),x instanceof Promise))return x.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,x}}},8742:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class c{static fromArray(m){const _=new c;if(!m.length)return _;for(let x=Array.isArray(m[0])?1:0;x<m.length;++x){const C=m[x];if(Array.isArray(C))for(let S=0;S<C.length;++S)_.addSubParam(C[S]);else _.addParam(C)}return _}constructor(m=32,_=32){if(this.maxLength=m,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(m),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(m),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const m=new c(this.maxLength,this.maxSubParamsLength);return m.params.set(this.params),m.length=this.length,m._subParams.set(this._subParams),m._subParamsLength=this._subParamsLength,m._subParamsIdx.set(this._subParamsIdx),m._rejectDigits=this._rejectDigits,m._rejectSubDigits=this._rejectSubDigits,m._digitIsSub=this._digitIsSub,m}toArray(){const m=[];for(let _=0;_<this.length;++_){m.push(this.params[_]);const x=this._subParamsIdx[_]>>8,C=255&this._subParamsIdx[_];C-x>0&&m.push(Array.prototype.slice.call(this._subParams,x,C))}return m}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(m){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=m>u?u:m}}addSubParam(m){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=m>u?u:m,this._subParamsIdx[this.length-1]++}}hasSubParams(m){return(255&this._subParamsIdx[m])-(this._subParamsIdx[m]>>8)>0}getSubParams(m){const _=this._subParamsIdx[m]>>8,x=255&this._subParamsIdx[m];return x-_>0?this._subParams.subarray(_,x):null}getSubParamsAll(){const m={};for(let _=0;_<this.length;++_){const x=this._subParamsIdx[_]>>8,C=255&this._subParamsIdx[_];C-x>0&&(m[_]=this._subParams.slice(x,C))}return m}addDigit(m){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,C=x[_-1];x[_-1]=~C?Math.min(10*C+m,u):m}}l.Params=c},5741:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,c){const v={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(v),c.dispose=()=>this._wrappedAddonDispose(v),c.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let c=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===u){c=v;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(c,1)}}},8771:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const c=u(3785),v=u(511);l.BufferApiView=class{constructor(m,_){this._buffer=m,this.type=_}init(m){return this._buffer=m,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(m){const _=this._buffer.lines.get(m);if(_)return new c.BufferLineApiView(_)}getNullCell(){return new v.CellData}}},3785:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const c=u(511);l.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,m){if(!(v<0||v>=this._line.length))return m?(this._line.loadCell(v,m),m):this._line.loadCell(v,new c.CellData)}translateToString(v,m,_){return this._line.translateToString(v,m,_)}}},8285:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const c=u(8771),v=u(8460),m=u(844);class _ extends m.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new v.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}l.BufferNamespaceApi=_},7975:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,c){return this._core.registerCsiHandler(u,(v=>c(v.toArray())))}addCsiHandler(u,c){return this.registerCsiHandler(u,c)}registerDcsHandler(u,c){return this._core.registerDcsHandler(u,((v,m)=>c(v,m.toArray())))}addDcsHandler(u,c){return this.registerDcsHandler(u,c)}registerEscHandler(u,c){return this._core.registerEscHandler(u,c)}addEscHandler(u,c){return this.registerEscHandler(u,c)}registerOscHandler(u,c){return this._core.registerOscHandler(u,c)}addOscHandler(u,c){return this.registerOscHandler(u,c)}}},7090:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(d,l,u){var c=this&&this.__decorate||function(p,g,b,y){var E,T=arguments.length,O=T<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,g,b,y);else for(var D=p.length-1;D>=0;D--)(E=p[D])&&(O=(T<3?E(O):T>3?E(g,b,O):E(g,b))||O);return T>3&&O&&Object.defineProperty(g,b,O),O},v=this&&this.__param||function(p,g){return function(b,y){g(b,y,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const m=u(8460),_=u(844),x=u(5295),C=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let S=l.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(p){super(),this.isUserScrolling=!1,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new m.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(p.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(p.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(p,this))}resize(p,g){this.cols=p,this.rows=g,this.buffers.resize(p,g),this._onResize.fire({cols:p,rows:g})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(p,g=!1){const b=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===p.fg&&y.getBg(0)===p.bg||(y=b.getBlankLine(p,g),this._cachedBlankLine=y),y.isWrapped=g;const E=b.ybase+b.scrollTop,T=b.ybase+b.scrollBottom;if(b.scrollTop===0){const O=b.lines.isFull;T===b.lines.length-1?O?b.lines.recycle().copyFrom(y):b.lines.push(y.clone()):b.lines.splice(T+1,0,y.clone()),O?this.isUserScrolling&&(b.ydisp=Math.max(b.ydisp-1,0)):(b.ybase++,this.isUserScrolling||b.ydisp++)}else{const O=T-E+1;b.lines.shiftElements(E+1,O-1,-1),b.lines.set(T,y.clone())}this.isUserScrolling||(b.ydisp=b.ybase),this._onScroll.fire(b.ydisp)}scrollLines(p,g,b){const y=this.buffer;if(p<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else p+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const E=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+p,y.ybase),0),E!==y.ydisp&&(g||this._onScroll.fire(y.ydisp))}};l.BufferService=S=c([v(0,C.IOptionsService)],S)},7994:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,c){this._charsets[u]=c,this.glevel===u&&(this.charset=c)}}},1753:function(d,l,u){var c=this&&this.__decorate||function(y,E,T,O){var D,A=arguments.length,N=A<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,T):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,E,T,O);else for(var q=y.length-1;q>=0;q--)(D=y[q])&&(N=(A<3?D(N):A>3?D(E,T,N):D(E,T))||N);return A>3&&N&&Object.defineProperty(E,T,N),N},v=this&&this.__param||function(y,E){return function(T,O){E(T,O,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const m=u(2585),_=u(8460),x=u(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function S(y,E){let T=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(T|=64,T|=y.action):(T|=3&y.button,4&y.button&&(T|=64),8&y.button&&(T|=128),y.action===32?T|=32:y.action!==0||E||(T|=3)),T}const p=String.fromCharCode,g={DEFAULT:y=>{const E=[S(y,!1)+32,y.col+32,y.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${p(E[0])}${p(E[1])}${p(E[2])}`},SGR:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.col};${y.row}${E}`},SGR_PIXELS:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.x};${y.y}${E}`}};let b=l.CoreMouseService=class extends x.Disposable{constructor(y,E){super(),this._bufferService=y,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const T of Object.keys(C))this.addProtocol(T,C[T]);for(const T of Object.keys(g))this.addEncoding(T,g[T]);this.reset()}addProtocol(y,E){this._protocols[y]=E}addEncoding(y,E){this._encodings[y]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const E=this._encodings[this._activeEncoding](y);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,E,T){if(T){if(y.x!==E.x||y.y!==E.y)return!1}else if(y.col!==E.col||y.row!==E.row)return!1;return y.button===E.button&&y.action===E.action&&y.ctrl===E.ctrl&&y.alt===E.alt&&y.shift===E.shift}};l.CoreMouseService=b=c([v(0,m.IBufferService),v(1,m.ICoreService)],b)},6975:function(d,l,u){var c=this&&this.__decorate||function(b,y,E,T){var O,D=arguments.length,A=D<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,y,E,T);else for(var N=b.length-1;N>=0;N--)(O=b[N])&&(A=(D<3?O(A):D>3?O(y,E,A):O(y,E))||A);return D>3&&A&&Object.defineProperty(y,E,A),A},v=this&&this.__param||function(b,y){return function(E,T){y(E,T,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const m=u(1439),_=u(8460),x=u(844),C=u(2585),S=Object.freeze({insertMode:!1}),p=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let g=l.CoreService=class extends x.Disposable{constructor(b,y,E){super(),this._bufferService=b,this._logService=y,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,m.clone)(S),this.decPrivateModes=(0,m.clone)(p)}reset(){this.modes=(0,m.clone)(S),this.decPrivateModes=(0,m.clone)(p)}triggerDataEvent(b,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${b}"`,(()=>b.split("").map((T=>T.charCodeAt(0))))),this._onData.fire(b)}triggerBinaryEvent(b){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${b}"`,(()=>b.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(b))}};l.CoreService=g=c([v(0,C.IBufferService),v(1,C.ILogService),v(2,C.IOptionsService)],g)},9074:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const c=u(8055),v=u(8460),m=u(844),_=u(6106);let x=0,C=0;class S extends m.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((b=>b?.marker.line)),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,m.toDisposable)((()=>this.reset())))}registerDecoration(b){if(b.marker.isDisposed)return;const y=new p(b);if(y){const E=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),E.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const b of this._decorations.values())b.dispose();this._decorations.clear()}*getDecorationsAtCell(b,y,E){let T=0,O=0;for(const D of this._decorations.getKeyIterator(y))T=D.options.x??0,O=T+(D.options.width??1),b>=T&&b<O&&(!E||(D.options.layer??"bottom")===E)&&(yield D)}forEachDecorationAtCell(b,y,E,T){this._decorations.forEachByKey(y,(O=>{x=O.options.x??0,C=x+(O.options.width??1),b>=x&&b<C&&(!E||(O.options.layer??"bottom")===E)&&T(O)}))}}l.DecorationService=S;class p extends m.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(b){super(),this.options=b,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=b.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const c=u(2585),v=u(8343);class m{constructor(...x){this._entries=new Map;for(const[C,S]of x)this.set(C,S)}set(x,C){const S=this._entries.get(x);return this._entries.set(x,C),S}forEach(x){for(const[C,S]of this._entries.entries())x(C,S)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}l.ServiceCollection=m,l.InstantiationService=class{constructor(){this._services=new m,this._services.set(c.IInstantiationService,this)}setService(_,x){this._services.set(_,x)}getService(_){return this._services.get(_)}createInstance(_,...x){const C=(0,v.getServiceDependencies)(_).sort(((g,b)=>g.index-b.index)),S=[];for(const g of C){const b=this._services.get(g.id);if(!b)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${g.id}.`);S.push(b)}const p=C.length>0?C[0].index:x.length;if(x.length!==p)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${p+1} conflicts with ${x.length} static arguments`);return new _(...x,...S)}}},7866:function(d,l,u){var c=this&&this.__decorate||function(p,g,b,y){var E,T=arguments.length,O=T<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,g,b,y);else for(var D=p.length-1;D>=0;D--)(E=p[D])&&(O=(T<3?E(O):T>3?E(g,b,O):E(g,b))||O);return T>3&&O&&Object.defineProperty(g,b,O),O},v=this&&this.__param||function(p,g){return function(b,y){g(b,y,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const m=u(844),_=u(2585),x={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let C,S=l.LogService=class extends m.Disposable{get logLevel(){return this._logLevel}constructor(p){super(),this._optionsService=p,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(p){for(let g=0;g<p.length;g++)typeof p[g]=="function"&&(p[g]=p[g]())}_log(p,g,b){this._evalLazyOptionalParams(b),p.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+g,...b)}trace(p,...g){this._logLevel<=_.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,p,g)}debug(p,...g){this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,p,g)}info(p,...g){this._logLevel<=_.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,p,g)}warn(p,...g){this._logLevel<=_.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,p,g)}error(p,...g){this._logLevel<=_.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,p,g)}};l.LogService=S=c([v(0,_.IOptionsService)],S),l.setTraceLogger=function(p){C=p},l.traceCall=function(p,g,b){if(typeof b.value!="function")throw new Error("not supported");const y=b.value;b.value=function(...E){if(C.logLevel!==_.LogLevelEnum.TRACE)return y.apply(this,E);C.trace(`GlyphRenderer#${y.name}(${E.map((O=>JSON.stringify(O))).join(", ")})`);const T=y.apply(this,E);return C.trace(`GlyphRenderer#${y.name} return`,T),T}}},7302:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const c=u(8460),v=u(844),m=u(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:m.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends v.Disposable{constructor(S){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const p={...l.DEFAULT_OPTIONS};for(const g in S)if(g in p)try{const b=S[g];p[g]=this._sanitizeAndValidateOption(g,b)}catch(b){console.error(b)}this.rawOptions=p,this.options={...p},this._setupOptions()}onSpecificOptionChange(S,p){return this.onOptionChange((g=>{g===S&&p(this.rawOptions[S])}))}onMultipleOptionChange(S,p){return this.onOptionChange((g=>{S.indexOf(g)!==-1&&p()}))}_setupOptions(){const S=g=>{if(!(g in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);return this.rawOptions[g]},p=(g,b)=>{if(!(g in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);b=this._sanitizeAndValidateOption(g,b),this.rawOptions[g]!==b&&(this.rawOptions[g]=b,this._onOptionChange.fire(g))};for(const g in this.rawOptions){const b={get:S.bind(this,g),set:p.bind(this,g)};Object.defineProperty(this.options,g,b)}}_sanitizeAndValidateOption(S,p){switch(S){case"cursorStyle":if(p||(p=l.DEFAULT_OPTIONS[S]),!(function(g){return g==="block"||g==="underline"||g==="bar"})(p))throw new Error(`"${p}" is not a valid value for ${S}`);break;case"wordSeparator":p||(p=l.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof p=="number"&&1<=p&&p<=1e3)break;p=_.includes(p)?p:l.DEFAULT_OPTIONS[S];break;case"cursorWidth":p=Math.floor(p);case"lineHeight":case"tabStopWidth":if(p<1)throw new Error(`${S} cannot be less than 1, value: ${p}`);break;case"minimumContrastRatio":p=Math.max(1,Math.min(21,Math.round(10*p)/10));break;case"scrollback":if((p=Math.min(p,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${p}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(p<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${p}`);break;case"rows":case"cols":if(!p&&p!==0)throw new Error(`${S} must be numeric, value: ${p}`);break;case"windowsPty":p=p??{}}return p}}l.OptionsService=x},2660:function(d,l,u){var c=this&&this.__decorate||function(x,C,S,p){var g,b=arguments.length,y=b<3?C:p===null?p=Object.getOwnPropertyDescriptor(C,S):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(x,C,S,p);else for(var E=x.length-1;E>=0;E--)(g=x[E])&&(y=(b<3?g(y):b>3?g(C,S,y):g(C,S))||y);return b>3&&y&&Object.defineProperty(C,S,y),y},v=this&&this.__param||function(x,C){return function(S,p){C(S,p,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const m=u(2585);let _=l.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const C=this._bufferService.buffer;if(x.id===void 0){const E=C.addMarker(C.ybase+C.y),T={data:x,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(T,E))),this._dataByLinkId.set(T.id,T),T.id}const S=x,p=this._getEntryIdKey(S),g=this._entriesWithId.get(p);if(g)return this.addLineToLink(g.id,C.ybase+C.y),g.id;const b=C.addMarker(C.ybase+C.y),y={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[b]};return b.onDispose((()=>this._removeMarkerFromLink(y,b))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(x,C){const S=this._dataByLinkId.get(x);if(S&&S.lines.every((p=>p.line!==C))){const p=this._bufferService.buffer.addMarker(C);S.lines.push(p),p.onDispose((()=>this._removeMarkerFromLink(S,p)))}}getLinkData(x){return this._dataByLinkId.get(x)?.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,C){const S=x.lines.indexOf(C);S!==-1&&(x.lines.splice(S,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};l.OscLinkService=_=c([v(0,m.IBufferService)],_)},8343:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",c="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(v){return v[c]||[]},l.createDecorator=function(v){if(l.serviceRegistry.has(v))return l.serviceRegistry.get(v);const m=function(_,x,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,p,g){p[u]===p?p[c].push({id:S,index:g}):(p[c]=[{id:S,index:g}],p[u]=p)})(m,_,C)};return m.toString=()=>v,l.serviceRegistry.set(v,m),m}},2585:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const c=u(8343);var v;l.IBufferService=(0,c.createDecorator)("BufferService"),l.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),l.ICoreService=(0,c.createDecorator)("CoreService"),l.ICharsetService=(0,c.createDecorator)("CharsetService"),l.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(m){m[m.TRACE=0]="TRACE",m[m.DEBUG=1]="DEBUG",m[m.INFO=2]="INFO",m[m.WARN=3]="WARN",m[m.ERROR=4]="ERROR",m[m.OFF=5]="OFF"})(v||(l.LogLevelEnum=v={})),l.ILogService=(0,c.createDecorator)("LogService"),l.IOptionsService=(0,c.createDecorator)("OptionsService"),l.IOscLinkService=(0,c.createDecorator)("OscLinkService"),l.IUnicodeService=(0,c.createDecorator)("UnicodeService"),l.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const c=u(8460),v=u(225);class m{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,C,S=!1){return(16777215&x)<<3|(3&C)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const x=new v.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let C=0,S=0;const p=x.length;for(let g=0;g<p;++g){let b=x.charCodeAt(g);if(55296<=b&&b<=56319){if(++g>=p)return C+this.wcwidth(b);const T=x.charCodeAt(g);56320<=T&&T<=57343?b=1024*(b-55296)+T-56320+65536:C+=this.wcwidth(T)}const y=this.charProperties(b,S);let E=m.extractWidth(y);m.extractShouldJoin(y)&&(E-=m.extractWidth(S)),C+=E,S=y}return C}charProperties(x,C){return this._activeProvider.charProperties(x,C)}}l.UnicodeService=m}},s={};function a(d){var l=s[d];if(l!==void 0)return l.exports;var u=s[d]={exports:{}};return i[d].call(u.exports,u,u.exports,a),u.exports}var h={};return(()=>{var d=h;Object.defineProperty(d,"__esModule",{value:!0}),d.Terminal=void 0;const l=a(9042),u=a(3236),c=a(844),v=a(5741),m=a(8285),_=a(7975),x=a(7090),C=["cols","rows"];class S extends c.Disposable{constructor(g){super(),this._core=this.register(new u.Terminal(g)),this._addonManager=this.register(new v.AddonManager),this._publicOptions={...this._core.options};const b=E=>this._core.options[E],y=(E,T)=>{this._checkReadonlyOptions(E),this._core.options[E]=T};for(const E in this._core.options){const T={get:b.bind(this,E),set:y.bind(this,E)};Object.defineProperty(this._publicOptions,E,T)}}_checkReadonlyOptions(g){if(C.includes(g))throw new Error(`Option "${g}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new m.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const g=this._core.coreService.decPrivateModes;let b="none";switch(this._core.coreMouseService.activeProtocol){case"X10":b="x10";break;case"VT200":b="vt200";break;case"DRAG":b="drag";break;case"ANY":b="any"}return{applicationCursorKeysMode:g.applicationCursorKeys,applicationKeypadMode:g.applicationKeypad,bracketedPasteMode:g.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:b,originMode:g.origin,reverseWraparoundMode:g.reverseWraparound,sendFocusMode:g.sendFocus,wraparoundMode:g.wraparound}}get options(){return this._publicOptions}set options(g){for(const b in g)this._publicOptions[b]=g[b]}blur(){this._core.blur()}focus(){this._core.focus()}resize(g,b){this._verifyIntegers(g,b),this._core.resize(g,b)}open(g){this._core.open(g)}attachCustomKeyEventHandler(g){this._core.attachCustomKeyEventHandler(g)}registerLinkProvider(g){return this._core.registerLinkProvider(g)}registerCharacterJoiner(g){return this._checkProposedApi(),this._core.registerCharacterJoiner(g)}deregisterCharacterJoiner(g){this._checkProposedApi(),this._core.deregisterCharacterJoiner(g)}registerMarker(g=0){return this._verifyIntegers(g),this._core.registerMarker(g)}registerDecoration(g){return this._checkProposedApi(),this._verifyPositiveIntegers(g.x??0,g.width??0,g.height??0),this._core.registerDecoration(g)}hasSelection(){return this._core.hasSelection()}select(g,b,y){this._verifyIntegers(g,b,y),this._core.select(g,b,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(g,b){this._verifyIntegers(g,b),this._core.selectLines(g,b)}dispose(){super.dispose()}scrollLines(g){this._verifyIntegers(g),this._core.scrollLines(g)}scrollPages(g){this._verifyIntegers(g),this._core.scrollPages(g)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(g){this._verifyIntegers(g),this._core.scrollToLine(g)}clear(){this._core.clear()}write(g,b){this._core.write(g,b)}writeln(g,b){this._core.write(g),this._core.write(`\r
|
|
66
|
-
`,b)}paste(g){this._core.paste(g)}refresh(g,b){this._verifyIntegers(g,b),this._core.refresh(g,b)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(g){this._addonManager.loadAddon(this,g)}static get strings(){return l}_verifyIntegers(...g){for(const b of g)if(b===1/0||isNaN(b)||b%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...g){for(const b of g)if(b&&(b===1/0||isNaN(b)||b%1!=0||b<0))throw new Error("This API only accepts positive integers")}}d.Terminal=S})(),h})()))})(Dm)),Dm.exports}var eP=JH(),Tm={exports:{}},FS;function tP(){return FS||(FS=1,(function(e,n){(function(i,s){e.exports=s()})(self,(()=>(()=>{var i={};return(()=>{var s=i;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const h=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(h._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,h=a._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const d=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),c=Math.max(0,parseInt(l.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),m=u-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),_=c-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-d;return{cols:Math.max(2,Math.floor(_/h.css.cell.width)),rows:Math.max(1,Math.floor(m/h.css.cell.height))}}}})(),i})()))})(Tm)),Tm.exports}var nP=tP();class rP{ws=null;handlers;sessionId;reconnectTimer=null;retryCount=0;exitReceived=!1;manualClose=!1;reconnectScheduled=!1;constructor(n,i){this.sessionId=n,this.handlers=i}connect(){this.clearReconnectTimer();const n=window.location.protocol==="https:"?"wss:":"ws:",i=window.location.host,s=`${n}//${i}/api/sessions/${this.sessionId}/terminal?sessionId=${this.sessionId}`;this.ws=new WebSocket(s),this.manualClose=!1,this.exitReceived=!1,this.reconnectScheduled=!1,this.ws.onopen=()=>{this.retryCount=0,this.handlers.onOpen?.()},this.ws.onmessage=a=>{try{const h=JSON.parse(a.data);this.handleServerMessage(h)}catch(h){console.error("Failed to parse WebSocket message:",h)}},this.ws.onerror=a=>{console.error("WebSocket error:",a),this.scheduleReconnect()},this.ws.onclose=()=>{this.handlers.onClose?.(),this.scheduleReconnect()}}handleServerMessage(n){switch(n.type){case"output":{const i=n;this.handlers.onOutput?.(i.data);break}case"exit":{const i=n;this.exitReceived=!0,this.handlers.onExit?.(i.data.code,i.data.signal);break}case"error":{const i=n;this.handlers.onError?.(i.data.message);break}case"pong":{this.handlers.onPong?.();break}default:{console.warn("Unknown server message type:",n.type);break}}}sendInput(n){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.error("WebSocket is not connected");return}const i={type:"input",data:n,timestamp:new Date().toISOString()};this.ws.send(JSON.stringify(i))}sendResize(n,i){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.error("WebSocket is not connected");return}const s={type:"resize",data:{cols:n,rows:i},timestamp:new Date().toISOString()};this.ws.send(JSON.stringify(s))}sendPing(){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.error("WebSocket is not connected");return}const n={type:"ping",timestamp:new Date().toISOString()};this.ws.send(JSON.stringify(n))}disconnect(){this.manualClose=!0,this.exitReceived=!0,this.clearReconnectTimer(),this.ws&&(this.ws.close(),this.ws=null)}isConnected(){return this.ws!==null&&this.ws.readyState===WebSocket.OPEN}scheduleReconnect(){if(this.reconnectScheduled||this.manualClose||this.exitReceived)return;if(this.retryCount>=iP){this.handlers.onError?.("Unable to reconnect to session.");return}this.retryCount+=1;const n=Math.min(2e3,this.retryCount*500);this.clearReconnectTimer(),this.reconnectScheduled=!0,this.reconnectTimer=window.setTimeout(()=>{this.reconnectScheduled=!1,this.connect()},n)}clearReconnectTimer(){this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.reconnectScheduled=!1)}}const iP=5;function sP({sessionId:e,onExit:n,onError:i}){const s=L.useRef(null),a=L.useRef(null),h=L.useRef(null),d=L.useRef(null),l=L.useRef(n),u=L.useRef(i);return L.useEffect(()=>{l.current=n,u.current=i},[n,i]),L.useEffect(()=>{if(!s.current)return;const c=new eP.Terminal({cursorBlink:!0,fontSize:14,fontFamily:'"Cascadia Code", "SF Mono", Monaco, Consolas, monospace',theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#aeafad",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff"}}),v=new nP.FitAddon;c.loadAddon(v),c.open(s.current),v.fit(),a.current=c,h.current=v;const m=new rP(e,{onOutput:C=>{c.write(C)},onExit:C=>{c.write(`\r
|
|
67
|
-
\r
|
|
68
|
-
[Process exited with code ${C}]\r
|
|
69
|
-
`),l.current?.(C)},onError:C=>{c.write(`\r
|
|
70
|
-
\r
|
|
71
|
-
[Error: ${C}]\r
|
|
72
|
-
`),u.current?.(C)},onOpen:()=>{c.write(`Connected to session...\r
|
|
73
|
-
`)},onClose:()=>{c.write(`\r
|
|
74
|
-
[Connection closed]\r
|
|
75
|
-
`)}});m.connect(),d.current=m,c.onData(C=>{m.sendInput(C)});const _=()=>{v.fit(),m.isConnected()&&m.sendResize(c.cols,c.rows)};window.addEventListener("resize",_);let x=null;return typeof ResizeObserver<"u"&&(x=new ResizeObserver(()=>{_()}),x.observe(s.current)),()=>{window.removeEventListener("resize",_),x?.disconnect(),m.disconnect(),c.dispose()}},[e]),M.jsx("div",{ref:s,style:{width:"100%",height:"100%",padding:"8px",backgroundColor:"#1e1e1e"}})}function oP({sessionId:e,isFullscreen:n,onToggleFullscreen:i,onExit:s,onError:a}){return e?M.jsxs(Kt,{className:ze("flex flex-col transition-all",n&&"fixed inset-4 z-50 h-auto"),"data-testid":"active-terminal",children:[M.jsxs(An,{className:"flex-shrink-0 pb-2",children:[M.jsxs("div",{className:"flex items-center justify-between",children:[M.jsxs("div",{children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Active Session"}),M.jsx("h3",{className:"text-lg font-semibold",children:"ターミナルセッション"})]}),M.jsxs("div",{className:"flex gap-2",children:[M.jsx(Ut,{variant:"ghost",size:"sm",onClick:i,children:n?"通常表示に戻す":"最大化"}),n&&M.jsx(Ut,{variant:"ghost",size:"sm",onClick:i,"aria-label":"ターミナルを閉じる",children:"×"})]})]}),M.jsx("p",{className:"text-sm text-muted-foreground",children:"出力はリアルタイムにストリームされます。終了するとこのパネルは自動で閉じます。"})]}),M.jsx(en,{className:ze("flex-1 overflow-hidden",n&&"h-full"),children:M.jsx("div",{className:ze("h-full min-h-[300px] overflow-auto rounded-lg border bg-black p-4",n&&"min-h-0"),children:M.jsx(sP,{sessionId:e,onExit:s,onError:a})})})]}):M.jsxs(Kt,{className:"h-full",children:[M.jsxs(An,{className:"pb-2",children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Terminal"}),M.jsx("h3",{className:"text-lg font-semibold",children:"セッションは未起動"})]}),M.jsx(en,{className:"flex min-h-[200px] items-center justify-center",children:M.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:["上部のアクションからAIツールを起動すると、",M.jsx("br",{}),"このエリアにターミナルが表示されます。"]})})]})}const aP={local:"ローカル",remote:"リモート"},lP={merged:"マージ済み",unmerged:"未マージ",unknown:"状態不明"};function cP(){const{branchName:e}=AD(),n=e?decodeURIComponent(e):"",{data:i,isLoading:s,error:a}=BT(n),h=jT(n),d=t6(),l=r6(),{data:u,isLoading:c}=n6(),v=i6(),{data:m,isLoading:_,error:x}=H1(),[C,S]=L.useState(null),[p,g]=L.useState(!1),[b,y]=L.useState(null),[E,T]=L.useState(!1),[O,D]=L.useState("claude-code"),[A,N]=L.useState("normal"),[q,P]=L.useState(!1),[z,W]=L.useState(""),[U,G]=L.useState(null),H=L.useMemo(()=>uP(i?.commitDate),[i?.commitDate]);L.useEffect(()=>{if(!E)return;const le=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=le}},[E]);const K=m?.codingAgents??[],F=L.useMemo(()=>[{id:"claude-code",label:"Claude Code",target:"claude"},{id:"codex-cli",label:"Codex CLI",target:"codex"},...K.map(le=>({id:le.id,label:le.displayName,target:"custom",definition:le}))],[K]);L.useEffect(()=>{if(!F.length){D("claude-code");return}if(!F.find(le=>le.id===O)){const le=F[0];le&&D(le.id)}},[F,O]);const k=L.useMemo(()=>(u??[]).filter(le=>le.worktreePath===i?.worktreePath).sort((le,_e)=>(_e.startedAt??"").localeCompare(le.startedAt??"")),[u,i?.worktreePath]),$=L.useMemo(()=>{if(!i)return null;if(i.lastToolUsage)return i.lastToolUsage;const le=k[0];return le?{branch:i.name,worktreePath:i.worktreePath??null,toolId:le.agentType==="custom"?le.agentName??"custom":le.agentType,toolLabel:le.agentType==="custom"?le.agentName??"Custom":$S(le.agentType),mode:le.mode??"normal",model:null,timestamp:le.startedAt?Date.parse(le.startedAt):Date.now()}:null},[i,k]);if(s)return M.jsxs("div",{className:"min-h-screen bg-background",children:[M.jsx(Sr,{eyebrow:"BRANCH DETAIL",title:"読み込み中...",subtitle:"ブランチ情報を取得しています"}),M.jsx("main",{className:"mx-auto max-w-7xl px-6 py-8",children:M.jsx("div",{className:"flex items-center justify-center py-20",children:M.jsxs("div",{className:"text-center",children:[M.jsx("div",{className:"mb-4 text-4xl",children:"⏳"}),M.jsx("p",{className:"text-muted-foreground",children:"Loading branch..."})]})})})]});if(a)return M.jsxs("div",{className:"min-h-screen bg-background",children:[M.jsx(Sr,{eyebrow:"BRANCH DETAIL",title:"エラー"}),M.jsxs("main",{className:"mx-auto max-w-7xl px-6 py-8",children:[M.jsx(wi,{variant:"destructive",children:M.jsx(Ci,{children:a instanceof Error?a.message:"未知のエラーです"})}),M.jsx("div",{className:"mt-4",children:M.jsx(Ut,{variant:"ghost",asChild:!0,children:M.jsx(_r,{to:"/",children:"← ブランチ一覧に戻る"})})})]})]});if(!i)return M.jsxs("div",{className:"min-h-screen bg-background",children:[M.jsx(Sr,{eyebrow:"BRANCH DETAIL",title:"Branch not found"}),M.jsxs("main",{className:"mx-auto max-w-7xl px-6 py-8",children:[M.jsx("p",{className:"mb-4 text-muted-foreground",children:"指定されたブランチは存在しません。"}),M.jsx(Ut,{variant:"ghost",asChild:!0,children:M.jsx(_r,{to:"/",children:"← ブランチ一覧に戻る"})})]})]});const B=!!i.worktreePath,I=i.divergence??null,Q=!!(I&&I.ahead>0&&I.behind>0),J=!!(i.worktreePath&&I&&I.behind>0&&I.ahead===0&&!Q),ae=h.isPending,Z=F.find(le=>le.id===O),X=async()=>{try{await d.mutateAsync({branchName:i.name,createBranch:!1}),y({type:"success",message:`${i.name} のWorktreeを作成しました。`})}catch(le){y({type:"error",message:ku(le,"Worktreeの作成に失敗しました")})}},V=async()=>{if(!i.worktreePath){y({type:"error",message:"Worktreeが存在しないため、先に作成してください。"});return}if(!Z){y({type:"error",message:"起動する Coding Agent を選択してください"});return}if(J){y({type:"error",message:"リモートの更新を取り込むまで Coding Agent は起動できません。"});return}if(!(q&&!window.confirm("権限チェックをスキップして起動します。続行しますか?"))){g(!0);try{const le=Z.target==="codex"?"codex-cli":Z.target==="custom"?"custom":"claude-code",_e=A==="normal"?null:$?.sessionId&&$.toolId===O?$.sessionId:null,Ee=z.split(/\s+/).map(Ce=>Ce.trim()).filter(Boolean),He={agentType:le,agentName:Z.target==="custom"?Z.id:null,...Z.target==="custom"?{customAgentId:Z.id}:{},mode:A,worktreePath:i.worktreePath,skipPermissions:q,...Z.target==="codex"?{bypassApprovals:q}:{},..._e?{resumeSessionId:_e}:{},...Ee.length?{extraArgs:Ee}:{}},ke=await l.mutateAsync(He);S(ke.sessionId),T(!1),y({type:"info",message:`${$S(le,Z)} を起動しました。`})}catch(le){y({type:"error",message:ku(le,"セッションの起動に失敗しました")})}finally{g(!1)}}},ie=async le=>{G(le);try{await v.mutateAsync(le),y({type:"success",message:"セッションを終了しました"}),C===le&&S(null)}catch(_e){y({type:"error",message:ku(_e,"セッションの終了に失敗しました")})}finally{G(null)}},de=async()=>{if(!i.worktreePath){y({type:"error",message:"Worktreeが存在しないため同期できません。"});return}try{const le=await h.mutateAsync({worktreePath:i.worktreePath});if(le.pullStatus==="success")y({type:"success",message:"リモートの最新変更を取り込みました。"});else{const _e=le.warnings?.join(`
|
|
76
|
-
`)??"fast-forward pull が完了しませんでした";y({type:"error",message:`git pull --ff-only が失敗しました。
|
|
77
|
-
${_e}`})}}catch(le){y({type:"error",message:ku(le,"Git同期に失敗しました")})}},re=le=>{S(null),T(!1),y({type:le===0?"success":"error",message:`セッションがコード ${le} で終了しました。`})};return M.jsxs("div",{className:"min-h-screen bg-background",children:[E&&M.jsx("div",{className:"fixed inset-0 z-40 bg-black/80","aria-hidden":"true",onClick:()=>T(!1)}),M.jsxs(Sr,{eyebrow:"BRANCH DETAIL",title:i.name,subtitle:`最新コミット ${i.commitHash.slice(0,7)} · ${H}`,children:[M.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[M.jsx(pt,{variant:i.type==="local"?"local":"remote",children:aP[i.type]}),M.jsx(pt,{variant:i.mergeStatus==="merged"?"success":i.mergeStatus==="unmerged"?"warning":"outline",children:lP[i.mergeStatus]}),M.jsx(pt,{variant:i.worktreePath?"success":"outline",children:i.worktreePath?"Worktreeあり":"Worktree未作成"})]}),M.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[M.jsx(Ut,{variant:"ghost",size:"sm",asChild:!0,children:M.jsx(_r,{to:"/",children:"← ブランチ一覧"})}),B?M.jsx(Ut,{variant:"secondary",asChild:!0,children:M.jsx(_r,{to:"/config",children:"Custom Coding Agent"})}):M.jsx(Ut,{onClick:X,disabled:d.isPending,children:d.isPending?"作成中...":"Worktreeを作成"})]})]}),b&&M.jsx("div",{className:"mx-auto max-w-7xl px-6 pt-4",children:M.jsx(wi,{variant:b.type==="error"?"destructive":b.type==="success"?"success":"info",children:M.jsx(Ci,{children:b.message})})}),M.jsx("main",{className:"mx-auto max-w-7xl space-y-6 px-6 py-8",children:M.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_400px]",children:[M.jsxs("div",{className:"space-y-6",children:[M.jsx(KH,{branch:i,availableTools:F,selectedToolId:O,selectedMode:A,skipPermissions:q,extraArgsText:z,isConfigLoading:_,configError:x??null,isStartingSession:p,isSyncingBranch:ae,needsRemoteSync:J,hasConflictingDivergence:Q,onToolChange:D,onModeChange:N,onSkipPermissionsChange:P,onExtraArgsChange:W,onStartSession:V,onSyncBranch:de}),M.jsx(d6,{sessions:k,isLoading:c,terminatingSessionId:U,isDeleting:v.isPending,onTerminate:ie,onSelectSession:S}),M.jsx(ZH,{branch:i,formattedCommitDate:H,latestToolUsage:$})]}),M.jsx("div",{className:"lg:sticky lg:top-6 lg:self-start",children:M.jsx(oP,{sessionId:C,isFullscreen:E,onToggleFullscreen:()=>T(le=>!le),onExit:re,onError:le=>y({type:"error",message:le??"不明なエラー"})})})]})})]})}function uP(e){if(!e)return"日時不明";try{return new Intl.DateTimeFormat("ja-JP",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return e}}function ku(e,n){return e instanceof Nx?`${e.message}${e.details?`
|
|
78
|
-
${e.details}`:""}`:e instanceof Error?e.message:n}function $S(e,n){return e==="custom"&&n?.target==="custom"?n.label:e==="codex-cli"?"Codex CLI":"Claude Code"}const hP=/^[A-Z0-9_]+$/;function aE(e){const n={id:e?.id??`env-${Date.now()}-${Math.random().toString(36).slice(2)}`,key:e?.key??"",value:e?.value??""};return typeof e?.importedFromOs=="boolean"&&(n.importedFromOs=e.importedFromOs),e?.lastUpdated&&(n.lastUpdated=e.lastUpdated),n}function fP(e){return e.key?!hP.test(e.key):!0}function VS({title:e,rows:n,onChange:i,description:s,allowAdd:a=!0,emptyLabel:h="環境変数はまだありません"}){const d=(c,v,m)=>{i(n.map(_=>_.id===c?{..._,[v]:v==="key"?m.toUpperCase().replace(/[^A-Z0-9_]/g,"_"):m}:_))},l=c=>{i(n.filter(v=>v.id!==c))},u=()=>{i([...n,aE()])};return M.jsxs("div",{className:"space-y-4",children:[M.jsxs("div",{className:"flex items-start justify-between gap-4",children:[M.jsxs("div",{children:[M.jsx("h3",{className:"font-semibold",children:e}),s&&M.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s})]}),a&&M.jsx(Ut,{variant:"secondary",size:"sm",onClick:u,children:"変数を追加"})]}),n.length===0?M.jsx("p",{className:"py-4 text-center text-sm text-muted-foreground",children:h}):M.jsx("div",{className:"rounded-md border",children:M.jsxs(ng,{children:[M.jsx(rg,{children:M.jsxs(Bl,{children:[M.jsx(Br,{children:"キー"}),M.jsx(Br,{children:"値"}),M.jsx(Br,{className:"w-24 text-right",children:"操作"})]})}),M.jsx(ig,{children:n.map(c=>{const v=fP(c);return M.jsxs(Bl,{className:ze(v&&"bg-destructive/10"),children:[M.jsxs(jr,{className:"space-y-1",children:[M.jsx(kl,{type:"text",value:c.key,onChange:m=>d(c.id,"key",m.target.value),placeholder:"EXAMPLE_KEY",className:ze(v&&"border-destructive")}),M.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.importedFromOs&&M.jsx(pt,{variant:"outline",className:"text-xs",children:"OSから取り込み"}),c.lastUpdated&&M.jsxs("span",{className:"text-xs text-muted-foreground",children:["更新: ",new Date(c.lastUpdated).toLocaleString()]})]}),v&&M.jsx("p",{className:"text-xs text-destructive",children:"A-Z,0-9,_ のみ使用できます"})]}),M.jsx(jr,{children:M.jsx(kl,{type:"text",value:c.value,onChange:m=>d(c.id,"value",m.target.value),placeholder:"値"})}),M.jsx(jr,{className:"text-right",children:M.jsx(Ut,{variant:"ghost",size:"sm",onClick:()=>l(c.id),children:"削除"})})]},c.id)})})]})})]})}function qS(e){return e?e.map(n=>{const i={key:n.key,value:n.value};return typeof n.importedFromOs=="boolean"&&(i.importedFromOs=n.importedFromOs),n.lastUpdated&&(i.lastUpdated=n.lastUpdated),aE(i)}):[]}function mh(e){return e.filter(n=>n.key.trim().length>0).map(n=>({key:n.key.trim().toUpperCase(),value:n.value}))}function dP(e,n,i){const s=(e?.codingAgents??[]).map(a=>({...a,env:mh(i[a.id]??[])}));return{version:e?.version??"1.0.0",env:mh(n),codingAgents:s}}function mP(){const{data:e,isLoading:n,error:i}=H1(),s=s6(),[a,h]=L.useState([]),[d,l]=L.useState({}),[u,c]=L.useState(null);L.useEffect(()=>{if(!e)return;h(qS(e.env));const S={};e.codingAgents?.forEach(p=>{S[p.id]=qS(p.env)}),l(S)},[e]);const v=L.useMemo(()=>JSON.stringify(e?.env??[]),[e?.env]),m=L.useMemo(()=>JSON.stringify(mh(a)),[a]),_=L.useMemo(()=>{const S=a.some(b=>!b.key||/[^A-Z0-9_]/.test(b.key)),p=a.some(b=>b.key&&b.value.trim().length===0),g=Object.values(d).some(b=>b.some(y=>!y.key||/[^A-Z0-9_]/.test(y.key)||y.value.trim().length===0));return S||p||g},[a,d]),x=L.useMemo(()=>{if(v!==m)return!0;if(!e)return!1;const S=e.codingAgents?.map(g=>mh(d[g.id]??[]))??[],p=e.codingAgents?.map(g=>g.env??[])??[];return JSON.stringify(S)!==JSON.stringify(p)},[e,v,m,d]),C=async()=>{if(e)try{const S=dP(e,a,d);await s.mutateAsync(S),c({type:"success",message:"設定を保存しました"})}catch(S){c({type:"error",message:S instanceof Error?S.message:"保存に失敗しました"})}};return n?M.jsxs("div",{className:"min-h-screen bg-background",children:[M.jsx(Sr,{eyebrow:"CONFIG",title:"環境変数の管理",subtitle:"読み込み中..."}),M.jsx("main",{className:"mx-auto max-w-7xl px-6 py-8",children:M.jsx("div",{className:"flex items-center justify-center py-20",children:M.jsx("p",{className:"text-muted-foreground",children:"設定を読み込んでいます..."})})})]}):i?M.jsxs("div",{className:"min-h-screen bg-background",children:[M.jsx(Sr,{eyebrow:"CONFIG",title:"エラー"}),M.jsxs("main",{className:"mx-auto max-w-7xl px-6 py-8",children:[M.jsx(wi,{variant:"destructive",children:M.jsx(Ci,{children:i instanceof Error?i.message:"未知のエラーです"})}),M.jsx("div",{className:"mt-4",children:M.jsx(Ut,{variant:"ghost",asChild:!0,children:M.jsx(_r,{to:"/",children:"← ブランチ一覧に戻る"})})})]})]}):M.jsxs("div",{className:"min-h-screen bg-background",children:[M.jsx(Sr,{eyebrow:"CONFIG",title:"環境変数の管理",subtitle:"共通環境変数とツールごとの上書きをブラウザから編集できます。",children:M.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[M.jsx(Ut,{variant:"ghost",size:"sm",asChild:!0,children:M.jsx(_r,{to:"/",children:"← ブランチ一覧へ"})}),M.jsx(Ut,{onClick:C,disabled:s.isPending||_||!x,children:s.isPending?"保存中...":"保存"})]})}),u&&M.jsx("div",{className:"mx-auto max-w-7xl px-6 pt-4",children:M.jsx(wi,{variant:u.type==="error"?"destructive":"success",children:M.jsx(Ci,{children:u.message})})}),M.jsxs("main",{className:"mx-auto max-w-7xl space-y-6 px-6 py-8",children:[M.jsx(Kt,{children:M.jsx(en,{className:"pt-6",children:M.jsx(VS,{title:"共通環境変数",description:"全ての Coding Agent で共有される値。PAT やプロキシ設定などはこちらに入力してください。",rows:a,onChange:h})})}),M.jsxs(Kt,{children:[M.jsxs(An,{className:"pb-3",children:[M.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Agent-specific"}),M.jsx("h3",{className:"mt-1 text-lg font-semibold",children:"Coding Agent 固有の環境変数"}),M.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"各 Coding Agent 固有に上書きしたい値がある場合はこちらから設定します。 共通設定との競合がある場合はエージェント設定が優先されます。"})]}),M.jsxs(en,{className:"space-y-6",children:[e?.codingAgents?.map(S=>M.jsx("div",{className:"rounded-lg border p-4",children:M.jsx(VS,{title:S.displayName,description:`${S.executionType} / ${S.command}`,rows:d[S.id]??[],onChange:p=>l(g=>({...g,[S.id]:p}))})},S.id)),!e?.codingAgents?.length&&M.jsx("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"登録されている Coding Agent がありません。"})]})]})]})]})}const pP=yT([{path:"/",element:M.jsx(JB,{})},{path:"/:branchName",element:M.jsx(cP,{})},{path:"/config",element:M.jsx(mP,{})}]),gP=new KR({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e4}}}),lE=document.getElementById("root");if(!lE)throw new Error("Root element not found");CR.createRoot(lE).render(M.jsx(Nr.StrictMode,{children:M.jsx(GR,{client:gP,children:M.jsx(LT,{router:pP})})}));
|