agim-cli 1.4.9 → 1.5.1
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/CHANGELOG.md +437 -402
- package/README.md +43 -7
- package/README.zh-CN.md +42 -7
- package/bin/agim_rpc.py +12 -12
- package/dist/cli-ui/cmd-handlers.d.ts +25 -4
- package/dist/cli-ui/cmd-handlers.d.ts.map +1 -1
- package/dist/cli-ui/cmd-handlers.js +315 -59
- package/dist/cli-ui/cmd-handlers.js.map +1 -1
- package/dist/cli-ui/config-wizard.d.ts +13 -1
- package/dist/cli-ui/config-wizard.d.ts.map +1 -1
- package/dist/cli-ui/config-wizard.js +120 -48
- package/dist/cli-ui/config-wizard.js.map +1 -1
- package/dist/cli-ui/doctor.d.ts +15 -0
- package/dist/cli-ui/doctor.d.ts.map +1 -0
- package/dist/cli-ui/doctor.js +151 -0
- package/dist/cli-ui/doctor.js.map +1 -0
- package/dist/cli-ui/entry-menu.d.ts +6 -0
- package/dist/cli-ui/entry-menu.d.ts.map +1 -1
- package/dist/cli-ui/entry-menu.js +67 -30
- package/dist/cli-ui/entry-menu.js.map +1 -1
- package/dist/cli-ui/env-file.d.ts +4 -4
- package/dist/cli-ui/env-file.js +13 -13
- package/dist/cli-ui/env-file.js.map +1 -1
- package/dist/cli-ui/i18n.d.ts +17 -8
- package/dist/cli-ui/i18n.d.ts.map +1 -1
- package/dist/cli-ui/i18n.js +39 -21
- package/dist/cli-ui/i18n.js.map +1 -1
- package/dist/cli-ui/lang-picker.js +1 -1
- package/dist/cli-ui/lang-picker.js.map +1 -1
- package/dist/cli-ui/paths.d.ts.map +1 -1
- package/dist/cli-ui/paths.js +2 -4
- package/dist/cli-ui/paths.js.map +1 -1
- package/dist/cli-ui/quickstart.d.ts +3 -0
- package/dist/cli-ui/quickstart.d.ts.map +1 -0
- package/dist/cli-ui/quickstart.js +108 -0
- package/dist/cli-ui/quickstart.js.map +1 -0
- package/dist/cli-ui/readiness.d.ts +10 -0
- package/dist/cli-ui/readiness.d.ts.map +1 -0
- package/dist/cli-ui/readiness.js +75 -0
- package/dist/cli-ui/readiness.js.map +1 -0
- package/dist/cli-ui/service.d.ts +30 -7
- package/dist/cli-ui/service.d.ts.map +1 -1
- package/dist/cli-ui/service.js +171 -77
- package/dist/cli-ui/service.js.map +1 -1
- package/dist/cli-ui/tui/app.js +2 -2
- package/dist/cli-ui/tui/app.js.map +1 -1
- package/dist/cli-ui/tui/index.js +6 -6
- package/dist/cli-ui/tui/index.js.map +1 -1
- package/dist/cli-ui/tui/mouse-stdin.js +1 -1
- package/dist/cli-ui/tui/mouse-stdin.js.map +1 -1
- package/dist/cli-ui/tui/stream-reveal.d.ts +2 -2
- package/dist/cli-ui/tui/stream-reveal.d.ts.map +1 -1
- package/dist/cli-ui/tui/stream-reveal.js +4 -4
- package/dist/cli-ui/tui/stream-reveal.js.map +1 -1
- package/dist/cli.js +118 -436
- package/dist/cli.js.map +1 -1
- package/dist/core/a2a-notify.js +5 -5
- package/dist/core/a2a-notify.js.map +1 -1
- package/dist/core/a2a.d.ts +2 -2
- package/dist/core/a2a.d.ts.map +1 -1
- package/dist/core/a2a.js +12 -12
- package/dist/core/a2a.js.map +1 -1
- package/dist/core/access-token.d.ts +1 -1
- package/dist/core/access-token.js +7 -7
- package/dist/core/access-token.js.map +1 -1
- package/dist/core/acp-server.d.ts.map +1 -1
- package/dist/core/acp-server.js +21 -7
- package/dist/core/acp-server.js.map +1 -1
- package/dist/core/admin-allowlist.js +5 -5
- package/dist/core/admin-allowlist.js.map +1 -1
- package/dist/core/agent-base.d.ts +1 -1
- package/dist/core/agent-base.js +3 -3
- package/dist/core/agent-base.js.map +1 -1
- package/dist/core/agent-cwd.d.ts +13 -6
- package/dist/core/agent-cwd.d.ts.map +1 -1
- package/dist/core/agent-cwd.js +72 -23
- package/dist/core/agent-cwd.js.map +1 -1
- package/dist/core/agim-paths.d.ts +1 -4
- package/dist/core/agim-paths.d.ts.map +1 -1
- package/dist/core/agim-paths.js +18 -35
- package/dist/core/agim-paths.js.map +1 -1
- package/dist/core/approval-bus.d.ts +4 -4
- package/dist/core/approval-bus.d.ts.map +1 -1
- package/dist/core/approval-bus.js +14 -14
- package/dist/core/approval-bus.js.map +1 -1
- package/dist/core/approval-router.js +2 -2
- package/dist/core/artifacts.js +3 -3
- package/dist/core/artifacts.js.map +1 -1
- package/dist/core/ask-user-rpc.js +1 -1
- package/dist/core/ask-user-rpc.js.map +1 -1
- package/dist/core/audit-log.js +2 -2
- package/dist/core/audit-log.js.map +1 -1
- package/dist/core/bgjob-reader.d.ts +1 -1
- package/dist/core/bgjob-reader.js +4 -4
- package/dist/core/bgjob-reader.js.map +1 -1
- package/dist/core/commands/approval.js +2 -2
- package/dist/core/commands/approval.js.map +1 -1
- package/dist/core/commands/builtin.d.ts.map +1 -1
- package/dist/core/commands/builtin.js +12 -2
- package/dist/core/commands/builtin.js.map +1 -1
- package/dist/core/commands/heartbeat.js +2 -2
- package/dist/core/commands/heartbeat.js.map +1 -1
- package/dist/core/commands/memo.js +1 -1
- package/dist/core/commands/memo.js.map +1 -1
- package/dist/core/commands/model.d.ts.map +1 -1
- package/dist/core/commands/model.js +32 -3
- package/dist/core/commands/model.js.map +1 -1
- package/dist/core/commands/plan.js +3 -3
- package/dist/core/commands/plan.js.map +1 -1
- package/dist/core/commands/router-compare.js +3 -3
- package/dist/core/commands/router-compare.js.map +1 -1
- package/dist/core/commands/service.d.ts.map +1 -1
- package/dist/core/commands/service.js +1 -3
- package/dist/core/commands/service.js.map +1 -1
- package/dist/core/commands/sessions.js +4 -4
- package/dist/core/commands/sessions.js.map +1 -1
- package/dist/core/commands/skill.js +1 -1
- package/dist/core/commands/skill.js.map +1 -1
- package/dist/core/commands/stats.js +1 -1
- package/dist/core/commands/stats.js.map +1 -1
- package/dist/core/commands/web.js +5 -5
- package/dist/core/commands/web.js.map +1 -1
- package/dist/core/config-schema.js +1 -1
- package/dist/core/coord-systems.d.ts +1 -1
- package/dist/core/coord-systems.js +4 -4
- package/dist/core/coord-systems.js.map +1 -1
- package/dist/core/event-bus.d.ts +5 -5
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js +3 -3
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/feature-flags.d.ts +2 -2
- package/dist/core/feature-flags.js +4 -4
- package/dist/core/feature-flags.js.map +1 -1
- package/dist/core/goal-rpc.js +2 -2
- package/dist/core/goal-rpc.js.map +1 -1
- package/dist/core/goals.d.ts +1 -1
- package/dist/core/goals.js +3 -3
- package/dist/core/goals.js.map +1 -1
- package/dist/core/heartbeat-store.d.ts +1 -1
- package/dist/core/heartbeat-store.d.ts.map +1 -1
- package/dist/core/heartbeat-store.js +3 -3
- package/dist/core/heartbeat-store.js.map +1 -1
- package/dist/core/heartbeat.js +4 -4
- package/dist/core/heartbeat.js.map +1 -1
- package/dist/core/intent-llm.d.ts +2 -2
- package/dist/core/intent-llm.js +5 -5
- package/dist/core/intent-llm.js.map +1 -1
- package/dist/core/job-board.d.ts +5 -5
- package/dist/core/job-board.d.ts.map +1 -1
- package/dist/core/job-board.js +17 -17
- package/dist/core/job-board.js.map +1 -1
- package/dist/core/llm/agent-loop.d.ts +3 -3
- package/dist/core/llm/agent-loop.js +14 -14
- package/dist/core/llm/agent-loop.js.map +1 -1
- package/dist/core/llm/{imhub-dispatcher.d.ts → agim-dispatcher.d.ts} +4 -4
- package/dist/core/llm/agim-dispatcher.d.ts.map +1 -0
- package/dist/core/llm/{imhub-dispatcher.js → agim-dispatcher.js} +43 -43
- package/dist/core/llm/agim-dispatcher.js.map +1 -0
- package/dist/core/llm/agim-rpc-server.js +17 -17
- package/dist/core/llm/agim-rpc-server.js.map +1 -1
- package/dist/core/llm/anthropic-provider.js +2 -1
- package/dist/core/llm/anthropic-provider.js.map +1 -1
- package/dist/core/llm/auto-compact.d.ts +3 -3
- package/dist/core/llm/auto-compact.d.ts.map +1 -1
- package/dist/core/llm/auto-compact.js +5 -5
- package/dist/core/llm/auto-compact.js.map +1 -1
- package/dist/core/llm/builtin-dispatcher.js +3 -3
- package/dist/core/llm/builtin-dispatcher.js.map +1 -1
- package/dist/core/llm/exec-dispatcher.d.ts +2 -2
- package/dist/core/llm/exec-dispatcher.d.ts.map +1 -1
- package/dist/core/llm/exec-dispatcher.js +20 -22
- package/dist/core/llm/exec-dispatcher.js.map +1 -1
- package/dist/core/llm/fs-dispatcher.js +8 -8
- package/dist/core/llm/fs-dispatcher.js.map +1 -1
- package/dist/core/llm/goal-critic.js +4 -4
- package/dist/core/llm/goal-critic.js.map +1 -1
- package/dist/core/llm/hallucination-detector.js +2 -2
- package/dist/core/llm/hallucination-detector.js.map +1 -1
- package/dist/core/llm/mcp-client.d.ts +1 -1
- package/dist/core/llm/mcp-client.js +3 -3
- package/dist/core/llm/mcp-client.js.map +1 -1
- package/dist/core/llm/mcp-registry.js +3 -3
- package/dist/core/llm/mcp-registry.js.map +1 -1
- package/dist/core/llm/openai-compat-provider.d.ts +1 -1
- package/dist/core/llm/openai-compat-provider.js +5 -4
- package/dist/core/llm/openai-compat-provider.js.map +1 -1
- package/dist/core/llm/provider-base.d.ts +5 -5
- package/dist/core/llm/provider-base.d.ts.map +1 -1
- package/dist/core/llm/provider-base.js +1 -1
- package/dist/core/llm/provider-base.js.map +1 -1
- package/dist/core/llm/secrets.d.ts +2 -2
- package/dist/core/llm/secrets.d.ts.map +1 -1
- package/dist/core/llm/tool-dispatcher.d.ts +1 -1
- package/dist/core/llm/web-dispatcher.d.ts +1 -1
- package/dist/core/llm/web-dispatcher.js +15 -15
- package/dist/core/llm/web-dispatcher.js.map +1 -1
- package/dist/core/logger.d.ts +1 -1
- package/dist/core/logger.js +3 -3
- package/dist/core/logger.js.map +1 -1
- package/dist/core/memo-rpc.js +3 -3
- package/dist/core/memo-rpc.js.map +1 -1
- package/dist/core/memory-consolidate.js +4 -4
- package/dist/core/memory-consolidate.js.map +1 -1
- package/dist/core/memory-distill.js +4 -4
- package/dist/core/memory-distill.js.map +1 -1
- package/dist/core/memory-distiller.js +9 -9
- package/dist/core/memory-distiller.js.map +1 -1
- package/dist/core/memory-vector.js +9 -9
- package/dist/core/memory-vector.js.map +1 -1
- package/dist/core/memory.js +2 -2
- package/dist/core/memory.js.map +1 -1
- package/dist/core/memos.js +6 -6
- package/dist/core/memos.js.map +1 -1
- package/dist/core/message-sink.js +13 -13
- package/dist/core/message-sink.js.map +1 -1
- package/dist/core/notification-evaluator.d.ts +2 -2
- package/dist/core/notification-evaluator.js +4 -4
- package/dist/core/notification-evaluator.js.map +1 -1
- package/dist/core/onboarding.js +3 -3
- package/dist/core/onboarding.js.map +1 -1
- package/dist/core/outbox.js +2 -2
- package/dist/core/outbox.js.map +1 -1
- package/dist/core/persona.d.ts +1 -1
- package/dist/core/persona.d.ts.map +1 -1
- package/dist/core/persona.js +2 -2
- package/dist/core/persona.js.map +1 -1
- package/dist/core/plan-history.js +1 -1
- package/dist/core/plan-history.js.map +1 -1
- package/dist/core/plan-intent.js +5 -5
- package/dist/core/plan-intent.js.map +1 -1
- package/dist/core/plan-mode-state.d.ts +1 -1
- package/dist/core/plan-mode-state.js +4 -4
- package/dist/core/plan-mode-state.js.map +1 -1
- package/dist/core/push-rpc.d.ts +1 -1
- package/dist/core/push-rpc.js +6 -6
- package/dist/core/push-rpc.js.map +1 -1
- package/dist/core/registry.d.ts +4 -4
- package/dist/core/registry.js +10 -10
- package/dist/core/registry.js.map +1 -1
- package/dist/core/reminders.js +1 -1
- package/dist/core/reminders.js.map +1 -1
- package/dist/core/restart-flow.d.ts.map +1 -1
- package/dist/core/restart-flow.js +5 -7
- package/dist/core/restart-flow.js.map +1 -1
- package/dist/core/router.d.ts +1 -1
- package/dist/core/router.js +5 -5
- package/dist/core/router.js.map +1 -1
- package/dist/core/schedule.d.ts +2 -2
- package/dist/core/schedule.js +4 -4
- package/dist/core/schedule.js.map +1 -1
- package/dist/core/self-protect.js +3 -3
- package/dist/core/self-protect.js.map +1 -1
- package/dist/core/sender-allowlist.js +7 -7
- package/dist/core/sender-allowlist.js.map +1 -1
- package/dist/core/sensitive-paths.d.ts.map +1 -1
- package/dist/core/sensitive-paths.js +1 -2
- package/dist/core/sensitive-paths.js.map +1 -1
- package/dist/core/session.js +2 -2
- package/dist/core/session.js.map +1 -1
- package/dist/core/skills/builtin/ECC_NOTICE.md +1 -1
- package/dist/core/skills/builtin/agim-memory/SKILL.md +1 -1
- package/dist/core/skills/builtin/agim-reminders/SKILL.md +2 -2
- package/dist/core/skills/builtin/agim-self/SKILL.md +9 -9
- package/dist/core/skills/builtin/agim-skill-discovery/SKILL.md +5 -5
- package/dist/core/skills/builtin/image-generation/SKILL.md +2 -2
- package/dist/core/skills/builtin/long-goal/SKILL.md +7 -7
- package/dist/core/skills/builtin/my/SKILL.md +2 -2
- package/dist/core/skills/builtin/skill-creator/SKILL.md +2 -2
- package/dist/core/skills/loader.d.ts +4 -4
- package/dist/core/skills/loader.js +22 -22
- package/dist/core/skills/loader.js.map +1 -1
- package/dist/core/skills-rpc.js +1 -1
- package/dist/core/skills-rpc.js.map +1 -1
- package/dist/core/transcribe.js +13 -13
- package/dist/core/transcribe.js.map +1 -1
- package/dist/core/tunnel.js +1 -1
- package/dist/core/tunnel.js.map +1 -1
- package/dist/core/types.d.ts +2 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/user-coord-prefs.js +1 -1
- package/dist/core/user-coord-prefs.js.map +1 -1
- package/dist/core/viewer-config.d.ts +8 -8
- package/dist/core/viewer-config.js +17 -17
- package/dist/core/viewer-config.js.map +1 -1
- package/dist/core/viewer-local.js +4 -4
- package/dist/core/viewer-local.js.map +1 -1
- package/dist/core/viewer-remote.js +1 -1
- package/dist/core/viewer-remote.js.map +1 -1
- package/dist/plugins/agents/acp/url-guard.d.ts +1 -1
- package/dist/plugins/agents/acp/url-guard.js +2 -2
- package/dist/plugins/agents/acp/url-guard.js.map +1 -1
- package/dist/plugins/agents/antigravity/ensure-mcp-config.d.ts +6 -6
- package/dist/plugins/agents/antigravity/ensure-mcp-config.d.ts.map +1 -1
- package/dist/plugins/agents/antigravity/ensure-mcp-config.js +12 -12
- package/dist/plugins/agents/antigravity/ensure-mcp-config.js.map +1 -1
- package/dist/plugins/agents/antigravity/index.js +10 -10
- package/dist/plugins/agents/antigravity/index.js.map +1 -1
- package/dist/plugins/agents/claude-code/index.d.ts +2 -2
- package/dist/plugins/agents/claude-code/index.js +16 -16
- package/dist/plugins/agents/claude-code/index.js.map +1 -1
- package/dist/plugins/agents/claude-code/mcp-approval-server.js +13 -13
- package/dist/plugins/agents/claude-code/mcp-approval-server.js.map +1 -1
- package/dist/plugins/agents/codex/build-mcp-cli-args.d.ts +4 -4
- package/dist/plugins/agents/codex/build-mcp-cli-args.js +14 -14
- package/dist/plugins/agents/codex/build-mcp-cli-args.js.map +1 -1
- package/dist/plugins/agents/codex/index.d.ts +3 -3
- package/dist/plugins/agents/codex/index.js +14 -14
- package/dist/plugins/agents/codex/index.js.map +1 -1
- package/dist/plugins/agents/cursor/ensure-mcp-config.d.ts +5 -5
- package/dist/plugins/agents/cursor/ensure-mcp-config.d.ts.map +1 -1
- package/dist/plugins/agents/cursor/ensure-mcp-config.js +11 -11
- package/dist/plugins/agents/cursor/ensure-mcp-config.js.map +1 -1
- package/dist/plugins/agents/cursor/index.d.ts +1 -1
- package/dist/plugins/agents/cursor/index.js +12 -12
- package/dist/plugins/agents/cursor/index.js.map +1 -1
- package/dist/plugins/agents/native/index.d.ts +1 -0
- package/dist/plugins/agents/native/index.d.ts.map +1 -1
- package/dist/plugins/agents/native/index.js +28 -14
- package/dist/plugins/agents/native/index.js.map +1 -1
- package/dist/plugins/agents/native/tool-registry.d.ts +3 -3
- package/dist/plugins/agents/native/tool-registry.d.ts.map +1 -1
- package/dist/plugins/agents/native/tool-registry.js +5 -5
- package/dist/plugins/agents/native/tool-registry.js.map +1 -1
- package/dist/plugins/agents/opencode/ensure-mcp-config.d.ts +1 -1
- package/dist/plugins/agents/opencode/ensure-mcp-config.js +9 -9
- package/dist/plugins/agents/opencode/ensure-mcp-config.js.map +1 -1
- package/dist/plugins/agents/opencode/index.js +3 -3
- package/dist/plugins/agents/opencode/index.js.map +1 -1
- package/dist/plugins/agents/opencode/opencode-http-adapter.d.ts +4 -0
- package/dist/plugins/agents/opencode/opencode-http-adapter.d.ts.map +1 -1
- package/dist/plugins/agents/opencode/opencode-http-adapter.js +16 -12
- package/dist/plugins/agents/opencode/opencode-http-adapter.js.map +1 -1
- package/dist/plugins/agents/opencode/opencode-stdio-adapter.d.ts +2 -2
- package/dist/plugins/agents/opencode/opencode-stdio-adapter.d.ts.map +1 -1
- package/dist/plugins/agents/opencode/opencode-stdio-adapter.js +7 -5
- package/dist/plugins/agents/opencode/opencode-stdio-adapter.js.map +1 -1
- package/dist/plugins/agents/opencode/serve-manager.d.ts +1 -1
- package/dist/plugins/agents/opencode/serve-manager.d.ts.map +1 -1
- package/dist/plugins/agents/opencode/serve-manager.js +10 -10
- package/dist/plugins/agents/opencode/serve-manager.js.map +1 -1
- package/dist/plugins/agents/pi-native/factory.d.ts.map +1 -1
- package/dist/plugins/agents/pi-native/factory.js +29 -13
- package/dist/plugins/agents/pi-native/factory.js.map +1 -1
- package/dist/plugins/agents/pi-native/index.d.ts +14 -3
- package/dist/plugins/agents/pi-native/index.d.ts.map +1 -1
- package/dist/plugins/agents/pi-native/index.js +58 -4
- package/dist/plugins/agents/pi-native/index.js.map +1 -1
- package/dist/plugins/agents/pi-native/provider-resolver.d.ts +2 -0
- package/dist/plugins/agents/pi-native/provider-resolver.d.ts.map +1 -1
- package/dist/plugins/agents/pi-native/provider-resolver.js +9 -1
- package/dist/plugins/agents/pi-native/provider-resolver.js.map +1 -1
- package/dist/plugins/agents/pi-native/tool-bridge.js +1 -1
- package/dist/plugins/agents/pi-native/tool-bridge.js.map +1 -1
- package/dist/plugins/agents/pi-native/tools.js +4 -4
- package/dist/plugins/agents/pi-native/tools.js.map +1 -1
- package/dist/plugins/messengers/dingtalk/dingtalk-adapter.d.ts +1 -1
- package/dist/plugins/messengers/dingtalk/dingtalk-adapter.js +2 -2
- package/dist/plugins/messengers/dingtalk/dingtalk-adapter.js.map +1 -1
- package/dist/plugins/messengers/email/email-adapter.js +15 -15
- package/dist/plugins/messengers/email/email-adapter.js.map +1 -1
- package/dist/plugins/messengers/telegram/media-download.d.ts +1 -1
- package/dist/plugins/messengers/telegram/media-download.js +4 -4
- package/dist/plugins/messengers/telegram/media-download.js.map +1 -1
- package/dist/plugins/messengers/telegram/telegram-adapter.d.ts +1 -1
- package/dist/plugins/messengers/telegram/telegram-adapter.js +3 -3
- package/dist/plugins/messengers/telegram/telegram-adapter.js.map +1 -1
- package/dist/plugins/messengers/wechat/context-store.js +1 -1
- package/dist/plugins/messengers/wechat/context-store.js.map +1 -1
- package/dist/plugins/messengers/wechat/ilink-adapter.js +1 -1
- package/dist/plugins/messengers/wechat/ilink-adapter.js.map +1 -1
- package/dist/plugins/messengers/wechat/ilink-client.js +1 -1
- package/dist/plugins/messengers/wechat/ilink-client.js.map +1 -1
- package/dist/plugins/messengers/wechat/media-download.js +1 -1
- package/dist/plugins/messengers/wechat/media-download.js.map +1 -1
- package/dist/scripts/migrate-gcj02-to-wgs84.js +1 -1
- package/dist/scripts/migrate-gcj02-to-wgs84.js.map +1 -1
- package/dist/web/public/assets/a2a-CTsDMefo.js +7 -0
- package/dist/web/public/assets/a2a-CTsDMefo.js.map +1 -0
- package/dist/web/public/assets/{activity-BnlFGipw.js → activity-ul8Os7Pz.js} +2 -2
- package/dist/web/public/assets/{activity-BnlFGipw.js.map → activity-ul8Os7Pz.js.map} +1 -1
- package/dist/web/public/assets/{admins-CH84Rw1d.js → admins-ByMAuquy.js} +3 -3
- package/dist/web/public/assets/{admins-CH84Rw1d.js.map → admins-ByMAuquy.js.map} +1 -1
- package/dist/web/public/assets/agents-Ds1zyxBj.js +2 -0
- package/dist/web/public/assets/agents-Ds1zyxBj.js.map +1 -0
- package/dist/web/public/assets/{approvals-DnzjbDR6.js → approvals-DOWlWI7Z.js} +3 -3
- package/dist/web/public/assets/{approvals-DnzjbDR6.js.map → approvals-DOWlWI7Z.js.map} +1 -1
- package/dist/web/public/assets/{arrow-down-DxlRHrs8.js → arrow-down-7i0xwCI2.js} +2 -2
- package/dist/web/public/assets/{arrow-down-DxlRHrs8.js.map → arrow-down-7i0xwCI2.js.map} +1 -1
- package/dist/web/public/assets/arrow-right-A889Wof8.js +7 -0
- package/dist/web/public/assets/arrow-right-A889Wof8.js.map +1 -0
- package/dist/web/public/assets/{arrow-up-CAiQ2jy-.js → arrow-up-Dm0U4-6U.js} +2 -2
- package/dist/web/public/assets/{arrow-up-CAiQ2jy-.js.map → arrow-up-Dm0U4-6U.js.map} +1 -1
- package/dist/web/public/assets/{asks-DyUQopay.js → asks-DGuBsrJ7.js} +3 -3
- package/dist/web/public/assets/{asks-DyUQopay.js.map → asks-DGuBsrJ7.js.map} +1 -1
- package/dist/web/public/assets/{audit-BVHTMS82.js → audit-BRXsplJ2.js} +2 -2
- package/dist/web/public/assets/{audit-BVHTMS82.js.map → audit-BRXsplJ2.js.map} +1 -1
- package/dist/web/public/assets/{bell-D7iS7ctN.js → bell-B-UdeJsp.js} +2 -2
- package/dist/web/public/assets/{bell-D7iS7ctN.js.map → bell-B-UdeJsp.js.map} +1 -1
- package/dist/web/public/assets/bgjobs-CcRiffyJ.js +2 -0
- package/dist/web/public/assets/bgjobs-CcRiffyJ.js.map +1 -0
- package/dist/web/public/assets/book-open-CSCq5cjL.js +7 -0
- package/dist/web/public/assets/book-open-CSCq5cjL.js.map +1 -0
- package/dist/web/public/assets/{brain-CCF25Egu.js → brain-Dl4DF5kX.js} +2 -2
- package/dist/web/public/assets/{brain-CCF25Egu.js.map → brain-Dl4DF5kX.js.map} +1 -1
- package/dist/web/public/assets/{briefcase-BMLMD8nM.js → briefcase-CeKUkFSq.js} +2 -2
- package/dist/web/public/assets/{briefcase-BMLMD8nM.js.map → briefcase-CeKUkFSq.js.map} +1 -1
- package/dist/web/public/assets/chat-rLJMdJBk.js +12 -0
- package/dist/web/public/assets/chat-rLJMdJBk.js.map +1 -0
- package/dist/web/public/assets/{chevron-left-BDO3vw8G.js → chevron-left-01fAFVpo.js} +2 -2
- package/dist/web/public/assets/{chevron-left-BDO3vw8G.js.map → chevron-left-01fAFVpo.js.map} +1 -1
- package/dist/web/public/assets/{chevron-right-5ZUC2opg.js → chevron-right-CFRb-SM_.js} +3 -3
- package/dist/web/public/assets/{chevron-right-5ZUC2opg.js.map → chevron-right-CFRb-SM_.js.map} +1 -1
- package/dist/web/public/assets/{circle-check-big-DHAHqUlS.js → circle-check-big-DBg2BD6o.js} +2 -2
- package/dist/web/public/assets/{circle-check-big-DHAHqUlS.js.map → circle-check-big-DBg2BD6o.js.map} +1 -1
- package/dist/web/public/assets/{circle-x-7VaoZ7dY.js → circle-x-CqFMzO-x.js} +2 -2
- package/dist/web/public/assets/{circle-x-7VaoZ7dY.js.map → circle-x-CqFMzO-x.js.map} +1 -1
- package/dist/web/public/assets/clipboard-list-lnqdk2_J.js +7 -0
- package/dist/web/public/assets/clipboard-list-lnqdk2_J.js.map +1 -0
- package/dist/web/public/assets/{clock-ZPVXnd6V.js → clock-4hd1joQe.js} +3 -3
- package/dist/web/public/assets/{clock-ZPVXnd6V.js.map → clock-4hd1joQe.js.map} +1 -1
- package/dist/web/public/assets/confirm-dialog-BDb0NLny.js +2 -0
- package/dist/web/public/assets/{confirm-dialog-CgpJL9oN.js.map → confirm-dialog-BDb0NLny.js.map} +1 -1
- package/dist/web/public/assets/{copy-BaZl52tH.js → copy-CD4A7VD8.js} +3 -3
- package/dist/web/public/assets/{copy-BaZl52tH.js.map → copy-CD4A7VD8.js.map} +1 -1
- package/dist/web/public/assets/dashboard-CG3WiG7h.js +2 -0
- package/dist/web/public/assets/dashboard-CG3WiG7h.js.map +1 -0
- package/dist/web/public/assets/{data-table-BLYG79TX.js → data-table-BkUshOZz.js} +2 -2
- package/dist/web/public/assets/{data-table-BLYG79TX.js.map → data-table-BkUshOZz.js.map} +1 -1
- package/dist/web/public/assets/database-lQzk64rV.js +7 -0
- package/dist/web/public/assets/database-lQzk64rV.js.map +1 -0
- package/dist/web/public/assets/distill-CPurVW3v.js +7 -0
- package/dist/web/public/assets/distill-CPurVW3v.js.map +1 -0
- package/dist/web/public/assets/{download-bzCepctg.js → download-CVZnHcwj.js} +2 -2
- package/dist/web/public/assets/{download-bzCepctg.js.map → download-CVZnHcwj.js.map} +1 -1
- package/dist/web/public/assets/dropdown-menu-BNH5SrVb.js +7 -0
- package/dist/web/public/assets/dropdown-menu-BNH5SrVb.js.map +1 -0
- package/dist/web/public/assets/email-YlI4MWLp.js +7 -0
- package/dist/web/public/assets/email-YlI4MWLp.js.map +1 -0
- package/dist/web/public/assets/{empty-state-96qpPTNg.js → empty-state-CuiqdZiB.js} +2 -2
- package/dist/web/public/assets/{empty-state-96qpPTNg.js.map → empty-state-CuiqdZiB.js.map} +1 -1
- package/dist/web/public/assets/{external-link-J4nIlCem.js → external-link-1WPpVvdu.js} +2 -2
- package/dist/web/public/assets/{external-link-J4nIlCem.js.map → external-link-1WPpVvdu.js.map} +1 -1
- package/dist/web/public/assets/{eye-BvsBLK42.js → eye-BfPyNFzk.js} +2 -2
- package/dist/web/public/assets/{eye-BvsBLK42.js.map → eye-BfPyNFzk.js.map} +1 -1
- package/dist/web/public/assets/{facts-DMucDXYd.js → facts-xT_24pH8.js} +2 -2
- package/dist/web/public/assets/{facts-DMucDXYd.js.map → facts-xT_24pH8.js.map} +1 -1
- package/dist/web/public/assets/file-text-BxfdLM0-.js +7 -0
- package/dist/web/public/assets/file-text-BxfdLM0-.js.map +1 -0
- package/dist/web/public/assets/{goals-B9ETHgL0.js → goals-C8ZQfbhj.js} +3 -3
- package/dist/web/public/assets/{goals-B9ETHgL0.js.map → goals-C8ZQfbhj.js.map} +1 -1
- package/dist/web/public/assets/health-A2StNEfn.js +2 -0
- package/dist/web/public/assets/{health-DLzZ7KHc.js.map → health-A2StNEfn.js.map} +1 -1
- package/dist/web/public/assets/{heart-pulse-CVEeD2sz.js → heart-pulse-DXlE9oic.js} +2 -2
- package/dist/web/public/assets/{heart-pulse-CVEeD2sz.js.map → heart-pulse-DXlE9oic.js.map} +1 -1
- package/dist/web/public/assets/{heartbeat-B1BEBHge.js → heartbeat-ClO5gJrj.js} +3 -3
- package/dist/web/public/assets/{heartbeat-B1BEBHge.js.map → heartbeat-ClO5gJrj.js.map} +1 -1
- package/dist/web/public/assets/hot-bfTA-V_z.js +7 -0
- package/dist/web/public/assets/{hot-Yc7iad0D.js.map → hot-bfTA-V_z.js.map} +1 -1
- package/dist/web/public/assets/index-Bi2qWb-u.css +1 -0
- package/dist/web/public/assets/index-DCfdN5R7.js +244 -0
- package/dist/web/public/assets/index-DCfdN5R7.js.map +1 -0
- package/dist/web/public/assets/{injection-Ca-9gbo0.js → injection-omvCR6-p.js} +2 -2
- package/dist/web/public/assets/{injection-Ca-9gbo0.js.map → injection-omvCR6-p.js.map} +1 -1
- package/dist/web/public/assets/{installed-Zz34apdi.js → installed-DL6r3ktm.js} +4 -9
- package/dist/web/public/assets/installed-DL6r3ktm.js.map +1 -0
- package/dist/web/public/assets/jobs-Biy5lYd4.js +2 -0
- package/dist/web/public/assets/jobs-Biy5lYd4.js.map +1 -0
- package/dist/web/public/assets/layout-BLm6NJ3V.js +2 -0
- package/dist/web/public/assets/layout-BLm6NJ3V.js.map +1 -0
- package/dist/web/public/assets/layout-BTKafRVZ.js +2 -0
- package/dist/web/public/assets/layout-BTKafRVZ.js.map +1 -0
- package/dist/web/public/assets/layout-Bm-2s2fp.js +2 -0
- package/dist/web/public/assets/layout-Bm-2s2fp.js.map +1 -0
- package/dist/web/public/assets/layout-DsZ8eR4i.js +2 -0
- package/dist/web/public/assets/layout-DsZ8eR4i.js.map +1 -0
- package/dist/web/public/assets/{layout-CtDc2i7w.js → layout-sxvovjEH.js} +2 -2
- package/dist/web/public/assets/{layout-CtDc2i7w.js.map → layout-sxvovjEH.js.map} +1 -1
- package/dist/web/public/assets/llm-JjZDbBvJ.js +37 -0
- package/dist/web/public/assets/llm-JjZDbBvJ.js.map +1 -0
- package/dist/web/public/assets/loader-circle-DDdmcH0k.js +7 -0
- package/dist/web/public/assets/{loader-circle-D8L1w9c1.js.map → loader-circle-DDdmcH0k.js.map} +1 -1
- package/dist/web/public/assets/{map-pin--GMunU9n.js → map-pin-C_jAxukI.js} +2 -2
- package/dist/web/public/assets/{map-pin--GMunU9n.js.map → map-pin-C_jAxukI.js.map} +1 -1
- package/dist/web/public/assets/{mcp-DhnXhO9B.js → mcp-vKajK1F8.js} +3 -3
- package/dist/web/public/assets/{mcp-DhnXhO9B.js.map → mcp-vKajK1F8.js.map} +1 -1
- package/dist/web/public/assets/memos-DAt4k3DO.js +7 -0
- package/dist/web/public/assets/memos-DAt4k3DO.js.map +1 -0
- package/dist/web/public/assets/messengers-GYVTFlAj.js +2 -0
- package/dist/web/public/assets/messengers-GYVTFlAj.js.map +1 -0
- package/dist/web/public/assets/{mobile-CUZ359rQ.js → mobile-VUyTo40E.js} +3 -3
- package/dist/web/public/assets/{mobile-CUZ359rQ.js.map → mobile-VUyTo40E.js.map} +1 -1
- package/dist/web/public/assets/{network-BBdRdrH_.js → network-BUeWK3bs.js} +2 -2
- package/dist/web/public/assets/{network-BBdRdrH_.js.map → network-BUeWK3bs.js.map} +1 -1
- package/dist/web/public/assets/outbox-CEE0rwN3.js +2 -0
- package/dist/web/public/assets/outbox-CEE0rwN3.js.map +1 -0
- package/dist/web/public/assets/overview-BSOZ5gTD.js +12 -0
- package/dist/web/public/assets/overview-BSOZ5gTD.js.map +1 -0
- package/dist/web/public/assets/overview-COop5K2Y.js +12 -0
- package/dist/web/public/assets/overview-COop5K2Y.js.map +1 -0
- package/dist/web/public/assets/overview-DeH5ud6d.js +2 -0
- package/dist/web/public/assets/overview-DeH5ud6d.js.map +1 -0
- package/dist/web/public/assets/{pagination-DcsgDXXM.js → pagination-BBicLzXP.js} +3 -3
- package/dist/web/public/assets/{pagination-DcsgDXXM.js.map → pagination-BBicLzXP.js.map} +1 -1
- package/dist/web/public/assets/persona-CElXQZ4p.js +2 -0
- package/dist/web/public/assets/{persona-ig2ac4mY.js.map → persona-CElXQZ4p.js.map} +1 -1
- package/dist/web/public/assets/{plans-Bzbk8eUr.js → plans-Bo5LlLeH.js} +3 -8
- package/dist/web/public/assets/plans-Bo5LlLeH.js.map +1 -0
- package/dist/web/public/assets/{play-Di1jqulh.js → play-DX5wp4WH.js} +2 -2
- package/dist/web/public/assets/{play-Di1jqulh.js.map → play-DX5wp4WH.js.map} +1 -1
- package/dist/web/public/assets/{plus-C2zyJ1mF.js → plus-DH4J_YhN.js} +2 -2
- package/dist/web/public/assets/{plus-C2zyJ1mF.js.map → plus-DH4J_YhN.js.map} +1 -1
- package/dist/web/public/assets/policy-BrgOuDt_.js +2 -0
- package/dist/web/public/assets/policy-BrgOuDt_.js.map +1 -0
- package/dist/web/public/assets/{qr-code-C-ACsKv_.js → qr-code-YrEuhMPC.js} +2 -2
- package/dist/web/public/assets/{qr-code-C-ACsKv_.js.map → qr-code-YrEuhMPC.js.map} +1 -1
- package/dist/web/public/assets/{refresh-ccw-7HdadG5V.js → refresh-ccw-DlAd-eTQ.js} +2 -2
- package/dist/web/public/assets/{refresh-ccw-7HdadG5V.js.map → refresh-ccw-DlAd-eTQ.js.map} +1 -1
- package/dist/web/public/assets/{reminders-BDeiVYTC.js → reminders-DBEE0zXG.js} +3 -3
- package/dist/web/public/assets/{reminders-BDeiVYTC.js.map → reminders-DBEE0zXG.js.map} +1 -1
- package/dist/web/public/assets/{save-BYFmz9gD.js → save-BDOtZrfp.js} +2 -2
- package/dist/web/public/assets/{save-BYFmz9gD.js.map → save-BDOtZrfp.js.map} +1 -1
- package/dist/web/public/assets/schedules-DAyhVI8-.js +2 -0
- package/dist/web/public/assets/schedules-DAyhVI8-.js.map +1 -0
- package/dist/web/public/assets/search-55mtgHrB.js +17 -0
- package/dist/web/public/assets/search-55mtgHrB.js.map +1 -0
- package/dist/web/public/assets/{search-DxkvV-8p.js → search-CAICU3aU.js} +2 -2
- package/dist/web/public/assets/{search-DxkvV-8p.js.map → search-CAICU3aU.js.map} +1 -1
- package/dist/web/public/assets/security-CbP4QgVp.js +2 -0
- package/dist/web/public/assets/security-CbP4QgVp.js.map +1 -0
- package/dist/web/public/assets/server-Dg4e8pvm.js +7 -0
- package/dist/web/public/assets/server-Dg4e8pvm.js.map +1 -0
- package/dist/web/public/assets/service-gWZa3sup.js +7 -0
- package/dist/web/public/assets/service-gWZa3sup.js.map +1 -0
- package/dist/web/public/assets/{shield-alert-DXGk9Rak.js → shield-alert-DOKK9EnJ.js} +2 -2
- package/dist/web/public/assets/{shield-alert-DXGk9Rak.js.map → shield-alert-DOKK9EnJ.js.map} +1 -1
- package/dist/web/public/assets/sparkles-G0QIs9nP.js +7 -0
- package/dist/web/public/assets/sparkles-G0QIs9nP.js.map +1 -0
- package/dist/web/public/assets/start-D-abhl3q.js +2 -0
- package/dist/web/public/assets/start-D-abhl3q.js.map +1 -0
- package/dist/web/public/assets/{status-badge-D0nbFSom.js → status-badge-CyLdpsXq.js} +2 -2
- package/dist/web/public/assets/{status-badge-D0nbFSom.js.map → status-badge-CyLdpsXq.js.map} +1 -1
- package/dist/web/public/assets/{subtasks-DFiAXvDp.js → subtasks-BnEjSGUR.js} +3 -3
- package/dist/web/public/assets/{subtasks-DFiAXvDp.js.map → subtasks-BnEjSGUR.js.map} +1 -1
- package/dist/web/public/assets/{table-_WsrnZ_T.js → table-sCMZBe_Z.js} +2 -2
- package/dist/web/public/assets/{table-_WsrnZ_T.js.map → table-sCMZBe_Z.js.map} +1 -1
- package/dist/web/public/assets/terminal-_pXeEjXG.js +7 -0
- package/dist/web/public/assets/terminal-_pXeEjXG.js.map +1 -0
- package/dist/web/public/assets/{topn-C2PHE4tX.js → topn-D1B-gS1M.js} +3 -3
- package/dist/web/public/assets/{topn-C2PHE4tX.js.map → topn-D1B-gS1M.js.map} +1 -1
- package/dist/web/public/assets/{trash-2-1Km439fW.js → trash-2-D2x2UPuZ.js} +2 -2
- package/dist/web/public/assets/{trash-2-1Km439fW.js.map → trash-2-D2x2UPuZ.js.map} +1 -1
- package/dist/web/public/assets/use-a2a-C98e2Via.js +2 -0
- package/dist/web/public/assets/use-a2a-C98e2Via.js.map +1 -0
- package/dist/web/public/assets/{use-agim-skills-COSqZrdH.js → use-agim-skills-BbuJP3NT.js} +2 -2
- package/dist/web/public/assets/{use-agim-skills-COSqZrdH.js.map → use-agim-skills-BbuJP3NT.js.map} +1 -1
- package/dist/web/public/assets/use-background-tasks-CwFmOokw.js +2 -0
- package/dist/web/public/assets/{use-background-tasks-wCL7jn68.js.map → use-background-tasks-CwFmOokw.js.map} +1 -1
- package/dist/web/public/assets/use-jobs-BJjeJ5lh.js +2 -0
- package/dist/web/public/assets/use-jobs-BJjeJ5lh.js.map +1 -0
- package/dist/web/public/assets/use-memory-CXDwKCco.js +2 -0
- package/dist/web/public/assets/{use-memory-B9oRyQC8.js.map → use-memory-CXDwKCco.js.map} +1 -1
- package/dist/web/public/assets/use-observability-CY5ZUPrC.js +2 -0
- package/dist/web/public/assets/{use-observability-DGkN80qa.js.map → use-observability-CY5ZUPrC.js.map} +1 -1
- package/dist/web/public/assets/use-outbox-DT_XWB_7.js +7 -0
- package/dist/web/public/assets/use-outbox-DT_XWB_7.js.map +1 -0
- package/dist/web/public/assets/use-schedules-D4W8fMwo.js +7 -0
- package/dist/web/public/assets/use-schedules-D4W8fMwo.js.map +1 -0
- package/dist/web/public/assets/use-settings-DGIjmUX0.js +2 -0
- package/dist/web/public/assets/use-settings-DGIjmUX0.js.map +1 -0
- package/dist/web/public/assets/use-skills-D2bMM580.js +7 -0
- package/dist/web/public/assets/use-skills-D2bMM580.js.map +1 -0
- package/dist/web/public/assets/use-vector-BYOFwjU0.js +2 -0
- package/dist/web/public/assets/use-vector-BYOFwjU0.js.map +1 -0
- package/dist/web/public/assets/use-workspace-CuytyHwb.js +2 -0
- package/dist/web/public/assets/{use-workspace-BDXP5XO1.js.map → use-workspace-CuytyHwb.js.map} +1 -1
- package/dist/web/public/assets/vector-CL8ezpSR.js +2 -0
- package/dist/web/public/assets/vector-CL8ezpSR.js.map +1 -0
- package/dist/web/public/assets/viewer-CD0iEfPU.js +7 -0
- package/dist/web/public/assets/viewer-CD0iEfPU.js.map +1 -0
- package/dist/web/public/assets/workspace-BA1_hso3.js +17 -0
- package/dist/web/public/assets/workspace-BA1_hso3.js.map +1 -0
- package/dist/web/public/assets/workspaces-DyGLJUgB.js +7 -0
- package/dist/web/public/assets/workspaces-DyGLJUgB.js.map +1 -0
- package/dist/web/public/index.html +2 -2
- package/dist/web/public/loc.html +1 -1
- package/dist/web/public/login.html +2 -2
- package/dist/web/server.d.ts +2 -5
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +256 -122
- package/dist/web/server.js.map +1 -1
- package/package.json +2 -3
- package/dist/core/llm/imhub-dispatcher.d.ts.map +0 -1
- package/dist/core/llm/imhub-dispatcher.js.map +0 -1
- package/dist/web/public/assets/a2a-CZxwvgvh.js +0 -7
- package/dist/web/public/assets/a2a-CZxwvgvh.js.map +0 -1
- package/dist/web/public/assets/agents-CFB4Uj6b.js +0 -7
- package/dist/web/public/assets/agents-CFB4Uj6b.js.map +0 -1
- package/dist/web/public/assets/bgjobs-BYCQhd_1.js +0 -7
- package/dist/web/public/assets/bgjobs-BYCQhd_1.js.map +0 -1
- package/dist/web/public/assets/chat-DPkKy5y_.js +0 -17
- package/dist/web/public/assets/chat-DPkKy5y_.js.map +0 -1
- package/dist/web/public/assets/circle-check-COhM5JsK.js +0 -7
- package/dist/web/public/assets/circle-check-COhM5JsK.js.map +0 -1
- package/dist/web/public/assets/confirm-dialog-CgpJL9oN.js +0 -2
- package/dist/web/public/assets/distill-D9p8O8Jf.js +0 -7
- package/dist/web/public/assets/distill-D9p8O8Jf.js.map +0 -1
- package/dist/web/public/assets/email-Douv-rZ5.js +0 -7
- package/dist/web/public/assets/email-Douv-rZ5.js.map +0 -1
- package/dist/web/public/assets/health-DLzZ7KHc.js +0 -2
- package/dist/web/public/assets/hot-Yc7iad0D.js +0 -12
- package/dist/web/public/assets/index-DY2Zglku.js +0 -209
- package/dist/web/public/assets/index-DY2Zglku.js.map +0 -1
- package/dist/web/public/assets/index-DknVjPYB.css +0 -1
- package/dist/web/public/assets/installed-Zz34apdi.js.map +0 -1
- package/dist/web/public/assets/jobs-CtVRpl0r.js +0 -2
- package/dist/web/public/assets/jobs-CtVRpl0r.js.map +0 -1
- package/dist/web/public/assets/layout-BTCLgkgN.js +0 -2
- package/dist/web/public/assets/layout-BTCLgkgN.js.map +0 -1
- package/dist/web/public/assets/layout-Cxch59sI.js +0 -2
- package/dist/web/public/assets/layout-Cxch59sI.js.map +0 -1
- package/dist/web/public/assets/layout-DnANw2Q2.js +0 -2
- package/dist/web/public/assets/layout-DnANw2Q2.js.map +0 -1
- package/dist/web/public/assets/layout-yIZG87fq.js +0 -2
- package/dist/web/public/assets/layout-yIZG87fq.js.map +0 -1
- package/dist/web/public/assets/llm-CMMa85Ig.js +0 -27
- package/dist/web/public/assets/llm-CMMa85Ig.js.map +0 -1
- package/dist/web/public/assets/loader-circle-D8L1w9c1.js +0 -7
- package/dist/web/public/assets/memos-DQZc7llR.js +0 -12
- package/dist/web/public/assets/memos-DQZc7llR.js.map +0 -1
- package/dist/web/public/assets/messengers-DwSmauLs.js +0 -2
- package/dist/web/public/assets/messengers-DwSmauLs.js.map +0 -1
- package/dist/web/public/assets/outbox-CmN0U35l.js +0 -7
- package/dist/web/public/assets/outbox-CmN0U35l.js.map +0 -1
- package/dist/web/public/assets/persona-ig2ac4mY.js +0 -2
- package/dist/web/public/assets/plans-Bzbk8eUr.js.map +0 -1
- package/dist/web/public/assets/policy-yD1c2Pcn.js +0 -2
- package/dist/web/public/assets/policy-yD1c2Pcn.js.map +0 -1
- package/dist/web/public/assets/schedules-BddzBrxI.js +0 -7
- package/dist/web/public/assets/schedules-BddzBrxI.js.map +0 -1
- package/dist/web/public/assets/search-B8PlbtLg.js +0 -17
- package/dist/web/public/assets/search-B8PlbtLg.js.map +0 -1
- package/dist/web/public/assets/security-DpOGp3nS.js +0 -2
- package/dist/web/public/assets/security-DpOGp3nS.js.map +0 -1
- package/dist/web/public/assets/service-BsY8CaNG.js +0 -7
- package/dist/web/public/assets/service-BsY8CaNG.js.map +0 -1
- package/dist/web/public/assets/use-background-tasks-wCL7jn68.js +0 -2
- package/dist/web/public/assets/use-memory-B9oRyQC8.js +0 -2
- package/dist/web/public/assets/use-observability-DGkN80qa.js +0 -2
- package/dist/web/public/assets/use-settings-Co-iafXD.js +0 -2
- package/dist/web/public/assets/use-settings-Co-iafXD.js.map +0 -1
- package/dist/web/public/assets/use-workspace-BDXP5XO1.js +0 -2
- package/dist/web/public/assets/vector-BfIEx8xX.js +0 -2
- package/dist/web/public/assets/vector-BfIEx8xX.js.map +0 -1
- package/dist/web/public/assets/viewer-BPMZkT05.js +0 -12
- package/dist/web/public/assets/viewer-BPMZkT05.js.map +0 -1
- package/dist/web/public/assets/workspace-BbCchiHE.js +0 -17
- package/dist/web/public/assets/workspace-BbCchiHE.js.map +0 -1
- package/dist/web/public/assets/workspaces-5HE7pjdA.js +0 -7
- package/dist/web/public/assets/workspaces-5HE7pjdA.js.map +0 -1
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browser-ponyfill-DBWdeCTC.js","assets/react-DlP5eolq.js","assets/layout-Cxch59sI.js","assets/jobs-CtVRpl0r.js","assets/data-table-BLYG79TX.js","assets/table-_WsrnZ_T.js","assets/empty-state-96qpPTNg.js","assets/arrow-up-CAiQ2jy-.js","assets/arrow-down-DxlRHrs8.js","assets/status-badge-D0nbFSom.js","assets/pagination-DcsgDXXM.js","assets/chevron-left-BDO3vw8G.js","assets/chevron-right-5ZUC2opg.js","assets/confirm-dialog-CgpJL9oN.js","assets/use-event-stream-I1lMFEfh.js","assets/loader-circle-D8L1w9c1.js","assets/refresh-ccw-7HdadG5V.js","assets/circle-x-7VaoZ7dY.js","assets/briefcase-BMLMD8nM.js","assets/subtasks-DFiAXvDp.js","assets/bgjobs-BYCQhd_1.js","assets/schedules-BddzBrxI.js","assets/outbox-CmN0U35l.js","assets/a2a-CZxwvgvh.js","assets/heartbeat-B1BEBHge.js","assets/use-background-tasks-wCL7jn68.js","assets/heart-pulse-CVEeD2sz.js","assets/play-Di1jqulh.js","assets/goals-B9ETHgL0.js","assets/circle-check-COhM5JsK.js","assets/asks-DyUQopay.js","assets/plans-Bzbk8eUr.js","assets/clock-ZPVXnd6V.js","assets/approvals-DnzjbDR6.js","assets/reminders-BDeiVYTC.js","assets/bell-D7iS7ctN.js","assets/memos-DQZc7llR.js","assets/trash-2-1Km439fW.js","assets/search-DxkvV-8p.js","assets/map-pin--GMunU9n.js","assets/layout-BTCLgkgN.js","assets/use-memory-B9oRyQC8.js","assets/facts-DMucDXYd.js","assets/brain-CCF25Egu.js","assets/persona-ig2ac4mY.js","assets/circle-check-big-DHAHqUlS.js","assets/distill-D9p8O8Jf.js","assets/use-settings-Co-iafXD.js","assets/save-BYFmz9gD.js","assets/vector-BfIEx8xX.js","assets/eye-BvsBLK42.js","assets/download-bzCepctg.js","assets/workspace-BbCchiHE.js","assets/use-workspace-BDXP5XO1.js","assets/layout-CtDc2i7w.js","assets/health-DLzZ7KHc.js","assets/use-observability-DGkN80qa.js","assets/activity-BnlFGipw.js","assets/topn-C2PHE4tX.js","assets/audit-BVHTMS82.js","assets/layout-DnANw2Q2.js","assets/messengers-DwSmauLs.js","assets/qr-code-C-ACsKv_.js","assets/email-Douv-rZ5.js","assets/viewer-BPMZkT05.js","assets/external-link-J4nIlCem.js","assets/agents-CFB4Uj6b.js","assets/network-BBdRdrH_.js","assets/plus-C2zyJ1mF.js","assets/policy-yD1c2Pcn.js","assets/security-DpOGp3nS.js","assets/shield-alert-DXGk9Rak.js","assets/service-BsY8CaNG.js","assets/admins-CH84Rw1d.js","assets/workspaces-5HE7pjdA.js","assets/llm-CMMa85Ig.js","assets/mcp-DhnXhO9B.js","assets/search-B8PlbtLg.js","assets/mobile-CUZ359rQ.js","assets/copy-BaZl52tH.js","assets/layout-yIZG87fq.js","assets/installed-Zz34apdi.js","assets/use-agim-skills-COSqZrdH.js","assets/hot-Yc7iad0D.js","assets/injection-Ca-9gbo0.js","assets/chat-DPkKy5y_.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as g,a as Pr,R as ko,b as vm,c as W,v as xm,d as Yi,g as bd}from"./react-DlP5eolq.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var vd={exports:{}},So={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.min.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var wm=g,km=Symbol.for("react.element"),Sm=Symbol.for("react.fragment"),Am=Object.prototype.hasOwnProperty,Cm=wm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Em={key:!0,ref:!0,__self:!0,__source:!0};function xd(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Am.call(t,r)&&!Em.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:km,type:e,key:o,ref:a,props:i,_owner:Cm.current}}So.Fragment=Sm;So.jsx=xd;So.jsxs=xd;vd.exports=So;var y=vd.exports,Pa={},Pl=Pr;Pa.createRoot=Pl.createRoot,Pa.hydrateRoot=Pl.hydrateRoot;const Rm="modulepreload",Tm=function(e){return"/"+e},Il={},fe=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),s=a?.nonce||a?.getAttribute("nonce");i=Promise.allSettled(n.map(l=>{if(l=Tm(l),l in Il)return;Il[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":Rm,c||(d.as="script"),d.crossOrigin="",d.href=l,s&&d.setAttribute("nonce",s),document.head.appendChild(d),c)return new Promise((h,f)=>{d.addEventListener("load",h),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return i.then(a=>{for(const s of a||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})};/**
|
|
11
|
-
* @remix-run/router v1.23.3
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Remix Software Inc.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
17
|
-
*
|
|
18
|
-
* @license MIT
|
|
19
|
-
*/function Be(){return Be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Be.apply(null,arguments)}var Ye;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ye||(Ye={}));const Ll="popstate";function Pm(e){e===void 0&&(e={});function t(r,i){let{pathname:o,search:a,hash:s}=r.location;return oi("",{pathname:o,search:a,hash:s},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Gn(i)}return Lm(t,n,null,e)}function we(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Qn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Im(){return Math.random().toString(36).substr(2,8)}function Ol(e,t){return{usr:e.state,key:e.key,idx:t}}function oi(e,t,n,r){return n===void 0&&(n=null),Be({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Cn(t):t,{state:n,key:t&&t.key||r||Im()})}function Gn(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 Cn(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 Lm(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=Ye.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(Be({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){s=Ye.Pop;let b=u(),v=b==null?null:b-c;c=b,l&&l({action:s,location:p.location,delta:v})}function h(b,v){s=Ye.Push;let x=oi(p.location,b,v);c=u()+1;let w=Ol(x,c),E=p.createHref(x);try{a.pushState(w,"",E)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(E)}o&&l&&l({action:s,location:p.location,delta:1})}function f(b,v){s=Ye.Replace;let x=oi(p.location,b,v);c=u();let w=Ol(x,c),E=p.createHref(x);a.replaceState(w,"",E),o&&l&&l({action:s,location:p.location,delta:0})}function m(b){let v=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof b=="string"?b:Gn(b);return x=x.replace(/ $/,"%20"),we(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let p={get action(){return s},get location(){return e(i,a)},listen(b){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Ll,d),l=b,()=>{i.removeEventListener(Ll,d),l=null}},createHref(b){return t(i,b)},createURL:m,encodeLocation(b){let v=m(b);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:f,go(b){return a.go(b)}};return p}var _e;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(_e||(_e={}));const Om=new Set(["lazy","caseSensitive","path","id","index","children"]);function Nm(e){return e.index===!0}function Xi(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let a=[...n,String(o)],s=typeof i.id=="string"?i.id:a.join("-");if(we(i.index!==!0||!i.children,"Cannot specify children on an index route"),we(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),Nm(i)){let l=Be({},i,t(i),{id:s});return r[s]=l,l}else{let l=Be({},i,t(i),{id:s,children:void 0});return r[s]=l,i.children&&(l.children=Xi(i.children,t,a,r)),l}})}function Hn(e,t,n){return n===void 0&&(n="/"),zi(e,t,n,!1)}function zi(e,t,n,r){let i=typeof t=="string"?Cn(t):t,o=on(i.pathname||"/",n);if(o==null)return null;let a=wd(e);Dm(a);let s=null,l=Wm(o);for(let c=0;s==null&&c<a.length;++c)s=Vm(a[c],l,r);return s}function _m(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function wd(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(o,a,s)=>{let l={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};l.relativePath.startsWith("/")&&(we(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=rn([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(we(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),wd(o.children,t,u,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:zm(c,o.index),routesMeta:u})};return e.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let l of kd(o.path))i(o,a,l)}),t}function kd(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=kd(r.join("/")),s=[];return s.push(...a.map(l=>l===""?o:[o,l].join("/"))),i&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function Dm(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$m(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Mm=/^:[\w-]+$/,jm=3,Fm=2,Um=1,Hm=10,Bm=-2,Nl=e=>e==="*";function zm(e,t){let n=e.split("/"),r=n.length;return n.some(Nl)&&(r+=Bm),t&&(r+=Fm),n.filter(i=>!Nl(i)).reduce((i,o)=>i+(Mm.test(o)?jm:o===""?Um:Hm),r)}function $m(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 Vm(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",a=[];for(let s=0;s<r.length;++s){let l=r[s],c=s===r.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=Ji({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),h=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ji({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(i,d.params),a.push({params:i,pathname:rn([o,d.pathname]),pathnameBase:Ym(rn([o,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(o=rn([o,d.pathnameBase]))}return a}function Ji(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Km(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((c,u,d)=>{let{paramName:h,isOptional:f}=u;if(h==="*"){let p=s[d]||"";a=o.slice(0,o.length-p.length).replace(/(.)\/+$/,"$1")}const m=s[d];return f&&!m?c[h]=void 0:c[h]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:a,pattern:e}}function Km(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Qn(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,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Wm(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Qn(!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 on(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 qm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qm=e=>qm.test(e);function Gm(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Cn(e):e,o;if(n)if(Qm(n))o=n;else{if(n.includes("//")){let a=n;n=xs(n),Qn(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?o=_l(n.substring(1),"/"):o=_l(n,t)}else o=t;return{pathname:o,search:Xm(r),hash:Jm(i)}}function _l(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 Jo(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 Sd(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ao(e,t){let n=Sd(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Co(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Cn(e):(i=Be({},e),we(!i.pathname||!i.pathname.includes("?"),Jo("?","pathname","search",i)),we(!i.pathname||!i.pathname.includes("#"),Jo("#","pathname","hash",i)),we(!i.search||!i.search.includes("#"),Jo("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,s;if(a==null)s=n;else{let d=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}s=d>=0?t[d]:"/"}let l=Gm(i,s),c=a&&a!=="/"&&a.endsWith("/"),u=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const xs=e=>e.replace(/\/\/+/g,"/"),rn=e=>xs(e.join("/")),Ym=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Xm=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Jm=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Zi{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ai(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ad=["post","put","patch","delete"],Zm=new Set(Ad),eg=["get",...Ad],tg=new Set(eg),ng=new Set([301,302,303,307,308]),rg=new Set([307,308]),Zo={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ig={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$r={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ws=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,og=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Cd="remix-router-transitions";function ag(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;we(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let T=e.detectErrorBoundary;i=I=>({hasErrorBoundary:T(I)})}else i=og;let o={},a=Xi(e.routes,i,void 0,o),s,l=e.basename||"/",c=e.dataStrategy||ug,u=e.patchRoutesOnNavigation,d=Be({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,f=new Set,m=null,p=null,b=null,v=e.hydrationData!=null,x=Hn(a,e.history.location,l),w=!1,E=null;if(x==null&&!u){let T=gt(404,{pathname:e.history.location.pathname}),{matches:I,route:N}=Kl(a);x=I,E={[N.id]:T}}x&&!e.hydrationData&&Ne(x,a,e.history.location.pathname).active&&(x=null);let P;if(x)if(x.some(T=>T.route.lazy))P=!1;else if(!x.some(T=>T.route.loader))P=!0;else if(d.v7_partialHydration){let T=e.hydrationData?e.hydrationData.loaderData:null,I=e.hydrationData?e.hydrationData.errors:null;if(I){let N=x.findIndex(j=>I[j.route.id]!==void 0);P=x.slice(0,N+1).every(j=>!La(j.route,T,I))}else P=x.every(N=>!La(N.route,T,I))}else P=e.hydrationData!=null;else if(P=!1,x=[],d.v7_partialHydration){let T=Ne(null,a,e.history.location.pathname);T.active&&T.matches&&(w=!0,x=T.matches)}let C,k={historyAction:e.history.action,location:e.history.location,matches:x,initialized:P,navigation:Zo,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},O=Ye.Pop,M=!1,R,_=!1,L=new Map,z=null,U=!1,$=!1,G=[],Y=new Set,V=new Map,F=0,S=-1,ie=new Map,Z=new Set,A=new Map,ae=new Map,me=new Set,be=new Map,q=new Map,he;function Pe(){if(h=e.history.listen(T=>{let{action:I,location:N,delta:j}=T;if(he){he(),he=void 0;return}Qn(q.size===0||j!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Q=Fr({currentLocation:k.location,nextLocation:N,historyAction:I});if(Q&&j!=null){let re=new Promise(le=>{he=le});e.history.go(j*-1),_n(Q,{state:"blocked",location:N,proceed(){_n(Q,{state:"proceeding",proceed:void 0,reset:void 0,location:N}),re.then(()=>e.history.go(j))},reset(){let le=new Map(k.blockers);le.set(Q,$r),pe({blockers:le})}});return}return nt(I,N)}),n){Ag(t,L);let T=()=>Cg(t,L);t.addEventListener("pagehide",T),z=()=>t.removeEventListener("pagehide",T)}return k.initialized||nt(Ye.Pop,k.location,{initialHydration:!0}),C}function xe(){h&&h(),z&&z(),f.clear(),R&&R.abort(),k.fetchers.forEach((T,I)=>tt(I)),k.blockers.forEach((T,I)=>pt(I))}function ke(T){return f.add(T),()=>f.delete(T)}function pe(T,I){I===void 0&&(I={}),k=Be({},k,T);let N=[],j=[];d.v7_fetcherPersist&&k.fetchers.forEach((Q,re)=>{Q.state==="idle"&&(me.has(re)?j.push(re):N.push(re))}),me.forEach(Q=>{!k.fetchers.has(Q)&&!V.has(Q)&&j.push(Q)}),[...f].forEach(Q=>Q(k,{deletedFetchers:j,viewTransitionOpts:I.viewTransitionOpts,flushSync:I.flushSync===!0})),d.v7_fetcherPersist?(N.forEach(Q=>k.fetchers.delete(Q)),j.forEach(Q=>tt(Q))):j.forEach(Q=>me.delete(Q))}function qe(T,I,N){var j,Q;let{flushSync:re}=N===void 0?{}:N,le=k.actionData!=null&&k.navigation.formMethod!=null&&_t(k.navigation.formMethod)&&k.navigation.state==="loading"&&((j=T.state)==null?void 0:j._isRedirect)!==!0,J;I.actionData?Object.keys(I.actionData).length>0?J=I.actionData:J=null:le?J=k.actionData:J=null;let ee=I.loaderData?$l(k.loaderData,I.loaderData,I.matches||[],I.errors):k.loaderData,X=k.blockers;X.size>0&&(X=new Map(X),X.forEach((Ce,rt)=>X.set(rt,$r)));let te=M===!0||k.navigation.formMethod!=null&&_t(k.navigation.formMethod)&&((Q=T.state)==null?void 0:Q._isRedirect)!==!0;s&&(a=s,s=void 0),U||O===Ye.Pop||(O===Ye.Push?e.history.push(T,T.state):O===Ye.Replace&&e.history.replace(T,T.state));let ge;if(O===Ye.Pop){let Ce=L.get(k.location.pathname);Ce&&Ce.has(T.pathname)?ge={currentLocation:k.location,nextLocation:T}:L.has(T.pathname)&&(ge={currentLocation:T,nextLocation:k.location})}else if(_){let Ce=L.get(k.location.pathname);Ce?Ce.add(T.pathname):(Ce=new Set([T.pathname]),L.set(k.location.pathname,Ce)),ge={currentLocation:k.location,nextLocation:T}}pe(Be({},I,{actionData:J,loaderData:ee,historyAction:O,location:T,initialized:!0,navigation:Zo,revalidation:"idle",restoreScrollPosition:Ie(T,I.matches||k.matches),preventScrollReset:te,blockers:X}),{viewTransitionOpts:ge,flushSync:re===!0}),O=Ye.Pop,M=!1,_=!1,U=!1,$=!1,G=[]}async function Xe(T,I){if(typeof T=="number"){e.history.go(T);return}let N=Ia(k.location,k.matches,l,d.v7_prependBasename,T,d.v7_relativeSplatPath,I?.fromRouteId,I?.relative),{path:j,submission:Q,error:re}=Dl(d.v7_normalizeFormMethod,!1,N,I),le=k.location,J=oi(k.location,j,I&&I.state);J=Be({},J,e.history.encodeLocation(J));let ee=I&&I.replace!=null?I.replace:void 0,X=Ye.Push;ee===!0?X=Ye.Replace:ee===!1||Q!=null&&_t(Q.formMethod)&&Q.formAction===k.location.pathname+k.location.search&&(X=Ye.Replace);let te=I&&"preventScrollReset"in I?I.preventScrollReset===!0:void 0,ge=(I&&I.flushSync)===!0,Ce=Fr({currentLocation:le,nextLocation:J,historyAction:X});if(Ce){_n(Ce,{state:"blocked",location:J,proceed(){_n(Ce,{state:"proceeding",proceed:void 0,reset:void 0,location:J}),Xe(T,I)},reset(){let rt=new Map(k.blockers);rt.set(Ce,$r),pe({blockers:rt})}});return}return await nt(X,J,{submission:Q,pendingError:re,preventScrollReset:te,replace:I&&I.replace,enableViewTransition:I&&I.viewTransition,flushSync:ge})}function Ut(){if(B(),pe({revalidation:"loading"}),k.navigation.state!=="submitting"){if(k.navigation.state==="idle"){nt(k.historyAction,k.location,{startUninterruptedRevalidation:!0});return}nt(O||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:_===!0})}}async function nt(T,I,N){R&&R.abort(),R=null,O=T,U=(N&&N.startUninterruptedRevalidation)===!0,ce(k.location,k.matches),M=(N&&N.preventScrollReset)===!0,_=(N&&N.enableViewTransition)===!0;let j=s||a,Q=N&&N.overrideNavigation,re=N!=null&&N.initialHydration&&k.matches&&k.matches.length>0&&!w?k.matches:Hn(j,I,l),le=(N&&N.flushSync)===!0;if(re&&k.initialized&&!$&&gg(k.location,I)&&!(N&&N.submission&&_t(N.submission.formMethod))){qe(I,{matches:re},{flushSync:le});return}let J=Ne(re,j,I.pathname);if(J.active&&J.matches&&(re=J.matches),!re){let{error:Fe,notFoundMatches:Le,route:Ke}=Ur(I.pathname);qe(I,{matches:Le,loaderData:{},errors:{[Ke.id]:Fe}},{flushSync:le});return}R=new AbortController;let ee=lr(e.history,I,R.signal,N&&N.submission),X;if(N&&N.pendingError)X=[Bn(re).route.id,{type:_e.error,error:N.pendingError}];else if(N&&N.submission&&_t(N.submission.formMethod)){let Fe=await Ht(ee,I,N.submission,re,J.active,{replace:N.replace,flushSync:le});if(Fe.shortCircuited)return;if(Fe.pendingActionResult){let[Le,Ke]=Fe.pendingActionResult;if(wt(Ke)&&ai(Ke.error)&&Ke.error.status===404){R=null,qe(I,{matches:Fe.matches,loaderData:{},errors:{[Le]:Ke.error}});return}}re=Fe.matches||re,X=Fe.pendingActionResult,Q=ea(I,N.submission),le=!1,J.active=!1,ee=lr(e.history,ee.url,ee.signal)}let{shortCircuited:te,matches:ge,loaderData:Ce,errors:rt}=await Ln(ee,I,re,J.active,Q,N&&N.submission,N&&N.fetcherSubmission,N&&N.replace,N&&N.initialHydration===!0,le,X);te||(R=null,qe(I,Be({matches:ge||re},Vl(X),{loaderData:Ce,errors:rt})))}async function Ht(T,I,N,j,Q,re){re===void 0&&(re={}),B();let le=kg(I,N);if(pe({navigation:le},{flushSync:re.flushSync===!0}),Q){let X=await st(j,I.pathname,T.signal);if(X.type==="aborted")return{shortCircuited:!0};if(X.type==="error"){let te=Bn(X.partialMatches).route.id;return{matches:X.partialMatches,pendingActionResult:[te,{type:_e.error,error:X.error}]}}else if(X.matches)j=X.matches;else{let{notFoundMatches:te,error:ge,route:Ce}=Ur(I.pathname);return{matches:te,pendingActionResult:[Ce.id,{type:_e.error,error:ge}]}}}let J,ee=Zr(j,I);if(!ee.route.action&&!ee.route.lazy)J={type:_e.error,error:gt(405,{method:T.method,pathname:I.pathname,routeId:ee.route.id})};else if(J=(await Zt("action",k,T,[ee],j,null))[ee.route.id],T.signal.aborted)return{shortCircuited:!0};if(Vn(J)){let X;return re&&re.replace!=null?X=re.replace:X=Hl(J.response.headers.get("Location"),new URL(T.url),l,e.history)===k.location.pathname+k.location.search,await Pt(T,J,!0,{submission:N,replace:X}),{shortCircuited:!0}}if(vn(J))throw gt(400,{type:"defer-action"});if(wt(J)){let X=Bn(j,ee.route.id);return(re&&re.replace)!==!0&&(O=Ye.Push),{matches:j,pendingActionResult:[X.route.id,J]}}return{matches:j,pendingActionResult:[ee.route.id,J]}}async function Ln(T,I,N,j,Q,re,le,J,ee,X,te){let ge=Q||ea(I,re),Ce=re||le||ql(ge),rt=!U&&(!d.v7_partialHydration||!ee);if(j){if(rt){let We=On(te);pe(Be({navigation:ge},We!==void 0?{actionData:We}:{}),{flushSync:X})}let Te=await st(N,I.pathname,T.signal);if(Te.type==="aborted")return{shortCircuited:!0};if(Te.type==="error"){let We=Bn(Te.partialMatches).route.id;return{matches:Te.partialMatches,loaderData:{},errors:{[We]:Te.error}}}else if(Te.matches)N=Te.matches;else{let{error:We,notFoundMatches:ar,route:zr}=Ur(I.pathname);return{matches:ar,loaderData:{},errors:{[zr.id]:We}}}}let Fe=s||a,[Le,Ke]=jl(e.history,k,N,Ce,I,d.v7_partialHydration&&ee===!0,d.v7_skipActionErrorRevalidation,$,G,Y,me,A,Z,Fe,l,te);if(Dn(Te=>!(N&&N.some(We=>We.route.id===Te))||Le&&Le.some(We=>We.route.id===Te)),S=++F,Le.length===0&&Ke.length===0){let Te=It();return qe(I,Be({matches:N,loaderData:{},errors:te&&wt(te[1])?{[te[0]]:te[1].error}:null},Vl(te),Te?{fetchers:new Map(k.fetchers)}:{}),{flushSync:X}),{shortCircuited:!0}}if(rt){let Te={};if(!j){Te.navigation=ge;let We=On(te);We!==void 0&&(Te.actionData=We)}Ke.length>0&&(Te.fetchers=Nn(Ke)),pe(Te,{flushSync:X})}Ke.forEach(Te=>{Ve(Te.key),Te.controller&&V.set(Te.key,Te.controller)});let or=()=>Ke.forEach(Te=>Ve(Te.key));R&&R.signal.addEventListener("abort",or);let{loaderResults:Hr,fetcherResults:en}=await D(k,N,Le,Ke,T);if(T.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",or),Ke.forEach(Te=>V.delete(Te.key));let Vt=Ci(Hr);if(Vt)return await Pt(T,Vt.result,!0,{replace:J}),{shortCircuited:!0};if(Vt=Ci(en),Vt)return Z.add(Vt.key),await Pt(T,Vt.result,!0,{replace:J}),{shortCircuited:!0};let{loaderData:Xo,errors:Br}=zl(k,N,Hr,te,Ke,en,be);be.forEach((Te,We)=>{Te.subscribe(ar=>{(ar||Te.done)&&be.delete(We)})}),d.v7_partialHydration&&ee&&k.errors&&(Br=Be({},k.errors,Br));let Mn=It(),Si=ze(S),Ai=Mn||Si||Ke.length>0;return Be({matches:N,loaderData:Xo,errors:Br},Ai?{fetchers:new Map(k.fetchers)}:{})}function On(T){if(T&&!wt(T[1]))return{[T[0]]:T[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function Nn(T){return T.forEach(I=>{let N=k.fetchers.get(I.key),j=Vr(void 0,N?N.data:void 0);k.fetchers.set(I.key,j)}),new Map(k.fetchers)}function Jt(T,I,N,j){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Ve(T);let Q=(j&&j.flushSync)===!0,re=s||a,le=Ia(k.location,k.matches,l,d.v7_prependBasename,N,d.v7_relativeSplatPath,I,j?.relative),J=Hn(re,le,l),ee=Ne(J,re,le);if(ee.active&&ee.matches&&(J=ee.matches),!J){se(T,I,gt(404,{pathname:le}),{flushSync:Q});return}let{path:X,submission:te,error:ge}=Dl(d.v7_normalizeFormMethod,!0,le,j);if(ge){se(T,I,ge,{flushSync:Q});return}let Ce=Zr(J,X),rt=(j&&j.preventScrollReset)===!0;if(te&&_t(te.formMethod)){ir(T,I,X,Ce,J,ee.active,Q,rt,te);return}A.set(T,{routeId:I,path:X}),Tt(T,I,X,Ce,J,ee.active,Q,rt,te)}async function ir(T,I,N,j,Q,re,le,J,ee){B(),A.delete(T);function X(Qe){if(!Qe.route.action&&!Qe.route.lazy){let sr=gt(405,{method:ee.formMethod,pathname:N,routeId:I});return se(T,I,sr,{flushSync:le}),!0}return!1}if(!re&&X(j))return;let te=k.fetchers.get(T);ne(T,Sg(ee,te),{flushSync:le});let ge=new AbortController,Ce=lr(e.history,N,ge.signal,ee);if(re){let Qe=await st(Q,new URL(Ce.url).pathname,Ce.signal,T);if(Qe.type==="aborted")return;if(Qe.type==="error"){se(T,I,Qe.error,{flushSync:le});return}else if(Qe.matches){if(Q=Qe.matches,j=Zr(Q,N),X(j))return}else{se(T,I,gt(404,{pathname:N}),{flushSync:le});return}}V.set(T,ge);let rt=F,Le=(await Zt("action",k,Ce,[j],Q,T))[j.route.id];if(Ce.signal.aborted){V.get(T)===ge&&V.delete(T);return}if(d.v7_fetcherPersist&&me.has(T)){if(Vn(Le)||wt(Le)){ne(T,gn(void 0));return}}else{if(Vn(Le))if(V.delete(T),S>rt){ne(T,gn(void 0));return}else return Z.add(T),ne(T,Vr(ee)),Pt(Ce,Le,!1,{fetcherSubmission:ee,preventScrollReset:J});if(wt(Le)){se(T,I,Le.error);return}}if(vn(Le))throw gt(400,{type:"defer-action"});let Ke=k.navigation.location||k.location,or=lr(e.history,Ke,ge.signal),Hr=s||a,en=k.navigation.state!=="idle"?Hn(Hr,k.navigation.location,l):k.matches;we(en,"Didn't find any matches after fetcher action");let Vt=++F;ie.set(T,Vt);let Xo=Vr(ee,Le.data);k.fetchers.set(T,Xo);let[Br,Mn]=jl(e.history,k,en,ee,Ke,!1,d.v7_skipActionErrorRevalidation,$,G,Y,me,A,Z,Hr,l,[j.route.id,Le]);Mn.filter(Qe=>Qe.key!==T).forEach(Qe=>{let sr=Qe.key,Tl=k.fetchers.get(sr),bm=Vr(void 0,Tl?Tl.data:void 0);k.fetchers.set(sr,bm),Ve(sr),Qe.controller&&V.set(sr,Qe.controller)}),pe({fetchers:new Map(k.fetchers)});let Si=()=>Mn.forEach(Qe=>Ve(Qe.key));ge.signal.addEventListener("abort",Si);let{loaderResults:Ai,fetcherResults:Te}=await D(k,en,Br,Mn,or);if(ge.signal.aborted)return;ge.signal.removeEventListener("abort",Si),ie.delete(T),V.delete(T),Mn.forEach(Qe=>V.delete(Qe.key));let We=Ci(Ai);if(We)return Pt(or,We.result,!1,{preventScrollReset:J});if(We=Ci(Te),We)return Z.add(We.key),Pt(or,We.result,!1,{preventScrollReset:J});let{loaderData:ar,errors:zr}=zl(k,en,Ai,void 0,Mn,Te,be);if(k.fetchers.has(T)){let Qe=gn(Le.data);k.fetchers.set(T,Qe)}ze(Vt),k.navigation.state==="loading"&&Vt>S?(we(O,"Expected pending action"),R&&R.abort(),qe(k.navigation.location,{matches:en,loaderData:ar,errors:zr,fetchers:new Map(k.fetchers)})):(pe({errors:zr,loaderData:$l(k.loaderData,ar,en,zr),fetchers:new Map(k.fetchers)}),$=!1)}async function Tt(T,I,N,j,Q,re,le,J,ee){let X=k.fetchers.get(T);ne(T,Vr(ee,X?X.data:void 0),{flushSync:le});let te=new AbortController,ge=lr(e.history,N,te.signal);if(re){let Le=await st(Q,new URL(ge.url).pathname,ge.signal,T);if(Le.type==="aborted")return;if(Le.type==="error"){se(T,I,Le.error,{flushSync:le});return}else if(Le.matches)Q=Le.matches,j=Zr(Q,N);else{se(T,I,gt(404,{pathname:N}),{flushSync:le});return}}V.set(T,te);let Ce=F,Fe=(await Zt("loader",k,ge,[j],Q,T))[j.route.id];if(vn(Fe)&&(Fe=await ks(Fe,ge.signal,!0)||Fe),V.get(T)===te&&V.delete(T),!ge.signal.aborted){if(me.has(T)){ne(T,gn(void 0));return}if(Vn(Fe))if(S>Ce){ne(T,gn(void 0));return}else{Z.add(T),await Pt(ge,Fe,!1,{preventScrollReset:J});return}if(wt(Fe)){se(T,I,Fe.error);return}we(!vn(Fe),"Unhandled fetcher deferred data"),ne(T,gn(Fe.data))}}async function Pt(T,I,N,j){let{submission:Q,fetcherSubmission:re,preventScrollReset:le,replace:J}=j===void 0?{}:j;I.response.headers.has("X-Remix-Revalidate")&&($=!0);let ee=I.response.headers.get("Location");we(ee,"Expected a Location header on the redirect Response"),ee=Hl(ee,new URL(T.url),l,e.history);let X=oi(k.location,ee,{_isRedirect:!0});if(n){let Le=!1;if(I.response.headers.has("X-Remix-Reload-Document"))Le=!0;else if(ws.test(ee)){const Ke=e.history.createURL(ee);Le=Ke.origin!==t.location.origin||on(Ke.pathname,l)==null}if(Le){J?t.location.replace(ee):t.location.assign(ee);return}}R=null;let te=J===!0||I.response.headers.has("X-Remix-Replace")?Ye.Replace:Ye.Push,{formMethod:ge,formAction:Ce,formEncType:rt}=k.navigation;!Q&&!re&&ge&&Ce&&rt&&(Q=ql(k.navigation));let Fe=Q||re;if(rg.has(I.response.status)&&Fe&&_t(Fe.formMethod))await nt(te,X,{submission:Be({},Fe,{formAction:ee}),preventScrollReset:le||M,enableViewTransition:N?_:void 0});else{let Le=ea(X,Q);await nt(te,X,{overrideNavigation:Le,fetcherSubmission:re,preventScrollReset:le||M,enableViewTransition:N?_:void 0})}}async function Zt(T,I,N,j,Q,re){let le,J={};try{le=await dg(c,T,I,N,j,Q,re,o,i)}catch(ee){return j.forEach(X=>{J[X.route.id]={type:_e.error,error:ee}}),J}for(let[ee,X]of Object.entries(le))if(yg(X)){let te=X.result;J[ee]={type:_e.redirect,response:pg(te,N,ee,Q,l,d.v7_relativeSplatPath)}}else J[ee]=await hg(X);return J}async function D(T,I,N,j,Q){let re=T.matches,le=Zt("loader",T,Q,N,I,null),J=Promise.all(j.map(async te=>{if(te.matches&&te.match&&te.controller){let Ce=(await Zt("loader",T,lr(e.history,te.path,te.controller.signal),[te.match],te.matches,te.key))[te.match.route.id];return{[te.key]:Ce}}else return Promise.resolve({[te.key]:{type:_e.error,error:gt(404,{pathname:te.path})}})})),ee=await le,X=(await J).reduce((te,ge)=>Object.assign(te,ge),{});return await Promise.all([xg(I,ee,Q.signal,re,T.loaderData),wg(I,X,j)]),{loaderResults:ee,fetcherResults:X}}function B(){$=!0,G.push(...Dn()),A.forEach((T,I)=>{V.has(I)&&Y.add(I),Ve(I)})}function ne(T,I,N){N===void 0&&(N={}),k.fetchers.set(T,I),pe({fetchers:new Map(k.fetchers)},{flushSync:(N&&N.flushSync)===!0})}function se(T,I,N,j){j===void 0&&(j={});let Q=Bn(k.matches,I);tt(T),pe({errors:{[Q.route.id]:N},fetchers:new Map(k.fetchers)},{flushSync:(j&&j.flushSync)===!0})}function Ae(T){return ae.set(T,(ae.get(T)||0)+1),me.has(T)&&me.delete(T),k.fetchers.get(T)||ig}function tt(T){let I=k.fetchers.get(T);V.has(T)&&!(I&&I.state==="loading"&&ie.has(T))&&Ve(T),A.delete(T),ie.delete(T),Z.delete(T),d.v7_fetcherPersist&&me.delete(T),Y.delete(T),k.fetchers.delete(T)}function Et(T){let I=(ae.get(T)||0)-1;I<=0?(ae.delete(T),me.add(T),d.v7_fetcherPersist||tt(T)):ae.set(T,I),pe({fetchers:new Map(k.fetchers)})}function Ve(T){let I=V.get(T);I&&(I.abort(),V.delete(T))}function dt(T){for(let I of T){let N=Ae(I),j=gn(N.data);k.fetchers.set(I,j)}}function It(){let T=[],I=!1;for(let N of Z){let j=k.fetchers.get(N);we(j,"Expected fetcher: "+N),j.state==="loading"&&(Z.delete(N),T.push(N),I=!0)}return dt(T),I}function ze(T){let I=[];for(let[N,j]of ie)if(j<T){let Q=k.fetchers.get(N);we(Q,"Expected fetcher: "+N),Q.state==="loading"&&(Ve(N),ie.delete(N),I.push(N))}return dt(I),I.length>0}function Bt(T,I){let N=k.blockers.get(T)||$r;return q.get(T)!==I&&q.set(T,I),N}function pt(T){k.blockers.delete(T),q.delete(T)}function _n(T,I){let N=k.blockers.get(T)||$r;we(N.state==="unblocked"&&I.state==="blocked"||N.state==="blocked"&&I.state==="blocked"||N.state==="blocked"&&I.state==="proceeding"||N.state==="blocked"&&I.state==="unblocked"||N.state==="proceeding"&&I.state==="unblocked","Invalid blocker state transition: "+N.state+" -> "+I.state);let j=new Map(k.blockers);j.set(T,I),pe({blockers:j})}function Fr(T){let{currentLocation:I,nextLocation:N,historyAction:j}=T;if(q.size===0)return;q.size>1&&Qn(!1,"A router only supports one blocker at a time");let Q=Array.from(q.entries()),[re,le]=Q[Q.length-1],J=k.blockers.get(re);if(!(J&&J.state==="proceeding")&&le({currentLocation:I,nextLocation:N,historyAction:j}))return re}function Ur(T){let I=gt(404,{pathname:T}),N=s||a,{matches:j,route:Q}=Kl(N);return Dn(),{notFoundMatches:j,route:Q,error:I}}function Dn(T){let I=[];return be.forEach((N,j)=>{(!T||T(j))&&(N.cancel(),I.push(j),be.delete(j))}),I}function zt(T,I,N){if(m=T,b=I,p=N||null,!v&&k.navigation===Zo){v=!0;let j=Ie(k.location,k.matches);j!=null&&pe({restoreScrollPosition:j})}return()=>{m=null,b=null,p=null}}function ki(T,I){return p&&p(T,I.map(j=>_m(j,k.loaderData)))||T.key}function ce(T,I){if(m&&b){let N=ki(T,I);m[N]=b()}}function Ie(T,I){if(m){let N=ki(T,I),j=m[N];if(typeof j=="number")return j}return null}function Ne(T,I,N){if(u)if(T){if(Object.keys(T[0].params).length>0)return{active:!0,matches:zi(I,N,l,!0)}}else return{active:!0,matches:zi(I,N,l,!0)||[]};return{active:!1,matches:null}}async function st(T,I,N,j){if(!u)return{type:"success",matches:T};let Q=T;for(;;){let re=s==null,le=s||a,J=o;try{await u({signal:N,path:I,matches:Q,fetcherKey:j,patch:(te,ge)=>{N.aborted||Ul(te,ge,le,J,i)}})}catch(te){return{type:"error",error:te,partialMatches:Q}}finally{re&&!N.aborted&&(a=[...a])}if(N.aborted)return{type:"aborted"};let ee=Hn(le,I,l);if(ee)return{type:"success",matches:ee};let X=zi(le,I,l,!0);if(!X||Q.length===X.length&&Q.every((te,ge)=>te.route.id===X[ge].route.id))return{type:"success",matches:null};Q=X}}function vt(T){o={},s=Xi(T,i,void 0,o)}function $t(T,I){let N=s==null;Ul(T,I,s||a,o,i),N&&(a=[...a],pe({}))}return C={get basename(){return l},get future(){return d},get state(){return k},get routes(){return a},get window(){return t},initialize:Pe,subscribe:ke,enableScrollRestoration:zt,navigate:Xe,fetch:Jt,revalidate:Ut,createHref:T=>e.history.createHref(T),encodeLocation:T=>e.history.encodeLocation(T),getFetcher:Ae,deleteFetcher:Et,dispose:xe,getBlocker:Bt,deleteBlocker:pt,patchRoutes:$t,_internalFetchControllers:V,_internalActiveDeferreds:be,_internalSetRoutes:vt},C}function sg(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ia(e,t,n,r,i,o,a,s){let l,c;if(a){l=[];for(let d of t)if(l.push(d),d.route.id===a){c=d;break}}else l=t,c=t[t.length-1];let u=Co(i||".",Ao(l,o),on(e.pathname,n)||e.pathname,s==="path");if(i==null&&(u.search=e.search,u.hash=e.hash),(i==null||i===""||i===".")&&c){let d=Ss(u.search);if(c.route.index&&!d)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let h=new URLSearchParams(u.search),f=h.getAll("index");h.delete("index"),f.filter(p=>p).forEach(p=>h.append("index",p));let m=h.toString();u.search=m?"?"+m:""}}return r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:rn([n,u.pathname])),Gn(u)}function Dl(e,t,n,r){if(!r||!sg(r))return{path:n};if(r.formMethod&&!vg(r.formMethod))return{path:n,error:gt(405,{method:r.formMethod})};let i=()=>({path:n,error:gt(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),s=Td(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!_t(a))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((f,m)=>{let[p,b]=m;return""+f+p+"="+b+`
|
|
20
|
-
`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!_t(a))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}we(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=Oa(r.formData),c=r.formData;else if(r.body instanceof FormData)l=Oa(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=Bl(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=Bl(l)}catch{return i()}let u={formMethod:a,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(_t(u.formMethod))return{path:n,submission:u};let d=Cn(n);return t&&d.search&&Ss(d.search)&&l.append("index",""),d.search="?"+l,{path:Gn(d),submission:u}}function Ml(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function jl(e,t,n,r,i,o,a,s,l,c,u,d,h,f,m,p){let b=p?wt(p[1])?p[1].error:p[1].data:void 0,v=e.createURL(t.location),x=e.createURL(i),w=n;o&&t.errors?w=Ml(n,Object.keys(t.errors)[0],!0):p&&wt(p[1])&&(w=Ml(n,p[0]));let E=p?p[1].statusCode:void 0,P=a&&E&&E>=400,C=w.filter((O,M)=>{let{route:R}=O;if(R.lazy)return!0;if(R.loader==null)return!1;if(o)return La(R,t.loaderData,t.errors);if(lg(t.loaderData,t.matches[M],O)||l.some(z=>z===O.route.id))return!0;let _=t.matches[M],L=O;return Fl(O,Be({currentUrl:v,currentParams:_.params,nextUrl:x,nextParams:L.params},r,{actionResult:b,actionStatus:E,defaultShouldRevalidate:P?!1:s||v.pathname+v.search===x.pathname+x.search||v.search!==x.search||Ed(_,L)}))}),k=[];return d.forEach((O,M)=>{if(o||!n.some(U=>U.route.id===O.routeId)||u.has(M))return;let R=Hn(f,O.path,m);if(!R){k.push({key:M,routeId:O.routeId,path:O.path,matches:null,match:null,controller:null});return}let _=t.fetchers.get(M),L=Zr(R,O.path),z=!1;h.has(M)?z=!1:c.has(M)?(c.delete(M),z=!0):_&&_.state!=="idle"&&_.data===void 0?z=s:z=Fl(L,Be({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:b,actionStatus:E,defaultShouldRevalidate:P?!1:s})),z&&k.push({key:M,routeId:O.routeId,path:O.path,matches:R,match:L,controller:new AbortController})}),[C,k]}function La(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function lg(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function Ed(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Fl(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Ul(e,t,n,r,i){var o;let a;if(e){let c=r[e];we(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),a=c.children}else a=n;let s=t.filter(c=>!a.some(u=>Rd(c,u))),l=Xi(s,i,[e||"_","patch",String(((o=a)==null?void 0:o.length)||"0")],r);a.push(...l)}function Rd(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(o=>Rd(n,o))}):!1}async function cg(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];we(i,"No route found in manifest");let o={};for(let a in r){let l=i[a]!==void 0&&a!=="hasErrorBoundary";Qn(!l,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!l&&!Om.has(a)&&(o[a]=r[a])}Object.assign(i,o),Object.assign(i,Be({},t(i),{lazy:void 0}))}async function ug(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,o,a)=>Object.assign(i,{[n[a].route.id]:o}),{})}async function dg(e,t,n,r,i,o,a,s,l,c){let u=o.map(f=>f.route.lazy?cg(f.route,l,s):void 0),d=o.map((f,m)=>{let p=u[m],b=i.some(x=>x.route.id===f.route.id);return Be({},f,{shouldLoad:b,resolve:async x=>(x&&r.method==="GET"&&(f.route.lazy||f.route.loader)&&(b=!0),b?fg(t,r,f,p,x,c):Promise.resolve({type:_e.data,result:void 0}))})}),h=await e({matches:d,request:r,params:o[0].params,fetcherKey:a,context:c});try{await Promise.all(u)}catch{}return h}async function fg(e,t,n,r,i,o){let a,s,l=c=>{let u,d=new Promise((m,p)=>u=p);s=()=>u(),t.signal.addEventListener("abort",s);let h=m=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):c({request:t,params:n.params,context:o},...m!==void 0?[m]:[]),f=(async()=>{try{return{type:"data",result:await(i?i(p=>h(p)):h())}}catch(m){return{type:"error",result:m}}})();return Promise.race([f,d])};try{let c=n.route[e];if(r)if(c){let u,[d]=await Promise.all([l(c).catch(h=>{u=h}),r]);if(u!==void 0)throw u;a=d}else if(await r,c=n.route[e],c)a=await l(c);else if(e==="action"){let u=new URL(t.url),d=u.pathname+u.search;throw gt(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:_e.data,result:void 0};else if(c)a=await l(c);else{let u=new URL(t.url),d=u.pathname+u.search;throw gt(404,{pathname:d})}we(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:_e.error,result:c}}finally{s&&t.signal.removeEventListener("abort",s)}return a}async function hg(e){let{result:t,type:n}=e;if(Pd(t)){let d;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?d=null:d=await t.json():d=await t.text()}catch(h){return{type:_e.error,error:h}}return n===_e.error?{type:_e.error,error:new Zi(t.status,t.statusText,d),statusCode:t.status,headers:t.headers}:{type:_e.data,data:d,statusCode:t.status,headers:t.headers}}if(n===_e.error){if(Wl(t)){var r,i;if(t.data instanceof Error){var o,a;return{type:_e.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:_e.error,error:new Zi(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:ai(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:_e.error,error:t,statusCode:ai(t)?t.status:void 0}}if(bg(t)){var s,l;return{type:_e.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(Wl(t)){var c,u;return{type:_e.data,data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:_e.data,data:t}}function pg(e,t,n,r,i,o){let a=e.headers.get("Location");if(we(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!ws.test(a)){let s=r.slice(0,r.findIndex(l=>l.route.id===n)+1);a=Ia(new URL(t.url),s,i,!0,a,o),e.headers.set("Location",a)}return e}function Hl(e,t,n,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(ws.test(e)){let o=e,a=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(i.includes(a.protocol))throw new Error("Invalid redirect location");let s=on(a.pathname,n)!=null;if(a.origin===t.origin&&s)return xs(a.pathname)+a.search+a.hash}try{let o=r.createURL(e);if(i.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function lr(e,t,n,r){let i=e.createURL(Td(t)).toString(),o={signal:n};if(r&&_t(r.formMethod)){let{formMethod:a,formEncType:s}=r;o.method=a.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(r.json)):s==="text/plain"?o.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?o.body=Oa(r.formData):o.body=r.formData}return new Request(i,o)}function Oa(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Bl(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function mg(e,t,n,r,i){let o={},a=null,s,l=!1,c={},u=n&&wt(n[1])?n[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let h=d.route.id,f=t[h];if(we(!Vn(f),"Cannot handle redirect results in processLoaderData"),wt(f)){let m=f.error;u!==void 0&&(m=u,u=void 0),a=a||{};{let p=Bn(e,h);a[p.route.id]==null&&(a[p.route.id]=m)}o[h]=void 0,l||(l=!0,s=ai(f.error)?f.error.status:500),f.headers&&(c[h]=f.headers)}else vn(f)?(r.set(h,f.deferredData),o[h]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!l&&(s=f.statusCode),f.headers&&(c[h]=f.headers)):(o[h]=f.data,f.statusCode&&f.statusCode!==200&&!l&&(s=f.statusCode),f.headers&&(c[h]=f.headers))}),u!==void 0&&n&&(a={[n[0]]:u},o[n[0]]=void 0),{loaderData:o,errors:a,statusCode:s||200,loaderHeaders:c}}function zl(e,t,n,r,i,o,a){let{loaderData:s,errors:l}=mg(t,n,r,a);return i.forEach(c=>{let{key:u,match:d,controller:h}=c,f=o[u];if(we(f,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(wt(f)){let m=Bn(e.matches,d?.route.id);l&&l[m.route.id]||(l=Be({},l,{[m.route.id]:f.error})),e.fetchers.delete(u)}else if(Vn(f))we(!1,"Unhandled fetcher revalidation redirect");else if(vn(f))we(!1,"Unhandled fetcher deferred data");else{let m=gn(f.data);e.fetchers.set(u,m)}}),{loaderData:s,errors:l}}function $l(e,t,n,r){let i=Be({},t);for(let o of n){let a=o.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(i[a]=t[a]):e[a]!==void 0&&o.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function Vl(e){return e?wt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Bn(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Kl(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function gt(e,t){let{pathname:n,routeId:r,method:i,type:o,message:a}=t===void 0?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(s="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",l='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new Zi(e||500,s,new Error(l),!0)}function Ci(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Vn(i))return{key:r,result:i}}}function Td(e){let t=typeof e=="string"?Cn(e):e;return Gn(Be({},t,{hash:""}))}function gg(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function yg(e){return Pd(e.result)&&ng.has(e.result.status)}function vn(e){return e.type===_e.deferred}function wt(e){return e.type===_e.error}function Vn(e){return(e&&e.type)===_e.redirect}function Wl(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function bg(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Pd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function vg(e){return tg.has(e.toLowerCase())}function _t(e){return Zm.has(e.toLowerCase())}async function xg(e,t,n,r,i){let o=Object.entries(t);for(let a=0;a<o.length;a++){let[s,l]=o[a],c=e.find(h=>h?.route.id===s);if(!c)continue;let u=r.find(h=>h.route.id===c.route.id),d=u!=null&&!Ed(u,c)&&(i&&i[c.route.id])!==void 0;vn(l)&&d&&await ks(l,n,!1).then(h=>{h&&(t[s]=h)})}}async function wg(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:o,controller:a}=n[r],s=t[i];e.find(c=>c?.route.id===o)&&vn(s)&&(we(a,"Expected an AbortController for revalidating fetcher deferred result"),await ks(s,a.signal,!0).then(c=>{c&&(t[i]=c)}))}}async function ks(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:_e.data,data:e.deferredData.unwrappedData}}catch(i){return{type:_e.error,error:i}}return{type:_e.data,data:e.deferredData.data}}}function Ss(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Zr(e,t){let n=typeof t=="string"?Cn(t).search:t.search;if(e[e.length-1].route.index&&Ss(n||""))return e[e.length-1];let r=Sd(e);return r[r.length-1]}function ql(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function ea(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function kg(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Vr(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Sg(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function gn(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Ag(e,t){try{let n=e.sessionStorage.getItem(Cd);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function Cg(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(Cd,JSON.stringify(n))}catch(r){Qn(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
21
|
-
* React Router v6.30.4
|
|
22
|
-
*
|
|
23
|
-
* Copyright (c) Remix Software Inc.
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the MIT license found in the
|
|
26
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
27
|
-
*
|
|
28
|
-
* @license MIT
|
|
29
|
-
*/function eo(){return eo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eo.apply(null,arguments)}const gi=g.createContext(null),As=g.createContext(null),ln=g.createContext(null),Cs=g.createContext(null),cn=g.createContext({outlet:null,matches:[],isDataRoute:!1}),Id=g.createContext(null);function Eg(e,t){let{relative:n}=t===void 0?{}:t;Ir()||we(!1);let{basename:r,navigator:i}=g.useContext(ln),{hash:o,pathname:a,search:s}=Ro(e,{relative:n}),l=a;return r!=="/"&&(l=a==="/"?r:rn([r,a])),i.createHref({pathname:l,search:s,hash:o})}function Ir(){return g.useContext(Cs)!=null}function un(){return Ir()||we(!1),g.useContext(Cs).location}function Ld(e){g.useContext(ln).static||g.useLayoutEffect(e)}function Eo(){let{isDataRoute:e}=g.useContext(cn);return e?Hg():Rg()}function Rg(){Ir()||we(!1);let e=g.useContext(gi),{basename:t,future:n,navigator:r}=g.useContext(ln),{matches:i}=g.useContext(cn),{pathname:o}=un(),a=JSON.stringify(Ao(i,n.v7_relativeSplatPath)),s=g.useRef(!1);return Ld(()=>{s.current=!0}),g.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let d=Co(c,JSON.parse(a),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:rn([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,a,o,e])}const Tg=g.createContext(null);function Pg(e){let t=g.useContext(cn).outlet;return t&&g.createElement(Tg.Provider,{value:e},t)}function Ro(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(ln),{matches:i}=g.useContext(cn),{pathname:o}=un(),a=JSON.stringify(Ao(i,r.v7_relativeSplatPath));return g.useMemo(()=>Co(e,JSON.parse(a),o,n==="path"),[e,a,o,n])}function Ig(e,t,n,r){Ir()||we(!1);let{navigator:i}=g.useContext(ln),{matches:o}=g.useContext(cn),a=o[o.length-1],s=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=un(),u;u=c;let d=u.pathname||"/",h=d;if(l!=="/"){let p=l.replace(/^\//,"").split("/");h="/"+d.replace(/^\//,"").split("/").slice(p.length).join("/")}let f=Hn(e,{pathname:h});return Dg(f&&f.map(p=>Object.assign({},p,{params:Object.assign({},s,p.params),pathname:rn([l,i.encodeLocation?i.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?l:rn([l,i.encodeLocation?i.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),o,n,r)}function Lg(){let e=Ug(),t=ai(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 g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,null)}const Og=g.createElement(Lg,null);class Ng extends g.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?g.createElement(cn.Provider,{value:this.props.routeContext},g.createElement(Id.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _g(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(gi);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(cn.Provider,{value:t},r)}function Dg(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let u=a.findIndex(d=>d.route.id&&s?.[d.route.id]!==void 0);u>=0||we(!1),a=a.slice(0,Math.min(a.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<a.length;u++){let d=a[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:h,errors:f}=n,m=d.route.loader&&h[d.route.id]===void 0&&(!f||f[d.route.id]===void 0);if(d.route.lazy||m){l=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,d,h)=>{let f,m=!1,p=null,b=null;n&&(f=s&&d.route.id?s[d.route.id]:void 0,p=d.route.errorElement||Og,l&&(c<0&&h===0?(Bg("route-fallback"),m=!0,b=null):c===h&&(m=!0,b=d.route.hydrateFallbackElement||null)));let v=t.concat(a.slice(0,h+1)),x=()=>{let w;return f?w=p:m?w=b:d.route.Component?w=g.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=u,g.createElement(_g,{match:d,routeContext:{outlet:u,matches:v,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?g.createElement(Ng,{location:n.location,revalidation:n.revalidation,component:p,error:f,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var Od=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Od||{}),Nd=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}(Nd||{});function Mg(e){let t=g.useContext(gi);return t||we(!1),t}function jg(e){let t=g.useContext(As);return t||we(!1),t}function Fg(e){let t=g.useContext(cn);return t||we(!1),t}function _d(e){let t=Fg(),n=t.matches[t.matches.length-1];return n.route.id||we(!1),n.route.id}function Ug(){var e;let t=g.useContext(Id),n=jg(),r=_d();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Hg(){let{router:e}=Mg(Od.UseNavigateStable),t=_d(Nd.UseNavigateStable),n=g.useRef(!1);return Ld(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,eo({fromRouteId:t},o)))},[e,t])}const Ql={};function Bg(e,t,n){Ql[e]||(Ql[e]=!0)}function zg(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function Ot(e){let{to:t,replace:n,state:r,relative:i}=e;Ir()||we(!1);let{future:o,static:a}=g.useContext(ln),{matches:s}=g.useContext(cn),{pathname:l}=un(),c=Eo(),u=Co(t,Ao(s,o.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(u);return g.useEffect(()=>c(JSON.parse(d),{replace:n,state:r,relative:i}),[c,d,i,n,r]),null}function FD(e){return Pg(e.context)}function $g(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ye.Pop,navigator:o,static:a=!1,future:s}=e;Ir()&&we(!1);let l=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:l,navigator:o,static:a,future:eo({v7_relativeSplatPath:!1},s)}),[l,s,o,a]);typeof r=="string"&&(r=Cn(r));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:m="default"}=r,p=g.useMemo(()=>{let b=on(u,l);return b==null?null:{location:{pathname:b,search:d,hash:h,state:f,key:m},navigationType:i}},[l,u,d,h,f,m,i]);return p==null?null:g.createElement(ln.Provider,{value:c},g.createElement(Cs.Provider,{children:n,value:p}))}new Promise(()=>{});function Vg(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:g.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:g.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:g.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
|
30
|
-
* React Router DOM v6.30.4
|
|
31
|
-
*
|
|
32
|
-
* Copyright (c) Remix Software Inc.
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the MIT license found in the
|
|
35
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
36
|
-
*
|
|
37
|
-
* @license MIT
|
|
38
|
-
*/function kr(){return kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kr.apply(null,arguments)}function Dd(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Kg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Wg(e,t){return e.button===0&&(!t||t==="_self")&&!Kg(e)}function Na(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function qg(e,t){let n=Na(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}const Qg=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Gg=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Yg="6";try{window.__reactRouterVersion=Yg}catch{}function Xg(e,t){return ag({basename:void 0,future:kr({},void 0,{v7_prependBasename:!0}),history:Pm({window:void 0}),hydrationData:Jg(),routes:e,mapRouteProperties:Vg,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function Jg(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=kr({},t,{errors:Zg(t.errors)})),t}function Zg(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Zi(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let a=new o(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}const Md=g.createContext({isTransitioning:!1}),ey=g.createContext(new Map),ty="startTransition",Gl=ko[ty],ny="flushSync",Yl=vm[ny];function ry(e){Gl?Gl(e):e()}function Kr(e){Yl?Yl(e):e()}class iy{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function oy(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=g.useState(n.state),[a,s]=g.useState(),[l,c]=g.useState({isTransitioning:!1}),[u,d]=g.useState(),[h,f]=g.useState(),[m,p]=g.useState(),b=g.useRef(new Map),{v7_startTransition:v}=r||{},x=g.useCallback(O=>{v?ry(O):O()},[v]),w=g.useCallback((O,M)=>{let{deletedFetchers:R,flushSync:_,viewTransitionOpts:L}=M;O.fetchers.forEach((U,$)=>{U.data!==void 0&&b.current.set($,U.data)}),R.forEach(U=>b.current.delete(U));let z=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||z){_?Kr(()=>o(O)):x(()=>o(O));return}if(_){Kr(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let U=n.window.document.startViewTransition(()=>{Kr(()=>o(O))});U.finished.finally(()=>{Kr(()=>{d(void 0),f(void 0),s(void 0),c({isTransitioning:!1})})}),Kr(()=>f(U));return}h?(u&&u.resolve(),h.skipTransition(),p({state:O,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(s(O),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,h,u,b,x]);g.useLayoutEffect(()=>n.subscribe(w),[n,w]),g.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new iy)},[l]),g.useEffect(()=>{if(u&&a&&n.window){let O=a,M=u.promise,R=n.window.document.startViewTransition(async()=>{x(()=>o(O)),await M});R.finished.finally(()=>{d(void 0),f(void 0),s(void 0),c({isTransitioning:!1})}),f(R)}},[x,a,u,n.window]),g.useEffect(()=>{u&&a&&i.location.key===a.location.key&&u.resolve()},[u,h,i.location,a]),g.useEffect(()=>{!l.isTransitioning&&m&&(s(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),p(void 0))},[l.isTransitioning,m]),g.useEffect(()=>{},[]);let E=g.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:O=>n.navigate(O),push:(O,M,R)=>n.navigate(O,{state:M,preventScrollReset:R?.preventScrollReset}),replace:(O,M,R)=>n.navigate(O,{replace:!0,state:M,preventScrollReset:R?.preventScrollReset})}),[n]),P=n.basename||"/",C=g.useMemo(()=>({router:n,navigator:E,static:!1,basename:P}),[n,E,P]),k=g.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return g.useEffect(()=>zg(r,n.future),[r,n.future]),g.createElement(g.Fragment,null,g.createElement(gi.Provider,{value:C},g.createElement(As.Provider,{value:i},g.createElement(ey.Provider,{value:b.current},g.createElement(Md.Provider,{value:l},g.createElement($g,{basename:P,location:i.location,navigationType:i.historyAction,navigator:E,future:k},i.initialized||n.future.v7_partialHydration?g.createElement(ay,{routes:n.routes,future:n.future,state:i}):t))))),null)}const ay=g.memo(sy);function sy(e){let{routes:t,future:n,state:r}=e;return Ig(t,void 0,r,n)}const ly=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Es=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:a,state:s,target:l,to:c,preventScrollReset:u,viewTransition:d}=t,h=Dd(t,Qg),{basename:f}=g.useContext(ln),m,p=!1;if(typeof c=="string"&&cy.test(c)&&(m=c,ly))try{let w=new URL(window.location.href),E=c.startsWith("//")?new URL(w.protocol+c):new URL(c),P=on(E.pathname,f);E.origin===w.origin&&P!=null?c=P+E.search+E.hash:p=!0}catch{}let b=Eg(c,{relative:i}),v=dy(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:i,viewTransition:d});function x(w){r&&r(w),w.defaultPrevented||v(w)}return g.createElement("a",kr({},h,{href:m||b,onClick:p||o?r:x,ref:n,target:l}))}),Xl=g.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:a=!1,style:s,to:l,viewTransition:c,children:u}=t,d=Dd(t,Gg),h=Ro(l,{relative:d.relative}),f=un(),m=g.useContext(As),{navigator:p,basename:b}=g.useContext(ln),v=m!=null&&hy(h)&&c===!0,x=p.encodeLocation?p.encodeLocation(h).pathname:h.pathname,w=f.pathname,E=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(w=w.toLowerCase(),E=E?E.toLowerCase():null,x=x.toLowerCase()),E&&b&&(E=on(E,b)||E);const P=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let C=w===x||!a&&w.startsWith(x)&&w.charAt(P)==="/",k=E!=null&&(E===x||!a&&E.startsWith(x)&&E.charAt(x.length)==="/"),O={isActive:C,isPending:k,isTransitioning:v},M=C?r:void 0,R;typeof o=="function"?R=o(O):R=[o,C?"active":null,k?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let _=typeof s=="function"?s(O):s;return g.createElement(Es,kr({},d,{"aria-current":M,className:R,ref:n,style:_,to:l,viewTransition:c}),typeof u=="function"?u(O):u)});var _a;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(_a||(_a={}));var Jl;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Jl||(Jl={}));function uy(e){let t=g.useContext(gi);return t||we(!1),t}function dy(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:a,viewTransition:s}=t===void 0?{}:t,l=Eo(),c=un(),u=Ro(e,{relative:a});return g.useCallback(d=>{if(Wg(d,n)){d.preventDefault();let h=r!==void 0?r:Gn(c)===Gn(u);l(e,{replace:h,state:i,preventScrollReset:o,relative:a,viewTransition:s})}},[c,l,u,r,i,n,e,o,a,s])}function fy(e){let t=g.useRef(Na(e)),n=g.useRef(!1),r=un(),i=g.useMemo(()=>qg(r.search,n.current?null:t.current),[r.search]),o=Eo(),a=g.useCallback((s,l)=>{const c=Na(typeof s=="function"?s(i):s);n.current=!0,o("?"+c,l)},[o,i]);return[i,a]}function hy(e,t){t===void 0&&(t={});let n=g.useContext(Md);n==null&&we(!1);let{basename:r}=uy(_a.useViewTransitionState),i=Ro(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=on(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=on(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ji(i.pathname,a)!=null||Ji(i.pathname,o)!=null}const Zl=e=>{let t;const n=new Set,r=(c,u)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const h=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(f=>f(t,h))}},i=()=>t,s={setState:r,getState:i,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,i,s);return s},py=e=>e?Zl(e):Zl,my=e=>e;function gy(e,t=my){const n=W.useSyncExternalStore(e.subscribe,W.useCallback(()=>t(e.getState()),[e,t]),W.useCallback(()=>t(e.getInitialState()),[e,t]));return W.useDebugValue(n),n}const ec=e=>{const t=py(e),n=r=>gy(t,r);return Object.assign(n,t),n},jd=e=>e?ec(e):ec,to="agim_token";function yy(){try{return localStorage.getItem(to)}catch{return null}}function tc(e){try{e?localStorage.setItem(to,e):localStorage.removeItem(to)}catch{}}const nc=yy(),Rs=jd(e=>({token:nc,signedIn:!!nc,setToken:t=>{tc(t),e({token:t,signedIn:!!t})},clear:()=>{tc(null),e({token:null,signedIn:!1})}}));function by(){function e(t){if(t.key!==to)return;const n=t.newValue;Rs.setState({token:n,signedIn:!!n})}return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}function Fd({children:e}){const t=Rs(r=>r.signedIn),n=un();if(!t){const r=encodeURIComponent(n.pathname+n.search);return y.jsx(Ot,{to:`/login?next=${r}`,replace:!0})}return y.jsx(y.Fragment,{children:e})}const vy=(e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);Wn(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},rc={},Da=(e,t,n,r)=>{Wn(n)&&rc[n]||(Wn(n)&&(rc[n]=new Date),vy(e,t,n,r))},Ud=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Ma=(e,t,n)=>{e.loadNamespaces(t,Ud(e,n))},ic=(e,t,n,r)=>{if(Wn(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Ma(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,Ud(e,r))},xy=(e,t,n={})=>!t.languages||!t.languages.length?(Da(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Wn=e=>typeof e=="string",wy=e=>typeof e=="object"&&e!==null,ky=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Sy={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Ay=e=>Sy[e],Cy=e=>e.replace(ky,Ay);let ja={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Cy};const Ey=(e={})=>{ja={...ja,...e}},Ry=()=>ja;let Hd;const Ty=e=>{Hd=e},Py=()=>Hd,Iy={type:"3rdParty",init(e){Ey(e.options.react),Ty(e)}},Ly=g.createContext();class Oy{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Ny=(e,t)=>{const n=g.useRef();return g.useEffect(()=>{n.current=e},[e,t]),n.current},Bd=(e,t,n,r)=>e.getFixedT(t,n,r),_y=(e,t,n,r)=>g.useCallback(Bd(e,t,n,r),[e,t,n,r]),at=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=g.useContext(Ly)||{},o=n||r||Py();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Oy),!o){Da(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const E=(C,k)=>Wn(k)?k:wy(k)&&Wn(k.defaultValue)?k.defaultValue:Array.isArray(C)?C[C.length-1]:C,P=[E,{},!1];return P.t=E,P.i18n={},P.ready=!1,P}o.options.react?.wait&&Da(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Ry(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let c=e||i||o.options?.defaultNS;c=Wn(c)?[c]:c||["translation"],o.reportNamespaces.addUsedNamespaces?.(c);const u=(o.isInitialized||o.initializedStoreOnce)&&c.every(E=>xy(E,o,a)),d=_y(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),h=()=>d,f=()=>Bd(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),[m,p]=g.useState(h);let b=c.join();t.lng&&(b=`${t.lng}${b}`);const v=Ny(b),x=g.useRef(!0);g.useEffect(()=>{const{bindI18n:E,bindI18nStore:P}=a;x.current=!0,!u&&!s&&(t.lng?ic(o,t.lng,c,()=>{x.current&&p(f)}):Ma(o,c,()=>{x.current&&p(f)})),u&&v&&v!==b&&x.current&&p(f);const C=()=>{x.current&&p(f)};return E&&o?.on(E,C),P&&o?.store.on(P,C),()=>{x.current=!1,o&&E&&E?.split(" ").forEach(k=>o.off(k,C)),P&&o&&P.split(" ").forEach(k=>o.store.off(k,C))}},[o,b]),g.useEffect(()=>{x.current&&u&&p(h)},[o,l,u]);const w=[m,o,u];if(w.t=m,w.i18n=o,w.ready=u,u||!u&&!s)return w;throw new Promise(E=>{t.lng?ic(o,t.lng,c,()=>E()):Ma(o,c,()=>E())})};/**
|
|
39
|
-
* @license lucide-react v0.469.0 - ISC
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the ISC license.
|
|
42
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/const Dy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zd=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
44
|
-
* @license lucide-react v0.469.0 - ISC
|
|
45
|
-
*
|
|
46
|
-
* This source code is licensed under the ISC license.
|
|
47
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var My={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
49
|
-
* @license lucide-react v0.469.0 - ISC
|
|
50
|
-
*
|
|
51
|
-
* This source code is licensed under the ISC license.
|
|
52
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
-
*/const jy=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>g.createElement("svg",{ref:l,...My,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:zd("lucide",i),...s},[...a.map(([c,u])=>g.createElement(c,u)),...Array.isArray(o)?o:[o]]));/**
|
|
54
|
-
* @license lucide-react v0.469.0 - ISC
|
|
55
|
-
*
|
|
56
|
-
* This source code is licensed under the ISC license.
|
|
57
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
-
*/const ct=(e,t)=>{const n=g.forwardRef(({className:r,...i},o)=>g.createElement(jy,{ref:o,iconNode:t,className:zd(`lucide-${Dy(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
|
|
59
|
-
* @license lucide-react v0.469.0 - ISC
|
|
60
|
-
*
|
|
61
|
-
* This source code is licensed under the ISC license.
|
|
62
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
-
*/const Fy=ct("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
64
|
-
* @license lucide-react v0.469.0 - ISC
|
|
65
|
-
*
|
|
66
|
-
* This source code is licensed under the ISC license.
|
|
67
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
-
*/const $d=ct("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
69
|
-
* @license lucide-react v0.469.0 - ISC
|
|
70
|
-
*
|
|
71
|
-
* This source code is licensed under the ISC license.
|
|
72
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
-
*/const Uy=ct("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
74
|
-
* @license lucide-react v0.469.0 - ISC
|
|
75
|
-
*
|
|
76
|
-
* This source code is licensed under the ISC license.
|
|
77
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
-
*/const Hy=ct("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
79
|
-
* @license lucide-react v0.469.0 - ISC
|
|
80
|
-
*
|
|
81
|
-
* This source code is licensed under the ISC license.
|
|
82
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
-
*/const By=ct("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/**
|
|
84
|
-
* @license lucide-react v0.469.0 - ISC
|
|
85
|
-
*
|
|
86
|
-
* This source code is licensed under the ISC license.
|
|
87
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/const zy=ct("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
|
|
89
|
-
* @license lucide-react v0.469.0 - ISC
|
|
90
|
-
*
|
|
91
|
-
* This source code is licensed under the ISC license.
|
|
92
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/const $y=ct("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
|
|
94
|
-
* @license lucide-react v0.469.0 - ISC
|
|
95
|
-
*
|
|
96
|
-
* This source code is licensed under the ISC license.
|
|
97
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
-
*/const Vy=ct("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
99
|
-
* @license lucide-react v0.469.0 - ISC
|
|
100
|
-
*
|
|
101
|
-
* This source code is licensed under the ISC license.
|
|
102
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
-
*/const Ky=ct("MessageSquarePlus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
|
|
104
|
-
* @license lucide-react v0.469.0 - ISC
|
|
105
|
-
*
|
|
106
|
-
* This source code is licensed under the ISC license.
|
|
107
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
-
*/const Wy=ct("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
109
|
-
* @license lucide-react v0.469.0 - ISC
|
|
110
|
-
*
|
|
111
|
-
* This source code is licensed under the ISC license.
|
|
112
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
-
*/const qy=ct("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
114
|
-
* @license lucide-react v0.469.0 - ISC
|
|
115
|
-
*
|
|
116
|
-
* This source code is licensed under the ISC license.
|
|
117
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
-
*/const Qy=ct("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
119
|
-
* @license lucide-react v0.469.0 - ISC
|
|
120
|
-
*
|
|
121
|
-
* This source code is licensed under the ISC license.
|
|
122
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
-
*/const Gy=ct("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
124
|
-
* @license lucide-react v0.469.0 - ISC
|
|
125
|
-
*
|
|
126
|
-
* This source code is licensed under the ISC license.
|
|
127
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
-
*/const Yy=ct("SunMedium",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 3v1",key:"1asbbs"}],["path",{d:"M12 20v1",key:"1wcdkc"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M20 12h1",key:"1vloll"}],["path",{d:"m18.364 5.636-.707.707",key:"1hakh0"}],["path",{d:"m6.343 17.657-.707.707",key:"18m9nf"}],["path",{d:"m5.636 5.636.707.707",key:"1xv1c5"}],["path",{d:"m17.657 17.657.707.707",key:"vl76zb"}]]);/**
|
|
129
|
-
* @license lucide-react v0.469.0 - ISC
|
|
130
|
-
*
|
|
131
|
-
* This source code is licensed under the ISC license.
|
|
132
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/const Xy=ct("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
134
|
-
* @license lucide-react v0.469.0 - ISC
|
|
135
|
-
*
|
|
136
|
-
* This source code is licensed under the ISC license.
|
|
137
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
-
*/const Jy=ct("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function oc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zy(...e){return t=>{let n=!1;const r=e.map(i=>{const o=oc(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():oc(e[i],null)}}}}function $e(...e){return g.useCallback(Zy(...e),e)}function Sr(e){const t=g.forwardRef((n,r)=>{let{children:i,...o}=n,a=null,s=!1;const l=[];ac(i)&&typeof Ei=="function"&&(i=Ei(i._payload)),g.Children.forEach(i,h=>{if(ob(h)){s=!0;const f=h;let m="child"in f.props?f.props.child:f.props.children;ac(m)&&typeof Ei=="function"&&(m=Ei(m._payload)),a=nb(f,m),l.push(a?.props?.children)}else l.push(h)}),a?a=g.cloneElement(a,void 0,l):!s&&g.Children.count(i)===1&&g.isValidElement(i)&&(a=i);const c=a?ib(a):void 0,u=$e(r,c);if(!a){if(i||i===0)throw new Error(s?cb(e):lb(e));return i}const d=rb(o,a.props??{});return a.type!==g.Fragment&&(d.ref=r?u:c),g.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}var eb=Sr("Slot"),Vd=Symbol.for("radix.slottable");function tb(e){const t=n=>"child"in n?n.children(n.child):n.children;return t.displayName=`${e}.Slottable`,t.__radixId=Vd,t}var nb=(e,t)=>{if("child"in e.props){const n=e.props.child;return g.isValidElement(n)?g.cloneElement(n,void 0,e.props.children(n.props.children)):null}return g.isValidElement(t)?t:null};function rb(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function ib(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ob(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vd}var ab=Symbol.for("react.lazy");function ac(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ab&&"_payload"in e&&sb(e._payload)}function sb(e){return typeof e=="object"&&e!==null&&"then"in e}var lb=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,cb=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Ei=ko[" use ".trim().toString()];function Kd(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Kd(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Wd(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Kd(e))&&(r&&(r+=" "),r+=t);return r}const sc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,lc=Wd,Ts=(e,t)=>n=>{var r;if(t?.variants==null)return lc(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(c=>{const u=n?.[c],d=o?.[c];if(u===null)return null;const h=sc(u)||sc(d);return i[c][h]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:h,...f}=u;return Object.entries(f).every(m=>{let[p,b]=m;return Array.isArray(b)?b.includes({...o,...s}[p]):{...o,...s}[p]===b})?[...c,d,h]:c},[]);return lc(e,a,l,n?.class,n?.className)},Ps="-",ub=e=>{const t=fb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(Ps);return s[0]===""&&s.length!==1&&s.shift(),qd(s,t)||db(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},qd=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?qd(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Ps);return t.validators.find(({validator:a})=>a(o))?.classGroupId},cc=/^\[(.+)\]$/,db=e=>{if(cc.test(e)){const t=cc.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},fb=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return pb(Object.entries(e.classGroups),n).forEach(([o,a])=>{Fa(a,r,o,t)}),r},Fa=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:uc(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(hb(i)){Fa(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{Fa(a,uc(t,o),n,r)})})},uc=(e,t)=>{let n=e;return t.split(Ps).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},hb=e=>e.isThemeGetter,pb=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[n,i]}):e,mb=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},Qd="!",gb=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,a=s=>{const l=[];let c=0,u=0,d;for(let b=0;b<s.length;b++){let v=s[b];if(c===0){if(v===i&&(r||s.slice(b,b+o)===t)){l.push(s.slice(u,b)),u=b+o;continue}if(v==="/"){d=b;continue}}v==="["?c++:v==="]"&&c--}const h=l.length===0?s:s.substring(u),f=h.startsWith(Qd),m=f?h.substring(1):h,p=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}};return n?s=>n({className:s,parseClassName:a}):a},yb=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},bb=e=>({cache:mb(e.cacheSize),parseClassName:gb(e),...ub(e)}),vb=/\s+/,xb=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(vb);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=n(c);let m=!!f,p=r(m?h.substring(0,f):h);if(!p){if(!m){s=c+(s.length>0?" "+s:s);continue}if(p=r(h),!p){s=c+(s.length>0?" "+s:s);continue}m=!1}const b=yb(u).join(":"),v=d?b+Qd:b,x=v+p;if(o.includes(x))continue;o.push(x);const w=i(p,m);for(let E=0;E<w.length;++E){const P=w[E];o.push(v+P)}s=c+(s.length>0?" "+s:s)}return s};function wb(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Gd(t))&&(r&&(r+=" "),r+=n);return r}const Gd=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Gd(e[r]))&&(n&&(n+=" "),n+=t);return n};function kb(e,...t){let n,r,i,o=a;function a(l){const c=t.reduce((u,d)=>d(u),e());return n=bb(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=xb(l,n);return i(l,u),u}return function(){return o(wb.apply(null,arguments))}}const Ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Yd=/^\[(?:([a-z-]+):)?(.+)\]$/i,Sb=/^\d+\/\d+$/,Ab=new Set(["px","full","screen"]),Cb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Eb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Rb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Tb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Pb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tn=e=>br(e)||Ab.has(e)||Sb.test(e),hn=e=>Lr(e,"length",jb),br=e=>!!e&&!Number.isNaN(Number(e)),ta=e=>Lr(e,"number",br),Wr=e=>!!e&&Number.isInteger(Number(e)),Ib=e=>e.endsWith("%")&&br(e.slice(0,-1)),ye=e=>Yd.test(e),pn=e=>Cb.test(e),Lb=new Set(["length","size","percentage"]),Ob=e=>Lr(e,Lb,Xd),Nb=e=>Lr(e,"position",Xd),_b=new Set(["image","url"]),Db=e=>Lr(e,_b,Ub),Mb=e=>Lr(e,"",Fb),qr=()=>!0,Lr=(e,t,n)=>{const r=Yd.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},jb=e=>Eb.test(e)&&!Rb.test(e),Xd=()=>!1,Fb=e=>Tb.test(e),Ub=e=>Pb.test(e),Hb=()=>{const e=Ue("colors"),t=Ue("spacing"),n=Ue("blur"),r=Ue("brightness"),i=Ue("borderColor"),o=Ue("borderRadius"),a=Ue("borderSpacing"),s=Ue("borderWidth"),l=Ue("contrast"),c=Ue("grayscale"),u=Ue("hueRotate"),d=Ue("invert"),h=Ue("gap"),f=Ue("gradientColorStops"),m=Ue("gradientColorStopPositions"),p=Ue("inset"),b=Ue("margin"),v=Ue("opacity"),x=Ue("padding"),w=Ue("saturate"),E=Ue("scale"),P=Ue("sepia"),C=Ue("skew"),k=Ue("space"),O=Ue("translate"),M=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",ye,t],L=()=>[ye,t],z=()=>["",tn,hn],U=()=>["auto",br,ye],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",ye],S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ie=()=>[br,ye];return{cacheSize:500,separator:":",theme:{colors:[qr],spacing:[tn,hn],blur:["none","",pn,ye],brightness:ie(),borderColor:[e],borderRadius:["none","","full",pn,ye],borderSpacing:L(),borderWidth:z(),contrast:ie(),grayscale:F(),hueRotate:ie(),invert:F(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[Ib,hn],inset:_(),margin:_(),opacity:ie(),padding:L(),saturate:ie(),scale:ie(),sepia:F(),skew:ie(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",ye]}],container:["container"],columns:[{columns:[pn]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),ye]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Wr,ye]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ye]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Wr,ye]}],"grid-cols":[{"grid-cols":[qr]}],"col-start-end":[{col:["auto",{span:["full",Wr,ye]},ye]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[qr]}],"row-start-end":[{row:["auto",{span:[Wr,ye]},ye]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ye]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...V()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...V(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...V(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ye,t]}],"min-w":[{"min-w":[ye,t,"min","max","fit"]}],"max-w":[{"max-w":[ye,t,"none","full","min","max","fit","prose",{screen:[pn]},pn]}],h:[{h:[ye,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ye,t,"auto","min","max","fit"]}],"font-size":[{text:["base",pn,hn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ta]}],"font-family":[{font:[qr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ye]}],"line-clamp":[{"line-clamp":["none",br,ta]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",tn,ye]}],"list-image":[{"list-image":["none",ye]}],"list-style-type":[{list:["none","disc","decimal",ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",tn,hn]}],"underline-offset":[{"underline-offset":["auto",tn,ye]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),Nb]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ob]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Db]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:G()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[tn,ye]}],"outline-w":[{outline:[tn,hn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[tn,hn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",pn,Mb]}],"shadow-color":[{shadow:[qr]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",pn,ye]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ye]}],duration:[{duration:ie()}],ease:[{ease:["linear","in","out","in-out",ye]}],delay:[{delay:ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Wr,ye]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ye]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[tn,hn,ta]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Bb=kb(Hb);function ve(...e){return Bb(Wd(e))}const zb=Ts(["inline-flex items-center justify-center gap-2","whitespace-nowrap rounded-md text-sm font-medium","transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-bg","disabled:pointer-events-none disabled:opacity-55","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"].join(" "),{variants:{variant:{default:"bg-accent text-accent-fg hover:bg-accent-hover",secondary:"bg-surface-2 text-text hover:bg-surface-hover border border-border",outline:"bg-surface text-text border border-border hover:bg-surface-hover hover:border-border-strong",ghost:"bg-transparent text-text-dim hover:bg-surface-hover hover:text-text",destructive:"bg-surface text-danger border border-danger hover:bg-danger hover:text-white",link:"bg-transparent text-accent underline-offset-4 hover:underline px-0 h-auto"},size:{default:"h-8 px-3 py-1 text-sm",sm:"h-7 px-2.5 py-1 text-xs",lg:"h-9 px-5",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),et=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const a=r?eb:"button";return y.jsx(a,{className:ve(zb({variant:t,size:n,className:e})),ref:o,...i})});et.displayName="Button";class $b extends g.Component{state={error:null,info:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){this.setState({info:n})}handleReset=()=>{this.setState({error:null,info:null})};render(){return this.state.error?y.jsx(Vb,{error:this.state.error,info:this.state.info,onReset:this.handleReset}):this.props.children}}function Vb({error:e,info:t,onReset:n}){const{t:r}=at("common"),i=typeof import.meta<"u"&&!1;return y.jsx("div",{className:"grid min-h-dvh place-items-center bg-bg px-4 py-8",children:y.jsxs("div",{className:"flex flex-col items-center gap-4 text-center max-w-xl",children:[y.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-danger-bg text-danger",children:y.jsx(Xy,{className:"h-6 w-6"})}),y.jsx("h1",{className:"text-xl font-semibold",children:r("errorBoundary.title",{defaultValue:"Something went wrong."})}),y.jsx("p",{className:"text-sm text-text-dim",children:r("errorBoundary.description",{defaultValue:"An unexpected error broke the page render. Try reloading or heading back to the home screen; if it persists, copy the message below and report it."})}),y.jsxs("pre",{className:"w-full max-w-lg overflow-auto rounded-md bg-surface-2 px-3 py-2 text-left text-xs leading-5 text-text-dim",children:[e.name,": ",e.message]}),i&&t?.componentStack&&y.jsxs("details",{className:"w-full max-w-lg text-left text-xs",children:[y.jsx("summary",{className:"cursor-pointer text-text-dim",children:"component stack (dev)"}),y.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md bg-surface-2 px-3 py-2 text-text-muted",children:t.componentStack})]}),y.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:[y.jsxs(et,{type:"button",variant:"default",onClick:()=>{n(),typeof window<"u"&&window.location.reload()},children:[y.jsx(qy,{className:"h-4 w-4"}),r("errorBoundary.reload",{defaultValue:"Reload"})]}),y.jsx(et,{type:"button",variant:"secondary",asChild:!0,children:y.jsxs(Es,{to:"/",onClick:n,children:[y.jsx(zy,{className:"h-4 w-4"}),r("errorBoundary.home",{defaultValue:"Home"})]})})]})]})})}var Or=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Kb=class extends Or{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Is=new Kb,Wb={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},qb=class{#e=Wb;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Kn=new qb;function Qb(e){setTimeout(e,0)}var Gb=typeof window>"u"||"Deno"in globalThis;function ft(){}function Yb(e,t){return typeof e=="function"?e(t):e}function Ua(e){return typeof e=="number"&&e>=0&&e!==1/0}function Jd(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xn(e,t){return typeof e=="function"?e(t):e}function kt(e,t){return typeof e=="function"?e(t):e}function dc(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==Ls(a,t.options))return!1}else if(!si(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||o&&!o(t))}function fc(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Yn(t.options.mutationKey)!==Yn(o))return!1}else if(!si(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ls(e,t){return(t?.queryKeyHashFn||Yn)(e)}function Yn(e){return JSON.stringify(e,(t,n)=>Ha(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function si(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>si(e[n],t[n])):!1}var Xb=Object.prototype.hasOwnProperty;function Zd(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=hc(e)&&hc(t);if(!r&&!(Ha(e)&&Ha(t)))return t;const o=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),s=a.length,l=r?new Array(s):{};let c=0;for(let u=0;u<s;u++){const d=r?u:a[u],h=e[d],f=t[d];if(h===f){l[d]=h,(r?u<o:Xb.call(e,d))&&c++;continue}if(h===null||f===null||typeof h!="object"||typeof f!="object"){l[d]=f;continue}const m=Zd(h,f,n+1);l[d]=m,m===h&&c++}return o===s&&c===o?e:l}function no(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function hc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ha(e){if(!pc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!pc(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function pc(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jb(e){return new Promise(t=>{Kn.setTimeout(t,e)})}function Ba(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Zd(e,t):t}function Zb(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ev(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Os=Symbol();function ef(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Os?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ns(e,t){return typeof e=="function"?e(...t):!!e}function tv(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var li=(()=>{let e=()=>Gb;return{isServer(){return e()},setIsServer(t){e=t}}})();function za(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var nv=Qb;function rv(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=nv;const o=s=>{t?e.push(s):i(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Ze=rv(),iv=class extends Or{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},ro=new iv;function ov(e){return Math.min(1e3*2**e,3e4)}function tf(e){return(e??"online")==="online"?ro.isOnline():!0}var $a=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function nf(e){let t=!1,n=0,r;const i=za(),o=()=>i.status!=="pending",a=p=>{if(!o()){const b=new $a(p);h(b),e.onCancel?.(b)}},s=()=>{t=!0},l=()=>{t=!1},c=()=>Is.isFocused()&&(e.networkMode==="always"||ro.isOnline())&&e.canRun(),u=()=>tf(e.networkMode)&&e.canRun(),d=p=>{o()||(r?.(),i.resolve(p))},h=p=>{o()||(r?.(),i.reject(p))},f=()=>new Promise(p=>{r=b=>{(o()||c())&&p(b)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),m=()=>{if(o())return;let p;const b=n===0?e.initialPromise:void 0;try{p=b??e.fn()}catch(v){p=Promise.reject(v)}Promise.resolve(p).then(d).catch(v=>{if(o())return;const x=e.retry??(li.isServer()?0:3),w=e.retryDelay??ov,E=typeof w=="function"?w(n,v):w,P=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,v);if(t||!P){h(v);return}n++,e.onFail?.(n,v),Jb(E).then(()=>c()?void 0:f()).then(()=>{t?h(v):m()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?m():f().then(m),i)}}var rf=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ua(this.gcTime)&&(this.#e=Kn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(li.isServer()?1/0:5*60*1e3))}clearGcTimeout(){this.#e!==void 0&&(Kn.clearTimeout(this.#e),this.#e=void 0)}};function av(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const d=m=>{tv(m,()=>t.signal,()=>u=!0)},h=ef(t.options,t.fetchOptions),f=async(m,p,b)=>{if(u)return Promise.reject(t.signal.reason);if(p==null&&m.pages.length)return Promise.resolve(m);const x=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:p,direction:b?"backward":"forward",meta:t.options.meta};return d(C),C})(),w=await h(x),{maxPages:E}=t.options,P=b?ev:Zb;return{pages:P(m.pages,w,E),pageParams:P(m.pageParams,p,E)}};if(i&&o.length){const m=i==="backward",p=m?sv:mc,b={pages:o,pageParams:a},v=p(r,b);s=await f(b,v,m)}else{const m=e??o.length;do{const p=l===0?a[0]??r.initialPageParam:mc(r,s);if(l>0&&p==null)break;s=await f(s,p),l++}while(l<m)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function mc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function sv(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var lv=class extends rf{#e;#t;#n;#r;#o;#i;#s;#a;constructor(e){super(),this.#a=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#r=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=yc(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=yc(this.options);t.data!==void 0&&(this.setState(gc(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=Ba(this.state.data,e,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(ft).catch(ft):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>kt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Os||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>xn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Jd(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#a||this.#u()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const l=ef(this.options,t),u=(()=>{const d={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#a=!1,this.options.persister?this.options.persister(l,u,this):l(u)},a=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:i};return r(l),l})();(this.#e==="infinite"?av(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:"fetch",meta:a.fetchOptions?.meta}),this.#i=nf({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof $a&&l.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#l({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const l=await this.#i.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#r.config.onSuccess?.(l,this),this.#r.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof $a){if(l.silent)return this.#i.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#l({type:"error",error:l}),this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#l(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...of(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...gc(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Ze.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function of(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tf(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function gc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function yc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var cv=class extends Or{constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.#s=za(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#o;#i;#s;#a;#u;#l;#p;#d;#f;#c;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),bc(this.#t,this.options)?this.#h():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Va(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Va(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#k(),this.#t.setOptions(this.options),t._defaulted&&!no(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&vc(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||kt(this.options.enabled,this.#t)!==kt(t.enabled,this.#t)||xn(this.options.staleTime,this.#t)!==xn(t.staleTime,this.#t))&&this.#g();const i=this.#y();r&&(this.#t!==n||kt(this.options.enabled,this.#t)!==kt(t.enabled,this.#t)||i!==this.#c)&&this.#b(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return dv(this,n)&&(this.#r=n,this.#i=this.options,this.#o=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#k();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ft)),t}#g(){this.#x();const e=xn(this.options.staleTime,this.#t);if(li.isServer()||this.#r.isStale||!Ua(e))return;const n=Jd(this.#r.dataUpdatedAt,e)+1;this.#d=Kn.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#b(e){this.#w(),this.#c=e,!(li.isServer()||kt(this.options.enabled,this.#t)===!1||!Ua(this.#c)||this.#c===0)&&(this.#f=Kn.setInterval(()=>{(this.options.refetchIntervalInBackground||Is.isFocused())&&this.#h()},this.#c))}#v(){this.#g(),this.#b(this.#y())}#x(){this.#d!==void 0&&(Kn.clearTimeout(this.#d),this.#d=void 0)}#w(){this.#f!==void 0&&(Kn.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#r,o=this.#o,a=this.#i,l=e!==n?e.state:this.#n,{state:c}=e;let u={...c},d=!1,h;if(t._optimisticResults){const O=this.hasListeners(),M=!O&&bc(e,t),R=O&&vc(e,n,t,r);(M||R)&&(u={...u,...of(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:f,errorUpdatedAt:m,status:p}=u;h=u.data;let b=!1;if(t.placeholderData!==void 0&&h===void 0&&p==="pending"){let O;i?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(O=i.data,b=!0):O=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,O!==void 0&&(p="success",h=Ba(i?.data,O,t),d=!0)}if(t.select&&h!==void 0&&!b)if(i&&h===o?.data&&t.select===this.#u)h=this.#l;else try{this.#u=t.select,h=t.select(h),h=Ba(i?.data,h,t),this.#l=h,this.#a=null}catch(O){this.#a=O}this.#a&&(f=this.#a,h=this.#l,m=Date.now(),p="error");const v=u.fetchStatus==="fetching",x=p==="pending",w=p==="error",E=x&&v,P=h!==void 0,k={status:p,fetchStatus:u.fetchStatus,isPending:x,isSuccess:p==="success",isError:w,isInitialLoading:E,isLoading:E,data:h,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:m,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>l.dataUpdateCount||u.errorUpdateCount>l.errorUpdateCount,isFetching:v,isRefetching:v&&!x,isLoadingError:w&&!P,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&P,isStale:_s(e,t),refetch:this.refetch,promise:this.#s,isEnabled:kt(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const O=k.data!==void 0,M=k.status==="error"&&!O,R=z=>{M?z.reject(k.error):O&&z.resolve(k.data)},_=()=>{const z=this.#s=k.promise=za();R(z)},L=this.#s;switch(L.status){case"pending":e.queryHash===n.queryHash&&R(L);break;case"fulfilled":(M||k.data!==L.value)&&_();break;case"rejected":(!M||k.error!==L.reason)&&_();break}}return k}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#o=this.#t.state,this.#i=this.options,this.#o.data!==void 0&&(this.#p=this.#t),no(t,e))return;this.#r=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#m.size)return!0;const o=new Set(i??this.#m);return this.options.throwOnError&&o.add("error"),Object.keys(this.#r).some(a=>{const s=a;return this.#r[s]!==e[s]&&o.has(s)})};this.#S({listeners:n()})}#k(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#S(e){Ze.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function uv(e,t){return kt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&kt(t.retryOnMount,e)===!1)}function bc(e,t){return uv(e,t)||e.state.data!==void 0&&Va(e,t,t.refetchOnMount)}function Va(e,t,n){if(kt(t.enabled,e)!==!1&&xn(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&_s(e,t)}return!1}function vc(e,t,n,r){return(e!==t||kt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&_s(e,n)}function _s(e,t){return kt(t.enabled,e)!==!1&&e.isStaleByTime(xn(t.staleTime,e))}function dv(e,t){return!no(e.getCurrentResult(),t)}var fv=class extends rf{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||af(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#o({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=nf({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,a)=>{this.#o({type:"failed",failureCount:o,error:a})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#r.canStart();try{if(r)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#o({type:"pending",context:a,variables:e,isPaused:i})}const o=await this.#r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#o({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#o({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Ze.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function af(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var hv=class extends Or{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new fv({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Ri(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Ri(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ri(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Ri(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ze.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>fc(t,n))}findAll(e={}){return this.getAll().filter(t=>fc(e,t))}notify(e){Ze.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ze.batch(()=>Promise.all(e.map(t=>t.continue().catch(ft))))}};function Ri(e){return e.options.scope?.id}var pv=class extends Or{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),no(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Yn(n.mutationKey)!==Yn(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#o(){const t=this.#n?.state??af();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){Ze.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,n,r,i)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(t.data,null,n,r,i)}catch(o){Promise.reject(o)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,n,r,i)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(void 0,t.error,n,r,i)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},mv=class extends Or{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Ls(r,t);let o=this.get(i);return o||(o=new lv({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ze.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>dc(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>dc(e,n)):t}notify(e){Ze.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ze.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ze.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},gv=class{#e;#t;#n;#r;#o;#i;#s;#a;constructor(e={}){this.#e=e.queryCache||new mv,this.#t=e.mutationCache||new hv,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#s=Is.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=ro.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#s?.(),this.#s=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(xn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,a=Yb(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Ze.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Ze.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Ze.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ze.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(ft).catch(ft)}invalidateQueries(e,t={}){return Ze.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ze.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(ft)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(ft)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(xn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ft).catch(ft)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ft).catch(ft)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ro.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Yn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{si(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(Yn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{si(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ls(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Os&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},sf=g.createContext(void 0),En=e=>{const t=g.useContext(sf);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},yv=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(sf.Provider,{value:e,children:t})),lf=g.createContext(!1),bv=()=>g.useContext(lf);lf.Provider;function vv(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xv=g.createContext(vv()),wv=()=>g.useContext(xv),kv=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Ns(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Sv=e=>{g.useEffect(()=>{e.clearReset()},[e])},Av=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Ns(n,[e.error,r])),Cv=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Ev=(e,t)=>e.isLoading&&e.isFetching&&!t,Rv=(e,t)=>e?.suspense&&t.isPending,xc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Tv(e,t,n){const r=bv(),i=wv(),o=En(),a=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const s=o.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,Cv(a),kv(a,i,s),Sv(i);const c=!o.getQueryCache().get(a.queryHash),[u]=g.useState(()=>new t(o,a)),d=u.getOptimisticResult(a),h=!r&&l;if(g.useSyncExternalStore(g.useCallback(f=>{const m=h?u.subscribe(Ze.batchCalls(f)):ft;return u.updateResult(),m},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),g.useEffect(()=>{u.setOptions(a)},[a,u]),Rv(a,d))throw xc(a,u,i);if(Av({result:d,errorResetBoundary:i,throwOnError:a.throwOnError,query:s,suspense:a.suspense}))throw d.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(a,d),a.experimental_prefetchInRender&&!li.isServer()&&Ev(d,r)&&(c?xc(a,u,i):s?.promise)?.catch(ft).finally(()=>{u.updateResult()}),a.notifyOnChangeProps?d:u.trackResult(d)}function cf(e,t){return Tv(e,cv)}function Rn(e,t){const n=En(),[r]=g.useState(()=>new pv(n,e));g.useEffect(()=>{r.setOptions(e)},[r,e]);const i=g.useSyncExternalStore(g.useCallback(a=>r.subscribe(Ze.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=g.useCallback((a,s)=>{r.mutate(a,s).catch(ft)},[r]);if(i.error&&Ns(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var Pv=e=>{switch(e){case"success":return Ov;case"info":return _v;case"warning":return Nv;case"error":return Dv;default:return null}},Iv=Array(12).fill(0),Lv=({visible:e,className:t})=>W.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},W.createElement("div",{className:"sonner-spinner"},Iv.map((n,r)=>W.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Ov=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Nv=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),_v=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Dv=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Mv=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},W.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),W.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),jv=()=>{let[e,t]=W.useState(document.hidden);return W.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Ka=1,Fv=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Ka++,o=this.toasts.find(s=>s.id===i),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...e,id:i,title:n}),{...s,...e,id:i,dismissible:a,title:n}):s):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,o,a=r.then(async l=>{if(o=["resolve",l],W.isValidElement(l))i=!1,this.create({id:n,type:"default",message:l});else if(Hv(l)&&!l.ok){i=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:u})}else if(t.success!==void 0){i=!1;let c=typeof t.success=="function"?await t.success(l):t.success,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(o=["reject",l],t.error!==void 0){i=!1;let c=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;i&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),s=()=>new Promise((l,c)=>a.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||Ka++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},yt=new Fv,Uv=(e,t)=>{let n=t?.id||Ka++;return yt.addToast({title:e,...t,id:n}),n},Hv=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Bv=Uv,zv=()=>yt.toasts,$v=()=>yt.getActiveToasts(),Je=Object.assign(Bv,{success:yt.success,info:yt.info,warning:yt.warning,error:yt.error,custom:yt.custom,message:yt.message,promise:yt.promise,dismiss:yt.dismiss,loading:yt.loading},{getHistory:zv,getToasts:$v});function Vv(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Vv(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
139
|
-
`);function Ti(e){return e.label!==void 0}var Kv=3,Wv="32px",qv="16px",wc=4e3,Qv=356,Gv=14,Yv=20,Xv=200;function Lt(...e){return e.filter(Boolean).join(" ")}function Jv(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Zv=e=>{var t,n,r,i,o,a,s,l,c,u,d;let{invert:h,toast:f,unstyled:m,interacting:p,setHeights:b,visibleToasts:v,heights:x,index:w,toasts:E,expanded:P,removeToast:C,defaultRichColors:k,closeButton:O,style:M,cancelButtonStyle:R,actionButtonStyle:_,className:L="",descriptionClassName:z="",duration:U,position:$,gap:G,loadingIcon:Y,expandByDefault:V,classNames:F,icons:S,closeButtonAriaLabel:ie="Close toast",pauseWhenPageIsHidden:Z}=e,[A,ae]=W.useState(null),[me,be]=W.useState(null),[q,he]=W.useState(!1),[Pe,xe]=W.useState(!1),[ke,pe]=W.useState(!1),[qe,Xe]=W.useState(!1),[Ut,nt]=W.useState(!1),[Ht,Ln]=W.useState(0),[On,Nn]=W.useState(0),Jt=W.useRef(f.duration||U||wc),ir=W.useRef(null),Tt=W.useRef(null),Pt=w===0,Zt=w+1<=v,D=f.type,B=f.dismissible!==!1,ne=f.className||"",se=f.descriptionClassName||"",Ae=W.useMemo(()=>x.findIndex(ce=>ce.toastId===f.id)||0,[x,f.id]),tt=W.useMemo(()=>{var ce;return(ce=f.closeButton)!=null?ce:O},[f.closeButton,O]),Et=W.useMemo(()=>f.duration||U||wc,[f.duration,U]),Ve=W.useRef(0),dt=W.useRef(0),It=W.useRef(0),ze=W.useRef(null),[Bt,pt]=$.split("-"),_n=W.useMemo(()=>x.reduce((ce,Ie,Ne)=>Ne>=Ae?ce:ce+Ie.height,0),[x,Ae]),Fr=jv(),Ur=f.invert||h,Dn=D==="loading";dt.current=W.useMemo(()=>Ae*G+_n,[Ae,_n]),W.useEffect(()=>{Jt.current=Et},[Et]),W.useEffect(()=>{he(!0)},[]),W.useEffect(()=>{let ce=Tt.current;if(ce){let Ie=ce.getBoundingClientRect().height;return Nn(Ie),b(Ne=>[{toastId:f.id,height:Ie,position:f.position},...Ne]),()=>b(Ne=>Ne.filter(st=>st.toastId!==f.id))}},[b,f.id]),W.useLayoutEffect(()=>{if(!q)return;let ce=Tt.current,Ie=ce.style.height;ce.style.height="auto";let Ne=ce.getBoundingClientRect().height;ce.style.height=Ie,Nn(Ne),b(st=>st.find(vt=>vt.toastId===f.id)?st.map(vt=>vt.toastId===f.id?{...vt,height:Ne}:vt):[{toastId:f.id,height:Ne,position:f.position},...st])},[q,f.title,f.description,b,f.id]);let zt=W.useCallback(()=>{xe(!0),Ln(dt.current),b(ce=>ce.filter(Ie=>Ie.toastId!==f.id)),setTimeout(()=>{C(f)},Xv)},[f,C,b,dt]);W.useEffect(()=>{if(f.promise&&D==="loading"||f.duration===1/0||f.type==="loading")return;let ce;return P||p||Z&&Fr?(()=>{if(It.current<Ve.current){let Ie=new Date().getTime()-Ve.current;Jt.current=Jt.current-Ie}It.current=new Date().getTime()})():Jt.current!==1/0&&(Ve.current=new Date().getTime(),ce=setTimeout(()=>{var Ie;(Ie=f.onAutoClose)==null||Ie.call(f,f),zt()},Jt.current)),()=>clearTimeout(ce)},[P,p,f,D,Z,Fr,zt]),W.useEffect(()=>{f.delete&&zt()},[zt,f.delete]);function ki(){var ce,Ie,Ne;return S!=null&&S.loading?W.createElement("div",{className:Lt(F?.loader,(ce=f?.classNames)==null?void 0:ce.loader,"sonner-loader"),"data-visible":D==="loading"},S.loading):Y?W.createElement("div",{className:Lt(F?.loader,(Ie=f?.classNames)==null?void 0:Ie.loader,"sonner-loader"),"data-visible":D==="loading"},Y):W.createElement(Lv,{className:Lt(F?.loader,(Ne=f?.classNames)==null?void 0:Ne.loader),visible:D==="loading"})}return W.createElement("li",{tabIndex:0,ref:Tt,className:Lt(L,ne,F?.toast,(t=f?.classNames)==null?void 0:t.toast,F?.default,F?.[D],(n=f?.classNames)==null?void 0:n[D]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:k,"data-styled":!(f.jsx||f.unstyled||m),"data-mounted":q,"data-promise":!!f.promise,"data-swiped":Ut,"data-removed":Pe,"data-visible":Zt,"data-y-position":Bt,"data-x-position":pt,"data-index":w,"data-front":Pt,"data-swiping":ke,"data-dismissible":B,"data-type":D,"data-invert":Ur,"data-swipe-out":qe,"data-swipe-direction":me,"data-expanded":!!(P||V&&q),style:{"--index":w,"--toasts-before":w,"--z-index":E.length-w,"--offset":`${Pe?Ht:dt.current}px`,"--initial-height":V?"auto":`${On}px`,...M,...f.style},onDragEnd:()=>{pe(!1),ae(null),ze.current=null},onPointerDown:ce=>{Dn||!B||(ir.current=new Date,Ln(dt.current),ce.target.setPointerCapture(ce.pointerId),ce.target.tagName!=="BUTTON"&&(pe(!0),ze.current={x:ce.clientX,y:ce.clientY}))},onPointerUp:()=>{var ce,Ie,Ne,st;if(qe||!B)return;ze.current=null;let vt=Number(((ce=Tt.current)==null?void 0:ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$t=Number(((Ie=Tt.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),T=new Date().getTime()-((Ne=ir.current)==null?void 0:Ne.getTime()),I=A==="x"?vt:$t,N=Math.abs(I)/T;if(Math.abs(I)>=Yv||N>.11){Ln(dt.current),(st=f.onDismiss)==null||st.call(f,f),be(A==="x"?vt>0?"right":"left":$t>0?"down":"up"),zt(),Xe(!0),nt(!1);return}pe(!1),ae(null)},onPointerMove:ce=>{var Ie,Ne,st,vt;if(!ze.current||!B||((Ie=window.getSelection())==null?void 0:Ie.toString().length)>0)return;let $t=ce.clientY-ze.current.y,T=ce.clientX-ze.current.x,I=(Ne=e.swipeDirections)!=null?Ne:Jv($);!A&&(Math.abs(T)>1||Math.abs($t)>1)&&ae(Math.abs(T)>Math.abs($t)?"x":"y");let N={x:0,y:0};A==="y"?(I.includes("top")||I.includes("bottom"))&&(I.includes("top")&&$t<0||I.includes("bottom")&&$t>0)&&(N.y=$t):A==="x"&&(I.includes("left")||I.includes("right"))&&(I.includes("left")&&T<0||I.includes("right")&&T>0)&&(N.x=T),(Math.abs(N.x)>0||Math.abs(N.y)>0)&&nt(!0),(st=Tt.current)==null||st.style.setProperty("--swipe-amount-x",`${N.x}px`),(vt=Tt.current)==null||vt.style.setProperty("--swipe-amount-y",`${N.y}px`)}},tt&&!f.jsx?W.createElement("button",{"aria-label":ie,"data-disabled":Dn,"data-close-button":!0,onClick:Dn||!B?()=>{}:()=>{var ce;zt(),(ce=f.onDismiss)==null||ce.call(f,f)},className:Lt(F?.closeButton,(i=f?.classNames)==null?void 0:i.closeButton)},(o=S?.close)!=null?o:Mv):null,f.jsx||g.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:W.createElement(W.Fragment,null,D||f.icon||f.promise?W.createElement("div",{"data-icon":"",className:Lt(F?.icon,(a=f?.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||ki():null,f.type!=="loading"?f.icon||S?.[D]||Pv(D):null):null,W.createElement("div",{"data-content":"",className:Lt(F?.content,(s=f?.classNames)==null?void 0:s.content)},W.createElement("div",{"data-title":"",className:Lt(F?.title,(l=f?.classNames)==null?void 0:l.title)},typeof f.title=="function"?f.title():f.title),f.description?W.createElement("div",{"data-description":"",className:Lt(z,se,F?.description,(c=f?.classNames)==null?void 0:c.description)},typeof f.description=="function"?f.description():f.description):null),g.isValidElement(f.cancel)?f.cancel:f.cancel&&Ti(f.cancel)?W.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||R,onClick:ce=>{var Ie,Ne;Ti(f.cancel)&&B&&((Ne=(Ie=f.cancel).onClick)==null||Ne.call(Ie,ce),zt())},className:Lt(F?.cancelButton,(u=f?.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,g.isValidElement(f.action)?f.action:f.action&&Ti(f.action)?W.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||_,onClick:ce=>{var Ie,Ne;Ti(f.action)&&((Ne=(Ie=f.action).onClick)==null||Ne.call(Ie,ce),!ce.defaultPrevented&&zt())},className:Lt(F?.actionButton,(d=f?.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function kc(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function ex(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,a=o?"--mobile-offset":"--offset",s=o?qv:Wv;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=s:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}var tx=g.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:a,className:s,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:h,style:f,visibleToasts:m=Kv,toastOptions:p,dir:b=kc(),gap:v=Gv,loadingIcon:x,icons:w,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:P}=e,[C,k]=W.useState([]),O=W.useMemo(()=>Array.from(new Set([r].concat(C.filter(Z=>Z.position).map(Z=>Z.position)))),[C,r]),[M,R]=W.useState([]),[_,L]=W.useState(!1),[z,U]=W.useState(!1),[$,G]=W.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=W.useRef(null),V=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=W.useRef(null),S=W.useRef(!1),ie=W.useCallback(Z=>{k(A=>{var ae;return(ae=A.find(me=>me.id===Z.id))!=null&&ae.delete||yt.dismiss(Z.id),A.filter(({id:me})=>me!==Z.id)})},[]);return W.useEffect(()=>yt.subscribe(Z=>{if(Z.dismiss){k(A=>A.map(ae=>ae.id===Z.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{xm.flushSync(()=>{k(A=>{let ae=A.findIndex(me=>me.id===Z.id);return ae!==-1?[...A.slice(0,ae),{...A[ae],...Z},...A.slice(ae+1)]:[Z,...A]})})})}),[]),W.useEffect(()=>{if(u!=="system"){G(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;let Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:A})=>{G(A?"dark":"light")})}catch{Z.addListener(({matches:ae})=>{try{G(ae?"dark":"light")}catch(me){console.error(me)}})}},[u]),W.useEffect(()=>{C.length<=1&&L(!1)},[C]),W.useEffect(()=>{let Z=A=>{var ae,me;i.every(be=>A[be]||A.code===be)&&(L(!0),(ae=Y.current)==null||ae.focus()),A.code==="Escape"&&(document.activeElement===Y.current||(me=Y.current)!=null&&me.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[i]),W.useEffect(()=>{if(Y.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,S.current=!1)}},[Y.current]),W.createElement("section",{ref:t,"aria-label":`${E} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((Z,A)=>{var ae;let[me,be]=Z.split("-");return C.length?W.createElement("ol",{key:Z,dir:b==="auto"?kc():b,tabIndex:-1,ref:Y,className:s,"data-sonner-toaster":!0,"data-theme":$,"data-y-position":me,"data-lifted":_&&C.length>1&&!o,"data-x-position":be,style:{"--front-toast-height":`${((ae=M[0])==null?void 0:ae.height)||0}px`,"--width":`${Qv}px`,"--gap":`${v}px`,...f,...ex(l,c)},onBlur:q=>{S.current&&!q.currentTarget.contains(q.relatedTarget)&&(S.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||S.current||(S.current=!0,F.current=q.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{z||L(!1)},onDragEnd:()=>L(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},C.filter(q=>!q.position&&A===0||q.position===Z).map((q,he)=>{var Pe,xe;return W.createElement(Zv,{key:q.id,icons:w,index:he,toast:q,defaultRichColors:d,duration:(Pe=p?.duration)!=null?Pe:h,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:n,visibleToasts:m,closeButton:(xe=p?.closeButton)!=null?xe:a,interacting:z,position:Z,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,removeToast:ie,toasts:C.filter(ke=>ke.position==q.position),heights:M.filter(ke=>ke.position==q.position),setHeights:R,expandByDefault:o,gap:v,loadingIcon:x,expanded:_,pauseWhenPageIsHidden:P,swipeDirections:e.swipeDirections})})):null}))});const uf="agim_token";function nx(e){if(!e)return"";const t=[];for(const[n,r]of Object.entries(e))if(!(r==null||r==="")){if(typeof r=="boolean"){t.push(`${encodeURIComponent(n)}=${r?"1":"0"}`);continue}t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`)}return t.length?`?${t.join("&")}`:""}function rx(){try{return localStorage.getItem(uf)}catch{return null}}async function Qr(e,t,n={}){const r=t+nx(n.query),i={...n.headers??{}},o=rx();o&&!i.Authorization&&(i.Authorization=`Bearer ${o}`);let a;n.body!==void 0&&n.body!==null&&(n.body instanceof FormData||typeof n.body=="string"?a=n.body:(i["Content-Type"]=i["Content-Type"]??"application/json",a=JSON.stringify(n.body)));let s;try{s=await fetch(r,{method:e,headers:i,body:a,credentials:"same-origin",signal:n.signal})}catch(u){const d=u instanceof Error?u.message:String(u);throw new Wa({code:"NETWORK",message:d,status:0})}if(s.status===204)return;const c=(s.headers.get("content-type")||"").includes("application/json");if(!s.ok){let u=`HTTP_${s.status}`,d=s.statusText,h=!1;if(c)try{const p=await s.json();p.error&&(d=p.error),p.code&&(u=p.code,h=!0)}catch{}h||(s.status===401&&(u="AUTH_INVALID"),s.status===403&&(u="FORBIDDEN"),s.status===404&&(u="NOT_FOUND"),s.status===413&&(u="PAYLOAD_TOO_LARGE"));const f=u==="AUTH_ADMIN_REQUIRED"||s.status===403&&d.toLowerCase()==="admin role required";if((s.status===401||f)&&!t.startsWith("/api/auth/")){try{localStorage.removeItem(uf)}catch{}const p=encodeURIComponent(location.pathname+location.search),b=f?"&reason=admin":"";location.pathname.startsWith("/login")||(location.href=`/login?next=${p}${b}`)}throw new Wa({code:u,message:d,status:s.status})}return c?await s.json():await s.text()}class Wa extends Error{code;status;constructor(t){super(t.message),this.name="ApiClientError",this.code=t.code,this.status=t.status}}const K={get:(e,t)=>Qr("GET",e,t),post:(e,t)=>Qr("POST",e,t),put:(e,t)=>Qr("PUT",e,t),patch:(e,t)=>Qr("PATCH",e,t),delete:(e,t)=>Qr("DELETE",e,t)},ix={getA2ARecent:e=>K.get("/api/a2a/recent",{query:e}),getA2AStats:()=>K.get("/api/a2a/stats"),removeAdminAllowlist:e=>K.delete("/api/admin-allowlist",{body:e}),listAdminAllowlist:()=>K.get("/api/admin-allowlist"),addAdminAllowlist:e=>K.post("/api/admin-allowlist",{body:e}),getAgentHealth:e=>K.get("/api/agent-health",e),discoverAcpAgents:e=>K.post("/api/agents/acp/discover",{body:e}),testAcpAgent:e=>K.post("/api/agents/acp/test",{body:e}),testEmail:()=>K.post("/api/messengers/email/test"),getSearchProviders:()=>K.get("/api/search/providers"),testSearchProvider:e=>K.post("/api/search/test",{body:e}),generateMobileQR:e=>K.post("/api/mobile/qr",{body:e??{}}),getAgentsStatus:()=>K.get("/api/agents/status"),listApprovals:()=>K.get("/api/approvals"),resolveApproval:(e,t)=>K.post(`/api/approvals/${encodeURIComponent(e)}/resolve`,{body:t}),getAudit:e=>K.get("/api/audit",{query:e}),login:e=>K.post("/api/auth/login",{body:e}),logout:e=>K.post("/api/auth/logout",e),listBgJobs:e=>K.get("/api/bgjobs",{query:e}),getConfig:()=>K.get("/api/config"),updateConfig:e=>K.put("/api/config",{body:e}),listWorkspacesFull:()=>K.get("/api/workspaces",{query:{full:!0}}),upsertWorkspace:e=>K.post("/api/workspaces",{body:e}),startWechatQr:()=>K.post("/api/messengers/wechat/qr-start"),getWechatQrStatus:e=>K.get("/api/messengers/wechat/qr-status",{query:e}),getEnv:e=>K.get("/api/env",{query:e}),updateEnv:e=>K.put("/api/env",{body:e}),getHealth:e=>K.get("/api/health",e),getHealthSummary:e=>K.get("/api/health/summary",{query:e}),getHealthTopN:e=>K.get("/api/health/topn",{query:e}),invoke:e=>K.post("/api/invoke",e),listJobs:e=>K.get("/api/jobs",{query:e}),createJob:e=>K.post("/api/jobs",{body:e}),batchCancelJobs:e=>K.post("/api/jobs/batch-cancel",{body:e}),batchRunJobs:e=>K.post("/api/jobs/batch-run",{body:e}),submitLoc:e=>K.post("/api/loc",e),getLocInfo:e=>K.get("/api/loc/info",e),consolidateMemory:()=>K.post("/api/memory/consolidate"),getMemoryConsolidateStatus:()=>K.get("/api/memory/consolidate/status"),triggerMemoryDistill:()=>K.post("/api/memory/distill"),getMemoryDistillStatus:()=>K.get("/api/memory/distill/status"),exportMemory:e=>K.get("/api/memory/export",e),deleteMemoryFacts:(e,t)=>K.delete("/api/memory/facts",{query:e,body:t}),deleteMemoryFactById:(e,t)=>K.delete(`/api/memory/facts/${e}`,{query:t}),listMemoryFacts:e=>K.get("/api/memory/facts",{query:e}),deleteMemoryPersona:e=>K.delete("/api/memory/persona",{query:e}),getMemoryPersona:e=>K.get("/api/memory/persona",{query:e}),updateMemoryPersona:(e,t)=>K.put("/api/memory/persona",{query:e,body:t}),listMemoryUsers:()=>K.get("/api/memory/users"),backfillMemoryVector:(e,t)=>K.post("/api/memory/vector/backfill",{query:e,body:t}),clearMemoryVector:e=>K.post("/api/memory/vector/clear",{query:e}),downloadMemoryVector:()=>K.post("/api/memory/vector/download"),getMemoryVectorStatus:e=>K.get("/api/memory/vector/status",{query:e}),testMemoryVector:()=>K.post("/api/memory/vector/test"),listMemos:e=>K.get("/api/memos",{query:e}),deleteMemo:e=>K.delete(`/api/memos/${e}`),getMetrics:e=>K.get("/api/metrics",e),notify:e=>K.post("/api/notify",e),listOutbox:e=>K.get("/api/outbox",{query:e}),getOutboxStats:()=>K.get("/api/outbox/stats"),retryOutbox:e=>K.post(`/api/outbox/${e}/retry`),listReminders:e=>K.get("/api/reminders",{query:e}),cancelReminder:e=>K.post(`/api/reminders/${e}/cancel`),snoozeReminder:(e,t)=>K.post(`/api/reminders/${e}/snooze`,{body:t}),listSchedules:e=>K.get("/api/schedules",{query:e}),restartService:()=>K.post("/api/service/restart"),startService:()=>K.post("/api/service/start"),getServiceStatus:()=>K.get("/api/service/status"),stopService:()=>K.post("/api/service/stop"),listSkills:()=>K.get("/api/skills"),getSkillDetail:e=>K.get(`/api/skills/${encodeURIComponent(e)}`),getSkillsRemoteHot:()=>K.get("/api/skills/remote/hot"),listSubtasks:e=>K.get("/api/subtasks",{query:e}),listViewerPastes:e=>K.get("/api/viewer",e),getViewerTunnel:()=>K.get("/api/viewer/tunnel"),getWorkspaceFiles:e=>K.get("/api/workspace-files",{query:e}),writeWorkspaceFile:(e,t)=>K.put("/api/workspace-files",{query:e,body:t})};function ox(e,t){if(e instanceof Wa){const n=t("errors:UNKNOWN",{code:e.code,detail:e.message,defaultValue:e.message}),r=t(`errors:${e.code}`,{defaultValue:n,detail:e.message});return{code:e.code,message:r}}return e instanceof Error?{code:"UNKNOWN",message:t("errors:UNKNOWN",{code:e.name,defaultValue:e.message})}:{code:"UNKNOWN",message:t("errors:UNKNOWN",{code:"UNKNOWN",defaultValue:String(e)})}}const df=g.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:ve("rounded-lg border border-border bg-surface text-text shadow-sm",e),...t}));df.displayName="Card";const ff=g.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:ve("flex flex-col space-y-1 p-3 sm:p-4",e),...t}));ff.displayName="CardHeader";const hf=g.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:ve("text-md font-semibold leading-tight",e),...t}));hf.displayName="CardTitle";const pf=g.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:ve("text-sm text-text-dim",e),...t}));pf.displayName="CardDescription";const mf=g.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:ve("p-3 pt-0 sm:p-4 sm:pt-0",e),...t}));mf.displayName="CardContent";const gf=g.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:ve("flex items-center p-5 pt-0 sm:p-6 sm:pt-0 gap-2",e),...t}));gf.displayName="CardFooter";const gr=g.forwardRef(({className:e,type:t,...n},r)=>y.jsx("input",{type:t,className:ve("flex h-8 w-full rounded-md border border-border bg-surface","px-3 py-1 text-sm shadow-sm","file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-text-muted","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg","disabled:cursor-not-allowed disabled:opacity-55",e),ref:r,...n}));gr.displayName="Input";var ax=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],De=ax.reduce((e,t)=>{const n=Sr(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sx(e,t){e&&Pr.flushSync(()=>e.dispatchEvent(t))}var lx="Label",yf=g.forwardRef((e,t)=>y.jsx(De.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));yf.displayName=lx;var bf=yf;const cx=Ts("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),zn=g.forwardRef(({className:e,...t},n)=>y.jsx(bf,{ref:n,className:ve(cx(),e),...t}));zn.displayName=bf.displayName;function ux(e){if(!e)return"/";try{const t=decodeURIComponent(e);if(t.startsWith("/")&&!t.startsWith("//"))return t}catch{}return"/"}function dx(){const{t:e}=at(),t=Eo(),[n]=fy(),r=Rs(d=>d.setToken),[i,o]=g.useState(""),a=ux(n.get("next")),l=n.get("reason")==="admin",c=Rn({mutationFn:d=>ix.login({token:d}),onSuccess:()=>{r(i.trim()),Je.success(e("states.saved")),t(a,{replace:!0})},onError:d=>{const{message:h}=ox(d,e);Je.error(h)}});function u(d){d.preventDefault();const h=i.trim();h&&c.mutate(h)}return y.jsx("div",{className:"grid min-h-dvh place-items-center bg-bg px-4 py-8 pt-safe",children:y.jsxs(df,{className:"w-full max-w-md",children:[y.jsxs(ff,{children:[y.jsxs(hf,{className:"text-xl",children:[y.jsx("span",{className:"mr-2",children:"🤖"}),e("appName")]}),y.jsx(pf,{children:e("login.intro",{defaultValue:"Paste your access token from `agim token bootstrap` (first boot) or `agim token create`."})})]}),y.jsxs(mf,{children:[l&&y.jsx("p",{className:"mb-3 rounded-md border border-warning/40 bg-warning-bg/50 px-3 py-2 text-sm text-warning",children:e("login.adminRequired",{defaultValue:"Current token has no admin permission. Please sign in with an admin token."})}),y.jsxs("form",{onSubmit:u,className:"flex flex-col gap-4",children:[y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(zn,{htmlFor:"token",children:e("login.tokenLabel",{defaultValue:"Access token"})}),y.jsx(gr,{id:"token",type:"password",value:i,onChange:d=>o(d.target.value),placeholder:"agim_••••••••",autoComplete:"off",autoFocus:!0,required:!0})]}),y.jsx(et,{type:"submit",size:"lg",disabled:c.isPending||i.trim().length===0,children:c.isPending?e("states.loading"):e("login.submit",{defaultValue:"Sign in"})})]})]}),y.jsx(gf,{className:"block text-xs text-text-muted",children:e("login.hint",{defaultValue:"Loopback (127.0.0.1) requests bypass this check; you only see this page when accessing agim from another host or with IMHUB_TRUST_LOOPBACK=off."})})]})})}const Sc=[1e3,2e3,5e3,1e4,3e4];function fx(e){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}${e}`}let Gr=null;function hx(){if(Gr)return Gr;let e=null,t="connecting",n=0,r=null,i=!1;const o=new Set;function a(b){t=b;for(const v of o)v.type==="status"&&v.fn(b)}function s(b){for(const v of o)v.type==="message"&&v.fn(b)}function l(){r!=null&&(clearTimeout(r),r=null)}function c(){if(i)return;l();const b=Sc[Math.min(n,Sc.length-1)]??3e4;n+=1,r=setTimeout(()=>u(),b)}function u(){l(),a("connecting");try{e=new WebSocket(fx("/ws"))}catch(b){a("error"),console.warn("[ws] construct failed",b),c();return}e.addEventListener("open",()=>{n=0,a("open")}),e.addEventListener("message",b=>{let v;try{v=JSON.parse(b.data)}catch{console.warn("[ws] bad json",b.data?.slice?.(0,200));return}s(v)}),e.addEventListener("close",()=>{a("closed"),i||c()}),e.addEventListener("error",()=>{a("error")})}function d(b){if(!e||e.readyState!==WebSocket.OPEN)return!1;try{return e.send(JSON.stringify(b)),!0}catch{return!1}}function h(b){return o.add(b),b.type==="status"&&b.fn(t),()=>{o.delete(b)}}function f(){i=!0,l();try{e?.close()}catch{}e=null,Gr=null}function m(){document.visibilityState==="visible"&&(!e||e.readyState===WebSocket.CLOSED)&&(n=0,u())}function p(){n=0,(!e||e.readyState!==WebSocket.OPEN)&&u()}return document.addEventListener("visibilitychange",m),window.addEventListener("online",p),u(),Gr={send:d,subscribe:h,status:()=>t,close:()=>{document.removeEventListener("visibilitychange",m),window.removeEventListener("online",p),f()}},Gr}const de=e=>typeof e=="string",Yr=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},Ac=e=>e==null?"":""+e,px=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},mx=/###/g,Cc=e=>e&&e.indexOf("###")>-1?e.replace(mx,"."):e,Ec=e=>!e||de(e),ti=(e,t,n)=>{const r=de(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(Ec(e))return{};const o=Cc(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return Ec(e)?{}:{obj:e,k:Cc(r[i])}},Rc=(e,t,n)=>{const{obj:r,k:i}=ti(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=ti(e,a,Object);for(;s.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=ti(e,a,Object),s?.obj&&typeof s.obj[`${s.k}.${o}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},gx=(e,t,n,r)=>{const{obj:i,k:o}=ti(e,t,Object);i[o]=i[o]||[],i[o].push(n)},io=(e,t)=>{const{obj:n,k:r}=ti(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},yx=(e,t,n)=>{const r=io(e,n);return r!==void 0?r:io(t,n)},vf=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?de(e[r])||e[r]instanceof String||de(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):vf(e[r],t[r],n):e[r]=t[r]);return e},cr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var bx={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const vx=e=>de(e)?e.replace(/[&<>"'\/]/g,t=>bx[t]):e;class xx{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const wx=[" ",",","?","!",";"],kx=new xx(20),Sx=(e,t,n)=>{t=t||"",n=n||"";const r=wx.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=kx.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o},qa=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let a,s="";for(let l=o;l<r.length;++l)if(l!==o&&(s+=n),s+=r[l],a=i[s],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<r.length-1)continue;o+=l-o+1;break}i=a}return i},oo=e=>e?.replace("_","-"),Ax={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class ao{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||Ax,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(de(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new ao(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new ao(this.logger,t)}}var qt=new ao;class To{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(a=>{let[s,l]=a;for(let c=0;c<l;c++)s(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[s,l]=a;for(let c=0;c<l;c++)s.apply(s,[t,...r])})}}class Tc extends To{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,n],r&&(Array.isArray(r)?s.push(...r):de(r)&&o?s.push(...r.split(o)):s.push(r)));const l=io(this.data,s);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=s[0],n=s[1],r=s.slice(2).join(".")),l||!a||!de(r)?l:qa(this.data?.[t]?.[n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),i=n,n=s[1]),this.addNamespaces(n),Rc(this.data,s,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(de(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let l=io(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?vf(l,r,o):l={...l,...r},Rc(this.data,s,l),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var xf={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{t=this.processors[o]?.process(t,n,r,i)??t}),t}};const Pc={},Ic=e=>!de(e)&&typeof e!="boolean"&&typeof e!="number";class so extends To{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),px(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=qt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return t==null?!1:this.resolve(t,n)?.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Sx(t,r,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:de(o)?[o]:o};const c=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(i)}return{key:t,namespaces:de(o)?[o]:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],n),l=s[s.length-1],c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode"){if(u){const _=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${_}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${_}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a}const d=this.resolve(t,n);let h=d?.res;const f=d?.usedKey||a,m=d?.exactUsedKey||a,p=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,x=n.count!==void 0&&!de(n.count),w=so.hasDefaultValue(n),E=x?this.pluralResolver.getSuffix(c,n.count,n):"",P=n.ordinal&&x?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",C=x&&!n.ordinal&&n.count===0,k=C&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${E}`]||n[`defaultValue${P}`]||n.defaultValue;let O=h;v&&!h&&w&&(O=k);const M=Ic(O),R=Object.prototype.toString.apply(O);if(v&&O&&M&&p.indexOf(R)<0&&!(de(b)&&Array.isArray(O))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,O,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(d.res=_,d.usedParams=this.getUsedParamsDetails(n),d):_}if(o){const _=Array.isArray(O),L=_?[]:{},z=_?m:f;for(const U in O)if(Object.prototype.hasOwnProperty.call(O,U)){const $=`${z}${o}${U}`;w&&!h?L[U]=this.translate($,{...n,defaultValue:Ic(k)?k[U]:void 0,joinArrays:!1,ns:s}):L[U]=this.translate($,{...n,joinArrays:!1,ns:s}),L[U]===$&&(L[U]=O[U])}h=L}}else if(v&&de(b)&&Array.isArray(h))h=h.join(b),h&&(h=this.extendTranslation(h,t,n,r));else{let _=!1,L=!1;!this.isValidLookup(h)&&w&&(_=!0,h=k),this.isValidLookup(h)||(L=!0,h=a);const U=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:h,$=w&&k!==h&&this.options.updateMissing;if(L||_||$){if(this.logger.log($?"updateKey":"missingKey",c,l,a,$?k:h),o){const F=this.resolve(a,{...n,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let G=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let F=0;F<Y.length;F++)G.push(Y[F]);else this.options.saveMissingTo==="all"?G=this.languageUtils.toResolveHierarchy(n.lng||this.language):G.push(n.lng||this.language);const V=(F,S,ie)=>{const Z=w&&ie!==h?ie:U;this.options.missingKeyHandler?this.options.missingKeyHandler(F,l,S,Z,$,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(F,l,S,Z,$,n),this.emit("missingKey",F,l,S,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?G.forEach(F=>{const S=this.pluralResolver.getSuffixes(F,n);C&&n[`defaultValue${this.options.pluralSeparator}zero`]&&S.indexOf(`${this.options.pluralSeparator}zero`)<0&&S.push(`${this.options.pluralSeparator}zero`),S.forEach(ie=>{V([F],a+ie,n[`defaultValue${ie}`]||k)})}):V(G,a,k))}h=this.extendTranslation(h,t,n,d,r),L&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${l}:${a}`),(L||_)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,_?h:void 0))}return i?(d.res=h,d.usedParams=this.getUsedParamsDetails(n),d):h}extendTranslation(t,n,r,i,o){var a=this;if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=de(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const h=t.match(this.interpolator.nestingRegexp);u=h&&h.length}let d=r.replace&&!de(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language||i.usedLng,r),c){const h=t.match(this.interpolator.nestingRegexp),f=h&&h.length;u<f&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var h=arguments.length,f=new Array(h),m=0;m<h;m++)f[m]=arguments[m];return o?.[0]===f[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${n[0]}`),null):a.translate(...f,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=de(s)?[s]:s;return t!=null&&l?.length&&r.applyPostProcessor!==!1&&(t=xf.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,a,s;return de(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;i=u;let d=c.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const h=n.count!==void 0&&!de(n.count),f=h&&!n.ordinal&&n.count===0,m=n.context!==void 0&&(de(n.context)||typeof n.context=="number")&&n.context!=="",p=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(b=>{this.isValidLookup(r)||(s=b,!Pc[`${p[0]}-${b}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(Pc[`${p[0]}-${b}`]=!0,this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(v=>{if(this.isValidLookup(r))return;a=v;const x=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(x,u,v,b,n);else{let E;h&&(E=this.pluralResolver.getSuffix(v,n.count,n));const P=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(x.push(u+E),n.ordinal&&E.indexOf(C)===0&&x.push(u+E.replace(C,this.options.pluralSeparator)),f&&x.push(u+P)),m){const k=`${u}${this.options.contextSeparator}${n.context}`;x.push(k),h&&(x.push(k+E),n.ordinal&&E.indexOf(C)===0&&x.push(k+E.replace(C,this.options.pluralSeparator)),f&&x.push(k+P))}}let w;for(;w=x.pop();)this.isValidLookup(r)||(o=w,r=this.getResource(v,b,w,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!de(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class Lc{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=qt.create("languageUtils")}getScriptPartFromCode(t){if(t=oo(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=oo(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(de(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),de(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return de(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):de(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}const Oc={zero:0,one:1,two:2,few:3,many:4,other:5},Nc={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Cx{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=qt.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=oo(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Nc;if(!t.match(/-|_/))return Nc;const l=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(l,n)}return this.pluralRulesCache[o]=a,a}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>Oc[i]-Oc[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const _c=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=yx(e,t,n);return!o&&i&&de(n)&&(o=qa(e,n,r),o===void 0&&(o=qa(t,n,r))),o},na=e=>e.replace(/\$/g,"$$$$");class Ex{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=qt.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:a,suffix:s,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:d,nestingPrefix:h,nestingPrefixEscaped:f,nestingSuffix:m,nestingSuffixEscaped:p,nestingOptionsSeparator:b,maxReplaces:v,alwaysFormat:x}=t.interpolation;this.escape=n!==void 0?n:vx,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?cr(o):a||"{{",this.suffix=s?cr(s):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=h?cr(h):f||cr("$t("),this.nestingSuffix=m?cr(m):p||cr(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=v||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,i){let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=f=>{if(f.indexOf(this.formatSeparator)<0){const v=_c(n,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,r,{...i,...n,interpolationkey:f}):v}const m=f.split(this.formatSeparator),p=m.shift().trim(),b=m.join(this.formatSeparator).trim();return this.format(_c(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...i,...n,interpolationkey:p})};this.resetRegExp();const u=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>na(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?na(this.escape(f)):na(f)}].forEach(f=>{for(s=0;o=f.regex.exec(t);){const m=o[1].trim();if(a=c(m),a===void 0)if(typeof u=="function"){const b=u(t,o,i);a=de(b)?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))a="";else if(d){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),a="";else!de(a)&&!this.useRawValueToEscape&&(a=Ac(a));const p=f.safeValue(a);if(t=t.replace(o[0],p),d?(f.regex.lastIndex+=a.length,f.regex.lastIndex-=o[0].length):f.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;const s=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const d=l.split(new RegExp(`${u}[ ]*{`));let h=`{${d[1]}`;l=d[0],h=this.interpolate(h,a);const f=h.match(/'/g),m=h.match(/"/g);((f?.length??0)%2===0&&!m||m.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),c&&(a={...c,...a})}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,p),`${l}${u}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;i=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&!de(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const u=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=u.shift(),l=u,c=!0}if(o=n(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&!de(o))return o;de(o)||(o=Ac(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),c&&(o=l.reduce((u,d)=>this.format(u,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const Rx=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(a){const[s,...l]=a.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=s.trim();n[u]||(n[u]=c),c==="false"&&(n[u]=!1),c==="true"&&(n[u]=!0),isNaN(c)||(n[u]=parseInt(c,10))}})}return{formatName:t,formatOptions:n}},ur=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let s=t[a];return s||(s=e(oo(r),i),t[a]=s),s(n)}};class Tx{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=qt.create("formatter"),this.options=t,this.formats={number:ur((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:ur((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:ur((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:ur((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:ur((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=ur(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(s=>s.indexOf(")")>-1)){const s=o.findIndex(l=>l.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,s)].join(this.formatSeparator)}return o.reduce((s,l)=>{const{formatName:c,formatOptions:u}=Rx(l);if(this.formats[c]){let d=s;try{const h=i?.formatParams?.[i.interpolationkey]||{},f=h.locale||h.lng||i.locale||i.lng||r;d=this.formats[c](s,f,{...u,...i,...h})}catch(h){this.logger.warn(h)}return d}else this.logger.warn(`there was no format function for ${c}`);return s},t)}}const Px=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Ix extends To{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=qt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},s={},l={};return t.forEach(c=>{let u=!0;n.forEach(d=>{const h=`${c}|${d}`;!r.reload&&this.store.hasResourceBundle(c,d)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,u=!1,a[h]===void 0&&(a[h]=!0),o[h]===void 0&&(o[h]=!0),l[d]===void 0&&(l[d]=!0)))}),u||(s[c]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const s={};this.queue.forEach(l=>{gx(l.loaded,[o],a),Px(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const u=l.loaded[c];u.length&&u.forEach(d=>{s[c][d]===void 0&&(s[c][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&u&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(t,n);c&&typeof c.then=="function"?c.then(u=>s(null,u)).catch(s):s(null,c)}catch(c){s(c)}return}return l(t,n,s)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();de(t)&&(t=this.languageUtils.toResolveHierarchy(t)),de(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const l={...a,isUpdate:o},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(t,n,r,i,l):u=c(t,n,r,i),u&&typeof u.then=="function"?u.then(d=>s(null,d)).catch(s):s(null,u)}catch(u){s(u)}else c(t,n,r,i,s,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const Dc=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),de(e[1])&&(t.defaultValue=e[1]),de(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Mc=e=>(de(e.ns)&&(e.ns=[e.ns]),de(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),de(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Pi=()=>{},Lx=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class ci extends To{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Mc(t),this.services={},this.logger=qt,this.modules={external:[]},Lx(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(de(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=Dc();this.options={...i,...this.options,...Mc(n)},this.options.interpolation={...i.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?qt.init(o(this.modules.logger),this.options):qt.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=Tx;const d=new Lc(this.options);this.store=new Tc(this.options.resources,this.options);const h=this.services;h.logger=qt,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new Cx(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(h.formatter=o(u),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new Ex(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new Ix(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(f){for(var m=arguments.length,p=new Array(m>1?m-1:0),b=1;b<m;b++)p[b-1]=arguments[b];t.emit(f,...p)}),this.modules.languageDetector&&(h.languageDetector=o(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=o(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new so(this.services,this.options),this.translator.on("*",function(f){for(var m=arguments.length,p=new Array(m>1?m-1:0),b=1;b<m;b++)p[b-1]=arguments[b];t.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Pi),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return t.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return t.store[u](...arguments),t}});const l=Yr(),c=()=>{const u=(d,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(h),r(d,h)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pi;const i=de(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(c=>{c!=="cimode"&&o.indexOf(c)<0&&o.push(c)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload?.forEach?.(s=>a(s)),this.services.backendConnector.load(o,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(s)})}else r(null)}reloadResources(t,n,r){const i=Yr();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Pi),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&xf.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=Yr();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,c)=>{c?(o(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=de(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,u=>{a(u,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,n,r){var i=this;const o=function(a,s){let l;if(typeof s!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),d=2;d<c;d++)u[d-2]=arguments[d];l=i.options.overloadTranslationOptionHandler([a,s].concat(u))}else l={...s};l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||o.keyPrefix);const h=i.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(a)?f=a.map(m=>`${l.keyPrefix}${h}${m}`):f=l.keyPrefix?`${l.keyPrefix}${h}${a}`:a,i.t(f,l)};return de(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.translate(...n)}exists(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.exists(...n)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=Yr();return this.options.ns?(de(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Yr();de(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new Lc(Dc());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new ci(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pi;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new ci(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const s=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},Object.keys(l[c]).reduce((u,d)=>(u[d]={...l[c][d]},u),{})),{});o.store=new Tc(s,i),o.services.resourceStore=o.store}return o.translator=new so(o.services,i),o.translator.on("*",function(s){for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];o.emit(s,...c)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const He=ci.createInstance();He.createInstance=ci.createInstance;He.createInstance;He.dir;He.init;He.loadResources;He.reloadResources;He.use;He.changeLanguage;He.getFixedT;He.t;He.exists;He.setDefaultNamespace;He.hasLoadedNamespace;He.loadNamespaces;He.loadLanguages;function Ox(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Nx(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
140
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function Nx(e,t){if(e){if(typeof e=="string")return jc(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jc(e,t):void 0}}function jc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Qa(e){"@babel/helpers - typeof";return Qa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qa(e)}var wf=["__proto__","constructor","prototype"];function kf(e){return!(typeof e!="string"||e.length===0||e.length>128||wf.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function Sf(e){return!(!kf(e)||e.indexOf("/")>-1)}function _x(e){return kf(e)}var Dx={lng:Sf,ns:_x};function Ii(e){return typeof e!="string"?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function Mx(e){if(typeof e!="string"||e.length===0)return e;try{var t=new URL(e);return t.username||t.password?(t.username="",t.password="",t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function Af(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Qa(XMLHttpRequest))==="object"}function jx(e){return!!e&&typeof e.then=="function"}function Fx(e){return jx(e)?e:Promise.resolve(e)}var Ux=/\{\{(.+?)\}\}/g;function Fc(e,t){var n=!1,r=e.replace(Ux,function(i,o){var a=o.trim();if(wf.indexOf(a)>-1)return i;var s=t[a];if(s==null)return i;var l=Dx[a]||Sf,c=String(s).split("+"),u=Ox(c),d;try{for(u.s();!(d=u.n()).done;){var h=d.value;if(!l(h))return n=!0,i}}catch(f){u.e(f)}finally{u.f()}return c.join("+")});return n?null:r}function Uc(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 Hc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Uc(Object(n),!0).forEach(function(r){Hx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hx(e,t,n){return(t=Bx(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bx(e){var t=zx(e,"string");return Xn(t)=="symbol"?t:t+""}function zx(e,t){if(Xn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xn(e){"@babel/helpers - typeof";return Xn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xn(e)}var wn=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?wn=global.fetch:typeof window<"u"&&window.fetch&&(wn=window.fetch);var ui;Af()&&(typeof global<"u"&&global.XMLHttpRequest?ui=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(ui=window.XMLHttpRequest));var lo;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?lo=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(lo=window.ActiveXObject));typeof wn!="function"&&(wn=void 0);if(!wn&&!ui&&!lo)try{fe(()=>import("./browser-ponyfill-DBWdeCTC.js").then(e=>e.b),__vite__mapDeps([0,1])).then(function(e){wn=e.default}).catch(function(){})}catch{}var Cf=["__proto__","constructor","prototype"],Ga=function(t,n){if(n&&Xn(n)==="object"){for(var r="",i=0,o=Object.keys(n);i<o.length;i++){var a=o[i];Cf.indexOf(a)>-1||(r+="&"+encodeURIComponent(a)+"="+encodeURIComponent(n[a]))}if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},Bc=function(t,n,r,i){var o=function(l){if(!l.ok)return r(l.statusText||"Error",{status:l.status});l.text().then(function(c){r(null,{status:l.status,data:c})}).catch(r)};if(i){var a=i(t,n);if(a instanceof Promise){a.then(o).catch(r);return}}typeof fetch=="function"?fetch(t,n).then(o).catch(r):wn(t,n).then(o).catch(r)},$x=function(t,n,r,i){t.queryStringParams&&(n=Ga(n,t.queryStringParams));var o=Hc({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=Hc({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},t._omitFetchOptions?{}:a),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{Bc(n,s,i,l)}catch(c){if(!a||Object.keys(a).length===0||!c.message||c.message.indexOf("not implemented")<0)return i(c);try{Object.keys(a).forEach(function(u){delete s[u]}),Bc(n,s,i,l),t._omitFetchOptions=!0}catch(u){i(u)}}},Vx=function(t,n,r,i){r&&Xn(r)==="object"&&(r=Ga("",r).slice(1)),t.queryStringParams&&(n=Ga(n,t.queryStringParams));try{var o=ui?new ui:new lo("MSXML2.XMLHTTP.3.0");o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s=0,l=Object.keys(a);s<l.length;s++){var c=l[s];Cf.indexOf(c)>-1||o.setRequestHeader(c,a[c])}o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(u){console&&console.log(u)}},Kx=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},wn&&n.indexOf("file:")!==0)return $x(t,n,r,i);if(Af()||typeof ActiveXObject=="function")return Vx(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function Ar(e){"@babel/helpers - typeof";return Ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ar(e)}function zc(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 ra(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zc(Object(n),!0).forEach(function(r){Ef(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wx(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qx(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rf(r.key),r)}}function Qx(e,t,n){return t&&qx(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ef(e,t,n){return(t=Rf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rf(e){var t=Gx(e,"string");return Ar(t)=="symbol"?t:t+""}function Gx(e,t){if(Ar(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ar(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Yx=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return Ef({},r,i||"")},parseLoadPayload:function(n,r){},request:Kx,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Tf=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Wx(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return Qx(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=ra(ra(ra({},Yx()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);Ar(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=Fx(l),l.then(function(c){if(!c)return a(null,{});var u=Fc(c,{lng:n.join("+"),ns:i.join("+")});if(u==null){var d=n.map(Ii).join(", "),h=i.map(Ii).join(", ");return a(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+d+"] namespaces=["+h+"]"),!1)}s.loadUrl(u,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this,s=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,c=this.options.parseLoadPayload(s,l),u=Ii(Mx(n));this.options.request(this.options,n,c,function(d,h){if(h&&(h.status>=500&&h.status<600||!h.status))return r("failed loading "+u+"; status code: "+h.status,!0);if(h&&h.status>=400&&h.status<500)return r("failed loading "+u+"; status code: "+h.status,!1);if(!h&&d&&d.message){var f=d.message.toLowerCase(),m=["failed","fetch","network","load"].find(function(v){return f.indexOf(v)>-1});if(m)return r("failed loading "+u+": "+Ii(d.message),!0)}if(d)return r(d,!1);var p,b;try{typeof h.data=="string"?p=a.options.parse(h.data,i,o):p=h.data}catch{b="failed parsing "+u+" to json"}if(b)return r(b,!1);r(null,p)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),c=0,u=[],d=[];n.forEach(function(h){var f=s.options.addPath;typeof s.options.addPath=="function"&&(f=s.options.addPath(h,r));var m=Fc(f,{lng:h,ns:r});if(m==null){c+=1,a&&c===n.length&&a(u,d);return}s.options.request(s.options,m,l,function(p,b){c+=1,u.push(p),d.push(b),c===n.length&&typeof a=="function"&&a(u,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],c=function(d){var h=o.toResolveHierarchy(d);h.forEach(function(f){l.indexOf(f)<0&&l.push(f)})};c(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(u){return c(u)}),l.forEach(function(u){n.allOptions.ns.forEach(function(d){i.read(u,d,"read",null,null,function(h,f){h&&a.warn("loading namespace ".concat(d," for language ").concat(u," failed"),h),!h&&f&&a.log("loaded namespace ".concat(d," for language ").concat(u),f),i.loaded("".concat(u,"|").concat(d),h,f)})})})}}}])}();Tf.type="backend";const Xx="Agim",Jx={refresh:"Refresh",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",submit:"Submit",close:"Close",back:"Back",next:"Next",previous:"Previous",create:"Create",search:"Search",retry:"Retry",confirm:"Confirm"},Zx={loading:"Loading…",empty:"No data",saving:"Saving…",saved:"Saved",error:"Something went wrong"},ew={label:"Theme",system:"System",light:"Light",dark:"Dark",cycleHint:"Click to cycle theme"},tw={label:"Language",en:"English",zh:"中文"},nw={chat:"Chat",tasks:"Tasks",approvals:"Approvals",reminders:"Reminders",memos:"Memos",memory:"Memory",skills:"Skills",workspace:"Workspace",observability:"Observability",settings:"Settings"},rw={deleteTitle:"Delete this item?",deleteDescription:"This cannot be undone.",destructiveAction:"Delete"},iw={label:"Pagination",perPage:"Per page",firstPage:"First page",lastPage:"Last page",pageOfTotal:"Page {{page}} of {{totalPages}}",range:"{{from}}–{{to}} of {{total}}"},ow={selectAll:"Select all rows",selectRow:"Select row"},aw={intro:"Paste your access token from `agim token bootstrap` (first boot) or `agim token create`.",tokenLabel:"Access token",submit:"Sign in",adminRequired:"Current token has no admin permission. Please sign in with an admin token.",hint:"Loopback (127.0.0.1) requests bypass this page; you only land here from another host or with IMHUB_TRUST_LOOPBACK=off."},sw={placeholder:"Signed in. Open Chat from the sidebar.",healthCheck:"Backend reachable"},lw={title:"Nothing here.",description:"The page you're looking for doesn't exist."},cw={title:"Something went wrong.",description:"An unexpected error broke the page render. Try reloading or heading back to the home screen; if it persists, copy the message below and report it.",reload:"Reload",home:"Home"},uw={mobileTitle:"agim chat",menu:"Menu",back:"Back",logout:"Log out",agent:"Agent",scrollDown:"Scroll to bottom",send:"Send",streaming:"… streaming",running:"Running",status:{open:"Connected",connecting:"Connecting…",closed:"Disconnected",error:"Error"},notConnected:"Not connected. Reconnecting…",notConnectedRetry:"Not connected. Reconnecting — try again in a moment.",connecting:"Connecting to agim…",disconnected:"Disconnected. Reconnecting automatically; you can keep typing.",welcomeTitle:"Start a conversation",welcomeBody:"Type a message to ask the active agent. Use the agent dropdown to switch.",welcomeBodyMobile:"Type a message below. Switch agent or start over from the menu.",inputPlaceholder:"Message… (Enter sends, Shift+Enter newlines)",inputPlaceholderMobile:"Message…",mobileHint:"Enter creates new lines, tap Send to submit.",activity:"Activity",activityTitle:"Run activity",activityEmpty:"No recent runs yet.",llmSettings:"Agim Agent settings",nativeSetupRequired:"Agim Agent is not configured. Open /settings/llm to add a usable model API (role bindings are optional).",nativeSetupAction:"Configure now",nativeSetupDialogTitle:"Configure model API for Agim Agent",nativeSetupDialogDesc:"Agim Agent works as soon as one model API with a valid API key is configured. Role Bindings are optional advanced wiring.",nativeSetupDialogReason:"Most recent error",nativeSetupDialogRoleOptional:"Role Bindings are optional and do not block Agim Agent usage.",nativeSetupDialogSave:"Save and enable agim",nativeSetupDialogCancel:"Later",nativeSetupDialogAdvanced:"Open full model API settings",nativeSetupApiKeyRequired:"API key is required",nativeSetupSaved:"Model API saved. Retrying agim switch…",pendingApprovals:"Pending approvals",quickPrompt:{plan:"Draft a plan first",risks:"List risks and rollback steps",summary:"Write an executive summary"},newConv:"New",newConvHint:"Clear messages and start a fresh session",newConvToast:"Started a new conversation",switchAgentConfirm:"Switch to agent “{{agent}}”?",copy:"Copy",copied:"Copied",copyMarkdown:"Copy Markdown",copyFailed:"Copy failed",approvalTitle:"🔐 Tool approval",approvalAutoBadge:"auto-allow",approvalAutoIn:"Auto-allowing in {{count}}s — Deny to stop.",approvalAutoResolving:"Auto-allowing now…",approvalToolLabel:"Tool",approvalInputLabel:"Input",approvalAllow:"Allow",approvalAuto:"Auto for similar",approvalAutoTip:"Allow and auto-allow similar calls for the rest of the session",approvalDeny:"Deny",approvalSubmitting:"Sent — waiting for result…",askTitle:"🤔 Please choose",askMultiHint:"Pick {{min}}–{{max}}",askSubmit:"Submit",askCustomPlaceholder:"Custom answer…",askResolved:"✅ Answered",outcome:{allowed:"✅ Allowed",allowedPinned:"✅ Allowed + auto-allow further",denied:"❌ Denied",deniedRevoked:"❌ Denied (auto-allow revoked)",expired:"⏱ Timed out"}},dw={appName:Xx,actions:Jx,states:Zx,theme:ew,lang:tw,nav:nw,confirm:rw,pagination:iw,table:ow,login:aw,home:sw,notFound:lw,errorBoundary:cw,chat:uw},fw="Agim",hw={refresh:"刷新",save:"保存",cancel:"取消",delete:"删除",edit:"编辑",submit:"提交",close:"关闭",back:"返回",next:"下一页",previous:"上一页",create:"新建",search:"搜索",retry:"重试",confirm:"确定"},pw={loading:"加载中…",empty:"暂无数据",saving:"保存中…",saved:"已保存",error:"出错了"},mw={label:"主题",system:"跟随系统",light:"浅色",dark:"深色",cycleHint:"点击切换主题"},gw={label:"语言",en:"English",zh:"中文"},yw={chat:"对话",tasks:"任务",approvals:"审批",reminders:"提醒",memos:"备忘",memory:"记忆",skills:"技能",workspace:"工作区",observability:"观测",settings:"设置"},bw={deleteTitle:"确认删除?",deleteDescription:"操作不可撤销。",destructiveAction:"删除"},vw={label:"分页",perPage:"每页",firstPage:"首页",lastPage:"末页",pageOfTotal:"第 {{page}} / {{totalPages}} 页",range:"{{from}}–{{to}} / 共 {{total}}"},xw={selectAll:"全选",selectRow:"选中此行"},ww={intro:"粘贴访问令牌:首次部署可运行 `agim token bootstrap`,后续可用 `agim token create` 生成。",tokenLabel:"访问令牌",submit:"登录",adminRequired:"当前 token 没有管理权限,请使用管理员 token 重新登录。",hint:"loopback(127.0.0.1)的请求会跳过此页;只有跨机访问或设置了 IMHUB_TRUST_LOOPBACK=off 时才会看到此页。"},kw={placeholder:"已登录,请从侧栏进入对话。",healthCheck:"后端可达"},Sw={title:"什么也没找到。",description:"你要找的页面不存在。"},Aw={title:"出错了。",description:"页面渲染过程中遇到了未预期的错误。可以尝试刷新或返回主页;若问题反复出现,请复制下方错误信息反馈。",reload:"刷新",home:"返回主页"},Cw={mobileTitle:"agim 对话",menu:"菜单",back:"返回",logout:"退出登录",agent:"Agent",scrollDown:"回到底部",send:"发送",streaming:"… 接收中",running:"处理中",status:{open:"已连接",connecting:"连接中…",closed:"已断开",error:"连接异常"},notConnected:"未连接,正在重连…",notConnectedRetry:"未连接,正在重连,请稍后重试。",connecting:"正在连接 agim…",disconnected:"已断开,自动重连中;可以继续输入。",welcomeTitle:"开始对话",welcomeBody:"输入消息向当前 Agent 提问。点上方下拉可切换 Agent。",welcomeBodyMobile:"在下方输入消息,或从菜单切换 Agent、开启新对话。",inputPlaceholder:"输入消息……(Enter 发送,Shift+Enter 换行)",inputPlaceholderMobile:"输入消息…",mobileHint:"Enter 换行,点击发送提交。",activity:"运行动态",activityTitle:"运行动态",activityEmpty:"暂无运行记录。",llmSettings:"Agim Agent 配置",nativeSetupRequired:"Agim Agent 未配置。请先在 /settings/llm 配置一个可用模型 API(角色绑定可选)。",nativeSetupAction:"去配置",nativeSetupDialogTitle:"配置 Agim Agent 所需大模型 API",nativeSetupDialogDesc:"只要配置一个可用且含 API Key 的大模型 API,agim 就可以使用。角色绑定属于可选高级配置。",nativeSetupDialogReason:"最近一次错误信息",nativeSetupDialogRoleOptional:"角色绑定是可选增强项,不配置也不会阻塞 Agim Agent。",nativeSetupDialogSave:"保存并启用 agim",nativeSetupDialogCancel:"稍后再配",nativeSetupDialogAdvanced:"打开完整大模型API设置页",nativeSetupApiKeyRequired:"请填写 API Key",nativeSetupSaved:"大模型 API 配置已保存,正在重试切换 agim…",pendingApprovals:"待审批数",quickPrompt:{plan:"先帮我拆解这个任务",risks:"列出风险与回滚方案",summary:"给我一版汇报摘要"},newConv:"新对话",newConvHint:"清空消息并开启新会话",newConvToast:"已开启新对话",switchAgentConfirm:"切换到「{{agent}}」?",copy:"复制",copied:"已复制",copyMarkdown:"复制 Markdown",copyFailed:"复制失败",approvalTitle:"🔐 工具授权",approvalAutoBadge:"自动放行",approvalAutoIn:"{{count}} 秒后自动放行 — 点「拒绝」可中止。",approvalAutoResolving:"正在自动放行…",approvalToolLabel:"工具",approvalInputLabel:"输入",approvalAllow:"批准",approvalAuto:"本类自动放行",approvalAutoTip:"批准并对本会话内同类调用自动放行",approvalDeny:"拒绝",approvalSubmitting:"已发送,等待结果…",askTitle:"🤔 请选择",askMultiHint:"选择 {{min}}–{{max}} 项",askSubmit:"提交",askCustomPlaceholder:"自定义回答…",askResolved:"✅ 已回答",outcome:{allowed:"✅ 已批准",allowedPinned:"✅ 已批准 · 后续同类自动放行",denied:"❌ 已拒绝",deniedRevoked:"❌ 已拒绝(撤销自动放行)",expired:"⏱ 已超时"}},Ew={appName:fw,actions:hw,states:pw,theme:mw,lang:gw,nav:yw,confirm:bw,pagination:vw,table:xw,login:ww,home:kw,notFound:Sw,errorBoundary:Aw,chat:Cw},Rw="Couldn't reach the server. Check your connection and retry.",Tw="Your session expired. Please sign in again.",Pw="This token has no admin permission. Please sign in with an admin token.",Iw="Sign-in required.",Lw="Auth token missing from request.",Ow="Auth subsystem isn't ready yet. Retry in a moment.",Nw="You don't have permission to do that.",_w="The requested resource wasn't found.",Dw="That request is too big — try splitting it.",Mw="The server rejected the request: {{detail}}",jw="Request body wasn't valid JSON.",Fw="Configuration didn't validate. Check the form fields.",Uw="Couldn't save configuration: {{detail}}",Hw="Send an `updates` object to change env values.",Bw="None of the keys you sent are editable.",zw="SMTP isn't configured. Save host / user / password first.",$w="SMTP verify failed: {{detail}}",Vw="Provide a baseUrl to discover ACP agents.",Kw="Provide an `endpoint` to test the agent.",Ww="ACP discovery failed: {{detail}}",qw="ACP agent test failed: {{detail}}",Qw="A user_key (platform:userId) is required.",Gw="Something went wrong (code {{code}}).",Yw="Bad request.",Xw="Sign-in required.",Jw="Forbidden.",Zw="Not found.",ek="Conflict — refresh and try again.",tk="Request too large.",nk="Server error.",rk="Gateway error.",ik="Service unavailable.",ok="Gateway timeout.",ak={NETWORK:Rw,AUTH_INVALID:Tw,AUTH_ADMIN_REQUIRED:Pw,AUTH_REQUIRED:Iw,AUTH_TOKEN_REQUIRED:Lw,AUTH_NOT_READY:Ow,FORBIDDEN:Nw,NOT_FOUND:_w,PAYLOAD_TOO_LARGE:Dw,VALIDATION:Mw,INVALID_JSON_BODY:jw,CONFIG_INVALID:Fw,CONFIG_SAVE_FAILED:Uw,ENV_UPDATES_REQUIRED:Hw,ENV_NO_EDITABLE_KEYS:Bw,EMAIL_NOT_CONFIGURED:zw,EMAIL_VERIFY_FAILED:$w,ACP_BASEURL_REQUIRED:Vw,ACP_ENDPOINT_REQUIRED:Kw,ACP_DISCOVER_FAILED:Ww,ACP_TEST_FAILED:qw,MEMORY_USER_KEY_REQUIRED:Qw,UNKNOWN:Gw,HTTP_400:Yw,HTTP_401:Xw,HTTP_403:Jw,HTTP_404:Zw,HTTP_409:ek,HTTP_413:tk,HTTP_500:nk,HTTP_502:rk,HTTP_503:ik,HTTP_504:ok},sk="无法访问服务器,请检查网络后重试。",lk="登录状态已过期,请重新登录。",ck="当前 token 没有管理权限,请使用管理员 token 重新登录。",uk="请先登录。",dk="请求缺少 auth token。",fk="鉴权子系统尚未就绪,请稍后重试。",hk="没有执行该操作的权限。",pk="请求的资源不存在。",mk="请求体过大,请拆分后重试。",gk="服务端拒绝了请求:{{detail}}",yk="请求体不是合法的 JSON。",bk="配置校验失败,请检查表单字段。",vk="保存配置失败:{{detail}}",xk="请在请求体中提供 `updates` 对象以修改 env。",wk="请求里的 key 均不可编辑。",kk="SMTP 未配置,请先保存 host / user / password。",Sk="SMTP 连接测试失败:{{detail}}",Ak="需要 baseUrl 才能发现 ACP Agent。",Ck="需要 `endpoint` 才能测试该 Agent。",Ek="ACP 发现失败:{{detail}}",Rk="ACP Agent 测试失败:{{detail}}",Tk="需要 user_key(形如 `platform:userId`)。",Pk="出错了 (code {{code}})。",Ik="请求格式不正确。",Lk="请先登录。",Ok="没有权限。",Nk="未找到。",_k="状态冲突,请刷新后重试。",Dk="请求体过大。",Mk="服务端出错。",jk="网关错误。",Fk="服务暂不可用。",Uk="网关超时。",Hk={NETWORK:sk,AUTH_INVALID:lk,AUTH_ADMIN_REQUIRED:ck,AUTH_REQUIRED:uk,AUTH_TOKEN_REQUIRED:dk,AUTH_NOT_READY:fk,FORBIDDEN:hk,NOT_FOUND:pk,PAYLOAD_TOO_LARGE:mk,VALIDATION:gk,INVALID_JSON_BODY:yk,CONFIG_INVALID:bk,CONFIG_SAVE_FAILED:vk,ENV_UPDATES_REQUIRED:xk,ENV_NO_EDITABLE_KEYS:wk,EMAIL_NOT_CONFIGURED:kk,EMAIL_VERIFY_FAILED:Sk,ACP_BASEURL_REQUIRED:Ak,ACP_ENDPOINT_REQUIRED:Ck,ACP_DISCOVER_FAILED:Ek,ACP_TEST_FAILED:Rk,MEMORY_USER_KEY_REQUIRED:Tk,UNKNOWN:Pk,HTTP_400:Ik,HTTP_401:Lk,HTTP_403:Ok,HTTP_404:Nk,HTTP_409:_k,HTTP_413:Dk,HTTP_500:Mk,HTTP_502:jk,HTTP_503:Fk,HTTP_504:Uk},Bk="Tasks",zk={jobs:"Jobs",subtasks:"Subtasks",bgjobs:"Background",schedules:"Schedules",outbox:"Outbox",a2a:"Agent ↔ Agent",heartbeat:"Heartbeat",goals:"Goals",asks:"Ask User",plans:"Plans"},$k={title:"Jobs",subtitle:"Long-running agent invocations and their results.",empty:{title:"No jobs yet",description:"Jobs are created when an agent runs in async mode — via `agim --invoke` or an inline /run command from chat."},filter:{status:"Status",statusAny:"Any status",agent:"Agent",agentAny:"Any agent",kind:"Kind",kindAny:"Any kind"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",createdAt:"Created",duration:"Duration",cost:"Cost"},status:{pending:"Pending",running:"Running",completed:"Completed",delivered:"Delivered",failed:"Failed",cancelled:"Cancelled",interrupted:"Interrupted",replaced:"Replaced",abandoned:"Abandoned"},kind:{job:"Job",inline:"Inline"},stats:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed"},batch:{selected:"{{count}} selected",cancel:"Cancel selected",rerun:"Re-run selected",confirmCancel:"Cancel {{count}} job(s)?",confirmCancelDesc:"Running jobs will be sent a stop signal. Already-completed jobs are unaffected.",confirmRerun:"Re-run {{count}} job(s)?",confirmRerunDesc:"New jobs will be created from the original prompts."},live:{connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"}},Vk={title:"Subtasks",subtitle:"Per-conversation child tasks spawned by the parent agent.",empty:{title:"No subtasks yet",description:"Subtasks appear when an agent dispatches work to another agent inside a chat thread."},filter:{agent:"Parent agent",agentAny:"Any agent"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",parent:"Parent",platform:"Platform",createdAt:"Created"},status:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"}},Kk={title:"Background jobs",subtitle:"Long-running scripts the agent wrappers (Claude Code / opencode / codex) launched via bgjob.",empty:{title:"No background jobs",description:"Background jobs show up here once an agent has used its bgjob wrapper. Roots come from ~/.claude/bgjobs/, ~/.config/opencode/bgjobs/, ~/.codex/bgjobs/ (override via IMHUB_BGJOB_ROOTS)."},filter:{root:"Root",rootAny:"All roots"},col:{name:"Name",status:"Status",root:"Root",pid:"PID",startedAt:"Started",endedAt:"Ended",exit:"Exit"},exitOk:"ok",stillRunning:"—"},Wk={title:"Schedules",subtitle:"Cron-style triggers that re-invoke an agent with a fixed prompt.",empty:{title:"No schedules configured",description:"Create a schedule from the agent's chat via `/cron set` or by running `agim cron create` in the CLI."},filter:{agent:"Agent",agentAny:"Any agent"},col:{id:"ID",name:"Name",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"Enabled",nextRun:"Next run",lastRun:"Last run"},enabled:"On",disabled:"Off"},qk={title:"Outbox",subtitle:"Pending IM-platform deliveries. The crash-safe queue retries on transient failures and parks unrecoverable ones in `giving_up`.",empty:{title:"Outbox is empty",description:"Messages move through the queue and are deleted on successful delivery. A non-empty outbox here means the queue is actively flushing or a delivery is stuck."},filter:{status:"Status",statusAny:"Any status",thread:"Thread key"},stats:{pending:"Pending",giving_up:"Giving up",delivered:"Delivered (lifetime)",lastDelivered:"Last delivery"},col:{id:"ID",status:"Status",platform:"Platform",preview:"Preview",thread:"Thread",kind:"Kind",attempts:"Attempts",createdAt:"Created",lastError:"Last error",jobId:"Job"},status:{pending:"Pending",delivered:"Delivered",giving_up:"Giving up"},action:{retry:"Retry",confirmRetry:"Re-queue this delivery?",confirmRetryDesc:"The row's status flips back to pending and the sender will attempt delivery again on the next tick."}},Qk={title:"Agent ↔ Agent",subtitle:"Recent inline jobs spawned with a parent (one agent invoking another).",empty:{title:"No agent-to-agent calls yet",description:"Inline a2a calls appear here once an agent uses the `agim --invoke` tool with a parent context."},stats:{total:"Total",recent24h:"Last 24h",maxDepth:"Max depth"},col:{id:"ID",agent:"Agent",parent:"Parent",depth:"Depth",status:"Status",prompt:"Prompt",createdAt:"Created"}},Gk={title:"Heartbeat bindings",subtitle:"Cross-thread view of every /heartbeat bind. Enable/disable a binding from here; create new ones from inside the IM thread itself (/heartbeat bind <body>).",refresh:"Refresh",empty:"No heartbeat bindings yet. Run /heartbeat bind <body> in any IM thread to create one.",col:{thread:"Thread",owner:"Owner",interval:"Interval",lastTick:"Last tick",enabled:"Enabled",body:"Body"},never:"never",pause:"Pause",enable:"Enable",show:"Show",hide:"Hide",enabledToast:"Binding enabled",disabledToast:"Binding paused",justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago",intervalMin:"{{count}}m"},Yk={title:"Active goals",subtitle:"Cross-thread view of every active /goal. Lifecycle controls (pause / complete / cancel) operate without the IM thread; creating a new goal still requires the thread context — /goal set <title>.",refresh:"Refresh",empty:"No active goals. Create one inside any IM thread with /goal set <title>.",col:{id:"#",thread:"Thread",title:"Title",progress:"Progress",updated:"Updated",actions:"Actions"},showBody:"Show body",hideBody:"Hide body",pause:"Pause",complete:"Complete",cancel:"Cancel",status:{paused:"Paused",completed:"Completed",cancelled:"Cancelled"},body:"Body",recentProgress:"Recent progress (latest {{count}})",created:"created {{at}}",closed:"closed {{at}}",statusUpdated:"Goal {{status}}"},Xk={title:"Pending ask_user",subtitle:"Live list of every mcp__imhub__ask_user waiting on a reply. Cancelling here gives the agent the same response shape as a natural timeout (ok: false, reason: 'cancelled').",refresh:"Refresh",empty:"No pending asks. Auto-refreshes every 5s.",col:{reqId:"Req ID",thread:"Thread",question:"Question",choices:"Choices",age:"Age",actions:""},cancel:"Cancel",cancelConfirm:"Cancel pending ask {{id}}…?",cancelledToast:"Cancelled",justNow:"just now",seconds:"{{count}}s",minutes:"{{count}}m",hours:"{{count}}h"},Jk={title:"Plan history",subtitle:"Audit log of plan-mode exit handshakes, including outcomes and proposed plan text.",refresh:"Refresh",filterLabel:"Filter by thread key (optional)",applyFilter:"Apply",clearFilter:"Clear",empty:"No plan history yet.",emptyFiltered:"No plan history for this thread key.",planMdLabel:"Proposed plan:",col:{outcome:"Outcome",thread:"Thread",resolvedAt:"Resolved",pending:"Wait",detail:"Detail"},outcome:{approved:"Approved",rejected:"Rejected",edited:"Edited",expired:"Expired"}},Zk={pageTitle:Bk,subnav:zk,jobs:$k,subtasks:Vk,bgjobs:Kk,schedules:Wk,outbox:qk,a2a:Qk,heartbeat:Gk,goals:Yk,asks:Xk,plans:Jk},eS="任务",tS={jobs:"作业",subtasks:"子任务",bgjobs:"后台脚本",schedules:"定时任务",outbox:"投递队列",a2a:"Agent 互调",heartbeat:"心跳",goals:"目标",asks:"待回答",plans:"计划审计"},nS={title:"作业",subtitle:"Agent 的长任务调用与结果。",empty:{title:"暂无作业",description:"通过 `agim --invoke` 或聊天里的 /run 命令异步启动 Agent 时会自动生成作业记录。"},filter:{status:"状态",statusAny:"全部状态",agent:"Agent",agentAny:"全部 Agent",kind:"类型",kindAny:"全部类型"},col:{id:"ID",agent:"Agent",prompt:"提示词",status:"状态",createdAt:"创建时间",duration:"耗时",cost:"成本"},status:{pending:"等待中",running:"运行中",completed:"已完成",delivered:"已送达",failed:"失败",cancelled:"已取消",interrupted:"已中断",replaced:"已替换",abandoned:"已放弃"},kind:{job:"作业",inline:"即时"},stats:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败"},batch:{selected:"已选 {{count}} 项",cancel:"取消所选",rerun:"重跑所选",confirmCancel:"确认取消 {{count}} 个作业?",confirmCancelDesc:"运行中的作业会收到停止信号。已完成的作业不受影响。",confirmRerun:"确认重跑 {{count}} 个作业?",confirmRerunDesc:"将根据原 Prompt 重新创建作业。"},live:{connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"}},rS={title:"子任务",subtitle:"由父 Agent 在对话内派发出的子任务列表。",empty:{title:"暂无子任务",description:"当 Agent 在聊天线程内向其他 Agent 委派工作时,子任务会出现在这里。"},filter:{agent:"父 Agent",agentAny:"全部 Agent"},col:{id:"ID",agent:"Agent",prompt:"提示词",status:"状态",parent:"父级",platform:"平台",createdAt:"创建时间"},status:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败",cancelled:"已取消"}},iS={title:"后台脚本",subtitle:"Agent 封装(Claude Code / opencode / codex)通过 bgjob 启动的长任务进程。",empty:{title:"暂无后台脚本",description:"当 Agent 使用其 bgjob 封装时,记录会在这里出现。Root 路径默认取 ~/.claude/bgjobs/、~/.config/opencode/bgjobs/、~/.codex/bgjobs/(可通过 IMHUB_BGJOB_ROOTS 覆盖)。"},filter:{root:"Root",rootAny:"全部 Root"},col:{name:"名称",status:"状态",root:"Root",pid:"PID",startedAt:"开始时间",endedAt:"结束时间",exit:"退出码"},exitOk:"ok",stillRunning:"—"},oS={title:"定时任务",subtitle:"Cron 触发的 Agent 调用 — 按固定 Prompt 重新执行。",empty:{title:"暂无定时任务",description:"可在聊天中通过 `/cron set` 或 CLI `agim cron create` 创建定时任务。"},filter:{agent:"Agent",agentAny:"全部 Agent"},col:{id:"ID",name:"名称",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"启用",nextRun:"下次运行",lastRun:"上次运行"},enabled:"开",disabled:"关"},aS={title:"投递队列",subtitle:"面向 IM 平台的待投递消息队列。瞬态失败会自动重试;不可恢复的会停在 giving_up。",empty:{title:"投递队列为空",description:"消息成功投递后会被删除。如果这里非空,说明队列正在刷出消息,或某条消息卡住了。"},filter:{status:"状态",statusAny:"全部状态",thread:"线程标识"},stats:{pending:"待发送",giving_up:"放弃中",delivered:"已投递(累计)",lastDelivered:"最近投递"},col:{id:"ID",status:"状态",platform:"平台",preview:"内容",thread:"线程",kind:"类型",attempts:"尝试次数",createdAt:"创建时间",lastError:"最后错误",jobId:"作业"},status:{pending:"待发送",delivered:"已投递",giving_up:"放弃中"},action:{retry:"重试",confirmRetry:"重新入队这条投递?",confirmRetryDesc:"状态会切回 pending,发送器会在下一轮 tick 再次尝试投递。"}},sS={title:"Agent 互调",subtitle:"带父级 ID 的最近 inline 作业(一个 Agent 调用另一个 Agent 的记录)。",empty:{title:"暂无 Agent 互调记录",description:"当某 Agent 使用 `agim --invoke` 工具并带上父级上下文时,这里会出现 inline a2a 调用记录。"},stats:{total:"累计",recent24h:"近 24 小时",maxDepth:"最大深度"},col:{id:"ID",agent:"Agent",parent:"父级",depth:"深度",status:"状态",prompt:"提示词",createdAt:"创建时间"}},lS={title:"心跳绑定",subtitle:"跨线程查看所有 /heartbeat bind。可在此启用/停用绑定;新建绑定需在 IM 线程内执行 /heartbeat bind <body>。",refresh:"刷新",empty:"尚无心跳绑定。在任意 IM 线程执行 /heartbeat bind <body> 即可创建。",col:{thread:"线程",owner:"所有者",interval:"间隔",lastTick:"上次 tick",enabled:"启用",body:"正文"},never:"从未",pause:"暂停",enable:"启用",show:"展开",hide:"收起",enabledToast:"已启用绑定",disabledToast:"已停用绑定",justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前",intervalMin:"{{count}} 分钟"},cS={title:"活跃目标",subtitle:"跨线程查看所有活跃 /goal。生命周期操作(暂停/完成/取消)无需 IM 线程;新建目标仍需在线程内执行 /goal set <title>。",refresh:"刷新",empty:"暂无活跃目标。在任意 IM 线程执行 /goal set <title> 创建。",col:{id:"#",thread:"线程",title:"标题",progress:"进度",updated:"更新",actions:"操作"},showBody:"展开正文",hideBody:"收起正文",pause:"暂停",complete:"完成",cancel:"取消",status:{paused:"暂停",completed:"完成",cancelled:"取消"},body:"正文",recentProgress:"最近进度(最新 {{count}} 条)",created:"创建于 {{at}}",closed:"关闭于 {{at}}",statusUpdated:"目标已{{status}}"},uS={title:"待回答 ask_user",subtitle:"所有等待回复的 mcp__imhub__ask_user 实时列表。在此取消与超时相同(ok: false, reason: 'cancelled')。",refresh:"刷新",empty:"暂无待回答。每 5 秒自动刷新。",col:{reqId:"请求 ID",thread:"线程",question:"问题",choices:"选项数",age:"等待时长",actions:""},cancel:"取消",cancelConfirm:"取消待回答 {{id}}…?",cancelledToast:"已取消",justNow:"刚刚",seconds:"{{count}} 秒",minutes:"{{count}} 分",hours:"{{count}} 小时"},dS={title:"计划记录",subtitle:"查看 Plan 模式退出时的处理结果与计划正文。",refresh:"刷新",filterLabel:"按线程标识筛选(可选)",applyFilter:"应用",clearFilter:"清空",empty:"暂无计划记录。",emptyFiltered:"该线程暂无计划记录。",planMdLabel:"计划正文:",col:{outcome:"结果",thread:"线程",resolvedAt:"处理时间",pending:"等待时长",detail:"说明"},outcome:{approved:"已通过",rejected:"已拒绝",edited:"已修改",expired:"已超时"}},fS={pageTitle:eS,subnav:tS,jobs:nS,subtasks:rS,bgjobs:iS,schedules:oS,outbox:aS,a2a:sS,heartbeat:lS,goals:cS,asks:uS,plans:dS},hS="Approvals",pS="Pending tool invocations the agent is asking permission for.",mS={connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"},gS={pending:"Pending",totalAllowed:"Total allowed",totalDenied:"Total denied",totalTimedOut:"Timed out",totalReadonly:"Read-only auto-allowed"},yS={title:"No approvals waiting",description:"The queue is empty. Tool requests show up here when an agent calls a tool that's not on its allow-list yet."},bS="Thread",vS="auto-allow",xS="Backend auto-allowed this read-only tool; the card is shown for visibility only.",wS="Allow",kS="Deny",SS={allowedShort:"Allowed",deniedShort:"Denied"},AS={pageTitle:hS,subtitle:pS,live:mS,stats:gS,empty:yS,threadLabel:bS,autoAllowedTag:vS,autoAllowedTitle:xS,allow:wS,deny:kS,toast:SS},CS="审批",ES="Agent 等待批准的工具调用。",RS={connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"},TS={pending:"待审批",totalAllowed:"累计放行",totalDenied:"累计拒绝",totalTimedOut:"超时",totalReadonly:"只读自动放行"},PS={title:"暂无待审批请求",description:"队列为空。当 Agent 调用尚未加入白名单的工具时,请求会在这里出现。"},IS="线程",LS="自动放行",OS="后端已对该只读工具自动放行;此处仅供可见性展示。",NS="放行",_S="拒绝",DS={allowedShort:"已放行",deniedShort:"已拒绝"},MS={pageTitle:CS,subtitle:ES,live:RS,stats:TS,empty:PS,threadLabel:IS,autoAllowedTag:LS,autoAllowedTitle:OS,allow:NS,deny:_S,toast:DS},jS="Reminders",FS="Queued reminders waiting to fire. Cancel or snooze pending ones; fired and cancelled rows are kept for audit.",US={status:"Status",statusAny:"Any status"},HS={pending:"Pending",firing:"Firing",fired:"Fired",cancelled:"Cancelled",failed:"Failed"},BS={slash:"/remind",mcp:"MCP",api:"API"},zS={literal:"Literal",llm:"LLM"},$S={title:"Nothing scheduled",description:"Reminders show up here once an agent (via /remind, MCP, or API) queues one. Filter by status to see fired or cancelled ones."},VS={id:"ID",fireAt:"Fires",text:"Text",status:"Status",platform:"Platform",thread:"Thread",source:"Source",recurrence:"Recurrence",createdAt:"Created"},KS={cancel:"Cancel",snooze:"Snooze",confirmCancel:"Cancel this reminder?",confirmCancelDesc:"The reminder is removed from the queue. Recurring reminders won't fire again unless re-created."},WS={title:"Snooze reminder",description:"How long should it be pushed back?",preset5m:"5 minutes",preset30m:"30 minutes",preset1h:"1 hour",preset1d:"1 day",submit:"Snooze",toastOk:"Snoozed for {{duration}}"},qS={cancelled:"Reminder cancelled"},QS={pageTitle:jS,subtitle:FS,filter:US,status:HS,source:BS,promptMode:zS,empty:$S,col:VS,action:KS,snooze:WS,toast:qS},GS="提醒",YS="排队待触发的提醒。可对 pending 的提醒做取消 / 延后;已触发与已取消的记录保留以备审计。",XS={status:"状态",statusAny:"全部状态"},JS={pending:"等待中",firing:"触发中",fired:"已触发",cancelled:"已取消",failed:"失败"},ZS={slash:"/remind",mcp:"MCP",api:"API"},e0={literal:"原文",llm:"LLM"},t0={title:"暂无提醒",description:"当 Agent 通过 /remind、MCP 或 API 创建提醒时,记录会出现在这里。可切换状态查看已触发或已取消的记录。"},n0={id:"ID",fireAt:"触发时间",text:"内容",status:"状态",platform:"平台",thread:"线程",source:"来源",recurrence:"周期",createdAt:"创建时间"},r0={cancel:"取消",snooze:"延后",confirmCancel:"确认取消这条提醒?",confirmCancelDesc:"该提醒会被移出队列。周期提醒在未重新创建前不会再触发。"},i0={title:"延后提醒",description:"延后多久?",preset5m:"5 分钟",preset30m:"30 分钟",preset1h:"1 小时",preset1d:"1 天",submit:"确认延后",toastOk:"已延后 {{duration}}"},o0={cancelled:"已取消"},a0={pageTitle:GS,subtitle:YS,filter:XS,status:JS,source:ZS,promptMode:e0,empty:t0,col:n0,action:r0,snooze:i0,toast:o0},s0="Memos",l0="Long-term notes the operator captured for the agent — searchable by content, person, or location.",c0={placeholder:"Search memos…",who:"Who",what:"What",hasLocation:"Has location",includeExpired:"Include expired"},u0={title:"No memos match",description:"Memos are created from chat via `/memo` or auto-extracted by the memory subsystem. Try clearing filters or widening the search."},d0={id:"ID",what:"What",who:"Who",when:"When",where:"Where",platform:"Platform",createdAt:"Created",expiresAt:"Expires"},f0={delete:"Delete",confirmDelete:"Delete this memo?",confirmDeleteDesc:"This cannot be undone. The memory subsystem still has any embeddings derived from this memo until a backfill prune lands."},h0={label:"Open map",baidu:"Baidu Maps",apple:"Apple Maps",google:"Google Maps",osm:"OpenStreetMap"},p0={deleted:"Memo deleted"},m0={pageTitle:s0,subtitle:l0,search:c0,empty:u0,col:d0,action:f0,openMap:h0,toast:p0},g0="备忘",y0="操作员为 Agent 记下的长期备忘 — 可按内容、人物、地点检索。",b0={placeholder:"搜索备忘…",who:"谁",what:"做什么",hasLocation:"含位置",includeExpired:"包含过期"},v0={title:"未匹配到备忘",description:"备忘通过聊天中的 `/memo` 命令或记忆子系统自动抽取生成。可清空筛选或放宽搜索条件再试。"},x0={id:"ID",what:"事项",who:"对象",when:"时间",where:"地点",platform:"平台",createdAt:"创建时间",expiresAt:"过期时间"},w0={delete:"删除",confirmDelete:"确认删除此备忘?",confirmDeleteDesc:"操作不可撤销。记忆子系统中由此备忘衍生的 embedding 在下一次 backfill 清理前仍会保留。"},k0={label:"在地图中打开",baidu:"百度地图",apple:"Apple 地图",google:"Google 地图",osm:"OpenStreetMap"},S0={deleted:"已删除"},A0={pageTitle:g0,subtitle:y0,search:b0,empty:v0,col:x0,action:w0,openMap:k0,toast:S0},C0="Memory",E0="Per-user facts the agent has accumulated. Long-term memory that survives session resets.",R0={label:"User",placeholder:"Pick a user",factsLabel:"{{count}} facts",personaTag:"persona"},T0={title:"Pick a user to view their memory",description:"Memory is partitioned per user_key (platform:userId). The dropdown above lists every user whose memory has any rows in the bank."},P0={facts:"Facts",persona:"Persona",distill:"Distillation",vector:"Vector",skills:"Skills"},I0={title:"Facts",empty:{title:"No facts yet",description:"Facts accumulate as the agent extracts them from chat history during memory consolidation. Triggering `/memory consolidate` from chat (or the Persona tab's button when it lands) seeds this list."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},category:{fact:"Fact",preference:"Preference",goal:"Goal",history:"History",profile:"Profile"},col:{id:"ID",what:"What",category:"Category",confidence:"Confidence",source:"Source",createdAt:"Created"},batch:{selected:"{{count}} selected",deleteSelected:"Delete selected",confirmDelete:"Delete {{count}} fact(s)?",confirmDeleteDesc:"This removes the rows from the bank. The vector index keeps any embedding derived from these rows until the next backfill prune."},action:{delete:"Delete",confirmDelete:"Delete this fact?",confirmDeleteDesc:"This row is removed permanently. The vector index retains its embedding until the next backfill prune."},toast:{deletedOne:"Fact deleted",deletedMany:"Deleted {{count}} facts"}},L0={title:"Persona",subtitle:"Long-form summary of who this user is, refined by periodic consolidation of their facts.",empty:{title:"No persona yet",description:"Personas are written by the consolidation pass — run it from the button below once enough facts have accumulated."},updated:"Updated {{at}}",editorLabel:"Persona summary",save:"Save",saved:"Saved",delete:"Delete persona",confirmDelete:"Delete this persona?",confirmDeleteDesc:"The persona summary is removed from the bank. Facts the persona was derived from stay in place; the next consolidate pass will rewrite a fresh one.",consolidate:{trigger:"Run consolidation",triggering:"Starting…",running:"Consolidation running…",doneOk:"Consolidation complete",doneFailed:"Consolidation failed",lastRun:"Last run {{at}}",result:"Processed {{users}} user(s), {{updated}} persona(s) updated"}},O0={title:"Dream distillation",subtitle:"Chat turns are buffered, then batch-extracted into facts in the background when the system is idle — or once a user's oldest turn passes the staleness floor. Configure the extraction model + cadence, watch the buffer, or force a pass now.",form:{title:"Configuration",hint:"Pick which model extracts facts, then tune the schedule. Changes hit the env file and reload in-process; a restart re-reads them.",dirty:"Unsaved changes",discard:"Discard",save:"Save",savedToast:"Saved",nothingChanged:"Nothing to save",source:"Extraction source",sourceHelp:"Which LLM turns buffered chat into facts.",sourceAuto:"Auto — the turn's own agent",sourceAgent:"A specific agent CLI",sourceLlm:"A standalone LLM backend",autoNote:"Zero-config: each batch is extracted by the agent that handled those turns. Recommended for most installs.",agent:"Agent",agentHelp:"Use this enabled agent CLI for every extraction, regardless of which agent handled the turn.",agentPlaceholder:"Pick an agent",noAgents:"No agents enabled. Enable one under Settings → Agents first.",llmBackend:"LLM backend",llmBackendHelp:"Bind a configured LLM backend to the `distill` role — a direct API call, no CLI spawn. Manage backends under Settings → LLM.",llmPlaceholder:"Pick a backend",noBackends:"No LLM backends configured. Add one under Settings → LLM first.",scheduleTitle:"Schedule",enabled:"Distiller",enabledHelp:"Master switch for the background pass. When off, turns still buffer but are never extracted.",enabledOn:"On",enabledOff:"Off",intervalMs:"Tick interval (ms)",intervalMsHelp:"How often the background pass wakes up. Default 300000 (5 min); minimum 10000.",floorMin:"Staleness floor (min)",floorMinHelp:"On a continuously-busy bot, force-flush a user once their oldest buffered turn is this old. Default 30.",batchMax:"Batch size",batchMaxHelp:"Max turns fed to one extraction call. Default 20.",maxPending:"Per-user buffer cap",maxPendingHelp:"Max buffered turns kept per user before the oldest are dropped. Default 200.",errors:{agentRequired:"Pick an agent for the agent source",llmRequired:"Pick an LLM backend for the LLM source",numRange:"{{field}} must be a number ≥ {{min}}"}},status:{title:"Status",enabledTrue:"Enabled",enabledFalse:"Disabled",running:"Running",pending:"Buffered turns",lastProcessed:"Last processed",lastRun:"Last run",bufferEmpty:"Buffer is empty — all turns have been distilled.",lastError:"Last error"},actions:{runNow:"Run now",runStarted:"Distillation pass started"}},N0={title:"Vector backend",subtitle:"Embeddings power hybrid recall on memory facts. The active backend, model, and per-user coverage live here.",config:{title:"Backend configuration",hint:"Backend selection + OpenAI / local-model parameters live in env. Edit `~/.agim/env` on the host (or set systemd `Environment=`); the `IMHUB_MEMORY_VECTOR_*` keys are listed below.",editLink:"env file"},form:{title:"Backend configuration",hint:"Pick a backend, fill in the parameters, then save & test. Changes hit the env file and reload in-process; a restart re-reads them.",dirty:"Unsaved changes",discard:"Discard",saveAndTest:"Save & test",savedToast:"Saved — running test…",nothingChanged:"Nothing to save",backend:"Backend",backendHelp:"off = vector recall disabled; local = on-device BGE; openai = OpenAI-compatible remote endpoint",backendOff:"Off",backendLocal:"Local (BGE)",backendOpenai:"OpenAI-compatible",localModel:"Local model",localModelHelp:"Xenova model id, defaults to Xenova/bge-base-zh-v1.5. First-time use needs a manual download.",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI-compatible endpoint root, e.g. https://api.openai.com/v1 or your self-hosted gateway.",openaiModel:"Model",openaiModelHelp:"Embedding model id, defaults to text-embedding-3-small. Match your provider's docs for other endpoints.",openaiApiKey:"API key",apiKeyKeepHint:"Leave blank to keep the existing key (placeholder shows the masked value); typing replaces it.",apiKeyNewHint:"Paste your OpenAI-compatible API key (only the server sees the raw value after save).",toggleApiKey:"Show / hide API key",batchSize:"Batch size",batchSizeHelp:"Max texts per embed call, 1–1024 (default 32).",hybridWeight:"Hybrid weight",hybridWeightHelp:"Vector branch weight when fusing with FTS5 recall, 0–1 (default 0.5).",errors:{baseUrlRequired:"Base URL is required",baseUrlInvalid:"Base URL is not a valid URL",openaiModelRequired:"Embedding model id is required",apiKeyRequired:"API key is required for the OpenAI backend on first setup",localModelRequired:"Local model id is required",batchSizeRange:"Batch size must be between 1 and 1024",hybridWeightRange:"Hybrid weight must be between 0 and 1"}},backendLabel:"Backend",modelLabel:"Model",dimsLabel:"Dimensions",readyTrue:"Ready",readyFalse:"Not ready",downloadedTrue:"Files on disk",lastError:"Last error",coverage:{title:"Coverage",total:"Facts",withEmbedding:"Embedded",withDifferentModel:"Mismatched model",scope_user:"for {{userKey}}",scope_global:"across every user"},actions:{title:"Maintenance",test:"Test",testOk:"Backend test OK",testFail:"Backend test failed: {{detail}}",download:"Download model",downloadStarted:"Download started",downloadAlreadyReady:"Model is already ready",backfill:"Backfill embeddings",backfillStarted:"Backfill started",backfillNotReady:"Backend not ready — run download first",clear:"Clear embeddings",clearStarted:"Cleared {{count}} embedding(s)",confirmClear:"Clear all embeddings?",confirmClearDesc:"Drops the embedding column for {{scope}}. Facts themselves stay; you'll need to backfill again before vector recall works."},jobs:{title:"Recent jobs",empty:"No recent jobs",phase:{running:"Running",done:"Done",failed:"Failed"}}},_0={title:"Skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills installed",description:"Drop a SKILL.md (with `name` and `description` frontmatter) under one of the configured roots and refresh."},filter:{search:"Search",category:"Category",categoryAny:"All categories"},sources:{title:"Source directories",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Available to"}},D0={pageTitle:C0,subtitle:E0,userPicker:R0,noUserSelected:T0,tabs:P0,facts:I0,persona:L0,distill:O0,vector:N0,skills:_0},M0="记忆",j0="Agent 为每个用户积累的事实库。跨会话保留的长期记忆。",F0={label:"用户",placeholder:"选择一个用户",factsLabel:"{{count}} 条事实",personaTag:"画像"},U0={title:"选择一个用户查看其记忆",description:"记忆按 user_key(platform:userId)分隔。上方下拉列出每位在库中有任何记忆数据的用户。"},H0={facts:"事实",persona:"画像",distill:"蒸馏",vector:"向量",skills:"技能"},B0={title:"事实",empty:{title:"暂无事实",description:"Agent 在记忆整理过程中会从聊天历史中抽取事实。可在聊天里运行 `/memory consolidate` 或后续 Persona 子页内的按钮触发整理。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},category:{fact:"事实",preference:"偏好",goal:"目标",history:"历史",profile:"档案"},col:{id:"ID",what:"内容",category:"类别",confidence:"置信度",source:"来源",createdAt:"创建时间"},batch:{selected:"已选 {{count}} 项",deleteSelected:"删除所选",confirmDelete:"确认删除 {{count}} 条事实?",confirmDeleteDesc:"记忆库中的这些行将被删除。向量索引中相应的 embedding 在下一次 backfill 清理前仍会保留。"},action:{delete:"删除",confirmDelete:"确认删除此事实?",confirmDeleteDesc:"该行被永久删除。向量索引会在下一次 backfill 清理前保留对应 embedding。"},toast:{deletedOne:"已删除",deletedMany:"已删除 {{count}} 条"}},z0={title:"Persona",subtitle:"该用户的长篇画像,由记忆整理任务从事实库中提炼。",empty:{title:"暂无 Persona",description:"Persona 由整理任务生成。当事实积累到一定量后,点击下方按钮运行整理。"},updated:"更新于 {{at}}",editorLabel:"Persona 内容",save:"保存",saved:"已保存",delete:"删除 Persona",confirmDelete:"确认删除此 Persona?",confirmDeleteDesc:"Persona 概要会从库中删除。生成它的事实仍保留,下一次整理会重新生成。",consolidate:{trigger:"运行整理",triggering:"启动中…",running:"整理进行中…",doneOk:"整理完成",doneFailed:"整理失败",lastRun:"上次运行:{{at}}",result:"处理 {{users}} 位用户,更新 {{updated}} 条 Persona"}},$0={title:"梦境蒸馏",subtitle:"聊天轮次会先缓冲下来,在系统空闲时(或某用户最早一条缓冲超过陈旧阈值后)于后台批量抽取为事实。在这里配置抽取所用的模型与节奏、查看缓冲队列,或立即手动触发一次。",form:{title:"配置",hint:"选择由哪个模型抽取事实,再调节调度参数。改动写入 env 文件并对本进程生效,重启后从 env 重新加载。",dirty:"有未保存的改动",discard:"放弃改动",save:"保存",savedToast:"已保存",nothingChanged:"没有需要保存的改动",source:"抽取来源",sourceHelp:"由哪个 LLM 把缓冲的聊天抽取为事实。",sourceAuto:"自动 —— 用该轮次自身的 Agent",sourceAgent:"指定一个 Agent CLI",sourceLlm:"单独配置一个 LLM 后端",autoNote:"零配置:每批由处理这些轮次的 Agent 来抽取。适合大多数部署,推荐。",agent:"Agent",agentHelp:"无论该轮次由谁处理,都用这个已启用的 Agent CLI 来抽取。",agentPlaceholder:"选择一个 Agent",noAgents:"尚未启用任何 Agent。请先在 设置 → Agents 中启用一个。",llmBackend:"LLM 后端",llmBackendHelp:"把一个已配置的 LLM 后端绑定到 `distill` 角色 —— 直接调 API,不拉起 CLI。后端在 设置 → LLM 中管理。",llmPlaceholder:"选择一个后端",noBackends:"尚未配置任何 LLM 后端。请先在 设置 → LLM 中添加一个。",scheduleTitle:"调度",enabled:"蒸馏器",enabledHelp:"后台抽取的总开关。关闭后轮次仍会缓冲,但不会被抽取。",enabledOn:"开启",enabledOff:"关闭",intervalMs:"轮询间隔(毫秒)",intervalMsHelp:"后台任务的唤醒频率。默认 300000(5 分钟),最小 10000。",floorMin:"陈旧阈值(分钟)",floorMinHelp:"在持续繁忙的 bot 上,当某用户最早一条缓冲超过此时长时强制抽取。默认 30。",batchMax:"批大小",batchMaxHelp:"单次抽取调用喂入的最大轮次数。默认 20。",maxPending:"单用户缓冲上限",maxPendingHelp:"每位用户最多保留多少条缓冲轮次,超出后丢弃最旧的。默认 200。",errors:{agentRequired:"选择 Agent 来源时必须指定一个 Agent",llmRequired:"选择 LLM 来源时必须指定一个 LLM 后端",numRange:"{{field}} 必须是 ≥ {{min}} 的数字"}},status:{title:"状态",enabledTrue:"已启用",enabledFalse:"已禁用",running:"运行中",pending:"缓冲轮次",lastProcessed:"上次处理",lastRun:"上次运行",bufferEmpty:"缓冲为空 —— 所有轮次都已蒸馏。",lastError:"最近错误"},actions:{runNow:"立即运行",runStarted:"已开始一次蒸馏"}},V0={title:"向量后端",subtitle:"Embedding 驱动事实库的混合检索。当前后端、模型与每位用户的覆盖情况都在这里。",config:{title:"后端配置",hint:"后端选择与 OpenAI / 本地模型的参数都通过环境变量配置。请在宿主机直接编辑 `~/.agim/env`(或 systemd unit 的 `Environment=`),下方列出的 `IMHUB_MEMORY_VECTOR_*` 系列 key 即对应字段。",editLink:"env file"},form:{title:"后端配置",hint:"选好后端、填好参数 → 保存并测试。配置只对本进程生效,重启服务后从 env 文件重新加载。",dirty:"有未保存的改动",discard:"放弃改动",saveAndTest:"保存并测试",savedToast:"已保存,正在测试…",nothingChanged:"没有需要保存的改动",backend:"后端",backendHelp:"off = 关闭向量召回;local = 本地 BGE 模型;openai = 调远程 OpenAI 协议端点",backendOff:"关闭",backendLocal:"本地(BGE)",backendOpenai:"OpenAI 协议远程",localModel:"本地模型",localModelHelp:"Xenova 仓库的 model id,默认 Xenova/bge-base-zh-v1.5;首次使用需手动触发下载。",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI 兼容端点根路径,例如 https://api.openai.com/v1 或自部署网关。",openaiModel:"模型",openaiModelHelp:"Embedding 模型 id,默认 text-embedding-3-small;用其他兼容端点请按其文档填写。",openaiApiKey:"API Key",apiKeyKeepHint:"留空 = 保留当前 key(占位显示为脱敏值);填了就会覆盖。",apiKeyNewHint:"粘贴你的 OpenAI 兼容 API Key(保存后只在服务端可见)。",toggleApiKey:"显示 / 隐藏 API Key",batchSize:"批大小",batchSizeHelp:"单次嵌入的最大文本数,1–1024,默认 32。",hybridWeight:"混合权重",hybridWeightHelp:"FTS5 与向量召回融合时向量分支的权重,0–1,默认 0.5。",errors:{baseUrlRequired:"Base URL 不能为空",baseUrlInvalid:"Base URL 不是合法 URL",openaiModelRequired:"Embedding 模型 id 不能为空",apiKeyRequired:"首次使用 OpenAI 后端需要填 API Key",localModelRequired:"本地模型 id 不能为空",batchSizeRange:"批大小需在 1–1024 之间",hybridWeightRange:"混合权重需在 0–1 之间"}},backendLabel:"后端",modelLabel:"模型",dimsLabel:"维度",readyTrue:"就绪",readyFalse:"未就绪",downloadedTrue:"已下载",lastError:"最近错误",coverage:{title:"覆盖率",total:"事实总数",withEmbedding:"已嵌入",withDifferentModel:"模型不匹配",scope_user:"(针对 {{userKey}})",scope_global:"(全部用户)"},actions:{title:"维护",test:"测试",testOk:"后端测试通过",testFail:"后端测试失败:{{detail}}",download:"下载模型",downloadStarted:"下载已开始",downloadAlreadyReady:"模型已就绪",backfill:"回填 embedding",backfillStarted:"回填已开始",backfillNotReady:"后端未就绪 — 请先下载",clear:"清空 embedding",clearStarted:"已清空 {{count}} 条",confirmClear:"确认清空全部 embedding?",confirmClearDesc:"会丢弃 {{scope}} 的 embedding 列。事实本身保留;下次回填前向量检索不可用。"},jobs:{title:"近期任务",empty:"暂无任务",phase:{running:"运行中",done:"完成",failed:"失败"}}},K0={title:"技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},W0={pageTitle:M0,subtitle:j0,userPicker:F0,noUserSelected:U0,tabs:H0,facts:B0,persona:z0,distill:$0,vector:V0,skills:K0},q0="Skills",Q0={installed:"Installed",hot:"Hot on skillhub.cn"},G0={title:"Installed skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills",description:"Drop a SKILL.md with `name` + `description` frontmatter under a configured root and refresh."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},sources:{title:"Sources",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Picked up by"}},Y0={title:"Hot on skillhub.cn",subtitle:"Live top entries from skillhub.cn (cached 5 min on the server). Click a row for the install commands. agim never auto-runs installs — you copy the command and paste into shell or IM.",openHub:"Open skillhub.cn",loading:"Loading…",empty:"No data",cached:"cache hit",stale:"upstream unreachable — serving stale",updatedAt:"updated {{at}}",col:{slug:"slug",name:"Name / description",stars:"stars",installs:"installs"},detail:{slug:"Slug",version:"Version",category:"Category",stars:"Stars",installs:"Installs",downloads:"Downloads",howInstall:"How to install (pick one; agim never auto-runs)",copy:"Copy",copied:"Copied",label:{cliInstall:"On host (recommended)",cliSearch:"Dry-run first",imAsk:"Ask an IM agent"},hint:"The two CLI commands need skillhub CLI installed on the host first. See docs/skills.md or skillhub.cn."}},X0={pageTitle:q0,subnav:Q0,installed:G0,hot:Y0},J0="技能",Z0={installed:"已安装",hot:"skillhub.cn 热门"},eA={title:"已安装的技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},tA={title:"skillhub.cn 热门",subtitle:"实时拉取 skillhub.cn 热门下载(服务端 5 分钟缓存)。点击任意条目查看安装命令。agim 不会自动跑安装——命令复制后由你贴去 shell 或 IM 触发。",openHub:"前往 skillhub.cn",loading:"正在加载…",empty:"暂无数据",cached:"缓存命中",stale:"上游不可达,使用旧数据",updatedAt:"更新于 {{at}}",col:{slug:"slug",name:"名称 / 描述",stars:"收藏",installs:"安装量"},detail:{slug:"标识",version:"版本",category:"类别",stars:"收藏",installs:"安装量",downloads:"下载量",howInstall:"安装方式(任选一个;agim 不会自动跑)",copy:"复制",copied:"已复制",label:{cliInstall:"Host 上跑(推荐)",cliSearch:"先查再装",imAsk:"在 IM 里让 agent 装"},hint:"前两条要先在 host 上安装 skillhub CLI。详见 docs/skills.md 或 skillhub.cn。"}},nA={pageTitle:J0,subnav:Z0,installed:eA,hot:tA},rA="Workspace",iA="Read and edit files in the per-agent working directories (`AGENT_CWD`).",oA={label:"Agent",placeholder:"Pick an agent",online:"online",offline:"offline"},aA={title:"Pick an agent to browse its workspace",description:"Each registered agent runs from its own CWD. The picker lists every agent the registry knows about; the green dot next to a name means it reports available."},sA={title:"Files",loading:"Loading…",empty:"(empty directory)",up:"Up",rootLabel:"(workspace root)",binary:"binary",symlinkEscape:"symlink → outside workspace, hidden",broken:"unreadable"},lA={noFile:"Select a file from the tree to view or edit it.",binary:"This file looks binary (base64-encoded) — editing not supported.",truncated:"File is over 1 MiB; only the first 1 MiB is shown. Saving from here would replace the whole file with the truncated content — close without saving.",truncatedBadge:"Truncated",save:"Save",saving:"Saving…",savedMeta:"Saved · {{size}} bytes · {{at}}",dirtyHint:"Unsaved changes",loadFailed:"Failed to load file"},cA={saved:"Saved {{path}}"},uA={pageTitle:rA,subtitle:iA,agentPicker:oA,noAgent:aA,tree:sA,editor:lA,toast:cA},dA="工作区",fA="在每个 Agent 的工作目录(`AGENT_CWD`)下浏览与编辑文件。",hA={label:"Agent",placeholder:"选择一个 Agent",online:"在线",offline:"离线"},pA={title:"选择一个 Agent 来浏览其工作区",description:"每个已注册的 Agent 都有自己的 CWD。下拉列出注册表中所有已知的 Agent;名字旁的绿点表示该 Agent 当前可用。"},mA={title:"文件",loading:"加载中…",empty:"(目录为空)",up:"返回上级",rootLabel:"(工作区根目录)",binary:"二进制",symlinkEscape:"符号链接指向工作区外,已隐藏",broken:"不可读"},gA={noFile:"从左侧选择一个文件查看或编辑。",binary:"该文件是二进制(base64 编码)— 不支持编辑。",truncated:"文件超过 1 MiB;仅显示前 1 MiB。直接保存会用截断内容覆盖整个文件 — 请关闭而不要保存。",truncatedBadge:"已截断",save:"保存",saving:"保存中…",savedMeta:"已保存 · {{size}} 字节 · {{at}}",dirtyHint:"有未保存的修改",loadFailed:"加载文件失败"},yA={saved:"已保存 {{path}}"},bA={pageTitle:dA,subtitle:fA,agentPicker:hA,noAgent:pA,tree:mA,editor:gA,toast:yA},vA="Observability",xA="Operational health: invocation totals, top-N leaderboards, and the audit timeline.",wA={health:"Health",topn:"Top-N",audit:"Audit"},kA={label:"Window",days_one:"{{count}} day",days_other:"{{count}} days"},SA={title:"Health",totals:"Totals",byDay:"By day",kpi:{calls:"Calls",cost:"Cost",errors:"Errors",errorRate:"Error rate",avgLatencyMs:"Avg latency",p95LatencyMs:"P95 latency"},byDayCol:{date:"Date",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data in this window",description:"No invocations recorded in the selected time window. Widen the window or wait for an agent call to fire."}},AA={title:"Top-N",filter:{dim:"Group by",metric:"Rank by"},dim:{user:"User",agent:"Agent",platform:"Platform",intent:"Intent"},metric:{cost:"Cost",calls:"Calls",errors:"Errors",avg_latency:"Avg latency"},col:{rank:"#",key:"Key",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data",description:"No invocations matched the filters."}},CA={title:"Audit",stats:{total:"Total",totalCost:"Total cost"},filter:{agent:"Agent",platform:"Platform",user:"User",intent:"Intent"},col:{ts:"Time",trace:"Trace",agent:"Agent",platform:"Platform",user:"User",intent:"Intent",duration:"Duration",cost:"Cost",outcome:"Outcome"},outcome:{ok:"ok",fail:"fail"},empty:{title:"No invocations",description:"Audit rows appear here when an agent is invoked. Adjust filters or widen the window."}},EA={pageTitle:vA,subtitle:xA,tabs:wA,window:kA,health:SA,topn:AA,audit:CA},RA="观测",TA="运行健康:调用总量、Top-N 排行与审计时间线。",PA={health:"健康",topn:"排行",audit:"审计"},IA={label:"时间窗口",days_one:"{{count}} 天",days_other:"{{count}} 天"},LA={title:"健康",totals:"总览",byDay:"每日明细",kpi:{calls:"调用",cost:"成本",errors:"错误",errorRate:"错误率",avgLatencyMs:"平均延迟",p95LatencyMs:"P95 延迟"},byDayCol:{date:"日期",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"时间窗口内无数据",description:"所选时间范围内没有任何调用记录。可以放宽时间窗口或等待 Agent 被调用。"}},OA={title:"Top-N",filter:{dim:"分组维度",metric:"排序依据"},dim:{user:"用户",agent:"Agent",platform:"平台",intent:"意图"},metric:{cost:"成本",calls:"调用",errors:"错误",avg_latency:"平均延迟"},col:{rank:"#",key:"键",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"暂无数据",description:"当前筛选下没有调用记录。"}},NA={title:"审计",stats:{total:"累计",totalCost:"累计成本"},filter:{agent:"Agent",platform:"平台",user:"用户",intent:"意图"},col:{ts:"时间",trace:"追踪 ID",agent:"Agent",platform:"平台",user:"用户",intent:"意图",duration:"耗时",cost:"成本",outcome:"结果"},outcome:{ok:"成功",fail:"失败"},empty:{title:"暂无调用",description:"当 Agent 被调用时,审计记录会出现在这里。可调整筛选或放宽时间窗口。"}},_A={pageTitle:RA,subtitle:TA,tabs:PA,window:IA,health:LA,topn:OA,audit:NA},DA="Settings",MA="Operational configuration: environment variables and service lifecycle.",jA={messengers:"Messengers",email:"Email (SMTP)",viewer:"Viewer & Maps",agents:"Agents",llm:"Agim Agent",mcp:"MCP Servers",nativeAgent:"Agim Agent",search:"Web search",mobile:"Mobile",agimSkills:"agim Skills",policy:"Policy",security:"Security",workspaces:"Workspaces",admins:"Admins",env:"Env Vars",service:"Service"},FA={title:"Agents",subtitle:"Manage bridged external agents (CLI / ACP). Agim Agent is the built-in default agent and is configured from the Agim Agent tab via Model APIs.",installHint:"Not installed. `npm install -g {{pkg}}` on the host.",nativeInstallHint:"No model API configured for Agim Agent. Open Settings → Agim Agent to add one (OpenAI / DeepSeek / Anthropic / …).",inProcessBadge:"built-in",inProcessHint:"built-in — runs inside agim, no external CLI to install",agimAgentCardTitle:"Agim Agent (built-in default agent)",agimAgentCardDesc:"Agim Agent runs inside agim and uses Model APIs you configure. It is separate from bridged external agents on this page.",agimAgentCardAction:"Open Agim Agent settings",aliasesLabel:"Aliases",online:"online",offline:"offline",defaultAgent:"Default agent",defaultAgentHint:"Used when the intent classifier has no preference (new web threads, etc.). Only enabled + online agents appear here.",noEligible:"No eligible default",saveBtn:"Save",saving:"Saving…",dirtyHint:"Unsaved changes",discard:"Discard",toast:{saved:"Saved"},acp:{title:"Remote agents (ACP)",subtitle:"Agents reachable over HTTP via the Agent Communication Protocol. Each entry persists in config and registers on the next service restart.",discoverBtn:"Discover",runDiscover:"Probe",baseUrl:"Discovery URL",baseUrlHint:"Probes `<base>/.well-known/acp` and adds the entries it lists. Skips names already present.",addTitle:"Add agent",name:"Name",nameHint:"Stable identifier; letters, digits, `._-`.",aliases:"Aliases",aliasesHint:"Comma-separated; routed via `/alias` in chat.",endpoint:"Endpoint",endpointHint:"Base URL of the agent's ACP root (no trailing `/`).",authType:"Auth",auth:{none:"None",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"Paste token",testBtn:"Test",addBtn:"Add",removeBtn:"Remove",on:"on",off:"off",dupName:"An agent with this name already exists.",empty:{title:"No remote agents",description:"Add an ACP endpoint below or use Discover for a `.well-known/acp` directory."},toast:{staged:"Added — click Save to apply.",testOk:"Reached `{{name}}`",testMasked:"Save first — token is masked, can't test in place.",discoverEmpty:"Nothing new to add.",discoverAdded_one:"Added {{count}} agent.",discoverAdded_other:"Added {{count}} agents."}}},UA={title:"Policy & toggles",subtitle:"Frequently used switches backed by environment values. Each toggle is saved immediately and usually takes effect at once; a few settings still require a service restart.",savingToast:"Saved",safety:{title:"Skip permissions (DANGEROUS)",description:"When ON, the Claude Code adapter passes `--dangerously-skip-permissions` to the wrapped CLI, bypassing every tool-use confirmation. Recommended OFF for production. Only enable for trusted, isolated workspaces.",envKey:"IMHUB_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"production deployments should keep this OFF"},approval:{title:"Approval timeout default",description:'What the approval bus does when a pending tool-use request expires with no human reply. `Deny` is the safe default and keeps write-side calls (Bash / Edit / Write) gated; `Allow` is "user away" mode and lets the agent keep moving.',envKey:"IMHUB_TIMEOUT_DEFAULT",valDeny:"Deny on timeout",valAllow:"Allow on timeout"},memory:{title:"Long-term memory",description:"Master switch for the per-user memory subsystem (facts + persona + vector retrieval). Disabling stops new fact extraction and persona consolidation; the existing bank stays on disk.",envKey:"IMHUB_MEMORY_ENABLED"},viewer:{title:"Long-message viewer",description:"When ON, IM replies that exceed the viewer threshold are uploaded to the local paste store and the IM message becomes a short URL the user can click. Without it, long replies get truncated by the messenger.",envKey:"IMHUB_VIEWER_ENABLED"},a2aNotify:{title:"A2A notify mode",description:"How verbose the bus is when one agent calls another. `essential` (default) sends only headline events; `verbose` includes every transition; `off` silences cross-agent notifications entirely.",envKey:"IMHUB_A2A_NOTIFY_MODE",valEssential:"Essential",valVerbose:"Verbose",valOff:"Off"}},HA={title:"Messengers",subtitle:"Per-IM-platform connection settings. Toggle a platform on, fill in its credentials, and Save. The next service restart picks up the new config.",saveAll:"Save all",saving:"Saving…",savedToast:"Configuration saved",discardAll:"Discard changes",dirtyHint:"Unsaved changes",platform:{wechat:"WeChat",telegram:"Telegram",feishu:"Feishu (Lark)",dingtalk:"DingTalk",discord:"Discord"},hint:{wechat:"iLink-based QR login. Click Scan, scan the QR with your phone WeChat, confirm — the bot logs in as that account.",telegram:"Bot API token from @BotFather; channel id is optional and only used when targeting a specific chat.",feishu:"App credentials from the Lark developer console. App must have the messaging scopes.",dingtalk:"Stream API client credentials from the DingTalk developer console.",discord:"Bot token from the Discord developer portal. The bot must be invited to the target channel."},enabled:"Enabled",disabled:"Disabled",scanQr:"Scan QR",fields:{botToken:"Bot token",appId:"App ID",appSecret:"App secret",clientId:"Client ID",clientSecret:"Client secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"DM policy",groupPolicy:"Group policy",allowFrom:"DM allowFrom (staffIds, comma-separated)",groupAllowFrom:"Group allowFrom (staffIds, comma-separated)",ackReaction:"Ack-reaction",policy:{open:"open — anyone may talk",pairing:"pairing — first DMer pinned",allowlist:"allowlist — only listed IDs",disabled:"disabled — bot ignores groups"},ack:{off:"off — no ack glyph",emoji:"emoji ⏳→✅",kaomoji:"kaomoji (text-face)"},accountsTitle:"Extra accounts",accountDisabled:"disabled",accountsHint:"Each entry starts its own DWClient with isolated dmPolicy / allowFrom / ack-reaction. Restart agim after Save for new accounts to take effect.",accountsEmpty:"No extra accounts yet. Click ‘+ add account’ to wire another DingTalk bot.",addAccount:"Add account",accountName:"Display name (optional)",accountRenameCollision:'An account with id "{{id}}" already exists; pick another id.'},qr:{title:"Scan WeChat QR",description:"Open WeChat on your phone, scan this code, then confirm the login prompt inside WeChat.",starting:"Starting QR session…",loadFailed:"Failed to start QR session",expired:"QR code expired — close and start a new one.",cancelled:"Cancelled.",confirmed:"Login confirmed — wechat-ilink will start on the next service restart."}},BA={title:"Email (SMTP)",subtitle:"Outbound mail delivery for `/remind email me@x.com …`. Credentials persist to `~/.agim/.env`. Leave blank to disable.",cardTitle:"SMTP credentials",statusOn:"configured",statusOff:"disabled",host:"Host",hostHint:"Mail server hostname (e.g. `smtp.gmail.com`).",port:"Port",portHint:"Usually 465 (SSL) or 587 (STARTTLS).",user:"Username",userHint:"Login email; often the sender address too.",pass:"Password / app token",passHint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",from:"From",fromHint:"Sender header. Defaults to the username when blank.",secure:"TLS mode",secureHint:"`auto` follows the port; force SSL or STARTTLS if your provider requires it.",secureAuto:"auto (port-based)",secureTrue:"true (SSL, port 465)",secureFalse:"false (STARTTLS, port 587)",reveal:"Reveal",hide:"Hide",testBtn:"Test connection",testNeedsConfigured:"Save host / user / password first.",disableBtn:"Disable SMTP",saveBtn:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"SMTP saved",disabled:"SMTP disabled",noChanges:"Nothing to save"}},zA={title:"Viewer & Maps",subtitle:"Public-facing surfaces: the long-message Viewer (turns >threshold replies into a `/v/<id>` short link) and Baidu Maps AK (drives `/memo` address geocoding).",reveal:"Reveal",hide:"Hide",save:"Save",saving:"Saving…",discard:"Discard",dirtyHint:"Unsaved changes",toast:{saved:"Viewer settings saved"},viewer:{title:"Viewer (long-message links)",subtitle:"Replies longer than the chars / lines threshold are uploaded to the local paste store and the IM message becomes a short `/v/<id>` link.",on:"enabled",off:"disabled",enableLabel:"Enable the long-message Viewer",publicUrl:"Public base URL",publicUrlHint:"What the operator's reverse proxy / tunnel exposes. Used to build `/v/<id>` links.",tunnelMode:"Tunnel mode",tunnelOff:"off (use Public base URL)",tunnelQuick:"quick (cloudflared)",tunnelHint:"`quick` launches a Cloudflare quick tunnel and uses its URL when the operator hasn't fronted agim themselves.",remotePasteUrl:"Remote paste URL",remotePasteUrlHint:"POST markdown here to get a public URL back; overrides Public base URL + tunnel. Leave empty to use the community default https://viewer.iclaw.host/paste.",remotePasteToken:"Remote paste bearer token",remotePasteTokenHint:"Optional bearer token sent to the remote paste server. Required only if your paste server protects POSTs.",noDefaultRemote:"Disable community default",noDefaultRemoteLabel:"Don't fall back to viewer.iclaw.host when nothing else is configured",noDefaultRemoteHint:"When no mode is configured, agim falls back to viewer.iclaw.host. Enable this to disable that fallback (long content stays inline unless another mode is configured).",tunnelStatus:"Tunnel status",refreshTunnel:"Refresh",tunnelRunning:"Running",yes:"yes",no:"no",tunnelUrl:"Live URL",effectiveUrl:"Effective URL",binary:"cloudflared binary",binaryMissing:"not found in PATH — install from cloudflare/cloudflared releases",lastError:"Last error",tunnelLoading:"Loading tunnel status…",thresholds:"Thresholds",chars:"Max chars",charsHint:"Replies above this length route through Viewer.",lines:"Max lines",linesHint:"Same routing decision, on line count.",codeLines:"Max code lines",codeLinesHint:"Lower threshold for replies inside code fences.",maxPastes:"Paste store cap",maxPastesHint:"Older pastes are evicted FIFO once the count exceeds this."},baidu:{title:"Baidu Maps AK",subtitle:"Enables `/memo` address-to-coords lookup. Without it, /memo still works via raw coords or browser GPS share. Free AK: lbsyun.baidu.com → Console → Application → Server-side API.",configured:"configured",empty:"not set",placeholder:"32-char AK starting with a non-digit",hint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",suspicious:"AK length is {{length}} — usually a Baidu AK is 32 characters. Double-check?",clear:"Clear AK",toast:{saved:"Baidu Maps AK saved",cleared:"Baidu Maps AK cleared"}}},$A={title:"Workspaces",subtitle:"Multi-tenant workspace registry. Each workspace has its own agent whitelist, rate-limit, and (optionally) member list. The `default` workspace catches every unrouted user.",empty:{title:"Only the default workspace",description:"Add a workspace below to partition a team / project / customer. Each one gets its own agent whitelist + rate-limit."},col:{id:"ID",name:"Name",agents:"Agents",members:"Members",rateLimit:"Rate limit"},rateLimitFormat:"{{rate}} per {{intervalSec}}s, burst {{burst}}",membersOpen:"open (any user)",membersCount_one:"{{count}} member",membersCount_other:"{{count}} members",edit:"Edit",form:{title:"Add or edit a workspace",subtitleEdit:"Editing existing workspace — change id to clone, keep to upsert.",id:"ID",idHint:"Stable identifier; [a-zA-Z0-9_-]+; the special name `default` is reserved.",name:"Display name",agents:"Agent whitelist",agentsHint:"Comma-separated; empty = allow every registered agent.",members:"Member user IDs",membersHint:"Comma-separated `platform:userId`; empty = open workspace.",rateLimit:"Rate limit (optional)",rate:"Calls",intervalSec:"Per (seconds)",burst:"Burst",submit:"Save workspace",reset:"Clear form"},toast:{saved:"Workspace saved"}},VA={title:"Service",subtitle:"Inspect the running agim process + start, stop, or restart it.",modeLabel:"Mode",pidLabel:"PID",uptimeLabel:"Uptime",webLabel:"Web",bootPhaseLabel:"Boot phase",mode:{systemd:"systemd",background:"background",foreground:"foreground",none:"not running"},actions:{start:"Start",stop:"Stop",restart:"Restart",confirmStop:"Stop the agim service?",confirmStopDesc:"The web console, the messenger adapters, and any in-flight job will all stop. You'll need to start the service again before you can use it.",confirmRestart:"Restart the agim service?",confirmRestartDesc:"The process stops and re-starts. In-flight jobs are cancelled; outbox + queued reminders survive the bounce. The web console will be unreachable for ~5-30 seconds."},toast:{started:"Service started",stopped:"Service stopped",restarted:"Service restarted"},ports:{title:"Ports",subtitle:"Which ports agim binds when started. Leave blank to use the default. Changes apply on the next service restart (use the Restart button below after saving).",webPort:"Web port",webPortHint:"HTTP server for the chat UI + REST API. Default: {{default}}.",acpPort:"ACP port",acpPortHint:"Agent Communication Protocol server (remote agent surface). Default: {{default}}.",invalidPort:"Must be a number between 1 and 65535.",restartRequired:"Restart required",save:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"Ports saved — restart agim to bind the new ports"}}},KA={title:"Security",subtitle:"Tool sandbox, SSRF protection, sender allowlist, and runtime diagnostics. Changes are saved to the env file immediately. Most native tools read process.env per call; exec sandbox and sender allowlist still require a service restart.",diagnostics:{title:"Runtime diagnostics",runningAsRoot:"Running as root",runningAsRootHelp:"Tool calls run with root privileges. Recommend creating a dedicated user + setting User= in the systemd unit.",envFilePerms:"Env file permissions",envFilePermsLax:"Too permissive (group/world readable)",envFilePermsOk:"0600 (owner-only)",bwrapAvailable:"bubblewrap installed",bwrapMissing:"Not installed (apt install bubblewrap)",senderAllowlist:"Sender allowlist",senderAllowlistOff:"Not configured (open access)",senderAllowlistOn:"Configured",adminAllowlist:"Admin allowlist",adminAllowlistOff:"Not configured (populated after first /setup)",adminAllowlistOn:"Configured"},sender:{title:"Sender allowlist (who can talk to the bot)",description:"Comma-separated platform:userId pairs, e.g. telegram:8754479311,wechat-ilink:wxid_abc. Set to * to mark 'everyone explicitly allowed'. Empty = open access (preserves backward compatibility; startup logs OPEN_IM_ACCESS).",envKey:"IMHUB_ALLOWED_USERS",placeholder:"platform:userId,platform:userId"},exec:{title:"Native exec tool",description:"Sandbox + timeout controls for native_exec. Each invocation also goes through an IM approval card (unless previously auto-allowed by fingerprint).",sandbox:"Sandbox backend",sandboxNone:"None (plain spawn)",sandboxBwrap:"bubblewrap (Linux only)",sandboxBwrapMissing:"bubblewrap not installed",sandboxNet:"Sandbox network",sandboxNetOn:"Allowed (default)",sandboxNetOff:"Blocked (--unshare-net)",timeoutMs:"Command timeout (ms, default 60000)",maxOutput:"Per-stream output cap (bytes, default 32768)"},web:{title:"Native web tools",description:"SSRF defense and timeouts. CIDR whitelist lets you allow Tailscale / 100.64.0.0/10 / VPN ranges back in.",allowPrivate:"Allow all private ranges (not recommended)",allowPrivateHelp:"= 1 disables all private-IP checks. Only for trusted internal deployments.",ssrfWhitelist:"SSRF CIDR whitelist",ssrfWhitelistPlaceholder:"100.64.0.0/10,10.20.0.0/16",timeoutMs:"fetch / search timeout (ms, default 30000)"},fs:{title:"Native filesystem tools",description:"fs tools default to the native agent's per-thread workspace subtree.",restrict:"Restrict to workspace",restrictOn:"ON (recommended)",restrictOff:"OFF (allow any path; sensitive-paths denylist still applies)",timeoutMs:"fs tool timeout (ms, default 60000)"},delegation:{title:"Native call_agent cap",description:"Max mcp__imhub__call_agent invocations per turn. Prevents native from spinning on infinite delegations. 0 = unlimited.",envKey:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN",valueLabel:"default 2"},platformBlacklist:{title:"IM platform blacklist",description:"Comma-separated platform ids. Listed platforms are hidden from the CLI wizard, from this admin page, and registry.registerMessenger refuses to register them at boot — even if their credentials still live in the env file the adapter won't come up. Default empty (no blocks). Common ids: wechat-ilink / telegram / feishu / dingtalk / discord / email.",envKey:"IMHUB_PLATFORM_BLACKLIST",placeholder:"telegram,discord",currentLabel:"Currently in force"},diagnosticsPlatformBlacklist:"Platform blacklist",savingToast:"Saved.",resetTitle:"Reset to default"},WA={title:"IM admin registry",subtitle:"Web admin tokens decide who can run IM admin-tier commands. Candidate IM users are auto-discovered after they send any message to agim.",configured:"Allowlist configured",notConfigured:"No IM admin configured yet.",empty:"No admins added yet.",col:{platform:"Platform",userId:"User ID"},known:{title:"Discovered IM users",hint:"Users appear here automatically after they talk to agim. Grant admin directly from this list.",count:"Discovered users: {{count}}",empty:"No discovered IM users yet.",emptyHint:"Ask the user to send one message to agim first.",col:{lastSeen:"Last seen"},promote:"Grant admin",alreadyAdmin:"Already admin"},remove:{label:"Remove",confirmTitle:"Remove this admin?",confirmDescription:"They lose access to all admin-tier commands. Re-add to restore."},toast:{added:"Admin added",removed:"Admin removed"}},qA={title:"Agim Agent Settings",subtitle:"Configure Agim Agent by adding model APIs and runtime behavior in one place. API metadata is saved in ~/.agim/config.json; API keys are saved in ~/.agim/llm-secrets.json (0600) or AGIM_LLM_SECRET_<NAME>.",refresh:"Refresh",backendsTitle:"APIs ({{count}})",backendsEmpty:"No model APIs configured yet. Add one below.",rolesTitle:"Role Bindings (optional, advanced)",rolesOptionalHint:"Role bindings are optional. Native auto-uses any usable API.",addTitle:"Add API",col:{name:"Name",provider:"Provider",model:"Model",baseUrl:"Base URL",apiKey:"API Key",actions:"Actions"},secretMissing:"missing",ping:"Ping",remove:"Remove",pinging:"pinging…",setKeyFirst:"set API key first",pingHint:"send a tiny chat probe",removeConfirm:'Remove API "{{name}}"? Role bindings and API key will be cleared.',removedToast:"Removed (also cleared {{count}} role binding(s)).",roleUpdated:"Updated role {{role}}",unset:"(unset)",unbound:"(unbound)",roleHint:{cheap:"Used by built-in helper tasks such as memory extraction and intent classification.",evaluator:"Used by notification evaluation and route comparison.","native-chat":"Preferred for /agim chat (/na still works). If unbound, Agim Agent auto-falls back to any usable API."},preset:"Provider preset",name:"Name",namePlaceholder:"e.g. deepseek-cheap",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",model:"Model",modelPlaceholder:"model-id",apiKey:"API Key",apiKeyPlaceholder:"sk-...",addBackend:"Add API",invalidPreset:"invalid preset",nameRequired:"name required",baseUrlRequired:"baseUrl required",modelRequired:"model required",apiKeyRequired:"API key required",addedWithKey:'Added API "{{name}}"',agimAgentRuntimeTitle:"Agim Agent runtime settings",agimAgentRuntimeHint:"Behavior controls below apply to Agim Agent. Model APIs above decide which models it uses.",presets:{deepseek:"DeepSeek",moonshot:"Moonshot Kimi",zhipu:"Zhipu GLM",openai:"OpenAI",anthropic:"Anthropic",custom:"Custom"}},QA={title:"External MCP Servers",subtitle:"Tools from these servers are exposed to the built-in Agim Agent (via mcp_<server>_<tool> naming). CLI agents keep their own MCP configs and ignore this list. Header values may contain bearer tokens, so this page is admin-only.",refresh:"Refresh",serversTitle:"Servers ({{count}})",serversEmpty:"No MCP servers configured. Add one below — common picks: filesystem, github, postgres.",totalTools:"total tools: {{count}}",addTitle:"Add Server",col:{name:"Name",transport:"Transport",target:"Target",runtime:"Runtime",actions:"Actions"},transportStdio:"stdio",transportSse:"SSE",transportHttp:"http",runtimeUnknown:"unknown",runtimeConnected:"connected · {{count}} tools",runtimeConnectedOne:"connected · {{count}} tool",runtimeDisconnected:"disconnected",health:"Health",remove:"Remove",probing:"probing…",removeConfirm:'Remove MCP server "{{name}}"?',removedToast:'Removed "{{name}}"',nameRequired:"name required",commandRequired:"command required for stdio transport",urlRequired:"url required for http/sse transport",headersInvalid:"headers must be valid JSON",addedToast:'Added "{{name}}"',nameLabel:"Name",namePlaceholder:"e.g. filesystem",transportLabel:"Transport",transportStdioOption:"stdio (subprocess)",transportHttpOption:"http / SSE",commandLabel:"Command",commandPlaceholder:"e.g. npx",argsLabel:"Args (space-separated)",urlLabel:"URL",urlPlaceholder:"https://example.com/mcp",headersLabel:"Headers (JSON, optional)",headersPlaceholder:'{"Authorization":"Bearer …"}',addServer:"Add Server"},GA={title:"Agim Agent · Evaluator · Heartbeat",subtitle:"Runtime controls for Agim Agent and two LLM-based gates (notification evaluator, heartbeat). Model APIs and optional role bindings are configured above on this page.",llmLink:"/settings/llm",refresh:"Refresh",unsaved:"unsaved changes",discard:"Discard",save:"Save",savedToast:"Saved.",agentCard:"Agim Agent (built-in)",evaluatorCard:"Notification Evaluator",heartbeatCard:"Heartbeat Scheduler",on:"on",off:"off",roleOverride:"Role override",roleHint:"Agim Agent prefers this role first; when no role resolves, it auto-falls back to any usable API. Role bindings are optional.",approvalMode:"Approval mode",approvalHint:"How tool calls from the Agim Agent loop are gated.",modeReadOnly:"read-only (safe default)",modeAllowList:"allow-list (only autoAllow entries)",modeAllowAll:"allow-all (every tool, no gate)",modeDenyAll:"deny-all (no tools)",autoAllow:"Auto-allow tool prefixes",autoAllowHint:"Comma-separated. Tool names starting with any entry bypass the gate (e.g. native_,mcp_filesystem_).",denyList:"Deny-list tool prefixes",denyListHint:"Comma-separated. Always rejected regardless of mode (e.g. mcp_shell_).",evalDesc:"LLM gate that filters routine / empty agent-initiated push messages. Uses the evaluator role. Fail-open: LLM error or missing API → message is delivered.",enableGate:"Enable gate",filterViaLlm:"Filter via LLM",evalSources:"Sources to gate",evalSourcesHint:"Comma-separated subset of: push, notify, reminder, heartbeat. Empty = default push,heartbeat.",hbDesc:"Periodic proactive wake-up loop. With this off, /heartbeat bind still works (saves the binding) but no scans run. Three-phase tick: DECIDE → EXECUTE → EVALUATE.",enableScheduler:"Enable scheduler",startScanLoop:"Start scan loop",tickInterval:"Tick interval (ms)",tickHint:"How often the scan loop checks due bindings. Default 60000.",defaultInterval:"Default binding interval (min)",defaultIntervalHint:"Minutes between ticks when a binding didn't specify one. Default 15.",runtimeCard:"Runtime caps",runtimeDesc:"Limits for Agim Agent tool calls and retries. Leave blank to use defaults.",toolResultCap:"Max tool-result chars",toolResultCapHint:"IMHUB_NATIVE_TOOL_RESULT_MAX_CHARS. Truncates + appends a note. Default 64000.",toolTimeoutMs:"Per-tool timeout (ms)",toolTimeoutHint:"IMHUB_NATIVE_TOOL_TIMEOUT_MS. Default 60000 (60 s).",blankRetryMax:"Blank-response retries",blankRetryHint:"IMHUB_NATIVE_BLANK_RETRY_MAX. Times to retry when the model returns empty text. Default 1.",lengthRecoveryMax:"Length-truncation continues",lengthRecoveryHint:"IMHUB_NATIVE_LENGTH_RECOVERY_MAX. Times to auto-continue on finishReason=length. Default 1.",a2aCard:"A2A sub-agent delegation",a2aDesc:"Controls for model-triggered `mcp__imhub__call_agent`, including depth and timeout limits. Agim→Agim calls use the built-in fast path by default.",a2aMaxDepth:"Max recursion depth",a2aMaxDepthHint:"IMHUB_A2A_MAX_DEPTH. Hard cap on nested call_agent chains. Default 1.",a2aTimeoutMs:"Default timeout (ms)",a2aTimeoutMsHint:"IMHUB_A2A_TIMEOUT_DEFAULT_MS. Default 1800000 (30 min).",callAgentInProcess:"Agim→Agim built-in path",callAgentInProcessHint:"IMHUB_NATIVE_CALL_AGENT_IN_PROCESS. Off falls back to the CLI subprocess. Default on.",callAgentMaxPerTurn:"Calls per turn cap",callAgentMaxPerTurnHint:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN. 0 = unlimited. Default 2.",criticCard:"Early stop and critic",criticDesc:"Semantic stuck-loop kills 3-strike same-intent across tools. Critic is an opt-in goal-divergence detector.",semanticStuckLoop:"Semantic stuck-loop",semanticStuckLoopHint:"IMHUB_NATIVE_SEMANTIC_STUCK_LOOP. Enabled by default. Turn off to disable semantic cross-tool deduplication.",criticEnabled:"Goal critic",criticEnabledHint:"IMHUB_NATIVE_CRITIC. Off by default; on enables off-track early-stop reviews.",criticRole:"Critic LLM role",criticRoleHint:"IMHUB_NATIVE_CRITIC_ROLE. Optional override (else uses main API).",planModeDefault:"PlanMode default state",planModeDefaultHint:"IMHUB_NATIVE_PLAN_MODE. Default off; `/plan on` toggles per-thread regardless.",planIntentAuto:"Auto-enter plan mode",planIntentAutoHint:"IMHUB_PLAN_INTENT_AUTO. When on, a prompt containing 先想想 / plan only / don't act yet temporarily enables plan mode for THAT turn only. Never auto-exits — user must /plan off or model must call native_exit_plan_mode.",planIntentPhrases:"Plan-intent phrase list (optional override)",planIntentPhrasesHint:"IMHUB_PLAN_INTENT_PHRASES. Comma-separated. Empty = use built-in CN/EN defaults. Matching is case-insensitive substring.",compactCard:"Auto-compaction",compactDesc:"Summarize older turns when the conversation gets long, while preserving recent messages and the original goal context.",compactTriggerChars:"Trigger chars",compactTriggerCharsHint:"IMHUB_NATIVE_COMPACT_TRIGGER_CHARS. Set 0 to disable. Default 60000.",compactKeepTurns:"Keep last N pairs",compactKeepTurnsHint:"IMHUB_NATIVE_COMPACT_KEEP_TURNS. Tail size in user/assistant turns. Default 6.",compactKeepFirst:"Keep first N user msgs",compactKeepFirstHint:"IMHUB_NATIVE_COMPACT_KEEP_FIRST. Preserves the earliest user goals. Default 1.",compactSummaryChars:"Summary char cap",compactSummaryCharsHint:"IMHUB_NATIVE_COMPACT_SUMMARY_CHARS. Cap on the LLM-generated summary. Default 1500.",streamCard:"Streaming and iteration",streamDesc:"Streaming preserves partial text on IM's 30-min hard timeout. Max-iter is the worst-case tool-call ceiling.",streamPartial:"Stream partial",streamPartialHint:"IMHUB_NATIVE_STREAM_PARTIAL. Default on; off uses legacy non-stream path.",maxIter:"Max iterations",maxIterHint:"IMHUB_NATIVE_AGENT_MAX_ITER. Clamped to [1,100]. Default 50."},YA={title:"Web search providers",subtitle:"Provider chain for native_web_search. On errors, requests fall through to the next provider. Clear a key to remove it; type to overwrite. Changes apply immediately.",refresh:"Refresh",save:"Save",discard:"Discard",unsaved:"Unsaved changes",savedToast:"Saved. Next search will use the new chain.",chainLabel:"Active chain:",chainEmpty:"no providers available",chainHint:"Resolved from IMHUB_WEB_SEARCH_PROVIDERS; only entries whose available() is true appear.",configured:"configured",missingKey:"missing key",noKey:"no key needed",moveUp:"Move up",moveDown:"Move down",testBtn:"Test",clearKey:"Clear",placeholderConfigured:"Saved (hidden) — leave blank to keep",placeholderEnter:"Enter new key",keyHint:"On Save, value is written to ~/.agim/env under {{envKey}}.",testOk:"{{provider}} ✓ {{hits}} hits / {{ms}} ms",testFail:"{{provider}} ✗ {{error}}"},XA={title:"Mobile sign-in QR",subtitle:"Generate a single QR code an operator can scan with a phone to open /m/chat. The scanned URL carries a fresh role=user token; on first scan the phone gets an auth cookie and lands inside the mobile chat.",generateCard:"Generate QR",generateDesc:"Each click mints a NEW token (the previous QR keeps working until you revoke it). Operators with phones already signed in are not affected.",hostLabel:"Override host (optional)",hostPlaceholder:"leave blank to auto-detect",hostHint:"By default the URL uses the same hostname:port this admin tab opened on. Override if your phone reaches agim via a different domain (e.g. cloudflared tunnel).",generate:"Generate QR",regenerate:"Regenerate",generating:"Generating…",generatedToast:"QR generated. Scan within sight of the screen.",scanCard:"Scan from your phone",scanDesc:"Open the phone camera, point it at the QR. The phone will sign in once and stay signed in until the token is revoked.",tokenLabel:"Label",urlLabel:"Embedded URL",urlHint:"Anyone with this URL can sign in as the user role. Keep it private; treat it like a password.",tokenIdLabel:"Token id",tokenIdHint:"Use this to find the token in the security page when you want to revoke it.",warningTitle:"Treat the QR like a password.",warningBody:"Scanned tokens persist until revoked. If a phone is lost, revoke the matching mobile-via-qr-* token in Security.",revokeLink:"Manage / revoke tokens →",copied:"URL copied",copyFailed:"Copy failed; long-press the URL field instead.",showUrl:"Show URL",hideUrl:"Hide URL",copyUrl:"Copy URL",qrAlt:"QR code for mobile chat sign-in"},JA={title:"System Prompt Skill Injection",subtitle:"Tune the skill summary block injected into every system prompt. When the override file is non-empty, it replaces the auto-generated block (routing header and always-on skill bodies are still preserved).",autoLabel:"Auto-generated (read-only preview)",overrideLabel:"Operator override (saved on Save)",overridePlaceholder:"Leave empty to use auto. Common pattern: copy auto above, prune families you don't need, or prepend routing hints at the top.",overrideActive:"Override active",overrideInactive:"Auto-generated",largeWarn:"Large block — watch your token budget",copyToOverride:"Copy to override",save:"Save",clear:"Clear override",savedToast:"Saved. Next turn picks it up.",clearedToast:"Override cleared. Back to auto.",refreshedToast:"Auto preview refreshed.",rebuild:"Rebuild auto block",rebuildTooltip:"Rescan all SKILL.md on disk and regenerate the auto-generated block above (override below is unaffected).",rebuiltToast:"Rescanned and rebuilt the auto-generated block. Picks up next turn.",overLimitToast:"Body is {{len}} chars, over the {{max}} limit",confirmClear:"Delete the override file and revert to auto-generated?",hint:"No restart needed; the next system-prompt build reads the latest content."},ZA={title:"agim Skills",tab:{installed:"Installed",hot:"skillhub Hot",injection:"Prompt Injection"},group:{framework:"Framework (agim-*)",builtin:"Agim builtin (non-ECC)",workspace:"Workspace (operator-installed)",eccPicks:"ECC recommended picks",eccRemainder:"ECC remainder"},searchPlaceholder:"Filter skills by name or description...",searchEmpty:"No matching skills.",reload:"Reload from disk",subtitle:"SKILL.md files loaded by src/core/skills/loader.ts. Tier-1 summary (name + description) is auto-injected into every agent system prompt; full body is read on-demand via mcp__imhub__read_skill. Workspace skills shadow bundled builtin skills by name.",reloadedToast:"Reloaded — {{count}} skill(s) on disk",selectHint:"Select a skill on the left, or click New to create one.",emptyList:"No skills loaded. Click New to create one (lands at ~/.agim/skills/<name>/SKILL.md).",unavailable:"unavailable",alwaysOn:"always-on",sourceWs:"ws",sourceBuiltin:"builtin",notFound:"Not found.",sourceWorkspace:"workspace",sourceBuiltinReadonly:"builtin (read-only via UI)",builtinShadowHint:"Builtin shown for reference. Save creates a workspace shadow that overrides it.",delete:"Delete",save:"Save",saveShadow:"Save (create workspace shadow)",savedToast:'Saved "{{name}}"',deleteConfirm:'Delete workspace skill "{{name}}"? The builtin (if any) will become visible again.',deletedToast:'Deleted "{{name}}"',new:"New",newTitle:"New skill",newName:"Skill name",newNamePlaceholder:"my-skill",newCreate:"Create",createdToast:'Created "{{name}}"',nameRequired:"name required",invalidNameChars:"Name may only use letters, numbers, and . _ -",pathLabel:"Workspace path:",binsLabel:"Required bins:",envLabel:"Required env:",none:"none"},eC={pageTitle:DA,subtitle:MA,tabs:jA,agents:FA,policy:UA,messengers:HA,email:BA,viewerSettings:zA,workspaces:$A,service:VA,security:KA,admins:WA,llm:qA,mcp:QA,nativeAgent:GA,search:YA,mobile:XA,skillInjection:JA,agimSkills:ZA},tC="设置",nC="运维配置:环境变量与服务生命周期。",rC={messengers:"IM 平台",email:"邮件 (SMTP)",viewer:"Viewer & 地图",agents:"Agents",llm:"Agim Agent",mcp:"MCP 服务器",nativeAgent:"Agim Agent",search:"Web 搜索",mobile:"手机端",agimSkills:"agim Skills",policy:"策略",security:"安全",workspaces:"工作区",admins:"管理员",env:"环境变量",service:"服务"},iC={title:"Agents",subtitle:"这里管理桥接的外部 Agent(CLI / ACP)。Agim Agent 是系统内置默认 Agent,在「Agim Agent」页通过大模型 API 配置。",installHint:"未安装。在宿主机执行 `npm install -g {{pkg}}`。",nativeInstallHint:"Agim Agent 尚未配置大模型 API。前往 设置 → Agim Agent 添加一个 API(OpenAI / DeepSeek / Anthropic 等)即可使用。",inProcessBadge:"内置",inProcessHint:"内置运行 — 在 agim 进程内执行,无需安装外部 CLI",agimAgentCardTitle:"Agim Agent(系统内置默认Agent)",agimAgentCardDesc:"Agim Agent 运行在 agim 进程内,通过你配置的大模型 API 提供能力;与本页桥接的外部 Agent 是两类能力。",agimAgentCardAction:"打开 Agim Agent 配置",aliasesLabel:"别名",online:"在线",offline:"未就绪",defaultAgent:"默认 Agent",defaultAgentHint:"意图分类无判定时使用(新建 web 线程等)。下拉只列出已启用且在线的 Agent。",noEligible:"无可选默认",saveBtn:"保存",saving:"保存中…",dirtyHint:"有未保存改动",discard:"放弃改动",toast:{saved:"已保存"},acp:{title:"远程 Agent (ACP)",subtitle:"通过 Agent Communication Protocol 接入的 HTTP Agent。每个条目持久化到 config,下次服务重启时注册。",discoverBtn:"批量发现",runDiscover:"探测",baseUrl:"发现地址",baseUrlHint:"探测 `<base>/.well-known/acp` 并追加返回的 Agent;同名条目自动跳过。",addTitle:"新增 Agent",name:"名称",nameHint:"稳定标识;只允许 字母 数字 `._-`。",aliases:"别名",aliasesHint:"逗号分隔;在 IM 内通过 `/alias` 路由。",endpoint:"Endpoint",endpointHint:"Agent 的 ACP 根路径(不带尾部 `/`)。",authType:"鉴权",auth:{none:"无",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"粘贴 token",testBtn:"测试",addBtn:"新增",removeBtn:"移除",on:"已启用",off:"已停用",dupName:"已存在同名 Agent。",empty:{title:"暂无远程 Agent",description:"下方填写 ACP endpoint 新增,或使用「批量发现」自动从 `.well-known/acp` 导入。"},toast:{staged:"已暂存,点击「保存」生效。",testOk:"已联通 `{{name}}`",testMasked:"Token 是掩码态,请先保存后再测试。",discoverEmpty:"没有可新增的 Agent。",discoverAdded_one:"已新增 {{count}} 个 Agent。",discoverAdded_other:"已新增 {{count}} 个 Agent。"}}},oC={title:"策略与开关",subtitle:"高频切换的开关,底层操作的是 env 值。每个开关变更后立即持久化;多数模块支持热加载,少数需要等下次服务重启。",savingToast:"已保存",safety:{title:"跳过权限确认(危险)",description:"打开后,Claude Code 适配器会向 CLI 传递 `--dangerously-skip-permissions`,跳过所有工具调用确认。生产环境强烈建议保持关闭;仅在隔离的可信工作区内启用。",envKey:"IMHUB_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"生产部署建议保持关闭"},approval:{title:"审批超时默认行为",description:'当 pending 的工具调用无人响应而超时时审批 bus 的行为。`拒绝` 是安全默认值,会让 Bash / Edit / Write 等写入调用保持阻断;`放行` 是"用户离开"模式,让 Agent 继续运行。',envKey:"IMHUB_TIMEOUT_DEFAULT",valDeny:"超时拒绝",valAllow:"超时放行"},memory:{title:"长期记忆",description:"每用户记忆子系统(事实 + persona + 向量检索)的总开关。关闭后停止抽取新事实和 persona 整理;已有数据保留在磁盘。",envKey:"IMHUB_MEMORY_ENABLED"},viewer:{title:"长消息查看器",description:"打开后,超过阈值的 IM 回复会被上传到本地 paste 存储,IM 消息变成一个可点击的短链。关闭则消息会被 IM 平台截断。",envKey:"IMHUB_VIEWER_ENABLED"},a2aNotify:{title:"A2A 通知模式",description:"Agent 间互相调用时 bus 的提示详细程度。`essential`(默认)仅发关键事件;`verbose` 包含每次状态切换;`off` 完全静默跨 Agent 通知。",envKey:"IMHUB_A2A_NOTIFY_MODE",valEssential:"关键事件",valVerbose:"详细",valOff:"关闭"}},aC={title:"IM 平台",subtitle:"各 IM 平台的连接配置。打开开关、填写凭据、保存;下次服务重启即生效。",saveAll:"全部保存",saving:"保存中…",savedToast:"配置已保存",discardAll:"放弃改动",dirtyHint:"有未保存的改动",platform:{wechat:"微信",telegram:"Telegram",feishu:"飞书",dingtalk:"钉钉",discord:"Discord"},hint:{wechat:'基于 iLink 的扫码登录。点击 "扫码登录",用手机微信扫码并在弹窗中确认;机器人以该微信账号登录。',telegram:"@BotFather 申请的 Bot Token;Channel ID 可选,仅用于定向到特定群组。",feishu:"飞书开放平台的应用凭据。应用需开启消息权限。",dingtalk:"钉钉开发者后台的 Stream API 客户端凭据。",discord:"Discord 开发者门户的 Bot Token。需将机器人邀请到目标频道。"},enabled:"已启用",disabled:"未启用",scanQr:"扫码登录",fields:{botToken:"Bot Token",appId:"App ID",appSecret:"App Secret",clientId:"Client ID",clientSecret:"Client Secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"私聊访问策略",groupPolicy:"群聊访问策略",allowFrom:"私聊白名单(staffId,英文逗号分隔)",groupAllowFrom:"群聊白名单(staffId,英文逗号分隔)",ackReaction:"ack 反馈方式",policy:{open:"开放(任何人都能对话)",pairing:"配对(第一个私聊用户会被锁定)",allowlist:"白名单(仅允许名单中的 ID)",disabled:"禁用(忽略群聊消息)"},ack:{off:"off — 不发标记",emoji:"emoji ⏳→✅",kaomoji:"kaomoji(纯文本颜文字)"},accountsTitle:"多账号 / 多机器人",accountDisabled:"已禁用",accountsHint:"每个 entry 启动独立的 DWClient,dmPolicy / allowFrom / ack-reaction 全部隔离。保存后请重启 agim 让新账号生效。",accountsEmpty:"还没有额外账号。点「+ 添加账号」接入另一个钉钉机器人。",addAccount:"添加账号",accountName:"显示名(可选)",accountRenameCollision:'已存在 id 为 "{{id}}" 的账号;请换一个 id。'},qr:{title:"扫码登录微信",description:"打开手机微信扫一扫这个二维码,然后在微信内确认登录。",starting:"正在启动 QR 会话…",loadFailed:"QR 启动失败",expired:"二维码已过期 — 关闭并重新发起。",cancelled:"已取消。",confirmed:"登录成功 — wechat-ilink 将在下次服务重启后启用。"}},sC={title:"邮件 (SMTP)",subtitle:"用于 `/remind email me@x.com …` 的对外邮件投递。凭据保存在 `~/.agim/.env`,留空即停用。",cardTitle:"SMTP 凭据",statusOn:"已配置",statusOff:"未配置",host:"Host",hostHint:"邮件服务器域名(如 `smtp.gmail.com`)。",port:"Port",portHint:"通常 465 (SSL) 或 587 (STARTTLS)。",user:"用户名",userHint:"登录邮箱;通常也是发件人地址。",pass:"密码 / 应用 Token",passHint:"保存到 `~/.agim/.env`(chmod 600)。默认遮罩,按「显示」可查看。",from:"发件人",fromHint:"发件 header;为空则使用用户名。",secure:"TLS 模式",secureHint:"`auto` 按端口判定;如运营商要求可强制 SSL 或 STARTTLS。",secureAuto:"auto(按端口)",secureTrue:"true(SSL,对应 465)",secureFalse:"false(STARTTLS,对应 587)",reveal:"显示",hide:"隐藏",testBtn:"测试连接",testNeedsConfigured:"请先保存 host / user / password。",disableBtn:"停用 SMTP",saveBtn:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"SMTP 已保存",disabled:"SMTP 已停用",noChanges:"无可保存的改动"}},lC={title:"Viewer & 地图",subtitle:"公开访问的两个外设:长消息 Viewer(超过阈值的回复转成 `/v/<id>` 短链)+ Baidu Maps AK(驱动 `/memo` 地址解析)。",reveal:"显示",hide:"隐藏",save:"保存",saving:"保存中…",discard:"放弃改动",dirtyHint:"有未保存改动",toast:{saved:"Viewer 设置已保存"},viewer:{title:"Viewer(长消息短链)",subtitle:"超过字符 / 行数阈值的回复会被上传到本地 paste 存储,IM 消息变成一条 `/v/<id>` 短链。",on:"已启用",off:"未启用",enableLabel:"启用长消息 Viewer",publicUrl:"公开基础 URL",publicUrlHint:"反代 / 隧道暴露给外网的地址。用于拼接 `/v/<id>` 短链。",remotePasteUrl:"远端 paste URL",remotePasteUrlHint:"POST markdown 到这个地址换公网链接;优先级高于 Public base URL 和 quick 隧道。留空使用社区默认 https://viewer.iclaw.host/paste。",remotePasteToken:"远端 paste Bearer Token",remotePasteTokenHint:"可选;只在你的 paste 服务要求鉴权时需要填。",noDefaultRemote:"禁用社区默认",noDefaultRemoteLabel:"未配置任何模式时不回退到 viewer.iclaw.host",noDefaultRemoteHint:"未配置任何模式时,agim 会回退到 viewer.iclaw.host。勾选后可关闭该回退(此时长内容会直接内联展示)。",tunnelMode:"隧道模式",tunnelOff:"关闭(使用上方公开 URL)",tunnelQuick:"quick(cloudflared 临时隧道)",tunnelHint:"`quick` 会本地拉起 Cloudflare quick tunnel;当运营商自己没有反代 agim 时启用。",tunnelStatus:"隧道状态",refreshTunnel:"刷新",tunnelRunning:"运行中",yes:"是",no:"否",tunnelUrl:"实时 URL",effectiveUrl:"生效 URL",binary:"cloudflared 二进制",binaryMissing:"PATH 中未找到 — 请从 cloudflare/cloudflared releases 安装",lastError:"最近一次错误",tunnelLoading:"正在加载隧道状态…",thresholds:"路由阈值",chars:"字符上限",charsHint:"回复超过此长度走 Viewer。",lines:"行数上限",linesHint:"相同的路由判定,按行数。",codeLines:"代码行数上限",codeLinesHint:"代码块内回复的更低阈值。",maxPastes:"Paste 存储上限",maxPastesHint:"超过此数量后按 FIFO 淘汰旧 paste。"},baidu:{title:"Baidu Maps AK",subtitle:"启用 `/memo` 的地址→坐标解析。不配置 AK,/memo 仍可通过裸坐标或浏览器 GPS 分享工作。免费 AK:lbsyun.baidu.com → 控制台 → 应用管理 → 创建应用 → 服务端 API。",configured:"已配置",empty:"未配置",placeholder:"32 位 AK,首字符非数字",hint:"保存到 `~/.agim/.env`(chmod 600),默认遮罩,按「显示」可查看。",suspicious:"AK 长度为 {{length}},通常 Baidu AK 是 32 位 — 请核对。",clear:"清除 AK",toast:{saved:"Baidu Maps AK 已保存",cleared:"Baidu Maps AK 已清除"}}},cC={title:"工作区",subtitle:"多租户工作区注册表。每个工作区有独立的 Agent 白名单、限流配置以及(可选的)成员名单。`default` 工作区承接所有未匹配的用户。",empty:{title:"只有默认工作区",description:"在下方添加工作区,可按团队 / 项目 / 客户分隔。每个工作区有独立的 Agent 白名单与限流。"},col:{id:"ID",name:"名称",agents:"Agent 白名单",members:"成员",rateLimit:"限流"},rateLimitFormat:"{{rate}} / {{intervalSec}}s,突发 {{burst}}",membersOpen:"开放(任何用户)",membersCount_one:"{{count}} 位成员",membersCount_other:"{{count}} 位成员",edit:"编辑",form:{title:"新增或编辑工作区",subtitleEdit:"编辑已有工作区 — 改 ID 可克隆,保持原 ID 即 upsert。",id:"ID",idHint:"稳定标识符;只允许 [a-zA-Z0-9_-]+;`default` 为保留名。",name:"显示名",agents:"Agent 白名单",agentsHint:"逗号分隔;为空 = 允许所有已注册 Agent。",members:"成员用户 ID",membersHint:"逗号分隔,形如 `platform:userId`;为空 = 开放工作区。",rateLimit:"限流(可选)",rate:"调用数",intervalSec:"周期(秒)",burst:"突发上限",submit:"保存工作区",reset:"清空表单"},toast:{saved:"工作区已保存"}},uC={title:"服务",subtitle:"查看运行中的 agim 进程,并启动 / 停止 / 重启它。",modeLabel:"运行模式",pidLabel:"PID",uptimeLabel:"运行时长",webLabel:"Web 端口",bootPhaseLabel:"启动阶段",mode:{systemd:"systemd",background:"后台",foreground:"前台",none:"未运行"},actions:{start:"启动",stop:"停止",restart:"重启",confirmStop:"停止 agim 服务?",confirmStopDesc:"Web 控制台、消息适配器、所有正在进行的作业都会停止。需要重新启动后才能继续使用。",confirmRestart:"重启 agim 服务?",confirmRestartDesc:"进程会先停止再启动。进行中的作业会被取消;投递队列与已排队的提醒会保留。重启期间 Web 控制台不可达,通常 5-30 秒。"},toast:{started:"服务已启动",stopped:"服务已停止",restarted:"服务已重启"},ports:{title:"端口",subtitle:"agim 启动时监听的端口。留空使用默认值;改动需下次服务重启生效(保存后点下方「重启」按钮)。",webPort:"Web 端口",webPortHint:"聊天 UI + REST API 的 HTTP 服务端口。默认 {{default}}。",acpPort:"ACP 端口",acpPortHint:"Agent Communication Protocol 服务端口(远程 Agent 接入面)。默认 {{default}}。",invalidPort:"需为 1-65535 之间的数字。",restartRequired:"需重启生效",save:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"端口已保存 — 重启 agim 以绑定新端口"}}},dC={title:"安全",subtitle:"工具沙盒、SSRF 拦截、发送方门禁、运行时审计。改动立即写入 env 文件;多数 native 工具读 process.env,下次工具调用即生效;exec 沙盒和发送方门禁需要「重启服务」生效。",diagnostics:{title:"运行时诊断",runningAsRoot:"以 root 运行",runningAsRootHelp:"tool 调用会拿到 root 权限。建议在 systemd unit 设 User=agim 后重启。",envFilePerms:"env 文件权限",envFilePermsLax:"过宽(group/world 可读)",envFilePermsOk:"0600(仅 owner 可读写)",bwrapAvailable:"bubblewrap 已装",bwrapMissing:"未装(apt install bubblewrap)",senderAllowlist:"发送方门禁",senderAllowlistOff:"未配置(开放访问)",senderAllowlistOn:"已配置",adminAllowlist:"管理员清单",adminAllowlistOff:"未配置(首次 setup 后填充)",adminAllowlistOn:"已配置"},sender:{title:"发送方门禁 (谁能跟 bot 说话)",description:"允许列表,逗号分隔 platform:userId 对,例如 telegram:8754479311,wechat-ilink:wxid_abc。设为 * 显式表示「所有人都允许」。空值 = 开放访问(保持向后兼容;启动日志 OPEN_IM_ACCESS)。",envKey:"IMHUB_ALLOWED_USERS",placeholder:"platform:userId,platform:userId"},exec:{title:"Native exec 工具",description:"对 native_exec 的沙盒与超时控制。每次 exec 调用还会经 IM 审批卡(除非已 autoallow 同 fingerprint)。",sandbox:"沙盒后端",sandboxNone:"无(直接 spawn)",sandboxBwrap:"bubblewrap(Linux only)",sandboxBwrapMissing:"bubblewrap 未装",sandboxNet:"沙盒内网络",sandboxNetOn:"允许(默认)",sandboxNetOff:"禁用(--unshare-net)",timeoutMs:"命令超时(毫秒,默认 60000)",maxOutput:"单流输出上限(字节,默认 32768)"},web:{title:"Native web 工具",description:"SSRF 防护与超时。CIDR 白名单可放行 Tailscale/100.64.0.0/10 这类私网。",allowPrivate:"允许所有私网(不推荐)",allowPrivateHelp:"= 1 时跳过所有私网检查。仅用于受信任的内网部署。",ssrfWhitelist:"SSRF CIDR 白名单",ssrfWhitelistPlaceholder:"100.64.0.0/10,10.20.0.0/16",timeoutMs:"fetch / search 超时(毫秒,默认 30000)"},fs:{title:"Native filesystem 工具",description:"fs 工具默认限制在 native 当前线程的 workspace 子树内。",restrict:"限制到 workspace",restrictOn:"ON(推荐)",restrictOff:"OFF(允许任意路径;sensitive-paths 黑名单仍生效)",timeoutMs:"fs 工具超时(毫秒,默认 60000)"},delegation:{title:"Native call_agent 上限",description:"一次对话内 mcp__imhub__call_agent 允许的最多次数。防止 native 死循环委托给 CLI agent。0 = 无限。",envKey:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN",valueLabel:"默认 2"},platformBlacklist:{title:"IM 平台黑名单",description:"逗号分隔的 IM 平台 id,列入后:CLI 向导不显示、web 后台不出现、注册时被直接拒绝。即使凭证仍在 env 文件里,进程也不会拉起这个适配器。默认空(不拦截)。常见 id:wechat-ilink / telegram / feishu / dingtalk / discord / email。",envKey:"IMHUB_PLATFORM_BLACKLIST",placeholder:"telegram,discord",currentLabel:"当前生效"},diagnosticsPlatformBlacklist:"IM 平台黑名单",savingToast:"已保存。",resetTitle:"清空 (使用默认值)"},fC={title:"IM 管理员名单",subtitle:"Web 管理员 token 决定谁可以执行 IM 管理员级命令。IM 候选用户在与 agim 对话后会自动出现在这里,可直接授予管理员。",configured:"名单已配置",notConfigured:"尚未配置任何 IM 管理员。",empty:"暂无管理员。",col:{platform:"平台",userId:"用户 ID"},known:{title:"已感知 IM 用户",hint:"用户给 agim 发过消息后会自动出现在此列表,可直接设为管理员。",count:"已感知用户:{{count}}",empty:"暂无已感知 IM 用户。",emptyHint:"请先让该用户给 agim 发送一条消息。",col:{lastSeen:"最近出现时间"},promote:"设为管理员",alreadyAdmin:"已是管理员"},remove:{label:"移除",confirmTitle:"确认移除该管理员?",confirmDescription:"该用户将失去所有管理员命令访问权限。可再次添加恢复。"},toast:{added:"已添加",removed:"已移除"}},hC={title:"Agim Agent配置",subtitle:"在一个页面完成 Agim Agent 的大模型 API 添加与运行参数配置。API 元数据保存在 ~/.agim/config.json;API Key 保存在 ~/.agim/llm-secrets.json(0600)或 AGIM_LLM_SECRET_<NAME> 环境变量。",refresh:"刷新",backendsTitle:"API ({{count}})",backendsEmpty:"尚未配置大模型 API。请先在下方添加 API。",rolesTitle:"角色绑定(可选,高级)",rolesOptionalHint:"角色绑定是可选增强项;不配置也会自动使用可用 API。",addTitle:"添加 API",col:{name:"名称",provider:"提供商",model:"模型",baseUrl:"Base URL",apiKey:"API Key",actions:"操作"},secretMissing:"缺失",ping:"探测",remove:"删除",pinging:"探测中…",setKeyFirst:"请先设置 API Key",pingHint:"发送一次小型 chat 探测",removeConfirm:'删除 API "{{name}}"?角色绑定与 API Key 将被清除。',removedToast:"已删除(同时清除 {{count}} 个角色绑定)。",roleUpdated:"已更新角色 {{role}}",unset:"(未设置)",unbound:"(未绑定)",roleHint:{cheap:"用于记忆提取、意图分类等内置辅助任务。",evaluator:"用于通知评估与路由对比。","native-chat":"/agim 对话优先角色(/na 仍兼容);不绑定时 Agim Agent 会自动回退到任意可用 API。"},preset:"提供商预设",name:"名称",namePlaceholder:"如 deepseek-cheap",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",model:"模型",modelPlaceholder:"model-id",apiKey:"API Key",apiKeyPlaceholder:"sk-...",addBackend:"添加 API",invalidPreset:"无效预设",nameRequired:"名称必填",baseUrlRequired:"baseUrl 必填",modelRequired:"model 必填",apiKeyRequired:"API Key 必填",addedWithKey:'已添加 API "{{name}}"',agimAgentRuntimeTitle:"Agim Agent 运行参数",agimAgentRuntimeHint:"下方参数控制 Agim Agent 的行为;上方 API 决定它使用哪个模型。",presets:{deepseek:"DeepSeek",moonshot:"Moonshot Kimi",zhipu:"智谱 GLM",openai:"OpenAI",anthropic:"Anthropic",custom:"自定义"}},pC={title:"外部 MCP 服务器",subtitle:"这些服务器提供的工具会暴露给内置 Agim Agent(命名规则 mcp_<server>_<tool>)。CLI agent 使用各自的 MCP 配置,不会读取此列表。Header 可能包含 Bearer Token — 仅管理员可见。",refresh:"刷新",serversTitle:"服务器 ({{count}})",serversEmpty:"尚未配置 MCP 服务器。请在下方添加 — 常见选择:filesystem、github、postgres。",totalTools:"工具总数:{{count}}",addTitle:"添加服务器",col:{name:"名称",transport:"传输",target:"目标",runtime:"运行时",actions:"操作"},transportStdio:"stdio",transportSse:"SSE",transportHttp:"http",runtimeUnknown:"未知",runtimeConnected:"已连接 · {{count}} 个工具",runtimeConnectedOne:"已连接 · {{count}} 个工具",runtimeDisconnected:"未连接",health:"健康检查",remove:"删除",probing:"探测中…",removeConfirm:'删除 MCP 服务器 "{{name}}"?',removedToast:'已删除 "{{name}}"',nameRequired:"名称必填",commandRequired:"stdio 传输需要 command",urlRequired:"http/sse 传输需要 url",headersInvalid:"headers 必须是合法 JSON",addedToast:'已添加 "{{name}}"',nameLabel:"名称",namePlaceholder:"如 filesystem",transportLabel:"传输",transportStdioOption:"stdio(子进程)",transportHttpOption:"http / SSE",commandLabel:"命令",commandPlaceholder:"如 npx",argsLabel:"参数(空格分隔)",urlLabel:"URL",urlPlaceholder:"https://example.com/mcp",headersLabel:"Headers(JSON,可选)",headersPlaceholder:'{"Authorization":"Bearer …"}',addServer:"添加服务器"},mC={title:"Agim Agent · 评估器 · 心跳",subtitle:"Agim Agent 与两个 LLM 驱动门控(通知评估器、心跳)的运行时行为。大模型 API 与可选角色绑定在本页上方配置。",llmLink:"/settings/llm",refresh:"刷新",unsaved:"有未保存改动",discard:"放弃",save:"保存",savedToast:"已保存。",agentCard:"Agim Agent(系统内置)",evaluatorCard:"通知评估器",heartbeatCard:"心跳调度器",on:"开",off:"关",roleOverride:"角色覆盖",roleHint:"Agim Agent 循环优先解析此角色;若未命中,会自动回退到任意可用 API。角色绑定为可选增强项。",approvalMode:"审批模式",approvalHint:"Agim Agent 循环中工具调用的门控方式。",modeReadOnly:"只读(安全默认)",modeAllowList:"白名单(仅 autoAllow 条目)",modeAllowAll:"全部放行(所有工具)",modeDenyAll:"全部禁止(不允许工具)",autoAllow:"自动允许工具前缀",autoAllowHint:"逗号分隔。名称以任一前缀开头的工具绕过门控(如 native_,mcp_filesystem_)。",denyList:"拒绝列表工具前缀",denyListHint:"逗号分隔。无论模式如何始终拒绝(如 mcp_shell_)。",evalDesc:"过滤例行/空的 agent 主动推送消息的 LLM 门控。使用 evaluator 角色。失败开放:LLM 错误或缺少可用 API → 仍投递消息。",enableGate:"启用门控",filterViaLlm:"通过 LLM 过滤",evalSources:"门控来源",evalSourcesHint:"逗号分隔子集:push, notify, reminder, heartbeat。留空 = 默认 push,heartbeat。",hbDesc:"周期性主动唤醒循环。关闭后 /heartbeat bind 仍可保存绑定,但不执行扫描。三阶段 tick:DECIDE → EXECUTE → EVALUATE。",enableScheduler:"启用调度器",startScanLoop:"启动扫描循环",tickInterval:"Tick 间隔(毫秒)",tickHint:"扫描循环检查到期绑定的频率。默认 60000。",defaultInterval:"默认绑定间隔(分钟)",defaultIntervalHint:"绑定未指定时的 tick 间隔。默认 15。",runtimeCard:"运行参数上限",runtimeDesc:"Agim Agent 工具调用与重试的上限控制。留空使用默认值。",toolResultCap:"单次工具返回最大字符",toolResultCapHint:"IMHUB_NATIVE_TOOL_RESULT_MAX_CHARS。超出截断+附说明。默认 64000。",toolTimeoutMs:"单次工具超时(毫秒)",toolTimeoutHint:"IMHUB_NATIVE_TOOL_TIMEOUT_MS。默认 60000(60 秒)。",blankRetryMax:"空响应重试上限",blankRetryHint:"IMHUB_NATIVE_BLANK_RETRY_MAX。模型连续返回空文本时的重试次数。默认 1。",lengthRecoveryMax:"长度截断续写上限",lengthRecoveryHint:"IMHUB_NATIVE_LENGTH_RECOVERY_MAX。finishReason=length 时自动续写次数。默认 1。",a2aCard:"A2A 子 Agent 派发",a2aDesc:"模型调用 `mcp__imhub__call_agent` 时的深度、超时与单轮上限。agim→agim 默认走内置快速路径。",a2aMaxDepth:"递归深度上限",a2aMaxDepthHint:"IMHUB_A2A_MAX_DEPTH。call_agent 嵌套调用最大层数。默认 1。",a2aTimeoutMs:"默认超时(毫秒)",a2aTimeoutMsHint:"IMHUB_A2A_TIMEOUT_DEFAULT_MS。默认 1800000(30 分钟)。",callAgentInProcess:"agim→agim 内置快速路径",callAgentInProcessHint:"IMHUB_NATIVE_CALL_AGENT_IN_PROCESS。关闭则回退到子进程 CLI。默认开。",callAgentMaxPerTurn:"单轮调用上限",callAgentMaxPerTurnHint:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN。0 = 不限。默认 2。",criticCard:"早停与复盘",criticDesc:"语义死循环检测识别「3 次同意图但工具不同」的情形并早停。Critic 是可选的目标偏离检测器。",semanticStuckLoop:"语义死循环检测",semanticStuckLoopHint:"IMHUB_NATIVE_SEMANTIC_STUCK_LOOP。默认开启;关闭后不再进行跨工具语义去重。",criticEnabled:"Goal Critic 复盘",criticEnabledHint:"IMHUB_NATIVE_CRITIC。默认关;开启后启用目标偏离早停。",criticRole:"Critic LLM role",criticRoleHint:"IMHUB_NATIVE_CRITIC_ROLE。可选 override(留空走主 API)。",planModeDefault:"PlanMode 默认状态",planModeDefaultHint:"IMHUB_NATIVE_PLAN_MODE。默认关;`/plan on` 在单线程内可独立切换不受此影响。",planIntentAuto:"自动进入 Plan 模式",planIntentAutoHint:"IMHUB_PLAN_INTENT_AUTO。开启后,含「先想想 / plan only / 不要直接做」等关键词的 prompt 会临时进入 plan 模式,仅本轮生效;从不自动退出——必须 /plan off 或模型调 native_exit_plan_mode。",planIntentPhrases:"意图关键词列表(可选覆盖)",planIntentPhrasesHint:"IMHUB_PLAN_INTENT_PHRASES。逗号分隔。留空则用内置中英文默认列表。匹配方式:大小写不敏感的子串。",compactCard:"自动压缩上下文",compactDesc:"对较早对话做摘要,保留最近几轮消息和最初目标,避免上下文过长。",compactTriggerChars:"触发字符数",compactTriggerCharsHint:"IMHUB_NATIVE_COMPACT_TRIGGER_CHARS。设为 0 禁用。默认 60000。",compactKeepTurns:"保留最后 N 对",compactKeepTurnsHint:"IMHUB_NATIVE_COMPACT_KEEP_TURNS。tail 保留的 user/assistant 对数。默认 6。",compactKeepFirst:"保留前 N 条 user 消息",compactKeepFirstHint:"IMHUB_NATIVE_COMPACT_KEEP_FIRST。保留最早的用户目标。默认 1。",compactSummaryChars:"摘要字符上限",compactSummaryCharsHint:"IMHUB_NATIVE_COMPACT_SUMMARY_CHARS。LLM 生成摘要的字符上限。默认 1500。",streamCard:"流式与迭代",streamDesc:"流式回传可在 IM 30 分钟硬超时时保留部分文本。max-iter 是工具循环的最坏上限。",streamPartial:"流式增量回写",streamPartialHint:"IMHUB_NATIVE_STREAM_PARTIAL。默认开;关闭走旧的非流式路径。",maxIter:"迭代上限",maxIterHint:"IMHUB_NATIVE_AGENT_MAX_ITER。范围 [1,100],默认 50。"},gC={title:"Web 搜索 Provider",subtitle:"native_web_search 工具的后端链路。失败时按顺序回退到下一家。键留空 = 删除该值;填则覆盖。所有修改热生效。",refresh:"刷新",save:"保存",discard:"放弃",unsaved:"有未保存改动",savedToast:"已保存。下一次搜索即生效。",chainLabel:"当前生效链路:",chainEmpty:"无可用 provider",chainHint:"由 IMHUB_WEB_SEARCH_PROVIDERS 决定;只列出已启用且 available() 为真的项。",configured:"已配置",missingKey:"缺 API key",noKey:"无需 key",moveUp:"上移",moveDown:"下移",testBtn:"测试",clearKey:"清空",placeholderConfigured:"已保存(隐藏) — 不输入则保留",placeholderEnter:"输入新 key",keyHint:"提交后将以密文写入 ~/.agim/env 的 {{envKey}} 键。",testOk:"{{provider}} ✓ {{hits}} 条结果 / {{ms}} ms",testFail:"{{provider}} ✗ {{error}}"},yC={title:"手机端登录二维码",subtitle:"生成一张二维码,让操作员用手机扫码即可打开 /m/chat。链接里带一次性 role=user token,首次扫码后手机会拿到 cookie 并跳转到手机版聊天界面。",generateCard:"生成二维码",generateDesc:"每次点击会新建 token(旧二维码在被吊销前仍然可用)。已登录的手机不受影响。",hostLabel:"覆盖访问域名(可选)",hostPlaceholder:"留空自动识别",hostHint:"默认沿用当前 admin 页面的域名/端口。如果手机走的是另一个域名(例如 cloudflared 隧道),请在此覆盖。",generate:"生成二维码",regenerate:"重新生成",generating:"生成中…",generatedToast:"二维码已生成,请在屏幕前扫码。",scanCard:"用手机扫码",scanDesc:"打开手机相机对准二维码,首次扫码即完成登录,token 未被吊销前保持登录态。",tokenLabel:"标签",urlLabel:"内嵌 URL",urlHint:"持有此 URL 的人可以以 user 身份登录。请妥善保管,与密码同等敏感。",tokenIdLabel:"Token ID",tokenIdHint:"需要吊销时,在「安全」页按此 ID 定位 token。",warningTitle:"请像对待密码一样保护此二维码。",warningBody:"扫码 token 在被吊销前长期有效。手机丢失时,请到「安全」页吊销 mobile-via-qr-* 标签下的 token。",revokeLink:"管理 / 吊销 token →",copied:"URL 已复制",copyFailed:"复制失败,请长按 URL 字段选中。",showUrl:"显示 URL",hideUrl:"隐藏 URL",copyUrl:"复制 URL",qrAlt:"手机端聊天登录二维码"},bC={title:"系统提示 Skill 注入",subtitle:"调整每轮注入到系统提示的技能摘要块。覆盖文件存在且非空时,会替换自动生成内容(路由头与常驻技能正文仍会保留)。",autoLabel:"自动生成(只读预览)",overrideLabel:"运营者覆盖(保存后生效)",overridePlaceholder:"留空表示使用自动生成。常见做法:从上方复制后删掉不需要的族,或在头部加几行路由提示。",overrideActive:"覆盖生效中",overrideInactive:"使用自动生成",largeWarn:"占用偏大,注意 token 预算",copyToOverride:"复制到下方编辑",save:"保存",clear:"清除覆盖",savedToast:"已保存。下一轮对话生效。",clearedToast:"已清除覆盖。回到自动生成。",refreshedToast:"已刷新自动生成预览。",rebuild:"重建默认注入词",rebuildTooltip:"重新扫描磁盘的所有 SKILL.md,按规则重新生成上方自动注入词(不影响下方覆盖)。",rebuiltToast:"已重新扫描磁盘并按规则生成自动注入词。下次对话生效。",overLimitToast:"内容 {{len}} 字符,超过上限 {{max}}",confirmClear:"清除覆盖文件,回到自动生成?",hint:"保存后无需重启;下一轮系统提示构建会读取最新内容。"},vC={title:"agim Skills",tab:{installed:"已安装",hot:"skillhub 热门",injection:"系统提示注入"},group:{framework:"Framework(agim-*)",builtin:"Agim 内置(非 ECC)",workspace:"Workspace(运营者亲装业务)",eccPicks:"ECC 推荐池",eccRemainder:"ECC 余下"},searchPlaceholder:"搜索 skill 名称或描述…",searchEmpty:"没有匹配的 skill。",reload:"从磁盘重新加载",subtitle:"由 src/core/skills/loader.ts 加载的 SKILL.md 文件。Tier-1 摘要(name + description)自动注入每个 agent 系统提示;完整正文通过 mcp__imhub__read_skill 按需读取。工作区 skill 按名称覆盖内置 skill。",reloadedToast:"已重新加载 — 磁盘上 {{count}} 个 skill",selectHint:"在左侧选择一个 skill,或点击「新建」创建。",emptyList:"尚未加载 skill。点击「新建」创建(保存到 ~/.agim/skills/<name>/SKILL.md)。",unavailable:"不可用",alwaysOn:"常驻",sourceWs:"ws",sourceBuiltin:"builtin",notFound:"未找到。",sourceWorkspace:"workspace",sourceBuiltinReadonly:"builtin(UI 只读)",builtinShadowHint:"内置 skill 仅供参考。保存将创建工作区 shadow 覆盖它。",delete:"删除",save:"保存",saveShadow:"保存(创建工作区 shadow)",savedToast:'已保存 "{{name}}"',deleteConfirm:'删除工作区 skill "{{name}}"?如有内置版本将重新可见。',deletedToast:'已删除 "{{name}}"',new:"新建",newTitle:"新建 skill",newName:"Skill 名称",newNamePlaceholder:"my-skill",newCreate:"创建",createdToast:'已创建 "{{name}}"',nameRequired:"名称必填",invalidNameChars:"名称仅允许字母、数字及 . _ -",pathLabel:"工作区路径:",binsLabel:"依赖二进制:",envLabel:"依赖环境变量:",none:"无"},xC={pageTitle:tC,subtitle:nC,tabs:rC,agents:iC,policy:oC,messengers:aC,email:sC,viewerSettings:lC,workspaces:cC,service:uC,security:dC,admins:fC,llm:hC,mcp:pC,nativeAgent:mC,search:gC,mobile:yC,skillInjection:bC,agimSkills:vC},wC=kC();He.use(Tf).use(Iy).init({resources:{en:{common:dw,errors:ak,tasks:Zk,approvals:AS,reminders:QS,memos:m0,memory:D0,skills:X0,workspace:uA,observability:EA,settings:eC},zh:{common:Ew,errors:Hk,tasks:fS,approvals:MS,reminders:a0,memos:A0,memory:W0,skills:nA,workspace:bA,observability:_A,settings:xC}},lng:wC,fallbackLng:"en",supportedLngs:["en","zh"],ns:["common","errors","tasks","approvals","reminders","memos","memory","skills","workspace","observability","settings"],defaultNS:"common",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:[],caches:[]}}).then(()=>{Pf(He.language==="zh"?"zh":"en")});function kC(){try{const e=localStorage.getItem("im-hub-lang");if(e==="en"||e==="zh")return e}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function SC(e){Pf(e),He.language!==e&&He.changeLanguage(e)}function Pf(e){typeof document>"u"||(document.documentElement.lang=e==="zh"?"zh-CN":"en")}const ia=1200,AC={messages:[],pendingApprovals:[],pendingAsks:[],runActivities:[],activeRunId:null,agents:[],agent:"",status:"connecting",currentReplyId:null,error:null},CC=24;function EC(e,t){switch(t.kind){case"WS_STATUS":return{...e,status:t.status};case"INIT":return{...e,agents:t.agents,agent:e.agent||t.defaultAgent};case"HISTORY":return{...e,messages:t.messages,agent:t.agent};case"AGENTS":return{...e,agents:t.agents};case"AGENT_SWITCHED":return{...e,agent:t.agent};case"SEND_USER":return{...e,messages:[...e.messages,t.message,t.placeholder],currentReplyId:t.placeholder.id,error:null};case"CHUNK":{const n=e.messages.findIndex(o=>o.id===t.replyId);if(n<0)return e;const r=[...e.messages],i=r[n];return i&&(r[n]={...i,content:i.content+t.text}),{...e,messages:r}}case"DONE":{const n=e.messages.findIndex(o=>o.id===t.replyId);if(n<0)return{...e,currentReplyId:null};const r=[...e.messages],i=r[n];return i&&(r[n]={...i,content:t.finalText||i.content}),{...e,messages:r,currentReplyId:null}}case"ERROR":return{...e,error:t.message,currentReplyId:null};case"APPROVAL_CARD":return e.pendingApprovals.some(n=>n.messageId===t.messageId)?e:{...e,pendingApprovals:[...e.pendingApprovals,{messageId:t.messageId,prompt:t.prompt}]};case"APPROVAL_TEXT":return e;case"APPROVAL_EDIT":{const n=e.pendingApprovals.findIndex(o=>o.messageId===t.messageId);if(n<0)return e;const r=[...e.pendingApprovals],i=r[n];return i&&(r[n]={...i,outcome:t.outcome,resolvedAt:Date.now()}),{...e,pendingApprovals:r}}case"APPROVAL_DISMISS":return{...e,pendingApprovals:e.pendingApprovals.filter(n=>n.messageId!==t.messageId)};case"CHOICE_CARD":return e.pendingAsks.some(n=>n.messageId===t.messageId)?e:{...e,pendingAsks:[...e.pendingAsks,{messageId:t.messageId,prompt:t.prompt}]};case"CHOICE_EDIT":{const n=e.pendingAsks.findIndex(o=>o.messageId===t.messageId);if(n<0)return e;const r=[...e.pendingAsks],i=r[n];return i&&(r[n]={...i,finalText:t.finalText,resolvedAt:Date.now()}),{...e,pendingAsks:r}}case"CHOICE_DISMISS":return{...e,pendingAsks:e.pendingAsks.filter(n=>n.messageId!==t.messageId)};case"RUN_START":{const n=[{runId:t.runId,agent:t.agent,startedAt:t.startedAt,status:"running"},...e.runActivities.filter(r=>r.runId!==t.runId)];return{...e,runActivities:n.slice(0,CC),activeRunId:t.runId}}case"RUN_USAGE":{const n=e.runActivities.findIndex(o=>o.runId===t.runId);if(n<0)return e;const r=[...e.runActivities],i=r[n];return i&&(r[n]={...i,durationMs:t.durationMs,outputChars:t.outputChars}),{...e,runActivities:r}}case"RUN_FINISH":{const n=e.runActivities.findIndex(o=>o.runId===t.runId);if(n<0)return{...e,activeRunId:e.activeRunId===t.runId?null:e.activeRunId};const r=[...e.runActivities],i=r[n];return i&&(r[n]={...i,status:t.status,finishedAt:t.finishedAt,durationMs:t.durationMs,error:t.error}),{...e,runActivities:r,activeRunId:e.activeRunId===t.runId?null:e.activeRunId}}case"RESET_CONVERSATION":return{...e,messages:[],pendingApprovals:[],pendingAsks:[],runActivities:[],activeRunId:null,currentReplyId:null,error:null};case"CLEAR_ERROR":return{...e,error:null}}}function RC(e){const t=(n,r)=>He.t(`chat.outcome.${n}`,{ns:"common",defaultValue:r});switch(e.decision){case"allowed":Je.success(t("allowed","Allowed"));return;case"allowed-pinned":Je.success(t("allowedPinned","Allowed + auto-allow further"));return;case"denied":Je.error(t("denied","Denied"));return;case"denied-revoked":Je.error(t("deniedRevoked","Denied (auto-allow revoked)"));return;case"expired":Je.warning(t("expired","Timed out"));return}}let $c=0;function Vc(e){return $c+=1,`${e}-${Date.now()}-${$c}`}function TC(){const[e,t]=g.useReducer(EC,AC),n=g.useRef(hx()),r=g.useRef(new Map),i=g.useRef(!1),o=g.useRef(null);g.useEffect(()=>{o.current=e.currentReplyId},[e.currentReplyId]),g.useEffect(()=>{const m=n.current,p=m.subscribe({type:"status",fn:P=>t({kind:"WS_STATUS",status:P})}),b=m.subscribe({type:"message",fn:P=>a(P)});function v(){try{const C=localStorage.getItem("agim-web-thread-id");if(C&&/^web-[A-Za-z0-9_-]{4,64}$/.test(C))return C}catch{}const P=`web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;try{localStorage.setItem("agim-web-thread-id",P)}catch{}return P}const x=v();function w(){m.send({type:"get-history",threadId:x}),m.send({type:"get-agents"})}let E=()=>{};return m.status()==="open"?w():E=m.subscribe({type:"status",fn:P=>{P==="open"&&(w(),E())}}),()=>{p(),b(),E()}},[]);function a(m){switch(m.type){case"init":t({kind:"INIT",agents:m.agents,defaultAgent:m.defaultAgent});return;case"history":t({kind:"HISTORY",agent:m.agent,messages:m.messages.map((p,b)=>({id:`hist-${b}`,role:p.role,content:p.content,agent:p.agent,timestamp:p.timestamp?Date.parse(p.timestamp):Date.now()-b*1e3}))});return;case"agents":t({kind:"AGENTS",agents:m.agents});return;case"agent-switched":t({kind:"AGENT_SWITCHED",agent:m.agent});return;case"run-start":t({kind:"RUN_START",runId:m.runId,agent:m.agent,startedAt:Number.isFinite(Date.parse(m.startedAt))?Date.parse(m.startedAt):Date.now()});return;case"usage":t({kind:"RUN_USAGE",runId:m.runId,durationMs:m.durationMs,outputChars:m.outputChars});return;case"run-finish":t({kind:"RUN_FINISH",runId:m.runId,status:m.status,finishedAt:Number.isFinite(Date.parse(m.finishedAt))?Date.parse(m.finishedAt):Date.now(),durationMs:m.durationMs,error:m.error});return;case"chunk":s(m.text);return;case"done":l(),t({kind:"DONE",replyId:o.current??"",finalText:m.text});return;case"error":l(),t({kind:"ERROR",message:m.message});return;case"approval-card":t({kind:"APPROVAL_CARD",messageId:m.messageId,prompt:m.prompt});return;case"approval-card-edit":t({kind:"APPROVAL_EDIT",messageId:m.messageId,outcome:m.outcome}),RC(m.outcome),window.setTimeout(()=>{t({kind:"APPROVAL_DISMISS",messageId:m.messageId})},ia);return;case"choice-card":t({kind:"CHOICE_CARD",messageId:m.messageId,prompt:m.prompt});return;case"choice-card-edit":t({kind:"CHOICE_EDIT",messageId:m.messageId,finalText:m.finalText}),window.setTimeout(()=>{t({kind:"CHOICE_DISMISS",messageId:m.messageId})},ia);return;case"approval-text":Je.info(m.text);return;case"metrics":return;default:return}}function s(m){const p=o.current;if(!p)return;const b=r.current.get(p)??"";r.current.set(p,b+m),!i.current&&(i.current=!0,requestAnimationFrame(()=>{i.current=!1,l()}))}function l(){for(const[m,p]of r.current.entries())p&&t({kind:"CHUNK",replyId:m,text:p});r.current.clear()}function c(m){const p=m.trim();if(!p)return;const b=n.current,v=Vc("u"),x=Vc("a");t({kind:"SEND_USER",message:{id:v,role:"user",content:p,timestamp:Date.now()},placeholder:{id:x,role:"assistant",content:"",agent:e.agent,timestamp:Date.now()}}),b.send({type:"message",text:p,agent:e.agent})||t({kind:"ERROR",message:He.t("chat.notConnected",{ns:"common",defaultValue:"Not connected. Reconnecting…"})})}function u(m){n.current.send({type:"switch-agent",agent:m})}function d(m,p,b){const v=n.current.send({type:"approval-action",data:`apv:${p}:${b}`,messageId:m});return v||t({kind:"ERROR",message:He.t("chat.notConnectedRetry",{ns:"common",defaultValue:"Not connected. Reconnecting — try again in a moment."})}),v}function h(m,p){const b=n.current.send({type:"choice-action",data:p,messageId:m});return b?(t({kind:"CHOICE_EDIT",messageId:m,finalText:He.t("chat.askResolved",{ns:"common",defaultValue:"✅ 已回答"})}),window.setTimeout(()=>{t({kind:"CHOICE_DISMISS",messageId:m})},ia),b):(t({kind:"ERROR",message:He.t("chat.notConnectedRetry",{ns:"common",defaultValue:"Not connected. Reconnecting — try again in a moment."})}),b)}function f(){t({kind:"RESET_CONVERSATION"}),n.current.send({type:"new-conversation"})}return{state:e,send:c,switchAgent:u,approvalClick:d,choiceSubmit:h,newConversation:f,clearError:()=>t({kind:"CLEAR_ERROR"})}}const PC=Ts(["inline-flex items-center gap-1","rounded-full border px-2 py-0.5","text-xs font-semibold uppercase tracking-wide leading-5","transition-colors"].join(" "),{variants:{variant:{default:"bg-surface-2 text-text-dim border-transparent",secondary:"bg-surface-2 text-text border-border",outline:"bg-transparent text-text-dim border-border",success:"bg-success-bg text-success border-transparent",warning:"bg-warning-bg text-warning border-transparent",danger:"bg-danger-bg text-danger border-transparent",info:"bg-info-bg text-info border-transparent",accent:"bg-accent-bg text-accent border-transparent"}},defaultVariants:{variant:"default"}});function it({className:e,variant:t,...n}){return y.jsx("span",{className:ve(PC({variant:t}),e),...n})}function IC(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const LC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,NC={};function Kc(e,t){return(NC.jsx?OC:LC).test(e)}const _C=/[ \t\n\f\r]/g;function DC(e){return typeof e=="object"?e.type==="text"?Wc(e.value):!1:Wc(e)}function Wc(e){return e.replace(_C,"")===""}class yi{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yi.prototype.normal={};yi.prototype.property={};yi.prototype.space=void 0;function If(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new yi(n,r,t)}function Ya(e){return e.toLowerCase()}class bt{constructor(t,n){this.attribute=n,this.property=t}}bt.prototype.attribute="";bt.prototype.booleanish=!1;bt.prototype.boolean=!1;bt.prototype.commaOrSpaceSeparated=!1;bt.prototype.commaSeparated=!1;bt.prototype.defined=!1;bt.prototype.mustUseProperty=!1;bt.prototype.number=!1;bt.prototype.overloadedBoolean=!1;bt.prototype.property="";bt.prototype.spaceSeparated=!1;bt.prototype.space=void 0;let MC=0;const ue=nr(),Ge=nr(),Xa=nr(),H=nr(),Me=nr(),qn=nr(),xt=nr();function nr(){return 2**++MC}const Ja=Object.freeze(Object.defineProperty({__proto__:null,boolean:ue,booleanish:Ge,commaOrSpaceSeparated:xt,commaSeparated:qn,number:H,overloadedBoolean:Xa,spaceSeparated:Me},Symbol.toStringTag,{value:"Module"})),oa=Object.keys(Ja);class Ds extends bt{constructor(t,n,r,i){let o=-1;if(super(t,n),qc(this,"space",i),typeof r=="number")for(;++o<oa.length;){const a=oa[o];qc(this,oa[o],(r&Ja[a])===Ja[a])}}}Ds.prototype.defined=!0;function qc(e,t,n){n&&(e[t]=n)}function Nr(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Ds(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Ya(r)]=r,n[Ya(o.attribute)]=r}return new yi(t,n,e.space)}const Lf=Nr({properties:{ariaActiveDescendant:null,ariaAtomic:Ge,ariaAutoComplete:null,ariaBusy:Ge,ariaChecked:Ge,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:Me,ariaCurrent:null,ariaDescribedBy:Me,ariaDetails:null,ariaDisabled:Ge,ariaDropEffect:Me,ariaErrorMessage:null,ariaExpanded:Ge,ariaFlowTo:Me,ariaGrabbed:Ge,ariaHasPopup:null,ariaHidden:Ge,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Me,ariaLevel:H,ariaLive:null,ariaModal:Ge,ariaMultiLine:Ge,ariaMultiSelectable:Ge,ariaOrientation:null,ariaOwns:Me,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:Ge,ariaReadOnly:Ge,ariaRelevant:null,ariaRequired:Ge,ariaRoleDescription:Me,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:Ge,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Of(e,t){return t in e?e[t]:t}function Nf(e,t){return Of(e,t.toLowerCase())}const jC=Nr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qn,acceptCharset:Me,accessKey:Me,action:null,allow:null,allowFullScreen:ue,allowPaymentRequest:ue,allowUserMedia:ue,alpha:ue,alt:null,as:null,async:ue,autoCapitalize:null,autoComplete:Me,autoFocus:ue,autoPlay:ue,blocking:Me,capture:null,charSet:null,checked:ue,cite:null,className:Me,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:Ge,controls:ue,controlsList:Me,coords:H|qn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ue,defer:ue,dir:null,dirName:null,disabled:ue,download:Xa,draggable:Ge,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ue,formTarget:null,headers:Me,height:H,hidden:Xa,high:H,href:null,hrefLang:null,htmlFor:Me,httpEquiv:Me,id:null,imageSizes:null,imageSrcSet:null,inert:ue,inputMode:null,integrity:null,is:null,isMap:ue,itemId:null,itemProp:Me,itemRef:Me,itemScope:ue,itemType:Me,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ue,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:ue,muted:ue,name:null,nonce:null,noModule:ue,noValidate:ue,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:ue,optimum:H,pattern:null,ping:Me,placeholder:null,playsInline:ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ue,referrerPolicy:null,rel:Me,required:ue,reversed:ue,rows:H,rowSpan:H,sandbox:Me,scope:null,scoped:ue,seamless:ue,selected:ue,shadowRootClonable:ue,shadowRootCustomElementRegistry:ue,shadowRootDelegatesFocus:ue,shadowRootMode:null,shadowRootSerializable:ue,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:Ge,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:ue,useMap:null,value:Ge,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Me,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ue,declare:ue,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:ue,noHref:ue,noShade:ue,noWrap:ue,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:Ge,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ue,disablePictureInPicture:ue,disableRemotePlayback:ue,exportParts:qn,part:Me,prefix:null,property:null,results:H,security:null,unselectable:null},space:"html",transform:Nf}),FC=Nr({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",maskType:"mask-type",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:xt,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:Me,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:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,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:qn,g2:qn,glyphName:qn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:xt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:H,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:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Me,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xt,rev:xt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xt,requiredFeatures:xt,requiredFonts:xt,requiredFormats:xt,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:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:xt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xt,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Of}),_f=Nr({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()}}),Df=Nr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Nf}),Mf=Nr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),UC={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"},HC=/[A-Z]/g,Qc=/-[a-z]/g,BC=/^data[-\w.:]+$/i;function zC(e,t){const n=Ya(t);let r=t,i=bt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&BC.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Qc,VC);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Qc.test(o)){let a=o.replace(HC,$C);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Ds}return new i(r,t)}function $C(e){return"-"+e.toLowerCase()}function VC(e){return e.charAt(1).toUpperCase()}const KC=If([Lf,jC,_f,Df,Mf],"html"),Ms=If([Lf,FC,_f,Df,Mf],"svg");function WC(e){return e.join(" ").trim()}var js={},Gc=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,qC=/\n/g,QC=/^\s*/,GC=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,YC=/^:\s*/,XC=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,JC=/^[;\s]*/,ZC=/^\s+|\s+$/g,eE=`
|
|
141
|
-
`,Yc="/",Xc="*",$n="",tE="comment",nE="declaration";function rE(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(m){var p=m.match(qC);p&&(n+=p.length);var b=m.lastIndexOf(eE);r=~b?m.length-b:r+m.length}function o(){var m={line:n,column:r};return function(p){return p.position=new a(m),c(),p}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(m){var p=new Error(t.source+":"+n+":"+r+": "+m);if(p.reason=m,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function l(m){var p=m.exec(e);if(p){var b=p[0];return i(b),e=e.slice(b.length),p}}function c(){l(QC)}function u(m){var p;for(m=m||[];p=d();)p!==!1&&m.push(p);return m}function d(){var m=o();if(!(Yc!=e.charAt(0)||Xc!=e.charAt(1))){for(var p=2;$n!=e.charAt(p)&&(Xc!=e.charAt(p)||Yc!=e.charAt(p+1));)++p;if(p+=2,$n===e.charAt(p-1))return s("End of comment missing");var b=e.slice(2,p-2);return r+=2,i(b),e=e.slice(p),r+=2,m({type:tE,comment:b})}}function h(){var m=o(),p=l(GC);if(p){if(d(),!l(YC))return s("property missing ':'");var b=l(XC),v=m({type:nE,property:Jc(p[0].replace(Gc,$n)),value:b?Jc(b[0].replace(Gc,$n)):$n});return l(JC),v}}function f(){var m=[];u(m);for(var p;p=h();)p!==!1&&(m.push(p),u(m));return m}return c(),f()}function Jc(e){return e?e.replace(ZC,$n):$n}var iE=rE,oE=Yi&&Yi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(js,"__esModule",{value:!0});js.default=sE;const aE=oE(iE);function sE(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,aE.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:a,value:s}=o;i?t(a,s,o):s&&(n=n||{},n[a]=s)}),n}var Po={};Object.defineProperty(Po,"__esModule",{value:!0});Po.camelCase=void 0;var lE=/^--[a-zA-Z0-9_-]+$/,cE=/-([a-z])/g,uE=/^[^-]+$/,dE=/^-(webkit|moz|ms|o|khtml)-/,fE=/^-(ms)-/,hE=function(e){return!e||uE.test(e)||lE.test(e)},pE=function(e,t){return t.toUpperCase()},Zc=function(e,t){return"".concat(t,"-")},mE=function(e,t){return t===void 0&&(t={}),hE(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(fE,Zc):e=e.replace(dE,Zc),e.replace(cE,pE))};Po.camelCase=mE;var gE=Yi&&Yi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},yE=gE(js),bE=Po;function Za(e,t){var n={};return!e||typeof e!="string"||(0,yE.default)(e,function(r,i){r&&i&&(n[(0,bE.camelCase)(r,t)]=i)}),n}Za.default=Za;var vE=Za;const xE=bd(vE),jf=Ff("end"),Fs=Ff("start");function Ff(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 wE(e){const t=Fs(e),n=jf(e);if(t&&n)return{start:t,end:n}}function ni(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?eu(e.position):"start"in e||"end"in e?eu(e):"line"in e||"column"in e?es(e):""}function es(e){return tu(e&&e.line)+":"+tu(e&&e.column)}function eu(e){return es(e&&e.start)+"-"+es(e&&e.end)}function tu(e){return e&&typeof e=="number"?e:1}class ut extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.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=ni(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ut.prototype.file="";ut.prototype.name="";ut.prototype.reason="";ut.prototype.message="";ut.prototype.stack="";ut.prototype.column=void 0;ut.prototype.line=void 0;ut.prototype.ancestors=void 0;ut.prototype.cause=void 0;ut.prototype.fatal=void 0;ut.prototype.place=void 0;ut.prototype.ruleId=void 0;ut.prototype.source=void 0;const Us={}.hasOwnProperty,kE=new Map,SE=/[A-Z]/g,AE=new Set(["table","tbody","thead","tfoot","tr"]),CE=new Set(["td","th"]),Uf="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function EE(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=_E(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=NE(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"?Ms:KC,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Hf(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Hf(e,t,n){if(t.type==="element")return RE(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return TE(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return IE(e,t,n);if(t.type==="mdxjsEsm")return PE(e,t);if(t.type==="root")return LE(e,t,n);if(t.type==="text")return OE(e,t)}function RE(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ms,e.schema=i),e.ancestors.push(t);const o=zf(e,t.tagName,!1),a=DE(e,t);let s=Bs(e,t);return AE.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!DC(l):!0})),Bf(e,a,o,t),Hs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function TE(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}di(e,t.position)}function PE(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);di(e,t.position)}function IE(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ms,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:zf(e,t.name,!0),a=ME(e,t),s=Bs(e,t);return Bf(e,a,o,t),Hs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function LE(e,t,n){const r={};return Hs(r,Bs(e,t)),e.create(t,e.Fragment,r,n)}function OE(e,t){return t.value}function Bf(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Hs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function NE(e,t,n){return r;function r(i,o,a,s){const c=Array.isArray(a.children)?n:t;return s?c(o,a,s):c(o,a)}}function _E(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=Fs(r);return t(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function DE(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Us.call(t.properties,i)){const o=jE(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&CE.has(t.tagName)?r=s:n[a]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function ME(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else di(e,t.position);else{const i=r.name;let o;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,o=e.evaluater.evaluateExpression(s.expression)}else di(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Bs(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:kE;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;a=l+"-"+c,i.set(l,c+1)}}const s=Hf(e,o,a);s!==void 0&&n.push(s)}return n}function jE(e,t,n){const r=zC(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?IC(n):WC(n)),r.property==="style"){let i=typeof n=="object"?n:FE(e,String(n));return e.stylePropertyNameCase==="css"&&(i=UE(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?UC[r.property]||r.property:r.attribute,n]}}function FE(e,t){try{return xE(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ut("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=Uf+"#cannot-parse-style-attribute",i}}function zf(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const s=Kc(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=Kc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Us.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);di(e)}function di(e,t){const n=new ut("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=Uf+"#cannot-handle-mdx-estrees-without-createevaluater",n}function UE(e){const t={};let n;for(n in e)Us.call(e,n)&&(t[HE(n)]=e[n]);return t}function HE(e){let t=e.replace(SE,BE);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function BE(e){return"-"+e.toLowerCase()}const aa={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"]},zE={};function zs(e,t){const n=zE,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return $f(e,r,i)}function $f(e,t,n){if($E(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 nu(e.children,t,n)}return Array.isArray(e)?nu(e,t,n):""}function nu(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=$f(e[i],t,n);return r.join("")}function $E(e){return!!(e&&typeof e=="object")}const ru=document.createElement("i");function $s(e){const t="&"+e+";";ru.innerHTML=t;const n=ru.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function At(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function Rt(e,t){return e.length>0?(At(e,e.length,0,t),e):t}const iu={}.hasOwnProperty;function Vf(e){const t={};let n=-1;for(;++n<e.length;)VE(t,e[n]);return t}function VE(e,t){let n;for(n in t){const i=(iu.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){iu.call(i,a)||(i[a]=[]);const s=o[a];KE(i[a],Array.isArray(s)?s:s?[s]:[])}}}function KE(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);At(e,0,0,r)}function Kf(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 Dt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ht=Tn(/[A-Za-z]/),lt=Tn(/[\dA-Za-z]/),WE=Tn(/[#-'*+\--9=?A-Z^-~]/);function co(e){return e!==null&&(e<32||e===127)}const ts=Tn(/\d/),qE=Tn(/[\dA-Fa-f]/),QE=Tn(/[!-/:-@[-`{-~]/);function oe(e){return e!==null&&e<-2}function je(e){return e!==null&&(e<0||e===32)}function Se(e){return e===-2||e===-1||e===32}const Io=Tn(/\p{P}|\p{S}/u),Jn=Tn(/\s/);function Tn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function _r(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&<(e.charCodeAt(n+1))&<(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Re(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return Se(l)?(e.enter(n),s(l)):t(l)}function s(l){return Se(l)&&o++<i?(e.consume(l),s):(e.exit(n),t(l))}}const GE={tokenize:YE};function YE(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"),Re(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return oe(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const XE={tokenize:JE},ou={tokenize:ZE};function JE(e){const t=this,n=[];let r=0,i,o,a;return s;function s(w){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const E=t.events.length;let P=E,C;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){C=t.events[P][1].end;break}v(r);let k=E;for(;k<t.events.length;)t.events[k][1].end={...C},k++;return At(t.events,P+1,0,t.events.slice(E)),t.events.length=k,c(w)}return s(w)}function c(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ou,u,d)(w)}function u(w){return i&&x(),v(r),h(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(ou,f,m)(w)}function f(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){i&&x(),v(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(w)}function p(w){if(w===null){b(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return oe(w)?(e.consume(w),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),p)}function b(w,E){const P=t.sliceStream(w);if(E&&P.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(P),t.parser.lazy[w.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const k=t.events.length;let O=k,M,R;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(M){R=t.events[O][1].end;break}M=!0}for(v(r),C=k;C<t.events.length;)t.events[C][1].end={...R},C++;At(t.events,O+1,0,t.events.slice(k)),t.events.length=C}}function v(w){let E=n.length;for(;E-- >w;){const P=n[E];t.containerState=P[1],P[0].exit.call(t,e)}n.length=w}function x(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ZE(e,t,n){return Re(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cr(e){if(e===null||je(e)||Jn(e))return 1;if(Io(e))return 2}function Lo(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ns={name:"attention",resolveAll:e1,tokenize:t1};function e1(e,t){let n=-1,r,i,o,a,s,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};au(d,-l),au(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Rt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Rt(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),c=Rt(c,Lo(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Rt(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Rt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,At(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function t1(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Cr(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const c=e.exit("attentionSequence"),u=Cr(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?d:d&&(i||!h)),c._close=!!(o===42?h:h&&(u||!d)),t(l)}}function au(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const n1={name:"autolink",tokenize:r1};function r1(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return ht(f)?(e.consume(f),a):f===64?n(f):c(f)}function a(f){return f===43||f===45||f===46||lt(f)?(r=1,s(f)):c(f)}function s(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||lt(f))&&r++<32?(e.consume(f),s):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||co(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):WE(f)?(e.consume(f),c):n(f)}function u(f){return lt(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||lt(f))&&r++<63){const m=f===45?h:d;return e.consume(f),m}return n(f)}}const bi={partial:!0,tokenize:i1};function i1(e,t,n){return r;function r(o){return Se(o)?Re(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||oe(o)?t(o):n(o)}}const Wf={continuation:{tokenize:a1},exit:s1,name:"blockQuote",tokenize:o1};function o1(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Se(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function a1(e,t,n){const r=this;return i;function i(a){return Se(a)?Re(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(Wf,t,n)(a)}}function s1(e){e.exit("blockQuote")}const qf={name:"characterEscape",tokenize:l1};function l1(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return QE(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Qf={name:"characterReference",tokenize:c1};function c1(e,t,n){const r=this;let i=0,o,a;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,a=lt,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=qE,u):(e.enter("characterReferenceValue"),o=7,a=ts,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return a===lt&&!$s(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<o?(e.consume(d),u):n(d)}}const su={partial:!0,tokenize:d1},lu={concrete:!0,name:"codeFenced",tokenize:u1};function u1(e,t,n){const r=this,i={partial:!0,tokenize:P};let o=0,a=0,s;return l;function l(C){return c(C)}function c(C){const k=r.events[r.events.length-1];return o=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,s=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(C)}function u(C){return C===s?(a++,e.consume(C),u):a<3?n(C):(e.exit("codeFencedFenceSequence"),Se(C)?Re(e,d,"whitespace")(C):d(C))}function d(C){return C===null||oe(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(su,p,E)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||oe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):Se(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Re(e,f,"whitespace")(C)):C===96&&C===s?n(C):(e.consume(C),h)}function f(C){return C===null||oe(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||oe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===s?n(C):(e.consume(C),m)}function p(C){return e.attempt(i,E,b)(C)}function b(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),v}function v(C){return o>0&&Se(C)?Re(e,x,"linePrefix",o+1)(C):x(C)}function x(C){return C===null||oe(C)?e.check(su,p,E)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||oe(C)?(e.exit("codeFlowValue"),x(C)):(e.consume(C),w)}function E(C){return e.exit("codeFenced"),t(C)}function P(C,k,O){let M=0;return R;function R($){return C.enter("lineEnding"),C.consume($),C.exit("lineEnding"),_}function _($){return C.enter("codeFencedFence"),Se($)?Re(C,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):L($)}function L($){return $===s?(C.enter("codeFencedFenceSequence"),z($)):O($)}function z($){return $===s?(M++,C.consume($),z):M>=a?(C.exit("codeFencedFenceSequence"),Se($)?Re(C,U,"whitespace")($):U($)):O($)}function U($){return $===null||oe($)?(C.exit("codeFencedFence"),k($)):O($)}}}function d1(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const sa={name:"codeIndented",tokenize:h1},f1={partial:!0,tokenize:p1};function h1(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Re(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):oe(c)?e.attempt(f1,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||oe(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function p1(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Re(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):oe(a)?i(a):n(a)}}const m1={name:"codeText",previous:y1,resolve:g1,tokenize:b1};function g1(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 y1(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function b1(e,t,n){let r=0,i,o;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),r++,s):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||oe(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",c(d))}}class v1{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 o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Xr(this.left,r),o.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),Xr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Xr(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);Xr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Xr(this.left,n.reverse())}}}function Xr(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 Gf(e){const t={};let n=-1,r,i,o,a,s,l,c;const u=new v1(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,x1(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=u.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return At(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function x1(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,h=-1,f=n,m=0,p=0;const b=[p];for(;f;){for(;e.get(++i)[1]!==f;);o.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<s.length;)s[h][0]==="exit"&&s[h-1][0]==="enter"&&s[h][1].type===s[h-1][1].type&&s[h][1].start.line!==s[h][1].end.line&&(p=h+1,b.push(p),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):b.pop(),h=b.length;h--;){const v=s.slice(b[h],b[h+1]),x=o.pop();l.push([x,x+v.length-1]),e.splice(x,2,v)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const w1={resolve:S1,tokenize:A1},k1={partial:!0,tokenize:C1};function S1(e){return Gf(e),e}function A1(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?o(s):oe(s)?e.check(k1,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function C1(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Re(e,o,"linePrefix")}function o(a){if(a===null||oe(a))return n(a);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(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Yf(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(v){return v===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(v),e.exit(o),h):v===null||v===32||v===41||co(v)?n(v):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(v))}function h(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===62?(e.exit("chunkString"),e.exit(s),h(v)):v===null||v===60||oe(v)?n(v):(e.consume(v),v===92?m:f)}function m(v){return v===60||v===62||v===92?(e.consume(v),f):f(v)}function p(v){return!u&&(v===null||v===41||je(v))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(v)):u<c&&v===40?(e.consume(v),u++,p):v===41?(e.consume(v),u--,p):v===null||v===32||v===40||co(v)?n(v):(e.consume(v),v===92?b:p)}function b(v){return v===40||v===41||v===92?(e.consume(v),p):p(v)}}function Xf(e,t,n,r,i,o){const a=this;let s=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),u}function u(f){return s>999||f===null||f===91||f===93&&!l||f===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):oe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||oe(f)||s++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!Se(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),s++,d):d(f)}}function Jf(e,t,n,r,i,o){let a;return s;function s(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),c(h))}function c(h){return h===a?(e.exit(o),l(a)):h===null?n(h):oe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Re(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===a||h===null||oe(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===a||h===92?(e.consume(h),u):u(h)}}function ri(e,t){let n;return r;function r(i){return oe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Se(i)?Re(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const E1={name:"definition",tokenize:T1},R1={partial:!0,tokenize:P1};function T1(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),a(f)}function a(f){return Xf.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function s(f){return i=Dt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return je(f)?ri(e,c)(f):c(f)}function c(f){return Yf(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(R1,d,d)(f)}function d(f){return Se(f)?Re(e,h,"whitespace")(f):h(f)}function h(f){return f===null||oe(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function P1(e,t,n){return r;function r(s){return je(s)?ri(e,i)(s):n(s)}function i(s){return Jf(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return Se(s)?Re(e,a,"whitespace")(s):a(s)}function a(s){return s===null||oe(s)?t(s):n(s)}}const I1={name:"hardBreakEscape",tokenize:L1};function L1(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return oe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const O1={name:"headingAtx",resolve:N1,tokenize:_1};function N1(e,t){let n=e.length-2,r=3,i,o;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},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},At(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function _1(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(e.consume(u),a):u===null||je(u)?(e.exit("atxHeadingSequence"),s(u)):n(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||oe(u)?(e.exit("atxHeading"),t(u)):Se(u)?Re(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||je(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}const D1=["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"],cu=["pre","script","style","textarea"],M1={concrete:!0,name:"htmlFlow",resolveTo:U1,tokenize:H1},j1={partial:!0,tokenize:z1},F1={partial:!0,tokenize:B1};function U1(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 H1(e,t,n){const r=this;let i,o,a,s,l;return c;function c(A){return u(A)}function u(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),d}function d(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),o=!0,p):A===63?(e.consume(A),i=3,r.interrupt?t:S):ht(A)?(e.consume(A),a=String.fromCharCode(A),b):n(A)}function h(A){return A===45?(e.consume(A),i=2,f):A===91?(e.consume(A),i=5,s=0,m):ht(A)?(e.consume(A),i=4,r.interrupt?t:S):n(A)}function f(A){return A===45?(e.consume(A),r.interrupt?t:S):n(A)}function m(A){const ae="CDATA[";return A===ae.charCodeAt(s++)?(e.consume(A),s===ae.length?r.interrupt?t:L:m):n(A)}function p(A){return ht(A)?(e.consume(A),a=String.fromCharCode(A),b):n(A)}function b(A){if(A===null||A===47||A===62||je(A)){const ae=A===47,me=a.toLowerCase();return!ae&&!o&&cu.includes(me)?(i=1,r.interrupt?t(A):L(A)):D1.includes(a.toLowerCase())?(i=6,ae?(e.consume(A),v):r.interrupt?t(A):L(A)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):o?x(A):w(A))}return A===45||lt(A)?(e.consume(A),a+=String.fromCharCode(A),b):n(A)}function v(A){return A===62?(e.consume(A),r.interrupt?t:L):n(A)}function x(A){return Se(A)?(e.consume(A),x):R(A)}function w(A){return A===47?(e.consume(A),R):A===58||A===95||ht(A)?(e.consume(A),E):Se(A)?(e.consume(A),w):R(A)}function E(A){return A===45||A===46||A===58||A===95||lt(A)?(e.consume(A),E):P(A)}function P(A){return A===61?(e.consume(A),C):Se(A)?(e.consume(A),P):w(A)}function C(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,k):Se(A)?(e.consume(A),C):O(A)}function k(A){return A===l?(e.consume(A),l=null,M):A===null||oe(A)?n(A):(e.consume(A),k)}function O(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||je(A)?P(A):(e.consume(A),O)}function M(A){return A===47||A===62||Se(A)?w(A):n(A)}function R(A){return A===62?(e.consume(A),_):n(A)}function _(A){return A===null||oe(A)?L(A):Se(A)?(e.consume(A),_):n(A)}function L(A){return A===45&&i===2?(e.consume(A),G):A===60&&i===1?(e.consume(A),Y):A===62&&i===4?(e.consume(A),ie):A===63&&i===3?(e.consume(A),S):A===93&&i===5?(e.consume(A),F):oe(A)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(j1,Z,z)(A)):A===null||oe(A)?(e.exit("htmlFlowData"),z(A)):(e.consume(A),L)}function z(A){return e.check(F1,U,Z)(A)}function U(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),$}function $(A){return A===null||oe(A)?z(A):(e.enter("htmlFlowData"),L(A))}function G(A){return A===45?(e.consume(A),S):L(A)}function Y(A){return A===47?(e.consume(A),a="",V):L(A)}function V(A){if(A===62){const ae=a.toLowerCase();return cu.includes(ae)?(e.consume(A),ie):L(A)}return ht(A)&&a.length<8?(e.consume(A),a+=String.fromCharCode(A),V):L(A)}function F(A){return A===93?(e.consume(A),S):L(A)}function S(A){return A===62?(e.consume(A),ie):A===45&&i===2?(e.consume(A),S):L(A)}function ie(A){return A===null||oe(A)?(e.exit("htmlFlowData"),Z(A)):(e.consume(A),ie)}function Z(A){return e.exit("htmlFlow"),t(A)}}function B1(e,t,n){const r=this;return i;function i(a){return oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function z1(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(bi,t,n)}}const $1={name:"htmlText",tokenize:V1};function V1(e,t,n){const r=this;let i,o,a;return s;function s(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),l}function l(S){return S===33?(e.consume(S),c):S===47?(e.consume(S),P):S===63?(e.consume(S),w):ht(S)?(e.consume(S),O):n(S)}function c(S){return S===45?(e.consume(S),u):S===91?(e.consume(S),o=0,m):ht(S)?(e.consume(S),x):n(S)}function u(S){return S===45?(e.consume(S),f):n(S)}function d(S){return S===null?n(S):S===45?(e.consume(S),h):oe(S)?(a=d,Y(S)):(e.consume(S),d)}function h(S){return S===45?(e.consume(S),f):d(S)}function f(S){return S===62?G(S):S===45?h(S):d(S)}function m(S){const ie="CDATA[";return S===ie.charCodeAt(o++)?(e.consume(S),o===ie.length?p:m):n(S)}function p(S){return S===null?n(S):S===93?(e.consume(S),b):oe(S)?(a=p,Y(S)):(e.consume(S),p)}function b(S){return S===93?(e.consume(S),v):p(S)}function v(S){return S===62?G(S):S===93?(e.consume(S),v):p(S)}function x(S){return S===null||S===62?G(S):oe(S)?(a=x,Y(S)):(e.consume(S),x)}function w(S){return S===null?n(S):S===63?(e.consume(S),E):oe(S)?(a=w,Y(S)):(e.consume(S),w)}function E(S){return S===62?G(S):w(S)}function P(S){return ht(S)?(e.consume(S),C):n(S)}function C(S){return S===45||lt(S)?(e.consume(S),C):k(S)}function k(S){return oe(S)?(a=k,Y(S)):Se(S)?(e.consume(S),k):G(S)}function O(S){return S===45||lt(S)?(e.consume(S),O):S===47||S===62||je(S)?M(S):n(S)}function M(S){return S===47?(e.consume(S),G):S===58||S===95||ht(S)?(e.consume(S),R):oe(S)?(a=M,Y(S)):Se(S)?(e.consume(S),M):G(S)}function R(S){return S===45||S===46||S===58||S===95||lt(S)?(e.consume(S),R):_(S)}function _(S){return S===61?(e.consume(S),L):oe(S)?(a=_,Y(S)):Se(S)?(e.consume(S),_):M(S)}function L(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,z):oe(S)?(a=L,Y(S)):Se(S)?(e.consume(S),L):(e.consume(S),U)}function z(S){return S===i?(e.consume(S),i=void 0,$):S===null?n(S):oe(S)?(a=z,Y(S)):(e.consume(S),z)}function U(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||je(S)?M(S):(e.consume(S),U)}function $(S){return S===47||S===62||je(S)?M(S):n(S)}function G(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function Y(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),V}function V(S){return Se(S)?Re(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):F(S)}function F(S){return e.enter("htmlTextData"),a(S)}}const Vs={name:"labelEnd",resolveAll:Q1,resolveTo:G1,tokenize:Y1},K1={tokenize:X1},W1={tokenize:J1},q1={tokenize:Z1};function Q1(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&&At(e,0,e.length,n),e}function G1(e,t){let n=e.length,r=0,i,o,a,s;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",c,t]],s=Rt(s,e.slice(o+1,o+r+3)),s=Rt(s,[["enter",u,t]]),s=Rt(s,Lo(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=Rt(s,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),s=Rt(s,e.slice(a+1)),s=Rt(s,[["exit",l,t]]),At(e,o,e.length,s),e}function Y1(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(h){return o?o._inactive?d(h):(a=r.parser.defined.includes(Dt(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(K1,u,a?u:d)(h):h===91?e.attempt(W1,u,a?c:d)(h):a?u(h):d(h)}function c(h){return e.attempt(q1,u,d)(h)}function u(h){return t(h)}function d(h){return o._balanced=!0,n(h)}}function X1(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 je(d)?ri(e,o)(d):o(d)}function o(d){return d===41?u(d):Yf(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return je(d)?ri(e,l)(d):u(d)}function s(d){return n(d)}function l(d){return d===34||d===39||d===40?Jf(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return je(d)?ri(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function J1(e,t,n){const r=this;return i;function i(s){return Xf.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(Dt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function Z1(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const eR={name:"labelStartImage",resolveAll:Vs.resolveAll,tokenize:tR};function tR(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const nR={name:"labelStartLink",resolveAll:Vs.resolveAll,tokenize:rR};function rR(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const la={name:"lineEnding",tokenize:iR};function iR(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Re(e,t,"linePrefix")}}const $i={name:"thematicBreak",tokenize:oR};function oR(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||oe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Se(c)?Re(e,s,"whitespace")(c):s(c))}}const mt={continuation:{tokenize:cR},exit:dR,name:"list",tokenize:lR},aR={partial:!0,tokenize:fR},sR={partial:!0,tokenize:uR};function lR(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(f){const m=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:ts(f)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check($i,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return ts(f)&&++a<10?(e.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(bi,r.interrupt?n:u,e.attempt(aR,h,d))}function u(f){return r.containerState.initialBlankLine=!0,o++,h(f)}function d(f){return Se(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function cR(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(bi,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Re(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!Se(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(sR,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Re(e,e.attempt(mt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function uR(e,t,n){const r=this;return Re(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function dR(e){e.exit(this.containerState.type)}function fR(e,t,n){const r=this;return Re(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Se(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const uu={name:"setextUnderline",resolveTo:hR,tokenize:pR};function hR(e,t){let n=e.length,r,i,o;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),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function pR(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Se(c)?Re(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||oe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const mR={tokenize:gR};function gR(e){const t=this,n=e.attempt(bi,r,e.attempt(this.parser.constructs.flowInitial,i,Re(e,e.attempt(this.parser.constructs.flow,i,e.attempt(w1,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const yR={resolveAll:eh()},bR=Zf("string"),vR=Zf("text");function Zf(e){return{resolveAll:eh(e==="text"?xR:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(u){return c(u)?o(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function eh(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function xR(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 o=i.length,a=-1,s=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const wR={42:mt,43:mt,45:mt,48:mt,49:mt,50:mt,51:mt,52:mt,53:mt,54:mt,55:mt,56:mt,57:mt,62:Wf},kR={91:E1},SR={[-2]:sa,[-1]:sa,32:sa},AR={35:O1,42:$i,45:[uu,$i],60:M1,61:uu,95:$i,96:lu,126:lu},CR={38:Qf,92:qf},ER={[-5]:la,[-4]:la,[-3]:la,33:eR,38:Qf,42:ns,60:[n1,$1],91:nR,92:[I1,qf],93:Vs,95:ns,96:m1},RR={null:[ns,yR]},TR={null:[42,95]},PR={null:[]},IR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:TR,contentInitial:kR,disable:PR,document:wR,flow:AR,flowInitial:SR,insideSpan:RR,string:CR,text:ER},Symbol.toStringTag,{value:"Module"}));function LR(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={},o=[];let a=[],s=[];const l={attempt:k(P),check:k(C),consume:x,enter:w,exit:E,interrupt:k(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function d(_){return a=Rt(a,_),b(),a[a.length-1]!==null?[]:(O(t,0),c.events=Lo(o,c.events,c),c.events)}function h(_,L){return NR(f(_),L)}function f(_){return OR(a,_)}function m(){const{_bufferIndex:_,_index:L,line:z,column:U,offset:$}=r;return{_bufferIndex:_,_index:L,line:z,column:U,offset:$}}function p(_){i[_.line]=_.column,R()}function b(){let _;for(;r._index<a.length;){const L=a[r._index];if(typeof L=="string")for(_=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===_&&r._bufferIndex<L.length;)v(L.charCodeAt(r._bufferIndex));else v(L)}}function v(_){u=u(_)}function x(_){oe(_)?(r.line++,r.column=1,r.offset+=_===-3?2:1,R()):_!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=_}function w(_,L){const z=L||{};return z.type=_,z.start=m(),c.events.push(["enter",z,c]),s.push(z),z}function E(_){const L=s.pop();return L.end=m(),c.events.push(["exit",L,c]),L}function P(_,L){O(_,L.from)}function C(_,L){L.restore()}function k(_,L){return z;function z(U,$,G){let Y,V,F,S;return Array.isArray(U)?Z(U):"tokenize"in U?Z([U]):ie(U);function ie(be){return q;function q(he){const Pe=he!==null&&be[he],xe=he!==null&&be.null,ke=[...Array.isArray(Pe)?Pe:Pe?[Pe]:[],...Array.isArray(xe)?xe:xe?[xe]:[]];return Z(ke)(he)}}function Z(be){return Y=be,V=0,be.length===0?G:A(be[V])}function A(be){return q;function q(he){return S=M(),F=be,be.partial||(c.currentConstruct=be),be.name&&c.parser.constructs.disable.null.includes(be.name)?me():be.tokenize.call(L?Object.assign(Object.create(c),L):c,l,ae,me)(he)}}function ae(be){return _(F,S),$}function me(be){return S.restore(),++V<Y.length?A(Y[V]):G}}}function O(_,L){_.resolveAll&&!o.includes(_)&&o.push(_),_.resolve&&At(c.events,L,c.events.length-L,_.resolve(c.events.slice(L),c)),_.resolveTo&&(c.events=_.resolveTo(c.events,c))}function M(){const _=m(),L=c.previous,z=c.currentConstruct,U=c.events.length,$=Array.from(s);return{from:U,restore:G};function G(){r=_,c.previous=L,c.currentConstruct=z,c.events.length=U,s=$,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function OR(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function NR(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
|
|
142
|
-
`;break}case-3:{a=`\r
|
|
143
|
-
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function _R(e){const r={constructs:Vf([IR,...(e||{}).extensions||[]]),content:i(GE),defined:[],document:i(XE),flow:i(mR),lazy:{},string:i(bR),text:i(vR)};return r;function i(o){return a;function a(s){return LR(r,o,s)}}}function DR(e){for(;!Gf(e););return e}const du=/[\0\t\n\r]/g;function MR(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const l=[];let c,u,d,h,f;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(du.lastIndex=d,c=du.exec(o),h=c&&c.index!==void 0?c.index:o.length,f=o.charCodeAt(h),!c){t=o.slice(d);break}if(f===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(o.slice(d,h)),e+=h-d),f){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const jR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function FR(e){return e.replace(jR,UR)}function UR(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Kf(n.slice(o?2:1),o?16:10)}return $s(n)||e}const th={}.hasOwnProperty;function HR(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),BR(n)(DR(_R(n).document().write(MR()(e,t,!0))))}function BR(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(On),autolinkProtocol:M,autolinkEmail:M,atxHeading:o(Ut),blockQuote:o(xe),characterEscape:M,characterReference:M,codeFenced:o(ke),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(ke,a),codeText:o(pe,a),codeTextData:M,data:M,codeFlowValue:M,definition:o(qe),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Xe),hardBreakEscape:o(nt),hardBreakTrailing:o(nt),htmlFlow:o(Ht,a),htmlFlowData:M,htmlText:o(Ht,a),htmlTextData:M,image:o(Ln),label:a,link:o(On),listItem:o(Jt),listItemValue:h,listOrdered:o(Nn,d),listUnordered:o(Nn),paragraph:o(ir),reference:A,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Ut),strong:o(Tt),thematicBreak:o(Zt)},exit:{atxHeading:l(),atxHeadingSequence:P,autolink:l(),autolinkEmail:Pe,autolinkProtocol:he,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:be,characterReference:q,codeFenced:l(b),codeFencedFence:p,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:l(v),codeText:l($),codeTextData:R,data:R,definition:l(),definitionDestinationString:E,definitionLabelString:x,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(z),htmlFlowData:R,htmlText:l(U),htmlTextData:R,image:l(Y),label:F,labelText:V,lineEnding:_,link:l(G),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ae,resourceDestinationString:S,resourceTitleString:ie,resource:Z,setextHeading:l(O),setextHeadingLineSequence:k,setextHeadingText:C,strong:l(),thematicBreak:l()}};nh(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(D){let B={type:"root",children:[]};const ne={stack:[B],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},se=[];let Ae=-1;for(;++Ae<D.length;)if(D[Ae][1].type==="listOrdered"||D[Ae][1].type==="listUnordered")if(D[Ae][0]==="enter")se.push(Ae);else{const tt=se.pop();Ae=i(D,tt,Ae)}for(Ae=-1;++Ae<D.length;){const tt=t[D[Ae][0]];th.call(tt,D[Ae][1].type)&&tt[D[Ae][1].type].call(Object.assign({sliceSerialize:D[Ae][2].sliceSerialize},ne),D[Ae][1])}if(ne.tokenStack.length>0){const tt=ne.tokenStack[ne.tokenStack.length-1];(tt[1]||fu).call(ne,void 0,tt[0])}for(B.position={start:mn(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:mn(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae<t.transforms.length;)B=t.transforms[Ae](B)||B;return B}function i(D,B,ne){let se=B-1,Ae=-1,tt=!1,Et,Ve,dt,It;for(;++se<=ne;){const ze=D[se];switch(ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ze[0]==="enter"?Ae++:Ae--,It=void 0;break}case"lineEndingBlank":{ze[0]==="enter"&&(Et&&!It&&!Ae&&!dt&&(dt=se),It=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:It=void 0}if(!Ae&&ze[0]==="enter"&&ze[1].type==="listItemPrefix"||Ae===-1&&ze[0]==="exit"&&(ze[1].type==="listUnordered"||ze[1].type==="listOrdered")){if(Et){let Bt=se;for(Ve=void 0;Bt--;){const pt=D[Bt];if(pt[1].type==="lineEnding"||pt[1].type==="lineEndingBlank"){if(pt[0]==="exit")continue;Ve&&(D[Ve][1].type="lineEndingBlank",tt=!0),pt[1].type="lineEnding",Ve=Bt}else if(!(pt[1].type==="linePrefix"||pt[1].type==="blockQuotePrefix"||pt[1].type==="blockQuotePrefixWhitespace"||pt[1].type==="blockQuoteMarker"||pt[1].type==="listItemIndent"))break}dt&&(!Ve||dt<Ve)&&(Et._spread=!0),Et.end=Object.assign({},Ve?D[Ve][1].start:ze[1].end),D.splice(Ve||se,0,["exit",Et,ze[2]]),se++,ne++}if(ze[1].type==="listItemPrefix"){const Bt={type:"listItem",_spread:!1,start:Object.assign({},ze[1].start),end:void 0};Et=Bt,D.splice(se,0,["enter",Bt,ze[2]]),se++,ne++,dt=void 0,It=!0}}}return D[B][1]._spread=tt,ne}function o(D,B){return ne;function ne(se){s.call(this,D(se),se),B&&B.call(this,se)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(D,B,ne){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([B,ne||void 0]),D.position={start:mn(B.start),end:void 0}}function l(D){return B;function B(ne){D&&D.call(this,ne),c.call(this,ne)}}function c(D,B){const ne=this.stack.pop(),se=this.tokenStack.pop();if(se)se[0].type!==D.type&&(B?B.call(this,D,se[0]):(se[1]||fu).call(this,D,se[0]));else throw new Error("Cannot close `"+D.type+"` ("+ni({start:D.start,end:D.end})+"): it’s not open");ne.position.end=mn(D.end)}function u(){return zs(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(D){if(this.data.expectingFirstListItemValue){const B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function f(){const D=this.resume(),B=this.stack[this.stack.length-1];B.lang=D}function m(){const D=this.resume(),B=this.stack[this.stack.length-1];B.meta=D}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const D=this.resume(),B=this.stack[this.stack.length-1];B.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const D=this.resume(),B=this.stack[this.stack.length-1];B.value=D.replace(/(\r?\n|\r)$/g,"")}function x(D){const B=this.resume(),ne=this.stack[this.stack.length-1];ne.label=B,ne.identifier=Dt(this.sliceSerialize(D)).toLowerCase()}function w(){const D=this.resume(),B=this.stack[this.stack.length-1];B.title=D}function E(){const D=this.resume(),B=this.stack[this.stack.length-1];B.url=D}function P(D){const B=this.stack[this.stack.length-1];if(!B.depth){const ne=this.sliceSerialize(D).length;B.depth=ne}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function k(D){const B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function M(D){const ne=this.stack[this.stack.length-1].children;let se=ne[ne.length-1];(!se||se.type!=="text")&&(se=Pt(),se.position={start:mn(D.start),end:void 0},ne.push(se)),this.stack.push(se)}function R(D){const B=this.stack.pop();B.value+=this.sliceSerialize(D),B.position.end=mn(D.end)}function _(D){const B=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ne=B.children[B.children.length-1];ne.position.end=mn(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(B.type)&&(M.call(this,D),R.call(this,D))}function L(){this.data.atHardBreak=!0}function z(){const D=this.resume(),B=this.stack[this.stack.length-1];B.value=D}function U(){const D=this.resume(),B=this.stack[this.stack.length-1];B.value=D}function $(){const D=this.resume(),B=this.stack[this.stack.length-1];B.value=D}function G(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=B,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function Y(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=B,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function V(D){const B=this.sliceSerialize(D),ne=this.stack[this.stack.length-2];ne.label=FR(B),ne.identifier=Dt(B).toLowerCase()}function F(){const D=this.stack[this.stack.length-1],B=this.resume(),ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,ne.type==="link"){const se=D.children;ne.children=se}else ne.alt=B}function S(){const D=this.resume(),B=this.stack[this.stack.length-1];B.url=D}function ie(){const D=this.resume(),B=this.stack[this.stack.length-1];B.title=D}function Z(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function ae(D){const B=this.resume(),ne=this.stack[this.stack.length-1];ne.label=B,ne.identifier=Dt(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function me(D){this.data.characterReferenceType=D.type}function be(D){const B=this.sliceSerialize(D),ne=this.data.characterReferenceType;let se;ne?(se=Kf(B,ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):se=$s(B);const Ae=this.stack[this.stack.length-1];Ae.value+=se}function q(D){const B=this.stack.pop();B.position.end=mn(D.end)}function he(D){R.call(this,D);const B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(D)}function Pe(D){R.call(this,D);const B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(D)}function xe(){return{type:"blockquote",children:[]}}function ke(){return{type:"code",lang:null,meta:null,value:""}}function pe(){return{type:"inlineCode",value:""}}function qe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Xe(){return{type:"emphasis",children:[]}}function Ut(){return{type:"heading",depth:0,children:[]}}function nt(){return{type:"break"}}function Ht(){return{type:"html",value:""}}function Ln(){return{type:"image",title:null,url:"",alt:null}}function On(){return{type:"link",title:null,url:"",children:[]}}function Nn(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function Jt(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function ir(){return{type:"paragraph",children:[]}}function Tt(){return{type:"strong",children:[]}}function Pt(){return{type:"text",value:""}}function Zt(){return{type:"thematicBreak"}}}function mn(e){return{line:e.line,column:e.column,offset:e.offset}}function nh(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?nh(e,r):zR(e,r)}}function zR(e,t){let n;for(n in t)if(th.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 fu(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ni({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ni({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ni({start:t.start,end:t.end})+") is still open")}function $R(e){const t=this;t.parser=n;function n(r){return HR(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function VR(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 KR(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
144
|
-
`}]}function WR(e,t){const n=t.value?t.value+`
|
|
145
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function qR(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function QR(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GR(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=_r(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={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(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function YR(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 XR(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function rh(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),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function JR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rh(e,t);const i={src:_r(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function ZR(e,t){const n={src:_r(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 eT(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 tT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return rh(e,t);const i={href:_r(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function nT(e,t){const n={href:_r(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 rT(e,t,n){const r=e.all(t),i=n?iT(n):ih(t),o={},a=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(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:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const u=r[s];(i||s!==0||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
|
|
146
|
-
`}),u.type==="element"&&u.tagName==="p"&&!i?a.push(...u.children):a.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
|
|
147
|
-
`});const c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)}function iT(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=ih(n[r])}return t}function ih(e){const t=e.spread;return t??e.children.length>1}function oT(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 a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function aT(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sT(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function lT(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cT(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Fs(t.children[1]),l=jf(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function uT(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<s;){const d=t.children[l],h={},f=a?a[l]:void 0;f&&(h.align=f);let m={type:"element",tagName:o,properties:h,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function dT(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const hu=9,pu=32;function fT(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(mu(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(mu(t.slice(i),i>0,!1)),o.join("")}function mu(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===hu||o===pu;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===hu||o===pu;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function hT(e,t){const n={type:"text",value:fT(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function pT(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const mT={blockquote:VR,break:KR,code:WR,delete:qR,emphasis:QR,footnoteReference:GR,heading:YR,html:XR,imageReference:JR,image:ZR,inlineCode:eT,linkReference:tT,link:nT,listItem:rT,list:oT,paragraph:aT,root:sT,strong:lT,table:cT,tableCell:dT,tableRow:uT,text:hT,thematicBreak:pT,toml:Li,yaml:Li,definition:Li,footnoteDefinition:Li};function Li(){}const oh=-1,Oo=0,ii=1,uo=2,Ks=3,Ws=4,qs=5,Qs=6,ah=7,sh=8,gT=typeof self=="object"?self:globalThis,gu=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new gT[e](t)},yT=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case Oo:case oh:return n(a,i);case ii:{const s=n([],i);for(const l of a)s.push(r(l));return s}case uo:{const s=n({},i);for(const[l,c]of a)s[r(l)]=r(c);return s}case Ks:return n(new Date(a),i);case Ws:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case qs:{const s=n(new Map,i);for(const[l,c]of a)s.set(r(l),r(c));return s}case Qs:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case ah:{const{name:s,message:l}=a;return n(gu(s,l),i)}case sh:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:s}=new Uint8Array(a);return n(new DataView(s),a)}}return n(gu(o,a),i)};return r},yu=e=>yT(new Map,e)(0),Un="",{toString:bT}={},{keys:vT}=Object,Jr=e=>{const t=typeof e;if(t!=="object"||!e)return[Oo,t];const n=bT.call(e).slice(8,-1);switch(n){case"Array":return[ii,Un];case"Object":return[uo,Un];case"Date":return[Ks,Un];case"RegExp":return[Ws,Un];case"Map":return[qs,Un];case"Set":return[Qs,Un];case"DataView":return[ii,n]}return n.includes("Array")?[ii,n]:n.includes("Error")?[ah,n]:[uo,n]},Oi=([e,t])=>e===Oo&&(t==="function"||t==="symbol"),xT=(e,t,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=Jr(a);switch(s){case Oo:{let u=a;switch(l){case"bigint":s=sh,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([oh],a)}return i([s,u],a)}case ii:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),i([l,[...h]],a)}const u=[],d=i([s,u],a);for(const h of a)u.push(o(h));return d}case uo:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const u=[],d=i([s,u],a);for(const h of vT(a))(e||!Oi(Jr(a[h])))&&u.push([o(h),o(a[h])]);return d}case Ks:return i([s,isNaN(a.getTime())?Un:a.toISOString()],a);case Ws:{const{source:u,flags:d}=a;return i([s,{source:u,flags:d}],a)}case qs:{const u=[],d=i([s,u],a);for(const[h,f]of a)(e||!(Oi(Jr(h))||Oi(Jr(f))))&&u.push([o(h),o(f)]);return d}case Qs:{const u=[],d=i([s,u],a);for(const h of a)(e||!Oi(Jr(h)))&&u.push(o(h));return d}}const{message:c}=a;return i([s,{name:l,message:c}],a)};return o},bu=(e,{json:t,lossy:n}={})=>{const r=[];return xT(!(t||n),!!t,new Map,r)(e),r},fo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?yu(bu(e,t)):structuredClone(e):(e,t)=>yu(bu(e,t));function wT(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 kT(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ST(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||wT,r=e.options.footnoteBackLabel||kT,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),h=_r(d.toLowerCase());let f=0;const m=[],p=e.footnoteCounts.get(d);for(;p!==void 0&&++f<=p;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,f);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const b=u[u.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const x=b.children[b.children.length-1];x&&x.type==="text"?x.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...m)}else u.push(...m);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,v),s.push(v)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...fo(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
148
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
|
|
149
|
-
`}]}}const No=function(e){if(e==null)return RT;if(typeof e=="function")return _o(e);if(typeof e=="object")return Array.isArray(e)?AT(e):CT(e);if(typeof e=="string")return ET(e);throw new Error("Expected function, string, or object as test")};function AT(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=No(e[n]);return _o(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function CT(e){const t=e;return _o(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function ET(e){return _o(t);function t(n){return n&&n.type===e}}function _o(e){return t;function t(n,r,i){return!!(TT(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function RT(){return!0}function TT(e){return e!==null&&typeof e=="object"&&"type"in e}const lh=[],PT=!0,rs=!1,IT="skip";function ch(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=No(i),a=r?-1:1;s(e,void 0,[])();function s(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=lh,m,p,b;if((!t||o(l,c,u[u.length-1]||void 0))&&(f=LT(n(l,u)),f[0]===rs))return f;if("children"in l&&l.children){const v=l;if(v.children&&f[0]!==IT)for(p=(r?v.children.length:-1)+a,b=u.concat(v);p>-1&&p<v.children.length;){const x=v.children[p];if(m=s(x,p,b)(),m[0]===rs)return m;p=typeof m[1]=="number"?m[1]:p+a}}return f}}}function LT(e){return Array.isArray(e)?e:typeof e=="number"?[PT,e]:e==null?lh:[e]}function Gs(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),ch(e,o,s,i);function s(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return a(l,d,u)}}const is={}.hasOwnProperty,OT={};function NT(e,t){const n=t||OT,r=new Map,i=new Map,o=new Map,a={...mT,...n.handlers},s={all:c,applyData:DT,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:l,options:n,patch:_T,wrap:jT};return Gs(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),s;function l(u,d){const h=u.type,f=s.handlers[h];if(is.call(s.handlers,h)&&f)return f(s,u,d);if(s.options.passThrough&&s.options.passThrough.includes(h)){if("children"in u){const{children:p,...b}=u,v=fo(b);return v.children=s.all(u),v}return fo(u)}return(s.options.unknownHandler||MT)(s,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let f=-1;for(;++f<h.length;){const m=s.one(h[f],u);if(m){if(f&&h[f-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=vu(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=vu(p.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function _T(e,t){e.position&&(t.position=wE(e))}function DT(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,fo(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function MT(e,t){const n=t.data||{},r="value"in t&&!(is.call(n,"hProperties")||is.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 jT(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
150
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
151
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
152
|
-
`}),n}function vu(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function xu(e,t){const n=NT(e,t),r=n.one(e,void 0),i=ST(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
153
|
-
`},i),o}function FT(e,t){return e&&"run"in e?async function(n,r){const i=xu(n,{file:r,...t});await e.run(i,r)}:function(n,r){return xu(n,{file:r,...e||t})}}function wu(e){if(e)throw e}var Vi=Object.prototype.hasOwnProperty,uh=Object.prototype.toString,ku=Object.defineProperty,Su=Object.getOwnPropertyDescriptor,Au=function(t){return typeof Array.isArray=="function"?Array.isArray(t):uh.call(t)==="[object Array]"},Cu=function(t){if(!t||uh.call(t)!=="[object Object]")return!1;var n=Vi.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Vi.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Vi.call(t,i)},Eu=function(t,n){ku&&n.name==="__proto__"?ku(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ru=function(t,n){if(n==="__proto__")if(Vi.call(t,n)){if(Su)return Su(t,n).value}else return;return t[n]},UT=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=Ru(s,n),i=Ru(t,n),s!==i&&(u&&i&&(Cu(i)||(o=Au(i)))?(o?(o=!1,a=r&&Au(r)?r:[]):a=r&&Cu(r)?r:{},Eu(s,{name:n,newValue:e(u,a,i)})):typeof i<"u"&&Eu(s,{name:n,newValue:i}));return s};const ca=bd(UT);function os(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 HT(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...c){const u=e[++o];let d=-1;if(l){a(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?BT(u,s)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function BT(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(c){const u=c;if(s&&n)throw u;return i(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const Kt={basename:zT,dirname:$T,extname:VT,join:KT,sep:"/"};function zT(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');vi(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function $T(e){if(vi(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 VT(e){vi(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function KT(...e){let t=-1,n;for(;++t<e.length;)vi(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":WT(n)}function WT(e){vi(e);const t=e.codePointAt(0)===47;let n=qT(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function qT(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function vi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const QT={cwd:GT};function GT(){return"/"}function as(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function YT(e){if(typeof e=="string")e=new URL(e);else if(!as(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 XT(e)}function XT(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 ua=["history","path","basename","stem","extname","dirname"];class dh{constructor(t){let n;t?as(t)?n={path:t}:typeof t=="string"||JT(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":QT.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ua.length;){const o=ua[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)ua.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Kt.basename(this.path):void 0}set basename(t){fa(t,"basename"),da(t,"basename"),this.path=Kt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Kt.dirname(this.path):void 0}set dirname(t){Tu(this.basename,"dirname"),this.path=Kt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Kt.extname(this.path):void 0}set extname(t){if(da(t,"extname"),Tu(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=Kt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){as(t)&&(t=YT(t)),fa(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Kt.basename(this.path,this.extname):void 0}set stem(t){fa(t,"stem"),da(t,"stem"),this.path=Kt.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 ut(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 da(e,t){if(e&&e.includes(Kt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Kt.sep+"`")}function fa(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Tu(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function JT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ZT=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},eP={}.hasOwnProperty;class Ys extends ZT{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=HT()}copy(){const t=new Ys;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ca(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ma("data",this.frozen),this.namespace[t]=n,this):eP.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ma("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=Ni(t),r=this.parser||this.Parser;return ha("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ha("process",this.parser||this.Parser),pa("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=Ni(t),l=r.parse(s);r.run(l,s,function(u,d,h){if(u||!d||!h)return c(u);const f=d,m=r.stringify(f,h);rP(m)?h.value=m:h.result=m,c(u,h)});function c(u,d){u||!d?a(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),ha("processSync",this.parser||this.Parser),pa("processSync",this.compiler||this.Compiler),this.process(t,i),Iu("processSync","process",n),r;function i(o,a){n=!0,wu(o),r=a}}run(t,n,r){Pu(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,s){const l=Ni(n);i.run(t,l,c);function c(u,d,h){const f=d||t;u?s(u):a?a(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Iu("runSync","run",r),i;function o(a,s){wu(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=Ni(n),i=this.compiler||this.Compiler;return pa("stringify",i),Pu(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(ma("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(i.settings=ca(!0,i.settings,c.settings))}function s(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[f,...m]=u;const p=r[h][1];os(p)&&os(f)&&(f=ca(!0,p,f)),r[h]=[c,f,...m]}}}}const tP=new Ys().freeze();function ha(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function pa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ma(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 Pu(e){if(!os(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Iu(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ni(e){return nP(e)?e:new dh(e)}function nP(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function rP(e){return typeof e=="string"||iP(e)}function iP(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oP="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Lu=[],Ou={allowDangerousHtml:!0},aP=/^(https?|ircs?|mailto|xmpp)$/i,sP=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function lP(e){const t=cP(e),n=uP(e);return dP(t.runSync(t.parse(n),n),e)}function cP(e){const t=e.rehypePlugins||Lu,n=e.remarkPlugins||Lu,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ou}:Ou;return tP().use($R).use(n).use(FT,r).use(t)}function uP(e){const t=e.children||"",n=new dh;return typeof t=="string"&&(n.value=t),n}function dP(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||fP;for(const u of sP)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+oP+u.id,void 0);return Gs(e,c),EE(e,{Fragment:y.Fragment,components:i,ignoreInvalidStyle:!0,jsx:y.jsx,jsxs:y.jsxs,passKeys:!0,passNode:!0});function c(u,d,h){if(u.type==="raw"&&h&&typeof d=="number")return a?h.children.splice(d,1):h.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let f;for(f in aa)if(Object.hasOwn(aa,f)&&Object.hasOwn(u.properties,f)){const m=u.properties[f],p=aa[f];(p===null||p.includes(u.tagName))&&(u.properties[f]=l(String(m||""),f,u))}}if(u.type==="element"){let f=n?!n.includes(u.tagName):o?o.includes(u.tagName):!1;if(!f&&r&&typeof d=="number"&&(f=!r(u,d,h)),f&&h&&typeof d=="number")return s&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d}}}function fP(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||aP.test(e.slice(0,t))?e:""}function Nu(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 hP(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function pP(e,t,n){const i=No((n||{}).ignore||[]),o=mP(t);let a=-1;for(;++a<o.length;)ch(e,"text",s);function s(c,u){let d=-1,h;for(;++d<u.length;){const f=u[d],m=h?h.children:void 0;if(i(f,m?m.indexOf(f):void 0,h))return;h=f}if(h)return l(c,u)}function l(c,u){const d=u[u.length-1],h=o[a][0],f=o[a][1];let m=0;const b=d.children.indexOf(c);let v=!1,x=[];h.lastIndex=0;let w=h.exec(c.value);for(;w;){const E=w.index,P={index:w.index,input:w.input,stack:[...u,c]};let C=f(...w,P);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?h.lastIndex=E+1:(m!==E&&x.push({type:"text",value:c.value.slice(m,E)}),Array.isArray(C)?x.push(...C):C&&x.push(C),m=E+w[0].length,v=!0),!h.global)break;w=h.exec(c.value)}return v?(m<c.value.length&&x.push({type:"text",value:c.value.slice(m)}),d.children.splice(b,1,...x)):x=[c],b+x.length}}function mP(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([gP(i[0]),yP(i[1])])}return t}function gP(e){return typeof e=="string"?new RegExp(hP(e),"g"):e}function yP(e){return typeof e=="function"?e:function(){return e}}const ga="phrasing",ya=["autolink","link","image","label"];function bP(){return{transforms:[CP],enter:{literalAutolink:xP,literalAutolinkEmail:ba,literalAutolinkHttp:ba,literalAutolinkWww:ba},exit:{literalAutolink:AP,literalAutolinkEmail:SP,literalAutolinkHttp:wP,literalAutolinkWww:kP}}}function vP(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ga,notInConstruct:ya},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ga,notInConstruct:ya},{character:":",before:"[ps]",after:"\\/",inConstruct:ga,notInConstruct:ya}]}}function xP(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ba(e){this.config.enter.autolinkProtocol.call(this,e)}function wP(e){this.config.exit.autolinkProtocol.call(this,e)}function kP(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 SP(e){this.config.exit.autolinkEmail.call(this,e)}function AP(e){this.exit(e)}function CP(e){pP(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,EP],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,RP]],{ignore:["link","linkReference"]})}function EP(e,t,n,r,i){let o="";if(!fh(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!TP(n)))return!1;const a=PP(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function RP(e,t,n,r){return!fh(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function TP(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 PP(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=Nu(e,"(");let o=Nu(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function fh(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Jn(n)||Io(n))&&(!t||n!==47)}hh.peek=FP;function IP(){this.buffer()}function LP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function OP(){this.buffer()}function NP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function _P(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Dt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function DP(e){this.exit(e)}function MP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Dt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jP(e){this.exit(e)}function FP(){return"["}function hh(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}function UP(){return{enter:{gfmFootnoteCallString:IP,gfmFootnoteCall:LP,gfmFootnoteDefinitionLabelString:OP,gfmFootnoteDefinition:NP},exit:{gfmFootnoteCallString:_P,gfmFootnoteCall:DP,gfmFootnoteDefinitionLabelString:MP,gfmFootnoteDefinition:jP}}}function HP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:hh},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,a){const s=o.createTracker(a);let l=s.move("[^");const c=o.enter("footnoteDefinition"),u=o.enter("label");return l+=s.move(o.safe(o.associationId(r),{before:l,after:"]"})),u(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
|
|
154
|
-
`:" ")+o.indentLines(o.containerFlow(r,s.current()),t?ph:BP))),c(),l}}function BP(e,t,n){return t===0?e:ph(e,t,n)}function ph(e,t,n){return(n?"":" ")+e}const zP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];mh.peek=qP;function $P(){return{canContainEols:["delete"],enter:{strikethrough:KP},exit:{strikethrough:WP}}}function VP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:zP}],handlers:{delete:mh}}}function KP(e){this.enter({type:"delete",children:[]},e)}function WP(e){this.exit(e)}function mh(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function qP(){return"~"}function QP(e){return e.length}function GP(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||QP,o=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const p=[],b=[];let v=-1;for(e[u].length>c&&(c=e[u].length);++v<e[u].length;){const x=YP(e[u][v]);if(n.alignDelimiters!==!1){const w=i(x);b[v]=w,(l[v]===void 0||w>l[v])&&(l[v]=w)}p.push(x)}a[u]=p,s[u]=b}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)o[d]=_u(r[d]);else{const p=_u(r);for(;++d<c;)o[d]=p}d=-1;const h=[],f=[];for(;++d<c;){const p=o[d];let b="",v="";p===99?(b=":",v=":"):p===108?b=":":p===114&&(v=":");let x=n.alignDelimiters===!1?1:Math.max(1,l[d]-b.length-v.length);const w=b+"-".repeat(x)+v;n.alignDelimiters!==!1&&(x=b.length+x+v.length,x>l[d]&&(l[d]=x),f[d]=x),h[d]=w}a.splice(1,0,h),s.splice(1,0,f),u=-1;const m=[];for(;++u<a.length;){const p=a[u],b=s[u];d=-1;const v=[];for(;++d<c;){const x=p[d]||"";let w="",E="";if(n.alignDelimiters!==!1){const P=l[d]-(b[d]||0),C=o[d];C===114?w=" ".repeat(P):C===99?P%2?(w=" ".repeat(P/2+.5),E=" ".repeat(P/2-.5)):(w=" ".repeat(P/2),E=w):E=" ".repeat(P)}n.delimiterStart!==!1&&!d&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&v.push(" "),n.alignDelimiters!==!1&&v.push(w),v.push(x),n.alignDelimiters!==!1&&v.push(E),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&v.push("|")}m.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return m.join(`
|
|
155
|
-
`)}function YP(e){return e==null?"":String(e)}function _u(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 XP(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),JP);return i(),a}function JP(e,t,n){return">"+(n?"":" ")+e}function ZP(e,t){return Du(e,t.inConstruct,!0)&&!Du(e,t.notInConstruct,!1)}function Du(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 Mu(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
156
|
-
`&&ZP(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
157
|
-
`}function eI(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}function tI(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 nI(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 rI(e,t,n,r){const i=nI(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(tI(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(o,iI);return d(),h}const s=n.createTracker(r),l=i.repeat(Math.max(eI(o,i)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const d=n.enter(`codeFencedLang${a}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
158
|
-
`,encode:["`"],...s.current()})),d()}return u+=s.move(`
|
|
159
|
-
`),o&&(u+=s.move(o+`
|
|
160
|
-
`)),u+=s.move(l),c(),u}function iI(e,t,n){return(n?"":" ")+e}function Xs(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 oI(e,t,n,r){const i=Xs(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
|
|
161
|
-
`,...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),a(),c}function aI(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function fi(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ho(e,t,n){const r=Cr(e),i=Cr(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}}gh.peek=sI;function gh(e,t,n,r){const i=aI(n),o=n.enter("emphasis"),a=n.createTracker(r),s=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=ho(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=fi(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=ho(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+fi(d));const f=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},s+l+f}function sI(e,t,n){return n.options.emphasis||"*"}function lI(e,t){let n=!1;return Gs(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,rs}),!!((!e.depth||e.depth<3)&&zs(e)&&(t.options.setext||n))}function cI(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(lI(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
|
|
162
|
-
`,after:`
|
|
163
|
-
`});return d(),u(),h+`
|
|
164
|
-
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
165
|
-
`))+1))}const a="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");o.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
166
|
-
`,...o.current()});return/^[\t ]/.test(c)&&(c=fi(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c}yh.peek=uI;function yh(e){return e.value||""}function uI(){return"<"}bh.peek=dI;function bh(e,t,n,r){const i=Xs(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),a(),c}function dI(){return"!"}vh.peek=fI;function vh(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),i==="full"||!c||c!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function fI(){return"!"}xh.peek=hI;function xh(e,t,n){let r=e.value||"",i="`",o=-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+" ");++o<n.unsafe.length;){const a=n.unsafe[o],s=n.compilePattern(a);let l;if(a.atBreak)for(;l=s.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function hI(){return"`"}function wh(e,t){const n=zs(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))}kh.peek=pI;function kh(e,t,n,r){const i=Xs(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(wh(e,n)){const u=n.stack;n.stack=[],s=n.enter("autolink");let d=a.move("<");return d+=a.move(n.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),s(),n.stack=u,d}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),s(),c}function pI(e,t,n){return wh(e,n)?"<":"["}Sh.peek=mI;function Sh(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),i==="full"||!c||c!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function mI(){return"["}function Js(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 gI(e){const t=Js(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 yI(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 Ah(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 bI(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?yI(n):Js(n);const s=e.ordered?a==="."?")":".":gI(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Ah(n)===a&&u){let d=-1;for(;++d<e.children.length;){const h=e.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),c}function vI(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 xI(e,t,n,r){const i=vI(n);let o=n.bulletCurrent||Js(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),u);return l(),c;function u(d,h,f){return h?(f?"":" ".repeat(a))+d:(f?o:o+" ".repeat(a-o.length))+d}}function wI(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const kI=No(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function SI(e,t,n,r){return(e.children.some(function(a){return kI(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function AI(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ch.peek=CI;function Ch(e,t,n,r){const i=AI(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=ho(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=fi(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=ho(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+fi(d));const f=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},s+l+f}function CI(e,t,n){return n.options.strong||"*"}function EI(e,t,n,r){return n.safe(e.value,r)}function RI(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 TI(e,t,n){const r=(Ah(n)+(n.options.ruleSpaces?" ":"")).repeat(RI(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Eh={blockquote:XP,break:Mu,code:rI,definition:oI,emphasis:gh,hardBreak:Mu,heading:cI,html:yh,image:bh,imageReference:vh,inlineCode:xh,link:kh,linkReference:Sh,list:bI,listItem:xI,paragraph:wI,root:SI,strong:Ch,text:EI,thematicBreak:TI};function PI(){return{enter:{table:II,tableData:ju,tableHeader:ju,tableRow:OI},exit:{codeText:NI,table:LI,tableData:va,tableHeader:va,tableRow:va}}}function II(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 LI(e){this.exit(e),this.data.inTable=void 0}function OI(e){this.enter({type:"tableRow",children:[]},e)}function va(e){this.exit(e)}function ju(e){this.enter({type:"tableCell",children:[]},e)}function NI(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,_I));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function _I(e,t){return t==="|"?t:e}function DI(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
167
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:l,tableRow:s}};function a(f,m,p,b){return c(u(f,p,b),f.align)}function s(f,m,p,b){const v=d(f,p,b),x=c([v]);return x.slice(0,x.indexOf(`
|
|
168
|
-
`))}function l(f,m,p,b){const v=p.enter("tableCell"),x=p.enter("phrasing"),w=p.containerPhrasing(f,{...b,before:o,after:o});return x(),v(),w}function c(f,m){return GP(f,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function u(f,m,p){const b=f.children;let v=-1;const x=[],w=m.enter("table");for(;++v<b.length;)x[v]=d(b[v],m,p);return w(),x}function d(f,m,p){const b=f.children;let v=-1;const x=[],w=m.enter("tableRow");for(;++v<b.length;)x[v]=l(b[v],f,m,p);return w(),x}function h(f,m,p){let b=Eh.inlineCode(f,m,p);return p.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function MI(){return{exit:{taskListCheckValueChecked:Fu,taskListCheckValueUnchecked:Fu,paragraph:FI}}}function jI(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:UI}}}function Fu(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function FI(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 o=-1,a;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){a=s;break}}a===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 UI(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let l=Eh.listItem(e,t,n,{...r,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+a}}function HI(){return[bP(),UP(),$P(),PI(),MI()]}function BI(e){return{extensions:[vP(),HP(e),VP(),DI(e),jI()]}}const zI={tokenize:QI,partial:!0},Rh={tokenize:GI,partial:!0},Th={tokenize:YI,partial:!0},Ph={tokenize:XI,partial:!0},$I={tokenize:JI,partial:!0},Ih={name:"wwwAutolink",tokenize:WI,previous:Oh},Lh={name:"protocolAutolink",tokenize:qI,previous:Nh},dn={name:"emailAutolink",tokenize:KI,previous:_h},Yt={};function VI(){return{text:Yt}}let jn=48;for(;jn<123;)Yt[jn]=dn,jn++,jn===58?jn=65:jn===91&&(jn=97);Yt[43]=dn;Yt[45]=dn;Yt[46]=dn;Yt[95]=dn;Yt[72]=[dn,Lh];Yt[104]=[dn,Lh];Yt[87]=[dn,Ih];Yt[119]=[dn,Ih];function KI(e,t,n){const r=this;let i,o;return a;function a(d){return!ss(d)||!_h.call(r,r.previous)||Zs(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(d))}function s(d){return ss(d)?(e.consume(d),s):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check($I,u,c)(d):d===45||d===95||lt(d)?(o=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return o&&i&&ht(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function WI(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Oh.call(r,r.previous)||Zs(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(zI,e.attempt(Rh,e.attempt(Th,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function qI(e,t,n){const r=this;let i="",o=!1;return a;function a(d){return(d===72||d===104)&&Nh.call(r,r.previous)&&!Zs(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),s):n(d)}function s(d){if(ht(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),s;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),o?c:(o=!0,l)):n(d)}function c(d){return d===null||co(d)||je(d)||Jn(d)||Io(d)?n(d):e.attempt(Rh,e.attempt(Th,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function QI(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function GI(e,t,n){let r,i,o;return a;function a(c){return c===46||c===95?e.check(Ph,l,s)(c):c===null||je(c)||Jn(c)||c!==45&&Io(c)?l(c):(o=!0,e.consume(c),a)}function s(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function l(c){return i||r||!o?n(c):t(c)}}function YI(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Ph,t,o)(a):a===null||je(a)||Jn(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function XI(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),o):s===93?(e.consume(s),i):s===60||s===null||je(s)||Jn(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||je(s)||Jn(s)?t(s):r(s)}function o(s){return ht(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):ht(s)?(e.consume(s),a):n(s)}}function JI(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return lt(o)?n(o):t(o)}}function Oh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||je(e)}function Nh(e){return!ht(e)}function _h(e){return!(e===47||ss(e))}function ss(e){return e===43||e===45||e===46||e===95||lt(e)}function Zs(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 ZI={tokenize:sL,partial:!0};function eL(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:iL,continuation:{tokenize:oL},exit:aL}},text:{91:{name:"gfmFootnoteCall",tokenize:rL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:tL,resolveTo:nL}}}}function tL(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!a||!a._balanced)return n(l);const c=Dt(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function nL(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 o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function rL(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(o>999||d===93&&!a||d===null||d===91||je(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Dt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return je(d)||(a=!0),o++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),o++,c):c(d)}}function iL(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(m)}function u(m){if(a>999||m===93&&!s||m===null||m===91||je(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return o=Dt(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return je(m)||(s=!0),a++,e.consume(m),m===92?d:u}function d(m){return m===91||m===92||m===93?(e.consume(m),a++,u):u(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),Re(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function oL(e,t,n){return e.check(bi,t,e.attempt(ZI,t,n))}function aL(e){e.exit("gfmFootnoteDefinition")}function sL(e,t,n){const r=this;return Re(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function lL(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},h=[["enter",u,s],["enter",a[c][1],s],["exit",a[c][1],s],["enter",d,s]],f=s.parser.constructs.insideSpan.null;f&&At(h,h.length,0,Lo(f,a.slice(c+1,l),s)),At(h,h.length,0,[["exit",d,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",u,s]]),At(a,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function o(a,s,l){const c=this.previous,u=this.events;let d=0;return h;function h(m){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(m):(a.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const p=Cr(c);if(m===126)return d>1?l(m):(a.consume(m),d++,f);if(d<2&&!n)return l(m);const b=a.exit("strikethroughSequenceTemporary"),v=Cr(m);return b._open=!v||v===2&&!!p,b._close=!p||p===2&&!!v,s(m)}}}class cL{constructor(){this.map=[]}add(t,n,r){uL(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[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 o of i)t.push(o);i=r.pop()}this.map.length=0}}function uL(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 dL(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 o=r.length-1;r[o]=r[o]==="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 fL(){return{flow:{null:{name:"table",tokenize:hL,resolveAll:pL}}}}function hL(e,t,n){const r=this;let i=0,o=0,a;return s;function s(R){let _=r.events.length-1;for(;_>-1;){const U=r.events[_][1].type;if(U==="lineEnding"||U==="linePrefix")_--;else break}const L=_>-1?r.events[_][1].type:null,z=L==="tableHead"||L==="tableRow"?C:l;return z===C&&r.parser.lazy[r.now().line]?n(R):z(R)}function l(R){return e.enter("tableHead"),e.enter("tableRow"),c(R)}function c(R){return R===124||(a=!0,o+=1),u(R)}function u(R){return R===null?n(R):oe(R)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),f):n(R):Se(R)?Re(e,u,"whitespace")(R):(o+=1,a&&(a=!1,i+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),a=!0,u):(e.enter("data"),d(R)))}function d(R){return R===null||R===124||je(R)?(e.exit("data"),u(R)):(e.consume(R),R===92?h:d)}function h(R){return R===92||R===124?(e.consume(R),d):d(R)}function f(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(e.enter("tableDelimiterRow"),a=!1,Se(R)?Re(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):m(R))}function m(R){return R===45||R===58?b(R):R===124?(a=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),p):P(R)}function p(R){return Se(R)?Re(e,b,"whitespace")(R):b(R)}function b(R){return R===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),v):R===45?(o+=1,v(R)):R===null||oe(R)?E(R):P(R)}function v(R){return R===45?(e.enter("tableDelimiterFiller"),x(R)):P(R)}function x(R){return R===45?(e.consume(R),x):R===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(R))}function w(R){return Se(R)?Re(e,E,"whitespace")(R):E(R)}function E(R){return R===124?m(R):R===null||oe(R)?!a||i!==o?P(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):P(R)}function P(R){return n(R)}function C(R){return e.enter("tableRow"),k(R)}function k(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),k):R===null||oe(R)?(e.exit("tableRow"),t(R)):Se(R)?Re(e,k,"whitespace")(R):(e.enter("data"),O(R))}function O(R){return R===null||R===124||je(R)?(e.exit("data"),k(R)):(e.consume(R),R===92?M:O)}function M(R){return R===92||R===124?(e.consume(R),O):O(R)}}function pL(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,c,u,d;const h=new cL;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(Uu(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,u={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])),i=m.type==="tableDelimiterRow"?2:u?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],d=_i(h,t,o,i,void 0,d),o=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],d=_i(h,t,o,i,void 0,d)),o=a,a=[o[1],n,0,0])):m.type==="tableHead"?(s=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(a[0]=a[1],d=_i(h,t,o,i,n,d)):a[1]!==0&&(d=_i(h,t,a,i,n,d)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Uu(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=dL(t.events,n))}return e}function _i(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},mr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=mr(t.events,n[1]);if(o={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=mr(t.events,n[2]),u=mr(t.events,n[3]),d={type:s,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},mr(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Uu(e,t,n,r,i){const o=[],a=mr(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function mr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const mL={name:"tasklistCheck",tokenize:yL};function gL(){return{text:{91:mL}}}function yL(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return je(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return oe(l)?t(l):Se(l)?e.check({tokenize:bL},t,n)(l):n(l)}}function bL(e,t,n){return Re(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function vL(e){return Vf([VI(),eL(),lL(e),fL(),gL()])}const xL={};function wL(e){const t=this,n=e||xL,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(vL(n)),o.push(HI()),a.push(BI(n))}const kL={h1:({children:e,...t})=>y.jsx("h2",{className:"mt-2 mb-1 text-base font-semibold",...t,children:e}),h2:({children:e,...t})=>y.jsx("h3",{className:"mt-2 mb-1 text-sm font-semibold",...t,children:e}),h3:({children:e,...t})=>y.jsx("h4",{className:"mt-1.5 mb-1 text-sm font-semibold",...t,children:e}),h4:({children:e,...t})=>y.jsx("h5",{className:"mt-1.5 mb-1 text-xs font-semibold uppercase tracking-wide text-text-muted",...t,children:e}),h5:({children:e,...t})=>y.jsx("h6",{className:"mt-1.5 mb-0.5 text-xs font-semibold text-text-muted",...t,children:e}),h6:({children:e,...t})=>y.jsx("h6",{className:"mt-1.5 mb-0.5 text-xs font-medium text-text-muted",...t,children:e}),p:({children:e,...t})=>y.jsx("p",{className:"my-1 leading-relaxed",...t,children:e}),strong:({children:e,...t})=>y.jsx("strong",{className:"font-semibold text-text",...t,children:e}),em:({children:e,...t})=>y.jsx("em",{className:"italic",...t,children:e}),a:({children:e,...t})=>y.jsx("a",{className:"text-accent underline decoration-accent/40 underline-offset-2 hover:decoration-accent",target:"_blank",rel:"noreferrer",...t,children:e}),ul:({children:e,...t})=>y.jsx("ul",{className:"my-1 ml-5 list-disc space-y-0.5",...t,children:e}),ol:({children:e,...t})=>y.jsx("ol",{className:"my-1 ml-5 list-decimal space-y-0.5",...t,children:e}),li:({children:e,...t})=>y.jsx("li",{className:"leading-relaxed",...t,children:e}),blockquote:({children:e,...t})=>y.jsx("blockquote",{className:"my-2 border-l-2 border-border pl-3 text-text-dim",...t,children:e}),code:({inline:e,className:t,children:n,...r})=>e?y.jsx("code",{className:"rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.85em]",...r,children:n}):y.jsx("code",{className:ve("font-mono text-xs",t),...r,children:n}),pre:({children:e,...t})=>y.jsx("pre",{className:"my-2 overflow-x-auto rounded bg-surface-2 p-2 text-xs leading-relaxed",...t,children:e}),table:({children:e,...t})=>y.jsx("div",{className:"my-2 overflow-x-auto",children:y.jsx("table",{className:"w-full border-collapse text-xs",...t,children:e})}),thead:({children:e,...t})=>y.jsx("thead",{className:"border-b border-border bg-surface-2/50",...t,children:e}),tbody:({children:e,...t})=>y.jsx("tbody",{...t,children:e}),tr:({children:e,...t})=>y.jsx("tr",{className:"border-b border-border/40 last:border-b-0",...t,children:e}),th:({children:e,...t})=>y.jsx("th",{className:"px-2 py-1 text-left font-semibold",...t,children:e}),td:({children:e,...t})=>y.jsx("td",{className:"px-2 py-1 align-top",...t,children:e}),hr:e=>y.jsx("hr",{className:"my-2 border-border",...e})};function SL({content:e,className:t}){return y.jsx("div",{className:ve("text-sm leading-relaxed [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",t),children:y.jsx(lP,{remarkPlugins:[wL],components:kL,children:e})})}function Ki(e){return e==="native"?"agim":e}function AL({msg:e,onApprove:t}){if(e.approval)return y.jsx(EL,{approval:e.approval,onApprove:t});const n=e.role==="user",r=!n&&!!e.content,i=e.agent?Ki(e.agent):"";return y.jsx("div",{className:ve("flex",n?"justify-end":"justify-start"),children:y.jsxs("div",{className:ve("max-w-[85%] sm:max-w-[75%] rounded-lg px-3 py-2 shadow-sm",n?"bg-accent text-accent-fg":"bg-surface text-text border border-border"),children:[!n&&(e.agent||r)&&y.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[y.jsx("span",{className:"text-xs font-medium text-text-muted",children:i}),r&&y.jsx(CL,{text:e.content})]}),!n&&e.content?y.jsx(SL,{content:e.content,className:"break-words"}):y.jsx("div",{className:"whitespace-pre-wrap break-words text-sm leading-relaxed",children:e.content||e.role==="assistant"&&y.jsx("span",{className:"inline-block animate-pulse text-text-dim",children:"…"})})]})})}function CL({text:e}){const{t}=at(),[n,r]=g.useState(!1);async function i(){try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)}catch{Je.error(t("chat.copyFailed"))}}return y.jsx("button",{type:"button",onClick:i,title:t("chat.copyMarkdown"),className:"shrink-0 rounded px-1.5 py-0.5 text-[11px] text-text-dim transition hover:bg-surface-2 hover:text-text",children:t(n?"chat.copied":"chat.copy")})}function EL({approval:e,onApprove:t}){const{t:n}=at(),{messageId:r,prompt:i,text:o,outcome:a}=e,s=i?.mode==="auto-allow",[l,c]=g.useState(null);g.useEffect(()=>{a&&c(null)},[a]);function u(d){if(l||!i||!t)return;c(d),t(r,i.reqId,d)===!1&&c(null)}return y.jsxs("div",{className:ve("mx-auto w-full max-w-2xl rounded-lg border p-4",s?"border-warning/60 bg-warning-bg":"border-warning bg-warning-bg",a&&"opacity-90"),children:[y.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[y.jsx(it,{variant:"warning",children:n("chat.approvalTitle",{defaultValue:"🔐 Tool approval"})}),s&&!a&&y.jsx(it,{variant:"outline",className:"text-[10px] uppercase",children:n("chat.approvalAutoBadge",{defaultValue:"auto-allow"})})]}),s&&!a&&i&&y.jsx(RL,{graceSeconds:i.graceSeconds??0}),i?y.jsxs("div",{className:"mt-1 flex flex-col gap-2 text-sm",children:[y.jsx(Hu,{label:n("chat.approvalToolLabel",{defaultValue:"Tool"}),children:y.jsx("code",{className:"rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs",children:i.toolName})}),y.jsx(Hu,{label:n("chat.approvalInputLabel",{defaultValue:"Input"}),children:y.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded bg-surface-2 p-2 font-mono text-xs leading-relaxed text-text",children:i.inputJson})})]}):o?y.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm text-text",children:o}):null,a?y.jsx(TL,{outcome:a}):i?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[!s&&y.jsxs(y.Fragment,{children:[y.jsx(et,{size:"sm",disabled:l!==null,onClick:()=>u("y"),children:n("chat.approvalAllow",{defaultValue:"Allow"})}),y.jsx(et,{size:"sm",variant:"secondary",disabled:l!==null,onClick:()=>u("a"),title:n("chat.approvalAutoTip",{defaultValue:"Allow and auto-allow similar calls for the rest of the session"}),children:n("chat.approvalAuto",{defaultValue:"Auto for similar"})})]}),y.jsx(et,{size:"sm",variant:"destructive",disabled:l!==null,onClick:()=>u("n"),children:n("chat.approvalDeny",{defaultValue:"Deny"})})]}),l!==null&&y.jsx("p",{className:"mt-2 text-xs text-text-dim",children:n("chat.approvalSubmitting")})]}):null]})}function Hu({label:e,children:t}){return y.jsxs("div",{className:"flex flex-col gap-0.5",children:[y.jsx("span",{className:"text-xs font-medium text-text-muted",children:e}),t]})}function RL({graceSeconds:e}){const{t}=at(),[n,r]=g.useState(Math.max(0,e));return g.useEffect(()=>{if(e<=0)return;r(e);const i=setInterval(()=>{r(o=>o>0?o-1:0)},1e3);return()=>clearInterval(i)},[e]),e<=0?null:y.jsx("p",{className:"mb-2 text-xs text-warning",children:n>0?t("chat.approvalAutoIn",{count:n,defaultValue:"Auto-allowing in {{count}}s — Deny to stop."}):t("chat.approvalAutoResolving",{defaultValue:"Auto-allowing now…"})})}function TL({outcome:e}){const{t}=at(),n=e.byUserDisplay?` · ${e.byUserDisplay}`:"";switch(e.decision){case"allowed":return y.jsx("div",{className:"mt-3",children:y.jsxs(it,{variant:"success",children:[t("chat.outcome.allowed",{defaultValue:"✅ Allowed"}),n]})});case"allowed-pinned":return y.jsx("div",{className:"mt-3",children:y.jsxs(it,{variant:"success",children:[t("chat.outcome.allowedPinned",{defaultValue:"✅ Allowed + auto-allow further"}),n]})});case"denied":return y.jsx("div",{className:"mt-3",children:y.jsxs(it,{variant:"danger",children:[t("chat.outcome.denied",{defaultValue:"❌ Denied"}),n]})});case"denied-revoked":return y.jsx("div",{className:"mt-3",children:y.jsxs(it,{variant:"danger",children:[t("chat.outcome.deniedRevoked",{defaultValue:"❌ Denied (auto-allow revoked)"}),n]})});case"expired":return y.jsx("div",{className:"mt-3",children:y.jsxs(it,{variant:"outline",children:[t("chat.outcome.expired",{defaultValue:"⏱ Timed out"}),n]})})}}function PL({approvals:e,onApprove:t}){return e.length===0?null:y.jsx("div",{className:"border-t border-warning/40 bg-warning-bg/40",children:y.jsx("div",{className:"mx-auto max-h-60 w-full max-w-3xl overflow-y-auto px-3 py-2 sm:px-4",children:y.jsx("div",{className:"flex flex-col gap-2",children:e.map(n=>y.jsx(IL,{entry:n,onApprove:t},n.messageId))})})})}function IL({entry:e,onApprove:t}){const{t:n}=at(),{messageId:r,prompt:i,outcome:o}=e,a=i.mode==="auto-allow",[s,l]=g.useState(null);g.useEffect(()=>{o&&l(null)},[o]);function c(u){if(s||!t)return;l(u),t(r,i.reqId,u)===!1&&l(null)}return y.jsxs("div",{className:ve("rounded-lg border bg-surface p-3 shadow-sm transition-opacity",o?"border-success/60 opacity-80":"border-warning"),children:[y.jsxs("div",{className:"mb-1.5 flex flex-wrap items-center gap-2",children:[y.jsxs(it,{variant:"warning",className:"gap-1",children:[y.jsx(Gy,{className:"h-3 w-3"}),n("chat.approvalTitle")]}),a&&!o&&y.jsx(it,{variant:"outline",className:"text-[10px] uppercase",children:n("chat.approvalAutoBadge",{defaultValue:"auto-allow"})}),a&&!o&&i.graceSeconds!=null&&y.jsx(LL,{graceSeconds:i.graceSeconds}),y.jsx("code",{className:"ml-auto rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs",children:i.toolName})]}),y.jsx("pre",{className:"mb-2 max-h-32 overflow-auto rounded bg-surface-2 p-2 font-mono text-xs leading-relaxed text-text",children:i.inputJson}),o?y.jsx(OL,{outcome:o}):y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex flex-wrap gap-2",children:[!a&&y.jsxs(y.Fragment,{children:[y.jsx(et,{size:"sm",disabled:s!==null,onClick:()=>c("y"),children:n("chat.approvalAllow")}),y.jsx(et,{size:"sm",variant:"secondary",disabled:s!==null,onClick:()=>c("a"),title:n("chat.approvalAutoTip",{defaultValue:"Allow and auto-allow similar calls for the rest of the session"}),children:n("chat.approvalAuto")})]}),y.jsx(et,{size:"sm",variant:"destructive",disabled:s!==null,onClick:()=>c("n"),children:n("chat.approvalDeny")})]}),s!==null&&y.jsx("p",{className:"mt-1.5 text-xs text-text-dim",children:n("chat.approvalSubmitting")})]})]})}function LL({graceSeconds:e}){const{t}=at(),[n,r]=g.useState(Math.max(0,e));return g.useEffect(()=>{if(e<=0)return;r(e);const i=setInterval(()=>{r(o=>o>0?o-1:0)},1e3);return()=>clearInterval(i)},[e]),e<=0?null:y.jsx("span",{className:"text-xs text-warning",children:n>0?t("chat.approvalAutoIn",{count:n,defaultValue:"Auto-allowing in {{count}}s — Deny to stop."}):t("chat.approvalAutoResolving",{defaultValue:"Auto-allowing now…"})})}function OL({outcome:e}){const{t}=at(),n=e.byUserDisplay?` · ${e.byUserDisplay}`:"";switch(e.decision){case"allowed":return y.jsxs(it,{variant:"success",children:[t("chat.outcome.allowed",{defaultValue:"✅ Allowed"}),n]});case"allowed-pinned":return y.jsxs(it,{variant:"success",children:[t("chat.outcome.allowedPinned",{defaultValue:"✅ Allowed + auto-allow further"}),n]});case"denied":return y.jsxs(it,{variant:"danger",children:[t("chat.outcome.denied",{defaultValue:"❌ Denied"}),n]});case"denied-revoked":return y.jsxs(it,{variant:"danger",children:[t("chat.outcome.deniedRevoked",{defaultValue:"❌ Denied (auto-allow revoked)"}),n]});case"expired":return y.jsxs(it,{variant:"outline",children:[t("chat.outcome.expired",{defaultValue:"⏱ Timed out"}),n]})}}function NL({asks:e,onSubmit:t}){return e.length===0?null:y.jsx("div",{className:"border-t border-info/40 bg-info-bg/40",children:y.jsx("div",{className:"mx-auto max-h-72 w-full max-w-3xl overflow-y-auto px-3 py-2 sm:px-4",children:y.jsx("div",{className:"flex flex-col gap-2",children:e.map(n=>y.jsx(DL,{entry:n,onSubmit:t},n.messageId))})})})}function Bu(e){const t=new TextEncoder().encode(e);let n="";for(const r of t)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function _L(e){const t=e.split(":").pop()??"";return Number.parseInt(t,10)}function DL({entry:e,onSubmit:t}){const{t:n}=at(),{messageId:r,prompt:i,finalText:o,resolvedAt:a}=e,s=i.meta,l=o!=null||a!=null,[c,u]=g.useState(!1),[d,h]=g.useState([]),[f,m]=g.useState("");g.useEffect(()=>{l&&u(!1)},[l]);const p=s?.selectionMode??"single",b=s?.minSelections??1,v=s?.maxSelections??i.choices.length,x=s?.allowCustomInput??!1,w=s?.reqId??"";function E(k){if(c)return;u(!0),t(r,k)===!1&&u(!1)}function P(k){h(O=>O.includes(k)?O.filter(M=>M!==k):[...O,k])}const C=d.length>=b&&d.length<=v;return y.jsxs("div",{className:ve("rounded-lg border bg-surface p-3 shadow-sm transition-opacity",l?"border-success/60 opacity-80":"border-info"),children:[y.jsxs("div",{className:"mb-1.5 flex flex-wrap items-center gap-2",children:[y.jsxs(it,{variant:"info",className:"gap-1",children:[y.jsx(Vy,{className:"h-3 w-3"}),i.title||n("chat.askTitle",{defaultValue:"🤔 请选择"})]}),!l&&p==="multi"&&y.jsx("span",{className:"text-xs text-text-dim",children:n("chat.askMultiHint",{min:b,max:v,defaultValue:"Pick {{min}}–{{max}}"})})]}),y.jsx("p",{className:"mb-2 whitespace-pre-wrap break-words text-sm text-text",children:i.body}),l?y.jsx(it,{variant:"success",children:o||n("chat.askResolved",{defaultValue:"✅ 已回答"})}):p==="multi"?y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"flex flex-col gap-1.5",children:i.choices.map(k=>{const O=_L(k.data),M=d.includes(O);return y.jsxs("label",{className:ve("flex cursor-pointer items-center gap-2 rounded border px-2 py-1.5 text-sm transition",M?"border-info bg-info-bg/50":"border-border hover:bg-surface-2",c&&"pointer-events-none opacity-60"),children:[y.jsx("input",{type:"checkbox",checked:M,disabled:c,onChange:()=>P(O)}),y.jsx("span",{children:k.label})]},k.data)})}),y.jsx("div",{className:"mt-2",children:y.jsx(et,{size:"sm",disabled:c||!C,onClick:()=>E(`ask:${w}:multi:${[...d].sort((k,O)=>k-O).join(",")}`),children:n("chat.askSubmit",{defaultValue:"Submit"})})})]}):y.jsx("div",{className:"flex flex-wrap gap-2",children:i.choices.map(k=>y.jsx(et,{size:"sm",variant:"secondary",disabled:c,onClick:()=>E(k.data),children:k.label},k.data))}),!l&&x&&y.jsxs("div",{className:"mt-2 flex gap-2",children:[y.jsx("input",{type:"text",value:f,disabled:c,placeholder:s?.customInputLabel||n("chat.askCustomPlaceholder",{defaultValue:"自定义回答…"}),onChange:k=>m(k.target.value),onKeyDown:k=>{k.key==="Enter"&&f.trim()&&E(`ask:${w}:custom:${Bu(f.trim())}`)},className:"flex-1 rounded border border-border bg-surface px-2 py-1 text-sm text-text outline-none focus:border-info"}),y.jsx(et,{size:"sm",variant:"outline",disabled:c||!f.trim(),onClick:()=>E(`ask:${w}:custom:${Bu(f.trim())}`),children:n("chat.askSubmit",{defaultValue:"Submit"})})]}),i.links?.length?y.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:i.links.map(k=>y.jsx("a",{href:k.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center rounded border border-border px-2 py-1 text-xs text-info underline-offset-2 transition hover:bg-surface-2 hover:underline",children:k.label},k.url))}):null,c&&!l&&y.jsx("p",{className:"mt-1.5 text-xs text-text-dim",children:n("chat.approvalSubmitting")})]})}function zu(e,[t,n]){return Math.min(n,Math.max(t,e))}function Oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function xi(e,t=[]){let n=[];function r(o,a){const s=g.createContext(a);s.displayName=o+"Context";const l=n.length;n=[...n,a];const c=d=>{const{scope:h,children:f,...m}=d,p=h?.[e]?.[l]||s,b=g.useMemo(()=>m,Object.values(m));return y.jsx(p.Provider,{value:b,children:f})};c.displayName=o+"Provider";function u(d,h){const f=h?.[e]?.[l]||s,m=g.useContext(f);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(a=>g.createContext(a));return function(s){const l=s?.[e]||o;return g.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,ML(i,...t)]}function ML(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...s,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function jL(e){const t=e+"CollectionProvider",[n,r]=xi(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:b,children:v}=p,x=g.useRef(null),w=g.useRef(new Map).current;return y.jsx(i,{scope:b,itemMap:w,collectionRef:x,children:v})};a.displayName=t;const s=e+"CollectionSlot",l=Sr(s),c=g.forwardRef((p,b)=>{const{scope:v,children:x}=p,w=o(s,v),E=$e(b,w.collectionRef);return y.jsx(l,{ref:E,children:x})});c.displayName=s;const u=e+"CollectionItemSlot",d="data-radix-collection-item",h=Sr(u),f=g.forwardRef((p,b)=>{const{scope:v,children:x,...w}=p,E=g.useRef(null),P=$e(b,E),C=o(u,v);return g.useEffect(()=>(C.itemMap.set(E,{ref:E,...w}),()=>void C.itemMap.delete(E))),y.jsx(h,{[d]:"",ref:P,children:x})});f.displayName=u;function m(p){const b=o(e+"CollectionConsumer",p);return g.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((C,k)=>w.indexOf(C.ref.current)-w.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:c,ItemSlot:f},m,r]}var FL=g.createContext(void 0);function UL(e){const t=g.useContext(FL);return e||t||"ltr"}function Zn(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>t.current?.(...n),[])}function HL(e,t=globalThis?.document){const n=Zn(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var BL="DismissableLayer",ls="dismissableLayer.update",zL="dismissableLayer.pointerDownOutside",$L="dismissableLayer.focusOutside",$u,el=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Do=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,u=g.useContext(el),[d,h]=g.useState(null),f=d?.ownerDocument??globalThis?.document,[,m]=g.useState({}),p=$e(t,M=>h(M)),b=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=b.indexOf(v),w=d?b.indexOf(d):-1,E=u.layersWithOutsidePointerEventsDisabled.size>0,P=w>=x,C=g.useRef(!1),k=qL(M=>{const R=M.target;if(!(R instanceof Node))return;const _=[...u.branches].some(L=>L.contains(R));!P||_||(o?.(M),s?.(M),M.defaultPrevented||l?.())},{ownerDocument:f,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces}),O=QL(M=>{if(r&&C.current)return;const R=M.target;[...u.branches].some(L=>L.contains(R))||(a?.(M),s?.(M),M.defaultPrevented||l?.())},f);return HL(M=>{w===u.layers.size-1&&(i?.(M),!M.defaultPrevented&&l&&(M.preventDefault(),l()))},f),g.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&($u=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Vu(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=$u))}},[d,f,n,u]),g.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Vu())},[d,u]),g.useEffect(()=>{const M=()=>m({});return document.addEventListener(ls,M),()=>document.removeEventListener(ls,M)},[]),y.jsx(De.div,{...c,ref:p,style:{pointerEvents:E?P?"auto":"none":void 0,...e.style},onFocusCapture:Oe(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Oe(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Oe(e.onPointerDownCapture,k.onPointerDownCapture)})});Do.displayName=BL;var VL="DismissableLayerBranch",KL=g.forwardRef((e,t)=>{const n=g.useContext(el),r=g.useRef(null),i=$e(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),y.jsx(De.div,{...e,ref:i})});KL.displayName=VL;function WL(){const e=g.useContext(el),[t,n]=g.useState(null);return g.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function qL(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o}=t,a=Zn(e),s=g.useRef(!1),l=g.useRef(!1),c=g.useRef(new Map),u=g.useRef(()=>{});return g.useEffect(()=>{function d(){l.current=!1,i.current=!1,c.current.clear()}function h(){return Array.from(c.current.values()).some(Boolean)}function f(x){if(!l.current)return;const w=x.target;w instanceof Node&&[...o].some(P=>P.contains(w))||c.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{l.current&&u.current()},0)}function m(x){l.current&&c.current.set(x.type,!1)}const p=x=>{if(x.target&&!s.current){let w=function(){n.removeEventListener("click",u.current);const P=h();d(),P||Dh(zL,a,E,{discrete:!0})};const E={originalEvent:x};l.current=!0,i.current=r&&x.button===0,c.current.clear(),!r||x.button!==0?w():(n.removeEventListener("click",u.current),u.current=w,n.addEventListener("click",u.current,{once:!0}))}else n.removeEventListener("click",u.current),d();s.current=!1},b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of b)n.addEventListener(x,f,!0),n.addEventListener(x,m);const v=window.setTimeout(()=>{n.addEventListener("pointerdown",p)},0);return()=>{window.clearTimeout(v),n.removeEventListener("pointerdown",p),n.removeEventListener("click",u.current);for(const x of b)n.removeEventListener(x,f,!0),n.removeEventListener(x,m)}},[n,a,r,i,o]),{onPointerDownCapture:()=>s.current=!0}}function QL(e,t=globalThis?.document){const n=Zn(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&Dh($L,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Vu(){const e=new CustomEvent(ls);document.dispatchEvent(e)}function Dh(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?sx(i,o):i.dispatchEvent(o)}var Di=0,dr=null;function Mh(){g.useEffect(()=>{dr||(dr={start:Ku(),end:Ku()});const{start:e,end:t}=dr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Di++,()=>{Di===1&&(dr?.start.remove(),dr?.end.remove(),dr=null),Di=Math.max(0,Di-1)}},[])}function Ku(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var xa="focusScope.autoFocusOnMount",wa="focusScope.autoFocusOnUnmount",Wu={bubbles:!1,cancelable:!0},GL="FocusScope",tl=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=g.useState(null),c=Zn(i),u=Zn(o),d=g.useRef(null),h=$e(t,p=>l(p)),f=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let p=function(w){if(f.paused||!s)return;const E=w.target;s.contains(E)?d.current=E:yn(d.current,{select:!0})},b=function(w){if(f.paused||!s)return;const E=w.relatedTarget;E!==null&&(s.contains(E)||yn(d.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const P of w)P.removedNodes.length>0&&yn(s)};document.addEventListener("focusin",p),document.addEventListener("focusout",b);const x=new MutationObserver(v);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",b),x.disconnect()}}},[r,s,f.paused]),g.useEffect(()=>{if(s){Qu.add(f);const p=document.activeElement;if(!s.contains(p)){const v=new CustomEvent(xa,Wu);s.addEventListener(xa,c),s.dispatchEvent(v),v.defaultPrevented||(YL(tO(jh(s)),{select:!0}),document.activeElement===p&&yn(s))}return()=>{s.removeEventListener(xa,c),setTimeout(()=>{const v=new CustomEvent(wa,Wu);s.addEventListener(wa,u),s.dispatchEvent(v),v.defaultPrevented||yn(p??document.body,{select:!0}),s.removeEventListener(wa,u),Qu.remove(f)},0)}}},[s,c,u,f]);const m=g.useCallback(p=>{if(!n&&!r||f.paused)return;const b=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(b&&v){const x=p.currentTarget,[w,E]=XL(x);w&&E?!p.shiftKey&&v===E?(p.preventDefault(),n&&yn(w,{select:!0})):p.shiftKey&&v===w&&(p.preventDefault(),n&&yn(E,{select:!0})):v===x&&p.preventDefault()}},[n,r,f.paused]);return y.jsx(De.div,{tabIndex:-1,...a,ref:h,onKeyDown:m})});tl.displayName=GL;function YL(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(yn(r,{select:t}),document.activeElement!==n)return}function XL(e){const t=jh(e),n=qu(t,e),r=qu(t.reverse(),e);return[n,r]}function jh(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qu(e,t){for(const n of e)if(!JL(n,{upTo:t}))return n}function JL(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ZL(e){return e instanceof HTMLInputElement&&"select"in e}function yn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ZL(e)&&t&&e.select()}}var Qu=eO();function eO(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Gu(e,t),e.unshift(t)},remove(t){e=Gu(e,t),e[0]?.resume()}}}function Gu(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function tO(e){return e.filter(t=>t.tagName!=="A")}var ot=globalThis?.document?g.useLayoutEffect:()=>{},nO=ko[" useId ".trim().toString()]||(()=>{}),rO=0;function vr(e){const[t,n]=g.useState(nO());return ot(()=>{n(r=>r??String(rO++))},[e]),t?`radix-${t}`:""}const iO=["top","right","bottom","left"],kn=Math.min,St=Math.max,po=Math.round,Mi=Math.floor,Gt=e=>({x:e,y:e}),oO={left:"right",right:"left",bottom:"top",top:"bottom"};function cs(e,t,n){return St(e,kn(t,n))}function an(e,t){return typeof e=="function"?e(t):e}function sn(e){return e.split("-")[0]}function Dr(e){return e.split("-")[1]}function nl(e){return e==="x"?"y":"x"}function rl(e){return e==="y"?"height":"width"}function Qt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function il(e){return nl(Qt(e))}function aO(e,t,n){n===void 0&&(n=!1);const r=Dr(e),i=il(e),o=rl(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=mo(a)),[a,mo(a)]}function sO(e){const t=mo(e);return[us(e),t,us(t)]}function us(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Yu=["left","right"],Xu=["right","left"],lO=["top","bottom"],cO=["bottom","top"];function uO(e,t,n){switch(e){case"top":case"bottom":return n?t?Xu:Yu:t?Yu:Xu;case"left":case"right":return t?lO:cO;default:return[]}}function dO(e,t,n,r){const i=Dr(e);let o=uO(sn(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(us)))),o}function mo(e){const t=sn(e);return oO[t]+e.slice(t.length)}function fO(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fh(e){return typeof e!="number"?fO(e):{top:e,right:e,bottom:e,left:e}}function go(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ju(e,t,n){let{reference:r,floating:i}=e;const o=Qt(t),a=il(t),s=rl(a),l=sn(t),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Dr(t)){case"start":f[a]-=h*(n&&c?-1:1);break;case"end":f[a]+=h*(n&&c?-1:1);break}return f}async function hO(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=an(t,e),m=Fh(f),b=s[h?d==="floating"?"reference":"floating":d],v=go(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),x=d==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),E=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},P=go(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:w,strategy:l}):x);return{top:(v.top-P.top+m.top)/E.y,bottom:(P.bottom-v.bottom+m.bottom)/E.y,left:(v.left-P.left+m.left)/E.x,right:(P.right-v.right+m.right)/E.x}}const pO=50,mO=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:hO},l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ju(c,r,l),h=r,f=0;const m={};for(let p=0;p<o.length;p++){const b=o[p];if(!b)continue;const{name:v,fn:x}=b,{x:w,y:E,data:P,reset:C}=await x({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,d=E??d,m[v]={...m[v],...P},C&&f<pO&&(f++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:u,y:d}=Ju(c,h,l)),p=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:m}},gO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=an(e,t)||{};if(c==null)return{};const d=Fh(u),h={x:n,y:r},f=il(i),m=rl(f),p=await a.getDimensions(c),b=f==="y",v=b?"top":"left",x=b?"bottom":"right",w=b?"clientHeight":"clientWidth",E=o.reference[m]+o.reference[f]-h[f]-o.floating[m],P=h[f]-o.reference[f],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let k=C?C[w]:0;(!k||!await(a.isElement==null?void 0:a.isElement(C)))&&(k=s.floating[w]||o.floating[m]);const O=E/2-P/2,M=k/2-p[m]/2-1,R=kn(d[v],M),_=kn(d[x],M),L=R,z=k-p[m]-_,U=k/2-p[m]/2+O,$=cs(L,U,z),G=!l.arrow&&Dr(i)!=null&&U!==$&&o.reference[m]/2-(U<L?R:_)-p[m]/2<0,Y=G?U<L?U-L:U-z:0;return{[f]:h[f]+Y,data:{[f]:$,centerOffset:U-$-Y,...G&&{alignmentOffset:Y}},reset:G}}}),yO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...b}=an(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=sn(i),x=Qt(s),w=sn(s)===s,E=await(l.isRTL==null?void 0:l.isRTL(c.floating)),P=h||(w||!p?[mo(s)]:sO(s)),C=m!=="none";!h&&C&&P.push(...dO(s,p,m,E));const k=[s,...P],O=await l.detectOverflow(t,b),M=[];let R=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&M.push(O[v]),d){const U=aO(i,a,E);M.push(O[U[0]],O[U[1]])}if(R=[...R,{placement:i,overflows:M}],!M.every(U=>U<=0)){var _,L;const U=(((_=o.flip)==null?void 0:_.index)||0)+1,$=k[U];if($&&(!(d==="alignment"?x!==Qt($):!1)||R.every(V=>Qt(V.placement)===x?V.overflows[0]>0:!0)))return{data:{index:U,overflows:R},reset:{placement:$}};let G=(L=R.filter(Y=>Y.overflows[0]<=0).sort((Y,V)=>Y.overflows[1]-V.overflows[1])[0])==null?void 0:L.placement;if(!G)switch(f){case"bestFit":{var z;const Y=(z=R.filter(V=>{if(C){const F=Qt(V.placement);return F===x||F==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(F=>F>0).reduce((F,S)=>F+S,0)]).sort((V,F)=>V[1]-F[1])[0])==null?void 0:z[0];Y&&(G=Y);break}case"initialPlacement":G=s;break}if(i!==G)return{reset:{placement:G}}}return{}}}};function Zu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ed(e){return iO.some(t=>e[t]>=0)}const bO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=an(e,t);switch(i){case"referenceHidden":{const a=await r.detectOverflow(t,{...o,elementContext:"reference"}),s=Zu(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:ed(s)}}}case"escaped":{const a=await r.detectOverflow(t,{...o,altBoundary:!0}),s=Zu(a,n.floating);return{data:{escapedOffsets:s,escaped:ed(s)}}}default:return{}}}}},Uh=new Set(["left","top"]);async function vO(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=sn(n),s=Dr(n),l=Qt(n)==="y",c=Uh.has(a)?-1:1,u=o&&l?-1:1,d=an(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m=="number"&&(f=s==="end"?m*-1:m),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const xO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await vO(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},wO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:v=>{let{x,y:w}=v;return{x,y:w}}},...c}=an(e,t),u={x:n,y:r},d=await o.detectOverflow(t,c),h=Qt(sn(i)),f=nl(h);let m=u[f],p=u[h];if(a){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=m+d[v],E=m-d[x];m=cs(w,m,E)}if(s){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",w=p+d[v],E=p-d[x];p=cs(w,p,E)}const b=l.fn({...t,[f]:m,[h]:p});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[f]:a,[h]:s}}}}}},kO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=an(e,t),u={x:n,y:r},d=Qt(i),h=nl(d);let f=u[h],m=u[d];const p=an(s,t),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=h==="y"?"height":"width",E=o.reference[h]-o.floating[w]+b.mainAxis,P=o.reference[h]+o.reference[w]-b.mainAxis;f<E?f=E:f>P&&(f=P)}if(c){var v,x;const w=h==="y"?"width":"height",E=Uh.has(sn(i)),P=o.reference[d]-o.floating[w]+(E&&((v=a.offset)==null?void 0:v[d])||0)+(E?0:b.crossAxis),C=o.reference[d]+o.reference[w]+(E?0:((x=a.offset)==null?void 0:x[d])||0)-(E?b.crossAxis:0);m<P?m=P:m>C&&(m=C)}return{[h]:f,[d]:m}}}},SO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:l=()=>{},...c}=an(e,t),u=await a.detectOverflow(t,c),d=sn(i),h=Dr(i),f=Qt(i)==="y",{width:m,height:p}=o.floating;let b,v;d==="top"||d==="bottom"?(b=d,v=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,b=h==="end"?"top":"bottom");const x=p-u.top-u.bottom,w=m-u.left-u.right,E=kn(p-u[b],x),P=kn(m-u[v],w),C=!t.middlewareData.shift;let k=E,O=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=x),C&&!h){const R=St(u.left,0),_=St(u.right,0),L=St(u.top,0),z=St(u.bottom,0);f?O=m-2*(R!==0||_!==0?R+_:St(u.left,u.right)):k=p-2*(L!==0||z!==0?L+z:St(u.top,u.bottom))}await l({...t,availableWidth:O,availableHeight:k});const M=await a.getDimensions(s.floating);return m!==M.width||p!==M.height?{reset:{rects:!0}}:{}}}};function Mo(){return typeof window<"u"}function Mr(e){return Hh(e)?(e.nodeName||"").toLowerCase():"#document"}function Ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Xt(e){var t;return(t=(Hh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hh(e){return Mo()?e instanceof Node||e instanceof Ct(e).Node:!1}function Mt(e){return Mo()?e instanceof Element||e instanceof Ct(e).Element:!1}function fn(e){return Mo()?e instanceof HTMLElement||e instanceof Ct(e).HTMLElement:!1}function td(e){return!Mo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ct(e).ShadowRoot}function wi(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=jt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function AO(e){return/^(table|td|th)$/.test(Mr(e))}function jo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const CO=/transform|translate|scale|rotate|perspective|filter/,EO=/paint|layout|strict|content/,Fn=e=>!!e&&e!=="none";let ka;function ol(e){const t=Mt(e)?jt(e):e;return Fn(t.transform)||Fn(t.translate)||Fn(t.scale)||Fn(t.rotate)||Fn(t.perspective)||!al()&&(Fn(t.backdropFilter)||Fn(t.filter))||CO.test(t.willChange||"")||EO.test(t.contain||"")}function RO(e){let t=Sn(e);for(;fn(t)&&!Er(t);){if(ol(t))return t;if(jo(t))return null;t=Sn(t)}return null}function al(){return ka==null&&(ka=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ka}function Er(e){return/^(html|body|#document)$/.test(Mr(e))}function jt(e){return Ct(e).getComputedStyle(e)}function Fo(e){return Mt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Sn(e){if(Mr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||td(e)&&e.host||Xt(e);return td(t)?t.host:t}function Bh(e){const t=Sn(e);return Er(t)?e.ownerDocument?e.ownerDocument.body:e.body:fn(t)&&wi(t)?t:Bh(t)}function hi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Bh(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Ct(i);if(o){const s=ds(a);return t.concat(a,a.visualViewport||[],wi(i)?i:[],s&&n?hi(s):[])}else return t.concat(i,hi(i,[],n))}function ds(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function zh(e){const t=jt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=fn(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=po(n)!==o||po(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function sl(e){return Mt(e)?e:e.contextElement}function xr(e){const t=sl(e);if(!fn(t))return Gt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=zh(t);let a=(o?po(n.width):n.width)/r,s=(o?po(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const TO=Gt(0);function $h(e){const t=Ct(e);return!al()||!t.visualViewport?TO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function PO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ct(e)?!1:t}function er(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=sl(e);let a=Gt(1);t&&(r?Mt(r)&&(a=xr(r)):a=xr(e));const s=PO(o,n,r)?$h(o):Gt(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const h=Ct(o),f=r&&Mt(r)?Ct(r):r;let m=h,p=ds(m);for(;p&&r&&f!==m;){const b=xr(p),v=p.getBoundingClientRect(),x=jt(p),w=v.left+(p.clientLeft+parseFloat(x.paddingLeft))*b.x,E=v.top+(p.clientTop+parseFloat(x.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=w,c+=E,m=Ct(p),p=ds(m)}}return go({width:u,height:d,x:l,y:c})}function Uo(e,t){const n=Fo(e).scrollLeft;return t?t.left+n:er(Xt(e)).left+n}function Vh(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Uo(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function IO(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=Xt(r),s=t?jo(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Gt(1);const u=Gt(0),d=fn(r);if((d||!d&&!o)&&((Mr(r)!=="body"||wi(a))&&(l=Fo(r)),d)){const f=er(r);c=xr(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const h=a&&!d&&!o?Vh(a,l):Gt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function LO(e){return Array.from(e.getClientRects())}function OO(e){const t=Xt(e),n=Fo(e),r=e.ownerDocument.body,i=St(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=St(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Uo(e);const s=-n.scrollTop;return jt(r).direction==="rtl"&&(a+=St(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const nd=25;function NO(e,t){const n=Ct(e),r=Xt(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const u=al();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=Uo(r);if(c<=0){const u=r.ownerDocument,d=u.body,h=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-f);m<=nd&&(o-=m)}else c<=nd&&(o+=c);return{width:o,height:a,x:s,y:l}}function _O(e,t){const n=er(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=fn(e)?xr(e):Gt(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function rd(e,t,n){let r;if(t==="viewport")r=NO(e,n);else if(t==="document")r=OO(Xt(e));else if(Mt(t))r=_O(t,n);else{const i=$h(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return go(r)}function Kh(e,t){const n=Sn(e);return n===t||!Mt(n)||Er(n)?!1:jt(n).position==="fixed"||Kh(n,t)}function DO(e,t){const n=t.get(e);if(n)return n;let r=hi(e,[],!1).filter(s=>Mt(s)&&Mr(s)!=="body"),i=null;const o=jt(e).position==="fixed";let a=o?Sn(e):e;for(;Mt(a)&&!Er(a);){const s=jt(a),l=ol(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||wi(a)&&!l&&Kh(e,a))?r=r.filter(u=>u!==a):i=s,a=Sn(a)}return t.set(e,r),r}function MO(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?jo(t)?[]:DO(t,this._c):[].concat(n),r],s=rd(t,a[0],i);let l=s.top,c=s.right,u=s.bottom,d=s.left;for(let h=1;h<a.length;h++){const f=rd(t,a[h],i);l=St(f.top,l),c=kn(f.right,c),u=kn(f.bottom,u),d=St(f.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function jO(e){const{width:t,height:n}=zh(e);return{width:t,height:n}}function FO(e,t,n){const r=fn(t),i=Xt(t),o=n==="fixed",a=er(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Gt(0);function c(){l.x=Uo(i)}if(r||!r&&!o)if((Mr(t)!=="body"||wi(i))&&(s=Fo(t)),r){const f=er(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?Vh(i,s):Gt(0),d=a.left+s.scrollLeft-l.x-u.x,h=a.top+s.scrollTop-l.y-u.y;return{x:d,y:h,width:a.width,height:a.height}}function Sa(e){return jt(e).position==="static"}function id(e,t){if(!fn(e)||jt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Xt(e)===n&&(n=n.ownerDocument.body),n}function Wh(e,t){const n=Ct(e);if(jo(e))return n;if(!fn(e)){let i=Sn(e);for(;i&&!Er(i);){if(Mt(i)&&!Sa(i))return i;i=Sn(i)}return n}let r=id(e,t);for(;r&&AO(r)&&Sa(r);)r=id(r,t);return r&&Er(r)&&Sa(r)&&!ol(r)?n:r||RO(e)||n}const UO=async function(e){const t=this.getOffsetParent||Wh,n=this.getDimensions,r=await n(e.floating);return{reference:FO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function HO(e){return jt(e).direction==="rtl"}const BO={convertOffsetParentRelativeRectToViewportRelativeRect:IO,getDocumentElement:Xt,getClippingRect:MO,getOffsetParent:Wh,getElementRects:UO,getClientRects:LO,getDimensions:jO,getScale:xr,isElement:Mt,isRTL:HO};function qh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zO(e,t){let n=null,r;const i=Xt(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=c;if(s||t(),!h||!f)return;const m=Mi(d),p=Mi(i.clientWidth-(u+h)),b=Mi(i.clientHeight-(d+f)),v=Mi(u),w={rootMargin:-m+"px "+-p+"px "+-b+"px "+-v+"px",threshold:St(0,kn(1,l))||1};let E=!0;function P(C){const k=C[0].intersectionRatio;if(k!==l){if(!E)return a();k?a(!1,k):r=setTimeout(()=>{a(!1,1e-7)},1e3)}k===1&&!qh(c,e.getBoundingClientRect())&&a(),E=!1}try{n=new IntersectionObserver(P,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(P,w)}n.observe(e)}return a(!0),o}function $O(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=sl(e),u=i||o?[...c?hi(c):[],...t?hi(t):[]]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=c&&s?zO(c,n):null;let h=-1,f=null;a&&(f=new ResizeObserver(v=>{let[x]=v;x&&x.target===c&&f&&t&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),n()}),c&&!l&&f.observe(c),t&&f.observe(t));let m,p=l?er(e):null;l&&b();function b(){const v=er(e);p&&!qh(p,v)&&n(),p=v,m=requestAnimationFrame(b)}return n(),()=>{var v;u.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d?.(),(v=f)==null||v.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const VO=xO,KO=wO,WO=yO,qO=SO,QO=bO,od=gO,GO=kO,YO=(e,t,n)=>{const r=new Map,i={platform:BO,...n},o={...i.platform,_c:r};return mO(e,t,{...i,platform:o})};var XO=typeof document<"u",JO=function(){},Wi=XO?g.useLayoutEffect:JO;function yo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!yo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Qh(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ad(e,t){const n=Qh(e);return Math.round(t*n)/n}function Aa(e){const t=g.useRef(e);return Wi(()=>{t.current=e}),t}function ZO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=g.useState(r);yo(h,r)||f(r);const[m,p]=g.useState(null),[b,v]=g.useState(null),x=g.useCallback(V=>{V!==C.current&&(C.current=V,p(V))},[]),w=g.useCallback(V=>{V!==k.current&&(k.current=V,v(V))},[]),E=o||m,P=a||b,C=g.useRef(null),k=g.useRef(null),O=g.useRef(u),M=l!=null,R=Aa(l),_=Aa(i),L=Aa(c),z=g.useCallback(()=>{if(!C.current||!k.current)return;const V={placement:t,strategy:n,middleware:h};_.current&&(V.platform=_.current),YO(C.current,k.current,V).then(F=>{const S={...F,isPositioned:L.current!==!1};U.current&&!yo(O.current,S)&&(O.current=S,Pr.flushSync(()=>{d(S)}))})},[h,t,n,_,L]);Wi(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[c]);const U=g.useRef(!1);Wi(()=>(U.current=!0,()=>{U.current=!1}),[]),Wi(()=>{if(E&&(C.current=E),P&&(k.current=P),E&&P){if(R.current)return R.current(E,P,z);z()}},[E,P,z,R,M]);const $=g.useMemo(()=>({reference:C,floating:k,setReference:x,setFloating:w}),[x,w]),G=g.useMemo(()=>({reference:E,floating:P}),[E,P]),Y=g.useMemo(()=>{const V={position:n,left:0,top:0};if(!G.floating)return V;const F=ad(G.floating,u.x),S=ad(G.floating,u.y);return s?{...V,transform:"translate("+F+"px, "+S+"px)",...Qh(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:S}},[n,s,G.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:z,refs:$,elements:G,floatingStyles:Y}),[u,z,$,G,Y])}const eN=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?od({element:r.current,padding:i}).fn(n):{}:r?od({element:r,padding:i}).fn(n):{}}}},tN=(e,t)=>{const n=VO(e);return{name:n.name,fn:n.fn,options:[e,t]}},nN=(e,t)=>{const n=KO(e);return{name:n.name,fn:n.fn,options:[e,t]}},rN=(e,t)=>({fn:GO(e).fn,options:[e,t]}),iN=(e,t)=>{const n=WO(e);return{name:n.name,fn:n.fn,options:[e,t]}},oN=(e,t)=>{const n=qO(e);return{name:n.name,fn:n.fn,options:[e,t]}},aN=(e,t)=>{const n=QO(e);return{name:n.name,fn:n.fn,options:[e,t]}},sN=(e,t)=>{const n=eN(e);return{name:n.name,fn:n.fn,options:[e,t]}};var lN="Arrow",Gh=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return y.jsx(De.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});Gh.displayName=lN;var cN=Gh;function uN(e){const[t,n]=g.useState(void 0);return ot(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ll="Popper",[Yh,Ho]=xi(ll),[dN,Xh]=Yh(ll),Jh=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null),[o,a]=g.useState(void 0);return y.jsx(dN,{scope:t,anchor:r,onAnchorChange:i,placementState:o,setPlacementState:a,children:n})};Jh.displayName=ll;var Zh="PopperAnchor",ep=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=Xh(Zh,n),a=g.useRef(null),s=o.onAnchorChange,l=g.useCallback(m=>{a.current=m,m&&s(m)},[s]),c=$e(t,l),u=g.useRef(null);g.useEffect(()=>{if(!r)return;const m=u.current;u.current=r.current,m!==u.current&&s(u.current)});const d=o.placementState&&ul(o.placementState),h=d?.[0],f=d?.[1];return r?null:y.jsx(De.div,{"data-radix-popper-side":h,"data-radix-popper-align":f,...i,ref:c})});ep.displayName=Zh;var cl="PopperContent",[fN,hN]=Yh(cl),tp=g.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:m,...p}=e,b=Xh(cl,n),[v,x]=g.useState(null),w=$e(t,he=>x(he)),[E,P]=g.useState(null),C=uN(E),k=C?.width??0,O=C?.height??0,M=r+(o!=="center"?"-"+o:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},_=Array.isArray(c)?c:[c],L=_.length>0,z={padding:R,boundary:_.filter(mN),altBoundary:L},{refs:U,floatingStyles:$,placement:G,isPositioned:Y,middlewareData:V}=ZO({strategy:"fixed",placement:M,whileElementsMounted:(...he)=>$O(...he,{animationFrame:f==="always"}),elements:{reference:b.anchor},middleware:[tN({mainAxis:i+O,alignmentAxis:a}),l&&nN({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?rN():void 0,...z}),l&&iN({...z}),oN({...z,apply:({elements:he,rects:Pe,availableWidth:xe,availableHeight:ke})=>{const{width:pe,height:qe}=Pe.reference,Xe=he.floating.style;Xe.setProperty("--radix-popper-available-width",`${xe}px`),Xe.setProperty("--radix-popper-available-height",`${ke}px`),Xe.setProperty("--radix-popper-anchor-width",`${pe}px`),Xe.setProperty("--radix-popper-anchor-height",`${qe}px`)}}),E&&sN({element:E,padding:s}),gN({arrowWidth:k,arrowHeight:O}),h&&aN({strategy:"referenceHidden",...z,boundary:L?z.boundary:void 0})]}),F=b.setPlacementState;ot(()=>(F(G),()=>{F(void 0)}),[G,F]);const[S,ie]=ul(G),Z=Zn(m);ot(()=>{Y&&Z?.()},[Y,Z]);const A=V.arrow?.x,ae=V.arrow?.y,me=V.arrow?.centerOffset!==0,[be,q]=g.useState();return ot(()=>{v&&q(window.getComputedStyle(v).zIndex)},[v]),y.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:Y?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:y.jsx(fN,{scope:n,placedSide:S,placedAlign:ie,onArrowChange:P,arrowX:A,arrowY:ae,shouldHideArrow:me,children:y.jsx(De.div,{"data-side":S,"data-align":ie,...p,ref:w,style:{...p.style,animation:Y?void 0:"none"}})})})});tp.displayName=cl;var np="PopperArrow",pN={top:"bottom",right:"left",bottom:"top",left:"right"},rp=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=hN(np,r),a=pN[o.placedSide];return y.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:y.jsx(cN,{...i,ref:n,style:{...i.style,display:"block"}})})});rp.displayName=np;function mN(e){return e!==null}var gN=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,u]=ul(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(i.arrow?.x??0)+s/2,f=(i.arrow?.y??0)+l/2;let m="",p="";return c==="bottom"?(m=a?d:`${h}px`,p=`${-l}px`):c==="top"?(m=a?d:`${h}px`,p=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,p=a?d:`${f}px`):c==="left"&&(m=`${r.floating.width+l}px`,p=a?d:`${f}px`),{data:{x:m,y:p}}}});function ul(e){const[t,n="center"]=e.split("-");return[t,n]}var yN=Jh,ip=ep,op=tp,ap=rp,bN="Portal",dl=g.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=g.useState(!1);ot(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?Pr.createPortal(y.jsx(De.div,{...r,ref:t}),a):null});dl.displayName=bN;function vN(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var jr=e=>{const{present:t,children:n}=e,r=xN(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=wN(r.ref,kN(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};jr.displayName="Presence";function xN(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),a=e?"mounted":"unmounted",[s,l]=vN(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=ji(r.current);o.current=s==="mounted"?c:"none"},[s]),ot(()=>{const c=r.current,u=i.current;if(u!==e){const h=o.current,f=ji(c);e?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),ot(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=f=>{const p=ji(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&p&&(l("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=f=>{f.target===t&&(o.current=ji(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function sd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wN(...e){const t=g.useRef(e);return t.current=e,g.useCallback(n=>{const r=t.current;let i=!1;const o=r.map(a=>{const s=sd(a,n);return!i&&typeof s=="function"&&(i=!0),s});if(i)return()=>{for(let a=0;a<o.length;a++){const s=o[a];typeof s=="function"?s():sd(r[a],null)}}},[])}function ji(e){return e?.animationName||"none"}function kN(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var SN=ko[" useInsertionEffect ".trim().toString()]||ot;function fs({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=AN({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{const u=g.useRef(e!==void 0);g.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,r])}const c=g.useCallback(u=>{if(s){const d=CN(u)?u(e):u;d!==e&&a.current?.(d)}else o(u)},[s,e,o,a]);return[l,c]}function AN({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return SN(()=>{o.current=t},[t]),g.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function CN(e){return typeof e=="function"}function EN(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var sp=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),RN="VisuallyHidden",lp=g.forwardRef((e,t)=>y.jsx(De.span,{...e,ref:t,style:{...sp,...e.style}}));lp.displayName=RN;var TN=lp,PN=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},fr=new WeakMap,Fi=new WeakMap,Ui={},Ca=0,cp=function(e){return e&&(e.host||cp(e.parentNode))},IN=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=cp(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},LN=function(e,t,n,r){var i=IN(t,Array.isArray(e)?e:[e]);Ui[n]||(Ui[n]=new WeakMap);var o=Ui[n],a=[],s=new Set,l=new Set(i),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(s.has(h))u(h);else try{var f=h.getAttribute(r),m=f!==null&&f!=="false",p=(fr.get(h)||0)+1,b=(o.get(h)||0)+1;fr.set(h,p),o.set(h,b),a.push(h),p===1&&m&&Fi.set(h,!0),b===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return u(t),s.clear(),Ca++,function(){a.forEach(function(d){var h=fr.get(d)-1,f=o.get(d)-1;fr.set(d,h),o.set(d,f),h||(Fi.has(d)||d.removeAttribute(r),Fi.delete(d)),f||d.removeAttribute(n)}),Ca--,Ca||(fr=new WeakMap,fr=new WeakMap,Fi=new WeakMap,Ui={})}},up=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=PN(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),LN(r,i,n,"aria-hidden")):function(){return null}},Wt=function(){return Wt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Wt.apply(this,arguments)};function dp(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ON(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var qi="right-scroll-bar-position",Qi="width-before-scroll-bar",NN="with-scroll-bars-hidden",_N="--removed-body-scroll-bar-size";function Ea(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function DN(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var MN=typeof window<"u"?g.useLayoutEffect:g.useEffect,ld=new WeakMap;function jN(e,t){var n=DN(null,function(r){return e.forEach(function(i){return Ea(i,r)})});return MN(function(){var r=ld.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||Ea(s,null)}),o.forEach(function(s){i.has(s)||Ea(s,a)})}ld.set(n,e)},[e]),n}function FN(e){return e}function UN(e,t){t===void 0&&(t=FN);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var u=a;a=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){a.push(u),c()},filter:function(u){return a=a.filter(u),n}}}};return i}function HN(e){e===void 0&&(e={});var t=UN(null);return t.options=Wt({async:!0,ssr:!1},e),t}var fp=function(e){var t=e.sideCar,n=dp(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,Wt({},n))};fp.isSideCarExport=!0;function BN(e,t){return e.useMedium(t),fp}var hp=HN(),Ra=function(){},Bo=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:Ra,onWheelCapture:Ra,onTouchMoveCapture:Ra}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noRelative,m=e.noIsolation,p=e.inert,b=e.allowPinchZoom,v=e.as,x=v===void 0?"div":v,w=e.gapMode,E=dp(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=h,C=jN([n,t]),k=Wt(Wt({},E),i);return g.createElement(g.Fragment,null,u&&g.createElement(P,{sideCar:hp,removeScrollBar:c,shards:d,noRelative:f,noIsolation:m,inert:p,setCallbacks:o,allowPinchZoom:!!b,lockRef:n,gapMode:w}),a?g.cloneElement(g.Children.only(s),Wt(Wt({},k),{ref:C})):g.createElement(x,Wt({},k,{className:l,ref:C}),s))});Bo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bo.classNames={fullWidth:Qi,zeroRight:qi};var zN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $N(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=zN();return t&&e.setAttribute("nonce",t),e}function VN(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function KN(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var WN=function(){var e=0,t=null;return{add:function(n){e==0&&(t=$N())&&(VN(t,n),KN(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qN=function(){var e=WN();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pp=function(){var e=qN(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},QN={left:0,top:0,right:0,gap:0},Ta=function(e){return parseInt(e||"",10)||0},GN=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Ta(n),Ta(r),Ta(i)]},YN=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return QN;var t=GN(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},XN=pp(),wr="data-scroll-locked",JN=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
169
|
-
.`.concat(NN,` {
|
|
170
|
-
overflow: hidden `).concat(r,`;
|
|
171
|
-
padding-right: `).concat(s,"px ").concat(r,`;
|
|
172
|
-
}
|
|
173
|
-
body[`).concat(wr,`] {
|
|
174
|
-
overflow: hidden `).concat(r,`;
|
|
175
|
-
overscroll-behavior: contain;
|
|
176
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
177
|
-
padding-left: `.concat(i,`px;
|
|
178
|
-
padding-top: `).concat(o,`px;
|
|
179
|
-
padding-right: `).concat(a,`px;
|
|
180
|
-
margin-left:0;
|
|
181
|
-
margin-top:0;
|
|
182
|
-
margin-right: `).concat(s,"px ").concat(r,`;
|
|
183
|
-
`),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.`).concat(qi,` {
|
|
187
|
-
right: `).concat(s,"px ").concat(r,`;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.`).concat(Qi,` {
|
|
191
|
-
margin-right: `).concat(s,"px ").concat(r,`;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.`).concat(qi," .").concat(qi,` {
|
|
195
|
-
right: 0 `).concat(r,`;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.`).concat(Qi," .").concat(Qi,` {
|
|
199
|
-
margin-right: 0 `).concat(r,`;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
body[`).concat(wr,`] {
|
|
203
|
-
`).concat(_N,": ").concat(s,`px;
|
|
204
|
-
}
|
|
205
|
-
`)},cd=function(){var e=parseInt(document.body.getAttribute(wr)||"0",10);return isFinite(e)?e:0},ZN=function(){g.useEffect(function(){return document.body.setAttribute(wr,(cd()+1).toString()),function(){var e=cd()-1;e<=0?document.body.removeAttribute(wr):document.body.setAttribute(wr,e.toString())}},[])},e_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;ZN();var o=g.useMemo(function(){return YN(i)},[i]);return g.createElement(XN,{styles:JN(o,!t,i,n?"":"!important")})},hs=!1;if(typeof window<"u")try{var Hi=Object.defineProperty({},"passive",{get:function(){return hs=!0,!0}});window.addEventListener("test",Hi,Hi),window.removeEventListener("test",Hi,Hi)}catch{hs=!1}var hr=hs?{passive:!1}:!1,t_=function(e){return e.tagName==="TEXTAREA"},mp=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!t_(e)&&n[t]==="visible")},n_=function(e){return mp(e,"overflowY")},r_=function(e){return mp(e,"overflowX")},ud=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=gp(e,r);if(i){var o=yp(e,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},i_=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},o_=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},gp=function(e,t){return e==="v"?n_(t):r_(t)},yp=function(e,t){return e==="v"?i_(t):o_(t)},a_=function(e,t){return e==="h"&&t==="rtl"?-1:1},s_=function(e,t,n,r,i){var o=a_(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,h=0;do{if(!s)break;var f=yp(e,s),m=f[0],p=f[1],b=f[2],v=p-b-o*m;(m||v)&&gp(e,s)&&(d+=v,h+=m);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&Math.abs(d)<1||!u&&Math.abs(h)<1)&&(c=!0),c},Bi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dd=function(e){return[e.deltaX,e.deltaY]},fd=function(e){return e&&"current"in e?e.current:e},l_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},c_=function(e){return`
|
|
206
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
207
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
208
|
-
`)},u_=0,pr=[];function d_(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(u_++)[0],o=g.useState(pp)[0],a=g.useRef(e);g.useEffect(function(){a.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=ON([e.lockRef.current],(e.shards||[]).map(fd),!0).filter(Boolean);return p.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(p,b){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var v=Bi(p),x=n.current,w="deltaX"in p?p.deltaX:x[0]-v[0],E="deltaY"in p?p.deltaY:x[1]-v[1],P,C=p.target,k=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in p&&k==="h"&&C.type==="range")return!1;var O=window.getSelection(),M=O&&O.anchorNode,R=M?M===C||M.contains(C):!1;if(R)return!1;var _=ud(k,C);if(!_)return!0;if(_?P=k:(P=k==="v"?"h":"v",_=ud(k,C)),!_)return!1;if(!r.current&&"changedTouches"in p&&(w||E)&&(r.current=P),!P)return!0;var L=r.current||P;return s_(L,b,p,L==="h"?w:E)},[]),l=g.useCallback(function(p){var b=p;if(!(!pr.length||pr[pr.length-1]!==o)){var v="deltaY"in b?dd(b):Bi(b),x=t.current.filter(function(P){return P.name===b.type&&(P.target===b.target||b.target===P.shadowParent)&&l_(P.delta,v)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var w=(a.current.shards||[]).map(fd).filter(Boolean).filter(function(P){return P.contains(b.target)}),E=w.length>0?s(b,w[0]):!a.current.noIsolation;E&&b.cancelable&&b.preventDefault()}}},[]),c=g.useCallback(function(p,b,v,x){var w={name:p,delta:b,target:v,should:x,shadowParent:f_(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),u=g.useCallback(function(p){n.current=Bi(p),r.current=void 0},[]),d=g.useCallback(function(p){c(p.type,dd(p),p.target,s(p,e.lockRef.current))},[]),h=g.useCallback(function(p){c(p.type,Bi(p),p.target,s(p,e.lockRef.current))},[]);g.useEffect(function(){return pr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,hr),document.addEventListener("touchmove",l,hr),document.addEventListener("touchstart",u,hr),function(){pr=pr.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,hr),document.removeEventListener("touchmove",l,hr),document.removeEventListener("touchstart",u,hr)}},[]);var f=e.removeScrollBar,m=e.inert;return g.createElement(g.Fragment,null,m?g.createElement(o,{styles:c_(i)}):null,f?g.createElement(e_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function f_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const h_=BN(hp,d_);var fl=g.forwardRef(function(e,t){return g.createElement(Bo,Wt({},e,{ref:t,sideCar:h_}))});fl.classNames=Bo.classNames;var p_=[" ","Enter","ArrowUp","ArrowDown"],m_=[" ","Enter"],tr="Select",[zo,$o,g_]=jL(tr),[rr]=xi(tr,[g_,Ho]),Vo=Ho(),[y_,Pn]=rr(tr),[b_,v_]=rr(tr),x_="SelectProvider";function bp(e){const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:h,required:f,form:m,internal_do_not_use_render:p}=e,b=Vo(t),[v,x]=g.useState(null),[w,E]=g.useState(null),[P,C]=g.useState(!1),k=UL(c),[O,M]=fs({prop:r,defaultProp:i??!1,onChange:o,caller:tr}),[R,_]=fs({prop:a,defaultProp:s,onChange:l,caller:tr}),L=g.useRef(null),z=v?!!m||!!v.closest("form"):!0,[U,$]=g.useState(new Set),G=vr(),Y=Array.from(U).map(ie=>ie.props.value).join(";"),V=g.useCallback(ie=>{$(Z=>new Set(Z).add(ie))},[]),F=g.useCallback(ie=>{$(Z=>{const A=new Set(Z);return A.delete(ie),A})},[]),S={required:f,trigger:v,onTriggerChange:x,valueNode:w,onValueNodeChange:E,valueNodeHasChildren:P,onValueNodeHasChildrenChange:C,contentId:G,value:R,onValueChange:_,open:O,onOpenChange:M,dir:k,triggerPointerDownPosRef:L,disabled:h,name:u,autoComplete:d,form:m,nativeOptions:U,nativeSelectKey:Y,isFormControl:z};return y.jsx(yN,{...b,children:y.jsx(y_,{scope:t,...S,children:y.jsx(zo.Provider,{scope:t,children:y.jsx(b_,{scope:t,onNativeOptionAdd:V,onNativeOptionRemove:F,children:D_(p)?p(S):n})})})})}bp.displayName=x_;var vp=e=>{const{__scopeSelect:t,children:n,...r}=e;return y.jsx(bp,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:i})=>y.jsxs(y.Fragment,{children:[n,i?y.jsx(Hp,{__scopeSelect:t}):null]})})};vp.displayName=tr;var xp="SelectTrigger",hl=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Vo(n),a=Pn(xp,n),s=a.disabled||r,l=$e(t,a.onTriggerChange),c=$o(n),u=g.useRef("touch"),[d,h,f]=Bp(p=>{const b=c().filter(w=>!w.disabled),v=b.find(w=>w.value===a.value),x=zp(b,p,v);x!==void 0&&a.onValueChange(x.value)}),m=p=>{s||(a.onOpenChange(!0),f()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return y.jsx(ip,{asChild:!0,...o,children:y.jsx(De.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Ko(a.value)?"":void 0,...i,ref:l,onClick:Oe(i.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&m(p)}),onPointerDown:Oe(i.onPointerDown,p=>{u.current=p.pointerType;const b=p.target;b.hasPointerCapture(p.pointerId)&&b.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(m(p),p.preventDefault())}),onKeyDown:Oe(i.onKeyDown,p=>{const b=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(b&&p.key===" ")&&p_.includes(p.key)&&(m(),p.preventDefault())})})})});hl.displayName=xp;var wp="SelectValue",kp=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,l=Pn(wp,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=$e(t,l.onValueNodeChange);ot(()=>{c(u)},[c,u]);const h=Ko(l.value);return y.jsx(De.span,{...s,asChild:h?!1:s.asChild,ref:d,style:{pointerEvents:"none"},children:y.jsx(g.Fragment,{children:h?a:o},h?"placeholder":"value")})});kp.displayName=wp;var w_="SelectIcon",Sp=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return y.jsx(De.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Sp.displayName=w_;var Ap="SelectPortal",[k_,S_]=rr(Ap,{forceMount:void 0}),Cp=e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return y.jsx(k_,{scope:e.__scopeSelect,forceMount:n,children:y.jsx(dl,{asChild:!0,...r})})};Cp.displayName=Ap;var An="SelectContent",pl=g.forwardRef((e,t)=>{const n=S_(An,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,o=Pn(An,e.__scopeSelect),[a,s]=g.useState();return ot(()=>{s(new DocumentFragment)},[]),y.jsx(jr,{present:r||o.open,children:({present:l})=>l?y.jsx(Tp,{...i,ref:t}):y.jsx(Ep,{...i,fragment:a})})});pl.displayName=An;var Ep=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,fragment:i}=e;return i?Pr.createPortal(y.jsx(Rp,{scope:n,children:y.jsx(zo.Slot,{scope:n,children:y.jsx("div",{ref:t,children:r})})}),i):null});Ep.displayName="SelectContentFragment";var Nt=10,[Rp,In]=rr(An),A_="SelectContentImpl",C_=Sr("SelectContent.RemoveScroll"),Tp=g.forwardRef((e,t)=>{const{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:m,hideWhenDetached:p,avoidCollisions:b,...v}=e,x=Pn(An,n),[w,E]=g.useState(null),[P,C]=g.useState(null),k=$e(t,q=>E(q)),[O,M]=g.useState(null),[R,_]=g.useState(null),L=$o(n),[z,U]=g.useState(!1),$=g.useRef(!1);g.useEffect(()=>{if(w)return up(w)},[w]),Mh();const G=g.useCallback(q=>{const[he,...Pe]=L().map(pe=>pe.ref.current),[xe]=Pe.slice(-1),ke=document.activeElement;for(const pe of q)if(pe===ke||(pe?.scrollIntoView({block:"nearest"}),pe===he&&P&&(P.scrollTop=0),pe===xe&&P&&(P.scrollTop=P.scrollHeight),pe?.focus(),document.activeElement!==ke))return},[L,P]),Y=g.useCallback(()=>G([O,w]),[G,O,w]);g.useEffect(()=>{z&&Y()},[z,Y]);const{onOpenChange:V,triggerPointerDownPosRef:F}=x;g.useEffect(()=>{if(w){let q={x:0,y:0};const he=xe=>{q={x:Math.abs(Math.round(xe.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(xe.pageY)-(F.current?.y??0))}},Pe=xe=>{q.x<=10&&q.y<=10?xe.preventDefault():xe.composedPath().includes(w)||V(!1),document.removeEventListener("pointermove",he),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",Pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",Pe,{capture:!0})}}},[w,V,F]),g.useEffect(()=>{const q=()=>V(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[V]);const[S,ie]=Bp(q=>{const he=L().filter(ke=>!ke.disabled),Pe=he.find(ke=>ke.ref.current===document.activeElement),xe=zp(he,q,Pe);xe&&setTimeout(()=>xe.ref.current?.focus())}),Z=g.useCallback((q,he,Pe)=>{const xe=!$.current&&!Pe;(x.value!==void 0&&x.value===he||xe)&&(M(q),xe&&($.current=!0))},[x.value]),A=g.useCallback(()=>w?.focus(),[w]),ae=g.useCallback((q,he,Pe)=>{const xe=!$.current&&!Pe;(x.value!==void 0&&x.value===he||xe)&&_(q)},[x.value]),me=r==="popper"?ps:Pp,be=me===ps?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:m,hideWhenDetached:p,avoidCollisions:b}:{};return y.jsx(Rp,{scope:n,content:w,viewport:P,onViewportChange:C,itemRefCallback:Z,selectedItem:O,onItemLeave:A,itemTextRefCallback:ae,focusSelectedItem:Y,selectedItemText:R,position:r,isPositioned:z,searchRef:S,children:y.jsx(fl,{as:C_,allowPinchZoom:!0,children:y.jsx(tl,{asChild:!0,trapped:x.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:Oe(i,q=>{x.trigger?.focus({preventScroll:!0}),q.preventDefault()}),children:y.jsx(Do,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:y.jsx(me,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:q=>q.preventDefault(),...v,...be,onPlaced:()=>U(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Oe(v.onKeyDown,q=>{const he=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!he&&q.key.length===1&&ie(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let xe=L().filter(ke=>!ke.disabled).map(ke=>ke.ref.current);if(["ArrowUp","End"].includes(q.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const ke=q.target,pe=xe.indexOf(ke);xe=xe.slice(pe+1)}setTimeout(()=>G(xe)),q.preventDefault()}})})})})})})});Tp.displayName=A_;var E_="SelectItemAlignedPosition",Pp=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Pn(An,n),a=In(An,n),[s,l]=g.useState(null),[c,u]=g.useState(null),d=$e(t,k=>u(k)),h=$o(n),f=g.useRef(!1),m=g.useRef(!0),{viewport:p,selectedItem:b,selectedItemText:v,focusSelectedItem:x}=a,w=g.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&p&&b&&v){const k=o.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),M=o.valueNode.getBoundingClientRect(),R=v.getBoundingClientRect();if(o.dir!=="rtl"){const ke=R.left-O.left,pe=M.left-ke,qe=k.left-pe,Xe=k.width+qe,Ut=Math.max(Xe,O.width),nt=window.innerWidth-Nt,Ht=zu(pe,[Nt,Math.max(Nt,nt-Ut)]);s.style.minWidth=Xe+"px",s.style.left=Ht+"px"}else{const ke=O.right-R.right,pe=window.innerWidth-M.right-ke,qe=window.innerWidth-k.right-pe,Xe=k.width+qe,Ut=Math.max(Xe,O.width),nt=window.innerWidth-Nt,Ht=zu(pe,[Nt,Math.max(Nt,nt-Ut)]);s.style.minWidth=Xe+"px",s.style.right=Ht+"px"}const _=h(),L=window.innerHeight-Nt*2,z=p.scrollHeight,U=window.getComputedStyle(c),$=parseInt(U.borderTopWidth,10),G=parseInt(U.paddingTop,10),Y=parseInt(U.borderBottomWidth,10),V=parseInt(U.paddingBottom,10),F=$+G+z+V+Y,S=Math.min(b.offsetHeight*5,F),ie=window.getComputedStyle(p),Z=parseInt(ie.paddingTop,10),A=parseInt(ie.paddingBottom,10),ae=k.top+k.height/2-Nt,me=L-ae,be=b.offsetHeight/2,q=b.offsetTop+be,he=$+G+q,Pe=F-he;if(he<=ae){const ke=_.length>0&&b===_[_.length-1].ref.current;s.style.bottom="0px";const pe=c.clientHeight-p.offsetTop-p.offsetHeight,qe=Math.max(me,be+(ke?A:0)+pe+Y),Xe=he+qe;s.style.height=Xe+"px"}else{const ke=_.length>0&&b===_[0].ref.current;s.style.top="0px";const qe=Math.max(ae,$+p.offsetTop+(ke?Z:0)+be)+Pe;s.style.height=qe+"px",p.scrollTop=he-ae+p.offsetTop}s.style.margin=`${Nt}px 0`,s.style.minHeight=S+"px",s.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,s,c,p,b,v,o.dir,r]);ot(()=>w(),[w]);const[E,P]=g.useState();ot(()=>{c&&P(window.getComputedStyle(c).zIndex)},[c]);const C=g.useCallback(k=>{k&&m.current===!0&&(w(),x?.(),m.current=!1)},[w,x]);return y.jsx(T_,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:y.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:y.jsx(De.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Pp.displayName=E_;var R_="SelectPopperPosition",ps=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Nt,...o}=e,a=Vo(n);return y.jsx(op,{...a,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ps.displayName=R_;var[T_,ml]=rr(An,{}),ms="SelectViewport",Ip=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=In(ms,n),a=ml(ms,n),s=$e(t,o.onViewportChange),l=g.useRef(0);return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),y.jsx(zo.Slot,{scope:n,children:y.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Oe(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=a;if(h?.current&&d){const f=Math.abs(l.current-u.scrollTop);if(f>0){const m=window.innerHeight-Nt*2,p=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),v=Math.max(p,b);if(v<m){const x=v+f,w=Math.min(m,x),E=x-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=E>0?E:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Ip.displayName=ms;var Lp="SelectGroup",[P_,I_]=rr(Lp),L_=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=vr();return y.jsx(P_,{scope:n,id:i,children:y.jsx(De.div,{role:"group","aria-labelledby":i,...r,ref:t})})});L_.displayName=Lp;var Op="SelectLabel",gl=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=I_(Op,n);return y.jsx(De.div,{id:i.id,...r,ref:t})});gl.displayName=Op;var bo="SelectItem",[O_,Np]=rr(bo),yl=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=Pn(bo,n),l=In(bo,n),c=s.value===r,[u,d]=g.useState(o??""),[h,f]=g.useState(!1),m=$e(t,x=>l.itemRefCallback?.(x,r,i)),p=vr(),b=g.useRef("touch"),v=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};return y.jsx(O_,{scope:n,value:r,disabled:i,textId:p,isSelected:c,onItemTextChange:g.useCallback(x=>{d(w=>w||(x?.textContent??"").trim())},[]),children:y.jsx(zo.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:y.jsx(De.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:m,onFocus:Oe(a.onFocus,()=>f(!0)),onBlur:Oe(a.onBlur,()=>f(!1)),onClick:Oe(a.onClick,()=>{b.current!=="mouse"&&v()}),onPointerUp:Oe(a.onPointerUp,()=>{b.current==="mouse"&&v()}),onPointerDown:Oe(a.onPointerDown,x=>{b.current=x.pointerType}),onPointerMove:Oe(a.onPointerMove,x=>{b.current=x.pointerType,i?l.onItemLeave?.():b.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:Oe(a.onKeyDown,x=>{l.searchRef?.current!==""&&x.key===" "||(m_.includes(x.key)&&v(),x.key===" "&&x.preventDefault())})})})})});yl.displayName=bo;var ei="SelectItemText",_p=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Pn(ei,n),s=In(ei,n),l=Np(ei,n),c=v_(ei,n),[u,d]=g.useState(null),h=$e(t,v=>d(v),l.onItemTextChange,v=>s.itemTextRefCallback?.(v,l.value,l.disabled)),f=u?.textContent,m=g.useMemo(()=>y.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:p,onNativeOptionRemove:b}=c;return ot(()=>(p(m),()=>b(m)),[p,b,m]),y.jsxs(y.Fragment,{children:[y.jsx(De.span,{id:l.textId,...o,ref:h}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!Ko(a.value)?Pr.createPortal(o.children,a.valueNode):null]})});_p.displayName=ei;var Dp="SelectItemIndicator",Mp=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Np(Dp,n).isSelected?y.jsx(De.span,{"aria-hidden":!0,...r,ref:t}):null});Mp.displayName=Dp;var gs="SelectScrollUpButton",bl=g.forwardRef((e,t)=>{const n=In(gs,e.__scopeSelect),r=ml(gs,e.__scopeSelect),[i,o]=g.useState(!1),a=$e(t,r.onScrollButtonChange);return ot(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?y.jsx(jp,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});bl.displayName=gs;var ys="SelectScrollDownButton",vl=g.forwardRef((e,t)=>{const n=In(ys,e.__scopeSelect),r=ml(ys,e.__scopeSelect),[i,o]=g.useState(!1),a=$e(t,r.onScrollButtonChange);return ot(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;o(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?y.jsx(jp,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});vl.displayName=ys;var jp=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=In("SelectScrollButton",n),a=g.useRef(null),s=$o(n),l=g.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),ot(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),y.jsx(De.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Oe(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Oe(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Oe(i.onPointerLeave,()=>{l()})})}),N_="SelectSeparator",xl=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return y.jsx(De.div,{"aria-hidden":!0,...r,ref:t})});xl.displayName=N_;var Fp="SelectArrow",__=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Vo(n);return In(Fp,n).position==="popper"?y.jsx(ap,{...i,...r,ref:t}):null});__.displayName=Fp;var Up="SelectBubbleInput",Hp=g.forwardRef(({__scopeSelect:e,...t},n)=>{const r=Pn(Up,e),{value:i,onValueChange:o,required:a,disabled:s,name:l,autoComplete:c,form:u}=r,{nativeOptions:d,nativeSelectKey:h}=r,f=g.useRef(null),m=$e(n,f),p=i??"",b=EN(p),v=Array.from(d).some(x=>(x.props.value??"")==="");return g.useEffect(()=>{const x=f.current;if(!x)return;const w=window.HTMLSelectElement.prototype,P=Object.getOwnPropertyDescriptor(w,"value").set;if(b!==p&&P){const C=new Event("change",{bubbles:!0});P.call(x,p),x.dispatchEvent(C)}},[b,p]),y.jsxs(De.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:l,autoComplete:c,disabled:s,form:u,onChange:x=>o(x.target.value),...t,style:{...sp,...t.style},ref:m,defaultValue:p,children:[Ko(i)&&!v?y.jsx("option",{value:""}):null,Array.from(d)]},h)});Hp.displayName=Up;function D_(e){return typeof e=="function"}function Ko(e){return e===""||e===void 0}function Bp(e){const t=Zn(e),n=g.useRef(""),r=g.useRef(0),i=g.useCallback(a=>{const s=n.current+a;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),o=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function zp(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=M_(e,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function M_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const vo=vp,xo=kp,pi=g.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(hl,{ref:r,className:ve("flex h-8 w-full items-center justify-between gap-2","rounded-md border border-border bg-surface px-3 py-1 text-sm","placeholder:text-text-muted","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","disabled:cursor-not-allowed disabled:opacity-55","[&>span]:line-clamp-1",e),...n,children:[t,y.jsx(Sp,{asChild:!0,children:y.jsx($d,{className:"h-4 w-4 opacity-60"})})]}));pi.displayName=hl.displayName;const $p=g.forwardRef(({className:e,...t},n)=>y.jsx(bl,{ref:n,className:ve("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(Uy,{className:"h-4 w-4"})}));$p.displayName=bl.displayName;const Vp=g.forwardRef(({className:e,...t},n)=>y.jsx(vl,{ref:n,className:ve("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx($d,{className:"h-4 w-4"})}));Vp.displayName=vl.displayName;const mi=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>y.jsx(Cp,{children:y.jsxs(pl,{ref:i,position:n,className:ve("relative z-50 max-h-96 min-w-[8rem] overflow-hidden","rounded-md border border-border bg-surface text-text shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",n==="popper"&&["data-[side=bottom]:translate-y-1","data-[side=top]:-translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1"],e),...r,children:[y.jsx($p,{}),y.jsx(Ip,{className:ve("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),y.jsx(Vp,{})]})}));mi.displayName=pl.displayName;const j_=g.forwardRef(({className:e,...t},n)=>y.jsx(gl,{ref:n,className:ve("px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-text-muted",e),...t}));j_.displayName=gl.displayName;const bn=g.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(yl,{ref:r,className:ve("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-surface-hover focus:text-text","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[y.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:y.jsx(Mp,{children:y.jsx(Fy,{className:"h-4 w-4"})})}),y.jsx(_p,{children:t})]}));bn.displayName=yl.displayName;const F_=g.forwardRef(({className:e,...t},n)=>y.jsx(xl,{ref:n,className:ve("-mx-1 my-1 h-px bg-border",e),...t}));F_.displayName=xl.displayName;function U_({agents:e,value:t,onChange:n}){const{t:r}=at();function i(o){if(!o||o===t)return;const a=Ki(o);window.confirm(r("chat.switchAgentConfirm",{agent:a}))&&n(o)}return y.jsxs(vo,{value:t||void 0,onValueChange:i,children:[y.jsx(pi,{className:"h-7 w-28 sm:w-36 text-xs",children:y.jsx(xo,{placeholder:Ki(e[0]??"—")})}),y.jsx(mi,{children:e.map(o=>y.jsx(bn,{value:o,children:Ki(o)},o))})]})}function H_(e){const t=String(e||"");if(!t)return!1;const n=t.toLowerCase();return!(n.includes("native")||n.includes("agim"))&&!t.includes("/settings/llm")?!1:n.includes("not configured")||n.includes("not available")||n.includes("no llm backend")||n.includes("llmroles.native-chat")||t.includes("/settings/llm")||t.includes("未配置")||t.includes("大模型")}const Wo={all:["llm"],list:["llm","list"]};function B_(){return cf({queryKey:Wo.list,queryFn:()=>K.get("/api/llm")})}function z_(){const e=En();return Rn({mutationFn:t=>K.post("/api/llm/backends",{body:t}),onSuccess:()=>e.invalidateQueries({queryKey:Wo.all})})}function HD(){const e=En();return Rn({mutationFn:t=>K.delete(`/api/llm/backends/${encodeURIComponent(t)}`),onSuccess:()=>e.invalidateQueries({queryKey:Wo.all})})}function BD(){const e=En();return Rn({mutationFn:t=>K.put("/api/llm/roles",{body:t}),onSuccess:()=>e.invalidateQueries({queryKey:Wo.all})})}function zD(){return Rn({mutationFn:e=>K.post(`/api/llm/backends/${encodeURIComponent(e)}/ping`)})}const qo={all:["mcp"],list:["mcp","list"]};function $D(){return cf({queryKey:qo.list,queryFn:()=>K.get("/api/mcp")})}function VD(){const e=En();return Rn({mutationFn:t=>K.post("/api/mcp/servers",{body:t}),onSuccess:()=>e.invalidateQueries({queryKey:qo.all})})}function KD(){const e=En();return Rn({mutationFn:t=>K.delete(`/api/mcp/servers/${encodeURIComponent(t)}`),onSuccess:()=>e.invalidateQueries({queryKey:qo.all})})}function WD(){const e=En();return Rn({mutationFn:t=>K.post(`/api/mcp/servers/${encodeURIComponent(t)}/health`),onSuccess:()=>e.invalidateQueries({queryKey:qo.all})})}var Qo="Dialog",[Kp]=xi(Qo),[$_,Ft]=Kp(Qo),Wp=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=g.useRef(null),l=g.useRef(null),[c,u]=fs({prop:r,defaultProp:i??!1,onChange:o,caller:Qo});return y.jsx($_,{scope:t,triggerRef:s,contentRef:l,contentId:vr(),titleId:vr(),descriptionId:vr(),open:c,onOpenChange:u,onOpenToggle:g.useCallback(()=>u(d=>!d),[u]),modal:a,children:n})};Wp.displayName=Qo;var qp="DialogTrigger",V_=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ft(qp,n),o=$e(t,i.triggerRef);return y.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":El(i.open),...r,ref:o,onClick:Oe(e.onClick,i.onOpenToggle)})});V_.displayName=qp;var wl="DialogPortal",[K_,Qp]=Kp(wl,{forceMount:void 0}),Gp=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Ft(wl,t);return y.jsx(K_,{scope:t,forceMount:n,children:g.Children.map(r,a=>y.jsx(jr,{present:n||o.open,children:y.jsx(dl,{asChild:!0,container:i,children:a})}))})};Gp.displayName=wl;var wo="DialogOverlay",kl=g.forwardRef((e,t)=>{const n=Qp(wo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Ft(wo,e.__scopeDialog);return o.modal?y.jsx(jr,{present:r||o.open,children:y.jsx(q_,{...i,ref:t})}):null});kl.displayName=wo;var W_=Sr("DialogOverlay.RemoveScroll"),q_=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ft(wo,n),o=WL(),a=$e(t,o);return y.jsx(fl,{as:W_,allowPinchZoom:!0,shards:[i.contentRef],children:y.jsx(De.div,{"data-state":El(i.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})}),Rr="DialogContent",Sl=g.forwardRef((e,t)=>{const n=Qp(Rr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Ft(Rr,e.__scopeDialog);return y.jsx(jr,{present:r||o.open,children:o.modal?y.jsx(Q_,{...i,ref:t}):y.jsx(G_,{...i,ref:t})})});Sl.displayName=Rr;var Q_=g.forwardRef((e,t)=>{const n=Ft(Rr,e.__scopeDialog),r=g.useRef(null),i=$e(t,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return up(o)},[]),y.jsx(Yp,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Oe(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Oe(e.onFocusOutside,o=>o.preventDefault())})}),G_=g.forwardRef((e,t)=>{const n=Ft(Rr,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return y.jsx(Yp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Yp=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=Ft(Rr,n);return Mh(),y.jsx(y.Fragment,{children:y.jsx(tl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:y.jsx(Do,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":El(s.open),...a,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),Xp="DialogTitle",Al=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ft(Xp,n);return y.jsx(De.h2,{id:i.titleId,...r,ref:t})});Al.displayName=Xp;var Jp="DialogDescription",Cl=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ft(Jp,n);return y.jsx(De.p,{id:i.descriptionId,...r,ref:t})});Cl.displayName=Jp;var Zp="DialogClose",em=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ft(Zp,n);return y.jsx(De.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,()=>i.onOpenChange(!1))})});em.displayName=Zp;function El(e){return e?"open":"closed"}const Y_=Wp,X_=Gp,tm=g.forwardRef(({className:e,...t},n)=>y.jsx(kl,{ref:n,className:ve("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));tm.displayName=kl.displayName;const nm=g.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(X_,{children:[y.jsx(tm,{}),y.jsxs(Sl,{ref:r,className:ve("fixed left-[50%] top-[50%] z-50 grid w-full max-w-[calc(100vw-2rem)] sm:max-w-lg","translate-x-[-50%] translate-y-[-50%] gap-4","border border-border bg-surface p-4 shadow-lg","rounded-lg","max-h-[85dvh] overflow-y-auto pb-[calc(env(safe-area-inset-bottom)+1.5rem)]","duration-200","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]","data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",e),...n,children:[t,y.jsx(em,{className:ve("absolute right-4 top-4 rounded-md p-1","text-text-dim hover:bg-surface-hover hover:text-text","focus:outline-none focus:ring-2 focus:ring-accent","tap-target","disabled:pointer-events-none"),"aria-label":He.t("actions.close",{ns:"common",defaultValue:"Close"}),children:y.jsx(Jy,{className:"h-4 w-4"})})]})]}));nm.displayName=Sl.displayName;const rm=({className:e,...t})=>y.jsx("div",{className:ve("flex flex-col gap-1.5 text-left",e),...t});rm.displayName="DialogHeader";const im=({className:e,...t})=>y.jsx("div",{className:ve("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t});im.displayName="DialogFooter";const om=g.forwardRef(({className:e,...t},n)=>y.jsx(Al,{ref:n,className:ve("text-lg font-semibold leading-snug",e),...t}));om.displayName=Al.displayName;const am=g.forwardRef(({className:e,...t},n)=>y.jsx(Cl,{ref:n,className:ve("text-sm text-text-dim",e),...t}));am.displayName=Cl.displayName;const Gi=[{key:"deepseek",provider:"openai-compat",baseUrl:"https://api.deepseek.com/v1",model:"deepseek-chat",baseName:"deepseek-agim"},{key:"moonshot",provider:"openai-compat",baseUrl:"https://api.moonshot.cn/v1",model:"moonshot-v1-8k",baseName:"moonshot-agim"},{key:"zhipu",provider:"openai-compat",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-4-air",baseName:"zhipu-agim"},{key:"openai",provider:"openai-compat",baseUrl:"https://api.openai.com/v1",model:"gpt-4o-mini",baseName:"openai-agim"},{key:"anthropic",provider:"anthropic",baseUrl:"https://api.anthropic.com",model:"claude-3-5-sonnet-20241022",baseName:"anthropic-agim"},{key:"custom",provider:"openai-compat",baseUrl:"",model:"",baseName:"agim-api"}],hd=Gi[0];function pd(e,t){const n=new Set(t.map(r=>r.toLowerCase()));if(!n.has(e.toLowerCase()))return e;for(let r=2;r<200;r+=1){const i=`${e}-${r}`;if(!n.has(i.toLowerCase()))return i}return`${e}-${Date.now()}`}function J_({open:e,reason:t,onOpenChange:n,onConfigured:r}){const{t:i}=at(["common","settings"]),o=z_(),a=B_(),[s,l]=g.useState("deepseek"),c=g.useMemo(()=>Gi.find(P=>P.key===s)??hd,[s]),u=g.useMemo(()=>(a.data?.backends??[]).map(P=>P.name),[a.data]),[d,h]=g.useState(()=>pd("deepseek-agim",[])),[f,m]=g.useState(c.baseUrl),[p,b]=g.useState(c.model),[v,x]=g.useState("");function w(P){const C=Gi.find(k=>k.key===P)??hd;l(P),m(C.baseUrl),b(C.model),h(pd(C.baseName,u))}async function E(P){if(P.preventDefault(),!d.trim()){Je.error(i("llm.nameRequired",{ns:"settings"}));return}if(!f.trim()){Je.error(i("llm.baseUrlRequired",{ns:"settings"}));return}if(!/^https?:\/\//i.test(f.trim())){Je.error(i("llm.baseUrlRequired",{ns:"settings"}));return}if(!p.trim()){Je.error(i("llm.modelRequired",{ns:"settings"}));return}if(!v.trim()){Je.error(i("chat.nativeSetupApiKeyRequired"));return}try{await o.mutateAsync({name:d.trim(),provider:c.provider,baseUrl:f.trim(),model:p.trim(),apiKey:v.trim()}),Je.success(i("chat.nativeSetupSaved")),x(""),n(!1),r?.()}catch(C){Je.error(C?.message??String(C))}}return y.jsx(Y_,{open:e,onOpenChange:n,children:y.jsxs(nm,{className:"sm:max-w-2xl",children:[y.jsxs(rm,{children:[y.jsx(om,{children:i("chat.nativeSetupDialogTitle")}),y.jsx(am,{children:i("chat.nativeSetupDialogDesc")})]}),y.jsxs("form",{className:"space-y-4",onSubmit:P=>void E(P),children:[t&&y.jsxs("div",{className:"rounded-md border border-warning/50 bg-warning-bg/40 p-3 text-xs text-warning",children:[y.jsx("div",{className:"mb-1 font-medium",children:i("chat.nativeSetupDialogReason")}),y.jsx("div",{className:"break-words",children:t})]}),y.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[y.jsxs("div",{children:[y.jsx(zn,{className:"text-xs font-medium",children:i("llm.preset",{ns:"settings"})}),y.jsxs(vo,{value:s,onValueChange:P=>w(P),children:[y.jsx(pi,{children:y.jsx(xo,{})}),y.jsx(mi,{children:Gi.map(P=>y.jsx(bn,{value:P.key,children:i(`llm.presets.${P.key}`,{ns:"settings"})},P.key))})]})]}),y.jsxs("div",{children:[y.jsx(zn,{className:"text-xs font-medium",children:i("llm.name",{ns:"settings"})}),y.jsx(gr,{value:d,onChange:P=>h(P.target.value),placeholder:i("llm.namePlaceholder",{ns:"settings"}),className:"font-mono text-xs"})]}),y.jsxs("div",{className:"sm:col-span-2",children:[y.jsx(zn,{className:"text-xs font-medium",children:i("llm.baseUrl",{ns:"settings"})}),y.jsx(gr,{value:f,onChange:P=>m(P.target.value),placeholder:i("llm.baseUrlPlaceholder",{ns:"settings"}),className:"font-mono text-xs"})]}),y.jsxs("div",{children:[y.jsx(zn,{className:"text-xs font-medium",children:i("llm.model",{ns:"settings"})}),y.jsx(gr,{value:p,onChange:P=>b(P.target.value),placeholder:i("llm.modelPlaceholder",{ns:"settings"}),className:"font-mono text-xs"})]}),y.jsxs("div",{children:[y.jsx(zn,{className:"text-xs font-medium",children:i("llm.apiKey",{ns:"settings"})}),y.jsx(gr,{type:"password",value:v,onChange:P=>x(P.target.value),placeholder:i("llm.apiKeyPlaceholder",{ns:"settings"}),className:"font-mono text-xs",autoComplete:"off"})]})]}),y.jsx("p",{className:"text-xs text-text-dim",children:i("chat.nativeSetupDialogRoleOptional")}),y.jsxs(im,{children:[y.jsx(et,{type:"button",variant:"ghost",onClick:()=>window.location.assign("/settings/llm"),children:i("chat.nativeSetupDialogAdvanced")}),y.jsx(et,{type:"button",variant:"outline",onClick:()=>n(!1),children:i("chat.nativeSetupDialogCancel")}),y.jsx(et,{type:"submit",disabled:o.isPending,children:i("chat.nativeSetupDialogSave")})]})]})]})})}const bs="agim-theme",sm="im-hub-lang";function Z_(){try{const e=localStorage.getItem(bs);if(e==="light"||e==="dark")return e}catch{}return"system"}function eD(){try{const t=localStorage.getItem(sm);if(t==="en"||t==="zh")return t}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function md(e){try{e==="system"?localStorage.removeItem(bs):localStorage.setItem(bs,e)}catch{}}function tD(e){try{localStorage.setItem(sm,e)}catch{}}const yr=jd((e,t)=>({theme:Z_(),lang:eD(),setTheme:n=>{md(n),e({theme:n})},cycleTheme:()=>{const n=t().theme,r=n==="system"?"light":n==="light"?"dark":"system";md(r),e({theme:r})},setLang:n=>{tD(n),e({lang:n})}}));function gd(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}function nD(){const e=yr(t=>t.theme);g.useEffect(()=>{if(gd(e),e!=="system")return;const t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>gd(e);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[e])}function rD(){const{t:e}=at(),t=yr(o=>o.theme),n=yr(o=>o.lang),r=yr(o=>o.setTheme),i=yr(o=>o.setLang);return y.jsxs(y.Fragment,{children:[y.jsxs(vo,{value:n,onValueChange:o=>i(o),children:[y.jsx(pi,{className:"h-7 w-16 sm:w-20 text-xs","aria-label":e("lang.label"),children:y.jsx(xo,{})}),y.jsxs(mi,{children:[y.jsx(bn,{value:"en",children:e("lang.en")}),y.jsx(bn,{value:"zh",children:e("lang.zh")})]})]}),y.jsxs(vo,{value:t,onValueChange:o=>r(o),children:[y.jsx(pi,{className:"h-7 w-16 text-xs sm:w-28","aria-label":e("theme.label"),children:y.jsx(xo,{})}),y.jsxs(mi,{children:[y.jsx(bn,{value:"system",children:y.jsxs("span",{className:"inline-flex items-center gap-2",children:[y.jsx($y,{className:"h-4 w-4"})," ",e("theme.system")]})}),y.jsx(bn,{value:"light",children:y.jsxs("span",{className:"inline-flex items-center gap-2",children:[y.jsx(Yy,{className:"h-4 w-4"})," ",e("theme.light")]})}),y.jsx(bn,{value:"dark",children:y.jsxs("span",{className:"inline-flex items-center gap-2",children:[y.jsx(Wy,{className:"h-4 w-4"})," ",e("theme.dark")]})})]})]})]})}function iD(e){const[t,n]=g.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return g.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),i=o=>n(o.matches);return n(r.matches),r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[e]),t}function oD(){return iD("(min-width: 640px)")}const aD=[{to:"/",i18nKey:"nav.chat",mounted:!0},{to:"/tasks",i18nKey:"nav.tasks",mounted:!0},{to:"/approvals",i18nKey:"nav.approvals",mounted:!0},{to:"/reminders",i18nKey:"nav.reminders",mounted:!0},{to:"/memos",i18nKey:"nav.memos",mounted:!0},{to:"/memory",i18nKey:"nav.memory",mounted:!0},{to:"/workspace",i18nKey:"nav.workspace",mounted:!0},{to:"/observability",i18nKey:"nav.observability",mounted:!0},{to:"/settings",i18nKey:"nav.settings",mounted:!0}];function lm({children:e}){const{t}=at(),n=oD(),r=y.jsx("nav",{className:ve("flex flex-1 min-w-0 items-center gap-1","overflow-x-auto scrollbar-thin","[&::-webkit-scrollbar]:h-1 [&::-webkit-scrollbar-thumb]:bg-border"),"aria-label":t("appName"),children:aD.filter(i=>i.mounted).map(i=>y.jsx(Xl,{to:i.to,end:i.to==="/",className:({isActive:o})=>ve("shrink-0 rounded-md px-2.5 py-1.5 text-sm no-underline","transition-colors tap-target",o?"bg-accent-bg text-accent font-medium":"text-text-dim hover:bg-surface-hover hover:text-text"),children:t(i.i18nKey)},i.to))});return y.jsxs("header",{className:ve("sticky top-0 z-20","flex flex-col sm:flex-row sm:items-center sm:gap-3","border-b border-border bg-surface","pt-safe","shadow-sm"),children:[y.jsxs("div",{className:ve("flex items-center gap-2 sm:gap-3","overflow-x-hidden","px-3 sm:px-4 py-2 sm:py-2","sm:flex-1 sm:min-w-0"),children:[y.jsxs(Xl,{to:"/",className:"flex shrink-0 items-center gap-1 text-md font-semibold no-underline",end:!0,children:[y.jsx("span",{"aria-hidden":"true",children:"🤖"}),y.jsx("span",{className:"hidden sm:inline",children:t("appName")})]}),n&&y.jsx("div",{className:"flex flex-1 min-w-0",children:r}),e&&y.jsx("div",{className:"flex items-center gap-2",children:e}),y.jsx("div",{className:"flex shrink-0 items-center gap-2",children:y.jsx(rD,{})})]}),!n&&y.jsx("div",{className:"border-t border-border px-3 py-1",children:r})]})}const sD={open:"bg-success",connecting:"bg-warning animate-pulse",closed:"bg-text-muted",error:"bg-danger"};function lD(){const{t:e}=at(),{state:t,send:n,switchAgent:r,approvalClick:i,choiceSubmit:o,newConversation:a,clearError:s}=TC(),[l,c]=g.useState(""),[u,d]=g.useState(!1),[h,f]=g.useState(""),m=g.useRef(null),p=g.useRef(null),b=e(`chat.status.${t.status}`,{defaultValue:t.status});g.useEffect(()=>{if(!m.current)return;const w=m.current;!(w.scrollHeight-w.scrollTop-w.clientHeight<200)&&t.currentReplyId==null||requestAnimationFrame(()=>{w.scrollTop=w.scrollHeight})},[t.messages,t.currentReplyId]),g.useEffect(()=>{t.error&&(H_(t.error)?(f(t.error),d(!0)):Je.error(t.error),s())},[t.error,s]);function v(w){w?.preventDefault();const E=l.trim();if(E){if(t.status!=="open"){Je.error(e("chat.notConnected",{defaultValue:"Not connected. Reconnecting…"}));return}n(E),c(""),requestAnimationFrame(()=>p.current?.focus())}}function x(w){w.nativeEvent.isComposing||w.keyCode===229||w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),v())}return y.jsxs("div",{className:"flex h-dvh flex-col bg-bg",children:[y.jsxs(lm,{children:[y.jsx("span",{className:ve("inline-block h-2 w-2 rounded-full",sD[t.status]),title:b}),y.jsx("span",{className:"hidden text-xs text-text-dim sm:inline",children:b}),y.jsxs(et,{variant:"ghost",size:"sm",onClick:()=>{a(),Je.success(e("chat.newConvToast",{defaultValue:"Started a new conversation"})),requestAnimationFrame(()=>p.current?.focus())},disabled:t.status!=="open",title:e("chat.newConvHint",{defaultValue:"Clear messages and start a fresh session"}),"aria-label":e("chat.newConv",{defaultValue:"New conversation"}),children:[y.jsx(Ky,{className:"h-4 w-4"}),y.jsx("span",{className:"hidden text-xs sm:inline",children:e("chat.newConv",{defaultValue:"New"})})]}),y.jsx(U_,{agents:t.agents,value:t.agent,onChange:r})]}),y.jsx(J_,{open:u,reason:h,onOpenChange:d,onConfigured:()=>r("agim")}),y.jsx("div",{ref:m,className:"flex-1 overflow-y-auto",children:y.jsxs("div",{className:"mx-auto flex max-w-3xl flex-col gap-2 px-3 py-3 sm:px-4",children:[t.messages.length===0&&t.status==="open"&&y.jsxs("div",{className:"flex flex-col items-center gap-2 py-16 text-center",children:[y.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-2xl",children:"💬"}),y.jsx("h2",{className:"text-base font-semibold",children:e("chat.welcomeTitle",{defaultValue:"Start a conversation"})}),y.jsx("p",{className:"max-w-md text-sm text-text-dim",children:e("chat.welcomeBody",{defaultValue:"Type a message to ask the active agent. Use the agent dropdown to switch."})})]}),t.messages.length===0&&t.status!=="open"&&y.jsxs("div",{className:"grid place-items-center py-16 text-center",children:[y.jsx(Hy,{className:"h-10 w-10 text-text-muted"}),y.jsx("p",{className:"mt-3 text-sm text-text-dim",children:t.status==="connecting"?e("chat.connecting",{defaultValue:"Connecting to agim…"}):e("chat.disconnected",{defaultValue:"Disconnected. Reconnecting automatically; you can keep typing."})})]}),t.messages.filter(w=>!w.approval).map(w=>y.jsx(AL,{msg:w,onApprove:(E,P,C)=>i(E,P,C)},w.id))]})}),y.jsx(PL,{approvals:t.pendingApprovals,onApprove:(w,E,P)=>i(w,E,P)}),y.jsx(NL,{asks:t.pendingAsks,onSubmit:(w,E)=>o(w,E)}),y.jsxs("form",{onSubmit:v,className:"sticky bottom-0 border-t border-border bg-surface px-4 py-2 pb-safe sm:px-6",children:[y.jsxs("div",{className:"mx-auto flex max-w-3xl items-end gap-2",children:[y.jsx("textarea",{ref:p,value:l,onChange:w=>c(w.target.value),onKeyDown:x,placeholder:e("chat.inputPlaceholder",{defaultValue:"Message… (Enter sends, Shift+Enter newlines)"}),rows:1,className:ve("flex-1 resize-none rounded-md border border-border bg-bg","px-3 py-1.5 text-sm leading-5","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","max-h-32 min-h-8")}),y.jsx(et,{type:"submit",disabled:!l.trim()||t.status!=="open","aria-label":e("chat.send",{defaultValue:"Send"}),className:"h-8 w-8 p-0",children:y.jsx(Qy,{className:"h-4 w-4"})})]}),t.currentReplyId&&y.jsx("div",{className:"mx-auto mt-2 flex max-w-3xl items-center gap-2",children:y.jsx(it,{variant:"info",children:e("chat.streaming",{defaultValue:"… streaming"})})})]})]})}function cD(){const{t:e}=at(),t=un();return y.jsxs("div",{className:"flex min-h-dvh flex-col bg-bg",children:[y.jsx(lm,{}),y.jsx("main",{className:"grid flex-1 place-items-center px-4 py-8 pb-safe",children:y.jsxs("div",{className:"flex max-w-md flex-col items-center gap-3 text-center",children:[y.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-text-dim",children:y.jsx(By,{className:"h-6 w-6"})}),y.jsx("div",{className:"text-6xl font-bold tracking-tight text-text-muted",children:"404"}),y.jsx("h1",{className:"text-xl font-semibold",children:e("notFound.title",{defaultValue:"Nothing here."})}),y.jsx("p",{className:"text-sm text-text-dim",children:e("notFound.description",{defaultValue:"The page you're looking for doesn't exist."})}),y.jsx("code",{className:"rounded bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.pathname}),y.jsx(et,{asChild:!0,className:"mt-2",children:y.jsx(Es,{to:"/",children:e("actions.back")})})]})})]})}function nn(e){return async()=>{const n=(await e()).default;return{element:y.jsx(Fd,{children:y.jsx(n,{})})}}}function Ee(e){return async()=>{const n=(await e()).default;return{element:y.jsx(n,{})}}}const uD=Xg([{path:"/login",element:y.jsx(dx,{})},{path:"/",element:y.jsx(Fd,{children:y.jsx(lD,{})})},{path:"/tasks",lazy:nn(()=>fe(()=>import("./layout-Cxch59sI.js"),__vite__mapDeps([2,1]))),children:[{index:!0,element:y.jsx(Ot,{to:"jobs",replace:!0})},{path:"jobs",lazy:Ee(()=>fe(()=>import("./jobs-CtVRpl0r.js"),__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])))},{path:"subtasks",lazy:Ee(()=>fe(()=>import("./subtasks-DFiAXvDp.js"),__vite__mapDeps([19,1,4,5,6,7,8,9,14,15,16])))},{path:"bgjobs",lazy:Ee(()=>fe(()=>import("./bgjobs-BYCQhd_1.js"),__vite__mapDeps([20,1,4,5,6,7,8,9,15,16])))},{path:"schedules",lazy:Ee(()=>fe(()=>import("./schedules-BddzBrxI.js"),__vite__mapDeps([21,1,4,5,6,7,8,15,16])))},{path:"outbox",lazy:Ee(()=>fe(()=>import("./outbox-CmN0U35l.js"),__vite__mapDeps([22,1,4,5,6,7,8,9,13,15,16])))},{path:"a2a",lazy:Ee(()=>fe(()=>import("./a2a-CZxwvgvh.js"),__vite__mapDeps([23,1,4,5,6,7,8,9,14,15,16])))},{path:"heartbeat",lazy:Ee(()=>fe(()=>import("./heartbeat-B1BEBHge.js"),__vite__mapDeps([24,1,5,25,26,15,16,27])))},{path:"goals",lazy:Ee(()=>fe(()=>import("./goals-B9ETHgL0.js"),__vite__mapDeps([28,1,5,25,15,16,29,17])))},{path:"asks",lazy:Ee(()=>fe(()=>import("./asks-DyUQopay.js"),__vite__mapDeps([30,5,1,25,15,16,17])))},{path:"plans",lazy:Ee(()=>fe(()=>import("./plans-Bzbk8eUr.js"),__vite__mapDeps([31,1,5,25,15,16,12,32,17,29])))}]},{path:"/approvals",lazy:nn(()=>fe(()=>import("./approvals-DnzjbDR6.js"),__vite__mapDeps([33,1,6,14,15,16])))},{path:"/reminders",lazy:nn(()=>fe(()=>import("./reminders-BDeiVYTC.js"),__vite__mapDeps([34,1,4,5,6,7,8,9,13,32,15,16,35])))},{path:"/memos",lazy:nn(()=>fe(()=>import("./memos-DQZc7llR.js"),__vite__mapDeps([36,1,4,5,6,7,8,13,12,37,16,38,39])))},{path:"/memory",lazy:nn(()=>fe(()=>import("./layout-BTCLgkgN.js"),__vite__mapDeps([40,41,1]))),children:[{index:!0,element:y.jsx(Ot,{to:"facts",replace:!0})},{path:"facts",lazy:Ee(()=>fe(()=>import("./facts-DMucDXYd.js"),__vite__mapDeps([42,1,4,5,6,7,8,10,11,12,13,41,37,43,15,16,38])))},{path:"persona",lazy:Ee(()=>fe(()=>import("./persona-ig2ac4mY.js"),__vite__mapDeps([44,1,6,13,41,43,15,16,27,45,17,37])))},{path:"distill",lazy:Ee(()=>fe(()=>import("./distill-D9p8O8Jf.js"),__vite__mapDeps([46,1,47,15,48,41,16,27])))},{path:"vector",lazy:Ee(()=>fe(()=>import("./vector-BfIEx8xX.js"),__vite__mapDeps([49,1,47,41,15,48,50,13,6,17,16,27,51,37,45])))},{path:"skills",element:y.jsx(Ot,{to:"/settings/agim-skills/installed",replace:!0})}]},{path:"/skills",children:[{index:!0,element:y.jsx(Ot,{to:"/settings/agim-skills/installed",replace:!0})},{path:"installed",element:y.jsx(Ot,{to:"/settings/agim-skills/installed",replace:!0})},{path:"hot",element:y.jsx(Ot,{to:"/settings/agim-skills/hot",replace:!0})}]},{path:"/workspace",lazy:nn(()=>fe(()=>import("./workspace-BbCchiHE.js"),__vite__mapDeps([52,1,6,53,15,16])))},{path:"/observability",lazy:nn(()=>fe(()=>import("./layout-CtDc2i7w.js"),__vite__mapDeps([54,1]))),children:[{index:!0,element:y.jsx(Ot,{to:"health",replace:!0})},{path:"health",lazy:Ee(()=>fe(()=>import("./health-DLzZ7KHc.js"),__vite__mapDeps([55,1,6,5,56,15,16,57])))},{path:"topn",lazy:Ee(()=>fe(()=>import("./topn-C2PHE4tX.js"),__vite__mapDeps([58,6,5,1,56,15,16])))},{path:"audit",lazy:Ee(()=>fe(()=>import("./audit-BVHTMS82.js"),__vite__mapDeps([59,1,4,5,6,7,8,56,15,16,57])))}]},{path:"/settings",lazy:nn(()=>fe(()=>import("./layout-DnANw2Q2.js"),__vite__mapDeps([60,1]))),children:[{index:!0,element:y.jsx(Ot,{to:"messengers",replace:!0})},{path:"messengers",lazy:Ee(()=>fe(()=>import("./messengers-DwSmauLs.js"),__vite__mapDeps([61,1,47,15,16,48,62])))},{path:"email",lazy:Ee(()=>fe(()=>import("./email-Douv-rZ5.js"),__vite__mapDeps([63,1,47,15,17,29,16,50,48])))},{path:"viewer",lazy:Ee(()=>fe(()=>import("./viewer-BPMZkT05.js"),__vite__mapDeps([64,1,47,50,15,16,29,65,48,39])))},{path:"agents",lazy:Ee(()=>fe(()=>import("./agents-CFB4Uj6b.js"),__vite__mapDeps([66,1,6,53,47,15,16,48,67,38,68,37])))},{path:"policy",lazy:Ee(()=>fe(()=>import("./policy-yD1c2Pcn.js"),__vite__mapDeps([69,47,15,16,1])))},{path:"security",lazy:Ee(()=>fe(()=>import("./security-DpOGp3nS.js"),__vite__mapDeps([70,1,47,15,16,71,29])))},{path:"service",lazy:Ee(()=>fe(()=>import("./service-BsY8CaNG.js"),__vite__mapDeps([72,1,13,47,15,16,27,67,48])))},{path:"admins",lazy:Ee(()=>fe(()=>import("./admins-CH84Rw1d.js"),__vite__mapDeps([73,1,13,6,5,47,15,16,37])))},{path:"workspaces",lazy:Ee(()=>fe(()=>import("./workspaces-5HE7pjdA.js"),__vite__mapDeps([74,1,6,5,47,15,16,18,48])))},{path:"llm",lazy:Ee(()=>fe(()=>import("./llm-CMMa85Ig.js"),__vite__mapDeps([75,1,5,47,15,16,48,67,71,35,26,37,68])))},{path:"mcp",lazy:Ee(()=>fe(()=>import("./mcp-DhnXhO9B.js"),__vite__mapDeps([76,1,5,15,16,57,37,68])))},{path:"native-agent",element:y.jsx(Ot,{to:"/settings/llm",replace:!0})},{path:"search",lazy:Ee(()=>fe(()=>import("./search-B8PlbtLg.js"),__vite__mapDeps([77,1,47,15,16,48,7,8,29,17])))},{path:"mobile",lazy:Ee(()=>fe(()=>import("./mobile-CUZ359rQ.js"),__vite__mapDeps([78,1,15,16,62,50,79,71])))},{path:"agim-skills",lazy:Ee(()=>fe(()=>import("./layout-yIZG87fq.js"),__vite__mapDeps([80,1]))),children:[{index:!0,element:y.jsx(Ot,{to:"installed",replace:!0})},{path:"installed",lazy:Ee(()=>fe(()=>import("./installed-Zz34apdi.js"),__vite__mapDeps([81,1,82,15,16,38,12,37,48])))},{path:"hot",lazy:Ee(()=>fe(()=>import("./hot-Yc7iad0D.js"),__vite__mapDeps([83,1,6,65,15,16,38,51,79])))},{path:"injection",lazy:Ee(()=>fe(()=>import("./injection-Ca-9gbo0.js"),__vite__mapDeps([84,1,82,15,16,79,48,37])))}]}]},{path:"/m/chat",lazy:nn(()=>fe(()=>import("./chat-DPkKy5y_.js"),__vite__mapDeps([85,1,11,8,15,57])))},{path:"*",element:y.jsx(cD,{})}]);function dD(){return y.jsx($b,{children:y.jsx(oy,{router:uD})})}const fD=new gv({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1,retryDelay:e=>Math.min(1e3*2**e,8e3),refetchOnWindowFocus:!1,refetchOnReconnect:!0},mutations:{retry:0}}});var[Go]=xi("Tooltip",[Ho]),Rl=Ho(),cm="TooltipProvider",hD=700,yd="tooltip.open",[pD,um]=Go(cm),dm=e=>{const{__scopeTooltip:t,delayDuration:n=hD,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=g.useRef(!0),s=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),y.jsx(pD,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(l.current),a.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:g.useCallback(c=>{s.current=c},[]),disableHoverableContent:i,children:o})};dm.displayName=cm;var fm="Tooltip",[qD,Yo]=Go(fm),vs="TooltipTrigger",mD=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Yo(vs,n),o=um(vs,n),a=Rl(n),s=g.useRef(null),l=$e(t,s,i.onTriggerChange),c=g.useRef(!1),u=g.useRef(!1),d=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),y.jsx(ip,{asChild:!0,...a,children:y.jsx(De.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Oe(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Oe(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Oe(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Oe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Oe(e.onBlur,i.onClose),onClick:Oe(e.onClick,i.onClose)})})});mD.displayName=vs;var gD="TooltipPortal",[QD,yD]=Go(gD,{forceMount:void 0}),Tr="TooltipContent",hm=g.forwardRef((e,t)=>{const n=yD(Tr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=Yo(Tr,e.__scopeTooltip);return y.jsx(jr,{present:r||a.open,children:a.disableHoverableContent?y.jsx(pm,{side:i,...o,ref:t}):y.jsx(bD,{side:i,...o,ref:t})})}),bD=g.forwardRef((e,t)=>{const n=Yo(Tr,e.__scopeTooltip),r=um(Tr,e.__scopeTooltip),i=g.useRef(null),o=$e(t,i),[a,s]=g.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,h=g.useCallback(()=>{s(null),d(!1)},[d]),f=g.useCallback((m,p)=>{const b=m.currentTarget,v={x:m.clientX,y:m.clientY},x=SD(v,b.getBoundingClientRect()),w=AD(v,x),E=CD(p.getBoundingClientRect()),P=RD([...w,...E]);s(P),d(!0)},[d]);return g.useEffect(()=>()=>h(),[h]),g.useEffect(()=>{if(l&&u){const m=b=>f(b,u),p=b=>f(b,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",p)}}},[l,u,f,h]),g.useEffect(()=>{if(a){const m=p=>{const b=p.target,v={x:p.clientX,y:p.clientY},x=l?.contains(b)||u?.contains(b),w=!ED(v,a);x?h():w&&(h(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,a,c,h]),y.jsx(pm,{...e,ref:o})}),[vD,xD]=Go(fm,{isInside:!1}),wD=tb("TooltipContent"),pm=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=Yo(Tr,n),c=Rl(n),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(yd,u),()=>document.removeEventListener(yd,u)),[u]),g.useEffect(()=>{if(l.trigger){const d=h=>{h.target instanceof Node&&h.target.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),y.jsx(Do,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:y.jsxs(op,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[y.jsx(wD,{children:r}),y.jsx(vD,{scope:n,isInside:!0,children:y.jsx(TN,{id:l.contentId,role:"tooltip",children:i||r})})]})})});hm.displayName=Tr;var mm="TooltipArrow",kD=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Rl(n);return xD(mm,n).isInside?null:y.jsx(ap,{...i,...r,ref:t})});kD.displayName=mm;function SD(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function AD(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function CD(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ED(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const s=t[o],l=t[a],c=s.x,u=s.y,d=l.x,h=l.y;u>r!=h>r&&n<(d-c)*(r-u)/(h-u)+c&&(i=!i)}return i}function RD(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),TD(t)}function TD(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var PD=dm,gm=hm;const ID=PD,LD=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>y.jsx(gm,{ref:r,sideOffset:t,className:ve("z-50 overflow-hidden rounded-md","bg-text text-bg px-2 py-1 text-xs font-medium shadow-md","data-[state=delayed-open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=delayed-open]:zoom-in-95",e),...n}));LD.displayName=gm.displayName;function OD(e){return y.jsx(tx,{position:"top-center",richColors:!0,closeButton:!0,toastOptions:{classNames:{toast:"border border-border bg-surface text-text shadow-md",title:"font-medium",description:"text-text-dim text-sm",actionButton:"bg-accent text-accent-fg rounded-md",cancelButton:"bg-surface-2 text-text rounded-md",error:"bg-danger-bg text-danger border-danger",success:"bg-success-bg text-success border-success",warning:"bg-warning-bg text-warning border-warning",info:"bg-info-bg text-info border-info"}},...e})}function ND({children:e}){const t=yr(r=>r.lang),{i18n:n}=at();return g.useEffect(()=>{n.language!==t&&SC(t)},[t,n]),y.jsx(y.Fragment,{children:e})}function _D({children:e}){return nD(),y.jsx(y.Fragment,{children:e})}function DD({children:e}){return g.useEffect(()=>by(),[]),y.jsx(y.Fragment,{children:e})}function MD({children:e}){return y.jsx(yv,{client:fD,children:y.jsx(ND,{children:y.jsx(_D,{children:y.jsx(DD,{children:y.jsxs(ID,{children:[e,y.jsx(OD,{})]})})})})})}const ym=document.getElementById("root");if(!ym)throw new Error("agim: #root not found in index.html");Pa.createRoot(ym).render(y.jsx(W.StrictMode,{children:y.jsx(MD,{children:y.jsx(dD,{})})}));export{fl as $,jL as A,et as B,$d as C,Y_ as D,vr as E,Oe as F,$e as G,UL as H,gr as I,fs as J,Zn as K,zn as L,yN as M,Xl as N,FD as O,De as P,ip as Q,qy as R,vo as S,lm as T,Ho as U,jr as V,dl as W,Jy as X,up as Y,sx as Z,Mh as _,En as a,tl as a0,Do as a1,op as a2,Sr as a3,ap as a4,Zy as a5,B_ as a6,BD as a7,Ki as a8,Wa as a9,Uy as aa,Qy as ab,HD as ac,zD as ad,z_ as ae,$D as af,KD as ag,WD as ah,VD as ai,TC as aj,H_ as ak,J_ as al,AL as am,PL as an,U_ as ao,cf as b,ve as c,ix as d,Rn as e,fy as f,pi as g,xo as h,mi as i,y as j,bn as k,it as l,Je as m,ox as n,ct as o,K as p,Xy as q,Fy as r,Gy as s,nm as t,at as u,rm as v,om as w,am as x,im as y,xi as z};
|
|
209
|
-
//# sourceMappingURL=index-DY2Zglku.js.map
|