omniroute 1.4.5 → 1.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -8
- package/README.pt-BR.md +1 -0
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +26 -26
- package/app/.next/build-manifest.json +2 -2
- package/app/.next/prerender-manifest.json +3 -676
- package/app/.next/required-server-files.json +4 -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 +1 -1
- 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/cli-tools/page.js +4 -4
- 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 +1 -1
- 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 +1 -1
- 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/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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/_global-error/page.js +1 -1
- 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 +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- 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 +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js +1 -1
- 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/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_client-reference-manifest.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_client-reference-manifest.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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +1 -1
- 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-settings/route.js +2 -2
- 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_client-reference-manifest.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_client-reference-manifest.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.js.nft.json +1 -1
- package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.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.js.nft.json +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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/route.js +1 -1
- package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/monitoring/health/route.js +1 -1
- 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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- 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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- 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_client-reference-manifest.js +1 -1
- 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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/route.js +1 -1
- package/app/.next/server/app/api/providers/route_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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 +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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/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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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_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.js.nft.json +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.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/moderations/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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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_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.js.nft.json +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_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 +1 -1
- 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 +1 -1
- 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/page.js +1 -1
- 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 +1 -1
- 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/terms/page.js +1 -1
- 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 +26 -26
- package/app/.next/server/chunks/1259.js +2 -0
- package/app/.next/server/chunks/1960.js +1 -0
- package/app/.next/server/chunks/1990.js +1 -0
- package/app/.next/server/chunks/2767.js +2 -2
- package/app/.next/server/chunks/2901.js +2 -2
- package/app/.next/server/chunks/3447.js +1 -1
- package/app/.next/server/chunks/3498.js +39 -0
- package/app/.next/server/chunks/3596.js +1 -1
- package/app/.next/server/chunks/3699.js +1 -1
- package/app/.next/server/chunks/{1079.js → 3875.js} +3 -1
- package/app/.next/server/chunks/4509.js +1 -0
- package/app/.next/server/chunks/5248.js +1 -1
- package/app/.next/server/chunks/5573.js +1 -1
- package/app/.next/server/chunks/7544.js +1 -1
- package/app/.next/server/chunks/7669.js +1 -3
- package/app/.next/server/chunks/8020.js +1 -1
- package/app/.next/server/chunks/9340.js +1 -0
- package/app/.next/server/chunks/9342.js +1 -1
- package/app/.next/server/chunks/9824.js +3 -3
- package/app/.next/server/instrumentation.js +1 -1
- package/app/.next/server/middleware.js +1 -1
- package/app/.next/server/pages/500.html +2 -2
- package/app/.next/server/pages-manifest.json +0 -1
- 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/3418-66271bd83bd2e66a.js +3 -0
- package/app/.next/static/chunks/5846-756d72eb0e01a60c.js +2 -0
- package/app/.next/static/chunks/{1149-fefe7f95f0e9842f.js → 6458-085536744d592424.js} +1 -1
- package/app/.next/static/chunks/993-961f6e199b93539a.js +21 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/page-3fcbbdb2221f0b0c.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-d806e4f28c15636a.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-27bc511cf3930e1e.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-918d5f38d5cdbbc2.js → page-012be9f38cda4c4a.js} +4 -4
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-ede2315b6918315e.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/costs/page-f256689b8410bd74.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-6e4f3ca7ac9778be.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/health/page-8725f1a181e558a3.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-a5a48afa8c125ada.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/logs/page-6ee69634597daee0.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/onboarding/page-931fa0c45dca76c9.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-04bc41f9e9de17ef.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-62c6fceede3a5549.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-2dc2a865e90681dd.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-ac85ce5066cd9044.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-88cac9e6f2fbe335.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/page-77158451270c1852.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-75c8b38a55e13042.js +4 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/{page-51a813eac9d71eed.js → page-f0809c7842e4f5b4.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/layout-b23c2c5427e04dcf.js +1 -0
- package/app/.next/static/chunks/app/callback/page-e439cd5a287000d8.js +1 -0
- package/app/.next/static/chunks/app/forbidden/page-4a39fedc08aaaf55.js +1 -0
- package/app/.next/static/chunks/app/forgot-password/page-057ea91c6f140e0b.js +1 -0
- package/app/.next/static/chunks/app/layout-108592eafb959363.js +1 -0
- package/app/.next/static/chunks/app/login/page-c1d7bfab91a7877c.js +1 -0
- package/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/app/package.json +2 -1
- package/app/server.js +1 -1
- package/package.json +2 -1
- package/app/.next/server/app/_not-found.html +0 -1
- package/app/.next/server/app/_not-found.meta +0 -16
- package/app/.next/server/app/_not-found.rsc +0 -23
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +0 -23
- package/app/.next/server/app/_not-found.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/_not-found.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +0 -4
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/callback.html +0 -1
- package/app/.next/server/app/callback.meta +0 -15
- package/app/.next/server/app/callback.rsc +0 -24
- package/app/.next/server/app/callback.segments/_full.segment.rsc +0 -24
- package/app/.next/server/app/callback.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/callback.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/callback.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/callback.segments/callback.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/analytics.html +0 -2
- package/app/.next/server/app/dashboard/analytics.meta +0 -17
- package/app/.next/server/app/dashboard/analytics.rsc +0 -26
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/analytics.segments/_full.segment.rsc +0 -26
- package/app/.next/server/app/dashboard/analytics.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/analytics.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/analytics.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/api-manager.html +0 -1
- package/app/.next/server/app/dashboard/api-manager.meta +0 -17
- package/app/.next/server/app/dashboard/api-manager.rsc +0 -22
- package/app/.next/server/app/dashboard/api-manager.segments/!KGRhc2hib2FyZCk/dashboard/api-manager/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/api-manager.segments/!KGRhc2hib2FyZCk/dashboard/api-manager.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/api-manager.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/api-manager.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/api-manager.segments/_full.segment.rsc +0 -22
- package/app/.next/server/app/dashboard/api-manager.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/api-manager.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/api-manager.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/audit-log.html +0 -1
- package/app/.next/server/app/dashboard/audit-log.meta +0 -17
- package/app/.next/server/app/dashboard/audit-log.rsc +0 -25
- package/app/.next/server/app/dashboard/audit-log.segments/!KGRhc2hib2FyZCk/dashboard/audit-log/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/audit-log.segments/!KGRhc2hib2FyZCk/dashboard/audit-log.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/audit-log.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/audit-log.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/audit-log.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/audit-log.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/audit-log.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/audit-log.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/cli-tools.html +0 -1
- package/app/.next/server/app/dashboard/cli-tools.meta +0 -17
- package/app/.next/server/app/dashboard/cli-tools.rsc +0 -23
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +0 -23
- package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/combos.html +0 -1
- package/app/.next/server/app/dashboard/combos.meta +0 -17
- package/app/.next/server/app/dashboard/combos.rsc +0 -25
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/costs.html +0 -1
- package/app/.next/server/app/dashboard/costs.meta +0 -17
- package/app/.next/server/app/dashboard/costs.rsc +0 -25
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard/costs/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard/costs.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/costs.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/costs.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/costs.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/costs.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/endpoint.html +0 -1
- package/app/.next/server/app/dashboard/endpoint.meta +0 -17
- package/app/.next/server/app/dashboard/endpoint.rsc +0 -23
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +0 -23
- package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/health.html +0 -1
- package/app/.next/server/app/dashboard/health.meta +0 -17
- package/app/.next/server/app/dashboard/health.rsc +0 -25
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/health.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/health.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/health.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/health.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/limits.html +0 -2
- package/app/.next/server/app/dashboard/limits.meta +0 -17
- package/app/.next/server/app/dashboard/limits.rsc +0 -25
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk/dashboard/limits/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk/dashboard/limits.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/limits.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/limits.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/limits.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/limits.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/logs.html +0 -1
- package/app/.next/server/app/dashboard/logs.meta +0 -17
- package/app/.next/server/app/dashboard/logs.rsc +0 -25
- package/app/.next/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard/logs/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard/logs.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/logs.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/logs.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/logs.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/logs.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/onboarding.html +0 -1
- package/app/.next/server/app/dashboard/onboarding.meta +0 -17
- package/app/.next/server/app/dashboard/onboarding.rsc +0 -25
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/onboarding.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/onboarding.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/onboarding.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/onboarding.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/profile.html +0 -1
- package/app/.next/server/app/dashboard/profile.meta +0 -19
- package/app/.next/server/app/dashboard/profile.rsc +0 -22
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +0 -22
- package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/providers/new.html +0 -2
- package/app/.next/server/app/dashboard/providers/new.meta +0 -18
- package/app/.next/server/app/dashboard/providers/new.rsc +0 -27
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/providers.html +0 -2
- package/app/.next/server/app/dashboard/providers.meta +0 -17
- package/app/.next/server/app/dashboard/providers.rsc +0 -27
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/settings/pricing.html +0 -2
- package/app/.next/server/app/dashboard/settings/pricing.meta +0 -18
- package/app/.next/server/app/dashboard/settings/pricing.rsc +0 -27
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/settings.html +0 -1
- package/app/.next/server/app/dashboard/settings.meta +0 -17
- package/app/.next/server/app/dashboard/settings.rsc +0 -27
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/settings.segments/_full.segment.rsc +0 -27
- package/app/.next/server/app/dashboard/settings.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/settings.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/settings.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/translator.html +0 -19
- package/app/.next/server/app/dashboard/translator.meta +0 -17
- package/app/.next/server/app/dashboard/translator.rsc +0 -22
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +0 -22
- package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/usage.html +0 -1
- package/app/.next/server/app/dashboard/usage.meta +0 -17
- package/app/.next/server/app/dashboard/usage.rsc +0 -25
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -4
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
- package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +0 -25
- package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/docs.html +0 -1
- package/app/.next/server/app/docs.meta +0 -15
- package/app/.next/server/app/docs.rsc +0 -88
- package/app/.next/server/app/docs.segments/_full.segment.rsc +0 -88
- package/app/.next/server/app/docs.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/docs.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/docs.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +0 -67
- package/app/.next/server/app/docs.segments/docs.segment.rsc +0 -4
- package/app/.next/server/app/forbidden.html +0 -1
- package/app/.next/server/app/forbidden.meta +0 -15
- package/app/.next/server/app/forbidden.rsc +0 -24
- package/app/.next/server/app/forbidden.segments/_full.segment.rsc +0 -24
- package/app/.next/server/app/forbidden.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/forbidden.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/forbidden.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/forbidden.segments/forbidden/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/forbidden.segments/forbidden.segment.rsc +0 -4
- package/app/.next/server/app/forgot-password.html +0 -1
- package/app/.next/server/app/forgot-password.meta +0 -15
- package/app/.next/server/app/forgot-password.rsc +0 -24
- package/app/.next/server/app/forgot-password.segments/_full.segment.rsc +0 -24
- package/app/.next/server/app/forgot-password.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/forgot-password.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/forgot-password.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/forgot-password.segments/forgot-password/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/forgot-password.segments/forgot-password.segment.rsc +0 -4
- package/app/.next/server/app/index.html +0 -1
- package/app/.next/server/app/index.meta +0 -16
- package/app/.next/server/app/index.rsc +0 -21
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +0 -6
- package/app/.next/server/app/index.segments/_full.segment.rsc +0 -21
- package/app/.next/server/app/index.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/index.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/index.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/landing.html +0 -1
- package/app/.next/server/app/landing.meta +0 -15
- package/app/.next/server/app/landing.rsc +0 -24
- package/app/.next/server/app/landing.segments/_full.segment.rsc +0 -24
- package/app/.next/server/app/landing.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/landing.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/landing.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/landing.segments/landing.segment.rsc +0 -4
- package/app/.next/server/app/login.html +0 -1
- package/app/.next/server/app/login.meta +0 -15
- package/app/.next/server/app/login.rsc +0 -24
- package/app/.next/server/app/login.segments/_full.segment.rsc +0 -24
- package/app/.next/server/app/login.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/login.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/login.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +0 -9
- package/app/.next/server/app/login.segments/login.segment.rsc +0 -4
- package/app/.next/server/app/privacy.html +0 -1
- package/app/.next/server/app/privacy.meta +0 -15
- package/app/.next/server/app/privacy.rsc +0 -28
- package/app/.next/server/app/privacy.segments/_full.segment.rsc +0 -28
- package/app/.next/server/app/privacy.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/privacy.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/privacy.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/privacy.segments/privacy/__PAGE__.segment.rsc +0 -11
- package/app/.next/server/app/privacy.segments/privacy.segment.rsc +0 -4
- package/app/.next/server/app/terms.html +0 -1
- package/app/.next/server/app/terms.meta +0 -15
- package/app/.next/server/app/terms.rsc +0 -29
- package/app/.next/server/app/terms.segments/_full.segment.rsc +0 -29
- package/app/.next/server/app/terms.segments/_head.segment.rsc +0 -6
- package/app/.next/server/app/terms.segments/_index.segment.rsc +0 -10
- package/app/.next/server/app/terms.segments/_tree.segment.rsc +0 -5
- package/app/.next/server/app/terms.segments/terms/__PAGE__.segment.rsc +0 -7
- package/app/.next/server/app/terms.segments/terms.segment.rsc +0 -4
- package/app/.next/server/chunks/2760.js +0 -1
- package/app/.next/server/chunks/438.js +0 -1
- package/app/.next/server/chunks/9723.js +0 -37
- package/app/.next/server/chunks/9979.js +0 -2
- package/app/.next/server/pages/404.html +0 -1
- package/app/.next/static/chunks/5846-8a4d88e4bc5e07f6.js +0 -2
- package/app/.next/static/chunks/993-4cb24412f8681dc9.js +0 -21
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/page-f8b57e41a1b6fce6.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-10e24238da560d00.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-c37f849e39b1bf02.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-f017a1a13b450ed3.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/costs/page-9495b294cfe54d73.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-90f0a2f2cfc02a76.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/health/page-58ea3e55f475ea7b.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-2a3cd7fd5ca34713.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/logs/page-88e667cb7ae99420.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/onboarding/page-19072ecdea202e4e.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-d2651dc387e7fdfd.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-56e8174ce9caec1b.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-200bed170f9ee2b0.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-7fec684a49291104.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-06d076294b449efb.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/page-1b3f14c99d3edf09.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-775e1506821cac94.js +0 -4
- package/app/.next/static/chunks/app/(dashboard)/layout-cf710bbfb7c3ba11.js +0 -1
- package/app/.next/static/chunks/app/callback/page-5c58a06902dd94ed.js +0 -1
- package/app/.next/static/chunks/app/forbidden/page-86b6392f80a3ff69.js +0 -1
- package/app/.next/static/chunks/app/forgot-password/page-373672767bb0aae4.js +0 -1
- package/app/.next/static/chunks/app/layout-3375493e8f9133db.js +0 -1
- package/app/.next/static/chunks/app/login/page-ca4dde4376ccd169.js +0 -1
- /package/app/.next/static/{5wRmzcux4mm_n3yTB8RLl → oaQaCPrOo77oe3OAEMAe-}/_buildManifest.js +0 -0
- /package/app/.next/static/{5wRmzcux4mm_n3yTB8RLl → oaQaCPrOo77oe3OAEMAe-}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{37667:(e,t,s)=>{Promise.resolve().then(s.bind(s,75926))},75926:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>g});var r=s(95155),a=s(12115),l=s(5772),i=s(14051),n=s.n(i),o=s(40993),d=s(52529),c=s(20909),p=s(98500),m=s.n(p),x=s(67671);let u={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function h(){let[e,t]=(0,a.useState)(null),[s,l]=(0,a.useState)(!0),[i,n]=(0,a.useState)(!1),[d,c]=(0,a.useState)(null),p=(0,a.useRef)(null),m=(0,x.i)(),h=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let s=await e.json();t(s)}}catch{}finally{l(!1)}},[]);(0,a.useEffect)(()=>{h();let e=setInterval(h,3e4);return()=>clearInterval(e)},[h]),(0,a.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&n(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let b=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(m.success(`Cooldown cleared for ${t}`),await h()):m.error("Failed to clear cooldown")}catch{m.error("Failed to clear cooldown")}finally{c(null)}};if(s)return null;let f=e?.models||[],g=e?.unavailableCount||f.filter(e=>"available"!==e.status).length,v=0===g,y={};return f.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";y[t]||(y[t]=[]),y[t].push(e)}),(0,r.jsxs)("div",{className:"relative",ref:p,children:[(0,r.jsxs)("button",{onClick:()=>n(!i),className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-all ${v?"bg-emerald-500/10 border-emerald-500/20 text-emerald-500 hover:bg-emerald-500/15":"bg-amber-500/10 border-amber-500/20 text-amber-500 hover:bg-amber-500/15"}`,children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:v?"verified":"warning"}),v?"All models operational":`${g} model${1!==g?"s":""} with issues`]}),i&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:v?"#22c55e":"#f59e0b"},children:v?"verified":"warning"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,r.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:v?(0,r.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,r.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(y).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=u[e.status]||u.unknown,s=d===`${e.provider}:${e.model}`;return(0,r.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,r.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,r.jsx)(o.$n,{size:"sm",variant:"ghost",onClick:()=>b(e.provider,e.model),disabled:s,className:"text-[10px] px-1.5! py-0.5! ml-2",children:s?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})]})}var b=s(50910);function f(e,t,s){let a=[];if(e>0&&a.push((0,r.jsxs)(o.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=s?`${t} Error (${s})`:`${t} Error`;a.push((0,r.jsx)(o.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,r.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function g(){let[e,t]=(0,a.useState)([]),[s,l]=(0,a.useState)([]),[i,n]=(0,a.useState)(!0),[p,m]=(0,a.useState)(!1),[u,f]=(0,a.useState)(!1),[g,k]=(0,a.useState)(null),[w,A]=(0,a.useState)(null),T=(0,x.i)(),S=(0,b.c)("providers");(0,b.c)("common"),(0,a.useEffect)(()=>{(async()=>{try{let[e,s]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),r=await e.json(),a=await s.json();e.ok&&t(r.connections||[]),s.ok&&l(a.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{n(!1)}})()},[]);let U=(t,s)=>{let r=e.filter(e=>e.provider===t&&e.authType===s),a=e=>{let t=e.rateLimitedUntil&&new Date(e.rateLimitedUntil).getTime()>Date.now();return"unavailable"!==e.testStatus||t?e.testStatus:"active"},l=r.filter(e=>{let t=a(e);return"active"===t||"success"===t}).length,i=r.filter(e=>{let t=a(e);return"error"===t||"expired"===t||"unavailable"===t}),n=i.length,o=r.length,d=o>0&&r.every(e=>!1===e.isActive),c=i.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:l,error:n,total:o,errorCode:c?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let r=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===r||"403"===r)return"AUTH";if(r&&"ERR"!==r)return r;let a=(e.lastError||"").toLowerCase();return a.includes("runtime")||a.includes("not runnable")||a.includes("not installed")?"RUNTIME":a.includes("invalid api key")||a.includes("token invalid")||a.includes("revoked")||a.includes("unauthorized")?"AUTH":"ERR"}(c):null,errorTime:c?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let r=Math.floor(s/24);return`${r}d ago`}(c.lastErrorAt):null,allDisabled:d}},E=async(s,r,a)=>{let l=e.filter(e=>e.provider===s&&e.authType===r);t(e=>e.map(e=>e.provider===s&&e.authType===r?{...e,isActive:a}:e)),await Promise.allSettled(l.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:a})})))},$=async(e,t=null)=>{if(!g){k("provider"===e?t:e),A(null);try{let s=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),r=await s.json();if(A(r),r.summary){let{passed:e,failed:t,total:s}=r.summary;0===t?T.success(S("allTestsPassed",{total:s})):T.warning(S("testSummary",{passed:e,failed:t,total:s}))}}catch(e){A({error:S("providerTestFailed")}),T.error(S("providerTestFailed"))}finally{k(null)}}},O=s.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})),R=s.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"}));return i?(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(o.Qv,{}),(0,r.jsx)(o.Qv,{})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[S("oauthProviders")," ",(0,r.jsx)("span",{className:"size-2.5 rounded-full bg-blue-500",title:"OAuth"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(h,{}),(0,r.jsxs)("button",{onClick:()=>$("oauth"),disabled:!!g,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"oauth"===g?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:S("testAllOAuth"),"aria-label":S("testAllOAuth"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"oauth"===g?"sync":"play_arrow"}),"oauth"===g?S("testing"):S("testAll")]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Object.entries(d.zN).map(([e,t])=>(0,r.jsx)(v,{providerId:e,provider:t,stats:U(e,"oauth"),authType:"oauth",onToggle:t=>E(e,"oauth",t)},e))})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[S("freeProviders")," ",(0,r.jsx)("span",{className:"size-2.5 rounded-full bg-green-500",title:"Free"})]}),(0,r.jsxs)("button",{onClick:()=>$("free"),disabled:!!g,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"free"===g?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:S("testAllFree"),"aria-label":S("testAllFree"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"free"===g?"sync":"play_arrow"}),"free"===g?S("testing"):S("testAll")]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Object.entries(c.IS).map(([e,t])=>(0,r.jsx)(v,{providerId:e,provider:t,stats:U(e,"oauth"),authType:"free",onToggle:t=>E(e,"oauth",t)},e))})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[S("apiKeyProviders")," ",(0,r.jsx)("span",{className:"size-2.5 rounded-full bg-amber-500",title:"API Key"})]}),(0,r.jsxs)("button",{onClick:()=>$("apikey"),disabled:!!g,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"apikey"===g?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:S("testAllApiKey"),"aria-label":S("testAllApiKey"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"apikey"===g?"sync":"play_arrow"}),"apikey"===g?S("testing"):S("testAll")]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Object.entries(d.fg).map(([e,t])=>(0,r.jsx)(y,{providerId:e,provider:t,stats:U(e,"apikey"),authType:"apikey",onToggle:t=>E(e,"apikey",t)},e))})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[S("compatibleProviders")," ",(0,r.jsx)("span",{className:"size-2.5 rounded-full bg-orange-500",title:"Compatible"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(O.length>0||R.length>0)&&(0,r.jsxs)("button",{onClick:()=>$("compatible"),disabled:!!g,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"compatible"===g?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:S("testAllCompatible"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"compatible"===g?"sync":"play_arrow"}),"compatible"===g?S("testing"):S("testAll")]}),(0,r.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>f(!0),children:S("addAnthropicCompatible")}),(0,r.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>m(!0),className:"!bg-white !text-black hover:!bg-gray-100",children:S("addOpenAICompatible")})]})]}),0===O.length&&0===R.length?(0,r.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"extension"}),(0,r.jsx)("p",{className:"text-text-muted text-sm",children:S("noCompatibleYet")}),(0,r.jsx)("p",{className:"text-text-muted text-xs mt-1",children:S("compatibleHint")})]}):(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[...O,...R].map(e=>(0,r.jsx)(y,{providerId:e.id,provider:e,stats:U(e.id,"apikey"),authType:"compatible",onToggle:t=>E(e.id,"apikey",t)},e.id))})]}),(0,r.jsx)(j,{isOpen:p,onClose:()=>m(!1),onCreated:e=>{l(t=>[...t,e]),m(!1)}}),(0,r.jsx)(N,{isOpen:u,onClose:()=>f(!1),onCreated:e=>{l(t=>[...t,e]),f(!1)}}),w&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[10vh]",onClick:()=>A(null),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative bg-bg-primary border border-border rounded-xl w-full max-w-[600px] max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-bg-primary/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsx)("h3",{className:"font-semibold",children:S("testResults")}),(0,r.jsx)("button",{onClick:()=>A(null),className:"p-1 rounded-lg hover:bg-bg-subtle text-text-muted hover:text-text-primary transition-colors","aria-label":"Close test results",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,r.jsx)("div",{className:"p-5",children:(0,r.jsx)(C,{results:w})})]})]})]})}function v({providerId:e,provider:t,stats:s,authType:i,onToggle:n}){let{connected:d,error:c,errorCode:p,errorTime:x,allDisabled:u}=s,[h,b]=(0,a.useState)(!1),g={free:"bg-green-500",oauth:"bg-blue-500",apikey:"bg-amber-500",compatible:"bg-orange-500"};return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group",children:(0,r.jsx)(o.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${u?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color}15`},children:h?(0,r.jsx)("span",{className:"text-xs font-bold",style:{color:t.color},children:t.textIcon||t.id.slice(0,2).toUpperCase()}):(0,r.jsx)(l.default,{src:`/providers/${t.id}.png`,alt:t.name,width:30,height:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",sizes:"32px",onError:()=>b(!0)})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("h3",{className:"font-semibold flex items-center gap-1.5",children:[t.name,(0,r.jsx)("span",{className:`size-2 rounded-full ${g[i]||g.oauth} shrink-0`,title:{free:"Free",oauth:"OAuth",apikey:"API Key",compatible:"Compatible"}[i]||"OAuth"})]}),(0,r.jsx)("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:u?(0,r.jsx)(o.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,r.jsxs)(r.Fragment,{children:[f(d,c,p),x&&(0,r.jsxs)("span",{className:"text-text-muted",children:["• ",x]})]})})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[s.total>0&&(0,r.jsx)("div",{onClick:e=>{e.preventDefault(),e.stopPropagation(),n(!!u)},className:"",children:(0,r.jsx)(o.lM,{size:"sm",checked:!u,onChange:()=>{},title:u?"Enable provider":"Disable provider"})}),(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:"chevron_right"})]})]})})})}function y({providerId:e,provider:t,stats:s,authType:i,onToggle:n}){let{connected:d,error:p,errorCode:x,errorTime:u,allDisabled:h}=s,b=e.startsWith(c.JH),g=e.startsWith(c.DI),[v,y]=(0,a.useState)(!1),j={free:"bg-green-500",oauth:"bg-blue-500",apikey:"bg-amber-500",compatible:"bg-orange-500"};return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group",children:(0,r.jsx)(o.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${h?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color}15`},children:v?(0,r.jsx)("span",{className:"text-xs font-bold",style:{color:t.color},children:t.textIcon||t.id.slice(0,2).toUpperCase()}):(0,r.jsx)(l.default,{src:b?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":g?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,width:30,height:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",sizes:"30px",onError:()=>y(!0)})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("h3",{className:"font-semibold flex items-center gap-1.5",children:[t.name,(0,r.jsx)("span",{className:`size-2 rounded-full ${j[i]||j.apikey} shrink-0`,title:{free:"Free",oauth:"OAuth",apikey:"API Key",compatible:"Compatible"}[i]||"API Key"})]}),(0,r.jsx)("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:h?(0,r.jsx)(o.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,r.jsxs)(r.Fragment,{children:[f(d,p,x),b&&(0,r.jsx)(o.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),g&&(0,r.jsx)(o.Ex,{variant:"default",size:"sm",children:"Messages"}),u&&(0,r.jsxs)("span",{className:"text-text-muted",children:["• ",u]})]})})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[s.total>0&&(0,r.jsx)("div",{onClick:e=>{e.preventDefault(),e.stopPropagation(),n(!!h)},className:"",children:(0,r.jsx)(o.lM,{size:"sm",checked:!h,onChange:()=>{},title:h?"Enable provider":"Disable provider"})}),(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:"chevron_right"})]})]})})})}function j({isOpen:e,onClose:t,onCreated:s}){let[l,i]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[n,d]=(0,a.useState)(!1),[c,p]=(0,a.useState)(""),[m,x]=(0,a.useState)(!1),[u,h]=(0,a.useState)(null);(0,a.useEffect)(()=>{i(e=>({...e,baseUrl:"https://api.openai.com/v1"}))},[l.apiType]);let b=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,apiType:l.apiType,baseUrl:l.baseUrl,type:"openai-compatible"})}),t=await e.json();e.ok&&(s(t.node),i({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),p(""),h(null))}catch(e){console.log("Error creating OpenAI Compatible node:",e)}finally{d(!1)}}},f=async()=>{x(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"openai-compatible"})}),t=await e.json();h(t.valid?"success":"failed")}catch{h("failed")}finally{x(!1)}};return(0,r.jsx)(o.aF,{isOpen:e,title:"Add OpenAI Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"OpenAI Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(o.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(o.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:l.apiType,onChange:e=>i({...l,apiType:e.target.value})}),(0,r.jsx)(o.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.openai.com/v1",hint:"Use the base URL (ending in /v1) for your OpenAI-compatible API."}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value),className:"flex-1"}),(0,r.jsx)("div",{className:"pt-6",children:(0,r.jsx)(o.$n,{onClick:f,disabled:!c||m||!l.baseUrl.trim(),variant:"secondary",children:m?"Checking...":"Check"})})]}),u&&(0,r.jsx)(o.Ex,{variant:"success"===u?"success":"error",children:"success"===u?"Valid":"Invalid"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.$n,{onClick:b,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||n,children:n?"Creating...":"Create"}),(0,r.jsx)(o.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function N({isOpen:e,onClose:t,onCreated:s}){let[l,i]=(0,a.useState)({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),[n,d]=(0,a.useState)(!1),[c,p]=(0,a.useState)(""),[m,x]=(0,a.useState)(!1),[u,h]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&(h(null),p(""))},[e]);let b=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,baseUrl:l.baseUrl,type:"anthropic-compatible"})}),t=await e.json();e.ok&&(s(t.node),i({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),p(""),h(null))}catch(e){console.log("Error creating Anthropic Compatible node:",e)}finally{d(!1)}}},f=async()=>{x(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"anthropic-compatible"})}),t=await e.json();h(t.valid?"success":"failed")}catch{h("failed")}finally{x(!1)}};return(0,r.jsx)(o.aF,{isOpen:e,title:"Add Anthropic Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"Anthropic Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(o.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"ac-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(o.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.anthropic.com/v1",hint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages."}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value),className:"flex-1"}),(0,r.jsx)("div",{className:"pt-6",children:(0,r.jsx)(o.$n,{onClick:f,disabled:!c||m||!l.baseUrl.trim(),variant:"secondary",children:m?"Checking...":"Check"})})]}),u&&(0,r.jsx)(o.Ex,{variant:"success"===u?"success":"error",children:"success"===u?"Valid":"Invalid"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.$n,{onClick:b,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||n,children:n?"Creating...":"Create"}),(0,r.jsx)(o.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function C({results:e}){if(e.error&&!e.results)return(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,r.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:s}=e,a=e.results||[];return(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[t&&(0,r.jsxs)("div",{className:"flex items-center gap-3 text-xs mb-1",children:[(0,r.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[s]||s," Test"]}),(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,r.jsxs)("span",{className:"text-text-muted ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-2 text-xs px-3 py-2 rounded-lg bg-black/[0.03] dark:bg-white/[0.03]",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"font-medium",children:e.connectionName}),(0,r.jsxs)("span",{className:"text-text-muted ml-1.5",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,r.jsxs)("span",{className:"text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,r.jsx)("span",{className:`text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===a.length&&(0,r.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}v.propTypes={providerId:n().string.isRequired,provider:n().shape({id:n().string.isRequired,name:n().string.isRequired,color:n().string,textIcon:n().string}).isRequired,stats:n().shape({connected:n().number,error:n().number,errorCode:n().string,errorTime:n().string}).isRequired,authType:n().string},y.propTypes={providerId:n().string.isRequired,provider:n().shape({id:n().string.isRequired,name:n().string.isRequired,color:n().string,textIcon:n().string,apiType:n().string}).isRequired,stats:n().shape({connected:n().number,error:n().number,errorCode:n().string,errorTime:n().string}).isRequired,authType:n().string},j.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onCreated:n().func.isRequired},N.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onCreated:n().func.isRequired},C.propTypes={results:n().shape({mode:n().string,results:n().array,summary:n().shape({total:n().number,passed:n().number,failed:n().number}),error:n().string}).isRequired}}},e=>{e.O(0,[3418,8500,9751,782,6458,5846,993,8441,3794,7358],()=>e(e.s=37667)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2791],{49162:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>z});var a=s(95155),l=s(12115),r=s(73321),i=s(67040),n=s(52529),c=s(50910),d=s(40993);function o(){let[e,t]=(0,l.useState)([]),[s,r]=(0,l.useState)(!1),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)({type:"",message:""}),[x,h]=(0,l.useState)(null),[u,p]=(0,l.useState)(null),[b,g]=(0,l.useState)(!1),[f,j]=(0,l.useState)({type:"",message:""}),[v,y]=(0,l.useState)(!1),[N,k]=(0,l.useState)(!1),[w,C]=(0,l.useState)({type:"",message:""}),[S,$]=(0,l.useState)(!1),[P,T]=(0,l.useState)(null),D=(0,l.useRef)(null),L=(0,c.c)("settings"),E=(0,c.c)("common"),[A,O]=(0,l.useState)({driver:"sqlite",dbPath:"~/.omniroute/storage.sqlite",sizeBytes:0,retentionDays:90,lastBackupAt:null}),R=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)}},B=async()=>{try{let e=await fetch("/api/storage/health");if(!e.ok)return;let t=await e.json();O(e=>({...e,...t}))}catch(e){console.error("Failed to fetch storage health:",e)}},M=async()=>{g(!0),j({type:"",message:""});try{let e=await fetch("/api/db-backups",{method:"PUT"}),t=await e.json();e.ok?(t.filename?j({type:"success",message:`Backup created: ${t.filename}`}):j({type:"info",message:t.message||"No changes since last backup"}),await B(),i&&await R()):j({type:"error",message:t.error||"Backup failed"})}catch{j({type:"error",message:"An error occurred"})}finally{g(!1)}},_=async e=>{h(e),m({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?(m({type:"success",message:`Restored! ${s.connectionCount} connections, ${s.nodeCount} nodes, ${s.comboCount} combos, ${s.apiKeyCount} API keys.`}),await R(),await B()):m({type:"error",message:s.error||"Restore failed"})}catch{m({type:"error",message:"An error occurred during restore"})}finally{h(null),p(null)}};(0,l.useEffect)(()=>{B()},[]);let z=async()=>{y(!0);try{let e=await fetch("/api/db-backups/export");if(!e.ok){let t=await e.json();throw Error(t.error||"Export failed")}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),C({type:"error",message:`Export failed: ${e.message}`})}finally{y(!1)}},q=async()=>{if(P){k(!0),C({type:"",message:""}),$(!1);try{let e=new FormData;e.append("file",P);let t=await fetch("/api/db-backups/import",{method:"POST",body:e}),s=await t.json();t.ok?(C({type:"success",message:`Database imported! ${s.connectionCount} connections, ${s.nodeCount} nodes, ${s.comboCount} combos, ${s.apiKeyCount} API keys.`}),await B(),i&&await R()):C({type:"error",message:s.error||"Import failed"})}catch{C({type:"error",message:"An error occurred during import"})}finally{k(!1),T(null)}}},F=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)(d.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:L("systemStorage")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:L("allDataLocal")})]}),(0,a.jsx)(d.Ex,{variant:"success",size:"sm",children:A.driver||"json"})]}),(0,a.jsxs)("div",{className:"grid 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:L("databasePath")}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main break-all",children:A.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:L("databaseSize")}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main",children:F(A.sizeBytes)})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsxs)(d.$n,{variant:"outline",size:"sm",onClick:z,loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"download"}),L("exportDatabase")]}),(0,a.jsxs)(d.$n,{variant:"outline",size:"sm",onClick:async()=>{y(!0);try{let e=await fetch("/api/db-backups/exportAll");if(!e.ok)throw Error("Export failed");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){C({type:"error",message:`Full export failed: ${e.message}`})}finally{y(!1)}},loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"folder_zip"}),L("exportAll")]}),(0,a.jsxs)(d.$n,{variant:"outline",size:"sm",onClick:()=>{D.current?.click()},loading:N,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"upload"}),L("importDatabase")]}),(0,a.jsx)("input",{ref:D,type:"file",accept:".sqlite",className:"hidden",onChange:e=>{let t=e.target.files?.[0];if(t){if(!t.name.endsWith(".sqlite"))return void C({type:"error",message:L("invalidFileType")});T(t),$(!0),D.current&&(D.current.value="")}}})]}),S&&P&&(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:L("confirmDbImport")}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["This will replace ",(0,a.jsx)("strong",{children:"all current data"})," with the content from"," ",(0,a.jsx)("span",{className:"font-mono",children:P.name}),". A backup will be created automatically before the import."]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(d.$n,{variant:"primary",size:"sm",onClick:q,className:"!bg-amber-500 hover:!bg-amber-600",children:L("yesImport")}),(0,a.jsx)(d.$n,{variant:"outline",size:"sm",onClick:()=>{$(!1),T(null)},children:E("cancel")})]})]})]})}),w.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-4 text-sm ${"success"===w.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"===w.type?"check_circle":"error"}),w.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:L("lastBackup")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:A.lastBackupAt?`${new Date(A.lastBackupAt).toLocaleString("pt-BR")} (${(e=>{if(!e)return null;let t=Math.floor((new Date-new Date(e))/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`})(A.lastBackupAt)})`:L("noBackupYet")})]})]}),(0,a.jsxs)(d.$n,{variant:"outline",size:"sm",onClick:M,loading:b,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"backup"}),L("backupNow")]})]}),f.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-4 text-sm ${"success"===f.type?"bg-green-500/10 text-green-500 border border-green-500/20":"info"===f.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"===f.type?"check_circle":"info"===f.type?"info":"error"}),f.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:L("backupRestore")})]}),(0,a.jsx)(d.$n,{variant:"outline",size:"sm",onClick:()=>{n(!i),i||0!==e.length||R()},children:i?L("hide"):L("viewBackups")})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:L("backupRetentionDesc")}),o.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-3 text-sm ${"success"===o.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"===o.type?"check_circle":"error"}),o.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"}),L("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"}),L("noBackupsYet")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.length," backup(s) available"]}),(0,a.jsxs)("button",{onClick:R,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"}),L("refresh")]})]}),e.map(e=>(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("pt-BR")}),(0,a.jsx)(d.Ex,{variant:"pre-restore"===e.reason?"warning":"manual"===e.reason?"success":"default",size:"sm",children:e.reason})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted ml-6",children:[(0,a.jsxs)("span",{children:[e.connectionCount," connection(s)"]}),(0,a.jsx)("span",{children:"•"}),(0,a.jsx)("span",{children:F(e.size)})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 ml-3",children:u===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-xs text-amber-500 font-medium",children:L("confirm")}),(0,a.jsx)(d.$n,{variant:"primary",size:"sm",onClick:()=>_(e.id),loading:x===e.id,className:"!bg-amber-500 hover:!bg-amber-600",children:L("yes")}),(0,a.jsx)(d.$n,{variant:"outline",size:"sm",onClick:()=>p(null),children:L("no")})]}):(0,a.jsxs)(d.$n,{variant:"outline",size:"sm",onClick:()=>p(e.id),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"restore"}),L("restore")]})})]},e.id))]})})]})]})}var m=s(20909);let x=[{value:"disabled",label:"Disabled",icon:"block"},{value:"blacklist",label:"Blacklist",icon:"do_not_disturb"},{value:"whitelist",label:"Whitelist",icon:"verified_user"},{value:"whitelist-priority",label:"WL Priority",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"),h=(0,c.c)("settings");(0,l.useEffect)(()=>{u()},[]);let u=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)(d.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:h("ipAccessControl")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:h("ipAccessControlDesc")})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-4 gap-2 mb-5",children:x.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:e.label})]},e.value))}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex gap-2 items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(d.pd,{label:h("addIpAddress"),placeholder:"192.168.1.0/24 or 10.0.*.*",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)(d.$n,{size:"sm",variant:"blacklist"===o?"danger":"secondary",onClick:()=>{m("blacklist"),i.trim()&&b()},children:h("block")}),(0,a.jsx)(d.$n,{size:"sm",variant:"whitelist"===o?"primary":"secondary",onClick:()=>{m("whitelist"),i.trim()&&b()},children:h("allow")})]})]}),e.blacklist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:["Blocked (",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.jsxs)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:["Allowed (",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.jsxs)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:["Temporary Bans (",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 px-3 py-2 rounded-lg bg-orange-500/5 border border-orange-500/20 text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-xs text-orange-400",children:e.ip}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["— ",e.reason]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted tabular-nums",children:[Math.ceil(e.remainingMs/6e4),"m left"]}),(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 u(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),i=(0,c.c)("settings");(0,l.useEffect)(()=>{let e=!1;return async function(){let s=sessionStorage.getItem("omniroute_login_time"),a=Date.now(),l="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 i=!1;try{let e=await fetch("/api/auth/status",{method:"GET",cache:"no-store"});if(e.ok){let t=await e.json();i=!0===t.authenticated}}catch{}e||(t({authenticated:i,loginTime:s?new Date(parseInt(s,10)).toLocaleString():null,sessionAge:l,ipAddress:"—",userAgent:navigator.userAgent.split(" ").slice(-2).join(" ")||"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)(d.Zp,{children:(0,a.jsx)("div",{className:"animate-pulse h-32 bg-black/5 dark:bg-white/5 rounded-lg"})}):(0,a.jsxs)(d.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":"Session details",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)(d.$n,{variant:"secondary",onClick:()=>{confirm(i("clearLocalDataConfirm"))&&(localStorage.clear(),sessionStorage.clear(),window.location.reload())},children:i("clearLocalData")}),e?.authenticated&&(0,a.jsx)(d.$n,{variant:"danger",onClick:n,children:i("logout")})]})]})}function p(){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,x]=(0,l.useState)({type:"",message:""}),[p,b]=(0,l.useState)(!1),g=(0,c.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)}},v=async e=>{if(e.preventDefault(),i.new!==i.confirm)return void x({type:"error",message:g("passwordsNoMatch")});b(!0),x({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?(x({type:"success",message:g("passwordUpdated")}),n({current:"",new:"",confirm:""})):x({type:"error",message:t.error||g("failedUpdatePassword")})}catch{x({type:"error",message:g("errorOccurred")})}finally{b(!1)}},y=e.blockedProviders||[];return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(d.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)(d.lM,{checked:!0===e.requireLogin,onChange:()=>f(!e.requireLogin),disabled:s})]}),!0===e.requireLogin&&(0,a.jsxs)("form",{onSubmit:v,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[e.hasPassword&&(0,a.jsx)(d.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)(d.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)(d.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)(d.$n,{type:"submit",variant:"primary",loading:p,children:e.hasPassword?g("updatePassword"):g("setPassword")})})]})]})]}),(0,a.jsxs)(d.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.jsxs)("p",{className:"text-sm text-text-muted",children:["When ON, the"," ",(0,a.jsx)("code",{className:"text-xs bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded",children:"/v1/models"})," ","endpoint returns 404 for unauthenticated requests. Prevents model discovery by unauthorized users."]})]}),(0,a.jsx)(d.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.jsxs)("p",{className:"text-sm text-text-muted",children:["Hide specific providers from the"," ",(0,a.jsx)("code",{className:"text-xs bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded",children:"/v1/models"})," ","response. Blocked providers will not appear in model listings."]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.values(m.Q2).map(t=>{let l=y.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?`Unblock ${t.name}`:`Block ${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)})}),y.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"}),y.length," provider",1!==y.length?"s":""," blocked from /models"]})]})]})]}),(0,a.jsx)(u,{}),(0,a.jsx)(h,{})]})}var b=s(67671);let g=["#6366f1","#22c55e","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#14b8a6"];function f(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(""),[x,h]=(0,l.useState)(""),[u,p]=(0,l.useState)(!1),f=(0,b.i)(),j=(0,c.c)("settings"),v=(0,c.c)("common"),y=(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)(()=>{y()},[y]);let N=async()=>{if(!o.trim()||!x.trim())return void f.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 f.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?(f.success(j("chainCreated",{model:o.trim()})),m(""),h(""),n(!1),await y()):f.error(j("failedCreateChain"))}catch{f.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?(f.success(j("chainDeleted",{model:e})),await y()):f.error(j("failedDeleteChain"))}catch{f.error(j("failedDeleteChain"))}};if(s)return(0,a.jsx)(d.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)(d.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)(d.$n,{size:"sm",variant:"primary",onClick:()=>n(!i),children:i?v("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)(d.pd,{label:j("modelName"),placeholder:"claude-sonnet-4-20250514",value:o,onChange:e=>m(e.target.value)}),(0,a.jsx)(d.pd,{label:j("providersCommaSeparated"),placeholder:"anthropic, openai, gemini",value:x,onChange:e=>h(e.target.value)})]}),(0,a.jsx)(d.$n,{variant:"primary",size:"sm",onClick:N,loading:u,children:j("createChain")})]}),(0,a.jsx)("div",{className:"px-6 pb-6",children:0===w.length?(0,a.jsx)(d.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:`${g[t%g.length]}20`,color:g[t%g.length],border:`1px solid ${g[t%g.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:"Delete chain",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},e))})})]})}let j=[{value:"fill-first",label:"Fill First",desc:"Use accounts in priority order",icon:"vertical_align_top"},{value:"round-robin",label:"Round Robin",desc:"Cycle through all accounts",icon:"loop"},{value:"p2c",label:"P2C",desc:"Pick 2 random, use the healthier one",icon:"balance"},{value:"random",label:"Random",desc:"Random account each request",icon:"shuffle"},{value:"least-used",label:"Least Used",desc:"Pick least recently used account",icon:"low_priority"},{value:"cost-optimized",label:"Cost Opt",desc:"Prefer cheapest available account",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,h]=(0,l.useState)(""),u=(0,c.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(""),h("")},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)(d.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:u("routingStrategy")})]}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2 mb-4",style:{gridAutoRows:"1fr"},children:j.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:t.label}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:t.desc})]})]},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:u("stickyLimit")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("stickyLimitDesc")})]}),(0,a.jsx)(d.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.jsxs)("p",{className:"text-xs text-text-muted italic pt-3 border-t border-border/30 mt-3",children:["round-robin"===e.fallbackStrategy&&`Distributing requests across accounts with ${e.stickyRoundRobinLimit||3} calls per account.`,"fill-first"===e.fallbackStrategy&&"Using accounts in priority order (Fill First).","p2c"===e.fallbackStrategy&&"Power of Two Choices: picks 2 random accounts and routes to the healthier one.","random"===e.fallbackStrategy&&"Randomly selects an available account for each request.","least-used"===e.fallbackStrategy&&"Picks the account that was used least recently.","cost-optimized"===e.fallbackStrategy&&"Prefers accounts with the lowest cost (priority-based, extensible with actual cost data)."]})]}),(0,a.jsxs)(d.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:u("modelAliases")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:u("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 px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 text-sm",children:[(0,a.jsx)("span",{className:"font-mono text-purple-400",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",children:e.target})]}),(0,a.jsx)("button",{onClick:()=>g(t),className:"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 gap-2 items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(d.pd,{label:u("pattern"),placeholder:"claude-sonnet-*",value:o,onChange:e=>m(e.target.value)})}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(d.pd,{label:u("targetModel"),placeholder:"claude-sonnet-4-20250514",value:x,onChange:e=>h(e.target.value)})}),(0,a.jsx)(d.$n,{size:"sm",variant:"primary",onClick:b,className:"mb-[2px]",children:u("add")})]})]}),(0,a.jsx)(f,{})]})}function y(){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),h=(0,c.c)("settings"),u=(0,c.c)("common");(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 p=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)}},b=()=>{let e=n.trim().toLowerCase();e&&!s[e]&&(r(t=>({...t,[e]:{maxRetries:1,timeoutMs:12e4}})),o(""))};return(0,a.jsxs)(d.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:h("comboDefaultsTitle")}),(0,a.jsx)("span",{className:"text-xs text-text-muted ml-auto",children:h("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:h("defaultStrategy")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:h("defaultStrategyDesc")})]}),(0,a.jsx)("div",{role:"tablist","aria-label":"Combo strategy",className:"grid grid-cols-3 gap-1 p-0.5 rounded-md bg-black/5 dark:bg-white/5",children:[{value:"priority",label:"Priority",icon:"sort"},{value:"weighted",label:"Weighted",icon:"percent"},{value:"round-robin",label:"Round-Robin",icon:"autorenew"},{value:"random",label:"Random",icon:"shuffle"},{value:"least-used",label:"Least-Used",icon:"low_priority"},{value:"cost-optimized",label:"Cost-Opt",icon:"savings"}].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:[{key:"maxRetries",label:"Max Retries",min:0,max:5},{key:"retryDelayMs",label:"Retry Delay (ms)",min:500,max:1e4,step:500},{key:"timeoutMs",label:"Timeout (ms)",min:5e3,max:3e5,step:5e3},{key:"maxComboDepth",label:"Max Nesting Depth",min:1,max:10}].map(({key:s,label:l,min:r,max:i,step:n})=>(0,a.jsx)(d.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)(d.pd,{label:"Concurrency / Model",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)(d.pd,{label:"Queue Timeout (ms)",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:h("healthCheck")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:h("healthCheckDesc")})]}),(0,a.jsx)(d.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:h("trackMetrics")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:h("trackMetricsDesc")})]}),(0,a.jsx)(d.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:h("providerOverrides")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:h("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)(d.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":`${e} max retries`}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:h("retries")}),(0,a.jsx)(d.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":`${e} timeout ms`}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:h("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":`Remove ${e} override`,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)(d.pd,{type:"text",placeholder:"e.g. google, openai...",value:n,onChange:e=>o(e.target.value),onKeyDown:e=>"Enter"===e.key&&b(),className:"text-xs flex-1","aria-label":"New provider name"}),(0,a.jsx)(d.$n,{variant:"outline",size:"sm",onClick:b,disabled:!n.trim(),children:u("add")})]})]}),(0,a.jsx)("div",{className:"pt-3 border-t border-border/50",children:(0,a.jsx)(d.$n,{variant:"primary",size:"sm",onClick:p,loading:m,children:h("saveComboDefaults")})})]})]})}function N(){let[e,t]=(0,l.useState)(!1),[s,r]=(0,l.useState)(null),i=(0,l.useRef)(!0),n=(0,c.c)("settings"),o=(0,c.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)(d.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)(d.$n,{size:"sm",variant:s?"secondary":"primary",icon:"settings",onClick:()=>{m(),t(!0)},children:s?o("edit"):n("configure")})]})]})}),(0,a.jsx)(d.KN,{isOpen:e,onClose:()=>t(!1),level:"global",levelLabel:"Global",onSaved:m})]})}var k=s(97550);function w(){let{theme:e,setTheme:t,isDark:s}=(0,k.D)(),r=(0,c.c)("settings"),[n,o]=(0,l.useState)({}),[m,x]=(0,l.useState)(!0);(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>{if(!e.ok)throw Error(`HTTP error ${e.status}`);return e.json()}).then(e=>{o(e),x(!1)}).catch(()=>x(!1))},[]);let h=async(e,t)=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:t})})).ok&&o(s=>({...s,[e]:t}))}catch(t){console.error(`Failed to update ${e}:`,t)}};return(0,a.jsxs)(d.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:r("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:r("darkMode")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:r("switchThemes")})]}),(0,a.jsx)(d.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":"Theme selection",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",{className:"capitalize",children:s})]},s))})}),(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:r("hideHealthLogs")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:r("hideHealthLogsDesc")})]}),(0,a.jsx)(d.lM,{checked:!0===n.hideHealthCheckLogs,onChange:()=>h("hideHealthCheckLogs",!n.hideHealthCheckLogs),disabled:m})]})})]})]})}let C=[{value:"passthrough",label:"Passthrough",desc:"No changes — client controls thinking budget",icon:"arrow_forward"},{value:"auto",label:"Auto",desc:"Strip all thinking config — let provider decide",icon:"auto_awesome"},{value:"custom",label:"Custom",desc:"Set a fixed token budget for all requests",icon:"tune"},{value:"adaptive",label:"Adaptive",desc:"Scale budget based on request complexity",icon:"trending_up"}],S=[{value:"none",label:"None (0 tokens)"},{value:"low",label:"Low (1K tokens)"},{value:"medium",label:"Medium (10K tokens)"},{value:"high",label:"High (128K tokens)"}];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,c.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/thinking-budget").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let h=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)(d.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:C.map(t=>(0,a.jsxs)("button",{onClick:()=>h({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:t.label}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5 leading-relaxed",children:t.desc})]})]},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=>h({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-4 gap-2",children:S.map(t=>(0,a.jsx)("button",{onClick:()=>h({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:t.value.charAt(0).toUpperCase()+t.value.slice(1)},t.value))})]})]})}function P(){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,c.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/system-prompt").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let h=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)(d.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)(d.lM,{checked:e.enabled,onChange:()=>h({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(()=>{h({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.jsxs)("div",{className:"absolute bottom-2 right-3 text-xs text-text-muted/60 tabular-nums",children:[e.prompt.length," chars"]})]}),(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")," Send"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-surface/50",children:"_skipSystemPrompt: true"})," in a request to bypass."]})]})]})}function T(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!1),i=(0,c.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)(d.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 D={CLOSED:{bg:"bg-emerald-500/15",text:"text-emerald-400",border:"border-emerald-500/30",label:"CLOSED",icon:"check_circle"},OPEN:{bg:"bg-red-500/15",text:"text-red-400",border:"border-red-500/30",label:"OPEN",icon:"error"},HALF_OPEN:{bg:"bg-amber-500/15",text:"text-amber-400",border:"border-amber-500/30",label:"HALF-OPEN",icon:"warning"}},L={closed:{icon:"check_circle",color:"#22c55e",label:"Closed"},"half-open":{icon:"pending",color:"#f59e0b",label:"Half-Open"},open:{icon:"error",color:"#ef4444",label:"Open"}};function E(e){return!e||e<=0?"—":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function A({profiles:e,onSave:t,saving:s}){let[r,i]=(0,l.useState)(!1),[n,o]=(0,l.useState)(e),m=(0,c.c)("settings"),x=(0,c.c)("common");(0,l.useEffect)(()=>{o(e)},[e]);let h=[{key:"transientCooldown",label:"Transient Cooldown",suffix:"ms"},{key:"rateLimitCooldown",label:"Rate Limit Cooldown",suffix:"ms"},{key:"maxBackoffLevel",label:"Max Backoff Level",suffix:""},{key:"circuitBreakerThreshold",label:"CB Threshold",suffix:" fails"},{key:"circuitBreakerReset",label:"CB Reset Time",suffix:"ms"}];return(0,a.jsx)(d.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 gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",onClick:()=>i(!1),children:x("cancel")}),(0,a.jsx)(d.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{t(n),i(!1)},disabled:s,children:x("save")})]}):(0,a.jsx)(d.$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,suffix: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.jsxs)("span",{className:"text-sm font-mono",children:[e?.[t]?.[s]??"—",i&&e?.[t]?.[s]!=null?i:""]})]},s))})]},t))})]})})}function O({rateLimitStatus:e,defaults:t,onSaveDefaults:s,saving:r}){let[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(t||{}),x=(0,c.c)("settings"),h=(0,c.c)("common");return(0,l.useEffect)(()=>{t&&m(t)},[t]),(0,a.jsx)(d.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)(d.$n,{size:"sm",variant:"secondary",onClick:()=>n(!1),children:h("cancel")}),(0,a.jsx)(d.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{s(o),n(!1)},disabled:r,children:h("save")})]}):(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>n(!0),children:h("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-3 gap-4",children:[{key:"requestsPerMinute",label:"RPM",suffix:""},{key:"minTimeBetweenRequests",label:"Min Gap",suffix:"ms",format:E},{key:"concurrentRequests",label:"Max Concurrent",suffix:""}].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:["Reservoir: ",e.reservoir]}),null!=e.running&&(0,a.jsxs)("span",{children:["Running: ",e.running]}),null!=e.queued&&(0,a.jsxs)("span",{children:["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,c.c)("settings");return(0,a.jsx)(d.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?`${l.length} tripped`:`${r} healthy`}),l.length>0&&(0,a.jsx)(d.$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=D[e.state]||D.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.jsxs)("span",{className:"text-xs text-text-muted",children:[e.failureCount," failure",1!==e.failureCount?"s":""]}),(0,a.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-bold uppercase ${t.bg} ${t.text} border ${t.border}`,children:t.label})]})]},e.name)})})]})})}function B(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(null),o=(0,b.i)(),m=(0,c.c)("settings"),x=(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)(()=>{x();let e=setInterval(x,15e3);return()=>clearInterval(e)},[x]);let h=async e=>{n(e);try{(await fetch("/api/policies",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"unlock",identifier:e})})).ok?(o.success(`Unlocked: ${e}`),await x()):o.error(m("failedUnlock"))}catch{o.error(m("failedUnlock"))}finally{n(null)}},u=e?.circuitBreakers||[],p=e?.lockedIdentifiers||[],g=u.some(e=>"closed"!==e.state)||p.length>0;return s?(0,a.jsx)(d.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"}),m("loadingPolicies")]})}):(0,a.jsx)(d.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:m("policiesLocked")})]}),g&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",onClick:x,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"refresh"})})]}),g?(0,a.jsxs)(a.Fragment,{children:[u.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:m("circuitBreakers")}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:u.filter(e=>"closed"!==e.state).map((e,t)=>{let s=L[e.state]||L.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||"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:s.label}),e.failures>0&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.failures," failures"]})]})},e.name||t)})})]}),p.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:m("lockedIdentifiers")}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:p.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.jsxs)("span",{className:"text-xs text-text-muted",children:["since ",new Date(e.lockedAt).toLocaleString()]})]}),(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",onClick:()=>h(s),disabled:i===s,className:"text-xs",children:i===s?m("unlocking"):m("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:m("allOperational")})})]})]})})}function M(){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,c.c)("settings"),h=(0,l.useCallback)(async()=>{try{r(!0);let e=await fetch("/api/resilience");if(!e.ok)throw Error(`Failed to load: ${e.status}`);let s=await e.json();t(s),m(null)}catch(e){m(e.message)}finally{r(!1)}},[]);(0,l.useEffect)(()=>{h();let e=setInterval(h,1e4);return()=>clearInterval(e)},[h]);let u=async()=>{try{if(r(!0),!(await fetch("/api/resilience/reset",{method:"POST"})).ok)throw Error("Reset failed");await h()}catch(e){m(e.message)}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("Save failed");await h()}catch(e){m(e.message)}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("Save failed");await h()}catch(e){m(e.message)}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)(d.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)(d.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:h,className:"mt-3",children:x("retry")})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(A,{profiles:e?.profiles||{},onSave:p,saving:i}),(0,a.jsx)(O,{rateLimitStatus:e?.rateLimitStatus||[],defaults:e?.defaults||{},onSaveDefaults:b,saving:i}),(0,a.jsx)(R,{breakers:e?.circuitBreakers||[],onReset:u,loading:s}),(0,a.jsx)(B,{})]})}let _=[{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 z(){let e=(0,c.c)("settings"),t=(0,r.useSearchParams)().get("tab"),[s,d]=(0,l.useState)(null),m=s||_.find(e=>e.id===t)?.id||"general";return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)("div",{role:"tablist","aria-label":"Settings sections",className:"inline-flex items-center p-1 rounded-lg bg-black/5 dark:bg-white/5 self-start",children:_.map(t=>(0,a.jsxs)("button",{role:"tab","aria-selected":m===t.id,tabIndex:m===t.id?0:-1,onClick:()=>d(t.id),className:(0,i.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all text-sm",m===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",children:e(t.labelKey)})]},t.id))}),(0,a.jsxs)("div",{role:"tabpanel","aria-label":e(_.find(e=>e.id===m)?.labelKey||"general"),children:["general"===m&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(o,{}),(0,a.jsx)(w,{})]})}),"ai"===m&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)($,{}),(0,a.jsx)(P,{}),(0,a.jsx)(T,{})]}),"security"===m&&(0,a.jsx)(p,{}),"routing"===m&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(v,{}),(0,a.jsx)(y,{})]}),"resilience"===m&&(0,a.jsx)(M,{}),"advanced"===m&&(0,a.jsx)(N,{})]}),(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")})]})]})})}},99344:(e,t,s)=>{Promise.resolve().then(s.bind(s,49162))}},e=>{e.O(0,[3418,8500,9751,782,6458,5846,993,8441,3794,7358],()=>e(e.s=99344)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/page-77158451270c1852.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[410],{43265:(e,t,c)=>{Promise.resolve().then(c.bind(c,95204))},50910:(e,t,c)=>{"use strict";c.d(t,{c:()=>i});var a=c(33418);function n(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let i=n(0,a.c3);n(0,a.kc)},67040:(e,t,c)=>{"use strict";function a(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}c.d(t,{cn:()=>a})},73321:(e,t,c)=>{"use strict";var a=c(74645);c.o(a,"useParams")&&c.d(t,{useParams:function(){return a.useParams}}),c.o(a,"usePathname")&&c.d(t,{usePathname:function(){return a.usePathname}}),c.o(a,"useRouter")&&c.d(t,{useRouter:function(){return a.useRouter}}),c.o(a,"useSearchParams")&&c.d(t,{useSearchParams:function(){return a.useSearchParams}})},81060:(e,t,c)=>{"use strict";c.d(t,{default:()=>i});var a=c(95155),n=c(67040);function i({children:e,title:t,subtitle:c,icon:i,action:r,padding:s="md",hover:o=!1,className:u,...d}){return(0,a.jsxs)("div",{className:(0,n.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",o&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[s],u),...d,children:[(t||r)&&(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[i&&(0,a.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:i})}),(0,a.jsxs)("div",{children:[t&&(0,a.jsx)("h3",{className:"text-text-main font-semibold",children:t}),c&&(0,a.jsx)("p",{className:"text-sm text-text-muted",children:c})]})]}),r]}),e]})}i.Section=function({children:e,className:t,...c}){return(0,a.jsx)("div",{className:(0,n.cn)("p-4 rounded-lg","bg-black/[0.02] dark:bg-white/[0.02]","border border-black/5 dark:border-white/5",t),...c,children:e})},i.Row=function({children:e,className:t,...c}){return(0,a.jsx)("div",{className:(0,n.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-black/5 dark:border-white/5 last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]",t),...c,children:e})},i.ListItem=function({children:e,actions:t,className:c,...i}){return(0,a.jsxs)("div",{className:(0,n.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]","transition-colors",c),...i,children:[(0,a.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,a.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity",children:t})]})}},95204:(e,t,c)=>{"use strict";c.r(t),c.d(t,{default:()=>d});var a=c(95155),n=c(12115),i=c(73321),r=c(81060);let s={cc:{"claude-opus-4-5-20251101":{input:15,output:75,cached:7.5,reasoning:75,cache_creation:15},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4-5-20251001":{input:.5,output:2.5,cached:.25,reasoning:2.5,cache_creation:.5}},cx:{"gpt-5.2-codex":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.2":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5-codex":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-codex-mini":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},gc:{"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},qw:{"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},if:{"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"deepseek-r1":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"deepseek-v3.2-chat":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"deepseek-v3.2-reasoner":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"minimax-m2":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},ag:{"gemini-3.1-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"gpt-oss-120b-medium":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},gh:{"gpt-5":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-mini":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"claude-4.5-sonnet":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-4.5-opus":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-4.5-haiku":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"gemini-3-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},openai:{"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},anthropic:{"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:75,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3}},gemini:{"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},openrouter:{auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},glm:{"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},kimi:{"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},minimax:{"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},groq:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-3.3-70b-versatile":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/llama-4-maverick-17b-128e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen/qwen3-32b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},fireworks:{"accounts/fireworks/models/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/deepseek-v3p1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/llama-v3p3-70b-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/qwen3-235b-a22b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},cerebras:{"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"zai-glm-4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-3.3-70b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-4-scout-17b-16e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen-3-235b-a22b-instruct-2507":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen-3-32b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},nvidia:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"moonshotai/kimi-k2.5":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"z-ai/glm4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/deepseek-v3.2":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"nvidia/llama-3.3-70b-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta/llama-4-maverick-17b-128e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek/deepseek-r1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},nebius:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.3-70B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},siliconflow:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3.2":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3.1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-R1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-235B-A22B-Instruct-2507":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-32B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"moonshotai/Kimi-K2.5":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"zai-org/GLM-4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"baidu/ERNIE-4.5-300B-A47B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},hyperbolic:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/QwQ-32B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-R1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.3-70B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.2-3B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen2.5-72B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen2.5-Coder-32B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"NousResearch/Hermes-3-Llama-3.1-70B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},kiro:{"claude-sonnet-4.5":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.25,reasoning:2.5,cache_creation:.5}}};function o({isOpen:e,onClose:t,onSave:c}){let[i,r]=(0,n.useState)({}),[o,u]=(0,n.useState)(!0),[d,p]=(0,n.useState)(!1);(0,n.useEffect)(()=>{e&&l()},[e]);let l=async()=>{u(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();r(t)}else r(s)}catch(e){console.error("Failed to load pricing:",e),r(s)}finally{u(!1)}},h=async()=>{p(!0);try{let e=await fetch("/api/pricing",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(e.ok)c?.(),t();else{let t=await e.json();alert(`Failed to save pricing: ${t.error}`)}}catch(e){console.error("Failed to save pricing:",e),alert("Failed to save pricing")}finally{p(!1)}},g=async()=>{if(confirm("Reset all pricing to defaults? This cannot be undone."))try{(await fetch("/api/pricing",{method:"DELETE"})).ok&&r(s)}catch(e){console.error("Failed to reset pricing:",e),alert("Failed to reset pricing")}};if(!e)return null;let m=Object.keys(i).sort(),x=["input","output","cached","reasoning","cache_creation"];return(0,a.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:(0,a.jsxs)("div",{className:"bg-bg-base border border-border rounded-lg shadow-xl max-w-6xl w-full max-h-[90vh] overflow-hidden flex flex-col",children:[(0,a.jsxs)("div",{className:"p-4 border-b border-border flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"Pricing Configuration"}),(0,a.jsx)("button",{onClick:t,className:"text-text-muted hover:text-text text-2xl leading-none",children:"\xd7"})]}),(0,a.jsx)("div",{className:"flex-1 overflow-auto p-4",children:o?(0,a.jsx)("div",{className:"text-center py-8 text-text-muted",children:"Loading pricing data..."}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"bg-bg-subtle border border-border rounded-lg p-3 text-sm",children:[(0,a.jsx)("p",{className:"font-medium mb-1",children:"Pricing Rates Format"}),(0,a.jsxs)("p",{className:"text-text-muted",children:["All rates are in ",(0,a.jsx)("strong",{children:"dollars per million tokens"})," ($/1M tokens). Example: Input rate of 2.50 means $2.50 per 1,000,000 input tokens."]})]}),m.map(e=>{let t=Object.keys(i[e]).sort();return(0,a.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,a.jsx)("div",{className:"bg-bg-subtle px-4 py-2 font-semibold text-sm",children:e.toUpperCase()}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-bg-hover text-text-muted uppercase text-xs",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 text-left",children:"Model"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Input"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Output"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Cached"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Reasoning"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Cache Creation"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-border",children:t.map(t=>(0,a.jsxs)("tr",{className:"hover:bg-bg-subtle/50",children:[(0,a.jsx)("td",{className:"px-3 py-2 font-medium",children:t}),x.map(c=>(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("input",{type:"number",step:"0.01",min:"0",value:i[e][t][c]||0,onChange:a=>{let n;!isNaN(n=parseFloat(a.target.value))&&!(n<0)&&r(a=>{let i={...a};return i[e]||(i[e]={}),i[e][t]||(i[e][t]={}),i[e][t][c]=n,i})},className:"w-20 px-2 py-1 text-right bg-bg-base border border-border rounded focus:outline-none focus:border-primary"})},c))]},t))})]})})]},e)}),0===m.length&&(0,a.jsx)("div",{className:"text-center py-8 text-text-muted",children:"No pricing data available"})]})}),(0,a.jsxs)("div",{className:"p-4 border-t border-border flex items-center justify-between gap-2",children:[(0,a.jsx)("button",{onClick:g,className:"px-4 py-2 text-sm text-red-500 hover:bg-red-500/10 rounded border border-red-500/20 transition-colors",disabled:d,children:"Reset to Defaults"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:t,className:"px-4 py-2 text-sm text-text-muted hover:text-text border border-border rounded transition-colors",disabled:d,children:"Cancel"}),(0,a.jsx)("button",{onClick:h,className:"px-4 py-2 text-sm bg-primary text-white rounded hover:bg-primary/90 transition-colors disabled:opacity-50",disabled:d,children:d?"Saving...":"Save Changes"})]})]})]})})}var u=c(50910);function d(){(0,i.useRouter)();let[e,t]=(0,n.useState)(!1),[c,s]=(0,n.useState)(null),[d,p]=(0,n.useState)(!0),l=(0,u.c)("settings");(0,n.useEffect)(()=>{h()},[]);let h=async()=>{p(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();s(t)}}catch(e){console.error("Failed to load pricing:",e)}finally{p(!1)}};return(0,a.jsxs)("div",{className:"max-w-6xl mx-auto p-6 space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-3xl font-bold",children:l("pricingSettingsTitle")}),(0,a.jsx)("p",{className:"text-text-muted mt-1",children:l("modelPricingDesc")})]}),(0,a.jsx)("button",{onClick:()=>t(!0),className:"px-4 py-2 bg-primary text-white rounded hover:bg-primary/90 transition-colors",children:l("editPricing")})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,a.jsxs)(r.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:l("totalModels")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1",children:d?"...":(()=>{if(!c)return 0;let e=0;for(let t in c)e+=Object.keys(c[t]).length;return e})()})]}),(0,a.jsxs)(r.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:l("providers")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1",children:d?"...":(!c?[]:Object.keys(c).sort()).length})]}),(0,a.jsxs)(r.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:l("status")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-success",children:d?"...":l("active")})]})]}),(0,a.jsxs)(r.default,{className:"p-6",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold mb-4",children:l("howPricingWorks")}),(0,a.jsxs)("div",{className:"space-y-3 text-sm text-text-muted",children:[(0,a.jsxs)("p",{children:[(0,a.jsxs)("strong",{children:[l("costCalculation"),":"]})," ",l("costCalculationDesc")]}),(0,a.jsxs)("p",{children:[(0,a.jsxs)("strong",{children:[l("pricingFormat"),":"]})," ",l("pricingFormatDesc")]}),(0,a.jsx)("p",{children:(0,a.jsxs)("strong",{children:[l("tokenTypes"),":"]})}),(0,a.jsxs)("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Input:"})," ",l("inputTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Output:"})," ",l("outputTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Cached:"})," ",l("cachedTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Reasoning:"})," ",l("reasoningTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Cache Creation:"})," ",l("cacheCreationTokenDesc")]})]}),(0,a.jsx)("p",{children:l("customPricingNote")})]})]}),(0,a.jsxs)(r.default,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:l("currentPricing")}),(0,a.jsx)("button",{onClick:()=>t(!0),className:"text-primary hover:underline text-sm",children:l("viewFullDetails")})]}),d?(0,a.jsx)("div",{className:"text-center py-4 text-text-muted",children:l("loadingPricing")}):c?(0,a.jsxs)("div",{className:"space-y-3",children:[Object.keys(c).slice(0,5).map(e=>(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsxs)("span",{className:"font-semibold",children:[e.toUpperCase(),":"]})," ",(0,a.jsxs)("span",{className:"text-text-muted",children:[Object.keys(c[e]).length," models"]})]},e)),Object.keys(c).length>5&&(0,a.jsxs)("div",{className:"text-sm text-text-muted",children:["+ ",Object.keys(c).length-5," more providers"]})]}):(0,a.jsx)("div",{className:"text-text-muted",children:l("noPricing")})]}),e&&(0,a.jsx)(o,{isOpen:e,onClose:()=>t(!1),onSave:()=>{h()}})]})}}},e=>{e.O(0,[3418,8441,3794,7358],()=>e(e.s=43265)),_N_E=e.O()}]);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3528],{2824:(e,t,s)=>{"use strict";s.d(t,{default:()=>C});var a=s(95155),r=s(12115),n=s(40993),l=s(50910);let i=[{id:"simple-chat",name:"Simple Chat",icon:"chat",description:"Basic text message",formats:{openai:{model:"gpt-4o",messages:[{role:"system",content:"You are a helpful assistant."},{role:"user",content:"Hello! How are you today?"}],stream:!0},claude:{model:"claude-sonnet-4-20250514",system:"You are a helpful assistant.",max_tokens:1024,messages:[{role:"user",content:"Hello! How are you today?"}],stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:"Hello! How are you today?"}]}],systemInstruction:{parts:[{text:"You are a helpful assistant."}]}},"openai-responses":{model:"gpt-4o",input:"Hello! How are you today?",instructions:"You are a helpful assistant."}}},{id:"tool-calling",name:"Tool Calling",icon:"build",description:"Function/tool invocation",formats:{openai:{model:"gpt-4o",messages:[{role:"user",content:"What's the weather in S\xe3o Paulo?"}],tools:[{type:"function",function:{name:"get_weather",description:"Get current weather for a location",parameters:{type:"object",properties:{location:{type:"string",description:"City name"},unit:{type:"string",enum:["celsius","fahrenheit"]}},required:["location"]}}}],stream:!0},claude:{model:"claude-sonnet-4-20250514",max_tokens:1024,messages:[{role:"user",content:"What's the weather in S\xe3o Paulo?"}],tools:[{name:"get_weather",description:"Get current weather for a location",input_schema:{type:"object",properties:{location:{type:"string",description:"City name"},unit:{type:"string",enum:["celsius","fahrenheit"]}},required:["location"]}}],stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:"What's the weather in S\xe3o Paulo?"}]}],tools:[{functionDeclarations:[{name:"get_weather",description:"Get current weather for a location",parameters:{type:"object",properties:{location:{type:"string",description:"City name"},unit:{type:"string",enum:["celsius","fahrenheit"]}},required:["location"]}}]}]}}},{id:"multi-turn",name:"Multi-turn",icon:"forum",description:"Conversation with history",formats:{openai:{model:"gpt-4o",messages:[{role:"system",content:"You are a coding assistant."},{role:"user",content:"Write a function to sort an array in Python."},{role:"assistant",content:"Here's a simple sort function:\n\n```python\ndef sort_array(arr):\n return sorted(arr)\n```"},{role:"user",content:"Now make it sort in descending order."}],stream:!0},claude:{model:"claude-sonnet-4-20250514",system:"You are a coding assistant.",max_tokens:1024,messages:[{role:"user",content:"Write a function to sort an array in Python."},{role:"assistant",content:"Here's a simple sort function:\n\n```python\ndef sort_array(arr):\n return sorted(arr)\n```"},{role:"user",content:"Now make it sort in descending order."}],stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:"Write a function to sort an array in Python."}]},{role:"model",parts:[{text:"Here's a simple sort function:\n\n```python\ndef sort_array(arr):\n return sorted(arr)\n```"}]},{role:"user",parts:[{text:"Now make it sort in descending order."}]}],systemInstruction:{parts:[{text:"You are a coding assistant."}]}}}},{id:"thinking",name:"Thinking",icon:"psychology",description:"Extended thinking / reasoning",formats:{openai:{model:"o3-mini",messages:[{role:"user",content:"What is the sum of the first 100 prime numbers?"}],stream:!0},claude:{model:"claude-sonnet-4-20250514",max_tokens:16e3,thinking:{type:"enabled",budget_tokens:1e4},messages:[{role:"user",content:"What is the sum of the first 100 prime numbers?"}],stream:!0},gemini:{model:"gemini-2.5-flash-thinking",contents:[{role:"user",parts:[{text:"What is the sum of the first 100 prime numbers?"}]}],generationConfig:{thinkingConfig:{thinkingBudget:1e4}}}}},{id:"system-prompt",name:"System Prompt",icon:"settings",description:"Complex system instructions",formats:{openai:{model:"gpt-4o",messages:[{role:"system",content:"You are a senior software engineer specializing in distributed systems. Answer questions concisely using industry best practices. Always provide code examples when relevant. Format your responses using markdown."},{role:"user",content:"How do I implement a circuit breaker pattern?"}],temperature:.7,stream:!0},claude:{model:"claude-sonnet-4-20250514",system:"You are a senior software engineer specializing in distributed systems. Answer questions concisely using industry best practices. Always provide code examples when relevant. Format your responses using markdown.",max_tokens:2048,messages:[{role:"user",content:"How do I implement a circuit breaker pattern?"}],temperature:.7,stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:"How do I implement a circuit breaker pattern?"}]}],systemInstruction:{parts:[{text:"You are a senior software engineer specializing in distributed systems. Answer questions concisely using industry best practices. Always provide code examples when relevant. Format your responses using markdown."}]},generationConfig:{temperature:.7}}}},{id:"streaming",name:"Streaming",icon:"stream",description:"SSE streaming request",formats:{openai:{model:"gpt-4o",messages:[{role:"user",content:"Tell me a short story about a robot learning to paint."}],stream:!0,stream_options:{include_usage:!0}},claude:{model:"claude-sonnet-4-20250514",max_tokens:1024,messages:[{role:"user",content:"Tell me a short story about a robot learning to paint."}],stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:"Tell me a short story about a robot learning to paint."}]}]}}}],o={openai:{label:"OpenAI",color:"emerald",icon:"smart_toy"},"openai-responses":{label:"OpenAI Responses",color:"amber",icon:"swap_horiz"},claude:{label:"Claude",color:"orange",icon:"psychology"},gemini:{label:"Gemini",color:"blue",icon:"auto_awesome"},antigravity:{label:"Antigravity",color:"purple",icon:"rocket_launch"},kiro:{label:"Kiro",color:"cyan",icon:"terminal"},cursor:{label:"Cursor",color:"pink",icon:"edit"},codex:{label:"Codex",color:"yellow",icon:"code"}},c=Object.entries(o).map(([e,t])=>({value:e,label:t.label}));var d=s(75707),m=s.n(d);let u=m()(()=>s.e(8202).then(s.bind(s,28202)),{loadableGenerated:{webpack:()=>[28202]},ssr:!1});function x(){let e=(0,l.c)("translator"),[t,s]=(0,r.useState)("claude"),[d,m]=(0,r.useState)("openai"),[x,p]=(0,r.useState)(""),[h,f]=(0,r.useState)(""),[g,b]=(0,r.useState)(null),[y,j]=(0,r.useState)(!1),[v,N]=(0,r.useState)(!1),[w,k]=(0,r.useState)(null),S=(0,r.useCallback)(async e=>{if(!e||e.trim().length<5)return void b(null);try{let t=JSON.parse(e);N(!0);let a=await fetch("/api/translator/detect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:t})}),r=await a.json();r.success&&(b(r.format),s(r.format))}catch{}finally{N(!1)}},[]);(0,r.useEffect)(()=>{let e=setTimeout(()=>{S(x)},600);return()=>clearTimeout(e)},[x,S]);let C=async()=>{if(x.trim()){j(!0),f("");try{let e=JSON.parse(x),s=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:t,targetFormat:d,body:e})}),a=await s.json();a.success?f(JSON.stringify(a.result,null,2)):f(JSON.stringify({error:a.error},null,2))}catch(e){f(JSON.stringify({error:e.message},null,2))}j(!1)}},O=async e=>{try{await navigator.clipboard.writeText(e)}catch{}},_=o[t]||o.openai,P=o[d]||o.openai;return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:e("formatConverter")}),(0,a.jsx)("p",{children:"Paste or type a JSON request body. The translator will auto-detect the source format and convert it to the target format. Use this to debug how OmniRoute translates requests between formats (OpenAI ↔ Claude ↔ Gemini ↔ Responses API)."})]})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex flex-col sm:flex-row items-center gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:"Source Format"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] text-${_.color}-500`,children:_.icon}),(0,a.jsx)(n.l6,{value:t,onChange:e=>{s(e.target.value),b(null)},options:c,className:"flex-1"}),g&&(0,a.jsx)(n.Ex,{variant:"primary",size:"sm",icon:"auto_awesome",children:"Auto"})]})]}),(0,a.jsx)("button",{onClick:()=>{s(d),m(t),p(h),f(""),b(null)},className:"p-2 rounded-full hover:bg-primary/10 text-text-muted hover:text-primary transition-all mt-4 sm:mt-5",title:"Swap formats",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:"swap_horiz"})}),(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:"Target Format"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] text-${P.color}-500`,children:P.icon}),(0,a.jsx)(n.l6,{value:d,onChange:e=>m(e.target.value),options:c,className:"flex-1"})]})]}),(0,a.jsx)("div",{className:"pt-0 sm:pt-5",children:(0,a.jsx)(n.$n,{icon:"arrow_forward",onClick:C,loading:y,disabled:!x.trim()||y,className:"whitespace-nowrap",children:"Translate"})})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"input"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e(">input</")}),g&&(0,a.jsx)(n.Ex,{variant:"info",size:"sm",dot:!0,children:o[g]?.label||g}),v&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted animate-spin",children:"progress_activity"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("button",{onClick:()=>O(x),className:"p-1.5 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-text-main transition-colors",title:"Copy",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})}),(0,a.jsx)("button",{onClick:()=>{p(""),f(""),b(null),k(null)},className:"p-1.5 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-text-main transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]}),(0,a.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,a.jsx)(u,{height:"400px",defaultLanguage:"json",value:x,onChange:e=>p(e||""),theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,formatOnPaste:!0,placeholder:"Paste a request body here or select a template below..."}})})]})}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"output"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e(">output</")}),h&&(0,a.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:o[d]?.label||d})]}),(0,a.jsx)("div",{className:"flex items-center gap-1",children:(0,a.jsx)("button",{onClick:()=>O(h),className:"p-1.5 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-text-main transition-colors",title:"Copy",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})})})]}),(0,a.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,a.jsx)(u,{height:"400px",defaultLanguage:"json",value:h,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,readOnly:!0}})})]})})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"library_books"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Example Templates"}),(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"— Click to load"})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2",children:i.map(e=>(0,a.jsxs)("button",{onClick:()=>{p(JSON.stringify(e.formats[t]||e.formats.openai,null,2)),k(e.id),f("")},className:`
|
|
2
|
+
group flex flex-col items-center gap-1.5 p-3 rounded-lg border transition-all text-center
|
|
3
|
+
${w===e.id?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/30 hover:bg-primary/5 text-text-muted hover:text-text-main"}
|
|
4
|
+
`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[22px] ${w===e.id?"text-primary":"text-text-muted group-hover:text-primary"} transition-colors`,children:e.icon}),(0,a.jsx)("span",{className:"text-xs font-medium leading-tight",children:e.name})]},e.id))}),w&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),"Template loads the request in"," ",(0,a.jsx)("strong",{className:"text-text-main",children:o[t]?.label||t})," ","format. Change Source Format to load in a different format."]})]})})]})}var p=s(20909);function h(e="openai"){let[t,s]=(0,r.useState)(e),[a,n]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),[a,r]=await Promise.all([e.json(),t.json()]),l=new Map((r.nodes||[]).map(e=>[e.id,e])),i=[...new Set((a.connections||[]).filter(e=>!1!==e.isActive).map(e=>e.provider))].map(e=>{let t=p.Q2[e],s=l.get(e),a=t?.name||s?.name||e;return!t&&e.startsWith(p.JH)&&(a=s?.name||"OpenAI Compatible"),!t&&e.startsWith(p.DI)&&(a=s?.name||"Anthropic Compatible"),{value:e,label:a}}).sort((e,t)=>e.label.localeCompare(t.label)),o=i.length>0?i:Object.entries(p.Q2).map(([e,t])=>({value:e,label:t.name}));n(o),o.length>0&&s(e=>o.some(t=>t.value===e)?e:o[0].value)}catch{let e=Object.entries(p.Q2).map(([e,t])=>({value:e,label:t.name}));n(e),e.length>0&&s(t=>e.some(e=>e.value===t)?t:e[0].value)}finally{i(!1)}})()},[]),{provider:t,setProvider:s,providerOptions:a,loading:l}}let f={openai:["gpt-","o1-","o3-","o4-"],"openai-responses":["gpt-","o1-","o3-","o4-"],claude:["claude-"],gemini:["gemini-"]};function g(){let[e,t]=(0,r.useState)(""),[s,a]=(0,r.useState)([]),[n,l]=(0,r.useState)(!0);(0,r.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/v1/models"),t=((await e.json()).data||[]).map(e=>e.id).sort((e,t)=>e.localeCompare(t));a(t)}catch{a([])}finally{l(!1)}})()},[]);let i=(0,r.useCallback)(e=>{if(0===s.length)return"";for(let t of f[e]||[]){let e=s.find(e=>e.startsWith(t));if(e)return e}return s[0]},[s]);return{model:e,setModel:t,availableModels:s,loading:n,pickModelForFormat:i}}let b=m()(()=>s.e(8202).then(s.bind(s,28202)),{loadableGenerated:{webpack:()=>[28202]},ssr:!1});function y(){let e=(0,l.c)("translator"),{provider:t,setProvider:s,providerOptions:i}=h("openai"),{model:d,setModel:m,availableModels:u,pickModelForFormat:x}=g(),[p,f]=(0,r.useState)("openai"),[y,j]=(0,r.useState)(""),[v,N]=(0,r.useState)(!1),[w,k]=(0,r.useState)([]),[S,C]=(0,r.useState)(null),[O,_]=(0,r.useState)(null),P=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=x(p);e&&m(e)},[p,x,m]);let T=()=>{P.current?.scrollIntoView({behavior:"smooth"})},I=async()=>{if(!y.trim()||v)return;let e=y.trim();j(""),N(!0),k(t=>[...t,{role:"user",content:e}]);let s=[];try{let a,r=[...w.map(e=>({role:e.role,content:e.content})),{role:"user",content:e}];a="claude"===p?{model:d,max_tokens:1024,messages:r,stream:!0}:"gemini"===p?{model:d,contents:r.map(e=>({role:"assistant"===e.role?"model":"user",parts:[{text:e.content}]}))}:"openai-responses"===p?{model:d,input:r.map(e=>({type:"message",role:e.role,content:[{type:"input_text",text:e.content}]})),stream:!0}:{model:d,messages:r,stream:!0},s.push({id:1,name:"Client Request",description:"The request body as your client would send it",format:p,content:JSON.stringify(a,null,2),status:"done"});let n=await fetch("/api/translator/detect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:a})}),l=(await n.json()).format||p;s.push({id:2,name:"Format Detected",description:"OmniRoute auto-detects the API format from the request structure",format:l,content:JSON.stringify({detectedFormat:l,clientFormat:p,match:l===p},null,2),status:"done"});let i=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:l,targetFormat:"openai",body:a})}),o=await i.json();s.push({id:3,name:"OpenAI Intermediate",description:"All formats are first normalized to OpenAI format (the universal bridge)",format:"openai",content:JSON.stringify(o.result||o,null,2),status:o.success?"done":"error"});let c=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:"openai",provider:t,body:o.result})}),m=await c.json(),u=m.targetFormat||"openai";s.push({id:4,name:"Provider Format",description:"OpenAI format is translated to the provider's native format",format:u,content:JSON.stringify(m.result||m,null,2),status:m.success?"done":"error"});let x=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,body:m.result||o.result})});if(x.ok){let e=x.body.getReader(),t=new TextDecoder,a="";for(;;){let{done:s,value:r}=await e.read();if(s)break;a+=t.decode(r,{stream:!0})}s.push({id:5,name:"Provider Response",description:"The raw SSE stream from the provider API",format:u,content:a.slice(0,5e3)+(a.length>5e3?"\n... (truncated)":""),status:"done"});let r=function(e){let t="";for(let s of e.split("\n")){if(!s.startsWith("data: "))continue;let e=s.slice(6).trim();if("[DONE]"===e)break;try{let s=JSON.parse(e),a=s.choices?.[0]?.delta;a?.content&&(t+=a.content),"content_block_delta"===s.type&&s.delta?.text&&(t+=s.delta.text)}catch{}}return t||e.slice(0,500)}(a);k(e=>[...e,{role:"assistant",content:r||"(No text extracted)"}])}else{let e=await x.json().catch(()=>({error:"Request failed"}));s.push({id:5,name:"Provider Response",description:"The raw response from the provider API",format:u,content:JSON.stringify(e,null,2),status:"error"}),k(t=>[...t,{role:"assistant",content:`Error: ${e.error||"Request failed"}`}])}}catch(e){s.push({id:s.length+1,name:"Error",description:"An unexpected error occurred",format:"error",content:JSON.stringify({error:e.message},null,2),status:"error"}),k(t=>[...t,{role:"assistant",content:`Error: ${e.message}`}])}C(s),_(s.length>0?s[s.length-1].id:null),N(!1),setTimeout(T,100)};return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:e("pipelineDebugger")}),(0,a.jsxs)("p",{children:["Send messages as a specific client format and see how each step of the translation pipeline works. The right panel shows the full flow:"," ",(0,a.jsx)("strong",{className:"text-text-main",children:"Client Request → Format Detection → OpenAI Intermediate → Provider Format → Response"}),". Click any step to inspect the data at that stage."]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1 uppercase tracking-wider",children:"Client Format"}),(0,a.jsx)(n.l6,{value:p,onChange:e=>f(e.target.value),options:c.filter(e=>["openai","claude","gemini","openai-responses"].includes(e.value))})]}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1 uppercase tracking-wider",children:"Provider"}),(0,a.jsx)(n.l6,{value:t,onChange:e=>s(e.target.value),options:i})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1 uppercase tracking-wider",children:"Model"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:d,onChange:e=>m(e.target.value),list:"model-suggestions",placeholder:"Select or type a model name...",className:"w-full bg-bg-subtle border border-border rounded-lg px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:border-primary transition-colors"}),(0,a.jsx)("datalist",{id:"model-suggestions",children:u.map(e=>(0,a.jsx)("option",{value:e},e))})]})]})]})}),(0,a.jsxs)(n.Zp,{className:"min-h-[400px] flex flex-col",children:[(0,a.jsxs)("div",{className:"p-4 flex-1 overflow-y-auto max-h-[500px] space-y-3",children:[0===w.length&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-text-muted py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-3 opacity-30",children:"chat"}),(0,a.jsx)("p",{className:"text-sm font-medium mb-1",children:"Send a message to see the translation pipeline"}),(0,a.jsxs)("p",{className:"text-xs text-center max-w-xs",children:["Your message will be formatted as a"," ",(0,a.jsx)("strong",{children:o[p]?.label})," request, translated through the pipeline, and sent to the selected provider."]})]}),w.map((e,t)=>(0,a.jsx)("div",{className:`flex ${"user"===e.role?"justify-end":"justify-start"}`,children:(0,a.jsxs)("div",{className:`max-w-[85%] rounded-lg px-3 py-2 text-sm ${"user"===e.role?"bg-primary/10 text-text-main border border-primary/20":"bg-bg-subtle text-text-main border border-border"}`,children:[(0,a.jsx)("p",{className:"text-[10px] font-semibold text-text-muted mb-1 uppercase",children:"user"===e.role?`You (${o[p]?.label})`:"Assistant"}),(0,a.jsx)("p",{className:"whitespace-pre-wrap",children:e.content})]})},t)),(0,a.jsx)("div",{ref:P})]}),(0,a.jsx)("div",{className:"p-3 border-t border-border",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:y,onChange:e=>j(e.target.value),onKeyDown:e=>"Enter"===e.key&&!e.shiftKey&&I(),placeholder:"Type a message...",className:"flex-1 bg-bg-subtle border border-border rounded-lg px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:border-primary transition-colors",disabled:v}),(0,a.jsx)(n.$n,{icon:"send",onClick:I,loading:v,disabled:!y.trim()||v,children:"Send"})]})})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"account_tree"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e("translationPipeline")})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Click on any step to inspect the data at that stage"})]})}),S?(0,a.jsx)("div",{className:"space-y-2",children:S.map((e,t)=>{let s=o[e.format]||{label:e.format,color:"gray",icon:"code"},r=O===e.id;return(0,a.jsxs)("div",{children:[t>0&&(0,a.jsx)("div",{className:"flex justify-center py-1",children:(0,a.jsx)("div",{className:"w-px h-4 bg-border"})}),(0,a.jsxs)(n.Zp,{className:"error"===e.status?"border-red-500/30":r?"border-primary/30":"",children:[(0,a.jsxs)("button",{onClick:()=>_(r?null:e.id),className:"w-full p-3 flex items-center gap-3 text-left",children:[(0,a.jsx)("div",{className:`flex items-center justify-center w-7 h-7 rounded-full text-xs font-bold ${"error"===e.status?"bg-red-500/10 text-red-500":"done"===e.status?`bg-${s.color}-500/10 text-${s.color}-500`:"bg-bg-subtle text-text-muted"}`,children:"error"===e.status?"!":e.id}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:e.name}),e.description&&(0,a.jsx)("p",{className:"text-[10px] text-text-muted truncate",children:e.description})]}),(0,a.jsx)(n.Ex,{variant:"error"===e.status?"error":"default",size:"sm",children:s.label}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:r?"expand_less":"expand_more"})]}),r&&(0,a.jsx)("div",{className:"px-3 pb-3",children:(0,a.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,a.jsx)(b,{height:"250px",defaultLanguage:"json",value:e.content,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:11,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,readOnly:!0}})})})]})]},e.id)})}):(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-8 flex flex-col items-center justify-center text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-3 opacity-30",children:"account_tree"}),(0,a.jsx)("p",{className:"text-sm font-medium mb-1",children:"Pipeline visualization"}),(0,a.jsx)("p",{className:"text-xs text-center max-w-xs",children:"Send a message to see how your request flows through detection → translation → provider call."})]})})]})]})]})}let j=[{id:"simple-chat",name:"Simple Chat",icon:"chat",templateId:"simple-chat"},{id:"tool-calling",name:"Tool Calling",icon:"build",templateId:"tool-calling"},{id:"multi-turn",name:"Multi-turn",icon:"forum",templateId:"multi-turn"},{id:"thinking",name:"Thinking",icon:"psychology",templateId:"thinking"},{id:"system-prompt",name:"System Prompt",icon:"settings",templateId:"system-prompt"},{id:"streaming",name:"Streaming",icon:"stream",templateId:"streaming"}];function v(){let e=(0,l.c)("translator"),[t,s]=(0,r.useState)("claude"),{provider:d,setProvider:m,providerOptions:u}=h("openai"),{model:x,setModel:p,availableModels:f,pickModelForFormat:b}=g(),[y,v]=(0,r.useState)({}),[N,w]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=b(t);e&&p(e)},[t,b,p]);let k=async e=>{v(t=>({...t,[e.id]:{status:"running"}}));let s=Date.now();try{let a=i.find(t=>t.id===e.templateId),r=a?.formats[t]||a?.formats.openai;if(!r)return void v(t=>({...t,[e.id]:{status:"error",error:"No template for this format",latency:0}}));let n={...r,model:x};r.contents&&(n.model=x);let l=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:t,provider:d,body:n})}),o=await l.json();if(!o.success)return void v(t=>({...t,[e.id]:{status:"error",error:`Translation failed: ${o.error}`,latency:Date.now()-s}}));let c=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:d,body:o.result})}),m=Date.now()-s;if(!c.ok){let t=await c.json().catch(()=>({}));v(s=>({...s,[e.id]:{status:"error",error:t.error||`HTTP ${c.status}`,latency:m,httpStatus:c.status}}));return}let u=c.body.getReader(),p=0;for(;;){let{done:e}=await u.read();if(e)break;p++}v(t=>({...t,[e.id]:{status:"pass",latency:Date.now()-s,chunks:p}}))}catch(t){v(a=>({...a,[e.id]:{status:"error",error:t.message,latency:Date.now()-s}}))}},S=async()=>{for(let e of(w(!0),v({}),j))await k(e);w(!1)},C=Object.values(y).filter(e=>"pass"===e.status).length,O=Object.values(y).filter(e=>"error"===e.status).length,_=C+O,P=_>0?Math.round(C/_*100):0,T=o[t]||o.openai;return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:e("compatibilityTester")}),(0,a.jsx)("p",{children:"Run predefined scenarios (Simple Chat, Tool Calling, etc.) to verify translation and provider compatibility. Select a source format and target provider, then run all tests to see a compatibility percentage. Use this to find which features work across providers."})]})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-end gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:"Source Format"}),(0,a.jsx)(n.l6,{value:t,onChange:e=>{s(e.target.value),v({})},options:c.filter(e=>["openai","claude","gemini","openai-responses"].includes(e.value))})]}),(0,a.jsx)("div",{className:"flex items-center justify-center px-2",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px] text-text-muted",children:"arrow_forward"})}),(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:"Target Provider"}),(0,a.jsx)(n.l6,{value:d,onChange:e=>{m(e.target.value),v({})},options:u})]}),(0,a.jsx)(n.$n,{icon:"play_arrow",onClick:S,loading:N,disabled:N,children:"Run All Tests"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:"Model"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:x,onChange:e=>p(e.target.value),list:"testbench-model-suggestions",placeholder:"Select or type a model name...",className:"w-full bg-bg-subtle border border-border rounded-lg px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:border-primary transition-colors"}),(0,a.jsx)("datalist",{id:"testbench-model-suggestions",children:f.map(e=>(0,a.jsx)("option",{value:e},e))})]})]})]})}),_>0&&(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e("compatibilityReport")}),(0,a.jsxs)(n.Ex,{variant:P>=80?"success":P>=50?"warning":"error",size:"lg",children:[P,"%"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-green-500"})," ",C," passed"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-red-500"})," ",O," failed"]})]})]}),(0,a.jsx)("div",{className:"w-full h-2 bg-bg-subtle rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-gradient-to-r from-green-500 to-emerald-400 rounded-full transition-all duration-500",style:{width:`${P}%`}})})]})}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:j.map(e=>{let t=y[e.id],s=t?.status==="running";return(0,a.jsx)(n.Zp,{className:`transition-all ${t?.status==="pass"?"border-green-500/30":t?.status==="error"?"border-red-500/30":""}`,children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsx)("div",{className:"flex items-center justify-between",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:`flex items-center justify-center w-9 h-9 rounded-lg ${t?.status==="pass"?"bg-green-500/10 text-green-500":t?.status==="error"?"bg-red-500/10 text-red-500":"bg-bg-subtle text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:s?"progress_activity":t?.status==="pass"?"check_circle":t?.status==="error"?"error":e.icon})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:e.name}),(0,a.jsxs)("p",{className:"text-[10px] text-text-muted uppercase",children:[T.label," →"," ",u.find(e=>e.value===d)?.label||d]})]})]})}),t&&"running"!==t.status&&(0,a.jsx)("div",{className:`rounded-lg p-2 text-xs ${"pass"===t.status?"bg-green-500/5 text-green-600 dark:text-green-400":"bg-red-500/5 text-red-600 dark:text-red-400"}`,children:"pass"===t.status?(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:"✅ Passed"}),(0,a.jsxs)("span",{className:"text-text-muted",children:[t.latency,"ms • ",t.chunks," chunks"]})]}):(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:["❌ ",t.error]}),(0,a.jsxs)("p",{className:"text-text-muted mt-0.5",children:[t.latency,"ms"]})]})}),(0,a.jsx)(n.$n,{size:"sm",variant:t?.status==="pass"?"ghost":"outline",icon:s?"progress_activity":"play_arrow",onClick:()=>k(e),disabled:s||N,className:"w-full",children:s?"Running...":t?"Re-run":"Run Test"})]})},e.id)})})]})}function N(){let e=(0,l.c)("translator"),[t,s]=(0,r.useState)([]),[i,c]=(0,r.useState)(!0),[d,m]=(0,r.useState)(!0),u=(0,r.useRef)(null),x=async()=>{try{let e=await fetch("/api/translator/history?limit=50");if(e.ok){let t=await e.json();s(t.events||[])}}catch{}finally{c(!1)}};(0,r.useEffect)(()=>(x(),d&&(u.current=setInterval(x,3e3)),()=>{u.current&&clearInterval(u.current)}),[d]);let p=t.filter(e=>"success"===e.status).length,h=t.filter(e=>"error"===e.status).length,f=t.length>0?Math.round(t.reduce((e,t)=>e+(t.latency||0),0)/t.length):0;return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:e("realtime")}),(0,a.jsxs)("p",{children:["Shows translation events as API calls flow through OmniRoute. Events come from the in-memory buffer (resets on restart). Use"," ",(0,a.jsx)("strong",{className:"text-text-main",children:e("chatTester")}),","," ",(0,a.jsx)("strong",{className:"text-text-main",children:e("testBench")}),", or external API calls to generate events."]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,a.jsx)(w,{icon:"translate",label:"Total Translations",value:t.length,color:"blue"}),(0,a.jsx)(w,{icon:"check_circle",label:"Successful",value:p,color:"green"}),(0,a.jsx)(w,{icon:"error",label:"Errors",value:h,color:"red"}),(0,a.jsx)(w,{icon:"speed",label:"Avg Latency",value:`${f}ms`,color:"purple"})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-3 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${d?"text-green-500 animate-pulse":"text-text-muted"}`,children:d?"radio_button_checked":"radio_button_unchecked"}),(0,a.jsx)("button",{onClick:()=>m(!d),className:"text-sm text-text-main hover:text-primary transition-colors",children:d?"Live — Auto-refreshing":"Paused"})]}),(0,a.jsxs)("button",{onClick:x,className:"flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"refresh"}),"Refresh"]})]})}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main mb-3",children:e("recentTranslations")}),i?(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:"progress_activity"}),"Loading..."]}):0===t.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-3 opacity-30",children:"monitoring"}),(0,a.jsx)("p",{className:"text-sm font-medium mb-1",children:e("noTranslations")}),(0,a.jsx)("p",{className:"text-xs text-center max-w-sm",children:"Translation events appear here as requests flow through OmniRoute. Use any of these methods to generate events:"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 mt-3 text-xs",children:[(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:"Chat Tester tab"}),(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:"Test Bench tab"}),(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:"External API calls"}),(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:"IDE/CLI integrations"})]}),(0,a.jsx)("p",{className:"text-[10px] mt-3 text-text-muted/70",children:"Note: Events are stored in-memory and reset when the server restarts."})]}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-left text-xs text-text-muted border-b border-border",children:[(0,a.jsx)("th",{className:"pb-2 pr-4",children:e(">time</")}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:e(">source</")}),(0,a.jsx)("th",{className:"pb-2 pr-4"}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:e(">target</")}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:e(">model</")}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:e(">status</")}),(0,a.jsx)("th",{className:"pb-2 text-right",children:e(">latency</")})]})}),(0,a.jsx)("tbody",{children:t.map((e,t)=>{let s=o[e.sourceFormat]||{label:e.sourceFormat||"?",color:"gray"},r=o[e.targetFormat]||{label:e.targetFormat||"?",color:"gray"};return(0,a.jsxs)("tr",{className:"border-b border-border/50 hover:bg-bg-subtle/50 transition-colors",children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-xs text-text-muted whitespace-nowrap",children:e.timestamp?new Date(e.timestamp).toLocaleTimeString():"—"}),(0,a.jsx)("td",{className:"py-2 pr-4",children:(0,a.jsx)(n.Ex,{variant:"default",size:"sm",children:s.label})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"arrow_forward"})}),(0,a.jsx)("td",{className:"py-2 pr-4",children:(0,a.jsx)(n.Ex,{variant:"primary",size:"sm",children:r.label})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-xs font-mono text-text-muted",children:e.model||"—"}),(0,a.jsx)("td",{className:"py-2 pr-4",children:"success"===e.status?(0,a.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"OK"}):(0,a.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e.statusCode||"ERR"})}),(0,a.jsx)("td",{className:"py-2 text-right text-xs text-text-muted",children:e.latency?`${e.latency}ms`:"—"})]},e.id||t)})})]})})]})})]})}function w({icon:e,label:t,value:s,color:r}){return(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex items-center gap-3",children:[(0,a.jsx)("div",{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-${r}-500/10`,children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[22px] text-${r}-500`,children:e})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-lg font-bold text-text-main",children:s}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:t})]})]})})}let k=[{value:"playground",label:"Playground",icon:"code"},{value:"chat-tester",label:"Chat Tester",icon:"chat"},{value:"test-bench",label:"Test Bench",icon:"science"},{value:"live-monitor",label:"Live Monitor",icon:"monitoring"}],S={playground:"Paste any API request body and see how OmniRoute translates it between provider formats (OpenAI ↔ Claude ↔ Gemini ↔ Responses API)","chat-tester":"Send real chat requests through OmniRoute and see the full round-trip: your input, the translated request, the provider response, and the translated output","test-bench":"Define multiple test cases with different inputs and expected outputs, run them all at once, and compare results across providers and models","live-monitor":"Watch incoming requests in real-time as they flow through OmniRoute — see format translations happening live and identify issues instantly"};function C(){let[e,t]=(0,r.useState)("playground");return(0,a.jsxs)("div",{className:"p-8 space-y-6",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h1",{className:"text-2xl font-bold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[28px]",children:"translate"}),"Translator Playground"]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:S[e]||"Debug, test, and visualize how OmniRoute translates API requests between providers"})]}),(0,a.jsx)(n.Iz,{options:k,value:e,onChange:t,size:"md"})]}),"playground"===e&&(0,a.jsx)(x,{}),"chat-tester"===e&&(0,a.jsx)(y,{}),"test-bench"===e&&(0,a.jsx)(v,{}),"live-monitor"===e&&(0,a.jsx)(N,{})]})}},5214:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return a.workAsyncStorageInstance}});let a=s(17828)},17828:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return a}});let a=(0,s(64054).createAsyncLocalStorage)()},21957:(e,t,s)=>{"use strict";function a({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return a}}),s(95155),s(47650),s(5214),s(2451),s(53887)},41112:(e,t,s)=>{"use strict";function a({reason:e,children:t}){return t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return a}}),s(1980)},64054:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={bindSnapshot:function(){return o},createAsyncLocalStorage:function(){return i},createSnapshot:function(){return c}};for(var a in s)Object.defineProperty(t,a,{enumerable:!0,get:s[a]});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class n{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let l="u">typeof globalThis&&globalThis.AsyncLocalStorage;function i(){return l?new l:new n}function o(e){return l?l.bind(e):n.bind(e)}function c(){return l?l.snapshot():function(e,...t){return e(...t)}}},65355:(e,t,s)=>{Promise.resolve().then(s.bind(s,2824))},68635:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let a=s(95155),r=s(12115),n=s(41112);function l(e){return{default:e&&"default"in e?e.default:e}}s(21957);let i={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},o=function(e){let t={...i,...e},s=(0,r.lazy)(()=>t.loader().then(l)),o=t.loading;function c(e){let l=o?(0,a.jsx)(o,{isLoading:!0,pastDelay:!0,error:null}):null,i=!t.ssr||!!t.loading,c=i?r.Suspense:r.Fragment,d=t.ssr?(0,a.jsxs)(a.Fragment,{children:[null,(0,a.jsx)(s,{...e})]}):(0,a.jsx)(n.BailoutToCSR,{reason:"next/dynamic",children:(0,a.jsx)(s,{...e})});return(0,a.jsx)(c,{...i?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},75707:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}});let a=s(73623)._(s(68635));function r(e,t){let s={};"function"==typeof e&&(s.loader=e);let r={...s,...t};return(0,a.default)({...r,modules:r.loadableGenerated?.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{e.O(0,[3418,8500,9751,782,6458,5846,993,8441,3794,7358],()=>e(e.s=65355)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{39608:(e,l,s)=>{Promise.resolve().then(s.bind(s,97449))},97449:(e,l,s)=>{"use strict";s.r(l),s.d(l,{default:()=>n});var o=s(95155),a=s(12115),r=s(40993);function n(){let[e,l]=(0,a.useState)("logs");return(0,o.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,o.jsx)(r.Iz,{options:[{value:"logs",label:"Logger"},{value:"proxy-logs",label:"Proxy"}],value:e,onChange:l}),"logs"===e&&(0,o.jsx)(r.y7,{}),"proxy-logs"===e&&(0,o.jsx)(r.Lo,{})]})}}},e=>{e.O(0,[8500,9751,782,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{39608:(e,l,s)=>{Promise.resolve().then(s.bind(s,97449))},97449:(e,l,s)=>{"use strict";s.r(l),s.d(l,{default:()=>n});var o=s(95155),a=s(12115),r=s(40993);function n(){let[e,l]=(0,a.useState)("logs");return(0,o.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,o.jsx)(r.Iz,{options:[{value:"logs",label:"Logger"},{value:"proxy-logs",label:"Proxy"}],value:e,onChange:l}),"logs"===e&&(0,o.jsx)(r.y7,{}),"proxy-logs"===e&&(0,o.jsx)(r.Lo,{})]})}}},e=>{e.O(0,[3418,8500,9751,782,6458,5846,993,8441,3794,7358],()=>e(e.s=39608)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9305],{69436:(e,s,n)=>{Promise.resolve().then(n.bind(n,17705)),Promise.resolve().then(n.bind(n,80927)),Promise.resolve().then(n.bind(n,76332)),Promise.resolve().then(n.bind(n,35806)),Promise.resolve().then(n.bind(n,81060)),Promise.resolve().then(n.bind(n,54128)),Promise.resolve().then(n.bind(n,71689)),Promise.resolve().then(n.bind(n,44638)),Promise.resolve().then(n.bind(n,66200)),Promise.resolve().then(n.bind(n,51503)),Promise.resolve().then(n.bind(n,99023)),Promise.resolve().then(n.bind(n,89938)),Promise.resolve().then(n.bind(n,34422)),Promise.resolve().then(n.bind(n,1652)),Promise.resolve().then(n.bind(n,92701)),Promise.resolve().then(n.bind(n,18150)),Promise.resolve().then(n.bind(n,97050)),Promise.resolve().then(n.bind(n,21720)),Promise.resolve().then(n.bind(n,92542)),Promise.resolve().then(n.bind(n,91961)),Promise.resolve().then(n.bind(n,71361)),Promise.resolve().then(n.bind(n,85444)),Promise.resolve().then(n.bind(n,61580)),Promise.resolve().then(n.bind(n,80178)),Promise.resolve().then(n.bind(n,48643)),Promise.resolve().then(n.bind(n,8287)),Promise.resolve().then(n.bind(n,37415)),Promise.resolve().then(n.bind(n,33709)),Promise.resolve().then(n.bind(n,42994)),Promise.resolve().then(n.bind(n,34243)),Promise.resolve().then(n.bind(n,55846)),Promise.resolve().then(n.bind(n,6261)),Promise.resolve().then(n.bind(n,19790)),Promise.resolve().then(n.bind(n,45624)),Promise.resolve().then(n.bind(n,25112))}},e=>{e.O(0,[3418,8500,9751,782,6458,5846,993,8441,3794,7358],()=>e(e.s=69436)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7852],{44037:(e,s,a)=>{Promise.resolve().then(a.bind(a,62308))},50910:(e,s,a)=>{"use strict";a.d(s,{c:()=>n});var r=a(33418);function l(e,s){return(...e)=>{try{return s(...e)}catch{throw Error(void 0)}}}let n=l(0,r.c3);l(0,r.kc)},62308:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>o});var r=a(95155),l=a(50910),n=a(12115),c=a(73321);function i(){let e=(0,c.useSearchParams)(),[s,a]=(0,n.useState)("processing");return(0,n.useEffect)(()=>{let s=e.get("code"),r=e.get("state"),l=e.get("error"),n={code:s,state:r,error:l,errorDescription:e.get("error_description"),fullUrl:window.location.href},c=!1;if(window.location.origin,window.opener)try{window.opener.postMessage({type:"oauth_callback",data:n},"*"),c=!0}catch(e){console.log("postMessage failed:",e)}try{let e=new BroadcastChannel("oauth_callback");e.postMessage(n),e.close(),c=!0}catch(e){console.log("BroadcastChannel failed:",e)}try{localStorage.setItem("oauth_callback",JSON.stringify({...n,timestamp:Date.now()})),c=!0}catch(e){console.log("localStorage failed:",e)}c&&(s||l)?setTimeout(()=>{window.opener?(a("success"),setTimeout(()=>{window.close(),setTimeout(()=>a("done"),500)},1500)):a("done")},0):setTimeout(()=>a("manual"),0)},[e]),(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,r.jsxs)("div",{className:"text-center p-8 max-w-md",children:["processing"===s&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h1",{className:"text-xl font-semibold mb-2",children:t("processing")}),(0,r.jsx)("p",{className:"text-text-muted",children:t("pleaseWait")})]}),("success"===s||"done"===s)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h1",{className:"text-xl font-semibold mb-2",children:t("authSuccess")}),(0,r.jsx)("p",{className:"text-text-muted",children:"success"===s?"This window will close automatically...":"You can close this tab now."})]}),"manual"===s&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-yellow-100 dark:bg-yellow-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-yellow-600",children:"info"})}),(0,r.jsx)("h1",{className:"text-xl font-semibold mb-2",children:t("copyUrl")}),(0,r.jsx)("p",{className:"text-text-muted mb-4",children:"Please copy the URL from the address bar and paste it in the application."}),(0,r.jsx)("div",{className:"bg-surface border border-border rounded-lg p-3 text-left",children:(0,r.jsx)("code",{className:"text-xs break-all",children:window.location.href})})]})]})})}function o(){return(0,l.c)("auth"),(0,r.jsx)(n.Suspense,{fallback:(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,r.jsxs)("div",{className:"text-center p-8",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("p",{className:"text-text-muted",children:"Loading..."})]})}),children:(0,r.jsx)(i,{})})}},73321:(e,s,a)=>{"use strict";var r=a(74645);a.o(r,"useParams")&&a.d(s,{useParams:function(){return r.useParams}}),a.o(r,"usePathname")&&a.d(s,{usePathname:function(){return r.usePathname}}),a.o(r,"useRouter")&&a.d(s,{useRouter:function(){return r.useRouter}}),a.o(r,"useSearchParams")&&a.d(s,{useSearchParams:function(){return r.useSearchParams}})}},e=>{e.O(0,[3418,8441,3794,7358],()=>e(e.s=44037)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[200],{50910:(e,t,r)=>{"use strict";r.d(t,{c:()=>s});var a=r(33418);function n(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let s=n(0,a.c3);n(0,a.kc)},62128:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var a=r(95155),n=r(50910),s=r(98500),i=r.n(s);function c(){let e=(0,n.c)("auth");return(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-screen p-6 bg-[var(--bg-primary,#0a0a0f)] text-[var(--text-primary,#e0e0e0)] text-center",children:[(0,a.jsx)("div",{className:"text-[96px] font-extrabold leading-none mb-2",style:{background:"linear-gradient(135deg, #ef4444 0%, #f97316 50%, #eab308 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"403"}),(0,a.jsx)("h1",{className:"text-2xl font-semibold mb-2",children:e("accessDenied")}),(0,a.jsx)("p",{className:"text-[15px] text-[var(--text-secondary,#888)] max-w-[400px] leading-relaxed mb-8",children:"You don't have permission to access this resource. Check your API key or contact the administrator."}),(0,a.jsx)(i(),{href:"/dashboard",className:"px-8 py-3 rounded-[10px] text-white text-sm font-semibold no-underline transition-all duration-200 shadow-[0_4px_16px_rgba(99,102,241,0.3)] hover:-translate-y-0.5",style:{background:"linear-gradient(135deg, #6366f1, #8b5cf6)"},children:"Go to Dashboard"})]})}},88263:(e,t,r)=>{Promise.resolve().then(r.bind(r,62128))}},e=>{e.O(0,[3418,8500,8441,3794,7358],()=>e(e.s=88263)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2162],{40182:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>d});var l=t(95155),a=t(50910),r=t(98500),i=t.n(r),n=t(40993);function d(){let e=(0,a.c)("auth");return(0,l.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4",children:(0,l.jsxs)("div",{className:"w-full max-w-lg",children:[(0,l.jsxs)("div",{className:"text-center mb-8",children:[(0,l.jsx)("h1",{className:"text-3xl font-bold text-primary mb-2",children:e(">resetPassword</")}),(0,l.jsx)("p",{className:"text-text-muted",children:e("resetDescription")})]}),(0,l.jsx)(n.Zp,{className:"mb-4",children:(0,l.jsxs)("div",{className:"flex items-start gap-4 p-2",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-10 rounded-lg bg-primary/10 text-primary shrink-0 mt-0.5",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"terminal"})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold mb-1",children:"Method 1: CLI Reset"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-3",children:"Run the following command on the server where OmniRoute is running:"}),(0,l.jsx)("div",{className:"bg-black/30 rounded-lg p-3 mb-3 font-mono text-sm text-green-400 border border-white/5",children:(0,l.jsx)("code",{children:"npx omniroute reset-password"})}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"This will prompt you to set a new password. The server must be stopped first."})]})]})}),(0,l.jsx)(n.Zp,{className:"mb-6",children:(0,l.jsxs)("div",{className:"flex items-start gap-4 p-2",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-10 rounded-lg bg-amber-500/10 text-amber-500 shrink-0 mt-0.5",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"database"})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold mb-1",children:"Method 2: Manual Reset"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-3",children:"Delete the password from the database and set a new one on startup:"}),(0,l.jsxs)("ol",{className:"text-sm text-text-muted space-y-2 list-decimal list-inside mb-3",children:[(0,l.jsx)("li",{children:e("stopServer")}),(0,l.jsxs)("li",{children:["Set a new password in your"," ",(0,l.jsx)("code",{className:"bg-black/30 px-1 rounded text-text-main",children:".env"})," file:",(0,l.jsx)("div",{className:"bg-black/30 rounded-lg p-2 mt-1 font-mono text-xs text-green-400 border border-white/5",children:"INITIAL_PASSWORD=your_new_password"})]}),(0,l.jsxs)("li",{children:["Delete"," ",(0,l.jsx)("code",{className:"bg-black/30 px-1 rounded text-text-main",children:"data/settings.json"})," ","(or remove the"," ",(0,l.jsx)("code",{className:"bg-black/30 px-1 rounded text-text-main",children:"passwordHash"})," ","field)"]}),(0,l.jsx)("li",{children:"Restart the server — it will use the new password"})]})]})]})}),(0,l.jsx)("div",{className:"text-center",children:(0,l.jsxs)(i(),{href:"/login",className:"text-sm text-primary hover:underline inline-flex items-center gap-1",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_back"}),"Back to Login"]})})]})})}},50057:(e,s,t)=>{Promise.resolve().then(t.bind(t,40182))}},e=>{e.O(0,[3418,8500,9751,782,6458,5846,993,8441,3794,7358],()=>e(e.s=50057)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{11025:(e,r,l)=>{Promise.resolve().then(l.bind(l,91930)),Promise.resolve().then(l.t.bind(l,95642,23)),Promise.resolve().then(l.t.bind(l,51743,23)),Promise.resolve().then(l.bind(l,55846))},51743:()=>{},91930:(e,r,l)=>{"use strict";l.d(r,{default:()=>a});var s=l(33418),t=l(95155);function a({locale:e,...r}){if(!e)throw Error(void 0);return(0,t.jsx)(s.Dk,{locale:e,...r})}},95642:e=>{e.exports={style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"},className:"__className_f367f3",variable:"__variable_f367f3"}}},e=>{e.O(0,[4781,3334,3418,9751,5846,8441,3794,7358],()=>e(e.s=11025)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{13504:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var a=s(95155),r=s(50910),i=s(12115),n=s(40993),l=s(73321);function d(){let e=(0,r.c)("auth"),[t,s]=(0,i.useState)(""),[d,c]=(0,i.useState)(""),[o,m]=(0,i.useState)(!1),[x,u]=(0,i.useState)(null),[h,p]=(0,i.useState)(null),[b,f]=(0,i.useState)(!1),y=(0,l.useRouter)();(0,i.useEffect)(()=>{f(!0),async function(){let e=new AbortController,t=setTimeout(()=>e.abort(),5e3),s=window.location.origin;try{let a=await fetch(`${s}/api/settings`,{signal:e.signal});if(clearTimeout(t),a.ok){let e=await a.json();if(!1===e.requireLogin){y.push("/dashboard"),y.refresh();return}u(!!e.hasPassword),p(!!e.setupComplete)}else u(!0),p(!0)}catch(e){clearTimeout(t),u(!0),p(!0)}}()},[y]);let j=async e=>{e.preventDefault(),m(!0),c("");try{let e=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:t})});if(e.ok)sessionStorage.setItem("omniroute_login_time",String(Date.now())),y.push("/dashboard"),y.refresh();else{let t=await e.json();c(t.error||"Invalid password")}}catch(e){c("An error occurred. Please try again.")}finally{m(!1)}};return null===x||null===h?(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"w-10 h-10 border-2 border-primary/20 rounded-full"}),(0,a.jsx)("div",{className:"absolute inset-0 w-10 h-10 border-2 border-primary border-t-transparent rounded-full animate-spin"})]}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Loading..."})]})}):x||h?!x&&h?(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-6",children:(0,a.jsxs)("div",{className:`w-full max-w-md transition-all duration-700 ease-out ${b?"opacity-100 translate-y-0":"opacity-0 translate-y-4"}`,children:[(0,a.jsxs)("div",{className:"text-center mb-10",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-3xl bg-gradient-to-br from-amber-500/10 to-amber-500/5 border border-amber-500/10 mb-6",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-amber-500 text-[40px]",children:"shield_person"})}),(0,a.jsx)("h1",{className:"text-3xl font-bold text-text-main tracking-tight",children:"Secure Your Instance"}),(0,a.jsx)("p",{className:"text-text-muted mt-2",children:e("passwordNotEnabled")})]}),(0,a.jsx)("div",{className:"bg-surface border border-border rounded-2xl p-8 shadow-soft",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-text-muted leading-relaxed mb-6",children:"Set a password to protect your dashboard and secure your API endpoints from unauthorized access."}),(0,a.jsx)(n.$n,{variant:"primary",className:"w-full h-11 text-sm font-medium",onClick:()=>y.push("/dashboard/settings?tab=security"),children:"Configure Password"})]})}),(0,a.jsx)("p",{className:"text-center text-xs text-text-muted/60 mt-8",children:"OmniRoute — Unified AI API Proxy"})]})}):(0,a.jsxs)("div",{className:"min-h-screen flex bg-bg",children:[(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center p-6",children:(0,a.jsxs)("div",{className:`w-full max-w-sm transition-all duration-700 ease-out ${b?"opacity-100 translate-y-0":"opacity-0 translate-y-4"}`,children:[(0,a.jsxs)("div",{className:"mb-10",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-8",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-primary to-primary-hover flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-white text-[20px]",children:"hub"})}),(0,a.jsx)("span",{className:"text-xl font-semibold text-text-main tracking-tight",children:"OmniRoute"})]}),(0,a.jsx)("h1",{className:"text-2xl font-bold text-text-main tracking-tight",children:e(">signIn</")}),(0,a.jsx)("p",{className:"text-text-muted mt-1.5",children:e("enterPassword")})]}),(0,a.jsxs)("form",{onSubmit:j,className:"space-y-5",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-text-main",children:e(">password</")}),(0,a.jsx)(n.pd,{type:"password",placeholder:"Enter your password",value:t,onChange:e=>s(e.target.value),required:!0,autoFocus:!0,className:"h-11"}),d&&(0,a.jsxs)("p",{className:"text-sm text-red-500 flex items-center gap-1.5 pt-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"error"}),d]})]}),(0,a.jsx)(n.$n,{type:"submit",variant:"primary",className:"w-full h-11 text-sm font-medium",loading:o,children:"Continue"})]}),(0,a.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:(0,a.jsx)("a",{href:"/forgot-password",className:"text-sm text-text-muted hover:text-primary transition-colors",children:"Forgot your password?"})})]})}),(0,a.jsx)("div",{className:"hidden lg:flex lg:w-1/2 bg-gradient-to-br from-primary/5 via-primary/3 to-transparent items-center justify-center p-12",children:(0,a.jsx)("div",{className:`max-w-md transition-all duration-700 delay-200 ease-out ${b?"opacity-100 translate-y-0":"opacity-0 translate-y-4"}`,children:(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-2xl font-bold text-text-main mb-3",children:"Unified AI API Proxy"}),(0,a.jsx)("p",{className:"text-text-muted leading-relaxed",children:"Route requests to multiple AI providers through a single endpoint. Load balancing, failover, and usage tracking built in."})]}),(0,a.jsx)("div",{className:"space-y-4",children:[{icon:"swap_horiz",title:"Multi-Provider",desc:"OpenAI, Anthropic, Google, and more"},{icon:"speed",title:"Load Balancing",desc:"Distribute requests intelligently"},{icon:"analytics",title:"Usage Tracking",desc:"Monitor costs and tokens"}].map(e=>(0,a.jsxs)("div",{className:"flex items-start gap-4 p-4 rounded-xl bg-surface/50 border border-border",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:e.icon})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium text-text-main",children:e.title}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:e.desc})]})]},e.icon))})]})})})]}):(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-6",children:(0,a.jsxs)("div",{className:`w-full max-w-md transition-all duration-700 ease-out ${b?"opacity-100 translate-y-0":"opacity-0 translate-y-4"}`,children:[(0,a.jsxs)("div",{className:"text-center mb-10",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-3xl bg-gradient-to-br from-primary/10 to-primary/5 border border-primary/10 mb-6",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[40px]",children:"rocket_launch"})}),(0,a.jsx)("h1",{className:"text-3xl font-bold text-text-main tracking-tight",children:e(">welcome</")}),(0,a.jsx)("p",{className:"text-text-muted mt-2",children:"Let's get your OmniRoute instance configured"})]}),(0,a.jsx)("div",{className:"bg-surface border border-border rounded-2xl p-8 shadow-soft",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-text-muted leading-relaxed mb-6",children:"Run the onboarding wizard to set up your password and connect your first AI provider."}),(0,a.jsx)(n.$n,{variant:"primary",className:"w-full h-11 text-sm font-medium",onClick:()=>y.push("/dashboard/onboarding"),children:"Start Onboarding"})]})}),(0,a.jsxs)("p",{className:"text-center text-xs text-text-muted/60 mt-8",children:["OmniRoute — ",e("unifiedProxy")]})]})})}},90723:(e,t,s)=>{Promise.resolve().then(s.bind(s,13504))}},e=>{e.O(0,[3418,8500,9751,782,6458,5846,993,8441,3794,7358],()=>e(e.s=90723)),_N_E=e.O()}]);
|
|
Binary file
|
package/app/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omniroute",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.9",
|
|
4
4
|
"description": "Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"lowdb": "^7.0.1",
|
|
73
73
|
"monaco-editor": "^0.55.1",
|
|
74
74
|
"next": "^16.1.6",
|
|
75
|
+
"next-intl": "^4.8.3",
|
|
75
76
|
"node-machine-id": "^1.1.12",
|
|
76
77
|
"open": "^11.0.0",
|
|
77
78
|
"ora": "^9.1.0",
|