@wingman-ai/gateway 0.1.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/.wingman/agents/README.md +161 -0
- package/.wingman/agents/coding/agent.md +147 -0
- package/.wingman/agents/coding/implementor.md +56 -0
- package/.wingman/agents/main/agent.md +19 -0
- package/.wingman/agents/researcher/agent.md +62 -0
- package/.wingman/agents/stock-trader/agent.md +223 -0
- package/.wingman/agents/stock-trader/chain-curator.md +24 -0
- package/.wingman/agents/stock-trader/goal-translator.md +42 -0
- package/.wingman/agents/stock-trader/guardrails-veto.md +11 -0
- package/.wingman/agents/stock-trader/path-planner.md +23 -0
- package/.wingman/agents/stock-trader/regime-analyst.md +15 -0
- package/.wingman/agents/stock-trader/risk.md +20 -0
- package/.wingman/agents/stock-trader/selection.md +22 -0
- package/.wingman/agents/stock-trader/strategy-composer.md +38 -0
- package/.wingman/agents/wingman/agent.json +12 -0
- package/bin/wingman +7 -0
- package/dist/agent/config/agentConfig.cjs +95 -0
- package/dist/agent/config/agentConfig.d.ts +187 -0
- package/dist/agent/config/agentConfig.js +52 -0
- package/dist/agent/config/agentLoader.cjs +242 -0
- package/dist/agent/config/agentLoader.d.ts +42 -0
- package/dist/agent/config/agentLoader.js +208 -0
- package/dist/agent/config/mcpClientManager.cjs +168 -0
- package/dist/agent/config/mcpClientManager.d.ts +41 -0
- package/dist/agent/config/mcpClientManager.js +134 -0
- package/dist/agent/config/modelFactory.cjs +175 -0
- package/dist/agent/config/modelFactory.d.ts +33 -0
- package/dist/agent/config/modelFactory.js +141 -0
- package/dist/agent/config/toolRegistry.cjs +111 -0
- package/dist/agent/config/toolRegistry.d.ts +25 -0
- package/dist/agent/config/toolRegistry.js +71 -0
- package/dist/agent/middleware/additional-messages.cjs +60 -0
- package/dist/agent/middleware/additional-messages.d.ts +7 -0
- package/dist/agent/middleware/additional-messages.js +26 -0
- package/dist/agent/middleware/hooks/executor.cjs +137 -0
- package/dist/agent/middleware/hooks/executor.d.ts +52 -0
- package/dist/agent/middleware/hooks/executor.js +103 -0
- package/dist/agent/middleware/hooks/input-builder.cjs +55 -0
- package/dist/agent/middleware/hooks/input-builder.d.ts +15 -0
- package/dist/agent/middleware/hooks/input-builder.js +21 -0
- package/dist/agent/middleware/hooks/matcher.cjs +59 -0
- package/dist/agent/middleware/hooks/matcher.d.ts +27 -0
- package/dist/agent/middleware/hooks/matcher.js +22 -0
- package/dist/agent/middleware/hooks/merger.cjs +54 -0
- package/dist/agent/middleware/hooks/merger.d.ts +18 -0
- package/dist/agent/middleware/hooks/merger.js +20 -0
- package/dist/agent/middleware/hooks/types.cjs +62 -0
- package/dist/agent/middleware/hooks/types.d.ts +82 -0
- package/dist/agent/middleware/hooks/types.js +19 -0
- package/dist/agent/middleware/hooks.cjs +79 -0
- package/dist/agent/middleware/hooks.d.ts +19 -0
- package/dist/agent/middleware/hooks.js +45 -0
- package/dist/agent/middleware/media-compat.cjs +80 -0
- package/dist/agent/middleware/media-compat.d.ts +7 -0
- package/dist/agent/middleware/media-compat.js +46 -0
- package/dist/agent/tests/agentConfig.test.cjs +132 -0
- package/dist/agent/tests/agentConfig.test.d.ts +1 -0
- package/dist/agent/tests/agentConfig.test.js +126 -0
- package/dist/agent/tests/agentLoader.test.cjs +235 -0
- package/dist/agent/tests/agentLoader.test.d.ts +1 -0
- package/dist/agent/tests/agentLoader.test.js +229 -0
- package/dist/agent/tests/modelFactory.test.cjs +114 -0
- package/dist/agent/tests/modelFactory.test.d.ts +1 -0
- package/dist/agent/tests/modelFactory.test.js +108 -0
- package/dist/agent/tests/test-agent-loader.cjs +33 -0
- package/dist/agent/tests/test-agent-loader.d.ts +1 -0
- package/dist/agent/tests/test-agent-loader.js +27 -0
- package/dist/agent/tests/test-subagent-loading.cjs +99 -0
- package/dist/agent/tests/test-subagent-loading.d.ts +1 -0
- package/dist/agent/tests/test-subagent-loading.js +93 -0
- package/dist/agent/tests/toolRegistry.test.cjs +109 -0
- package/dist/agent/tests/toolRegistry.test.d.ts +1 -0
- package/dist/agent/tests/toolRegistry.test.js +103 -0
- package/dist/agent/tools/code_search.cjs +108 -0
- package/dist/agent/tools/code_search.d.ts +24 -0
- package/dist/agent/tools/code_search.js +74 -0
- package/dist/agent/tools/command_execute.cjs +136 -0
- package/dist/agent/tools/command_execute.d.ts +12 -0
- package/dist/agent/tools/command_execute.js +99 -0
- package/dist/agent/tools/git_status.cjs +126 -0
- package/dist/agent/tools/git_status.d.ts +15 -0
- package/dist/agent/tools/git_status.js +92 -0
- package/dist/agent/tools/internet_search.cjs +93 -0
- package/dist/agent/tools/internet_search.d.ts +25 -0
- package/dist/agent/tools/internet_search.js +56 -0
- package/dist/agent/tools/think.cjs +53 -0
- package/dist/agent/tools/think.d.ts +26 -0
- package/dist/agent/tools/think.js +16 -0
- package/dist/agent/tools/web_crawler.cjs +180 -0
- package/dist/agent/tools/web_crawler.d.ts +31 -0
- package/dist/agent/tools/web_crawler.js +143 -0
- package/dist/agent/utils.cjs +54 -0
- package/dist/agent/utils.d.ts +1 -0
- package/dist/agent/utils.js +10 -0
- package/dist/cli/commands/agent.cjs +169 -0
- package/dist/cli/commands/agent.d.ts +15 -0
- package/dist/cli/commands/agent.js +125 -0
- package/dist/cli/commands/gateway.cjs +601 -0
- package/dist/cli/commands/gateway.d.ts +12 -0
- package/dist/cli/commands/gateway.js +567 -0
- package/dist/cli/commands/init.cjs +681 -0
- package/dist/cli/commands/init.d.ts +10 -0
- package/dist/cli/commands/init.js +634 -0
- package/dist/cli/commands/provider.cjs +208 -0
- package/dist/cli/commands/provider.d.ts +5 -0
- package/dist/cli/commands/provider.js +174 -0
- package/dist/cli/commands/skill.cjs +145 -0
- package/dist/cli/commands/skill.d.ts +10 -0
- package/dist/cli/commands/skill.js +111 -0
- package/dist/cli/config/loader.cjs +143 -0
- package/dist/cli/config/loader.d.ts +14 -0
- package/dist/cli/config/loader.js +109 -0
- package/dist/cli/config/schema.cjs +262 -0
- package/dist/cli/config/schema.d.ts +268 -0
- package/dist/cli/config/schema.js +213 -0
- package/dist/cli/core/agentInvoker.cjs +284 -0
- package/dist/cli/core/agentInvoker.d.ts +77 -0
- package/dist/cli/core/agentInvoker.js +247 -0
- package/dist/cli/core/commandHandler.cjs +257 -0
- package/dist/cli/core/commandHandler.d.ts +62 -0
- package/dist/cli/core/commandHandler.js +223 -0
- package/dist/cli/core/database/bunSqliteAdapter.cjs +87 -0
- package/dist/cli/core/database/bunSqliteAdapter.d.ts +34 -0
- package/dist/cli/core/database/bunSqliteAdapter.js +53 -0
- package/dist/cli/core/loggerBridge.cjs +42 -0
- package/dist/cli/core/loggerBridge.d.ts +8 -0
- package/dist/cli/core/loggerBridge.js +8 -0
- package/dist/cli/core/outputManager.cjs +106 -0
- package/dist/cli/core/outputManager.d.ts +43 -0
- package/dist/cli/core/outputManager.js +72 -0
- package/dist/cli/core/sessionManager.cjs +535 -0
- package/dist/cli/core/sessionManager.d.ts +111 -0
- package/dist/cli/core/sessionManager.js +486 -0
- package/dist/cli/core/streamParser.cjs +328 -0
- package/dist/cli/core/streamParser.d.ts +42 -0
- package/dist/cli/core/streamParser.js +288 -0
- package/dist/cli/index.cjs +211 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +205 -0
- package/dist/cli/services/skillRepository.cjs +178 -0
- package/dist/cli/services/skillRepository.d.ts +35 -0
- package/dist/cli/services/skillRepository.js +144 -0
- package/dist/cli/services/skillService.cjs +336 -0
- package/dist/cli/services/skillService.d.ts +48 -0
- package/dist/cli/services/skillService.js +302 -0
- package/dist/cli/types/gateway.cjs +18 -0
- package/dist/cli/types/gateway.d.ts +18 -0
- package/dist/cli/types/gateway.js +0 -0
- package/dist/cli/types/init.cjs +18 -0
- package/dist/cli/types/init.d.ts +13 -0
- package/dist/cli/types/init.js +0 -0
- package/dist/cli/types/provider.cjs +18 -0
- package/dist/cli/types/provider.d.ts +9 -0
- package/dist/cli/types/provider.js +0 -0
- package/dist/cli/types/skill.cjs +18 -0
- package/dist/cli/types/skill.d.ts +71 -0
- package/dist/cli/types/skill.js +0 -0
- package/dist/cli/types.cjs +18 -0
- package/dist/cli/types.d.ts +175 -0
- package/dist/cli/types.js +0 -0
- package/dist/cli/ui/AgentOutput.cjs +82 -0
- package/dist/cli/ui/AgentOutput.d.ts +8 -0
- package/dist/cli/ui/AgentOutput.js +38 -0
- package/dist/cli/ui/App.cjs +285 -0
- package/dist/cli/ui/App.d.ts +6 -0
- package/dist/cli/ui/App.js +241 -0
- package/dist/cli/ui/ErrorDisplay.cjs +65 -0
- package/dist/cli/ui/ErrorDisplay.d.ts +8 -0
- package/dist/cli/ui/ErrorDisplay.js +21 -0
- package/dist/cli/ui/LogDisplay.cjs +74 -0
- package/dist/cli/ui/LogDisplay.d.ts +13 -0
- package/dist/cli/ui/LogDisplay.js +30 -0
- package/dist/cli/ui/SessionListDisplay.cjs +135 -0
- package/dist/cli/ui/SessionListDisplay.d.ts +9 -0
- package/dist/cli/ui/SessionListDisplay.js +91 -0
- package/dist/cli/ui/blockHelpers.cjs +80 -0
- package/dist/cli/ui/blockHelpers.d.ts +21 -0
- package/dist/cli/ui/blockHelpers.js +40 -0
- package/dist/cli/ui/components/ToolCallDisplay.cjs +207 -0
- package/dist/cli/ui/components/ToolCallDisplay.d.ts +7 -0
- package/dist/cli/ui/components/ToolCallDisplay.js +162 -0
- package/dist/cli/ui/components/ToolResultDisplay.cjs +86 -0
- package/dist/cli/ui/components/ToolResultDisplay.d.ts +8 -0
- package/dist/cli/ui/components/ToolResultDisplay.js +42 -0
- package/dist/cli/ui/toolDisplayHelpers.cjs +112 -0
- package/dist/cli/ui/toolDisplayHelpers.d.ts +3 -0
- package/dist/cli/ui/toolDisplayHelpers.js +72 -0
- package/dist/gateway/adapters/discord.cjs +298 -0
- package/dist/gateway/adapters/discord.d.ts +42 -0
- package/dist/gateway/adapters/discord.js +246 -0
- package/dist/gateway/auth.cjs +94 -0
- package/dist/gateway/auth.d.ts +36 -0
- package/dist/gateway/auth.js +60 -0
- package/dist/gateway/broadcast.cjs +131 -0
- package/dist/gateway/broadcast.d.ts +76 -0
- package/dist/gateway/broadcast.js +97 -0
- package/dist/gateway/client.cjs +282 -0
- package/dist/gateway/client.d.ts +141 -0
- package/dist/gateway/client.js +248 -0
- package/dist/gateway/daemon.cjs +195 -0
- package/dist/gateway/daemon.d.ts +67 -0
- package/dist/gateway/daemon.js +161 -0
- package/dist/gateway/discovery/index.cjs +72 -0
- package/dist/gateway/discovery/index.d.ts +3 -0
- package/dist/gateway/discovery/index.js +3 -0
- package/dist/gateway/discovery/mdns.cjs +221 -0
- package/dist/gateway/discovery/mdns.d.ts +37 -0
- package/dist/gateway/discovery/mdns.js +177 -0
- package/dist/gateway/discovery/tailscale.cjs +140 -0
- package/dist/gateway/discovery/tailscale.d.ts +31 -0
- package/dist/gateway/discovery/tailscale.js +106 -0
- package/dist/gateway/discovery/types.cjs +18 -0
- package/dist/gateway/discovery/types.d.ts +41 -0
- package/dist/gateway/discovery/types.js +0 -0
- package/dist/gateway/env.cjs +45 -0
- package/dist/gateway/env.d.ts +2 -0
- package/dist/gateway/env.js +8 -0
- package/dist/gateway/hooks/loader.cjs +137 -0
- package/dist/gateway/hooks/loader.d.ts +10 -0
- package/dist/gateway/hooks/loader.js +103 -0
- package/dist/gateway/hooks/registry.cjs +128 -0
- package/dist/gateway/hooks/registry.d.ts +13 -0
- package/dist/gateway/hooks/registry.js +94 -0
- package/dist/gateway/hooks/types.cjs +58 -0
- package/dist/gateway/hooks/types.d.ts +50 -0
- package/dist/gateway/hooks/types.js +18 -0
- package/dist/gateway/http/agents.cjs +280 -0
- package/dist/gateway/http/agents.d.ts +2 -0
- package/dist/gateway/http/agents.js +246 -0
- package/dist/gateway/http/fs.cjs +81 -0
- package/dist/gateway/http/fs.d.ts +2 -0
- package/dist/gateway/http/fs.js +47 -0
- package/dist/gateway/http/providers.cjs +120 -0
- package/dist/gateway/http/providers.d.ts +2 -0
- package/dist/gateway/http/providers.js +86 -0
- package/dist/gateway/http/routines.cjs +196 -0
- package/dist/gateway/http/routines.d.ts +20 -0
- package/dist/gateway/http/routines.js +159 -0
- package/dist/gateway/http/sessions.cjs +241 -0
- package/dist/gateway/http/sessions.d.ts +2 -0
- package/dist/gateway/http/sessions.js +207 -0
- package/dist/gateway/http/types.cjs +18 -0
- package/dist/gateway/http/types.d.ts +25 -0
- package/dist/gateway/http/types.js +0 -0
- package/dist/gateway/http/voice.cjs +167 -0
- package/dist/gateway/http/voice.d.ts +2 -0
- package/dist/gateway/http/voice.js +133 -0
- package/dist/gateway/http/webhooks.cjs +353 -0
- package/dist/gateway/http/webhooks.d.ts +22 -0
- package/dist/gateway/http/webhooks.js +313 -0
- package/dist/gateway/index.cjs +119 -0
- package/dist/gateway/index.d.ts +8 -0
- package/dist/gateway/index.js +9 -0
- package/dist/gateway/node.cjs +218 -0
- package/dist/gateway/node.d.ts +112 -0
- package/dist/gateway/node.js +184 -0
- package/dist/gateway/router.cjs +85 -0
- package/dist/gateway/router.d.ts +9 -0
- package/dist/gateway/router.js +51 -0
- package/dist/gateway/rpcClient.cjs +152 -0
- package/dist/gateway/rpcClient.d.ts +24 -0
- package/dist/gateway/rpcClient.js +118 -0
- package/dist/gateway/server.cjs +1175 -0
- package/dist/gateway/server.d.ts +185 -0
- package/dist/gateway/server.js +1138 -0
- package/dist/gateway/transport/http.cjs +153 -0
- package/dist/gateway/transport/http.d.ts +25 -0
- package/dist/gateway/transport/http.js +119 -0
- package/dist/gateway/transport/index.cjs +40 -0
- package/dist/gateway/transport/index.d.ts +3 -0
- package/dist/gateway/transport/index.js +3 -0
- package/dist/gateway/transport/types.cjs +18 -0
- package/dist/gateway/transport/types.d.ts +59 -0
- package/dist/gateway/transport/types.js +0 -0
- package/dist/gateway/transport/websocket.cjs +132 -0
- package/dist/gateway/transport/websocket.d.ts +21 -0
- package/dist/gateway/transport/websocket.js +98 -0
- package/dist/gateway/types.cjs +18 -0
- package/dist/gateway/types.d.ts +215 -0
- package/dist/gateway/types.js +0 -0
- package/dist/gateway/validation.cjs +225 -0
- package/dist/gateway/validation.d.ts +157 -0
- package/dist/gateway/validation.js +158 -0
- package/dist/index.cjs +95 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/logger.cjs +270 -0
- package/dist/logger.d.ts +54 -0
- package/dist/logger.js +215 -0
- package/dist/providers/copilot.cjs +148 -0
- package/dist/providers/copilot.d.ts +3 -0
- package/dist/providers/copilot.js +114 -0
- package/dist/providers/credentials.cjs +154 -0
- package/dist/providers/credentials.d.ts +26 -0
- package/dist/providers/credentials.js +99 -0
- package/dist/providers/oauth.cjs +279 -0
- package/dist/providers/oauth.d.ts +13 -0
- package/dist/providers/oauth.js +245 -0
- package/dist/providers/registry.cjs +138 -0
- package/dist/providers/registry.d.ts +32 -0
- package/dist/providers/registry.js +98 -0
- package/dist/tests/additionalMessageMiddleware.test.cjs +45 -0
- package/dist/tests/additionalMessageMiddleware.test.d.ts +1 -0
- package/dist/tests/additionalMessageMiddleware.test.js +39 -0
- package/dist/tests/agent-config-voice.test.cjs +25 -0
- package/dist/tests/agent-config-voice.test.d.ts +1 -0
- package/dist/tests/agent-config-voice.test.js +19 -0
- package/dist/tests/agentInvokerAttachments.test.cjs +67 -0
- package/dist/tests/agentInvokerAttachments.test.d.ts +1 -0
- package/dist/tests/agentInvokerAttachments.test.js +61 -0
- package/dist/tests/attachments-utils.test.cjs +46 -0
- package/dist/tests/attachments-utils.test.d.ts +1 -0
- package/dist/tests/attachments-utils.test.js +40 -0
- package/dist/tests/bunSqliteAdapter.test.cjs +265 -0
- package/dist/tests/bunSqliteAdapter.test.d.ts +1 -0
- package/dist/tests/bunSqliteAdapter.test.js +259 -0
- package/dist/tests/candleRange.test.cjs +48 -0
- package/dist/tests/candleRange.test.d.ts +1 -0
- package/dist/tests/candleRange.test.js +42 -0
- package/dist/tests/cli-config-loader.test.cjs +364 -0
- package/dist/tests/cli-config-loader.test.d.ts +1 -0
- package/dist/tests/cli-config-loader.test.js +358 -0
- package/dist/tests/cli-init.test.cjs +82 -0
- package/dist/tests/cli-init.test.d.ts +1 -0
- package/dist/tests/cli-init.test.js +76 -0
- package/dist/tests/discord-adapter.test.cjs +55 -0
- package/dist/tests/discord-adapter.test.d.ts +1 -0
- package/dist/tests/discord-adapter.test.js +49 -0
- package/dist/tests/gateway.test.cjs +319 -0
- package/dist/tests/gateway.test.d.ts +1 -0
- package/dist/tests/gateway.test.js +313 -0
- package/dist/tests/hooks-matcher.test.cjs +309 -0
- package/dist/tests/hooks-matcher.test.d.ts +1 -0
- package/dist/tests/hooks-matcher.test.js +303 -0
- package/dist/tests/hooks-merger.test.cjs +528 -0
- package/dist/tests/hooks-merger.test.d.ts +1 -0
- package/dist/tests/hooks-merger.test.js +522 -0
- package/dist/tests/integration/agent-invocation.integration.test.cjs +264 -0
- package/dist/tests/integration/agent-invocation.integration.test.d.ts +1 -0
- package/dist/tests/integration/agent-invocation.integration.test.js +258 -0
- package/dist/tests/integration/finnhub-candles.integration.test.cjs +98 -0
- package/dist/tests/integration/finnhub-candles.integration.test.d.ts +1 -0
- package/dist/tests/integration/finnhub-candles.integration.test.js +92 -0
- package/dist/tests/logger.test.cjs +353 -0
- package/dist/tests/logger.test.d.ts +1 -0
- package/dist/tests/logger.test.js +347 -0
- package/dist/tests/mediaCompatibilityMiddleware.test.cjs +106 -0
- package/dist/tests/mediaCompatibilityMiddleware.test.d.ts +1 -0
- package/dist/tests/mediaCompatibilityMiddleware.test.js +100 -0
- package/dist/tests/routines-api.test.cjs +107 -0
- package/dist/tests/routines-api.test.d.ts +1 -0
- package/dist/tests/routines-api.test.js +101 -0
- package/dist/tests/sessionMessageAttachments.test.cjs +108 -0
- package/dist/tests/sessionMessageAttachments.test.d.ts +1 -0
- package/dist/tests/sessionMessageAttachments.test.js +102 -0
- package/dist/tests/sessionMessageRole.test.cjs +44 -0
- package/dist/tests/sessionMessageRole.test.d.ts +1 -0
- package/dist/tests/sessionMessageRole.test.js +38 -0
- package/dist/tests/sessionStateMessages.test.cjs +72 -0
- package/dist/tests/sessionStateMessages.test.d.ts +1 -0
- package/dist/tests/sessionStateMessages.test.js +66 -0
- package/dist/tests/sessions-api.test.cjs +68 -0
- package/dist/tests/sessions-api.test.d.ts +1 -0
- package/dist/tests/sessions-api.test.js +62 -0
- package/dist/tests/technicalIndicators.test.cjs +82 -0
- package/dist/tests/technicalIndicators.test.d.ts +1 -0
- package/dist/tests/technicalIndicators.test.js +76 -0
- package/dist/tests/toolDisplayHelpers.test.cjs +43 -0
- package/dist/tests/toolDisplayHelpers.test.d.ts +1 -0
- package/dist/tests/toolDisplayHelpers.test.js +37 -0
- package/dist/tests/voice-config.test.cjs +35 -0
- package/dist/tests/voice-config.test.d.ts +1 -0
- package/dist/tests/voice-config.test.js +29 -0
- package/dist/tests/yahooCandles.test.cjs +111 -0
- package/dist/tests/yahooCandles.test.d.ts +1 -0
- package/dist/tests/yahooCandles.test.js +105 -0
- package/dist/tools/finance/candleRange.cjs +71 -0
- package/dist/tools/finance/candleRange.d.ts +21 -0
- package/dist/tools/finance/candleRange.js +28 -0
- package/dist/tools/finance/optionsAnalytics.cjs +222 -0
- package/dist/tools/finance/optionsAnalytics.d.ts +44 -0
- package/dist/tools/finance/optionsAnalytics.js +188 -0
- package/dist/tools/finance/optionsAnalytics.test.cjs +128 -0
- package/dist/tools/finance/optionsAnalytics.test.d.ts +1 -0
- package/dist/tools/finance/optionsAnalytics.test.js +122 -0
- package/dist/tools/finance/technicalIndicators.cjs +111 -0
- package/dist/tools/finance/technicalIndicators.d.ts +15 -0
- package/dist/tools/finance/technicalIndicators.js +68 -0
- package/dist/tools/finance/yahooCandles.cjs +125 -0
- package/dist/tools/finance/yahooCandles.d.ts +41 -0
- package/dist/tools/finance/yahooCandles.js +85 -0
- package/dist/tools/mcp-finance.cjs +649 -0
- package/dist/tools/mcp-finance.d.ts +1 -0
- package/dist/tools/mcp-finance.js +631 -0
- package/dist/types/agents.cjs +18 -0
- package/dist/types/agents.d.ts +11 -0
- package/dist/types/agents.js +0 -0
- package/dist/types/hooks.cjs +18 -0
- package/dist/types/hooks.d.ts +82 -0
- package/dist/types/hooks.js +0 -0
- package/dist/types/mcp.cjs +86 -0
- package/dist/types/mcp.d.ts +107 -0
- package/dist/types/mcp.js +40 -0
- package/dist/types/voice.cjs +103 -0
- package/dist/types/voice.d.ts +117 -0
- package/dist/types/voice.js +51 -0
- package/dist/utils/attachments.cjs +46 -0
- package/dist/utils/attachments.d.ts +7 -0
- package/dist/utils/attachments.js +12 -0
- package/dist/voice/config.cjs +52 -0
- package/dist/voice/config.d.ts +8 -0
- package/dist/voice/config.js +18 -0
- package/dist/webui/assets/index-BA0HaStz.css +1 -0
- package/dist/webui/assets/index-NHgTZsWN.js +112 -0
- package/dist/webui/assets/wingman_icon-DOy91UEF.webp +0 -0
- package/dist/webui/assets/wingman_logo-Cogyt3qm.webp +0 -0
- package/dist/webui/index.html +19 -0
- package/package.json +130 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
function F1(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(r,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();var Gs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c0={exports:{}},$a={},d0={exports:{}},je={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ro=Symbol.for("react.element"),$1=Symbol.for("react.portal"),B1=Symbol.for("react.fragment"),U1=Symbol.for("react.strict_mode"),V1=Symbol.for("react.profiler"),H1=Symbol.for("react.provider"),W1=Symbol.for("react.context"),Y1=Symbol.for("react.forward_ref"),X1=Symbol.for("react.suspense"),K1=Symbol.for("react.memo"),G1=Symbol.for("react.lazy"),Xp=Symbol.iterator;function q1(e){return e===null||typeof e!="object"?null:(e=Xp&&e[Xp]||e["@@iterator"],typeof e=="function"?e:null)}var f0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p0=Object.assign,h0={};function pl(e,t,n){this.props=e,this.context=t,this.refs=h0,this.updater=n||f0}pl.prototype.isReactComponent={};pl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};pl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function m0(){}m0.prototype=pl.prototype;function of(e,t,n){this.props=e,this.context=t,this.refs=h0,this.updater=n||f0}var sf=of.prototype=new m0;sf.constructor=of;p0(sf,pl.prototype);sf.isPureReactComponent=!0;var Kp=Array.isArray,g0=Object.prototype.hasOwnProperty,af={current:null},x0={key:!0,ref:!0,__self:!0,__source:!0};function y0(e,t,n){var r,i={},l=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(l=""+t.key),t)g0.call(t,r)&&!x0.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var a=Array(s),u=0;u<s;u++)a[u]=arguments[u+2];i.children=a}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return{$$typeof:Ro,type:e,key:l,ref:o,props:i,_owner:af.current}}function Q1(e,t){return{$$typeof:Ro,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function uf(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ro}function Z1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Gp=/\/+/g;function Pu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Z1(""+e.key):t.toString(36)}function Is(e,t,n,r,i){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(l){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Ro:case $1:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+Pu(o,0):r,Kp(i)?(n="",e!=null&&(n=e.replace(Gp,"$&/")+"/"),Is(i,t,n,"",function(u){return u})):i!=null&&(uf(i)&&(i=Q1(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Gp,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",Kp(e))for(var s=0;s<e.length;s++){l=e[s];var a=r+Pu(l,s);o+=Is(l,t,n,a,i)}else if(a=q1(e),typeof a=="function")for(e=a.call(e),s=0;!(l=e.next()).done;)l=l.value,a=r+Pu(l,s++),o+=Is(l,t,n,a,i);else if(l==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function ts(e,t,n){if(e==null)return e;var r=[],i=0;return Is(e,r,"","",function(l){return t.call(n,l,i++)}),r}function J1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var zt={current:null},Ts={transition:null},ek={ReactCurrentDispatcher:zt,ReactCurrentBatchConfig:Ts,ReactCurrentOwner:af};function v0(){throw Error("act(...) is not supported in production builds of React.")}je.Children={map:ts,forEach:function(e,t,n){ts(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ts(e,function(){t++}),t},toArray:function(e){return ts(e,function(t){return t})||[]},only:function(e){if(!uf(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};je.Component=pl;je.Fragment=B1;je.Profiler=V1;je.PureComponent=of;je.StrictMode=U1;je.Suspense=X1;je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ek;je.act=v0;je.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=p0({},e.props),i=e.key,l=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,o=af.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(a in t)g0.call(t,a)&&!x0.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&s!==void 0?s[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){s=Array(a);for(var u=0;u<a;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:Ro,type:e.type,key:i,ref:l,props:r,_owner:o}};je.createContext=function(e){return e={$$typeof:W1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:H1,_context:e},e.Consumer=e};je.createElement=y0;je.createFactory=function(e){var t=y0.bind(null,e);return t.type=e,t};je.createRef=function(){return{current:null}};je.forwardRef=function(e){return{$$typeof:Y1,render:e}};je.isValidElement=uf;je.lazy=function(e){return{$$typeof:G1,_payload:{_status:-1,_result:e},_init:J1}};je.memo=function(e,t){return{$$typeof:K1,type:e,compare:t===void 0?null:t}};je.startTransition=function(e){var t=Ts.transition;Ts.transition={};try{e()}finally{Ts.transition=t}};je.unstable_act=v0;je.useCallback=function(e,t){return zt.current.useCallback(e,t)};je.useContext=function(e){return zt.current.useContext(e)};je.useDebugValue=function(){};je.useDeferredValue=function(e){return zt.current.useDeferredValue(e)};je.useEffect=function(e,t){return zt.current.useEffect(e,t)};je.useId=function(){return zt.current.useId()};je.useImperativeHandle=function(e,t,n){return zt.current.useImperativeHandle(e,t,n)};je.useInsertionEffect=function(e,t){return zt.current.useInsertionEffect(e,t)};je.useLayoutEffect=function(e,t){return zt.current.useLayoutEffect(e,t)};je.useMemo=function(e,t){return zt.current.useMemo(e,t)};je.useReducer=function(e,t,n){return zt.current.useReducer(e,t,n)};je.useRef=function(e){return zt.current.useRef(e)};je.useState=function(e){return zt.current.useState(e)};je.useSyncExternalStore=function(e,t,n){return zt.current.useSyncExternalStore(e,t,n)};je.useTransition=function(){return zt.current.useTransition()};je.version="18.3.1";d0.exports=je;var y=d0.exports;const X=Fa(y),tk=F1({__proto__:null,default:X},[y]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var nk=y,rk=Symbol.for("react.element"),ik=Symbol.for("react.fragment"),lk=Object.prototype.hasOwnProperty,ok=nk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,sk={key:!0,ref:!0,__self:!0,__source:!0};function w0(e,t,n){var r,i={},l=null,o=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)lk.call(t,r)&&!sk.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:rk,type:e,key:l,ref:o,props:i,_owner:ok.current}}$a.Fragment=ik;$a.jsx=w0;$a.jsxs=w0;c0.exports=$a;var f=c0.exports,k0={exports:{}},nn={},b0={exports:{}},S0={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(M,A){var k=M.length;M.push(A);e:for(;0<k;){var H=k-1>>>1,F=M[H];if(0<i(F,A))M[H]=A,M[k]=F,k=H;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var A=M[0],k=M.pop();if(k!==A){M[0]=k;e:for(var H=0,F=M.length,C=F>>>1;H<C;){var Z=2*(H+1)-1,re=M[Z],V=Z+1,ie=M[V];if(0>i(re,k))V<F&&0>i(ie,re)?(M[H]=ie,M[V]=k,H=V):(M[H]=re,M[Z]=k,H=Z);else if(V<F&&0>i(ie,k))M[H]=ie,M[V]=k,H=V;else break e}}return A}function i(M,A){var k=M.sortIndex-A.sortIndex;return k!==0?k:M.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var a=[],u=[],c=1,d=null,p=3,h=!1,x=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(M){for(var A=n(u);A!==null;){if(A.callback===null)r(u);else if(A.startTime<=M)r(u),A.sortIndex=A.expirationTime,t(a,A);else break;A=n(u)}}function S(M){if(v=!1,w(M),!x)if(n(a)!==null)x=!0,R(j);else{var A=n(u);A!==null&&W(S,A.startTime-M)}}function j(M,A){x=!1,v&&(v=!1,m(I),I=-1),h=!0;var k=p;try{for(w(A),d=n(a);d!==null&&(!(d.expirationTime>A)||M&&!O());){var H=d.callback;if(typeof H=="function"){d.callback=null,p=d.priorityLevel;var F=H(d.expirationTime<=A);A=e.unstable_now(),typeof F=="function"?d.callback=F:d===n(a)&&r(a),w(A)}else r(a);d=n(a)}if(d!==null)var C=!0;else{var Z=n(u);Z!==null&&W(S,Z.startTime-A),C=!1}return C}finally{d=null,p=k,h=!1}}var E=!1,P=null,I=-1,L=5,_=-1;function O(){return!(e.unstable_now()-_<L)}function U(){if(P!==null){var M=e.unstable_now();_=M;var A=!0;try{A=P(!0,M)}finally{A?B():(E=!1,P=null)}}else E=!1}var B;if(typeof g=="function")B=function(){g(U)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,z=N.port2;N.port1.onmessage=U,B=function(){z.postMessage(null)}}else B=function(){b(U,0)};function R(M){P=M,E||(E=!0,B())}function W(M,A){I=b(function(){M(e.unstable_now())},A)}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(M){M.callback=null},e.unstable_continueExecution=function(){x||h||(x=!0,R(j))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(M){switch(p){case 1:case 2:case 3:var A=3;break;default:A=p}var k=p;p=A;try{return M()}finally{p=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,A){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var k=p;p=M;try{return A()}finally{p=k}},e.unstable_scheduleCallback=function(M,A,k){var H=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?H+k:H):k=H,M){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=k+F,M={id:c++,callback:A,priorityLevel:M,startTime:k,expirationTime:F,sortIndex:-1},k>H?(M.sortIndex=k,t(u,M),n(a)===null&&M===n(u)&&(v?(m(I),I=-1):v=!0,W(S,k-H))):(M.sortIndex=F,t(a,M),x||h||(x=!0,R(j))),M},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(M){var A=p;return function(){var k=p;p=A;try{return M.apply(this,arguments)}finally{p=k}}}})(S0);b0.exports=S0;var ak=b0.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var uk=y,en=ak;function ee(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var E0=new Set,ro={};function yi(e,t){el(e,t),el(e+"Capture",t)}function el(e,t){for(ro[e]=t,e=0;e<t.length;e++)E0.add(t[e])}var Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rc=Object.prototype.hasOwnProperty,ck=/^[: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]*$/,qp={},Qp={};function dk(e){return Rc.call(Qp,e)?!0:Rc.call(qp,e)?!1:ck.test(e)?Qp[e]=!0:(qp[e]=!0,!1)}function fk(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function pk(e,t,n,r){if(t===null||typeof t>"u"||fk(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Dt(e,t,n,r,i,l,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=o}var bt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){bt[e]=new Dt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];bt[t]=new Dt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){bt[e]=new Dt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){bt[e]=new Dt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){bt[e]=new Dt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){bt[e]=new Dt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){bt[e]=new Dt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){bt[e]=new Dt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){bt[e]=new Dt(e,5,!1,e.toLowerCase(),null,!1,!1)});var cf=/[\-:]([a-z])/g;function df(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(cf,df);bt[t]=new Dt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(cf,df);bt[t]=new Dt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(cf,df);bt[t]=new Dt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){bt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!1,!1)});bt.xlinkHref=new Dt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){bt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!0,!0)});function ff(e,t,n,r){var i=bt.hasOwnProperty(t)?bt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(pk(t,n,i,r)&&(n=null),r||i===null?dk(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var rr=uk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ns=Symbol.for("react.element"),Ii=Symbol.for("react.portal"),Ti=Symbol.for("react.fragment"),pf=Symbol.for("react.strict_mode"),Lc=Symbol.for("react.profiler"),N0=Symbol.for("react.provider"),C0=Symbol.for("react.context"),hf=Symbol.for("react.forward_ref"),Mc=Symbol.for("react.suspense"),zc=Symbol.for("react.suspense_list"),mf=Symbol.for("react.memo"),xr=Symbol.for("react.lazy"),_0=Symbol.for("react.offscreen"),Zp=Symbol.iterator;function bl(e){return e===null||typeof e!="object"?null:(e=Zp&&e[Zp]||e["@@iterator"],typeof e=="function"?e:null)}var tt=Object.assign,Au;function Ol(e){if(Au===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Au=t&&t[1]||""}return`
|
|
34
|
+
`+Au+e}var Iu=!1;function Tu(e,t){if(!e||Iu)return"";Iu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
|
35
|
+
`),l=r.stack.split(`
|
|
36
|
+
`),o=i.length-1,s=l.length-1;1<=o&&0<=s&&i[o]!==l[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==l[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==l[s]){var a=`
|
|
37
|
+
`+i[o].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=o&&0<=s);break}}}finally{Iu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ol(e):""}function hk(e){switch(e.tag){case 5:return Ol(e.type);case 16:return Ol("Lazy");case 13:return Ol("Suspense");case 19:return Ol("SuspenseList");case 0:case 2:case 15:return e=Tu(e.type,!1),e;case 11:return e=Tu(e.type.render,!1),e;case 1:return e=Tu(e.type,!0),e;default:return""}}function Dc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ti:return"Fragment";case Ii:return"Portal";case Lc:return"Profiler";case pf:return"StrictMode";case Mc:return"Suspense";case zc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case C0:return(e.displayName||"Context")+".Consumer";case N0:return(e._context.displayName||"Context")+".Provider";case hf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mf:return t=e.displayName||null,t!==null?t:Dc(e.type)||"Memo";case xr:t=e._payload,e=e._init;try{return Dc(e(t))}catch{}}return null}function mk(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Dc(t);case 8:return t===pf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Dr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function j0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gk(e){var t=j0(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,l.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rs(e){e._valueTracker||(e._valueTracker=gk(e))}function P0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=j0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function qs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Oc(e,t){var n=t.checked;return tt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Jp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Dr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function A0(e,t){t=t.checked,t!=null&&ff(e,"checked",t,!1)}function Fc(e,t){A0(e,t);var n=Dr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$c(e,t.type,n):t.hasOwnProperty("defaultValue")&&$c(e,t.type,Dr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function eh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function $c(e,t,n){(t!=="number"||qs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Fl=Array.isArray;function Hi(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Dr(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Bc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ee(91));return tt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function th(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ee(92));if(Fl(n)){if(1<n.length)throw Error(ee(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Dr(n)}}function I0(e,t){var n=Dr(t.value),r=Dr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function nh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function T0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Uc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?T0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var is,R0=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(is=is||document.createElement("div"),is.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=is.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function io(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xk=["Webkit","ms","Moz","O"];Object.keys(Wl).forEach(function(e){xk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Wl[t]=Wl[e]})});function L0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Wl.hasOwnProperty(e)&&Wl[e]?(""+t).trim():t+"px"}function M0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=L0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var yk=tt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Vc(e,t){if(t){if(yk[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ee(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ee(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ee(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ee(62))}}function Hc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Wc=null;function gf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yc=null,Wi=null,Yi=null;function rh(e){if(e=zo(e)){if(typeof Yc!="function")throw Error(ee(280));var t=e.stateNode;t&&(t=Wa(t),Yc(e.stateNode,e.type,t))}}function z0(e){Wi?Yi?Yi.push(e):Yi=[e]:Wi=e}function D0(){if(Wi){var e=Wi,t=Yi;if(Yi=Wi=null,rh(e),t)for(e=0;e<t.length;e++)rh(t[e])}}function O0(e,t){return e(t)}function F0(){}var Ru=!1;function $0(e,t,n){if(Ru)return e(t,n);Ru=!0;try{return O0(e,t,n)}finally{Ru=!1,(Wi!==null||Yi!==null)&&(F0(),D0())}}function lo(e,t){var n=e.stateNode;if(n===null)return null;var r=Wa(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ee(231,t,typeof n));return n}var Xc=!1;if(Qn)try{var Sl={};Object.defineProperty(Sl,"passive",{get:function(){Xc=!0}}),window.addEventListener("test",Sl,Sl),window.removeEventListener("test",Sl,Sl)}catch{Xc=!1}function vk(e,t,n,r,i,l,o,s,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Yl=!1,Qs=null,Zs=!1,Kc=null,wk={onError:function(e){Yl=!0,Qs=e}};function kk(e,t,n,r,i,l,o,s,a){Yl=!1,Qs=null,vk.apply(wk,arguments)}function bk(e,t,n,r,i,l,o,s,a){if(kk.apply(this,arguments),Yl){if(Yl){var u=Qs;Yl=!1,Qs=null}else throw Error(ee(198));Zs||(Zs=!0,Kc=u)}}function vi(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function B0(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ih(e){if(vi(e)!==e)throw Error(ee(188))}function Sk(e){var t=e.alternate;if(!t){if(t=vi(e),t===null)throw Error(ee(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var l=i.alternate;if(l===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===l.child){for(l=i.child;l;){if(l===n)return ih(i),e;if(l===r)return ih(i),t;l=l.sibling}throw Error(ee(188))}if(n.return!==r.return)n=i,r=l;else{for(var o=!1,s=i.child;s;){if(s===n){o=!0,n=i,r=l;break}if(s===r){o=!0,r=i,n=l;break}s=s.sibling}if(!o){for(s=l.child;s;){if(s===n){o=!0,n=l,r=i;break}if(s===r){o=!0,r=l,n=i;break}s=s.sibling}if(!o)throw Error(ee(189))}}if(n.alternate!==r)throw Error(ee(190))}if(n.tag!==3)throw Error(ee(188));return n.stateNode.current===n?e:t}function U0(e){return e=Sk(e),e!==null?V0(e):null}function V0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=V0(e);if(t!==null)return t;e=e.sibling}return null}var H0=en.unstable_scheduleCallback,lh=en.unstable_cancelCallback,Ek=en.unstable_shouldYield,Nk=en.unstable_requestPaint,lt=en.unstable_now,Ck=en.unstable_getCurrentPriorityLevel,xf=en.unstable_ImmediatePriority,W0=en.unstable_UserBlockingPriority,Js=en.unstable_NormalPriority,_k=en.unstable_LowPriority,Y0=en.unstable_IdlePriority,Ba=null,Dn=null;function jk(e){if(Dn&&typeof Dn.onCommitFiberRoot=="function")try{Dn.onCommitFiberRoot(Ba,e,void 0,(e.current.flags&128)===128)}catch{}}var En=Math.clz32?Math.clz32:Ik,Pk=Math.log,Ak=Math.LN2;function Ik(e){return e>>>=0,e===0?32:31-(Pk(e)/Ak|0)|0}var ls=64,os=4194304;function $l(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ea(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,l=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s!==0?r=$l(s):(l&=o,l!==0&&(r=$l(l)))}else o=n&~i,o!==0?r=$l(o):l!==0&&(r=$l(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,l=t&-t,i>=l||i===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-En(t),i=1<<n,r|=e[n],t&=~i;return r}function Tk(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rk(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,l=e.pendingLanes;0<l;){var o=31-En(l),s=1<<o,a=i[o];a===-1?(!(s&n)||s&r)&&(i[o]=Tk(s,t)):a<=t&&(e.expiredLanes|=s),l&=~s}}function Gc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function X0(){var e=ls;return ls<<=1,!(ls&4194240)&&(ls=64),e}function Lu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Lo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-En(t),e[t]=n}function Lk(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-En(n),l=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~l}}function yf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-En(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var De=0;function K0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var G0,vf,q0,Q0,Z0,qc=!1,ss=[],_r=null,jr=null,Pr=null,oo=new Map,so=new Map,kr=[],Mk="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function oh(e,t){switch(e){case"focusin":case"focusout":_r=null;break;case"dragenter":case"dragleave":jr=null;break;case"mouseover":case"mouseout":Pr=null;break;case"pointerover":case"pointerout":oo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":so.delete(t.pointerId)}}function El(e,t,n,r,i,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[i]},t!==null&&(t=zo(t),t!==null&&vf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zk(e,t,n,r,i){switch(t){case"focusin":return _r=El(_r,e,t,n,r,i),!0;case"dragenter":return jr=El(jr,e,t,n,r,i),!0;case"mouseover":return Pr=El(Pr,e,t,n,r,i),!0;case"pointerover":var l=i.pointerId;return oo.set(l,El(oo.get(l)||null,e,t,n,r,i)),!0;case"gotpointercapture":return l=i.pointerId,so.set(l,El(so.get(l)||null,e,t,n,r,i)),!0}return!1}function J0(e){var t=ti(e.target);if(t!==null){var n=vi(t);if(n!==null){if(t=n.tag,t===13){if(t=B0(n),t!==null){e.blockedOn=t,Z0(e.priority,function(){q0(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Qc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Wc=r,n.target.dispatchEvent(r),Wc=null}else return t=zo(n),t!==null&&vf(t),e.blockedOn=n,!1;t.shift()}return!0}function sh(e,t,n){Rs(e)&&n.delete(t)}function Dk(){qc=!1,_r!==null&&Rs(_r)&&(_r=null),jr!==null&&Rs(jr)&&(jr=null),Pr!==null&&Rs(Pr)&&(Pr=null),oo.forEach(sh),so.forEach(sh)}function Nl(e,t){e.blockedOn===t&&(e.blockedOn=null,qc||(qc=!0,en.unstable_scheduleCallback(en.unstable_NormalPriority,Dk)))}function ao(e){function t(i){return Nl(i,e)}if(0<ss.length){Nl(ss[0],e);for(var n=1;n<ss.length;n++){var r=ss[n];r.blockedOn===e&&(r.blockedOn=null)}}for(_r!==null&&Nl(_r,e),jr!==null&&Nl(jr,e),Pr!==null&&Nl(Pr,e),oo.forEach(t),so.forEach(t),n=0;n<kr.length;n++)r=kr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<kr.length&&(n=kr[0],n.blockedOn===null);)J0(n),n.blockedOn===null&&kr.shift()}var Xi=rr.ReactCurrentBatchConfig,ta=!0;function Ok(e,t,n,r){var i=De,l=Xi.transition;Xi.transition=null;try{De=1,wf(e,t,n,r)}finally{De=i,Xi.transition=l}}function Fk(e,t,n,r){var i=De,l=Xi.transition;Xi.transition=null;try{De=4,wf(e,t,n,r)}finally{De=i,Xi.transition=l}}function wf(e,t,n,r){if(ta){var i=Qc(e,t,n,r);if(i===null)Hu(e,t,r,na,n),oh(e,r);else if(zk(i,e,t,n,r))r.stopPropagation();else if(oh(e,r),t&4&&-1<Mk.indexOf(e)){for(;i!==null;){var l=zo(i);if(l!==null&&G0(l),l=Qc(e,t,n,r),l===null&&Hu(e,t,r,na,n),l===i)break;i=l}i!==null&&r.stopPropagation()}else Hu(e,t,r,null,n)}}var na=null;function Qc(e,t,n,r){if(na=null,e=gf(r),e=ti(e),e!==null)if(t=vi(e),t===null)e=null;else if(n=t.tag,n===13){if(e=B0(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return na=e,null}function ex(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ck()){case xf:return 1;case W0:return 4;case Js:case _k:return 16;case Y0:return 536870912;default:return 16}default:return 16}}var Er=null,kf=null,Ls=null;function tx(){if(Ls)return Ls;var e,t=kf,n=t.length,r,i="value"in Er?Er.value:Er.textContent,l=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[l-r];r++);return Ls=i.slice(e,1<r?1-r:void 0)}function Ms(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function as(){return!0}function ah(){return!1}function rn(e){function t(n,r,i,l,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=l,this.target=o,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(l):l[s]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?as:ah,this.isPropagationStopped=ah,this}return tt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=as)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=as)},persist:function(){},isPersistent:as}),t}var hl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bf=rn(hl),Mo=tt({},hl,{view:0,detail:0}),$k=rn(Mo),Mu,zu,Cl,Ua=tt({},Mo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Cl&&(Cl&&e.type==="mousemove"?(Mu=e.screenX-Cl.screenX,zu=e.screenY-Cl.screenY):zu=Mu=0,Cl=e),Mu)},movementY:function(e){return"movementY"in e?e.movementY:zu}}),uh=rn(Ua),Bk=tt({},Ua,{dataTransfer:0}),Uk=rn(Bk),Vk=tt({},Mo,{relatedTarget:0}),Du=rn(Vk),Hk=tt({},hl,{animationName:0,elapsedTime:0,pseudoElement:0}),Wk=rn(Hk),Yk=tt({},hl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Xk=rn(Yk),Kk=tt({},hl,{data:0}),ch=rn(Kk),Gk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qk={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"},Qk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zk(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qk[e])?!!t[e]:!1}function Sf(){return Zk}var Jk=tt({},Mo,{key:function(e){if(e.key){var t=Gk[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ms(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sf,charCode:function(e){return e.type==="keypress"?Ms(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ms(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),eb=rn(Jk),tb=tt({},Ua,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dh=rn(tb),nb=tt({},Mo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sf}),rb=rn(nb),ib=tt({},hl,{propertyName:0,elapsedTime:0,pseudoElement:0}),lb=rn(ib),ob=tt({},Ua,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),sb=rn(ob),ab=[9,13,27,32],Ef=Qn&&"CompositionEvent"in window,Xl=null;Qn&&"documentMode"in document&&(Xl=document.documentMode);var ub=Qn&&"TextEvent"in window&&!Xl,nx=Qn&&(!Ef||Xl&&8<Xl&&11>=Xl),fh=" ",ph=!1;function rx(e,t){switch(e){case"keyup":return ab.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ix(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ri=!1;function cb(e,t){switch(e){case"compositionend":return ix(t);case"keypress":return t.which!==32?null:(ph=!0,fh);case"textInput":return e=t.data,e===fh&&ph?null:e;default:return null}}function db(e,t){if(Ri)return e==="compositionend"||!Ef&&rx(e,t)?(e=tx(),Ls=kf=Er=null,Ri=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return nx&&t.locale!=="ko"?null:t.data;default:return null}}var fb={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 hh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fb[e.type]:t==="textarea"}function lx(e,t,n,r){z0(r),t=ra(t,"onChange"),0<t.length&&(n=new bf("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Kl=null,uo=null;function pb(e){gx(e,0)}function Va(e){var t=zi(e);if(P0(t))return e}function hb(e,t){if(e==="change")return t}var ox=!1;if(Qn){var Ou;if(Qn){var Fu="oninput"in document;if(!Fu){var mh=document.createElement("div");mh.setAttribute("oninput","return;"),Fu=typeof mh.oninput=="function"}Ou=Fu}else Ou=!1;ox=Ou&&(!document.documentMode||9<document.documentMode)}function gh(){Kl&&(Kl.detachEvent("onpropertychange",sx),uo=Kl=null)}function sx(e){if(e.propertyName==="value"&&Va(uo)){var t=[];lx(t,uo,e,gf(e)),$0(pb,t)}}function mb(e,t,n){e==="focusin"?(gh(),Kl=t,uo=n,Kl.attachEvent("onpropertychange",sx)):e==="focusout"&&gh()}function gb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Va(uo)}function xb(e,t){if(e==="click")return Va(t)}function yb(e,t){if(e==="input"||e==="change")return Va(t)}function vb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jn=typeof Object.is=="function"?Object.is:vb;function co(e,t){if(jn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Rc.call(t,i)||!jn(e[i],t[i]))return!1}return!0}function xh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yh(e,t){var n=xh(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xh(n)}}function ax(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ax(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ux(){for(var e=window,t=qs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=qs(e.document)}return t}function Nf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function wb(e){var t=ux(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ax(n.ownerDocument.documentElement,n)){if(r!==null&&Nf(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,l=Math.min(r.start,i);r=r.end===void 0?l:Math.min(r.end,i),!e.extend&&l>r&&(i=r,r=l,l=i),i=yh(n,l);var o=yh(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var kb=Qn&&"documentMode"in document&&11>=document.documentMode,Li=null,Zc=null,Gl=null,Jc=!1;function vh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jc||Li==null||Li!==qs(r)||(r=Li,"selectionStart"in r&&Nf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Gl&&co(Gl,r)||(Gl=r,r=ra(Zc,"onSelect"),0<r.length&&(t=new bf("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Li)))}function us(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Mi={animationend:us("Animation","AnimationEnd"),animationiteration:us("Animation","AnimationIteration"),animationstart:us("Animation","AnimationStart"),transitionend:us("Transition","TransitionEnd")},$u={},cx={};Qn&&(cx=document.createElement("div").style,"AnimationEvent"in window||(delete Mi.animationend.animation,delete Mi.animationiteration.animation,delete Mi.animationstart.animation),"TransitionEvent"in window||delete Mi.transitionend.transition);function Ha(e){if($u[e])return $u[e];if(!Mi[e])return e;var t=Mi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in cx)return $u[e]=t[n];return e}var dx=Ha("animationend"),fx=Ha("animationiteration"),px=Ha("animationstart"),hx=Ha("transitionend"),mx=new Map,wh="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Fr(e,t){mx.set(e,t),yi(t,[e])}for(var Bu=0;Bu<wh.length;Bu++){var Uu=wh[Bu],bb=Uu.toLowerCase(),Sb=Uu[0].toUpperCase()+Uu.slice(1);Fr(bb,"on"+Sb)}Fr(dx,"onAnimationEnd");Fr(fx,"onAnimationIteration");Fr(px,"onAnimationStart");Fr("dblclick","onDoubleClick");Fr("focusin","onFocus");Fr("focusout","onBlur");Fr(hx,"onTransitionEnd");el("onMouseEnter",["mouseout","mouseover"]);el("onMouseLeave",["mouseout","mouseover"]);el("onPointerEnter",["pointerout","pointerover"]);el("onPointerLeave",["pointerout","pointerover"]);yi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));yi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));yi("onBeforeInput",["compositionend","keypress","textInput","paste"]);yi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));yi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));yi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bl="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(" "),Eb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Bl));function kh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,bk(r,t,void 0,e),e.currentTarget=null}function gx(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],a=s.instance,u=s.currentTarget;if(s=s.listener,a!==l&&i.isPropagationStopped())break e;kh(i,s,u),l=a}else for(o=0;o<r.length;o++){if(s=r[o],a=s.instance,u=s.currentTarget,s=s.listener,a!==l&&i.isPropagationStopped())break e;kh(i,s,u),l=a}}}if(Zs)throw e=Kc,Zs=!1,Kc=null,e}function Ke(e,t){var n=t[id];n===void 0&&(n=t[id]=new Set);var r=e+"__bubble";n.has(r)||(xx(t,e,2,!1),n.add(r))}function Vu(e,t,n){var r=0;t&&(r|=4),xx(n,e,r,t)}var cs="_reactListening"+Math.random().toString(36).slice(2);function fo(e){if(!e[cs]){e[cs]=!0,E0.forEach(function(n){n!=="selectionchange"&&(Eb.has(n)||Vu(n,!1,e),Vu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[cs]||(t[cs]=!0,Vu("selectionchange",!1,t))}}function xx(e,t,n,r){switch(ex(t)){case 1:var i=Ok;break;case 4:i=Fk;break;default:i=wf}n=i.bind(null,t,n,e),i=void 0,!Xc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Hu(e,t,n,r,i){var l=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var a=o.tag;if((a===3||a===4)&&(a=o.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;o=o.return}for(;s!==null;){if(o=ti(s),o===null)return;if(a=o.tag,a===5||a===6){r=l=o;continue e}s=s.parentNode}}r=r.return}$0(function(){var u=l,c=gf(n),d=[];e:{var p=mx.get(e);if(p!==void 0){var h=bf,x=e;switch(e){case"keypress":if(Ms(n)===0)break e;case"keydown":case"keyup":h=eb;break;case"focusin":x="focus",h=Du;break;case"focusout":x="blur",h=Du;break;case"beforeblur":case"afterblur":h=Du;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=uh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=Uk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=rb;break;case dx:case fx:case px:h=Wk;break;case hx:h=lb;break;case"scroll":h=$k;break;case"wheel":h=sb;break;case"copy":case"cut":case"paste":h=Xk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=dh}var v=(t&4)!==0,b=!v&&e==="scroll",m=v?p!==null?p+"Capture":null:p;v=[];for(var g=u,w;g!==null;){w=g;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,m!==null&&(S=lo(g,m),S!=null&&v.push(po(g,S,w)))),b)break;g=g.return}0<v.length&&(p=new h(p,x,null,n,c),d.push({event:p,listeners:v}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Wc&&(x=n.relatedTarget||n.fromElement)&&(ti(x)||x[Zn]))break e;if((h||p)&&(p=c.window===c?c:(p=c.ownerDocument)?p.defaultView||p.parentWindow:window,h?(x=n.relatedTarget||n.toElement,h=u,x=x?ti(x):null,x!==null&&(b=vi(x),x!==b||x.tag!==5&&x.tag!==6)&&(x=null)):(h=null,x=u),h!==x)){if(v=uh,S="onMouseLeave",m="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=dh,S="onPointerLeave",m="onPointerEnter",g="pointer"),b=h==null?p:zi(h),w=x==null?p:zi(x),p=new v(S,g+"leave",h,n,c),p.target=b,p.relatedTarget=w,S=null,ti(c)===u&&(v=new v(m,g+"enter",x,n,c),v.target=w,v.relatedTarget=b,S=v),b=S,h&&x)t:{for(v=h,m=x,g=0,w=v;w;w=Ei(w))g++;for(w=0,S=m;S;S=Ei(S))w++;for(;0<g-w;)v=Ei(v),g--;for(;0<w-g;)m=Ei(m),w--;for(;g--;){if(v===m||m!==null&&v===m.alternate)break t;v=Ei(v),m=Ei(m)}v=null}else v=null;h!==null&&bh(d,p,h,v,!1),x!==null&&b!==null&&bh(d,b,x,v,!0)}}e:{if(p=u?zi(u):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var j=hb;else if(hh(p))if(ox)j=yb;else{j=gb;var E=mb}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(j=xb);if(j&&(j=j(e,u))){lx(d,j,n,c);break e}E&&E(e,p,u),e==="focusout"&&(E=p._wrapperState)&&E.controlled&&p.type==="number"&&$c(p,"number",p.value)}switch(E=u?zi(u):window,e){case"focusin":(hh(E)||E.contentEditable==="true")&&(Li=E,Zc=u,Gl=null);break;case"focusout":Gl=Zc=Li=null;break;case"mousedown":Jc=!0;break;case"contextmenu":case"mouseup":case"dragend":Jc=!1,vh(d,n,c);break;case"selectionchange":if(kb)break;case"keydown":case"keyup":vh(d,n,c)}var P;if(Ef)e:{switch(e){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else Ri?rx(e,n)&&(I="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(I="onCompositionStart");I&&(nx&&n.locale!=="ko"&&(Ri||I!=="onCompositionStart"?I==="onCompositionEnd"&&Ri&&(P=tx()):(Er=c,kf="value"in Er?Er.value:Er.textContent,Ri=!0)),E=ra(u,I),0<E.length&&(I=new ch(I,e,null,n,c),d.push({event:I,listeners:E}),P?I.data=P:(P=ix(n),P!==null&&(I.data=P)))),(P=ub?cb(e,n):db(e,n))&&(u=ra(u,"onBeforeInput"),0<u.length&&(c=new ch("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=P))}gx(d,t)})}function po(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ra(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,l=i.stateNode;i.tag===5&&l!==null&&(i=l,l=lo(e,n),l!=null&&r.unshift(po(e,l,i)),l=lo(e,t),l!=null&&r.push(po(e,l,i))),e=e.return}return r}function Ei(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function bh(e,t,n,r,i){for(var l=t._reactName,o=[];n!==null&&n!==r;){var s=n,a=s.alternate,u=s.stateNode;if(a!==null&&a===r)break;s.tag===5&&u!==null&&(s=u,i?(a=lo(n,l),a!=null&&o.unshift(po(n,a,s))):i||(a=lo(n,l),a!=null&&o.push(po(n,a,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Nb=/\r\n?/g,Cb=/\u0000|\uFFFD/g;function Sh(e){return(typeof e=="string"?e:""+e).replace(Nb,`
|
|
38
|
+
`).replace(Cb,"")}function ds(e,t,n){if(t=Sh(t),Sh(e)!==t&&n)throw Error(ee(425))}function ia(){}var ed=null,td=null;function nd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var rd=typeof setTimeout=="function"?setTimeout:void 0,_b=typeof clearTimeout=="function"?clearTimeout:void 0,Eh=typeof Promise=="function"?Promise:void 0,jb=typeof queueMicrotask=="function"?queueMicrotask:typeof Eh<"u"?function(e){return Eh.resolve(null).then(e).catch(Pb)}:rd;function Pb(e){setTimeout(function(){throw e})}function Wu(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),ao(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ao(t)}function Ar(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Nh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ml=Math.random().toString(36).slice(2),zn="__reactFiber$"+ml,ho="__reactProps$"+ml,Zn="__reactContainer$"+ml,id="__reactEvents$"+ml,Ab="__reactListeners$"+ml,Ib="__reactHandles$"+ml;function ti(e){var t=e[zn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Zn]||n[zn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Nh(e);e!==null;){if(n=e[zn])return n;e=Nh(e)}return t}e=n,n=e.parentNode}return null}function zo(e){return e=e[zn]||e[Zn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function zi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ee(33))}function Wa(e){return e[ho]||null}var ld=[],Di=-1;function $r(e){return{current:e}}function Ge(e){0>Di||(e.current=ld[Di],ld[Di]=null,Di--)}function We(e,t){Di++,ld[Di]=e.current,e.current=t}var Or={},At=$r(Or),Ht=$r(!1),ci=Or;function tl(e,t){var n=e.type.contextTypes;if(!n)return Or;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in n)i[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Wt(e){return e=e.childContextTypes,e!=null}function la(){Ge(Ht),Ge(At)}function Ch(e,t,n){if(At.current!==Or)throw Error(ee(168));We(At,t),We(Ht,n)}function yx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ee(108,mk(e)||"Unknown",i));return tt({},n,r)}function oa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Or,ci=At.current,We(At,e),We(Ht,Ht.current),!0}function _h(e,t,n){var r=e.stateNode;if(!r)throw Error(ee(169));n?(e=yx(e,t,ci),r.__reactInternalMemoizedMergedChildContext=e,Ge(Ht),Ge(At),We(At,e)):Ge(Ht),We(Ht,n)}var Wn=null,Ya=!1,Yu=!1;function vx(e){Wn===null?Wn=[e]:Wn.push(e)}function Tb(e){Ya=!0,vx(e)}function Br(){if(!Yu&&Wn!==null){Yu=!0;var e=0,t=De;try{var n=Wn;for(De=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Wn=null,Ya=!1}catch(i){throw Wn!==null&&(Wn=Wn.slice(e+1)),H0(xf,Br),i}finally{De=t,Yu=!1}}return null}var Oi=[],Fi=0,sa=null,aa=0,on=[],sn=0,di=null,Yn=1,Xn="";function qr(e,t){Oi[Fi++]=aa,Oi[Fi++]=sa,sa=e,aa=t}function wx(e,t,n){on[sn++]=Yn,on[sn++]=Xn,on[sn++]=di,di=e;var r=Yn;e=Xn;var i=32-En(r)-1;r&=~(1<<i),n+=1;var l=32-En(t)+i;if(30<l){var o=i-i%5;l=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Yn=1<<32-En(t)+i|n<<i|r,Xn=l+e}else Yn=1<<l|n<<i|r,Xn=e}function Cf(e){e.return!==null&&(qr(e,1),wx(e,1,0))}function _f(e){for(;e===sa;)sa=Oi[--Fi],Oi[Fi]=null,aa=Oi[--Fi],Oi[Fi]=null;for(;e===di;)di=on[--sn],on[sn]=null,Xn=on[--sn],on[sn]=null,Yn=on[--sn],on[sn]=null}var Zt=null,Qt=null,Qe=!1,bn=null;function kx(e,t){var n=cn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function jh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Zt=e,Qt=Ar(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Zt=e,Qt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=di!==null?{id:Yn,overflow:Xn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=cn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Zt=e,Qt=null,!0):!1;default:return!1}}function od(e){return(e.mode&1)!==0&&(e.flags&128)===0}function sd(e){if(Qe){var t=Qt;if(t){var n=t;if(!jh(e,t)){if(od(e))throw Error(ee(418));t=Ar(n.nextSibling);var r=Zt;t&&jh(e,t)?kx(r,n):(e.flags=e.flags&-4097|2,Qe=!1,Zt=e)}}else{if(od(e))throw Error(ee(418));e.flags=e.flags&-4097|2,Qe=!1,Zt=e}}}function Ph(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Zt=e}function fs(e){if(e!==Zt)return!1;if(!Qe)return Ph(e),Qe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!nd(e.type,e.memoizedProps)),t&&(t=Qt)){if(od(e))throw bx(),Error(ee(418));for(;t;)kx(e,t),t=Ar(t.nextSibling)}if(Ph(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Qt=Ar(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Qt=null}}else Qt=Zt?Ar(e.stateNode.nextSibling):null;return!0}function bx(){for(var e=Qt;e;)e=Ar(e.nextSibling)}function nl(){Qt=Zt=null,Qe=!1}function jf(e){bn===null?bn=[e]:bn.push(e)}var Rb=rr.ReactCurrentBatchConfig;function _l(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ee(309));var r=n.stateNode}if(!r)throw Error(ee(147,e));var i=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(o){var s=i.refs;o===null?delete s[l]:s[l]=o},t._stringRef=l,t)}if(typeof e!="string")throw Error(ee(284));if(!n._owner)throw Error(ee(290,e))}return e}function ps(e,t){throw e=Object.prototype.toString.call(t),Error(ee(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ah(e){var t=e._init;return t(e._payload)}function Sx(e){function t(m,g){if(e){var w=m.deletions;w===null?(m.deletions=[g],m.flags|=16):w.push(g)}}function n(m,g){if(!e)return null;for(;g!==null;)t(m,g),g=g.sibling;return null}function r(m,g){for(m=new Map;g!==null;)g.key!==null?m.set(g.key,g):m.set(g.index,g),g=g.sibling;return m}function i(m,g){return m=Lr(m,g),m.index=0,m.sibling=null,m}function l(m,g,w){return m.index=w,e?(w=m.alternate,w!==null?(w=w.index,w<g?(m.flags|=2,g):w):(m.flags|=2,g)):(m.flags|=1048576,g)}function o(m){return e&&m.alternate===null&&(m.flags|=2),m}function s(m,g,w,S){return g===null||g.tag!==6?(g=Ju(w,m.mode,S),g.return=m,g):(g=i(g,w),g.return=m,g)}function a(m,g,w,S){var j=w.type;return j===Ti?c(m,g,w.props.children,S,w.key):g!==null&&(g.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===xr&&Ah(j)===g.type)?(S=i(g,w.props),S.ref=_l(m,g,w),S.return=m,S):(S=Us(w.type,w.key,w.props,null,m.mode,S),S.ref=_l(m,g,w),S.return=m,S)}function u(m,g,w,S){return g===null||g.tag!==4||g.stateNode.containerInfo!==w.containerInfo||g.stateNode.implementation!==w.implementation?(g=ec(w,m.mode,S),g.return=m,g):(g=i(g,w.children||[]),g.return=m,g)}function c(m,g,w,S,j){return g===null||g.tag!==7?(g=si(w,m.mode,S,j),g.return=m,g):(g=i(g,w),g.return=m,g)}function d(m,g,w){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Ju(""+g,m.mode,w),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ns:return w=Us(g.type,g.key,g.props,null,m.mode,w),w.ref=_l(m,null,g),w.return=m,w;case Ii:return g=ec(g,m.mode,w),g.return=m,g;case xr:var S=g._init;return d(m,S(g._payload),w)}if(Fl(g)||bl(g))return g=si(g,m.mode,w,null),g.return=m,g;ps(m,g)}return null}function p(m,g,w,S){var j=g!==null?g.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:s(m,g,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ns:return w.key===j?a(m,g,w,S):null;case Ii:return w.key===j?u(m,g,w,S):null;case xr:return j=w._init,p(m,g,j(w._payload),S)}if(Fl(w)||bl(w))return j!==null?null:c(m,g,w,S,null);ps(m,w)}return null}function h(m,g,w,S,j){if(typeof S=="string"&&S!==""||typeof S=="number")return m=m.get(w)||null,s(g,m,""+S,j);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ns:return m=m.get(S.key===null?w:S.key)||null,a(g,m,S,j);case Ii:return m=m.get(S.key===null?w:S.key)||null,u(g,m,S,j);case xr:var E=S._init;return h(m,g,w,E(S._payload),j)}if(Fl(S)||bl(S))return m=m.get(w)||null,c(g,m,S,j,null);ps(g,S)}return null}function x(m,g,w,S){for(var j=null,E=null,P=g,I=g=0,L=null;P!==null&&I<w.length;I++){P.index>I?(L=P,P=null):L=P.sibling;var _=p(m,P,w[I],S);if(_===null){P===null&&(P=L);break}e&&P&&_.alternate===null&&t(m,P),g=l(_,g,I),E===null?j=_:E.sibling=_,E=_,P=L}if(I===w.length)return n(m,P),Qe&&qr(m,I),j;if(P===null){for(;I<w.length;I++)P=d(m,w[I],S),P!==null&&(g=l(P,g,I),E===null?j=P:E.sibling=P,E=P);return Qe&&qr(m,I),j}for(P=r(m,P);I<w.length;I++)L=h(P,m,I,w[I],S),L!==null&&(e&&L.alternate!==null&&P.delete(L.key===null?I:L.key),g=l(L,g,I),E===null?j=L:E.sibling=L,E=L);return e&&P.forEach(function(O){return t(m,O)}),Qe&&qr(m,I),j}function v(m,g,w,S){var j=bl(w);if(typeof j!="function")throw Error(ee(150));if(w=j.call(w),w==null)throw Error(ee(151));for(var E=j=null,P=g,I=g=0,L=null,_=w.next();P!==null&&!_.done;I++,_=w.next()){P.index>I?(L=P,P=null):L=P.sibling;var O=p(m,P,_.value,S);if(O===null){P===null&&(P=L);break}e&&P&&O.alternate===null&&t(m,P),g=l(O,g,I),E===null?j=O:E.sibling=O,E=O,P=L}if(_.done)return n(m,P),Qe&&qr(m,I),j;if(P===null){for(;!_.done;I++,_=w.next())_=d(m,_.value,S),_!==null&&(g=l(_,g,I),E===null?j=_:E.sibling=_,E=_);return Qe&&qr(m,I),j}for(P=r(m,P);!_.done;I++,_=w.next())_=h(P,m,I,_.value,S),_!==null&&(e&&_.alternate!==null&&P.delete(_.key===null?I:_.key),g=l(_,g,I),E===null?j=_:E.sibling=_,E=_);return e&&P.forEach(function(U){return t(m,U)}),Qe&&qr(m,I),j}function b(m,g,w,S){if(typeof w=="object"&&w!==null&&w.type===Ti&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case ns:e:{for(var j=w.key,E=g;E!==null;){if(E.key===j){if(j=w.type,j===Ti){if(E.tag===7){n(m,E.sibling),g=i(E,w.props.children),g.return=m,m=g;break e}}else if(E.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===xr&&Ah(j)===E.type){n(m,E.sibling),g=i(E,w.props),g.ref=_l(m,E,w),g.return=m,m=g;break e}n(m,E);break}else t(m,E);E=E.sibling}w.type===Ti?(g=si(w.props.children,m.mode,S,w.key),g.return=m,m=g):(S=Us(w.type,w.key,w.props,null,m.mode,S),S.ref=_l(m,g,w),S.return=m,m=S)}return o(m);case Ii:e:{for(E=w.key;g!==null;){if(g.key===E)if(g.tag===4&&g.stateNode.containerInfo===w.containerInfo&&g.stateNode.implementation===w.implementation){n(m,g.sibling),g=i(g,w.children||[]),g.return=m,m=g;break e}else{n(m,g);break}else t(m,g);g=g.sibling}g=ec(w,m.mode,S),g.return=m,m=g}return o(m);case xr:return E=w._init,b(m,g,E(w._payload),S)}if(Fl(w))return x(m,g,w,S);if(bl(w))return v(m,g,w,S);ps(m,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,g!==null&&g.tag===6?(n(m,g.sibling),g=i(g,w),g.return=m,m=g):(n(m,g),g=Ju(w,m.mode,S),g.return=m,m=g),o(m)):n(m,g)}return b}var rl=Sx(!0),Ex=Sx(!1),ua=$r(null),ca=null,$i=null,Pf=null;function Af(){Pf=$i=ca=null}function If(e){var t=ua.current;Ge(ua),e._currentValue=t}function ad(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ki(e,t){ca=e,Pf=$i=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ut=!0),e.firstContext=null)}function pn(e){var t=e._currentValue;if(Pf!==e)if(e={context:e,memoizedValue:t,next:null},$i===null){if(ca===null)throw Error(ee(308));$i=e,ca.dependencies={lanes:0,firstContext:e}}else $i=$i.next=e;return t}var ni=null;function Tf(e){ni===null?ni=[e]:ni.push(e)}function Nx(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Tf(t)):(n.next=i.next,i.next=n),t.interleaved=n,Jn(e,r)}function Jn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var yr=!1;function Rf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Cx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Gn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ir(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Le&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Jn(e,n)}return i=r.interleaved,i===null?(t.next=t,Tf(r)):(t.next=i.next,i.next=t),r.interleaved=t,Jn(e,n)}function zs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yf(e,n)}}function Ih(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?i=l=o:l=l.next=o,n=n.next}while(n!==null);l===null?i=l=t:l=l.next=t}else i=l=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function da(e,t,n,r){var i=e.updateQueue;yr=!1;var l=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,u=a.next;a.next=null,o===null?l=u:o.next=u,o=a;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==o&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=a))}if(l!==null){var d=i.baseState;o=0,c=u=a=null,s=l;do{var p=s.lane,h=s.eventTime;if((r&p)===p){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var x=e,v=s;switch(p=t,h=n,v.tag){case 1:if(x=v.payload,typeof x=="function"){d=x.call(h,d,p);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=v.payload,p=typeof x=="function"?x.call(h,d,p):x,p==null)break e;d=tt({},d,p);break e;case 2:yr=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,a=d):c=c.next=h,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(c===null&&(a=d),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else l===null&&(i.shared.lanes=0);pi|=o,e.lanes=o,e.memoizedState=d}}function Th(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(ee(191,i));i.call(r)}}}var Do={},On=$r(Do),mo=$r(Do),go=$r(Do);function ri(e){if(e===Do)throw Error(ee(174));return e}function Lf(e,t){switch(We(go,t),We(mo,e),We(On,Do),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Uc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Uc(t,e)}Ge(On),We(On,t)}function il(){Ge(On),Ge(mo),Ge(go)}function _x(e){ri(go.current);var t=ri(On.current),n=Uc(t,e.type);t!==n&&(We(mo,e),We(On,n))}function Mf(e){mo.current===e&&(Ge(On),Ge(mo))}var Ze=$r(0);function fa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Xu=[];function zf(){for(var e=0;e<Xu.length;e++)Xu[e]._workInProgressVersionPrimary=null;Xu.length=0}var Ds=rr.ReactCurrentDispatcher,Ku=rr.ReactCurrentBatchConfig,fi=0,Je=null,ut=null,ht=null,pa=!1,ql=!1,xo=0,Lb=0;function Ct(){throw Error(ee(321))}function Df(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jn(e[n],t[n]))return!1;return!0}function Of(e,t,n,r,i,l){if(fi=l,Je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ds.current=e===null||e.memoizedState===null?Ob:Fb,e=n(r,i),ql){l=0;do{if(ql=!1,xo=0,25<=l)throw Error(ee(301));l+=1,ht=ut=null,t.updateQueue=null,Ds.current=$b,e=n(r,i)}while(ql)}if(Ds.current=ha,t=ut!==null&&ut.next!==null,fi=0,ht=ut=Je=null,pa=!1,t)throw Error(ee(300));return e}function Ff(){var e=xo!==0;return xo=0,e}function Ln(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ht===null?Je.memoizedState=ht=e:ht=ht.next=e,ht}function hn(){if(ut===null){var e=Je.alternate;e=e!==null?e.memoizedState:null}else e=ut.next;var t=ht===null?Je.memoizedState:ht.next;if(t!==null)ht=t,ut=e;else{if(e===null)throw Error(ee(310));ut=e,e={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},ht===null?Je.memoizedState=ht=e:ht=ht.next=e}return ht}function yo(e,t){return typeof t=="function"?t(e):t}function Gu(e){var t=hn(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=ut,i=r.baseQueue,l=n.pending;if(l!==null){if(i!==null){var o=i.next;i.next=l.next,l.next=o}r.baseQueue=i=l,n.pending=null}if(i!==null){l=i.next,r=r.baseState;var s=o=null,a=null,u=l;do{var c=u.lane;if((fi&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(s=a=d,o=r):a=a.next=d,Je.lanes|=c,pi|=c}u=u.next}while(u!==null&&u!==l);a===null?o=r:a.next=s,jn(r,t.memoizedState)||(Ut=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do l=i.lane,Je.lanes|=l,pi|=l,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function qu(e){var t=hn(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,l=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do l=e(l,o.action),o=o.next;while(o!==i);jn(l,t.memoizedState)||(Ut=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function jx(){}function Px(e,t){var n=Je,r=hn(),i=t(),l=!jn(r.memoizedState,i);if(l&&(r.memoizedState=i,Ut=!0),r=r.queue,$f(Tx.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||ht!==null&&ht.memoizedState.tag&1){if(n.flags|=2048,vo(9,Ix.bind(null,n,r,i,t),void 0,null),mt===null)throw Error(ee(349));fi&30||Ax(n,t,i)}return i}function Ax(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Je.updateQueue,t===null?(t={lastEffect:null,stores:null},Je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ix(e,t,n,r){t.value=n,t.getSnapshot=r,Rx(t)&&Lx(e)}function Tx(e,t,n){return n(function(){Rx(t)&&Lx(e)})}function Rx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jn(e,n)}catch{return!0}}function Lx(e){var t=Jn(e,1);t!==null&&Nn(t,e,1,-1)}function Rh(e){var t=Ln();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yo,lastRenderedState:e},t.queue=e,e=e.dispatch=Db.bind(null,Je,e),[t.memoizedState,e]}function vo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Je.updateQueue,t===null?(t={lastEffect:null,stores:null},Je.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Mx(){return hn().memoizedState}function Os(e,t,n,r){var i=Ln();Je.flags|=e,i.memoizedState=vo(1|t,n,void 0,r===void 0?null:r)}function Xa(e,t,n,r){var i=hn();r=r===void 0?null:r;var l=void 0;if(ut!==null){var o=ut.memoizedState;if(l=o.destroy,r!==null&&Df(r,o.deps)){i.memoizedState=vo(t,n,l,r);return}}Je.flags|=e,i.memoizedState=vo(1|t,n,l,r)}function Lh(e,t){return Os(8390656,8,e,t)}function $f(e,t){return Xa(2048,8,e,t)}function zx(e,t){return Xa(4,2,e,t)}function Dx(e,t){return Xa(4,4,e,t)}function Ox(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Fx(e,t,n){return n=n!=null?n.concat([e]):null,Xa(4,4,Ox.bind(null,t,e),n)}function Bf(){}function $x(e,t){var n=hn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Df(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Bx(e,t){var n=hn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Df(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ux(e,t,n){return fi&21?(jn(n,t)||(n=X0(),Je.lanes|=n,pi|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ut=!0),e.memoizedState=n)}function Mb(e,t){var n=De;De=n!==0&&4>n?n:4,e(!0);var r=Ku.transition;Ku.transition={};try{e(!1),t()}finally{De=n,Ku.transition=r}}function Vx(){return hn().memoizedState}function zb(e,t,n){var r=Rr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Hx(e))Wx(t,n);else if(n=Nx(e,t,n,r),n!==null){var i=Mt();Nn(n,e,r,i),Yx(n,t,r)}}function Db(e,t,n){var r=Rr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Hx(e))Wx(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var o=t.lastRenderedState,s=l(o,n);if(i.hasEagerState=!0,i.eagerState=s,jn(s,o)){var a=t.interleaved;a===null?(i.next=i,Tf(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=Nx(e,t,i,r),n!==null&&(i=Mt(),Nn(n,e,r,i),Yx(n,t,r))}}function Hx(e){var t=e.alternate;return e===Je||t!==null&&t===Je}function Wx(e,t){ql=pa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Yx(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yf(e,n)}}var ha={readContext:pn,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},Ob={readContext:pn,useCallback:function(e,t){return Ln().memoizedState=[e,t===void 0?null:t],e},useContext:pn,useEffect:Lh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Os(4194308,4,Ox.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Os(4194308,4,e,t)},useInsertionEffect:function(e,t){return Os(4,2,e,t)},useMemo:function(e,t){var n=Ln();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ln();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=zb.bind(null,Je,e),[r.memoizedState,e]},useRef:function(e){var t=Ln();return e={current:e},t.memoizedState=e},useState:Rh,useDebugValue:Bf,useDeferredValue:function(e){return Ln().memoizedState=e},useTransition:function(){var e=Rh(!1),t=e[0];return e=Mb.bind(null,e[1]),Ln().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Je,i=Ln();if(Qe){if(n===void 0)throw Error(ee(407));n=n()}else{if(n=t(),mt===null)throw Error(ee(349));fi&30||Ax(r,t,n)}i.memoizedState=n;var l={value:n,getSnapshot:t};return i.queue=l,Lh(Tx.bind(null,r,l,e),[e]),r.flags|=2048,vo(9,Ix.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Ln(),t=mt.identifierPrefix;if(Qe){var n=Xn,r=Yn;n=(r&~(1<<32-En(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=xo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Lb++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Fb={readContext:pn,useCallback:$x,useContext:pn,useEffect:$f,useImperativeHandle:Fx,useInsertionEffect:zx,useLayoutEffect:Dx,useMemo:Bx,useReducer:Gu,useRef:Mx,useState:function(){return Gu(yo)},useDebugValue:Bf,useDeferredValue:function(e){var t=hn();return Ux(t,ut.memoizedState,e)},useTransition:function(){var e=Gu(yo)[0],t=hn().memoizedState;return[e,t]},useMutableSource:jx,useSyncExternalStore:Px,useId:Vx,unstable_isNewReconciler:!1},$b={readContext:pn,useCallback:$x,useContext:pn,useEffect:$f,useImperativeHandle:Fx,useInsertionEffect:zx,useLayoutEffect:Dx,useMemo:Bx,useReducer:qu,useRef:Mx,useState:function(){return qu(yo)},useDebugValue:Bf,useDeferredValue:function(e){var t=hn();return ut===null?t.memoizedState=e:Ux(t,ut.memoizedState,e)},useTransition:function(){var e=qu(yo)[0],t=hn().memoizedState;return[e,t]},useMutableSource:jx,useSyncExternalStore:Px,useId:Vx,unstable_isNewReconciler:!1};function vn(e,t){if(e&&e.defaultProps){t=tt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ud(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:tt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ka={isMounted:function(e){return(e=e._reactInternals)?vi(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Mt(),i=Rr(e),l=Gn(r,i);l.payload=t,n!=null&&(l.callback=n),t=Ir(e,l,i),t!==null&&(Nn(t,e,i,r),zs(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Mt(),i=Rr(e),l=Gn(r,i);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=Ir(e,l,i),t!==null&&(Nn(t,e,i,r),zs(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Mt(),r=Rr(e),i=Gn(n,r);i.tag=2,t!=null&&(i.callback=t),t=Ir(e,i,r),t!==null&&(Nn(t,e,r,n),zs(t,e,r))}};function Mh(e,t,n,r,i,l,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,o):t.prototype&&t.prototype.isPureReactComponent?!co(n,r)||!co(i,l):!0}function Xx(e,t,n){var r=!1,i=Or,l=t.contextType;return typeof l=="object"&&l!==null?l=pn(l):(i=Wt(t)?ci:At.current,r=t.contextTypes,l=(r=r!=null)?tl(e,i):Or),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ka,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=l),t}function zh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ka.enqueueReplaceState(t,t.state,null)}function cd(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Rf(e);var l=t.contextType;typeof l=="object"&&l!==null?i.context=pn(l):(l=Wt(t)?ci:At.current,i.context=tl(e,l)),i.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(ud(e,t,l,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Ka.enqueueReplaceState(i,i.state,null),da(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ll(e,t){try{var n="",r=t;do n+=hk(r),r=r.return;while(r);var i=n}catch(l){i=`
|
|
39
|
+
Error generating stack: `+l.message+`
|
|
40
|
+
`+l.stack}return{value:e,source:t,stack:i,digest:null}}function Qu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function dd(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Bb=typeof WeakMap=="function"?WeakMap:Map;function Kx(e,t,n){n=Gn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ga||(ga=!0,kd=r),dd(e,t)},n}function Gx(e,t,n){n=Gn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){dd(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){dd(e,t),typeof r!="function"&&(Tr===null?Tr=new Set([this]):Tr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Dh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Bb;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=tS.bind(null,e,t,n),t.then(e,e))}function Oh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Fh(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Gn(-1,1),t.tag=2,Ir(n,t,1))),n.lanes|=1),e)}var Ub=rr.ReactCurrentOwner,Ut=!1;function Rt(e,t,n,r){t.child=e===null?Ex(t,null,n,r):rl(t,e.child,n,r)}function $h(e,t,n,r,i){n=n.render;var l=t.ref;return Ki(t,i),r=Of(e,t,n,r,l,i),n=Ff(),e!==null&&!Ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,er(e,t,i)):(Qe&&n&&Cf(t),t.flags|=1,Rt(e,t,r,i),t.child)}function Bh(e,t,n,r,i){if(e===null){var l=n.type;return typeof l=="function"&&!Gf(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,qx(e,t,l,r,i)):(e=Us(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&i)){var o=l.memoizedProps;if(n=n.compare,n=n!==null?n:co,n(o,r)&&e.ref===t.ref)return er(e,t,i)}return t.flags|=1,e=Lr(l,r),e.ref=t.ref,e.return=t,t.child=e}function qx(e,t,n,r,i){if(e!==null){var l=e.memoizedProps;if(co(l,r)&&e.ref===t.ref)if(Ut=!1,t.pendingProps=r=l,(e.lanes&i)!==0)e.flags&131072&&(Ut=!0);else return t.lanes=e.lanes,er(e,t,i)}return fd(e,t,n,r,i)}function Qx(e,t,n){var r=t.pendingProps,i=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},We(Ui,qt),qt|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,We(Ui,qt),qt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,We(Ui,qt),qt|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,We(Ui,qt),qt|=r;return Rt(e,t,i,n),t.child}function Zx(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function fd(e,t,n,r,i){var l=Wt(n)?ci:At.current;return l=tl(t,l),Ki(t,i),n=Of(e,t,n,r,l,i),r=Ff(),e!==null&&!Ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,er(e,t,i)):(Qe&&r&&Cf(t),t.flags|=1,Rt(e,t,n,i),t.child)}function Uh(e,t,n,r,i){if(Wt(n)){var l=!0;oa(t)}else l=!1;if(Ki(t,i),t.stateNode===null)Fs(e,t),Xx(t,n,r),cd(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var a=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=pn(u):(u=Wt(n)?ci:At.current,u=tl(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==r||a!==u)&&zh(t,o,r,u),yr=!1;var p=t.memoizedState;o.state=p,da(t,r,o,i),a=t.memoizedState,s!==r||p!==a||Ht.current||yr?(typeof c=="function"&&(ud(t,n,c,r),a=t.memoizedState),(s=yr||Mh(t,n,s,r,p,a,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),o.props=r,o.state=a,o.context=u,r=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Cx(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:vn(t.type,s),o.props=u,d=t.pendingProps,p=o.context,a=n.contextType,typeof a=="object"&&a!==null?a=pn(a):(a=Wt(n)?ci:At.current,a=tl(t,a));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==d||p!==a)&&zh(t,o,r,a),yr=!1,p=t.memoizedState,o.state=p,da(t,r,o,i);var x=t.memoizedState;s!==d||p!==x||Ht.current||yr?(typeof h=="function"&&(ud(t,n,h,r),x=t.memoizedState),(u=yr||Mh(t,n,u,r,p,x,a)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,x,a),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,x,a)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),o.props=r,o.state=x,o.context=a,r=u):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return pd(e,t,n,r,l,i)}function pd(e,t,n,r,i,l){Zx(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&_h(t,n,!1),er(e,t,l);r=t.stateNode,Ub.current=t;var s=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=rl(t,e.child,null,l),t.child=rl(t,null,s,l)):Rt(e,t,s,l),t.memoizedState=r.state,i&&_h(t,n,!0),t.child}function Jx(e){var t=e.stateNode;t.pendingContext?Ch(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ch(e,t.context,!1),Lf(e,t.containerInfo)}function Vh(e,t,n,r,i){return nl(),jf(i),t.flags|=256,Rt(e,t,n,r),t.child}var hd={dehydrated:null,treeContext:null,retryLane:0};function md(e){return{baseLanes:e,cachePool:null,transitions:null}}function ey(e,t,n){var r=t.pendingProps,i=Ze.current,l=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),We(Ze,i&1),e===null)return sd(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,l?(r=t.mode,l=t.child,o={mode:"hidden",children:o},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=o):l=Qa(o,r,0,null),e=si(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=md(n),t.memoizedState=hd,e):Uf(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Vb(e,t,o,r,s,i,n);if(l){l=r.fallback,o=t.mode,i=e.child,s=i.sibling;var a={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Lr(i,a),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?l=Lr(s,l):(l=si(l,o,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,o=e.child.memoizedState,o=o===null?md(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},l.memoizedState=o,l.childLanes=e.childLanes&~n,t.memoizedState=hd,r}return l=e.child,e=l.sibling,r=Lr(l,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Uf(e,t){return t=Qa({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function hs(e,t,n,r){return r!==null&&jf(r),rl(t,e.child,null,n),e=Uf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Vb(e,t,n,r,i,l,o){if(n)return t.flags&256?(t.flags&=-257,r=Qu(Error(ee(422))),hs(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,i=t.mode,r=Qa({mode:"visible",children:r.children},i,0,null),l=si(l,i,o,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&rl(t,e.child,null,o),t.child.memoizedState=md(o),t.memoizedState=hd,l);if(!(t.mode&1))return hs(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,l=Error(ee(419)),r=Qu(l,r,void 0),hs(e,t,o,r)}if(s=(o&e.childLanes)!==0,Ut||s){if(r=mt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==l.retryLane&&(l.retryLane=i,Jn(e,i),Nn(r,e,i,-1))}return Kf(),r=Qu(Error(ee(421))),hs(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=nS.bind(null,e),i._reactRetry=t,null):(e=l.treeContext,Qt=Ar(i.nextSibling),Zt=t,Qe=!0,bn=null,e!==null&&(on[sn++]=Yn,on[sn++]=Xn,on[sn++]=di,Yn=e.id,Xn=e.overflow,di=t),t=Uf(t,r.children),t.flags|=4096,t)}function Hh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ad(e.return,t,n)}function Zu(e,t,n,r,i){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=i)}function ty(e,t,n){var r=t.pendingProps,i=r.revealOrder,l=r.tail;if(Rt(e,t,r.children,n),r=Ze.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hh(e,n,t);else if(e.tag===19)Hh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(We(Ze,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&fa(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Zu(t,!1,i,n,l);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fa(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Zu(t,!0,n,null,l);break;case"together":Zu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Fs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function er(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),pi|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ee(153));if(t.child!==null){for(e=t.child,n=Lr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Lr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Hb(e,t,n){switch(t.tag){case 3:Jx(t),nl();break;case 5:_x(t);break;case 1:Wt(t.type)&&oa(t);break;case 4:Lf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;We(ua,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(We(Ze,Ze.current&1),t.flags|=128,null):n&t.child.childLanes?ey(e,t,n):(We(Ze,Ze.current&1),e=er(e,t,n),e!==null?e.sibling:null);We(Ze,Ze.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ty(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),We(Ze,Ze.current),r)break;return null;case 22:case 23:return t.lanes=0,Qx(e,t,n)}return er(e,t,n)}var ny,gd,ry,iy;ny=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};gd=function(){};ry=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ri(On.current);var l=null;switch(n){case"input":i=Oc(e,i),r=Oc(e,r),l=[];break;case"select":i=tt({},i,{value:void 0}),r=tt({},r,{value:void 0}),l=[];break;case"textarea":i=Bc(e,i),r=Bc(e,r),l=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ia)}Vc(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(o in s)s.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ro.hasOwnProperty(u)?l||(l=[]):(l=l||[]).push(u,null));for(u in r){var a=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&a!==s&&(a!=null||s!=null))if(u==="style")if(s){for(o in s)!s.hasOwnProperty(o)||a&&a.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in a)a.hasOwnProperty(o)&&s[o]!==a[o]&&(n||(n={}),n[o]=a[o])}else n||(l||(l=[]),l.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,s=s?s.__html:void 0,a!=null&&s!==a&&(l=l||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(l=l||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ro.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&Ke("scroll",e),l||s===a||(l=[])):(l=l||[]).push(u,a))}n&&(l=l||[]).push("style",n);var u=l;(t.updateQueue=u)&&(t.flags|=4)}};iy=function(e,t,n,r){n!==r&&(t.flags|=4)};function jl(e,t){if(!Qe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function _t(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Wb(e,t,n){var r=t.pendingProps;switch(_f(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(t),null;case 1:return Wt(t.type)&&la(),_t(t),null;case 3:return r=t.stateNode,il(),Ge(Ht),Ge(At),zf(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(fs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,bn!==null&&(Ed(bn),bn=null))),gd(e,t),_t(t),null;case 5:Mf(t);var i=ri(go.current);if(n=t.type,e!==null&&t.stateNode!=null)ry(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ee(166));return _t(t),null}if(e=ri(On.current),fs(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[zn]=t,r[ho]=l,e=(t.mode&1)!==0,n){case"dialog":Ke("cancel",r),Ke("close",r);break;case"iframe":case"object":case"embed":Ke("load",r);break;case"video":case"audio":for(i=0;i<Bl.length;i++)Ke(Bl[i],r);break;case"source":Ke("error",r);break;case"img":case"image":case"link":Ke("error",r),Ke("load",r);break;case"details":Ke("toggle",r);break;case"input":Jp(r,l),Ke("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},Ke("invalid",r);break;case"textarea":th(r,l),Ke("invalid",r)}Vc(n,l),i=null;for(var o in l)if(l.hasOwnProperty(o)){var s=l[o];o==="children"?typeof s=="string"?r.textContent!==s&&(l.suppressHydrationWarning!==!0&&ds(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(l.suppressHydrationWarning!==!0&&ds(r.textContent,s,e),i=["children",""+s]):ro.hasOwnProperty(o)&&s!=null&&o==="onScroll"&&Ke("scroll",r)}switch(n){case"input":rs(r),eh(r,l,!0);break;case"textarea":rs(r),nh(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=ia)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=T0(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[zn]=t,e[ho]=r,ny(e,t,!1,!1),t.stateNode=e;e:{switch(o=Hc(n,r),n){case"dialog":Ke("cancel",e),Ke("close",e),i=r;break;case"iframe":case"object":case"embed":Ke("load",e),i=r;break;case"video":case"audio":for(i=0;i<Bl.length;i++)Ke(Bl[i],e);i=r;break;case"source":Ke("error",e),i=r;break;case"img":case"image":case"link":Ke("error",e),Ke("load",e),i=r;break;case"details":Ke("toggle",e),i=r;break;case"input":Jp(e,r),i=Oc(e,r),Ke("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=tt({},r,{value:void 0}),Ke("invalid",e);break;case"textarea":th(e,r),i=Bc(e,r),Ke("invalid",e);break;default:i=r}Vc(n,i),s=i;for(l in s)if(s.hasOwnProperty(l)){var a=s[l];l==="style"?M0(e,a):l==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&R0(e,a)):l==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&io(e,a):typeof a=="number"&&io(e,""+a):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(ro.hasOwnProperty(l)?a!=null&&l==="onScroll"&&Ke("scroll",e):a!=null&&ff(e,l,a,o))}switch(n){case"input":rs(e),eh(e,r,!1);break;case"textarea":rs(e),nh(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Dr(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?Hi(e,!!r.multiple,l,!1):r.defaultValue!=null&&Hi(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=ia)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return _t(t),null;case 6:if(e&&t.stateNode!=null)iy(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ee(166));if(n=ri(go.current),ri(On.current),fs(t)){if(r=t.stateNode,n=t.memoizedProps,r[zn]=t,(l=r.nodeValue!==n)&&(e=Zt,e!==null))switch(e.tag){case 3:ds(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ds(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[zn]=t,t.stateNode=r}return _t(t),null;case 13:if(Ge(Ze),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Qe&&Qt!==null&&t.mode&1&&!(t.flags&128))bx(),nl(),t.flags|=98560,l=!1;else if(l=fs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(ee(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(ee(317));l[zn]=t}else nl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_t(t),l=!1}else bn!==null&&(Ed(bn),bn=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ze.current&1?ct===0&&(ct=3):Kf())),t.updateQueue!==null&&(t.flags|=4),_t(t),null);case 4:return il(),gd(e,t),e===null&&fo(t.stateNode.containerInfo),_t(t),null;case 10:return If(t.type._context),_t(t),null;case 17:return Wt(t.type)&&la(),_t(t),null;case 19:if(Ge(Ze),l=t.memoizedState,l===null)return _t(t),null;if(r=(t.flags&128)!==0,o=l.rendering,o===null)if(r)jl(l,!1);else{if(ct!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fa(e),o!==null){for(t.flags|=128,jl(l,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,o=l.alternate,o===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=o.childLanes,l.lanes=o.lanes,l.child=o.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=o.memoizedProps,l.memoizedState=o.memoizedState,l.updateQueue=o.updateQueue,l.type=o.type,e=o.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return We(Ze,Ze.current&1|2),t.child}e=e.sibling}l.tail!==null&<()>ol&&(t.flags|=128,r=!0,jl(l,!1),t.lanes=4194304)}else{if(!r)if(e=fa(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),jl(l,!0),l.tail===null&&l.tailMode==="hidden"&&!o.alternate&&!Qe)return _t(t),null}else 2*lt()-l.renderingStartTime>ol&&n!==1073741824&&(t.flags|=128,r=!0,jl(l,!1),t.lanes=4194304);l.isBackwards?(o.sibling=t.child,t.child=o):(n=l.last,n!==null?n.sibling=o:t.child=o,l.last=o)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=lt(),t.sibling=null,n=Ze.current,We(Ze,r?n&1|2:n&1),t):(_t(t),null);case 22:case 23:return Xf(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?qt&1073741824&&(_t(t),t.subtreeFlags&6&&(t.flags|=8192)):_t(t),null;case 24:return null;case 25:return null}throw Error(ee(156,t.tag))}function Yb(e,t){switch(_f(t),t.tag){case 1:return Wt(t.type)&&la(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return il(),Ge(Ht),Ge(At),zf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Mf(t),null;case 13:if(Ge(Ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));nl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ge(Ze),null;case 4:return il(),null;case 10:return If(t.type._context),null;case 22:case 23:return Xf(),null;case 24:return null;default:return null}}var ms=!1,jt=!1,Xb=typeof WeakSet=="function"?WeakSet:Set,se=null;function Bi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){nt(e,t,r)}else n.current=null}function xd(e,t,n){try{n()}catch(r){nt(e,t,r)}}var Wh=!1;function Kb(e,t){if(ed=ta,e=ux(),Nf(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var o=0,s=-1,a=-1,u=0,c=0,d=e,p=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(s=o+i),d!==l||r!==0&&d.nodeType!==3||(a=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===n&&++u===i&&(s=o),p===l&&++c===r&&(a=o),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(td={focusedElem:e,selectionRange:n},ta=!1,se=t;se!==null;)if(t=se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,se=e;else for(;se!==null;){t=se;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var v=x.memoizedProps,b=x.memoizedState,m=t.stateNode,g=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:vn(t.type,v),b);m.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ee(163))}}catch(S){nt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,se=e;break}se=t.return}return x=Wh,Wh=!1,x}function Ql(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var l=i.destroy;i.destroy=void 0,l!==void 0&&xd(t,n,l)}i=i.next}while(i!==r)}}function Ga(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function yd(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ly(e){var t=e.alternate;t!==null&&(e.alternate=null,ly(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zn],delete t[ho],delete t[id],delete t[Ab],delete t[Ib])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function oy(e){return e.tag===5||e.tag===3||e.tag===4}function Yh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||oy(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function vd(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ia));else if(r!==4&&(e=e.child,e!==null))for(vd(e,t,n),e=e.sibling;e!==null;)vd(e,t,n),e=e.sibling}function wd(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(wd(e,t,n),e=e.sibling;e!==null;)wd(e,t,n),e=e.sibling}var wt=null,wn=!1;function pr(e,t,n){for(n=n.child;n!==null;)sy(e,t,n),n=n.sibling}function sy(e,t,n){if(Dn&&typeof Dn.onCommitFiberUnmount=="function")try{Dn.onCommitFiberUnmount(Ba,n)}catch{}switch(n.tag){case 5:jt||Bi(n,t);case 6:var r=wt,i=wn;wt=null,pr(e,t,n),wt=r,wn=i,wt!==null&&(wn?(e=wt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wt.removeChild(n.stateNode));break;case 18:wt!==null&&(wn?(e=wt,n=n.stateNode,e.nodeType===8?Wu(e.parentNode,n):e.nodeType===1&&Wu(e,n),ao(e)):Wu(wt,n.stateNode));break;case 4:r=wt,i=wn,wt=n.stateNode.containerInfo,wn=!0,pr(e,t,n),wt=r,wn=i;break;case 0:case 11:case 14:case 15:if(!jt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var l=i,o=l.destroy;l=l.tag,o!==void 0&&(l&2||l&4)&&xd(n,t,o),i=i.next}while(i!==r)}pr(e,t,n);break;case 1:if(!jt&&(Bi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){nt(n,t,s)}pr(e,t,n);break;case 21:pr(e,t,n);break;case 22:n.mode&1?(jt=(r=jt)||n.memoizedState!==null,pr(e,t,n),jt=r):pr(e,t,n);break;default:pr(e,t,n)}}function Xh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Xb),t.forEach(function(r){var i=rS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function yn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var l=e,o=t,s=o;e:for(;s!==null;){switch(s.tag){case 5:wt=s.stateNode,wn=!1;break e;case 3:wt=s.stateNode.containerInfo,wn=!0;break e;case 4:wt=s.stateNode.containerInfo,wn=!0;break e}s=s.return}if(wt===null)throw Error(ee(160));sy(l,o,i),wt=null,wn=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(u){nt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ay(t,e),t=t.sibling}function ay(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(yn(t,e),Rn(e),r&4){try{Ql(3,e,e.return),Ga(3,e)}catch(v){nt(e,e.return,v)}try{Ql(5,e,e.return)}catch(v){nt(e,e.return,v)}}break;case 1:yn(t,e),Rn(e),r&512&&n!==null&&Bi(n,n.return);break;case 5:if(yn(t,e),Rn(e),r&512&&n!==null&&Bi(n,n.return),e.flags&32){var i=e.stateNode;try{io(i,"")}catch(v){nt(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var l=e.memoizedProps,o=n!==null?n.memoizedProps:l,s=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{s==="input"&&l.type==="radio"&&l.name!=null&&A0(i,l),Hc(s,o);var u=Hc(s,l);for(o=0;o<a.length;o+=2){var c=a[o],d=a[o+1];c==="style"?M0(i,d):c==="dangerouslySetInnerHTML"?R0(i,d):c==="children"?io(i,d):ff(i,c,d,u)}switch(s){case"input":Fc(i,l);break;case"textarea":I0(i,l);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!l.multiple;var h=l.value;h!=null?Hi(i,!!l.multiple,h,!1):p!==!!l.multiple&&(l.defaultValue!=null?Hi(i,!!l.multiple,l.defaultValue,!0):Hi(i,!!l.multiple,l.multiple?[]:"",!1))}i[ho]=l}catch(v){nt(e,e.return,v)}}break;case 6:if(yn(t,e),Rn(e),r&4){if(e.stateNode===null)throw Error(ee(162));i=e.stateNode,l=e.memoizedProps;try{i.nodeValue=l}catch(v){nt(e,e.return,v)}}break;case 3:if(yn(t,e),Rn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ao(t.containerInfo)}catch(v){nt(e,e.return,v)}break;case 4:yn(t,e),Rn(e);break;case 13:yn(t,e),Rn(e),i=e.child,i.flags&8192&&(l=i.memoizedState!==null,i.stateNode.isHidden=l,!l||i.alternate!==null&&i.alternate.memoizedState!==null||(Wf=lt())),r&4&&Xh(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(jt=(u=jt)||c,yn(t,e),jt=u):yn(t,e),Rn(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(se=e,c=e.child;c!==null;){for(d=se=c;se!==null;){switch(p=se,h=p.child,p.tag){case 0:case 11:case 14:case 15:Ql(4,p,p.return);break;case 1:Bi(p,p.return);var x=p.stateNode;if(typeof x.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(v){nt(r,n,v)}}break;case 5:Bi(p,p.return);break;case 22:if(p.memoizedState!==null){Gh(d);continue}}h!==null?(h.return=p,se=h):Gh(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(l=i.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(s=d.stateNode,a=d.memoizedProps.style,o=a!=null&&a.hasOwnProperty("display")?a.display:null,s.style.display=L0("display",o))}catch(v){nt(e,e.return,v)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){nt(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:yn(t,e),Rn(e),r&4&&Xh(e);break;case 21:break;default:yn(t,e),Rn(e)}}function Rn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(oy(n)){var r=n;break e}n=n.return}throw Error(ee(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(io(i,""),r.flags&=-33);var l=Yh(e);wd(e,l,i);break;case 3:case 4:var o=r.stateNode.containerInfo,s=Yh(e);vd(e,s,o);break;default:throw Error(ee(161))}}catch(a){nt(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gb(e,t,n){se=e,uy(e)}function uy(e,t,n){for(var r=(e.mode&1)!==0;se!==null;){var i=se,l=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||ms;if(!o){var s=i.alternate,a=s!==null&&s.memoizedState!==null||jt;s=ms;var u=jt;if(ms=o,(jt=a)&&!u)for(se=i;se!==null;)o=se,a=o.child,o.tag===22&&o.memoizedState!==null?qh(i):a!==null?(a.return=o,se=a):qh(i);for(;l!==null;)se=l,uy(l),l=l.sibling;se=i,ms=s,jt=u}Kh(e)}else i.subtreeFlags&8772&&l!==null?(l.return=i,se=l):Kh(e)}}function Kh(e){for(;se!==null;){var t=se;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:jt||Ga(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!jt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:vn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Th(t,l,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Th(t,o,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&ao(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ee(163))}jt||t.flags&512&&yd(t)}catch(p){nt(t,t.return,p)}}if(t===e){se=null;break}if(n=t.sibling,n!==null){n.return=t.return,se=n;break}se=t.return}}function Gh(e){for(;se!==null;){var t=se;if(t===e){se=null;break}var n=t.sibling;if(n!==null){n.return=t.return,se=n;break}se=t.return}}function qh(e){for(;se!==null;){var t=se;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ga(4,t)}catch(a){nt(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(a){nt(t,i,a)}}var l=t.return;try{yd(t)}catch(a){nt(t,l,a)}break;case 5:var o=t.return;try{yd(t)}catch(a){nt(t,o,a)}}}catch(a){nt(t,t.return,a)}if(t===e){se=null;break}var s=t.sibling;if(s!==null){s.return=t.return,se=s;break}se=t.return}}var qb=Math.ceil,ma=rr.ReactCurrentDispatcher,Vf=rr.ReactCurrentOwner,fn=rr.ReactCurrentBatchConfig,Le=0,mt=null,st=null,kt=0,qt=0,Ui=$r(0),ct=0,wo=null,pi=0,qa=0,Hf=0,Zl=null,Bt=null,Wf=0,ol=1/0,Hn=null,ga=!1,kd=null,Tr=null,gs=!1,Nr=null,xa=0,Jl=0,bd=null,$s=-1,Bs=0;function Mt(){return Le&6?lt():$s!==-1?$s:$s=lt()}function Rr(e){return e.mode&1?Le&2&&kt!==0?kt&-kt:Rb.transition!==null?(Bs===0&&(Bs=X0()),Bs):(e=De,e!==0||(e=window.event,e=e===void 0?16:ex(e.type)),e):1}function Nn(e,t,n,r){if(50<Jl)throw Jl=0,bd=null,Error(ee(185));Lo(e,n,r),(!(Le&2)||e!==mt)&&(e===mt&&(!(Le&2)&&(qa|=n),ct===4&&br(e,kt)),Yt(e,r),n===1&&Le===0&&!(t.mode&1)&&(ol=lt()+500,Ya&&Br()))}function Yt(e,t){var n=e.callbackNode;Rk(e,t);var r=ea(e,e===mt?kt:0);if(r===0)n!==null&&lh(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&lh(n),t===1)e.tag===0?Tb(Qh.bind(null,e)):vx(Qh.bind(null,e)),jb(function(){!(Le&6)&&Br()}),n=null;else{switch(K0(r)){case 1:n=xf;break;case 4:n=W0;break;case 16:n=Js;break;case 536870912:n=Y0;break;default:n=Js}n=xy(n,cy.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function cy(e,t){if($s=-1,Bs=0,Le&6)throw Error(ee(327));var n=e.callbackNode;if(Gi()&&e.callbackNode!==n)return null;var r=ea(e,e===mt?kt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ya(e,r);else{t=r;var i=Le;Le|=2;var l=fy();(mt!==e||kt!==t)&&(Hn=null,ol=lt()+500,oi(e,t));do try{Jb();break}catch(s){dy(e,s)}while(!0);Af(),ma.current=l,Le=i,st!==null?t=0:(mt=null,kt=0,t=ct)}if(t!==0){if(t===2&&(i=Gc(e),i!==0&&(r=i,t=Sd(e,i))),t===1)throw n=wo,oi(e,0),br(e,r),Yt(e,lt()),n;if(t===6)br(e,r);else{if(i=e.current.alternate,!(r&30)&&!Qb(i)&&(t=ya(e,r),t===2&&(l=Gc(e),l!==0&&(r=l,t=Sd(e,l))),t===1))throw n=wo,oi(e,0),br(e,r),Yt(e,lt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ee(345));case 2:Qr(e,Bt,Hn);break;case 3:if(br(e,r),(r&130023424)===r&&(t=Wf+500-lt(),10<t)){if(ea(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Mt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=rd(Qr.bind(null,e,Bt,Hn),t);break}Qr(e,Bt,Hn);break;case 4:if(br(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-En(r);l=1<<o,o=t[o],o>i&&(i=o),r&=~l}if(r=i,r=lt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*qb(r/1960))-r,10<r){e.timeoutHandle=rd(Qr.bind(null,e,Bt,Hn),r);break}Qr(e,Bt,Hn);break;case 5:Qr(e,Bt,Hn);break;default:throw Error(ee(329))}}}return Yt(e,lt()),e.callbackNode===n?cy.bind(null,e):null}function Sd(e,t){var n=Zl;return e.current.memoizedState.isDehydrated&&(oi(e,t).flags|=256),e=ya(e,t),e!==2&&(t=Bt,Bt=n,t!==null&&Ed(t)),e}function Ed(e){Bt===null?Bt=e:Bt.push.apply(Bt,e)}function Qb(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],l=i.getSnapshot;i=i.value;try{if(!jn(l(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function br(e,t){for(t&=~Hf,t&=~qa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-En(t),r=1<<n;e[n]=-1,t&=~r}}function Qh(e){if(Le&6)throw Error(ee(327));Gi();var t=ea(e,0);if(!(t&1))return Yt(e,lt()),null;var n=ya(e,t);if(e.tag!==0&&n===2){var r=Gc(e);r!==0&&(t=r,n=Sd(e,r))}if(n===1)throw n=wo,oi(e,0),br(e,t),Yt(e,lt()),n;if(n===6)throw Error(ee(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Qr(e,Bt,Hn),Yt(e,lt()),null}function Yf(e,t){var n=Le;Le|=1;try{return e(t)}finally{Le=n,Le===0&&(ol=lt()+500,Ya&&Br())}}function hi(e){Nr!==null&&Nr.tag===0&&!(Le&6)&&Gi();var t=Le;Le|=1;var n=fn.transition,r=De;try{if(fn.transition=null,De=1,e)return e()}finally{De=r,fn.transition=n,Le=t,!(Le&6)&&Br()}}function Xf(){qt=Ui.current,Ge(Ui)}function oi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,_b(n)),st!==null)for(n=st.return;n!==null;){var r=n;switch(_f(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&la();break;case 3:il(),Ge(Ht),Ge(At),zf();break;case 5:Mf(r);break;case 4:il();break;case 13:Ge(Ze);break;case 19:Ge(Ze);break;case 10:If(r.type._context);break;case 22:case 23:Xf()}n=n.return}if(mt=e,st=e=Lr(e.current,null),kt=qt=t,ct=0,wo=null,Hf=qa=pi=0,Bt=Zl=null,ni!==null){for(t=0;t<ni.length;t++)if(n=ni[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,l=n.pending;if(l!==null){var o=l.next;l.next=i,r.next=o}n.pending=r}ni=null}return e}function dy(e,t){do{var n=st;try{if(Af(),Ds.current=ha,pa){for(var r=Je.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}pa=!1}if(fi=0,ht=ut=Je=null,ql=!1,xo=0,Vf.current=null,n===null||n.return===null){ct=1,wo=t,st=null;break}e:{var l=e,o=n.return,s=n,a=t;if(t=kt,s.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=s,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var p=c.alternate;p?(c.updateQueue=p.updateQueue,c.memoizedState=p.memoizedState,c.lanes=p.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=Oh(o);if(h!==null){h.flags&=-257,Fh(h,o,s,l,t),h.mode&1&&Dh(l,u,t),t=h,a=u;var x=t.updateQueue;if(x===null){var v=new Set;v.add(a),t.updateQueue=v}else x.add(a);break e}else{if(!(t&1)){Dh(l,u,t),Kf();break e}a=Error(ee(426))}}else if(Qe&&s.mode&1){var b=Oh(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Fh(b,o,s,l,t),jf(ll(a,s));break e}}l=a=ll(a,s),ct!==4&&(ct=2),Zl===null?Zl=[l]:Zl.push(l),l=o;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var m=Kx(l,a,t);Ih(l,m);break e;case 1:s=a;var g=l.type,w=l.stateNode;if(!(l.flags&128)&&(typeof g.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Tr===null||!Tr.has(w)))){l.flags|=65536,t&=-t,l.lanes|=t;var S=Gx(l,s,t);Ih(l,S);break e}}l=l.return}while(l!==null)}hy(n)}catch(j){t=j,st===n&&n!==null&&(st=n=n.return);continue}break}while(!0)}function fy(){var e=ma.current;return ma.current=ha,e===null?ha:e}function Kf(){(ct===0||ct===3||ct===2)&&(ct=4),mt===null||!(pi&268435455)&&!(qa&268435455)||br(mt,kt)}function ya(e,t){var n=Le;Le|=2;var r=fy();(mt!==e||kt!==t)&&(Hn=null,oi(e,t));do try{Zb();break}catch(i){dy(e,i)}while(!0);if(Af(),Le=n,ma.current=r,st!==null)throw Error(ee(261));return mt=null,kt=0,ct}function Zb(){for(;st!==null;)py(st)}function Jb(){for(;st!==null&&!Ek();)py(st)}function py(e){var t=gy(e.alternate,e,qt);e.memoizedProps=e.pendingProps,t===null?hy(e):st=t,Vf.current=null}function hy(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Yb(n,t),n!==null){n.flags&=32767,st=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ct=6,st=null;return}}else if(n=Wb(n,t,qt),n!==null){st=n;return}if(t=t.sibling,t!==null){st=t;return}st=t=e}while(t!==null);ct===0&&(ct=5)}function Qr(e,t,n){var r=De,i=fn.transition;try{fn.transition=null,De=1,eS(e,t,n,r)}finally{fn.transition=i,De=r}return null}function eS(e,t,n,r){do Gi();while(Nr!==null);if(Le&6)throw Error(ee(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ee(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(Lk(e,l),e===mt&&(st=mt=null,kt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||gs||(gs=!0,xy(Js,function(){return Gi(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=fn.transition,fn.transition=null;var o=De;De=1;var s=Le;Le|=4,Vf.current=null,Kb(e,n),ay(n,e),wb(td),ta=!!ed,td=ed=null,e.current=n,Gb(n),Nk(),Le=s,De=o,fn.transition=l}else e.current=n;if(gs&&(gs=!1,Nr=e,xa=i),l=e.pendingLanes,l===0&&(Tr=null),jk(n.stateNode),Yt(e,lt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(ga)throw ga=!1,e=kd,kd=null,e;return xa&1&&e.tag!==0&&Gi(),l=e.pendingLanes,l&1?e===bd?Jl++:(Jl=0,bd=e):Jl=0,Br(),null}function Gi(){if(Nr!==null){var e=K0(xa),t=fn.transition,n=De;try{if(fn.transition=null,De=16>e?16:e,Nr===null)var r=!1;else{if(e=Nr,Nr=null,xa=0,Le&6)throw Error(ee(331));var i=Le;for(Le|=4,se=e.current;se!==null;){var l=se,o=l.child;if(se.flags&16){var s=l.deletions;if(s!==null){for(var a=0;a<s.length;a++){var u=s[a];for(se=u;se!==null;){var c=se;switch(c.tag){case 0:case 11:case 15:Ql(8,c,l)}var d=c.child;if(d!==null)d.return=c,se=d;else for(;se!==null;){c=se;var p=c.sibling,h=c.return;if(ly(c),c===u){se=null;break}if(p!==null){p.return=h,se=p;break}se=h}}}var x=l.alternate;if(x!==null){var v=x.child;if(v!==null){x.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}se=l}}if(l.subtreeFlags&2064&&o!==null)o.return=l,se=o;else e:for(;se!==null;){if(l=se,l.flags&2048)switch(l.tag){case 0:case 11:case 15:Ql(9,l,l.return)}var m=l.sibling;if(m!==null){m.return=l.return,se=m;break e}se=l.return}}var g=e.current;for(se=g;se!==null;){o=se;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,se=w;else e:for(o=g;se!==null;){if(s=se,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:Ga(9,s)}}catch(j){nt(s,s.return,j)}if(s===o){se=null;break e}var S=s.sibling;if(S!==null){S.return=s.return,se=S;break e}se=s.return}}if(Le=i,Br(),Dn&&typeof Dn.onPostCommitFiberRoot=="function")try{Dn.onPostCommitFiberRoot(Ba,e)}catch{}r=!0}return r}finally{De=n,fn.transition=t}}return!1}function Zh(e,t,n){t=ll(n,t),t=Kx(e,t,1),e=Ir(e,t,1),t=Mt(),e!==null&&(Lo(e,1,t),Yt(e,t))}function nt(e,t,n){if(e.tag===3)Zh(e,e,n);else for(;t!==null;){if(t.tag===3){Zh(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Tr===null||!Tr.has(r))){e=ll(n,e),e=Gx(t,e,1),t=Ir(t,e,1),e=Mt(),t!==null&&(Lo(t,1,e),Yt(t,e));break}}t=t.return}}function tS(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Mt(),e.pingedLanes|=e.suspendedLanes&n,mt===e&&(kt&n)===n&&(ct===4||ct===3&&(kt&130023424)===kt&&500>lt()-Wf?oi(e,0):Hf|=n),Yt(e,t)}function my(e,t){t===0&&(e.mode&1?(t=os,os<<=1,!(os&130023424)&&(os=4194304)):t=1);var n=Mt();e=Jn(e,t),e!==null&&(Lo(e,t,n),Yt(e,n))}function nS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),my(e,n)}function rS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ee(314))}r!==null&&r.delete(t),my(e,n)}var gy;gy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ht.current)Ut=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ut=!1,Hb(e,t,n);Ut=!!(e.flags&131072)}else Ut=!1,Qe&&t.flags&1048576&&wx(t,aa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Fs(e,t),e=t.pendingProps;var i=tl(t,At.current);Ki(t,n),i=Of(null,t,r,e,i,n);var l=Ff();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Wt(r)?(l=!0,oa(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Rf(t),i.updater=Ka,t.stateNode=i,i._reactInternals=t,cd(t,r,e,n),t=pd(null,t,r,!0,l,n)):(t.tag=0,Qe&&l&&Cf(t),Rt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Fs(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=lS(r),e=vn(r,e),i){case 0:t=fd(null,t,r,e,n);break e;case 1:t=Uh(null,t,r,e,n);break e;case 11:t=$h(null,t,r,e,n);break e;case 14:t=Bh(null,t,r,vn(r.type,e),n);break e}throw Error(ee(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vn(r,i),fd(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vn(r,i),Uh(e,t,r,i,n);case 3:e:{if(Jx(t),e===null)throw Error(ee(387));r=t.pendingProps,l=t.memoizedState,i=l.element,Cx(e,t),da(t,r,null,n);var o=t.memoizedState;if(r=o.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=ll(Error(ee(423)),t),t=Vh(e,t,r,n,i);break e}else if(r!==i){i=ll(Error(ee(424)),t),t=Vh(e,t,r,n,i);break e}else for(Qt=Ar(t.stateNode.containerInfo.firstChild),Zt=t,Qe=!0,bn=null,n=Ex(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(nl(),r===i){t=er(e,t,n);break e}Rt(e,t,r,n)}t=t.child}return t;case 5:return _x(t),e===null&&sd(t),r=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,o=i.children,nd(r,i)?o=null:l!==null&&nd(r,l)&&(t.flags|=32),Zx(e,t),Rt(e,t,o,n),t.child;case 6:return e===null&&sd(t),null;case 13:return ey(e,t,n);case 4:return Lf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=rl(t,null,r,n):Rt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vn(r,i),$h(e,t,r,i,n);case 7:return Rt(e,t,t.pendingProps,n),t.child;case 8:return Rt(e,t,t.pendingProps.children,n),t.child;case 12:return Rt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,l=t.memoizedProps,o=i.value,We(ua,r._currentValue),r._currentValue=o,l!==null)if(jn(l.value,o)){if(l.children===i.children&&!Ht.current){t=er(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var s=l.dependencies;if(s!==null){o=l.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(l.tag===1){a=Gn(-1,n&-n),a.tag=2;var u=l.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),ad(l.return,n,t),s.lanes|=n;break}a=a.next}}else if(l.tag===10)o=l.type===t.type?null:l.child;else if(l.tag===18){if(o=l.return,o===null)throw Error(ee(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),ad(o,n,t),o=l.sibling}else o=l.child;if(o!==null)o.return=l;else for(o=l;o!==null;){if(o===t){o=null;break}if(l=o.sibling,l!==null){l.return=o.return,o=l;break}o=o.return}l=o}Rt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Ki(t,n),i=pn(i),r=r(i),t.flags|=1,Rt(e,t,r,n),t.child;case 14:return r=t.type,i=vn(r,t.pendingProps),i=vn(r.type,i),Bh(e,t,r,i,n);case 15:return qx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vn(r,i),Fs(e,t),t.tag=1,Wt(r)?(e=!0,oa(t)):e=!1,Ki(t,n),Xx(t,r,i),cd(t,r,i,n),pd(null,t,r,!0,e,n);case 19:return ty(e,t,n);case 22:return Qx(e,t,n)}throw Error(ee(156,t.tag))};function xy(e,t){return H0(e,t)}function iS(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(e,t,n,r){return new iS(e,t,n,r)}function Gf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function lS(e){if(typeof e=="function")return Gf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===hf)return 11;if(e===mf)return 14}return 2}function Lr(e,t){var n=e.alternate;return n===null?(n=cn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Us(e,t,n,r,i,l){var o=2;if(r=e,typeof e=="function")Gf(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ti:return si(n.children,i,l,t);case pf:o=8,i|=8;break;case Lc:return e=cn(12,n,t,i|2),e.elementType=Lc,e.lanes=l,e;case Mc:return e=cn(13,n,t,i),e.elementType=Mc,e.lanes=l,e;case zc:return e=cn(19,n,t,i),e.elementType=zc,e.lanes=l,e;case _0:return Qa(n,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N0:o=10;break e;case C0:o=9;break e;case hf:o=11;break e;case mf:o=14;break e;case xr:o=16,r=null;break e}throw Error(ee(130,e==null?e:typeof e,""))}return t=cn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=l,t}function si(e,t,n,r){return e=cn(7,e,r,t),e.lanes=n,e}function Qa(e,t,n,r){return e=cn(22,e,r,t),e.elementType=_0,e.lanes=n,e.stateNode={isHidden:!1},e}function Ju(e,t,n){return e=cn(6,e,null,t),e.lanes=n,e}function ec(e,t,n){return t=cn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function oS(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Lu(0),this.expirationTimes=Lu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lu(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function qf(e,t,n,r,i,l,o,s,a){return e=new oS(e,t,n,s,a),t===1?(t=1,l===!0&&(t|=8)):t=0,l=cn(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rf(l),e}function sS(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ii,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function yy(e){if(!e)return Or;e=e._reactInternals;e:{if(vi(e)!==e||e.tag!==1)throw Error(ee(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Wt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ee(171))}if(e.tag===1){var n=e.type;if(Wt(n))return yx(e,n,t)}return t}function vy(e,t,n,r,i,l,o,s,a){return e=qf(n,r,!0,e,i,l,o,s,a),e.context=yy(null),n=e.current,r=Mt(),i=Rr(n),l=Gn(r,i),l.callback=t??null,Ir(n,l,i),e.current.lanes=i,Lo(e,i,r),Yt(e,r),e}function Za(e,t,n,r){var i=t.current,l=Mt(),o=Rr(i);return n=yy(n),t.context===null?t.context=n:t.pendingContext=n,t=Gn(l,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ir(i,t,o),e!==null&&(Nn(e,i,o,l),zs(e,i,o)),o}function va(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Jh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Qf(e,t){Jh(e,t),(e=e.alternate)&&Jh(e,t)}function aS(){return null}var wy=typeof reportError=="function"?reportError:function(e){console.error(e)};function Zf(e){this._internalRoot=e}Ja.prototype.render=Zf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ee(409));Za(e,t,null,null)};Ja.prototype.unmount=Zf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hi(function(){Za(null,e,null,null)}),t[Zn]=null}};function Ja(e){this._internalRoot=e}Ja.prototype.unstable_scheduleHydration=function(e){if(e){var t=Q0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<kr.length&&t!==0&&t<kr[n].priority;n++);kr.splice(n,0,e),n===0&&J0(e)}};function Jf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function eu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function em(){}function uS(e,t,n,r,i){if(i){if(typeof r=="function"){var l=r;r=function(){var u=va(o);l.call(u)}}var o=vy(t,r,e,0,null,!1,!1,"",em);return e._reactRootContainer=o,e[Zn]=o.current,fo(e.nodeType===8?e.parentNode:e),hi(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=va(a);s.call(u)}}var a=qf(e,0,!1,null,null,!1,!1,"",em);return e._reactRootContainer=a,e[Zn]=a.current,fo(e.nodeType===8?e.parentNode:e),hi(function(){Za(t,a,n,r)}),a}function tu(e,t,n,r,i){var l=n._reactRootContainer;if(l){var o=l;if(typeof i=="function"){var s=i;i=function(){var a=va(o);s.call(a)}}Za(t,o,e,i)}else o=uS(n,t,e,i,r);return va(o)}G0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=$l(t.pendingLanes);n!==0&&(yf(t,n|1),Yt(t,lt()),!(Le&6)&&(ol=lt()+500,Br()))}break;case 13:hi(function(){var r=Jn(e,1);if(r!==null){var i=Mt();Nn(r,e,1,i)}}),Qf(e,1)}};vf=function(e){if(e.tag===13){var t=Jn(e,134217728);if(t!==null){var n=Mt();Nn(t,e,134217728,n)}Qf(e,134217728)}};q0=function(e){if(e.tag===13){var t=Rr(e),n=Jn(e,t);if(n!==null){var r=Mt();Nn(n,e,t,r)}Qf(e,t)}};Q0=function(){return De};Z0=function(e,t){var n=De;try{return De=e,t()}finally{De=n}};Yc=function(e,t,n){switch(t){case"input":if(Fc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Wa(r);if(!i)throw Error(ee(90));P0(r),Fc(r,i)}}}break;case"textarea":I0(e,n);break;case"select":t=n.value,t!=null&&Hi(e,!!n.multiple,t,!1)}};O0=Yf;F0=hi;var cS={usingClientEntryPoint:!1,Events:[zo,zi,Wa,z0,D0,Yf]},Pl={findFiberByHostInstance:ti,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dS={bundleType:Pl.bundleType,version:Pl.version,rendererPackageName:Pl.rendererPackageName,rendererConfig:Pl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:rr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=U0(e),e===null?null:e.stateNode},findFiberByHostInstance:Pl.findFiberByHostInstance||aS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xs.isDisabled&&xs.supportsFiber)try{Ba=xs.inject(dS),Dn=xs}catch{}}nn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cS;nn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jf(t))throw Error(ee(200));return sS(e,t,null,n)};nn.createRoot=function(e,t){if(!Jf(e))throw Error(ee(299));var n=!1,r="",i=wy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=qf(e,1,!1,null,null,n,!1,r,i),e[Zn]=t.current,fo(e.nodeType===8?e.parentNode:e),new Zf(t)};nn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ee(188)):(e=Object.keys(e).join(","),Error(ee(268,e)));return e=U0(t),e=e===null?null:e.stateNode,e};nn.flushSync=function(e){return hi(e)};nn.hydrate=function(e,t,n){if(!eu(t))throw Error(ee(200));return tu(null,e,t,!0,n)};nn.hydrateRoot=function(e,t,n){if(!Jf(e))throw Error(ee(405));var r=n!=null&&n.hydratedSources||null,i=!1,l="",o=wy;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=vy(t,null,e,1,n??null,i,!1,l,o),e[Zn]=t.current,fo(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Ja(t)};nn.render=function(e,t,n){if(!eu(t))throw Error(ee(200));return tu(null,e,t,!1,n)};nn.unmountComponentAtNode=function(e){if(!eu(e))throw Error(ee(40));return e._reactRootContainer?(hi(function(){tu(null,null,e,!1,function(){e._reactRootContainer=null,e[Zn]=null})}),!0):!1};nn.unstable_batchedUpdates=Yf;nn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!eu(n))throw Error(ee(200));if(e==null||e._reactInternals===void 0)throw Error(ee(38));return tu(e,t,n,!1,r)};nn.version="18.3.1-next-f1338f8080-20240426";function ky(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ky)}catch(e){console.error(e)}}ky(),k0.exports=nn;var fS=k0.exports,by,tm=fS;by=tm.createRoot,tm.hydrateRoot;/**
|
|
41
|
+
* @remix-run/router v1.23.2
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/function ko(){return ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ko.apply(this,arguments)}var Cr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Cr||(Cr={}));const nm="popstate";function pS(e){e===void 0&&(e={});function t(r,i){let{pathname:l,search:o,hash:s}=r.location;return Nd("",{pathname:l,search:o,hash:s},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:wa(i)}return mS(t,n,null,e)}function et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ep(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function hS(){return Math.random().toString(36).substr(2,8)}function rm(e,t){return{usr:e.state,key:e.key,idx:t}}function Nd(e,t,n,r){return n===void 0&&(n=null),ko({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?gl(t):t,{state:n,key:t&&t.key||r||hS()})}function wa(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function gl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function mS(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:l=!1}=r,o=i.history,s=Cr.Pop,a=null,u=c();u==null&&(u=0,o.replaceState(ko({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){s=Cr.Pop;let b=c(),m=b==null?null:b-u;u=b,a&&a({action:s,location:v.location,delta:m})}function p(b,m){s=Cr.Push;let g=Nd(v.location,b,m);u=c()+1;let w=rm(g,u),S=v.createHref(g);try{o.pushState(w,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(S)}l&&a&&a({action:s,location:v.location,delta:1})}function h(b,m){s=Cr.Replace;let g=Nd(v.location,b,m);u=c();let w=rm(g,u),S=v.createHref(g);o.replaceState(w,"",S),l&&a&&a({action:s,location:v.location,delta:0})}function x(b){let m=i.location.origin!=="null"?i.location.origin:i.location.href,g=typeof b=="string"?b:wa(b);return g=g.replace(/ $/,"%20"),et(m,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,m)}let v={get action(){return s},get location(){return e(i,o)},listen(b){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(nm,d),a=b,()=>{i.removeEventListener(nm,d),a=null}},createHref(b){return t(i,b)},createURL:x,encodeLocation(b){let m=x(b);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:p,replace:h,go(b){return o.go(b)}};return v}var im;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(im||(im={}));function gS(e,t,n){return n===void 0&&(n="/"),xS(e,t,n)}function xS(e,t,n,r){let i=typeof t=="string"?gl(t):t,l=sl(i.pathname||"/",n);if(l==null)return null;let o=Sy(e);yS(o);let s=null;for(let a=0;s==null&&a<o.length;++a){let u=PS(l);s=_S(o[a],u)}return s}function Sy(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(l,o,s)=>{let a={relativePath:s===void 0?l.path||"":s,caseSensitive:l.caseSensitive===!0,childrenIndex:o,route:l};a.relativePath.startsWith("/")&&(et(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Mr([r,a.relativePath]),c=n.concat(a);l.children&&l.children.length>0&&(et(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Sy(l.children,t,c,u)),!(l.path==null&&!l.index)&&t.push({path:u,score:NS(u,l.index),routesMeta:c})};return e.forEach((l,o)=>{var s;if(l.path===""||!((s=l.path)!=null&&s.includes("?")))i(l,o);else for(let a of Ey(l.path))i(l,o,a)}),t}function Ey(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return i?[l,""]:[l];let o=Ey(r.join("/")),s=[];return s.push(...o.map(a=>a===""?l:[l,a].join("/"))),i&&s.push(...o),s.map(a=>e.startsWith("/")&&a===""?"/":a)}function yS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:CS(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const vS=/^:[\w-]+$/,wS=3,kS=2,bS=1,SS=10,ES=-2,lm=e=>e==="*";function NS(e,t){let n=e.split("/"),r=n.length;return n.some(lm)&&(r+=ES),t&&(r+=kS),n.filter(i=>!lm(i)).reduce((i,l)=>i+(vS.test(l)?wS:l===""?bS:SS),r)}function CS(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function _S(e,t,n){let{routesMeta:r}=e,i={},l="/",o=[];for(let s=0;s<r.length;++s){let a=r[s],u=s===r.length-1,c=l==="/"?t:t.slice(l.length)||"/",d=Cd({path:a.relativePath,caseSensitive:a.caseSensitive,end:u},c),p=a.route;if(!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Mr([l,d.pathname]),pathnameBase:LS(Mr([l,d.pathnameBase])),route:p}),d.pathnameBase!=="/"&&(l=Mr([l,d.pathnameBase]))}return o}function Cd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=jS(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let l=i[0],o=l.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((u,c,d)=>{let{paramName:p,isOptional:h}=c;if(p==="*"){let v=s[d]||"";o=l.slice(0,l.length-v.length).replace(/(.)\/+$/,"$1")}const x=s[d];return h&&!x?u[p]=void 0:u[p]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:l,pathnameBase:o,pattern:e}}function jS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ep(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function PS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ep(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function sl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const AS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,IS=e=>AS.test(e);function TS(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?gl(e):e,l;if(n)if(IS(n))l=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),ep(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?l=om(n.substring(1),"/"):l=om(n,t)}else l=t;return{pathname:l,search:MS(r),hash:zS(i)}}function om(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function tc(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function RS(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function tp(e,t){let n=RS(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function np(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=gl(e):(i=ko({},e),et(!i.pathname||!i.pathname.includes("?"),tc("?","pathname","search",i)),et(!i.pathname||!i.pathname.includes("#"),tc("#","pathname","hash",i)),et(!i.search||!i.search.includes("#"),tc("#","search","hash",i)));let l=e===""||i.pathname==="",o=l?"/":i.pathname,s;if(o==null)s=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;i.pathname=p.join("/")}s=d>=0?t[d]:"/"}let a=TS(i,s),u=o&&o!=="/"&&o.endsWith("/"),c=(l||o===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||c)&&(a.pathname+="/"),a}const Mr=e=>e.join("/").replace(/\/\/+/g,"/"),LS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),MS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function DS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ny=["post","put","patch","delete"];new Set(Ny);const OS=["get",...Ny];new Set(OS);/**
|
|
50
|
+
* React Router v6.30.3
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/function bo(){return bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bo.apply(this,arguments)}const nu=y.createContext(null),Cy=y.createContext(null),ir=y.createContext(null),ru=y.createContext(null),Ur=y.createContext({outlet:null,matches:[],isDataRoute:!1}),_y=y.createContext(null);function FS(e,t){let{relative:n}=t===void 0?{}:t;xl()||et(!1);let{basename:r,navigator:i}=y.useContext(ir),{hash:l,pathname:o,search:s}=iu(e,{relative:n}),a=o;return r!=="/"&&(a=o==="/"?r:Mr([r,o])),i.createHref({pathname:a,search:s,hash:l})}function xl(){return y.useContext(ru)!=null}function wi(){return xl()||et(!1),y.useContext(ru).location}function jy(e){y.useContext(ir).static||y.useLayoutEffect(e)}function rp(){let{isDataRoute:e}=y.useContext(Ur);return e?ZS():$S()}function $S(){xl()||et(!1);let e=y.useContext(nu),{basename:t,future:n,navigator:r}=y.useContext(ir),{matches:i}=y.useContext(Ur),{pathname:l}=wi(),o=JSON.stringify(tp(i,n.v7_relativeSplatPath)),s=y.useRef(!1);return jy(()=>{s.current=!0}),y.useCallback(function(u,c){if(c===void 0&&(c={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let d=np(u,JSON.parse(o),l,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Mr([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,o,l,e])}function iu(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(ir),{matches:i}=y.useContext(Ur),{pathname:l}=wi(),o=JSON.stringify(tp(i,r.v7_relativeSplatPath));return y.useMemo(()=>np(e,JSON.parse(o),l,n==="path"),[e,o,l,n])}function BS(e,t){return US(e,t)}function US(e,t,n,r){xl()||et(!1);let{navigator:i}=y.useContext(ir),{matches:l}=y.useContext(Ur),o=l[l.length-1],s=o?o.params:{};o&&o.pathname;let a=o?o.pathnameBase:"/";o&&o.route;let u=wi(),c;if(t){var d;let b=typeof t=="string"?gl(t):t;a==="/"||(d=b.pathname)!=null&&d.startsWith(a)||et(!1),c=b}else c=u;let p=c.pathname||"/",h=p;if(a!=="/"){let b=a.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(b.length).join("/")}let x=gS(e,{pathname:h}),v=XS(x&&x.map(b=>Object.assign({},b,{params:Object.assign({},s,b.params),pathname:Mr([a,i.encodeLocation?i.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?a:Mr([a,i.encodeLocation?i.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),l,n,r);return t&&v?y.createElement(ru.Provider,{value:{location:bo({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Cr.Pop}},v):v}function VS(){let e=QS(),t=DS(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:i},n):null,null)}const HS=y.createElement(VS,null);class WS extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?y.createElement(Ur.Provider,{value:this.props.routeContext},y.createElement(_y.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function YS(e){let{routeContext:t,match:n,children:r}=e,i=y.useContext(nu);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Ur.Provider,{value:t},r)}function XS(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=r)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let c=o.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);c>=0||et(!1),o=o.slice(0,Math.min(o.length,c+1))}let a=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c<o.length;c++){let d=o[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=c),d.route.id){let{loaderData:p,errors:h}=n,x=d.route.loader&&p[d.route.id]===void 0&&(!h||h[d.route.id]===void 0);if(d.route.lazy||x){a=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,d,p)=>{let h,x=!1,v=null,b=null;n&&(h=s&&d.route.id?s[d.route.id]:void 0,v=d.route.errorElement||HS,a&&(u<0&&p===0?(JS("route-fallback"),x=!0,b=null):u===p&&(x=!0,b=d.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,p+1)),g=()=>{let w;return h?w=v:x?w=b:d.route.Component?w=y.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=c,y.createElement(YS,{match:d,routeContext:{outlet:c,matches:m,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?y.createElement(WS,{location:n.location,revalidation:n.revalidation,component:v,error:h,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()},null)}var Py=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Py||{}),Ay=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ay||{});function KS(e){let t=y.useContext(nu);return t||et(!1),t}function GS(e){let t=y.useContext(Cy);return t||et(!1),t}function qS(e){let t=y.useContext(Ur);return t||et(!1),t}function Iy(e){let t=qS(),n=t.matches[t.matches.length-1];return n.route.id||et(!1),n.route.id}function QS(){var e;let t=y.useContext(_y),n=GS(),r=Iy();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function ZS(){let{router:e}=KS(Py.UseNavigateStable),t=Iy(Ay.UseNavigateStable),n=y.useRef(!1);return jy(()=>{n.current=!0}),y.useCallback(function(i,l){l===void 0&&(l={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,bo({fromRouteId:t},l)))},[e,t])}const sm={};function JS(e,t,n){sm[e]||(sm[e]=!0)}function e2(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function t2(e){let{to:t,replace:n,state:r,relative:i}=e;xl()||et(!1);let{future:l,static:o}=y.useContext(ir),{matches:s}=y.useContext(Ur),{pathname:a}=wi(),u=rp(),c=np(t,tp(s,l.v7_relativeSplatPath),a,i==="path"),d=JSON.stringify(c);return y.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:i}),[u,d,i,n,r]),null}function Zr(e){et(!1)}function n2(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Cr.Pop,navigator:l,static:o=!1,future:s}=e;xl()&&et(!1);let a=t.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:a,navigator:l,static:o,future:bo({v7_relativeSplatPath:!1},s)}),[a,s,l,o]);typeof r=="string"&&(r=gl(r));let{pathname:c="/",search:d="",hash:p="",state:h=null,key:x="default"}=r,v=y.useMemo(()=>{let b=sl(c,a);return b==null?null:{location:{pathname:b,search:d,hash:p,state:h,key:x},navigationType:i}},[a,c,d,p,h,x,i]);return v==null?null:y.createElement(ir.Provider,{value:u},y.createElement(ru.Provider,{children:n,value:v}))}function r2(e){let{children:t,location:n}=e;return BS(_d(t),n)}new Promise(()=>{});function _d(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(r,i)=>{if(!y.isValidElement(r))return;let l=[...t,i];if(r.type===y.Fragment){n.push.apply(n,_d(r.props.children,l));return}r.type!==Zr&&et(!1),!r.props.index||!r.props.children||et(!1);let o={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=_d(r.props.children,l)),n.push(o)}),n}/**
|
|
59
|
+
* React Router DOM v6.30.3
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/function ka(){return ka=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ka.apply(this,arguments)}function Ty(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,l;for(l=0;l<r.length;l++)i=r[l],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function i2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function l2(e,t){return e.button===0&&(!t||t==="_self")&&!i2(e)}const o2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],s2=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],a2="6";try{window.__reactRouterVersion=a2}catch{}const u2=y.createContext({isTransitioning:!1}),c2="startTransition",am=tk[c2];function d2(e){let{basename:t,children:n,future:r,window:i}=e,l=y.useRef();l.current==null&&(l.current=pS({window:i,v5Compat:!0}));let o=l.current,[s,a]=y.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},c=y.useCallback(d=>{u&&am?am(()=>a(d)):a(d)},[a,u]);return y.useLayoutEffect(()=>o.listen(c),[o,c]),y.useEffect(()=>e2(r),[r]),y.createElement(n2,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}const f2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",p2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,h2=y.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:l,replace:o,state:s,target:a,to:u,preventScrollReset:c,viewTransition:d}=t,p=Ty(t,o2),{basename:h}=y.useContext(ir),x,v=!1;if(typeof u=="string"&&p2.test(u)&&(x=u,f2))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),j=sl(S.pathname,h);S.origin===w.origin&&j!=null?u=j+S.search+S.hash:v=!0}catch{}let b=FS(u,{relative:i}),m=g2(u,{replace:o,state:s,target:a,preventScrollReset:c,relative:i,viewTransition:d});function g(w){r&&r(w),w.defaultPrevented||m(w)}return y.createElement("a",ka({},p,{href:x||b,onClick:v||l?r:g,ref:n,target:a}))}),Al=y.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:l="",end:o=!1,style:s,to:a,viewTransition:u,children:c}=t,d=Ty(t,s2),p=iu(a,{relative:d.relative}),h=wi(),x=y.useContext(Cy),{navigator:v,basename:b}=y.useContext(ir),m=x!=null&&x2(p)&&u===!0,g=v.encodeLocation?v.encodeLocation(p).pathname:p.pathname,w=h.pathname,S=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;i||(w=w.toLowerCase(),S=S?S.toLowerCase():null,g=g.toLowerCase()),S&&b&&(S=sl(S,b)||S);const j=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let E=w===g||!o&&w.startsWith(g)&&w.charAt(j)==="/",P=S!=null&&(S===g||!o&&S.startsWith(g)&&S.charAt(g.length)==="/"),I={isActive:E,isPending:P,isTransitioning:m},L=E?r:void 0,_;typeof l=="function"?_=l(I):_=[l,E?"active":null,P?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let O=typeof s=="function"?s(I):s;return y.createElement(h2,ka({},d,{"aria-current":L,className:_,ref:n,style:O,to:a,viewTransition:u}),typeof c=="function"?c(I):c)});var jd;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(jd||(jd={}));var um;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(um||(um={}));function m2(e){let t=y.useContext(nu);return t||et(!1),t}function g2(e,t){let{target:n,replace:r,state:i,preventScrollReset:l,relative:o,viewTransition:s}=t===void 0?{}:t,a=rp(),u=wi(),c=iu(e,{relative:o});return y.useCallback(d=>{if(l2(d,n)){d.preventDefault();let p=r!==void 0?r:wa(u)===wa(c);a(e,{replace:p,state:i,preventScrollReset:l,relative:o,viewTransition:s})}},[u,a,c,r,i,n,e,l,o,s])}function x2(e,t){t===void 0&&(t={});let n=y.useContext(u2);n==null&&et(!1);let{basename:r}=m2(jd.useViewTransitionState),i=iu(e,{relative:t.relative});if(!n.isTransitioning)return!1;let l=sl(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=sl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Cd(i.pathname,o)!=null||Cd(i.pathname,l)!=null}var Ry={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},cm=X.createContext&&X.createContext(Ry),y2=["attr","size","title"];function v2(e,t){if(e==null)return{};var n=w2(e,t),r,i;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function w2(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ba(){return ba=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ba.apply(this,arguments)}function dm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dm(Object(n),!0).forEach(function(r){k2(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function k2(e,t,n){return t=b2(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b2(e){var t=S2(e,"string");return typeof t=="symbol"?t:t+""}function S2(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ly(e){return e&&e.map((t,n)=>X.createElement(t.tag,Sa({key:n},t.attr),Ly(t.child)))}function Xt(e){return t=>X.createElement(E2,ba({attr:Sa({},e.attr)},t),Ly(e.child))}function E2(e){var t=n=>{var{attr:r,size:i,title:l}=e,o=v2(e,y2),s=i||n.size||"1em",a;return n.className&&(a=n.className),e.className&&(a=(a?a+" ":"")+e.className),X.createElement("svg",ba({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:a,style:Sa(Sa({color:e.color||n.color},n.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),l&&X.createElement("title",null,l),e.children)};return cm!==void 0?X.createElement(cm.Consumer,null,n=>t(n)):t(Ry)}function fm(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"},child:[]},{tag:"line",attr:{x1:"12",y1:"9",x2:"12",y2:"13"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(e)}function N2(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(e)}function C2(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"18 15 12 9 6 15"},child:[]}]})(e)}function _2(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"},child:[]}]})(e)}function j2(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"2",x2:"12",y2:"6"},child:[]},{tag:"line",attr:{x1:"12",y1:"18",x2:"12",y2:"22"},child:[]},{tag:"line",attr:{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76"},child:[]},{tag:"line",attr:{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07"},child:[]},{tag:"line",attr:{x1:"2",y1:"12",x2:"6",y2:"12"},child:[]},{tag:"line",attr:{x1:"18",y1:"12",x2:"22",y2:"12"},child:[]},{tag:"line",attr:{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24"},child:[]},{tag:"line",attr:{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93"},child:[]}]})(e)}function P2(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"3",y1:"12",x2:"21",y2:"12"},child:[]},{tag:"line",attr:{x1:"3",y1:"6",x2:"21",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",y1:"18",x2:"21",y2:"18"},child:[]}]})(e)}function A2(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"},child:[]}]})(e)}function I2(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"},child:[]},{tag:"path",attr:{d:"M19 10v2a7 7 0 0 1-14 0v-2"},child:[]},{tag:"line",attr:{x1:"12",y1:"19",x2:"12",y2:"23"},child:[]},{tag:"line",attr:{x1:"8",y1:"23",x2:"16",y2:"23"},child:[]}]})(e)}function T2(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"5",x2:"12",y2:"19"},child:[]},{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(e)}function pm(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"rect",attr:{x:"9",y:"9",width:"6",height:"6"},child:[]}]})(e)}function R2(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]},{tag:"line",attr:{x1:"10",y1:"11",x2:"10",y2:"17"},child:[]},{tag:"line",attr:{x1:"14",y1:"11",x2:"14",y2:"17"},child:[]}]})(e)}function L2(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"},child:[]},{tag:"circle",attr:{cx:"12",cy:"7",r:"4"},child:[]}]})(e)}function M2(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},child:[]},{tag:"path",attr:{d:"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"},child:[]}]})(e)}function z2(e){return Xt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}function D2(e){const t=[],n=[];if(!e||typeof e!="object")return{textEvents:t,toolEvents:n};const r=O2(e);if(r)return r;const i=F2(e);if(i.length>0){for(const l of i){const o=l.message,s=B2(o),a=s?s.toLowerCase():"",u=U2(o),c=V2(a)||u==="assistant",d=H2(a);if(!(u==="user"&&!c&&!d)){if(c){const p=Y2(o,l),h=X2(o,l.meta),x=K2(o,p);for(const b of x)n.push({id:b.id,name:b.name,args:b.args,status:"running",timestamp:Date.now()});const v=zy(o);v&&t.push({text:v,messageId:p,node:h,isDelta:W2(o,a)})}if(d){const p=G2(o);p&&n.push({id:p.id,name:p.name||"tool",status:p.error?"error":"completed",output:p.output,error:p.error,timestamp:Date.now()})}}}if(t.length>0||n.length>0)return{textEvents:t,toolEvents:n}}if(typeof e.content=="string"&&t.push({text:e.content}),e.tool_calls&&Array.isArray(e.tool_calls))for(const l of e.tool_calls){const o=Oy(l);o&&n.push({id:o.id,name:o.name,args:o.args,status:"running",timestamp:Date.now()})}return{textEvents:t,toolEvents:n}}function O2(e){var t,n,r,i,l,o,s;if(!e||typeof e!="object"||typeof e.event!="string")return null;if(e.event==="on_chat_model_stream"){const a=((t=e.data)==null?void 0:t.chunk)??((n=e.data)==null?void 0:n.message),u=zy(a);return u?{textEvents:[{text:u,messageId:typeof e.run_id=="string"?e.run_id:void 0,node:hm(e),isDelta:!0}],toolEvents:[]}:null}if(e.event==="on_llm_stream"){const a=(r=e.data)==null?void 0:r.chunk;let u;return typeof a=="string"?u=a:typeof(a==null?void 0:a.text)=="string"&&(u=a.text),u?{textEvents:[{text:u,messageId:typeof e.run_id=="string"?e.run_id:void 0,node:hm(e),isDelta:!0}],toolEvents:[]}:null}if(e.event==="on_tool_start"){const a=typeof e.name=="string"?e.name:"tool",u=typeof e.run_id=="string"?e.run_id:Ea();return{textEvents:[],toolEvents:[{id:u,name:a,args:Dy((i=e.data)==null?void 0:i.input),status:"running",timestamp:Date.now()}]}}if(e.event==="on_tool_end"){const a=typeof e.run_id=="string"?e.run_id:Ea();return{textEvents:[],toolEvents:[{id:a,name:typeof e.name=="string"?e.name:"tool",status:(l=e.data)!=null&&l.error?"error":"completed",output:(o=e.data)==null?void 0:o.output,error:(s=e.data)==null?void 0:s.error,timestamp:Date.now()}]}}return null}function F2(e){if(Array.isArray(e)&&e.length>=3&&e[1]==="messages")return $2(e[2],String(e[0]??"messages"));const t=[];if(Array.isArray(e.messages))for(const[n,r]of e.messages.entries())t.push({message:r,sourceKey:"messages",index:n});if(typeof e=="object")for(const[n,r]of Object.entries(e)){const i=r==null?void 0:r.messages;if(Array.isArray(i))for(const[l,o]of i.entries())t.push({message:o,sourceKey:n,index:l})}return t}function $2(e,t){return!Array.isArray(e)||e.length===0?[]:e.length===2&&!Array.isArray(e[0])?[{message:e[0],meta:e[1],sourceKey:t,index:0}]:Array.isArray(e[0])?e.map((n,r)=>{if(Array.isArray(n))return{message:n[0],meta:n[1],sourceKey:t,index:r}}).filter(Boolean):[{message:e[0],sourceKey:t,index:0}]}function B2(e){var n;if(!e)return;if(typeof e._getType=="function")return e._getType();if(typeof e.getType=="function")return e.getType();if(typeof e.type=="string")return e.type;if(Array.isArray(e.id)&&e.id.length>0)return String(e.id[e.id.length-1]);if(Array.isArray(e.lc_id)&&e.lc_id.length>0)return String(e.lc_id[e.lc_id.length-1]);const t=typeof((n=e.constructor)==null?void 0:n.name)=="string"?e.constructor.name:"";if(t&&t!=="Object")return t}function U2(e){var t,n,r;if(e)return e.role||((t=e==null?void 0:e.kwargs)==null?void 0:t.role)||((n=e==null?void 0:e.additional_kwargs)==null?void 0:n.role)||((r=e==null?void 0:e.metadata)==null?void 0:r.role)}function V2(e){return e==="ai"||e==="assistant"||e==="aimessage"||e==="aimessagechunk"}function H2(e){return e==="tool"||e==="toolmessage"||e==="toolmessagechunk"}function W2(e,t){var l;return t.includes("chunk")||(Array.isArray(e==null?void 0:e.id)?e.id:[]).some(o=>String(o).toLowerCase().includes("chunk"))||(Array.isArray(e==null?void 0:e.lc_id)?e.lc_id:[]).some(o=>String(o).toLowerCase().includes("chunk"))?!0:(typeof((l=e==null?void 0:e.constructor)==null?void 0:l.name)=="string"?e.constructor.name:"").toLowerCase().includes("chunk")}function Y2(e,t){var r,i,l,o;if(typeof(e==null?void 0:e.id)=="string")return e.id;if(typeof((r=e==null?void 0:e.kwargs)==null?void 0:r.id)=="string")return e.kwargs.id;if(typeof((i=e==null?void 0:e.additional_kwargs)==null?void 0:i.id)=="string")return e.additional_kwargs.id;if(typeof((l=e==null?void 0:e.lc_kwargs)==null?void 0:l.id)=="string")return e.lc_kwargs.id;if(typeof((o=t.meta)==null?void 0:o.id)=="string")return t.meta.id;const n=[];return t.meta&&typeof t.meta=="object"&&(t.meta.langgraph_node&&n.push(String(t.meta.langgraph_node)),t.meta.langgraph_step!==void 0&&n.push(String(t.meta.langgraph_step))),n.length===0&&t.sourceKey&&n.push(t.sourceKey),t.index!==void 0&&n.push(String(t.index)),n.length>0?n.join(":"):void 0}function hm(e){var n,r,i,l,o,s,a,u,c,d,p;const t=[e==null?void 0:e.metadata,(n=e==null?void 0:e.data)==null?void 0:n.metadata,(i=(r=e==null?void 0:e.data)==null?void 0:r.chunk)==null?void 0:i.metadata,(o=(l=e==null?void 0:e.data)==null?void 0:l.message)==null?void 0:o.metadata,(u=(a=(s=e==null?void 0:e.data)==null?void 0:s.chunk)==null?void 0:a.additional_kwargs)==null?void 0:u.metadata,(p=(d=(c=e==null?void 0:e.data)==null?void 0:c.message)==null?void 0:d.additional_kwargs)==null?void 0:p.metadata];for(const h of t){const x=My(h);if(x)return x}}function My(e){if(!e||typeof e!="object")return;const t=e.langgraph_node??e.langgraphNode??e.node??e.node_id??e.nodeId;if(typeof t=="string"&&t.trim().length>0)return t}function X2(e,t){var r,i;const n=[t,e==null?void 0:e.metadata,(r=e==null?void 0:e.kwargs)==null?void 0:r.metadata,(i=e==null?void 0:e.additional_kwargs)==null?void 0:i.metadata,e==null?void 0:e.additional_kwargs,e==null?void 0:e.kwargs];for(const l of n){const o=My(l);if(o)return o}}function zy(e){var n,r;if(!e)return;const t=e.content??((n=e==null?void 0:e.kwargs)==null?void 0:n.content)??((r=e==null?void 0:e.additional_kwargs)==null?void 0:r.content);if(typeof t=="string")return t.length>0?t:void 0;if(Array.isArray(t)){const i=t.filter(l=>l&&l.type==="text"&&l.text).map(l=>l.text);return i.length>0?i.join(""):void 0}}function K2(e,t){var l,o,s,a;const n=[],r=(e==null?void 0:e.tool_calls)??((l=e==null?void 0:e.kwargs)==null?void 0:l.tool_calls)??((o=e==null?void 0:e.additional_kwargs)==null?void 0:o.tool_calls);Array.isArray(r)&&n.push(...r);const i=(e==null?void 0:e.tool_call_chunks)??((s=e==null?void 0:e.kwargs)==null?void 0:s.tool_call_chunks)??((a=e==null?void 0:e.additional_kwargs)==null?void 0:a.tool_call_chunks);return Array.isArray(i)&&n.push(...i),n.map(u=>Oy(u,t)).filter(Boolean)}function Ea(){var e;return typeof((e=globalThis.crypto)==null?void 0:e.randomUUID)=="function"?globalThis.crypto.randomUUID():`evt-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function Dy(e){if(!e)return{};if(typeof e=="string"){try{const t=JSON.parse(e);if(t&&typeof t=="object")return t}catch{return{raw:e}}return{raw:e}}return typeof e=="object"?e:{value:e}}function Oy(e,t){var o,s;if(!e||typeof e!="object")return null;const n=e.name||((o=e.function)==null?void 0:o.name);if(!n)return null;const r=typeof e.index=="number"?e.index:void 0,i=e.id||(r!==void 0&&t?`${t}:${r}`:void 0)||(t?`${t}:${Ea()}`:Ea()),l=Dy(e.args??((s=e.function)==null?void 0:s.arguments));return{id:i,name:n,args:l}}function G2(e){var n,r,i,l,o,s,a;const t=(e==null?void 0:e.tool_call_id)??((n=e==null?void 0:e.kwargs)==null?void 0:n.tool_call_id)??((r=e==null?void 0:e.additional_kwargs)==null?void 0:r.tool_call_id);return t?{id:t,name:(e==null?void 0:e.name)??((i=e==null?void 0:e.kwargs)==null?void 0:i.name)??((l=e==null?void 0:e.additional_kwargs)==null?void 0:l.name),output:(e==null?void 0:e.content)??((o=e==null?void 0:e.kwargs)==null?void 0:o.content)??"",error:((s=e==null?void 0:e.kwargs)==null?void 0:s.error)??((a=e==null?void 0:e.additional_kwargs)==null?void 0:a.error)}:null}const Fy="/assets/wingman_icon-DOy91UEF.webp",$y="/assets/wingman_logo-Cogyt3qm.webp",mm=({variant:e="default",currentRoute:t,activeAgents:n,selectedAgentId:r,threads:i,activeThreadId:l,loadingThreads:o,onSelectAgent:s,onSelectThread:a,onCreateThread:u,onDeleteThread:c,onRenameThread:d,hostLabel:p,deviceId:h,getAgentLabel:x})=>{const v=g=>`flex w-full items-center justify-between rounded-xl border px-3 py-2 text-sm font-semibold transition ${g?"border-sky-500/50 bg-sky-500/15 text-sky-300":"border-white/10 bg-slate-950/50 text-slate-300 hover:border-sky-400/50"}`,b=t==="/chat",m=f.jsxs(f.Fragment,{children:[e==="default"&&f.jsx("div",{children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("img",{src:Fy,alt:"Wingman",className:"h-14 rounded-2xl border border-white/10 bg-slate-950/60 p-1.5"}),f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-slate-400",children:"Navigation"}),f.jsx("h2",{className:"mt-1 text-lg font-semibold",children:"Command Panel"})]})]})}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Al,{to:"/chat",className:({isActive:g})=>v(g),children:f.jsx("span",{children:"Chat"})}),f.jsx(Al,{to:"/command",className:({isActive:g})=>v(g),children:f.jsx("span",{children:"Command Deck"})}),f.jsx(Al,{to:"/agents",className:({isActive:g})=>v(g),children:f.jsx("span",{children:"Agents"})}),f.jsx(Al,{to:"/webhooks",className:({isActive:g})=>v(g),children:f.jsx("span",{children:"Webhooks"})}),f.jsx(Al,{to:"/routines",className:({isActive:g})=>v(g),children:f.jsx("span",{children:"Routines"})})]}),b&&f.jsxs("div",{className:"space-y-3",children:[f.jsx("p",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Threads"}),f.jsxs("div",{className:"flex items-end gap-2",children:[f.jsxs("div",{className:"flex w-full flex-col gap-1",children:[f.jsx("label",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-400",children:"Agent"}),f.jsx("select",{className:"w-full rounded-xl border border-white/10 bg-slate-900/60 px-3 py-2 text-xs font-semibold text-slate-200",value:r,onChange:g=>s(g.target.value),children:n.map(g=>f.jsx("option",{value:g.id,children:g.name||g.id},g.id))})]}),f.jsxs("button",{type:"button",className:"button-secondary flex items-center gap-2 px-3 py-2 text-xs",onClick:()=>u(r),title:"New thread",children:[f.jsx(T2,{}),f.jsx("span",{children:"New"})]})]}),f.jsx("div",{className:"max-h-[45vh] space-y-2 overflow-auto pr-1 lg:max-h-[420px]",children:o?f.jsx("div",{className:"rounded-xl border border-dashed border-white/15 bg-slate-950/40 px-3 py-2 text-xs text-slate-400",children:"Loading threads..."}):i.length===0?f.jsx("div",{className:"rounded-xl border border-dashed border-white/15 bg-slate-950/40 px-3 py-2 text-xs text-slate-400",children:"No threads yet."}):i.map(g=>f.jsx("div",{className:`rounded-xl border px-3 py-2 text-xs font-semibold transition ${g.id===l?"border-sky-500/50 bg-sky-500/12 text-sky-300":"border-white/10 bg-slate-950/50 text-slate-300 hover:border-sky-400/50"}`,children:f.jsxs("div",{className:"flex items-start justify-between gap-2",children:[f.jsxs("button",{type:"button",onClick:()=>a(g.id),className:"min-w-0 flex-1 text-left",children:[f.jsx("div",{className:"truncate",children:g.name}),f.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[10px] uppercase tracking-[0.18em] text-slate-400",children:[f.jsxs("span",{className:"pill flex items-center gap-1 px-2 py-0.5 text-[9px]",children:[f.jsx(L2,{className:"text-[11px]"}),x(g.agentId)]}),f.jsxs("span",{className:"flex items-center gap-1",children:[f.jsx(A2,{className:"text-[11px]"}),g.messageCount??g.messages.length]})]})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{type:"button",className:"rounded-full border border-transparent p-2 text-[12px] text-slate-400 transition hover:border-sky-400/50 hover:text-sky-300",onClick:()=>d(g.id),title:"Rename",children:f.jsx(_2,{})}),f.jsx("button",{type:"button",className:"rounded-full border border-transparent p-2 text-[12px] text-slate-400 transition hover:border-rose-400/40 hover:text-rose-500",onClick:()=>c(g.id),title:"Delete",children:f.jsx(R2,{})})]})]})},g.id))})]}),e==="default"&&f.jsxs("div",{className:"mt-auto space-y-3 text-xs text-slate-400",children:[f.jsx("div",{className:"flex items-center justify-center rounded-2xl border border-white/10 bg-slate-950/50 px-4 py-4",children:f.jsx("img",{src:$y,alt:"Wingman logo",className:"h-18 w-auto opacity-95"})}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"pill",children:["host: ",p]}),f.jsxs("div",{className:"pill",children:["device: ",h||"--"]})]})]})]});return e==="mobile-drawer"?f.jsx("nav",{className:"flex flex-col gap-6",children:m}):f.jsx("nav",{className:"panel-card animate-rise flex h-full flex-col gap-6 p-5",children:m})},gm="wingman_hero_panel_expanded",q2=({agentId:e,activeThreadName:t,statusLabel:n,connected:r,health:i,stats:l,formatDuration:o})=>{var c,d,p,h;const[s,a]=y.useState(()=>{if(typeof window>"u")return!0;const x=localStorage.getItem(gm);return x!==null?x==="true":window.innerWidth>=1024});y.useEffect(()=>{localStorage.setItem(gm,String(s))},[s]);const u=()=>a(x=>!x);return f.jsxs("section",{className:"glass-edge animate-floatIn relative overflow-hidden rounded-2xl px-4 py-3 lg:rounded-[32px] lg:px-7 lg:py-7 transition-all duration-300 ease-in-out",children:[f.jsx("div",{className:"lg:hidden",children:!s&&f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${r?"bg-sky-500 animate-pulseSoft":"bg-slate-600"}`}),f.jsx("span",{className:"text-sm font-semibold text-ink",children:"Gateway"}),f.jsx("span",{className:"text-slate-400",children:"•"}),f.jsx("span",{className:"text-xs text-slate-300",children:n}),f.jsx("span",{className:"text-slate-400",children:"•"}),f.jsxs("span",{className:"text-xs text-slate-300",children:["Health: ",i.status||"--"]})]}),f.jsx("button",{type:"button",onClick:u,"aria-expanded":!1,"aria-label":"Expand mission console",className:"text-slate-400 hover:text-slate-200 transition-colors flex-shrink-0",children:f.jsx(N2,{className:"h-4 w-4"})})]}),f.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-400 flex-wrap",children:[f.jsxs("span",{children:["agent: ",e]}),f.jsx("span",{children:"•"}),f.jsxs("span",{children:["thread: ",t||"--"]}),f.jsx("span",{children:"•"}),f.jsxs("span",{children:["uptime: ",o((c=i.stats)==null?void 0:c.uptime)]})]})]})}),f.jsxs("div",{className:s?"block":"hidden lg:block",children:[f.jsxs("div",{className:"relative z-10 grid gap-6 lg:grid-cols-[1.2fr_0.8fr]",children:[f.jsxs("div",{className:"space-y-4",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-slate-400",children:"Wingman Control Core"}),f.jsxs("h1",{className:"text-4xl font-semibold tracking-tight text-ink",children:[f.jsx("span",{className:"text-gradient",children:"Gateway"})," Mission Console"]}),f.jsx("p",{className:"text-sm text-slate-300",children:"Run your agent fleet, inspect runtime state, and stream intelligence through a single command deck."}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-slate-300",children:[f.jsx("span",{className:"pill",children:"channel: webui"}),f.jsxs("span",{className:"pill",children:["active agent: ",e]}),f.jsxs("span",{className:"pill",children:["thread: ",t||"--"]})]})]}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-white/10 bg-slate-900/70 px-4 py-3 shadow-[0_10px_24px_rgba(18,14,12,0.12)]",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-slate-400",children:"Status"}),f.jsx("p",{className:"text-lg font-semibold",children:n})]}),f.jsx("span",{className:`h-3 w-3 rounded-full ${r?"bg-sky-500/100 animate-pulseSoft":"bg-slate-600"}`})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[f.jsxs("div",{className:"stat-card p-3",children:[f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Health"}),f.jsx("strong",{className:"mt-2 block text-lg",children:i.status||"--"})]}),f.jsxs("div",{className:"stat-card p-3",children:[f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Uptime"}),f.jsx("strong",{className:"mt-2 block text-lg",children:o((d=i.stats)==null?void 0:d.uptime)})]}),f.jsxs("div",{className:"stat-card p-3",children:[f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Nodes"}),f.jsx("strong",{className:"mt-2 block text-lg",children:((p=l.nodes)==null?void 0:p.totalNodes)??"--"})]}),f.jsxs("div",{className:"stat-card p-3",children:[f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Groups"}),f.jsx("strong",{className:"mt-2 block text-lg",children:((h=l.groups)==null?void 0:h.totalGroups)??"--"})]})]})]})]}),f.jsx("button",{type:"button",onClick:u,"aria-expanded":!0,"aria-label":"Collapse mission console",className:"lg:hidden absolute top-3 right-3 text-slate-400 hover:text-slate-200 transition-colors z-20",children:f.jsx(C2,{className:"h-4 w-4"})})]})]})};function Q2(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Z2=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eE={};function xm(e,t){return(eE.jsx?J2:Z2).test(e)}const tE=/[ \t\n\f\r]/g;function nE(e){return typeof e=="object"?e.type==="text"?ym(e.value):!1:ym(e)}function ym(e){return e.replace(tE,"")===""}class Oo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Oo.prototype.normal={};Oo.prototype.property={};Oo.prototype.space=void 0;function By(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Oo(n,r,t)}function Pd(e){return e.toLowerCase()}class Kt{constructor(t,n){this.attribute=n,this.property=t}}Kt.prototype.attribute="";Kt.prototype.booleanish=!1;Kt.prototype.boolean=!1;Kt.prototype.commaOrSpaceSeparated=!1;Kt.prototype.commaSeparated=!1;Kt.prototype.defined=!1;Kt.prototype.mustUseProperty=!1;Kt.prototype.number=!1;Kt.prototype.overloadedBoolean=!1;Kt.prototype.property="";Kt.prototype.spaceSeparated=!1;Kt.prototype.space=void 0;let rE=0;const Se=ki(),ot=ki(),Ad=ki(),te=ki(),He=ki(),qi=ki(),Gt=ki();function ki(){return 2**++rE}const Id=Object.freeze(Object.defineProperty({__proto__:null,boolean:Se,booleanish:ot,commaOrSpaceSeparated:Gt,commaSeparated:qi,number:te,overloadedBoolean:Ad,spaceSeparated:He},Symbol.toStringTag,{value:"Module"})),nc=Object.keys(Id);class ip extends Kt{constructor(t,n,r,i){let l=-1;if(super(t,n),vm(this,"space",i),typeof r=="number")for(;++l<nc.length;){const o=nc[l];vm(this,nc[l],(r&Id[o])===Id[o])}}}ip.prototype.defined=!0;function vm(e,t,n){n&&(e[t]=n)}function yl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new ip(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Pd(r)]=r,n[Pd(l.attribute)]=r}return new Oo(t,n,e.space)}const Uy=yl({properties:{ariaActiveDescendant:null,ariaAtomic:ot,ariaAutoComplete:null,ariaBusy:ot,ariaChecked:ot,ariaColCount:te,ariaColIndex:te,ariaColSpan:te,ariaControls:He,ariaCurrent:null,ariaDescribedBy:He,ariaDetails:null,ariaDisabled:ot,ariaDropEffect:He,ariaErrorMessage:null,ariaExpanded:ot,ariaFlowTo:He,ariaGrabbed:ot,ariaHasPopup:null,ariaHidden:ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:He,ariaLevel:te,ariaLive:null,ariaModal:ot,ariaMultiLine:ot,ariaMultiSelectable:ot,ariaOrientation:null,ariaOwns:He,ariaPlaceholder:null,ariaPosInSet:te,ariaPressed:ot,ariaReadOnly:ot,ariaRelevant:null,ariaRequired:ot,ariaRoleDescription:He,ariaRowCount:te,ariaRowIndex:te,ariaRowSpan:te,ariaSelected:ot,ariaSetSize:te,ariaSort:null,ariaValueMax:te,ariaValueMin:te,ariaValueNow:te,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Vy(e,t){return t in e?e[t]:t}function Hy(e,t){return Vy(e,t.toLowerCase())}const iE=yl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qi,acceptCharset:He,accessKey:He,action:null,allow:null,allowFullScreen:Se,allowPaymentRequest:Se,allowUserMedia:Se,alt:null,as:null,async:Se,autoCapitalize:null,autoComplete:He,autoFocus:Se,autoPlay:Se,blocking:He,capture:null,charSet:null,checked:Se,cite:null,className:He,cols:te,colSpan:null,content:null,contentEditable:ot,controls:Se,controlsList:He,coords:te|qi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Se,defer:Se,dir:null,dirName:null,disabled:Se,download:Ad,draggable:ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Se,formTarget:null,headers:He,height:te,hidden:Ad,high:te,href:null,hrefLang:null,htmlFor:He,httpEquiv:He,id:null,imageSizes:null,imageSrcSet:null,inert:Se,inputMode:null,integrity:null,is:null,isMap:Se,itemId:null,itemProp:He,itemRef:He,itemScope:Se,itemType:He,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Se,low:te,manifest:null,max:null,maxLength:te,media:null,method:null,min:null,minLength:te,multiple:Se,muted:Se,name:null,nonce:null,noModule:Se,noValidate:Se,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Se,optimum:te,pattern:null,ping:He,placeholder:null,playsInline:Se,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Se,referrerPolicy:null,rel:He,required:Se,reversed:Se,rows:te,rowSpan:te,sandbox:He,scope:null,scoped:Se,seamless:Se,selected:Se,shadowRootClonable:Se,shadowRootDelegatesFocus:Se,shadowRootMode:null,shape:null,size:te,sizes:null,slot:null,span:te,spellCheck:ot,src:null,srcDoc:null,srcLang:null,srcSet:null,start:te,step:null,style:null,tabIndex:te,target:null,title:null,translate:null,type:null,typeMustMatch:Se,useMap:null,value:ot,width:te,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:He,axis:null,background:null,bgColor:null,border:te,borderColor:null,bottomMargin:te,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Se,declare:Se,event:null,face:null,frame:null,frameBorder:null,hSpace:te,leftMargin:te,link:null,longDesc:null,lowSrc:null,marginHeight:te,marginWidth:te,noResize:Se,noHref:Se,noShade:Se,noWrap:Se,object:null,profile:null,prompt:null,rev:null,rightMargin:te,rules:null,scheme:null,scrolling:ot,standby:null,summary:null,text:null,topMargin:te,valueType:null,version:null,vAlign:null,vLink:null,vSpace:te,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Se,disableRemotePlayback:Se,prefix:null,property:null,results:te,security:null,unselectable:null},space:"html",transform:Hy}),lE=yl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Gt,accentHeight:te,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:te,amplitude:te,arabicForm:null,ascent:te,attributeName:null,attributeType:null,azimuth:te,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:te,by:null,calcMode:null,capHeight:te,className:He,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:te,diffuseConstant:te,direction:null,display:null,dur:null,divisor:te,dominantBaseline:null,download:Se,dx:null,dy:null,edgeMode:null,editable:null,elevation:te,enableBackground:null,end:null,event:null,exponent:te,externalResourcesRequired:null,fill:null,fillOpacity:te,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:qi,g2:qi,glyphName:qi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:te,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:te,horizOriginX:te,horizOriginY:te,id:null,ideographic:te,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:te,k:te,k1:te,k2:te,k3:te,k4:te,kernelMatrix:Gt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:te,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:te,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:te,overlineThickness:te,paintOrder:null,panose1:null,path:null,pathLength:te,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:He,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:te,pointsAtY:te,pointsAtZ:te,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gt,rev:Gt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gt,requiredFeatures:Gt,requiredFonts:Gt,requiredFormats:Gt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:te,specularExponent:te,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:te,strikethroughThickness:te,string:null,stroke:null,strokeDashArray:Gt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:te,strokeOpacity:te,strokeWidth:null,style:null,surfaceScale:te,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gt,tabIndex:te,tableValues:null,target:null,targetX:te,targetY:te,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:te,underlineThickness:te,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:te,values:null,vAlphabetic:te,vMathematical:te,vectorEffect:null,vHanging:te,vIdeographic:te,version:null,vertAdvY:te,vertOriginX:te,vertOriginY:te,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:te,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Vy}),Wy=yl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Yy=yl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Hy}),Xy=yl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),oE={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},sE=/[A-Z]/g,wm=/-[a-z]/g,aE=/^data[-\w.:]+$/i;function uE(e,t){const n=Pd(t);let r=t,i=Kt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&aE.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(wm,dE);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!wm.test(l)){let o=l.replace(sE,cE);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=ip}return new i(r,t)}function cE(e){return"-"+e.toLowerCase()}function dE(e){return e.charAt(1).toUpperCase()}const fE=By([Uy,iE,Wy,Yy,Xy],"html"),lp=By([Uy,lE,Wy,Yy,Xy],"svg");function pE(e){return e.join(" ").trim()}var op={},km=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,hE=/\n/g,mE=/^\s*/,gE=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,xE=/^:\s*/,yE=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,vE=/^[;\s]*/,wE=/^\s+|\s+$/g,kE=`
|
|
68
|
+
`,bm="/",Sm="*",ei="",bE="comment",SE="declaration";function EE(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(x){var v=x.match(hE);v&&(n+=v.length);var b=x.lastIndexOf(kE);r=~b?x.length-b:r+x.length}function l(){var x={line:n,column:r};return function(v){return v.position=new o(x),u(),v}}function o(x){this.start=x,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(x){var v=new Error(t.source+":"+n+":"+r+": "+x);if(v.reason=x,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function a(x){var v=x.exec(e);if(v){var b=v[0];return i(b),e=e.slice(b.length),v}}function u(){a(mE)}function c(x){var v;for(x=x||[];v=d();)v!==!1&&x.push(v);return x}function d(){var x=l();if(!(bm!=e.charAt(0)||Sm!=e.charAt(1))){for(var v=2;ei!=e.charAt(v)&&(Sm!=e.charAt(v)||bm!=e.charAt(v+1));)++v;if(v+=2,ei===e.charAt(v-1))return s("End of comment missing");var b=e.slice(2,v-2);return r+=2,i(b),e=e.slice(v),r+=2,x({type:bE,comment:b})}}function p(){var x=l(),v=a(gE);if(v){if(d(),!a(xE))return s("property missing ':'");var b=a(yE),m=x({type:SE,property:Em(v[0].replace(km,ei)),value:b?Em(b[0].replace(km,ei)):ei});return a(vE),m}}function h(){var x=[];c(x);for(var v;v=p();)v!==!1&&(x.push(v),c(x));return x}return u(),h()}function Em(e){return e?e.replace(wE,ei):ei}var NE=EE,CE=Gs&&Gs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(op,"__esModule",{value:!0});op.default=jE;const _E=CE(NE);function jE(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,_E.default)(e),i=typeof t=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:o,value:s}=l;i?t(o,s,l):s&&(n=n||{},n[o]=s)}),n}var lu={};Object.defineProperty(lu,"__esModule",{value:!0});lu.camelCase=void 0;var PE=/^--[a-zA-Z0-9_-]+$/,AE=/-([a-z])/g,IE=/^[^-]+$/,TE=/^-(webkit|moz|ms|o|khtml)-/,RE=/^-(ms)-/,LE=function(e){return!e||IE.test(e)||PE.test(e)},ME=function(e,t){return t.toUpperCase()},Nm=function(e,t){return"".concat(t,"-")},zE=function(e,t){return t===void 0&&(t={}),LE(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(RE,Nm):e=e.replace(TE,Nm),e.replace(AE,ME))};lu.camelCase=zE;var DE=Gs&&Gs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},OE=DE(op),FE=lu;function Td(e,t){var n={};return!e||typeof e!="string"||(0,OE.default)(e,function(r,i){r&&i&&(n[(0,FE.camelCase)(r,t)]=i)}),n}Td.default=Td;var $E=Td;const BE=Fa($E),Ky=Gy("end"),sp=Gy("start");function Gy(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function UE(e){const t=sp(e),n=Ky(e);if(t&&n)return{start:t,end:n}}function eo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Cm(e.position):"start"in e||"end"in e?Cm(e):"line"in e||"column"in e?Rd(e):""}function Rd(e){return _m(e&&e.line)+":"+_m(e&&e.column)}function Cm(e){return Rd(e&&e.start)+"-"+Rd(e&&e.end)}function _m(e){return e&&typeof e=="number"?e:1}class It extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},o=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(o=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?l.ruleId=r:(l.source=r.slice(0,a),l.ruleId=r.slice(a+1))}if(!l.place&&l.ancestors&&l.ancestors){const a=l.ancestors[l.ancestors.length-1];a&&(l.place=a.position)}const s=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=eo(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}It.prototype.file="";It.prototype.name="";It.prototype.reason="";It.prototype.message="";It.prototype.stack="";It.prototype.column=void 0;It.prototype.line=void 0;It.prototype.ancestors=void 0;It.prototype.cause=void 0;It.prototype.fatal=void 0;It.prototype.place=void 0;It.prototype.ruleId=void 0;It.prototype.source=void 0;const ap={}.hasOwnProperty,VE=new Map,HE=/[A-Z]/g,WE=new Set(["table","tbody","thead","tfoot","tr"]),YE=new Set(["td","th"]),qy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function XE(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=tN(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=eN(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?lp:fE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=Qy(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Qy(e,t,n){if(t.type==="element")return KE(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return GE(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return QE(e,t,n);if(t.type==="mdxjsEsm")return qE(e,t);if(t.type==="root")return ZE(e,t,n);if(t.type==="text")return JE(e,t)}function KE(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=lp,e.schema=i),e.ancestors.push(t);const l=Jy(e,t.tagName,!1),o=nN(e,t);let s=cp(e,t);return WE.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!nE(a):!0})),Zy(e,o,l,t),up(o,s),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function GE(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}So(e,t.position)}function qE(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);So(e,t.position)}function QE(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=lp,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:Jy(e,t.name,!0),o=rN(e,t),s=cp(e,t);return Zy(e,o,l,t),up(o,s),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function ZE(e,t,n){const r={};return up(r,cp(e,t)),e.create(t,e.Fragment,r,n)}function JE(e,t){return t.value}function Zy(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function up(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function eN(e,t,n){return r;function r(i,l,o,s){const u=Array.isArray(o.children)?n:t;return s?u(l,o,s):u(l,o)}}function tN(e,t){return n;function n(r,i,l,o){const s=Array.isArray(l.children),a=sp(r);return t(i,l,o,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function nN(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ap.call(t.properties,i)){const l=iN(e,i,t.properties[i]);if(l){const[o,s]=l;e.tableCellAlignToStyle&&o==="align"&&typeof s=="string"&&YE.has(t.tagName)?r=s:n[o]=s}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function rN(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const s=o.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else So(e,t.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,l=e.evaluater.evaluateExpression(s.expression)}else So(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function cp(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:VE;for(;++r<t.children.length;){const l=t.children[r];let o;if(e.passKeys){const a=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(a){const u=i.get(a)||0;o=a+"-"+u,i.set(a,u+1)}}const s=Qy(e,l,o);s!==void 0&&n.push(s)}return n}function iN(e,t,n){const r=uE(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Q2(n):pE(n)),r.property==="style"){let i=typeof n=="object"?n:lN(e,String(n));return e.stylePropertyNameCase==="css"&&(i=oN(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?oE[r.property]||r.property:r.attribute,n]}}function lN(e,t){try{return BE(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new It("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=qy+"#cannot-parse-style-attribute",i}}function Jy(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,o;for(;++l<i.length;){const s=xm(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};o=o?{type:"MemberExpression",object:o,property:s,computed:!!(l&&s.type==="Literal"),optional:!1}:s}r=o}else r=xm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ap.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);So(e)}function So(e,t){const n=new It("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=qy+"#cannot-handle-mdx-estrees-without-createevaluater",n}function oN(e){const t={};let n;for(n in e)ap.call(e,n)&&(t[sN(n)]=e[n]);return t}function sN(e){let t=e.replace(HE,aN);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function aN(e){return"-"+e.toLowerCase()}const rc={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},uN={};function dp(e,t){const n=uN,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ev(e,r,i)}function ev(e,t,n){if(cN(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return jm(e.children,t,n)}return Array.isArray(e)?jm(e,t,n):""}function jm(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ev(e[i],t,n);return r.join("")}function cN(e){return!!(e&&typeof e=="object")}const Pm=document.createElement("i");function fp(e){const t="&"+e+";";Pm.innerHTML=t;const n=Pm.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Jt(e,t,n,r){const i=e.length;let l=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);l<r.length;)o=r.slice(l,l+1e4),o.unshift(t,0),e.splice(...o),l+=1e4,t+=1e4}function an(e,t){return e.length>0?(Jt(e,e.length,0,t),e):t}const Am={}.hasOwnProperty;function tv(e){const t={};let n=-1;for(;++n<e.length;)dN(t,e[n]);return t}function dN(e,t){let n;for(n in t){const i=(Am.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let o;if(l)for(o in l){Am.call(i,o)||(i[o]=[]);const s=l[o];fN(i[o],Array.isArray(s)?s:s?[s]:[])}}}function fN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Jt(e,0,0,r)}function nv(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Cn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Lt=Vr(/[A-Za-z]/),Pt=Vr(/[\dA-Za-z]/),pN=Vr(/[#-'*+\--9=?A-Z^-~]/);function Na(e){return e!==null&&(e<32||e===127)}const Ld=Vr(/\d/),hN=Vr(/[\dA-Fa-f]/),mN=Vr(/[!-/:-@[-`{-~]/);function xe(e){return e!==null&&e<-2}function Ve(e){return e!==null&&(e<0||e===32)}function _e(e){return e===-2||e===-1||e===32}const ou=Vr(new RegExp("\\p{P}|\\p{S}","u")),mi=Vr(/\s/);function Vr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function vl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let o="";if(l===37&&Pt(e.charCodeAt(n+1))&&Pt(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const s=e.charCodeAt(n+1);l<56320&&s>56319&&s<57344?(o=String.fromCharCode(l,s),i=1):o="�"}else o=String.fromCharCode(l);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Te(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(a){return _e(a)?(e.enter(n),s(a)):t(a)}function s(a){return _e(a)&&l++<i?(e.consume(a),s):(e.exit(n),t(a))}}const gN={tokenize:xN};function xN(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Te(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),l(s)}function l(s){const a=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=a),n=a,o(s)}function o(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return xe(s)?(e.consume(s),e.exit("chunkText"),l):(e.consume(s),o)}}const yN={tokenize:vN},Im={tokenize:wN};function vN(e){const t=this,n=[];let r=0,i,l,o;return s;function s(w){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,a,u)(w)}return u(w)}function a(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&g();const S=t.events.length;let j=S,E;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){E=t.events[j][1].end;break}m(r);let P=S;for(;P<t.events.length;)t.events[P][1].end={...E},P++;return Jt(t.events,j+1,0,t.events.slice(S)),t.events.length=P,u(w)}return s(w)}function u(w){if(r===n.length){if(!i)return p(w);if(i.currentConstruct&&i.currentConstruct.concrete)return x(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Im,c,d)(w)}function c(w){return i&&g(),m(r),p(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,x(w)}function p(w){return t.containerState={},e.attempt(Im,h,x)(w)}function h(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function x(w){if(w===null){i&&g(),m(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),v(w)}function v(w){if(w===null){b(e.exit("chunkFlow"),!0),m(0),e.consume(w);return}return xe(w)?(e.consume(w),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),v)}function b(w,S){const j=t.sliceStream(w);if(S&&j.push(null),w.previous=l,l&&(l.next=w),l=w,i.defineSkip(w.start),i.write(j),t.parser.lazy[w.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<o&&(!i.events[E][1].end||i.events[E][1].end.offset>o))return;const P=t.events.length;let I=P,L,_;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(L){_=t.events[I][1].end;break}L=!0}for(m(r),E=P;E<t.events.length;)t.events[E][1].end={..._},E++;Jt(t.events,I+1,0,t.events.slice(P)),t.events.length=E}}function m(w){let S=n.length;for(;S-- >w;){const j=n[S];t.containerState=j[1],j[0].exit.call(t,e)}n.length=w}function g(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function wN(e,t,n){return Te(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function al(e){if(e===null||Ve(e)||mi(e))return 1;if(ou(e))return 2}function su(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Md={name:"attention",resolveAll:kN,tokenize:bN};function kN(e,t){let n=-1,r,i,l,o,s,a,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;a=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};Tm(d,-a),Tm(p,a),o={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},l={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=an(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=an(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",l,t]]),u=an(u,su(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=an(u,[["exit",l,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=an(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Jt(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function bN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=al(r);let l;return o;function o(a){return l=a,e.enter("attentionSequence"),s(a)}function s(a){if(a===l)return e.consume(a),s;const u=e.exit("attentionSequence"),c=al(a),d=!c||c===2&&i||n.includes(a),p=!i||i===2&&c||n.includes(r);return u._open=!!(l===42?d:d&&(i||!p)),u._close=!!(l===42?p:p&&(c||!d)),t(a)}}function Tm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const SN={name:"autolink",tokenize:EN};function EN(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(h){return Lt(h)?(e.consume(h),o):h===64?n(h):u(h)}function o(h){return h===43||h===45||h===46||Pt(h)?(r=1,s(h)):u(h)}function s(h){return h===58?(e.consume(h),r=0,a):(h===43||h===45||h===46||Pt(h))&&r++<32?(e.consume(h),s):(r=0,u(h))}function a(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||Na(h)?n(h):(e.consume(h),a)}function u(h){return h===64?(e.consume(h),c):pN(h)?(e.consume(h),u):n(h)}function c(h){return Pt(h)?d(h):n(h)}function d(h){return h===46?(e.consume(h),r=0,c):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||Pt(h))&&r++<63){const x=h===45?p:d;return e.consume(h),x}return n(h)}}const Fo={partial:!0,tokenize:NN};function NN(e,t,n){return r;function r(l){return _e(l)?Te(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||xe(l)?t(l):n(l)}}const rv={continuation:{tokenize:_N},exit:jN,name:"blockQuote",tokenize:CN};function CN(e,t,n){const r=this;return i;function i(o){if(o===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return n(o)}function l(o){return _e(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function _N(e,t,n){const r=this;return i;function i(o){return _e(o)?Te(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(rv,t,n)(o)}}function jN(e){e.exit("blockQuote")}const iv={name:"characterEscape",tokenize:PN};function PN(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return mN(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const lv={name:"characterReference",tokenize:AN};function AN(e,t,n){const r=this;let i=0,l,o;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),a}function a(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),l=31,o=Pt,c(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=hN,c):(e.enter("characterReferenceValue"),l=7,o=Ld,c(d))}function c(d){if(d===59&&i){const p=e.exit("characterReferenceValue");return o===Pt&&!fp(r.sliceSerialize(p))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<l?(e.consume(d),c):n(d)}}const Rm={partial:!0,tokenize:TN},Lm={concrete:!0,name:"codeFenced",tokenize:IN};function IN(e,t,n){const r=this,i={partial:!0,tokenize:j};let l=0,o=0,s;return a;function a(E){return u(E)}function u(E){const P=r.events[r.events.length-1];return l=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,s=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(E)}function c(E){return E===s?(o++,e.consume(E),c):o<3?n(E):(e.exit("codeFencedFenceSequence"),_e(E)?Te(e,d,"whitespace")(E):d(E))}function d(E){return E===null||xe(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Rm,v,S)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===null||xe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(E)):_e(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Te(e,h,"whitespace")(E)):E===96&&E===s?n(E):(e.consume(E),p)}function h(E){return E===null||xe(E)?d(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(E))}function x(E){return E===null||xe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(E)):E===96&&E===s?n(E):(e.consume(E),x)}function v(E){return e.attempt(i,S,b)(E)}function b(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),m}function m(E){return l>0&&_e(E)?Te(e,g,"linePrefix",l+1)(E):g(E)}function g(E){return E===null||xe(E)?e.check(Rm,v,S)(E):(e.enter("codeFlowValue"),w(E))}function w(E){return E===null||xe(E)?(e.exit("codeFlowValue"),g(E)):(e.consume(E),w)}function S(E){return e.exit("codeFenced"),t(E)}function j(E,P,I){let L=0;return _;function _(z){return E.enter("lineEnding"),E.consume(z),E.exit("lineEnding"),O}function O(z){return E.enter("codeFencedFence"),_e(z)?Te(E,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):U(z)}function U(z){return z===s?(E.enter("codeFencedFenceSequence"),B(z)):I(z)}function B(z){return z===s?(L++,E.consume(z),B):L>=o?(E.exit("codeFencedFenceSequence"),_e(z)?Te(E,N,"whitespace")(z):N(z)):I(z)}function N(z){return z===null||xe(z)?(E.exit("codeFencedFence"),P(z)):I(z)}}}function TN(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const ic={name:"codeIndented",tokenize:LN},RN={partial:!0,tokenize:MN};function LN(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Te(e,l,"linePrefix",5)(u)}function l(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?a(u):xe(u)?e.attempt(RN,o,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||xe(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),t(u)}}function MN(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):xe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Te(e,l,"linePrefix",5)(o)}function l(o){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):xe(o)?i(o):n(o)}}const zN={name:"codeText",previous:ON,resolve:DN,tokenize:FN};function DN(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function ON(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function FN(e,t,n){let r=0,i,l;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),r++,s):(e.exit("codeTextSequence"),a(d))}function a(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),a):d===96?(l=e.enter("codeTextSequence"),i=0,c(d)):xe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),a):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||xe(d)?(e.exit("codeTextData"),a(d)):(e.consume(d),u)}function c(d){return d===96?(e.consume(d),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(l.type="codeTextData",u(d))}}class $N{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Il(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Il(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Il(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Il(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Il(this.left,n.reverse())}}}function Il(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ov(e){const t={};let n=-1,r,i,l,o,s,a,u;const c=new $N(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(a=r[1]._tokenizer.events,l=0,l<a.length&&a[l][1].type==="lineEndingBlank"&&(l+=2),l<a.length&&a[l][1].type==="content"))for(;++l<a.length&&a[l][1].type!=="content";)a[l][1].type==="chunkText"&&(a[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,BN(c,n)),n=t[n],u=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(o=c.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},s=c.slice(i,n),s.unshift(r),c.splice(i,n-i+1,s))}}return Jt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function BN(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const s=o.events,a=[],u={};let c,d,p=-1,h=n,x=0,v=0;const b=[v];for(;h;){for(;e.get(++i)[1]!==h;);l.push(i),h._tokenizer||(c=r.sliceStream(h),h.next||c.push(null),d&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(v=p+1,b.push(v),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):b.pop(),p=b.length;p--;){const m=s.slice(b[p],b[p+1]),g=l.pop();a.push([g,g+m.length-1]),e.splice(g,2,m)}for(a.reverse(),p=-1;++p<a.length;)u[x+a[p][0]]=x+a[p][1],x+=a[p][1]-a[p][0]-1;return u}const UN={resolve:HN,tokenize:WN},VN={partial:!0,tokenize:YN};function HN(e){return ov(e),e}function WN(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?l(s):xe(s)?e.check(VN,o,l)(s):(e.consume(s),i)}function l(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function o(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function YN(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Te(e,l,"linePrefix")}function l(o){if(o===null||xe(o))return n(o);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function sv(e,t,n,r,i,l,o,s,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(m){return m===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(m),e.exit(l),p):m===null||m===32||m===41||Na(m)?n(m):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),v(m))}function p(m){return m===62?(e.enter(l),e.consume(m),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===62?(e.exit("chunkString"),e.exit(s),p(m)):m===null||m===60||xe(m)?n(m):(e.consume(m),m===92?x:h)}function x(m){return m===60||m===62||m===92?(e.consume(m),h):h(m)}function v(m){return!c&&(m===null||m===41||Ve(m))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(m)):c<u&&m===40?(e.consume(m),c++,v):m===41?(e.consume(m),c--,v):m===null||m===32||m===40||Na(m)?n(m):(e.consume(m),m===92?b:v)}function b(m){return m===40||m===41||m===92?(e.consume(m),v):v(m)}}function av(e,t,n,r,i,l){const o=this;let s=0,a;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(l),c}function c(h){return s>999||h===null||h===91||h===93&&!a||h===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):h===93?(e.exit(l),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):xe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||xe(h)||s++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!_e(h)),h===92?p:d)}function p(h){return h===91||h===92||h===93?(e.consume(h),s++,d):d(h)}}function uv(e,t,n,r,i,l){let o;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),o=p===40?41:p,a):n(p)}function a(p){return p===o?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(l),u(p))}function u(p){return p===o?(e.exit(l),a(o)):p===null?n(p):xe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Te(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===o||p===null||xe(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:c)}function d(p){return p===o||p===92?(e.consume(p),c):c(p)}}function to(e,t){let n;return r;function r(i){return xe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):_e(i)?Te(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const XN={name:"definition",tokenize:GN},KN={partial:!0,tokenize:qN};function GN(e,t,n){const r=this;let i;return l;function l(h){return e.enter("definition"),o(h)}function o(h){return av.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return i=Cn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return Ve(h)?to(e,u)(h):u(h)}function u(h){return sv(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(KN,d,d)(h)}function d(h){return _e(h)?Te(e,p,"whitespace")(h):p(h)}function p(h){return h===null||xe(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function qN(e,t,n){return r;function r(s){return Ve(s)?to(e,i)(s):n(s)}function i(s){return uv(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function l(s){return _e(s)?Te(e,o,"whitespace")(s):o(s)}function o(s){return s===null||xe(s)?t(s):n(s)}}const QN={name:"hardBreakEscape",tokenize:ZN};function ZN(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return xe(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const JN={name:"headingAtx",resolve:eC,tokenize:tC};function eC(e,t){let n=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Jt(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function tC(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),l(c)}function l(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||Ve(c)?(e.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||xe(c)?(e.exit("atxHeading"),t(c)):_e(c)?Te(e,s,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||Ve(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}const nC=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Mm=["pre","script","style","textarea"],rC={concrete:!0,name:"htmlFlow",resolveTo:oC,tokenize:sC},iC={partial:!0,tokenize:uC},lC={partial:!0,tokenize:aC};function oC(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function sC(e,t,n){const r=this;let i,l,o,s,a;return u;function u(C){return c(C)}function c(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),d}function d(C){return C===33?(e.consume(C),p):C===47?(e.consume(C),l=!0,v):C===63?(e.consume(C),i=3,r.interrupt?t:k):Lt(C)?(e.consume(C),o=String.fromCharCode(C),b):n(C)}function p(C){return C===45?(e.consume(C),i=2,h):C===91?(e.consume(C),i=5,s=0,x):Lt(C)?(e.consume(C),i=4,r.interrupt?t:k):n(C)}function h(C){return C===45?(e.consume(C),r.interrupt?t:k):n(C)}function x(C){const Z="CDATA[";return C===Z.charCodeAt(s++)?(e.consume(C),s===Z.length?r.interrupt?t:U:x):n(C)}function v(C){return Lt(C)?(e.consume(C),o=String.fromCharCode(C),b):n(C)}function b(C){if(C===null||C===47||C===62||Ve(C)){const Z=C===47,re=o.toLowerCase();return!Z&&!l&&Mm.includes(re)?(i=1,r.interrupt?t(C):U(C)):nC.includes(o.toLowerCase())?(i=6,Z?(e.consume(C),m):r.interrupt?t(C):U(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):l?g(C):w(C))}return C===45||Pt(C)?(e.consume(C),o+=String.fromCharCode(C),b):n(C)}function m(C){return C===62?(e.consume(C),r.interrupt?t:U):n(C)}function g(C){return _e(C)?(e.consume(C),g):_(C)}function w(C){return C===47?(e.consume(C),_):C===58||C===95||Lt(C)?(e.consume(C),S):_e(C)?(e.consume(C),w):_(C)}function S(C){return C===45||C===46||C===58||C===95||Pt(C)?(e.consume(C),S):j(C)}function j(C){return C===61?(e.consume(C),E):_e(C)?(e.consume(C),j):w(C)}function E(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),a=C,P):_e(C)?(e.consume(C),E):I(C)}function P(C){return C===a?(e.consume(C),a=null,L):C===null||xe(C)?n(C):(e.consume(C),P)}function I(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||Ve(C)?j(C):(e.consume(C),I)}function L(C){return C===47||C===62||_e(C)?w(C):n(C)}function _(C){return C===62?(e.consume(C),O):n(C)}function O(C){return C===null||xe(C)?U(C):_e(C)?(e.consume(C),O):n(C)}function U(C){return C===45&&i===2?(e.consume(C),R):C===60&&i===1?(e.consume(C),W):C===62&&i===4?(e.consume(C),H):C===63&&i===3?(e.consume(C),k):C===93&&i===5?(e.consume(C),A):xe(C)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(iC,F,B)(C)):C===null||xe(C)?(e.exit("htmlFlowData"),B(C)):(e.consume(C),U)}function B(C){return e.check(lC,N,F)(C)}function N(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),z}function z(C){return C===null||xe(C)?B(C):(e.enter("htmlFlowData"),U(C))}function R(C){return C===45?(e.consume(C),k):U(C)}function W(C){return C===47?(e.consume(C),o="",M):U(C)}function M(C){if(C===62){const Z=o.toLowerCase();return Mm.includes(Z)?(e.consume(C),H):U(C)}return Lt(C)&&o.length<8?(e.consume(C),o+=String.fromCharCode(C),M):U(C)}function A(C){return C===93?(e.consume(C),k):U(C)}function k(C){return C===62?(e.consume(C),H):C===45&&i===2?(e.consume(C),k):U(C)}function H(C){return C===null||xe(C)?(e.exit("htmlFlowData"),F(C)):(e.consume(C),H)}function F(C){return e.exit("htmlFlow"),t(C)}}function aC(e,t,n){const r=this;return i;function i(o){return xe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):n(o)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function uC(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Fo,t,n)}}const cC={name:"htmlText",tokenize:dC};function dC(e,t,n){const r=this;let i,l,o;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),a}function a(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),j):k===63?(e.consume(k),w):Lt(k)?(e.consume(k),I):n(k)}function u(k){return k===45?(e.consume(k),c):k===91?(e.consume(k),l=0,x):Lt(k)?(e.consume(k),g):n(k)}function c(k){return k===45?(e.consume(k),h):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),p):xe(k)?(o=d,W(k)):(e.consume(k),d)}function p(k){return k===45?(e.consume(k),h):d(k)}function h(k){return k===62?R(k):k===45?p(k):d(k)}function x(k){const H="CDATA[";return k===H.charCodeAt(l++)?(e.consume(k),l===H.length?v:x):n(k)}function v(k){return k===null?n(k):k===93?(e.consume(k),b):xe(k)?(o=v,W(k)):(e.consume(k),v)}function b(k){return k===93?(e.consume(k),m):v(k)}function m(k){return k===62?R(k):k===93?(e.consume(k),m):v(k)}function g(k){return k===null||k===62?R(k):xe(k)?(o=g,W(k)):(e.consume(k),g)}function w(k){return k===null?n(k):k===63?(e.consume(k),S):xe(k)?(o=w,W(k)):(e.consume(k),w)}function S(k){return k===62?R(k):w(k)}function j(k){return Lt(k)?(e.consume(k),E):n(k)}function E(k){return k===45||Pt(k)?(e.consume(k),E):P(k)}function P(k){return xe(k)?(o=P,W(k)):_e(k)?(e.consume(k),P):R(k)}function I(k){return k===45||Pt(k)?(e.consume(k),I):k===47||k===62||Ve(k)?L(k):n(k)}function L(k){return k===47?(e.consume(k),R):k===58||k===95||Lt(k)?(e.consume(k),_):xe(k)?(o=L,W(k)):_e(k)?(e.consume(k),L):R(k)}function _(k){return k===45||k===46||k===58||k===95||Pt(k)?(e.consume(k),_):O(k)}function O(k){return k===61?(e.consume(k),U):xe(k)?(o=O,W(k)):_e(k)?(e.consume(k),O):L(k)}function U(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,B):xe(k)?(o=U,W(k)):_e(k)?(e.consume(k),U):(e.consume(k),N)}function B(k){return k===i?(e.consume(k),i=void 0,z):k===null?n(k):xe(k)?(o=B,W(k)):(e.consume(k),B)}function N(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Ve(k)?L(k):(e.consume(k),N)}function z(k){return k===47||k===62||Ve(k)?L(k):n(k)}function R(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function W(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),M}function M(k){return _e(k)?Te(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):A(k)}function A(k){return e.enter("htmlTextData"),o(k)}}const pp={name:"labelEnd",resolveAll:mC,resolveTo:gC,tokenize:xC},fC={tokenize:yC},pC={tokenize:vC},hC={tokenize:wC};function mC(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Jt(e,0,e.length,n),e}function gC(e,t){let n=e.length,r=0,i,l,o,s;for(;n--;)if(i=e[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const a={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return s=[["enter",a,t],["enter",u,t]],s=an(s,e.slice(l+1,l+r+3)),s=an(s,[["enter",c,t]]),s=an(s,su(t.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),t)),s=an(s,[["exit",c,t],e[o-2],e[o-1],["exit",u,t]]),s=an(s,e.slice(o+1)),s=an(s,[["exit",a,t]]),Jt(e,l,e.length,s),e}function xC(e,t,n){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return s;function s(p){return l?l._inactive?d(p):(o=r.parser.defined.includes(Cn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),a):n(p)}function a(p){return p===40?e.attempt(fC,c,o?c:d)(p):p===91?e.attempt(pC,c,o?u:d)(p):o?c(p):d(p)}function u(p){return e.attempt(hC,c,d)(p)}function c(p){return t(p)}function d(p){return l._balanced=!0,n(p)}}function yC(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Ve(d)?to(e,l)(d):l(d)}function l(d){return d===41?c(d):sv(e,o,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return Ve(d)?to(e,a)(d):c(d)}function s(d){return n(d)}function a(d){return d===34||d===39||d===40?uv(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return Ve(d)?to(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function vC(e,t,n){const r=this;return i;function i(s){return av.call(r,e,l,o,"reference","referenceMarker","referenceString")(s)}function l(s){return r.parser.defined.includes(Cn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function o(s){return n(s)}}function wC(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const kC={name:"labelStartImage",resolveAll:pp.resolveAll,tokenize:bC};function bC(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),l}function l(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),o):n(s)}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const SC={name:"labelStartLink",resolveAll:pp.resolveAll,tokenize:EC};function EC(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const lc={name:"lineEnding",tokenize:NC};function NC(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Te(e,t,"linePrefix")}}const Vs={name:"thematicBreak",tokenize:CC};function CC(e,t,n){let r=0,i;return l;function l(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,s(u)}function s(u){return u===i?(e.enter("thematicBreakSequence"),a(u)):r>=3&&(u===null||xe(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),_e(u)?Te(e,s,"whitespace")(u):s(u))}}const $t={continuation:{tokenize:AC},exit:TC,name:"list",tokenize:PC},_C={partial:!0,tokenize:RC},jC={partial:!0,tokenize:IC};function PC(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(h){const x=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Ld(h)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Vs,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return Ld(h)&&++o<10?(e.consume(h),a):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Fo,r.interrupt?n:c,e.attempt(_C,p,d))}function c(h){return r.containerState.initialBlankLine=!0,l++,p(h)}function d(h){return _e(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function AC(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Fo,i,l);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Te(e,t,"listItemIndent",r.containerState.size+1)(s)}function l(s){return r.containerState.furtherBlankLines||!_e(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(jC,t,o)(s))}function o(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Te(e,e.attempt($t,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function IC(e,t,n){const r=this;return Te(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(l):n(l)}}function TC(e){e.exit(this.containerState.type)}function RC(e,t,n){const r=this;return Te(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!_e(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const zm={name:"setextUnderline",resolveTo:LC,tokenize:MC};function LC(e,t){let n=e.length,r,i,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function MC(e,t,n){const r=this;let i;return l;function l(u){let c=r.events.length,d;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){d=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),_e(u)?Te(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||xe(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const zC={tokenize:DC};function DC(e){const t=this,n=e.attempt(Fo,r,e.attempt(this.parser.constructs.flowInitial,i,Te(e,e.attempt(this.parser.constructs.flow,i,e.attempt(UN,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const OC={resolveAll:dv()},FC=cv("string"),$C=cv("text");function cv(e){return{resolveAll:dv(e==="text"?BC:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,o,s);return o;function o(c){return u(c)?l(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),l(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=i[c];let p=-1;if(d)for(;++p<d.length;){const h=d[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function dv(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function BC(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let l=i.length,o=-1,s=0,a;for(;l--;){const u=i[l];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(u===-2)a=!0,s++;else if(u!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const u={type:n===e.length||a||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const UC={42:$t,43:$t,45:$t,48:$t,49:$t,50:$t,51:$t,52:$t,53:$t,54:$t,55:$t,56:$t,57:$t,62:rv},VC={91:XN},HC={[-2]:ic,[-1]:ic,32:ic},WC={35:JN,42:Vs,45:[zm,Vs],60:rC,61:zm,95:Vs,96:Lm,126:Lm},YC={38:lv,92:iv},XC={[-5]:lc,[-4]:lc,[-3]:lc,33:kC,38:lv,42:Md,60:[SN,cC],91:SC,92:[QN,iv],93:pp,95:Md,96:zN},KC={null:[Md,OC]},GC={null:[42,95]},qC={null:[]},QC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:GC,contentInitial:VC,disable:qC,document:UC,flow:WC,flowInitial:HC,insideSpan:KC,string:YC,text:XC},Symbol.toStringTag,{value:"Module"}));function ZC(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let o=[],s=[];const a={attempt:P(j),check:P(E),consume:g,enter:w,exit:S,interrupt:P(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:x,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:d};let c=t.tokenize.call(u,a);return t.resolveAll&&l.push(t),u;function d(O){return o=an(o,O),b(),o[o.length-1]!==null?[]:(I(t,0),u.events=su(l,u.events,u),u.events)}function p(O,U){return e_(h(O),U)}function h(O){return JC(o,O)}function x(){const{_bufferIndex:O,_index:U,line:B,column:N,offset:z}=r;return{_bufferIndex:O,_index:U,line:B,column:N,offset:z}}function v(O){i[O.line]=O.column,_()}function b(){let O;for(;r._index<o.length;){const U=o[r._index];if(typeof U=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<U.length;)m(U.charCodeAt(r._bufferIndex));else m(U)}}function m(O){c=c(O)}function g(O){xe(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,_()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function w(O,U){const B=U||{};return B.type=O,B.start=x(),u.events.push(["enter",B,u]),s.push(B),B}function S(O){const U=s.pop();return U.end=x(),u.events.push(["exit",U,u]),U}function j(O,U){I(O,U.from)}function E(O,U){U.restore()}function P(O,U){return B;function B(N,z,R){let W,M,A,k;return Array.isArray(N)?F(N):"tokenize"in N?F([N]):H(N);function H(V){return ie;function ie(ae){const ge=ae!==null&&V[ae],ve=ae!==null&&V.null,Re=[...Array.isArray(ge)?ge:ge?[ge]:[],...Array.isArray(ve)?ve:ve?[ve]:[]];return F(Re)(ae)}}function F(V){return W=V,M=0,V.length===0?R:C(V[M])}function C(V){return ie;function ie(ae){return k=L(),A=V,V.partial||(u.currentConstruct=V),V.name&&u.parser.constructs.disable.null.includes(V.name)?re():V.tokenize.call(U?Object.assign(Object.create(u),U):u,a,Z,re)(ae)}}function Z(V){return O(A,k),z}function re(V){return k.restore(),++M<W.length?C(W[M]):R}}}function I(O,U){O.resolveAll&&!l.includes(O)&&l.push(O),O.resolve&&Jt(u.events,U,u.events.length-U,O.resolve(u.events.slice(U),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function L(){const O=x(),U=u.previous,B=u.currentConstruct,N=u.events.length,z=Array.from(s);return{from:N,restore:R};function R(){r=O,u.previous=U,u.currentConstruct=B,u.events.length=N,s=z,_()}}function _(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function JC(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,l)];else{if(o=e.slice(n,i),r>-1){const s=o[0];typeof s=="string"?o[0]=s.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function e_(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const l=e[n];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
|
|
69
|
+
`;break}case-3:{o=`\r
|
|
70
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(l)}i=l===-2,r.push(o)}return r.join("")}function t_(e){const r={constructs:tv([QC,...(e||{}).extensions||[]]),content:i(gN),defined:[],document:i(yN),flow:i(zC),lazy:{},string:i(FC),text:i($C)};return r;function i(l){return o;function o(s){return ZC(r,l,s)}}}function n_(e){for(;!ov(e););return e}const Dm=/[\0\t\n\r]/g;function r_(){let e=1,t="",n=!0,r;return i;function i(l,o,s){const a=[];let u,c,d,p,h;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),d=0,t="",n&&(l.charCodeAt(0)===65279&&d++,n=void 0);d<l.length;){if(Dm.lastIndex=d,u=Dm.exec(l),p=u&&u.index!==void 0?u.index:l.length,h=l.charCodeAt(p),!u){t=l.slice(d);break}if(h===10&&d===p&&r)a.push(-3),r=void 0;else switch(r&&(a.push(-5),r=void 0),d<p&&(a.push(l.slice(d,p)),e+=p-d),h){case 0:{a.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,a.push(-2);e++<c;)a.push(-1);break}case 10:{a.push(-4),e=1;break}default:r=!0,e=1}d=p+1}return s&&(r&&a.push(-5),t&&a.push(t),a.push(null)),a}}const i_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function l_(e){return e.replace(i_,o_)}function o_(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return nv(n.slice(l?2:1),l?16:10)}return fp(n)||e}const fv={}.hasOwnProperty;function s_(e,t,n){return typeof t!="string"&&(n=t,t=void 0),a_(n)(n_(t_(n).document().write(r_()(e,t,!0))))}function a_(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Fe),autolinkProtocol:L,autolinkEmail:L,atxHeading:l(Ie),blockQuote:l(ve),characterEscape:L,characterReference:L,codeFenced:l(Re),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(Re,o),codeText:l(Ae,o),codeTextData:L,data:L,codeFlowValue:L,definition:l(Be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(ze),hardBreakEscape:l(Oe),hardBreakTrailing:l(Oe),htmlFlow:l(Ne,o),htmlFlowData:L,htmlText:l(Ne,o),htmlTextData:L,image:l(ce),label:o,link:l(Fe),listItem:l(ft),listItemValue:p,listOrdered:l(it,d),listUnordered:l(it),paragraph:l(Et),reference:C,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Ie),strong:l(at),thematicBreak:l(q)},exit:{atxHeading:a(),atxHeadingSequence:j,autolink:a(),autolinkEmail:ge,autolinkProtocol:ae,blockQuote:a(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:V,characterReference:ie,codeFenced:a(b),codeFencedFence:v,codeFencedFenceInfo:h,codeFencedFenceMeta:x,codeFlowValue:_,codeIndented:a(m),codeText:a(z),codeTextData:_,data:_,definition:a(),definitionDestinationString:S,definitionLabelString:g,definitionTitleString:w,emphasis:a(),hardBreakEscape:a(U),hardBreakTrailing:a(U),htmlFlow:a(B),htmlFlowData:_,htmlText:a(N),htmlTextData:_,image:a(W),label:A,labelText:M,lineEnding:O,link:a(R),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:Z,resourceDestinationString:k,resourceTitleString:H,resource:F,setextHeading:a(I),setextHeadingLineSequence:P,setextHeadingText:E,strong:a(),thematicBreak:a()}};pv(t,(e||{}).mdastExtensions||[]);const n={};return r;function r($){let G={type:"root",children:[]};const le={stack:[G],tokenStack:[],config:t,enter:s,exit:u,buffer:o,resume:c,data:n},oe=[];let he=-1;for(;++he<$.length;)if($[he][1].type==="listOrdered"||$[he][1].type==="listUnordered")if($[he][0]==="enter")oe.push(he);else{const de=oe.pop();he=i($,de,he)}for(he=-1;++he<$.length;){const de=t[$[he][0]];fv.call(de,$[he][1].type)&&de[$[he][1].type].call(Object.assign({sliceSerialize:$[he][2].sliceSerialize},le),$[he][1])}if(le.tokenStack.length>0){const de=le.tokenStack[le.tokenStack.length-1];(de[1]||Om).call(le,void 0,de[0])}for(G.position={start:hr($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:hr($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)G=t.transforms[he](G)||G;return G}function i($,G,le){let oe=G-1,he=-1,de=!1,we,Pe,$e,qe;for(;++oe<=le;){const Ue=$[oe];switch(Ue[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ue[0]==="enter"?he++:he--,qe=void 0;break}case"lineEndingBlank":{Ue[0]==="enter"&&(we&&!qe&&!he&&!$e&&($e=oe),qe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qe=void 0}if(!he&&Ue[0]==="enter"&&Ue[1].type==="listItemPrefix"||he===-1&&Ue[0]==="exit"&&(Ue[1].type==="listUnordered"||Ue[1].type==="listOrdered")){if(we){let Y=oe;for(Pe=void 0;Y--;){const Ee=$[Y];if(Ee[1].type==="lineEnding"||Ee[1].type==="lineEndingBlank"){if(Ee[0]==="exit")continue;Pe&&($[Pe][1].type="lineEndingBlank",de=!0),Ee[1].type="lineEnding",Pe=Y}else if(!(Ee[1].type==="linePrefix"||Ee[1].type==="blockQuotePrefix"||Ee[1].type==="blockQuotePrefixWhitespace"||Ee[1].type==="blockQuoteMarker"||Ee[1].type==="listItemIndent"))break}$e&&(!Pe||$e<Pe)&&(we._spread=!0),we.end=Object.assign({},Pe?$[Pe][1].start:Ue[1].end),$.splice(Pe||oe,0,["exit",we,Ue[2]]),oe++,le++}if(Ue[1].type==="listItemPrefix"){const Y={type:"listItem",_spread:!1,start:Object.assign({},Ue[1].start),end:void 0};we=Y,$.splice(oe,0,["enter",Y,Ue[2]]),oe++,le++,$e=void 0,qe=!0}}}return $[G][1]._spread=de,le}function l($,G){return le;function le(oe){s.call(this,$(oe),oe),G&&G.call(this,oe)}}function o(){this.stack.push({type:"fragment",children:[]})}function s($,G,le){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([G,le||void 0]),$.position={start:hr(G.start),end:void 0}}function a($){return G;function G(le){$&&$.call(this,le),u.call(this,le)}}function u($,G){const le=this.stack.pop(),oe=this.tokenStack.pop();if(oe)oe[0].type!==$.type&&(G?G.call(this,$,oe[0]):(oe[1]||Om).call(this,$,oe[0]));else throw new Error("Cannot close `"+$.type+"` ("+eo({start:$.start,end:$.end})+"): it’s not open");le.position.end=hr($.end)}function c(){return dp(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p($){if(this.data.expectingFirstListItemValue){const G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function h(){const $=this.resume(),G=this.stack[this.stack.length-1];G.lang=$}function x(){const $=this.resume(),G=this.stack[this.stack.length-1];G.meta=$}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$.replace(/(\r?\n|\r)$/g,"")}function g($){const G=this.resume(),le=this.stack[this.stack.length-1];le.label=G,le.identifier=Cn(this.sliceSerialize($)).toLowerCase()}function w(){const $=this.resume(),G=this.stack[this.stack.length-1];G.title=$}function S(){const $=this.resume(),G=this.stack[this.stack.length-1];G.url=$}function j($){const G=this.stack[this.stack.length-1];if(!G.depth){const le=this.sliceSerialize($).length;G.depth=le}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function P($){const G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function L($){const le=this.stack[this.stack.length-1].children;let oe=le[le.length-1];(!oe||oe.type!=="text")&&(oe=pt(),oe.position={start:hr($.start),end:void 0},le.push(oe)),this.stack.push(oe)}function _($){const G=this.stack.pop();G.value+=this.sliceSerialize($),G.position.end=hr($.end)}function O($){const G=this.stack[this.stack.length-1];if(this.data.atHardBreak){const le=G.children[G.children.length-1];le.position.end=hr($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(G.type)&&(L.call(this,$),_.call(this,$))}function U(){this.data.atHardBreak=!0}function B(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$}function N(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$}function z(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$}function R(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=G,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function W(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=G,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function M($){const G=this.sliceSerialize($),le=this.stack[this.stack.length-2];le.label=l_(G),le.identifier=Cn(G).toLowerCase()}function A(){const $=this.stack[this.stack.length-1],G=this.resume(),le=this.stack[this.stack.length-1];if(this.data.inReference=!0,le.type==="link"){const oe=$.children;le.children=oe}else le.alt=G}function k(){const $=this.resume(),G=this.stack[this.stack.length-1];G.url=$}function H(){const $=this.resume(),G=this.stack[this.stack.length-1];G.title=$}function F(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function Z($){const G=this.resume(),le=this.stack[this.stack.length-1];le.label=G,le.identifier=Cn(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function re($){this.data.characterReferenceType=$.type}function V($){const G=this.sliceSerialize($),le=this.data.characterReferenceType;let oe;le?(oe=nv(G,le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=fp(G);const he=this.stack[this.stack.length-1];he.value+=oe}function ie($){const G=this.stack.pop();G.position.end=hr($.end)}function ae($){_.call(this,$);const G=this.stack[this.stack.length-1];G.url=this.sliceSerialize($)}function ge($){_.call(this,$);const G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize($)}function ve(){return{type:"blockquote",children:[]}}function Re(){return{type:"code",lang:null,meta:null,value:""}}function Ae(){return{type:"inlineCode",value:""}}function Be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function Ie(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function Ne(){return{type:"html",value:""}}function ce(){return{type:"image",title:null,url:"",alt:null}}function Fe(){return{type:"link",title:null,url:"",children:[]}}function it($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[]}}function ft($){return{type:"listItem",spread:$._spread,checked:null,children:[]}}function Et(){return{type:"paragraph",children:[]}}function at(){return{type:"strong",children:[]}}function pt(){return{type:"text",value:""}}function q(){return{type:"thematicBreak"}}}function hr(e){return{line:e.line,column:e.column,offset:e.offset}}function pv(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?pv(e,r):u_(e,r)}}function u_(e,t){let n;for(n in t)if(fv.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Om(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+eo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+eo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+eo({start:t.start,end:t.end})+") is still open")}function c_(e){const t=this;t.parser=n;function n(r){return s_(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function d_(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function f_(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
71
|
+
`}]}function p_(e,t){const n=t.value?t.value+`
|
|
72
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function h_(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function m_(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function g_(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=vl(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,s+=1,e.footnoteCounts.set(r,s);const a={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,u),e.applyData(t,u)}function x_(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function y_(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function hv(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function v_(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hv(e,t);const i={src:vl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function w_(e,t){const n={src:vl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function k_(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function b_(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hv(e,t);const i={href:vl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function S_(e,t){const n={href:vl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function E_(e,t,n){const r=e.all(t),i=n?N_(n):mv(t),l={},o=[];if(typeof t.checked=="boolean"){const c=r[0];let d;c&&c.type==="element"&&c.tagName==="p"?d=c:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const c=r[s];(i||s!==0||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
|
|
73
|
+
`}),c.type==="element"&&c.tagName==="p"&&!i?o.push(...c.children):o.push(c)}const a=r[r.length-1];a&&(i||a.type!=="element"||a.tagName!=="p")&&o.push({type:"text",value:`
|
|
74
|
+
`});const u={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,u),e.applyData(t,u)}function N_(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=mv(n[r])}return t}function mv(e){const t=e.spread;return t??e.children.length>1}function C_(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function __(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function j_(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function P_(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A_(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=sp(t.children[1]),a=Ky(t.children[t.children.length-1]);s&&a&&(o.position={start:s,end:a}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function I_(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,s=o?o.length:t.children.length;let a=-1;const u=[];for(;++a<s;){const d=t.children[a],p={},h=o?o[a]:void 0;h&&(p.align=h);let x={type:"element",tagName:l,properties:p,children:[]};d&&(x.children=e.all(d),e.patch(d,x),x=e.applyData(d,x)),u.push(x)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}function T_(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Fm=9,$m=32;function R_(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(Bm(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(Bm(t.slice(i),i>0,!1)),l.join("")}function Bm(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===Fm||l===$m;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===Fm||l===$m;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function L_(e,t){const n={type:"text",value:R_(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function M_(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const z_={blockquote:d_,break:f_,code:p_,delete:h_,emphasis:m_,footnoteReference:g_,heading:x_,html:y_,imageReference:v_,image:w_,inlineCode:k_,linkReference:b_,link:S_,listItem:E_,list:C_,paragraph:__,root:j_,strong:P_,table:A_,tableCell:T_,tableRow:I_,text:L_,thematicBreak:M_,toml:ys,yaml:ys,definition:ys,footnoteDefinition:ys};function ys(){}const gv=-1,au=0,no=1,Ca=2,hp=3,mp=4,gp=5,xp=6,xv=7,yv=8,Um=typeof self=="object"?self:globalThis,D_=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,o]=t[i];switch(l){case au:case gv:return n(o,i);case no:{const s=n([],i);for(const a of o)s.push(r(a));return s}case Ca:{const s=n({},i);for(const[a,u]of o)s[r(a)]=r(u);return s}case hp:return n(new Date(o),i);case mp:{const{source:s,flags:a}=o;return n(new RegExp(s,a),i)}case gp:{const s=n(new Map,i);for(const[a,u]of o)s.set(r(a),r(u));return s}case xp:{const s=n(new Set,i);for(const a of o)s.add(r(a));return s}case xv:{const{name:s,message:a}=o;return n(new Um[s](a),i)}case yv:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:s}=new Uint8Array(o);return n(new DataView(s),o)}}return n(new Um[l](o),i)};return r},Vm=e=>D_(new Map,e)(0),Ni="",{toString:O_}={},{keys:F_}=Object,Tl=e=>{const t=typeof e;if(t!=="object"||!e)return[au,t];const n=O_.call(e).slice(8,-1);switch(n){case"Array":return[no,Ni];case"Object":return[Ca,Ni];case"Date":return[hp,Ni];case"RegExp":return[mp,Ni];case"Map":return[gp,Ni];case"Set":return[xp,Ni];case"DataView":return[no,n]}return n.includes("Array")?[no,n]:n.includes("Error")?[xv,n]:[Ca,n]},vs=([e,t])=>e===au&&(t==="function"||t==="symbol"),$_=(e,t,n,r)=>{const i=(o,s)=>{const a=r.push(o)-1;return n.set(s,a),a},l=o=>{if(n.has(o))return n.get(o);let[s,a]=Tl(o);switch(s){case au:{let c=o;switch(a){case"bigint":s=yv,c=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);c=null;break;case"undefined":return i([gv],o)}return i([s,c],o)}case no:{if(a){let p=o;return a==="DataView"?p=new Uint8Array(o.buffer):a==="ArrayBuffer"&&(p=new Uint8Array(o)),i([a,[...p]],o)}const c=[],d=i([s,c],o);for(const p of o)c.push(l(p));return d}case Ca:{if(a)switch(a){case"BigInt":return i([a,o.toString()],o);case"Boolean":case"Number":case"String":return i([a,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());const c=[],d=i([s,c],o);for(const p of F_(o))(e||!vs(Tl(o[p])))&&c.push([l(p),l(o[p])]);return d}case hp:return i([s,o.toISOString()],o);case mp:{const{source:c,flags:d}=o;return i([s,{source:c,flags:d}],o)}case gp:{const c=[],d=i([s,c],o);for(const[p,h]of o)(e||!(vs(Tl(p))||vs(Tl(h))))&&c.push([l(p),l(h)]);return d}case xp:{const c=[],d=i([s,c],o);for(const p of o)(e||!vs(Tl(p)))&&c.push(l(p));return d}}const{message:u}=o;return i([s,{name:a,message:u}],o)};return l},Hm=(e,{json:t,lossy:n}={})=>{const r=[];return $_(!(t||n),!!t,new Map,r)(e),r},_a=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Vm(Hm(e,t)):structuredClone(e):(e,t)=>Vm(Hm(e,t));function B_(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function U_(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function V_(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||B_,r=e.options.footnoteBackLabel||U_,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[a]);if(!u)continue;const c=e.all(u),d=String(u.identifier).toUpperCase(),p=vl(d.toLowerCase());let h=0;const x=[],v=e.footnoteCounts.get(d);for(;v!==void 0&&++h<=v;){x.length>0&&x.push({type:"text",value:" "});let g=typeof n=="string"?n:n(a,h);typeof g=="string"&&(g={type:"text",value:g}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,h),className:["data-footnote-backref"]},children:Array.isArray(g)?g:[g]})}const b=c[c.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const g=b.children[b.children.length-1];g&&g.type==="text"?g.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...x)}else c.push(...x);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(c,!0)};e.patch(u,m),s.push(m)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{..._a(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
75
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
|
|
76
|
+
`}]}}const uu=function(e){if(e==null)return X_;if(typeof e=="function")return cu(e);if(typeof e=="object")return Array.isArray(e)?H_(e):W_(e);if(typeof e=="string")return Y_(e);throw new Error("Expected function, string, or object as test")};function H_(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=uu(e[n]);return cu(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function W_(e){const t=e;return cu(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function Y_(e){return cu(t);function t(n){return n&&n.type===e}}function cu(e){return t;function t(n,r,i){return!!(K_(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function X_(){return!0}function K_(e){return e!==null&&typeof e=="object"&&"type"in e}const vv=[],G_=!0,zd=!1,q_="skip";function wv(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const l=uu(i),o=r?-1:1;s(e,void 0,[])();function s(a,u,c){const d=a&&typeof a=="object"?a:{};if(typeof d.type=="string"){const h=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(a.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=vv,x,v,b;if((!t||l(a,u,c[c.length-1]||void 0))&&(h=Q_(n(a,c)),h[0]===zd))return h;if("children"in a&&a.children){const m=a;if(m.children&&h[0]!==q_)for(v=(r?m.children.length:-1)+o,b=c.concat(m);v>-1&&v<m.children.length;){const g=m.children[v];if(x=s(g,v,b)(),x[0]===zd)return x;v=typeof x[1]=="number"?x[1]:v+o}}return h}}}function Q_(e){return Array.isArray(e)?e:typeof e=="number"?[G_,e]:e==null?vv:[e]}function yp(e,t,n,r){let i,l,o;typeof t=="function"&&typeof n!="function"?(l=void 0,o=t,i=n):(l=t,o=n,i=r),wv(e,l,s,i);function s(a,u){const c=u[u.length-1],d=c?c.children.indexOf(a):void 0;return o(a,d,c)}}const Dd={}.hasOwnProperty,Z_={};function J_(e,t){const n=t||Z_,r=new Map,i=new Map,l=new Map,o={...z_,...n.handlers},s={all:u,applyData:tj,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:a,options:n,patch:ej,wrap:rj};return yp(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const d=c.type==="definition"?r:i,p=String(c.identifier).toUpperCase();d.has(p)||d.set(p,c)}}),s;function a(c,d){const p=c.type,h=s.handlers[p];if(Dd.call(s.handlers,p)&&h)return h(s,c,d);if(s.options.passThrough&&s.options.passThrough.includes(p)){if("children"in c){const{children:v,...b}=c,m=_a(b);return m.children=s.all(c),m}return _a(c)}return(s.options.unknownHandler||nj)(s,c,d)}function u(c){const d=[];if("children"in c){const p=c.children;let h=-1;for(;++h<p.length;){const x=s.one(p[h],c);if(x){if(h&&p[h-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=Wm(x.value)),!Array.isArray(x)&&x.type==="element")){const v=x.children[0];v&&v.type==="text"&&(v.value=Wm(v.value))}Array.isArray(x)?d.push(...x):d.push(x)}}}return d}}function ej(e,t){e.position&&(t.position=UE(e))}function tj(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&l&&Object.assign(n.properties,_a(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function nj(e,t){const n=t.data||{},r="value"in t&&!(Dd.call(n,"hProperties")||Dd.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function rj(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
77
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
78
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
79
|
+
`}),n}function Wm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ym(e,t){const n=J_(e,t),r=n.one(e,void 0),i=V_(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
|
|
80
|
+
`},i),l}function ij(e,t){return e&&"run"in e?async function(n,r){const i=Ym(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Ym(n,{file:r,...e||t})}}function Xm(e){if(e)throw e}var Hs=Object.prototype.hasOwnProperty,kv=Object.prototype.toString,Km=Object.defineProperty,Gm=Object.getOwnPropertyDescriptor,qm=function(t){return typeof Array.isArray=="function"?Array.isArray(t):kv.call(t)==="[object Array]"},Qm=function(t){if(!t||kv.call(t)!=="[object Object]")return!1;var n=Hs.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Hs.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Hs.call(t,i)},Zm=function(t,n){Km&&n.name==="__proto__"?Km(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Jm=function(t,n){if(n==="__proto__")if(Hs.call(t,n)){if(Gm)return Gm(t,n).value}else return;return t[n]},lj=function e(){var t,n,r,i,l,o,s=arguments[0],a=1,u=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},a=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});a<u;++a)if(t=arguments[a],t!=null)for(n in t)r=Jm(s,n),i=Jm(t,n),s!==i&&(c&&i&&(Qm(i)||(l=qm(i)))?(l?(l=!1,o=r&&qm(r)?r:[]):o=r&&Qm(r)?r:{},Zm(s,{name:n,newValue:e(c,o,i)})):typeof i<"u"&&Zm(s,{name:n,newValue:i}));return s};const oc=Fa(lj);function Od(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function oj(){const e=[],t={run:n,use:r};return t;function n(...i){let l=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);s(null,...i);function s(a,...u){const c=e[++l];let d=-1;if(a){o(a);return}for(;++d<i.length;)(u[d]===null||u[d]===void 0)&&(u[d]=i[d]);i=u,c?sj(c,s)(...u):o(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function sj(e,t){let n;return r;function r(...o){const s=e.length>o.length;let a;s&&o.push(i);try{a=e.apply(this,o)}catch(u){const c=u;if(s&&n)throw c;return i(c)}s||(a&&a.then&&typeof a.then=="function"?a.then(l,i):a instanceof Error?i(a):l(a))}function i(o,...s){n||(n=!0,t(o,...s))}function l(o){i(null,o)}}const Mn={basename:aj,dirname:uj,extname:cj,join:dj,sep:"/"};function aj(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');$o(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else o<0&&(l=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function uj(e){if($o(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function cj(e){$o(e);let t=e.length,n=-1,r=0,i=-1,l=0,o;for(;t--;){const s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function dj(...e){let t=-1,n;for(;++t<e.length;)$o(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":fj(n)}function fj(e){$o(e);const t=e.codePointAt(0)===47;let n=pj(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pj(e,t){let n="",r=0,i=-1,l=0,o=-1,s,a;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else{if(s===47)break;s=47}if(s===47){if(!(i===o-1||l===1))if(i!==o-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),r=n.length-1-n.lastIndexOf("/")),i=o,l=0;continue}}else if(n.length>0){n="",r=0,i=o,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,l=0}else s===46&&l>-1?l++:l=-1}return n}function $o(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const hj={cwd:mj};function mj(){return"/"}function Fd(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function gj(e){if(typeof e=="string")e=new URL(e);else if(!Fd(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return xj(e)}function xj(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const sc=["history","path","basename","stem","extname","dirname"];class bv{constructor(t){let n;t?Fd(t)?n={path:t}:typeof t=="string"||yj(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":hj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<sc.length;){const l=sc[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)sc.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Mn.basename(this.path):void 0}set basename(t){uc(t,"basename"),ac(t,"basename"),this.path=Mn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mn.dirname(this.path):void 0}set dirname(t){eg(this.basename,"dirname"),this.path=Mn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mn.extname(this.path):void 0}set extname(t){if(ac(t,"extname"),eg(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Mn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Fd(t)&&(t=gj(t)),uc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mn.basename(this.path,this.extname):void 0}set stem(t){uc(t,"stem"),ac(t,"stem"),this.path=Mn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new It(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ac(e,t){if(e&&e.includes(Mn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mn.sep+"`")}function uc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function eg(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function yj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vj=function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},wj={}.hasOwnProperty;class vp extends vj{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=oj()}copy(){const t=new vp;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(oc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(fc("data",this.frozen),this.namespace[t]=n,this):wj.call(this.namespace,t)&&this.namespace[t]||void 0:t?(fc("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ws(t),r=this.parser||this.Parser;return cc("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),cc("process",this.parser||this.Parser),dc("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,o){const s=ws(t),a=r.parse(s);r.run(a,s,function(c,d,p){if(c||!d||!p)return u(c);const h=d,x=r.stringify(h,p);Sj(x)?p.value=x:p.result=x,u(c,p)});function u(c,d){c||!d?o(c):l?l(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),cc("processSync",this.parser||this.Parser),dc("processSync",this.compiler||this.Compiler),this.process(t,i),ng("processSync","process",n),r;function i(l,o){n=!0,Xm(l),r=o}}run(t,n,r){tg(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(o,s){const a=ws(n);i.run(t,a,u);function u(c,d,p){const h=d||t;c?s(c):o?o(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),ng("runSync","run",r),i;function l(o,s){Xm(o),i=s,r=!0}}stringify(t,n){this.freeze();const r=ws(n),i=this.compiler||this.Compiler;return dc("stringify",i),tg(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(fc("use",this.frozen),t!=null)if(typeof t=="function")a(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(u){if(typeof u=="function")a(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...d]=u;a(c,d)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(u.plugins),u.settings&&(i.settings=oc(!0,i.settings,u.settings))}function s(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const d=u[c];l(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function a(u,c){let d=-1,p=-1;for(;++d<r.length;)if(r[d][0]===u){p=d;break}if(p===-1)r.push([u,...c]);else if(c.length>0){let[h,...x]=c;const v=r[p][1];Od(v)&&Od(h)&&(h=oc(!0,v,h)),r[p]=[u,h,...x]}}}}const kj=new vp().freeze();function cc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function fc(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function tg(e){if(!Od(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ng(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ws(e){return bj(e)?e:new bv(e)}function bj(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Sj(e){return typeof e=="string"||Ej(e)}function Ej(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Nj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",rg=[],ig={allowDangerousHtml:!0},Cj=/^(https?|ircs?|mailto|xmpp)$/i,_j=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function jj(e){const t=Pj(e),n=Aj(e);return Ij(t.runSync(t.parse(n),n),e)}function Pj(e){const t=e.rehypePlugins||rg,n=e.remarkPlugins||rg,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ig}:ig;return kj().use(c_).use(n).use(ij,r).use(t)}function Aj(e){const t=e.children||"",n=new bv;return typeof t=="string"&&(n.value=t),n}function Ij(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,l=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||Tj;for(const c of _j)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+Nj+c.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),yp(e,u),XE(e,{Fragment:f.Fragment,components:i,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function u(c,d,p){if(c.type==="raw"&&p&&typeof d=="number")return o?p.children.splice(d,1):p.children[d]={type:"text",value:c.value},d;if(c.type==="element"){let h;for(h in rc)if(Object.hasOwn(rc,h)&&Object.hasOwn(c.properties,h)){const x=c.properties[h],v=rc[h];(v===null||v.includes(c.tagName))&&(c.properties[h]=a(String(x||""),h,c))}}if(c.type==="element"){let h=n?!n.includes(c.tagName):l?l.includes(c.tagName):!1;if(!h&&r&&typeof d=="number"&&(h=!r(c,d,p)),h&&p&&typeof d=="number")return s&&c.children?p.children.splice(d,1,...c.children):p.children.splice(d,1),d}}}function Tj(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Cj.test(e.slice(0,t))?e:""}function lg(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Rj(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Lj(e,t,n){const i=uu((n||{}).ignore||[]),l=Mj(t);let o=-1;for(;++o<l.length;)wv(e,"text",s);function s(u,c){let d=-1,p;for(;++d<c.length;){const h=c[d],x=p?p.children:void 0;if(i(h,x?x.indexOf(h):void 0,p))return;p=h}if(p)return a(u,c)}function a(u,c){const d=c[c.length-1],p=l[o][0],h=l[o][1];let x=0;const b=d.children.indexOf(u);let m=!1,g=[];p.lastIndex=0;let w=p.exec(u.value);for(;w;){const S=w.index,j={index:w.index,input:w.input,stack:[...c,u]};let E=h(...w,j);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?p.lastIndex=S+1:(x!==S&&g.push({type:"text",value:u.value.slice(x,S)}),Array.isArray(E)?g.push(...E):E&&g.push(E),x=S+w[0].length,m=!0),!p.global)break;w=p.exec(u.value)}return m?(x<u.value.length&&g.push({type:"text",value:u.value.slice(x)}),d.children.splice(b,1,...g)):g=[u],b+g.length}}function Mj(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([zj(i[0]),Dj(i[1])])}return t}function zj(e){return typeof e=="string"?new RegExp(Rj(e),"g"):e}function Dj(e){return typeof e=="function"?e:function(){return e}}const pc="phrasing",hc=["autolink","link","image","label"];function Oj(){return{transforms:[Wj],enter:{literalAutolink:$j,literalAutolinkEmail:mc,literalAutolinkHttp:mc,literalAutolinkWww:mc},exit:{literalAutolink:Hj,literalAutolinkEmail:Vj,literalAutolinkHttp:Bj,literalAutolinkWww:Uj}}}function Fj(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:pc,notInConstruct:hc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:pc,notInConstruct:hc},{character:":",before:"[ps]",after:"\\/",inConstruct:pc,notInConstruct:hc}]}}function $j(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mc(e){this.config.enter.autolinkProtocol.call(this,e)}function Bj(e){this.config.exit.autolinkProtocol.call(this,e)}function Uj(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Vj(e){this.config.exit.autolinkEmail.call(this,e)}function Hj(e){this.exit(e)}function Wj(e){Lj(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Yj],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Xj]],{ignore:["link","linkReference"]})}function Yj(e,t,n,r,i){let l="";if(!Sv(i)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!Kj(n)))return!1;const o=Gj(n+r);if(!o[0])return!1;const s={type:"link",title:null,url:l+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function Xj(e,t,n,r){return!Sv(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Kj(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Gj(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=lg(e,"(");let l=lg(e,")");for(;r!==-1&&i>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function Sv(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||mi(n)||ou(n))&&(!t||n!==47)}Ev.peek=i3;function qj(){this.buffer()}function Qj(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Zj(){this.buffer()}function Jj(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function e3(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function t3(e){this.exit(e)}function n3(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function r3(e){this.exit(e)}function i3(){return"["}function Ev(e,t,n,r){const i=n.createTracker(r);let l=i.move("[^");const o=n.enter("footnoteReference"),s=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),s(),o(),l+=i.move("]"),l}function l3(){return{enter:{gfmFootnoteCallString:qj,gfmFootnoteCall:Qj,gfmFootnoteDefinitionLabelString:Zj,gfmFootnoteDefinition:Jj},exit:{gfmFootnoteCallString:e3,gfmFootnoteCall:t3,gfmFootnoteDefinitionLabelString:n3,gfmFootnoteDefinition:r3}}}function o3(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ev},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,o){const s=l.createTracker(o);let a=s.move("[^");const u=l.enter("footnoteDefinition"),c=l.enter("label");return a+=s.move(l.safe(l.associationId(r),{before:a,after:"]"})),c(),a+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),a+=s.move((t?`
|
|
81
|
+
`:" ")+l.indentLines(l.containerFlow(r,s.current()),t?Nv:s3))),u(),a}}function s3(e,t,n){return t===0?e:Nv(e,t,n)}function Nv(e,t,n){return(n?"":" ")+e}const a3=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Cv.peek=p3;function u3(){return{canContainEols:["delete"],enter:{strikethrough:d3},exit:{strikethrough:f3}}}function c3(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:a3}],handlers:{delete:Cv}}}function d3(e){this.enter({type:"delete",children:[]},e)}function f3(e){this.exit(e)}function Cv(e,t,n,r){const i=n.createTracker(r),l=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),l(),o}function p3(){return"~"}function h3(e){return e.length}function m3(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||h3,l=[],o=[],s=[],a=[];let u=0,c=-1;for(;++c<e.length;){const v=[],b=[];let m=-1;for(e[c].length>u&&(u=e[c].length);++m<e[c].length;){const g=g3(e[c][m]);if(n.alignDelimiters!==!1){const w=i(g);b[m]=w,(a[m]===void 0||w>a[m])&&(a[m]=w)}v.push(g)}o[c]=v,s[c]=b}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<u;)l[d]=og(r[d]);else{const v=og(r);for(;++d<u;)l[d]=v}d=-1;const p=[],h=[];for(;++d<u;){const v=l[d];let b="",m="";v===99?(b=":",m=":"):v===108?b=":":v===114&&(m=":");let g=n.alignDelimiters===!1?1:Math.max(1,a[d]-b.length-m.length);const w=b+"-".repeat(g)+m;n.alignDelimiters!==!1&&(g=b.length+g+m.length,g>a[d]&&(a[d]=g),h[d]=g),p[d]=w}o.splice(1,0,p),s.splice(1,0,h),c=-1;const x=[];for(;++c<o.length;){const v=o[c],b=s[c];d=-1;const m=[];for(;++d<u;){const g=v[d]||"";let w="",S="";if(n.alignDelimiters!==!1){const j=a[d]-(b[d]||0),E=l[d];E===114?w=" ".repeat(j):E===99?j%2?(w=" ".repeat(j/2+.5),S=" ".repeat(j/2-.5)):(w=" ".repeat(j/2),S=w):S=" ".repeat(j)}n.delimiterStart!==!1&&!d&&m.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&g==="")&&(n.delimiterStart!==!1||d)&&m.push(" "),n.alignDelimiters!==!1&&m.push(w),m.push(g),n.alignDelimiters!==!1&&m.push(S),n.padding!==!1&&m.push(" "),(n.delimiterEnd!==!1||d!==u-1)&&m.push("|")}x.push(n.delimiterEnd===!1?m.join("").replace(/ +$/,""):m.join(""))}return x.join(`
|
|
82
|
+
`)}function g3(e){return e==null?"":String(e)}function og(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function x3(e,t,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const o=n.indentLines(n.containerFlow(e,l.current()),y3);return i(),o}function y3(e,t,n){return">"+(n?"":" ")+e}function v3(e,t){return sg(e,t.inConstruct,!0)&&!sg(e,t.notInConstruct,!1)}function sg(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function ag(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
83
|
+
`&&v3(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
84
|
+
`}function w3(e,t){const n=String(e);let r=n.indexOf(t),i=r,l=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>o&&(o=l):l=1,i=r+t.length,r=n.indexOf(t,i);return o}function k3(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function b3(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function S3(e,t,n,r){const i=b3(n),l=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(k3(e,n)){const d=n.enter("codeIndented"),p=n.indentLines(l,E3);return d(),p}const s=n.createTracker(r),a=i.repeat(Math.max(w3(l,i)+1,3)),u=n.enter("codeFenced");let c=s.move(a);if(e.lang){const d=n.enter(`codeFencedLang${o}`);c+=s.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...s.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);c+=s.move(" "),c+=s.move(n.safe(e.meta,{before:c,after:`
|
|
85
|
+
`,encode:["`"],...s.current()})),d()}return c+=s.move(`
|
|
86
|
+
`),l&&(c+=s.move(l+`
|
|
87
|
+
`)),c+=s.move(a),u(),c}function E3(e,t,n){return(n?"":" ")+e}function wp(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function N3(e,t,n,r){const i=wp(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("[");return u+=a.move(n.safe(n.associationId(e),{before:u,after:"]",...a.current()})),u+=a.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(s=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
88
|
+
`,...a.current()}))),s(),e.title&&(s=n.enter(`title${l}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),s()),o(),u}function C3(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Eo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ja(e,t,n){const r=al(e),i=al(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}_v.peek=_3;function _v(e,t,n,r){const i=C3(n),l=n.enter("emphasis"),o=n.createTracker(r),s=o.move(i);let a=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()}));const u=a.charCodeAt(0),c=ja(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(a=Eo(u)+a.slice(1));const d=a.charCodeAt(a.length-1),p=ja(r.after.charCodeAt(0),d,i);p.inside&&(a=a.slice(0,-1)+Eo(d));const h=o.move(i);return l(),n.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},s+a+h}function _3(e,t,n){return n.options.emphasis||"*"}function j3(e,t){let n=!1;return yp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,zd}),!!((!e.depth||e.depth<3)&&dp(e)&&(t.options.setext||n))}function P3(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(j3(e,n)){const c=n.enter("headingSetext"),d=n.enter("phrasing"),p=n.containerPhrasing(e,{...l.current(),before:`
|
|
89
|
+
`,after:`
|
|
90
|
+
`});return d(),c(),p+`
|
|
91
|
+
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
92
|
+
`))+1))}const o="#".repeat(i),s=n.enter("headingAtx"),a=n.enter("phrasing");l.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
93
|
+
`,...l.current()});return/^[\t ]/.test(u)&&(u=Eo(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),a(),s(),u}jv.peek=A3;function jv(e){return e.value||""}function A3(){return"<"}Pv.peek=I3;function Pv(e,t,n,r){const i=wp(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("![");return u+=a.move(n.safe(e.alt,{before:u,after:"]",...a.current()})),u+=a.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(s=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),s(),e.title&&(s=n.enter(`title${l}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),s()),u+=a.move(")"),o(),u}function I3(){return"!"}Av.peek=T3;function Av(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let o=n.enter("label");const s=n.createTracker(r);let a=s.move("![");const u=n.safe(e.alt,{before:a,after:"]",...s.current()});a+=s.move(u+"]["),o();const c=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:a,after:"]",...s.current()});return o(),n.stack=c,l(),i==="full"||!u||u!==d?a+=s.move(d+"]"):i==="shortcut"?a=a.slice(0,-1):a+=s.move("]"),a}function T3(){return"!"}Iv.peek=R3;function Iv(e,t,n){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const o=n.unsafe[l],s=n.compilePattern(o);let a;if(o.atBreak)for(;a=s.exec(r);){let u=a.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(a.index+1)}}return i+r+i}function R3(){return"`"}function Tv(e,t){const n=dp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Rv.peek=L3;function Rv(e,t,n,r){const i=wp(n),l=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let s,a;if(Tv(e,n)){const c=n.stack;n.stack=[],s=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),s(),n.stack=c,d}s=n.enter("link"),a=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(a=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),a(),e.title&&(a=n.enter(`title${l}`),u+=o.move(" "+i),u+=o.move(n.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),a()),u+=o.move(")"),s(),u}function L3(e,t,n){return Tv(e,n)?"<":"["}Lv.peek=M3;function Lv(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let o=n.enter("label");const s=n.createTracker(r);let a=s.move("[");const u=n.containerPhrasing(e,{before:a,after:"]",...s.current()});a+=s.move(u+"]["),o();const c=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:a,after:"]",...s.current()});return o(),n.stack=c,l(),i==="full"||!u||u!==d?a+=s.move(d+"]"):i==="shortcut"?a=a.slice(0,-1):a+=s.move("]"),a}function M3(){return"["}function kp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function z3(e){const t=kp(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function D3(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Mv(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function O3(e,t,n,r){const i=n.enter("list"),l=n.bulletCurrent;let o=e.ordered?D3(n):kp(n);const s=e.ordered?o==="."?")":".":z3(n);let a=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const c=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(a=!0),Mv(n)===o&&c){let d=-1;for(;++d<e.children.length;){const p=e.children[d];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){a=!0;break}}}}a&&(o=s),n.bulletCurrent=o;const u=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=l,i(),u}function F3(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function $3(e,t,n,r){const i=F3(n);let l=n.bulletCurrent||kp(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let o=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const s=n.createTracker(r);s.move(l+" ".repeat(o-l.length)),s.shift(o);const a=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,s.current()),c);return a(),u;function c(d,p,h){return p?(h?"":" ".repeat(o))+d:(h?l:l+" ".repeat(o-l.length))+d}}function B3(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,r);return l(),i(),o}const U3=uu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function V3(e,t,n,r){return(e.children.some(function(o){return U3(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function H3(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}zv.peek=W3;function zv(e,t,n,r){const i=H3(n),l=n.enter("strong"),o=n.createTracker(r),s=o.move(i+i);let a=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()}));const u=a.charCodeAt(0),c=ja(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(a=Eo(u)+a.slice(1));const d=a.charCodeAt(a.length-1),p=ja(r.after.charCodeAt(0),d,i);p.inside&&(a=a.slice(0,-1)+Eo(d));const h=o.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},s+a+h}function W3(e,t,n){return n.options.strong||"*"}function Y3(e,t,n,r){return n.safe(e.value,r)}function X3(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function K3(e,t,n){const r=(Mv(n)+(n.options.ruleSpaces?" ":"")).repeat(X3(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Dv={blockquote:x3,break:ag,code:S3,definition:N3,emphasis:_v,hardBreak:ag,heading:P3,html:jv,image:Pv,imageReference:Av,inlineCode:Iv,link:Rv,linkReference:Lv,list:O3,listItem:$3,paragraph:B3,root:V3,strong:zv,text:Y3,thematicBreak:K3};function G3(){return{enter:{table:q3,tableData:ug,tableHeader:ug,tableRow:Z3},exit:{codeText:J3,table:Q3,tableData:gc,tableHeader:gc,tableRow:gc}}}function q3(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Q3(e){this.exit(e),this.data.inTable=void 0}function Z3(e){this.enter({type:"tableRow",children:[]},e)}function gc(e){this.exit(e)}function ug(e){this.enter({type:"tableCell",children:[]},e)}function J3(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,e4));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function e4(e,t){return t==="|"?t:e}function t4(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
94
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:o,tableCell:a,tableRow:s}};function o(h,x,v,b){return u(c(h,v,b),h.align)}function s(h,x,v,b){const m=d(h,v,b),g=u([m]);return g.slice(0,g.indexOf(`
|
|
95
|
+
`))}function a(h,x,v,b){const m=v.enter("tableCell"),g=v.enter("phrasing"),w=v.containerPhrasing(h,{...b,before:l,after:l});return g(),m(),w}function u(h,x){return m3(h,{align:x,alignDelimiters:r,padding:n,stringLength:i})}function c(h,x,v){const b=h.children;let m=-1;const g=[],w=x.enter("table");for(;++m<b.length;)g[m]=d(b[m],x,v);return w(),g}function d(h,x,v){const b=h.children;let m=-1;const g=[],w=x.enter("tableRow");for(;++m<b.length;)g[m]=a(b[m],h,x,v);return w(),g}function p(h,x,v){let b=Dv.inlineCode(h,x,v);return v.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function n4(){return{exit:{taskListCheckValueChecked:cg,taskListCheckValueUnchecked:cg,paragraph:i4}}}function r4(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:l4}}}function cg(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function i4(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let l=-1,o;for(;++l<i.length;){const s=i[l];if(s.type==="paragraph"){o=s;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function l4(e,t,n,r){const i=e.children[0],l=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);l&&s.move(o);let a=Dv.listItem(e,t,n,{...r,...s.current()});return l&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),a;function u(c){return c+o}}function o4(){return[Oj(),l3(),u3(),G3(),n4()]}function s4(e){return{extensions:[Fj(),o3(e),c3(),t4(e),r4()]}}const a4={tokenize:h4,partial:!0},Ov={tokenize:m4,partial:!0},Fv={tokenize:g4,partial:!0},$v={tokenize:x4,partial:!0},u4={tokenize:y4,partial:!0},Bv={name:"wwwAutolink",tokenize:f4,previous:Vv},Uv={name:"protocolAutolink",tokenize:p4,previous:Hv},lr={name:"emailAutolink",tokenize:d4,previous:Wv},$n={};function c4(){return{text:$n}}let Gr=48;for(;Gr<123;)$n[Gr]=lr,Gr++,Gr===58?Gr=65:Gr===91&&(Gr=97);$n[43]=lr;$n[45]=lr;$n[46]=lr;$n[95]=lr;$n[72]=[lr,Uv];$n[104]=[lr,Uv];$n[87]=[lr,Bv];$n[119]=[lr,Bv];function d4(e,t,n){const r=this;let i,l;return o;function o(d){return!$d(d)||!Wv.call(r,r.previous)||bp(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(d))}function s(d){return $d(d)?(e.consume(d),s):d===64?(e.consume(d),a):n(d)}function a(d){return d===46?e.check(u4,c,u)(d):d===45||d===95||Pt(d)?(l=!0,e.consume(d),a):c(d)}function u(d){return e.consume(d),i=!0,a}function c(d){return l&&i&&Lt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function f4(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!Vv.call(r,r.previous)||bp(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(a4,e.attempt(Ov,e.attempt(Fv,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function p4(e,t,n){const r=this;let i="",l=!1;return o;function o(d){return(d===72||d===104)&&Hv.call(r,r.previous)&&!bp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),s):n(d)}function s(d){if(Lt(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),s;if(d===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(d),a}return n(d)}function a(d){return d===47?(e.consume(d),l?u:(l=!0,a)):n(d)}function u(d){return d===null||Na(d)||Ve(d)||mi(d)||ou(d)?n(d):e.attempt(Ov,e.attempt(Fv,c),n)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function h4(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),l):n(o)}function l(o){return o===null?n(o):t(o)}}function m4(e,t,n){let r,i,l;return o;function o(u){return u===46||u===95?e.check($v,a,s)(u):u===null||Ve(u)||mi(u)||u!==45&&ou(u)?a(u):(l=!0,e.consume(u),o)}function s(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),o}function a(u){return i||r||!l?n(u):t(u)}}function g4(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?l(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check($v,t,l)(o):o===null||Ve(o)||mi(o)?t(o):(e.consume(o),i)}function l(o){return o===41&&r++,e.consume(o),i}}function x4(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),l):s===93?(e.consume(s),i):s===60||s===null||Ve(s)||mi(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||Ve(s)||mi(s)?t(s):r(s)}function l(s){return Lt(s)?o(s):n(s)}function o(s){return s===59?(e.consume(s),r):Lt(s)?(e.consume(s),o):n(s)}}function y4(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return Pt(l)?n(l):t(l)}}function Vv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ve(e)}function Hv(e){return!Lt(e)}function Wv(e){return!(e===47||$d(e))}function $d(e){return e===43||e===45||e===46||e===95||Pt(e)}function bp(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const v4={tokenize:_4,partial:!0};function w4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:E4,continuation:{tokenize:N4},exit:C4}},text:{91:{name:"gfmFootnoteCall",tokenize:S4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:k4,resolveTo:b4}}}}function k4(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const a=r.events[i][1];if(a.type==="labelImage"){o=a;break}if(a.type==="gfmFootnoteCall"||a.type==="labelLink"||a.type==="label"||a.type==="image"||a.type==="link")break}return s;function s(a){if(!o||!o._balanced)return n(a);const u=Cn(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!l.includes(u.slice(1))?n(a):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),t(a))}}function b4(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function S4(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,o;return s;function s(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),a}function a(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(l>999||d===93&&!o||d===null||d===91||Ve(d))return n(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(Cn(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Ve(d)||(o=!0),l++,e.consume(d),d===92?c:u}function c(d){return d===91||d===92||d===93?(e.consume(d),l++,u):u(d)}}function E4(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,o=0,s;return a;function a(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(x)}function c(x){if(o>999||x===93&&!s||x===null||x===91||Ve(x))return n(x);if(x===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return l=Cn(r.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Ve(x)||(s=!0),o++,e.consume(x),x===92?d:c}function d(x){return x===91||x===92||x===93?(e.consume(x),o++,c):c(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),i.includes(l)||i.push(l),Te(e,h,"gfmFootnoteDefinitionWhitespace")):n(x)}function h(x){return t(x)}}function N4(e,t,n){return e.check(Fo,t,e.attempt(v4,t,n))}function C4(e){e.exit("gfmFootnoteDefinition")}function _4(e,t,n){const r=this;return Te(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(l):n(l)}}function j4(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,s){let a=-1;for(;++a<o.length;)if(o[a][0]==="enter"&&o[a][1].type==="strikethroughSequenceTemporary"&&o[a][1]._close){let u=a;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[a][1].end.offset-o[a][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[a][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[a][1].end)},d={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[a][1].start)},p=[["enter",c,s],["enter",o[u][1],s],["exit",o[u][1],s],["enter",d,s]],h=s.parser.constructs.insideSpan.null;h&&Jt(p,p.length,0,su(h,o.slice(u+1,a),s)),Jt(p,p.length,0,[["exit",d,s],["enter",o[a][1],s],["exit",o[a][1],s],["exit",c,s]]),Jt(o,u-1,a-u+3,p),a=u+p.length-2;break}}for(a=-1;++a<o.length;)o[a][1].type==="strikethroughSequenceTemporary"&&(o[a][1].type="data");return o}function l(o,s,a){const u=this.previous,c=this.events;let d=0;return p;function p(x){return u===126&&c[c.length-1][1].type!=="characterEscape"?a(x):(o.enter("strikethroughSequenceTemporary"),h(x))}function h(x){const v=al(u);if(x===126)return d>1?a(x):(o.consume(x),d++,h);if(d<2&&!n)return a(x);const b=o.exit("strikethroughSequenceTemporary"),m=al(x);return b._open=!m||m===2&&!!v,b._close=!v||v===2&&!!m,s(x)}}}class P4{constructor(){this.map=[]}add(t,n,r){A4(this,t,n,r)}consume(t){if(this.map.sort(function(l,o){return l[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0}}function A4(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function I4(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function T4(){return{flow:{null:{name:"table",tokenize:R4,resolveAll:L4}}}}function R4(e,t,n){const r=this;let i=0,l=0,o;return s;function s(_){let O=r.events.length-1;for(;O>-1;){const N=r.events[O][1].type;if(N==="lineEnding"||N==="linePrefix")O--;else break}const U=O>-1?r.events[O][1].type:null,B=U==="tableHead"||U==="tableRow"?E:a;return B===E&&r.parser.lazy[r.now().line]?n(_):B(_)}function a(_){return e.enter("tableHead"),e.enter("tableRow"),u(_)}function u(_){return _===124||(o=!0,l+=1),c(_)}function c(_){return _===null?n(_):xe(_)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),h):n(_):_e(_)?Te(e,c,"whitespace")(_):(l+=1,o&&(o=!1,i+=1),_===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),o=!0,c):(e.enter("data"),d(_)))}function d(_){return _===null||_===124||Ve(_)?(e.exit("data"),c(_)):(e.consume(_),_===92?p:d)}function p(_){return _===92||_===124?(e.consume(_),d):d(_)}function h(_){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(_):(e.enter("tableDelimiterRow"),o=!1,_e(_)?Te(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):x(_))}function x(_){return _===45||_===58?b(_):_===124?(o=!0,e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),v):j(_)}function v(_){return _e(_)?Te(e,b,"whitespace")(_):b(_)}function b(_){return _===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),m):_===45?(l+=1,m(_)):_===null||xe(_)?S(_):j(_)}function m(_){return _===45?(e.enter("tableDelimiterFiller"),g(_)):j(_)}function g(_){return _===45?(e.consume(_),g):_===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(_))}function w(_){return _e(_)?Te(e,S,"whitespace")(_):S(_)}function S(_){return _===124?x(_):_===null||xe(_)?!o||i!==l?j(_):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(_)):j(_)}function j(_){return n(_)}function E(_){return e.enter("tableRow"),P(_)}function P(_){return _===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),P):_===null||xe(_)?(e.exit("tableRow"),t(_)):_e(_)?Te(e,P,"whitespace")(_):(e.enter("data"),I(_))}function I(_){return _===null||_===124||Ve(_)?(e.exit("data"),P(_)):(e.consume(_),_===92?L:I)}function L(_){return _===92||_===124?(e.consume(_),I):I(_)}}function L4(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],o=[0,0,0,0],s=!1,a=0,u,c,d;const p=new P4;for(;++n<e.length;){const h=e[n],x=h[1];h[0]==="enter"?x.type==="tableHead"?(s=!1,a!==0&&(dg(p,t,a,u,c),c=void 0,a=0),u={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},p.add(n,0,[["enter",u,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,d=void 0,l=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,c={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},p.add(n,0,[["enter",c,t]])),i=x.type==="tableDelimiterRow"?2:c?3:1):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],d=ks(p,t,l,i,void 0,d),l=[0,0,0,0]),o[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(o[0]=o[1],d=ks(p,t,l,i,void 0,d)),l=o,o=[l[1],n,0,0])):x.type==="tableHead"?(s=!0,a=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(a=n,l[1]!==0?(o[0]=o[1],d=ks(p,t,l,i,n,d)):o[1]!==0&&(d=ks(p,t,o,i,n,d)),i=0):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(o[3]=n)}for(a!==0&&dg(p,t,a,u,c),p.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=I4(t.events,n))}return e}function ks(e,t,n,r,i,l){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(l.end=Object.assign({},Ai(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const a=Ai(t.events,n[1]);if(l={type:o,start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const u=Ai(t.events,n[2]),c=Ai(t.events,n[3]),d={type:s,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const p=t.events[n[2]],h=t.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,v=n[3]-n[2]-1;e.add(x,v,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(l.end=Object.assign({},Ai(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function dg(e,t,n,r,i){const l=[],o=Ai(t.events,n);i&&(i.end=Object.assign({},o),l.push(["exit",i,t])),r.end=Object.assign({},o),l.push(["exit",r,t]),e.add(n+1,0,l)}function Ai(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const M4={name:"tasklistCheck",tokenize:D4};function z4(){return{text:{91:M4}}}function D4(e,t,n){const r=this;return i;function i(a){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(a):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),l)}function l(a){return Ve(a)?(e.enter("taskListCheckValueUnchecked"),e.consume(a),e.exit("taskListCheckValueUnchecked"),o):a===88||a===120?(e.enter("taskListCheckValueChecked"),e.consume(a),e.exit("taskListCheckValueChecked"),o):n(a)}function o(a){return a===93?(e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(a)}function s(a){return xe(a)?t(a):_e(a)?e.check({tokenize:O4},t,n)(a):n(a)}}function O4(e,t,n){return Te(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function F4(e){return tv([c4(),w4(),j4(e),T4(),z4()])}const $4={};function B4(e){const t=this,n=e||$4,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(F4(n)),l.push(o4()),o.push(s4(n))}function U4(e){var n;const t=[];if(!e)return t;for(let r=0;r<e.length;r+=1){const i=e[r];if(!i||i.kind!=="file"||!i.type.startsWith("image/"))continue;const l=(n=i.getAsFile)==null?void 0:n.call(i);l&&t.push(l)}return t}function V4(e){switch(e){case"idle":return"Play";case"pending":return"Pending";case"loading":return"Loading";case"playing":return"Stop";default:return"Play"}}function fg(e){if(!e||typeof e.dataUrl!="string")return{playable:!1,reason:"Audio source missing."};const t=e.dataUrl.trim();if(!t)return{playable:!1,reason:"Audio source missing."};if(e.size===0)return{playable:!1,reason:"Audio data is empty."};const n=t.toLowerCase();if(n.startsWith("blob:"))return{playable:!1,reason:"Audio was generated for a live session and is no longer available."};if(n.startsWith("data:audio/")){const[,r]=t.split(",",2);return!r||r.trim().length===0?{playable:!1,reason:"Audio data was not stored."}:{playable:!0}}return n.startsWith("http://")||n.startsWith("https://")?{playable:!0}:{playable:!1,reason:"Audio source is not available."}}const H4=({toolEvents:e,activeCount:t,variant:n="panel"})=>{const r=[...e].sort((o,s)=>{const a=o.startedAt??0,u=s.startedAt??0;return a-u}),i=n==="panel",l=n==="panel"?"rounded-2xl border border-white/10 bg-slate-900/60 p-4":"space-y-2";return f.jsxs("section",{className:l,children:[i?f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("h3",{className:"text-sm font-semibold text-slate-200",children:"Tool activity"}),f.jsx("p",{className:"text-xs text-slate-400",children:t>0?`${t} tool${t===1?"":"s"} running`:"Recent tool calls"})]}),f.jsx("span",{className:"pill",children:r.length})]}):null,f.jsx("div",{className:i?"mt-3 space-y-2":"space-y-2",children:r.map(o=>f.jsx(W4,{event:o},o.id))})]})},W4=({event:e})=>{const t=e.status==="running"?"Running":e.status==="error"?"Error":"Completed",n=e.status==="running"?"border-amber-400/40 bg-amber-500/12 text-amber-200":e.status==="error"?"border-rose-400/40 bg-rose-500/15 text-rose-200":"border-sky-400/40 bg-sky-500/12 text-sky-300",r=pg(e.args),i=pg(e.error?{error:e.error}:e.output);return f.jsxs("details",{className:"rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2",children:[f.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-semibold text-slate-100",children:e.name}),e.startedAt?f.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-slate-400",children:Y4(e.startedAt)}):null]}),f.jsx("span",{className:`rounded-full border px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.2em] ${n}`,children:t})]}),f.jsxs("div",{className:"mt-3 space-y-3 text-xs text-slate-300",children:[r?f.jsxs("div",{children:[f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Args"}),f.jsx("pre",{className:"mt-2 max-h-32 overflow-auto rounded-lg border border-white/10 bg-slate-900/60 p-2 text-[11px] text-slate-300",children:r})]}):null,i?f.jsxs("div",{children:[f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:e.error?"Error":"Output"}),f.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-lg border border-white/10 bg-slate-900/60 p-2 text-[11px] text-slate-300",children:i})]}):null]})]})};function pg(e){if(e==null)return null;let t;if(typeof e=="string")t=e;else try{t=JSON.stringify(e,null,2)}catch{t=String(e)}return t.length>800?`${t.slice(0,800)}...`:t}function Y4(e){if(!e)return"--";try{return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}catch{return"--"}}const X4=({thinkingEvents:e,toolEvents:t,isStreaming:n})=>{const r=[...e].sort((u,c)=>u.updatedAt-c.updatedAt),i=t.filter(u=>u.status==="running").length,l=r.length>0,o=t.length>0,s=[];l&&s.push(`${r.length} subagent${r.length===1?"":"s"}`),o&&s.push(`${t.length} tool${t.length===1?"":"s"}`),i>0&&s.push(`${i} running`);const a=s.length>0?s.join(" • "):"Activity";return f.jsxs("details",{className:"rounded-2xl border border-sky-400/40 bg-sky-500/10 px-4 py-3 text-sm text-slate-200 shadow-[0_10px_18px_rgba(18,14,12,0.08)]",defaultOpen:n&&(l||i>0),children:[f.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] text-slate-400",children:"Thinking"}),f.jsx("span",{className:"text-xs text-slate-400",children:a})]}),f.jsx("div",{className:"flex items-center gap-2 text-[10px] uppercase tracking-[0.18em] text-slate-400",children:n?f.jsxs("span",{className:"flex items-center gap-1",children:[f.jsx("span",{className:"h-2 w-2 animate-pulse rounded-full bg-sky-400"}),f.jsx("span",{children:"Streaming"})]}):f.jsx("span",{children:"Idle"})})]}),f.jsxs("div",{className:"mt-3 space-y-3",children:[l?f.jsx("div",{className:"space-y-2",children:r.map(u=>f.jsxs("details",{className:"rounded-xl border border-white/10 bg-slate-900/60 px-3 py-2",children:[f.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-semibold text-slate-100",children:u.node?u.node:"Subagent"}),f.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-slate-400",children:K4(u.updatedAt)})]}),f.jsx("span",{className:"rounded-full border border-sky-400/40 bg-sky-500/12 px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.2em] text-sky-300",children:"Insight"})]}),f.jsx("div",{className:"mt-3 whitespace-pre-wrap text-xs text-slate-300",children:u.content})]},u.id))}):null,o?f.jsx("div",{className:"rounded-xl border border-white/10 bg-slate-900/60 px-3 py-2",children:f.jsx(H4,{toolEvents:t,activeCount:i,variant:"inline"})}):null]})]})};function K4(e){if(!e)return"--";try{return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}catch{return"--"}}const G4=["Summarize the latest updates in this thread.","Draft a plan of attack for the next task.","List open questions we need to resolve."],q4=({activeThread:e,prompt:t,attachments:n,attachmentError:r,isStreaming:i,connected:l,loading:o,voiceAutoEnabled:s,voicePlayback:a,onToggleVoiceAuto:u,onSpeakVoice:c,onStopVoice:d,onPromptChange:p,onSendPrompt:h,onAddAttachments:x,onRemoveAttachment:v,onClearAttachments:b,onClearChat:m,onOpenCommandDeck:g})=>{const w=y.useRef(null),S=y.useRef(null),j=y.useRef(!0),E=y.useRef(null),P=y.useRef(null),I=y.useRef([]),L=y.useRef(null),_=y.useRef(0),O=y.useRef(!1),U=y.useRef(null),B=y.useRef(null),N=y.useRef(null),z=y.useRef(null),[R,W]=y.useState(null),[M,A]=y.useState(!1),[k,H]=y.useState(0),[F,C]=y.useState(""),[Z,re]=y.useState(0),V=y.useRef(null);y.useEffect(()=>{a.status==="idle"?V.current=null:a.messageId&&(V.current=a.messageId)},[a.messageId,a.status]);const ie=l&&!i&&!M&&(t.trim()||n.length>0);y.useEffect(()=>{const q=w.current;q&&j.current&&(q.scrollTop=q.scrollHeight)},[]),y.useEffect(()=>{j.current=!0},[]),y.useEffect(()=>{if(!R)return;const q=$=>{$.key==="Escape"&&W(null)};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[R]),y.useEffect(()=>()=>{if(O.current=!0,L.current!==null&&(window.clearInterval(L.current),L.current=null),ge(),E.current&&E.current.state!=="inactive"&&E.current.stop(),P.current){for(const q of P.current.getTracks())q.stop();P.current=null}},[]);const ae=q=>{ge();const $=window.AudioContext||window.webkitAudioContext;if(!$)return;const G=new $,le=G.createAnalyser();le.fftSize=256,G.createMediaStreamSource(q).connect(le);const he=new Uint8Array(le.fftSize);U.current=G,B.current=le,N.current=he;const de=()=>{if(!B.current||!N.current)return;B.current.getByteTimeDomainData(N.current);let we=0;for(let $e=0;$e<N.current.length;$e+=1){const qe=(N.current[$e]-128)/128;we+=qe*qe}const Pe=Math.sqrt(we/N.current.length);re(Pe),z.current=window.requestAnimationFrame(de)};z.current=window.requestAnimationFrame(de)},ge=()=>{z.current!==null&&(window.cancelAnimationFrame(z.current),z.current=null),U.current&&(U.current.close(),U.current=null),B.current=null,N.current=null,re(0)},ve=async()=>{var q;if(!(M||i)){if(C(""),O.current=!1,!((q=navigator.mediaDevices)!=null&&q.getUserMedia)||typeof MediaRecorder>"u"){C("Audio recording is not supported in this browser.");return}try{const $=await navigator.mediaDevices.getUserMedia({audio:!0}),G=J4(),le=new MediaRecorder($,G?{mimeType:G}:void 0);P.current=$,E.current=le,I.current=[],ae($),le.ondataavailable=oe=>{oe.data&&oe.data.size>0&&I.current.push(oe.data)},le.onerror=()=>{C("Recording failed.")},le.onstop=()=>{if(O.current){Ae();return}const oe=new Blob(I.current,{type:le.mimeType||"audio/webm"});if(!oe||oe.size===0){C("No audio captured."),Ae();return}const he=eP(oe.type||le.mimeType),de=`voice-${new Date().toISOString().replace(/[:.]/g,"-")}.${he}`,we=new File([oe],de,{type:oe.type||le.mimeType||"audio/webm"});x([we]),Ae()},le.start(),_.current=Date.now(),A(!0),H(0),L.current=window.setInterval(()=>{H(Date.now()-_.current)},250)}catch{C("Microphone access was denied."),Ae()}}},Re=()=>{L.current!==null&&(window.clearInterval(L.current),L.current=null),A(!1),ge();const q=E.current;q&&q.state!=="inactive"&&q.stop()},Ae=()=>{if(L.current!==null&&(window.clearInterval(L.current),L.current=null),ge(),P.current){for(const q of P.current.getTracks())q.stop();P.current=null}E.current=null,I.current=[],A(!1),H(0)},Be=q=>{if(q.key==="Enter"&&!q.shiftKey){if(q.preventDefault(),M)return;h()}},ze=()=>{var q;(q=S.current)==null||q.click()},Ie=q=>{x(q.target.files),q.target&&(q.target.value="")},Oe=q=>{var oe,he;if(i)return;const $=(oe=q.clipboardData)==null?void 0:oe.items,G=U4($);if(G.length===0)return;q.preventDefault(),x(G);const le=(he=q.clipboardData)==null?void 0:he.getData("text/plain");le&&p(`${t}${le}`)},Ne=()=>{const q=w.current;if(!q)return;const $=40,G=q.scrollHeight-q.scrollTop-q.clientHeight;j.current=G<=$},ce=y.useMemo(()=>{if(e)for(let q=e.messages.length-1;q>=0;q-=1){const $=e.messages[q];if($.role==="assistant")return $.id}},[e]),Fe=(e==null?void 0:e.toolEvents)||[],it=(e==null?void 0:e.thinkingEvents)||[],ft=Math.min(1,Z*4),Et=M?`0 0 ${8+ft*18}px rgba(248, 113, 113, ${.25+ft*.45})`:void 0,at=a.messageId||V.current,pt=!!e;return f.jsxs("section",{className:"panel-card animate-rise flex h-[calc(100vh-120px)] min-h-[1200px] flex-col gap-4 p-4 sm:gap-6 sm:p-6",children:[f.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-4",children:[f.jsxs("div",{children:[f.jsx("h2",{className:"text-lg font-semibold",children:"Mission Stream"}),f.jsxs("p",{className:"mt-1 text-sm text-slate-400",children:["Thread:"," ",f.jsx("span",{className:"font-semibold text-slate-200",children:(e==null?void 0:e.name)||"--"})]})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("button",{className:`button-secondary ${s?"border-sky-400/60 text-sky-200":""}`,onClick:u,type:"button",disabled:!pt,children:s?"Voice: Auto":"Voice: Off"}),f.jsx("button",{className:"button-secondary",onClick:m,type:"button",children:"Clear"})]})]}),f.jsx("div",{ref:w,onScroll:Ne,className:"flex-1 min-h-0 space-y-4 overflow-auto rounded-2xl border border-white/10 bg-gradient-to-b from-slate-950/80 to-slate-900/80 p-3 sm:p-4",children:o?f.jsx("div",{className:"grid h-full place-items-center text-sm text-slate-400",children:"Loading messages..."}):!e||e.messages.length===0?f.jsx("div",{className:"grid h-full place-items-center text-sm text-slate-400",children:f.jsxs("div",{className:"max-w-sm text-center",children:[f.jsx("p",{className:"text-base font-semibold text-slate-200",children:"Launch a new mission."}),f.jsx("p",{className:"mt-2 text-sm text-slate-400",children:"Send a prompt to begin, or pick a quick prompt below to shape the session."})]})}):e.messages.map(q=>{const $=q.id===ce&&(Fe.length>0||it.length>0),G=q.toolEvents&&q.toolEvents.length>0?q.toolEvents:$?Fe:[],le=q.thinkingEvents&&q.thinkingEvents.length>0?q.thinkingEvents:$?it:[],oe=q.role==="assistant"&&(G.length>0||le.length>0),he=q.role==="assistant"&&i&&q.id===ce;return f.jsx("div",{className:`flex ${q.role==="user"?"justify-end":"justify-start"}`,children:f.jsxs("div",{className:`w-fit max-w-[90%] rounded-2xl border px-4 py-3 text-sm leading-relaxed shadow-[0_10px_18px_rgba(18,14,12,0.08)] sm:max-w-[78%] ${q.role==="user"?"border-white/10 bg-slate-950/60 text-slate-100":"border-sky-400/40 bg-sky-500/10 text-slate-100"}`,children:[f.jsxs("div",{className:"flex items-center justify-between gap-4 text-[10px] uppercase tracking-[0.18em] text-slate-400",children:[f.jsx("span",{children:q.role==="user"?"You":"Wingman"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"whitespace-nowrap",children:Q4(q.createdAt)}),q.role==="assistant"&&q.content?(()=>{const de=at===q.id?a.status:"idle",we=V4(de),Pe=de==="pending"||de==="loading",$e=de==="playing";return f.jsxs("button",{type:"button",onClick:()=>at===q.id&&a.status!=="idle"?d():(()=>{V.current=q.id,c(q.id,q.content)})(),className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[9px] uppercase tracking-[0.12em] transition hover:border-sky-400/60 hover:text-sky-100 ${Pe?"border-sky-400/40 text-sky-100":$e?"border-emerald-400/60 bg-emerald-500/15 text-emerald-100":"border-white/10 text-slate-300"}`,children:[Pe?f.jsx(j2,{className:`h-3 w-3 ${de==="pending"?"animate-pulse":"animate-spin"}`}):de==="playing"?f.jsx(pm,{className:"h-3 w-3 animate-pulse"}):f.jsx(M2,{className:"h-3 w-3"}),f.jsx("span",{children:we}),$e?f.jsxs("span",{className:"flex items-end gap-0.5",children:[f.jsx("span",{className:"h-2 w-0.5 animate-pulse rounded-full bg-emerald-200/80"}),f.jsx("span",{className:"h-3 w-0.5 animate-pulse rounded-full bg-emerald-200/80 [animation-delay:120ms]"}),f.jsx("span",{className:"h-2 w-0.5 animate-pulse rounded-full bg-emerald-200/80 [animation-delay:240ms]"})]}):null]})})():null]})]}),q.role==="assistant"&&!q.content?f.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs uppercase tracking-[0.18em] text-slate-400",children:[f.jsx("span",{className:"h-2 w-2 animate-pulse rounded-full bg-sky-400"}),f.jsx("span",{className:"h-2 w-2 animate-pulse rounded-full bg-sky-400 [animation-delay:150ms]"}),f.jsx("span",{className:"h-2 w-2 animate-pulse rounded-full bg-sky-400 [animation-delay:300ms]"})]}):f.jsx(jj,{remarkPlugins:[B4],className:"markdown-content mt-2 text-sm leading-relaxed",components:{a:({node:de,...we})=>f.jsx("a",{...we,className:"text-sky-300 underline decoration-sky-400/40 underline-offset-4",target:"_blank",rel:"noreferrer"}),code:({node:de,inline:we,className:Pe,children:$e,...qe})=>we?f.jsx("code",{...qe,className:"rounded bg-white/10 px-1 py-0.5 text-[0.85em]",children:$e}):f.jsx("pre",{className:"mt-3 overflow-auto rounded-lg border border-white/10 bg-slate-900/60 p-3 text-xs",children:f.jsx("code",{...qe,className:Pe,children:$e})}),ul:({node:de,...we})=>f.jsx("ul",{...we,className:"ml-5 list-disc space-y-1"}),ol:({node:de,...we})=>f.jsx("ol",{...we,className:"ml-5 list-decimal space-y-1"}),blockquote:({node:de,...we})=>f.jsx("blockquote",{...we,className:"border-l-2 border-sky-400/60 pl-3 text-slate-300"})},children:q.content}),q.attachments&&q.attachments.length>0?f.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:q.attachments.map(de=>{const we=hg(de),Pe=we?fg(de):null;return f.jsx("div",{className:"overflow-hidden rounded-xl border border-white/10 bg-slate-950/50",children:we?f.jsxs("div",{className:"p-4",children:[Pe!=null&&Pe.playable?f.jsx("audio",{controls:!0,src:de.dataUrl,className:"w-full min-w-[200px] max-w-[360px] sm:min-w-[240px]"}):f.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-dashed border-amber-400/40 bg-amber-500/10 px-3 py-2 text-xs text-amber-100",children:[f.jsx(fm,{className:"h-4 w-4"}),f.jsxs("div",{children:[f.jsx("div",{className:"font-semibold",children:"Audio unavailable"}),f.jsx("div",{className:"text-[11px] text-amber-200/80",children:(Pe==null?void 0:Pe.reason)||"Audio was not stored for this session."})]})]}),de.name?f.jsx("div",{className:"mt-2 truncate text-[11px] text-slate-400",children:de.name}):null]}):f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"group relative block w-full",onClick:()=>W(de),children:[f.jsx("img",{src:de.dataUrl,alt:de.name||"Attachment",className:"h-36 w-full cursor-zoom-in object-cover transition duration-200 group-hover:scale-[1.02]",loading:"lazy"}),f.jsx("span",{className:"pointer-events-none absolute inset-0 bg-black/0 transition group-hover:bg-white/5"})]}),de.name?f.jsx("div",{className:"truncate border-t border-white/10 px-2 py-1 text-[11px] text-slate-400",children:de.name}):null]})},de.id)})}):null,oe?f.jsx("div",{className:"mt-3",children:f.jsx(X4,{thinkingEvents:le,toolEvents:G,isStreaming:he})}):null]})},q.id)})}),f.jsxs("div",{className:"rounded-2xl border border-white/10 bg-slate-900/60 p-3 sm:p-4",children:[l?null:f.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-amber-400/40 bg-amber-500/15 px-3 py-2 text-xs text-amber-200",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-semibold",children:"Gateway not connected."})," Open the Command Deck to connect before sending prompts."]}),f.jsx("button",{className:"button-secondary px-3 py-1 text-xs",type:"button",onClick:g,children:"Open Command Deck"})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("label",{htmlFor:"prompt-textarea",className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Prompt"}),f.jsxs("div",{className:"flex items-center gap-3 text-xs text-slate-400",children:[f.jsx("button",{type:"button",className:"button-secondary px-3 py-2 text-xs",onClick:ze,disabled:i,children:"Add Media"}),f.jsxs("button",{type:"button","aria-pressed":M,"aria-label":M?"Stop recording":"Record audio",className:`relative flex h-9 w-9 items-center justify-center rounded-full border text-xs transition ${M?"border-rose-400/60 bg-rose-500/20 text-rose-100":"border-white/10 bg-slate-900/70 text-slate-100"}`,style:Et?{boxShadow:Et}:void 0,onClick:M?Re:ve,disabled:i,children:[M?f.jsx(pm,{size:16}):f.jsx(I2,{size:16}),M?f.jsx("span",{className:"pointer-events-none absolute inset-0 rounded-full border border-rose-400/40 animate-ping"}):null,M?f.jsxs("span",{className:"pointer-events-none absolute -bottom-2 left-1/2 flex -translate-x-1/2 items-end gap-0.5",children:[f.jsx("span",{className:"w-1 rounded-full bg-rose-300/80 transition-all",style:{height:`${6+ft*10}px`}}),f.jsx("span",{className:"w-1 rounded-full bg-rose-200/80 transition-all",style:{height:`${4+ft*14}px`}}),f.jsx("span",{className:"w-1 rounded-full bg-rose-300/80 transition-all",style:{height:`${6+ft*8}px`}})]}):null]}),M?f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-rose-200",children:Z4(k)}):null,f.jsx("input",{ref:S,type:"file",accept:"image/*,audio/*",multiple:!0,className:"hidden",onChange:Ie})]})]}),n.length>0?f.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[n.map(q=>{const $=hg(q),G=$?fg(q):null;return f.jsxs("div",{className:"group relative flex items-center gap-2 overflow-hidden rounded-xl border border-white/10 bg-slate-900/60 pr-2 text-xs",children:[$?f.jsx("div",{className:"flex items-center gap-2 px-2 py-1",children:G!=null&&G.playable?f.jsx("audio",{controls:!0,src:q.dataUrl,className:"h-8 w-[200px] min-w-[180px]"}):f.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-amber-400/40 bg-amber-500/10 px-2 py-1 text-[11px] text-amber-100",children:[f.jsx(fm,{className:"h-3 w-3"}),f.jsx("span",{children:"Audio unavailable"})]})}):f.jsx("button",{type:"button",className:"h-12 w-12 cursor-zoom-in p-0",onClick:()=>W(q),children:f.jsx("img",{src:q.dataUrl,alt:q.name||"Attachment",className:"h-full w-full object-cover"})}),f.jsx("span",{className:"max-w-[160px] truncate text-slate-300",children:q.name||($?"Audio":"Image")}),f.jsx("button",{type:"button",className:"text-slate-400 transition hover:text-rose-500",onClick:()=>v(q.id),children:"×"})]},q.id)}),f.jsx("button",{type:"button",className:"text-xs text-slate-400 underline decoration-slate-300 underline-offset-4",onClick:b,children:"Clear all"})]}):null,r?f.jsx("div",{className:"mt-2 text-xs text-rose-500",children:r}):null,F?f.jsx("div",{className:"mt-2 text-xs text-rose-500",children:F}):null,f.jsx("textarea",{id:"prompt-textarea",className:"mt-2 w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-3 text-sm focus:shadow-glow",rows:3,value:t,onChange:q=>p(q.target.value),onKeyDown:Be,onPaste:Oe,placeholder:"Ask Wingman to do something...",disabled:i}),f.jsxs("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-3",children:[f.jsx("div",{className:"flex flex-wrap items-center gap-2",children:G4.map(q=>f.jsx("button",{type:"button",className:"rounded-full border border-white/10 bg-slate-900/60 px-3 py-1 text-xs text-slate-300 transition hover:border-sky-400/50",onClick:()=>p(q),children:q},q))}),f.jsx("div",{className:"flex items-center gap-3 text-xs text-slate-400",children:f.jsx("button",{className:"button-primary",onClick:h,type:"button",disabled:!ie,children:"Send Prompt"})})]})]}),R?f.jsx("div",{role:"button",tabIndex:0,className:"fixed inset-0 z-50 grid place-items-center bg-black/70 p-6",onClick:()=>W(null),onKeyDown:q=>{(q.key==="Enter"||q.key===" ")&&W(null)},children:f.jsxs("div",{role:"dialog","aria-modal":"true",className:"max-h-[90vh] max-w-[90vw] overflow-hidden rounded-2xl bg-slate-950 shadow-2xl",onClick:q=>q.stopPropagation(),onKeyDown:q=>q.stopPropagation(),children:[f.jsx("img",{src:R.dataUrl,alt:R.name||"Attachment preview",className:"max-h-[85vh] max-w-[90vw] object-contain"}),f.jsxs("div",{className:"flex items-center justify-between gap-4 border-t border-white/10 px-4 py-2 text-xs text-slate-400",children:[f.jsx("span",{className:"truncate",children:R.name||"Image preview"}),f.jsx("button",{type:"button",className:"text-slate-400 transition hover:text-slate-300",onClick:()=>W(null),children:"Close"})]})]})}):null]})};function Q4(e){if(!e)return"--";try{return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}catch{return"--"}}function Z4(e){const t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/60),r=t%60;return n>0?`${n}:${String(r).padStart(2,"0")}`:`0:${String(r).padStart(2,"0")}`}function hg(e){var t,n;return!!(e.kind==="audio"||(t=e.mimeType)!=null&&t.startsWith("audio/")||(n=e.dataUrl)!=null&&n.startsWith("data:audio/"))}function J4(){if(typeof MediaRecorder>"u")return;const e=["audio/webm;codecs=opus","audio/ogg;codecs=opus","audio/webm","audio/ogg","audio/mp4"];for(const t of e)if(MediaRecorder.isTypeSupported(t))return t}function eP(e){if(!e)return"webm";const t=e.toLowerCase();return t.includes("ogg")?"ogg":t.includes("mp4")||t.includes("m4a")?"m4a":t.includes("wav")?"wav":t.includes("mpeg")||t.includes("mp3")?"mp3":(t.includes("webm"),"webm")}const tP=({open:e,currentWorkdir:t,outputRoot:n,onClose:r,onSave:i})=>{const[l,o]=y.useState([]),[s,a]=y.useState(""),[u,c]=y.useState([]),[d,p]=y.useState(null),[h,x]=y.useState(!1),[v,b]=y.useState(!1),[m,g]=y.useState(""),[w,S]=y.useState(""),j=l.length>0,E=y.useMemo(()=>n?n.replace(/\/+$/,""):"--",[n]),P=async()=>{x(!0),g("");try{const B=await fetch("/api/fs/roots");if(!B.ok){g("Unable to load folder roots.");return}const z=(await B.json()).roots||[];o(z);const R=t||(z.length>0?z[0]:n||"");R&&await I(R)}catch{g("Unable to load folder roots.")}finally{x(!1)}},I=async B=>{if(B){x(!0),g("");try{const N=new URLSearchParams({path:B}),z=await fetch(`/api/fs/list?${N.toString()}`);if(!z.ok){g("Folder is not accessible or not allowed.");return}const R=await z.json();a(R.path),S(R.path),c(R.entries||[]),p(R.parent??null)}catch{g("Unable to load folder.")}finally{x(!1)}}};y.useEffect(()=>{e&&P()},[e]);const L=B=>{const N=B.target.value;N&&I(N)},_=()=>{w.trim()&&I(w.trim())},O=async()=>{if(!s)return;b(!0);const B=await i(s);b(!1),B&&r()},U=async()=>{b(!0);const B=await i(null);b(!1),B&&r()};return e?f.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 p-4",children:f.jsxs("div",{className:"glass-edge w-full max-w-2xl space-y-4 rounded-3xl p-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-semibold",children:"Working Folder"}),f.jsx("p",{className:"text-xs text-slate-400",children:"Choose where the agent should write outputs for this session."})]}),f.jsx("button",{className:"button-ghost px-3 py-1 text-xs",onClick:r,type:"button",children:"Close"})]}),m?f.jsx("div",{className:"rounded-xl border border-rose-400/40 bg-rose-500/15 px-3 py-2 text-xs text-rose-200",children:m}):null,f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[f.jsxs("div",{className:"flex-1",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Root"}),f.jsx("select",{className:"mt-2 w-full rounded-xl border border-white/10 bg-slate-900/60 px-3 py-2 text-sm",onChange:L,value:j?l.find(B=>s===B||s.startsWith(`${B}/`)||s.startsWith(`${B}\\`))||l[0]:"",disabled:!j,children:l.map(B=>f.jsx("option",{value:B,children:B},B))})]}),f.jsxs("div",{className:"text-xs text-slate-400",children:["Default output root: ",f.jsx("span",{className:"font-mono",children:E})]})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("input",{className:"flex-1 rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",value:w,onChange:B=>S(B.target.value),placeholder:"Select or paste a folder path"}),f.jsx("button",{className:"button-secondary px-3 py-2 text-xs",onClick:_,type:"button",children:"Go"}),d?f.jsx("button",{className:"button-ghost px-3 py-2 text-xs",onClick:()=>void I(d),type:"button",children:"Up"}):null]}),f.jsx("div",{className:"max-h-56 space-y-2 overflow-auto rounded-2xl border border-white/10 bg-slate-900/60 p-3",children:h?f.jsx("div",{className:"text-xs text-slate-400",children:"Loading folders..."}):u.length===0?f.jsx("div",{className:"text-xs text-slate-400",children:"No subfolders found."}):u.map(B=>f.jsxs("button",{type:"button",className:`flex w-full items-center justify-between rounded-xl border px-3 py-2 text-xs font-semibold transition ${B.path===s?"border-sky-500/50 bg-sky-500/15 text-sky-300":"border-white/10 bg-slate-950/50 text-slate-300 hover:border-sky-400/50"}`,onClick:()=>void I(B.path),children:[f.jsx("span",{children:B.name}),f.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-400",children:"Open"})]},B.path))})]}),f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pt-2",children:[f.jsxs("div",{className:"text-xs text-slate-400",children:["Current selection: ",f.jsx("span",{className:"font-mono",children:s||"--"})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("button",{className:"button-secondary",onClick:U,type:"button",disabled:v,children:"Clear"}),f.jsx("button",{className:"button-primary",onClick:O,type:"button",disabled:v||!s,children:"Use Folder"})]})]})]})}):null},nP=({agentId:e,activeThread:t,prompt:n,attachments:r,attachmentError:i,isStreaming:l,connected:o,loadingThread:s,outputRoot:a,voiceAutoEnabled:u,voicePlayback:c,onToggleVoiceAuto:d,onSpeakVoice:p,onStopVoice:h,onPromptChange:x,onSendPrompt:v,onAddAttachments:b,onRemoveAttachment:m,onClearAttachments:g,onClearChat:w,onDeleteThread:S,onOpenCommandDeck:j,onSetWorkdir:E})=>{const[P,I]=y.useState(!1),L=y.useMemo(()=>t?t.id:"--",[t]),_=t!=null&&t.createdAt?new Date(t.createdAt).toLocaleString():"--",O=(t==null?void 0:t.messageCount)??(t==null?void 0:t.messages.length)??0,U=a?a.replace(/\/+$/,""):"",B=t&&U?`${U}/${t.agentId}`:U||"--",N=async z=>{if(!t)return!1;const R=await E(t.id,z);return R&&I(!1),R};return f.jsxs("section",{className:"grid gap-6 lg:grid-cols-[1fr_280px]",children:[f.jsx(q4,{activeThread:t,prompt:n,attachments:r,attachmentError:i,isStreaming:l,connected:o,loading:s,voiceAutoEnabled:u,voicePlayback:c,onToggleVoiceAuto:d,onSpeakVoice:p,onStopVoice:h,onPromptChange:x,onSendPrompt:v,onAddAttachments:b,onRemoveAttachment:m,onClearAttachments:g,onClearChat:w,onOpenCommandDeck:j}),f.jsxs("aside",{className:"panel-card animate-rise space-y-4 p-5 lg:order-none order-last",children:[f.jsxs("div",{className:"rounded-2xl border border-dashed border-white/10 bg-slate-950/50 px-4 py-3",children:[f.jsxs("div",{className:"flex items-center justify-between text-sm font-semibold text-slate-200",children:[f.jsx("span",{children:"Working Folder"}),f.jsx("button",{type:"button",className:"button-secondary px-3 py-1 text-xs",onClick:()=>I(!0),disabled:!t,children:t!=null&&t.workdir?"Change":"Set"})]}),f.jsx("div",{className:"mt-3 text-xs text-slate-300",children:t!=null&&t.workdir?f.jsx("div",{className:"break-all font-mono",children:t.workdir}):f.jsxs("div",{children:[f.jsx("span",{className:"uppercase tracking-[0.2em] text-slate-400",children:"Default"}),f.jsx("div",{className:"mt-2 break-all font-mono",children:B})]})})]}),f.jsxs("details",{className:"group rounded-2xl border border-dashed border-white/10 bg-slate-950/50 px-4 py-3",children:[f.jsx("summary",{className:"cursor-pointer list-none text-sm font-semibold text-slate-200",children:"Session Snapshot"}),f.jsxs("div",{className:"mt-4 space-y-3 text-xs text-slate-300",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{children:"Agent"}),f.jsx("span",{className:"pill",children:e})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{children:"Thread"}),f.jsx("span",{className:"pill",children:(t==null?void 0:t.name)||"--"})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{children:"Messages"}),f.jsx("span",{className:"pill",children:O})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{children:"Created"}),f.jsx("span",{className:"pill",children:_})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Session Key"}),f.jsx("div",{className:"mt-2 break-all rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2 font-mono text-[11px] text-slate-400",children:L})]})]})]}),f.jsxs("details",{className:"group rounded-2xl border border-dashed border-white/10 bg-slate-950/50 px-4 py-3",children:[f.jsx("summary",{className:"cursor-pointer list-none text-sm font-semibold text-slate-200",children:"Guidance"}),f.jsxs("ul",{className:"mt-4 space-y-2 text-xs text-slate-300",children:[f.jsx("li",{className:"rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2",children:"Use the command deck to refresh stats or rotate credentials."}),f.jsx("li",{className:"rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2",children:"Create separate threads for each mission to keep context clean."}),f.jsx("li",{className:"rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2",children:"Shift + Enter inserts a new line in prompts."})]})]}),f.jsx("button",{type:"button",className:"rounded-full border border-rose-400/40 bg-rose-500/15 px-4 py-2 text-xs font-semibold uppercase tracking-[0.2em] text-rose-200 transition hover:border-rose-400/60",onClick:()=>t&&S(t.id),disabled:!t,children:"Delete Thread"})]}),f.jsx(tP,{open:P,currentWorkdir:(t==null?void 0:t.workdir)||null,outputRoot:U||void 0,onClose:()=>I(!1),onSave:N})]})},rP=({wsUrl:e,token:t,password:n,connecting:r,connected:i,authHint:l,autoConnect:o,autoConnectStatus:s,onAutoConnectChange:a,onWsUrlChange:u,onTokenChange:c,onPasswordChange:d,onConnect:p,onDisconnect:h,onRefresh:x,deviceId:v,onResetDevice:b})=>{const m=i?"Connected":r?"Connecting":"Disconnected";return f.jsxs("aside",{className:"panel-card animate-rise space-y-6 p-5",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("h2",{className:"text-lg font-semibold",children:"Command Deck"}),f.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-slate-400",children:"Connection + identity"}),f.jsx("div",{className:"flex items-center gap-2 text-xs text-slate-400",children:f.jsxs("span",{className:"pill",children:["status: ",m]})})]}),f.jsxs("div",{className:"space-y-3",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"WebSocket URL"}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm shadow-[0_0_0_1px_rgba(0,0,0,0.03)] focus:shadow-glow",value:e,onChange:g=>u(g.target.value)}),f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Token (optional)"}),f.jsx("input",{type:"password",className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm focus:shadow-glow",value:t,onChange:g=>c(g.target.value),autoComplete:"off"}),f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Password (optional)"}),f.jsx("input",{type:"password",className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm focus:shadow-glow",value:n,onChange:g=>d(g.target.value),autoComplete:"off"}),f.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2 text-xs text-slate-300",children:[f.jsx("span",{children:"Auto-connect"}),f.jsx("button",{type:"button",className:`rounded-full border px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.2em] transition ${o?"border-sky-500/50 bg-sky-500/15 text-sky-300":"border-white/10 bg-slate-950/50 text-slate-400"}`,onClick:()=>a(!o),children:o?"On":"Off"})]}),s?f.jsx("div",{className:"rounded-xl border border-amber-400/40 bg-amber-500/15 px-3 py-2 text-xs text-amber-200",children:s}):null,f.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[f.jsx("button",{className:"button-primary",onClick:p,disabled:r,type:"button",children:"Connect"}),f.jsx("button",{className:"button-secondary",onClick:h,type:"button",children:"Disconnect"}),f.jsx("button",{className:"button-ghost",onClick:x,type:"button",children:"Refresh"})]}),f.jsx("p",{className:"text-xs text-slate-400",children:l})]}),f.jsxs("div",{className:"space-y-3",children:[f.jsx("h3",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Identity"}),f.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-300",children:[f.jsx("span",{children:"Device"}),f.jsx("span",{className:"pill",children:v||"--"}),f.jsx("button",{className:"button-secondary",onClick:b,type:"button",children:"Reset"})]}),f.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-300",children:[f.jsx("span",{children:"Routing"}),f.jsxs("span",{className:"pill",children:["webui / channel / ",v||"--"]})]})]})]})},iP=({eventLog:e})=>f.jsxs("section",{className:"panel-card animate-rise space-y-3 p-5",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h3",{className:"text-lg font-semibold",children:"Telemetry"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Live events"})]}),f.jsx("div",{className:"max-h-60 overflow-auto rounded-xl border border-white/10 bg-slate-900/65 p-3 text-xs font-mono text-slate-200",children:e.length===0?f.jsx("div",{className:"text-slate-400",children:"No events yet."}):e.map((t,n)=>f.jsx("div",{className:"border-b border-dashed border-white/10 py-1 last:border-0",children:t},`${t}-${n}`))})]}),lP=({providers:e,loading:t,credentialsPath:n,updatedAt:r,onRefresh:i,onSaveToken:l,onClearToken:o})=>{const[s,a]=y.useState({}),[u,c]=y.useState({}),[d,p]=y.useState({}),h=y.useMemo(()=>[...e].sort((m,g)=>m.label.localeCompare(g.label)),[e]),x=(m,g)=>{a(w=>({...w,[m]:g})),p(w=>({...w,[m]:""}))},v=async m=>{const g=(s[m]||"").trim();if(!g){p(S=>({...S,[m]:"Token is required."}));return}c(S=>({...S,[m]:!0}));const w=await l(m,g);c(S=>({...S,[m]:!1})),w&&a(S=>({...S,[m]:""}))},b=async m=>{c(g=>({...g,[m]:!0})),await o(m),c(g=>({...g,[m]:!1}))};return f.jsxs("section",{className:"panel-card animate-rise space-y-4 p-5",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-semibold",children:"Providers"}),f.jsx("p",{className:"text-xs text-slate-400",children:"Manage API keys for model and voice providers."})]}),f.jsx("button",{className:"button-ghost",type:"button",onClick:i,children:"Refresh"})]}),t?f.jsx("div",{className:"rounded-xl border border-dashed border-white/10 bg-slate-950/50 px-3 py-2 text-xs text-slate-400",children:"Loading provider status..."}):null,h.length===0?f.jsx("div",{className:"rounded-xl border border-dashed border-white/10 bg-slate-950/50 px-3 py-2 text-xs text-slate-400",children:"No providers configured."}):f.jsx("div",{className:"space-y-3",children:h.map(m=>{const g=m.requiresAuth===!1,w=m.source==="missing",S=w?g?"Ready":"Missing":"Configured",j=w?g?"border-emerald-400/60 bg-emerald-500/10 text-emerald-300":"border-rose-400/50 bg-rose-500/15 text-rose-200":"border-sky-400/60 bg-sky-500/10 text-sky-300",E=m.source==="env"?`Env (${m.envVar||m.envVars[0]||"set"})`:m.source==="credentials"?"Stored credentials":g?"Local server (no auth required)":"No credentials saved";return f.jsxs("details",{open:w&&!g,className:"rounded-xl border border-white/10 bg-slate-900/60 px-3 py-2",children:[f.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-semibold text-slate-100",children:m.label}),f.jsx("div",{className:"text-xs text-slate-400",children:E})]}),f.jsx("span",{className:`rounded-full border px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.2em] ${j}`,children:S})]}),f.jsxs("div",{className:"mt-4 space-y-3",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:m.type==="oauth"?"Access Token":g?"API Key (Optional)":"API Key"}),f.jsx("input",{type:"password",className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm focus:shadow-glow",placeholder:g?`Optional: Custom API key for ${m.label}`:`Paste ${m.label} ${m.type==="oauth"?"token":"API key"}`,value:s[m.name]||"",onChange:P=>x(m.name,P.target.value),autoComplete:"off"}),d[m.name]?f.jsx("p",{className:"text-xs text-rose-500",children:d[m.name]}):null,f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx("button",{className:"button-primary",type:"button",disabled:u[m.name],onClick:()=>v(m.name),children:"Save"}),f.jsx("button",{className:"button-secondary",type:"button",disabled:u[m.name],onClick:()=>b(m.name),children:"Clear"})]}),f.jsxs("div",{className:"text-xs text-slate-400",children:["Env: ",m.envVars.join(", ")]}),g&&f.jsxs("div",{className:"rounded-lg border border-emerald-500/30 bg-emerald-950/30 px-3 py-2 text-xs text-emerald-200",children:[f.jsx("div",{className:"font-semibold",children:"Local Provider"}),f.jsx("div",{className:"mt-1 text-emerald-300/80",children:m.name==="lmstudio"?"Start LM Studio server (default: localhost:1234)":"Start Ollama server (default: localhost:11434)"}),f.jsx("div",{className:"mt-1 text-emerald-300/60",children:"No API key required for local inference"})]})]})]},m.name)})}),f.jsxs("div",{className:"rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2 text-xs text-slate-300",children:[f.jsxs("div",{children:["Credentials file: ",n||"--"]}),f.jsxs("div",{children:["Last updated: ",r||"--"]})]})]})},mr=e=>{if(!e.trim())return;const t=Number(e);return Number.isFinite(t)?t:void 0},oP=({voiceConfig:e,onSave:t})=>{const[n,r]=y.useState("web_speech"),[i,l]=y.useState("off"),[o,s]=y.useState(""),[a,u]=y.useState(""),[c,d]=y.useState(""),[p,h]=y.useState(""),[x,v]=y.useState(""),[b,m]=y.useState(""),[g,w]=y.useState(""),[S,j]=y.useState(""),[E,P]=y.useState(""),[I,L]=y.useState(""),[_,O]=y.useState(""),[U,B]=y.useState(""),[N,z]=y.useState(""),[R,W]=y.useState(null),[M,A]=y.useState(!1),k=y.useMemo(()=>n==="elevenlabs"?"ElevenLabs":"Web Speech",[n]);y.useEffect(()=>{var F,C,Z,re,V,ie,ae,ge,ve,Re,Ae,Be,ze,Ie;e&&(r(e.provider||"web_speech"),l(e.defaultPolicy||"off"),s(((F=e.webSpeech)==null?void 0:F.voiceName)||""),u(((C=e.webSpeech)==null?void 0:C.lang)||""),d(((Z=e.webSpeech)==null?void 0:Z.rate)!==void 0?String(e.webSpeech.rate):""),h(((re=e.webSpeech)==null?void 0:re.pitch)!==void 0?String(e.webSpeech.pitch):""),v(((V=e.webSpeech)==null?void 0:V.volume)!==void 0?String(e.webSpeech.volume):""),m(((ie=e.elevenlabs)==null?void 0:ie.voiceId)||""),w(((ae=e.elevenlabs)==null?void 0:ae.modelId)||""),j(((ge=e.elevenlabs)==null?void 0:ge.stability)!==void 0?String(e.elevenlabs.stability):""),P(((ve=e.elevenlabs)==null?void 0:ve.similarityBoost)!==void 0?String(e.elevenlabs.similarityBoost):""),L(((Re=e.elevenlabs)==null?void 0:Re.style)!==void 0?String(e.elevenlabs.style):""),O(((Ae=e.elevenlabs)==null?void 0:Ae.speed)!==void 0?String(e.elevenlabs.speed):""),B(((Be=e.elevenlabs)==null?void 0:Be.outputFormat)||""),z(((ze=e.elevenlabs)==null?void 0:ze.optimizeStreamingLatency)!==void 0?String(e.elevenlabs.optimizeStreamingLatency):""),W(((Ie=e.elevenlabs)==null?void 0:Ie.speakerBoost)??null))},[e]);const H=async()=>{A(!0);const F={provider:n,defaultPolicy:i,webSpeech:{voiceName:o.trim()||void 0,lang:a.trim()||void 0,rate:mr(c),pitch:mr(p),volume:mr(x)},elevenlabs:{voiceId:b.trim()||void 0,modelId:g.trim()||void 0,stability:mr(S),similarityBoost:mr(E),style:mr(I),speed:mr(_),outputFormat:U.trim()||void 0,optimizeStreamingLatency:mr(N),speakerBoost:R??void 0}},C=await t(F);return A(!1),C};return f.jsxs("section",{className:"panel-card animate-rise space-y-4 p-5",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-semibold",children:"Voice Provider"}),f.jsx("p",{className:"text-xs text-slate-400",children:"Configure the default TTS provider and voice settings for the gateway."})]}),f.jsx("button",{className:"button-primary",type:"button",onClick:H,disabled:M,children:M?"Saving...":"Save"})]}),f.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Provider"}),f.jsxs("select",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",value:n,onChange:F=>r(F.target.value),children:[f.jsx("option",{value:"web_speech",children:"Web Speech (Browser)"}),f.jsx("option",{value:"elevenlabs",children:"ElevenLabs"})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Default Policy"}),f.jsxs("select",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",value:i,onChange:F=>l(F.target.value),children:[f.jsx("option",{value:"off",children:"Off"}),f.jsx("option",{value:"auto",children:"Auto speak"}),f.jsx("option",{value:"manual",children:"Manual only"})]})]})]}),n==="web_speech"?f.jsxs("div",{className:"space-y-3",children:[f.jsx("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-400",children:"Web Speech Defaults"}),f.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Voice name (optional)",value:o,onChange:F=>s(F.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Language (e.g. en-US)",value:a,onChange:F=>u(F.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Rate (0.1 - 4)",value:c,onChange:F=>d(F.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Pitch (0 - 2)",value:p,onChange:F=>h(F.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Volume (0 - 1)",value:x,onChange:F=>v(F.target.value)})]})]}):f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"text-xs uppercase tracking-[0.2em] text-slate-400",children:[k," Defaults"]}),f.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Voice ID",value:b,onChange:F=>m(F.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Model ID (optional)",value:g,onChange:F=>w(F.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Stability (0 - 1)",value:S,onChange:F=>j(F.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Similarity boost (0 - 1)",value:E,onChange:F=>P(F.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Style (0 - 1)",value:I,onChange:F=>L(F.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Speed (0.25 - 4)",value:_,onChange:F=>O(F.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Output format (mp3_44100_128)",value:U,onChange:F=>B(F.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Optimize latency (0-4)",value:N,onChange:F=>z(F.target.value)})]}),f.jsxs("label",{className:"flex items-center gap-2 text-xs text-slate-300",children:[f.jsx("input",{type:"checkbox",checked:R??!1,onChange:F=>W(F.target.checked)}),"Use speaker boost"]})]}),f.jsxs("div",{className:"rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2 text-xs text-slate-300",children:["Provider: ",f.jsx("span",{className:"font-semibold",children:k})]})]})},sP=({wsUrl:e,token:t,password:n,connecting:r,connected:i,authHint:l,autoConnect:o,autoConnectStatus:s,onAutoConnectChange:a,deviceId:u,eventLog:c,providers:d,providersLoading:p,providersUpdatedAt:h,credentialsPath:x,voiceConfig:v,onWsUrlChange:b,onTokenChange:m,onPasswordChange:g,onConnect:w,onDisconnect:S,onRefresh:j,onResetDevice:E,onRefreshProviders:P,onSaveProviderToken:I,onClearProviderToken:L,onSaveVoiceConfig:_})=>f.jsxs("section",{className:"grid gap-6 lg:grid-cols-[360px_1fr]",children:[f.jsx(rP,{wsUrl:e,token:t,password:n,connecting:r,connected:i,authHint:l,autoConnect:o,autoConnectStatus:s,onAutoConnectChange:a,deviceId:u,onWsUrlChange:b,onTokenChange:m,onPasswordChange:g,onConnect:w,onDisconnect:S,onRefresh:j,onResetDevice:E}),f.jsxs("div",{className:"space-y-6",children:[f.jsx(iP,{eventLog:c}),f.jsx(lP,{providers:d,loading:p,credentialsPath:x,updatedAt:h,onRefresh:P,onSaveToken:I,onClearToken:L}),f.jsx(oP,{voiceConfig:v,onSave:_}),f.jsxs("section",{className:"panel-card animate-rise space-y-3 p-5",children:[f.jsx("h3",{className:"text-lg font-semibold",children:"Security Notes"}),f.jsx("p",{className:"text-sm text-slate-300",children:"Keep your gateway bound to localhost unless you are tunneling through a trusted network such as Tailscale or SSH. Tokens remain the safest option for remote access."}),f.jsxs("div",{className:"rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2 text-xs text-slate-300",children:["Device ID: ",f.jsx("span",{className:"font-mono",children:u||"--"})]})]})]})]});function St(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=St(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Yv={exports:{}},Xv={},Kv={exports:{}},Gv={};/**
|
|
96
|
+
* @license React
|
|
97
|
+
* use-sync-external-store-shim.production.js
|
|
98
|
+
*
|
|
99
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the MIT license found in the
|
|
102
|
+
* LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/var ul=y;function aP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var uP=typeof Object.is=="function"?Object.is:aP,cP=ul.useState,dP=ul.useEffect,fP=ul.useLayoutEffect,pP=ul.useDebugValue;function hP(e,t){var n=t(),r=cP({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return fP(function(){i.value=n,i.getSnapshot=t,xc(i)&&l({inst:i})},[e,n,t]),dP(function(){return xc(i)&&l({inst:i}),e(function(){xc(i)&&l({inst:i})})},[e]),pP(n),n}function xc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!uP(e,n)}catch{return!0}}function mP(e,t){return t()}var gP=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?mP:hP;Gv.useSyncExternalStore=ul.useSyncExternalStore!==void 0?ul.useSyncExternalStore:gP;Kv.exports=Gv;var xP=Kv.exports;/**
|
|
104
|
+
* @license React
|
|
105
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
106
|
+
*
|
|
107
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the MIT license found in the
|
|
110
|
+
* LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/var du=y,yP=xP;function vP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wP=typeof Object.is=="function"?Object.is:vP,kP=yP.useSyncExternalStore,bP=du.useRef,SP=du.useEffect,EP=du.useMemo,NP=du.useDebugValue;Xv.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var l=bP(null);if(l.current===null){var o={hasValue:!1,value:null};l.current=o}else o=l.current;l=EP(function(){function a(h){if(!u){if(u=!0,c=h,h=r(h),i!==void 0&&o.hasValue){var x=o.value;if(i(x,h))return d=x}return d=h}if(x=d,wP(c,h))return x;var v=r(h);return i!==void 0&&i(x,v)?(c=h,x):(c=h,d=v)}var u=!1,c,d,p=n===void 0?null:n;return[function(){return a(t())},p===null?void 0:function(){return a(p())}]},[t,n,r,i]);var s=kP(e,l[0],l[1]);return SP(function(){o.hasValue=!0,o.value=s},[s]),NP(s),s};Yv.exports=Xv;var CP=Yv.exports;const _P=Fa(CP),jP={},mg=e=>{let t;const n=new Set,r=(c,d)=>{const p=typeof c=="function"?c(t):c;if(!Object.is(p,t)){const h=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(x=>x(t,h))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(jP?"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."),n.clear()}},u=t=e(r,i,a);return a},PP=e=>e?mg(e):mg,{useDebugValue:AP}=X,{useSyncExternalStoreWithSelector:IP}=_P,TP=e=>e;function qv(e,t=TP,n){const r=IP(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return AP(r),r}const gg=(e,t)=>{const n=PP(e),r=(i,l=t)=>qv(n,i,l);return Object.assign(r,n),r},RP=(e,t)=>e?gg(e,t):gg;function gt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var LP={value:()=>{}};function fu(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ws(n)}function Ws(e){this._=e}function MP(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ws.prototype=fu.prototype={constructor:Ws,on:function(e,t){var n=this._,r=MP(e+"",n),i,l=-1,o=r.length;if(arguments.length<2){for(;++l<o;)if((i=(e=r[l]).type)&&(i=zP(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<o;)if(i=(e=r[l]).type)n[i]=xg(n[i],e.name,t);else if(t==null)for(i in n)n[i]=xg(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ws(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,l;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],r=0,i=l.length;r<i;++r)l[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,l=r.length;i<l;++i)r[i].value.apply(t,n)}};function zP(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function xg(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=LP,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Bd="http://www.w3.org/1999/xhtml";const yg={svg:"http://www.w3.org/2000/svg",xhtml:Bd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function pu(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),yg.hasOwnProperty(t)?{space:yg[t],local:e}:e}function DP(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Bd&&t.documentElement.namespaceURI===Bd?t.createElement(e):t.createElementNS(n,e)}}function OP(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Qv(e){var t=pu(e);return(t.local?OP:DP)(t)}function FP(){}function Sp(e){return e==null?FP:function(){return this.querySelector(e)}}function $P(e){typeof e!="function"&&(e=Sp(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var l=t[i],o=l.length,s=r[i]=new Array(o),a,u,c=0;c<o;++c)(a=l[c])&&(u=e.call(a,a.__data__,c,l))&&("__data__"in a&&(u.__data__=a.__data__),s[c]=u);return new tn(r,this._parents)}function BP(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function UP(){return[]}function Zv(e){return e==null?UP:function(){return this.querySelectorAll(e)}}function VP(e){return function(){return BP(e.apply(this,arguments))}}function HP(e){typeof e=="function"?e=VP(e):e=Zv(e);for(var t=this._groups,n=t.length,r=[],i=[],l=0;l<n;++l)for(var o=t[l],s=o.length,a,u=0;u<s;++u)(a=o[u])&&(r.push(e.call(a,a.__data__,u,o)),i.push(a));return new tn(r,i)}function Jv(e){return function(){return this.matches(e)}}function ew(e){return function(t){return t.matches(e)}}var WP=Array.prototype.find;function YP(e){return function(){return WP.call(this.children,e)}}function XP(){return this.firstElementChild}function KP(e){return this.select(e==null?XP:YP(typeof e=="function"?e:ew(e)))}var GP=Array.prototype.filter;function qP(){return Array.from(this.children)}function QP(e){return function(){return GP.call(this.children,e)}}function ZP(e){return this.selectAll(e==null?qP:QP(typeof e=="function"?e:ew(e)))}function JP(e){typeof e!="function"&&(e=Jv(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var l=t[i],o=l.length,s=r[i]=[],a,u=0;u<o;++u)(a=l[u])&&e.call(a,a.__data__,u,l)&&s.push(a);return new tn(r,this._parents)}function tw(e){return new Array(e.length)}function eA(){return new tn(this._enter||this._groups.map(tw),this._parents)}function Pa(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Pa.prototype={constructor:Pa,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function tA(e){return function(){return e}}function nA(e,t,n,r,i,l){for(var o=0,s,a=t.length,u=l.length;o<u;++o)(s=t[o])?(s.__data__=l[o],r[o]=s):n[o]=new Pa(e,l[o]);for(;o<a;++o)(s=t[o])&&(i[o]=s)}function rA(e,t,n,r,i,l,o){var s,a,u=new Map,c=t.length,d=l.length,p=new Array(c),h;for(s=0;s<c;++s)(a=t[s])&&(p[s]=h=o.call(a,a.__data__,s,t)+"",u.has(h)?i[s]=a:u.set(h,a));for(s=0;s<d;++s)h=o.call(e,l[s],s,l)+"",(a=u.get(h))?(r[s]=a,a.__data__=l[s],u.delete(h)):n[s]=new Pa(e,l[s]);for(s=0;s<c;++s)(a=t[s])&&u.get(p[s])===a&&(i[s]=a)}function iA(e){return e.__data__}function lA(e,t){if(!arguments.length)return Array.from(this,iA);var n=t?rA:nA,r=this._parents,i=this._groups;typeof e!="function"&&(e=tA(e));for(var l=i.length,o=new Array(l),s=new Array(l),a=new Array(l),u=0;u<l;++u){var c=r[u],d=i[u],p=d.length,h=oA(e.call(c,c&&c.__data__,u,r)),x=h.length,v=s[u]=new Array(x),b=o[u]=new Array(x),m=a[u]=new Array(p);n(c,d,v,b,m,h,t);for(var g=0,w=0,S,j;g<x;++g)if(S=v[g]){for(g>=w&&(w=g+1);!(j=b[w])&&++w<x;);S._next=j||null}}return o=new tn(o,r),o._enter=s,o._exit=a,o}function oA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sA(){return new tn(this._exit||this._groups.map(tw),this._parents)}function aA(e,t,n){var r=this.enter(),i=this,l=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?l.remove():n(l),r&&i?r.merge(i).order():i}function uA(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,l=r.length,o=Math.min(i,l),s=new Array(i),a=0;a<o;++a)for(var u=n[a],c=r[a],d=u.length,p=s[a]=new Array(d),h,x=0;x<d;++x)(h=u[x]||c[x])&&(p[x]=h);for(;a<i;++a)s[a]=n[a];return new tn(s,this._parents)}function cA(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,l=r[i],o;--i>=0;)(o=r[i])&&(l&&o.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(o,l),l=o);return this}function dA(e){e||(e=fA);function t(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var n=this._groups,r=n.length,i=new Array(r),l=0;l<r;++l){for(var o=n[l],s=o.length,a=i[l]=new Array(s),u,c=0;c<s;++c)(u=o[c])&&(a[c]=u);a.sort(t)}return new tn(i,this._parents).order()}function fA(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function pA(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function hA(){return Array.from(this)}function mA(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,l=r.length;i<l;++i){var o=r[i];if(o)return o}return null}function gA(){let e=0;for(const t of this)++e;return e}function xA(){return!this.node()}function yA(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],l=0,o=i.length,s;l<o;++l)(s=i[l])&&e.call(s,s.__data__,l,i);return this}function vA(e){return function(){this.removeAttribute(e)}}function wA(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kA(e,t){return function(){this.setAttribute(e,t)}}function bA(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function SA(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function EA(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function NA(e,t){var n=pu(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?wA:vA:typeof t=="function"?n.local?EA:SA:n.local?bA:kA)(n,t))}function nw(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function CA(e){return function(){this.style.removeProperty(e)}}function _A(e,t,n){return function(){this.style.setProperty(e,t,n)}}function jA(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function PA(e,t,n){return arguments.length>1?this.each((t==null?CA:typeof t=="function"?jA:_A)(e,t,n??"")):cl(this.node(),e)}function cl(e,t){return e.style.getPropertyValue(t)||nw(e).getComputedStyle(e,null).getPropertyValue(t)}function AA(e){return function(){delete this[e]}}function IA(e,t){return function(){this[e]=t}}function TA(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function RA(e,t){return arguments.length>1?this.each((t==null?AA:typeof t=="function"?TA:IA)(e,t)):this.node()[e]}function rw(e){return e.trim().split(/^|\s+/)}function Ep(e){return e.classList||new iw(e)}function iw(e){this._node=e,this._names=rw(e.getAttribute("class")||"")}iw.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function lw(e,t){for(var n=Ep(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function ow(e,t){for(var n=Ep(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function LA(e){return function(){lw(this,e)}}function MA(e){return function(){ow(this,e)}}function zA(e,t){return function(){(t.apply(this,arguments)?lw:ow)(this,e)}}function DA(e,t){var n=rw(e+"");if(arguments.length<2){for(var r=Ep(this.node()),i=-1,l=n.length;++i<l;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?zA:t?LA:MA)(n,t))}function OA(){this.textContent=""}function FA(e){return function(){this.textContent=e}}function $A(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function BA(e){return arguments.length?this.each(e==null?OA:(typeof e=="function"?$A:FA)(e)):this.node().textContent}function UA(){this.innerHTML=""}function VA(e){return function(){this.innerHTML=e}}function HA(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function WA(e){return arguments.length?this.each(e==null?UA:(typeof e=="function"?HA:VA)(e)):this.node().innerHTML}function YA(){this.nextSibling&&this.parentNode.appendChild(this)}function XA(){return this.each(YA)}function KA(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function GA(){return this.each(KA)}function qA(e){var t=typeof e=="function"?e:Qv(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function QA(){return null}function ZA(e,t){var n=typeof e=="function"?e:Qv(e),r=t==null?QA:typeof t=="function"?t:Sp(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function JA(){var e=this.parentNode;e&&e.removeChild(this)}function eI(){return this.each(JA)}function tI(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nI(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rI(e){return this.select(e?nI:tI)}function iI(e){return arguments.length?this.property("__data__",e):this.node().__data__}function lI(e){return function(t){e.call(this,t,this.__data__)}}function oI(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function sI(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,l;n<i;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++r]=l;++r?t.length=r:delete this.__on}}}function aI(e,t,n){return function(){var r=this.__on,i,l=lI(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=l,i.options=n),i.value=t;return}}this.addEventListener(e.type,l,n),i={type:e.type,name:e.name,value:t,listener:l,options:n},r?r.push(i):this.__on=[i]}}function uI(e,t,n){var r=oI(e+""),i,l=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var a=0,u=s.length,c;a<u;++a)for(i=0,c=s[a];i<l;++i)if((o=r[i]).type===c.type&&o.name===c.name)return c.value}return}for(s=t?aI:sI,i=0;i<l;++i)this.each(s(r[i],t,n));return this}function sw(e,t,n){var r=nw(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function cI(e,t){return function(){return sw(this,e,t)}}function dI(e,t){return function(){return sw(this,e,t.apply(this,arguments))}}function fI(e,t){return this.each((typeof t=="function"?dI:cI)(e,t))}function*pI(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,l=r.length,o;i<l;++i)(o=r[i])&&(yield o)}var aw=[null];function tn(e,t){this._groups=e,this._parents=t}function Bo(){return new tn([[document.documentElement]],aw)}function hI(){return this}tn.prototype=Bo.prototype={constructor:tn,select:$P,selectAll:HP,selectChild:KP,selectChildren:ZP,filter:JP,data:lA,enter:eA,exit:sA,join:aA,merge:uA,selection:hI,order:cA,sort:dA,call:pA,nodes:hA,node:mA,size:gA,empty:xA,each:yA,attr:NA,style:PA,property:RA,classed:DA,text:BA,html:WA,raise:XA,lower:GA,append:qA,insert:ZA,remove:eI,clone:rI,datum:iI,on:uI,dispatch:fI,[Symbol.iterator]:pI};function un(e){return typeof e=="string"?new tn([[document.querySelector(e)]],[document.documentElement]):new tn([[e]],aw)}function mI(e){let t;for(;t=e.sourceEvent;)e=t;return e}function kn(e,t){if(e=mI(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const gI={passive:!1},No={capture:!0,passive:!1};function yc(e){e.stopImmediatePropagation()}function Qi(e){e.preventDefault(),e.stopImmediatePropagation()}function uw(e){var t=e.document.documentElement,n=un(e).on("dragstart.drag",Qi,No);"onselectstart"in t?n.on("selectstart.drag",Qi,No):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function cw(e,t){var n=e.document.documentElement,r=un(e).on("dragstart.drag",null);t&&(r.on("click.drag",Qi,No),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const bs=e=>()=>e;function Ud(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:l,x:o,y:s,dx:a,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Ud.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function xI(e){return!e.ctrlKey&&!e.button}function yI(){return this.parentNode}function vI(e,t){return t??{x:e.x,y:e.y}}function wI(){return navigator.maxTouchPoints||"ontouchstart"in this}function kI(){var e=xI,t=yI,n=vI,r=wI,i={},l=fu("start","drag","end"),o=0,s,a,u,c,d=0;function p(S){S.on("mousedown.drag",h).filter(r).on("touchstart.drag",b).on("touchmove.drag",m,gI).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(S,j){if(!(c||!e.call(this,S,j))){var E=w(this,t.call(this,S,j),S,j,"mouse");E&&(un(S.view).on("mousemove.drag",x,No).on("mouseup.drag",v,No),uw(S.view),yc(S),u=!1,s=S.clientX,a=S.clientY,E("start",S))}}function x(S){if(Qi(S),!u){var j=S.clientX-s,E=S.clientY-a;u=j*j+E*E>d}i.mouse("drag",S)}function v(S){un(S.view).on("mousemove.drag mouseup.drag",null),cw(S.view,u),Qi(S),i.mouse("end",S)}function b(S,j){if(e.call(this,S,j)){var E=S.changedTouches,P=t.call(this,S,j),I=E.length,L,_;for(L=0;L<I;++L)(_=w(this,P,S,j,E[L].identifier,E[L]))&&(yc(S),_("start",S,E[L]))}}function m(S){var j=S.changedTouches,E=j.length,P,I;for(P=0;P<E;++P)(I=i[j[P].identifier])&&(Qi(S),I("drag",S,j[P]))}function g(S){var j=S.changedTouches,E=j.length,P,I;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),P=0;P<E;++P)(I=i[j[P].identifier])&&(yc(S),I("end",S,j[P]))}function w(S,j,E,P,I,L){var _=l.copy(),O=kn(L||E,j),U,B,N;if((N=n.call(S,new Ud("beforestart",{sourceEvent:E,target:p,identifier:I,active:o,x:O[0],y:O[1],dx:0,dy:0,dispatch:_}),P))!=null)return U=N.x-O[0]||0,B=N.y-O[1]||0,function z(R,W,M){var A=O,k;switch(R){case"start":i[I]=z,k=o++;break;case"end":delete i[I],--o;case"drag":O=kn(M||W,j),k=o;break}_.call(R,S,new Ud(R,{sourceEvent:W,subject:N,target:p,identifier:I,active:k,x:O[0]+U,y:O[1]+B,dx:O[0]-A[0],dy:O[1]-A[1],dispatch:_}),P)}}return p.filter=function(S){return arguments.length?(e=typeof S=="function"?S:bs(!!S),p):e},p.container=function(S){return arguments.length?(t=typeof S=="function"?S:bs(S),p):t},p.subject=function(S){return arguments.length?(n=typeof S=="function"?S:bs(S),p):n},p.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:bs(!!S),p):r},p.on=function(){var S=l.on.apply(l,arguments);return S===l?p:S},p.clickDistance=function(S){return arguments.length?(d=(S=+S)*S,p):Math.sqrt(d)},p}function Np(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function dw(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Uo(){}var Co=.7,Aa=1/Co,Zi="\\s*([+-]?\\d+)\\s*",_o="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bI=/^#([0-9a-f]{3,8})$/,SI=new RegExp(`^rgb\\(${Zi},${Zi},${Zi}\\)$`),EI=new RegExp(`^rgb\\(${Fn},${Fn},${Fn}\\)$`),NI=new RegExp(`^rgba\\(${Zi},${Zi},${Zi},${_o}\\)$`),CI=new RegExp(`^rgba\\(${Fn},${Fn},${Fn},${_o}\\)$`),_I=new RegExp(`^hsl\\(${_o},${Fn},${Fn}\\)$`),jI=new RegExp(`^hsla\\(${_o},${Fn},${Fn},${_o}\\)$`),vg={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};Np(Uo,jo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wg,formatHex:wg,formatHex8:PI,formatHsl:AI,formatRgb:kg,toString:kg});function wg(){return this.rgb().formatHex()}function PI(){return this.rgb().formatHex8()}function AI(){return fw(this).formatHsl()}function kg(){return this.rgb().formatRgb()}function jo(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=bI.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?bg(t):n===3?new Vt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ss(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ss(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=SI.exec(e))?new Vt(t[1],t[2],t[3],1):(t=EI.exec(e))?new Vt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=NI.exec(e))?Ss(t[1],t[2],t[3],t[4]):(t=CI.exec(e))?Ss(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_I.exec(e))?Ng(t[1],t[2]/100,t[3]/100,1):(t=jI.exec(e))?Ng(t[1],t[2]/100,t[3]/100,t[4]):vg.hasOwnProperty(e)?bg(vg[e]):e==="transparent"?new Vt(NaN,NaN,NaN,0):null}function bg(e){return new Vt(e>>16&255,e>>8&255,e&255,1)}function Ss(e,t,n,r){return r<=0&&(e=t=n=NaN),new Vt(e,t,n,r)}function II(e){return e instanceof Uo||(e=jo(e)),e?(e=e.rgb(),new Vt(e.r,e.g,e.b,e.opacity)):new Vt}function Vd(e,t,n,r){return arguments.length===1?II(e):new Vt(e,t,n,r??1)}function Vt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Np(Vt,Vd,dw(Uo,{brighter(e){return e=e==null?Aa:Math.pow(Aa,e),new Vt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Co:Math.pow(Co,e),new Vt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vt(ai(this.r),ai(this.g),ai(this.b),Ia(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:Sg,formatHex:Sg,formatHex8:TI,formatRgb:Eg,toString:Eg}));function Sg(){return`#${ii(this.r)}${ii(this.g)}${ii(this.b)}`}function TI(){return`#${ii(this.r)}${ii(this.g)}${ii(this.b)}${ii((isNaN(this.opacity)?1:this.opacity)*255)}`}function Eg(){const e=Ia(this.opacity);return`${e===1?"rgb(":"rgba("}${ai(this.r)}, ${ai(this.g)}, ${ai(this.b)}${e===1?")":`, ${e})`}`}function Ia(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ai(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ii(e){return e=ai(e),(e<16?"0":"")+e.toString(16)}function Ng(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Sn(e,t,n,r)}function fw(e){if(e instanceof Sn)return new Sn(e.h,e.s,e.l,e.opacity);if(e instanceof Uo||(e=jo(e)),!e)return new Sn;if(e instanceof Sn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),l=Math.max(t,n,r),o=NaN,s=l-i,a=(l+i)/2;return s?(t===l?o=(n-r)/s+(n<r)*6:n===l?o=(r-t)/s+2:o=(t-n)/s+4,s/=a<.5?l+i:2-l-i,o*=60):s=a>0&&a<1?0:o,new Sn(o,s,a,e.opacity)}function RI(e,t,n,r){return arguments.length===1?fw(e):new Sn(e,t,n,r??1)}function Sn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Np(Sn,RI,dw(Uo,{brighter(e){return e=e==null?Aa:Math.pow(Aa,e),new Sn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Co:Math.pow(Co,e),new Sn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Vt(vc(e>=240?e-240:e+120,i,r),vc(e,i,r),vc(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Sn(Cg(this.h),Es(this.s),Es(this.l),Ia(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=Ia(this.opacity);return`${e===1?"hsl(":"hsla("}${Cg(this.h)}, ${Es(this.s)*100}%, ${Es(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Cg(e){return e=(e||0)%360,e<0?e+360:e}function Es(e){return Math.max(0,Math.min(1,e||0))}function vc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const pw=e=>()=>e;function LI(e,t){return function(n){return e+n*t}}function MI(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function zI(e){return(e=+e)==1?hw:function(t,n){return n-t?MI(t,n,e):pw(isNaN(t)?n:t)}}function hw(e,t){var n=t-e;return n?LI(e,n):pw(isNaN(e)?t:e)}const _g=function e(t){var n=zI(t);function r(i,l){var o=n((i=Vd(i)).r,(l=Vd(l)).r),s=n(i.g,l.g),a=n(i.b,l.b),u=hw(i.opacity,l.opacity);return function(c){return i.r=o(c),i.g=s(c),i.b=a(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function vr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Hd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wc=new RegExp(Hd.source,"g");function DI(e){return function(){return e}}function OI(e){return function(t){return e(t)+""}}function FI(e,t){var n=Hd.lastIndex=wc.lastIndex=0,r,i,l,o=-1,s=[],a=[];for(e=e+"",t=t+"";(r=Hd.exec(e))&&(i=wc.exec(t));)(l=i.index)>n&&(l=t.slice(n,l),s[o]?s[o]+=l:s[++o]=l),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,a.push({i:o,x:vr(r,i)})),n=wc.lastIndex;return n<t.length&&(l=t.slice(n),s[o]?s[o]+=l:s[++o]=l),s.length<2?a[0]?OI(a[0].x):DI(t):(t=a.length,function(u){for(var c=0,d;c<t;++c)s[(d=a[c]).i]=d.x(u);return s.join("")})}var jg=180/Math.PI,Wd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mw(e,t,n,r,i,l){var o,s,a;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,a/=s),e*r<t*n&&(e=-e,t=-t,a=-a,o=-o),{translateX:i,translateY:l,rotate:Math.atan2(t,e)*jg,skewX:Math.atan(a)*jg,scaleX:o,scaleY:s}}var Ns;function $I(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Wd:mw(t.a,t.b,t.c,t.d,t.e,t.f)}function BI(e){return e==null||(Ns||(Ns=document.createElementNS("http://www.w3.org/2000/svg","g")),Ns.setAttribute("transform",e),!(e=Ns.transform.baseVal.consolidate()))?Wd:(e=e.matrix,mw(e.a,e.b,e.c,e.d,e.e,e.f))}function gw(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function l(u,c,d,p,h,x){if(u!==d||c!==p){var v=h.push("translate(",null,t,null,n);x.push({i:v-4,x:vr(u,d)},{i:v-2,x:vr(c,p)})}else(d||p)&&h.push("translate("+d+t+p+n)}function o(u,c,d,p){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),p.push({i:d.push(i(d)+"rotate(",null,r)-2,x:vr(u,c)})):c&&d.push(i(d)+"rotate("+c+r)}function s(u,c,d,p){u!==c?p.push({i:d.push(i(d)+"skewX(",null,r)-2,x:vr(u,c)}):c&&d.push(i(d)+"skewX("+c+r)}function a(u,c,d,p,h,x){if(u!==d||c!==p){var v=h.push(i(h)+"scale(",null,",",null,")");x.push({i:v-4,x:vr(u,d)},{i:v-2,x:vr(c,p)})}else(d!==1||p!==1)&&h.push(i(h)+"scale("+d+","+p+")")}return function(u,c){var d=[],p=[];return u=e(u),c=e(c),l(u.translateX,u.translateY,c.translateX,c.translateY,d,p),o(u.rotate,c.rotate,d,p),s(u.skewX,c.skewX,d,p),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,p),u=c=null,function(h){for(var x=-1,v=p.length,b;++x<v;)d[(b=p[x]).i]=b.x(h);return d.join("")}}}var UI=gw($I,"px, ","px)","deg)"),VI=gw(BI,", ",")",")"),HI=1e-12;function Pg(e){return((e=Math.exp(e))+1/e)/2}function WI(e){return((e=Math.exp(e))-1/e)/2}function YI(e){return((e=Math.exp(2*e))-1)/(e+1)}const XI=function e(t,n,r){function i(l,o){var s=l[0],a=l[1],u=l[2],c=o[0],d=o[1],p=o[2],h=c-s,x=d-a,v=h*h+x*x,b,m;if(v<HI)m=Math.log(p/u)/t,b=function(P){return[s+P*h,a+P*x,u*Math.exp(t*P*m)]};else{var g=Math.sqrt(v),w=(p*p-u*u+r*v)/(2*u*n*g),S=(p*p-u*u-r*v)/(2*p*n*g),j=Math.log(Math.sqrt(w*w+1)-w),E=Math.log(Math.sqrt(S*S+1)-S);m=(E-j)/t,b=function(P){var I=P*m,L=Pg(j),_=u/(n*g)*(L*YI(t*I+j)-WI(j));return[s+_*h,a+_*x,u*L/Pg(t*I+j)]}}return b.duration=m*1e3*t/Math.SQRT2,b}return i.rho=function(l){var o=Math.max(.001,+l),s=o*o,a=s*s;return e(o,s,a)},i}(Math.SQRT2,2,4);var dl=0,Ul=0,Rl=0,xw=1e3,Ta,Vl,Ra=0,gi=0,hu=0,Po=typeof performance=="object"&&performance.now?performance:Date,yw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Cp(){return gi||(yw(KI),gi=Po.now()+hu)}function KI(){gi=0}function La(){this._call=this._time=this._next=null}La.prototype=vw.prototype={constructor:La,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Cp():+n)+(t==null?0:+t),!this._next&&Vl!==this&&(Vl?Vl._next=this:Ta=this,Vl=this),this._call=e,this._time=n,Yd()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yd())}};function vw(e,t,n){var r=new La;return r.restart(e,t,n),r}function GI(){Cp(),++dl;for(var e=Ta,t;e;)(t=gi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--dl}function Ag(){gi=(Ra=Po.now())+hu,dl=Ul=0;try{GI()}finally{dl=0,QI(),gi=0}}function qI(){var e=Po.now(),t=e-Ra;t>xw&&(hu-=t,Ra=e)}function QI(){for(var e,t=Ta,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ta=n);Vl=e,Yd(r)}function Yd(e){if(!dl){Ul&&(Ul=clearTimeout(Ul));var t=e-gi;t>24?(e<1/0&&(Ul=setTimeout(Ag,e-Po.now()-hu)),Rl&&(Rl=clearInterval(Rl))):(Rl||(Ra=Po.now(),Rl=setInterval(qI,xw)),dl=1,yw(Ag))}}function Ig(e,t,n){var r=new La;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var ZI=fu("start","end","cancel","interrupt"),JI=[],ww=0,Tg=1,Xd=2,Ys=3,Rg=4,Kd=5,Xs=6;function mu(e,t,n,r,i,l){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;eT(e,n,{name:t,index:r,group:i,on:ZI,tween:JI,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:ww})}function _p(e,t){var n=Pn(e,t);if(n.state>ww)throw new Error("too late; already scheduled");return n}function Bn(e,t){var n=Pn(e,t);if(n.state>Ys)throw new Error("too late; already running");return n}function Pn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function eT(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=vw(l,0,n.time);function l(u){n.state=Tg,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var c,d,p,h;if(n.state!==Tg)return a();for(c in r)if(h=r[c],h.name===n.name){if(h.state===Ys)return Ig(o);h.state===Rg?(h.state=Xs,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=Xs,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(Ig(function(){n.state===Ys&&(n.state=Rg,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=Xd,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Xd){for(n.state=Ys,i=new Array(p=n.tween.length),c=0,d=-1;c<p;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Kd,1),d=-1,p=i.length;++d<p;)i[d].call(e,c);n.state===Kd&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Xs,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Ks(e,t){var n=e.__transition,r,i,l=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){l=!1;continue}i=r.state>Xd&&r.state<Kd,r.state=Xs,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}l&&delete e.__transition}}function tT(e){return this.each(function(){Ks(this,e)})}function nT(e,t){var n,r;return function(){var i=Bn(this,e),l=i.tween;if(l!==n){r=n=l;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function rT(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var l=Bn(this,e),o=l.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},a=0,u=i.length;a<u;++a)if(i[a].name===t){i[a]=s;break}a===u&&i.push(s)}l.tween=i}}function iT(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Pn(this.node(),n).tween,i=0,l=r.length,o;i<l;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?nT:rT)(n,e,t))}function jp(e,t,n){var r=e._id;return e.each(function(){var i=Bn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Pn(i,r).value[t]}}function kw(e,t){var n;return(typeof t=="number"?vr:t instanceof jo?_g:(n=jo(t))?(t=n,_g):FI)(e,t)}function lT(e){return function(){this.removeAttribute(e)}}function oT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function sT(e,t,n){var r,i=n+"",l;return function(){var o=this.getAttribute(e);return o===i?null:o===r?l:l=t(r=o,n)}}function aT(e,t,n){var r,i=n+"",l;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?l:l=t(r=o,n)}}function uT(e,t,n){var r,i,l;return function(){var o,s=n(this),a;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),a=s+"",o===a?null:o===r&&a===i?l:(i=a,l=t(r=o,s)))}}function cT(e,t,n){var r,i,l;return function(){var o,s=n(this),a;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),a=s+"",o===a?null:o===r&&a===i?l:(i=a,l=t(r=o,s)))}}function dT(e,t){var n=pu(e),r=n==="transform"?VI:kw;return this.attrTween(e,typeof t=="function"?(n.local?cT:uT)(n,r,jp(this,"attr."+e,t)):t==null?(n.local?oT:lT)(n):(n.local?aT:sT)(n,r,t))}function fT(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function pT(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function hT(e,t){var n,r;function i(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&pT(e,l)),n}return i._value=t,i}function mT(e,t){var n,r;function i(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&fT(e,l)),n}return i._value=t,i}function gT(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=pu(e);return this.tween(n,(r.local?hT:mT)(r,t))}function xT(e,t){return function(){_p(this,e).delay=+t.apply(this,arguments)}}function yT(e,t){return t=+t,function(){_p(this,e).delay=t}}function vT(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?xT:yT)(t,e)):Pn(this.node(),t).delay}function wT(e,t){return function(){Bn(this,e).duration=+t.apply(this,arguments)}}function kT(e,t){return t=+t,function(){Bn(this,e).duration=t}}function bT(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?wT:kT)(t,e)):Pn(this.node(),t).duration}function ST(e,t){if(typeof t!="function")throw new Error;return function(){Bn(this,e).ease=t}}function ET(e){var t=this._id;return arguments.length?this.each(ST(t,e)):Pn(this.node(),t).ease}function NT(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Bn(this,e).ease=n}}function CT(e){if(typeof e!="function")throw new Error;return this.each(NT(this._id,e))}function _T(e){typeof e!="function"&&(e=Jv(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var l=t[i],o=l.length,s=r[i]=[],a,u=0;u<o;++u)(a=l[u])&&e.call(a,a.__data__,u,l)&&s.push(a);return new tr(r,this._parents,this._name,this._id)}function jT(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,l=Math.min(r,i),o=new Array(r),s=0;s<l;++s)for(var a=t[s],u=n[s],c=a.length,d=o[s]=new Array(c),p,h=0;h<c;++h)(p=a[h]||u[h])&&(d[h]=p);for(;s<r;++s)o[s]=t[s];return new tr(o,this._parents,this._name,this._id)}function PT(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function AT(e,t,n){var r,i,l=PT(t)?_p:Bn;return function(){var o=l(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function IT(e,t){var n=this._id;return arguments.length<2?Pn(this.node(),n).on.on(e):this.each(AT(n,e,t))}function TT(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function RT(){return this.on("end.remove",TT(this._id))}function LT(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Sp(e));for(var r=this._groups,i=r.length,l=new Array(i),o=0;o<i;++o)for(var s=r[o],a=s.length,u=l[o]=new Array(a),c,d,p=0;p<a;++p)(c=s[p])&&(d=e.call(c,c.__data__,p,s))&&("__data__"in c&&(d.__data__=c.__data__),u[p]=d,mu(u[p],t,n,p,u,Pn(c,n)));return new tr(l,this._parents,t,n)}function MT(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Zv(e));for(var r=this._groups,i=r.length,l=[],o=[],s=0;s<i;++s)for(var a=r[s],u=a.length,c,d=0;d<u;++d)if(c=a[d]){for(var p=e.call(c,c.__data__,d,a),h,x=Pn(c,n),v=0,b=p.length;v<b;++v)(h=p[v])&&mu(h,t,n,v,p,x);l.push(p),o.push(c)}return new tr(l,o,t,n)}var zT=Bo.prototype.constructor;function DT(){return new zT(this._groups,this._parents)}function OT(e,t){var n,r,i;return function(){var l=cl(this,e),o=(this.style.removeProperty(e),cl(this,e));return l===o?null:l===n&&o===r?i:i=t(n=l,r=o)}}function bw(e){return function(){this.style.removeProperty(e)}}function FT(e,t,n){var r,i=n+"",l;return function(){var o=cl(this,e);return o===i?null:o===r?l:l=t(r=o,n)}}function $T(e,t,n){var r,i,l;return function(){var o=cl(this,e),s=n(this),a=s+"";return s==null&&(a=s=(this.style.removeProperty(e),cl(this,e))),o===a?null:o===r&&a===i?l:(i=a,l=t(r=o,s))}}function BT(e,t){var n,r,i,l="style."+t,o="end."+l,s;return function(){var a=Bn(this,e),u=a.on,c=a.value[l]==null?s||(s=bw(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(o,i=c),a.on=r}}function UT(e,t,n){var r=(e+="")=="transform"?UI:kw;return t==null?this.styleTween(e,OT(e,r)).on("end.style."+e,bw(e)):typeof t=="function"?this.styleTween(e,$T(e,r,jp(this,"style."+e,t))).each(BT(this._id,e)):this.styleTween(e,FT(e,r,t),n).on("end.style."+e,null)}function VT(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function HT(e,t,n){var r,i;function l(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&VT(e,o,n)),r}return l._value=t,l}function WT(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,HT(e,t,n??""))}function YT(e){return function(){this.textContent=e}}function XT(e){return function(){var t=e(this);this.textContent=t??""}}function KT(e){return this.tween("text",typeof e=="function"?XT(jp(this,"text",e)):YT(e==null?"":e+""))}function GT(e){return function(t){this.textContent=e.call(this,t)}}function qT(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&>(i)),t}return r._value=e,r}function QT(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,qT(e))}function ZT(){for(var e=this._name,t=this._id,n=Sw(),r=this._groups,i=r.length,l=0;l<i;++l)for(var o=r[l],s=o.length,a,u=0;u<s;++u)if(a=o[u]){var c=Pn(a,t);mu(a,e,n,u,o,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new tr(r,this._parents,e,n)}function JT(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(l,o){var s={value:o},a={value:function(){--i===0&&l()}};n.each(function(){var u=Bn(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(a)),u.on=t}),i===0&&l()})}var eR=0;function tr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Sw(){return++eR}var Vn=Bo.prototype;tr.prototype={constructor:tr,select:LT,selectAll:MT,selectChild:Vn.selectChild,selectChildren:Vn.selectChildren,filter:_T,merge:jT,selection:DT,transition:ZT,call:Vn.call,nodes:Vn.nodes,node:Vn.node,size:Vn.size,empty:Vn.empty,each:Vn.each,on:IT,attr:dT,attrTween:gT,style:UT,styleTween:WT,text:KT,textTween:QT,remove:RT,tween:iT,delay:vT,duration:bT,ease:ET,easeVarying:CT,end:JT,[Symbol.iterator]:Vn[Symbol.iterator]};function tR(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nR={time:null,delay:0,duration:250,ease:tR};function rR(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function iR(e){var t,n;e instanceof tr?(t=e._id,e=e._name):(t=Sw(),(n=nR).time=Cp(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,l=0;l<i;++l)for(var o=r[l],s=o.length,a,u=0;u<s;++u)(a=o[u])&&mu(a,e,t,u,o,n||rR(a,t));return new tr(r,this._parents,e,t)}Bo.prototype.interrupt=tT;Bo.prototype.transition=iR;const Cs=e=>()=>e;function lR(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Kn(e,t,n){this.k=e,this.x=t,this.y=n}Kn.prototype={constructor:Kn,scale:function(e){return e===1?this:new Kn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Kn(this.k,this.x+this.k*e,this.y+this.k*t)},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 qn=new Kn(1,0,0);Kn.prototype;function kc(e){e.stopImmediatePropagation()}function Ll(e){e.preventDefault(),e.stopImmediatePropagation()}function oR(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function sR(){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 Lg(){return this.__zoom||qn}function aR(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function uR(){return navigator.maxTouchPoints||"ontouchstart"in this}function cR(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>l?(l+o)/2:Math.min(0,l)||Math.max(0,o))}function Ew(){var e=oR,t=sR,n=cR,r=aR,i=uR,l=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,a=XI,u=fu("start","zoom","end"),c,d,p,h=500,x=150,v=0,b=10;function m(N){N.property("__zoom",Lg).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",_).filter(i).on("touchstart.zoom",O).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(N,z,R,W){var M=N.selection?N.selection():N;M.property("__zoom",Lg),N!==M?j(N,z,R,W):M.interrupt().each(function(){E(this,arguments).event(W).start().zoom(null,typeof z=="function"?z.apply(this,arguments):z).end()})},m.scaleBy=function(N,z,R,W){m.scaleTo(N,function(){var M=this.__zoom.k,A=typeof z=="function"?z.apply(this,arguments):z;return M*A},R,W)},m.scaleTo=function(N,z,R,W){m.transform(N,function(){var M=t.apply(this,arguments),A=this.__zoom,k=R==null?S(M):typeof R=="function"?R.apply(this,arguments):R,H=A.invert(k),F=typeof z=="function"?z.apply(this,arguments):z;return n(w(g(A,F),k,H),M,o)},R,W)},m.translateBy=function(N,z,R,W){m.transform(N,function(){return n(this.__zoom.translate(typeof z=="function"?z.apply(this,arguments):z,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),o)},null,W)},m.translateTo=function(N,z,R,W,M){m.transform(N,function(){var A=t.apply(this,arguments),k=this.__zoom,H=W==null?S(A):typeof W=="function"?W.apply(this,arguments):W;return n(qn.translate(H[0],H[1]).scale(k.k).translate(typeof z=="function"?-z.apply(this,arguments):-z,typeof R=="function"?-R.apply(this,arguments):-R),A,o)},W,M)};function g(N,z){return z=Math.max(l[0],Math.min(l[1],z)),z===N.k?N:new Kn(z,N.x,N.y)}function w(N,z,R){var W=z[0]-R[0]*N.k,M=z[1]-R[1]*N.k;return W===N.x&&M===N.y?N:new Kn(N.k,W,M)}function S(N){return[(+N[0][0]+ +N[1][0])/2,(+N[0][1]+ +N[1][1])/2]}function j(N,z,R,W){N.on("start.zoom",function(){E(this,arguments).event(W).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(W).end()}).tween("zoom",function(){var M=this,A=arguments,k=E(M,A).event(W),H=t.apply(M,A),F=R==null?S(H):typeof R=="function"?R.apply(M,A):R,C=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),Z=M.__zoom,re=typeof z=="function"?z.apply(M,A):z,V=a(Z.invert(F).concat(C/Z.k),re.invert(F).concat(C/re.k));return function(ie){if(ie===1)ie=re;else{var ae=V(ie),ge=C/ae[2];ie=new Kn(ge,F[0]-ae[0]*ge,F[1]-ae[1]*ge)}k.zoom(null,ie)}})}function E(N,z,R){return!R&&N.__zooming||new P(N,z)}function P(N,z){this.that=N,this.args=z,this.active=0,this.sourceEvent=null,this.extent=t.apply(N,z),this.taps=0}P.prototype={event:function(N){return N&&(this.sourceEvent=N),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(N,z){return this.mouse&&N!=="mouse"&&(this.mouse[1]=z.invert(this.mouse[0])),this.touch0&&N!=="touch"&&(this.touch0[1]=z.invert(this.touch0[0])),this.touch1&&N!=="touch"&&(this.touch1[1]=z.invert(this.touch1[0])),this.that.__zoom=z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(N){var z=un(this.that).datum();u.call(N,this.that,new lR(N,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),z)}};function I(N,...z){if(!e.apply(this,arguments))return;var R=E(this,z).event(N),W=this.__zoom,M=Math.max(l[0],Math.min(l[1],W.k*Math.pow(2,r.apply(this,arguments)))),A=kn(N);if(R.wheel)(R.mouse[0][0]!==A[0]||R.mouse[0][1]!==A[1])&&(R.mouse[1]=W.invert(R.mouse[0]=A)),clearTimeout(R.wheel);else{if(W.k===M)return;R.mouse=[A,W.invert(A)],Ks(this),R.start()}Ll(N),R.wheel=setTimeout(k,x),R.zoom("mouse",n(w(g(W,M),R.mouse[0],R.mouse[1]),R.extent,o));function k(){R.wheel=null,R.end()}}function L(N,...z){if(p||!e.apply(this,arguments))return;var R=N.currentTarget,W=E(this,z,!0).event(N),M=un(N.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",C,!0),A=kn(N,R),k=N.clientX,H=N.clientY;uw(N.view),kc(N),W.mouse=[A,this.__zoom.invert(A)],Ks(this),W.start();function F(Z){if(Ll(Z),!W.moved){var re=Z.clientX-k,V=Z.clientY-H;W.moved=re*re+V*V>v}W.event(Z).zoom("mouse",n(w(W.that.__zoom,W.mouse[0]=kn(Z,R),W.mouse[1]),W.extent,o))}function C(Z){M.on("mousemove.zoom mouseup.zoom",null),cw(Z.view,W.moved),Ll(Z),W.event(Z).end()}}function _(N,...z){if(e.apply(this,arguments)){var R=this.__zoom,W=kn(N.changedTouches?N.changedTouches[0]:N,this),M=R.invert(W),A=R.k*(N.shiftKey?.5:2),k=n(w(g(R,A),W,M),t.apply(this,z),o);Ll(N),s>0?un(this).transition().duration(s).call(j,k,W,N):un(this).call(m.transform,k,W,N)}}function O(N,...z){if(e.apply(this,arguments)){var R=N.touches,W=R.length,M=E(this,z,N.changedTouches.length===W).event(N),A,k,H,F;for(kc(N),k=0;k<W;++k)H=R[k],F=kn(H,this),F=[F,this.__zoom.invert(F),H.identifier],M.touch0?!M.touch1&&M.touch0[2]!==F[2]&&(M.touch1=F,M.taps=0):(M.touch0=F,A=!0,M.taps=1+!!c);c&&(c=clearTimeout(c)),A&&(M.taps<2&&(d=F[0],c=setTimeout(function(){c=null},h)),Ks(this),M.start())}}function U(N,...z){if(this.__zooming){var R=E(this,z).event(N),W=N.changedTouches,M=W.length,A,k,H,F;for(Ll(N),A=0;A<M;++A)k=W[A],H=kn(k,this),R.touch0&&R.touch0[2]===k.identifier?R.touch0[0]=H:R.touch1&&R.touch1[2]===k.identifier&&(R.touch1[0]=H);if(k=R.that.__zoom,R.touch1){var C=R.touch0[0],Z=R.touch0[1],re=R.touch1[0],V=R.touch1[1],ie=(ie=re[0]-C[0])*ie+(ie=re[1]-C[1])*ie,ae=(ae=V[0]-Z[0])*ae+(ae=V[1]-Z[1])*ae;k=g(k,Math.sqrt(ie/ae)),H=[(C[0]+re[0])/2,(C[1]+re[1])/2],F=[(Z[0]+V[0])/2,(Z[1]+V[1])/2]}else if(R.touch0)H=R.touch0[0],F=R.touch0[1];else return;R.zoom("touch",n(w(k,H,F),R.extent,o))}}function B(N,...z){if(this.__zooming){var R=E(this,z).event(N),W=N.changedTouches,M=W.length,A,k;for(kc(N),p&&clearTimeout(p),p=setTimeout(function(){p=null},h),A=0;A<M;++A)k=W[A],R.touch0&&R.touch0[2]===k.identifier?delete R.touch0:R.touch1&&R.touch1[2]===k.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(k=kn(k,this),Math.hypot(d[0]-k[0],d[1]-k[1])<b)){var H=un(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return m.wheelDelta=function(N){return arguments.length?(r=typeof N=="function"?N:Cs(+N),m):r},m.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Cs(!!N),m):e},m.touchable=function(N){return arguments.length?(i=typeof N=="function"?N:Cs(!!N),m):i},m.extent=function(N){return arguments.length?(t=typeof N=="function"?N:Cs([[+N[0][0],+N[0][1]],[+N[1][0],+N[1][1]]]),m):t},m.scaleExtent=function(N){return arguments.length?(l[0]=+N[0],l[1]=+N[1],m):[l[0],l[1]]},m.translateExtent=function(N){return arguments.length?(o[0][0]=+N[0][0],o[1][0]=+N[1][0],o[0][1]=+N[0][1],o[1][1]=+N[1][1],m):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},m.constrain=function(N){return arguments.length?(n=N,m):n},m.duration=function(N){return arguments.length?(s=+N,m):s},m.interpolate=function(N){return arguments.length?(a=N,m):a},m.on=function(){var N=u.on.apply(u,arguments);return N===u?m:N},m.clickDistance=function(N){return arguments.length?(v=(N=+N)*N,m):Math.sqrt(v)},m.tapDistance=function(N){return arguments.length?(b=+N,m):b},m}const gu=y.createContext(null),dR=gu.Provider,nr={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,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,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.`},Nw=nr.error001();function Ye(e,t){const n=y.useContext(gu);if(n===null)throw new Error(Nw);return qv(n,e,t)}const dt=()=>{const e=y.useContext(gu);if(e===null)throw new Error(Nw);return y.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},fR=e=>e.userSelectionActive?"none":"all";function Pp({position:e,children:t,className:n,style:r,...i}){const l=Ye(fR),o=`${e}`.split("-");return X.createElement("div",{className:St(["react-flow__panel",n,...o]),style:{...r,pointerEvents:l},...i},t)}function pR({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:X.createElement(Pp,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},X.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const hR=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:l={},labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:a,className:u,...c})=>{const d=y.useRef(null),[p,h]=y.useState({x:0,y:0,width:0,height:0}),x=St(["react-flow__edge-textwrapper",u]);return y.useEffect(()=>{if(d.current){const v=d.current.getBBox();h({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:X.createElement("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:x,visibility:p.width?"visible":"hidden",...c},i&&X.createElement("rect",{width:p.width+2*o[0],x:-o[0],y:-o[1],height:p.height+2*o[1],className:"react-flow__edge-textbg",style:l,rx:s,ry:s}),X.createElement("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:d,style:r},n),a)};var mR=y.memo(hR);const Ap=e=>({width:e.offsetWidth,height:e.offsetHeight}),fl=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ip=(e={x:0,y:0},t)=>({x:fl(e.x,t[0][0],t[1][0]),y:fl(e.y,t[0][1],t[1][1])}),Mg=(e,t,n)=>e<t?fl(Math.abs(e-t),1,50)/50:e>n?-fl(Math.abs(e-n),1,50)/50:0,Cw=(e,t)=>{const n=Mg(e.x,35,t.width-35)*20,r=Mg(e.y,35,t.height-35)*20;return[n,r]},_w=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},jw=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ao=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Pw=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),zg=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),gR=(e,t)=>Pw(jw(Ao(e),Ao(t))),Gd=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},xR=e=>dn(e.width)&&dn(e.height)&&dn(e.x)&&dn(e.y),dn=e=>!isNaN(e)&&isFinite(e),rt=Symbol.for("internals"),Aw=["Enter"," ","Escape"],yR=(e,t)=>{},vR=e=>"nativeEvent"in e;function qd(e){var i,l;const t=vR(e)?e.nativeEvent:e,n=((l=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:l[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const Iw=e=>"clientX"in e,zr=(e,t)=>{var l,o;const n=Iw(e),r=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},Ma=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Vo=({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:l,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:p,interactionWidth:h=20})=>X.createElement(X.Fragment,null,X.createElement("path",{id:e,style:c,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:p}),h&&X.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),i&&dn(n)&&dn(r)?X.createElement(mR,{x:n,y:r,label:i,labelStyle:l,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u}):null);Vo.displayName="BaseEdge";function Ml(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(l=>l.id===e);i&&n(r,{...i})}}function Tw({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,l=n<e?n+i:n-i,o=Math.abs(r-t)/2,s=r<t?r+o:r-o;return[l,s,i,o]}function Rw({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:l,targetControlX:o,targetControlY:s}){const a=e*.125+i*.375+o*.375+n*.125,u=t*.125+l*.375+s*.375+r*.125,c=Math.abs(a-e),d=Math.abs(u-t);return[a,u,c,d]}var xi;(function(e){e.Strict="strict",e.Loose="loose"})(xi||(xi={}));var li;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(li||(li={}));var Io;(function(e){e.Partial="partial",e.Full="full"})(Io||(Io={}));var Sr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Sr||(Sr={}));var za;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(za||(za={}));var me;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(me||(me={}));function Dg({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===me.Left||e===me.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function Lw({sourceX:e,sourceY:t,sourcePosition:n=me.Bottom,targetX:r,targetY:i,targetPosition:l=me.Top}){const[o,s]=Dg({pos:n,x1:e,y1:t,x2:r,y2:i}),[a,u]=Dg({pos:l,x1:r,y1:i,x2:e,y2:t}),[c,d,p,h]=Rw({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:a,targetControlY:u});return[`M${e},${t} C${o},${s} ${a},${u} ${r},${i}`,c,d,p,h]}const Tp=y.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=me.Bottom,targetPosition:l=me.Top,label:o,labelStyle:s,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:p,markerEnd:h,markerStart:x,interactionWidth:v})=>{const[b,m,g]=Lw({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:l});return X.createElement(Vo,{path:b,labelX:m,labelY:g,label:o,labelStyle:s,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:p,markerEnd:h,markerStart:x,interactionWidth:v})});Tp.displayName="SimpleBezierEdge";const Og={[me.Left]:{x:-1,y:0},[me.Right]:{x:1,y:0},[me.Top]:{x:0,y:-1},[me.Bottom]:{x:0,y:1}},wR=({source:e,sourcePosition:t=me.Bottom,target:n})=>t===me.Left||t===me.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Fg=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function kR({source:e,sourcePosition:t=me.Bottom,target:n,targetPosition:r=me.Top,center:i,offset:l}){const o=Og[t],s=Og[r],a={x:e.x+o.x*l,y:e.y+o.y*l},u={x:n.x+s.x*l,y:n.y+s.y*l},c=wR({source:a,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",p=c[d];let h=[],x,v;const b={x:0,y:0},m={x:0,y:0},[g,w,S,j]=Tw({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[d]*s[d]===-1){x=i.x??g,v=i.y??w;const P=[{x,y:a.y},{x,y:u.y}],I=[{x:a.x,y:v},{x:u.x,y:v}];o[d]===p?h=d==="x"?P:I:h=d==="x"?I:P}else{const P=[{x:a.x,y:u.y}],I=[{x:u.x,y:a.y}];if(d==="x"?h=o.x===p?I:P:h=o.y===p?P:I,t===r){const B=Math.abs(e[d]-n[d]);if(B<=l){const N=Math.min(l-1,l-B);o[d]===p?b[d]=(a[d]>e[d]?-1:1)*N:m[d]=(u[d]>n[d]?-1:1)*N}}if(t!==r){const B=d==="x"?"y":"x",N=o[d]===s[B],z=a[B]>u[B],R=a[B]<u[B];(o[d]===1&&(!N&&z||N&&R)||o[d]!==1&&(!N&&R||N&&z))&&(h=d==="x"?P:I)}const L={x:a.x+b.x,y:a.y+b.y},_={x:u.x+m.x,y:u.y+m.y},O=Math.max(Math.abs(L.x-h[0].x),Math.abs(_.x-h[0].x)),U=Math.max(Math.abs(L.y-h[0].y),Math.abs(_.y-h[0].y));O>=U?(x=(L.x+_.x)/2,v=h[0].y):(x=h[0].x,v=(L.y+_.y)/2)}return[[e,{x:a.x+b.x,y:a.y+b.y},...h,{x:u.x+m.x,y:u.y+m.y},n],x,v,S,j]}function bR(e,t,n,r){const i=Math.min(Fg(e,t)/2,Fg(t,n)/2,r),{x:l,y:o}=t;if(e.x===l&&l===n.x||e.y===o&&o===n.y)return`L${l} ${o}`;if(e.y===o){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${l+i*u},${o}Q ${l},${o} ${l},${o+i*c}`}const s=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${l},${o+i*a}Q ${l},${o} ${l+i*s},${o}`}function Qd({sourceX:e,sourceY:t,sourcePosition:n=me.Bottom,targetX:r,targetY:i,targetPosition:l=me.Top,borderRadius:o=5,centerX:s,centerY:a,offset:u=20}){const[c,d,p,h,x]=kR({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:l,center:{x:s,y:a},offset:u});return[c.reduce((b,m,g)=>{let w="";return g>0&&g<c.length-1?w=bR(c[g-1],m,c[g+1],o):w=`${g===0?"M":"L"}${m.x} ${m.y}`,b+=w,b},""),d,p,h,x]}const xu=y.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:l,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u,style:c,sourcePosition:d=me.Bottom,targetPosition:p=me.Top,markerEnd:h,markerStart:x,pathOptions:v,interactionWidth:b})=>{const[m,g,w]=Qd({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:p,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset});return X.createElement(Vo,{path:m,labelX:g,labelY:w,label:i,labelStyle:l,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:h,markerStart:x,interactionWidth:b})});xu.displayName="SmoothStepEdge";const Rp=y.memo(e=>{var t;return X.createElement(xu,{...e,pathOptions:y.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});Rp.displayName="StepEdge";function SR({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,l,o,s]=Tw({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,l,o,s]}const Lp=y.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:l,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:p,interactionWidth:h})=>{const[x,v,b]=SR({sourceX:e,sourceY:t,targetX:n,targetY:r});return X.createElement(Vo,{path:x,labelX:v,labelY:b,label:i,labelStyle:l,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:p,interactionWidth:h})});Lp.displayName="StraightEdge";function _s(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function $g({pos:e,x1:t,y1:n,x2:r,y2:i,c:l}){switch(e){case me.Left:return[t-_s(t-r,l),n];case me.Right:return[t+_s(r-t,l),n];case me.Top:return[t,n-_s(n-i,l)];case me.Bottom:return[t,n+_s(i-n,l)]}}function Mw({sourceX:e,sourceY:t,sourcePosition:n=me.Bottom,targetX:r,targetY:i,targetPosition:l=me.Top,curvature:o=.25}){const[s,a]=$g({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[u,c]=$g({pos:l,x1:r,y1:i,x2:e,y2:t,c:o}),[d,p,h,x]=Rw({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${s},${a} ${u},${c} ${r},${i}`,d,p,h,x]}const Da=y.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=me.Bottom,targetPosition:l=me.Top,label:o,labelStyle:s,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:p,markerEnd:h,markerStart:x,pathOptions:v,interactionWidth:b})=>{const[m,g,w]=Mw({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:l,curvature:v==null?void 0:v.curvature});return X.createElement(Vo,{path:m,labelX:g,labelY:w,label:o,labelStyle:s,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:p,markerEnd:h,markerStart:x,interactionWidth:b})});Da.displayName="BezierEdge";const Mp=y.createContext(null),ER=Mp.Provider;Mp.Consumer;const NR=()=>y.useContext(Mp),CR=e=>"id"in e&&"source"in e&&"target"in e,_R=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Zd=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,jR=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),PR=(e,t)=>{if(!e.source||!e.target)return t;let n;return CR(e)?n={...e}:n={...e,id:_R(e)},jR(n,t)?t:t.concat(n)},Jd=({x:e,y:t},[n,r,i],l,[o,s])=>{const a={x:(e-n)/i,y:(t-r)/i};return l?{x:o*Math.round(a.x/o),y:s*Math.round(a.y/s)}:a},zw=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),ui=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],i={x:e.position.x-n,y:e.position.y-r};return{...i,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:i}},yu=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const{x:l,y:o}=ui(i,t).positionAbsolute;return jw(r,Ao({x:l,y:o,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Pw(n)},Dw=(e,t,[n,r,i]=[0,0,1],l=!1,o=!1,s=[0,0])=>{const a={x:(t.x-n)/i,y:(t.y-r)/i,width:t.width/i,height:t.height/i},u=[];return e.forEach(c=>{const{width:d,height:p,selectable:h=!0,hidden:x=!1}=c;if(o&&!h||x)return!1;const{positionAbsolute:v}=ui(c,s),b={x:v.x,y:v.y,width:d||0,height:p||0},m=Gd(a,b),g=typeof d>"u"||typeof p>"u"||d===null||p===null,w=l&&m>0,S=(d||0)*(p||0);(g||w||m>=S||c.dragging)&&u.push(c)}),u},Ow=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},Fw=(e,t,n,r,i,l=.1)=>{const o=t/(e.width*(1+l)),s=n/(e.height*(1+l)),a=Math.min(o,s),u=fl(a,r,i),c=e.x+e.width/2,d=e.y+e.height/2,p=t/2-c*u,h=n/2-d*u;return{x:p,y:h,zoom:u}},Jr=(e,t=0)=>e.transition().duration(t);function Bg(e,t,n,r){return(t[n]||[]).reduce((i,l)=>{var o,s;return`${e.id}-${l.id}-${n}`!==r&&i.push({id:l.id||null,type:n,nodeId:e.id,x:(((o=e.positionAbsolute)==null?void 0:o.x)??0)+l.x+l.width/2,y:(((s=e.positionAbsolute)==null?void 0:s.y)??0)+l.y+l.height/2}),i},[])}function AR(e,t,n,r,i,l){const{x:o,y:s}=zr(e),u=t.elementsFromPoint(o,s).find(x=>x.classList.contains("react-flow__handle"));if(u){const x=u.getAttribute("data-nodeid");if(x){const v=zp(void 0,u),b=u.getAttribute("data-handleid"),m=l({nodeId:x,id:b,type:v});if(m){const g=i.find(w=>w.nodeId===x&&w.type===v&&w.id===b);return{handle:{id:b,type:v,nodeId:x,x:(g==null?void 0:g.x)||n.x,y:(g==null?void 0:g.y)||n.y},validHandleResult:m}}}}let c=[],d=1/0;if(i.forEach(x=>{const v=Math.sqrt((x.x-n.x)**2+(x.y-n.y)**2);if(v<=r){const b=l(x);v<=d&&(v<d?c=[{handle:x,validHandleResult:b}]:v===d&&c.push({handle:x,validHandleResult:b}),d=v)}}),!c.length)return{handle:null,validHandleResult:$w()};if(c.length===1)return c[0];const p=c.some(({validHandleResult:x})=>x.isValid),h=c.some(({handle:x})=>x.type==="target");return c.find(({handle:x,validHandleResult:v})=>h?x.type==="target":p?v.isValid:!0)||c[0]}const IR={source:null,target:null,sourceHandle:null,targetHandle:null},$w=()=>({handleDomNode:null,isValid:!1,connection:IR,endHandle:null});function Bw(e,t,n,r,i,l,o){const s=i==="target",a=o.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),u={...$w(),handleDomNode:a};if(a){const c=zp(void 0,a),d=a.getAttribute("data-nodeid"),p=a.getAttribute("data-handleid"),h=a.classList.contains("connectable"),x=a.classList.contains("connectableend"),v={source:s?d:n,sourceHandle:s?p:r,target:s?n:d,targetHandle:s?r:p};u.connection=v,h&&x&&(t===xi.Strict?s&&c==="source"||!s&&c==="target":d!==n||p!==r)&&(u.endHandle={nodeId:d,handleId:p,type:c},u.isValid=l(v))}return u}function TR({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((i,l)=>{if(l[rt]){const{handleBounds:o}=l[rt];let s=[],a=[];o&&(s=Bg(l,o,"source",`${t}-${n}-${r}`),a=Bg(l,o,"target",`${t}-${n}-${r}`)),i.push(...s,...a)}return i},[])}function zp(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function bc(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function RR(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Uw({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:l,setState:o,isValidConnection:s,edgeUpdaterType:a,onReconnectEnd:u}){const c=_w(e.target),{connectionMode:d,domNode:p,autoPanOnConnect:h,connectionRadius:x,onConnectStart:v,panBy:b,getNodes:m,cancelConnection:g}=l();let w=0,S;const{x:j,y:E}=zr(e),P=c==null?void 0:c.elementFromPoint(j,E),I=zp(a,P),L=p==null?void 0:p.getBoundingClientRect();if(!L||!I)return;let _,O=zr(e,L),U=!1,B=null,N=!1,z=null;const R=TR({nodes:m(),nodeId:n,handleId:t,handleType:I}),W=()=>{if(!h)return;const[k,H]=Cw(O,L);b({x:k,y:H}),w=requestAnimationFrame(W)};o({connectionPosition:O,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:I,connectionStartHandle:{nodeId:n,handleId:t,type:I},connectionEndHandle:null}),v==null||v(e,{nodeId:n,handleId:t,handleType:I});function M(k){const{transform:H}=l();O=zr(k,L);const{handle:F,validHandleResult:C}=AR(k,c,Jd(O,H,!1,[1,1]),x,R,Z=>Bw(Z,d,n,t,i?"target":"source",s,c));if(S=F,U||(W(),U=!0),z=C.handleDomNode,B=C.connection,N=C.isValid,o({connectionPosition:S&&N?zw({x:S.x,y:S.y},H):O,connectionStatus:RR(!!S,N),connectionEndHandle:C.endHandle}),!S&&!N&&!z)return bc(_);B.source!==B.target&&z&&(bc(_),_=z,z.classList.add("connecting","react-flow__handle-connecting"),z.classList.toggle("valid",N),z.classList.toggle("react-flow__handle-valid",N))}function A(k){var H,F;(S||z)&&B&&N&&(r==null||r(B)),(F=(H=l()).onConnectEnd)==null||F.call(H,k),a&&(u==null||u(k)),bc(_),g(),cancelAnimationFrame(w),U=!1,N=!1,B=null,z=null,c.removeEventListener("mousemove",M),c.removeEventListener("mouseup",A),c.removeEventListener("touchmove",M),c.removeEventListener("touchend",A)}c.addEventListener("mousemove",M),c.addEventListener("mouseup",A),c.addEventListener("touchmove",M),c.addEventListener("touchend",A)}const Ug=()=>!0,LR=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),MR=(e,t,n)=>r=>{const{connectionStartHandle:i,connectionEndHandle:l,connectionClickStartHandle:o}=r;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n||(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.handleId)===t&&(l==null?void 0:l.type)===n,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n}},Vw=y.forwardRef(({type:e="source",position:t=me.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:l=!0,id:o,onConnect:s,children:a,className:u,onMouseDown:c,onTouchStart:d,...p},h)=>{var L,_;const x=o||null,v=e==="target",b=dt(),m=NR(),{connectOnClick:g,noPanClassName:w}=Ye(LR,gt),{connecting:S,clickConnecting:j}=Ye(MR(m,x,e),gt);m||(_=(L=b.getState()).onError)==null||_.call(L,"010",nr.error010());const E=O=>{const{defaultEdgeOptions:U,onConnect:B,hasDefaultEdges:N}=b.getState(),z={...U,...O};if(N){const{edges:R,setEdges:W}=b.getState();W(PR(z,R))}B==null||B(z),s==null||s(z)},P=O=>{if(!m)return;const U=Iw(O);i&&(U&&O.button===0||!U)&&Uw({event:O,handleId:x,nodeId:m,onConnect:E,isTarget:v,getState:b.getState,setState:b.setState,isValidConnection:n||b.getState().isValidConnection||Ug}),U?c==null||c(O):d==null||d(O)},I=O=>{const{onClickConnectStart:U,onClickConnectEnd:B,connectionClickStartHandle:N,connectionMode:z,isValidConnection:R}=b.getState();if(!m||!N&&!i)return;if(!N){U==null||U(O,{nodeId:m,handleId:x,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:m,type:e,handleId:x}});return}const W=_w(O.target),M=n||R||Ug,{connection:A,isValid:k}=Bw({nodeId:m,id:x,type:e},z,N.nodeId,N.handleId||null,N.type,M,W);k&&E(A),B==null||B(O),b.setState({connectionClickStartHandle:null})};return X.createElement("div",{"data-handleid":x,"data-nodeid":m,"data-handlepos":t,"data-id":`${m}-${x}-${e}`,className:St(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",w,u,{source:!v,target:v,connectable:r,connectablestart:i,connectableend:l,connecting:j,connectionindicator:r&&(i&&!S||l&&S)}]),onMouseDown:P,onTouchStart:P,onClick:g?I:void 0,ref:h,...p},a)});Vw.displayName="Handle";var Oa=y.memo(Vw);const Hw=({data:e,isConnectable:t,targetPosition:n=me.Top,sourcePosition:r=me.Bottom})=>X.createElement(X.Fragment,null,X.createElement(Oa,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,X.createElement(Oa,{type:"source",position:r,isConnectable:t}));Hw.displayName="DefaultNode";var ef=y.memo(Hw);const Ww=({data:e,isConnectable:t,sourcePosition:n=me.Bottom})=>X.createElement(X.Fragment,null,e==null?void 0:e.label,X.createElement(Oa,{type:"source",position:n,isConnectable:t}));Ww.displayName="InputNode";var Yw=y.memo(Ww);const Xw=({data:e,isConnectable:t,targetPosition:n=me.Top})=>X.createElement(X.Fragment,null,X.createElement(Oa,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);Xw.displayName="OutputNode";var Kw=y.memo(Xw);const Dp=()=>null;Dp.displayName="GroupNode";const zR=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),js=e=>e.id;function DR(e,t){return gt(e.selectedNodes.map(js),t.selectedNodes.map(js))&>(e.selectedEdges.map(js),t.selectedEdges.map(js))}const Gw=y.memo(({onSelectionChange:e})=>{const t=dt(),{selectedNodes:n,selectedEdges:r}=Ye(zR,DR);return y.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChange.forEach(l=>l(i))},[n,r,e]),null});Gw.displayName="SelectionListener";const OR=e=>!!e.onSelectionChange;function FR({onSelectionChange:e}){const t=Ye(OR);return e||t?X.createElement(Gw,{onSelectionChange:e}):null}const $R=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Ci(e,t){y.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Ce(e,t,n){y.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const BR=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:i,onConnectStart:l,onConnectEnd:o,onClickConnectStart:s,onClickConnectEnd:a,nodesDraggable:u,nodesConnectable:c,nodesFocusable:d,edgesFocusable:p,edgesUpdatable:h,elevateNodesOnSelect:x,minZoom:v,maxZoom:b,nodeExtent:m,onNodesChange:g,onEdgesChange:w,elementsSelectable:S,connectionMode:j,snapGrid:E,snapToGrid:P,translateExtent:I,connectOnClick:L,defaultEdgeOptions:_,fitView:O,fitViewOptions:U,onNodesDelete:B,onEdgesDelete:N,onNodeDrag:z,onNodeDragStart:R,onNodeDragStop:W,onSelectionDrag:M,onSelectionDragStart:A,onSelectionDragStop:k,noPanClassName:H,nodeOrigin:F,rfId:C,autoPanOnConnect:Z,autoPanOnNodeDrag:re,onError:V,connectionRadius:ie,isValidConnection:ae,nodeDragThreshold:ge})=>{const{setNodes:ve,setEdges:Re,setDefaultNodesAndEdges:Ae,setMinZoom:Be,setMaxZoom:ze,setTranslateExtent:Ie,setNodeExtent:Oe,reset:Ne}=Ye($R,gt),ce=dt();return y.useEffect(()=>{const Fe=r==null?void 0:r.map(it=>({...it,..._}));return Ae(n,Fe),()=>{Ne()}},[]),Ce("defaultEdgeOptions",_,ce.setState),Ce("connectionMode",j,ce.setState),Ce("onConnect",i,ce.setState),Ce("onConnectStart",l,ce.setState),Ce("onConnectEnd",o,ce.setState),Ce("onClickConnectStart",s,ce.setState),Ce("onClickConnectEnd",a,ce.setState),Ce("nodesDraggable",u,ce.setState),Ce("nodesConnectable",c,ce.setState),Ce("nodesFocusable",d,ce.setState),Ce("edgesFocusable",p,ce.setState),Ce("edgesUpdatable",h,ce.setState),Ce("elementsSelectable",S,ce.setState),Ce("elevateNodesOnSelect",x,ce.setState),Ce("snapToGrid",P,ce.setState),Ce("snapGrid",E,ce.setState),Ce("onNodesChange",g,ce.setState),Ce("onEdgesChange",w,ce.setState),Ce("connectOnClick",L,ce.setState),Ce("fitViewOnInit",O,ce.setState),Ce("fitViewOnInitOptions",U,ce.setState),Ce("onNodesDelete",B,ce.setState),Ce("onEdgesDelete",N,ce.setState),Ce("onNodeDrag",z,ce.setState),Ce("onNodeDragStart",R,ce.setState),Ce("onNodeDragStop",W,ce.setState),Ce("onSelectionDrag",M,ce.setState),Ce("onSelectionDragStart",A,ce.setState),Ce("onSelectionDragStop",k,ce.setState),Ce("noPanClassName",H,ce.setState),Ce("nodeOrigin",F,ce.setState),Ce("rfId",C,ce.setState),Ce("autoPanOnConnect",Z,ce.setState),Ce("autoPanOnNodeDrag",re,ce.setState),Ce("onError",V,ce.setState),Ce("connectionRadius",ie,ce.setState),Ce("isValidConnection",ae,ce.setState),Ce("nodeDragThreshold",ge,ce.setState),Ci(e,ve),Ci(t,Re),Ci(v,Be),Ci(b,ze),Ci(I,Ie),Ci(m,Oe),null},Vg={display:"none"},UR={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},qw="react-flow__node-desc",Qw="react-flow__edge-desc",VR="react-flow__aria-live",HR=e=>e.ariaLiveMessage;function WR({rfId:e}){const t=Ye(HR);return X.createElement("div",{id:`${VR}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:UR},t)}function YR({rfId:e,disableKeyboardA11y:t}){return X.createElement(X.Fragment,null,X.createElement("div",{id:`${qw}-${e}`,style:Vg},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),X.createElement("div",{id:`${Qw}-${e}`,style:Vg},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&X.createElement(WR,{rfId:e}))}var To=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=y.useState(!1),i=y.useRef(!1),l=y.useRef(new Set([])),[o,s]=y.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=u.reduce((d,p)=>d.concat(...p),[]);return[u,c]}return[[],[]]},[e]);return y.useEffect(()=>{const a=typeof document<"u"?document:null,u=(t==null?void 0:t.target)||a;if(e!==null){const c=h=>{if(i.current=h.ctrlKey||h.metaKey||h.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&qd(h))return!1;const v=Wg(h.code,s);l.current.add(h[v]),Hg(o,l.current,!1)&&(h.preventDefault(),r(!0))},d=h=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&qd(h))return!1;const v=Wg(h.code,s);Hg(o,l.current,!0)?(r(!1),l.current.clear()):l.current.delete(h[v]),h.key==="Meta"&&l.current.clear(),i.current=!1},p=()=>{l.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",c),u==null||u.addEventListener("keyup",d),window.addEventListener("blur",p),()=>{u==null||u.removeEventListener("keydown",c),u==null||u.removeEventListener("keyup",d),window.removeEventListener("blur",p)}}},[e,r]),n};function Hg(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function Wg(e,t){return t.includes(e)?"code":"key"}function Zw(e,t,n,r){var s,a;const i=e.parentNode||e.parentId;if(!i)return n;const l=t.get(i),o=ui(l,r);return Zw(l,t,{x:(n.x??0)+o.x,y:(n.y??0)+o.y,z:(((s=l[rt])==null?void 0:s.z)??0)>(n.z??0)?((a=l[rt])==null?void 0:a.z)??0:n.z??0},r)}function Jw(e,t,n){e.forEach(r=>{var l;const i=r.parentNode||r.parentId;if(i&&!e.has(i))throw new Error(`Parent node ${i} not found`);if(i||n!=null&&n[r.id]){const{x:o,y:s,z:a}=Zw(r,e,{...r.position,z:((l=r[rt])==null?void 0:l.z)??0},t);r.positionAbsolute={x:o,y:s},r[rt].z=a,n!=null&&n[r.id]&&(r[rt].isParent=!0)}})}function Sc(e,t,n,r){const i=new Map,l={},o=r?1e3:0;return e.forEach(s=>{var h;const a=(dn(s.zIndex)?s.zIndex:0)+(s.selected?o:0),u=t.get(s.id),c={...s,positionAbsolute:{x:s.position.x,y:s.position.y}},d=s.parentNode||s.parentId;d&&(l[d]=!0);const p=(u==null?void 0:u.type)&&(u==null?void 0:u.type)!==s.type;Object.defineProperty(c,rt,{enumerable:!1,value:{handleBounds:p||(h=u==null?void 0:u[rt])==null?void 0:h.handleBounds,z:a}}),i.set(s.id,c)}),Jw(i,n,l),i}function e1(e,t={}){const{getNodes:n,width:r,height:i,minZoom:l,maxZoom:o,d3Zoom:s,d3Selection:a,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:d}=e(),p=t.initial&&!u&&c;if(s&&a&&(p||!t.initial)){const x=n().filter(b=>{var g;const m=t.includeHiddenNodes?b.width&&b.height:!b.hidden;return(g=t.nodes)!=null&&g.length?m&&t.nodes.some(w=>w.id===b.id):m}),v=x.every(b=>b.width&&b.height);if(x.length>0&&v){const b=yu(x,d),{x:m,y:g,zoom:w}=Fw(b,r,i,t.minZoom??l,t.maxZoom??o,t.padding??.1),S=qn.translate(m,g).scale(w);return typeof t.duration=="number"&&t.duration>0?s.transform(Jr(a,t.duration),S):s.transform(a,S),!0}}return!1}function XR(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[rt]:r[rt],selected:n.selected})}),new Map(t)}function KR(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function Ps({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:i,edges:l,onNodesChange:o,onEdgesChange:s,hasDefaultNodes:a,hasDefaultEdges:u}=n();e!=null&&e.length&&(a&&r({nodeInternals:XR(e,i)}),o==null||o(e)),t!=null&&t.length&&(u&&r({edges:KR(t,l)}),s==null||s(t))}const _i=()=>{},GR={zoomIn:_i,zoomOut:_i,zoomTo:_i,getZoom:()=>1,setViewport:_i,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:_i,fitBounds:_i,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},qR=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),QR=()=>{const e=dt(),{d3Zoom:t,d3Selection:n}=Ye(qR,gt);return y.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(Jr(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(Jr(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,l)=>t.scaleTo(Jr(n,l==null?void 0:l.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,l)=>{const[o,s,a]=e.getState().transform,u=qn.translate(i.x??o,i.y??s).scale(i.zoom??a);t.transform(Jr(n,l==null?void 0:l.duration),u)},getViewport:()=>{const[i,l,o]=e.getState().transform;return{x:i,y:l,zoom:o}},fitView:i=>e1(e.getState,i),setCenter:(i,l,o)=>{const{width:s,height:a,maxZoom:u}=e.getState(),c=typeof(o==null?void 0:o.zoom)<"u"?o.zoom:u,d=s/2-i*c,p=a/2-l*c,h=qn.translate(d,p).scale(c);t.transform(Jr(n,o==null?void 0:o.duration),h)},fitBounds:(i,l)=>{const{width:o,height:s,minZoom:a,maxZoom:u}=e.getState(),{x:c,y:d,zoom:p}=Fw(i,o,s,a,u,(l==null?void 0:l.padding)??.1),h=qn.translate(c,d).scale(p);t.transform(Jr(n,l==null?void 0:l.duration),h)},project:i=>{const{transform:l,snapToGrid:o,snapGrid:s}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Jd(i,l,o,s)},screenToFlowPosition:i=>{const{transform:l,snapToGrid:o,snapGrid:s,domNode:a}=e.getState();if(!a)return i;const{x:u,y:c}=a.getBoundingClientRect(),d={x:i.x-u,y:i.y-c};return Jd(d,l,o,s)},flowToScreenPosition:i=>{const{transform:l,domNode:o}=e.getState();if(!o)return i;const{x:s,y:a}=o.getBoundingClientRect(),u=zw(i,l);return{x:u.x+s,y:u.y+a}},viewportInitialized:!0}:GR,[t,n])};function Op(){const e=QR(),t=dt(),n=y.useCallback(()=>t.getState().getNodes().map(v=>({...v})),[]),r=y.useCallback(v=>t.getState().nodeInternals.get(v),[]),i=y.useCallback(()=>{const{edges:v=[]}=t.getState();return v.map(b=>({...b}))},[]),l=y.useCallback(v=>{const{edges:b=[]}=t.getState();return b.find(m=>m.id===v)},[]),o=y.useCallback(v=>{const{getNodes:b,setNodes:m,hasDefaultNodes:g,onNodesChange:w}=t.getState(),S=b(),j=typeof v=="function"?v(S):v;if(g)m(j);else if(w){const E=j.length===0?S.map(P=>({type:"remove",id:P.id})):j.map(P=>({item:P,type:"reset"}));w(E)}},[]),s=y.useCallback(v=>{const{edges:b=[],setEdges:m,hasDefaultEdges:g,onEdgesChange:w}=t.getState(),S=typeof v=="function"?v(b):v;if(g)m(S);else if(w){const j=S.length===0?b.map(E=>({type:"remove",id:E.id})):S.map(E=>({item:E,type:"reset"}));w(j)}},[]),a=y.useCallback(v=>{const b=Array.isArray(v)?v:[v],{getNodes:m,setNodes:g,hasDefaultNodes:w,onNodesChange:S}=t.getState();if(w){const E=[...m(),...b];g(E)}else if(S){const j=b.map(E=>({item:E,type:"add"}));S(j)}},[]),u=y.useCallback(v=>{const b=Array.isArray(v)?v:[v],{edges:m=[],setEdges:g,hasDefaultEdges:w,onEdgesChange:S}=t.getState();if(w)g([...m,...b]);else if(S){const j=b.map(E=>({item:E,type:"add"}));S(j)}},[]),c=y.useCallback(()=>{const{getNodes:v,edges:b=[],transform:m}=t.getState(),[g,w,S]=m;return{nodes:v().map(j=>({...j})),edges:b.map(j=>({...j})),viewport:{x:g,y:w,zoom:S}}},[]),d=y.useCallback(({nodes:v,edges:b})=>{const{nodeInternals:m,getNodes:g,edges:w,hasDefaultNodes:S,hasDefaultEdges:j,onNodesDelete:E,onEdgesDelete:P,onNodesChange:I,onEdgesChange:L}=t.getState(),_=(v||[]).map(z=>z.id),O=(b||[]).map(z=>z.id),U=g().reduce((z,R)=>{const W=R.parentNode||R.parentId,M=!_.includes(R.id)&&W&&z.find(k=>k.id===W);return(typeof R.deletable=="boolean"?R.deletable:!0)&&(_.includes(R.id)||M)&&z.push(R),z},[]),B=w.filter(z=>typeof z.deletable=="boolean"?z.deletable:!0),N=B.filter(z=>O.includes(z.id));if(U||N){const z=Ow(U,B),R=[...N,...z],W=R.reduce((M,A)=>(M.includes(A.id)||M.push(A.id),M),[]);if((j||S)&&(j&&t.setState({edges:w.filter(M=>!W.includes(M.id))}),S&&(U.forEach(M=>{m.delete(M.id)}),t.setState({nodeInternals:new Map(m)}))),W.length>0&&(P==null||P(R),L&&L(W.map(M=>({id:M,type:"remove"})))),U.length>0&&(E==null||E(U),I)){const M=U.map(A=>({id:A.id,type:"remove"}));I(M)}}},[]),p=y.useCallback(v=>{const b=xR(v),m=b?null:t.getState().nodeInternals.get(v.id);return!b&&!m?[null,null,b]:[b?v:zg(m),m,b]},[]),h=y.useCallback((v,b=!0,m)=>{const[g,w,S]=p(v);return g?(m||t.getState().getNodes()).filter(j=>{if(!S&&(j.id===w.id||!j.positionAbsolute))return!1;const E=zg(j),P=Gd(E,g);return b&&P>0||P>=g.width*g.height}):[]},[]),x=y.useCallback((v,b,m=!0)=>{const[g]=p(v);if(!g)return!1;const w=Gd(g,b);return m&&w>0||w>=g.width*g.height},[]);return y.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:l,setNodes:o,setEdges:s,addNodes:a,addEdges:u,toObject:c,deleteElements:d,getIntersectingNodes:h,isNodeIntersecting:x}),[e,n,r,i,l,o,s,a,u,c,d,h,x])}const ZR={actInsideInputWithModifier:!1};var JR=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=dt(),{deleteElements:r}=Op(),i=To(e,ZR),l=To(t);y.useEffect(()=>{if(i){const{edges:o,getNodes:s}=n.getState(),a=s().filter(c=>c.selected),u=o.filter(c=>c.selected);r({nodes:a,edges:u}),n.setState({nodesSelectionActive:!1})}},[i]),y.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])};function eL(e){const t=dt();y.useEffect(()=>{let n;const r=()=>{var l,o;if(!e.current)return;const i=Ap(e.current);(i.height===0||i.width===0)&&((o=(l=t.getState()).onError)==null||o.call(l,"004",nr.error004())),t.setState({width:i.width||500,height:i.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const Fp={position:"absolute",width:"100%",height:"100%",top:0,left:0},tL=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,As=e=>({x:e.x,y:e.y,zoom:e.k}),ji=(e,t)=>e.target.closest(`.${t}`),Yg=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Xg=e=>{const t=e.ctrlKey&&Ma()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},nL=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),rL=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:l=!0,panOnScroll:o=!1,panOnScrollSpeed:s=.5,panOnScrollMode:a=li.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:d=!0,defaultViewport:p,translateExtent:h,minZoom:x,maxZoom:v,zoomActivationKeyCode:b,preventScrolling:m=!0,children:g,noWheelClassName:w,noPanClassName:S})=>{const j=y.useRef(),E=dt(),P=y.useRef(!1),I=y.useRef(!1),L=y.useRef(null),_=y.useRef({x:0,y:0,zoom:0}),{d3Zoom:O,d3Selection:U,d3ZoomHandler:B,userSelectionActive:N}=Ye(nL,gt),z=To(b),R=y.useRef(0),W=y.useRef(!1),M=y.useRef();return eL(L),y.useEffect(()=>{if(L.current){const A=L.current.getBoundingClientRect(),k=Ew().scaleExtent([x,v]).translateExtent(h),H=un(L.current).call(k),F=qn.translate(p.x,p.y).scale(fl(p.zoom,x,v)),C=[[0,0],[A.width,A.height]],Z=k.constrain()(F,C,h);k.transform(H,Z),k.wheelDelta(Xg),E.setState({d3Zoom:k,d3Selection:H,d3ZoomHandler:H.on("wheel.zoom"),transform:[Z.x,Z.y,Z.k],domNode:L.current.closest(".react-flow")})}},[]),y.useEffect(()=>{U&&O&&(o&&!z&&!N?U.on("wheel.zoom",A=>{if(ji(A,w))return!1;A.preventDefault(),A.stopImmediatePropagation();const k=U.property("__zoom").k||1;if(A.ctrlKey&&l){const ae=kn(A),ge=Xg(A),ve=k*Math.pow(2,ge);O.scaleTo(U,ve,ae,A);return}const H=A.deltaMode===1?20:1;let F=a===li.Vertical?0:A.deltaX*H,C=a===li.Horizontal?0:A.deltaY*H;!Ma()&&A.shiftKey&&a!==li.Vertical&&(F=A.deltaY*H,C=0),O.translateBy(U,-(F/k)*s,-(C/k)*s,{internal:!0});const Z=As(U.property("__zoom")),{onViewportChangeStart:re,onViewportChange:V,onViewportChangeEnd:ie}=E.getState();clearTimeout(M.current),W.current||(W.current=!0,t==null||t(A,Z),re==null||re(Z)),W.current&&(e==null||e(A,Z),V==null||V(Z),M.current=setTimeout(()=>{n==null||n(A,Z),ie==null||ie(Z),W.current=!1},150))},{passive:!1}):typeof B<"u"&&U.on("wheel.zoom",function(A,k){if(!m&&A.type==="wheel"&&!A.ctrlKey||ji(A,w))return null;A.preventDefault(),B.call(this,A,k)},{passive:!1}))},[N,o,a,U,O,B,z,l,m,w,t,e,n]),y.useEffect(()=>{O&&O.on("start",A=>{var F,C;if(!A.sourceEvent||A.sourceEvent.internal)return null;R.current=(F=A.sourceEvent)==null?void 0:F.button;const{onViewportChangeStart:k}=E.getState(),H=As(A.transform);P.current=!0,_.current=H,((C=A.sourceEvent)==null?void 0:C.type)==="mousedown"&&E.setState({paneDragging:!0}),k==null||k(H),t==null||t(A.sourceEvent,H)})},[O,t]),y.useEffect(()=>{O&&(N&&!P.current?O.on("zoom",null):N||O.on("zoom",A=>{var H;const{onViewportChange:k}=E.getState();if(E.setState({transform:[A.transform.x,A.transform.y,A.transform.k]}),I.current=!!(r&&Yg(d,R.current??0)),(e||k)&&!((H=A.sourceEvent)!=null&&H.internal)){const F=As(A.transform);k==null||k(F),e==null||e(A.sourceEvent,F)}}))},[N,O,e,d,r]),y.useEffect(()=>{O&&O.on("end",A=>{if(!A.sourceEvent||A.sourceEvent.internal)return null;const{onViewportChangeEnd:k}=E.getState();if(P.current=!1,E.setState({paneDragging:!1}),r&&Yg(d,R.current??0)&&!I.current&&r(A.sourceEvent),I.current=!1,(n||k)&&tL(_.current,A.transform)){const H=As(A.transform);_.current=H,clearTimeout(j.current),j.current=setTimeout(()=>{k==null||k(H),n==null||n(A.sourceEvent,H)},o?150:0)}})},[O,o,d,n,r]),y.useEffect(()=>{O&&O.filter(A=>{const k=z||i,H=l&&A.ctrlKey;if((d===!0||Array.isArray(d)&&d.includes(1))&&A.button===1&&A.type==="mousedown"&&(ji(A,"react-flow__node")||ji(A,"react-flow__edge")))return!0;if(!d&&!k&&!o&&!u&&!l||N||!u&&A.type==="dblclick"||ji(A,w)&&A.type==="wheel"||ji(A,S)&&(A.type!=="wheel"||o&&A.type==="wheel"&&!z)||!l&&A.ctrlKey&&A.type==="wheel"||!k&&!o&&!H&&A.type==="wheel"||!d&&(A.type==="mousedown"||A.type==="touchstart")||Array.isArray(d)&&!d.includes(A.button)&&A.type==="mousedown")return!1;const F=Array.isArray(d)&&d.includes(A.button)||!A.button||A.button<=1;return(!A.ctrlKey||A.type==="wheel")&&F})},[N,O,i,l,o,u,d,c,z]),X.createElement("div",{className:"react-flow__renderer",ref:L,style:Fp},g)},iL=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function lL(){const{userSelectionActive:e,userSelectionRect:t}=Ye(iL,gt);return e&&t?X.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Kg(e,t){const n=t.parentNode||t.parentId,r=e.find(i=>i.id===n);if(r){const i=t.position.x+t.width-r.width,l=t.position.y+t.height-r.height;if(i>0||l>0||t.position.x<0||t.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,i>0&&(r.style.width+=i),l>0&&(r.style.height+=l),t.position.x<0){const o=Math.abs(t.position.x);r.position.x=r.position.x-o,r.style.width+=o,t.position.x=0}if(t.position.y<0){const o=Math.abs(t.position.y);r.position.y=r.position.y-o,r.style.height+=o,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function oL(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,i)=>{const l=e.filter(s=>s.id===i.id);if(l.length===0)return r.push(i),r;const o={...i};for(const s of l)if(s)switch(s.type){case"select":{o.selected=s.selected;break}case"position":{typeof s.position<"u"&&(o.position=s.position),typeof s.positionAbsolute<"u"&&(o.positionAbsolute=s.positionAbsolute),typeof s.dragging<"u"&&(o.dragging=s.dragging),o.expandParent&&Kg(r,o);break}case"dimensions":{typeof s.dimensions<"u"&&(o.width=s.dimensions.width,o.height=s.dimensions.height),typeof s.updateStyle<"u"&&(o.style={...o.style||{},...s.dimensions}),typeof s.resizing=="boolean"&&(o.resizing=s.resizing),o.expandParent&&Kg(r,o);break}case"remove":return r}return r.push(o),r},n)}function sL(e,t){return oL(e,t)}const wr=(e,t)=>({id:e,type:"select",selected:t});function Vi(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(wr(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(wr(r.id,!1))),n},[])}const Ec=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},aL=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),t1=y.memo(({isSelecting:e,selectionMode:t=Io.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:i,onPaneClick:l,onPaneContextMenu:o,onPaneScroll:s,onPaneMouseEnter:a,onPaneMouseMove:u,onPaneMouseLeave:c,children:d})=>{const p=y.useRef(null),h=dt(),x=y.useRef(0),v=y.useRef(0),b=y.useRef(),{userSelectionActive:m,elementsSelectable:g,dragging:w}=Ye(aL,gt),S=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),x.current=0,v.current=0},j=B=>{l==null||l(B),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},E=B=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){B.preventDefault();return}o==null||o(B)},P=s?B=>s(B):void 0,I=B=>{const{resetSelectedElements:N,domNode:z}=h.getState();if(b.current=z==null?void 0:z.getBoundingClientRect(),!g||!e||B.button!==0||B.target!==p.current||!b.current)return;const{x:R,y:W}=zr(B,b.current);N(),h.setState({userSelectionRect:{width:0,height:0,startX:R,startY:W,x:R,y:W}}),r==null||r(B)},L=B=>{const{userSelectionRect:N,nodeInternals:z,edges:R,transform:W,onNodesChange:M,onEdgesChange:A,nodeOrigin:k,getNodes:H}=h.getState();if(!e||!b.current||!N)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const F=zr(B,b.current),C=N.startX??0,Z=N.startY??0,re={...N,x:F.x<C?F.x:C,y:F.y<Z?F.y:Z,width:Math.abs(F.x-C),height:Math.abs(F.y-Z)},V=H(),ie=Dw(z,re,W,t===Io.Partial,!0,k),ae=Ow(ie,R).map(ve=>ve.id),ge=ie.map(ve=>ve.id);if(x.current!==ge.length){x.current=ge.length;const ve=Vi(V,ge);ve.length&&(M==null||M(ve))}if(v.current!==ae.length){v.current=ae.length;const ve=Vi(R,ae);ve.length&&(A==null||A(ve))}h.setState({userSelectionRect:re})},_=B=>{if(B.button!==0)return;const{userSelectionRect:N}=h.getState();!m&&N&&B.target===p.current&&(j==null||j(B)),h.setState({nodesSelectionActive:x.current>0}),S(),i==null||i(B)},O=B=>{m&&(h.setState({nodesSelectionActive:x.current>0}),i==null||i(B)),S()},U=g&&(e||m);return X.createElement("div",{className:St(["react-flow__pane",{dragging:w,selection:e}]),onClick:U?void 0:Ec(j,p),onContextMenu:Ec(E,p),onWheel:Ec(P,p),onMouseEnter:U?void 0:a,onMouseDown:U?I:void 0,onMouseMove:U?L:u,onMouseUp:U?_:void 0,onMouseLeave:U?O:c,ref:p,style:Fp},d,X.createElement(lL,null))});t1.displayName="Pane";function n1(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return r?r.selected?!0:n1(r,t):!1}function Gg(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function uL(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||i.parentId||!n1(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var l,o;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((l=i.positionAbsolute)==null?void 0:l.x)??0),y:n.y-(((o=i.positionAbsolute)==null?void 0:o.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode||i.parentId,parentId:i.parentNode||i.parentId,width:i.width,height:i.height,expandParent:i.expandParent}})}function cL(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function r1(e,t,n,r,i=[0,0],l){const o=cL(e,e.extent||r);let s=o;const a=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(a&&e.width&&e.height){const d=n.get(a),{x:p,y:h}=ui(d,i).positionAbsolute;s=d&&dn(p)&&dn(h)&&dn(d.width)&&dn(d.height)?[[p+e.width*i[0],h+e.height*i[1]],[p+d.width-e.width+e.width*i[0],h+d.height-e.height+e.height*i[1]]]:s}else l==null||l("005",nr.error005()),s=o;else if(e.extent&&a&&e.extent!=="parent"){const d=n.get(a),{x:p,y:h}=ui(d,i).positionAbsolute;s=[[e.extent[0][0]+p,e.extent[0][1]+h],[e.extent[1][0]+p,e.extent[1][1]+h]]}let u={x:0,y:0};if(a){const d=n.get(a);u=ui(d,i).positionAbsolute}const c=s&&s!=="parent"?Ip(t,s):t;return{position:{x:c.x-u.x,y:c.y-u.y},positionAbsolute:c}}function Nc({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(i=>({...n.get(i.id),position:i.position,positionAbsolute:i.positionAbsolute}));return[e?r.find(i=>i.id===e):r[0],r]}const qg=(e,t,n,r)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const l=Array.from(i),o=t.getBoundingClientRect(),s={x:o.width*r[0],y:o.height*r[1]};return l.map(a=>{const u=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),position:a.getAttribute("data-handlepos"),x:(u.left-o.left-s.x)/n,y:(u.top-o.top-s.y)/n,...Ap(a)}})};function zl(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);i&&n(r,{...i})}}function tf({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:l,multiSelectionActive:o,nodeInternals:s,onError:a}=t.getState(),u=s.get(e);if(!u){a==null||a("012",nr.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(l({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):i([e])}function dL(){const e=dt();return y.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:i,snapToGrid:l}=e.getState(),o=n.touches?n.touches[0].clientX:n.clientX,s=n.touches?n.touches[0].clientY:n.clientY,a={x:(o-r[0])/r[2],y:(s-r[1])/r[2]};return{xSnapped:l?i[0]*Math.round(a.x/i[0]):a.x,ySnapped:l?i[1]*Math.round(a.y/i[1]):a.y,...a}},[])}function Cc(e){return(t,n,r)=>e==null?void 0:e(t,r)}function i1({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:l,selectNodesOnDrag:o}){const s=dt(),[a,u]=y.useState(!1),c=y.useRef([]),d=y.useRef({x:null,y:null}),p=y.useRef(0),h=y.useRef(null),x=y.useRef({x:0,y:0}),v=y.useRef(null),b=y.useRef(!1),m=y.useRef(!1),g=y.useRef(!1),w=dL();return y.useEffect(()=>{if(e!=null&&e.current){const S=un(e.current),j=({x:I,y:L})=>{const{nodeInternals:_,onNodeDrag:O,onSelectionDrag:U,updateNodePositions:B,nodeExtent:N,snapGrid:z,snapToGrid:R,nodeOrigin:W,onError:M}=s.getState();d.current={x:I,y:L};let A=!1,k={x:0,y:0,x2:0,y2:0};if(c.current.length>1&&N){const F=yu(c.current,W);k=Ao(F)}if(c.current=c.current.map(F=>{const C={x:I-F.distance.x,y:L-F.distance.y};R&&(C.x=z[0]*Math.round(C.x/z[0]),C.y=z[1]*Math.round(C.y/z[1]));const Z=[[N[0][0],N[0][1]],[N[1][0],N[1][1]]];c.current.length>1&&N&&!F.extent&&(Z[0][0]=F.positionAbsolute.x-k.x+N[0][0],Z[1][0]=F.positionAbsolute.x+(F.width??0)-k.x2+N[1][0],Z[0][1]=F.positionAbsolute.y-k.y+N[0][1],Z[1][1]=F.positionAbsolute.y+(F.height??0)-k.y2+N[1][1]);const re=r1(F,C,_,Z,W,M);return A=A||F.position.x!==re.position.x||F.position.y!==re.position.y,F.position=re.position,F.positionAbsolute=re.positionAbsolute,F}),!A)return;B(c.current,!0,!0),u(!0);const H=i?O:Cc(U);if(H&&v.current){const[F,C]=Nc({nodeId:i,dragItems:c.current,nodeInternals:_});H(v.current,F,C)}},E=()=>{if(!h.current)return;const[I,L]=Cw(x.current,h.current);if(I!==0||L!==0){const{transform:_,panBy:O}=s.getState();d.current.x=(d.current.x??0)-I/_[2],d.current.y=(d.current.y??0)-L/_[2],O({x:I,y:L})&&j(d.current)}p.current=requestAnimationFrame(E)},P=I=>{var W;const{nodeInternals:L,multiSelectionActive:_,nodesDraggable:O,unselectNodesAndEdges:U,onNodeDragStart:B,onSelectionDragStart:N}=s.getState();m.current=!0;const z=i?B:Cc(N);(!o||!l)&&!_&&i&&((W=L.get(i))!=null&&W.selected||U()),i&&l&&o&&tf({id:i,store:s,nodeRef:e});const R=w(I);if(d.current=R,c.current=uL(L,O,R,i),z&&c.current){const[M,A]=Nc({nodeId:i,dragItems:c.current,nodeInternals:L});z(I.sourceEvent,M,A)}};if(t)S.on(".drag",null);else{const I=kI().on("start",L=>{const{domNode:_,nodeDragThreshold:O}=s.getState();O===0&&P(L),g.current=!1;const U=w(L);d.current=U,h.current=(_==null?void 0:_.getBoundingClientRect())||null,x.current=zr(L.sourceEvent,h.current)}).on("drag",L=>{var B,N;const _=w(L),{autoPanOnNodeDrag:O,nodeDragThreshold:U}=s.getState();if(L.sourceEvent.type==="touchmove"&&L.sourceEvent.touches.length>1&&(g.current=!0),!g.current){if(!b.current&&m.current&&O&&(b.current=!0,E()),!m.current){const z=_.xSnapped-(((B=d==null?void 0:d.current)==null?void 0:B.x)??0),R=_.ySnapped-(((N=d==null?void 0:d.current)==null?void 0:N.y)??0);Math.sqrt(z*z+R*R)>U&&P(L)}(d.current.x!==_.xSnapped||d.current.y!==_.ySnapped)&&c.current&&m.current&&(v.current=L.sourceEvent,x.current=zr(L.sourceEvent,h.current),j(_))}}).on("end",L=>{if(!(!m.current||g.current)&&(u(!1),b.current=!1,m.current=!1,cancelAnimationFrame(p.current),c.current)){const{updateNodePositions:_,nodeInternals:O,onNodeDragStop:U,onSelectionDragStop:B}=s.getState(),N=i?U:Cc(B);if(_(c.current,!1,!1),N){const[z,R]=Nc({nodeId:i,dragItems:c.current,nodeInternals:O});N(L.sourceEvent,z,R)}}}).filter(L=>{const _=L.target;return!L.button&&(!n||!Gg(_,`.${n}`,e))&&(!r||Gg(_,r,e))});return S.call(I),()=>{S.on(".drag",null)}}}},[e,t,n,r,l,s,i,o,w]),a}function l1(){const e=dt();return y.useCallback(n=>{const{nodeInternals:r,nodeExtent:i,updateNodePositions:l,getNodes:o,snapToGrid:s,snapGrid:a,onError:u,nodesDraggable:c}=e.getState(),d=o().filter(g=>g.selected&&(g.draggable||c&&typeof g.draggable>"u")),p=s?a[0]:5,h=s?a[1]:5,x=n.isShiftPressed?4:1,v=n.x*p*x,b=n.y*h*x,m=d.map(g=>{if(g.positionAbsolute){const w={x:g.positionAbsolute.x+v,y:g.positionAbsolute.y+b};s&&(w.x=a[0]*Math.round(w.x/a[0]),w.y=a[1]*Math.round(w.y/a[1]));const{positionAbsolute:S,position:j}=r1(g,w,r,i,void 0,u);g.position=j,g.positionAbsolute=S}return g});l(m,!0,!1)},[])}const Ji={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Dl=e=>{const t=({id:n,type:r,data:i,xPos:l,yPos:o,xPosOrigin:s,yPosOrigin:a,selected:u,onClick:c,onMouseEnter:d,onMouseMove:p,onMouseLeave:h,onContextMenu:x,onDoubleClick:v,style:b,className:m,isDraggable:g,isSelectable:w,isConnectable:S,isFocusable:j,selectNodesOnDrag:E,sourcePosition:P,targetPosition:I,hidden:L,resizeObserver:_,dragHandle:O,zIndex:U,isParent:B,noDragClassName:N,noPanClassName:z,initialized:R,disableKeyboardA11y:W,ariaLabel:M,rfId:A,hasHandleBounds:k})=>{const H=dt(),F=y.useRef(null),C=y.useRef(null),Z=y.useRef(P),re=y.useRef(I),V=y.useRef(r),ie=w||g||c||d||p||h,ae=l1(),ge=zl(n,H.getState,d),ve=zl(n,H.getState,p),Re=zl(n,H.getState,h),Ae=zl(n,H.getState,x),Be=zl(n,H.getState,v),ze=Ne=>{const{nodeDragThreshold:ce}=H.getState();if(w&&(!E||!g||ce>0)&&tf({id:n,store:H,nodeRef:F}),c){const Fe=H.getState().nodeInternals.get(n);Fe&&c(Ne,{...Fe})}},Ie=Ne=>{if(!qd(Ne)&&!W)if(Aw.includes(Ne.key)&&w){const ce=Ne.key==="Escape";tf({id:n,store:H,unselect:ce,nodeRef:F})}else g&&u&&Object.prototype.hasOwnProperty.call(Ji,Ne.key)&&(H.setState({ariaLiveMessage:`Moved selected node ${Ne.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~l}, y: ${~~o}`}),ae({x:Ji[Ne.key].x,y:Ji[Ne.key].y,isShiftPressed:Ne.shiftKey}))};y.useEffect(()=>()=>{C.current&&(_==null||_.unobserve(C.current),C.current=null)},[]),y.useEffect(()=>{if(F.current&&!L){const Ne=F.current;(!R||!k||C.current!==Ne)&&(C.current&&(_==null||_.unobserve(C.current)),_==null||_.observe(Ne),C.current=Ne)}},[L,R,k]),y.useEffect(()=>{const Ne=V.current!==r,ce=Z.current!==P,Fe=re.current!==I;F.current&&(Ne||ce||Fe)&&(Ne&&(V.current=r),ce&&(Z.current=P),Fe&&(re.current=I),H.getState().updateNodeDimensions([{id:n,nodeElement:F.current,forceUpdate:!0}]))},[n,r,P,I]);const Oe=i1({nodeRef:F,disabled:L||!g,noDragClassName:N,handleSelector:O,nodeId:n,isSelectable:w,selectNodesOnDrag:E});return L?null:X.createElement("div",{className:St(["react-flow__node",`react-flow__node-${r}`,{[z]:g},m,{selected:u,selectable:w,parent:B,dragging:Oe}]),ref:F,style:{zIndex:U,transform:`translate(${s}px,${a}px)`,pointerEvents:ie?"all":"none",visibility:R?"visible":"hidden",...b},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:ge,onMouseMove:ve,onMouseLeave:Re,onContextMenu:Ae,onClick:ze,onDoubleClick:Be,onKeyDown:j?Ie:void 0,tabIndex:j?0:void 0,role:j?"button":void 0,"aria-describedby":W?void 0:`${qw}-${A}`,"aria-label":M},X.createElement(ER,{value:n},X.createElement(e,{id:n,data:i,type:r,xPos:l,yPos:o,selected:u,isConnectable:S,sourcePosition:P,targetPosition:I,dragging:Oe,dragHandle:O,zIndex:U})))};return t.displayName="NodeWrapper",y.memo(t)};const fL=e=>{const t=e.getNodes().filter(n=>n.selected);return{...yu(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function pL({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=dt(),{width:i,height:l,x:o,y:s,transformString:a,userSelectionActive:u}=Ye(fL,gt),c=l1(),d=y.useRef(null);if(y.useEffect(()=>{var x;n||(x=d.current)==null||x.focus({preventScroll:!0})},[n]),i1({nodeRef:d}),u||!i||!l)return null;const p=e?x=>{const v=r.getState().getNodes().filter(b=>b.selected);e(x,v)}:void 0,h=x=>{Object.prototype.hasOwnProperty.call(Ji,x.key)&&c({x:Ji[x.key].x,y:Ji[x.key].y,isShiftPressed:x.shiftKey})};return X.createElement("div",{className:St(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a}},X.createElement("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:l,top:s,left:o}}))}var hL=y.memo(pL);const mL=e=>e.nodesSelectionActive,o1=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:l,onPaneScroll:o,deleteKeyCode:s,onMove:a,onMoveStart:u,onMoveEnd:c,selectionKeyCode:d,selectionOnDrag:p,selectionMode:h,onSelectionStart:x,onSelectionEnd:v,multiSelectionKeyCode:b,panActivationKeyCode:m,zoomActivationKeyCode:g,elementsSelectable:w,zoomOnScroll:S,zoomOnPinch:j,panOnScroll:E,panOnScrollSpeed:P,panOnScrollMode:I,zoomOnDoubleClick:L,panOnDrag:_,defaultViewport:O,translateExtent:U,minZoom:B,maxZoom:N,preventScrolling:z,onSelectionContextMenu:R,noWheelClassName:W,noPanClassName:M,disableKeyboardA11y:A})=>{const k=Ye(mL),H=To(d),F=To(m),C=F||_,Z=F||E,re=H||p&&C!==!0;return JR({deleteKeyCode:s,multiSelectionKeyCode:b}),X.createElement(rL,{onMove:a,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:l,elementsSelectable:w,zoomOnScroll:S,zoomOnPinch:j,panOnScroll:Z,panOnScrollSpeed:P,panOnScrollMode:I,zoomOnDoubleClick:L,panOnDrag:!H&&C,defaultViewport:O,translateExtent:U,minZoom:B,maxZoom:N,zoomActivationKeyCode:g,preventScrolling:z,noWheelClassName:W,noPanClassName:M},X.createElement(t1,{onSelectionStart:x,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:l,onPaneScroll:o,panOnDrag:C,isSelecting:!!re,selectionMode:h},e,k&&X.createElement(hL,{onSelectionContextMenu:R,noPanClassName:M,disableKeyboardA11y:A})))};o1.displayName="FlowRenderer";var gL=y.memo(o1);function xL(e){return Ye(y.useCallback(n=>e?Dw(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function yL(e){const t={input:Dl(e.input||Yw),default:Dl(e.default||ef),output:Dl(e.output||Kw),group:Dl(e.group||Dp)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,l)=>(i[l]=Dl(e[l]||ef),i),n);return{...t,...r}}const vL=({x:e,y:t,width:n,height:r,origin:i})=>!n||!r?{x:e,y:t}:i[0]<0||i[1]<0||i[0]>1||i[1]>1?{x:e,y:t}:{x:e-n*i[0],y:t-r*i[1]},wL=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),s1=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:l,onError:o}=Ye(wL,gt),s=xL(e.onlyRenderVisibleElements),a=y.useRef(),u=y.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const c=new ResizeObserver(d=>{const p=d.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));l(p)});return a.current=c,c},[]);return y.useEffect(()=>()=>{var c;(c=a==null?void 0:a.current)==null||c.disconnect()},[]),X.createElement("div",{className:"react-flow__nodes",style:Fp},s.map(c=>{var j,E,P;let d=c.type||"default";e.nodeTypes[d]||(o==null||o("003",nr.error003(d)),d="default");const p=e.nodeTypes[d]||e.nodeTypes.default,h=!!(c.draggable||t&&typeof c.draggable>"u"),x=!!(c.selectable||i&&typeof c.selectable>"u"),v=!!(c.connectable||n&&typeof c.connectable>"u"),b=!!(c.focusable||r&&typeof c.focusable>"u"),m=e.nodeExtent?Ip(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,g=(m==null?void 0:m.x)??0,w=(m==null?void 0:m.y)??0,S=vL({x:g,y:w,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return X.createElement(p,{key:c.id,id:c.id,className:c.className,style:c.style,type:d,data:c.data,sourcePosition:c.sourcePosition||me.Bottom,targetPosition:c.targetPosition||me.Top,hidden:c.hidden,xPos:g,yPos:w,xPosOrigin:S.x,yPosOrigin:S.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:h,isSelectable:x,isConnectable:v,isFocusable:b,resizeObserver:u,dragHandle:c.dragHandle,zIndex:((j=c[rt])==null?void 0:j.z)??0,isParent:!!((E=c[rt])!=null&&E.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel,hasHandleBounds:!!((P=c[rt])!=null&&P.handleBounds)})}))};s1.displayName="NodeRenderer";var kL=y.memo(s1);const bL=(e,t,n)=>n===me.Left?e-t:n===me.Right?e+t:e,SL=(e,t,n)=>n===me.Top?e-t:n===me.Bottom?e+t:e,Qg="react-flow__edgeupdater",Zg=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:l,onMouseOut:o,type:s})=>X.createElement("circle",{onMouseDown:i,onMouseEnter:l,onMouseOut:o,className:St([Qg,`${Qg}-${s}`]),cx:bL(t,r,e),cy:SL(n,r,e),r,stroke:"transparent",fill:"transparent"}),EL=()=>!0;var Pi=e=>{const t=({id:n,className:r,type:i,data:l,onClick:o,onEdgeDoubleClick:s,selected:a,animated:u,label:c,labelStyle:d,labelShowBg:p,labelBgStyle:h,labelBgPadding:x,labelBgBorderRadius:v,style:b,source:m,target:g,sourceX:w,sourceY:S,targetX:j,targetY:E,sourcePosition:P,targetPosition:I,elementsSelectable:L,hidden:_,sourceHandleId:O,targetHandleId:U,onContextMenu:B,onMouseEnter:N,onMouseMove:z,onMouseLeave:R,reconnectRadius:W,onReconnect:M,onReconnectStart:A,onReconnectEnd:k,markerEnd:H,markerStart:F,rfId:C,ariaLabel:Z,isFocusable:re,isReconnectable:V,pathOptions:ie,interactionWidth:ae,disableKeyboardA11y:ge})=>{const ve=y.useRef(null),[Re,Ae]=y.useState(!1),[Be,ze]=y.useState(!1),Ie=dt(),Oe=y.useMemo(()=>`url('#${Zd(F,C)}')`,[F,C]),Ne=y.useMemo(()=>`url('#${Zd(H,C)}')`,[H,C]);if(_)return null;const ce=de=>{var Y;const{edges:we,addSelectedEdges:Pe,unselectNodesAndEdges:$e,multiSelectionActive:qe}=Ie.getState(),Ue=we.find(Ee=>Ee.id===n);Ue&&(L&&(Ie.setState({nodesSelectionActive:!1}),Ue.selected&&qe?($e({nodes:[],edges:[Ue]}),(Y=ve.current)==null||Y.blur()):Pe([n])),o&&o(de,Ue))},Fe=Ml(n,Ie.getState,s),it=Ml(n,Ie.getState,B),ft=Ml(n,Ie.getState,N),Et=Ml(n,Ie.getState,z),at=Ml(n,Ie.getState,R),pt=(de,we)=>{if(de.button!==0)return;const{edges:Pe,isValidConnection:$e}=Ie.getState(),qe=we?g:m,Ue=(we?U:O)||null,Y=we?"target":"source",Ee=$e||EL,xt=we,yt=Pe.find(Nt=>Nt.id===n);ze(!0),A==null||A(de,yt,Y);const An=Nt=>{ze(!1),k==null||k(Nt,yt,Y)};Uw({event:de,handleId:Ue,nodeId:qe,onConnect:Nt=>M==null?void 0:M(yt,Nt),isTarget:xt,getState:Ie.getState,setState:Ie.setState,isValidConnection:Ee,edgeUpdaterType:Y,onReconnectEnd:An})},q=de=>pt(de,!0),$=de=>pt(de,!1),G=()=>Ae(!0),le=()=>Ae(!1),oe=!L&&!o,he=de=>{var we;if(!ge&&Aw.includes(de.key)&&L){const{unselectNodesAndEdges:Pe,addSelectedEdges:$e,edges:qe}=Ie.getState();de.key==="Escape"?((we=ve.current)==null||we.blur(),Pe({edges:[qe.find(Y=>Y.id===n)]})):$e([n])}};return X.createElement("g",{className:St(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:a,animated:u,inactive:oe,updating:Re}]),onClick:ce,onDoubleClick:Fe,onContextMenu:it,onMouseEnter:ft,onMouseMove:Et,onMouseLeave:at,onKeyDown:re?he:void 0,tabIndex:re?0:void 0,role:re?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":Z===null?void 0:Z||`Edge from ${m} to ${g}`,"aria-describedby":re?`${Qw}-${C}`:void 0,ref:ve},!Be&&X.createElement(e,{id:n,source:m,target:g,selected:a,animated:u,label:c,labelStyle:d,labelShowBg:p,labelBgStyle:h,labelBgPadding:x,labelBgBorderRadius:v,data:l,style:b,sourceX:w,sourceY:S,targetX:j,targetY:E,sourcePosition:P,targetPosition:I,sourceHandleId:O,targetHandleId:U,markerStart:Oe,markerEnd:Ne,pathOptions:ie,interactionWidth:ae}),V&&X.createElement(X.Fragment,null,(V==="source"||V===!0)&&X.createElement(Zg,{position:P,centerX:w,centerY:S,radius:W,onMouseDown:q,onMouseEnter:G,onMouseOut:le,type:"source"}),(V==="target"||V===!0)&&X.createElement(Zg,{position:I,centerX:j,centerY:E,radius:W,onMouseDown:$,onMouseEnter:G,onMouseOut:le,type:"target"})))};return t.displayName="EdgeWrapper",y.memo(t)};function NL(e){const t={default:Pi(e.default||Da),straight:Pi(e.bezier||Lp),step:Pi(e.step||Rp),smoothstep:Pi(e.step||xu),simplebezier:Pi(e.simplebezier||Tp)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,l)=>(i[l]=Pi(e[l]||Da),i),n);return{...t,...r}}function Jg(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,i=((n==null?void 0:n.y)||0)+t.y,l=(n==null?void 0:n.width)||t.width,o=(n==null?void 0:n.height)||t.height;switch(e){case me.Top:return{x:r+l/2,y:i};case me.Right:return{x:r+l,y:i+o/2};case me.Bottom:return{x:r+l/2,y:i+o};case me.Left:return{x:r,y:i+o/2}}}function e0(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const CL=(e,t,n,r,i,l)=>{const o=Jg(n,e,t),s=Jg(l,r,i);return{sourceX:o.x,sourceY:o.y,targetX:s.x,targetY:s.y}};function _L({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:l,width:o,height:s,transform:a}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+r,t.y+l)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=Ao({x:(0-a[0])/a[2],y:(0-a[1])/a[2],width:o/a[2],height:s/a[2]}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),p=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*p)>0}function t0(e){var r,i,l,o,s;const t=((r=e==null?void 0:e[rt])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)<"u";return[{x:((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)||0,y:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const jL=[{level:0,isMaxLevel:!0,edges:[]}];function PL(e,t,n=!1){let r=-1;const i=e.reduce((o,s)=>{var c,d;const a=dn(s.zIndex);let u=a?s.zIndex:0;if(n){const p=t.get(s.target),h=t.get(s.source),x=s.selected||(p==null?void 0:p.selected)||(h==null?void 0:h.selected),v=Math.max(((c=h==null?void 0:h[rt])==null?void 0:c.z)||0,((d=p==null?void 0:p[rt])==null?void 0:d.z)||0,1e3);u=(a?s.zIndex:0)+(x?v:0)}return o[u]?o[u].push(s):o[u]=[s],r=u>r?u:r,o},{}),l=Object.entries(i).map(([o,s])=>{const a=+o;return{edges:s,level:a,isMaxLevel:a===r}});return l.length===0?jL:l}function AL(e,t,n){const r=Ye(y.useCallback(i=>e?i.edges.filter(l=>{const o=t.get(l.source),s=t.get(l.target);return(o==null?void 0:o.width)&&(o==null?void 0:o.height)&&(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&_L({sourcePos:o.positionAbsolute||{x:0,y:0},targetPos:s.positionAbsolute||{x:0,y:0},sourceWidth:o.width,sourceHeight:o.height,targetWidth:s.width,targetHeight:s.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return PL(r,t,n)}const IL=({color:e="none",strokeWidth:t=1})=>X.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),TL=({color:e="none",strokeWidth:t=1})=>X.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),n0={[za.Arrow]:IL,[za.ArrowClosed]:TL};function RL(e){const t=dt();return y.useMemo(()=>{var i,l;return Object.prototype.hasOwnProperty.call(n0,e)?n0[e]:((l=(i=t.getState()).onError)==null||l.call(i,"009",nr.error009(e)),null)},[e])}const LL=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:l="strokeWidth",strokeWidth:o,orient:s="auto-start-reverse"})=>{const a=RL(t);return a?X.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:s,refX:"0",refY:"0"},X.createElement(a,{color:n,strokeWidth:o})):null},ML=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((i,l)=>([l.markerStart,l.markerEnd].forEach(o=>{if(o&&typeof o=="object"){const s=Zd(o,t);r.includes(s)||(i.push({id:s,color:o.color||e,...o}),r.push(s))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))},a1=({defaultColor:e,rfId:t})=>{const n=Ye(y.useCallback(ML({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((l,o)=>l.id!==i[o].id)));return X.createElement("defs",null,n.map(r=>X.createElement(LL,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};a1.displayName="MarkerDefinitions";var zL=y.memo(a1);const DL=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),u1=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:i,noPanClassName:l,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:c,onEdgeDoubleClick:d,onReconnect:p,onReconnectStart:h,onReconnectEnd:x,reconnectRadius:v,children:b,disableKeyboardA11y:m})=>{const{edgesFocusable:g,edgesUpdatable:w,elementsSelectable:S,width:j,height:E,connectionMode:P,nodeInternals:I,onError:L}=Ye(DL,gt),_=AL(t,I,n);return j?X.createElement(X.Fragment,null,_.map(({level:O,edges:U,isMaxLevel:B})=>X.createElement("svg",{key:O,style:{zIndex:O},width:j,height:E,className:"react-flow__edges react-flow__container"},B&&X.createElement(zL,{defaultColor:e,rfId:r}),X.createElement("g",null,U.map(N=>{const[z,R,W]=t0(I.get(N.source)),[M,A,k]=t0(I.get(N.target));if(!W||!k)return null;let H=N.type||"default";i[H]||(L==null||L("011",nr.error011(H)),H="default");const F=i[H]||i.default,C=P===xi.Strict?A.target:(A.target??[]).concat(A.source??[]),Z=e0(R.source,N.sourceHandle),re=e0(C,N.targetHandle),V=(Z==null?void 0:Z.position)||me.Bottom,ie=(re==null?void 0:re.position)||me.Top,ae=!!(N.focusable||g&&typeof N.focusable>"u"),ge=N.reconnectable||N.updatable,ve=typeof p<"u"&&(ge||w&&typeof ge>"u");if(!Z||!re)return L==null||L("008",nr.error008(Z,N)),null;const{sourceX:Re,sourceY:Ae,targetX:Be,targetY:ze}=CL(z,Z,V,M,re,ie);return X.createElement(F,{key:N.id,id:N.id,className:St([N.className,l]),type:H,data:N.data,selected:!!N.selected,animated:!!N.animated,hidden:!!N.hidden,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,style:N.style,source:N.source,target:N.target,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerEnd:N.markerEnd,markerStart:N.markerStart,sourceX:Re,sourceY:Ae,targetX:Be,targetY:ze,sourcePosition:V,targetPosition:ie,elementsSelectable:S,onContextMenu:o,onMouseEnter:s,onMouseMove:a,onMouseLeave:u,onClick:c,onEdgeDoubleClick:d,onReconnect:p,onReconnectStart:h,onReconnectEnd:x,reconnectRadius:v,rfId:r,ariaLabel:N.ariaLabel,isFocusable:ae,isReconnectable:ve,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth,disableKeyboardA11y:m})})))),b):null};u1.displayName="EdgeRenderer";var OL=y.memo(u1);const FL=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function $L({children:e}){const t=Ye(FL);return X.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function BL(e){const t=Op(),n=y.useRef(!1);y.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const UL={[me.Left]:me.Right,[me.Right]:me.Left,[me.Top]:me.Bottom,[me.Bottom]:me.Top},c1=({nodeId:e,handleType:t,style:n,type:r=Sr.Bezier,CustomComponent:i,connectionStatus:l})=>{var E,P,I;const{fromNode:o,handleId:s,toX:a,toY:u,connectionMode:c}=Ye(y.useCallback(L=>({fromNode:L.nodeInternals.get(e),handleId:L.connectionHandleId,toX:(L.connectionPosition.x-L.transform[0])/L.transform[2],toY:(L.connectionPosition.y-L.transform[1])/L.transform[2],connectionMode:L.connectionMode}),[e]),gt),d=(E=o==null?void 0:o[rt])==null?void 0:E.handleBounds;let p=d==null?void 0:d[t];if(c===xi.Loose&&(p=p||(d==null?void 0:d[t==="source"?"target":"source"])),!o||!p)return null;const h=s?p.find(L=>L.id===s):p[0],x=h?h.x+h.width/2:(o.width??0)/2,v=h?h.y+h.height/2:o.height??0,b=(((P=o.positionAbsolute)==null?void 0:P.x)??0)+x,m=(((I=o.positionAbsolute)==null?void 0:I.y)??0)+v,g=h==null?void 0:h.position,w=g?UL[g]:null;if(!g||!w)return null;if(i)return X.createElement(i,{connectionLineType:r,connectionLineStyle:n,fromNode:o,fromHandle:h,fromX:b,fromY:m,toX:a,toY:u,fromPosition:g,toPosition:w,connectionStatus:l});let S="";const j={sourceX:b,sourceY:m,sourcePosition:g,targetX:a,targetY:u,targetPosition:w};return r===Sr.Bezier?[S]=Mw(j):r===Sr.Step?[S]=Qd({...j,borderRadius:0}):r===Sr.SmoothStep?[S]=Qd(j):r===Sr.SimpleBezier?[S]=Lw(j):S=`M${b},${m} ${a},${u}`,X.createElement("path",{d:S,fill:"none",className:"react-flow__connection-path",style:n})};c1.displayName="ConnectionLine";const VL=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function HL({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:l,nodesConnectable:o,width:s,height:a,connectionStatus:u}=Ye(VL,gt);return!(i&&l&&s&&o)?null:X.createElement("svg",{style:e,width:s,height:a,className:"react-flow__edges react-flow__connectionline react-flow__container"},X.createElement("g",{className:St(["react-flow__connection",u])},X.createElement(c1,{nodeId:i,handleType:l,style:t,type:n,CustomComponent:r,connectionStatus:u})))}function r0(e,t){return y.useRef(null),dt(),y.useMemo(()=>t(e),[e])}const d1=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:i,onInit:l,onNodeClick:o,onEdgeClick:s,onNodeDoubleClick:a,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:p,onNodeContextMenu:h,onSelectionContextMenu:x,onSelectionStart:v,onSelectionEnd:b,connectionLineType:m,connectionLineStyle:g,connectionLineComponent:w,connectionLineContainerStyle:S,selectionKeyCode:j,selectionOnDrag:E,selectionMode:P,multiSelectionKeyCode:I,panActivationKeyCode:L,zoomActivationKeyCode:_,deleteKeyCode:O,onlyRenderVisibleElements:U,elementsSelectable:B,selectNodesOnDrag:N,defaultViewport:z,translateExtent:R,minZoom:W,maxZoom:M,preventScrolling:A,defaultMarkerColor:k,zoomOnScroll:H,zoomOnPinch:F,panOnScroll:C,panOnScrollSpeed:Z,panOnScrollMode:re,zoomOnDoubleClick:V,panOnDrag:ie,onPaneClick:ae,onPaneMouseEnter:ge,onPaneMouseMove:ve,onPaneMouseLeave:Re,onPaneScroll:Ae,onPaneContextMenu:Be,onEdgeContextMenu:ze,onEdgeMouseEnter:Ie,onEdgeMouseMove:Oe,onEdgeMouseLeave:Ne,onReconnect:ce,onReconnectStart:Fe,onReconnectEnd:it,reconnectRadius:ft,noDragClassName:Et,noWheelClassName:at,noPanClassName:pt,elevateEdgesOnSelect:q,disableKeyboardA11y:$,nodeOrigin:G,nodeExtent:le,rfId:oe})=>{const he=r0(e,yL),de=r0(t,NL);return BL(l),X.createElement(gL,{onPaneClick:ae,onPaneMouseEnter:ge,onPaneMouseMove:ve,onPaneMouseLeave:Re,onPaneContextMenu:Be,onPaneScroll:Ae,deleteKeyCode:O,selectionKeyCode:j,selectionOnDrag:E,selectionMode:P,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:I,panActivationKeyCode:L,zoomActivationKeyCode:_,elementsSelectable:B,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:H,zoomOnPinch:F,zoomOnDoubleClick:V,panOnScroll:C,panOnScrollSpeed:Z,panOnScrollMode:re,panOnDrag:ie,defaultViewport:z,translateExtent:R,minZoom:W,maxZoom:M,onSelectionContextMenu:x,preventScrolling:A,noDragClassName:Et,noWheelClassName:at,noPanClassName:pt,disableKeyboardA11y:$},X.createElement($L,null,X.createElement(OL,{edgeTypes:de,onEdgeClick:s,onEdgeDoubleClick:u,onlyRenderVisibleElements:U,onEdgeContextMenu:ze,onEdgeMouseEnter:Ie,onEdgeMouseMove:Oe,onEdgeMouseLeave:Ne,onReconnect:ce,onReconnectStart:Fe,onReconnectEnd:it,reconnectRadius:ft,defaultMarkerColor:k,noPanClassName:pt,elevateEdgesOnSelect:!!q,disableKeyboardA11y:$,rfId:oe},X.createElement(HL,{style:g,type:m,component:w,containerStyle:S})),X.createElement("div",{className:"react-flow__edgelabel-renderer"}),X.createElement(kL,{nodeTypes:he,onNodeClick:o,onNodeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:p,onNodeContextMenu:h,selectNodesOnDrag:N,onlyRenderVisibleElements:U,noPanClassName:pt,noDragClassName:Et,disableKeyboardA11y:$,nodeOrigin:G,nodeExtent:le,rfId:oe})))};d1.displayName="GraphView";var WL=y.memo(d1);const nf=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],gr={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:nf,nodeExtent:nf,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:xi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:yR,isValidConnection:void 0},YL=()=>RP((e,t)=>({...gr,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:l}=t();e({nodeInternals:Sc(n,r,i,l)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(i=>({...r,...i}))})},setDefaultNodesAndEdges:(n,r)=>{const i=typeof n<"u",l=typeof r<"u",o=i?Sc(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:o,edges:l?r:[],hasDefaultNodes:i,hasDefaultEdges:l})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:i,fitViewOnInit:l,fitViewOnInitDone:o,fitViewOnInitOptions:s,domNode:a,nodeOrigin:u}=t(),c=a==null?void 0:a.querySelector(".react-flow__viewport");if(!c)return;const d=window.getComputedStyle(c),{m22:p}=new window.DOMMatrixReadOnly(d.transform),h=n.reduce((v,b)=>{const m=i.get(b.id);if(m!=null&&m.hidden)i.set(m.id,{...m,[rt]:{...m[rt],handleBounds:void 0}});else if(m){const g=Ap(b.nodeElement);!!(g.width&&g.height&&(m.width!==g.width||m.height!==g.height||b.forceUpdate))&&(i.set(m.id,{...m,[rt]:{...m[rt],handleBounds:{source:qg(".source",b.nodeElement,p,u),target:qg(".target",b.nodeElement,p,u)}},...g}),v.push({id:m.id,type:"dimensions",dimensions:g}))}return v},[]);Jw(i,u);const x=o||l&&!o&&e1(t,{initial:!0,...s});e({nodeInternals:new Map(i),fitViewOnInitDone:x}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,i=!1)=>{const{triggerNodeChanges:l}=t(),o=n.map(s=>{const a={id:s.id,type:"position",dragging:i};return r&&(a.positionAbsolute=s.positionAbsolute,a.position=s.position),a});l(o)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:i,hasDefaultNodes:l,nodeOrigin:o,getNodes:s,elevateNodesOnSelect:a}=t();if(n!=null&&n.length){if(l){const u=sL(n,s()),c=Sc(u,i,o,a);e({nodeInternals:c})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:i,getNodes:l}=t();let o,s=null;r?o=n.map(a=>wr(a,!0)):(o=Vi(l(),n),s=Vi(i,[])),Ps({changedNodes:o,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:i,getNodes:l}=t();let o,s=null;r?o=n.map(a=>wr(a,!0)):(o=Vi(i,n),s=Vi(l(),[])),Ps({changedNodes:s,changedEdges:o,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:i,getNodes:l}=t(),o=n||l(),s=r||i,a=o.map(c=>(c.selected=!1,wr(c.id,!1))),u=s.map(c=>wr(c.id,!1));Ps({changedNodes:a,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:i}=t();r==null||r.scaleExtent([n,i]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:i}=t();r==null||r.scaleExtent([i,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),l=r().filter(s=>s.selected).map(s=>wr(s.id,!1)),o=n.filter(s=>s.selected).map(s=>wr(s.id,!1));Ps({changedNodes:l,changedEdges:o,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=Ip(i.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:i,height:l,d3Zoom:o,d3Selection:s,translateExtent:a}=t();if(!o||!s||!n.x&&!n.y)return!1;const u=qn.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[i,l]],d=o==null?void 0:o.constrain()(u,c,a);return o.transform(s,d),r[0]!==d.x||r[1]!==d.y||r[2]!==d.k},cancelConnection:()=>e({connectionNodeId:gr.connectionNodeId,connectionHandleId:gr.connectionHandleId,connectionHandleType:gr.connectionHandleType,connectionStatus:gr.connectionStatus,connectionStartHandle:gr.connectionStartHandle,connectionEndHandle:gr.connectionEndHandle}),reset:()=>e({...gr})}),Object.is),f1=({children:e})=>{const t=y.useRef(null);return t.current||(t.current=YL()),X.createElement(dR,{value:t.current},e)};f1.displayName="ReactFlowProvider";const p1=({children:e})=>y.useContext(gu)?X.createElement(X.Fragment,null,e):X.createElement(f1,null,e);p1.displayName="ReactFlowWrapper";const XL={input:Yw,default:ef,output:Kw,group:Dp},KL={default:Da,straight:Lp,step:Rp,smoothstep:xu,simplebezier:Tp},GL=[0,0],qL=[15,15],QL={x:0,y:0,zoom:1},ZL={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},h1=y.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:l=XL,edgeTypes:o=KL,onNodeClick:s,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:p,onConnect:h,onConnectStart:x,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:m,onNodeMouseEnter:g,onNodeMouseMove:w,onNodeMouseLeave:S,onNodeContextMenu:j,onNodeDoubleClick:E,onNodeDragStart:P,onNodeDrag:I,onNodeDragStop:L,onNodesDelete:_,onEdgesDelete:O,onSelectionChange:U,onSelectionDragStart:B,onSelectionDrag:N,onSelectionDragStop:z,onSelectionContextMenu:R,onSelectionStart:W,onSelectionEnd:M,connectionMode:A=xi.Strict,connectionLineType:k=Sr.Bezier,connectionLineStyle:H,connectionLineComponent:F,connectionLineContainerStyle:C,deleteKeyCode:Z="Backspace",selectionKeyCode:re="Shift",selectionOnDrag:V=!1,selectionMode:ie=Io.Full,panActivationKeyCode:ae="Space",multiSelectionKeyCode:ge=Ma()?"Meta":"Control",zoomActivationKeyCode:ve=Ma()?"Meta":"Control",snapToGrid:Re=!1,snapGrid:Ae=qL,onlyRenderVisibleElements:Be=!1,selectNodesOnDrag:ze=!0,nodesDraggable:Ie,nodesConnectable:Oe,nodesFocusable:Ne,nodeOrigin:ce=GL,edgesFocusable:Fe,edgesUpdatable:it,elementsSelectable:ft,defaultViewport:Et=QL,minZoom:at=.5,maxZoom:pt=2,translateExtent:q=nf,preventScrolling:$=!0,nodeExtent:G,defaultMarkerColor:le="#b1b1b7",zoomOnScroll:oe=!0,zoomOnPinch:he=!0,panOnScroll:de=!1,panOnScrollSpeed:we=.5,panOnScrollMode:Pe=li.Free,zoomOnDoubleClick:$e=!0,panOnDrag:qe=!0,onPaneClick:Ue,onPaneMouseEnter:Y,onPaneMouseMove:Ee,onPaneMouseLeave:xt,onPaneScroll:yt,onPaneContextMenu:An,children:Ot,onEdgeContextMenu:Nt,onEdgeDoubleClick:In,onEdgeMouseEnter:ln,onEdgeMouseMove:or,onEdgeMouseLeave:mn,onEdgeUpdate:sr,onEdgeUpdateStart:ar,onEdgeUpdateEnd:gn,onReconnect:Tt,onReconnectStart:xn,onReconnectEnd:ur,reconnectRadius:Ho=10,edgeUpdaterRadius:Wo=10,onNodesChange:ke,onEdgesChange:Yo,noDragClassName:Q="nodrag",noWheelClassName:vu="nowheel",noPanClassName:cr="nopan",fitView:Tn=!1,fitViewOptions:wl,connectOnClick:dr=!0,attributionPosition:wu,proOptions:ku,defaultEdgeOptions:bu,elevateNodesOnSelect:fr=!0,elevateEdgesOnSelect:Xo=!1,disableKeyboardA11y:kl=!1,autoPanOnConnect:Ft=!0,autoPanOnNodeDrag:Hr=!0,connectionRadius:Ko=20,isValidConnection:Su,onError:Eu,style:Nu,id:Go,nodeDragThreshold:qo,...Qo},Zo)=>{const Wr=Go||"1";return X.createElement("div",{...Qo,style:{...Nu,...ZL},ref:Zo,className:St(["react-flow",i]),"data-testid":"rf__wrapper",id:Go},X.createElement(p1,null,X.createElement(WL,{onInit:u,onMove:c,onMoveStart:d,onMoveEnd:p,onNodeClick:s,onEdgeClick:a,onNodeMouseEnter:g,onNodeMouseMove:w,onNodeMouseLeave:S,onNodeContextMenu:j,onNodeDoubleClick:E,nodeTypes:l,edgeTypes:o,connectionLineType:k,connectionLineStyle:H,connectionLineComponent:F,connectionLineContainerStyle:C,selectionKeyCode:re,selectionOnDrag:V,selectionMode:ie,deleteKeyCode:Z,multiSelectionKeyCode:ge,panActivationKeyCode:ae,zoomActivationKeyCode:ve,onlyRenderVisibleElements:Be,selectNodesOnDrag:ze,defaultViewport:Et,translateExtent:q,minZoom:at,maxZoom:pt,preventScrolling:$,zoomOnScroll:oe,zoomOnPinch:he,zoomOnDoubleClick:$e,panOnScroll:de,panOnScrollSpeed:we,panOnScrollMode:Pe,panOnDrag:qe,onPaneClick:Ue,onPaneMouseEnter:Y,onPaneMouseMove:Ee,onPaneMouseLeave:xt,onPaneScroll:yt,onPaneContextMenu:An,onSelectionContextMenu:R,onSelectionStart:W,onSelectionEnd:M,onEdgeContextMenu:Nt,onEdgeDoubleClick:In,onEdgeMouseEnter:ln,onEdgeMouseMove:or,onEdgeMouseLeave:mn,onReconnect:Tt??sr,onReconnectStart:xn??ar,onReconnectEnd:ur??gn,reconnectRadius:Ho??Wo,defaultMarkerColor:le,noDragClassName:Q,noWheelClassName:vu,noPanClassName:cr,elevateEdgesOnSelect:Xo,rfId:Wr,disableKeyboardA11y:kl,nodeOrigin:ce,nodeExtent:G}),X.createElement(BR,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:x,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:m,nodesDraggable:Ie,nodesConnectable:Oe,nodesFocusable:Ne,edgesFocusable:Fe,edgesUpdatable:it,elementsSelectable:ft,elevateNodesOnSelect:fr,minZoom:at,maxZoom:pt,nodeExtent:G,onNodesChange:ke,onEdgesChange:Yo,snapToGrid:Re,snapGrid:Ae,connectionMode:A,translateExtent:q,connectOnClick:dr,defaultEdgeOptions:bu,fitView:Tn,fitViewOptions:wl,onNodesDelete:_,onEdgesDelete:O,onNodeDragStart:P,onNodeDrag:I,onNodeDragStop:L,onSelectionDrag:N,onSelectionDragStart:B,onSelectionDragStop:z,noPanClassName:cr,nodeOrigin:ce,rfId:Wr,autoPanOnConnect:Ft,autoPanOnNodeDrag:Hr,onError:Eu,connectionRadius:Ko,isValidConnection:Su,nodeDragThreshold:qo}),X.createElement(FR,{onSelectionChange:U}),Ot,X.createElement(pR,{proOptions:ku,position:wu}),X.createElement(YR,{rfId:Wr,disableKeyboardA11y:kl})))});h1.displayName="ReactFlow";const m1=({id:e,x:t,y:n,width:r,height:i,style:l,color:o,strokeColor:s,strokeWidth:a,className:u,borderRadius:c,shapeRendering:d,onClick:p,selected:h})=>{const{background:x,backgroundColor:v}=l||{},b=o||x||v;return X.createElement("rect",{className:St(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:c,ry:c,width:r,height:i,fill:b,stroke:s,strokeWidth:a,shapeRendering:d,onClick:p?m=>p(m,e):void 0})};m1.displayName="MiniMapNode";var JL=y.memo(m1);const eM=e=>e.nodeOrigin,tM=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),_c=e=>e instanceof Function?e:()=>e;function nM({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i=2,nodeComponent:l=JL,onClick:o}){const s=Ye(tM,gt),a=Ye(eM),u=_c(t),c=_c(e),d=_c(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return X.createElement(X.Fragment,null,s.map(h=>{const{x,y:v}=ui(h,a).positionAbsolute;return X.createElement(l,{key:h.id,x,y:v,width:h.width,height:h.height,style:h.style,selected:h.selected,className:d(h),color:u(h),borderRadius:r,strokeColor:c(h),strokeWidth:i,shapeRendering:p,onClick:o,id:h.id})}))}var rM=y.memo(nM);const iM=200,lM=150,oM=e=>{const t=e.getNodes(),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:t.length>0?gR(yu(t,e.nodeOrigin),n):n,rfId:e.rfId}},sM="react-flow__minimap-desc";function g1({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:i="",nodeBorderRadius:l=5,nodeStrokeWidth:o=2,nodeComponent:s,maskColor:a="rgb(240, 240, 240, 0.6)",maskStrokeColor:u="none",maskStrokeWidth:c=1,position:d="bottom-right",onClick:p,onNodeClick:h,pannable:x=!1,zoomable:v=!1,ariaLabel:b="React Flow mini map",inversePan:m=!1,zoomStep:g=10,offsetScale:w=5}){const S=dt(),j=y.useRef(null),{boundingRect:E,viewBB:P,rfId:I}=Ye(oM,gt),L=(e==null?void 0:e.width)??iM,_=(e==null?void 0:e.height)??lM,O=E.width/L,U=E.height/_,B=Math.max(O,U),N=B*L,z=B*_,R=w*B,W=E.x-(N-E.width)/2-R,M=E.y-(z-E.height)/2-R,A=N+R*2,k=z+R*2,H=`${sM}-${I}`,F=y.useRef(0);F.current=B,y.useEffect(()=>{if(j.current){const re=un(j.current),V=ge=>{const{transform:ve,d3Selection:Re,d3Zoom:Ae}=S.getState();if(ge.sourceEvent.type!=="wheel"||!Re||!Ae)return;const Be=-ge.sourceEvent.deltaY*(ge.sourceEvent.deltaMode===1?.05:ge.sourceEvent.deltaMode?1:.002)*g,ze=ve[2]*Math.pow(2,Be);Ae.scaleTo(Re,ze)},ie=ge=>{const{transform:ve,d3Selection:Re,d3Zoom:Ae,translateExtent:Be,width:ze,height:Ie}=S.getState();if(ge.sourceEvent.type!=="mousemove"||!Re||!Ae)return;const Oe=F.current*Math.max(1,ve[2])*(m?-1:1),Ne={x:ve[0]-ge.sourceEvent.movementX*Oe,y:ve[1]-ge.sourceEvent.movementY*Oe},ce=[[0,0],[ze,Ie]],Fe=qn.translate(Ne.x,Ne.y).scale(ve[2]),it=Ae.constrain()(Fe,ce,Be);Ae.transform(Re,it)},ae=Ew().on("zoom",x?ie:null).on("zoom.wheel",v?V:null);return re.call(ae),()=>{re.on("zoom",null)}}},[x,v,m,g]);const C=p?re=>{const V=kn(re);p(re,{x:V[0],y:V[1]})}:void 0,Z=h?(re,V)=>{const ie=S.getState().nodeInternals.get(V);h(re,ie)}:void 0;return X.createElement(Pp,{position:d,style:e,className:St(["react-flow__minimap",t]),"data-testid":"rf__minimap"},X.createElement("svg",{width:L,height:_,viewBox:`${W} ${M} ${A} ${k}`,role:"img","aria-labelledby":H,ref:j,onClick:C},b&&X.createElement("title",{id:H},b),X.createElement(rM,{onClick:Z,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),X.createElement("path",{className:"react-flow__minimap-mask",d:`M${W-R},${M-R}h${A+R*2}v${k+R*2}h${-A-R*2}z
|
|
112
|
+
M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fill:a,fillRule:"evenodd",stroke:u,strokeWidth:c,pointerEvents:"none"})))}g1.displayName="MiniMap";var aM=y.memo(g1);function uM(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},X.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function cM(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},X.createElement("path",{d:"M0 0h32v4.2H0z"}))}function dM(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},X.createElement("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 fM(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},X.createElement("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 pM(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},X.createElement("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"}))}const Hl=({children:e,className:t,...n})=>X.createElement("button",{type:"button",className:St(["react-flow__controls-button",t]),...n},e);Hl.displayName="ControlButton";const hM=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),x1=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:l,onZoomOut:o,onFitView:s,onInteractiveChange:a,className:u,children:c,position:d="bottom-left"})=>{const p=dt(),[h,x]=y.useState(!1),{isInteractive:v,minZoomReached:b,maxZoomReached:m}=Ye(hM,gt),{zoomIn:g,zoomOut:w,fitView:S}=Op();if(y.useEffect(()=>{x(!0)},[]),!h)return null;const j=()=>{g(),l==null||l()},E=()=>{w(),o==null||o()},P=()=>{S(i),s==null||s()},I=()=>{p.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),a==null||a(!v)};return X.createElement(Pp,{className:St(["react-flow__controls",u]),position:d,style:e,"data-testid":"rf__controls"},t&&X.createElement(X.Fragment,null,X.createElement(Hl,{onClick:j,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:m},X.createElement(uM,null)),X.createElement(Hl,{onClick:E,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b},X.createElement(cM,null))),n&&X.createElement(Hl,{className:"react-flow__controls-fitview",onClick:P,title:"fit view","aria-label":"fit view"},X.createElement(dM,null)),r&&X.createElement(Hl,{className:"react-flow__controls-interactive",onClick:I,title:"toggle interactivity","aria-label":"toggle interactivity"},v?X.createElement(pM,null):X.createElement(fM,null)),c)};x1.displayName="Controls";var mM=y.memo(x1),_n;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(_n||(_n={}));function gM({color:e,dimensions:t,lineWidth:n}){return X.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function xM({color:e,radius:t}){return X.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const yM={[_n.Dots]:"#91919a",[_n.Lines]:"#eee",[_n.Cross]:"#e2e2e2"},vM={[_n.Dots]:1,[_n.Lines]:1,[_n.Cross]:6},wM=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function y1({id:e,variant:t=_n.Dots,gap:n=20,size:r,lineWidth:i=1,offset:l=2,color:o,style:s,className:a}){const u=y.useRef(null),{transform:c,patternId:d}=Ye(wM,gt),p=o||yM[t],h=r||vM[t],x=t===_n.Dots,v=t===_n.Cross,b=Array.isArray(n)?n:[n,n],m=[b[0]*c[2]||1,b[1]*c[2]||1],g=h*c[2],w=v?[g,g]:m,S=x?[g/l,g/l]:[w[0]/l,w[1]/l];return X.createElement("svg",{className:St(["react-flow__background",a]),style:{...s,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:u,"data-testid":"rf__background"},X.createElement("pattern",{id:d+e,x:c[0]%m[0],y:c[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`},x?X.createElement(xM,{color:p,radius:g/l}):X.createElement(gM,{dimensions:w,color:p,lineWidth:i})),X.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${d+e})`}))}y1.displayName="Background";var kM=y.memo(y1);const bM=({agents:e,availableTools:t,builtInTools:n,providers:r,loading:i,onCreateAgent:l,onUpdateAgent:o,onLoadAgent:s,onRefresh:a})=>{const[u,c]=y.useState(""),[d,p]=y.useState(""),[h,x]=y.useState(""),[v,b]=y.useState(""),[m,g]=y.useState(""),[w,S]=y.useState([]),[j,E]=y.useState("inherit"),[P,I]=y.useState(""),[L,_]=y.useState(""),[O,U]=y.useState(""),[B,N]=y.useState(""),[z,R]=y.useState(""),[W,M]=y.useState(""),[A,k]=y.useState(""),[H,F]=y.useState(""),[C,Z]=y.useState(""),[re,V]=y.useState(""),[ie,ae]=y.useState(""),[ge,ve]=y.useState(""),[Re,Ae]=y.useState(""),[Be,ze]=y.useState(null),[Ie,Oe]=y.useState(null),[Ne,ce]=y.useState(!1),[Fe,it]=y.useState(null),[ft,Et]=y.useState(!1),[at,pt]=y.useState("editor"),q=y.useMemo(()=>SM(e),[e]),$=y.useMemo(()=>Ie&&q.lookup[Ie]||null,[q.lookup,Ie]),G=!!Fe,le=y.useMemo(()=>r.filter(Y=>Y.source!=="missing"&&Y.category!=="voice"),[r]),oe=y.useMemo(()=>[{id:"openai",example:"openai:gpt-4o"},{id:"anthropic",example:"anthropic:claude-sonnet-4-5"},{id:"openrouter",example:"openrouter:openai/gpt-4o"},{id:"xai",example:"xai:grok-beta"},{id:"copilot",example:"copilot:gpt-4o"},{id:"lmstudio",example:"lmstudio:llama-3.1-8b"},{id:"ollama",example:"ollama:llama3.2"}],[]),he=Y=>{if(!Y.trim())return;const Ee=Number(Y);return Number.isFinite(Ee)?Ee:void 0},de=()=>{if(j==="inherit")return null;const Y={provider:j};return j==="web_speech"&&(Y.webSpeech={voiceName:P.trim()||void 0,lang:L.trim()||void 0,rate:he(O),pitch:he(B),volume:he(z)}),j==="elevenlabs"&&(Y.elevenlabs={voiceId:W.trim()||void 0,modelId:A.trim()||void 0,stability:he(H),similarityBoost:he(C),style:he(re),speed:he(ie),outputFormat:ge.trim()||void 0,optimizeStreamingLatency:he(Re),speakerBoost:Be??void 0}),Y},we=Y=>{var xt,yt,An,Ot,Nt,In,ln,or,mn,sr,ar,gn,Tt,xn;if(!Y){E("inherit"),I(""),_(""),U(""),N(""),R(""),M(""),k(""),F(""),Z(""),V(""),ae(""),ve(""),Ae(""),ze(null);return}const Ee=Y.provider||(Y.elevenlabs?"elevenlabs":Y.webSpeech?"web_speech":"inherit");E(Ee),I(((xt=Y.webSpeech)==null?void 0:xt.voiceName)||""),_(((yt=Y.webSpeech)==null?void 0:yt.lang)||""),U(((An=Y.webSpeech)==null?void 0:An.rate)!==void 0?String(Y.webSpeech.rate):""),N(((Ot=Y.webSpeech)==null?void 0:Ot.pitch)!==void 0?String(Y.webSpeech.pitch):""),R(((Nt=Y.webSpeech)==null?void 0:Nt.volume)!==void 0?String(Y.webSpeech.volume):""),M(((In=Y.elevenlabs)==null?void 0:In.voiceId)||""),k(((ln=Y.elevenlabs)==null?void 0:ln.modelId)||""),F(((or=Y.elevenlabs)==null?void 0:or.stability)!==void 0?String(Y.elevenlabs.stability):""),Z(((mn=Y.elevenlabs)==null?void 0:mn.similarityBoost)!==void 0?String(Y.elevenlabs.similarityBoost):""),V(((sr=Y.elevenlabs)==null?void 0:sr.style)!==void 0?String(Y.elevenlabs.style):""),ae(((ar=Y.elevenlabs)==null?void 0:ar.speed)!==void 0?String(Y.elevenlabs.speed):""),ve(((gn=Y.elevenlabs)==null?void 0:gn.outputFormat)||""),Ae(((Tt=Y.elevenlabs)==null?void 0:Tt.optimizeStreamingLatency)!==void 0?String(Y.elevenlabs.optimizeStreamingLatency):""),ze(((xn=Y.elevenlabs)==null?void 0:xn.speakerBoost)??null)},Pe=Y=>{S(Ee=>Ee.includes(Y)?Ee.filter(xt=>xt!==Y):[...Ee,Y])},$e=async Y=>{if(Y.preventDefault(),!u.trim()||!m.trim())return;ce(!0);const Ee=de(),xt={displayName:d.trim()||void 0,description:h.trim()||void 0,model:v.trim()||void 0,tools:w,prompt:m.trim()||void 0,voice:Ee},yt=G&&Fe?await o(Fe,xt):await l({id:u.trim(),...xt});ce(!1),yt&&(c(""),p(""),x(""),b(""),g(""),S([]),it(null),we(void 0))},qe=async()=>{if(!$)return;Et(!0);const Y=await s($.id);Et(!1),Y&&(it(Y.id),c(Y.id),p(Y.displayName||""),x(Y.description||""),b(Y.model||""),g(Y.prompt||""),S(Y.tools||[]),we(Y.voice))},Ue=()=>{it(null),c(""),p(""),x(""),b(""),g(""),S([]),we(void 0)};return f.jsxs("section",{className:"space-y-6",children:[f.jsx("div",{className:"flex items-center justify-between gap-3 lg:hidden",children:f.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-slate-900/60 p-1 text-xs font-semibold text-slate-300",children:[f.jsx("button",{type:"button",className:`rounded-full px-3 py-1 transition ${at==="editor"?"bg-sky-500/20 text-sky-300":"text-slate-400"}`,onClick:()=>pt("editor"),children:"Editor"}),f.jsx("button",{type:"button",className:`rounded-full px-3 py-1 transition ${at==="topology"?"bg-sky-500/20 text-sky-300":"text-slate-400"}`,onClick:()=>pt("topology"),children:"Topology"})]})}),f.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(420px,1.4fr)_minmax(360px,1fr)]",children:[f.jsxs("aside",{className:`panel-card animate-rise space-y-6 p-5 ${at==="topology"?"hidden lg:block":""}`,children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("h2",{className:"text-lg font-semibold",children:"Agents"}),f.jsx("p",{className:"text-xs text-slate-400",children:"Create and inspect agent configs."})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{className:"button-ghost",type:"button",onClick:Ue,children:"New"}),f.jsx("button",{className:"button-ghost",type:"button",onClick:a,children:"Refresh"})]})]}),f.jsxs("div",{className:"space-y-3",children:[f.jsx("p",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Built-in Tools (always available)"}),f.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(Y=>f.jsx("span",{className:"pill",children:Y},Y))})]}),f.jsxs("form",{className:"space-y-4",onSubmit:$e,children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Agent ID"}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",value:u,onChange:Y=>c(Y.target.value),placeholder:"e.g. design-lead",required:!0,disabled:G}),G?f.jsxs("p",{className:"text-xs text-slate-400",children:["Editing agent ",f.jsx("span",{className:"font-mono",children:Fe}),". Agent ID cannot be changed."]}):null]}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Display Name"}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",value:d,onChange:Y=>p(Y.target.value),placeholder:"Agent label"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Model"}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",value:v,onChange:Y=>b(Y.target.value),placeholder:"(Example) provider:model-name"}),f.jsxs("div",{className:"rounded-xl border border-dashed border-white/10 bg-slate-950/50 px-3 py-2 text-[11px] text-slate-300",children:[f.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-400",children:"Model Format"}),f.jsxs("p",{className:"mt-2 text-xs",children:["Use ",f.jsx("span",{className:"font-mono",children:"provider:model-name"}),". If a provider is configured, it will appear below."]}),le.length>0?f.jsxs("div",{className:"mt-3 space-y-2",children:[f.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-400",children:"Configured Providers"}),f.jsx("div",{className:"grid gap-2",children:le.map(Y=>{var xt;const Ee=(xt=oe.find(yt=>yt.id===Y.name))==null?void 0:xt.example;return f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-white/10 bg-slate-900/60 px-2 py-1 text-[11px]",children:[f.jsx("span",{className:"pill",children:Y.label}),Ee?f.jsx("span",{className:"font-mono text-slate-300",children:Ee}):f.jsx("span",{className:"text-slate-400",children:"example coming soon"})]},Y.name)})})]}):null]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Description"}),f.jsx("textarea",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",rows:2,value:h,onChange:Y=>x(Y.target.value),placeholder:"Short description of the agent."})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"System Prompt"}),f.jsx("textarea",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",rows:4,value:m,onChange:Y=>g(Y.target.value),placeholder:"Required: describe how this agent should behave.",required:!0})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Tools"}),f.jsx("div",{className:"flex flex-wrap gap-2",children:t.map(Y=>f.jsx("button",{type:"button",className:`rounded-full border px-3 py-1 text-xs font-semibold transition ${w.includes(Y)?"border-sky-500/50 bg-sky-500/15 text-sky-300":"border-white/10 bg-slate-900/60 text-slate-300"}`,onClick:()=>Pe(Y),children:Y},Y))})]}),f.jsxs("details",{className:"group rounded-2xl border border-dashed border-white/10 bg-slate-950/50 px-4 py-3",children:[f.jsx("summary",{className:"cursor-pointer list-none text-sm font-semibold text-slate-200",children:"Voice Settings (Optional)"}),f.jsxs("div",{className:"mt-4 space-y-3 text-xs text-slate-300",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Voice Provider"}),f.jsxs("select",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",value:j,onChange:Y=>E(Y.target.value),children:[f.jsx("option",{value:"inherit",children:"Inherit gateway defaults"}),f.jsx("option",{value:"web_speech",children:"Web Speech"}),f.jsx("option",{value:"elevenlabs",children:"ElevenLabs"})]})]}),j==="web_speech"?f.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Voice name (optional)",value:P,onChange:Y=>I(Y.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Language (e.g. en-US)",value:L,onChange:Y=>_(Y.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Rate (0.1 - 4)",value:O,onChange:Y=>U(Y.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Pitch (0 - 2)",value:B,onChange:Y=>N(Y.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Volume (0 - 1)",value:z,onChange:Y=>R(Y.target.value)})]}):null,j==="elevenlabs"?f.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Voice ID",value:W,onChange:Y=>M(Y.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Model ID (optional)",value:A,onChange:Y=>k(Y.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Stability (0 - 1)",value:H,onChange:Y=>F(Y.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Similarity boost (0 - 1)",value:C,onChange:Y=>Z(Y.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Style (0 - 1)",value:re,onChange:Y=>V(Y.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Speed (0.25 - 4)",value:ie,onChange:Y=>ae(Y.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Output format",value:ge,onChange:Y=>ve(Y.target.value)}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",placeholder:"Optimize latency (0-4)",value:Re,onChange:Y=>Ae(Y.target.value)}),f.jsxs("label",{className:"flex items-center gap-2 text-xs text-slate-300",children:[f.jsx("input",{type:"checkbox",checked:Be??!1,onChange:Y=>ze(Y.target.checked)}),"Use speaker boost"]})]}):null]})]}),f.jsx("button",{className:"button-primary w-full",type:"submit",disabled:Ne,children:Ne?G?"Updating...":"Creating...":G?"Update Agent":"Create Agent"})]})]}),f.jsxs("section",{className:`space-y-6 ${at==="editor"?"hidden lg:block":""}`,children:[f.jsxs("div",{className:"panel-card animate-rise space-y-4 p-5",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h3",{className:"text-lg font-semibold",children:"Agent Topology"}),i?f.jsx("span",{className:"text-xs text-slate-400",children:"Loading..."}):null]}),f.jsx("div",{className:"rounded-2xl border border-white/10 bg-slate-900/60 p-4",children:$?f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-semibold text-slate-100",children:$.displayName}),f.jsx("div",{className:"text-xs text-slate-400",children:$.id})]}),f.jsx("button",{type:"button",className:"button-secondary text-xs",onClick:qe,disabled:ft,children:ft?"Loading...":"Edit"})]}),$.description?f.jsx("p",{className:"text-xs text-slate-300",children:$.description}):null,$.model?f.jsxs("div",{className:"text-xs text-slate-400",children:["Model: ",f.jsx("span",{className:"font-mono",children:$.model})]}):null,f.jsx("div",{className:"flex flex-wrap gap-2",children:$.tools.map(Y=>f.jsx("span",{className:"pill",children:Y},Y))}),$.parentId?f.jsxs("div",{className:"text-xs text-slate-400",children:["Subagent of"," ",f.jsx("span",{className:"font-mono",children:$.parentId})]}):null]}):f.jsx("div",{className:"text-xs text-slate-400",children:"Select an agent node to see details."})})]}),f.jsx("div",{className:"panel-card animate-rise h-[520px] p-4",children:f.jsxs(h1,{nodes:q.nodes,edges:q.edges,fitView:!0,onNodeClick:(Y,Ee)=>Oe(Ee.id),children:[f.jsx(kM,{}),f.jsx(mM,{}),f.jsx(aM,{})]})})]})]})]})};function SM(e){const t=[],n=[],r={};return e.forEach((o,s)=>{var u;const a=`agent-${o.id}`;t.push({id:a,data:{label:o.displayName},position:{x:s%3*220,y:Math.floor(s/3)*160}}),r[a]={id:o.id,displayName:o.displayName,description:o.description,tools:o.tools,model:o.model},(u=o.subAgents)==null||u.forEach((c,d)=>{const p=`${a}-sub-${c.id}`;t.push({id:p,data:{label:c.displayName},position:{x:s%3*220+180,y:Math.floor(s/3)*160+(d+1)*80}}),r[p]={id:c.id,displayName:c.displayName,description:c.description,tools:c.tools,model:c.model,parentId:o.id},n.push({id:`${a}->${p}`,source:a,target:p})})}),{nodes:t,edges:n,lookup:r}}const EM=[{label:"Every hour",value:"0 * * * *"},{label:"Every day 9am",value:"0 9 * * *"},{label:"Weekdays 9am",value:"0 9 * * 1-5"},{label:"Every Monday 9am",value:"0 9 * * 1"}],NM=({agents:e,routines:t,threads:n,loading:r,onCreateRoutine:i,onDeleteRoutine:l})=>{var E;const[o,s]=y.useState(""),[a,u]=y.useState("0 9 * * *"),[c,d]=y.useState(((E=e[0])==null?void 0:E.id)||"main"),[p,h]=y.useState(""),[x,v]=y.useState(!0),[b,m]=y.useState(""),g=o.trim()&&a.trim()&&p.trim(),w=async P=>{P.preventDefault(),!(!g||!await i({name:o.trim(),agentId:c,cron:a.trim(),prompt:p.trim(),sessionId:b||void 0,enabled:x}))&&(s(""),u("0 9 * * *"),h(""),v(!0),m(""))},S=y.useMemo(()=>e.length===0?[{id:"main",name:"Main"}]:e,[e]),j=y.useMemo(()=>n.map(P=>({id:P.id,label:`${P.name} · ${P.agentId}`,agentId:P.agentId})),[n]);return f.jsxs("section",{className:"grid gap-6 lg:grid-cols-[360px_1fr]",children:[f.jsxs("aside",{className:"panel-card animate-rise space-y-6 p-5",children:[f.jsxs("div",{children:[f.jsx("h2",{className:"text-lg font-semibold",children:"Routines"}),f.jsx("p",{className:"text-xs text-slate-400",children:"Schedule recurring runs for any agent using cron."})]}),f.jsxs("form",{className:"space-y-4",onSubmit:w,children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Routine Name"}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",value:o,onChange:P=>s(P.target.value),placeholder:"Daily status report",required:!0})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Schedule (CRON)"}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",value:a,onChange:P=>u(P.target.value),placeholder:"0 9 * * *",required:!0}),f.jsx("div",{className:"flex flex-wrap gap-2",children:EM.map(P=>f.jsx("button",{type:"button",className:"rounded-full border border-white/10 bg-slate-900/60 px-3 py-1 text-xs text-slate-300 transition hover:border-sky-400/50",onClick:()=>u(P.value),children:P.label},P.value))}),f.jsxs("p",{className:"text-xs text-slate-400",children:["Use standard 5‑field cron syntax. Example:"," ",f.jsx("span",{className:"font-mono",children:"0 9 * * 1-5"}),"."]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Agent"}),f.jsx("select",{className:"w-full rounded-xl border border-white/10 bg-slate-900/60 px-3 py-2 text-sm",value:c,onChange:P=>{const I=P.target.value;d(I),b&&!n.some(L=>L.id===b&&L.agentId===I)&&m("")},children:S.map(P=>f.jsx("option",{value:P.id,children:P.name||P.id},P.id))})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Target Session (optional)"}),f.jsxs("select",{className:"w-full rounded-xl border border-white/10 bg-slate-900/60 px-3 py-2 text-sm",value:b,onChange:P=>{const I=P.target.value;m(I);const L=n.find(_=>_.id===I);L&&L.agentId!==c&&d(L.agentId)},children:[f.jsx("option",{value:"",children:"Create a routine thread"}),j.map(P=>f.jsx("option",{value:P.id,children:P.label},P.id))]}),f.jsx("p",{className:"text-xs text-slate-400",children:"Send routine output to an existing chat."})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Prompt"}),f.jsx("textarea",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",rows:4,value:p,onChange:P=>h(P.target.value),placeholder:"What should the agent do each run?",required:!0})]}),f.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2 text-xs text-slate-300",children:[f.jsx("span",{children:"Enabled"}),f.jsx("button",{type:"button",className:`rounded-full border px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.2em] transition ${x?"border-sky-500/50 bg-sky-500/15 text-sky-300":"border-white/10 bg-slate-950/50 text-slate-400"}`,onClick:()=>v(!x),children:x?"On":"Off"})]}),f.jsx("button",{className:"button-primary w-full",type:"submit",disabled:!g,children:"Create Routine"})]})]}),f.jsx("section",{className:"space-y-6",children:f.jsxs("div",{className:"panel-card animate-rise space-y-4 p-5",children:[f.jsx("h3",{className:"text-lg font-semibold",children:"Scheduled Runs"}),r?f.jsx("div",{className:"rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2 text-sm text-slate-400",children:"Loading routines..."}):t.length===0?f.jsx("div",{className:"rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2 text-sm text-slate-400",children:"No routines created yet."}):f.jsx("div",{className:"space-y-3",children:t.map(P=>{var I;return f.jsxs("div",{className:"rounded-2xl border border-white/10 bg-slate-900/60 p-4",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("h4",{className:"text-sm font-semibold text-slate-100",children:P.name}),f.jsxs("p",{className:"text-xs text-slate-400",children:["Agent: ",P.agentId]})]}),f.jsx("span",{className:"pill",children:P.enabled?"enabled":"disabled"})]}),f.jsxs("div",{className:"mt-3 text-xs text-slate-300",children:[f.jsxs("div",{children:[f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Cron"}),f.jsx("div",{className:"mt-1 font-mono",children:P.cron})]}),P.sessionId?f.jsxs("div",{className:"mt-2",children:[f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Target Session"}),f.jsx("div",{className:"mt-1",children:((I=n.find(L=>L.id===P.sessionId))==null?void 0:I.name)||P.sessionId})]}):null,f.jsxs("div",{className:"mt-2",children:[f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Prompt"}),f.jsx("div",{className:"mt-1 line-clamp-2",children:P.prompt})]})]}),f.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs text-slate-400",children:[f.jsxs("span",{children:["Created ",new Date(P.createdAt).toLocaleDateString()]}),f.jsx("button",{type:"button",className:"rounded-full border border-transparent px-3 py-1 text-[10px] uppercase tracking-[0.2em] text-rose-500 transition hover:border-rose-400/40",onClick:()=>void l(P.id),children:"Delete"})]})]},P.id)})})]})})]})},CM=()=>{var n;const e=Math.random().toString(36).slice(2);if(!((n=window.crypto)!=null&&n.getRandomValues))return e;const t=new Uint8Array(24);return window.crypto.getRandomValues(t),Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")},_M=e=>e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)+/g,""),jc=[{id:"custom",name:"Custom",description:"Generic JSON payloads."},{id:"gog-gmail",name:"Gmail (gog)",description:"Use gogcli Gmail watch payloads."}],jM=({agents:e,webhooks:t,threads:n,loading:r,baseUrl:i,onCreateWebhook:l,onUpdateWebhook:o,onDeleteWebhook:s,onTestWebhook:a,onRefresh:u})=>{var Z,re;const[c,d]=y.useState(""),[p,h]=y.useState(""),[x,v]=y.useState(((Z=e[0])==null?void 0:Z.id)||"main"),[b,m]=y.useState(""),[g,w]=y.useState(""),[S,j]=y.useState("custom"),[E,P]=y.useState(""),[I,L]=y.useState(!0),[_,O]=y.useState(null),[U,B]=y.useState(!1),[N,z]=y.useState({}),R=y.useMemo(()=>e.length===0?[{id:"main",name:"Main"}]:e,[e]),W=async V=>{if(V.preventDefault(),!c.trim()||!p.trim()||!b.trim())return;B(!0);const ie={id:c.trim(),name:p.trim(),agentId:x,secret:b.trim(),enabled:I,eventLabel:g.trim()||void 0,preset:S==="custom"?void 0:S,sessionId:E||void 0},ae=_?await o(_,ie):await l(ie);B(!1),ae&&(d(""),h(""),m(""),w(""),L(!0),O(null))},M=V=>{O(V.id),d(V.id),h(V.name),v(V.agentId),m(V.secret),w(V.eventLabel||""),j(V.preset||"custom"),P(V.sessionId||""),L(V.enabled)},A=()=>{var V;O(null),d(""),h(""),v(((V=R[0])==null?void 0:V.id)||"main"),m(""),w(""),j("custom"),P(""),L(!0)},k=y.useMemo(()=>n.map(V=>({id:V.id,label:`${V.name} · ${V.agentId}`,agentId:V.agentId})),[n]),H=async V=>{z(ae=>({...ae,[V]:"Testing..."}));const ie=await a(V);z(ae=>({...ae,[V]:ie.ok?"Webhook fired":ie.message||"Test failed"}))},F=c.trim()?`${i.replace(/\/$/,"")}/webhooks/${c.trim()}`:"",C=y.useMemo(()=>jc.reduce((V,ie)=>(V[ie.id]=ie.name,V),{}),[]);return f.jsxs("section",{className:"grid gap-6 xl:grid-cols-[minmax(420px,1fr)_minmax(360px,1fr)]",children:[f.jsxs("aside",{className:"panel-card animate-rise space-y-6 p-5",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("h2",{className:"text-lg font-semibold",children:"Webhooks"}),f.jsx("p",{className:"text-xs text-slate-400",children:"Trigger agents from external systems with a secure endpoint."})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{className:"button-ghost",type:"button",onClick:A,children:"New"}),f.jsx("button",{className:"button-ghost",type:"button",onClick:u,children:"Refresh"})]})]}),f.jsxs("form",{className:"space-y-4",onSubmit:W,children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Webhook Name"}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",value:p,onChange:V=>{h(V.target.value),c||d(_M(V.target.value))},placeholder:"e.g. New Gmail Message",required:!0})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Webhook ID"}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",value:c,onChange:V=>d(V.target.value),placeholder:"gmail-inbox",required:!0,disabled:!!_}),_?f.jsx("p",{className:"text-xs text-slate-400",children:"Webhook ID cannot be changed once created."}):null]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Agent"}),f.jsx("select",{className:"w-full rounded-xl border border-white/10 bg-slate-900/60 px-3 py-2 text-sm",value:x,onChange:V=>{const ie=V.target.value;v(ie),E&&!n.some(ae=>ae.id===E&&ae.agentId===ie)&&P("")},children:R.map(V=>f.jsx("option",{value:V.id,children:V.name||V.id},V.id))})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Target Session (optional)"}),f.jsxs("select",{className:"w-full rounded-xl border border-white/10 bg-slate-900/60 px-3 py-2 text-sm",value:E,onChange:V=>{const ie=V.target.value;P(ie);const ae=n.find(ge=>ge.id===ie);ae&&ae.agentId!==x&&v(ae.agentId)},children:[f.jsx("option",{value:"",children:"Create a new webhook thread"}),k.map(V=>f.jsx("option",{value:V.id,children:V.label},V.id))]}),f.jsx("p",{className:"text-xs text-slate-400",children:"Choose an existing chat to receive webhook output."})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Secret"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm font-mono",value:b,onChange:V=>m(V.target.value),placeholder:"auto-generated secret",required:!0}),f.jsx("button",{type:"button",className:"button-secondary text-xs",onClick:()=>m(CM()),children:"Generate"})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Preset"}),f.jsx("select",{className:"w-full rounded-xl border border-white/10 bg-slate-900/60 px-3 py-2 text-sm",value:S,onChange:V=>{const ie=V.target.value;j(ie),ie==="gog-gmail"&&!g.trim()&&w("gmail.received")},children:jc.map(V=>f.jsx("option",{value:V.id,children:V.name},V.id))}),f.jsx("p",{className:"text-xs text-slate-400",children:(re=jc.find(V=>V.id===S))==null?void 0:re.description})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-[11px] uppercase tracking-[0.2em] text-slate-400",children:"Event Label (optional)"}),f.jsx("input",{className:"w-full rounded-xl border border-white/10 bg-slate-900/70 px-3 py-2 text-sm",value:g,onChange:V=>w(V.target.value),placeholder:"e.g. email.received"})]}),F?f.jsxs("div",{className:"rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2 text-xs text-slate-300",children:[f.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-400",children:"Endpoint"}),f.jsx("div",{className:"mt-1 break-all font-mono",children:F})]}):null,S==="gog-gmail"&&F?f.jsxs("div",{className:"rounded-xl border border-dashed border-sky-400/40 bg-sky-500/10 px-3 py-2 text-xs text-sky-200",children:[f.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] text-sky-300",children:"Gog Gmail Hook"}),f.jsxs("div",{className:"mt-2 space-y-1 font-mono text-[11px] text-sky-300",children:[f.jsx("div",{children:"gog gmail watch serve \\"}),f.jsxs("div",{children:[" --hook-url ",F," \\"]}),f.jsxs("div",{children:[" --hook-token ",b||"YOUR_SECRET"," \\"]}),f.jsx("div",{children:" --include-body"})]})]}):null,f.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2 text-xs text-slate-300",children:[f.jsx("span",{children:"Enabled"}),f.jsx("button",{type:"button",className:`rounded-full border px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.2em] transition ${I?"border-sky-500/50 bg-sky-500/15 text-sky-300":"border-white/10 bg-slate-950/50 text-slate-400"}`,onClick:()=>L(!I),children:I?"On":"Off"})]}),f.jsx("button",{className:"button-primary w-full",type:"submit",disabled:U,children:U?_?"Updating...":"Creating...":_?"Update Webhook":"Create Webhook"})]})]}),f.jsx("section",{className:"space-y-6",children:f.jsxs("div",{className:"panel-card animate-rise space-y-4 p-5",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h3",{className:"text-lg font-semibold",children:"Configured Webhooks"}),r?f.jsx("span",{className:"text-xs text-slate-400",children:"Loading..."}):null]}),t.length===0?f.jsx("div",{className:"rounded-xl border border-dashed border-white/15 bg-slate-950/50 px-3 py-2 text-sm text-slate-400",children:"No webhooks configured yet."}):f.jsx("div",{className:"space-y-3",children:t.map(V=>{var ie;return f.jsxs("div",{className:"rounded-2xl border border-white/10 bg-slate-900/60 p-4",children:[f.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("h4",{className:"text-sm font-semibold text-slate-100",children:V.name}),f.jsxs("p",{className:"text-xs text-slate-400",children:["Agent: ",V.agentId]})]}),f.jsx("span",{className:"pill",children:V.enabled?"enabled":"disabled"})]}),f.jsxs("div",{className:"mt-3 space-y-2 text-xs text-slate-300",children:[f.jsxs("div",{children:[f.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-400",children:"Endpoint"}),f.jsxs("div",{className:"mt-1 break-all font-mono",children:[i.replace(/\/$/,""),"/webhooks/",V.id]})]}),V.sessionId?f.jsxs("div",{children:[f.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-400",children:"Target Session"}),f.jsx("div",{className:"mt-1",children:((ie=n.find(ae=>ae.id===V.sessionId))==null?void 0:ie.name)||V.sessionId})]}):null,V.preset?f.jsxs("div",{children:[f.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-400",children:"Preset"}),f.jsx("div",{className:"mt-1",children:C[V.preset]||V.preset})]}):null,f.jsxs("div",{children:[f.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-400",children:"Secret"}),f.jsxs("div",{className:"mt-1 font-mono",children:[V.secret.slice(0,6),"•••",V.secret.slice(-4)]})]}),V.eventLabel?f.jsxs("div",{children:[f.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-400",children:"Event Label"}),f.jsx("div",{className:"mt-1",children:V.eventLabel})]}):null]}),f.jsxs("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-2 text-xs text-slate-400",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{type:"button",className:"button-secondary text-xs",onClick:()=>M(V),children:"Edit"}),f.jsx("button",{type:"button",className:"button-secondary text-xs",onClick:()=>H(V.id),children:"Test"}),f.jsx("button",{type:"button",className:"rounded-full border border-transparent px-3 py-1 text-[10px] uppercase tracking-[0.2em] text-rose-500 transition hover:border-rose-400/40",onClick:()=>s(V.id),children:"Delete"})]}),f.jsx("span",{children:N[V.id]||"Ready"})]})]},V.id)})})]})})]})},PM=({catalog:e,configAgents:t})=>{const n=[],r=new Set,i=(l,o)=>{!l||r.has(l)||(r.add(l),n.push({id:l,name:o}))};for(const l of e)i(l.id,l.displayName||l.id);for(const l of t)i(l.id,l.name||l.id);return r.has("main")||i("main","Main"),n},AM=(e,t)=>({provider:(t==null?void 0:t.provider)||(e==null?void 0:e.provider)||"web_speech",webSpeech:{...(e==null?void 0:e.webSpeech)||{},...(t==null?void 0:t.webSpeech)||{}},elevenlabs:{...(e==null?void 0:e.elevenlabs)||{},...(t==null?void 0:t.elevenlabs)||{}}}),IM=e=>{let t=e||"";return t=t.replace(/```[\s\S]*?```/g," "),t=t.replace(/`([^`]+)`/g,"$1"),t=t.replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1"),t=t.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),t=t.replace(/^#+\s+/gm,""),t=t.replace(/^>\s?/gm,""),t=t.replace(/^\s*[-*+]\s+/gm,""),t=t.replace(/^\s*\d+\.\s+/gm,""),t=t.replace(/\s+/g," ").trim(),t},TM=(e,t)=>{if(typeof window>"u"||!("speechSynthesis"in window))return;const n=window.speechSynthesis.getVoices();if(!(!n||n.length===0)){if(e){const r=e.toLowerCase(),i=n.find(l=>{var o;return l.name.toLowerCase()===r||((o=l.voiceURI)==null?void 0:o.toLowerCase())===r});if(i)return i}if(t){const r=t.toLowerCase(),i=n.find(l=>{var o;return(o=l.lang)==null?void 0:o.toLowerCase().startsWith(r)});if(i)return i}return n[0]}};function RM(e){return!e.enabled||!e.text.trim()?!1:!e.spokenMessages.has(e.requestId)}const rf={provider:"web_speech",defaultPolicy:"off",webSpeech:{},elevenlabs:{}},LM={gatewayHost:"127.0.0.1",gatewayPort:18789,requireAuth:!1,outputRoot:"",voice:rf,agents:[]},i0="wingman_webui_token",l0="wingman_webui_password",Pc="wingman_webui_device",Ac="wingman_webui_autoconnect",lf="New Thread",MM=8*1024*1024,zM=20*1024*1024,Ic=6,DM=()=>{var Hp,Wp;const e=rp(),t=wi(),[n,r]=y.useState(!1),[i,l]=y.useState(LM),[o,s]=y.useState("main"),[a,u]=y.useState(""),[c,d]=y.useState(""),[p,h]=y.useState(""),[x,v]=y.useState(!0),[b,m]=y.useState(""),[g,w]=y.useState(!1),[S,j]=y.useState(!1),[E,P]=y.useState(""),[I,L]=y.useState([]),[_,O]=y.useState(""),[U,B]=y.useState([]),[N,z]=y.useState({}),[R,W]=y.useState({}),[M,A]=y.useState(!1),[k,H]=y.useState([]),[F,C]=y.useState(""),[Z,re]=y.useState(!1),[V,ie]=y.useState(null),[ae,ge]=y.useState([]),[ve,Re]=y.useState(!1),[Ae,Be]=y.useState(),[ze,Ie]=y.useState(),[Oe,Ne]=y.useState([]),[ce,Fe]=y.useState([]),[it,ft]=y.useState([]),[Et,at]=y.useState(!1),[pt,q]=y.useState([]),[$,G]=y.useState(!1),[le,oe]=y.useState(""),[he,de]=y.useState([]),[we,Pe]=y.useState(!1),[$e,qe]=y.useState({}),[Ue,Y]=y.useState({status:"idle"}),Ee=y.useRef(null),xt=y.useRef(null),yt=y.useRef(new Map),An=y.useRef(new Map),Ot=y.useRef(new Map),Nt=y.useRef(new Map),In=y.useRef(new Set),ln=y.useRef(null),or=y.useRef(null),mn=y.useRef(null),sr=y.useRef(null),ar=y.useRef(new Map),gn=y.useRef(0),Tt=y.useRef(null),xn=y.useRef(!1),ur=y.useMemo(()=>PM({catalog:Oe,configAgents:i.agents}),[Oe,i.agents]),Ho=y.useMemo(()=>{const T=new Map;for(const D of Oe){const K=new Set;for(const J of D.subAgents||[])J.id&&K.add(Tc(J.id)),J.displayName&&K.add(Tc(J.displayName));T.set(D.id,K)}return T},[Oe]),Wo=y.useMemo(()=>{const T=new Map;for(const D of Oe)T.set(D.id,D.voice);return T},[Oe]),ke=y.useMemo(()=>k.find(T=>T.id===F)||k[0],[F,k]),Yo=(ke==null?void 0:ke.agentId)||o;y.useEffect(()=>{L([]),O("")},[F]);const Q=y.useCallback(T=>{B(D=>[T,...D].slice(0,25))},[]),vu=T=>{if(!T&&T!==0)return"--";const D=Math.floor(T/1e3),K=Math.floor(D/3600),J=Math.floor(D%3600/60),ne=D%60;return K>0?`${K}h ${J}m`:J>0?`${J}m ${ne}s`:`${ne}s`},cr=y.useCallback(async()=>{try{const[T,D]=await Promise.all([fetch("/api/health"),fetch("/api/stats")]);T.ok&&z(await T.json()),D.ok&&W(await D.json())}catch{Q("Failed to refresh gateway stats")}},[Q]),Tn=y.useCallback(async()=>{Re(!0);try{const T=await fetch("/api/providers");if(!T.ok){Q("Failed to load providers");return}const D=await T.json();ge(D.providers||[]),Be(D.updatedAt),Ie(D.credentialsPath)}catch{Q("Failed to load providers")}finally{Re(!1)}},[Q]),wl=y.useCallback(async()=>{re(!0);try{const T=await fetch("/api/sessions?limit=100");if(!T.ok){Q("Failed to load sessions");return}const D=await T.json();H(K=>D.map(ne=>s0(ne)).map(ne=>{const ue=K.find(be=>be.id===ne.id);return ue!=null&&ue.messagesLoaded?{...ne,messages:ue.messages,messagesLoaded:!0,toolEvents:ue.toolEvents||[],thinkingEvents:ue.thinkingEvents||[]}:ne})),D.length>0&&C(K=>D.find(J=>J.id===K)?K:D[0].id)}catch{Q("Failed to load sessions")}finally{re(!1)}},[Q]),dr=y.useCallback(async T=>{if(!T.messagesLoaded){ie(T.id);try{const D=new URLSearchParams({agentId:T.agentId}),K=await fetch(`/api/sessions/${encodeURIComponent(T.id)}/messages?${D.toString()}`);if(!K.ok){Q("Failed to load session messages");return}const J=await K.json();H(ne=>ne.map(ue=>ue.id===T.id?{...ue,messages:J,messagesLoaded:!0,messageCount:J.length}:ue))}catch{Q("Failed to load session messages")}finally{ie(null)}}},[Q]),wu=y.useCallback(async T=>{if(O(""),!T||T.length===0)return;const D=Array.from(T),K=[];for(const J of D){const ne=J.type.startsWith("image/"),ue=J.type.startsWith("audio/");if(!ne&&!ue){O("Only image or audio files are supported.");continue}const be=ne?MM:zM;if(J.size>be){O(ne?"Image is too large. Max size is 8MB.":"Audio is too large. Max size is 20MB.");continue}const fe=await OM(J);K.push({id:a0(),kind:ue?"audio":"image",dataUrl:fe,name:J.name,mimeType:J.type,size:J.size})}L(J=>{const ne=[...J,...K];return ne.length>Ic?(O(`Limit is ${Ic} attachments per message.`),ne.slice(0,Ic)):ne})},[]),ku=y.useCallback(T=>{L(D=>D.filter(K=>K.id!==T))},[]),bu=y.useCallback(()=>{L([]),O("")},[]),fr=y.useCallback(T=>{var K;const D=$e[T];return D!==void 0?D:(((K=i.voice)==null?void 0:K.defaultPolicy)||"off")==="auto"},[(Hp=i.voice)==null?void 0:Hp.defaultPolicy,$e]),Xo=y.useRef(fr);y.useEffect(()=>{Xo.current=fr},[fr]);const kl=y.useCallback(T=>{qe(D=>{var J;const K=D[T]??(((J=i.voice)==null?void 0:J.defaultPolicy)||"off")==="auto";return{...D,[T]:!K}})},[(Wp=i.voice)==null?void 0:Wp.defaultPolicy]),Ft=y.useCallback(()=>{sr.current=null,mn.current&&(mn.current.abort(),mn.current=null),ln.current&&(ln.current.src.startsWith("blob:")&&URL.revokeObjectURL(ln.current.src),ln.current.pause(),ln.current.src="",ln.current=null),or.current&&("speechSynthesis"in window&&window.speechSynthesis.cancel(),or.current=null),Y({status:"idle"})},[]),Hr=y.useCallback(async T=>{const{messageId:D,text:K,agentId:J}=T,ne=IM(K);if(!ne)return;const ue=AM(i.voice,J?Wo.get(J):void 0);Ft();const be=`voice-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;sr.current=be,Y({status:"pending",messageId:D});const fe=()=>sr.current!==be;if(ue.provider==="web_speech"){if(!("speechSynthesis"in window)){Q("Speech synthesis is not supported in this browser."),fe()||Y({status:"idle"});return}const ye=new SpeechSynthesisUtterance(ne),pe=TM(ue.webSpeech.voiceName,ue.webSpeech.lang);pe&&(ye.voice=pe),ue.webSpeech.lang&&(ye.lang=ue.webSpeech.lang),typeof ue.webSpeech.rate=="number"&&(ye.rate=ue.webSpeech.rate),typeof ue.webSpeech.pitch=="number"&&(ye.pitch=ue.webSpeech.pitch),typeof ue.webSpeech.volume=="number"&&(ye.volume=ue.webSpeech.volume),ye.onend=()=>{fe()||Y({status:"idle"})},ye.onerror=()=>{Q("Voice playback failed."),fe()||Y({status:"idle"})},or.current=ye,fe()||Y({status:"playing",messageId:D}),window.speechSynthesis.speak(ye);return}if(ue.provider==="elevenlabs"){if(!ue.elevenlabs.voiceId){Q("ElevenLabs voiceId is not configured."),fe()||Y({status:"idle"});return}if(fe())return;const ye=new AbortController;mn.current=ye,Y({status:"loading",messageId:D});try{const pe=await fetch("/api/voice/speak",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:ne,agentId:J}),signal:ye.signal});if(!pe.ok){const Kr=await pe.text();Q(`Voice request failed: ${Kr||pe.statusText}`),fe()||Y({status:"idle"});return}const Me=await pe.blob();if(fe())return;const vt=URL.createObjectURL(Me),Xe=new Audio(vt);ln.current=Xe,Xe.onended=()=>{URL.revokeObjectURL(vt),fe()||Y({status:"idle"})},Xe.onerror=()=>{URL.revokeObjectURL(vt),Q("Voice playback failed."),fe()||Y({status:"idle"})};const Xr=Xe.play();Xr&&await Xr,fe()||Y({status:"playing",messageId:D})}catch(pe){(pe==null?void 0:pe.name)!=="AbortError"&&Q("Voice playback failed."),fe()||Y({status:"idle"})}finally{mn.current===ye&&(mn.current=null)}}Q("Voice provider is not supported."),fe()||Y({status:"idle"})},[Wo,i.voice,Q,Ft]),Ko=y.useRef(Hr);y.useEffect(()=>{Ko.current=Hr},[Hr]);const Su=ke?fr(ke.id):!1,Eu=y.useCallback(()=>{if(!ke)return;const T=!fr(ke.id);kl(ke.id),T||Ft()},[ke,fr,Ft,kl]),Nu=y.useCallback((T,D)=>{ke&&Hr({messageId:T,text:D,agentId:ke.agentId})},[ke,Hr]),Go=y.useCallback(()=>{Ft()},[Ft]);y.useEffect(()=>{Ft()},[F,Ft]);const qo=y.useCallback((T,D)=>{const K=Ot.current.get(T);K&&H(J=>J.map(ne=>ne.id===K?{...ne,messages:ne.messages.map(ue=>ue.id===T?{...ue,content:D}:ue)}:ne))},[]),Qo=y.useCallback((T,D)=>{const K=Ot.current.get(T);!K||D.length===0||H(J=>J.map(ne=>{if(ne.id!==K)return ne;const ue=ne.messages.map(be=>{if(be.id!==T)return be;const fe=be.toolEvents?[...be.toolEvents]:[];for(const ye of D){const pe=fe.findIndex(Me=>Me.id===ye.id);if(pe>=0){const Me=ye.name&&ye.name!=="tool"?ye.name:fe[pe].name;fe[pe]={...fe[pe],...ye,name:Me,startedAt:fe[pe].startedAt||ye.timestamp,completedAt:ye.status==="completed"||ye.status==="error"?ye.timestamp:fe[pe].completedAt}}else fe.push({id:ye.id,name:ye.name,args:ye.args,status:ye.status,output:ye.output,error:ye.error,startedAt:ye.timestamp,completedAt:ye.status==="completed"||ye.status==="error"?ye.timestamp:void 0})}return{...be,toolEvents:fe}});return{...ne,messages:ue}}))},[]),Zo=y.useCallback((T,D)=>{const K=Ot.current.get(T);!K||D.length===0||H(J=>J.map(ne=>{if(ne.id!==K)return ne;const ue=ne.messages.map(be=>{if(be.id!==T)return be;const fe=be.thinkingEvents?[...be.thinkingEvents]:[];for(const ye of D){const pe=fe.findIndex(Me=>Me.id===ye.id);pe>=0?fe[pe]={...fe[pe],...ye}:fe.push(ye)}return{...be,thinkingEvents:fe}});return{...ne,messages:ue}}))},[]),Wr=y.useCallback((T,D)=>{const K=Ot.current.get(T);if(!K)return;const J=yt.current.get(T)||D||"",ne=ar.current.get(K)||new Set;if(RM({text:J,enabled:Xo.current(K),spokenMessages:ne,requestId:T})){ne.add(T),ar.current.set(K,ne);const ue=Nt.current.get(T);Ko.current({messageId:T,text:J,agentId:ue})}H(ue=>ue.map(be=>be.id!==K?be:{...be,messages:be.messages.map(fe=>fe.id!==T?fe:!fe.content&&D?{...fe,content:D}:fe)})),yt.current.delete(T),An.current.delete(T),Ot.current.delete(T),Nt.current.delete(T),A(!1)},[]),$p=y.useCallback((T,D)=>{var J;if(!D)return;const K=typeof(D==null?void 0:D.sessionId)=="string"?D.sessionId:void 0;if(D.type==="session-message"&&D.role==="user"){if(!K)return;const ne=Date.now(),be=(Array.isArray(D.attachments)?D.attachments:[]).map(pe=>{if(!pe||typeof pe!="object")return null;const Me=typeof pe.dataUrl=="string"?pe.dataUrl:"";if(!Me)return null;const vt=typeof pe.mimeType=="string"?pe.mimeType:void 0,Xe=typeof pe.name=="string"?pe.name:void 0,Xr=typeof pe.size=="number"?pe.size:void 0,Kr=pe.kind==="audio"||(vt==null?void 0:vt.startsWith("audio/"))||Me.startsWith("data:audio/");return{id:a0(),kind:Kr?"audio":"image",dataUrl:Me,mimeType:vt,name:Xe,size:Xr}}).filter(Boolean),fe={id:`user-${T||ne}`,role:"user",content:typeof D.content=="string"?D.content:"",attachments:be.length>0?be:void 0,createdAt:ne},ye=be.length>0?u0(be):"";H(pe=>{const Me=pe.find(Xe=>Xe.id===K);return Me?Me.messages.some(Xe=>Xe.id===fe.id)?pe:pe.map(Xe=>Xe.id!==K?Xe:{...Xe,messages:[...Xe.messages,fe],messageCount:(Xe.messageCount??Xe.messages.length)+1,lastMessagePreview:(fe.content||ye).slice(0,200),updatedAt:ne}):[{id:K,name:K,agentId:typeof(D==null?void 0:D.agentId)=="string"?D.agentId:o,messages:[fe],toolEvents:[],thinkingEvents:[],createdAt:ne,updatedAt:ne,messageCount:1,lastMessagePreview:(fe.content||ye).slice(0,200),messagesLoaded:!1},...pe]});return}if(K&&!Ot.current.has(T)){Ot.current.set(T,K),typeof(D==null?void 0:D.agentId)=="string"&&Nt.current.set(T,D.agentId);const ne=Date.now();H(ue=>{const be=ue.find(pe=>pe.id===K),fe={id:T,role:"assistant",content:"",createdAt:ne};return be?be.messages.some(pe=>pe.id===T)?ue:ue.map(pe=>pe.id!==K?pe:{...pe,messages:[...pe.messages,fe],messageCount:(pe.messageCount??pe.messages.length)+1,updatedAt:ne}):[{id:K,name:K,agentId:typeof(D==null?void 0:D.agentId)=="string"?D.agentId:o,messages:[fe],toolEvents:[],thinkingEvents:[],createdAt:ne,updatedAt:ne,messageCount:1,lastMessagePreview:"",messagesLoaded:!1},...ue]})}if(D.type==="agent-start"){Q(`Agent started: ${D.agent||"unknown"}`);return}if(D.type==="agent-stream"){const{textEvents:ne,toolEvents:ue}=D2(D.chunk),be=Nt.current.get(T),fe=be?Ho.get(be):void 0,ye=[],pe=[];for(const Me of ne){const vt=(J=Me.node)==null?void 0:J.trim(),Xe=vt?Tc(vt):"";if(vt&&fe?fe.has(Xe):!1){const Kr=An.current.get(T)||new Map,O1=Kr.get(Xe)||"",Yp=o0(O1,Me.text);Kr.set(Xe,Yp),An.current.set(T,Kr),pe.push({id:`think-${T}-${Xe}`,node:vt||"Subagent",content:Yp,updatedAt:Date.now()})}else ye.push(Me.text)}if(ye.length>0){const Me=yt.current.get(T)||"",vt=ye.reduce((Xe,Xr)=>o0(Xe,Xr),Me);yt.current.set(T,vt),qo(T,vt),A(!0)}pe.length>0&&(Zo(T,pe),A(!0)),ue.length>0&&(Qo(T,ue),ue.some(Me=>Me.status==="running")&&A(!0));return}if(D.type==="agent-complete"){Q("Agent complete"),Wr(T,D.result?JSON.stringify(D.result,null,2):void 0);return}D.type==="agent-error"&&(Q(`Agent error: ${D.error||"unknown"}`),Wr(T,D.error||"Agent error"))},[o,Wr,Q,Ho,qo,Zo,Qo]),Cu=y.useCallback(()=>{Tt.current&&(window.clearTimeout(Tt.current),Tt.current=null),gn.current=0,xn.current=!1,oe(""),In.current.clear(),Ee.current&&(Ee.current.close(),Ee.current=null),w(!1),j(!1),A(!1)},[]),Jo=y.useCallback(()=>{if(!a){Q("Missing WebSocket URL");return}Tt.current&&(window.clearTimeout(Tt.current),Tt.current=null),xn.current=!1,Cu(),j(!0),localStorage.setItem(i0,c),localStorage.setItem(l0,p),localStorage.setItem(Ac,x?"true":"false");const T=new WebSocket(a);Ee.current=T,T.onopen=()=>{const D=`connect-${Date.now()}`;xt.current=D;const K={type:"connect",id:D,client:{instanceId:`webui-${b}`,clientType:"webui",version:"0.1"},auth:{token:c||void 0,password:p||void 0},timestamp:Date.now()};T.send(JSON.stringify(K))},T.onmessage=D=>{var J;let K;try{K=JSON.parse(D.data)}catch{Q("Received invalid message");return}if(K.type==="res"&&K.id&&K.id===xt.current){K.ok?(w(!0),j(!1),gn.current=0,oe(""),Q("Gateway connected"),cr()):(w(!1),j(!1),Q("Gateway auth failed"),v(!1),oe("Auto-connect paused due to auth failure. Update credentials and connect manually."));return}if(K.type==="event:agent"&&K.id){$p(K.id,K.payload);return}K.type==="error"&&Q(`Gateway error: ${((J=K.payload)==null?void 0:J.message)||"unknown"}`)},T.onerror=()=>{w(!1),j(!1),A(!1),Q("WebSocket error"),xn.current=!0},T.onclose=()=>{if(w(!1),j(!1),A(!1),Q("Gateway disconnected"),!x||!xn.current)return;xn.current=!1;const D=3;if(gn.current+=1,gn.current>D){oe("Auto-connect failed after 3 attempts. Please connect manually.");return}const K=gn.current,J=Math.min(1e3*2**(K-1),8e3);oe(`Retrying auto-connect in ${Math.round(J/1e3)}s (attempt ${K} of ${D}).`),Tt.current=window.setTimeout(()=>{x&&!g&&!S&&Jo()},J)}},[x,b,Cu,$p,Q,p,cr,c,a]),es=y.useCallback(async(T,D)=>{var ne,ue;const K=((ue=(ne=window.crypto)==null?void 0:ne.randomUUID)==null?void 0:ue.call(ne))||`thread-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,J=`agent:${T}:webui:thread:${K}`;try{const be=await fetch("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agentId:T,sessionId:J,name:D})});if(!be.ok)return Q("Failed to create session"),null;const fe=await be.json(),ye=s0(fe);return H(pe=>[ye,...pe]),C(ye.id),ye}catch{return Q("Failed to create session"),null}},[Q]),w1=y.useCallback(async()=>{if(!Ee.current||Ee.current.readyState!==WebSocket.OPEN){Q("Connect to the gateway before sending prompts");return}if(!E.trim()&&I.length===0)return;if(M){Q("Wait for the current response to finish");return}let T=ke;if(!T&&(T=await es(o,lf),!T)){Q("Unable to create a new thread");return}!T.messagesLoaded&&T.messageCount&&await dr(T);const D=`req-${Date.now()}`,K=Date.now(),J=E.trim(),ne=u0(I),ue={id:`user-${K}`,role:"user",content:J,attachments:I.length>0?I:void 0,createdAt:K},be={id:D,role:"assistant",content:"",createdAt:K};H(pe=>pe.map(Me=>Me.id===T.id?{...Me,name:Me.name===lf?(ue.content||ne).slice(0,32):Me.name,messages:[...Me.messages,ue,be],messageCount:(Me.messageCount??Me.messages.length)+1,lastMessagePreview:(ue.content||ne).slice(0,200),updatedAt:K,thinkingEvents:[]}:Me)),P(""),L([]),O(""),A(!0),Ot.current.set(D,T.id),Nt.current.set(D,T.agentId);const fe={agentId:T.agentId,content:ue.content,attachments:I.length>0?I:void 0,routing:{channel:"webui",peer:{kind:"channel",id:b}},sessionKey:T.id},ye={type:"req:agent",id:D,payload:fe,timestamp:Date.now()};Ee.current.send(JSON.stringify(ye))},[ke,o,I,es,b,M,dr,Q,E]),k1=y.useCallback(async()=>{if(ke){if(M){Q("Wait for the current response to finish");return}Ft();try{const T=new URLSearchParams({agentId:ke.agentId});if(!(await fetch(`/api/sessions/${encodeURIComponent(ke.id)}/messages?${T.toString()}`,{method:"DELETE"})).ok){Q("Failed to clear session messages");return}}catch{Q("Failed to clear session messages");return}H(T=>T.map(D=>D.id===ke.id?{...D,messages:[],messageCount:0,lastMessagePreview:void 0,messagesLoaded:!0,thinkingEvents:[]}:D))}},[ke,M,Q,Ft]),_u=y.useCallback(async T=>{var K;if(M&&(ke==null?void 0:ke.id)===T){Q("Wait for the current response to finish");return}const D=k.find(J=>J.id===T);if(D){try{const J=new URLSearchParams({agentId:D.agentId});await fetch(`/api/sessions/${encodeURIComponent(T)}?${J.toString()}`,{method:"DELETE"})}catch{Q("Failed to delete session")}if(H(J=>J.filter(ne=>ne.id!==T)),qe(J=>{if(!J[T])return J;const ne={...J};return delete ne[T],ne}),ar.current.delete(T),F===T){const J=k.filter(ne=>ne.id!==T);C(((K=J[0])==null?void 0:K.id)||""),Ft()}}},[ke==null?void 0:ke.id,F,M,Q,Ft,k]),Bp=y.useCallback(async T=>{const D=k.find(J=>J.id===T);if(!D)return;const K=window.prompt("Rename session",D.name);if(!(!K||!K.trim()))try{const J=new URLSearchParams({agentId:D.agentId}),ne=await fetch(`/api/sessions/${encodeURIComponent(T)}?${J.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:K.trim()})});if(!ne.ok){Q("Failed to rename session");return}const ue=await ne.json();H(be=>be.map(fe=>fe.id===T?{...fe,name:ue.name||K.trim(),updatedAt:ue.updatedAt??fe.updatedAt}:fe))}catch{Q("Failed to rename session")}},[Q,k]),b1=y.useCallback(async(T,D)=>{const K=k.find(J=>J.id===T);if(!K)return!1;try{const J=new URLSearchParams({agentId:K.agentId}),ne=await fetch(`/api/sessions/${encodeURIComponent(T)}/workdir?${J.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workdir:D})});if(!ne.ok)return Q("Failed to update working folder"),!1;const ue=await ne.json();return H(be=>be.map(fe=>fe.id===T?{...fe,workdir:ue.workdir??null}:fe)),!0}catch{return Q("Failed to update working folder"),!1}},[Q,k]),S1=y.useCallback(()=>{localStorage.removeItem(Pc),window.location.reload()},[]),Up=y.useCallback(T=>{C(T);const D=k.find(K=>K.id===T);D&&!D.messagesLoaded&&D.messageCount&&dr(D),D&&s(D.agentId),e("/chat")},[dr,e,k]),Vp=y.useCallback(async(T,D)=>{const K=await es(T,D);return K&&e("/chat"),K},[es,e]);y.useEffect(()=>{var ne,ue;const T=localStorage.getItem(i0)||"",D=localStorage.getItem(l0)||"",K=localStorage.getItem(Ac);d(T),h(D),v(K!==null?K==="true":!0);let J=localStorage.getItem(Pc)||"";J||(J=`device-${((ue=(ne=window.crypto)==null?void 0:ne.randomUUID)==null?void 0:ue.call(ne).slice(0,8))||Math.random().toString(36).slice(2,10)}`,localStorage.setItem(Pc,J)),m(J)},[]);const bi=y.useCallback(async()=>{try{const T=await fetch("/api/config");if(!T.ok)return;const D=await T.json();l({...D,voice:D.voice||rf})}catch{Q("Failed to load gateway config")}},[Q]),E1=y.useCallback(async T=>{try{const D=await fetch("/api/voice",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!D.ok){const J=await D.text();return Q(`Failed to update voice config: ${J||"unknown error"}`),!1}const K=await D.json();return l(J=>({...J,voice:K.voice||J.voice||rf})),Q("Updated voice configuration"),!0}catch{return Q("Failed to update voice config"),!1}},[Q]);y.useEffect(()=>{bi()},[bi]);const Yr=y.useCallback(async()=>{at(!0);try{const T=await fetch("/api/agents");if(!T.ok){Q("Failed to load agents");return}const D=await T.json();Ne(D.agents||[]),Fe(D.tools||[]),ft(D.builtInTools||[])}catch{Q("Failed to load agents")}finally{at(!1)}},[Q]),Un=y.useCallback(async()=>{Pe(!0);try{const T=await fetch("/api/webhooks");if(!T.ok){Q("Failed to load webhooks");return}const D=await T.json();de(D||[])}catch{Q("Failed to load webhooks")}finally{Pe(!1)}},[Q]),Si=y.useCallback(async()=>{G(!0);try{const T=await fetch("/api/routines");if(!T.ok){Q("Failed to load routines");return}const D=await T.json();q(D||[])}catch{Q("Failed to load routines")}finally{G(!1)}},[Q]),N1=y.useCallback(async T=>{try{const D=await fetch(`/api/agents/${encodeURIComponent(T)}`);return D.ok?await D.json():(Q(`Failed to load ${T} details`),null)}catch{return Q(`Failed to load ${T} details`),null}},[Q]);y.useEffect(()=>{const T=window.location.protocol==="https:"?"wss":"ws",D=window.location.hostname||i.gatewayHost||"localhost",K=`${T}://${D}:${i.gatewayPort}/ws`;u(K)},[i.gatewayHost,i.gatewayPort]),y.useEffect(()=>{var D,K;const T=i.defaultAgentId||((D=i.agents.find(J=>J.default))==null?void 0:D.id)||((K=i.agents[0])==null?void 0:K.id)||"main";s(T)},[i]),y.useEffect(()=>{x&&(g||S||!a||!b||Jo())},[x,g,S,Jo,b,a]),y.useEffect(()=>{localStorage.setItem(Ac,x?"true":"false")},[x]),y.useEffect(()=>{x||(Tt.current&&(window.clearTimeout(Tt.current),Tt.current=null),gn.current=0,xn.current=!1,oe(""))},[x]),y.useEffect(()=>{if(!g)return;const T=Ee.current;if(!T||T.readyState!==WebSocket.OPEN)return;const D=new Set(k.map(K=>K.id));for(const K of D){if(In.current.has(K))continue;const J={type:"session_subscribe",payload:{sessionId:K},timestamp:Date.now()};T.send(JSON.stringify(J)),In.current.add(K)}for(const K of Array.from(In.current)){if(D.has(K))continue;const J={type:"session_unsubscribe",payload:{sessionId:K},timestamp:Date.now()};T.send(JSON.stringify(J)),In.current.delete(K)}},[g,k]),y.useEffect(()=>{cr(),wl(),Tn(),Yr(),Un(),Si()},[wl,Yr,Tn,cr,Un,Si]),y.useEffect(()=>{k.length!==0&&(k.find(T=>T.id===F)||C(k[0].id))},[F,k]),y.useEffect(()=>{ke&&(ke.messagesLoaded||dr(ke))},[ke,dr]),y.useEffect(()=>{r(!1)},[t.pathname]),y.useEffect(()=>(n?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[n]),y.useEffect(()=>{if(!n)return;const T=D=>{D.key==="Escape"&&r(!1)};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[n]),y.useEffect(()=>{const T=()=>{window.innerWidth>=1024&&r(!1)};return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);const C1=g?"Connected":S?"Connecting":"Disconnected",_1=i.requireAuth?"Auth required by gateway. Provide a token or password.":"Auth is not required for this gateway.",ju=`${i.gatewayHost}:${i.gatewayPort}`,j1=y.useCallback(async T=>{try{const D=await fetch("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!D.ok){const K=await D.text();return Q(`Failed to create agent: ${K||"unknown error"}`),!1}return await Yr(),await bi(),Q(`Created agent: ${T.id}`),!0}catch{return Q("Failed to create agent"),!1}},[Q,Yr,bi]),P1=y.useCallback(async(T,D)=>{try{const K=await fetch(`/api/agents/${encodeURIComponent(T)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)});if(!K.ok){const J=await K.text();return Q(`Failed to update agent: ${J||"unknown error"}`),!1}return await Yr(),await bi(),Q(`Updated agent: ${T}`),!0}catch{return Q("Failed to update agent"),!1}},[Q,Yr,bi]),A1=y.useCallback(async T=>{try{const D=await fetch("/api/routines",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!D.ok){const K=await D.text();return Q(`Failed to create routine: ${K||"unknown error"}`),!1}return await Si(),Q(`Created routine: ${T.name}`),!0}catch{return Q("Failed to create routine"),!1}},[Q,Si]),I1=y.useCallback(async T=>{try{const D=await fetch(`/api/routines/${encodeURIComponent(T)}`,{method:"DELETE"});if(!D.ok){const K=await D.text();return Q(`Failed to delete routine: ${K||"unknown error"}`),!1}return await Si(),Q(`Deleted routine: ${T}`),!0}catch{return Q("Failed to delete routine"),!1}},[Q,Si]),T1=y.useCallback(async T=>{try{const D=await fetch("/api/webhooks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!D.ok){const K=await D.text();return Q(`Failed to create webhook: ${K||"unknown error"}`),!1}return await Un(),Q(`Created webhook: ${T.id}`),!0}catch{return Q("Failed to create webhook"),!1}},[Q,Un]),R1=y.useCallback(async(T,D)=>{try{const K=await fetch(`/api/webhooks/${encodeURIComponent(T)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)});if(!K.ok){const J=await K.text();return Q(`Failed to update webhook: ${J||"unknown error"}`),!1}return await Un(),Q(`Updated webhook: ${T}`),!0}catch{return Q("Failed to update webhook"),!1}},[Q,Un]),L1=y.useCallback(async T=>{try{const D=await fetch(`/api/webhooks/${encodeURIComponent(T)}`,{method:"DELETE"});if(!D.ok){const K=await D.text();return Q(`Failed to delete webhook: ${K||"unknown error"}`),!1}return await Un(),Q(`Deleted webhook: ${T}`),!0}catch{return Q("Failed to delete webhook"),!1}},[Q,Un]),M1=y.useCallback(async T=>{const D=he.find(J=>J.id===T);if(!D)return{ok:!1,message:"Webhook not found"};const K=D.preset==="gog-gmail"?{event:"gmail.received",messages:[{id:"demo-message-id",from:"alerts@example.com",subject:"Test Gmail webhook",snippet:"Gog sent a Gmail event payload.",body:"This is a sample message body from gog gmail watch."}]}:{event:"test",prompt:"Test webhook from Control UI."};try{const J=await fetch(`/webhooks/${encodeURIComponent(T)}`,{method:"POST",headers:{"Content-Type":"application/json","x-wingman-secret":D.secret},body:JSON.stringify(K)});return J.ok?{ok:!0}:{ok:!1,message:await J.text()||"Test failed"}}catch{return{ok:!1,message:"Test failed"}}},[he]),z1=y.useCallback(async(T,D)=>{try{return(await fetch(`/api/providers/${encodeURIComponent(T)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:D})})).ok?(Q(`Updated ${T} credentials`),await Tn(),!0):(Q(`Failed to save ${T} credentials`),!1)}catch{return Q(`Failed to save ${T} credentials`),!1}},[Q,Tn]),D1=y.useCallback(async T=>{try{return(await fetch(`/api/providers/${encodeURIComponent(T)}`,{method:"DELETE"})).ok?(Q(`Cleared ${T} credentials`),await Tn(),!0):(Q(`Failed to clear ${T} credentials`),!1)}catch{return Q(`Failed to clear ${T} credentials`),!1}},[Q,Tn]);return f.jsxs("div",{className:"relative min-h-screen",children:[f.jsxs("div",{className:"pointer-events-none fixed inset-0 z-0",children:[f.jsx("div",{className:"aurora"}),f.jsx("div",{className:"orb orb-a animate-drift"}),f.jsx("div",{className:"orb orb-b animate-drift"}),f.jsx("div",{className:"orb orb-c animate-drift"}),f.jsx("div",{className:"gridlines"})]}),f.jsx("div",{className:"noise z-[1]"}),f.jsx("main",{className:"relative z-10 mx-auto max-w-screen-2xl px-6 pb-16 pt-8",children:f.jsxs("div",{className:"grid gap-6 lg:grid-cols-[280px_1fr]",children:[f.jsx("div",{className:"hidden lg:block",children:f.jsx(mm,{variant:"default",currentRoute:t.pathname,activeAgents:ur,selectedAgentId:o,threads:k,activeThreadId:(ke==null?void 0:ke.id)||"",loadingThreads:Z,onSelectAgent:s,onSelectThread:Up,onCreateThread:Vp,onDeleteThread:_u,onRenameThread:Bp,hostLabel:ju,deviceId:b,getAgentLabel:T=>{var D;return((D=ur.find(K=>K.id===T))==null?void 0:D.name)||T}})}),f.jsx("button",{type:"button",onClick:()=>r(!0),className:"fixed bottom-6 right-6 z-40 flex h-14 w-14 items-center justify-center rounded-full bg-gradient-to-r from-sky-500 to-blue-600 text-white shadow-[0_14px_30px_rgba(37,99,235,0.45)] transition hover:shadow-[0_18px_36px_rgba(37,99,235,0.55)] active:scale-95 lg:hidden","aria-label":"Open navigation menu",children:f.jsx(P2,{className:"h-6 w-6"})}),n&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 z-[60] bg-slate-950/80 backdrop-blur-sm transition-opacity duration-300 lg:hidden",onClick:()=>r(!1),"aria-label":"Close menu"}),f.jsxs("aside",{className:"fixed inset-y-0 left-0 z-[70] w-[280px] overflow-y-auto border-r border-white/10 bg-slate-900/95 backdrop-blur-2xl shadow-[0_25px_80px_rgba(10,25,60,0.5)] animate-slideInFromLeft lg:hidden",role:"dialog","aria-modal":"true","aria-label":"Navigation menu",children:[f.jsx("div",{className:"sticky top-0 z-10 border-b border-white/10 bg-slate-900/95 px-5 py-4 backdrop-blur-xl",children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("img",{src:Fy,alt:"Wingman",className:"h-12 rounded-xl border border-white/10 bg-slate-950/60 p-1.5"}),f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-slate-400",children:"Menu"}),f.jsx("h2",{className:"text-base font-semibold text-slate-100",children:"Navigation"})]})]}),f.jsx("button",{type:"button",onClick:()=>r(!1),className:"flex h-9 w-9 items-center justify-center rounded-full border border-white/10 bg-slate-900/70 text-slate-300 transition hover:border-sky-400/50 hover:text-sky-300 active:scale-95","aria-label":"Close menu",children:f.jsx(z2,{className:"h-5 w-5"})})]})}),f.jsx("div",{className:"p-5",children:f.jsx(mm,{variant:"mobile-drawer",currentRoute:t.pathname,activeAgents:ur,selectedAgentId:o,threads:k,activeThreadId:(ke==null?void 0:ke.id)||"",loadingThreads:Z,onSelectAgent:s,onSelectThread:Up,onCreateThread:Vp,onDeleteThread:_u,onRenameThread:Bp,hostLabel:ju,deviceId:b,getAgentLabel:T=>{var D;return((D=ur.find(K=>K.id===T))==null?void 0:D.name)||T}})}),f.jsxs("div",{className:"sticky bottom-0 border-t border-white/10 bg-slate-900/95 px-5 py-4 backdrop-blur-xl",children:[f.jsxs("div",{className:"space-y-2 text-xs text-slate-400",children:[f.jsxs("div",{className:"pill",children:["host: ",ju]}),f.jsxs("div",{className:"pill",children:["device: ",b||"--"]})]}),f.jsx("div",{className:"mt-3 flex items-center justify-center rounded-2xl border border-white/10 bg-slate-950/50 px-4 py-3",children:f.jsx("img",{src:$y,alt:"Wingman logo",className:"h-16 w-auto opacity-95"})})]})]})]}),f.jsxs("section",{className:"space-y-6",children:[f.jsx(q2,{agentId:Yo,activeThreadName:ke==null?void 0:ke.name,statusLabel:C1,connected:g,health:N,stats:R,formatDuration:vu}),f.jsxs(r2,{children:[f.jsx(Zr,{path:"/",element:f.jsx(t2,{to:"/chat",replace:!0})}),f.jsx(Zr,{path:"/chat",element:f.jsx(nP,{agentId:Yo,activeThread:ke,prompt:E,attachments:I,attachmentError:_,isStreaming:M,connected:g,loadingThread:V===(ke==null?void 0:ke.id),outputRoot:i.outputRoot,voiceAutoEnabled:Su,voicePlayback:Ue,onToggleVoiceAuto:Eu,onSpeakVoice:Nu,onStopVoice:Go,onPromptChange:P,onSendPrompt:w1,onAddAttachments:wu,onRemoveAttachment:ku,onClearAttachments:bu,onClearChat:k1,onDeleteThread:_u,onOpenCommandDeck:()=>e("/command"),onSetWorkdir:b1})}),f.jsx(Zr,{path:"/command",element:f.jsx(sP,{wsUrl:a,token:c,password:p,connecting:S,connected:g,authHint:_1,autoConnectStatus:le,deviceId:b,eventLog:U,providers:ae,providersLoading:ve,providersUpdatedAt:Ae,credentialsPath:ze,voiceConfig:i.voice,autoConnect:x,onAutoConnectChange:v,onWsUrlChange:u,onTokenChange:d,onPasswordChange:h,onConnect:Jo,onDisconnect:Cu,onRefresh:()=>{cr(),wl(),Tn()},onResetDevice:S1,onRefreshProviders:Tn,onSaveProviderToken:z1,onClearProviderToken:D1,onSaveVoiceConfig:E1})}),f.jsx(Zr,{path:"/agents",element:f.jsx(bM,{agents:Oe,availableTools:ce,builtInTools:it,providers:ae,loading:Et,onCreateAgent:j1,onUpdateAgent:P1,onLoadAgent:N1,onRefresh:Yr})}),f.jsx(Zr,{path:"/routines",element:f.jsx(NM,{agents:ur,routines:pt,threads:k,loading:$,onCreateRoutine:A1,onDeleteRoutine:I1})}),f.jsx(Zr,{path:"/webhooks",element:f.jsx(jM,{agents:ur,webhooks:he,threads:k,loading:we,baseUrl:window.location.origin,onCreateWebhook:T1,onUpdateWebhook:R1,onDeleteWebhook:L1,onTestWebhook:M1,onRefresh:Un})})]})]})]})})]})};function Tc(e){return e.trim().toLowerCase()}function o0(e,t){return t?t.startsWith(e)?t:e+t:e}function s0(e){return{id:e.id,name:e.name||lf,agentId:e.agentId,messages:[],toolEvents:[],thinkingEvents:[],createdAt:e.createdAt||Date.now(),updatedAt:e.updatedAt,messageCount:e.messageCount??0,lastMessagePreview:e.lastMessagePreview,messagesLoaded:!1,workdir:e.workdir??null}}function a0(){var e;return typeof window<"u"&&typeof((e=window.crypto)==null?void 0:e.randomUUID)=="function"?window.crypto.randomUUID():`att-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function OM(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(String(r.result||"")),r.onerror=()=>n(r.error||new Error("Failed to read file")),r.readAsDataURL(e)})}function u0(e){if(!e||e.length===0)return"";let t=!1,n=!1;for(const i of e)FM(i)?t=!0:n=!0;const r=e.length;return t&&n?r>1?"Media attachments":"Media attachment":t?r>1?"Audio attachments":"Audio attachment":r>1?"Image attachments":"Image attachment"}function FM(e){var t,n;return!!(e.kind==="audio"||(t=e.mimeType)!=null&&t.startsWith("audio/")||(n=e.dataUrl)!=null&&n.startsWith("data:audio/"))}const v1=document.getElementById("root");if(!v1)throw new Error("Missing #root element");by(v1).render(f.jsx(X.StrictMode,{children:f.jsx(d2,{children:f.jsx(DM,{})})}));
|