9router 0.5.12 → 0.5.18
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/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +11 -11
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page.js +1 -1
- package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +6 -6
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +5 -5
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing/page.js +1 -1
- package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +5 -5
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page.js +1 -1
- package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +6 -6
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js +1 -1
- package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +11 -11
- package/app/.next-cli-build/server/chunks/1241.js +1 -1
- package/app/.next-cli-build/server/chunks/212.js +1 -1
- package/app/.next-cli-build/server/chunks/2231.js +1 -1
- package/app/.next-cli-build/server/chunks/2280.js +1 -0
- package/app/.next-cli-build/server/chunks/2701.js +10 -0
- package/app/.next-cli-build/server/chunks/2722.js +1 -1
- package/app/.next-cli-build/server/chunks/318.js +6 -13
- package/app/.next-cli-build/server/chunks/3535.js +1 -1
- package/app/.next-cli-build/server/chunks/412.js +2 -2
- package/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/app/.next-cli-build/server/chunks/4827.js +1 -1
- package/app/.next-cli-build/server/chunks/4884.js +3 -3
- package/app/.next-cli-build/server/chunks/5612.js +1 -0
- package/app/.next-cli-build/server/chunks/5615.js +1 -1
- package/app/.next-cli-build/server/chunks/5699.js +1 -1
- package/app/.next-cli-build/server/chunks/5961.js +1 -1
- package/app/.next-cli-build/server/chunks/6070.js +1 -1
- package/app/.next-cli-build/server/chunks/615.js +1 -1
- package/app/.next-cli-build/server/chunks/6182.js +2 -2
- package/app/.next-cli-build/server/chunks/6306.js +1 -1
- package/app/.next-cli-build/server/chunks/6763.js +1 -1
- package/app/.next-cli-build/server/chunks/6936.js +1 -1
- package/app/.next-cli-build/server/chunks/8238.js +1 -1
- package/app/.next-cli-build/server/chunks/8271.js +1 -1
- package/app/.next-cli-build/server/chunks/8833.js +75 -0
- package/app/.next-cli-build/server/chunks/8895.js +6 -6
- package/app/.next-cli-build/server/chunks/8920.js +1 -1
- package/app/.next-cli-build/server/chunks/9630.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +3 -3
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/1321-ba0695aeb6346c8d.js +1 -0
- package/app/.next-cli-build/static/chunks/5497-09b5b34c1bf27a6d.js +7 -0
- package/app/.next-cli-build/static/chunks/{6069-62b10374f45001c3.js → 6069-3d38ee5bebefdc91.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-1d548eea0e82af6b.js +10 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-c2d3bd88b46b55e4.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-181dcf89550efe27.js +1 -0
- package/app/.next-cli-build/static/chunks/app/callback/page-806e86a828cf4a0f.js +1 -0
- package/app/.next-cli-build/static/css/b4c8bea393be3991.css +1 -0
- package/app/cli/.build-home/.9router/db/backups/{upgrade-0.5.6-to-0.5.7-0.5.7-20260621-173633 → upgrade-0.5.12-to-0.5.15-0.5.15-20260629-161043}/data.sqlite +0 -0
- package/app/cli/.build-home/.9router/db/backups/{upgrade-0.5.4-to-0.5.6-0.5.6-20260620-160905 → upgrade-0.5.15-to-0.5.18-0.5.18-20260703-152217}/data.sqlite +0 -0
- package/app/cli/.build-home/.9router/db/data.sqlite +0 -0
- package/app/package.json +1 -1
- package/app/public/providers/clinepass.png +0 -0
- package/app/public/providers/kimchi.png +0 -0
- package/app/public/providers/kimchi.svg +4 -0
- package/app/src/mitm/server.js +27 -27
- package/package.json +1 -1
- package/src/cli/menus/providers.js +1 -0
- package/src/cli/tray/tray.ps1 +52 -1
- package/app/.next-cli-build/server/chunks/1275.js +0 -73
- package/app/.next-cli-build/server/chunks/3938.js +0 -1
- package/app/.next-cli-build/server/chunks/7220.js +0 -1
- package/app/.next-cli-build/server/chunks/7879.js +0 -10
- package/app/.next-cli-build/static/chunks/1321-7b9636fd1eaad6c0.js +0 -1
- package/app/.next-cli-build/static/chunks/5497-9d0cd9ade93022ac.js +0 -7
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-c4c59b98f52aba99.js +0 -10
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-f72e66dd55d53998.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-b32efa0400b90a7f.js +0 -1
- package/app/.next-cli-build/static/chunks/app/callback/page-9e4704ee20743942.js +0 -1
- package/app/.next-cli-build/static/css/e283a5cbab362c6d.css +0 -1
- /package/app/.next-cli-build/static/{AH3ddxF9BbbDDIRNE6r7m → HY5oJLpzIFrg6r5EeB2xx}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{AH3ddxF9BbbDDIRNE6r7m → HY5oJLpzIFrg6r5EeB2xx}/_ssgManifest.js +0 -0
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{52397:(e,t,s)=>{Promise.resolve().then(s.bind(s,78907))},70217:(e,t,s)=>{"use strict";function a(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>a})},78907:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>E});var a=s(95155),i=s(12115),l=s(73321),r=s(98500),o=s.n(r),n=s(5772),d=s(35497),c=s(88105),m=s(28777),p=s(11059),x=s(53593),u=s(73006);let h=new Map;async function f(e){if(!e?.url||!e?.type)return[];let t=h.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return h.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}function y({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:a=[],type:i="llm",includeLegacyAliases:l=!0}){let r=new Set(a.map(e=>e.id)),o=new Set,n=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(i&&e!==i||r.has(t.id))continue;let a=`${s}/${t.id}`;o.has(a)||(o.add(a),n.push({id:t.id,name:t.name||t.id,fullModel:a,source:"custom",type:e}))}if(!l)return n;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||r.has(t)||o.has(s)||(o.add(s),n.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:i||"llm"}))}return n}var g=s(14051),b=s.n(g);function v({model:e,fullModel:t,alias:s,copied:i,onCopy:l,testStatus:r,isCustom:o,isFree:n,onDeleteAlias:c,onTest:m,isTesting:p,onDisable:x,caps:u}){let h="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:h?{color:h}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:t}),(0,a.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,a.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,a.jsx)(d.nh,{caps:u,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>l(t,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e.id}`?"Copied!":"Copy"})]}),o?(0,a.jsx)("button",{onClick:c,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):x?(0,a.jsx)("button",{onClick:x,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function j({modelId:e,fullModel:t,copied:s,onCopy:i,onDeleteAlias:l,onTest:r,testStatus:o,isTesting:n}){let d="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),r&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:r,disabled:n,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:n?{animation:"spin 1s linear infinite"}:void 0,children:n?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:n?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function w({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:r,onCopy:o,onDeleteAlias:n,onAddCustomModel:c,onDeleteCustomModel:m,connections:p,isAnthropic:x}){let[u,h]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1),[b,v]=(0,i.useState)(!1),[N,k]=(0,i.useState)(null),[C,S]=(0,i.useState)({}),A=async t=>{if(!N){k(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),a=await s.json();S(e=>({...e,[t]:a.ok?"ok":"error"}))}catch{S(e=>({...e,[t]:"error"}))}finally{k(null)}}},$=y({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),T=async()=>{if(!u.trim()||f)return;let e=u.trim();if($.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await c(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},O=async()=>{if(b)return;let e=p.find(e=>!1!==e.isActive);if(e){v(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to import models");let a=s.models||[];if(0===a.length)return void alert("No models returned from /models.");let i=0;for(let e of a){let t=e.id||e.name||e.model;t&&($.some(e=>e.id===t)||(await c(t),i+=1))}0===i&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{v(!1)}}},P=p.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",x?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:u,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&T(),placeholder:x?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:T,disabled:!u.trim()||f,children:f?"Adding...":"Add"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"download",onClick:O,disabled:!P||b,children:b?"Importing...":"Import from /models"})]}),!P&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),$.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:$.map(({id:s,alias:i,source:l})=>(0,a.jsx)(j,{modelId:s,fullModel:`${t}/${s}`,copied:r,onCopy:o,onDeleteAlias:()=>"custom"===l?m(s):n(i),onTest:p.length>0?()=>A(s):void 0,testStatus:C[s],isTesting:N===s},`${l}-${e}/${s}`))})]})}v.propTypes={model:b().shape({id:b().string.isRequired}).isRequired,fullModel:b().string.isRequired,alias:b().string,copied:b().string,onCopy:b().func.isRequired,testStatus:b().oneOf(["ok","error"]),isCustom:b().bool,isFree:b().bool,onDeleteAlias:b().func,onTest:b().func,isTesting:b().bool,onDisable:b().func,caps:b().object},b().string.isRequired,b().string.isRequired,b().string,b().func.isRequired,b().func.isRequired,b().func,b().oneOf(["ok","error"]),b().bool,b().string.isRequired,b().object.isRequired,b().arrayOf(b().object),b().string,b().func.isRequired,b().func.isRequired,b().func.isRequired,b().func.isRequired,w.propTypes={providerStorageAlias:b().string.isRequired,providerDisplayAlias:b().string.isRequired,modelAliases:b().object.isRequired,customModels:b().arrayOf(b().object),copied:b().string,onCopy:b().func.isRequired,onDeleteAlias:b().func.isRequired,onAddCustomModel:b().func.isRequired,onDeleteCustomModel:b().func.isRequired,connections:b().arrayOf(b().shape({id:b().string,isActive:b().bool})).isRequired,isAnthropic:b().bool};var N=s(70217);function k({until:e}){let[t,s]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);if(a<60)s(`${a}s`);else if(a<3600)s(`${Math.floor(a/60)}m ${a%60}s`);else{let e=Math.floor(a/3600),t=Math.floor(a%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function C({connection:e,proxyPools:t,isOAuth:s,isFirst:l,isLast:r,onMoveUp:o,onMoveDown:n,onToggleActive:c,onUpdateProxy:m,onEdit:p,onDelete:x,oneByOneStatus:u=null,autoPing:h=null}){let[f,y]=(0,i.useState)(!1),[g,b]=(0,i.useState)(!1),v=(0,i.useRef)(null),j=new Map((t||[]).map(e=>[e.id,e])),w=e.providerSpecificData?.proxyPoolId||null,S=w?j.get(w):null,A=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,$=!!w||A,T=S?`Pool: ${S.name}`:w?`Pool: ${w} (inactive/missing)`:A?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",O="";if(S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);O=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{O=t}}let P=S?.noProxy||e.providerSpecificData?.connectionNoProxy||"",E="default";S?.isActive===!0?E="success":(w||A)&&(E="error"),(0,i.useEffect)(()=>{if(!f)return;let e=e=>{v.current&&!v.current.contains(e.target)&&y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);let I=async e=>{b(!0);try{await m("__none__"===e?null:e)}finally{b(!1),y(!1)}},R=e.authType||(s?"oauth":"apikey"),D="oauth"===R,U="cookie"===R,_=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(D?"OAuth Account":U?"Cookie Account":"API Key"),q=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[z,M]=(0,i.useState)(!1),F=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,i.useEffect)(()=>{let t=()=>{M(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=F?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[F]);let K="unavailable"!==e.testStatus||z?e.testStatus:"active",L=()=>u?"queued"===u.state?"queued":"testing"===u.state?"testing":"success"===u.state?"success":"failed"===u.state?u.error?`failed: ${u.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:o,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:n,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:U?"cookie":D?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:_}),q&&(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:q}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(d.Ex,{variant:(0,N.g)(e.isActive,K),size:"sm",dot:!0,children:!1===e.isActive?"disabled":K||"Unknown"}),(0,a.jsx)(d.Ex,{variant:"default",size:"sm",children:D?"OAuth":U?"Cookie":"API Key"}),$&&(0,a.jsx)(d.Ex,{variant:E,size:"sm",children:"Proxy"}),z&&!1!==e.isActive&&(0,a.jsx)(k,{until:F}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),L()&&(0,a.jsx)(d.Ex,{variant:u?"success"===u.state?"success":"failed"===u.state?"error":"testing"===u.state?"primary":"default":"default",size:"sm",children:L()})]}),$&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:T,children:T}),O&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:O}),P&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:P,children:["no_proxy: ",P]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:v,children:[(0,a.jsxs)("button",{onClick:()=>y(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${$?"text-primary":"text-text-muted hover:text-primary"}`,disabled:g,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:g?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,a.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,a.jsx)("button",{onClick:()=>I("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!w?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,a.jsx)("button",{onClick:()=>I(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${w===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,a.jsx)(d.m_,{text:"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",children:(0,a.jsxs)("button",{onClick:()=>h.onToggle(!h.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${h.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,a.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(d.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}k.propTypes={until:b().string.isRequired},C.propTypes={connection:b().shape({id:b().string,name:b().string,email:b().string,displayName:b().string,modelLockUntil:b().string,testStatus:b().string,isActive:b().bool,lastError:b().string,priority:b().number,globalPriority:b().number}).isRequired,proxyPools:b().arrayOf(b().shape({id:b().string,name:b().string,proxyUrl:b().string,noProxy:b().string,isActive:b().bool})),isOAuth:b().bool.isRequired,isFirst:b().bool.isRequired,isLast:b().bool.isRequired,onMoveUp:b().func.isRequired,onMoveDown:b().func.isRequired,onToggleActive:b().func.isRequired,onUpdateProxy:b().func,onEdit:b().func.isRequired,onDelete:b().func.isRequired,oneByOneStatus:b().shape({state:b().string,error:b().string}),autoPing:b().shape({on:b().bool,onToggle:b().func})};let S=`name1|sk-key1
|
|
2
|
-
name2|sk-key2
|
|
3
|
-
sk-key-only-auto-named`;function A({isOpen:e,provider:t,providerName:s,isCompatible:l,isAnthropic:r,authType:o,authHint:n,website:m,proxyPools:p,error:x,onSave:u,onBulkDone:h,onClose:f}){let y="__none__",g="ollama-local"===t,b="cookie"===o,v="xai"===t&&!b,j=b?"Cookie Value":"API Key",w="azure"===t,N="cloudflare-ai"===t,k=c.Q2?.[t]?.regions||null,C=c.Q2?.[t]?.defaultRegion||k?.[0]?.id||"",[$,T]=(0,i.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:y,ollamaHostUrl:""}),[O,P]=(0,i.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[E,I]=(0,i.useState)({accountId:""}),[R,D]=(0,i.useState)(C),[U,_]=(0,i.useState)(!1),[q,z]=(0,i.useState)(null),[M,F]=(0,i.useState)(!1),[K,L]=(0,i.useState)("single"),[J,W]=(0,i.useState)(""),[B,H]=(0,i.useState)(null),G=()=>g&&$.ollamaHostUrl.trim()?{baseUrl:$.ollamaHostUrl.trim()}:w?{azureEndpoint:O.azureEndpoint,apiVersion:O.apiVersion,deployment:O.deployment,organization:O.organization}:N?{accountId:E.accountId}:k&&R?{region:R}:void 0,V=async()=>{_(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:$.apiKey,providerSpecificData:G()})}),s=await e.json();z(s.valid?"success":"failed")}catch{z("failed")}finally{_(!1)}},Q=async()=>{if(t&&(g||$.apiKey)&&(g||$.name)&&(!l||$.defaultModel.trim())){F(!0);try{let e=!1;try{_(!0),z(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:$.apiKey,providerSpecificData:G()})});e=!!(await s.json()).valid,z(e?"success":"failed")}catch{z("failed")}finally{_(!1)}await u({name:$.name||(g?"Ollama Local":""),apiKey:$.apiKey,defaultModel:l?$.defaultModel.trim():void 0,priority:$.priority,proxyPoolId:$.proxyPoolId===y?null:$.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:G()})}finally{F(!1)}}},Z=async()=>{let e=J.split("\n").map(e=>e.trim()).filter(Boolean);if(!e.length)return;F(!0),H(null);let s=0,a=0;for(let i=0;i<e.length;i++){let l=e[i].split("|"),r=l.length>=2?l.slice(1).join("|").trim():l[0].trim(),o=l.length>=2?l[0].trim():"Key",n=`${o} ${i+1}`;try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:r,name:n,priority:1,testStatus:"unknown"})})).ok?s++:a++}catch{a++}}F(!1),H({success:s,failed:a}),s>0&&h&&h()};return t?(0,a.jsx)(d.aF,{isOpen:e,title:`Add ${s||t} ${j}`,onClose:f,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"single"===K?"primary":"ghost",onClick:()=>{L("single"),H(null)},children:"Single"}),(0,a.jsx)(d.$n,{size:"sm",variant:"bulk"===K?"primary":"ghost",onClick:()=>{L("bulk"),H(null)},children:"Bulk Add"})]}),"bulk"===K&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,a.jsx)("code",{children:"name|apiKey"})," or just ",(0,a.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:S,value:J,onChange:e=>W(e.target.value)}),B&&(0,a.jsxs)("div",{className:`text-sm font-medium ${B.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",B.success," added",B.failed>0?`, ✗ ${B.failed} failed`:""]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:Z,fullWidth:!0,disabled:M||!J.trim(),children:M?"Adding...":"Add All Keys"}),(0,a.jsx)(d.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===K&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.pd,{label:"Name",value:$.name,onChange:e=>T({...$,name:e.target.value}),placeholder:g?"Ollama Local":"Production Key"}),g&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"Ollama Host URL",value:$.ollamaHostUrl,onChange:e=>T({...$,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:V,disabled:U||M,variant:"secondary",children:U?"Checking...":"Check"})})]}),!g&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:j,type:b?"text":"password",value:$.apiKey,onChange:e=>T({...$,apiKey:e.target.value}),placeholder:b?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":v?"xai-...":"",className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:V,disabled:!$.apiKey||U||M,variant:"secondary",children:U?"Checking...":"Check"})})]}),v&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),b&&n&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[n,m&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",m.replace(/^https?:\/\//,"")]})]})]}),k&&(0,a.jsx)(d.l6,{label:"Region",value:R,onChange:e=>D(e.target.value),options:k.map(e=>({value:e.id,label:e.label}))}),l&&(0,a.jsx)(d.pd,{label:"Default Model",value:$.defaultModel,onChange:e=>T({...$,defaultModel:e.target.value}),placeholder:r?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),g&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,a.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,a.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),q&&(0,a.jsx)(d.Ex,{variant:"success"===q?"success":"error",children:"success"===q?"Valid":"Invalid"}),x&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:x}),l&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),N&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,a.jsx)(d.pd,{label:"Account ID",value:E.accountId,onChange:e=>I({...E,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,a.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),w&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(d.pd,{label:"Azure Endpoint",value:O.azureEndpoint,onChange:e=>P({...O,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,a.jsx)(d.pd,{label:"Deployment Name",value:O.deployment,onChange:e=>P({...O,deployment:e.target.value}),placeholder:"gpt-4"}),(0,a.jsx)(d.pd,{label:"API Version",value:O.apiVersion,onChange:e=>P({...O,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,a.jsx)(d.pd,{label:"Organization",value:O.organization,onChange:e=>P({...O,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,a.jsx)(d.pd,{label:"Priority",type:"number",value:$.priority,onChange:e=>T({...$,priority:Number.parseInt(e.target.value)||1})}),(0,a.jsx)(d.l6,{label:"Proxy Pool",value:$.proxyPoolId,onChange:e=>T({...$,proxyPoolId:e.target.value}),options:[{value:y,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:Q,fullWidth:!0,disabled:M||!g&&(!$.name||!$.apiKey)||l&&!$.defaultModel.trim()||w&&(!O.azureEndpoint||!O.deployment||!O.organization)||N&&!E.accountId,children:M?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function $({isOpen:e,node:t,onSave:s,onClose:l,isAnthropic:r}){let[o,n]=(0,i.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,m]=(0,i.useState)(!1),[p,x]=(0,i.useState)(""),[u,h]=(0,i.useState)(""),[f,y]=(0,i.useState)(!1),[g,b]=(0,i.useState)(null);(0,i.useEffect)(()=>{t&&n({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(r?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,r]);let v=async()=>{if(o.name.trim()&&o.prefix.trim()&&o.baseUrl.trim()){m(!0);try{let e={name:o.name,prefix:o.prefix,baseUrl:o.baseUrl};r||(e.apiType=o.apiType),await s(e)}finally{m(!1)}}},j=async()=>{y(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:o.baseUrl,apiKey:p,type:r?"anthropic-compatible":"openai-compatible",modelId:u.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{y(!1)}};return t?(0,a.jsx)(d.aF,{isOpen:e,title:`Edit ${r?"Anthropic":"OpenAI"} Compatible`,onClose:l,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(d.pd,{label:"Name",value:o.name,onChange:e=>n({...o,name:e.target.value}),placeholder:`${r?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,a.jsx)(d.pd,{label:"Prefix",value:o.prefix,onChange:e=>n({...o,prefix:e.target.value}),placeholder:r?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!r&&(0,a.jsx)(d.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:o.apiType,onChange:e=>n({...o,apiType:e.target.value})}),(0,a.jsx)(d.pd,{label:"Base URL",value:o.baseUrl,onChange:e=>n({...o,baseUrl:e.target.value}),placeholder:r?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${r?"Anthropic":"OpenAI"}-compatible API.`}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>x(e.target.value),className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:j,disabled:!p||f||!o.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,a.jsx)(d.pd,{label:"Model ID (optional)",value:u,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),g&&(0,a.jsx)(d.Ex,{variant:"success"===g?"success":"error",children:"success"===g?"Valid":"Invalid"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:v,fullWidth:!0,disabled:!o.name.trim()||!o.prefix.trim()||!o.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function T({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:l,onClose:r}){let[o,n]=(0,i.useState)(""),[c,m]=(0,i.useState)(null),[p,x]=(0,i.useState)(""),[u,h]=(0,i.useState)(!1);(0,i.useEffect)(()=>{e&&(n(""),m(null),x(""))},[e]);let f=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},y=async()=>{let e=f(o.trim());if(e){m("testing"),x("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),a=await s.json();m(a.ok?"ok":"error"),x(a.error||"")}catch(e){m("error"),x(e.message)}}},g=async()=>{let e=f(o.trim());if(e&&!u){h(!0);try{await l(e)}finally{h(!1)}}};return(0,a.jsx)(d.aF,{isOpen:e,onClose:r,title:"Add Custom Model",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:o,onChange:e=>{n(e.target.value),m(null),x("")},onKeyDown:e=>{"Enter"===e.key&&y()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,a.jsx)(d.$n,{variant:"secondary",icon:"science",loading:"testing"===c,onClick:y,disabled:!o.trim()||"testing"===c,children:"testing"===c?"Testing...":"Test"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,a.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:f(o.trim())||"model-id"})]})]}),"ok"===c&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===c&&(0,a.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,a.jsx)("span",{children:p||"Model not reachable"})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(d.$n,{onClick:r,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(d.$n,{onClick:g,fullWidth:!0,size:"sm",disabled:!o.trim()||u,children:u?"Adding...":"Add Model"})]})]})})}A.propTypes={isOpen:b().bool.isRequired,provider:b().string,providerName:b().string,isCompatible:b().bool,isAnthropic:b().bool,authType:b().string,authHint:b().string,website:b().string,proxyPools:b().arrayOf(b().shape({id:b().string,name:b().string})),error:b().string,onSave:b().func.isRequired,onBulkDone:b().func,onClose:b().func.isRequired},$.propTypes={isOpen:b().bool.isRequired,node:b().shape({id:b().string,name:b().string,prefix:b().string,apiType:b().string,baseUrl:b().string}),onSave:b().func.isRequired,onClose:b().func.isRequired,isAnthropic:b().bool},T.propTypes={isOpen:b().bool.isRequired,providerAlias:b().string.isRequired,providerDisplayAlias:b().string.isRequired,onSave:b().func.isRequired,onClose:b().func.isRequired};let O=`[
|
|
4
|
-
{
|
|
5
|
-
"accessToken": "eyJhbGc...",
|
|
6
|
-
"refreshToken": "rt_...",
|
|
7
|
-
"idToken": "eyJhbGc...",
|
|
8
|
-
"email": "user@example.com"
|
|
9
|
-
}
|
|
10
|
-
]`;function P({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,i.useState)(""),[o,n]=(0,i.useState)(!1),[c,m]=(0,i.useState)(""),[p,x]=(0,i.useState)(null),h=()=>{o||(r(""),m(""),x(null),t())},f=async()=>{var e;let t;m(""),x(null);let a=l.trim();if(!a)return;try{t=JSON.parse(a)}catch(e){m(`${(0,u.Tl)("Invalid JSON")}: ${e.message}`);return}let i=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!i||0===i.length)return void m((0,u.Tl)("No accounts found in input"));n(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:i})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);x(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,u.Tl)("Request failed"))}finally{n(!1)}},y=p?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(d.aF,{isOpen:e,title:(0,u.Tl)("Bulk Add Codex Accounts"),onClose:h,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,u.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:O,value:l,onChange:e=>r(e.target.value),disabled:o}),c&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,u.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,u.Tl)("failed")}`:""]}),y.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:y.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:f,fullWidth:!0,disabled:o||!l.trim(),children:o?(0,u.Tl)("Importing..."):(0,u.Tl)("Import All")}),(0,a.jsx)(d.$n,{onClick:h,variant:"ghost",fullWidth:!0,disabled:o,children:(0,u.Tl)("Close")})]})]})})}function E(){let e,t=(0,l.useParams)(),s=(0,l.useRouter)(),r=t.id,{getCaps:h}=(0,x.y)(),[g,b]=(0,i.useState)([]),[j,N]=(0,i.useState)(!0),[k,S]=(0,i.useState)(null),[O,E]=(0,i.useState)([]),[I,R]=(0,i.useState)(!1),[D,U]=(0,i.useState)(!1),[_,q]=(0,i.useState)(!1),[z,M]=(0,i.useState)(""),[F,K]=(0,i.useState)(!1),[L,J]=(0,i.useState)(!1),[W,B]=(0,i.useState)(!1),[H,G]=(0,i.useState)(!1),[V,Q]=(0,i.useState)(null),[Z,X]=(0,i.useState)({}),[Y,ee]=(0,i.useState)([]),[et,es]=(0,i.useState)(!1),[ea,ei]=(0,i.useState)({}),[el,er]=(0,i.useState)(""),[eo,en]=(0,i.useState)(()=>new Set),[ed,ec]=(0,i.useState)(!1),[em,ep]=(0,i.useState)([]),[ex,eu]=(0,i.useState)("__none__"),[eh,ef]=(0,i.useState)(!1),[ey,eg]=(0,i.useState)(null),[eb,ev]=(0,i.useState)(""),[ej,ew]=(0,i.useState)("auto"),[eN,ek]=(0,i.useState)({enabled:!1,connections:{}}),[eC,eS]=(0,i.useState)([]),[eA,e$]=(0,i.useState)([]),[eT,eO]=(0,i.useState)([]),[eP,eE]=(0,i.useState)(null),[eI,eR]=(0,i.useState)(!1),[eD,eU]=(0,i.useState)(!1),[e_,eq]=(0,i.useState)(!1),[ez,eM]=(0,i.useState)(null),[eF,eK]=(0,i.useState)({}),[eL,eJ]=(0,i.useState)(null),eW=(0,i.useRef)(!1),[eB,eH]=(0,i.useState)(!1),{copied:eG,copy:eV}=(0,p.C)(),eQ="ag_risk_confirmed",eZ=()=>{R(!0)},eX=()=>{"antigravity"===r&&"true"!==window.localStorage.getItem(eQ)?eR(!0):e5?eZ():(M(""),q(!0))},eY=()=>{M(""),q(!0)},e0=()=>{e5?eX():eY()},e1=k?{id:k.id,name:k.name||("anthropic-compatible"===k.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===k.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===k.type?"AC":"OC",apiType:k.apiType,baseUrl:k.baseUrl,type:k.type}:c.zN[r]||c.fg[r]||c.IS[r]||c.nJ[r]||c.br[r],e2=e1?.authModes||[],e5=!!c.zN[r]||!!c.IS[r]||e2.includes("oauth"),e3=!!c.fg[r]||e2.includes("apikey"),e4=!!c.IS[r]?.noAuth,e7=(0,m.KC)(r),e6=(0,c.wG)(r),e8=(0,c.mq)(r),e9=(0,c.gb)(r),te=e8||e9,tt=!te&&e5&&e3,ts="xai"===r?"Grok Build OAuth":"OAuth",ta="xai"===r?"xAI API Key":"API Key";c.Q2[r]?.thinkingConfig||c.s9.extended;let ti=te?r:e6,tl=te?k?.prefix||r:e6,tr=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(ti)}`,{cache:"no-store"}),t=await e.json();e.ok&&eO(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[ti]),to=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:ti,ids:[e]})})).ok&&await tr()}catch(e){console.log("Error disabling model:",e)}},tn=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(ti)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tr()}catch(e){console.log("Error enabling model:",e)}},td=async e=>{e.length&&eE({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eE(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:ti,ids:e})})).ok&&await tr()}catch(e){console.log("Error disabling all models:",e)}}})},tc=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(ti)}`,{method:"DELETE"})).ok&&await tr()}catch(e){console.log("Error enabling all models:",e)}},tm=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&X(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tp=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ee(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===r&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&e$(e.models)}).catch(()=>{})},[r]);let tx=(0,i.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),l=await t.json(),o=await s.json(),n=a.ok?await a.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===r);b(e)}s.ok&&E(o.proxyPools||[]);let d=(n.providerStrategies||{})[r]||{};eg(d.fallbackStrategy||null),ev(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(n.providerThinking||{})[r]||{};ew(c.mode||"auto");let m=n.claudeAutoPing||{};if(ek({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===r)||null;if(!e&&te)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===r)||null))break}S(e)}}catch(e){console.log("Error fetching connections:",e)}finally{N(!1)}},[r,te]),tu=async e=>{try{let t=await fetch(`/api/provider-nodes/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(S(s.node),await tx(),B(!1))}catch(e){console.log("Error updating provider node:",e)}},th=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...a};0===Object.keys(i).length?delete l[r]:l[r]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tf=async e=>{ek(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({claudeAutoPing:e})})}catch(e){console.log("Error saving auto-ping config:",e)}};(0,i.useEffect)(()=>{tx(),tm(),tp(),tr()},[tx,tm,tp,tr]),(0,i.useEffect)(()=>{let e=(c.zN[r]||c.fg[r]||c.IS[r]||c.nJ[r])?.modelsFetcher;e&&f(e).then(eS)},[r]);let ty=async(e,t,s=e6)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await tm();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tg=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tm()}catch(e){console.log("Error deleting alias:",e)}},tb=async(e,t="llm",s=ti)=>{try{let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t})});if(a.ok)await tp(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await a.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tv=async(e,t="llm",s=ti)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await tp(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tj=async()=>{if(eB)return;let e=g.find(e=>!1!==e.isActive);if(!e)return void alert((0,u.Tl)("Please add an active Qoder connection first"));eH(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,u.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,u.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,"");Y.some(e=>e.providerAlias===ti&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(Z).includes(`${ti}/${s}`)||(await tb(s,"llm",ti),i+=1)}0===i?alert((0,u.Tl)("All models already exist, no new models added")):alert((0,u.Tl)("Successfully added")+` ${i} `+(0,u.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,u.Tl)("Error fetching models")+": "+e.message)}finally{eH(!1)}},tw=async()=>{if(eD||0===g.length)return;let e=Object.fromEntries(g.map(e=>[e.id,{state:"queued",error:null}]));eW.current=!1,eU(!0),eq(!1),eM(null),eK(e),eJ({total:g.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<g.length;e+=1){if(eW.current){eJ({total:g.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=g[e];eM(a.id),eK(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:s+=1,eK(e=>({...e,[a.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){s+=1,eK(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}eJ({total:g.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<g.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eM(null),eU(!1),eq(!1),eW.current=!1}},tN=async e=>{eE({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eE(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&b(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tk=()=>{tx(),R(!1)},tC=async e=>{M("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tx(),q(!1);return}M(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),M("Failed to save connection")}},tS=async e=>{try{(await fetch(`/api/providers/${V.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tx(),J(!1))}catch(e){console.log("Error updating connection:",e)}},tA=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&b(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},t$=async(e,t)=>{let s=[...g];[s[e],s[t]]=[s[t],s[e]],b(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tx()}},tT=g.filter(e=>em.includes(e.id)),tO=g.length>0&&em.length===g.length;(0,i.useEffect)(()=>{ep(e=>e.filter(e=>g.some(t=>t.id===e)))},[g]),(()=>{if(0===tT.length)return;let e=new Set(tT.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=O.find(e=>e.id===t);return s?.name}})();let tP=()=>{eh||G(!1)},tE=async e=>{ef(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tx(),G(!1)}finally{ef(!1)}},tI=e=>tE(g.map(t=>({connectionId:t.id,proxyPoolId:e}))),tR=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:g.map((e,t)=>{let s;return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,a.jsx)("input",{type:"checkbox",checked:(s=e.id,em.includes(s)),onChange:()=>{var t;return t=e.id,void ep(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(C,{connection:e,proxyPools:O,isOAuth:e5,isFirst:0===t,isLast:t===g.length-1,onMoveUp:()=>t$(t,t-1),onMoveDown:()=>t$(t,t+1),onToggleActive:t=>tA(e.id,t),autoPing:"claude"===r&&"oauth"===e.authType?{on:!0===eN.connections[e.id],onToggle:t=>{var s;return s=e.id,void tf({...eN,connections:{...eN.connections,[s]:t}})}}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&b(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{Q(e),J(!0)},onDelete:()=>tN(e.id),oneByOneStatus:eF[e.id]||null})})]},e.id)})}),tD=O.filter(e=>!0===e.isActive),tU=(0,a.jsx)(d.aF,{isOpen:H,onClose:tP,title:`Apply Proxy (${g.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:()=>{let e=O.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tE(g.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eh||0===tD.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>tI(null),disabled:eh,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),O.map(e=>(0,a.jsxs)("button",{onClick:()=>tI(e.id),disabled:eh||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eh&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(d.$n,{onClick:tP,variant:"ghost",fullWidth:!0,disabled:eh,children:"Cancel"})]})}),t_=async e=>{if(!eo.has(e)){en(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${ti}/${e}`})}),s=await t.json();ei(t=>({...t,[e]:s.ok?"ok":"error"})),er(s.ok?"":s.error||"Model not reachable")}catch{ei(t=>({...t,[e]:"error"})),er("Network error")}finally{en(t=>{let s=new Set(t);return s.delete(e),s})}}};return j?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(d.Qv,{}),(0,a.jsx)(d.Qv,{})]}):e1?(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(o(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e1.color}15`},children:et?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:e1.color},children:e1.textIcon||e1.id.slice(0,2).toUpperCase()}):(0,a.jsx)(n.default,{src:e8&&e1.apiType?"responses"===e1.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":e9?"/providers/anthropic-m.png":`/providers/${e1.id}.png`,alt:e1.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>es(!0)})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e1.name}),(e1.notice?.apiKeyUrl||e1.notice?.signupUrl||e1.website)&&(0,a.jsxs)("a",{href:e1.notice?.apiKeyUrl||e1.notice?.signupUrl||e1.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e1.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[g.length," connection",1===g.length?"":"s"]})]})]})]}),e1.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e1.deprecationNotice})]}),e1.notice?.text&&!e1.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:e1.notice.text}),e1.notice.apiKeyUrl&&(0,a.jsx)("a",{href:e1.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),te&&k&&(0,a.jsx)(d.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:e9?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[e9?"Messages API":"responses"===k.apiType?"Responses API":"Chat Completions"," \xb7 ",(k.baseUrl||"").replace(/\/$/,""),"/",e9?"messages":"responses"===k.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>{M(""),q(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>B(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eE({title:"Delete Compatible Node",message:`Delete this ${e9?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eE(null);try{(await fetch(`/api/provider-nodes/${r}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),e4?(0,a.jsx)(d.gw,{providerId:r}):(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[g.length>0&&O.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>G(!0),children:"Apply Proxy"}),g.length>0&&(0,a.jsxs)(a.Fragment,{children:[em.length>0&&(0,a.jsxs)(d.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=em.length;0!==e&&eE({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eE(null);let e=0,t=[...em];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}b(e=>e.filter(e=>!t.includes(e.id))),ep([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",em.length,")"]}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tw,disabled:eD,children:eD?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eD&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eD&&(eW.current=!0,eq(!0))},disabled:e_,children:e_?"Stopping...":"Stop"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(d.lM,{checked:"round-robin"===ey,onChange:e=>{let t=e?"round-robin":null,s=e?eb||"1":eb;e&&!eb&&ev("1"),eg(t),th(t,s)}}),"round-robin"===ey&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:eb,onChange:e=>{var t;ev(t=e.target.value),th("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===g.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e5?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tt&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",ts," or ",ta,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:tt?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:eX,children:ts}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:eY,children:ta})]}):(0,a.jsxs)(a.Fragment,{children:[!te&&"iflow"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>U(!0),children:"Cookie"}),"codex"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>K(!0),children:(0,u.Tl)("Bulk Add")}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e0,children:te?"Add API Key":"iflow"===r?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[eL&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:["Total: ",eL.total]}),(0,a.jsxs)("span",{children:["Completed: ",eL.completed]}),(0,a.jsxs)("span",{children:["Passed: ",eL.passed]}),(0,a.jsxs)("span",{children:["Failed: ",eL.failed]}),eL.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eD&&ez&&(0,a.jsxs)("span",{children:["Running: ",g.find(e=>e.id===ez)?.name||ez]})]})}),g.length>0&&(0,a.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:tO,onChange:()=>{tO?ep([]):ep(g.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),tR,!te&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>U(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>K(!0),title:(0,u.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,u.Tl)("Bulk Add")}),tt?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:eX,className:"w-full sm:w-auto",children:ts}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:eY,className:"w-full sm:w-auto",children:ta})]}):(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e0,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!te&&(e=[...e7,...eA.filter(e=>!e7.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eT.includes(e)),(0,a.jsxs)("div",{className:"flex gap-2",children:[eT.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tc,children:"Active All"}),e.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>td(e),children:"Disable All"})]}))]}),!!el&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:el}),(()=>{let e,t,s;if(te)return(0,a.jsx)(w,{providerStorageAlias:ti,providerDisplayAlias:tl,modelAliases:Z,customModels:Y,copied:eG,onCopy:eV,onSetAlias:ty,onDeleteAlias:tg,onAddCustomModel:e=>tb(e,"llm",ti),onDeleteCustomModel:e=>tv(e,"llm",ti),connections:g,isAnthropic:e9});let i=[...e7,...eA.filter(e=>!e7.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),l=new Set(eT),o=i.filter(e=>!l.has(e.id)),n=i.filter(e=>l.has(e.id)),d=y({customModels:Y,modelAliases:Z,providerAlias:ti,builtInModels:e7,type:"llm"});return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,a.jsx)(v,{model:{id:e.id,name:e.name},fullModel:`${tl}/${e.id}`,alias:e.alias,copied:eG,onCopy:eV,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tv(e.id,"llm",ti):tg(e.alias)},testStatus:ea[e.id],onTest:g.length>0||e4?()=>t_(e.id):void 0,isTesting:eo.has(e.id),isCustom:!0,isFree:!1,caps:h(`${r}/${e.id}`)},`${e.source}-${e.fullModel}`)),o.map(e=>{let t=`${ti}/${e.id}`,s=`${r}/${e.id}`,i=Object.entries(Z).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(v,{model:e,fullModel:`${tl}/${e.id}`,alias:i,copied:eG,onCopy:eV,onSetAlias:t=>ty(e.id,t,ti),onDeleteAlias:()=>tg(i),testStatus:ea[e.id],onTest:g.length>0||e4?()=>t_(e.id):void 0,isTesting:eo.has(e.id),isFree:e.isFree,onDisable:()=>to(e.id),caps:h(`${r}/${e.id}`)},e.id)}),(0,a.jsxs)("button",{onClick:()=>ec(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===r&&g.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:tj,disabled:eB,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:eB?{animation:"spin 1s linear infinite"}:void 0,children:eB?"progress_activity":"download"}),eB?(0,u.Tl)("Fetching..."):(0,u.Tl)("Fetch Qoder Models")]}),eC.length>0&&(e=new Set([...Object.values(Z),...d.map(e=>e.fullModel)]),t=new Set(e7.map(e=>e.id)),0===(s=eC.filter(s=>!e.has(`${ti}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await tb(e.id,"llm",ti)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,a.jsxs)("button",{onClick:()=>tn(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tU,"kiro"===r?(0,a.jsx)(d.Mh,{isOpen:I,providerInfo:e1,onSuccess:tk,onClose:()=>R(!1)}):"cursor"===r?(0,a.jsx)(d.G9,{isOpen:I,onSuccess:tk,onClose:()=>R(!1)}):"gitlab"===r?(0,a.jsx)(d.vj,{isOpen:I,providerInfo:e1,onSuccess:tk,onClose:()=>R(!1)}):(0,a.jsx)(d.LF,{isOpen:I,provider:r,providerInfo:e1,onSuccess:tk,onClose:()=>R(!1)}),"iflow"===r&&(0,a.jsx)(d.vE,{isOpen:D,onSuccess:()=>{tx(),U(!1)},onClose:()=>U(!1)}),(0,a.jsx)(A,{isOpen:_,provider:r,providerName:e1.name,isCompatible:te,isAnthropic:e9,authType:e1?.authType,authHint:e1?.authHint,website:e1?.website,proxyPools:O,error:z,onSave:tC,onBulkDone:tx,onClose:()=>{M(""),q(!1)}}),(0,a.jsx)(d.wI,{isOpen:L,connection:V,proxyPools:O,onSave:tS,onClose:()=>J(!1)}),te&&(0,a.jsx)($,{isOpen:W,node:k,onSave:tu,onClose:()=>B(!1),isAnthropic:e9}),!te&&(0,a.jsx)(T,{isOpen:ed,providerAlias:ti,providerDisplayAlias:tl,onSave:async e=>{await tb(e,"llm",ti),ec(!1)},onClose:()=>ec(!1)}),"codex"===r&&(0,a.jsx)(P,{isOpen:F,onClose:()=>K(!1),onSuccess:tx}),(0,a.jsx)(d.uo,{isOpen:eI,onClose:()=>eR(!1),onConfirm:()=>{(window.localStorage.setItem(eQ,"true"),eR(!1),e5)?eZ():eY()},title:"Risk Notice",message:e1?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(d.uo,{isOpen:!!eP,onClose:()=>eE(null),onConfirm:eP?.onConfirm,title:eP?.title||"Confirm",message:eP?.message,variant:"danger"})]}):(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(o(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}P.propTypes={isOpen:b().bool.isRequired,onClose:b().func.isRequired,onSuccess:b().func}}},e=>{e.O(0,[2574,3862,1051,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=52397)),_N_E=e.O()}]);
|
package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-f72e66dd55d53998.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{15546:(e,t,r)=>{Promise.resolve().then(r.bind(r,75095)),Promise.resolve().then(r.bind(r,25086))},75095:(e,t,r)=>{"use strict";r.d(t,{default:()=>E});var a=r(95155),s=r(12115),i=r(57250),n=r(70778);let l="quotaCacheData",o="quotaAutoRefresh",c=[10,20,50,100],d=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],u=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function m(e){return e.name?.trim()||e.email?.trim()||e.displayName?.trim()||null}function x(e,t){let r=t[e.id]?.quotas?.[0];return r&&"number"==typeof r.remaining?r.remaining:1/0}function h(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function p(e,t){let r=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>r.has(e)))}async function b(e,t){return await e(t)}function g(){try{let e=window.localStorage.getItem(l);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function f(e,t){try{let r=g();r[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(l,JSON.stringify(r))}catch(e){console.error("Error writing quota cache:",e)}}function y(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function v({quotas:e=[],compact:t=!1,sortMode:r="default",showSortLabel:i=!1}){let[n,l]=(0,s.useState)(1),o=(0,s.useMemo)(()=>e.map((e,t)=>({...e,index:t,remaining:e?.remaining!==void 0?Math.max(0,Math.round(e.remaining)):e?.remainingPercentage!==void 0?Math.round(e.remainingPercentage):y(e?.used,e?.total)})),[e]),c=(0,s.useMemo)(()=>"remaining-asc"===r?[...o].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?[...o].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):o,[o,r]),d=Math.max(1,Math.ceil(c.length/10));if((0,s.useEffect)(()=>{l(1)},[r,e]),(0,s.useEffect)(()=>{l(e=>Math.min(e,d))},[d]),!e||0===e.length)return null;let u=c.slice((n-1)*10,10*n),m=0===c.length?0:(n-1)*10+1,x=Math.min(10*n,c.length),h=t?"py-1 px-1.5":"py-2 px-3",p=t?"text-[11px]":"text-sm",b=t?"text-[11px]":"text-sm",g=t?"text-[10px] leading-tight":"text-xs";return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"text-[10px] text-text-muted",children:[c.length," quota",c.length>1?"s":""]}),i&&(0,a.jsx)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1 text-[10px] text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"Sorted by account remaining"})]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsx)("table",{className:"w-full table-fixed text-left",children:(0,a.jsx)("tbody",{children:u.map(e=>{var r;let s=(r=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:r>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},i=function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,r=new Date,a=t-r;if(a<=0)return"-";let s=Math.ceil(a/6e4);if(s<60)return`${s}m`;let i=Math.floor(s/60),n=s%60;if(i<24)return`${i}h ${n}m`;let l=Math.floor(i/24);return`${l}d ${i%24}h ${n}m`}catch(e){return"-"}}(e.resetAt),n=function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(a);s.setDate(s.getDate()+1);let i="";i=t>=a&&t<s?"Today":t>=s&&t<new Date(s.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let n=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${i}, ${n}`}catch{return null}}(e.resetAt);return(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:`${h} w-[30%]`,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,a.jsx)("span",{className:"text-[10px] shrink-0",children:s.emoji}),(0,a.jsx)("span",{className:`${p} font-medium text-text-primary truncate`,children:e.name})]})}),(0,a.jsx)("td",{className:`${h} w-[45%]`,children:(0,a.jsxs)("div",{className:t?"space-y-1":"space-y-1.5",children:[(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${s.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,a.jsx)("div",{className:`h-full transition-all duration-300 ${s.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,a.jsxs)("div",{className:`flex items-center justify-between ${t?"text-[10px]":"text-xs"}`,children:[(0,a.jsxs)("span",{className:"text-text-muted",children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞"]}),(0,a.jsxs)("span",{className:`font-medium ${s.text}`,children:[e.remaining,"%"]})]})]})}),(0,a.jsx)("td",{className:`${h} w-[25%]`,children:"-"!==i||n?t?(0,a.jsx)("div",{className:`${b} text-text-primary font-medium truncate`,title:n||"",children:"-"!==i?`in ${i}`:n}):(0,a.jsxs)("div",{className:"space-y-0.5",children:["-"!==i&&(0,a.jsxs)("div",{className:`${b} text-text-primary font-medium`,children:["in ",i]}),n&&(0,a.jsx)("div",{className:`${g} text-text-muted`,children:n})]}):(0,a.jsx)("div",{className:`${b} text-text-muted italic`,children:"N/A"})})]},`${e.name}-${e.index}`)})})})}),d>1&&(0,a.jsxs)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{children:["Showing ",m,"-",x," of ",c.length]}),(0,a.jsxs)("span",{children:["Page ",n," / ",d]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>l(e=>Math.max(1,e-1)),disabled:1===n,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Prev"}),(0,a.jsx)("button",{type:"button",onClick:()=>l(e=>Math.min(d,e+1)),disabled:n===d,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Next"})]})]})]})}var j=r(98542),k=r(97677),w=r(84588),N=r(35497),S=r(88105),C=r(11059);let $={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"};function A(e){return e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null}function P(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}function E(){let{copied:e,copy:t}=(0,C.C)(),[r,E]=(0,s.useState)([]),[q,D]=(0,s.useState)({}),[M,T]=(0,s.useState)({}),[I,O]=(0,s.useState)({}),[_,F]=(0,s.useState)(!0),[L,z]=(0,s.useState)({}),[R,U]=(0,s.useState)(null),[J,K]=(0,s.useState)(!1),[G,H]=(0,s.useState)(!1),[B,W]=(0,s.useState)(60),[Y,Q]=(0,s.useState)(!0),[V,X]=(0,s.useState)(null),[Z,ee]=(0,s.useState)(null),[et,er]=(0,s.useState)(null),[ea,es]=(0,s.useState)(null),[ei,en]=(0,s.useState)(!1),[el,eo]=(0,s.useState)(null),[ec,ed]=(0,s.useState)([]),[eu,em]=(0,s.useState)("all"),[ex,eh]=(0,s.useState)([]),[ep,eb]=(0,s.useState)("all"),[eg,ef]=(0,s.useState)("default"),[ey,ev]=(0,s.useState)(!1),[ej,ek]=(0,s.useState)(!1),[ew,eN]=(0,s.useState)(!1),[eS,eC]=(0,s.useState)(1),[e$,eA]=(0,s.useState)(20),[eP,eE]=(0,s.useState)(String(20)),[eq,eD]=(0,s.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eM,eT]=(0,s.useState)({eligibleConnections:0,providerFilteredConnections:0}),eI=(0,s.useRef)(null),eO=(0,s.useRef)(null),e_=(0,s.useRef)(0),eF=(0,s.useCallback)(async(e=eS)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(e$),accountStatus:ep,sort:"priority"});"all"!==eu&&a.set("provider",eu);let s=await fetch(`/api/providers/client?${a.toString()}`);if(!s.ok)throw Error("Failed to fetch connections");let i=await s.json(),n=i.connections||[],l=(t=i.pagination,t||{page:1,pageSize:e$,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(i.totals,n.length);return E(n),eh(i.providerOptions||[]),eD(l),eT(o),eC((r=i.pagination,r?.page||e)),n}catch(e){return console.error("Error fetching connections:",e),E([]),eh([]),eD({page:1,pageSize:e$,total:0,totalPages:1}),eT({eligibleConnections:0,providerFilteredConnections:0}),[]}},[ep,ey,eS,e$,eu]),eL=(0,s.useCallback)(async(e,t)=>{T(t=>({...t,[e]:!0})),O(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let r=await fetch(`/api/usage/${e}`);if(!r.ok){let a=(await r.json().catch(()=>({}))).error||r.statusText;if(404===r.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===r.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,a);let r={quotas:[],message:a};D(t=>({...t,[e]:r})),f(e,r);return}throw Error(`HTTP ${r.status}: ${a}`)}let a=await r.json();console.log(`[ProviderLimits] Got quota for ${t}:`,a);let s={quotas:function(e,t){if(!t||"object"!=typeof t)return[];let r=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:t.remaining,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"qoder":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{("organization"!==e||t&&0!==(Number(t.total)||0))&&r.push({name:"user"===e?"Personal":"organization"===e?"Organization":e,used:t.used||0,total:t.total||0,unit:t.unit,resetAt:t.resetAt||null})});break;case"claude":t.message?r.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let a=(0,n.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));r.sort((t,r)=>{let a=t.modelKey||t.name,s=r.modelKey||r.name;return(e.get(a)??999)-(e.get(s)??999)})}return r}(t,a),plan:a.plan||null,message:a.message||null,raw:a};D(t=>({...t,[e]:s})),f(e,s)}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),O(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{T(t=>({...t,[e]:!1}))}},[]),ez=(0,s.useCallback)(async(e,t)=>{await eL(e,t),U(new Date)},[eL]),eR=(0,s.useCallback)(async(e,t)=>{if("codex"===t&&!et){er(e),O(t=>({...t,[e]:null}));try{let r=await fetch(`/api/usage/${e}/codex-reset-credits`,{method:"POST"}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.message||a.error||a.code||"Failed to reset Codex limit");await eL(e,t),U(new Date)}catch(t){O(r=>({...r,[e]:t.message||"Failed to reset Codex limit"}))}finally{er(null)}}},[eL,et]),eU=(0,s.useCallback)(async e=>{if(confirm("Delete this connection?")){X(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){D(t=>{let r={...t};return delete r[e],r}),T(t=>{let r={...t};return delete r[e],r}),O(t=>{let r={...t};return delete r[e],r});try{let t=g();t[e]&&(delete t[e],window.localStorage.setItem(l,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await b(eF,eS)}}catch(e){console.error("Error deleting connection:",e)}finally{X(null)}}},[eF,eS]),eJ=(0,s.useCallback)(async(e,t)=>{ee(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(D(e=>({...e})),await b(eF,eS))}catch(e){console.error("Error updating connection status:",e)}finally{ee(null)}},[eF,eS]),eK=(0,s.useCallback)(async e=>{if(!el?.id)return;let t=el.id,r=el.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eF(),en(!1),eo(null),S.wb.includes(r)&&await eL(t,r))}catch(e){console.error("Error saving connection:",e)}},[el,eF,eL]);(0,s.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&ed(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let eG=(0,s.useCallback)(async(e=!1)=>{if(G)return;H(!0),W(60);let t=e_.current+=1,r=Math.round(3);try{let a=await eF(eS);T(h(a)),O(e=>p(e,a)),D(e=>p(e,a)),await Promise.all(a.filter(a=>e||"claude"!==a.provider||t%r==0).map(e=>eL(e.id,e.provider))),U(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{H(!1)}},[G,eF,eL,eS]);(0,s.useEffect)(()=>{(async()=>{Q(!0);let e=await eF(eS);Q(!1),T(h(e)),O(t=>p(t,e)),D(t=>p(t,e)),await Promise.all(e.map(e=>eL(e.id,e.provider))),U(new Date)})()},[eF,eL,eS]),(0,s.useEffect)(()=>{let e=window.localStorage.getItem(o);F(null===e||"true"===e),K(!0)},[]),(0,s.useEffect)(()=>{J&&window.localStorage.setItem(o,String(_))},[_,J]),(0,s.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>z(e?.claudeAutoPing?.connections||{})).catch(()=>{})},[]);let eH=(0,s.useCallback)(async(e,t)=>{let r={...L,[e]:t};z(r);try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{}).claudeAutoPing||{},connections:r};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({claudeAutoPing:t})})}catch{z(L)}},[L]);(0,s.useEffect)(()=>{if(!J||!_){eI.current&&(clearInterval(eI.current),eI.current=null),eO.current&&(clearInterval(eO.current),eO.current=null);return}return eI.current=setInterval(()=>{eG()},6e4),eO.current=setInterval(()=>{W(e=>e<=1?60:e-1)},1e3),()=>{eI.current&&clearInterval(eI.current),eO.current&&clearInterval(eO.current)}},[_,eG,J]),(0,s.useEffect)(()=>{let e=()=>{document.hidden?(eI.current&&(clearInterval(eI.current),eI.current=null),eO.current&&(clearInterval(eO.current),eO.current=null)):_&&J&&(eI.current=setInterval(()=>eG(),6e4),eO.current=setInterval(()=>{W(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[_,eG,J]);let eB=(0,s.useMemo)(()=>(function(e,t,r,a,s){if("codex"===a&&"default"!==s)return[...e].sort((e,r)=>{let a=x(e,t),i=x(r,t),n="remaining-asc"===s?a-i:i-a;return 0!==n?n:(m(e)||"").localeCompare(m(r)||"")});if(!r)return e;let i=e=>{let r=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return r.length>0?Math.min(...r):1/0};return[...e].sort((e,t)=>{let r=i(e)-i(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(m(e)||"").localeCompare(m(t)||"")})})(r,q,ey,eu,eg),[r,q,ey,eu,eg]),eW=e=>{let t=q[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=y(e.used,e.total))},eY=(0,s.useCallback)(async(e,t)=>{if(e.length&&!ew){eN(!0);try{await Promise.all(e.map(e=>fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}))),await b(eF,eS)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eN(!1)}}},[ew,eF,eS]),eQ="all"===eu?"All providers":eu,eV=eM.eligibleConnections>0,eX=eB.length>0,eZ=eM.eligibleConnections?eM.providerFilteredConnections?{icon:"filter_alt_off",title:"No Accounts On This Page",description:"Try moving to another page or refreshing the current filters."}:{icon:"filter_alt_off",title:"No Accounts Match Current Filters",description:"all"===eu?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===ep?"turned off":"active"===ep?"active":"matching"} accounts found for ${eu}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},e0=function(e){var t;let{start:r,end:a}=(t=e).total?{start:(t.page-1)*t.pageSize+1,end:Math.min(t.page*t.pageSize,t.total)}:{start:0,end:0};return`Showing ${r}-${a} of ${e.total}`}(eq),e1=!c.includes(e$);return Y||eV?Y||eX?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>ek(e=>!e),className:"flex h-8 items-center justify-between gap-1 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-haspopup":"menu","aria-expanded":ej,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===eu?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(i.A,{src:`/providers/${eu}.png`,alt:eu,size:18,className:"size-[18px] rounded object-contain",fallbackText:eu.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:eQ})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),ej&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>ek(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-2 w-64 overflow-hidden rounded-2xl border border-black/10 bg-surface/95 p-1.5 shadow-xl shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-72",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==eu&&eC(1),em("all"),ek(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===eu?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===eu&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]}),(0,a.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,a.jsx)("div",{className:"max-h-72 overflow-y-auto pr-1",children:ex.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{eu!==e&&eC(1),em(e),ek(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${eu===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(i.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium capitalize",children:e}),eu===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:ep,onChange:e=>{let t=e.target.value;ep!==t&&eC(1),eb(t)},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter accounts by status",children:d.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===eu&&(0,a.jsx)("select",{value:eg,onChange:e=>ef(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Sort Codex quotas by remaining",children:u.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsxs)("button",{type:"button",onClick:()=>ev(e=>!e),"aria-pressed":ey,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${ey?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{eY(eB.filter(e=>(e.isActive??!0)&&eW(e)).map(e=>e.id),!1)},disabled:ew,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10 disabled:opacity-50",title:"Disable connections with depleted quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn off Empty"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{eY(eB.filter(e=>!(e.isActive??!0)&&!eW(e)).map(e=>e.id),!0)},disabled:ew,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-emerald-500/30 px-2 text-xs text-emerald-500 transition-colors hover:bg-emerald-500/10 disabled:opacity-50",title:"Enable connections that still have quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn on Available"})]}),(0,a.jsxs)("button",{onClick:()=>F(e=>!e),className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:_?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${_?"text-primary":"text-text-muted"}`,children:_?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),_&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",B,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>eG(!0),disabled:G,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5 disabled:opacity-50",title:"Refresh all",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${G?"animate-spin":""}`,children:"refresh"})})]})}),ey&&(0,a.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Expiring-first currently reorders accounts inside the current page. Cross-page ordering still follows backend pagination."}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:eB.map(r=>{let s,n,l,o=q[r.id],c=M[r.id],d=I[r.id],u=!1===r.isActive,x="codex"===r.provider,h=Number.isFinite(n="number"==typeof(s=o?.raw?.resetCredits?.availableCount)?s:Number(s))?Math.max(0,n):0,p=et===r.id,b=V===r.id||Z===r.id||p;return(0,a.jsxs)(w.default,{padding:"none",className:`min-w-0 ${u?"opacity-60":""}`,children:[(0,a.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,a.jsx)(i.A,{src:`/providers/${r.provider}.png`,alt:r.provider,size:32,className:"object-contain",fallbackText:r.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary capitalize truncate",children:r.provider}),m(r)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:m(r)}):null,A(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:A(r)}):null,x&&(0,a.jsxs)("p",{className:"text-[11px] text-text-muted truncate",children:["Reset eligible: ",h]}),"kiro"===r.provider&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[(0,a.jsx)("span",{className:"rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:(l=r.providerSpecificData?.authMethod)&&$[l]?$[l]:"api_key"===r.authType?"API Key":"OAuth"}),P(r)&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:P(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${u?"bg-surface-2 text-text-muted":"active"===r.testStatus||"success"===r.testStatus?"bg-green-500/10 text-green-600 dark:text-green-400":"error"===r.testStatus||"expired"===r.testStatus||"unavailable"===r.testStatus?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-surface-2 text-text-muted"}`,children:u?"disabled":r.testStatus||"unknown"}),r.providerSpecificData?.profileArn&&(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.providerSpecificData.profileArn,r.id),title:r.providerSpecificData.profileArn,className:"inline-flex max-w-full items-center gap-1 rounded-full border border-border-subtle px-2 py-0.5 text-[10px] text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:e===r.id?"check":"content_copy"}),(0,a.jsx)("code",{className:"truncate font-mono",children:r.providerSpecificData.profileArn})]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[x&&(0,a.jsx)(k.default,{text:`Codex reset credits remaining: ${h}`,children:(0,a.jsxs)("div",{className:`hidden h-8 items-center gap-1 rounded-lg border px-2 text-[11px] sm:flex ${h>0?"border-primary/30 bg-primary/5 text-primary":"border-black/10 bg-black/[0.02] text-text-muted dark:border-white/10 dark:bg-white/[0.03]"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"}),(0,a.jsx)("span",{className:"tabular-nums",children:h})]})}),x&&h>0&&(0,a.jsx)(k.default,{text:`Use one Codex reset credit. Available: ${h}`,children:(0,a.jsxs)("button",{type:"button",onClick:()=>es({connection:r,resetCreditCount:h}),disabled:c||b,className:"flex h-8 items-center gap-1 rounded-lg border border-primary/30 px-2 text-[11px] text-primary transition-colors hover:bg-primary/10 disabled:opacity-50",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[15px] ${p?"animate-spin":""}`,children:p?"progress_activity":"bolt"}),(0,a.jsx)("span",{className:"hidden lg:inline",children:"Reset limit"})]})}),"claude"===r.provider&&"oauth"===r.authType&&(0,a.jsx)(k.default,{text:"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",children:(0,a.jsx)("button",{type:"button",onClick:()=>eH(r.id,!0!==L[r.id]),"aria-label":"Toggle auto-ping",className:`flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${!0===L[r.id]?"text-primary":"text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})}),(0,a.jsx)(k.default,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>ez(r.id,r.provider),disabled:c||b,"aria-label":"Refresh quota",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${c?"animate-spin":""}`,children:"refresh"})})}),(0,a.jsx)(k.default,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{eo(r),en(!0)},disabled:b,"aria-label":"Edit connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})})}),(0,a.jsx)(k.default,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>eU(r.id),disabled:b,"aria-label":"Delete connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${V===r.id?"animate-pulse":""}`,children:"delete"})})}),(0,a.jsx)("div",{className:"inline-flex items-center pl-0.5",title:r.isActive??!0?"Disable connection":"Enable connection",children:(0,a.jsx)(j.default,{size:"sm",checked:r.isActive??!0,disabled:b,onChange:e=>eJ(r.id,e)})})]})]})}),(0,a.jsx)("div",{className:"px-2 py-1.5",children:c?(0,a.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):d?(0,a.jsxs)("div",{className:"text-center py-5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:d})]}):o?.message?(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:o.message})}):(0,a.jsx)(v,{quotas:o?.quotas,compact:!0,sortMode:"default",showSortLabel:"codex"===r.provider&&"default"!==eg})})]},r.id)})}),(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:e0}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:e1?"custom":String(e$),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(eC(1),eA(r),eE(String(r)))},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Accounts per page",children:[c.map(e=>(0,a.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,a.jsx)("option",{value:"custom",children:"Custom"})]}),(0,a.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:eP,onChange:e=>eE(e.target.value),onBlur:()=>{let e=Number.parseInt(eP,10);if(!Number.isFinite(e))return void eE(String(e$));let t=Math.min(500,Math.max(1,e));eC(1),eA(t),eE(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eP,10);if(!Number.isFinite(t))return void eE(String(e$));let r=Math.min(500,Math.max(1,t));eC(1),eA(r),eE(String(r))},className:"h-8 w-20 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Custom accounts per page",placeholder:"Custom"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",eq.page," / ",eq.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>eC(1),disabled:eq.page<=1||Y||G,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"First Page"}),(0,a.jsx)("button",{type:"button",onClick:()=>eC(e=>Math.max(1,e-1)),disabled:eq.page<=1||Y||G,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Previous accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eC(e=>Math.min(eq.totalPages,e+1)),disabled:eq.page>=eq.totalPages||Y||G,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Next accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eC(eq.totalPages),disabled:eq.page>=eq.totalPages||Y||G,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Last Page"})]})]})}),(0,a.jsx)(N.uo,{isOpen:!!ea,onClose:()=>{et||es(null)},onConfirm:async()=>{let e=ea?.connection;e&&(await eR(e.id,e.provider),es(null))},title:"Reset Codex limit?",message:`Use 1 Codex reset credit for ${m(ea?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${ea?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!et}),(0,a.jsx)(N.wI,{isOpen:ei,connection:el,proxyPools:ec,onSave:eK,onClose:()=>{en(!1),eo(null)}})]}):(0,a.jsx)(w.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:eZ.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:eZ.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:eZ.description})]})}):(0,a.jsx)(w.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})})}}},e=>{e.O(0,[2574,3862,1051,1321,705,5497,8441,3794,7358],()=>e(e.s=15546)),_N_E=e.O()}]);
|
package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-b32efa0400b90a7f.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{6788:(e,t,s)=>{Promise.resolve().then(s.bind(s,81772))},81772:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>N});var a=s(95155),l=s(12115),n=s(73321),r=s(35497),i=s(84588),d=s(92542),o=s(31474);function c({isOpen:e,onClose:t,title:s,children:n,width:r="md",className:i}){let d={sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[800px]",full:"w-full"};return((0,l.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,l.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e)?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,o.cn)("absolute right-0 top-0 h-full bg-surface flex flex-col","shadow-[var(--shadow-elev)]","slide-in-right","border-l border-border-subtle",d[r]||d.md,i),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle flex-shrink-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:s&&(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})}),(0,a.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-6 custom-scrollbar",children:n})]})]}):null}function x({currentPage:e,pageSize:t,totalItems:s,onPageChange:l,onPageSizeChange:n,className:r}){let i=Math.ceil(s/t),c=s>0?(e-1)*t+1:0,m=Math.min(e*t,s),h=(()=>{let t=[],s=Math.max(1,e-2),a=Math.min(i,s+5-1);a-s+1<5&&(s=Math.max(1,a-5+1));for(let e=s;e<=a;e++)t.push(e);return t})();return(0,a.jsxs)("div",{className:(0,o.cn)("flex flex-col sm:flex-row items-center justify-between gap-4 py-4 px-2",r),children:[s>0&&(0,a.jsxs)("div",{className:"text-sm text-text-muted",children:["Showing ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:c})," to"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:m})," of"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:s})," results"]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[n&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Rows:"}),(0,a.jsx)("select",{value:t,onChange:e=>n(Number(e.target.value)),className:(0,o.cn)("h-9 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","cursor-pointer"),style:{colorScheme:"auto"},children:[10,20,50].map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]}),i>1&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>l(e-1),disabled:1===e,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_left"})}),h[0]>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.default,{variant:"ghost",size:"sm",onClick:()=>l(1),className:"w-9 px-0 hidden sm:inline-flex",children:"1"}),h[0]>2&&(0,a.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."})]}),h.map(t=>(0,a.jsx)(d.default,{variant:e===t?"primary":"ghost",size:"sm",onClick:()=>l(t),className:(0,o.cn)("w-9 px-0",e===t?"inline-flex":"hidden sm:inline-flex"),children:t},t)),h[h.length-1]<i&&(0,a.jsxs)(a.Fragment,{children:[h[h.length-1]<i-1&&(0,a.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."}),(0,a.jsx)(d.default,{variant:"ghost",size:"sm",onClick:()=>l(i),className:"w-9 px-0 hidden sm:inline-flex",children:i})]}),(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>l(e+1),disabled:e===i,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"})})]})]})]})}var m=s(88105);let h=null,p=null;async function u(){if(h&&p)return{providerNameCache:h,providerNodesCache:p};let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[];for(let e of(p={},t))p[e.id]=e.name;return{providerNameCache:h={...m.Q2,...p},providerNodesCache:p}}function f(e,t){if(!e||!t)return e;let s=t[e];if("string"==typeof s)return s;if(s?.name)return s.name;let a=(0,m.zt)(e)||m.Q2[e];return a?.name||e}function b({title:e,children:t,defaultOpen:s=!1,icon:n=null}){let[r,i]=(0,l.useState)(s);return(0,a.jsxs)("div",{className:"border border-black/5 dark:border-white/5 rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"w-full flex items-center justify-between p-3 bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[n&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:n}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,o.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",r?"rotate-90":""),children:"chevron_right"})]}),r&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function j(e){let t=e?.prompt_tokens||e?.input_tokens||0,s=e?.cached_tokens||e?.cache_read_input_tokens||0;return t<s?s:t}function g(){let[e,t]=(0,l.useState)([]),[s,n]=(0,l.useState)({page:1,pageSize:20,totalItems:0,totalPages:0}),[r,m]=(0,l.useState)(!1),[h,p]=(0,l.useState)(null),[g,v]=(0,l.useState)(!1),[N,w]=(0,l.useState)([]),[k,y]=(0,l.useState)(null),[S,C]=(0,l.useState)({provider:"",startDate:"",endDate:""}),D=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/usage/providers"),t=await e.json();w(t.providers||[]);let s=await u();y(s.providerNameCache)}catch(e){console.error("Failed to fetch providers:",e)}},[]),z=(0,l.useCallback)(async()=>{m(!0);try{let e=new URLSearchParams({page:s.page.toString(),pageSize:s.pageSize.toString()});S.provider&&e.append("provider",S.provider),S.startDate&&e.append("startDate",S.startDate),S.endDate&&e.append("endDate",S.endDate);let a=await fetch(`/api/usage/request-details?${e}`),l=await a.json();t(l.details||[]),n(e=>({...e,...l.pagination}))}catch(e){console.error("Failed to fetch request details:",e)}finally{m(!1)}},[s.page,s.pageSize,S]);return(0,l.useEffect)(()=>{D()},[D]),(0,l.useEffect)(()=>{z()},[z]),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsx)(i.default,{padding:"md",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"provider-filter",className:"text-sm font-medium text-text-main",children:"Provider"}),(0,a.jsxs)("select",{id:"provider-filter",value:S.provider,onChange:e=>C({...S,provider:e.target.value}),className:(0,o.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","w-full min-w-0 cursor-pointer"),style:{colorScheme:"auto"},children:[(0,a.jsx)("option",{value:"",children:"All Providers"}),N.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"start-date-filter",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"start-date-filter",type:"datetime-local",value:S.startDate,onChange:e=>C({...S,startDate:e.target.value}),className:(0,o.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"end-date-filter",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"end-date-filter",type:"datetime-local",value:S.endDate,onChange:e=>C({...S,endDate:e.target.value}),className:(0,o.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:col-span-2 lg:col-span-1",children:[(0,a.jsx)("span",{className:"hidden text-sm font-medium text-text-main opacity-0 lg:block","aria-hidden":"true",children:"Clear"}),(0,a.jsx)(d.default,{variant:"ghost",onClick:()=>{C({provider:"",startDate:"",endDate:""})},disabled:!S.provider&&!S.startDate&&!S.endDate,className:"w-full",children:"Clear Filters"})]})]})}),(0,a.jsxs)(i.default,{padding:"none",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[880px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5",children:[(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Timestamp"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Model"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Provider"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Input Tokens"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Output Tokens"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Latency"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Action"})]})}),(0,a.jsx)("tbody",{children:r?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading..."]})})}):0===e.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:"No request details found"})}):e.map((e,t)=>(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 last:border-b-0 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:"whitespace-nowrap p-4 text-sm text-text-main",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"max-w-[260px] truncate p-4 font-mono text-sm text-text-main",children:e.model}),(0,a.jsx)("td",{className:"max-w-[180px] truncate p-4 text-sm text-text-main",children:(0,a.jsx)("span",{className:"font-medium",children:f(e.provider,k)})}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:j(e.tokens).toLocaleString()}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:e.tokens?.completion_tokens?.toLocaleString()||0}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-muted",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("div",{children:["TTFT: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.ttft||0,"ms"]})]}),(0,a.jsxs)("div",{children:["Total: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.total||0,"ms"]})]})]})}),(0,a.jsx)("td",{className:"p-4 text-center",children:(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>{p(e),v(!0)},children:"Detail"})})]},`${e.id}-${t}`))})]})}),!r&&e.length>0&&(0,a.jsx)("div",{className:"border-t border-black/5 dark:border-white/5",children:(0,a.jsx)(x,{currentPage:s.page,pageSize:s.pageSize,totalItems:s.totalItems,onPageChange:e=>{n(t=>({...t,page:e}))},onPageSizeChange:e=>{n(t=>({...t,pageSize:e,page:1}))}})})]}),(0,a.jsx)(c,{isOpen:g,onClose:()=>v(!1),title:"Request Details",width:"lg",children:h&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-4 text-sm sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"ID:"})," ",(0,a.jsx)("span",{className:"break-all font-mono text-text-main",children:h.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:new Date(h.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"})," ",(0,a.jsx)("span",{className:"text-text-main font-medium",children:f(h.provider,k)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:h.model})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"})," ",(0,a.jsx)("span",{className:(0,o.cn)("font-medium","success"===h.status?"text-green-600":"text-red-600"),children:h.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"})," ",(0,a.jsxs)("span",{className:"text-text-main font-mono",children:["TTFT ",h.latency?.ttft||0,"ms / Total ",h.latency?.total||0,"ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:j(h.tokens).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:h.tokens?.completion_tokens?.toLocaleString()||0})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(b,{title:"1. Client Request (Input)",defaultOpen:!0,icon:"input",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(h.request,null,2)})}),h.providerRequest&&(0,a.jsx)(b,{title:"2. Provider Request (Translated)",icon:"translate",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(h.providerRequest,null,2)})}),h.providerResponse&&(0,a.jsx)(b,{title:"3. Provider Response (Raw)",icon:"data_object",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:"object"==typeof h.providerResponse?JSON.stringify(h.providerResponse,null,2):h.providerResponse})}),(0,a.jsxs)(b,{title:"4. Client Response (Final)",defaultOpen:!0,icon:"output",children:[h.response?.thinking&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"font-semibold text-text-main mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"psychology"}),"Thinking Process"]}),(0,a.jsx)("pre",{className:"max-h-[200px] max-w-full overflow-auto rounded-lg border border-amber-200 bg-amber-50 p-3 font-mono text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100 sm:p-4",children:h.response.thinking})]}),(0,a.jsx)("h4",{className:"font-semibold text-text-main mb-2 text-xs uppercase tracking-wide opacity-70",children:"Content"}),(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:h.response?.content||"[No content]"})]})]})]})})]})}let v=[{value:"today",label:"Today"},{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function N(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(w,{})})}function w(){let e=(0,n.useSearchParams)(),t=(0,n.useRouter)(),[s,i]=(0,l.useState)("today"),d=e.get("tab"),o=d&&["overview","logs","details"].includes(d)?d:"overview";return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)(r.Iz,{options:[{value:"overview",label:"Overview"},{value:"details",label:"Details"}],value:o,onChange:s=>{if(s===o)return;let a=new URLSearchParams(e);a.set("tab",s),t.push(`/dashboard/usage?${a.toString()}`,{scroll:!1})},className:"w-full sm:w-auto"}),"overview"===o&&(0,a.jsx)(r.Iz,{options:v,value:s,onChange:i,size:"sm",className:"w-full sm:w-auto"})]}),"overview"===o&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(r.jK,{period:s,setPeriod:i,hidePeriodSelector:!0})}),"logs"===o&&(0,a.jsx)(r.gM,{}),"details"===o&&(0,a.jsx)(g,{})]})}}},e=>{e.O(0,[2574,3862,1051,1321,705,5497,8441,3794,7358],()=>e(e.s=6788)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7852],{23239:(e,s,t)=>{Promise.resolve().then(t.bind(t,59884))},59884:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>c});var a=t(95155),l=t(12115),r=t(73321);function n(){let e=(0,r.useSearchParams)(),[s,t]=(0,l.useState)("processing");return(0,l.useEffect)(()=>{let s=e.get("code"),a=e.get("state"),l=e.get("error"),r={code:s,state:a,error:l,errorDescription:e.get("error_description"),fullUrl:window.location.href},n=[window.location.origin,"http://localhost:1455"];if(window.opener)for(let e of n)try{window.opener.postMessage({type:"oauth_callback",data:r},e)}catch(e){console.log("postMessage failed:",e)}try{let e=new BroadcastChannel("oauth_callback");e.postMessage(r),e.close()}catch(e){console.log("BroadcastChannel failed:",e)}try{localStorage.setItem("oauth_callback",JSON.stringify({...r,timestamp:Date.now()}))}catch(e){console.log("localStorage failed:",e)}s||l?(t("success"),setTimeout(()=>{window.close(),setTimeout(()=>t("done"),500)},1500)):setTimeout(()=>t("manual"),0)},[e]),(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,a.jsxs)("div",{className:"text-center p-8 max-w-md",children:["processing"===s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,a.jsx)("h1",{className:"text-xl font-semibold mb-2",children:"Processing..."}),(0,a.jsx)("p",{className:"text-text-muted",children:"Please wait while we complete the authorization."})]}),("success"===s||"done"===s)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,a.jsx)("h1",{className:"text-xl font-semibold mb-2",children:"Authorization Successful!"}),(0,a.jsx)("p",{className:"text-text-muted",children:"success"===s?"This window will close automatically...":"You can close this tab now."})]}),"manual"===s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-yellow-600",children:"info"})}),(0,a.jsx)("h1",{className:"text-xl font-semibold mb-2",children:"Copy This URL"}),(0,a.jsx)("p",{className:"text-text-muted mb-4",children:"Please copy the URL from the address bar and paste it in the application."}),(0,a.jsx)("div",{className:"bg-surface border border-border rounded-lg p-3 text-left",children:(0,a.jsx)("code",{className:"text-xs break-all",children:window.location.href})})]})]})})}function c(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,a.jsxs)("div",{className:"text-center p-8",children:[(0,a.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,a.jsx)("p",{className:"text-text-muted",children:"Loading..."})]})}),children:(0,a.jsx)(n,{})})}},73321:(e,s,t)=>{"use strict";var a=t(74645);t.o(a,"notFound")&&t.d(s,{notFound:function(){return a.notFound}}),t.o(a,"useParams")&&t.d(s,{useParams:function(){return a.useParams}}),t.o(a,"usePathname")&&t.d(s,{usePathname:function(){return a.usePathname}}),t.o(a,"useRouter")&&t.d(s,{useRouter:function(){return a.useRouter}}),t.o(a,"useSearchParams")&&t.d(s,{useSearchParams:function(){return a.useSearchParams}})}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=23239)),_N_E=e.O()}]);
|