omniroute 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ar.md +4 -3
- package/README.bg.md +4 -3
- package/README.da.md +4 -2
- package/README.de.md +3 -2
- package/README.es.md +1 -0
- package/README.fi.md +1 -0
- package/README.fr.md +1 -0
- package/README.he.md +9 -8
- package/README.hu.md +1 -0
- package/README.id.md +1 -0
- package/README.in.md +9 -8
- package/README.it.md +1 -0
- package/README.ja.md +3 -0
- package/README.ko.md +9 -8
- package/README.md +17 -16
- package/README.ms.md +9 -8
- package/README.nl.md +9 -8
- package/README.no.md +1 -0
- package/README.phi.md +2 -1
- package/README.pl.md +9 -8
- package/README.pt-BR.md +3 -2
- package/README.pt.md +1 -0
- package/README.ro.md +2 -0
- package/README.ru.md +1 -0
- package/README.sk.md +1 -0
- package/README.sv.md +1 -0
- package/README.th.md +1 -0
- package/README.uk-UA.md +1 -0
- package/README.vi.md +1 -0
- package/README.zh-CN.md +10 -9
- package/app/.env +122 -0
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +54 -54
- package/app/.next/build-manifest.json +3 -3
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/required-server-files.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/a2a/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/a2a/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/a2a/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/costs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mcp/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/mcp/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mcp/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/media/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/.well-known/agent.json/route.js +1 -1
- package/app/.next/server/app/.well-known/agent.json/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/400/page.js +2 -2
- package/app/.next/server/app/400/page.js.nft.json +1 -1
- package/app/.next/server/app/400/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/401/page.js +2 -2
- package/app/.next/server/app/401/page.js.nft.json +1 -1
- package/app/.next/server/app/401/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/403/page.js +2 -2
- package/app/.next/server/app/403/page.js.nft.json +1 -1
- package/app/.next/server/app/403/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/408/page.js +2 -2
- package/app/.next/server/app/408/page.js.nft.json +1 -1
- package/app/.next/server/app/408/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/429/page.js +2 -2
- package/app/.next/server/app/429/page.js.nft.json +1 -1
- package/app/.next/server/app/429/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/500/page.js +2 -2
- package/app/.next/server/app/500/page.js.nft.json +1 -1
- package/app/.next/server/app/500/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/502/page.js +2 -2
- package/app/.next/server/app/502/page.js.nft.json +1 -1
- package/app/.next/server/app/502/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/503/page.js +2 -2
- package/app/.next/server/app/503/page.js.nft.json +1 -1
- package/app/.next/server/app/503/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error/page.js +3 -3
- package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +2 -2
- package/app/.next/server/app/_global-error.rsc +5 -5
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js +2 -2
- package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/a2a/route.js +2 -2
- package/app/.next/server/app/a2a/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/a2a/status/route.js +1 -1
- package/app/.next/server/app/api/a2a/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/a2a/tasks/[id]/cancel/route.js +1 -1
- package/app/.next/server/app/api/a2a/tasks/[id]/cancel/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/a2a/tasks/[id]/route.js +1 -1
- package/app/.next/server/app/api/a2a/tasks/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/a2a/tasks/route.js +1 -1
- package/app/.next/server/app/api/a2a/tasks/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/login/route.js +1 -1
- package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/logout/route.js +1 -1
- package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/status/route.js +1 -1
- package/app/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cache/route.js +1 -1
- package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cache/stats/route.js +1 -1
- package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +3 -3
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/backups/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/backups/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-profiles/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw/auto-order/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw/auto-order/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/status/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/auto/route.js +1 -1
- package/app/.next/server/app/api/combos/auto/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/metrics/route.js +1 -1
- package/app/.next/server/app/api/combos/metrics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/route.js +1 -1
- package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/test/route.js +1 -1
- package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/compliance/audit-log/route.js +1 -1
- package/app/.next/server/app/api/compliance/audit-log/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/export/route.js +1 -1
- package/app/.next/server/app/api/db-backups/export/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/exportAll/route.js +1 -1
- package/app/.next/server/app/api/db-backups/exportAll/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/import/route.js +1 -1
- package/app/.next/server/app/api/db-backups/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/route.js +1 -1
- package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/[suiteId]/route.js +1 -1
- package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/route.js +1 -1
- package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/fallback/chains/route.js +2 -2
- package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/init/route.js +1 -1
- package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/route.js +1 -1
- package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/logs/console/route.js +1 -1
- package/app/.next/server/app/api/logs/console/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/audit/route.js +2 -2
- package/app/.next/server/app/api/mcp/audit/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/audit/stats/route.js +2 -2
- package/app/.next/server/app/api/mcp/audit/stats/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/sse/route.js +1 -1
- package/app/.next/server/app/api/mcp/sse/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/status/route.js +1 -1
- package/app/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/stream/route.js +1 -1
- package/app/.next/server/app/api/mcp/stream/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/tools/route.js +1 -1
- package/app/.next/server/app/api/mcp/tools/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/alias/route.js +1 -1
- package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/availability/route.js +1 -1
- package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/catalog/route.js +2 -2
- package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/route.js +2 -2
- package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/monitoring/health/route.js +2 -2
- package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
- package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/policies/route.js +2 -2
- package/app/.next/server/app/api/policies/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/defaults/route.js +1 -1
- package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/models/route.js +1 -1
- package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/route.js +1 -1
- package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-metrics/route.js +2 -2
- package/app/.next/server/app/api/provider-metrics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-models/route.js +1 -1
- package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route.js +2 -2
- package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route.js +2 -2
- package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/client/route.js +1 -1
- package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/route.js +2 -2
- package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/validate/route.js +1 -1
- package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limit/route.js +1 -1
- package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limits/route.js +1 -1
- package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/reset/route.js +1 -1
- package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/route.js +1 -1
- package/app/.next/server/app/api/resilience/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/restart/route.js +1 -1
- package/app/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sessions/route.js +1 -1
- package/app/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/background-degradation/route.js +1 -1
- package/app/.next/server/app/api/settings/background-degradation/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/combo-defaults/route.js +1 -1
- package/app/.next/server/app/api/settings/combo-defaults/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/ip-filter/route.js +1 -1
- package/app/.next/server/app/api/settings/ip-filter/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/model-aliases/route.js +1 -1
- package/app/.next/server/app/api/settings/model-aliases/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/proxy/route.js +1 -1
- package/app/.next/server/app/api/settings/proxy/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/proxy/test/route.js +1 -1
- package/app/.next/server/app/api/settings/proxy/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/route.js +1 -1
- package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route.js +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/thinking-budget/route.js +1 -1
- package/app/.next/server/app/api/settings/thinking-budget/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/shutdown/route.js +1 -1
- package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/storage/health/route.js +1 -1
- package/app/.next/server/app/api/storage/health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tags/route.js +1 -1
- package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/telemetry/summary/route.js +1 -1
- package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/token-health/route.js +1 -1
- package/app/.next/server/app/api/token-health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/detect/route.js +1 -1
- package/app/.next/server/app/api/translator/detect/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/history/route.js +1 -1
- package/app/.next/server/app/api/translator/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/load/route.js +1 -1
- package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/save/route.js +1 -1
- package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/send/route.js +1 -1
- package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/translate/route.js +1 -1
- package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js +2 -2
- package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/analytics/route.js +1 -1
- package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/budget/route.js +2 -2
- package/app/.next/server/app/api/usage/budget/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/[id]/route.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/history/route.js +1 -1
- package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/logs/route.js +1 -1
- package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/proxy-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/proxy-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/quota/route.js +1 -1
- package/app/.next/server/app/api/usage/quota/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/route.js +1 -1
- package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/moderations/route.js +1 -1
- package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/music/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/music/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/rerank/route.js +1 -1
- package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/route.js +1 -1
- package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/videos/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/videos/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route.js +2 -2
- package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback/page.js +2 -2
- package/app/.next/server/app/callback/page.js.nft.json +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/docs/page.js +4 -4
- package/app/.next/server/app/docs/page.js.nft.json +1 -1
- package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forbidden/page.js +2 -2
- package/app/.next/server/app/forbidden/page.js.nft.json +1 -1
- package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forgot-password/page.js +2 -2
- package/app/.next/server/app/forgot-password/page.js.nft.json +1 -1
- package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing/page.js +2 -2
- package/app/.next/server/app/landing/page.js.nft.json +1 -1
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login/page.js +2 -2
- package/app/.next/server/app/login/page.js.nft.json +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/maintenance/page.js +2 -2
- package/app/.next/server/app/maintenance/page.js.nft.json +1 -1
- package/app/.next/server/app/maintenance/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/offline/page.js +2 -2
- package/app/.next/server/app/offline/page.js.nft.json +1 -1
- package/app/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/page.js +2 -2
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/privacy/page.js +2 -2
- package/app/.next/server/app/privacy/page.js.nft.json +1 -1
- package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/status/page.js +2 -2
- package/app/.next/server/app/status/page.js.nft.json +1 -1
- package/app/.next/server/app/status/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/terms/page.js +2 -2
- package/app/.next/server/app/terms/page.js.nft.json +1 -1
- package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +54 -54
- package/app/.next/server/chunks/1033.js +1 -1
- package/app/.next/server/chunks/1909.js +2 -0
- package/app/.next/server/chunks/2180.js +1 -1
- package/app/.next/server/chunks/2901.js +1 -1
- package/app/.next/server/chunks/2910.js +1 -1
- package/app/.next/server/chunks/3498.js +1 -1
- package/app/.next/server/chunks/3969.js +1 -1
- package/app/.next/server/chunks/4488.js +1 -1
- package/app/.next/server/chunks/4631.js +2 -2
- package/app/.next/server/chunks/7109.js +1 -1
- package/app/.next/server/chunks/7167.js +1 -0
- package/app/.next/server/chunks/7669.js +1 -1
- package/app/.next/server/chunks/8020.js +3 -3
- package/app/.next/server/chunks/8369.js +1 -1
- package/app/.next/server/chunks/9548.js +1 -1
- package/app/.next/server/instrumentation.js +1 -1
- package/app/.next/server/middleware-build-manifest.js +1 -1
- package/app/.next/server/middleware.js +3 -3
- package/app/.next/server/next-font-manifest.js +1 -1
- package/app/.next/server/next-font-manifest.json +1 -1
- package/app/.next/server/pages/500.html +2 -2
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/{5846-c2071f4db5ecc3da.js → 5846-014698d5430bb218.js} +1 -1
- package/app/.next/static/chunks/{647-f42f77310d9d9936.js → 647-52d3e2e64d7de62e.js} +2 -2
- package/app/.next/static/chunks/app/(dashboard)/dashboard/a2a/page-ed1f5b1ae0e01c02.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/loading-6a2bb3ad980b05b9.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/{page-bef5c045e7eae657.js → page-6ab7701da3357bb9.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-027b3eb09d2d46e0.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-c9b98846b8479f3f.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/auto-combo/{page-8e609f4c9b26a901.js → page-851063ded34ab7a6.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-86acc32f9984a4e2.js +15 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-ac5dcffbe54f77f9.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/costs/{page-7a233357dfbd2e05.js → page-8f6233f59f5277e9.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-36f33de29eb978a1.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/health/{page-66ee4e631429e0d8.js → page-1e1eb2f79d606ab2.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-e8a28e4cf62889bd.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/logs/{page-6e4bcb48b8731915.js → page-95e4b5e0bf023d76.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/mcp/page-d9b5c3282ec5d809.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media/page-72b768421394b42c.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/onboarding/{page-d424641c7e428be9.js → page-5378e9473a20cd6a.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-40d20c1273f57206.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-350aed2e86512c23.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{error-0400f175dd1372fa.js → error-a5ae03ba05400b04.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/loading-7deaa9f550841465.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-3ef302da4b756e50.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{page-87f0d43ce6cca0cb.js → page-cd0feb6c545b8a49.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{error-c39d18f10fb7d3f6.js → error-ec9643134a96bbcd.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{loading-b5faf05c78a2cc54.js → loading-3519a633b514f31a.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{page-6b38a30bfddf3b89.js → page-cbaa4b638a583fe9.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/{page-a4b8b03ffb39da1d.js → page-69eb8b0eb0e9de00.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-b29f17c4dc7d449f.js → page-8cc93e616925f0a0.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-8c8f2d59d0cbb516.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/{layout-6d0afc53f5f2a538.js → layout-7ae0c66c22bee8a1.js} +1 -1
- package/app/.next/static/chunks/app/400/{page-3b77bf358909019a.js → page-3b9079ea400ca287.js} +1 -1
- package/app/.next/static/chunks/app/401/{page-3b77bf358909019a.js → page-3b9079ea400ca287.js} +1 -1
- package/app/.next/static/chunks/app/403/{page-3b77bf358909019a.js → page-3b9079ea400ca287.js} +1 -1
- package/app/.next/static/chunks/app/408/{page-3b77bf358909019a.js → page-3b9079ea400ca287.js} +1 -1
- package/app/.next/static/chunks/app/429/page-3b9079ea400ca287.js +1 -0
- package/app/.next/static/chunks/app/500/page-3b9079ea400ca287.js +1 -0
- package/app/.next/static/chunks/app/502/page-3b9079ea400ca287.js +1 -0
- package/app/.next/static/chunks/app/503/page-3b9079ea400ca287.js +1 -0
- package/app/.next/static/chunks/app/callback/{page-585a53f7dc6a30f1.js → page-0f0ebc0820dd18a5.js} +1 -1
- package/app/.next/static/chunks/app/docs/{page-9624e5fb8cabf7d8.js → page-dc88e0a01d291518.js} +1 -1
- package/app/.next/static/chunks/app/{error-f7f595c541537e63.js → error-32c03f14529d3920.js} +1 -1
- package/app/.next/static/chunks/app/forbidden/page-8d8e1709a1e32585.js +1 -0
- package/app/.next/static/chunks/app/forgot-password/page-d5c9b77748aa9deb.js +1 -0
- package/app/.next/static/chunks/app/global-error-5840b1caa830f2ec.js +1 -0
- package/app/.next/static/chunks/app/landing/page-75b0c988db383cfc.js +1 -0
- package/app/.next/static/chunks/app/{layout-108592eafb959363.js → layout-070972eb026af319.js} +1 -1
- package/app/.next/static/chunks/app/{loading-e063375d5b12a2f7.js → loading-da2f6e1471afc070.js} +1 -1
- package/app/.next/static/chunks/app/login/{page-cf6b82187b09a701.js → page-26d717c652d56032.js} +1 -1
- package/app/.next/static/chunks/app/maintenance/page-3b9079ea400ca287.js +1 -0
- package/app/.next/static/chunks/app/not-found-faf36d2a9a452506.js +1 -0
- package/app/.next/static/chunks/app/offline/page-bf68bf461af876a3.js +1 -0
- package/app/.next/static/chunks/app/privacy/{page-9624e5fb8cabf7d8.js → page-dc88e0a01d291518.js} +1 -1
- package/app/.next/static/chunks/app/status/page-29a433b40631ce12.js +1 -0
- package/app/.next/static/chunks/app/terms/{page-9624e5fb8cabf7d8.js → page-dc88e0a01d291518.js} +1 -1
- package/app/.next/static/chunks/{main-app-c9da11a8061df107.js → main-app-ae230f6bf51a5edb.js} +1 -1
- package/app/logs/application/app.log +1 -0
- package/app/package.json +1 -1
- package/app/server.js +1 -1
- package/package.json +1 -1
- package/app/.next/server/chunks/5248.js +0 -1
- package/app/.next/server/chunks/7889.js +0 -2
- package/app/.next/static/chunks/app/(dashboard)/dashboard/a2a/page-43d6fa6b75cca497.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/loading-49ae846d72948391.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-16f886b3711a6a50.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-e5bf8955e7b9a4f5.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-d1e5ed188e14c618.js +0 -15
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-8d4d2f071d114b90.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-7b1037d65eef97a8.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-d5e0c556e2b32478.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/mcp/page-8e35334b9f393139.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media/page-1d0ca9b5d3eaf7cd.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-d75ccdb976b36258.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-1abb3ea768844f2b.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/loading-9552383fd2e11282.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-d57908b59d4b482c.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-9e20463252daf023.js +0 -1
- package/app/.next/static/chunks/app/429/page-3b77bf358909019a.js +0 -1
- package/app/.next/static/chunks/app/500/page-3b77bf358909019a.js +0 -1
- package/app/.next/static/chunks/app/502/page-3b77bf358909019a.js +0 -1
- package/app/.next/static/chunks/app/503/page-3b77bf358909019a.js +0 -1
- package/app/.next/static/chunks/app/forbidden/page-b33079c1573b0bfa.js +0 -1
- package/app/.next/static/chunks/app/forgot-password/page-90cd6259c75badfc.js +0 -1
- package/app/.next/static/chunks/app/global-error-1dfd1c91ad5199fe.js +0 -1
- package/app/.next/static/chunks/app/landing/page-9d540ab1716f8e3e.js +0 -1
- package/app/.next/static/chunks/app/maintenance/page-3b77bf358909019a.js +0 -1
- package/app/.next/static/chunks/app/not-found-511518956bcae7bc.js +0 -1
- package/app/.next/static/chunks/app/offline/page-9d6ea493783a0219.js +0 -1
- package/app/.next/static/chunks/app/status/page-4e5e9b5a513aa474.js +0 -1
- /package/app/.next/static/{i4hXorUJfOXsVFs23YXiR → GDoUzLvy4YDqhnGqUCiZ0}/_buildManifest.js +0 -0
- /package/app/.next/static/{i4hXorUJfOXsVFs23YXiR → GDoUzLvy4YDqhnGqUCiZ0}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8992],{43072:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});var r=s(95155);function i({error:e,reset:t}){return(0,r.jsx)("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-6",role:"alert","aria-live":"assertive",children:(0,r.jsxs)("div",{className:"text-center space-y-4",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold text-red-600 dark:text-red-400",children:"Failed to load settings"}),(0,r.jsx)("p",{className:"text-text-muted max-w-md",children:"We could not load settings right now. Please retry in a few seconds."}),e?.digest&&(0,r.jsxs)("p",{className:"text-xs text-text-muted font-mono",children:["Error ID: ",e.digest]}),!1,(0,r.jsx)("button",{onClick:t,className:"px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary-hover transition-colors focus:outline-2 focus:outline-offset-2 focus:outline-primary",children:"Try Again"})]})})}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8992],{43072:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});var r=s(95155);function i({error:e,reset:t}){return(0,r.jsx)("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-6",role:"alert","aria-live":"assertive",children:(0,r.jsxs)("div",{className:"text-center space-y-4",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold text-red-600 dark:text-red-400",children:"Failed to load settings"}),(0,r.jsx)("p",{className:"text-text-muted max-w-md",children:"We could not load settings right now. Please retry in a few seconds."}),e?.digest&&(0,r.jsxs)("p",{className:"text-xs text-text-muted font-mono",children:["Error ID: ",e.digest]}),!1,(0,r.jsx)("button",{onClick:t,className:"px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary-hover transition-colors focus:outline-2 focus:outline-offset-2 focus:outline-primary",children:"Try Again"})]})})}},68919:(e,t,s)=>{Promise.resolve().then(s.bind(s,43072))}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=68919)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7502],{4858:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>i});var n=a(95155),r=a(92542);function i(){return(0,n.jsxs)("div",{className:"space-y-6 p-6",role:"status","aria-live":"polite","aria-busy":"true",children:[(0,n.jsx)(r.Skeleton,{className:"h-8 w-36"}),(0,n.jsx)("div",{className:"space-y-4",children:[0,1,2,3].map(e=>(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(r.Skeleton,{className:"h-4 w-24"}),(0,n.jsx)(r.Skeleton,{className:"h-10 w-full"})]},e))})]})}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7502],{4858:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>i});var n=a(95155),r=a(92542);function i(){return(0,n.jsxs)("div",{className:"space-y-6 p-6",role:"status","aria-live":"polite","aria-busy":"true",children:[(0,n.jsx)(r.Skeleton,{className:"h-8 w-36"}),(0,n.jsx)("div",{className:"space-y-4",children:[0,1,2,3].map(e=>(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(r.Skeleton,{className:"h-4 w-24"}),(0,n.jsx)(r.Skeleton,{className:"h-10 w-full"})]},e))})]})}},67040:(e,s,a)=>{"use strict";function n(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}a.d(s,{cn:()=>n})},70237:(e,s,a)=>{Promise.resolve().then(a.bind(a,4858))},92542:(e,s,a)=>{"use strict";a.d(s,{CardSkeleton:()=>d,PageLoading:()=>l,Skeleton:()=>c,Spinner:()=>t,default:()=>u});var n=a(95155),r=a(67040);let i={sm:"size-4",md:"size-6",lg:"size-8",xl:"size-12"};function t({size:e="md",className:s,label:a="Loading"}){return(0,n.jsxs)("span",{role:"status","aria-live":"polite","aria-label":a,className:(0,r.cn)("inline-flex",s),children:[(0,n.jsx)("span",{className:"sr-only",children:a}),(0,n.jsx)("span",{"aria-hidden":"true",className:(0,r.cn)("material-symbols-outlined text-primary animate-spin motion-reduce:animate-none",i[e]),children:"progress_activity"})]})}function l({message:e="Loading...",className:s}){return(0,n.jsxs)("div",{className:(0,r.cn)("fixed inset-0 z-50 flex flex-col items-center justify-center bg-bg px-6",s),role:"status","aria-live":"polite","aria-busy":"true",children:[(0,n.jsx)(t,{size:"xl"}),(0,n.jsx)("p",{className:"mt-4 text-text-muted text-center",children:e})]})}function c({className:e,...s}){return(0,n.jsx)("div",{"aria-hidden":"true",className:(0,r.cn)("animate-pulse motion-reduce:animate-none rounded-lg bg-border",e),...s})}function d(){return(0,n.jsxs)("div",{className:"p-6 rounded-xl border border-border bg-surface","aria-hidden":"true",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4 gap-4",children:[(0,n.jsx)(c,{className:"h-4 w-24"}),(0,n.jsx)(c,{className:"size-10 rounded-lg"})]}),(0,n.jsx)(c,{className:"h-8 w-16 mb-2"}),(0,n.jsx)(c,{className:"h-3 w-20"})]})}function u({type:e="spinner",className:s,message:a,size:r,label:i,...u}){switch(e){case"page":return(0,n.jsx)(l,{message:a,className:s});case"skeleton":return(0,n.jsx)(c,{className:s,...u});case"card":return(0,n.jsx)(d,{});default:return(0,n.jsx)(t,{size:r,className:s,label:i})}}}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=70237)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2791],{3612:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>U});var a=s(95155),l=s(12115),r=s(73321),i=s(67040),n=s(52529),d=s(50910),c=s(40993),o=s(33418);function m(){let[e,t]=(0,l.useState)([]),[s,r]=(0,l.useState)(!1),[i,n]=(0,l.useState)(!1),[m,x]=(0,l.useState)({type:"",message:""}),[u,h]=(0,l.useState)(null),[p,b]=(0,l.useState)(null),[g,f]=(0,l.useState)(!1),[j,y]=(0,l.useState)({type:"",message:""}),[v,N]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)({type:"",message:""}),[D,P]=(0,l.useState)(!1),[$,A]=(0,l.useState)(null),T=(0,l.useRef)(null),L=(0,o.Ym)(),M=(0,d.c)("settings"),E=(0,d.c)("common"),[O,K]=(0,l.useState)({driver:"sqlite",dbPath:"~/.omniroute/storage.sqlite",sizeBytes:0,retentionDays:90,lastBackupAt:null}),F=async()=>{r(!0);try{let e=await fetch("/api/db-backups"),s=await e.json();t(s.backups||[])}catch(e){console.error("Failed to fetch backups:",e)}finally{r(!1)}},_=async()=>{try{let e=await fetch("/api/storage/health");if(!e.ok)return;let t=await e.json();K(e=>({...e,...t}))}catch(e){console.error("Failed to fetch storage health:",e)}},B=async()=>{f(!0),y({type:"",message:""});try{let e=await fetch("/api/db-backups",{method:"PUT"}),t=await e.json();e.ok?(t.filename?y({type:"success",message:M("backupCreated",{file:t.filename})}):y({type:"info",message:t.message||M("noChangesSinceBackup")}),await _(),i&&await F()):y({type:"error",message:t.error||M("backupFailed")})}catch{y({type:"error",message:M("errorOccurred")})}finally{f(!1)}},z=async e=>{h(e),x({type:"",message:""});try{let t=await fetch("/api/db-backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupId:e})}),s=await t.json();t.ok?(x({type:"success",message:M("restoreSuccess",{connections:s.connectionCount,nodes:s.nodeCount,combos:s.comboCount,apiKeys:s.apiKeyCount})}),await F(),await _()):x({type:"error",message:s.error||M("restoreFailed")})}catch{x({type:"error",message:M("errorDuringRestore")})}finally{h(null),b(null)}};(0,l.useEffect)(()=>{_()},[]);let R=async()=>{N(!0);try{let e=await fetch("/api/db-backups/export");if(!e.ok){let t=await e.json();throw Error(t.error||M("exportFailed"))}let t=await e.blob(),s=URL.createObjectURL(t),a=(e.headers.get("Content-Disposition")||"").match(/filename="(.+)"/),l=a?a[1]:`omniroute-backup-${new Date().toISOString().replace(/[:.]/g,"-")}.sqlite`,r=document.createElement("a");r.href=s,r.download=l,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}catch(e){console.error("Export failed:",e),S({type:"error",message:M("exportFailedWithError",{error:e.message})})}finally{N(!1)}},I=async()=>{if($){w(!0),S({type:"",message:""}),P(!1);try{let e=new FormData;e.append("file",$);let t=await fetch("/api/db-backups/import",{method:"POST",body:e}),s=await t.json();t.ok?(S({type:"success",message:M("importSuccess",{connections:s.connectionCount,nodes:s.nodeCount,combos:s.comboCount,apiKeys:s.apiKeyCount})}),await _(),i&&await F()):S({type:"error",message:s.error||M("importFailed")})}catch{S({type:"error",message:M("errorDuringImport")})}finally{w(!1),A(null)}}},q=e=>e&&0!==e?e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`:"0 B";return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-green-500/10 text-green-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"database"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:M("systemStorage")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:M("allDataLocal")})]}),(0,a.jsx)(c.Ex,{variant:"success",size:"sm",children:O.driver||"json"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-4",children:[(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:M("databasePath")}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main break-all",children:O.dbPath||"~/.omniroute/storage.sqlite"})]}),(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:M("databaseSize")}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main",children:q(O.sizeBytes)})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:R,loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"download"}),M("exportDatabase")]}),(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:async()=>{N(!0);try{let e=await fetch("/api/db-backups/exportAll");if(!e.ok)throw Error(M("exportFailed"));let t=await e.blob(),s=(e.headers.get("Content-Disposition")||"").match(/filename="?([^"]+)"?/),a=s?.[1]||"omniroute-full-backup.tar.gz",l=URL.createObjectURL(t),r=document.createElement("a");r.href=l,r.download=a,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(l)}catch(e){S({type:"error",message:M("fullExportFailedWithError",{error:e.message})})}finally{N(!1)}},loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"folder_zip"}),M("exportAll")]}),(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:()=>{T.current?.click()},loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"upload"}),M("importDatabase")]}),(0,a.jsx)("input",{ref:T,type:"file",accept:".sqlite",className:"hidden",onChange:e=>{let t=e.target.files?.[0];if(t){if(!t.name.endsWith(".sqlite"))return void S({type:"error",message:M("invalidFileType")});A(t),P(!0),T.current&&(T.current.value="")}}})]}),D&&$&&(0,a.jsx)("div",{className:"p-4 rounded-lg mb-4 bg-amber-500/10 border border-amber-500/30",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-amber-500 mt-0.5","aria-hidden":"true",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-500 mb-1",children:M("confirmDbImport")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:M("confirmDbImportDesc",{file:$.name})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:I,className:"!bg-amber-500 hover:!bg-amber-600",children:M("yesImport")}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:()=>{P(!1),A(null)},children:E("cancel")})]})]})]})}),C.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-4 text-sm ${"success"===C.type?"bg-green-500/10 text-green-500 border border-green-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===C.type?"check_circle":"error"}),C.message]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-bg border border-border mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"schedule"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:M("lastBackup")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:O.lastBackupAt?`${new Date(O.lastBackupAt).toLocaleString(L)} (${(e=>{if(!e)return null;let t=Math.floor((new Date-new Date(e))/6e4);if(t<1)return M("justNow");if(t<60)return M("minutesAgo",{count:t});let s=Math.floor(t/60);return s<24?M("hoursAgo",{count:s}):M("daysAgo",{count:Math.floor(s/24)})})(O.lastBackupAt)})`:M("noBackupYet")})]})]}),(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:B,loading:g,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"backup"}),M("backupNow")]})]}),j.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-4 text-sm ${"success"===j.type?"bg-green-500/10 text-green-500 border border-green-500/20":"info"===j.type?"bg-blue-500/10 text-blue-500 border border-blue-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===j.type?"check_circle":"info"===j.type?"info":"error"}),j.message]})}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-amber-500","aria-hidden":"true",children:"restore"}),(0,a.jsx)("p",{className:"font-medium",children:M("backupRestore")})]}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:()=>{n(!i),i||0!==e.length||F()},children:i?M("hide"):M("viewBackups")})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:M("backupRetentionDesc")}),m.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-3 text-sm ${"success"===m.type?"bg-green-500/10 text-green-500 border border-green-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===m.type?"check_circle":"error"}),m.message]})}),i&&(0,a.jsx)("div",{className:"flex flex-col gap-2",children:s?(0,a.jsxs)("div",{className:"flex items-center justify-center py-6 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px] mr-2","aria-hidden":"true",children:"progress_activity"}),M("loadingBackups")]}):0===e.length?(0,a.jsxs)("div",{className:"text-center py-6 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] mb-2 block opacity-40","aria-hidden":"true",children:"folder_off"}),M("noBackupsYet")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:M("backupsAvailable",{count:e.length})}),(0,a.jsxs)("button",{onClick:F,className:"text-xs text-primary hover:underline flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"refresh"}),M("refresh")]})]}),e.map(e=>{var t;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-black/[0.02] dark:bg-white/[0.02] border border-border/50 hover:border-border transition-colors",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"description"}),(0,a.jsx)("span",{className:"text-sm font-medium truncate",children:new Date(e.createdAt).toLocaleString(L)}),(0,a.jsx)(c.Ex,{variant:"pre-restore"===e.reason?"warning":"manual"===e.reason?"success":"default",size:"sm",children:"manual"===(t=e.reason)?M("backupReasonManual"):"pre-restore"===t?M("backupReasonPreRestore"):t})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted ml-6",children:[(0,a.jsx)("span",{children:M("connectionsCount",{count:e.connectionCount})}),(0,a.jsx)("span",{children:"•"}),(0,a.jsx)("span",{children:q(e.size)})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 ml-3",children:p===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-xs text-amber-500 font-medium",children:M("confirm")}),(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:()=>z(e.id),loading:u===e.id,className:"!bg-amber-500 hover:!bg-amber-600",children:M("yes")}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:()=>b(null),children:M("no")})]}):(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:()=>b(e.id),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"restore"}),M("restore")]})})]},e.id)})]})})]})]})}var x=s(20909);let u=[{value:"disabled",labelKey:"ipModeDisabled",icon:"block"},{value:"blacklist",labelKey:"ipModeBlacklist",icon:"do_not_disturb"},{value:"whitelist",labelKey:"ipModeWhitelist",icon:"verified_user"},{value:"whitelist-priority",labelKey:"ipModeWhitelistPriority",icon:"priority_high"}];function h(){let[e,t]=(0,l.useState)({enabled:!1,mode:"blacklist",blacklist:[],whitelist:[],tempBans:[]}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(""),[o,m]=(0,l.useState)("blacklist"),x=(0,d.c)("settings");(0,l.useEffect)(()=>{h()},[]);let h=async()=>{try{let e=await fetch("/api/settings/ip-filter");e.ok&&t(await e.json())}catch{}finally{r(!1)}},p=async e=>{try{let s=await fetch("/api/settings/ip-filter",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});s.ok&&t(await s.json())}catch{}},b=()=>{i.trim()&&(p({["blacklist"===o?"addBlacklist":"addWhitelist"]:i.trim()}),n(""))},g=(e,t)=>{p({["blacklist"===t?"removeBlacklist":"removeWhitelist"]:e})},f=e.enabled?e.mode:"disabled";return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-red-500/10 text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"security"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("ipAccessControl")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("ipAccessControlDesc")})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2 mb-5",children:u.map(e=>(0,a.jsxs)("button",{onClick:()=>{var t;"disabled"===(t=e.value)?p({enabled:!1}):p({enabled:!0,mode:t})},disabled:s,className:`flex flex-col items-center gap-1.5 p-3 rounded-lg border text-center transition-all ${f===e.value?"border-red-500/50 bg-red-500/5 ring-1 ring-red-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] ${f===e.value?"text-red-400":"text-text-muted"}`,children:e.icon}),(0,a.jsx)("span",{className:`text-xs font-medium ${f===e.value?"text-red-400":"text-text-muted"}`,children:x(e.labelKey)})]},e.value))}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 items-stretch sm:items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(c.pd,{label:x("addIpAddress"),placeholder:x("ipAddressPlaceholder"),value:i,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&b()})}),(0,a.jsxs)("div",{className:"flex gap-1 pb-[2px]",children:[(0,a.jsx)(c.$n,{size:"sm",variant:"blacklist"===o?"danger":"secondary",onClick:()=>{m("blacklist"),i.trim()&&b()},children:x("block")}),(0,a.jsx)(c.$n,{size:"sm",variant:"whitelist"===o?"primary":"secondary",onClick:()=>{m("whitelist"),i.trim()&&b()},children:x("allow")})]})]}),e.blacklist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:x("blocked",{count:e.blacklist.length})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.blacklist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-red-500/10 text-red-400 border border-red-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>g(e,"blacklist"),className:"hover:text-red-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.whitelist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:x("allowed",{count:e.whitelist.length})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.whitelist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>g(e,"whitelist"),className:"hover:text-emerald-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.tempBans.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:x("temporaryBans",{count:e.tempBans.length})}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:e.tempBans.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 rounded-lg bg-orange-500/5 border border-orange-500/20 text-sm",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-xs text-orange-400 shrink-0",children:e.ip}),(0,a.jsxs)("span",{className:"text-xs text-text-muted truncate",children:["— ",e.reason]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted tabular-nums",children:x("minLeft",{min:Math.ceil(e.remainingMs/6e4)})}),(0,a.jsx)("button",{onClick:()=>p({removeBan:e.ip}),className:"text-text-muted hover:text-orange-400",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]},e.ip))})]})]})]})}function p(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),i=(0,d.c)("settings");(0,l.useEffect)(()=>{let e=!1;return async function(){let s=sessionStorage.getItem("omniroute_login_time"),a=Date.now(),l=i("unknown");if(s){let e=a-parseInt(s,10),t=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4);l=t>0?`${t}h ${r}m`:`${r}m`}let n=!1;try{let e=await fetch("/api/auth/status",{method:"GET",cache:"no-store"});if(e.ok){let t=await e.json();n=!0===t.authenticated}}catch{}e||(t({authenticated:n,loginTime:s?new Date(parseInt(s,10)).toLocaleString():null,sessionAge:l,ipAddress:"—",userAgent:navigator.userAgent.split(" ").slice(-2).join(" ")||i("unknown")}),r(!1))}(),()=>{e=!0}},[]);let n=async()=>{try{await fetch("/api/auth/logout",{method:"POST"}),sessionStorage.removeItem("omniroute_login_time"),window.location.href="/"}catch{window.location.href="/"}};return s?(0,a.jsx)(c.Zp,{children:(0,a.jsx)("div",{className:"animate-pulse h-32 bg-black/5 dark:bg-white/5 rounded-lg"})}):(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"person"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:i("session")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",role:"list","aria-label":i("sessionDetailsAria"),children:[(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("status")}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:`w-2 h-2 rounded-full ${e?.authenticated?"bg-green-500":"bg-yellow-500"}`,"aria-hidden":"true"}),e?.authenticated?i("authenticated"):i("guest")]})]}),e?.loginTime&&(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("loginTime")}),(0,a.jsx)("span",{className:"font-mono text-xs",children:e.loginTime})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("sessionAge")}),(0,a.jsx)("span",{className:"font-mono text-xs",children:e?.sessionAge})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("browser")}),(0,a.jsx)("span",{className:"font-mono text-xs truncate max-w-[200px]",children:e?.userAgent})]})]}),(0,a.jsxs)("div",{className:"flex gap-3 mt-4 pt-4 border-t border-border/50",children:[(0,a.jsx)(c.$n,{variant:"secondary",onClick:()=>{confirm(i("clearLocalDataConfirm"))&&(localStorage.clear(),sessionStorage.clear(),window.location.reload())},children:i("clearLocalData")}),e?.authenticated&&(0,a.jsx)(c.$n,{variant:"danger",onClick:n,children:i("logout")})]})]})}function b(){let[e,t]=(0,l.useState)({requireLogin:!1,hasPassword:!1}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)({current:"",new:"",confirm:""}),[o,m]=(0,l.useState)({type:"",message:""}),[u,b]=(0,l.useState)(!1),g=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let f=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&t(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},j=async(e,s)=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:s})})).ok&&t(t=>({...t,[e]:s}))}catch(t){console.error(`Failed to update ${e}:`,t)}},y=async e=>{if(e.preventDefault(),i.new!==i.confirm)return void m({type:"error",message:g("passwordsNoMatch")});b(!0),m({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:i.current,newPassword:i.new})}),t=await e.json();e.ok?(m({type:"success",message:g("passwordUpdated")}),n({current:"",new:"",confirm:""})):m({type:"error",message:t.error||g("failedUpdatePassword")})}catch{m({type:"error",message:g("errorOccurred")})}finally{b(!1)}},v=e.blockedProviders||[];return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"shield"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:g("security")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:g("requireLogin")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:g("requireLoginDesc")})]}),(0,a.jsx)(c.lM,{checked:!0===e.requireLogin,onChange:()=>f(!e.requireLogin),disabled:s})]}),!0===e.requireLogin&&(0,a.jsxs)("form",{onSubmit:y,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[e.hasPassword&&(0,a.jsx)(c.pd,{label:g("currentPassword"),type:"password",placeholder:g("enterCurrentPassword"),value:i.current,onChange:e=>n({...i,current:e.target.value}),required:!0}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsx)(c.pd,{label:g("newPassword"),type:"password",placeholder:g("enterNewPassword"),value:i.new,onChange:e=>n({...i,new:e.target.value}),required:!0}),(0,a.jsx)(c.pd,{label:g("confirmPassword"),type:"password",placeholder:g("confirmPasswordPlaceholder"),value:i.confirm,onChange:e=>n({...i,confirm:e.target.value}),required:!0})]}),o.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===o.type?"text-red-500":"text-green-500"}`,children:o.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(c.$n,{type:"submit",variant:"primary",loading:u,children:e.hasPassword?g("updatePassword"):g("setPassword")})})]})]})]}),(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-600 dark:text-amber-400",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"api"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:g("apiEndpointProtection")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:g("requireAuthModels")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:g("requireAuthModelsDesc")})]}),(0,a.jsx)(c.lM,{checked:!0===e.requireAuthForModels,onChange:()=>j("requireAuthForModels",!e.requireAuthForModels),disabled:s})]}),(0,a.jsxs)("div",{className:"pt-4 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("p",{className:"font-medium",children:g("blockedProviders")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:g("blockedProvidersDesc")})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.values(x.Q2).map(t=>{let l=v.includes(t.id);return(0,a.jsxs)("button",{onClick:()=>{var s;let a;return s=t.id,void j("blockedProviders",(a=e.blockedProviders||[]).includes(s)?a.filter(e=>e!==s):[...a,s])},disabled:s,className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-all border ${l?"bg-red-500/10 border-red-500/30 text-red-600 dark:text-red-400":"bg-black/[0.02] dark:bg-white/[0.02] border-transparent text-text-muted hover:bg-black/[0.05] dark:hover:bg-white/[0.05]"}`,title:l?g("unblockProviderTitle",{provider:t.name}):g("blockProviderTitle",{provider:t.name}),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:{color:l?void 0:t.color},children:l?"block":t.icon}),t.name,l&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px] text-red-500",children:"close"})]},t.id)})}),v.length>0&&(0,a.jsxs)("p",{className:"text-xs text-amber-600 dark:text-amber-400 mt-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),g("providersBlocked",{count:v.length})]})]})]})]}),(0,a.jsx)(p,{}),(0,a.jsx)(h,{})]})}var g=s(67671);let f=["#6366f1","#22c55e","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#14b8a6"];function j(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),[h,p]=(0,l.useState)(!1),b=(0,g.i)(),j=(0,d.c)("settings"),y=(0,d.c)("common"),v=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/fallback/chains");if(e.ok){let s=await e.json();t(s.chains||s||{})}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{v()},[v]);let N=async()=>{if(!o.trim()||!x.trim())return void b.warning(j("fillModelAndProviders"));let e=x.split(",").map(e=>e.trim()).filter(Boolean).map((e,t)=>({provider:e,priority:t+1,enabled:!0}));if(0===e.length)return void b.warning(j("addAtLeastOneProvider"));p(!0);try{(await fetch("/api/fallback/chains",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:o.trim(),chain:e})})).ok?(b.success(j("chainCreated",{model:o.trim()})),m(""),u(""),n(!1),await v()):b.error(j("failedCreateChain"))}catch{b.error(j("failedCreateChain"))}finally{p(!1)}},k=async e=>{if(confirm(j("deleteChainConfirm",{model:e})))try{(await fetch("/api/fallback/chains",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:e})})).ok?(b.success(j("chainDeleted",{model:e})),await v()):b.error(j("failedDeleteChain"))}catch{b.error(j("failedDeleteChain"))}};if(s)return(0,a.jsx)(c.Zp,{className:"p-6 mt-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"timeline"}),j("loadingFallbackChains")]})});let w=Object.entries(e);return(0,a.jsxs)(c.Zp,{className:"mt-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4 p-6 pb-0",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-cyan-500/10 text-cyan-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"timeline"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:j("fallbackChainsTitle")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:j("fallbackChainsDesc")})]}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",onClick:()=>n(!i),children:i?y("cancel"):j("addChain")})]}),i&&(0,a.jsxs)("div",{className:"mx-6 p-4 rounded-lg border border-border/30 bg-surface/20 mb-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mb-3",children:[(0,a.jsx)(c.pd,{label:j("modelName"),placeholder:j("modelNamePlaceholder"),value:o,onChange:e=>m(e.target.value)}),(0,a.jsx)(c.pd,{label:j("providersCommaSeparated"),placeholder:j("providersCommaSeparatedPlaceholder"),value:x,onChange:e=>u(e.target.value)})]}),(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:N,loading:h,children:j("createChain")})]}),(0,a.jsx)("div",{className:"px-6 pb-6",children:0===w.length?(0,a.jsx)(c.pp,{icon:"timeline",title:j("noFallbackChains"),description:j("noFallbackChainsDesc")}):(0,a.jsx)("div",{className:"flex flex-col gap-2",children:w.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 rounded-lg border border-border/20 bg-surface/20 hover:bg-surface/40 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("span",{className:"font-mono text-sm text-text-main truncate max-w-[200px]",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("div",{className:"flex gap-1.5 flex-wrap",children:(Array.isArray(t)?t:[]).map((e,t)=>(0,a.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:`${f[t%f.length]}20`,color:f[t%f.length],border:`1px solid ${f[t%f.length]}40`},children:[t+1,". ",e.provider]},`${e.provider}-${t}`))})]}),(0,a.jsx)("button",{onClick:()=>k(e),className:"text-text-muted hover:text-red-400 transition-colors ml-2",title:j("deleteChain"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},e))})})]})}let y=[{value:"fill-first",labelKey:"fillFirst",descKey:"fillFirstDesc",icon:"vertical_align_top"},{value:"round-robin",labelKey:"roundRobin",descKey:"roundRobinDesc",icon:"loop"},{value:"p2c",labelKey:"p2c",descKey:"p2cDesc",icon:"balance"},{value:"random",labelKey:"random",descKey:"randomDesc",icon:"shuffle"},{value:"least-used",labelKey:"leastUsed",descKey:"leastUsedDesc",icon:"low_priority"},{value:"cost-optimized",labelKey:"costOpt",descKey:"costOptDesc",icon:"savings"}];function v(){let[e,t]=(0,l.useState)({fallbackStrategy:"fill-first"}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)([]),[o,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),h=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),n(e.wildcardAliases||[]),r(!1)}).catch(()=>r(!1))},[]);let p=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&t(t=>({...t,...e}))}catch(e){console.error("Failed to update settings:",e)}},b=async()=>{if(!o.trim()||!x.trim())return;let e=[...i,{pattern:o.trim(),target:x.trim()}];await p({wildcardAliases:e}),n(e),m(""),u("")},g=async e=>{let t=i.filter((t,s)=>s!==e);await p({wildcardAliases:t}),n(t)};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"route"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:h("routingStrategy")})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-2 mb-4",style:{gridAutoRows:"1fr"},children:y.map(t=>(0,a.jsxs)("button",{onClick:()=>p({fallbackStrategy:t.value}),disabled:s,className:`flex flex-col items-center gap-2 p-4 rounded-lg border text-center transition-all ${e.fallbackStrategy===t.value?"border-blue-500/50 bg-blue-500/5 ring-1 ring-blue-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[24px] ${e.fallbackStrategy===t.value?"text-blue-400":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.fallbackStrategy===t.value?"text-blue-400":""}`,children:h(t.labelKey)}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:h(t.descKey)})]})]},t.value))}),"round-robin"===e.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-3 border-t border-border/30",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:h("stickyLimit")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:h("stickyLimitDesc")})]}),(0,a.jsx)(c.pd,{type:"number",min:"1",max:"10",value:e.stickyRoundRobinLimit||3,onChange:e=>p({stickyRoundRobinLimit:parseInt(e.target.value)}),disabled:s,className:"w-20 text-center"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted italic pt-3 border-t border-border/30 mt-3",children:h({"fill-first":"fillFirstDesc","round-robin":"roundRobinDesc",p2c:"p2cDesc",random:"randomDesc","least-used":"leastUsedDesc","cost-optimized":"costOptDesc"}[e.fallbackStrategy]||"fillFirstDesc")})]}),(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"alt_route"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:h("modelAliases")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:h("modelAliasesDesc")})]})]}),i.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-1.5 mb-4",children:i.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-sm",children:[(0,a.jsx)("span",{className:"font-mono text-purple-400 break-all",children:e.pattern}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("span",{className:"font-mono text-text-main break-all",children:e.target})]}),(0,a.jsx)("button",{onClick:()=>g(t),className:"shrink-0 text-text-muted hover:text-red-400 transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},t))}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 items-stretch sm:items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(c.pd,{label:h("pattern"),placeholder:h("aliasPatternPlaceholder"),value:o,onChange:e=>m(e.target.value)})}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(c.pd,{label:h("targetModel"),placeholder:h("aliasTargetPlaceholder"),value:x,onChange:e=>u(e.target.value)})}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",onClick:b,className:"mb-[2px] sm:w-auto w-full",children:h("add")})]})]}),(0,a.jsx)(j,{})]})}function N(){let[e,t]=(0,l.useState)({strategy:"priority",maxRetries:1,retryDelayMs:2e3,timeoutMs:12e4,healthCheckEnabled:!0,healthCheckTimeoutMs:3e3,maxComboDepth:3,trackMetrics:!0}),[s,r]=(0,l.useState)({}),[n,o]=(0,l.useState)(""),[m,x]=(0,l.useState)(!1),u=(0,d.c)("settings"),h=(0,d.c)("common"),p=[{value:"priority",label:u("priority"),icon:"sort"},{value:"weighted",label:u("weighted"),icon:"percent"},{value:"round-robin",label:u("roundRobin"),icon:"autorenew"},{value:"random",label:u("random"),icon:"shuffle"},{value:"least-used",label:u("leastUsed"),icon:"low_priority"},{value:"cost-optimized",label:u("costOpt"),icon:"savings"}],b=[{key:"maxRetries",label:u("maxRetriesLabel"),min:0,max:5},{key:"retryDelayMs",label:u("retryDelayLabel"),min:500,max:1e4,step:500},{key:"timeoutMs",label:u("timeoutLabel"),min:5e3,max:3e5,step:5e3},{key:"maxComboDepth",label:u("maxNestingDepth"),min:1,max:10}];(0,l.useEffect)(()=>{fetch("/api/settings/combo-defaults").then(e=>e.json()).then(e=>{e.comboDefaults&&t(e.comboDefaults),e.providerOverrides&&r(e.providerOverrides)}).catch(e=>console.error("Failed to fetch combo defaults:",e))},[]);let g=async()=>{x(!0);try{await fetch("/api/settings/combo-defaults",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboDefaults:e,providerOverrides:s})})}catch(e){console.error("Failed to save combo defaults:",e)}finally{x(!1)}},f=()=>{let e=n.trim().toLowerCase();e&&!s[e]&&(r(t=>({...t,[e]:{maxRetries:1,timeoutMs:12e4}})),o(""))};return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"tune"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:u("comboDefaultsTitle")}),(0,a.jsx)("span",{className:"text-xs text-text-muted ml-auto",children:u("globalComboConfig")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:u("defaultStrategy")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("defaultStrategyDesc")})]}),(0,a.jsx)("div",{role:"tablist","aria-label":u("comboStrategyAria"),className:"grid grid-cols-3 gap-1 p-0.5 rounded-md bg-black/5 dark:bg-white/5",children:p.map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e.strategy===s.value,onClick:()=>t(e=>({...e,strategy:s.value})),className:(0,i.cn)("px-2 py-1 rounded text-xs font-medium transition-all flex items-center justify-center gap-0.5",e.strategy===s.value?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:s.icon}),s.label]},s.value))})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:b.map(({key:s,label:l,min:r,max:i,step:n})=>(0,a.jsx)(c.pd,{label:l,type:"number",min:r,max:i,step:n||1,value:e[s]??"",onChange:e=>t(t=>({...t,[s]:parseInt(e.target.value)||0})),className:"text-sm"},s))}),"round-robin"===e.strategy&&(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:[(0,a.jsx)(c.pd,{label:u("concurrencyPerModel"),type:"number",min:1,max:20,value:e.concurrencyPerModel??"",placeholder:"3",onChange:e=>t(t=>({...t,concurrencyPerModel:parseInt(e.target.value)||0})),className:"text-sm"}),(0,a.jsx)(c.pd,{label:u("queueTimeout"),type:"number",min:1e3,max:12e4,step:1e3,value:e.queueTimeoutMs??"",placeholder:"30000",onChange:e=>t(t=>({...t,queueTimeoutMs:parseInt(e.target.value)||0})),className:"text-sm"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:u("healthCheck")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("healthCheckDesc")})]}),(0,a.jsx)(c.lM,{checked:!1!==e.healthCheckEnabled,onChange:()=>t(e=>({...e,healthCheckEnabled:!e.healthCheckEnabled}))})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:u("trackMetrics")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("trackMetricsDesc")})]}),(0,a.jsx)(c.lM,{checked:!1!==e.trackMetrics,onChange:()=>t(e=>({...e,trackMetrics:!e.trackMetrics}))})]})]}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsx)("p",{className:"font-medium text-sm mb-2",children:u("providerOverrides")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:u("providerOverridesDesc")}),Object.entries(s).map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2 p-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,a.jsx)("span",{className:"text-xs font-mono font-medium min-w-[80px]",children:e}),(0,a.jsx)(c.pd,{type:"number",min:"0",max:"5",value:t.maxRetries??1,onChange:t=>r(s=>({...s,[e]:{...s[e],maxRetries:parseInt(t.target.value)||0}})),className:"text-xs w-16","aria-label":u("providerMaxRetriesAria",{provider:e})}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:u("retries")}),(0,a.jsx)(c.pd,{type:"number",min:"5000",max:"300000",step:"5000",value:t.timeoutMs??12e4,onChange:t=>r(s=>({...s,[e]:{...s[e],timeoutMs:parseInt(t.target.value)||12e4}})),className:"text-xs w-24","aria-label":u("providerTimeoutAria",{provider:e})}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:u("ms")}),(0,a.jsx)("button",{onClick:()=>{r(t=>{let s={...t};return delete s[e],s})},className:"ml-auto text-red-400 hover:text-red-500 transition-colors","aria-label":u("removeProviderOverrideAria",{provider:e}),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"close"})})]},e)),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,a.jsx)(c.pd,{type:"text",placeholder:u("newProviderNamePlaceholder"),value:n,onChange:e=>o(e.target.value),onKeyDown:e=>"Enter"===e.key&&f(),className:"text-xs flex-1","aria-label":u("newProviderNameAria")}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:f,disabled:!n.trim(),children:h("add")})]})]}),(0,a.jsx)("div",{className:"pt-3 border-t border-border/50",children:(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:g,loading:m,children:u("saveComboDefaults")})})]})]})}function k(){let[e,t]=(0,l.useState)(!1),[s,r]=(0,l.useState)(null),i=(0,l.useRef)(!0),n=(0,d.c)("settings"),o=(0,d.c)("common"),m=async()=>{try{let e=await fetch("/api/settings/proxy?level=global");if(e.ok){let t=await e.json();r(t.proxy||null)}}catch{}};return(0,l.useEffect)(()=>(i.current=!0,async function(){try{let e=await fetch("/api/settings/proxy?level=global");if(!i.current)return;if(e.ok){let t=await e.json();i.current&&r(t.proxy||null)}}catch{}}(),()=>{i.current=!1}),[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"vpn_lock"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:n("globalProxy")})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:n("globalProxyDesc")}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[s?(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("span",{className:"px-2.5 py-1 rounded text-xs font-bold uppercase bg-emerald-500/15 text-emerald-400 border border-emerald-500/30",children:[s.type,"://",s.host,":",s.port]})}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:n("noGlobalProxy")}),(0,a.jsx)(c.$n,{size:"sm",variant:s?"secondary":"primary",icon:"settings",onClick:()=>{m(),t(!0)},children:s?o("edit"):n("configure")})]})]})}),(0,a.jsx)(c.KN,{isOpen:e,onClose:()=>t(!1),level:"global",levelLabel:n("globalLabel"),onSaved:m})]})}var w=s(97550),C=s(76851);function S(){let{theme:e,setTheme:t,isDark:s}=(0,w.D)(),{colorTheme:r,customColor:n,setColorTheme:o,setCustomColorTheme:m}=(0,C.A)(),x=(0,d.c)("settings"),[u,h]=(0,l.useState)({}),[p,b]=(0,l.useState)(!0),[g,f]=(0,l.useState)(n||"#3b82f6"),j=/^#([0-9a-fA-F]{6})$/.test(g.startsWith("#")?g:`#${g}`);(0,l.useEffect)(()=>C.A.subscribe(e=>{e.customColor&&e.customColor!==g&&f(e.customColor)}),[]);let y={light:x("themeLight"),dark:x("themeDark"),system:x("themeSystem")};(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>{if(!e.ok)throw Error(`HTTP error ${e.status}`);return e.json()}).then(e=>{h(e),b(!1)}).catch(()=>b(!1))},[]);let v=async(e,t)=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:t})})).ok&&h(s=>({...s,[e]:t}))}catch(t){console.error(`Failed to update ${e}:`,t)}},N=[{id:"coral",color:C.F.coral,label:x("themeCoral")},{id:"blue",color:C.F.blue,label:x("themeBlue")},{id:"red",color:C.F.red,label:x("themeRed")},{id:"green",color:C.F.green,label:x("themeGreen")},{id:"violet",color:C.F.violet,label:x("themeViolet")},{id:"orange",color:C.F.orange,label:x("themeOrange")},{id:"cyan",color:C.F.cyan,label:x("themeCyan")}];return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"palette"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("appearance")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:x("darkMode")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("switchThemes")})]}),(0,a.jsx)(c.lM,{checked:s,onChange:()=>t(s?"light":"dark")})]}),(0,a.jsx)("div",{className:"pt-4 border-t border-border",children:(0,a.jsx)("div",{role:"tablist","aria-label":x("themeSelectionAria"),className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e===s,onClick:()=>t(s),className:(0,i.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{children:y[s]||s})]},s))})}),(0,a.jsxs)("div",{className:"pt-4 border-t border-border",children:[(0,a.jsx)("p",{className:"font-medium mb-1",children:x("themeAccent")}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-3",children:x("themeAccentDesc")}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mb-3",children:N.map(e=>{let t=r===e.id;return(0,a.jsx)("button",{onClick:()=>o(e.id),className:(0,i.cn)("flex items-center justify-between gap-2 p-2 rounded-lg border transition-colors",t?"border-primary bg-primary/10 text-primary":"border-border hover:bg-surface/50 text-text-main"),children:(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"size-4 rounded-full border border-black/10 dark:border-white/20",style:{backgroundColor:e.color}}),(0,a.jsx)("span",{className:"text-sm font-medium",children:e.label})]})},e.id)})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"color",value:g,onChange:e=>f(e.target.value),className:"h-10 w-12 rounded border border-border bg-surface cursor-pointer","aria-label":x("themeCustom")}),(0,a.jsx)("input",{type:"text",value:g,onChange:e=>f(e.target.value),placeholder:"#3b82f6",maxLength:7,className:`flex-1 h-10 px-3 rounded-lg bg-surface border text-sm text-text-main focus:outline-none ${j?"border-border focus:border-primary":"border-red-400 focus:border-red-500"}`}),(0,a.jsx)(c.$n,{onClick:()=>m(g),disabled:!j,children:x("themeCreate")})]})]}),(0,a.jsx)("div",{className:"pt-4 border-t border-border",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:x("hideHealthLogs")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("hideHealthLogsDesc")})]}),(0,a.jsx)(c.lM,{checked:!0===u.hideHealthCheckLogs,onChange:()=>v("hideHealthCheckLogs",!u.hideHealthCheckLogs),disabled:p})]})})]})]})}let D=[{value:"passthrough",labelKey:"passthrough",descKey:"passthroughDesc",icon:"arrow_forward"},{value:"auto",labelKey:"auto",descKey:"autoDesc",icon:"auto_awesome"},{value:"custom",labelKey:"custom",descKey:"customDesc",icon:"tune"},{value:"adaptive",labelKey:"adaptive",descKey:"adaptiveDesc",icon:"trending_up"}],P=[{value:"none",labelKey:"effortNone"},{value:"low",labelKey:"effortLow"},{value:"medium",labelKey:"effortMedium"},{value:"high",labelKey:"effortHigh"}];function $(){let[e,t]=(0,l.useState)({mode:"passthrough",customBudget:10240,effortLevel:"medium"}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(""),x=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/thinking-budget").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let u=async s=>{let a={...e,...s};t(a),n(!0),m("");try{(await fetch("/api/settings/thinking-budget",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok?(m("saved"),setTimeout(()=>m(""),2e3)):m("error")}catch{m("error")}finally{n(!1)}};return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-violet-500/10 text-violet-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"psychology"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("thinkingBudgetTitle")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("thinkingBudgetDesc")})]}),"saved"===o&&(0,a.jsxs)("span",{className:"ml-auto text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",x("saved")]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2 mb-5",children:D.map(t=>(0,a.jsxs)("button",{onClick:()=>u({mode:t.value}),disabled:s||i,className:`flex items-start gap-3 p-3 rounded-lg border text-left transition-all ${e.mode===t.value?"border-violet-500/50 bg-violet-500/5 ring-1 ring-violet-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] mt-0.5 ${e.mode===t.value?"text-violet-500":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.mode===t.value?"text-violet-400":""}`,children:x(t.labelKey)}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5 leading-relaxed",children:x(t.descKey)})]})]},t.value))}),"custom"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:x("tokenBudget")}),(0,a.jsxs)("span",{className:"text-sm font-mono tabular-nums text-violet-400",children:[e.customBudget.toLocaleString()," ",x("tokens")]})]}),(0,a.jsx)("input",{type:"range",min:"0",max:"131072",step:"1024",value:e.customBudget,onChange:e=>u({customBudget:parseInt(e.target.value)}),className:"w-full accent-violet-500"}),(0,a.jsxs)("div",{className:"flex justify-between text-xs text-text-muted mt-1",children:[(0,a.jsx)("span",{children:x("off")}),(0,a.jsx)("span",{children:"1K"}),(0,a.jsx)("span",{children:"10K"}),(0,a.jsx)("span",{children:"64K"}),(0,a.jsx)("span",{children:"128K"})]})]}),"adaptive"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30",children:[(0,a.jsx)("p",{className:"text-sm font-medium mb-3",children:x("baseEffortLevel")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:x("adaptiveHint")}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:P.map(t=>(0,a.jsx)("button",{onClick:()=>u({effortLevel:t.value}),disabled:s||i,className:`px-3 py-2 rounded-lg text-xs font-medium border transition-all ${e.effortLevel===t.value?"border-violet-500/50 bg-violet-500/10 text-violet-400":"border-border/50 text-text-muted hover:border-border"}`,children:x(t.labelKey)},t.value))})]})]})}function A(){let[e,t]=(0,l.useState)({enabled:!1,prompt:""}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(""),[o,m]=(0,l.useState)(null),x=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/system-prompt").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let u=async s=>{let a={...e,...s};t(a),n("");try{(await fetch("/api/settings/system-prompt",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(n("saved"),setTimeout(()=>n(""),2e3))}catch{n("error")}};return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"edit_note"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("globalSystemPrompt")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("systemPromptDesc")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:["saved"===i&&(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",x("saved")]}),(0,a.jsx)(c.lM,{checked:e.enabled,onChange:()=>u({enabled:!e.enabled}),disabled:s})]})]}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("textarea",{value:e.prompt,onChange:e=>{var s;return s=e.target.value,void(t(e=>({...e,prompt:s})),o&&clearTimeout(o),m(setTimeout(()=>{u({prompt:s})},800)))},placeholder:x("systemPromptPlaceholder"),rows:5,className:"w-full px-4 py-3 rounded-lg border border-border/50 bg-surface/30 text-sm placeholder:text-text-muted/50 resize-y min-h-[120px] focus:outline-none focus:ring-1 focus:ring-amber-500/30 focus:border-amber-500/50 transition-colors",disabled:s}),(0,a.jsx)("div",{className:"absolute bottom-2 right-3 text-xs text-text-muted/60 tabular-nums",children:x("chars",{count:e.prompt.length})})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted/70 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),x("systemPromptHint")]})]})]})}function T(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)({}),[i,n]=(0,l.useState)(!0),[o,m]=(0,l.useState)(!1),[x,u]=(0,l.useState)(""),[h,p]=(0,l.useState)(""),[b,g]=(0,l.useState)(""),f=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/model-aliases").then(e=>e.json()).then(e=>{t(e.builtIn||{}),r(e.custom||{}),n(!1)}).catch(()=>n(!1))},[]);let j=async()=>{if(h.trim()&&b.trim()){m(!0);try{let e=await fetch("/api/settings/model-aliases",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:h.trim(),to:b.trim()})});if(e.ok){let t=await e.json();r(t.custom),p(""),g(""),u("saved"),setTimeout(()=>u(""),2e3)}}catch{u("error")}finally{m(!1)}}},y=async e=>{m(!0);try{let t=await fetch("/api/settings/model-aliases",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:e})});if(t.ok){let e=await t.json();r(e.custom),u("saved"),setTimeout(()=>u(""),2e3)}}catch{u("error")}finally{m(!1)}},v=Object.entries(e),N=Object.entries(s);return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"swap_horiz"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:f("modelAliasesTitle")||"Model Aliases"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:f("modelAliasesDesc")||"Auto-forward deprecated model IDs to their replacements"})]}),"saved"===x&&(0,a.jsxs)("span",{className:"ml-auto text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",f("saved")||"Saved"]})]}),(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium mb-3",children:f("addCustomAlias")||"Add Custom Alias"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",placeholder:f("deprecatedModelId")||"Deprecated model ID",value:h,onChange:e=>p(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-amber-500/50 focus:outline-none"}),(0,a.jsx)("span",{className:"text-text-muted text-lg",children:"→"}),(0,a.jsx)("input",{type:"text",placeholder:f("newModelId")||"New model ID",value:b,onChange:e=>g(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-amber-500/50 focus:outline-none"}),(0,a.jsx)("button",{onClick:j,disabled:o||!h.trim()||!b.trim(),className:"px-4 py-2 rounded-lg text-sm font-medium bg-amber-500/10 text-amber-500 hover:bg-amber-500/20 disabled:opacity-50 transition-all",children:f("add")||"Add"})]})]}),N.length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-2",children:f("customAliases")||"Custom Aliases"}),(0,a.jsx)("div",{className:"rounded-lg border border-border/30 divide-y divide-border/20",children:N.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,a.jsx)("code",{className:"text-xs text-red-400/80 flex-1 truncate",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("code",{className:"text-xs text-emerald-400/80 flex-1 truncate",children:t}),(0,a.jsx)("button",{onClick:()=>y(e),disabled:o,className:"p-1 rounded hover:bg-red-500/10 text-text-muted hover:text-red-400 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},e))})]}),(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"text-xs font-medium text-text-muted uppercase tracking-wider cursor-pointer flex items-center gap-1 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] group-open:rotate-90 transition-transform",children:"chevron_right"}),f("builtInAliases")||"Built-in Aliases"," (",v.length,")"]}),(0,a.jsx)("div",{className:"rounded-lg border border-border/30 divide-y divide-border/20 max-h-60 overflow-y-auto",children:v.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2 opacity-60",children:[(0,a.jsx)("code",{className:"text-xs text-red-400/60 flex-1 truncate",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("code",{className:"text-xs text-emerald-400/60 flex-1 truncate",children:t}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"lock"})]},e))})]})]})}function L(){let[e,t]=(0,l.useState)({enabled:!1,degradationMap:{},detectionPatterns:[],stats:{detected:0,tokensSaved:0}}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),[h,p]=(0,l.useState)(""),[b,g]=(0,l.useState)(""),f=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/background-degradation").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let j=async s=>{let a={...e,...s};t(a),n(!0),m("");try{let{stats:e,...s}=a,l=await fetch("/api/settings/background-degradation",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(l.ok){let e=await l.json();t(e),m("saved"),setTimeout(()=>m(""),2e3)}else m("error")}catch{m("error")}finally{n(!1)}},y=Object.entries(e.degradationMap||{});return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-sky-500/10 text-sky-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"speed"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:f("backgroundDegradationTitle")||"Background Task Degradation"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:f("backgroundDegradationDesc")||"Auto-redirect background requests (titles, summaries) to cheaper models"})]}),"saved"===o&&(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",f("saved")||"Saved"]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:f("enableDegradation")||"Enable Background Degradation"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:f("enableDegradationHint")||"Automatically use cheaper models for background utility tasks"})]}),(0,a.jsx)("button",{onClick:()=>j({enabled:!e.enabled}),disabled:s||i,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${e.enabled?"bg-sky-500":"bg-white/10"}`,children:(0,a.jsx)("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${e.enabled?"translate-x-6":"translate-x-1"}`})})]}),e.stats&&e.stats.detected>0&&(0,a.jsx)("div",{className:"flex items-center gap-4 p-3 rounded-lg bg-sky-500/5 border border-sky-500/20 mb-4",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-sky-400",children:"analytics"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[f("tasksDetected")||"Tasks detected",":"]}),(0,a.jsx)("span",{className:"text-sm font-mono font-semibold text-sky-400",children:e.stats.detected})]})}),e.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-2",children:f("degradationMap")||"Model Degradation Map"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("input",{type:"text",placeholder:f("premiumModel")||"Premium model",value:x,onChange:e=>u(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-sky-500/50 focus:outline-none"}),(0,a.jsx)("span",{className:"text-text-muted text-lg",children:"→"}),(0,a.jsx)("input",{type:"text",placeholder:f("cheapModel")||"Cheap model",value:h,onChange:e=>p(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-sky-500/50 focus:outline-none"}),(0,a.jsx)("button",{onClick:()=>{x.trim()&&h.trim()&&(j({degradationMap:{...e.degradationMap,[x.trim()]:h.trim()}}),u(""),p(""))},disabled:i||!x.trim()||!h.trim(),className:"px-3 py-2 rounded-lg text-sm font-medium bg-sky-500/10 text-sky-500 hover:bg-sky-500/20 disabled:opacity-50 transition-all",children:f("add")||"Add"})]}),y.length>0&&(0,a.jsx)("div",{className:"rounded-lg border border-border/30 divide-y divide-border/20 max-h-48 overflow-y-auto",children:y.map(([t,s])=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2",children:[(0,a.jsx)("code",{className:"text-xs text-orange-400/80 flex-1 truncate",children:t}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("code",{className:"text-xs text-sky-400/80 flex-1 truncate",children:s}),(0,a.jsx)("button",{onClick:()=>{let s;return s={...e.degradationMap},void(delete s[t],j({degradationMap:s}))},disabled:i,className:"p-1 rounded hover:bg-red-500/10 text-text-muted hover:text-red-400 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},t))})]}),(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"text-xs font-medium text-text-muted uppercase tracking-wider cursor-pointer flex items-center gap-1 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] group-open:rotate-90 transition-transform",children:"chevron_right"}),f("detectionPatterns")||"Detection Patterns"," (",e.detectionPatterns?.length||0,")"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("input",{type:"text",placeholder:f("newPattern")||'e.g. "generate a title"',value:b,onChange:e=>g(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-sky-500/50 focus:outline-none"}),(0,a.jsx)("button",{onClick:()=>{b.trim()&&(j({detectionPatterns:[...e.detectionPatterns,b.trim()]}),g(""))},disabled:i||!b.trim(),className:"px-3 py-2 rounded-lg text-sm font-medium bg-sky-500/10 text-sky-500 hover:bg-sky-500/20 disabled:opacity-50 transition-all",children:f("add")||"Add"})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:(e.detectionPatterns||[]).map((t,s)=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs bg-sky-500/10 text-sky-400 border border-sky-500/20",children:[t,(0,a.jsx)("button",{onClick:()=>{j({detectionPatterns:e.detectionPatterns.filter((e,t)=>t!==s)})},className:"hover:text-red-400 transition-colors",disabled:i,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},s))})]})]})]})}function M(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!1),i=(0,d.c)("settings"),n=()=>{fetch("/api/cache/stats").then(e=>e.json()).then(t).catch(()=>{})};(0,l.useEffect)(n,[]);let o=async()=>{r(!0);try{await fetch("/api/cache/stats",{method:"DELETE"}),n()}finally{r(!1)}};return(0,a.jsxs)(c.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"cached"}),i("promptCache")]}),(0,a.jsx)("button",{onClick:o,disabled:s,className:"px-3 py-1.5 text-xs rounded-lg bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:i(s?"flushing":"flushCache")})]}),e?(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("size")}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.size,"/",e.maxSize]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("hitRate")}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.hitRate?.toFixed(1)??0,"%"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("hits")}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.hits??0})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("evictions")}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.evictions??0})]})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:i("loadingCacheStats")})]})}let E={CLOSED:{bg:"bg-emerald-500/15",text:"text-emerald-400",border:"border-emerald-500/30",icon:"check_circle"},OPEN:{bg:"bg-red-500/15",text:"text-red-400",border:"border-red-500/30",icon:"error"},HALF_OPEN:{bg:"bg-amber-500/15",text:"text-amber-400",border:"border-amber-500/30",icon:"warning"}},O={closed:{icon:"check_circle",color:"#22c55e"},"half-open":{icon:"pending",color:"#f59e0b"},open:{icon:"error",color:"#ef4444"}};function K(e,t){let s=String(e||"closed").toLowerCase().replaceAll("_","-");return t("open"===s?"breakerStateOpen":"half-open"===s?"breakerStateHalfOpen":"breakerStateClosed")}function F(e){return!e||e<=0?"—":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function _(e,t){return e instanceof Error&&e.message?e.message:t}function B({profiles:e,onSave:t,saving:s}){let[r,i]=(0,l.useState)(!1),[n,o]=(0,l.useState)(e),m=(0,d.c)("settings"),x=(0,d.c)("common");(0,l.useEffect)(()=>{o(e)},[e]);let u=e=>null==e?"—":`${e}${m("ms")}`,h=[{key:"transientCooldown",label:m("transientCooldown"),format:u},{key:"rateLimitCooldown",label:m("rateLimitCooldown"),format:u},{key:"maxBackoffLevel",label:m("maxBackoffLevel")},{key:"circuitBreakerThreshold",label:m("cbThreshold"),format:e=>null==e?"—":m("failures",{count:e})},{key:"circuitBreakerReset",label:m("cbResetTime"),format:u}];return(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"tune"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:m("providerProfiles")})]}),r?(0,a.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",onClick:()=>i(!1),children:x("cancel")}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{t(n),i(!1)},disabled:s,children:x("save")})]}):(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>i(!0),children:x("edit")})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:m("providerProfilesDesc")}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:["oauth","apikey"].map(t=>(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-bold uppercase tracking-wider mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base","aria-hidden":"true",children:"oauth"===t?"lock":"key"}),"oauth"===t?m("oauthProviders"):m("apiKeyProviders")]}),(0,a.jsx)("div",{className:"space-y-2",children:h.map(({key:s,label:l,format:i})=>(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l}),r?(0,a.jsx)("input",{type:"number",min:"0",value:n?.[t]?.[s]??0,onChange:e=>o({...n,[t]:{...n[t],[s]:Number(e.target.value)}}),className:"w-24 px-2 py-1 text-xs rounded bg-white/10 border border-white/20 text-right"}):(0,a.jsx)("span",{className:"text-sm font-mono",children:i?i(e?.[t]?.[s]):e?.[t]?.[s]??"—"})]},s))})]},t))})]})})}function z({rateLimitStatus:e,defaults:t,onSaveDefaults:s,saving:r}){let[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(t||{}),x=(0,d.c)("settings"),u=(0,d.c)("common");return(0,l.useEffect)(()=>{t&&m(t)},[t]),(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"speed"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:x("rateLimiting")})]}),i?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",onClick:()=>n(!1),children:u("cancel")}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{s(o),n(!1)},disabled:r,children:u("save")})]}):(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>n(!0),children:u("edit")})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:x("rateLimitingDesc")}),(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4 mb-4",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider mb-3 text-text-muted",children:x("defaultSafetyNet")}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[{key:"requestsPerMinute",label:x("rpm")},{key:"minTimeBetweenRequests",label:x("minGap"),format:F},{key:"concurrentRequests",label:x("maxConcurrent")}].map(({key:e,label:s,format:l})=>(0,a.jsxs)("div",{children:[i?(0,a.jsx)("input",{type:"number",min:"1",value:o[e]??0,onChange:t=>m(s=>({...s,[e]:parseInt(t.target.value)||0})),className:"w-full px-2 py-1 text-lg font-bold rounded bg-white/10 border border-white/20"}):(0,a.jsx)("div",{className:"text-lg font-bold",children:l?l(t?.[e]):t?.[e]??"—"}),(0,a.jsx)("div",{className:"text-xs text-text-muted",children:s})]},e))})]}),e&&e.length>0?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text-muted",children:x("activeLimiters")}),e.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.provider||e.key}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[null!=e.reservoir&&(0,a.jsxs)("span",{children:[x("reservoir"),": ",e.reservoir]}),null!=e.running&&(0,a.jsxs)("span",{children:[x("running"),": ",e.running]}),null!=e.queued&&(0,a.jsxs)("span",{children:[x("queued"),": ",e.queued]})]})]},t))]}):(0,a.jsx)("p",{className:"text-xs text-text-muted",children:x("noActiveLimiters")})]})})}function R({breakers:e,onReset:t,loading:s}){let l=e.filter(e=>"CLOSED"!==e.state),r=e.length,i=(0,d.c)("settings");return(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"electrical_services"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:i("circuitBreakers")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l.length>0?i("tripped",{count:l.length}):i("healthy",{count:r})}),l.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"danger",icon:"restart_alt",onClick:t,disabled:s,children:i("resetAll")})]})]}),0===e.length?(0,a.jsx)("p",{className:"text-sm text-text-muted",children:i("noCircuitBreakers")}):(0,a.jsx)("div",{className:"space-y-2",children:e.map(e=>{let t=E[e.state]||E.CLOSED;return(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-base ${t.text}`,"aria-hidden":"true",children:t.icon}),(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name.replace("combo:","")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[e.failureCount>0&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:i("failures",{count:e.failureCount})}),(0,a.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-bold uppercase ${t.bg} ${t.text} border ${t.border}`,children:K(e.state,i)})]})]},e.name)})})]})})}function I(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(null),m=(0,g.i)(),x=(0,o.Ym)(),u=(0,d.c)("settings"),h=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/policies");if(e.ok){let s=await e.json();t(s)}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{h();let e=setInterval(h,15e3);return()=>clearInterval(e)},[h]);let p=async e=>{n(e);try{(await fetch("/api/policies",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"unlock",identifier:e})})).ok?(m.success(u("unlockedIdentifier",{identifier:e})),await h()):m.error(u("failedUnlock"))}catch{m.error(u("failedUnlock"))}finally{n(null)}},b=e?.circuitBreakers||[],f=e?.lockedIdentifiers||[],j=b.some(e=>"closed"!==e.state)||f.length>0;return s?(0,a.jsx)(c.Zp,{className:"p-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"policy"}),u("loadingPolicies")]})}):(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"policy"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:u("policiesLocked")})]}),j&&(0,a.jsx)(c.$n,{size:"sm",variant:"ghost",onClick:h,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"refresh"})})]}),j?(0,a.jsxs)(a.Fragment,{children:[b.filter(e=>"closed"!==e.state).length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:u("circuitBreakers")}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:b.filter(e=>"closed"!==e.state).map((e,t)=>{let s=O[e.state]||O.open;return(0,a.jsx)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:s.color},children:s.icon}),(0,a.jsx)("span",{className:"text-sm text-text-main font-medium",children:e.name||e.provider||u("unknown")}),(0,a.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:`${s.color}15`,color:s.color},children:K(e.state,u)}),e.failures>0&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:u("failures",{count:e.failures})})]})},e.name||t)})})]}),f.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:u("lockedIdentifiers")}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:f.map((e,t)=>{let s="string"==typeof e?e:e.identifier||e.id;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-red-400",children:"lock"}),(0,a.jsx)("span",{className:"font-mono text-sm text-text-main",children:s}),"object"==typeof e&&e.lockedAt&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:u("sinceDate",{date:new Date(e.lockedAt).toLocaleString(x)})})]}),(0,a.jsx)(c.$n,{size:"sm",variant:"ghost",onClick:()=>p(s),disabled:i===s,className:"text-xs",children:i===s?u("unlocking"):u("forceUnlock")})]},s||t)})})]})]}):(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-emerald-500/10 text-emerald-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"verified_user"})}),(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:"text-sm text-text-muted",children:u("allOperational")})})]})]})})}function q(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(null),x=(0,d.c)("settings"),u=(0,l.useCallback)(async()=>{try{r(!0);let e=await fetch("/api/resilience");if(!e.ok)throw Error(x("failedLoadWithStatus",{status:e.status}));let s=await e.json();t(s),m(null)}catch(e){m(_(e,x("failedLoadResilience")))}finally{r(!1)}},[x]);(0,l.useEffect)(()=>{u();let e=setInterval(u,1e4);return()=>clearInterval(e)},[u]);let h=async()=>{try{if(r(!0),!(await fetch("/api/resilience/reset",{method:"POST"})).ok)throw Error(x("resetFailed"));await u()}catch(e){m(_(e,x("resetFailed")))}finally{r(!1)}},p=async e=>{try{if(n(!0),!(await fetch("/api/resilience",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({profiles:e})})).ok)throw Error(x("saveFailed"));await u()}catch(e){m(_(e,x("saveFailed")))}finally{n(!1)}},b=async e=>{try{if(n(!0),!(await fetch("/api/resilience",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaults:e})})).ok)throw Error(x("saveFailed"));await u()}catch(e){m(_(e,x("saveFailed")))}finally{n(!1)}};return s&&!e?(0,a.jsxs)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"hourglass_empty"}),x("loadingResilience")]}):o&&!e?(0,a.jsxs)(c.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"error"}),(0,a.jsx)("span",{className:"text-sm",children:o})]}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:u,className:"mt-3",children:x("retry")})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(B,{profiles:e?.profiles||{},onSave:p,saving:i}),(0,a.jsx)(z,{rateLimitStatus:e?.rateLimitStatus||[],defaults:e?.defaults||{},onSaveDefaults:b,saving:i}),(0,a.jsx)(R,{breakers:e?.circuitBreakers||[],onReset:h,loading:s}),(0,a.jsx)(I,{})]})}let Z=[{id:"general",labelKey:"general",icon:"settings"},{id:"ai",labelKey:"ai",icon:"smart_toy"},{id:"security",labelKey:"security",icon:"shield"},{id:"routing",labelKey:"routing",icon:"route"},{id:"resilience",labelKey:"resilience",icon:"electrical_services"},{id:"advanced",labelKey:"advanced",icon:"tune"}];function U(){let e=(0,d.c)("settings"),t=(0,r.useSearchParams)().get("tab"),[s,c]=(0,l.useState)(null),o=s||Z.find(e=>e.id===t)?.id||"general";return(0,a.jsx)("div",{className:"max-w-2xl mx-auto min-w-0",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)("div",{className:"w-full overflow-x-auto pb-1",children:(0,a.jsx)("div",{role:"tablist","aria-label":e("settingsSectionsAria"),className:"inline-flex items-center p-1 rounded-lg bg-black/5 dark:bg-white/5 min-w-max",children:Z.map(t=>(0,a.jsxs)("button",{role:"tab","aria-selected":o===t.id,tabIndex:o===t.id?0:-1,onClick:()=>c(t.id),className:(0,i.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all text-sm",o===t.id?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]","aria-hidden":"true",children:t.icon}),(0,a.jsx)("span",{className:"hidden sm:inline whitespace-nowrap",children:e(t.labelKey)})]},t.id))})}),(0,a.jsxs)("div",{role:"tabpanel","aria-label":e(Z.find(e=>e.id===o)?.labelKey||"general"),children:["general"===o&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(m,{}),(0,a.jsx)(S,{})]})}),"ai"===o&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)($,{}),(0,a.jsx)(A,{}),(0,a.jsx)(M,{})]}),"security"===o&&(0,a.jsx)(b,{}),"routing"===o&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(v,{}),(0,a.jsx)(N,{}),(0,a.jsx)(T,{}),(0,a.jsx)(L,{})]}),"resilience"===o&&(0,a.jsx)(q,{}),"advanced"===o&&(0,a.jsx)(k,{})]}),(0,a.jsxs)("div",{className:"text-center text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[n.vQ.name," v",n.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:e("localMode")})]})]})})}},40993:(e,t,s)=>{"use strict";s.d(t,{Ex:()=>c.default,$n:()=>a.default,Zp:()=>i.default,Qv:()=>d.CardSkeleton,G9:()=>j.default,bQ:()=>k.default,pp:()=>v.default,Qn:()=>N.default,pd:()=>l.default,Mh:()=>f.default,uR:()=>u.default,aF:()=>n.default,rq:()=>x.default,LF:()=>m.default,KN:()=>b.default,Lo:()=>g.default,y7:()=>p.default,Iz:()=>y.default,l6:()=>r.default,lM:()=>o.default,cn:()=>h.default});var a=s(35806),l=s(34422),r=s(42994),i=s(81060),n=s(71361),d=s(92542);s(17705);var c=s(80927),o=s(19790);s(6261),s(55846),s(34243),s(89938),s(99023);var m=s(80178),x=s(85444),u=s(91961);s(25112);var h=s(45624),p=s(37415),b=s(48643),g=s(8287);s(1652);var f=s(92701);s(18150);var j=s(71689),y=s(33709);s(76332);var v=s(66200);s(61580);var N=s(51503);s(54128);var k=s(44638);s(21720),s(97050)},99344:(e,t,s)=>{Promise.resolve().then(s.bind(s,3612))}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=99344)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2791],{3612:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>U});var a=s(95155),l=s(12115),r=s(73321),i=s(67040),n=s(52529),d=s(50910),c=s(40993),o=s(33418);function m(){let[e,t]=(0,l.useState)([]),[s,r]=(0,l.useState)(!1),[i,n]=(0,l.useState)(!1),[m,x]=(0,l.useState)({type:"",message:""}),[u,h]=(0,l.useState)(null),[p,b]=(0,l.useState)(null),[g,f]=(0,l.useState)(!1),[j,y]=(0,l.useState)({type:"",message:""}),[v,N]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)({type:"",message:""}),[D,P]=(0,l.useState)(!1),[$,A]=(0,l.useState)(null),T=(0,l.useRef)(null),L=(0,o.Ym)(),M=(0,d.c)("settings"),E=(0,d.c)("common"),[O,K]=(0,l.useState)({driver:"sqlite",dbPath:"~/.omniroute/storage.sqlite",sizeBytes:0,retentionDays:90,lastBackupAt:null}),F=async()=>{r(!0);try{let e=await fetch("/api/db-backups"),s=await e.json();t(s.backups||[])}catch(e){console.error("Failed to fetch backups:",e)}finally{r(!1)}},_=async()=>{try{let e=await fetch("/api/storage/health");if(!e.ok)return;let t=await e.json();K(e=>({...e,...t}))}catch(e){console.error("Failed to fetch storage health:",e)}},B=async()=>{f(!0),y({type:"",message:""});try{let e=await fetch("/api/db-backups",{method:"PUT"}),t=await e.json();e.ok?(t.filename?y({type:"success",message:M("backupCreated",{file:t.filename})}):y({type:"info",message:t.message||M("noChangesSinceBackup")}),await _(),i&&await F()):y({type:"error",message:t.error||M("backupFailed")})}catch{y({type:"error",message:M("errorOccurred")})}finally{f(!1)}},z=async e=>{h(e),x({type:"",message:""});try{let t=await fetch("/api/db-backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupId:e})}),s=await t.json();t.ok?(x({type:"success",message:M("restoreSuccess",{connections:s.connectionCount,nodes:s.nodeCount,combos:s.comboCount,apiKeys:s.apiKeyCount})}),await F(),await _()):x({type:"error",message:s.error||M("restoreFailed")})}catch{x({type:"error",message:M("errorDuringRestore")})}finally{h(null),b(null)}};(0,l.useEffect)(()=>{_()},[]);let R=async()=>{N(!0);try{let e=await fetch("/api/db-backups/export");if(!e.ok){let t=await e.json();throw Error(t.error||M("exportFailed"))}let t=await e.blob(),s=URL.createObjectURL(t),a=(e.headers.get("Content-Disposition")||"").match(/filename="(.+)"/),l=a?a[1]:`omniroute-backup-${new Date().toISOString().replace(/[:.]/g,"-")}.sqlite`,r=document.createElement("a");r.href=s,r.download=l,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}catch(e){console.error("Export failed:",e),S({type:"error",message:M("exportFailedWithError",{error:e.message})})}finally{N(!1)}},I=async()=>{if($){w(!0),S({type:"",message:""}),P(!1);try{let e=new FormData;e.append("file",$);let t=await fetch("/api/db-backups/import",{method:"POST",body:e}),s=await t.json();t.ok?(S({type:"success",message:M("importSuccess",{connections:s.connectionCount,nodes:s.nodeCount,combos:s.comboCount,apiKeys:s.apiKeyCount})}),await _(),i&&await F()):S({type:"error",message:s.error||M("importFailed")})}catch{S({type:"error",message:M("errorDuringImport")})}finally{w(!1),A(null)}}},q=e=>e&&0!==e?e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`:"0 B";return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-green-500/10 text-green-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"database"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:M("systemStorage")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:M("allDataLocal")})]}),(0,a.jsx)(c.Ex,{variant:"success",size:"sm",children:O.driver||"json"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-4",children:[(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:M("databasePath")}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main break-all",children:O.dbPath||"~/.omniroute/storage.sqlite"})]}),(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:M("databaseSize")}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main",children:q(O.sizeBytes)})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:R,loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"download"}),M("exportDatabase")]}),(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:async()=>{N(!0);try{let e=await fetch("/api/db-backups/exportAll");if(!e.ok)throw Error(M("exportFailed"));let t=await e.blob(),s=(e.headers.get("Content-Disposition")||"").match(/filename="?([^"]+)"?/),a=s?.[1]||"omniroute-full-backup.tar.gz",l=URL.createObjectURL(t),r=document.createElement("a");r.href=l,r.download=a,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(l)}catch(e){S({type:"error",message:M("fullExportFailedWithError",{error:e.message})})}finally{N(!1)}},loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"folder_zip"}),M("exportAll")]}),(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:()=>{T.current?.click()},loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"upload"}),M("importDatabase")]}),(0,a.jsx)("input",{ref:T,type:"file",accept:".sqlite",className:"hidden",onChange:e=>{let t=e.target.files?.[0];if(t){if(!t.name.endsWith(".sqlite"))return void S({type:"error",message:M("invalidFileType")});A(t),P(!0),T.current&&(T.current.value="")}}})]}),D&&$&&(0,a.jsx)("div",{className:"p-4 rounded-lg mb-4 bg-amber-500/10 border border-amber-500/30",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-amber-500 mt-0.5","aria-hidden":"true",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-500 mb-1",children:M("confirmDbImport")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:M("confirmDbImportDesc",{file:$.name})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:I,className:"!bg-amber-500 hover:!bg-amber-600",children:M("yesImport")}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:()=>{P(!1),A(null)},children:E("cancel")})]})]})]})}),C.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-4 text-sm ${"success"===C.type?"bg-green-500/10 text-green-500 border border-green-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===C.type?"check_circle":"error"}),C.message]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-bg border border-border mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"schedule"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:M("lastBackup")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:O.lastBackupAt?`${new Date(O.lastBackupAt).toLocaleString(L)} (${(e=>{if(!e)return null;let t=Math.floor((new Date-new Date(e))/6e4);if(t<1)return M("justNow");if(t<60)return M("minutesAgo",{count:t});let s=Math.floor(t/60);return s<24?M("hoursAgo",{count:s}):M("daysAgo",{count:Math.floor(s/24)})})(O.lastBackupAt)})`:M("noBackupYet")})]})]}),(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:B,loading:g,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"backup"}),M("backupNow")]})]}),j.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-4 text-sm ${"success"===j.type?"bg-green-500/10 text-green-500 border border-green-500/20":"info"===j.type?"bg-blue-500/10 text-blue-500 border border-blue-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===j.type?"check_circle":"info"===j.type?"info":"error"}),j.message]})}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-amber-500","aria-hidden":"true",children:"restore"}),(0,a.jsx)("p",{className:"font-medium",children:M("backupRestore")})]}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:()=>{n(!i),i||0!==e.length||F()},children:i?M("hide"):M("viewBackups")})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:M("backupRetentionDesc")}),m.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-3 text-sm ${"success"===m.type?"bg-green-500/10 text-green-500 border border-green-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===m.type?"check_circle":"error"}),m.message]})}),i&&(0,a.jsx)("div",{className:"flex flex-col gap-2",children:s?(0,a.jsxs)("div",{className:"flex items-center justify-center py-6 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px] mr-2","aria-hidden":"true",children:"progress_activity"}),M("loadingBackups")]}):0===e.length?(0,a.jsxs)("div",{className:"text-center py-6 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] mb-2 block opacity-40","aria-hidden":"true",children:"folder_off"}),M("noBackupsYet")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:M("backupsAvailable",{count:e.length})}),(0,a.jsxs)("button",{onClick:F,className:"text-xs text-primary hover:underline flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"refresh"}),M("refresh")]})]}),e.map(e=>{var t;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-black/[0.02] dark:bg-white/[0.02] border border-border/50 hover:border-border transition-colors",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"description"}),(0,a.jsx)("span",{className:"text-sm font-medium truncate",children:new Date(e.createdAt).toLocaleString(L)}),(0,a.jsx)(c.Ex,{variant:"pre-restore"===e.reason?"warning":"manual"===e.reason?"success":"default",size:"sm",children:"manual"===(t=e.reason)?M("backupReasonManual"):"pre-restore"===t?M("backupReasonPreRestore"):t})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted ml-6",children:[(0,a.jsx)("span",{children:M("connectionsCount",{count:e.connectionCount})}),(0,a.jsx)("span",{children:"•"}),(0,a.jsx)("span",{children:q(e.size)})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 ml-3",children:p===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-xs text-amber-500 font-medium",children:M("confirm")}),(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:()=>z(e.id),loading:u===e.id,className:"!bg-amber-500 hover:!bg-amber-600",children:M("yes")}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:()=>b(null),children:M("no")})]}):(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:()=>b(e.id),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"restore"}),M("restore")]})})]},e.id)})]})})]})]})}var x=s(20909);let u=[{value:"disabled",labelKey:"ipModeDisabled",icon:"block"},{value:"blacklist",labelKey:"ipModeBlacklist",icon:"do_not_disturb"},{value:"whitelist",labelKey:"ipModeWhitelist",icon:"verified_user"},{value:"whitelist-priority",labelKey:"ipModeWhitelistPriority",icon:"priority_high"}];function h(){let[e,t]=(0,l.useState)({enabled:!1,mode:"blacklist",blacklist:[],whitelist:[],tempBans:[]}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(""),[o,m]=(0,l.useState)("blacklist"),x=(0,d.c)("settings");(0,l.useEffect)(()=>{h()},[]);let h=async()=>{try{let e=await fetch("/api/settings/ip-filter");e.ok&&t(await e.json())}catch{}finally{r(!1)}},p=async e=>{try{let s=await fetch("/api/settings/ip-filter",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});s.ok&&t(await s.json())}catch{}},b=()=>{i.trim()&&(p({["blacklist"===o?"addBlacklist":"addWhitelist"]:i.trim()}),n(""))},g=(e,t)=>{p({["blacklist"===t?"removeBlacklist":"removeWhitelist"]:e})},f=e.enabled?e.mode:"disabled";return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-red-500/10 text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"security"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("ipAccessControl")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("ipAccessControlDesc")})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2 mb-5",children:u.map(e=>(0,a.jsxs)("button",{onClick:()=>{var t;"disabled"===(t=e.value)?p({enabled:!1}):p({enabled:!0,mode:t})},disabled:s,className:`flex flex-col items-center gap-1.5 p-3 rounded-lg border text-center transition-all ${f===e.value?"border-red-500/50 bg-red-500/5 ring-1 ring-red-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] ${f===e.value?"text-red-400":"text-text-muted"}`,children:e.icon}),(0,a.jsx)("span",{className:`text-xs font-medium ${f===e.value?"text-red-400":"text-text-muted"}`,children:x(e.labelKey)})]},e.value))}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 items-stretch sm:items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(c.pd,{label:x("addIpAddress"),placeholder:x("ipAddressPlaceholder"),value:i,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&b()})}),(0,a.jsxs)("div",{className:"flex gap-1 pb-[2px]",children:[(0,a.jsx)(c.$n,{size:"sm",variant:"blacklist"===o?"danger":"secondary",onClick:()=>{m("blacklist"),i.trim()&&b()},children:x("block")}),(0,a.jsx)(c.$n,{size:"sm",variant:"whitelist"===o?"primary":"secondary",onClick:()=>{m("whitelist"),i.trim()&&b()},children:x("allow")})]})]}),e.blacklist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:x("blocked",{count:e.blacklist.length})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.blacklist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-red-500/10 text-red-400 border border-red-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>g(e,"blacklist"),className:"hover:text-red-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.whitelist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:x("allowed",{count:e.whitelist.length})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.whitelist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>g(e,"whitelist"),className:"hover:text-emerald-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.tempBans.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:x("temporaryBans",{count:e.tempBans.length})}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:e.tempBans.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 rounded-lg bg-orange-500/5 border border-orange-500/20 text-sm",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-xs text-orange-400 shrink-0",children:e.ip}),(0,a.jsxs)("span",{className:"text-xs text-text-muted truncate",children:["— ",e.reason]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted tabular-nums",children:x("minLeft",{min:Math.ceil(e.remainingMs/6e4)})}),(0,a.jsx)("button",{onClick:()=>p({removeBan:e.ip}),className:"text-text-muted hover:text-orange-400",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]},e.ip))})]})]})]})}function p(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),i=(0,d.c)("settings");(0,l.useEffect)(()=>{let e=!1;return async function(){let s=sessionStorage.getItem("omniroute_login_time"),a=Date.now(),l=i("unknown");if(s){let e=a-parseInt(s,10),t=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4);l=t>0?`${t}h ${r}m`:`${r}m`}let n=!1;try{let e=await fetch("/api/auth/status",{method:"GET",cache:"no-store"});if(e.ok){let t=await e.json();n=!0===t.authenticated}}catch{}e||(t({authenticated:n,loginTime:s?new Date(parseInt(s,10)).toLocaleString():null,sessionAge:l,ipAddress:"—",userAgent:navigator.userAgent.split(" ").slice(-2).join(" ")||i("unknown")}),r(!1))}(),()=>{e=!0}},[]);let n=async()=>{try{await fetch("/api/auth/logout",{method:"POST"}),sessionStorage.removeItem("omniroute_login_time"),window.location.href="/"}catch{window.location.href="/"}};return s?(0,a.jsx)(c.Zp,{children:(0,a.jsx)("div",{className:"animate-pulse h-32 bg-black/5 dark:bg-white/5 rounded-lg"})}):(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"person"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:i("session")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",role:"list","aria-label":i("sessionDetailsAria"),children:[(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("status")}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:`w-2 h-2 rounded-full ${e?.authenticated?"bg-green-500":"bg-yellow-500"}`,"aria-hidden":"true"}),e?.authenticated?i("authenticated"):i("guest")]})]}),e?.loginTime&&(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("loginTime")}),(0,a.jsx)("span",{className:"font-mono text-xs",children:e.loginTime})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("sessionAge")}),(0,a.jsx)("span",{className:"font-mono text-xs",children:e?.sessionAge})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("browser")}),(0,a.jsx)("span",{className:"font-mono text-xs truncate max-w-[200px]",children:e?.userAgent})]})]}),(0,a.jsxs)("div",{className:"flex gap-3 mt-4 pt-4 border-t border-border/50",children:[(0,a.jsx)(c.$n,{variant:"secondary",onClick:()=>{confirm(i("clearLocalDataConfirm"))&&(localStorage.clear(),sessionStorage.clear(),window.location.reload())},children:i("clearLocalData")}),e?.authenticated&&(0,a.jsx)(c.$n,{variant:"danger",onClick:n,children:i("logout")})]})]})}function b(){let[e,t]=(0,l.useState)({requireLogin:!1,hasPassword:!1}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)({current:"",new:"",confirm:""}),[o,m]=(0,l.useState)({type:"",message:""}),[u,b]=(0,l.useState)(!1),g=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let f=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&t(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},j=async(e,s)=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:s})})).ok&&t(t=>({...t,[e]:s}))}catch(t){console.error(`Failed to update ${e}:`,t)}},y=async e=>{if(e.preventDefault(),i.new!==i.confirm)return void m({type:"error",message:g("passwordsNoMatch")});b(!0),m({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:i.current,newPassword:i.new})}),t=await e.json();e.ok?(m({type:"success",message:g("passwordUpdated")}),n({current:"",new:"",confirm:""})):m({type:"error",message:t.error||g("failedUpdatePassword")})}catch{m({type:"error",message:g("errorOccurred")})}finally{b(!1)}},v=e.blockedProviders||[];return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"shield"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:g("security")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:g("requireLogin")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:g("requireLoginDesc")})]}),(0,a.jsx)(c.lM,{checked:!0===e.requireLogin,onChange:()=>f(!e.requireLogin),disabled:s})]}),!0===e.requireLogin&&(0,a.jsxs)("form",{onSubmit:y,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[e.hasPassword&&(0,a.jsx)(c.pd,{label:g("currentPassword"),type:"password",placeholder:g("enterCurrentPassword"),value:i.current,onChange:e=>n({...i,current:e.target.value}),required:!0}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsx)(c.pd,{label:g("newPassword"),type:"password",placeholder:g("enterNewPassword"),value:i.new,onChange:e=>n({...i,new:e.target.value}),required:!0}),(0,a.jsx)(c.pd,{label:g("confirmPassword"),type:"password",placeholder:g("confirmPasswordPlaceholder"),value:i.confirm,onChange:e=>n({...i,confirm:e.target.value}),required:!0})]}),o.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===o.type?"text-red-500":"text-green-500"}`,children:o.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(c.$n,{type:"submit",variant:"primary",loading:u,children:e.hasPassword?g("updatePassword"):g("setPassword")})})]})]})]}),(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-600 dark:text-amber-400",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"api"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:g("apiEndpointProtection")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:g("requireAuthModels")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:g("requireAuthModelsDesc")})]}),(0,a.jsx)(c.lM,{checked:!0===e.requireAuthForModels,onChange:()=>j("requireAuthForModels",!e.requireAuthForModels),disabled:s})]}),(0,a.jsxs)("div",{className:"pt-4 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("p",{className:"font-medium",children:g("blockedProviders")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:g("blockedProvidersDesc")})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.values(x.Q2).map(t=>{let l=v.includes(t.id);return(0,a.jsxs)("button",{onClick:()=>{var s;let a;return s=t.id,void j("blockedProviders",(a=e.blockedProviders||[]).includes(s)?a.filter(e=>e!==s):[...a,s])},disabled:s,className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-all border ${l?"bg-red-500/10 border-red-500/30 text-red-600 dark:text-red-400":"bg-black/[0.02] dark:bg-white/[0.02] border-transparent text-text-muted hover:bg-black/[0.05] dark:hover:bg-white/[0.05]"}`,title:l?g("unblockProviderTitle",{provider:t.name}):g("blockProviderTitle",{provider:t.name}),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:{color:l?void 0:t.color},children:l?"block":t.icon}),t.name,l&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px] text-red-500",children:"close"})]},t.id)})}),v.length>0&&(0,a.jsxs)("p",{className:"text-xs text-amber-600 dark:text-amber-400 mt-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),g("providersBlocked",{count:v.length})]})]})]})]}),(0,a.jsx)(p,{}),(0,a.jsx)(h,{})]})}var g=s(67671);let f=["#6366f1","#22c55e","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#14b8a6"];function j(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),[h,p]=(0,l.useState)(!1),b=(0,g.i)(),j=(0,d.c)("settings"),y=(0,d.c)("common"),v=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/fallback/chains");if(e.ok){let s=await e.json();t(s.chains||s||{})}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{v()},[v]);let N=async()=>{if(!o.trim()||!x.trim())return void b.warning(j("fillModelAndProviders"));let e=x.split(",").map(e=>e.trim()).filter(Boolean).map((e,t)=>({provider:e,priority:t+1,enabled:!0}));if(0===e.length)return void b.warning(j("addAtLeastOneProvider"));p(!0);try{(await fetch("/api/fallback/chains",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:o.trim(),chain:e})})).ok?(b.success(j("chainCreated",{model:o.trim()})),m(""),u(""),n(!1),await v()):b.error(j("failedCreateChain"))}catch{b.error(j("failedCreateChain"))}finally{p(!1)}},k=async e=>{if(confirm(j("deleteChainConfirm",{model:e})))try{(await fetch("/api/fallback/chains",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:e})})).ok?(b.success(j("chainDeleted",{model:e})),await v()):b.error(j("failedDeleteChain"))}catch{b.error(j("failedDeleteChain"))}};if(s)return(0,a.jsx)(c.Zp,{className:"p-6 mt-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"timeline"}),j("loadingFallbackChains")]})});let w=Object.entries(e);return(0,a.jsxs)(c.Zp,{className:"mt-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4 p-6 pb-0",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-cyan-500/10 text-cyan-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"timeline"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:j("fallbackChainsTitle")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:j("fallbackChainsDesc")})]}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",onClick:()=>n(!i),children:i?y("cancel"):j("addChain")})]}),i&&(0,a.jsxs)("div",{className:"mx-6 p-4 rounded-lg border border-border/30 bg-surface/20 mb-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mb-3",children:[(0,a.jsx)(c.pd,{label:j("modelName"),placeholder:j("modelNamePlaceholder"),value:o,onChange:e=>m(e.target.value)}),(0,a.jsx)(c.pd,{label:j("providersCommaSeparated"),placeholder:j("providersCommaSeparatedPlaceholder"),value:x,onChange:e=>u(e.target.value)})]}),(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:N,loading:h,children:j("createChain")})]}),(0,a.jsx)("div",{className:"px-6 pb-6",children:0===w.length?(0,a.jsx)(c.pp,{icon:"timeline",title:j("noFallbackChains"),description:j("noFallbackChainsDesc")}):(0,a.jsx)("div",{className:"flex flex-col gap-2",children:w.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 rounded-lg border border-border/20 bg-surface/20 hover:bg-surface/40 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("span",{className:"font-mono text-sm text-text-main truncate max-w-[200px]",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("div",{className:"flex gap-1.5 flex-wrap",children:(Array.isArray(t)?t:[]).map((e,t)=>(0,a.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:`${f[t%f.length]}20`,color:f[t%f.length],border:`1px solid ${f[t%f.length]}40`},children:[t+1,". ",e.provider]},`${e.provider}-${t}`))})]}),(0,a.jsx)("button",{onClick:()=>k(e),className:"text-text-muted hover:text-red-400 transition-colors ml-2",title:j("deleteChain"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},e))})})]})}let y=[{value:"fill-first",labelKey:"fillFirst",descKey:"fillFirstDesc",icon:"vertical_align_top"},{value:"round-robin",labelKey:"roundRobin",descKey:"roundRobinDesc",icon:"loop"},{value:"p2c",labelKey:"p2c",descKey:"p2cDesc",icon:"balance"},{value:"random",labelKey:"random",descKey:"randomDesc",icon:"shuffle"},{value:"least-used",labelKey:"leastUsed",descKey:"leastUsedDesc",icon:"low_priority"},{value:"cost-optimized",labelKey:"costOpt",descKey:"costOptDesc",icon:"savings"}];function v(){let[e,t]=(0,l.useState)({fallbackStrategy:"fill-first"}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)([]),[o,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),h=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),n(e.wildcardAliases||[]),r(!1)}).catch(()=>r(!1))},[]);let p=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&t(t=>({...t,...e}))}catch(e){console.error("Failed to update settings:",e)}},b=async()=>{if(!o.trim()||!x.trim())return;let e=[...i,{pattern:o.trim(),target:x.trim()}];await p({wildcardAliases:e}),n(e),m(""),u("")},g=async e=>{let t=i.filter((t,s)=>s!==e);await p({wildcardAliases:t}),n(t)};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"route"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:h("routingStrategy")})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-2 mb-4",style:{gridAutoRows:"1fr"},children:y.map(t=>(0,a.jsxs)("button",{onClick:()=>p({fallbackStrategy:t.value}),disabled:s,className:`flex flex-col items-center gap-2 p-4 rounded-lg border text-center transition-all ${e.fallbackStrategy===t.value?"border-blue-500/50 bg-blue-500/5 ring-1 ring-blue-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[24px] ${e.fallbackStrategy===t.value?"text-blue-400":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.fallbackStrategy===t.value?"text-blue-400":""}`,children:h(t.labelKey)}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:h(t.descKey)})]})]},t.value))}),"round-robin"===e.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-3 border-t border-border/30",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:h("stickyLimit")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:h("stickyLimitDesc")})]}),(0,a.jsx)(c.pd,{type:"number",min:"1",max:"10",value:e.stickyRoundRobinLimit||3,onChange:e=>p({stickyRoundRobinLimit:parseInt(e.target.value)}),disabled:s,className:"w-20 text-center"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted italic pt-3 border-t border-border/30 mt-3",children:h({"fill-first":"fillFirstDesc","round-robin":"roundRobinDesc",p2c:"p2cDesc",random:"randomDesc","least-used":"leastUsedDesc","cost-optimized":"costOptDesc"}[e.fallbackStrategy]||"fillFirstDesc")})]}),(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"alt_route"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:h("modelAliases")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:h("modelAliasesDesc")})]})]}),i.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-1.5 mb-4",children:i.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-sm",children:[(0,a.jsx)("span",{className:"font-mono text-purple-400 break-all",children:e.pattern}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("span",{className:"font-mono text-text-main break-all",children:e.target})]}),(0,a.jsx)("button",{onClick:()=>g(t),className:"shrink-0 text-text-muted hover:text-red-400 transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},t))}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 items-stretch sm:items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(c.pd,{label:h("pattern"),placeholder:h("aliasPatternPlaceholder"),value:o,onChange:e=>m(e.target.value)})}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(c.pd,{label:h("targetModel"),placeholder:h("aliasTargetPlaceholder"),value:x,onChange:e=>u(e.target.value)})}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",onClick:b,className:"mb-[2px] sm:w-auto w-full",children:h("add")})]})]}),(0,a.jsx)(j,{})]})}function N(){let[e,t]=(0,l.useState)({strategy:"priority",maxRetries:1,retryDelayMs:2e3,timeoutMs:12e4,healthCheckEnabled:!0,healthCheckTimeoutMs:3e3,maxComboDepth:3,trackMetrics:!0}),[s,r]=(0,l.useState)({}),[n,o]=(0,l.useState)(""),[m,x]=(0,l.useState)(!1),u=(0,d.c)("settings"),h=(0,d.c)("common"),p=[{value:"priority",label:u("priority"),icon:"sort"},{value:"weighted",label:u("weighted"),icon:"percent"},{value:"round-robin",label:u("roundRobin"),icon:"autorenew"},{value:"random",label:u("random"),icon:"shuffle"},{value:"least-used",label:u("leastUsed"),icon:"low_priority"},{value:"cost-optimized",label:u("costOpt"),icon:"savings"}],b=[{key:"maxRetries",label:u("maxRetriesLabel"),min:0,max:5},{key:"retryDelayMs",label:u("retryDelayLabel"),min:500,max:1e4,step:500},{key:"timeoutMs",label:u("timeoutLabel"),min:5e3,max:3e5,step:5e3},{key:"maxComboDepth",label:u("maxNestingDepth"),min:1,max:10}];(0,l.useEffect)(()=>{fetch("/api/settings/combo-defaults").then(e=>e.json()).then(e=>{e.comboDefaults&&t(e.comboDefaults),e.providerOverrides&&r(e.providerOverrides)}).catch(e=>console.error("Failed to fetch combo defaults:",e))},[]);let g=async()=>{x(!0);try{await fetch("/api/settings/combo-defaults",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboDefaults:e,providerOverrides:s})})}catch(e){console.error("Failed to save combo defaults:",e)}finally{x(!1)}},f=()=>{let e=n.trim().toLowerCase();e&&!s[e]&&(r(t=>({...t,[e]:{maxRetries:1,timeoutMs:12e4}})),o(""))};return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"tune"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:u("comboDefaultsTitle")}),(0,a.jsx)("span",{className:"text-xs text-text-muted ml-auto",children:u("globalComboConfig")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:u("defaultStrategy")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("defaultStrategyDesc")})]}),(0,a.jsx)("div",{role:"tablist","aria-label":u("comboStrategyAria"),className:"grid grid-cols-3 gap-1 p-0.5 rounded-md bg-black/5 dark:bg-white/5",children:p.map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e.strategy===s.value,onClick:()=>t(e=>({...e,strategy:s.value})),className:(0,i.cn)("px-2 py-1 rounded text-xs font-medium transition-all flex items-center justify-center gap-0.5",e.strategy===s.value?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:s.icon}),s.label]},s.value))})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:b.map(({key:s,label:l,min:r,max:i,step:n})=>(0,a.jsx)(c.pd,{label:l,type:"number",min:r,max:i,step:n||1,value:e[s]??"",onChange:e=>t(t=>({...t,[s]:parseInt(e.target.value)||0})),className:"text-sm"},s))}),"round-robin"===e.strategy&&(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:[(0,a.jsx)(c.pd,{label:u("concurrencyPerModel"),type:"number",min:1,max:20,value:e.concurrencyPerModel??"",placeholder:"3",onChange:e=>t(t=>({...t,concurrencyPerModel:parseInt(e.target.value)||0})),className:"text-sm"}),(0,a.jsx)(c.pd,{label:u("queueTimeout"),type:"number",min:1e3,max:12e4,step:1e3,value:e.queueTimeoutMs??"",placeholder:"30000",onChange:e=>t(t=>({...t,queueTimeoutMs:parseInt(e.target.value)||0})),className:"text-sm"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:u("healthCheck")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("healthCheckDesc")})]}),(0,a.jsx)(c.lM,{checked:!1!==e.healthCheckEnabled,onChange:()=>t(e=>({...e,healthCheckEnabled:!e.healthCheckEnabled}))})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:u("trackMetrics")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("trackMetricsDesc")})]}),(0,a.jsx)(c.lM,{checked:!1!==e.trackMetrics,onChange:()=>t(e=>({...e,trackMetrics:!e.trackMetrics}))})]})]}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsx)("p",{className:"font-medium text-sm mb-2",children:u("providerOverrides")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:u("providerOverridesDesc")}),Object.entries(s).map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2 p-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,a.jsx)("span",{className:"text-xs font-mono font-medium min-w-[80px]",children:e}),(0,a.jsx)(c.pd,{type:"number",min:"0",max:"5",value:t.maxRetries??1,onChange:t=>r(s=>({...s,[e]:{...s[e],maxRetries:parseInt(t.target.value)||0}})),className:"text-xs w-16","aria-label":u("providerMaxRetriesAria",{provider:e})}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:u("retries")}),(0,a.jsx)(c.pd,{type:"number",min:"5000",max:"300000",step:"5000",value:t.timeoutMs??12e4,onChange:t=>r(s=>({...s,[e]:{...s[e],timeoutMs:parseInt(t.target.value)||12e4}})),className:"text-xs w-24","aria-label":u("providerTimeoutAria",{provider:e})}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:u("ms")}),(0,a.jsx)("button",{onClick:()=>{r(t=>{let s={...t};return delete s[e],s})},className:"ml-auto text-red-400 hover:text-red-500 transition-colors","aria-label":u("removeProviderOverrideAria",{provider:e}),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"close"})})]},e)),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,a.jsx)(c.pd,{type:"text",placeholder:u("newProviderNamePlaceholder"),value:n,onChange:e=>o(e.target.value),onKeyDown:e=>"Enter"===e.key&&f(),className:"text-xs flex-1","aria-label":u("newProviderNameAria")}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:f,disabled:!n.trim(),children:h("add")})]})]}),(0,a.jsx)("div",{className:"pt-3 border-t border-border/50",children:(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:g,loading:m,children:u("saveComboDefaults")})})]})]})}function k(){let[e,t]=(0,l.useState)(!1),[s,r]=(0,l.useState)(null),i=(0,l.useRef)(!0),n=(0,d.c)("settings"),o=(0,d.c)("common"),m=async()=>{try{let e=await fetch("/api/settings/proxy?level=global");if(e.ok){let t=await e.json();r(t.proxy||null)}}catch{}};return(0,l.useEffect)(()=>(i.current=!0,async function(){try{let e=await fetch("/api/settings/proxy?level=global");if(!i.current)return;if(e.ok){let t=await e.json();i.current&&r(t.proxy||null)}}catch{}}(),()=>{i.current=!1}),[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"vpn_lock"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:n("globalProxy")})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:n("globalProxyDesc")}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[s?(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("span",{className:"px-2.5 py-1 rounded text-xs font-bold uppercase bg-emerald-500/15 text-emerald-400 border border-emerald-500/30",children:[s.type,"://",s.host,":",s.port]})}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:n("noGlobalProxy")}),(0,a.jsx)(c.$n,{size:"sm",variant:s?"secondary":"primary",icon:"settings",onClick:()=>{m(),t(!0)},children:s?o("edit"):n("configure")})]})]})}),(0,a.jsx)(c.KN,{isOpen:e,onClose:()=>t(!1),level:"global",levelLabel:n("globalLabel"),onSaved:m})]})}var w=s(97550),C=s(76851);function S(){let{theme:e,setTheme:t,isDark:s}=(0,w.D)(),{colorTheme:r,customColor:n,setColorTheme:o,setCustomColorTheme:m}=(0,C.A)(),x=(0,d.c)("settings"),[u,h]=(0,l.useState)({}),[p,b]=(0,l.useState)(!0),[g,f]=(0,l.useState)(n||"#3b82f6"),j=/^#([0-9a-fA-F]{6})$/.test(g.startsWith("#")?g:`#${g}`);(0,l.useEffect)(()=>C.A.subscribe(e=>{e.customColor&&e.customColor!==g&&f(e.customColor)}),[]);let y={light:x("themeLight"),dark:x("themeDark"),system:x("themeSystem")};(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>{if(!e.ok)throw Error(`HTTP error ${e.status}`);return e.json()}).then(e=>{h(e),b(!1)}).catch(()=>b(!1))},[]);let v=async(e,t)=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:t})})).ok&&h(s=>({...s,[e]:t}))}catch(t){console.error(`Failed to update ${e}:`,t)}},N=[{id:"coral",color:C.F.coral,label:x("themeCoral")},{id:"blue",color:C.F.blue,label:x("themeBlue")},{id:"red",color:C.F.red,label:x("themeRed")},{id:"green",color:C.F.green,label:x("themeGreen")},{id:"violet",color:C.F.violet,label:x("themeViolet")},{id:"orange",color:C.F.orange,label:x("themeOrange")},{id:"cyan",color:C.F.cyan,label:x("themeCyan")}];return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"palette"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("appearance")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:x("darkMode")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("switchThemes")})]}),(0,a.jsx)(c.lM,{checked:s,onChange:()=>t(s?"light":"dark")})]}),(0,a.jsx)("div",{className:"pt-4 border-t border-border",children:(0,a.jsx)("div",{role:"tablist","aria-label":x("themeSelectionAria"),className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e===s,onClick:()=>t(s),className:(0,i.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{children:y[s]||s})]},s))})}),(0,a.jsxs)("div",{className:"pt-4 border-t border-border",children:[(0,a.jsx)("p",{className:"font-medium mb-1",children:x("themeAccent")}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-3",children:x("themeAccentDesc")}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mb-3",children:N.map(e=>{let t=r===e.id;return(0,a.jsx)("button",{onClick:()=>o(e.id),className:(0,i.cn)("flex items-center justify-between gap-2 p-2 rounded-lg border transition-colors",t?"border-primary bg-primary/10 text-primary":"border-border hover:bg-surface/50 text-text-main"),children:(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"size-4 rounded-full border border-black/10 dark:border-white/20",style:{backgroundColor:e.color}}),(0,a.jsx)("span",{className:"text-sm font-medium",children:e.label})]})},e.id)})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"color",value:g,onChange:e=>f(e.target.value),className:"h-10 w-12 rounded border border-border bg-surface cursor-pointer","aria-label":x("themeCustom")}),(0,a.jsx)("input",{type:"text",value:g,onChange:e=>f(e.target.value),placeholder:"#3b82f6",maxLength:7,className:`flex-1 h-10 px-3 rounded-lg bg-surface border text-sm text-text-main focus:outline-none ${j?"border-border focus:border-primary":"border-red-400 focus:border-red-500"}`}),(0,a.jsx)(c.$n,{onClick:()=>m(g),disabled:!j,children:x("themeCreate")})]})]}),(0,a.jsx)("div",{className:"pt-4 border-t border-border",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:x("hideHealthLogs")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("hideHealthLogsDesc")})]}),(0,a.jsx)(c.lM,{checked:!0===u.hideHealthCheckLogs,onChange:()=>v("hideHealthCheckLogs",!u.hideHealthCheckLogs),disabled:p})]})})]})]})}let D=[{value:"passthrough",labelKey:"passthrough",descKey:"passthroughDesc",icon:"arrow_forward"},{value:"auto",labelKey:"auto",descKey:"autoDesc",icon:"auto_awesome"},{value:"custom",labelKey:"custom",descKey:"customDesc",icon:"tune"},{value:"adaptive",labelKey:"adaptive",descKey:"adaptiveDesc",icon:"trending_up"}],P=[{value:"none",labelKey:"effortNone"},{value:"low",labelKey:"effortLow"},{value:"medium",labelKey:"effortMedium"},{value:"high",labelKey:"effortHigh"}];function $(){let[e,t]=(0,l.useState)({mode:"passthrough",customBudget:10240,effortLevel:"medium"}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(""),x=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/thinking-budget").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let u=async s=>{let a={...e,...s};t(a),n(!0),m("");try{(await fetch("/api/settings/thinking-budget",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok?(m("saved"),setTimeout(()=>m(""),2e3)):m("error")}catch{m("error")}finally{n(!1)}};return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-violet-500/10 text-violet-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"psychology"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("thinkingBudgetTitle")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("thinkingBudgetDesc")})]}),"saved"===o&&(0,a.jsxs)("span",{className:"ml-auto text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",x("saved")]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2 mb-5",children:D.map(t=>(0,a.jsxs)("button",{onClick:()=>u({mode:t.value}),disabled:s||i,className:`flex items-start gap-3 p-3 rounded-lg border text-left transition-all ${e.mode===t.value?"border-violet-500/50 bg-violet-500/5 ring-1 ring-violet-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] mt-0.5 ${e.mode===t.value?"text-violet-500":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.mode===t.value?"text-violet-400":""}`,children:x(t.labelKey)}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5 leading-relaxed",children:x(t.descKey)})]})]},t.value))}),"custom"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:x("tokenBudget")}),(0,a.jsxs)("span",{className:"text-sm font-mono tabular-nums text-violet-400",children:[e.customBudget.toLocaleString()," ",x("tokens")]})]}),(0,a.jsx)("input",{type:"range",min:"0",max:"131072",step:"1024",value:e.customBudget,onChange:e=>u({customBudget:parseInt(e.target.value)}),className:"w-full accent-violet-500"}),(0,a.jsxs)("div",{className:"flex justify-between text-xs text-text-muted mt-1",children:[(0,a.jsx)("span",{children:x("off")}),(0,a.jsx)("span",{children:"1K"}),(0,a.jsx)("span",{children:"10K"}),(0,a.jsx)("span",{children:"64K"}),(0,a.jsx)("span",{children:"128K"})]})]}),"adaptive"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30",children:[(0,a.jsx)("p",{className:"text-sm font-medium mb-3",children:x("baseEffortLevel")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:x("adaptiveHint")}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:P.map(t=>(0,a.jsx)("button",{onClick:()=>u({effortLevel:t.value}),disabled:s||i,className:`px-3 py-2 rounded-lg text-xs font-medium border transition-all ${e.effortLevel===t.value?"border-violet-500/50 bg-violet-500/10 text-violet-400":"border-border/50 text-text-muted hover:border-border"}`,children:x(t.labelKey)},t.value))})]})]})}function A(){let[e,t]=(0,l.useState)({enabled:!1,prompt:""}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(""),[o,m]=(0,l.useState)(null),x=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/system-prompt").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let u=async s=>{let a={...e,...s};t(a),n("");try{(await fetch("/api/settings/system-prompt",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(n("saved"),setTimeout(()=>n(""),2e3))}catch{n("error")}};return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"edit_note"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("globalSystemPrompt")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("systemPromptDesc")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:["saved"===i&&(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",x("saved")]}),(0,a.jsx)(c.lM,{checked:e.enabled,onChange:()=>u({enabled:!e.enabled}),disabled:s})]})]}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("textarea",{value:e.prompt,onChange:e=>{var s;return s=e.target.value,void(t(e=>({...e,prompt:s})),o&&clearTimeout(o),m(setTimeout(()=>{u({prompt:s})},800)))},placeholder:x("systemPromptPlaceholder"),rows:5,className:"w-full px-4 py-3 rounded-lg border border-border/50 bg-surface/30 text-sm placeholder:text-text-muted/50 resize-y min-h-[120px] focus:outline-none focus:ring-1 focus:ring-amber-500/30 focus:border-amber-500/50 transition-colors",disabled:s}),(0,a.jsx)("div",{className:"absolute bottom-2 right-3 text-xs text-text-muted/60 tabular-nums",children:x("chars",{count:e.prompt.length})})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted/70 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),x("systemPromptHint")]})]})]})}function T(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)({}),[i,n]=(0,l.useState)(!0),[o,m]=(0,l.useState)(!1),[x,u]=(0,l.useState)(""),[h,p]=(0,l.useState)(""),[b,g]=(0,l.useState)(""),f=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/model-aliases").then(e=>e.json()).then(e=>{t(e.builtIn||{}),r(e.custom||{}),n(!1)}).catch(()=>n(!1))},[]);let j=async()=>{if(h.trim()&&b.trim()){m(!0);try{let e=await fetch("/api/settings/model-aliases",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:h.trim(),to:b.trim()})});if(e.ok){let t=await e.json();r(t.custom),p(""),g(""),u("saved"),setTimeout(()=>u(""),2e3)}}catch{u("error")}finally{m(!1)}}},y=async e=>{m(!0);try{let t=await fetch("/api/settings/model-aliases",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:e})});if(t.ok){let e=await t.json();r(e.custom),u("saved"),setTimeout(()=>u(""),2e3)}}catch{u("error")}finally{m(!1)}},v=Object.entries(e),N=Object.entries(s);return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"swap_horiz"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:f("modelAliasesTitle")||"Model Aliases"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:f("modelAliasesDesc")||"Auto-forward deprecated model IDs to their replacements"})]}),"saved"===x&&(0,a.jsxs)("span",{className:"ml-auto text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",f("saved")||"Saved"]})]}),(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium mb-3",children:f("addCustomAlias")||"Add Custom Alias"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",placeholder:f("deprecatedModelId")||"Deprecated model ID",value:h,onChange:e=>p(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-amber-500/50 focus:outline-none"}),(0,a.jsx)("span",{className:"text-text-muted text-lg",children:"→"}),(0,a.jsx)("input",{type:"text",placeholder:f("newModelId")||"New model ID",value:b,onChange:e=>g(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-amber-500/50 focus:outline-none"}),(0,a.jsx)("button",{onClick:j,disabled:o||!h.trim()||!b.trim(),className:"px-4 py-2 rounded-lg text-sm font-medium bg-amber-500/10 text-amber-500 hover:bg-amber-500/20 disabled:opacity-50 transition-all",children:f("add")||"Add"})]})]}),N.length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-2",children:f("customAliases")||"Custom Aliases"}),(0,a.jsx)("div",{className:"rounded-lg border border-border/30 divide-y divide-border/20",children:N.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,a.jsx)("code",{className:"text-xs text-red-400/80 flex-1 truncate",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("code",{className:"text-xs text-emerald-400/80 flex-1 truncate",children:t}),(0,a.jsx)("button",{onClick:()=>y(e),disabled:o,className:"p-1 rounded hover:bg-red-500/10 text-text-muted hover:text-red-400 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},e))})]}),(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"text-xs font-medium text-text-muted uppercase tracking-wider cursor-pointer flex items-center gap-1 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] group-open:rotate-90 transition-transform",children:"chevron_right"}),f("builtInAliases")||"Built-in Aliases"," (",v.length,")"]}),(0,a.jsx)("div",{className:"rounded-lg border border-border/30 divide-y divide-border/20 max-h-60 overflow-y-auto",children:v.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2 opacity-60",children:[(0,a.jsx)("code",{className:"text-xs text-red-400/60 flex-1 truncate",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("code",{className:"text-xs text-emerald-400/60 flex-1 truncate",children:t}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"lock"})]},e))})]})]})}function L(){let[e,t]=(0,l.useState)({enabled:!1,degradationMap:{},detectionPatterns:[],stats:{detected:0,tokensSaved:0}}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),[h,p]=(0,l.useState)(""),[b,g]=(0,l.useState)(""),f=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/background-degradation").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let j=async s=>{let a={...e,...s};t(a),n(!0),m("");try{let{stats:e,...s}=a,l=await fetch("/api/settings/background-degradation",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(l.ok){let e=await l.json();t(e),m("saved"),setTimeout(()=>m(""),2e3)}else m("error")}catch{m("error")}finally{n(!1)}},y=Object.entries(e.degradationMap||{});return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-sky-500/10 text-sky-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"speed"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:f("backgroundDegradationTitle")||"Background Task Degradation"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:f("backgroundDegradationDesc")||"Auto-redirect background requests (titles, summaries) to cheaper models"})]}),"saved"===o&&(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",f("saved")||"Saved"]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:f("enableDegradation")||"Enable Background Degradation"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:f("enableDegradationHint")||"Automatically use cheaper models for background utility tasks"})]}),(0,a.jsx)("button",{onClick:()=>j({enabled:!e.enabled}),disabled:s||i,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${e.enabled?"bg-sky-500":"bg-white/10"}`,children:(0,a.jsx)("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${e.enabled?"translate-x-6":"translate-x-1"}`})})]}),e.stats&&e.stats.detected>0&&(0,a.jsx)("div",{className:"flex items-center gap-4 p-3 rounded-lg bg-sky-500/5 border border-sky-500/20 mb-4",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-sky-400",children:"analytics"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[f("tasksDetected")||"Tasks detected",":"]}),(0,a.jsx)("span",{className:"text-sm font-mono font-semibold text-sky-400",children:e.stats.detected})]})}),e.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-2",children:f("degradationMap")||"Model Degradation Map"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("input",{type:"text",placeholder:f("premiumModel")||"Premium model",value:x,onChange:e=>u(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-sky-500/50 focus:outline-none"}),(0,a.jsx)("span",{className:"text-text-muted text-lg",children:"→"}),(0,a.jsx)("input",{type:"text",placeholder:f("cheapModel")||"Cheap model",value:h,onChange:e=>p(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-sky-500/50 focus:outline-none"}),(0,a.jsx)("button",{onClick:()=>{x.trim()&&h.trim()&&(j({degradationMap:{...e.degradationMap,[x.trim()]:h.trim()}}),u(""),p(""))},disabled:i||!x.trim()||!h.trim(),className:"px-3 py-2 rounded-lg text-sm font-medium bg-sky-500/10 text-sky-500 hover:bg-sky-500/20 disabled:opacity-50 transition-all",children:f("add")||"Add"})]}),y.length>0&&(0,a.jsx)("div",{className:"rounded-lg border border-border/30 divide-y divide-border/20 max-h-48 overflow-y-auto",children:y.map(([t,s])=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2",children:[(0,a.jsx)("code",{className:"text-xs text-orange-400/80 flex-1 truncate",children:t}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("code",{className:"text-xs text-sky-400/80 flex-1 truncate",children:s}),(0,a.jsx)("button",{onClick:()=>{let s;return s={...e.degradationMap},void(delete s[t],j({degradationMap:s}))},disabled:i,className:"p-1 rounded hover:bg-red-500/10 text-text-muted hover:text-red-400 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},t))})]}),(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"text-xs font-medium text-text-muted uppercase tracking-wider cursor-pointer flex items-center gap-1 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] group-open:rotate-90 transition-transform",children:"chevron_right"}),f("detectionPatterns")||"Detection Patterns"," (",e.detectionPatterns?.length||0,")"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("input",{type:"text",placeholder:f("newPattern")||'e.g. "generate a title"',value:b,onChange:e=>g(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-sky-500/50 focus:outline-none"}),(0,a.jsx)("button",{onClick:()=>{b.trim()&&(j({detectionPatterns:[...e.detectionPatterns,b.trim()]}),g(""))},disabled:i||!b.trim(),className:"px-3 py-2 rounded-lg text-sm font-medium bg-sky-500/10 text-sky-500 hover:bg-sky-500/20 disabled:opacity-50 transition-all",children:f("add")||"Add"})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:(e.detectionPatterns||[]).map((t,s)=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs bg-sky-500/10 text-sky-400 border border-sky-500/20",children:[t,(0,a.jsx)("button",{onClick:()=>{j({detectionPatterns:e.detectionPatterns.filter((e,t)=>t!==s)})},className:"hover:text-red-400 transition-colors",disabled:i,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},s))})]})]})]})}function M(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!1),i=(0,d.c)("settings"),n=()=>{fetch("/api/cache/stats").then(e=>e.json()).then(t).catch(()=>{})};(0,l.useEffect)(n,[]);let o=async()=>{r(!0);try{await fetch("/api/cache/stats",{method:"DELETE"}),n()}finally{r(!1)}};return(0,a.jsxs)(c.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"cached"}),i("promptCache")]}),(0,a.jsx)("button",{onClick:o,disabled:s,className:"px-3 py-1.5 text-xs rounded-lg bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:i(s?"flushing":"flushCache")})]}),e?(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("size")}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.size,"/",e.maxSize]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("hitRate")}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.hitRate?.toFixed(1)??0,"%"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("hits")}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.hits??0})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("evictions")}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.evictions??0})]})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:i("loadingCacheStats")})]})}let E={CLOSED:{bg:"bg-emerald-500/15",text:"text-emerald-400",border:"border-emerald-500/30",icon:"check_circle"},OPEN:{bg:"bg-red-500/15",text:"text-red-400",border:"border-red-500/30",icon:"error"},HALF_OPEN:{bg:"bg-amber-500/15",text:"text-amber-400",border:"border-amber-500/30",icon:"warning"}},O={closed:{icon:"check_circle",color:"#22c55e"},"half-open":{icon:"pending",color:"#f59e0b"},open:{icon:"error",color:"#ef4444"}};function K(e,t){let s=String(e||"closed").toLowerCase().replaceAll("_","-");return t("open"===s?"breakerStateOpen":"half-open"===s?"breakerStateHalfOpen":"breakerStateClosed")}function F(e){return!e||e<=0?"—":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function _(e,t){return e instanceof Error&&e.message?e.message:t}function B({profiles:e,onSave:t,saving:s}){let[r,i]=(0,l.useState)(!1),[n,o]=(0,l.useState)(e),m=(0,d.c)("settings"),x=(0,d.c)("common");(0,l.useEffect)(()=>{o(e)},[e]);let u=e=>null==e?"—":`${e}${m("ms")}`,h=[{key:"transientCooldown",label:m("transientCooldown"),format:u},{key:"rateLimitCooldown",label:m("rateLimitCooldown"),format:u},{key:"maxBackoffLevel",label:m("maxBackoffLevel")},{key:"circuitBreakerThreshold",label:m("cbThreshold"),format:e=>null==e?"—":m("failures",{count:e})},{key:"circuitBreakerReset",label:m("cbResetTime"),format:u}];return(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"tune"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:m("providerProfiles")})]}),r?(0,a.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",onClick:()=>i(!1),children:x("cancel")}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{t(n),i(!1)},disabled:s,children:x("save")})]}):(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>i(!0),children:x("edit")})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:m("providerProfilesDesc")}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:["oauth","apikey"].map(t=>(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-bold uppercase tracking-wider mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base","aria-hidden":"true",children:"oauth"===t?"lock":"key"}),"oauth"===t?m("oauthProviders"):m("apiKeyProviders")]}),(0,a.jsx)("div",{className:"space-y-2",children:h.map(({key:s,label:l,format:i})=>(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l}),r?(0,a.jsx)("input",{type:"number",min:"0",value:n?.[t]?.[s]??0,onChange:e=>o({...n,[t]:{...n[t],[s]:Number(e.target.value)}}),className:"w-24 px-2 py-1 text-xs rounded bg-white/10 border border-white/20 text-right"}):(0,a.jsx)("span",{className:"text-sm font-mono",children:i?i(e?.[t]?.[s]):e?.[t]?.[s]??"—"})]},s))})]},t))})]})})}function z({rateLimitStatus:e,defaults:t,onSaveDefaults:s,saving:r}){let[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(t||{}),x=(0,d.c)("settings"),u=(0,d.c)("common");return(0,l.useEffect)(()=>{t&&m(t)},[t]),(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"speed"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:x("rateLimiting")})]}),i?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",onClick:()=>n(!1),children:u("cancel")}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{s(o),n(!1)},disabled:r,children:u("save")})]}):(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>n(!0),children:u("edit")})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:x("rateLimitingDesc")}),(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4 mb-4",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider mb-3 text-text-muted",children:x("defaultSafetyNet")}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[{key:"requestsPerMinute",label:x("rpm")},{key:"minTimeBetweenRequests",label:x("minGap"),format:F},{key:"concurrentRequests",label:x("maxConcurrent")}].map(({key:e,label:s,format:l})=>(0,a.jsxs)("div",{children:[i?(0,a.jsx)("input",{type:"number",min:"1",value:o[e]??0,onChange:t=>m(s=>({...s,[e]:parseInt(t.target.value)||0})),className:"w-full px-2 py-1 text-lg font-bold rounded bg-white/10 border border-white/20"}):(0,a.jsx)("div",{className:"text-lg font-bold",children:l?l(t?.[e]):t?.[e]??"—"}),(0,a.jsx)("div",{className:"text-xs text-text-muted",children:s})]},e))})]}),e&&e.length>0?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text-muted",children:x("activeLimiters")}),e.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.provider||e.key}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[null!=e.reservoir&&(0,a.jsxs)("span",{children:[x("reservoir"),": ",e.reservoir]}),null!=e.running&&(0,a.jsxs)("span",{children:[x("running"),": ",e.running]}),null!=e.queued&&(0,a.jsxs)("span",{children:[x("queued"),": ",e.queued]})]})]},t))]}):(0,a.jsx)("p",{className:"text-xs text-text-muted",children:x("noActiveLimiters")})]})})}function R({breakers:e,onReset:t,loading:s}){let l=e.filter(e=>"CLOSED"!==e.state),r=e.length,i=(0,d.c)("settings");return(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"electrical_services"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:i("circuitBreakers")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l.length>0?i("tripped",{count:l.length}):i("healthy",{count:r})}),l.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"danger",icon:"restart_alt",onClick:t,disabled:s,children:i("resetAll")})]})]}),0===e.length?(0,a.jsx)("p",{className:"text-sm text-text-muted",children:i("noCircuitBreakers")}):(0,a.jsx)("div",{className:"space-y-2",children:e.map(e=>{let t=E[e.state]||E.CLOSED;return(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-base ${t.text}`,"aria-hidden":"true",children:t.icon}),(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name.replace("combo:","")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[e.failureCount>0&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:i("failures",{count:e.failureCount})}),(0,a.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-bold uppercase ${t.bg} ${t.text} border ${t.border}`,children:K(e.state,i)})]})]},e.name)})})]})})}function I(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(null),m=(0,g.i)(),x=(0,o.Ym)(),u=(0,d.c)("settings"),h=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/policies");if(e.ok){let s=await e.json();t(s)}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{h();let e=setInterval(h,15e3);return()=>clearInterval(e)},[h]);let p=async e=>{n(e);try{(await fetch("/api/policies",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"unlock",identifier:e})})).ok?(m.success(u("unlockedIdentifier",{identifier:e})),await h()):m.error(u("failedUnlock"))}catch{m.error(u("failedUnlock"))}finally{n(null)}},b=e?.circuitBreakers||[],f=e?.lockedIdentifiers||[],j=b.some(e=>"closed"!==e.state)||f.length>0;return s?(0,a.jsx)(c.Zp,{className:"p-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"policy"}),u("loadingPolicies")]})}):(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"policy"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:u("policiesLocked")})]}),j&&(0,a.jsx)(c.$n,{size:"sm",variant:"ghost",onClick:h,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"refresh"})})]}),j?(0,a.jsxs)(a.Fragment,{children:[b.filter(e=>"closed"!==e.state).length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:u("circuitBreakers")}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:b.filter(e=>"closed"!==e.state).map((e,t)=>{let s=O[e.state]||O.open;return(0,a.jsx)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:s.color},children:s.icon}),(0,a.jsx)("span",{className:"text-sm text-text-main font-medium",children:e.name||e.provider||u("unknown")}),(0,a.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:`${s.color}15`,color:s.color},children:K(e.state,u)}),e.failures>0&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:u("failures",{count:e.failures})})]})},e.name||t)})})]}),f.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:u("lockedIdentifiers")}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:f.map((e,t)=>{let s="string"==typeof e?e:e.identifier||e.id;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-red-400",children:"lock"}),(0,a.jsx)("span",{className:"font-mono text-sm text-text-main",children:s}),"object"==typeof e&&e.lockedAt&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:u("sinceDate",{date:new Date(e.lockedAt).toLocaleString(x)})})]}),(0,a.jsx)(c.$n,{size:"sm",variant:"ghost",onClick:()=>p(s),disabled:i===s,className:"text-xs",children:i===s?u("unlocking"):u("forceUnlock")})]},s||t)})})]})]}):(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-emerald-500/10 text-emerald-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"verified_user"})}),(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:"text-sm text-text-muted",children:u("allOperational")})})]})]})})}function q(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(null),x=(0,d.c)("settings"),u=(0,l.useCallback)(async()=>{try{r(!0);let e=await fetch("/api/resilience");if(!e.ok)throw Error(x("failedLoadWithStatus",{status:e.status}));let s=await e.json();t(s),m(null)}catch(e){m(_(e,x("failedLoadResilience")))}finally{r(!1)}},[x]);(0,l.useEffect)(()=>{u();let e=setInterval(u,1e4);return()=>clearInterval(e)},[u]);let h=async()=>{try{if(r(!0),!(await fetch("/api/resilience/reset",{method:"POST"})).ok)throw Error(x("resetFailed"));await u()}catch(e){m(_(e,x("resetFailed")))}finally{r(!1)}},p=async e=>{try{if(n(!0),!(await fetch("/api/resilience",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({profiles:e})})).ok)throw Error(x("saveFailed"));await u()}catch(e){m(_(e,x("saveFailed")))}finally{n(!1)}},b=async e=>{try{if(n(!0),!(await fetch("/api/resilience",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaults:e})})).ok)throw Error(x("saveFailed"));await u()}catch(e){m(_(e,x("saveFailed")))}finally{n(!1)}};return s&&!e?(0,a.jsxs)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"hourglass_empty"}),x("loadingResilience")]}):o&&!e?(0,a.jsxs)(c.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"error"}),(0,a.jsx)("span",{className:"text-sm",children:o})]}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:u,className:"mt-3",children:x("retry")})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(B,{profiles:e?.profiles||{},onSave:p,saving:i}),(0,a.jsx)(z,{rateLimitStatus:e?.rateLimitStatus||[],defaults:e?.defaults||{},onSaveDefaults:b,saving:i}),(0,a.jsx)(R,{breakers:e?.circuitBreakers||[],onReset:h,loading:s}),(0,a.jsx)(I,{})]})}let Z=[{id:"general",labelKey:"general",icon:"settings"},{id:"ai",labelKey:"ai",icon:"smart_toy"},{id:"security",labelKey:"security",icon:"shield"},{id:"routing",labelKey:"routing",icon:"route"},{id:"resilience",labelKey:"resilience",icon:"electrical_services"},{id:"advanced",labelKey:"advanced",icon:"tune"}];function U(){let e=(0,d.c)("settings"),t=(0,r.useSearchParams)().get("tab"),[s,c]=(0,l.useState)(null),o=s||Z.find(e=>e.id===t)?.id||"general";return(0,a.jsx)("div",{className:"max-w-2xl mx-auto min-w-0",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)("div",{className:"w-full overflow-x-auto pb-1",children:(0,a.jsx)("div",{role:"tablist","aria-label":e("settingsSectionsAria"),className:"inline-flex items-center p-1 rounded-lg bg-black/5 dark:bg-white/5 min-w-max",children:Z.map(t=>(0,a.jsxs)("button",{role:"tab","aria-selected":o===t.id,tabIndex:o===t.id?0:-1,onClick:()=>c(t.id),className:(0,i.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all text-sm",o===t.id?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]","aria-hidden":"true",children:t.icon}),(0,a.jsx)("span",{className:"hidden sm:inline whitespace-nowrap",children:e(t.labelKey)})]},t.id))})}),(0,a.jsxs)("div",{role:"tabpanel","aria-label":e(Z.find(e=>e.id===o)?.labelKey||"general"),children:["general"===o&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(m,{}),(0,a.jsx)(S,{})]})}),"ai"===o&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)($,{}),(0,a.jsx)(A,{}),(0,a.jsx)(M,{})]}),"security"===o&&(0,a.jsx)(b,{}),"routing"===o&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(v,{}),(0,a.jsx)(N,{}),(0,a.jsx)(T,{}),(0,a.jsx)(L,{})]}),"resilience"===o&&(0,a.jsx)(q,{}),"advanced"===o&&(0,a.jsx)(k,{})]}),(0,a.jsxs)("div",{className:"text-center text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[n.vQ.name," v",n.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:e("localMode")})]})]})})}},13908:(e,t,s)=>{Promise.resolve().then(s.bind(s,3612))},40993:(e,t,s)=>{"use strict";s.d(t,{Ex:()=>c.default,$n:()=>a.default,Zp:()=>i.default,Qv:()=>d.CardSkeleton,G9:()=>j.default,bQ:()=>k.default,pp:()=>v.default,Qn:()=>N.default,pd:()=>l.default,Mh:()=>f.default,uR:()=>u.default,aF:()=>n.default,rq:()=>x.default,LF:()=>m.default,KN:()=>b.default,Lo:()=>g.default,y7:()=>p.default,Iz:()=>y.default,l6:()=>r.default,lM:()=>o.default,cn:()=>h.default});var a=s(35806),l=s(34422),r=s(42994),i=s(81060),n=s(71361),d=s(92542);s(17705);var c=s(80927),o=s(19790);s(6261),s(55846),s(34243),s(89938),s(99023);var m=s(80178),x=s(85444),u=s(91961);s(25112);var h=s(45624),p=s(37415),b=s(48643),g=s(8287);s(1652);var f=s(92701);s(18150);var j=s(71689),y=s(33709);s(76332);var v=s(66200);s(61580);var N=s(51503);s(54128);var k=s(44638);s(21720),s(97050)}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=13908)),_N_E=e.O()}]);
|