vansrouter 0.91.5 → 0.91.7
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 +21 -20
- 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/routes-manifest.json +6 -0
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +3 -3
- 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 +2 -2
- 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 +3 -3
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +6 -4
- 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 +2 -2
- 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 +2 -2
- 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-fitness/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-fitness/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-fitness/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
- 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/pxpipe/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +3 -3
- 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 +2 -2
- 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 +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- 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 +1 -1
- package/app/.next-cli-build/server/app/api/auth/check/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
- 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 +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 +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 +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 +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 +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 +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 +5 -5
- 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 +1 -1
- 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 +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 +2 -2
- 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/devin-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
- 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/grok-build-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
- 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 +2 -2
- 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 +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/extras/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js +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 +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 +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 +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 +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 +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 +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 +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 +2 -2
- 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 +2 -2
- 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 +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 +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 +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 +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 +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 +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 +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 +2 -2
- 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 +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 +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 +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 +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 +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 +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 +2 -2
- 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]/gcp-projects/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/gcp-projects/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 +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/bulk/route.js +1 -0
- package/app/.next-cli-build/server/app/api/providers/bulk/route.js.nft.json +1 -0
- package/app/.next-cli-build/server/app/api/providers/bulk/route_client-reference-manifest.js +1 -0
- package/app/.next-cli-build/server/app/api/providers/circuit-breakers/[name]/reset/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/circuit-breakers/[name]/reset/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/circuit-breakers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/circuit-breakers/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 +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 +2 -2
- 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]/fitness/clear/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/fitness/clear/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +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 +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 +3 -3
- 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 +3 -3
- 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/fitness/clear-all/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/fitness/clear-all/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/fitness/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/fitness/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js +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 +3 -3
- 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/pxpipe/health/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +3 -3
- 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 +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 +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 +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/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js +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 +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 +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 +2 -2
- 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 +2 -2
- 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 +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/videos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/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 +2 -2
- 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 +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- 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 +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- 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 +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk/dashboard/proxy-fitness/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk/dashboard/proxy-fitness.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
- 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 +6 -6
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- 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 +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
- 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 +5 -5
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page.js +2 -2
- 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 +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- 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 +2 -2
- 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 +4 -4
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- 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 +3 -3
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- 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 +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/masuk/page.js +2 -2
- package/app/.next-cli-build/server/app/masuk/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/masuk/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +21 -20
- package/app/.next-cli-build/server/chunks/1586.js +1 -1
- package/app/.next-cli-build/server/chunks/1632.js +1 -1
- package/app/.next-cli-build/server/chunks/1685.js +2 -2
- package/app/.next-cli-build/server/chunks/2764.js +1 -1
- package/app/.next-cli-build/server/chunks/32.js +1 -1
- package/app/.next-cli-build/server/chunks/4105.js +1 -1
- package/app/.next-cli-build/server/chunks/4502.js +2 -2
- package/app/.next-cli-build/server/chunks/4574.js +3 -5
- package/app/.next-cli-build/server/chunks/5006.js +1 -1
- package/app/.next-cli-build/server/chunks/5198.js +1 -1
- package/app/.next-cli-build/server/chunks/5302.js +1 -1
- package/app/.next-cli-build/server/chunks/5598.js +1 -1
- package/app/.next-cli-build/server/chunks/6085.js +1 -1
- package/app/.next-cli-build/server/chunks/6931.js +1 -1
- package/app/.next-cli-build/server/chunks/7104.js +1 -1
- package/app/.next-cli-build/server/chunks/7834.js +1 -1
- package/app/.next-cli-build/server/chunks/8356.js +1 -0
- package/app/.next-cli-build/server/chunks/9984.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +4 -4
- 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/4rgIuL9LKHqO5T-ereNHl/_buildManifest.js +1 -0
- package/app/.next-cli-build/static/chunks/4385-eb2201df8b7f00f5.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-7e4411e7070e11c8.js → page-775d2e9133c07844.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-5039d324c1af44cd.js → page-dfb9adca560c840b.js} +6 -4
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-44af31c220b203a8.js +1 -0
- package/app/.next-cli-build/static/chunks/app/_global-error/page-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/check/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/login/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/status/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/combos/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/health/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/init/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/keys/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/locale/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/alias/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/availability/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/custom/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/test/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pricing/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/gcp-projects/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/bulk/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/circuit-breakers/[name]/reset/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/circuit-breakers/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/client/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/fitness/clear/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/fitness/clear-all/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/fitness/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/settings/database/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/settings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/shutdown/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tags/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/load/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/save/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/send/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/history/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/request-details/[id]/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/models/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/search/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/version/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/version/update/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-0cb367716063bf7e.js +1 -0
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-0cb367716063bf7e.js +1 -0
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/app/.next-cli-build/static/WuRuQCoSteIg58fPNKmNT/_buildManifest.js +0 -1
- package/app/.next-cli-build/static/chunks/4385-c0914bc328af003a.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-ac56e568902351a0.js +0 -1
- package/app/.next-cli-build/static/chunks/app/_global-error/page-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/check/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/login/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/status/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/combos/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/health/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/init/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/keys/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/locale/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/alias/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/availability/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/custom/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/test/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pricing/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/gcp-projects/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/circuit-breakers/[name]/reset/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/circuit-breakers/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/client/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/fitness/clear/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/fitness/clear-all/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/fitness/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/settings/database/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/settings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/shutdown/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tags/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/load/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/save/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/send/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/history/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/request-details/[id]/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/models/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/search/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/version/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/version/update/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-3f553f07f574de1b.js +0 -1
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-3f553f07f574de1b.js +0 -1
- /package/app/.next-cli-build/static/{WuRuQCoSteIg58fPNKmNT → 4rgIuL9LKHqO5T-ereNHl}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{2710:(e,t,a)=>{Promise.resolve().then(a.bind(a,64347))},21863:(e,t,a)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}function r(e){let t=e?.testStatus;return e?.isActive===!1||"unavailable"===t||"error"===t||"expired"===t?"unavailable":"active"}a.d(t,{d:()=>r,g:()=>s})},64347:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>B});var s=a(15102),r=a(93278),l=a(93885),o=a.n(l),n=a(82030),i=a(92940),d=a(31704),c=a(31038),m=a(21863);function u({until:e}){let[t,a]=(0,n.useState)("");return((0,n.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);s<60?a(`${s}s`):s<3600?a(`${Math.floor(s/60)}m ${s%60}s`):a(`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`)};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function x({connection:e,proxyPools:t,isOAuth:a,isFirst:r,isLast:l,onMoveUp:o,onMoveDown:d,onToggleActive:c,onUpdateProxy:p,onEdit:h,onDelete:b}){let[g,f]=(0,n.useState)(!1),[y,j]=(0,n.useState)(!1),[v,w]=(0,n.useState)(!1),N=(0,n.useRef)(null),k=new Map((t||[]).map(e=>[e.id,e])),C=e.providerSpecificData?.proxyPoolId||null,S=C?k.get(C):null,$=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,P=!!C||$,_=S?`Pool: ${S.name}`:C?`Pool: ${C} (inactive/missing)`:$?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",I="",A=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(A)try{let e=new URL(A);I=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{I=A}let E=S?.noProxy||e.providerSpecificData?.connectionNoProxy||"",T=S?.isActive===!0?"success":C||$?"error":"default",B=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(Boolean).sort()[0]||null;(0,n.useEffect)(()=>{let t=null,a=()=>{w(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};return a(),B&&(t=setInterval(a,1e3)),()=>{t&&clearInterval(t)}},[B,e]),(0,n.useEffect)(()=>{if(!g)return;let e=e=>{N.current&&!N.current.contains(e.target)&&f(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[g]);let M="unavailable"!==e.testStatus||v?e.testStatus:"active",O=a?e.name||e.email||e.displayName||"OAuth Account":e.name,K=async e=>{j(!0);try{await p("__none__"===e?null:e)}finally{j(!1),f(!1)}};return(0,s.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{onClick:o,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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:d,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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:a?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:O}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,s.jsx)(i.Badge,{variant:(0,m.g)(e.isActive,M),size:"sm",dot:!0,children:!1===e.isActive?"disabled":M||"Unknown"}),P&&(0,s.jsx)(i.Badge,{variant:T,size:"sm",children:"Proxy"}),v&&!1!==e.isActive&&(0,s.jsx)(u,{until:B}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),P&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:_,children:_}),I&&(0,s.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:I}),E&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:E,children:["no_proxy: ",E]})]})]})]}),(0,s.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,s.jsxs)("div",{className:"relative",ref:N,children:[(0,s.jsxs)("button",{onClick:()=>f(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${P?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),g&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,s.jsx)("button",{onClick:()=>K("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!C?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,s.jsx)("button",{onClick:()=>K(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,s.jsxs)("button",{onClick:h,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:b,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(i.Toggle,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable":"Enable"})]})]})}function p({isOpen:e,provider:t,providerName:a,proxyPools:r,onSave:l,onClose:o}){let d="__none__",[c,m]=(0,n.useState)({name:"",apiKey:"",priority:1,proxyPoolId:d}),[u,x]=(0,n.useState)(!1),[h,b]=(0,n.useState)(null),[g,f]=(0,n.useState)(!1),y=async()=>{x(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),a=await e.json();b(a.valid?"success":"failed")}catch{b("failed")}finally{x(!1)}},j=async()=>{if(t&&c.apiKey){f(!0);try{let e=!1;try{x(!0),b(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await a.json()).valid,b(e?"success":"failed")}catch{b("failed")}finally{x(!1)}await l({name:c.name,apiKey:c.apiKey,priority:c.priority,proxyPoolId:c.proxyPoolId===d?null:c.proxyPoolId,testStatus:e?"active":"unknown"})}finally{f(!1)}}};return t?(0,s.jsx)(i.Modal,{isOpen:e,title:`Add ${a||t} API Key`,onClose:o,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.name,onChange:e=>m({...c,name:e.target.value}),placeholder:"Production Key"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,s.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.apiKey,onChange:e=>m({...c,apiKey:e.target.value})})]}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(i.Button,{onClick:y,disabled:!c.apiKey||u||g,variant:"secondary",children:u?"Checking...":"Check"})})]}),h&&(0,s.jsx)(i.Badge,{variant:"success"===h?"success":"error",children:"success"===h?"Valid":"Invalid"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,s.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.priority,onChange:e=>m({...c,priority:Number.parseInt(e.target.value)||1})})]}),(0,s.jsx)(i.Select,{label:"Proxy Pool",value:c.proxyPoolId,onChange:e=>m({...c,proxyPoolId:e.target.value}),options:[{value:d,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.Button,{onClick:j,fullWidth:!0,disabled:!c.name||!c.apiKey||g,children:g?"Saving...":"Save"}),(0,s.jsx)(i.Button,{onClick:o,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function h({providerId:e,isOAuth:t}){let[a,r]=(0,n.useState)([]),[l,o]=(0,n.useState)([]),[d,c]=(0,n.useState)(!0),[m,u]=(0,n.useState)(!1),[b,g]=(0,n.useState)(!1),[f,y]=(0,n.useState)(null),[j,v]=(0,n.useState)(null),[w,N]=(0,n.useState)("1"),[k,C]=(0,n.useState)(null),S=(0,n.useCallback)(async()=>{try{let[t,a,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),l=await t.json(),n=await a.json(),i=s.ok?await s.json():{};t.ok&&r((l.connections||[]).filter(t=>t.provider===e)),a.ok&&o(n.proxyPools||[]);let d=(i.providerStrategies||{})[e]||{};v(d.fallbackStrategy||null),N(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{c(!1)}},[e]);(0,n.useEffect)(()=>{S()},[S]);let $=async(t,a)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),r=(s.ok?await s.json():{}).providerStrategies||{},l={};t&&(l.fallbackStrategy=t),"round-robin"===t&&""!==a&&(l.stickyRoundRobinLimit=Number(a)||3);let o={...r};0===Object.keys(l).length?delete o[e]:o[e]=l,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:o})})}catch(e){console.log("saveStrategy error:",e)}},P=async(e,t)=>{let s=[...a];[s[e],s[t]]=[s[t],s[e]],r(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{await S()}},_=async e=>{C({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{C(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&r(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},I=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&r(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("toggle error:",e)}},A=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&r(a=>a.map(a=>a.id===e?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("proxy error:",e)}},E=async t=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})})).ok&&(await S(),u(!1))}catch(e){console.log("save apikey error:",e)}},T=async e=>{try{(await fetch(`/api/providers/${f.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await S(),g(!1))}catch(e){console.log("update connection error:",e)}};return d?(0,s.jsx)(i.Card,{children:(0,s.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i.Card,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(i.Toggle,{checked:"round-robin"===j,onChange:e=>{let t=e?"round-robin":null;v(t),e&&!w&&N("1"),$(t,e?w||"1":w)}}),"round-robin"===j&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:w,onChange:e=>{N(e.target.value),$("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===a.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,s.jsx)(i.Button,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add Connection"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:a.map((e,r)=>(0,s.jsx)(x,{connection:e,proxyPools:l,isOAuth:t,isFirst:0===r,isLast:r===a.length-1,onMoveUp:()=>P(r,r-1),onMoveDown:()=>P(r,r+1),onToggleActive:t=>I(e.id,t),onUpdateProxy:t=>A(e.id,t),onEdit:()=>{y(e),g(!0)},onDelete:()=>_(e.id)},e.id))}),(0,s.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,s.jsx)(i.Button,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add"})})]})]}),(0,s.jsx)(p,{isOpen:m,provider:e,proxyPools:l,onSave:E,onClose:()=>u(!1)}),(0,s.jsx)(i.EditConnectionModal,{isOpen:b,connection:f,proxyPools:l,onSave:T,onClose:()=>g(!1)}),(0,s.jsx)(i.ConfirmModal,{isOpen:!!k,onClose:()=>C(null),onConfirm:k?.onConfirm,title:k?.title||"Confirm",message:k?.message,variant:"danger"})]})}var b=a(55223),g=a(21577);function f({model:e,fullModel:t,copied:a,onCopy:r,testStatus:l,isCustom:o,isFree:n,onDeleteAlias:i,onTest:d,isTesting:c}){let m="ok"===l?"#22c55e":"error"===l?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,s.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,s.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:c?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,s.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:a===`model-${e.id}`?"Copied!":"Copy"})]}),n&&(0,s.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),o&&(0,s.jsx)("button",{onClick:i,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function y({isOpen:e,onSave:t,onClose:a}){let[r,l]=(0,n.useState)(""),o=()=>{r.trim()&&(t(r.trim()),l(""))};return(0,s.jsx)(i.Modal,{isOpen:e,title:"Add Custom Model",onClose:a,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>l(e.target.value),onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.Button,{onClick:o,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,s.jsx)(i.Button,{onClick:a,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function j({providerId:e,kindFilter:t,providerAliasOverride:a}){let{copied:r,copy:l}=(0,g.C)(),[o,d]=(0,n.useState)({}),[m,u]=(0,n.useState)([]),[x,p]=(0,n.useState)({}),[h,v]=(0,n.useState)(null),[w,N]=(0,n.useState)(""),[k,C]=(0,n.useState)(!1),S=a||(0,c.wG)(e),$=t||"llm",P=(0,n.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/models/custom",{cache:"no-store"})]),a=await e.json(),s=await t.json();e.ok&&d(a.aliases||{}),t.ok&&u(s.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[]);(0,n.useEffect)(()=>{P()},[P]);let _=async(e,t)=>{let a=`${S}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})})).ok&&await P()}catch(e){console.log("set alias error:",e)}},I=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await P()}catch(e){console.log("delete alias error:",e)}},A=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:S,id:e,type:$})})).ok&&(await P(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},E=async e=>{try{let t=new URLSearchParams({providerAlias:S,id:e,type:$});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await P(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},T=async e=>{if(!h){v(e);try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${S}/${e}`,kind:t})}),s=await a.json();p(t=>({...t,[e]:s.ok?"ok":"error"})),N(s.ok?"":s.error||"Model not reachable")}catch{p(t=>({...t,[e]:"error"})),N("Network error")}finally{v(null)}}},B=(0,b.KC)(e),M=t?B.filter(e=>e.kinds?e.kinds.includes(t):(0,b.CP)(e,"llm")===t):B,O=m.filter(e=>e.providerAlias===S&&(0,b.CP)(e,"llm")===$&&!M.some(t=>t.id===e.id));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i.Card,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),w&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:w}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[M.map(e=>{let t=`${S}/${e.id}`,a=Object.entries(o).find(([,e])=>e===t)?.[0];return(0,s.jsx)(f,{model:e,fullModel:`${S}/${e.id}`,alias:a,copied:r,onCopy:l,onSetAlias:t=>_(e.id,t),onDeleteAlias:()=>I(a),testStatus:x[e.id],onTest:()=>T(e.id),isTesting:h===e.id,isFree:e.isFree},e.id)}),O.map(e=>(0,s.jsx)(f,{model:{id:e.id,name:e.name},fullModel:`${S}/${e.id}`,copied:r,onCopy:l,onSetAlias:()=>{},onDeleteAlias:()=>E(e.id),testStatus:x[e.id],onTest:()=>T(e.id),isTesting:h===e.id,isCustom:!0},`${e.id}-${e.type}`)),(0,s.jsxs)("button",{onClick:()=>C(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,s.jsx)(y,{isOpen:k,onSave:async e=>{await A(e),C(!1)},onClose:()=>C(!1)})]})}function v({label:e,children:t}){return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,s.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}let w={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{2710:(e,t,a)=>{Promise.resolve().then(a.bind(a,64347))},21863:(e,t,a)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}a.d(t,{g:()=>s})},64347:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>B});var s=a(15102),r=a(93278),l=a(93885),o=a.n(l),n=a(82030),i=a(92940),d=a(31704),c=a(31038),m=a(21863);function u({until:e}){let[t,a]=(0,n.useState)("");return((0,n.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);s<60?a(`${s}s`):s<3600?a(`${Math.floor(s/60)}m ${s%60}s`):a(`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`)};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function x({connection:e,proxyPools:t,isOAuth:a,isFirst:r,isLast:l,onMoveUp:o,onMoveDown:d,onToggleActive:c,onUpdateProxy:p,onEdit:h,onDelete:b}){let[g,f]=(0,n.useState)(!1),[y,j]=(0,n.useState)(!1),[v,w]=(0,n.useState)(!1),N=(0,n.useRef)(null),k=new Map((t||[]).map(e=>[e.id,e])),C=e.providerSpecificData?.proxyPoolId||null,S=C?k.get(C):null,$=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,P=!!C||$,_=S?`Pool: ${S.name}`:C?`Pool: ${C} (inactive/missing)`:$?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",I="",A=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(A)try{let e=new URL(A);I=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{I=A}let E=S?.noProxy||e.providerSpecificData?.connectionNoProxy||"",T=S?.isActive===!0?"success":C||$?"error":"default",B=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(Boolean).sort()[0]||null;(0,n.useEffect)(()=>{let t=null,a=()=>{w(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};return a(),B&&(t=setInterval(a,1e3)),()=>{t&&clearInterval(t)}},[B,e]),(0,n.useEffect)(()=>{if(!g)return;let e=e=>{N.current&&!N.current.contains(e.target)&&f(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[g]);let M="unavailable"!==e.testStatus||v?e.testStatus:"active",O=a?e.name||e.email||e.displayName||"OAuth Account":e.name,K=async e=>{j(!0);try{await p("__none__"===e?null:e)}finally{j(!1),f(!1)}};return(0,s.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{onClick:o,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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:d,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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:a?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:O}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,s.jsx)(i.Badge,{variant:(0,m.g)(e.isActive,M),size:"sm",dot:!0,children:!1===e.isActive?"disabled":M||"Unknown"}),P&&(0,s.jsx)(i.Badge,{variant:T,size:"sm",children:"Proxy"}),v&&!1!==e.isActive&&(0,s.jsx)(u,{until:B}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),P&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:_,children:_}),I&&(0,s.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:I}),E&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:E,children:["no_proxy: ",E]})]})]})]}),(0,s.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,s.jsxs)("div",{className:"relative",ref:N,children:[(0,s.jsxs)("button",{onClick:()=>f(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${P?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),g&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,s.jsx)("button",{onClick:()=>K("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!C?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,s.jsx)("button",{onClick:()=>K(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,s.jsxs)("button",{onClick:h,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:b,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(i.Toggle,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable":"Enable"})]})]})}function p({isOpen:e,provider:t,providerName:a,proxyPools:r,onSave:l,onClose:o}){let d="__none__",[c,m]=(0,n.useState)({name:"",apiKey:"",priority:1,proxyPoolId:d}),[u,x]=(0,n.useState)(!1),[h,b]=(0,n.useState)(null),[g,f]=(0,n.useState)(!1),y=async()=>{x(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),a=await e.json();b(a.valid?"success":"failed")}catch{b("failed")}finally{x(!1)}},j=async()=>{if(t&&c.apiKey){f(!0);try{let e=!1;try{x(!0),b(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await a.json()).valid,b(e?"success":"failed")}catch{b("failed")}finally{x(!1)}await l({name:c.name,apiKey:c.apiKey,priority:c.priority,proxyPoolId:c.proxyPoolId===d?null:c.proxyPoolId,testStatus:e?"active":"unknown"})}finally{f(!1)}}};return t?(0,s.jsx)(i.Modal,{isOpen:e,title:`Add ${a||t} API Key`,onClose:o,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.name,onChange:e=>m({...c,name:e.target.value}),placeholder:"Production Key"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,s.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.apiKey,onChange:e=>m({...c,apiKey:e.target.value})})]}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(i.Button,{onClick:y,disabled:!c.apiKey||u||g,variant:"secondary",children:u?"Checking...":"Check"})})]}),h&&(0,s.jsx)(i.Badge,{variant:"success"===h?"success":"error",children:"success"===h?"Valid":"Invalid"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,s.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.priority,onChange:e=>m({...c,priority:Number.parseInt(e.target.value)||1})})]}),(0,s.jsx)(i.Select,{label:"Proxy Pool",value:c.proxyPoolId,onChange:e=>m({...c,proxyPoolId:e.target.value}),options:[{value:d,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.Button,{onClick:j,fullWidth:!0,disabled:!c.name||!c.apiKey||g,children:g?"Saving...":"Save"}),(0,s.jsx)(i.Button,{onClick:o,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function h({providerId:e,isOAuth:t}){let[a,r]=(0,n.useState)([]),[l,o]=(0,n.useState)([]),[d,c]=(0,n.useState)(!0),[m,u]=(0,n.useState)(!1),[b,g]=(0,n.useState)(!1),[f,y]=(0,n.useState)(null),[j,v]=(0,n.useState)(null),[w,N]=(0,n.useState)("1"),[k,C]=(0,n.useState)(null),S=(0,n.useCallback)(async()=>{try{let[t,a,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),l=await t.json(),n=await a.json(),i=s.ok?await s.json():{};t.ok&&r((l.connections||[]).filter(t=>t.provider===e)),a.ok&&o(n.proxyPools||[]);let d=(i.providerStrategies||{})[e]||{};v(d.fallbackStrategy||null),N(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{c(!1)}},[e]);(0,n.useEffect)(()=>{S()},[S]);let $=async(t,a)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),r=(s.ok?await s.json():{}).providerStrategies||{},l={};t&&(l.fallbackStrategy=t),"round-robin"===t&&""!==a&&(l.stickyRoundRobinLimit=Number(a)||3);let o={...r};0===Object.keys(l).length?delete o[e]:o[e]=l,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:o})})}catch(e){console.log("saveStrategy error:",e)}},P=async(e,t)=>{let s=[...a];[s[e],s[t]]=[s[t],s[e]],r(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{await S()}},_=async e=>{C({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{C(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&r(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},I=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&r(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("toggle error:",e)}},A=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&r(a=>a.map(a=>a.id===e?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("proxy error:",e)}},E=async t=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})})).ok&&(await S(),u(!1))}catch(e){console.log("save apikey error:",e)}},T=async e=>{try{(await fetch(`/api/providers/${f.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await S(),g(!1))}catch(e){console.log("update connection error:",e)}};return d?(0,s.jsx)(i.Card,{children:(0,s.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i.Card,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(i.Toggle,{checked:"round-robin"===j,onChange:e=>{let t=e?"round-robin":null;v(t),e&&!w&&N("1"),$(t,e?w||"1":w)}}),"round-robin"===j&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:w,onChange:e=>{N(e.target.value),$("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===a.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,s.jsx)(i.Button,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add Connection"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:a.map((e,r)=>(0,s.jsx)(x,{connection:e,proxyPools:l,isOAuth:t,isFirst:0===r,isLast:r===a.length-1,onMoveUp:()=>P(r,r-1),onMoveDown:()=>P(r,r+1),onToggleActive:t=>I(e.id,t),onUpdateProxy:t=>A(e.id,t),onEdit:()=>{y(e),g(!0)},onDelete:()=>_(e.id)},e.id))}),(0,s.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,s.jsx)(i.Button,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add"})})]})]}),(0,s.jsx)(p,{isOpen:m,provider:e,proxyPools:l,onSave:E,onClose:()=>u(!1)}),(0,s.jsx)(i.EditConnectionModal,{isOpen:b,connection:f,proxyPools:l,onSave:T,onClose:()=>g(!1)}),(0,s.jsx)(i.ConfirmModal,{isOpen:!!k,onClose:()=>C(null),onConfirm:k?.onConfirm,title:k?.title||"Confirm",message:k?.message,variant:"danger"})]})}var b=a(55223),g=a(21577);function f({model:e,fullModel:t,copied:a,onCopy:r,testStatus:l,isCustom:o,isFree:n,onDeleteAlias:i,onTest:d,isTesting:c}){let m="ok"===l?"#22c55e":"error"===l?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,s.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,s.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:c?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,s.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:a===`model-${e.id}`?"Copied!":"Copy"})]}),n&&(0,s.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),o&&(0,s.jsx)("button",{onClick:i,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function y({isOpen:e,onSave:t,onClose:a}){let[r,l]=(0,n.useState)(""),o=()=>{r.trim()&&(t(r.trim()),l(""))};return(0,s.jsx)(i.Modal,{isOpen:e,title:"Add Custom Model",onClose:a,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>l(e.target.value),onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.Button,{onClick:o,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,s.jsx)(i.Button,{onClick:a,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function j({providerId:e,kindFilter:t,providerAliasOverride:a}){let{copied:r,copy:l}=(0,g.C)(),[o,d]=(0,n.useState)({}),[m,u]=(0,n.useState)([]),[x,p]=(0,n.useState)({}),[h,v]=(0,n.useState)(null),[w,N]=(0,n.useState)(""),[k,C]=(0,n.useState)(!1),S=a||(0,c.wG)(e),$=t||"llm",P=(0,n.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/models/custom",{cache:"no-store"})]),a=await e.json(),s=await t.json();e.ok&&d(a.aliases||{}),t.ok&&u(s.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[]);(0,n.useEffect)(()=>{P()},[P]);let _=async(e,t)=>{let a=`${S}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})})).ok&&await P()}catch(e){console.log("set alias error:",e)}},I=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await P()}catch(e){console.log("delete alias error:",e)}},A=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:S,id:e,type:$})})).ok&&(await P(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},E=async e=>{try{let t=new URLSearchParams({providerAlias:S,id:e,type:$});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await P(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},T=async e=>{if(!h){v(e);try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${S}/${e}`,kind:t})}),s=await a.json();p(t=>({...t,[e]:s.ok?"ok":"error"})),N(s.ok?"":s.error||"Model not reachable")}catch{p(t=>({...t,[e]:"error"})),N("Network error")}finally{v(null)}}},B=(0,b.KC)(e),M=t?B.filter(e=>e.kinds?e.kinds.includes(t):(0,b.CP)(e,"llm")===t):B,O=m.filter(e=>e.providerAlias===S&&(0,b.CP)(e,"llm")===$&&!M.some(t=>t.id===e.id));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i.Card,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),w&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:w}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[M.map(e=>{let t=`${S}/${e.id}`,a=Object.entries(o).find(([,e])=>e===t)?.[0];return(0,s.jsx)(f,{model:e,fullModel:`${S}/${e.id}`,alias:a,copied:r,onCopy:l,onSetAlias:t=>_(e.id,t),onDeleteAlias:()=>I(a),testStatus:x[e.id],onTest:()=>T(e.id),isTesting:h===e.id,isFree:e.isFree},e.id)}),O.map(e=>(0,s.jsx)(f,{model:{id:e.id,name:e.name},fullModel:`${S}/${e.id}`,copied:r,onCopy:l,onSetAlias:()=>{},onDeleteAlias:()=>E(e.id),testStatus:x[e.id],onTest:()=>T(e.id),isTesting:h===e.id,isCustom:!0},`${e.id}-${e.type}`)),(0,s.jsxs)("button",{onClick:()=>C(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,s.jsx)(y,{isOpen:k,onSave:async e=>{await A(e),C(!1)},onClose:()=>C(!1)})]})}function v({label:e,children:t}){return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,s.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}let w={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
|
|
2
2
|
"results": [
|
|
3
3
|
{ "title": "...", "url": "...", "snippet": "..." }
|
|
4
4
|
]
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{6:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>L});var s=a(15102),i=a(82030),l=a(93278),r=a(93885),o=a.n(r);a(37837),a(19965);var n=a(31704),d=a(92940),c=a(31038),m=a(55223),p=a(58788),x=a(47236);a(5477);let u={base:["none","low","medium","high"],onOff:["none","thinking"],openai:["none","minimal","low","medium","high","xhigh"],levelMax:["none","low","medium","high","max"],budgetX:["none","low","medium","high","xhigh","max"],gemini:["minimal","low","medium","high"],hiMax:["none","high","max"]},h={openai:u.openai,"claude-adaptive":u.levelMax,"claude-budget":u.budgetX,"gemini-level":u.gemini,"gemini-budget":u.base,zai:u.onOff,qwen:u.base,kimi:u.levelMax,deepseek:u.hiMax,minimax:u.onOff,hunyuan:u.base,step:u.base},f=["none","minimal","low","medium","high","xhigh","max"],g=[{provider:"codex",pattern:"*gpt-5.6-sol*",levels:f},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:f},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:f},{pattern:"*gpt-5.6-sol*",levels:["none","minimal","low","medium","high","xhigh","max"]},{pattern:"*claude*opus-5*",levels:u.CLAUDE_EFFORT},{pattern:"*codex*",levels:["low","medium","high","xhigh"]}];function y(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let a=t.match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);if(!a)return null;let[,s,i]=a,l=Number(s),r=void 0===i?null:Number(i);return l<4||4===l&&(null===r||r<=5||null!==r&&r>=1e3)?null:"output_config"}(t))return null;let a=(0,p.nl)(e,t);if(!a.reasoning)return null;let s=g.find(a=>(!a.provider||a.provider===e)&&(0,x.gH)(a.pattern,t)),i=s?.levels||h[a.thinkingFormat]||u.base;return!1===a.thinkingCanDisable&&(i=i.filter(e=>"none"!==e)),i}var b=a(21577),v=a(85479),j=a(20264);let w=new Map;async function N(e){if(!e?.url||!e?.type)return[];let t=w.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),a=await fetch(`/api/providers/suggested-models?${t}`);if(!a.ok)return[];let s=(await a.json()).data??[];return w.set(e.url,{data:s,expiresAt:Date.now()+6e5}),s}catch{return[]}}function k({customModels:e=[],modelAliases:t={},providerAlias:a,builtInModels:s=[],type:i="llm",includeLegacyAliases:l=!0}){let r=new Set(s.map(e=>e.id)),o=new Set,n=[];for(let t of e){if(!t?.id||t.providerAlias!==a)continue;let e=t?.kind||t?.type||"llm";if(i&&e!==i||r.has(t.id))continue;let s=`${a}/${t.id}`;o.has(s)||(o.add(s),n.push({id:t.id,name:t.name||t.id,fullModel:s,source:"custom",type:e}))}if(!l)return n;let d=`${a}/`;for(let[e,a]of Object.entries(t||{})){if("string"!=typeof a||!a.startsWith(d))continue;let t=a.slice(d.length);!t||r.has(t)||o.has(a)||(o.add(a),n.push({id:t,alias:e,fullModel:a,source:"legacyAlias",type:i||"llm"}))}return n}function S({model:e,fullModel:t,alias:a,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,s.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,s.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,s.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,s.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,s.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,s.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,s.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,s.jsx)(d.CapacityBadges,{caps:u,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,s.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,s.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,s.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,s.jsx)("button",{onClick:()=>l(t,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,s.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,s.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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):x?(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function C({modelId:e,fullModel:t,copied:a,onCopy:i,onDeleteAlias:l,onTest:r,testStatus:o,isTesting:n}){let d="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,s.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,s.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,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>i(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e}`?"check":"content_copy"})}),(0,s.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:a===`model-${e}`?"Copied!":"Copy"})]}),r&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:r,disabled:n,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:n?{animation:"spin 1s linear infinite"}:void 0,children:n?"progress_activity":"science"})}),(0,s.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,s.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function A({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:a,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),[y,b]=(0,i.useState)(!1),[v,j]=(0,i.useState)(null),[w,N]=(0,i.useState)({}),S=async t=>{if(!v){j(t);try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),s=await a.json();N(e=>({...e,[t]:s.ok?"ok":"error"}))}catch{N(e=>({...e,[t]:"error"}))}finally{j(null)}}},T=k({customModels:l,modelAliases:a,providerAlias:e,type:"llm"}),I=async()=>{if(!u.trim()||f)return;let e=u.trim();if(T.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)}},P=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||"Failed to import models");let s=a.models||[];if(0===s.length)return void alert("No models returned from /models.");let i=0;for(let e of s){let t=e.id||e.name||e.model;t&&(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{b(!1)}}},$=p.some(e=>!1!==e.isActive);return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",x?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,s.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,s.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{id:"new-compatible-model-input",type:"text",value:u,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&I(),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,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:I,disabled:!u.trim()||f,children:f?"Adding...":"Add"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"download",onClick:P,disabled:!$||y,children:y?"Importing...":"Import from /models"})]}),!$&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),T.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:T.map(({id:a,alias:i,source:l})=>(0,s.jsx)(C,{modelId:a,fullModel:`${t}/${a}`,copied:r,onCopy:o,onDeleteAlias:()=>"custom"===l?m(a):n(i),onTest:p.length>0?()=>S(a):void 0,testStatus:w[a],isTesting:v===a},`${l}-${e}/${a}`))})]})}var T=a(21863);function I({until:e}){let[t,a]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);if(s<60)a(`${s}s`);else if(s<3600)a(`${Math.floor(s/60)}m ${s%60}s`);else{let e=Math.floor(s/3600),t=Math.floor(s%3600/60);a(`${e}h ${t}m`)}};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function P({connection:e,proxyPools:t,isOAuth:a,isFirst:l,isLast:r,onMoveUp:o,onMoveDown:n,onToggleActive:c,onUpdateProxy:m,onEdit:p,onDelete:x,oneByOneStatus:u=null,autoPing:h=null,modelAssignmentOptions:f=null,onModelAssignmentChange:g=null,strictModelAssignment:y=!1}){let[b,v]=(0,i.useState)(!1),[j,w]=(0,i.useState)(!1),N=(0,i.useRef)(null),k=new Map((t||[]).map(e=>[e.id,e])),S=e.providerSpecificData?.proxyPoolIds||(e.providerSpecificData?.proxyPoolId?[e.providerSpecificData.proxyPoolId]:[]),C=e.providerSpecificData?.proxyRotationStrategy||"none",A=S[0]||e.providerSpecificData?.proxyPoolId||null,$=A?k.get(A):null,E=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,O=!!A||E,D=S.length>1?`${S.length} pools (${C})`:$?`Pool: ${$.name}`:A?`Pool: ${A} (inactive/missing)`:E?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",_=h?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",U="";if($?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=$?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);U=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{U=t}}let M=$?.noProxy||e.providerSpecificData?.connectionNoProxy||"",z="default";$?.isActive===!0?z="success":(A||E)&&(z="error"),(0,i.useEffect)(()=>{if(!b)return;let e=e=>{N.current&&!N.current.contains(e.target)&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b]);let B=async e=>{w(!0);try{"__none__"===e?await m(null):await m(e),v(!1)}finally{w(!1)}},R=async(e,t)=>{let a=t.filter(e=>k.get(e)?.isActive===!0);if(a.length){w(!0);try{await m({proxyPoolIds:a,proxyRotationStrategy:e}),v(!1)}finally{w(!1)}}},K=e.authType||(a?"oauth":"apikey"),L="oauth"===K,F="cookie"===K,J=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(L?"OAuth Account":F?"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,[W,H]=(0,i.useState)(!1),V=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,i.useEffect)(()=>{let t=null,a=()=>{H(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};return a(),V&&(t=setInterval(a,1e3)),()=>{t&&clearInterval(t)}},[V,e]);let G="unavailable"!==e.testStatus||W?e.testStatus:"active",Q=()=>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,s.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,s.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,s.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:F?"cookie":L?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:J}),q&&(0,s.jsx)("p",{className:"text-xs text-text-muted truncate",children:q}),(0,s.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,s.jsx)(d.Badge,{variant:(0,T.g)(e.isActive,G),size:"sm",dot:!0,children:!1===e.isActive?"disabled":G||"Unknown"}),(0,s.jsx)(d.Badge,{variant:"default",size:"sm",children:L?"OAuth":F?"Cookie":"API Key"}),O&&(0,s.jsx)(d.Badge,{variant:z,size:"sm",children:"Proxy"}),W&&!1!==e.isActive&&(0,s.jsx)(I,{until:V}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),Q()&&(0,s.jsx)(d.Badge,{variant:u?"success"===u.state?"success":"failed"===u.state?"error":"testing"===u.state?"primary":"default":"default",size:"sm",children:Q()})]}),O&&(0,s.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:D,children:D}),U&&(0,s.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:U}),M&&(0,s.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:M,children:["no_proxy: ",M]})]}),f&&g&&(0,s.jsxs)("select",{value:Object.prototype.hasOwnProperty.call(e.providerSpecificData||{},"assignedModel")?e.providerSpecificData.assignedModel||"":e.providerSpecificData?.freebuffModel||"",onChange:e=>g(e.target.value),disabled:!y,className:"mt-2 max-w-full rounded-md border border-border bg-background px-2 py-1 text-[11px] text-text-main",title:"Model assignment",children:[(0,s.jsx)("option",{value:"",children:"Unassigned"}),f.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))]})]})]}),(0,s.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,s.jsxs)("div",{className:"relative",ref:N,children:[(0,s.jsxs)("button",{type:"button",onClick:()=>v(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 ${O?"text-primary":"text-text-muted hover:text-primary"}`,disabled:j,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:j?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),b&&(0,s.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:["smart"===C&&(0,s.jsx)("p",{className:"px-3 py-1 text-[10px] text-text-muted",children:"Smart skips unfit pools for this provider/model."}),(0,s.jsx)("button",{type:"button",onClick:()=>B("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!A?"text-primary font-medium":"text-text-main"}`,children:"None"}),(0,s.jsx)("p",{className:"px-3 pt-2 text-[10px] font-medium uppercase text-text-muted",children:"Rotation"}),["fill-first","round-robin","random","smart"].map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>R(e,S.length>1?S:(t||[]).filter(e=>e.isActive).map(e=>e.id)),disabled:j,className:`w-full px-3 py-1.5 text-left text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===e?"font-medium text-primary":"text-text-main"}`,children:"smart"===e?"Smart (provider/model aware)":e},e)),(0,s.jsx)("p",{className:"px-3 pt-2 text-[10px] font-medium uppercase text-text-muted",children:"Single pool"}),(t||[]).map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>B(e.id),disabled:j||!0!==e.isActive,className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${A===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,s.jsx)(d.Tooltip,{text:_,children:(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(d.Toggle,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}var $=a(28937),E=a.n($);let O=`name1|sk-key1
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{6:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>L});var s=a(15102),i=a(82030),l=a(93278),r=a(93885),o=a.n(r);a(37837),a(19965);var n=a(31704),d=a(92940),c=a(31038),m=a(55223),p=a(58788),x=a(47236);a(5477);let u={base:["none","low","medium","high"],onOff:["none","thinking"],openai:["none","minimal","low","medium","high","xhigh"],levelMax:["none","low","medium","high","max"],budgetX:["none","low","medium","high","xhigh","max"],gemini:["minimal","low","medium","high"],hiMax:["none","high","max"]},h={openai:u.openai,"claude-adaptive":u.levelMax,"claude-budget":u.budgetX,"gemini-level":u.gemini,"gemini-budget":u.base,zai:u.onOff,qwen:u.base,kimi:u.levelMax,deepseek:u.hiMax,minimax:u.onOff,hunyuan:u.base,step:u.base},f=["none","minimal","low","medium","high","xhigh","max"],g=[{provider:"codex",pattern:"*gpt-5.6-sol*",levels:f},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:f},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:f},{pattern:"*gpt-5.6-sol*",levels:["none","minimal","low","medium","high","xhigh","max"]},{pattern:"*claude*opus-5*",levels:u.CLAUDE_EFFORT},{pattern:"*codex*",levels:["low","medium","high","xhigh"]}];function y(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let a=t.match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);if(!a)return null;let[,s,i]=a,l=Number(s),r=void 0===i?null:Number(i);return l<4||4===l&&(null===r||r<=5||null!==r&&r>=1e3)?null:"output_config"}(t))return null;let a=(0,p.nl)(e,t);if(!a.reasoning)return null;let s=g.find(a=>(!a.provider||a.provider===e)&&(0,x.gH)(a.pattern,t)),i=s?.levels||h[a.thinkingFormat]||u.base;return!1===a.thinkingCanDisable&&(i=i.filter(e=>"none"!==e)),i}var b=a(21577),v=a(85479),j=a(20264);let w=new Map;async function k(e){if(!e?.url||!e?.type)return[];let t=w.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),a=await fetch(`/api/providers/suggested-models?${t}`);if(!a.ok)return[];let s=(await a.json()).data??[];return w.set(e.url,{data:s,expiresAt:Date.now()+6e5}),s}catch{return[]}}function N({customModels:e=[],modelAliases:t={},providerAlias:a,builtInModels:s=[],type:i="llm",includeLegacyAliases:l=!0}){let r=new Set(s.map(e=>e.id)),o=new Set,n=[];for(let t of e){if(!t?.id||t.providerAlias!==a)continue;let e=t?.kind||t?.type||"llm";if(i&&e!==i||r.has(t.id))continue;let s=`${a}/${t.id}`;o.has(s)||(o.add(s),n.push({id:t.id,name:t.name||t.id,fullModel:s,source:"custom",type:e}))}if(!l)return n;let d=`${a}/`;for(let[e,a]of Object.entries(t||{})){if("string"!=typeof a||!a.startsWith(d))continue;let t=a.slice(d.length);!t||r.has(t)||o.has(a)||(o.add(a),n.push({id:t,alias:e,fullModel:a,source:"legacyAlias",type:i||"llm"}))}return n}function S({model:e,fullModel:t,alias:a,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,s.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,s.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,s.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,s.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,s.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,s.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,s.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,s.jsx)(d.CapacityBadges,{caps:u,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,s.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,s.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,s.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,s.jsx)("button",{onClick:()=>l(t,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,s.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,s.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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):x?(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function C({modelId:e,fullModel:t,copied:a,onCopy:i,onDeleteAlias:l,onTest:r,testStatus:o,isTesting:n}){let d="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,s.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,s.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,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>i(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e}`?"check":"content_copy"})}),(0,s.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:a===`model-${e}`?"Copied!":"Copy"})]}),r&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:r,disabled:n,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:n?{animation:"spin 1s linear infinite"}:void 0,children:n?"progress_activity":"science"})}),(0,s.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,s.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function A({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:a,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),[y,b]=(0,i.useState)(!1),[v,j]=(0,i.useState)(null),[w,k]=(0,i.useState)({}),S=async t=>{if(!v){j(t);try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),s=await a.json();k(e=>({...e,[t]:s.ok?"ok":"error"}))}catch{k(e=>({...e,[t]:"error"}))}finally{j(null)}}},T=N({customModels:l,modelAliases:a,providerAlias:e,type:"llm"}),I=async()=>{if(!u.trim()||f)return;let e=u.trim();if(T.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)}},P=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||"Failed to import models");let s=a.models||[];if(0===s.length)return void alert("No models returned from /models.");let i=0;for(let e of s){let t=e.id||e.name||e.model;t&&(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{b(!1)}}},$=p.some(e=>!1!==e.isActive);return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",x?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,s.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,s.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{id:"new-compatible-model-input",type:"text",value:u,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&I(),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,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:I,disabled:!u.trim()||f,children:f?"Adding...":"Add"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"download",onClick:P,disabled:!$||y,children:y?"Importing...":"Import from /models"})]}),!$&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),T.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:T.map(({id:a,alias:i,source:l})=>(0,s.jsx)(C,{modelId:a,fullModel:`${t}/${a}`,copied:r,onCopy:o,onDeleteAlias:()=>"custom"===l?m(a):n(i),onTest:p.length>0?()=>S(a):void 0,testStatus:w[a],isTesting:v===a},`${l}-${e}/${a}`))})]})}var T=a(21863);function I({until:e}){let[t,a]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);if(s<60)a(`${s}s`);else if(s<3600)a(`${Math.floor(s/60)}m ${s%60}s`);else{let e=Math.floor(s/3600),t=Math.floor(s%3600/60);a(`${e}h ${t}m`)}};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function P({connection:e,proxyPools:t,isOAuth:a,isFirst:l,isLast:r,onMoveUp:o,onMoveDown:n,onToggleActive:c,onUpdateProxy:m,onEdit:p,onDelete:x,oneByOneStatus:u=null,autoPing:h=null,modelAssignmentOptions:f=null,onModelAssignmentChange:g=null,strictModelAssignment:y=!1}){let[b,v]=(0,i.useState)(!1),[j,w]=(0,i.useState)(!1),k=(0,i.useRef)(null),N=new Map((t||[]).map(e=>[e.id,e])),S=e.providerSpecificData?.proxyPoolIds||(e.providerSpecificData?.proxyPoolId?[e.providerSpecificData.proxyPoolId]:[]),C=e.providerSpecificData?.proxyRotationStrategy||"none",A=S[0]||e.providerSpecificData?.proxyPoolId||null,$=A?N.get(A):null,E=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,O=!!A||E,D=S.length>1?`${S.length} pools (${C})`:$?`Pool: ${$.name}`:A?`Pool: ${A} (inactive/missing)`:E?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",_=h?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",U="";if($?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=$?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);U=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{U=t}}let M=$?.noProxy||e.providerSpecificData?.connectionNoProxy||"",z="default";$?.isActive===!0?z="success":(A||E)&&(z="error"),(0,i.useEffect)(()=>{if(!b)return;let e=e=>{k.current&&!k.current.contains(e.target)&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b]);let B=async e=>{w(!0);try{"__none__"===e?await m(null):await m(e),v(!1)}finally{w(!1)}},R=async(e,t)=>{let a=t.filter(e=>N.get(e)?.isActive===!0);if(a.length){w(!0);try{await m({proxyPoolIds:a,proxyRotationStrategy:e}),v(!1)}finally{w(!1)}}},K=e.authType||(a?"oauth":"apikey"),L="oauth"===K,F="cookie"===K,J=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(L?"OAuth Account":F?"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,[W,H]=(0,i.useState)(!1),V=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,i.useEffect)(()=>{let t=null,a=()=>{H(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};return a(),V&&(t=setInterval(a,1e3)),()=>{t&&clearInterval(t)}},[V,e]);let G="unavailable"!==e.testStatus||W?e.testStatus:"active",Q=()=>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,s.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,s.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,s.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:F?"cookie":L?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:J}),q&&(0,s.jsx)("p",{className:"text-xs text-text-muted truncate",children:q}),(0,s.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,s.jsx)(d.Badge,{variant:(0,T.g)(e.isActive,G),size:"sm",dot:!0,children:!1===e.isActive?"disabled":G||"Unknown"}),(0,s.jsx)(d.Badge,{variant:"default",size:"sm",children:L?"OAuth":F?"Cookie":"API Key"}),O&&(0,s.jsx)(d.Badge,{variant:z,size:"sm",children:"Proxy"}),W&&!1!==e.isActive&&(0,s.jsx)(I,{until:V}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),Q()&&(0,s.jsx)(d.Badge,{variant:u?"success"===u.state?"success":"failed"===u.state?"error":"testing"===u.state?"primary":"default":"default",size:"sm",children:Q()})]}),O&&(0,s.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:D,children:D}),U&&(0,s.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:U}),M&&(0,s.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:M,children:["no_proxy: ",M]})]}),f&&g&&(0,s.jsxs)("select",{value:Object.prototype.hasOwnProperty.call(e.providerSpecificData||{},"assignedModel")?e.providerSpecificData.assignedModel||"":e.providerSpecificData?.freebuffModel||"",onChange:e=>g(e.target.value),disabled:!y,className:"mt-2 max-w-full rounded-md border border-border bg-background px-2 py-1 text-[11px] text-text-main",title:"Model assignment",children:[(0,s.jsx)("option",{value:"",children:"Unassigned"}),f.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))]})]})]}),(0,s.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,s.jsxs)("div",{className:"relative",ref:k,children:[(0,s.jsxs)("button",{type:"button",onClick:()=>v(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 ${O?"text-primary":"text-text-muted hover:text-primary"}`,disabled:j,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:j?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),b&&(0,s.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:["smart"===C&&(0,s.jsx)("p",{className:"px-3 py-1 text-[10px] text-text-muted",children:"Smart skips unfit pools for this provider/model."}),(0,s.jsx)("button",{type:"button",onClick:()=>B("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!A?"text-primary font-medium":"text-text-main"}`,children:"None"}),(0,s.jsx)("p",{className:"px-3 pt-2 text-[10px] font-medium uppercase text-text-muted",children:"Rotation"}),["fill-first","round-robin","random","smart"].map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>R(e,S.length>1?S:(t||[]).filter(e=>e.isActive).map(e=>e.id)),disabled:j,className:`w-full px-3 py-1.5 text-left text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===e?"font-medium text-primary":"text-text-main"}`,children:"smart"===e?"Smart (provider/model aware)":e},e)),(0,s.jsx)("p",{className:"px-3 pt-2 text-[10px] font-medium uppercase text-text-muted",children:"Single pool"}),(t||[]).map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>B(e.id),disabled:j||!0!==e.isActive,className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${A===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,s.jsx)(d.Tooltip,{text:_,children:(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(d.Toggle,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}var $=a(28937),E=a.n($);let O=`name1|sk-key1
|
|
2
2
|
name2|sk-key2
|
|
3
|
-
sk-key-only-auto-named`;function D({isOpen:e,provider:t,providerName:a,isCompatible:l,isAnthropic:r,authType:o,authHint:n,website:m,proxyPools:p,error:x,existingNames:u,onSave:h,onBulkDone:f,onClose:g}){let y="__none__",b="ollama-local"===t,v="cookie"===o,j="xai"===t&&!v,w=v?"Cookie Value":"API Key",
|
|
3
|
+
sk-key-only-auto-named`;function D({isOpen:e,provider:t,providerName:a,isCompatible:l,isAnthropic:r,authType:o,authHint:n,website:m,proxyPools:p,error:x,existingNames:u,onSave:h,onBulkDone:f,onClose:g}){let y="__none__",b="ollama-local"===t,v="cookie"===o,j="xai"===t&&!v,w=v?"Cookie Value":"API Key",k="azure"===t,N="cloudflare-ai"===t,S=c.Q2?.[t]?.regions||null,C=c.Q2?.[t]?.defaultRegion||S?.[0]?.id||"",[A,T]=(0,i.useState)({name:"",apiKey:"",priority:1,proxyPoolId:y,ollamaHostUrl:""}),[I,P]=(0,i.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[$,E]=(0,i.useState)({accountId:""}),[_,U]=(0,i.useState)(C),[M,z]=(0,i.useState)(!1),[B,R]=(0,i.useState)(null),[K,L]=(0,i.useState)(!1),F=N?`name1|sk-key1|acc123456
|
|
4
4
|
name2|sk-key2|def789012
|
|
5
|
-
sk-key-only-auto-named`:O,[J,q]=(0,i.useState)("single"),[W,H]=(0,i.useState)(""),[V,G]=(0,i.useState)(null),Q=()=>b&&A.ollamaHostUrl.trim()?{baseUrl:A.ollamaHostUrl.trim()}:N?{azureEndpoint:I.azureEndpoint,apiVersion:I.apiVersion,deployment:I.deployment,organization:I.organization}:k?{accountId:$.accountId}:S&&_?{region:_}:void 0,X=async()=>{z(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:A.apiKey,providerSpecificData:Q()})}),a=await e.json();R(a.valid?"success":"failed")}catch{R("failed")}finally{z(!1)}},Y=async()=>{if(t&&(b||A.apiKey)&&(b||A.name)){L(!0);try{let e=!1;try{z(!0),R(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:A.apiKey,providerSpecificData:Q()})});e=!!(await a.json()).valid,R(e?"success":"failed")}catch{R("failed")}finally{z(!1)}await h({name:A.name||(b?"Ollama Local":""),apiKey:A.apiKey,priority:A.priority,proxyPoolId:A.proxyPoolId===y?null:A.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:Q()})}finally{L(!1)}}},Z=async()=>{let e=W.split("\n");if(!e.length)return;let a=function(e,t,a={}){let{isCloudflareAi:s=!1}=a,i=new Set((Array.isArray(t)?t:[]).map(e=>"string"==typeof e?e.toLowerCase():"")),l=[];for(let t of e){let e,a="string"==typeof t?t.trim():"";if(!a)continue;let r=function(e,t={}){let{isCloudflareAi:a=!1}=t,s=e.split("|");if(a&&s.length>=3){let e=s[0].trim();return{baseName:e||"Key",apiKey:s.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:s[s.length-1].trim()}}}return s.length>=2?{baseName:s[0].trim()||"Key",apiKey:s.slice(1).join("|").trim()}:{baseName:"Key",apiKey:s[0].trim()}}(a,{isCloudflareAi:s});if(!r||!r.apiKey)continue;let o=r.baseName,n=1;for(;e=`${o} ${n}`,i.has(e.toLowerCase());)n+=1;i.add(e.toLowerCase());let d={name:e,apiKey:r.apiKey,skipped:!1};r.providerSpecificData&&(d.providerSpecificData=r.providerSpecificData),l.push(d)}return l}(e,u,{isCloudflareAi:k});if(!a.length)return;L(!0),G(null);let s=0,i=0;for(let e of a)try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey,name:e.name,priority:1,testStatus:"unknown",...e.providerSpecificData?{providerSpecificData:e.providerSpecificData}:{}})})).ok?s++:i++}catch{i++}L(!1),G({success:s,failed:i}),s>0&&f&&f()};return t?(0,s.jsx)(d.Modal,{isOpen:e,title:`Add ${a||t} ${w}`,onClose:g,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{size:"sm",variant:"single"===J?"primary":"ghost",onClick:()=>{q("single"),G(null)},children:"Single"}),(0,s.jsx)(d.Button,{size:"sm",variant:"bulk"===J?"primary":"ghost",onClick:()=>{q("bulk"),G(null)},children:"Bulk Add"})]}),"bulk"===J&&(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:k?(0,s.jsxs)(s.Fragment,{children:["One key per line. Format: ",(0,s.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,s.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):(0,s.jsxs)(s.Fragment,{children:["One key per line. Format: ",(0,s.jsx)("code",{children:"name|apiKey"})," or just ",(0,s.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,s.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:F,value:W,onChange:e=>H(e.target.value)}),V&&(0,s.jsxs)("div",{className:`text-sm font-medium ${V.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",V.success," added",V.failed>0?`, ✗ ${V.failed} failed`:""]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:Z,fullWidth:!0,disabled:K||!W.trim(),children:K?"Adding...":"Add All Keys"}),(0,s.jsx)(d.Button,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===J&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Input,{label:"Name",value:A.name,onChange:e=>T({...A,name:e.target.value}),placeholder:b?"Ollama Local":"Production Key"}),b&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Input,{label:"Ollama Host URL",value:A.ollamaHostUrl,onChange:e=>T({...A,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.Button,{onClick:X,disabled:M||K,variant:"secondary",children:M?"Checking...":"Check"})})]}),!b&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Input,{label:w,type:v?"text":"password",value:A.apiKey,onChange:e=>T({...A,apiKey:e.target.value}),placeholder:v?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":j?"xai-...":"",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.Button,{onClick:X,disabled:!A.apiKey||M||K,variant:"secondary",children:M?"Checking...":"Check"})})]}),j&&(0,s.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."}),v&&n&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:[n,m&&(0,s.jsxs)(s.Fragment,{children:[" ",(0,s.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",m.replace(/^https?:\/\//,"")]})]})]}),S&&(0,s.jsx)(d.Select,{label:"Region",value:_,onChange:e=>U(e.target.value),options:S.map(e=>({value:e.id,label:e.label}))}),b&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,s.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,s.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),B&&(0,s.jsx)(d.Badge,{variant:"success"===B?"success":"error",children:"success"===B?"Valid":"Invalid"}),x&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:x}),k&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,s.jsx)(d.Input,{label:"Account ID",value:$.accountId,onChange:e=>E({...$,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,s.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),N&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)(d.Input,{label:"Azure Endpoint",value:I.azureEndpoint,onChange:e=>P({...I,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,s.jsx)(d.Input,{label:"Deployment Name",value:I.deployment,onChange:e=>P({...I,deployment:e.target.value}),placeholder:"gpt-4"}),(0,s.jsx)(d.Input,{label:"API Version",value:I.apiVersion,onChange:e=>P({...I,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,s.jsx)(d.Input,{label:"Organization",value:I.organization,onChange:e=>P({...I,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,s.jsx)(d.Input,{label:"Priority",type:"number",value:A.priority,onChange:e=>T({...A,priority:Number.parseInt(e.target.value)||1})}),(0,s.jsx)(d.Select,{label:"Proxy Pool",value:A.proxyPoolId,onChange:e=>T({...A,proxyPoolId:e.target.value}),options:[{value:y,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:Y,fullWidth:!0,disabled:K||!b&&(!A.name||!A.apiKey)||N&&(!I.azureEndpoint||!I.deployment||!I.organization)||k&&!$.accountId,children:K?"Saving...":"Save"}),(0,s.jsx)(d.Button,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}D.propTypes={isOpen:E().bool.isRequired,provider:E().string,providerName:E().string,isCompatible:E().bool,isAnthropic:E().bool,authType:E().string,authHint:E().string,website:E().string,proxyPools:E().arrayOf(E().shape({id:E().string,name:E().string})),error:E().string,existingNames:E().arrayOf(E().string),onSave:E().func.isRequired,onBulkDone:E().func,onClose:E().func.isRequired};let _=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function U({isOpen:e,node:t,onSave:a,onClose:l,isAnthropic:r}){let[o,n]=(0,i.useState)(()=>({name:t?.name||"",prefix:t?.prefix||"",apiType:t?.apiType||"chat",baseUrl:t?.baseUrl||(r?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})),[c,m]=(0,i.useState)(!1),[p,x]=(0,i.useState)(""),[u,h]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(null),[v,j]=(0,i.useState)(t);t!==v&&(j(t),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")}));let w=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 a(e)}finally{m(!1)}}},N=async()=>{g(!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{g(!1)}};return t?(0,s.jsx)(d.Modal,{isOpen:e,title:`Edit ${r?"Anthropic":"OpenAI"} Compatible`,onClose:l,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(d.Input,{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,s.jsx)(d.Input,{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,s.jsx)(d.Select,{label:"API Type",options:_,value:o.apiType,onChange:e=>n({...o,apiType:e.target.value})}),(0,s.jsx)(d.Input,{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,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Input,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>x(e.target.value),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.Button,{onClick:N,disabled:!p||f||!o.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,s.jsx)(d.Input,{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."}),y&&(0,s.jsx)(d.Badge,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:w,fullWidth:!0,disabled:!o.name.trim()||!o.prefix.trim()||!o.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,s.jsx)(d.Button,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function M(e,t){switch(t.type){case"RESET":return{modelId:"",testStatus:null,testError:"",saving:!1};case"SET_MODEL":return{...e,modelId:t.value,testStatus:null,testError:""};case"TEST_START":return{...e,testStatus:"testing",testError:""};case"TEST_RESULT":return{...e,testStatus:t.ok?"ok":"error",testError:t.error||""};case"SAVE_START":return{...e,saving:!0};case"SAVE_DONE":return{...e,saving:!1};default:return e}}function z({isOpen:e,providerAlias:t,providerDisplayAlias:a,onSave:l,onClose:r}){let[o,n]=(0,i.useReducer)(M,{modelId:"",testStatus:null,testError:"",saving:!1}),{modelId:c,testStatus:m,testError:p,saving:x}=o,[u,h]=(0,i.useState)(!1);e&&!u?(h(!0),n({type:"RESET"})):!e&&u&&h(!1);let f=e=>{let a=`${t}/`;return e.startsWith(a)?e.slice(a.length):e},g=async()=>{let e=f(c.trim());if(e){n({type:"TEST_START"});try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),s=await a.json();n({type:"TEST_RESULT",ok:s.ok,error:s.error})}catch(e){n({type:"TEST_RESULT",ok:!1,error:e.message})}}},y=async()=>{let e=f(c.trim());if(e&&!x){n({type:"SAVE_START"});try{await l(e)}finally{n({type:"SAVE_DONE"})}}};return(0,s.jsx)(d.Modal,{isOpen:e,onClose:r,title:"Add Custom Model",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"add-custom-model-id",className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{id:"add-custom-model-id",type:"text",value:c,onChange:e=>n({type:"SET_MODEL",value:e.target.value}),onKeyDown:e=>{"Enter"===e.key&&g()},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"}),(0,s.jsx)(d.Button,{variant:"secondary",icon:"science",loading:"testing"===m,onClick:g,disabled:!c.trim()||"testing"===m,children:"testing"===m?"Testing...":"Test"})]}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,s.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:f(c.trim())||"model-id"})]})]}),"ok"===m&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===m&&(0,s.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,s.jsx)("span",{children:p||"Model not reachable"})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(d.Button,{onClick:r,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,s.jsx)(d.Button,{onClick:y,fullWidth:!0,size:"sm",disabled:!c.trim()||x,children:x?"Adding...":"Add Model"})]})]})})}let B=`[
|
|
5
|
+
sk-key-only-auto-named`:"exa"===t?`account-1|exa-key-1
|
|
6
|
+
account-2|exa-key-2
|
|
7
|
+
exa-key-only-auto-named`:O,[J,q]=(0,i.useState)("single"),[W,H]=(0,i.useState)(""),[V,G]=(0,i.useState)(null),Q=()=>b&&A.ollamaHostUrl.trim()?{baseUrl:A.ollamaHostUrl.trim()}:k?{azureEndpoint:I.azureEndpoint,apiVersion:I.apiVersion,deployment:I.deployment,organization:I.organization}:N?{accountId:$.accountId}:S&&_?{region:_}:void 0,X=async()=>{z(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:A.apiKey,providerSpecificData:Q()})}),a=await e.json();R(a.valid?"success":"failed")}catch{R("failed")}finally{z(!1)}},Y=async()=>{if(t&&(b||A.apiKey)&&(b||A.name)){L(!0);try{let e=!1;try{z(!0),R(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:A.apiKey,providerSpecificData:Q()})});e=!!(await a.json()).valid,R(e?"success":"failed")}catch{R("failed")}finally{z(!1)}await h({name:A.name||(b?"Ollama Local":""),apiKey:A.apiKey,priority:A.priority,proxyPoolId:A.proxyPoolId===y?null:A.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:Q()})}finally{L(!1)}}},Z=async()=>{let e=W.split("\n");if(!e.length)return;let a=function(e,t,a={}){let{isCloudflareAi:s=!1}=a,i=new Set((Array.isArray(t)?t:[]).map(e=>"string"==typeof e?e.toLowerCase():"")),l=[];for(let t of e){let e,a="string"==typeof t?t.trim():"";if(!a)continue;let r=function(e,t={}){let{isCloudflareAi:a=!1}=t,s=e.split("|");if(a&&s.length>=3){let e=s[0].trim();return{baseName:e||"Key",apiKey:s.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:s[s.length-1].trim()}}}return s.length>=2?{baseName:s[0].trim()||"Key",apiKey:s.slice(1).join("|").trim()}:{baseName:"Key",apiKey:s[0].trim()}}(a,{isCloudflareAi:s});if(!r||!r.apiKey)continue;let o=r.baseName,n=1;for(;e=`${o} ${n}`,i.has(e.toLowerCase());)n+=1;i.add(e.toLowerCase());let d={name:e,apiKey:r.apiKey,skipped:!1};r.providerSpecificData&&(d.providerSpecificData=r.providerSpecificData),l.push(d)}return l}(e,u,{isCloudflareAi:N});if(!a.length)return;L(!0),G(null);let s=0,i=0;try{let e=await fetch("/api/providers/bulk",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:a.map(e=>({provider:t,apiKey:e.apiKey,name:e.name,priority:1,providerSpecificData:e.providerSpecificData}))})}),l=await e.json();s=Array.isArray(l.results)?l.results.filter(e=>e.ok).length:0,i=a.length-s}catch{i=a.length}L(!1),G({success:s,failed:i}),s>0&&f&&f()};return t?(0,s.jsx)(d.Modal,{isOpen:e,title:`Add ${a||t} ${w}`,onClose:g,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{size:"sm",variant:"single"===J?"primary":"ghost",onClick:()=>{q("single"),G(null)},children:"Single"}),(0,s.jsx)(d.Button,{size:"sm",variant:"bulk"===J?"primary":"ghost",onClick:()=>{q("bulk"),G(null)},children:"Bulk Add"})]}),"bulk"===J&&(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:N?(0,s.jsxs)(s.Fragment,{children:["One key per line. Format: ",(0,s.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,s.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):"exa"===t?(0,s.jsxs)(s.Fragment,{children:["One Exa account per line: ",(0,s.jsx)("code",{children:"name|apiKey"})," or ",(0,s.jsx)("code",{children:"apiKey"}),". Keys are stored without a billable probe; runtime rotates on auth, quota, and rate-limit errors."]}):(0,s.jsxs)(s.Fragment,{children:["One key per line. Format: ",(0,s.jsx)("code",{children:"name|apiKey"})," or just ",(0,s.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,s.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:F,value:W,onChange:e=>H(e.target.value)}),V&&(0,s.jsxs)("div",{className:`text-sm font-medium ${V.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",V.success," added",V.failed>0?`, ✗ ${V.failed} failed`:""]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:Z,fullWidth:!0,disabled:K||!W.trim(),children:K?"Adding...":"Add All Keys"}),(0,s.jsx)(d.Button,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===J&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Input,{label:"Name",value:A.name,onChange:e=>T({...A,name:e.target.value}),placeholder:b?"Ollama Local":"Production Key"}),b&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Input,{label:"Ollama Host URL",value:A.ollamaHostUrl,onChange:e=>T({...A,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.Button,{onClick:X,disabled:M||K,variant:"secondary",children:M?"Checking...":"Check"})})]}),!b&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Input,{label:w,type:v?"text":"password",value:A.apiKey,onChange:e=>T({...A,apiKey:e.target.value}),placeholder:v?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":j?"xai-...":"",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.Button,{onClick:X,disabled:!A.apiKey||M||K,variant:"secondary",children:M?"Checking...":"Check"})})]}),j&&(0,s.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."}),v&&n&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:[n,m&&(0,s.jsxs)(s.Fragment,{children:[" ",(0,s.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",m.replace(/^https?:\/\//,"")]})]})]}),S&&(0,s.jsx)(d.Select,{label:"Region",value:_,onChange:e=>U(e.target.value),options:S.map(e=>({value:e.id,label:e.label}))}),b&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,s.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,s.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),B&&(0,s.jsx)(d.Badge,{variant:"success"===B?"success":"error",children:"success"===B?"Valid":"Invalid"}),x&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:x}),N&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,s.jsx)(d.Input,{label:"Account ID",value:$.accountId,onChange:e=>E({...$,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,s.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),k&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)(d.Input,{label:"Azure Endpoint",value:I.azureEndpoint,onChange:e=>P({...I,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,s.jsx)(d.Input,{label:"Deployment Name",value:I.deployment,onChange:e=>P({...I,deployment:e.target.value}),placeholder:"gpt-4"}),(0,s.jsx)(d.Input,{label:"API Version",value:I.apiVersion,onChange:e=>P({...I,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,s.jsx)(d.Input,{label:"Organization",value:I.organization,onChange:e=>P({...I,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,s.jsx)(d.Input,{label:"Priority",type:"number",value:A.priority,onChange:e=>T({...A,priority:Number.parseInt(e.target.value)||1})}),(0,s.jsx)(d.Select,{label:"Proxy Pool",value:A.proxyPoolId,onChange:e=>T({...A,proxyPoolId:e.target.value}),options:[{value:y,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:Y,fullWidth:!0,disabled:K||!b&&(!A.name||!A.apiKey)||k&&(!I.azureEndpoint||!I.deployment||!I.organization)||N&&!$.accountId,children:K?"Saving...":"Save"}),(0,s.jsx)(d.Button,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}D.propTypes={isOpen:E().bool.isRequired,provider:E().string,providerName:E().string,isCompatible:E().bool,isAnthropic:E().bool,authType:E().string,authHint:E().string,website:E().string,proxyPools:E().arrayOf(E().shape({id:E().string,name:E().string})),error:E().string,existingNames:E().arrayOf(E().string),onSave:E().func.isRequired,onBulkDone:E().func,onClose:E().func.isRequired};let _=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function U({isOpen:e,node:t,onSave:a,onClose:l,isAnthropic:r}){let[o,n]=(0,i.useState)(()=>({name:t?.name||"",prefix:t?.prefix||"",apiType:t?.apiType||"chat",baseUrl:t?.baseUrl||(r?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})),[c,m]=(0,i.useState)(!1),[p,x]=(0,i.useState)(""),[u,h]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(null),[v,j]=(0,i.useState)(t);t!==v&&(j(t),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")}));let w=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 a(e)}finally{m(!1)}}},k=async()=>{g(!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{g(!1)}};return t?(0,s.jsx)(d.Modal,{isOpen:e,title:`Edit ${r?"Anthropic":"OpenAI"} Compatible`,onClose:l,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(d.Input,{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,s.jsx)(d.Input,{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,s.jsx)(d.Select,{label:"API Type",options:_,value:o.apiType,onChange:e=>n({...o,apiType:e.target.value})}),(0,s.jsx)(d.Input,{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,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Input,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>x(e.target.value),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.Button,{onClick:k,disabled:!p||f||!o.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,s.jsx)(d.Input,{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."}),y&&(0,s.jsx)(d.Badge,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:w,fullWidth:!0,disabled:!o.name.trim()||!o.prefix.trim()||!o.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,s.jsx)(d.Button,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function M(e,t){switch(t.type){case"RESET":return{modelId:"",testStatus:null,testError:"",saving:!1};case"SET_MODEL":return{...e,modelId:t.value,testStatus:null,testError:""};case"TEST_START":return{...e,testStatus:"testing",testError:""};case"TEST_RESULT":return{...e,testStatus:t.ok?"ok":"error",testError:t.error||""};case"SAVE_START":return{...e,saving:!0};case"SAVE_DONE":return{...e,saving:!1};default:return e}}function z({isOpen:e,providerAlias:t,providerDisplayAlias:a,onSave:l,onClose:r}){let[o,n]=(0,i.useReducer)(M,{modelId:"",testStatus:null,testError:"",saving:!1}),{modelId:c,testStatus:m,testError:p,saving:x}=o,[u,h]=(0,i.useState)(!1);e&&!u?(h(!0),n({type:"RESET"})):!e&&u&&h(!1);let f=e=>{let a=`${t}/`;return e.startsWith(a)?e.slice(a.length):e},g=async()=>{let e=f(c.trim());if(e){n({type:"TEST_START"});try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),s=await a.json();n({type:"TEST_RESULT",ok:s.ok,error:s.error})}catch(e){n({type:"TEST_RESULT",ok:!1,error:e.message})}}},y=async()=>{let e=f(c.trim());if(e&&!x){n({type:"SAVE_START"});try{await l(e)}finally{n({type:"SAVE_DONE"})}}};return(0,s.jsx)(d.Modal,{isOpen:e,onClose:r,title:"Add Custom Model",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"add-custom-model-id",className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{id:"add-custom-model-id",type:"text",value:c,onChange:e=>n({type:"SET_MODEL",value:e.target.value}),onKeyDown:e=>{"Enter"===e.key&&g()},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"}),(0,s.jsx)(d.Button,{variant:"secondary",icon:"science",loading:"testing"===m,onClick:g,disabled:!c.trim()||"testing"===m,children:"testing"===m?"Testing...":"Test"})]}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,s.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:f(c.trim())||"model-id"})]})]}),"ok"===m&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===m&&(0,s.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,s.jsx)("span",{children:p||"Model not reachable"})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(d.Button,{onClick:r,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,s.jsx)(d.Button,{onClick:y,fullWidth:!0,size:"sm",disabled:!c.trim()||x,children:x?"Adding...":"Add Model"})]})]})})}let B=`[
|
|
6
8
|
{
|
|
7
9
|
"accessToken": "eyJhbGc...",
|
|
8
10
|
"refreshToken": "rt_...",
|
|
9
11
|
"idToken": "eyJhbGc...",
|
|
10
12
|
"email": "user@example.com"
|
|
11
13
|
}
|
|
12
|
-
]`;function R({isOpen:e,onClose:t,onSuccess:a}){let[l,r]=(0,i.useState)(""),[o,n]=(0,i.useState)(!1),[c,m]=(0,i.useState)(""),[p,x]=(0,i.useState)(null),u=()=>{o||(r(""),m(""),x(null),t())},h=async()=>{var e;let t;m(""),x(null);let s=l.trim();if(!s)return;try{t=JSON.parse(s)}catch(e){m(`${(0,j.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,j.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 a&&a()}catch(e){m(e.message||(0,j.Tl)("Request failed"))}finally{n(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,s.jsx)(d.Modal,{isOpen:e,title:(0,j.Tl)("Bulk Add Codex Accounts"),onClose:u,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:(0,j.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,s.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:B,value:l,onChange:e=>r(e.target.value),disabled:o}),c&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,j.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,j.Tl)("failed")}`:""]}),f.length>0&&(0,s.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,s.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:h,fullWidth:!0,disabled:o||!l.trim(),children:o?(0,j.Tl)("Importing..."):(0,j.Tl)("Import All")}),(0,s.jsx)(d.Button,{onClick:u,variant:"ghost",fullWidth:!0,disabled:o,children:(0,j.Tl)("Close")})]})]})})}let K={claude:"claudeAutoPing",codex:"codexAutoPing"};function L(){let e,t,a,r,p=(0,l.useParams)(),x=(0,l.useRouter)(),u=p.id,{getCaps:h}=(0,v.y)(),[f,g]=(0,i.useState)([]),[w,C]=(0,i.useState)(!0),[T,I]=(0,i.useState)(null),[$,E]=(0,i.useState)([]),[O,_]=(0,i.useState)(!1),[M,B]=(0,i.useState)(!1),[L,F]=(0,i.useState)(!1),[J,q]=(0,i.useState)(""),[W,H]=(0,i.useState)(!1),[V,G]=(0,i.useState)(!1),[Q,X]=(0,i.useState)(!1),[Y,Z]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(null),[ea,es]=(0,i.useState)({}),[ei,el]=(0,i.useState)([]),[er,eo]=(0,i.useState)(!1),[en,ed]=(0,i.useState)({}),[ec,em]=(0,i.useState)(""),[ep,ex]=(0,i.useState)(()=>new Set),[eu,eh]=(0,i.useState)(!1),[ef,eg]=(0,i.useState)([]),[ey,eb]=(0,i.useState)(1),[ev,ej]=(0,i.useState)("__none__"),[ew,eN]=(0,i.useState)(!1),[ek,eS]=(0,i.useState)(null),[eC,eA]=(0,i.useState)(""),[eT,eI]=(0,i.useState)(!1),[eP,e$]=(0,i.useState)("auto"),[eE,eO]=(0,i.useState)({enabled:!1,connections:{}}),[eD,e_]=(0,i.useState)([]),[eU,eM]=(0,i.useState)([]),[ez,eB]=(0,i.useState)([]),[eR,eK]=(0,i.useState)([]),[eL,eF]=(0,i.useState)(null),[eJ,eq]=(0,i.useState)(!1),[eW,eH]=(0,i.useState)(!1),[eV,eG]=(0,i.useState)(!1),[eQ,eX]=(0,i.useState)(null),[eY,eZ]=(0,i.useState)({}),[e0,e1]=(0,i.useState)(null),e2=(0,i.useRef)(!1),[e5,e3]=(0,i.useState)(!1),{copied:e4,copy:e6}=(0,b.C)(),e8="ag_risk_confirmed",e7=()=>{_(!0)},e9=()=>{"antigravity"===u&&"true"!==window.localStorage.getItem(e8)?eq(!0):ti?e7():(q(""),F(!0))},te=()=>{q(""),F(!0)},tt=()=>{ti?e9():te()},ta=T?{id:T.id,name:T.name||("anthropic-compatible"===T.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===T.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===T.type?"AC":"OC",apiType:T.apiType,baseUrl:T.baseUrl,type:T.type}:c.zN[u]||c.fg[u]||c.IS[u]||c.nJ[u]||c.br[u],ts=ta?.authModes||[],ti=!!c.zN[u]||!!c.IS[u]||ts.includes("oauth"),tl=!!c.fg[u]||ts.includes("apikey"),tr=!!c.IS[u]?.noAuth,to=(0,m.KC)(u),tn="cursor"===u&&eU.length>0?eU:to,td=(0,c.wG)(u),tc=(0,c.mq)(u),tm=(0,c.gb)(u),tp=tc||tm,tx=!tp&&ti&&tl,tu="xai"===u?"Grok Build OAuth":"grok-cli"===u?"Grok CLI Device Login":"kimi"===u?"Kimi Coding OAuth":"OAuth",th="xai"===u?"xAI API Key":"kimi"===u?"Kimi API Key":"qoder"===u?"PAT":"API Key",tf=e=>{if(!eP||"auto"===eP)return null;let t=y(u,e);return t&&t.includes(eP)?eP:null},tg=tp?u:td,ty=(e=new Map,t=t=>{t?.id&&!e.has(t.id)&&e.set(t.id,t)},tn.forEach(t),ei.forEach(e=>{e.providerAlias===tg&&"llm"===(e.kind||e.type||"llm")&&t(e)}),a=new Set(eR),[...e.values()].filter(e=>!a.has(e.id))),tb=(()=>{let e=new Set,t=new Set,a=a=>{if(!a||t.has(a))return;t.add(a);let s=y(u,a);s&&s.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tn)a(e.id);for(let e of ez)a(e.id);for(let e of ei)e.providerAlias===tg&&"llm"===(e.kind||e.type||"llm")&&a(e.id);return e.size?["auto",...e]:null})(),tv=tp?T?.prefix||u:td,tj=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tg)}`,{cache:"no-store"}),t=await e.json();e.ok&&eK(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tg]),tw=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tg,ids:[e]})})).ok&&await tj()}catch(e){console.log("Error disabling model:",e)}},tN=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tg)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tj()}catch(e){console.log("Error enabling model:",e)}},tk=async e=>{e.length&&eF({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eF(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tg,ids:e})})).ok&&await tj()}catch(e){console.log("Error disabling all models:",e)}}})},tS=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tg)}`,{method:"DELETE"})).ok&&await tj()}catch(e){console.log("Error enabling all models:",e)}},tC=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&es(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tA=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&el(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===u&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eB(e.models)}).catch(()=>{})},[u]);let tT=(0,i.useCallback)(async()=>{try{let[e,t,a,s]=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(),r=await a.json(),o=s.ok?await s.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===u);g(e)}a.ok&&E(r.proxyPools||[]);let n=(o.providerStrategies||{})[u]||{};eS(n.fallbackStrategy||null),eA(null!=n.stickyRoundRobinLimit?String(n.stickyRoundRobinLimit):"1"),eI(!0===n.strictModelAssignment);let d=(o.providerThinking||{})[u]||{};e$(d.mode||"auto");let c=K[u],m=c&&o[c]||{};if(eO({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===u)||null;if(!e&&tp)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===u)||null))break}I(e)}}catch(e){console.log("Error fetching connections:",e)}finally{C(!1)}},[u,tp]),tI=async e=>{try{let t=await fetch(`/api/provider-nodes/${u}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();t.ok&&(I(a.node),await tT(),X(!1))}catch(e){console.log("Error updating provider node:",e)}},tP=async(e,t)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),s=(a.ok?await a.json():{}).providerStrategies||{},i={...s[u]||{}};e?i.fallbackStrategy=e:(delete i.fallbackStrategy,delete i.stickyRoundRobinLimit),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...s};0===Object.keys(i).length?delete l[u]:l[u]=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)}},t$=async e=>{eI(e);try{let t=await fetch("/api/settings",{cache:"no-store"}),a=(t.ok?await t.json():{}).providerStrategies||{};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:{...a,[u]:{...a[u]||{},strictModelAssignment:e}}})})}catch(e){console.log("Error saving Freebuff strict assignment:",e)}},tE=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSpecificData:{assignedModel:t||null}})})).ok&&g(a=>a.map(a=>a.id===e?{...a,providerSpecificData:{...a.providerSpecificData||{},assignedModel:t||null}}:a))}catch(e){console.log("Error saving Freebuff model assignment:",e)}},tO=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?a[u]={mode:e}:delete a[u],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:a})})}catch(e){console.log("Error saving thinking config:",e)}},tD=async e=>{let t=K[u];if(t){eO(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,i.useEffect)(()=>{tT(),tC(),tA(),tj()},[tT,tC,tA,tj]),(0,i.useEffect)(()=>{if("cursor"!==u)return void eM([]);let e=f.find(e=>!1!==e.isActive);if(!e?.id)return void eM([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json()})).then(({ok:e,data:a})=>{!t&&e&&Array.isArray(a.models)&&a.models.length>0&&eM(a.models)}).catch(()=>{}),()=>{t=!0}},[u,f]),(0,i.useEffect)(()=>{let e=(c.zN[u]||c.fg[u]||c.IS[u]||c.nJ[u])?.modelsFetcher;e&&N(e).then(e_)},[u]);let t_=async(e,t,a=td)=>{let s=`${a}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})});if(e.ok)await tC();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tU=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tC()}catch(e){console.log("Error deleting alias:",e)}},tM=async(e,t="llm",a=tg)=>{try{let s=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:a,id:e,type:t})});if(s.ok)await tA(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await s.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tz=async(e,t="llm",a=tg)=>{try{let s=new URLSearchParams({providerAlias:a,id:e,type:t});(await fetch(`/api/models/custom?${s}`,{method:"DELETE"})).ok&&(await tA(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tB=async()=>{if(e5)return;let e=f.find(e=>!1!==e.isActive);if(!e)return void alert((0,j.Tl)("Please add an active Qoder connection first"));e3(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||(0,j.Tl)("Failed to fetch models"));let s=a.models||[];if(0===s.length)return void alert((0,j.Tl)("No models returned"));let i=0;for(let e of s){let t=e.id||e.name;if(!t)continue;let a=t.replace(/^qoder\//,"");ei.some(e=>e.providerAlias===tg&&e.id===a&&"llm"===(e.kind||e.type||"llm"))||Object.values(ea).includes(`${tg}/${a}`)||(await tM(a,"llm",tg),i+=1)}0===i?alert((0,j.Tl)("All models already exist, no new models added")):alert((0,j.Tl)("Successfully added")+` ${i} `+(0,j.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,j.Tl)("Error fetching models")+": "+e.message)}finally{e3(!1)}},tR=async()=>{if(eW||0===f.length)return;let e=Object.fromEntries(f.map(e=>[e.id,{state:"queued",error:null}]));e2.current=!1,eH(!0),eG(!1),eX(null),eZ(e),e1({total:f.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,a=0;try{for(let e=0;e<f.length;e+=1){if(e2.current){e1({total:f.length,completed:e,passed:t,failed:a,stopped:!0});break}let s=f[e];eX(s.id),eZ(e=>({...e,[s.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${s.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:a+=1,eZ(e=>({...e,[s.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){a+=1,eZ(t=>({...t,[s.id]:{state:"failed",error:e.message||"Test failed"}}))}e1({total:f.length,completed:e+1,passed:t,failed:a,stopped:!1}),e<f.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eX(null),eH(!1),eG(!1),e2.current=!1}},tK=async e=>{eF({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eF(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&g(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tL=()=>{tT(),_(!1)},tF=async e=>{q("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:u,...e})}),a=null;try{a=await t.json()}catch{a=null}if(t.ok){await tT(),F(!1);return}q(a?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),q("Failed to save connection")}},tJ=async e=>{try{(await fetch(`/api/providers/${ee.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tT(),G(!1))}catch(e){console.log("Error updating connection:",e)}},tq=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&g(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("Error updating connection status:",e)}},tW=async(e,t)=>{let a=[...f];[a[e],a[t]]=[a[t],a[e]],g(a);try{await Promise.all([fetch(`/api/providers/${a[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${a[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tT()}},tH=f.filter(e=>ef.includes(e.id)),{currentPage:tV,totalPages:tG,items:tQ,start:tX}=function(e=[],t=1){let a=Array.isArray(e)?e:[],s=a.length,i=Math.max(1,Math.ceil(s/10)),l=Math.floor(Number(t)),r=Math.min(Number.isFinite(l)&&l>0?l:1,i),o=(r-1)*10,n=a.slice(o,o+10);return{currentPage:r,totalPages:i,totalItems:s,start:o,items:n,pageSize:10}}(f,ey),tY=f.length>0&&ef.length===f.length;(0,i.useEffect)(()=>{eg(e=>e.filter(e=>f.some(t=>t.id===e)))},[f]);let tZ=(()=>{if(0===tH.length)return"";let e=new Set(tH.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return"All selected currently unbound";let a=$.find(e=>e.id===t);return`All selected currently bound to ${a?.name||t}`}return"Selected connections have mixed proxy bindings"})(),t0=()=>{ew||Z(!1)},t1=async(e,t)=>{let a=await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw Error((await a.json().catch(()=>({}))).error||`Proxy update failed (${a.status})`);return a.json()},t2=async e=>{eN(!0);try{let t=[];for(let{connectionId:a,proxyPoolId:s,proxyPoolIds:i,proxyRotationStrategy:l}of e)try{let e=i?{proxyPoolIds:i,proxyRotationStrategy:l}:{proxyPoolId:s};await t1(a,e)}catch(e){console.log("Error applying proxy for",a,e),t.push(a)}if(await tT(),t.length>0)return void alert(`Updated with ${t.length} failed request(s). Retry the selected connections.`);Z(!1),eg([]),ej("__none__")}finally{eN(!1)}},t5=e=>t2((ef.length>0?tH:f).map(t=>({connectionId:t.id,proxyPoolId:e}))),t3=(0,s.jsxs)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:[tQ.map((e,t)=>{let a,i=tX+t;return(0,s.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,s.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,s.jsx)("input",{type:"checkbox",checked:(a=e.id,ef.includes(a)),onChange:()=>{var t;return t=e.id,void eg(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,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsx)(P,{connection:e,proxyPools:$,isOAuth:ti,isFirst:0===i,isLast:i===f.length-1,onMoveUp:()=>tW(i,i-1),onMoveDown:()=>tW(i,i+1),onToggleActive:t=>tq(e.id,t),autoPing:K[u]&&"oauth"===e.authType?{on:!0===eE.connections[e.id],onToggle:t=>{var a;return a=e.id,void tD({...eE,connections:{...eE.connections,[a]:t}})},provider:u}:null,onUpdateProxy:async t=>{try{let a="object"==typeof t?t:{proxyPoolId:t||null};if((await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok){let t={...e.providerSpecificData};a.proxyPoolIds?(t.proxyPoolIds=a.proxyPoolIds,t.proxyRotationStrategy=a.proxyRotationStrategy,delete t.proxyPoolId):(a.proxyPoolId?t.proxyPoolId=a.proxyPoolId:delete t.proxyPoolId,delete t.proxyPoolIds,delete t.proxyRotationStrategy),g(a=>a.map(a=>a.id===e.id?{...a,providerSpecificData:t}:a))}}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{et(e),G(!0)},onDelete:()=>tK(e.id),oneByOneStatus:eY[e.id]||null,modelAssignmentOptions:"freebuff"===u?ty:null,onModelAssignmentChange:"freebuff"===u?t=>tE(e.id,t):null,strictModelAssignment:eT})})]},e.id)}),f.length>10&&(0,s.jsx)(d.Pagination,{currentPage:tV,pageSize:10,totalItems:f.length,onPageChange:eb})]}),t4=$.filter(e=>!0===e.isActive),t6=(0,s.jsx)(d.Modal,{isOpen:Y,onClose:t0,title:ef.length>0?`Apply Proxy (${ef.length} selected)`:`Apply Proxy (All ${f.length} connections)`,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[tZ&&(0,s.jsx)("p",{className:"text-xs text-text-muted bg-surface-2 px-3 py-2 rounded-lg border border-border/50",children:tZ}),(0,s.jsxs)("div",{className:"flex flex-col divide-y divide-border/30 border border-border/50 rounded-xl overflow-hidden bg-surface",children:[(0,s.jsxs)("div",{className:"p-3 flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"px-3 pb-1 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Dynamic Strategies"}),(0,s.jsxs)("button",{type:"button",onClick:()=>{let e=$.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):t2((ef.length>0?tH:f).map((t,a)=>({connectionId:t.id,proxyPoolId:e[a%e.length].id})))},disabled:ew||0===t4.length,className:"flex items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"sync_alt"}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-text-main",children:"One-to-one (rotate)"}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted mt-0.5",children:"Distribute active proxy pools round-robin"})]})]}),["fill-first","round-robin","random","smart"].map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{let t;return(t=t4.map(e=>e.id).filter(e=>$.find(t=>t.id===e)?.isActive===!0)).length?t2((ef.length>0?tH:f).map(a=>({connectionId:a.id,proxyPoolIds:t,proxyRotationStrategy:e}))):void alert("No active proxy pools selected.")},disabled:ew||0===t4.length,className:"flex items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"autorenew"}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)("span",{className:"text-sm font-medium text-text-main capitalize",children:[e," strategy"]}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted mt-0.5",children:"smart"===e?"Bypass pools marked unfit for provider/model":`Rotate over all active pools using ${e}`})]})]},e))]}),(0,s.jsxs)("div",{className:"p-3 flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"px-3 pb-1 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Static Assignment"}),(0,s.jsxs)("button",{type:"button",onClick:()=>t5(null),disabled:ew,className:"flex items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"link_off"}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-text-main",children:"None (unbind all)"}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted mt-0.5",children:"Direct routing without proxy"})]})]}),$.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>t5(e.id),disabled:ew||!0!==e.isActive,className:"flex items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"lan"}),(0,s.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"truncate text-sm font-medium text-text-main",children:e.name}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted truncate mt-0.5",children:e.proxyUrl})]}),!0!==e.isActive&&(0,s.jsx)(d.Badge,{variant:"secondary",size:"sm",className:"ml-auto shrink-0",children:"inactive"})]},e.id))]})]}),ew&&(0,s.jsx)("p",{className:"text-xs text-text-muted animate-pulse px-1",children:"Applying proxy configuration..."}),(0,s.jsx)(d.Button,{onClick:t0,variant:"ghost",fullWidth:!0,disabled:ew,children:"Cancel"})]})}),t8=async e=>{if(!ep.has(e)){ex(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:`${tg}/${e}`})}),a=await t.json();ed(t=>({...t,[e]:a.ok?"ok":"error"})),em(a.ok?"":a.error||"Model not reachable")}catch{ed(t=>({...t,[e]:"error"})),em("Network error")}finally{ex(t=>{let a=new Set(t);return a.delete(e),a})}}};return w?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(d.CardSkeleton,{}),(0,s.jsx)(d.CardSkeleton,{})]}):ta?(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,s.jsx)(n.A,{providerId:ta.id,size:48,alt:ta.name,className:"shrink-0 rounded-lg",fallbackText:ta.textIcon||ta.id.slice(0,2).toUpperCase(),fallbackColor:ta.color}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:ta.name}),(ta.notice?.apiKeyUrl||ta.notice?.signupUrl||ta.website)&&(0,s.jsxs)("a",{href:ta.notice?.apiKeyUrl||ta.notice?.signupUrl||ta.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),ta.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,s.jsxs)("p",{className:"text-text-muted",children:[f.length," connection",1===f.length?"":"s"]})]})]})]}),ta.deprecated&&(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,s.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:ta.deprecationNotice})]}),ta.notice?.text&&!ta.deprecated&&(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:ta.notice.text}),ta.notice.apiKeyUrl&&(0,s.jsx)("a",{href:ta.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 →"})]}),tp&&T&&(0,s.jsx)(d.Card,{children:(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:tm?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,s.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tm?"Messages API":"responses"===T.apiType?"Responses API":"Chat Completions"," \xb7 ",(T.baseUrl||"").replace(/\/$/,""),"/",tm?"messages":"responses"===T.apiType?"responses":"chat/completions"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:()=>{q(""),F(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>X(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eF({title:"Delete Compatible Node",message:`Delete this ${tm?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eF(null);try{(await fetch(`/api/provider-nodes/${u}`,{method:"DELETE"})).ok&&x.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tr?(0,s.jsx)(d.NoAuthProxyCard,{providerId:u}):(0,s.jsxs)(d.Card,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[f.length>0&&$.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>Z(!0),children:"Apply Proxy"}),f.length>0&&(0,s.jsxs)(s.Fragment,{children:[ef.length>0&&(0,s.jsxs)(d.Button,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=ef.length;0!==e&&eF({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eF(null);let e=0,t=[...ef];for(let a of t)try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}g(e=>e.filter(e=>!t.includes(e.id))),eg([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",ef.length,")"]}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"sync",onClick:tR,disabled:eW,children:eW?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eW&&(0,s.jsx)(d.Button,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eW&&(e2.current=!0,eG(!0))},disabled:eV,children:eV?"Stopping...":"Stop"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(d.Toggle,{checked:"round-robin"===ek,onChange:e=>{let t=e?"round-robin":null,a=e?eC||"1":eC;e&&!eC&&eA("1"),eS(t),tP(t,a)}}),"round-robin"===ek&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:eC,onChange:e=>{var t;eA(t=e.target.value),tP("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"})]})]}),"freebuff"===u&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t border-black/[0.03] pt-2 dark:border-white/[0.03]",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Strict Model Assignment"}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted",children:"Only assigned accounts can serve each Freebuff model."})]}),(0,s.jsx)(d.Toggle,{checked:eT,onChange:t$})]})]})]}),0===f.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:ti?"lock":"key"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tx&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tu," or ",th,"."]})]})]}),(0,s.jsx)("div",{className:"flex gap-2",children:tx?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Button,{size:"sm",icon:"lock",variant:"secondary",onClick:e9,children:tu}),(0,s.jsx)(d.Button,{size:"sm",icon:"key",onClick:te,children:th})]}):(0,s.jsxs)(s.Fragment,{children:[!tp&&"iflow"===u&&(0,s.jsx)(d.Button,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>B(!0),children:"Cookie"}),"codex"===u&&(0,s.jsx)(d.Button,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>H(!0),children:(0,j.Tl)("Bulk Add")}),(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:tt,children:tp?"Add API Key":"iflow"===u?"OAuth":"Add Connection"})]})})]}):(0,s.jsxs)(s.Fragment,{children:[e0&&(0,s.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,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("span",{children:["Total: ",e0.total]}),(0,s.jsxs)("span",{children:["Completed: ",e0.completed]}),(0,s.jsxs)("span",{children:["Passed: ",e0.passed]}),(0,s.jsxs)("span",{children:["Failed: ",e0.failed]}),e0.stopped&&(0,s.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eW&&eQ&&(0,s.jsxs)("span",{children:["Running: ",f.find(e=>e.id===eQ)?.name||eQ]})]})}),f.length>0&&(0,s.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,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,s.jsx)("input",{type:"checkbox",checked:tY,onChange:()=>{tY?eg([]):eg(f.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),t3,!tp&&(0,s.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===u&&(0,s.jsx)(d.Button,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>B(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===u&&(0,s.jsx)(d.Button,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>H(!0),title:(0,j.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,j.Tl)("Bulk Add")}),tx?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Button,{size:"sm",icon:"lock",variant:"secondary",onClick:e9,className:"w-full sm:w-auto",children:tu}),(0,s.jsx)(d.Button,{size:"sm",icon:"key",onClick:te,className:"w-full sm:w-auto",children:th})]}):(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:tt,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,s.jsxs)(d.Card,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tb&&(0,s.jsx)("select",{value:eP,onChange:e=>{var t;e$(t=e.target.value),tO(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tb.map(e=>(0,s.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tp&&(r=[...tn,...ez.filter(e=>!tn.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eR.includes(e)),(0,s.jsxs)("div",{className:"flex gap-2",children:[eR.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tS,children:"Active All"}),r.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tk(r),children:"Disable All"})]}))]}),!!ec&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:ec}),(()=>{let e,t,a;if(tp)return(0,s.jsx)(A,{providerStorageAlias:tg,providerDisplayAlias:tv,modelAliases:ea,customModels:ei,copied:e4,onCopy:e6,onSetAlias:t_,onDeleteAlias:tU,onAddCustomModel:e=>tM(e,"llm",tg),onDeleteCustomModel:e=>tz(e,"llm",tg),connections:f,isAnthropic:tm});let i=[...tn,...ez.filter(e=>!tn.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),l=new Set(eR),r=i.filter(e=>!l.has(e.id)),o=i.filter(e=>l.has(e.id)),n=k({customModels:ei,modelAliases:ea,providerAlias:tg,builtInModels:tn,type:"llm"});return(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[n.map(e=>(0,s.jsx)(S,{model:{id:e.id,name:e.name},fullModel:`${tv}/${e.id}`,alias:e.alias,copied:e4,onCopy:e6,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tz(e.id,"llm",tg):tU(e.alias)},testStatus:en[e.id],onTest:f.length>0||tr?()=>t8(e.id):void 0,isTesting:ep.has(e.id),isCustom:!0,isFree:!1,caps:h(`${u}/${e.id}`),thinkingSuffix:tf(e.id)},`${e.source}-${e.fullModel}`)),r.map(e=>{let t=`${tg}/${e.id}`,a=`${u}/${e.id}`,i=Object.entries(ea).find(([,e])=>e===t||e===a)?.[0];return(0,s.jsx)(S,{model:e,fullModel:`${tv}/${e.id}`,alias:i,copied:e4,onCopy:e6,onSetAlias:t=>t_(e.id,t,tg),onDeleteAlias:()=>tU(i),testStatus:en[e.id],onTest:f.length>0||tr?()=>t8(e.id):void 0,isTesting:ep.has(e.id),isFree:e.isFree,onDisable:()=>tw(e.id),caps:h(`${u}/${e.id}`),thinkingSuffix:tf(e.id)},e.id)}),(0,s.jsxs)("button",{onClick:()=>eh(!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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===u&&f.some(e=>!1!==e.isActive)&&(0,s.jsxs)("button",{onClick:tB,disabled:e5,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,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:e5?{animation:"spin 1s linear infinite"}:void 0,children:e5?"progress_activity":"download"}),e5?(0,j.Tl)("Fetching..."):(0,j.Tl)("Fetch Qoder Models")]}),eD.length>0&&(e=new Set([...Object.values(ea),...n.map(e=>e.fullModel)]),t=new Set(tn.map(e=>e.id)),0===(a=eD.filter(a=>!e.has(`${tg}/${a.id}`)&&!t.has(a.id))).length?null:(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>(0,s.jsxs)("button",{onClick:async()=>{await tM(e.id,"llm",tg)},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,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),t6,"kiro"===u?(0,s.jsx)(d.KiroOAuthWrapper,{isOpen:O,providerInfo:ta,onSuccess:tL,onClose:()=>_(!1)}):"cursor"===u?(0,s.jsx)(d.CursorAuthModal,{isOpen:O,onSuccess:tL,onClose:()=>_(!1)}):"gitlab"===u?(0,s.jsx)(d.GitLabAuthModal,{isOpen:O,providerInfo:ta,onSuccess:tL,onClose:()=>_(!1)}):(0,s.jsx)(d.OAuthModal,{isOpen:O,provider:u,providerInfo:ta,onSuccess:tL,onClose:()=>_(!1)}),"iflow"===u&&(0,s.jsx)(d.IFlowCookieModal,{isOpen:M,onSuccess:()=>{tT(),B(!1)},onClose:()=>B(!1)}),(0,s.jsx)(D,{isOpen:L,provider:u,providerName:ta.name,isCompatible:tp,isAnthropic:tm,authType:ta?.authType,authHint:ta?.authHint,website:ta?.website,proxyPools:$,error:J,existingNames:f.map(e=>e.name).filter(Boolean),onSave:tF,onBulkDone:tT,onClose:()=>{q(""),F(!1)}}),(0,s.jsx)(d.EditConnectionModal,{isOpen:V,connection:ee,proxyPools:$,onSave:tJ,onClose:()=>G(!1)}),tp&&(0,s.jsx)(U,{isOpen:Q,node:T,onSave:tI,onClose:()=>X(!1),isAnthropic:tm}),!tp&&(0,s.jsx)(z,{isOpen:eu,providerAlias:tg,providerDisplayAlias:tv,onSave:async e=>{await tM(e,"llm",tg),eh(!1)},onClose:()=>eh(!1)}),"codex"===u&&(0,s.jsx)(R,{isOpen:W,onClose:()=>H(!1),onSuccess:tT}),(0,s.jsx)(d.ConfirmModal,{isOpen:eJ,onClose:()=>eq(!1),onConfirm:()=>{(window.localStorage.setItem(e8,"true"),eq(!1),ti)?e7():te()},title:"Risk Notice",message:ta?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,s.jsx)(d.ConfirmModal,{isOpen:!!eL,onClose:()=>eF(null),onConfirm:eL?.onConfirm,title:eL?.title||"Confirm",message:eL?.message,variant:"danger"})]}):(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,s.jsx)(o(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},21863:(e,t,a)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}function i(e){let t=e?.testStatus;return e?.isActive===!1||"unavailable"===t||"error"===t||"expired"===t?"unavailable":"active"}a.d(t,{d:()=>i,g:()=>s})},68810:(e,t,a)=>{Promise.resolve().then(a.bind(a,6))}},e=>{e.O(0,[3885,2318,4385,2940,7236,5479,2147,3204,7358],()=>e(e.s=68810)),_N_E=e.O()}]);
|
|
14
|
+
]`;function R({isOpen:e,onClose:t,onSuccess:a}){let[l,r]=(0,i.useState)(""),[o,n]=(0,i.useState)(!1),[c,m]=(0,i.useState)(""),[p,x]=(0,i.useState)(null),u=()=>{o||(r(""),m(""),x(null),t())},h=async()=>{var e;let t;m(""),x(null);let s=l.trim();if(!s)return;try{t=JSON.parse(s)}catch(e){m(`${(0,j.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,j.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 a&&a()}catch(e){m(e.message||(0,j.Tl)("Request failed"))}finally{n(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,s.jsx)(d.Modal,{isOpen:e,title:(0,j.Tl)("Bulk Add Codex Accounts"),onClose:u,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:(0,j.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,s.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:B,value:l,onChange:e=>r(e.target.value),disabled:o}),c&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,j.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,j.Tl)("failed")}`:""]}),f.length>0&&(0,s.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,s.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:h,fullWidth:!0,disabled:o||!l.trim(),children:o?(0,j.Tl)("Importing..."):(0,j.Tl)("Import All")}),(0,s.jsx)(d.Button,{onClick:u,variant:"ghost",fullWidth:!0,disabled:o,children:(0,j.Tl)("Close")})]})]})})}let K={claude:"claudeAutoPing",codex:"codexAutoPing"};function L(){let e,t,a,r,p=(0,l.useParams)(),x=(0,l.useRouter)(),u=p.id,{getCaps:h}=(0,v.y)(),[f,g]=(0,i.useState)([]),[w,C]=(0,i.useState)(!0),[T,I]=(0,i.useState)(null),[$,E]=(0,i.useState)([]),[O,_]=(0,i.useState)(!1),[M,B]=(0,i.useState)(!1),[L,F]=(0,i.useState)(!1),[J,q]=(0,i.useState)(""),[W,H]=(0,i.useState)(!1),[V,G]=(0,i.useState)(!1),[Q,X]=(0,i.useState)(!1),[Y,Z]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(null),[ea,es]=(0,i.useState)({}),[ei,el]=(0,i.useState)([]),[er,eo]=(0,i.useState)(!1),[en,ed]=(0,i.useState)({}),[ec,em]=(0,i.useState)(""),[ep,ex]=(0,i.useState)(()=>new Set),[eu,eh]=(0,i.useState)(!1),[ef,eg]=(0,i.useState)([]),[ey,eb]=(0,i.useState)(1),[ev,ej]=(0,i.useState)("__none__"),[ew,ek]=(0,i.useState)(!1),[eN,eS]=(0,i.useState)(null),[eC,eA]=(0,i.useState)(""),[eT,eI]=(0,i.useState)(!1),[eP,e$]=(0,i.useState)("auto"),[eE,eO]=(0,i.useState)({enabled:!1,connections:{}}),[eD,e_]=(0,i.useState)([]),[eU,eM]=(0,i.useState)([]),[ez,eB]=(0,i.useState)([]),[eR,eK]=(0,i.useState)([]),[eL,eF]=(0,i.useState)(null),[eJ,eq]=(0,i.useState)(!1),[eW,eH]=(0,i.useState)(!1),[eV,eG]=(0,i.useState)(!1),[eQ,eX]=(0,i.useState)(null),[eY,eZ]=(0,i.useState)({}),[e0,e1]=(0,i.useState)(null),e2=(0,i.useRef)(!1),[e5,e3]=(0,i.useState)(!1),{copied:e4,copy:e6}=(0,b.C)(),e8="ag_risk_confirmed",e7=()=>{_(!0)},e9=()=>{"antigravity"===u&&"true"!==window.localStorage.getItem(e8)?eq(!0):ti?e7():(q(""),F(!0))},te=()=>{q(""),F(!0)},tt=()=>{ti?e9():te()},ta=T?{id:T.id,name:T.name||("anthropic-compatible"===T.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===T.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===T.type?"AC":"OC",apiType:T.apiType,baseUrl:T.baseUrl,type:T.type}:c.zN[u]||c.fg[u]||c.IS[u]||c.nJ[u]||c.br[u],ts=ta?.authModes||[],ti=!!c.zN[u]||!!c.IS[u]||ts.includes("oauth"),tl=!!c.fg[u]||ts.includes("apikey"),tr=!!c.IS[u]?.noAuth,to=(0,m.KC)(u),tn="cursor"===u&&eU.length>0?eU:to,td=(0,c.wG)(u),tc=(0,c.mq)(u),tm=(0,c.gb)(u),tp=tc||tm,tx=!tp&&ti&&tl,tu="xai"===u?"Grok Build OAuth":"grok-cli"===u?"Grok CLI Device Login":"kimi"===u?"Kimi Coding OAuth":"OAuth",th="xai"===u?"xAI API Key":"kimi"===u?"Kimi API Key":"qoder"===u?"PAT":"API Key",tf=e=>{if(!eP||"auto"===eP)return null;let t=y(u,e);return t&&t.includes(eP)?eP:null},tg=tp?u:td,ty=(e=new Map,t=t=>{t?.id&&!e.has(t.id)&&e.set(t.id,t)},tn.forEach(t),ei.forEach(e=>{e.providerAlias===tg&&"llm"===(e.kind||e.type||"llm")&&t(e)}),a=new Set(eR),[...e.values()].filter(e=>!a.has(e.id))),tb=(()=>{let e=new Set,t=new Set,a=a=>{if(!a||t.has(a))return;t.add(a);let s=y(u,a);s&&s.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tn)a(e.id);for(let e of ez)a(e.id);for(let e of ei)e.providerAlias===tg&&"llm"===(e.kind||e.type||"llm")&&a(e.id);return e.size?["auto",...e]:null})(),tv=tp?T?.prefix||u:td,tj=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tg)}`,{cache:"no-store"}),t=await e.json();e.ok&&eK(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tg]),tw=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tg,ids:[e]})})).ok&&await tj()}catch(e){console.log("Error disabling model:",e)}},tk=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tg)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tj()}catch(e){console.log("Error enabling model:",e)}},tN=async e=>{e.length&&eF({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eF(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tg,ids:e})})).ok&&await tj()}catch(e){console.log("Error disabling all models:",e)}}})},tS=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tg)}`,{method:"DELETE"})).ok&&await tj()}catch(e){console.log("Error enabling all models:",e)}},tC=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&es(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tA=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&el(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===u&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eB(e.models)}).catch(()=>{})},[u]);let tT=(0,i.useCallback)(async()=>{try{let[e,t,a,s]=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(),r=await a.json(),o=s.ok?await s.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===u);g(e)}a.ok&&E(r.proxyPools||[]);let n=(o.providerStrategies||{})[u]||{};eS(n.fallbackStrategy||null),eA(null!=n.stickyRoundRobinLimit?String(n.stickyRoundRobinLimit):"1"),eI(!0===n.strictModelAssignment);let d=(o.providerThinking||{})[u]||{};e$(d.mode||"auto");let c=K[u],m=c&&o[c]||{};if(eO({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===u)||null;if(!e&&tp)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===u)||null))break}I(e)}}catch(e){console.log("Error fetching connections:",e)}finally{C(!1)}},[u,tp]),tI=async e=>{try{let t=await fetch(`/api/provider-nodes/${u}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();t.ok&&(I(a.node),await tT(),X(!1))}catch(e){console.log("Error updating provider node:",e)}},tP=async(e,t)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),s=(a.ok?await a.json():{}).providerStrategies||{},i={...s[u]||{}};e?i.fallbackStrategy=e:(delete i.fallbackStrategy,delete i.stickyRoundRobinLimit),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...s};0===Object.keys(i).length?delete l[u]:l[u]=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)}},t$=async e=>{eI(e);try{let t=await fetch("/api/settings",{cache:"no-store"}),a=(t.ok?await t.json():{}).providerStrategies||{};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:{...a,[u]:{...a[u]||{},strictModelAssignment:e}}})})}catch(e){console.log("Error saving Freebuff strict assignment:",e)}},tE=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSpecificData:{assignedModel:t||null}})})).ok&&g(a=>a.map(a=>a.id===e?{...a,providerSpecificData:{...a.providerSpecificData||{},assignedModel:t||null}}:a))}catch(e){console.log("Error saving Freebuff model assignment:",e)}},tO=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?a[u]={mode:e}:delete a[u],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:a})})}catch(e){console.log("Error saving thinking config:",e)}},tD=async e=>{let t=K[u];if(t){eO(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,i.useEffect)(()=>{tT(),tC(),tA(),tj()},[tT,tC,tA,tj]),(0,i.useEffect)(()=>{if("cursor"!==u)return void eM([]);let e=f.find(e=>!1!==e.isActive);if(!e?.id)return void eM([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json()})).then(({ok:e,data:a})=>{!t&&e&&Array.isArray(a.models)&&a.models.length>0&&eM(a.models)}).catch(()=>{}),()=>{t=!0}},[u,f]),(0,i.useEffect)(()=>{let e=(c.zN[u]||c.fg[u]||c.IS[u]||c.nJ[u])?.modelsFetcher;e&&k(e).then(e_)},[u]);let t_=async(e,t,a=td)=>{let s=`${a}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})});if(e.ok)await tC();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tU=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tC()}catch(e){console.log("Error deleting alias:",e)}},tM=async(e,t="llm",a=tg)=>{try{let s=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:a,id:e,type:t})});if(s.ok)await tA(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await s.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tz=async(e,t="llm",a=tg)=>{try{let s=new URLSearchParams({providerAlias:a,id:e,type:t});(await fetch(`/api/models/custom?${s}`,{method:"DELETE"})).ok&&(await tA(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tB=async()=>{if(e5)return;let e=f.find(e=>!1!==e.isActive);if(!e)return void alert((0,j.Tl)("Please add an active Qoder connection first"));e3(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||(0,j.Tl)("Failed to fetch models"));let s=a.models||[];if(0===s.length)return void alert((0,j.Tl)("No models returned"));let i=0;for(let e of s){let t=e.id||e.name;if(!t)continue;let a=t.replace(/^qoder\//,"");ei.some(e=>e.providerAlias===tg&&e.id===a&&"llm"===(e.kind||e.type||"llm"))||Object.values(ea).includes(`${tg}/${a}`)||(await tM(a,"llm",tg),i+=1)}0===i?alert((0,j.Tl)("All models already exist, no new models added")):alert((0,j.Tl)("Successfully added")+` ${i} `+(0,j.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,j.Tl)("Error fetching models")+": "+e.message)}finally{e3(!1)}},tR=async()=>{if(eW||0===f.length)return;let e=Object.fromEntries(f.map(e=>[e.id,{state:"queued",error:null}]));e2.current=!1,eH(!0),eG(!1),eX(null),eZ(e),e1({total:f.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,a=0;try{for(let e=0;e<f.length;e+=1){if(e2.current){e1({total:f.length,completed:e,passed:t,failed:a,stopped:!0});break}let s=f[e];eX(s.id),eZ(e=>({...e,[s.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${s.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:a+=1,eZ(e=>({...e,[s.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){a+=1,eZ(t=>({...t,[s.id]:{state:"failed",error:e.message||"Test failed"}}))}e1({total:f.length,completed:e+1,passed:t,failed:a,stopped:!1}),e<f.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eX(null),eH(!1),eG(!1),e2.current=!1}},tK=async e=>{eF({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eF(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&g(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tL=()=>{tT(),_(!1)},tF=async e=>{q("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:u,...e})}),a=null;try{a=await t.json()}catch{a=null}if(t.ok){await tT(),F(!1);return}q(a?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),q("Failed to save connection")}},tJ=async e=>{try{(await fetch(`/api/providers/${ee.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tT(),G(!1))}catch(e){console.log("Error updating connection:",e)}},tq=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&g(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("Error updating connection status:",e)}},tW=async(e,t)=>{let a=[...f];[a[e],a[t]]=[a[t],a[e]],g(a);try{await Promise.all([fetch(`/api/providers/${a[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${a[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tT()}},tH=f.filter(e=>ef.includes(e.id)),{currentPage:tV,totalPages:tG,items:tQ,start:tX}=function(e=[],t=1){let a=Array.isArray(e)?e:[],s=a.length,i=Math.max(1,Math.ceil(s/10)),l=Math.floor(Number(t)),r=Math.min(Number.isFinite(l)&&l>0?l:1,i),o=(r-1)*10,n=a.slice(o,o+10);return{currentPage:r,totalPages:i,totalItems:s,start:o,items:n,pageSize:10}}(f,ey),tY=f.length>0&&ef.length===f.length;(0,i.useEffect)(()=>{eg(e=>e.filter(e=>f.some(t=>t.id===e)))},[f]);let tZ=(()=>{if(0===tH.length)return"";let e=new Set(tH.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return"All selected currently unbound";let a=$.find(e=>e.id===t);return`All selected currently bound to ${a?.name||t}`}return"Selected connections have mixed proxy bindings"})(),t0=()=>{ew||Z(!1)},t1=async(e,t)=>{let a=await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw Error((await a.json().catch(()=>({}))).error||`Proxy update failed (${a.status})`);return a.json()},t2=async e=>{ek(!0);try{let t=[];for(let{connectionId:a,proxyPoolId:s,proxyPoolIds:i,proxyRotationStrategy:l}of e)try{let e=i?{proxyPoolIds:i,proxyRotationStrategy:l}:{proxyPoolId:s};await t1(a,e)}catch(e){console.log("Error applying proxy for",a,e),t.push(a)}if(await tT(),t.length>0)return void alert(`Updated with ${t.length} failed request(s). Retry the selected connections.`);Z(!1),eg([]),ej("__none__")}finally{ek(!1)}},t5=e=>t2((ef.length>0?tH:f).map(t=>({connectionId:t.id,proxyPoolId:e}))),t3=(0,s.jsxs)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:[tQ.map((e,t)=>{let a,i=tX+t;return(0,s.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,s.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,s.jsx)("input",{type:"checkbox",checked:(a=e.id,ef.includes(a)),onChange:()=>{var t;return t=e.id,void eg(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,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsx)(P,{connection:e,proxyPools:$,isOAuth:ti,isFirst:0===i,isLast:i===f.length-1,onMoveUp:()=>tW(i,i-1),onMoveDown:()=>tW(i,i+1),onToggleActive:t=>tq(e.id,t),autoPing:K[u]&&"oauth"===e.authType?{on:!0===eE.connections[e.id],onToggle:t=>{var a;return a=e.id,void tD({...eE,connections:{...eE.connections,[a]:t}})},provider:u}:null,onUpdateProxy:async t=>{try{let a="object"==typeof t?t:{proxyPoolId:t||null};if((await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok){let t={...e.providerSpecificData};a.proxyPoolIds?(t.proxyPoolIds=a.proxyPoolIds,t.proxyRotationStrategy=a.proxyRotationStrategy,delete t.proxyPoolId):(a.proxyPoolId?t.proxyPoolId=a.proxyPoolId:delete t.proxyPoolId,delete t.proxyPoolIds,delete t.proxyRotationStrategy),g(a=>a.map(a=>a.id===e.id?{...a,providerSpecificData:t}:a))}}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{et(e),G(!0)},onDelete:()=>tK(e.id),oneByOneStatus:eY[e.id]||null,modelAssignmentOptions:"freebuff"===u?ty:null,onModelAssignmentChange:"freebuff"===u?t=>tE(e.id,t):null,strictModelAssignment:eT})})]},e.id)}),f.length>10&&(0,s.jsx)(d.Pagination,{currentPage:tV,pageSize:10,totalItems:f.length,onPageChange:eb})]}),t4=$.filter(e=>!0===e.isActive),t6=(0,s.jsx)(d.Modal,{isOpen:Y,onClose:t0,title:ef.length>0?`Apply Proxy (${ef.length} selected)`:`Apply Proxy (All ${f.length} connections)`,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[tZ&&(0,s.jsx)("p",{className:"text-xs text-text-muted bg-surface-2 px-3 py-2 rounded-lg border border-border/50",children:tZ}),(0,s.jsxs)("div",{className:"flex flex-col divide-y divide-border/30 border border-border/50 rounded-xl overflow-hidden bg-surface",children:[(0,s.jsxs)("div",{className:"p-3 flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"px-3 pb-1 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Dynamic Strategies"}),(0,s.jsxs)("button",{type:"button",onClick:()=>{let e=$.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):t2((ef.length>0?tH:f).map((t,a)=>({connectionId:t.id,proxyPoolId:e[a%e.length].id})))},disabled:ew||0===t4.length,className:"flex items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"sync_alt"}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-text-main",children:"One-to-one (rotate)"}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted mt-0.5",children:"Distribute active proxy pools round-robin"})]})]}),["fill-first","round-robin","random","smart"].map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{let t;return(t=t4.map(e=>e.id).filter(e=>$.find(t=>t.id===e)?.isActive===!0)).length?t2((ef.length>0?tH:f).map(a=>({connectionId:a.id,proxyPoolIds:t,proxyRotationStrategy:e}))):void alert("No active proxy pools selected.")},disabled:ew||0===t4.length,className:"flex items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"autorenew"}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)("span",{className:"text-sm font-medium text-text-main capitalize",children:[e," strategy"]}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted mt-0.5",children:"smart"===e?"Bypass pools marked unfit for provider/model":`Rotate over all active pools using ${e}`})]})]},e))]}),(0,s.jsxs)("div",{className:"p-3 flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"px-3 pb-1 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Static Assignment"}),(0,s.jsxs)("button",{type:"button",onClick:()=>t5(null),disabled:ew,className:"flex items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"link_off"}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-text-main",children:"None (unbind all)"}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted mt-0.5",children:"Direct routing without proxy"})]})]}),$.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>t5(e.id),disabled:ew||!0!==e.isActive,className:"flex items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"lan"}),(0,s.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"truncate text-sm font-medium text-text-main",children:e.name}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted truncate mt-0.5",children:e.proxyUrl})]}),!0!==e.isActive&&(0,s.jsx)(d.Badge,{variant:"secondary",size:"sm",className:"ml-auto shrink-0",children:"inactive"})]},e.id))]})]}),ew&&(0,s.jsx)("p",{className:"text-xs text-text-muted animate-pulse px-1",children:"Applying proxy configuration..."}),(0,s.jsx)(d.Button,{onClick:t0,variant:"ghost",fullWidth:!0,disabled:ew,children:"Cancel"})]})}),t8=async e=>{if(!ep.has(e)){ex(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:`${tg}/${e}`})}),a=await t.json();ed(t=>({...t,[e]:a.ok?"ok":"error"})),em(a.ok?"":a.error||"Model not reachable")}catch{ed(t=>({...t,[e]:"error"})),em("Network error")}finally{ex(t=>{let a=new Set(t);return a.delete(e),a})}}};return w?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(d.CardSkeleton,{}),(0,s.jsx)(d.CardSkeleton,{})]}):ta?(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,s.jsx)(n.A,{providerId:ta.id,size:48,alt:ta.name,className:"shrink-0 rounded-lg",fallbackText:ta.textIcon||ta.id.slice(0,2).toUpperCase(),fallbackColor:ta.color}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:ta.name}),(ta.notice?.apiKeyUrl||ta.notice?.signupUrl||ta.website)&&(0,s.jsxs)("a",{href:ta.notice?.apiKeyUrl||ta.notice?.signupUrl||ta.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),ta.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,s.jsxs)("p",{className:"text-text-muted",children:[f.length," connection",1===f.length?"":"s"]})]})]})]}),ta.deprecated&&(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,s.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:ta.deprecationNotice})]}),ta.notice?.text&&!ta.deprecated&&(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:ta.notice.text}),ta.notice.apiKeyUrl&&(0,s.jsx)("a",{href:ta.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 →"})]}),tp&&T&&(0,s.jsx)(d.Card,{children:(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:tm?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,s.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tm?"Messages API":"responses"===T.apiType?"Responses API":"Chat Completions"," \xb7 ",(T.baseUrl||"").replace(/\/$/,""),"/",tm?"messages":"responses"===T.apiType?"responses":"chat/completions"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:()=>{q(""),F(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>X(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eF({title:"Delete Compatible Node",message:`Delete this ${tm?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eF(null);try{(await fetch(`/api/provider-nodes/${u}`,{method:"DELETE"})).ok&&x.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tr?(0,s.jsx)(d.NoAuthProxyCard,{providerId:u}):(0,s.jsxs)(d.Card,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[f.length>0&&$.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>Z(!0),children:"Apply Proxy"}),f.length>0&&(0,s.jsxs)(s.Fragment,{children:[ef.length>0&&(0,s.jsxs)(d.Button,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=ef.length;0!==e&&eF({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eF(null);let e=0,t=[...ef];for(let a of t)try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}g(e=>e.filter(e=>!t.includes(e.id))),eg([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",ef.length,")"]}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"sync",onClick:tR,disabled:eW,children:eW?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eW&&(0,s.jsx)(d.Button,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eW&&(e2.current=!0,eG(!0))},disabled:eV,children:eV?"Stopping...":"Stop"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(d.Toggle,{checked:"round-robin"===eN,onChange:e=>{let t=e?"round-robin":null,a=e?eC||"1":eC;e&&!eC&&eA("1"),eS(t),tP(t,a)}}),"round-robin"===eN&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:eC,onChange:e=>{var t;eA(t=e.target.value),tP("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"})]})]}),"freebuff"===u&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t border-black/[0.03] pt-2 dark:border-white/[0.03]",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Strict Model Assignment"}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted",children:"Only assigned accounts can serve each Freebuff model."})]}),(0,s.jsx)(d.Toggle,{checked:eT,onChange:t$})]})]})]}),0===f.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:ti?"lock":"key"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tx&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tu," or ",th,"."]})]})]}),(0,s.jsx)("div",{className:"flex gap-2",children:tx?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Button,{size:"sm",icon:"lock",variant:"secondary",onClick:e9,children:tu}),(0,s.jsx)(d.Button,{size:"sm",icon:"key",onClick:te,children:th})]}):(0,s.jsxs)(s.Fragment,{children:[!tp&&"iflow"===u&&(0,s.jsx)(d.Button,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>B(!0),children:"Cookie"}),"codex"===u&&(0,s.jsx)(d.Button,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>H(!0),children:(0,j.Tl)("Bulk Add")}),(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:tt,children:tp?"Add API Key":"iflow"===u?"OAuth":"Add Connection"})]})})]}):(0,s.jsxs)(s.Fragment,{children:[e0&&(0,s.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,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("span",{children:["Total: ",e0.total]}),(0,s.jsxs)("span",{children:["Completed: ",e0.completed]}),(0,s.jsxs)("span",{children:["Passed: ",e0.passed]}),(0,s.jsxs)("span",{children:["Failed: ",e0.failed]}),e0.stopped&&(0,s.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eW&&eQ&&(0,s.jsxs)("span",{children:["Running: ",f.find(e=>e.id===eQ)?.name||eQ]})]})}),f.length>0&&(0,s.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,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,s.jsx)("input",{type:"checkbox",checked:tY,onChange:()=>{tY?eg([]):eg(f.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),t3,!tp&&(0,s.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===u&&(0,s.jsx)(d.Button,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>B(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===u&&(0,s.jsx)(d.Button,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>H(!0),title:(0,j.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,j.Tl)("Bulk Add")}),tx?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Button,{size:"sm",icon:"lock",variant:"secondary",onClick:e9,className:"w-full sm:w-auto",children:tu}),(0,s.jsx)(d.Button,{size:"sm",icon:"key",onClick:te,className:"w-full sm:w-auto",children:th})]}):(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:tt,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,s.jsxs)(d.Card,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tb&&(0,s.jsx)("select",{value:eP,onChange:e=>{var t;e$(t=e.target.value),tO(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tb.map(e=>(0,s.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tp&&(r=[...tn,...ez.filter(e=>!tn.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eR.includes(e)),(0,s.jsxs)("div",{className:"flex gap-2",children:[eR.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tS,children:"Active All"}),r.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tN(r),children:"Disable All"})]}))]}),!!ec&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:ec}),(()=>{let e,t,a;if(tp)return(0,s.jsx)(A,{providerStorageAlias:tg,providerDisplayAlias:tv,modelAliases:ea,customModels:ei,copied:e4,onCopy:e6,onSetAlias:t_,onDeleteAlias:tU,onAddCustomModel:e=>tM(e,"llm",tg),onDeleteCustomModel:e=>tz(e,"llm",tg),connections:f,isAnthropic:tm});let i=[...tn,...ez.filter(e=>!tn.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),l=new Set(eR),r=i.filter(e=>!l.has(e.id)),o=i.filter(e=>l.has(e.id)),n=N({customModels:ei,modelAliases:ea,providerAlias:tg,builtInModels:tn,type:"llm"});return(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[n.map(e=>(0,s.jsx)(S,{model:{id:e.id,name:e.name},fullModel:`${tv}/${e.id}`,alias:e.alias,copied:e4,onCopy:e6,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tz(e.id,"llm",tg):tU(e.alias)},testStatus:en[e.id],onTest:f.length>0||tr?()=>t8(e.id):void 0,isTesting:ep.has(e.id),isCustom:!0,isFree:!1,caps:h(`${u}/${e.id}`),thinkingSuffix:tf(e.id)},`${e.source}-${e.fullModel}`)),r.map(e=>{let t=`${tg}/${e.id}`,a=`${u}/${e.id}`,i=Object.entries(ea).find(([,e])=>e===t||e===a)?.[0];return(0,s.jsx)(S,{model:e,fullModel:`${tv}/${e.id}`,alias:i,copied:e4,onCopy:e6,onSetAlias:t=>t_(e.id,t,tg),onDeleteAlias:()=>tU(i),testStatus:en[e.id],onTest:f.length>0||tr?()=>t8(e.id):void 0,isTesting:ep.has(e.id),isFree:e.isFree,onDisable:()=>tw(e.id),caps:h(`${u}/${e.id}`),thinkingSuffix:tf(e.id)},e.id)}),(0,s.jsxs)("button",{onClick:()=>eh(!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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===u&&f.some(e=>!1!==e.isActive)&&(0,s.jsxs)("button",{onClick:tB,disabled:e5,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,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:e5?{animation:"spin 1s linear infinite"}:void 0,children:e5?"progress_activity":"download"}),e5?(0,j.Tl)("Fetching..."):(0,j.Tl)("Fetch Qoder Models")]}),eD.length>0&&(e=new Set([...Object.values(ea),...n.map(e=>e.fullModel)]),t=new Set(tn.map(e=>e.id)),0===(a=eD.filter(a=>!e.has(`${tg}/${a.id}`)&&!t.has(a.id))).length?null:(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>(0,s.jsxs)("button",{onClick:async()=>{await tM(e.id,"llm",tg)},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,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,s.jsxs)("button",{onClick:()=>tk(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,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),t6,"kiro"===u?(0,s.jsx)(d.KiroOAuthWrapper,{isOpen:O,providerInfo:ta,onSuccess:tL,onClose:()=>_(!1)}):"cursor"===u?(0,s.jsx)(d.CursorAuthModal,{isOpen:O,onSuccess:tL,onClose:()=>_(!1)}):"gitlab"===u?(0,s.jsx)(d.GitLabAuthModal,{isOpen:O,providerInfo:ta,onSuccess:tL,onClose:()=>_(!1)}):(0,s.jsx)(d.OAuthModal,{isOpen:O,provider:u,providerInfo:ta,onSuccess:tL,onClose:()=>_(!1)}),"iflow"===u&&(0,s.jsx)(d.IFlowCookieModal,{isOpen:M,onSuccess:()=>{tT(),B(!1)},onClose:()=>B(!1)}),(0,s.jsx)(D,{isOpen:L,provider:u,providerName:ta.name,isCompatible:tp,isAnthropic:tm,authType:ta?.authType,authHint:ta?.authHint,website:ta?.website,proxyPools:$,error:J,existingNames:f.map(e=>e.name).filter(Boolean),onSave:tF,onBulkDone:tT,onClose:()=>{q(""),F(!1)}}),(0,s.jsx)(d.EditConnectionModal,{isOpen:V,connection:ee,proxyPools:$,onSave:tJ,onClose:()=>G(!1)}),tp&&(0,s.jsx)(U,{isOpen:Q,node:T,onSave:tI,onClose:()=>X(!1),isAnthropic:tm}),!tp&&(0,s.jsx)(z,{isOpen:eu,providerAlias:tg,providerDisplayAlias:tv,onSave:async e=>{await tM(e,"llm",tg),eh(!1)},onClose:()=>eh(!1)}),"codex"===u&&(0,s.jsx)(R,{isOpen:W,onClose:()=>H(!1),onSuccess:tT}),(0,s.jsx)(d.ConfirmModal,{isOpen:eJ,onClose:()=>eq(!1),onConfirm:()=>{(window.localStorage.setItem(e8,"true"),eq(!1),ti)?e7():te()},title:"Risk Notice",message:ta?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,s.jsx)(d.ConfirmModal,{isOpen:!!eL,onClose:()=>eF(null),onConfirm:eL?.onConfirm,title:eL?.title||"Confirm",message:eL?.message,variant:"danger"})]}):(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,s.jsx)(o(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},21863:(e,t,a)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}a.d(t,{g:()=>s})},68810:(e,t,a)=>{Promise.resolve().then(a.bind(a,6))}},e=>{e.O(0,[3885,2318,4385,2940,7236,5479,2147,3204,7358],()=>e(e.s=68810)),_N_E=e.O()}]);
|