switchboard-router 0.9.70 → 0.9.72
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/static/chunks/1321-37ecf3f45c464e7e.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/{page-5503dc94b3b73efc.js → page-c49c2c45881644c2.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-6e36b61f4ae58378.js → page-15f9f168b6ba8411.js} +1 -1
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +17 -17
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.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.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.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/combos/routing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.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.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.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/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.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.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.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 +1 -1
- 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.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.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/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.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/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.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.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.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +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/_not-found/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/doctor/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/export/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/mcp/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/skills/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/updates/route.js.nft.json +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/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-full-catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-picker-labels/route.js.nft.json +1 -1
- 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-profiles/route.js.nft.json +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/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/droid-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/fx-settings/manual-configs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/fx-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/fx-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +1 -1
- 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/cli-tools/pi-settings/manual-configs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/picker-labels/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/live/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/strategy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/metrics/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/routing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/usage/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/routable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/routable/route.js.nft.json +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.nft.json +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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +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/defaults/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/cache/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/prepare/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/cancel/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/status/route.js.nft.json +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]/overrides/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +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/pxpipe/health/route.js.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/feedback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/insights/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/learn/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/promote/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/rollback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/skills/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/token-saver/vault-stats/route.js.nft.json +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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +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/usage/[connectionId]/claude-reset/route.js.nft.json +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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +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.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/[...model]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[...model]/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/systemone/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/systemone/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.nft.json +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.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/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
- 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/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +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/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
- 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/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +17 -17
- package/app/.next-cli-build/server/chunks/1350.js +1 -1
- package/app/.next-cli-build/server/chunks/1757.js +1 -1
- package/app/.next-cli-build/server/chunks/2348.js +1 -1
- package/app/.next-cli-build/server/chunks/2574.js +1 -1
- package/app/.next-cli-build/server/chunks/2766.js +1 -1
- package/app/.next-cli-build/server/chunks/2770.js +1 -1
- package/app/.next-cli-build/server/chunks/629.js +1 -1
- package/app/.next-cli-build/server/chunks/7730.js +1 -0
- package/app/.next-cli-build/server/chunks/8102.js +1 -0
- package/app/.next-cli-build/server/chunks/8400.js +1 -1
- package/app/.next-cli-build/server/chunks/869.js +1 -1
- package/app/.next-cli-build/server/chunks/8998.js +3 -3
- package/app/.next-cli-build/server/chunks/9264.js +1 -1
- package/app/.next-cli-build/server/chunks/9353.js +1 -1
- package/app/.next-cli-build/server/chunks/9662.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/1321-37ecf3f45c464e7e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/{page-5503dc94b3b73efc.js → page-c49c2c45881644c2.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-6e36b61f4ae58378.js → page-15f9f168b6ba8411.js} +1 -1
- package/app/config-writers.cjs +2 -1
- package/app/open-sse/identity/tls/bin/darwin/arm64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/darwin/x64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/linux/arm64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/linux/x64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/win32/arm64/switchboard-claude-tls.exe +0 -0
- package/app/open-sse/identity/tls/bin/win32/x64/switchboard-claude-tls.exe +0 -0
- package/app/package.json +1 -1
- package/app/public/providers/api-airforce.png +0 -0
- package/app/public/providers/grok-cli.png +0 -0
- package/app/public/providers/muse.png +0 -0
- package/app/public/providers/ollama-search.png +0 -0
- package/app/public/providers/opencode-zen.png +0 -0
- package/app/public/providers/venice.png +0 -0
- package/app/public/providers/vercel-ai-gateway.png +0 -0
- package/package.json +1 -1
- package/app/.next/static/chunks/1321-76df19b6a38e6fa9.js +0 -1
- package/app/.next-cli-build/server/chunks/6074.js +0 -1
- package/app/.next-cli-build/static/chunks/1321-76df19b6a38e6fa9.js +0 -1
- /package/app/.next/static/{5WtWAuXu4p-ILkKMsJE4i → mIIf1bKJ8KlrHk03nHIsh}/_buildManifest.js +0 -0
- /package/app/.next/static/{5WtWAuXu4p-ILkKMsJE4i → mIIf1bKJ8KlrHk03nHIsh}/_ssgManifest.js +0 -0
- /package/app/.next-cli-build/static/{5WtWAuXu4p-ILkKMsJE4i → mIIf1bKJ8KlrHk03nHIsh}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{5WtWAuXu4p-ILkKMsJE4i → mIIf1bKJ8KlrHk03nHIsh}/_ssgManifest.js +0 -0
|
@@ -25,4 +25,4 @@ name2|sk-key2|def789012`:U,value:X,onChange:a=>Y(a.target.value)}),Z&&(0,d.jsxs)
|
|
|
25
25
|
"id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
|
|
26
26
|
"email": "account2@example.com"
|
|
27
27
|
}
|
|
28
|
-
]`;function Y(a){let b,c=a.trim();if(!c)return[];try{b=JSON.parse(c)}catch(a){try{let a=c;a.startsWith("[")||((a=a.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(a=a.slice(0,-1)),a=`[${a}]`),b=JSON.parse(a)}catch{throw a}}if(Array.isArray(b))return b;if(b&&"object"==typeof b)return Array.isArray(b.accounts)?b.accounts:[b];throw Error("Input must be a JSON object or array of objects")}function Z({isOpen:a,onClose:b,onSuccess:c}){let[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[k,l]=(0,e.useState)(""),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=()=>{h||(g(""),l(""),n(null),r(null),p(!1),b())},u=async a=>{if(!a||0===a.length)return;l("");let b=Array.from(a).filter(a=>a.name.endsWith(".json")||"application/json"===a.type||""===a.type);if(0===b.length)return void l((0,C.Tl)("Please select valid .json files"));try{let a=[];for(let c of b){let b=await c.text(),d=Y(b);Array.isArray(d)?a.push(...d):d&&a.push(d)}if(0===a.length)return void l((0,C.Tl)("No accounts found in selected files"));g(JSON.stringify(a,null,2)),r({filesCount:b.length,accountsCount:a.length})}catch(a){l(`${(0,C.Tl)("Error reading files")}: ${a.message}`)}},v=async()=>{let a;l(""),n(null);try{a=Y(f)}catch(a){l(`${(0,C.Tl)("Invalid JSON")}: ${a.message}`);return}if(!a||0===a.length)return void l((0,C.Tl)("No accounts found in input"));i(!0);try{let b=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:a})}),d=await b.json();if(!b.ok)return void l(d?.error||`Request failed: ${b.status}`);n(d),d.success>0&&"function"==typeof c&&c()}catch(a){l(a.message||(0,C.Tl)("Request failed"))}finally{i(!1)}},w=m?.results?.filter(a=>!a.ok)||[];return(0,d.jsx)(j.aF,{isOpen:a,title:(0,C.Tl)("Bulk Add Grok CLI Accounts"),onClose:t,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,C.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,d.jsx)("input",{ref:s,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:a=>{u(a.target.files),a.target&&(a.target.value="")}}),(0,d.jsx)(j.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>s.current?.click(),disabled:h,children:(0,C.Tl)("Upload JSON Files")})]}),(0,d.jsxs)("div",{onDragOver:a=>{a.preventDefault(),p(!0)},onDragLeave:a=>{a.preventDefault(),p(!1)},onDrop:a=>{a.preventDefault(),p(!1),a.dataTransfer?.files?.length>0&&u(a.dataTransfer.files)},className:`relative rounded border transition-colors ${o?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,d.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:X,value:f,onChange:a=>{g(a.target.value),r(null)},disabled:h}),o&&(0,d.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-sidebar/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,d.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,C.Tl)("Drop .json files here")})]})]}),q&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-green-400 font-medium bg-green-500/10 border border-green-500/20 px-2.5 py-1.5 rounded",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,d.jsxs)("span",{children:[(0,C.Tl)("Loaded")," ",q.accountsCount," ",(0,C.Tl)("account(s) from")," ",q.filesCount," ",(0,C.Tl)("file(s)")]})]}),k&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:k}),m&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:`text-sm font-medium ${m.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",m.success," ",(0,C.Tl)("added"),m.failed>0?`, ✗ ${m.failed} ${(0,C.Tl)("failed")}`:""]}),w.length>0&&(0,d.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:w.map(a=>(0,d.jsxs)("li",{className:"text-red-400",children:["[",a.index,"] ",a.error]},a.index))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:v,fullWidth:!0,disabled:h||!f.trim(),children:h?(0,C.Tl)("Importing..."):(0,C.Tl)("Import All")}),(0,d.jsx)(j.$n,{onClick:t,variant:"ghost",fullWidth:!0,disabled:h,children:(0,C.Tl)("Close")})]})]})})}Z.propTypes={isOpen:G().bool.isRequired,onClose:G().func.isRequired,onSuccess:G().func};var $=c(78097);function _({connectionId:a,providerAlias:b,models:c,jobSnapshot:f,onComplete:g,onStarted:h,onClose:i}){let[k,l]=(0,e.useState)(4),[m,n]=(0,e.useState)(50),[o,p]=(0,e.useState)(Math.round(20)),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)(""),C=(0,e.useRef)({onComplete:g,onStarted:h}),D=(0,e.useRef)(null),E=(0,e.useRef)(a),F=(0,e.useRef)(null),G=c?.length||0,H=(0,e.useMemo)(()=>`max concurrency 16 \xb7 batch 200 \xb7 timeout ${60}s`,[]);async function I(){if(q||!a||0===G)return;r(!0),x(""),v(null),z("Starting…");let d={concurrency:Math.max(1,Math.min(16,Number(k)||4)),batchSize:Math.max(1,Math.min(200,Number(m)||50)),timeoutMs:Math.max(1e3,Math.min(6e4,1e3*(Number(o)||20)))};F.current=a;try{let e=await fetch(`/api/providers/${a}/model-probes/verify/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:c,providerAlias:b,...d,timeoutMs:d.timeoutMs})}),f=await e.json().catch(()=>({}));if(E.current!==a){F.current=null,r(!1);return}if(!e.ok){F.current=null,x(f.error||"Failed to start"),r(!1);return}C.current.onStarted?.(f),function(a){if(a){if("idle"===a.status){F.current=null,r(!1);return}if(t({done:a.done||0,total:a.total||0,ok:a.ok||0,dead:a.dead||0,retryable:a.retryable||0,skippedDead:a.skippedDead||0,skippedDup:a.skippedDup||0}),"running"===a.status&&(F.current=a.connectionId||E.current,D.current=null,r(!0)),a.currentRange&&z(`Probing ${a.currentRange.from}–${a.currentRange.to} of ${a.total}…`),a.error&&x(a.error),"done"===a.status||"cancelled"===a.status||"error"===a.status){F.current=null,r(!1);let b={ok:a.ok||0,dead:a.dead||0,retryable:a.retryable||0,tested:a.done||0,skippedDead:a.skippedDead||0,skippedDup:a.skippedDup||0,cancelled:"cancelled"===a.status,retryableAuthOnly:!0===a.retryableAuthOnly};v(b),z("cancelled"===a.status?"Cancelled (partial results saved).":"error"===a.status?"Stopped.":"Done.");let c=`${a.startedAt||"unknown"}:${a.status}`;D.current!==c&&(D.current=c,C.current.onComplete?.(b))}}}(f),"running"!==f.status&&r(!1)}catch(a){F.current=null,x(a?.message||"Verify failed"),r(!1)}}async function J(){let b=F.current||a;await fetch(`/api/providers/${b}/model-probes/verify/cancel`,{method:"POST"}).catch(()=>{})}async function K(c){if(!a)return;let d="retryable"===c,e=d?Number(u?.retryable||0):Number(u?.dead||0);if(!d||await (0,$.l)({title:"Remove retry-failed models?",message:`Review ${e} retryable result(s) and remove the eligible models? Timeouts, rate limits, network failures, and provider errors may be temporary. Credential failures are kept. Removed models can be enabled or imported again later.`,confirmText:"Remove eligible"})){B(c),x(""),z(`Removing ${d?"retry-failed":"dead"} models…`);try{let e=await fetch(`/api/providers/${a}/model-probes/remove-unavailable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:b,kind:"llm",status:c})}),f=await e.json().catch(()=>({}));if(!e.ok)return void x(f.error||"Remove failed");let g=Number(f.removed||0),h=Number(f.kept||0),i=u?{...u,[d?"retryable":"dead"]:h,...d?{retryableAuthOnly:h>0}:{}}:u;v(i),z(`Removed ${g} ${d?"retry-failed":"dead"} model(s).`+(h>0?` Kept ${h} credential failure(s).`:"")),C.current.onComplete?.({...i||{},removed:g,kept:h,removedStatus:c})}catch(a){x(a?.message||"Remove failed")}finally{B("")}}}async function L(){if(!a)return;let b=await fetch(`/api/providers/${a}/model-probes/cache`,{method:"DELETE"}),c=await b.json().catch(()=>({}));b.ok?(z(`Cleared probe cache (${c.cleared||0} rows). Next verify will re-test everything.`),v(null),t(null),C.current.onComplete?.({cacheCleared:!0,cleared:c.cleared||0})):x(c.error||"Clear cache failed")}let M=s?.total?Math.min(100,Math.round(s.done/s.total*100)):0;return(0,d.jsxs)("div",{className:"mb-4 rounded-lg border border-border bg-sidebar/40 p-3 space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Verify models"}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted mt-0.5",children:["Batch-ping availability and latency. Dead = permanently unavailable (missing, blocked, or deprecated) and can be removed; retry = transient (timeout/429/5xx). Known-dead models are skipped until you Clear cache. Caps: ",H,"."]})]}),i&&(0,d.jsx)("button",{type:"button",onClick:i,className:"p-1 text-text-muted hover:text-text-main rounded",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-3 items-end",children:[(0,d.jsxs)("label",{className:"text-xs text-text-muted",children:["Concurrency",(0,d.jsx)("input",{type:"number",min:1,max:16,value:k,disabled:q,onChange:a=>l(a.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,d.jsxs)("label",{className:"text-xs text-text-muted",children:["Batch size",(0,d.jsx)("input",{type:"number",min:1,max:200,value:m,disabled:q,onChange:a=>n(a.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,d.jsxs)("label",{className:"text-xs text-text-muted",children:["Timeout (s)",(0,d.jsx)("input",{type:"number",min:1,max:60,value:o,disabled:q,onChange:a=>p(a.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[q?(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"stop",onClick:J,children:"Cancel"}):(0,d.jsx)(j.$n,{size:"sm",icon:"science",onClick:I,disabled:!a||0===G,children:"Start"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"delete_sweep",onClick:L,disabled:q,children:"Clear cache"})]})]}),s&&(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("div",{className:"h-1.5 w-full rounded-full bg-border overflow-hidden",children:(0,d.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${M}%`}})}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted flex flex-wrap gap-x-2",children:[(0,d.jsxs)("span",{title:"Models probed this run",children:[s.done,"/",s.total," tested"]}),(0,d.jsxs)("span",{title:"Reachable",children:["\xb7 ok ",s.ok]}),(0,d.jsxs)("span",{title:"Permanently unavailable this run (missing, blocked, or deprecated)",children:["\xb7 dead ",s.dead]}),(0,d.jsxs)("span",{title:"Transient failure this run (timeout / 429 / 5xx / network); re-testable",children:["\xb7 retry ",s.retryable]}),s.skippedDead?(0,d.jsxs)("span",{title:"Not probed — cache already marks them dead. Clear cache to re-test.",children:["\xb7 skipped known-dead ",s.skippedDead]}):null,s.skippedDup?(0,d.jsxs)("span",{title:"Duplicate ids collapsed",children:["\xb7 dupes ",s.skippedDup]}):null]})]}),y&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:y}),w&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:w}),u&&(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[(0,d.jsxs)("span",{className:"text-xs text-text-main",children:["Summary: ",u.ok," ok \xb7 ",u.dead," dead \xb7 ",u.retryable," retry",u.skippedDead?` \xb7 ${u.skippedDead} skipped known-dead`:"",u.cancelled?" \xb7 cancelled":""]}),u.dead>0&&(0,d.jsxs)(j.$n,{size:"sm",variant:"primary",icon:"delete_sweep",onClick:()=>K("dead"),disabled:q||!!A,loading:"dead"===A,children:["Remove ",u.dead," dead"]}),u.retryable>0&&!u.retryableAuthOnly&&(0,d.jsxs)(j.$n,{size:"sm",variant:"danger",icon:"delete_sweep",onClick:()=>K("retryable"),disabled:q||!!A,loading:"retryable"===A,children:["Remove ",u.retryable," retry failures"]})]})]})}_.propTypes={connectionId:G().string,providerAlias:G().string,models:G().arrayOf(G().object),jobSnapshot:G().object,onComplete:G().func,onStarted:G().func,onClose:G().func};var aa=c(81847);let ab=["UTC","America/Los_Angeles","America/Denver","America/Chicago","America/New_York","America/Sao_Paulo","Europe/London","Europe/Berlin","Europe/Moscow","Asia/Kolkata","Asia/Shanghai","Asia/Tokyo","Asia/Singapore","Australia/Sydney"],ac=(()=>{let a=[];try{a=Intl.supportedValuesOf?.("timeZone")||[]}catch{a=[]}try{let a=Intl.DateTimeFormat().resolvedOptions().timeZone;a&&!ab.includes(a)&&ab.unshift(a)}catch{}return[...new Set([...ab,...a.filter(a=>!ab.includes(a))])]})(),ad={mon:"Mo",tue:"Tu",wed:"We",thu:"Th",fri:"Fr",sat:"Sa",sun:"Su"};function ae({providerId:a,scheduleKey:b}){let c=b||a,f=(0,e.useId)(),[g,h]=(0,e.useState)(!1),[i,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)("UTC"),[n,o]=(0,e.useState)("offPeak"),[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(""),[v,w]=(0,e.useState)(0),[,x]=(0,e.useState)(0),y=(0,e.useCallback)(a=>{let b=aa.Z9.find(b=>b.id===a);b&&(m(b.config.timezone||"UTC"),o("peak"===b.config.defaultState?"peak":"offPeak"),q(b.config.windows.map(a=>({type:a.type,start:a.start,end:a.end,days:Array.isArray(a.days)&&a.days.length?[...a.days]:[...aa.de]}))),w(0))},[]),z=(0,e.useMemo)(()=>i?{timezone:l,defaultState:n,windows:p}:null,[i,l,n,p]),A=(0,aa.yW)(z),B="unscheduled"===A?null:(0,aa.bC)(z),C=(0,e.useCallback)((a,b)=>{q(c=>c.map((c,d)=>d===a?{...c,...b}:c)),w(0)},[]),D=(0,e.useCallback)((a,b)=>{q(c=>c.map((c,d)=>{if(d!==a)return c;let e=c.days.includes(b)?c.days.filter(a=>a!==b):[...c.days,b];return{...c,days:e.length?e:c.days}})),w(0)},[]),E=async()=>{u("");let b=i?(0,aa.v2)({timezone:l,defaultState:n,windows:p},a):null;if(i&&b.error)return void u(b.error);s(!0);try{let a=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSchedules:{[c]:i?b.value:null}})});if(!a.ok){let b=await a.json().catch(()=>({}));u(b.error||`Failed to save peak hours (${a.status})`);return}w(Date.now())}catch{u("Failed to save peak hours")}finally{s(!1)}};return g?(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Peak hours"}),"unscheduled"!==A&&(0,d.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium ${"peak"===A?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-green-500/10 text-green-600 dark:text-green-400"}`,title:B?`Changes at ${function(a,b){try{return new Intl.DateTimeFormat("en-US",{timeZone:b,weekday:"short",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(new Date(a))}catch{return a}}(new Date(B).toISOString(),l)}`:void 0,children:[(0,d.jsx)("span",{className:`size-1.5 rounded-full ${"peak"===A?"bg-red-500":"bg-green-500"}`}),"peak"===A?"Peak now":"Off-peak now",B?` \xb7 ${(0,aa.zt)(B-Date.now())} left`:""]})]}),(0,d.jsx)(j.lM,{checked:i,onChange:a=>{k(a),w(0),a&&!p.length&&(m("UTC"),o("offPeak"),q([{type:"peak",start:"09:00",end:"17:00",days:[...aa.de]}]))},label:"Enable peak / off-peak hours",size:"sm"})]}),(0,d.jsx)("p",{className:"mb-3 text-xs text-text-muted leading-relaxed",children:"Optional. Some providers (e.g. DeepSeek) charge less outside peak hours. Define this provider's windows once, then mark models in a combo as peak-only or off-peak-only to skip them at the wrong hours."}),i&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsx)("label",{htmlFor:f,className:"text-sm font-medium text-text-main",children:"Timezone"}),(0,d.jsx)("input",{id:f,list:`${f}-zones`,value:l,onChange:a=>{m(a.target.value),w(0)},placeholder:"UTC — type to search IANA zones",className:"rounded-md border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",autoComplete:"off"}),(0,d.jsx)("datalist",{id:`${f}-zones`,children:ac.map(a=>(0,d.jsx)("option",{value:a},a))}),(0,d.jsx)("p",{className:"text-[10px] text-text-muted",children:"Windows are wall-clock in this zone (provider docs usually quote UTC)"})]}),(0,d.jsx)(j.l6,{label:"Outside all windows is",options:[{value:"offPeak",label:"Off-peak (peak is the exception)"},{value:"peak",label:"Peak (off-peak discount is the exception)"}],value:n,onChange:a=>{o(a.target.value),w(0)}})]}),(0,d.jsx)(j.l6,{label:"Load a preset",options:aa.Z9.map(a=>({value:a.id,label:a.label})),value:"",onChange:a=>y(a.target.value),placeholder:"Choose a known provider policy…",hint:"Fills the editor below — review the provider's current pricing page, then Save"}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[p.map((a,b)=>(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2 rounded-md border border-border bg-black/[0.02] px-2 py-2 dark:bg-white/[0.02]",children:[(0,d.jsxs)("select",{value:a.type,onChange:a=>C(b,{type:a.target.value}),className:"rounded-md border border-border bg-background px-2 py-1 text-xs","aria-label":`Window ${b+1} type`,children:[(0,d.jsx)("option",{value:"peak",children:"Peak"}),(0,d.jsx)("option",{value:"offPeak",children:"Off-peak"})]}),(0,d.jsx)("input",{type:"time",value:a.start,onChange:a=>C(b,{start:a.target.value}),className:"rounded-md border border-border bg-background px-2 py-1 text-xs","aria-label":`Window ${b+1} start`}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"→"}),(0,d.jsx)("input",{type:"time",value:a.end,onChange:a=>C(b,{end:a.target.value}),className:"rounded-md border border-border bg-background px-2 py-1 text-xs","aria-label":`Window ${b+1} end`}),(0,d.jsx)("div",{className:"flex items-center gap-1",children:aa.de.map(c=>(0,d.jsx)("button",{type:"button",onClick:()=>D(b,c),className:`size-6 rounded text-[10px] font-medium transition-colors ${a.days.includes(c)?"bg-primary/15 text-primary":"text-text-muted hover:bg-black/5 dark:hover:bg-white/5"}`,title:c,children:ad[c]},c))}),(0,d.jsx)("button",{type:"button",onClick:()=>{q(a=>a.filter((a,c)=>c!==b)),w(0)},className:"ml-auto rounded p-1 text-text-muted transition-colors hover:bg-red-500/10 hover:text-red-500",title:"Remove window","aria-label":`Remove window ${b+1}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},b)),(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>{q(a=>[...a,{type:"peak",start:"09:00",end:"17:00",days:[...aa.de]}]),w(0)},children:"Add window"})})]})]}),t&&(0,d.jsx)("p",{className:"mt-2 text-xs text-red-500",children:t}),v>0&&!t&&(0,d.jsx)("p",{className:"mt-2 text-xs text-green-600 dark:text-green-400",children:"Saved"}),(0,d.jsx)("div",{className:"mt-3",children:(0,d.jsx)(j.$n,{size:"sm",onClick:E,disabled:r,children:r?"Saving...":i?"Save peak hours":"Save (disable schedule)"})})]}):null}var af=c(41371);let ag=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],ah=/^[A-Za-z0-9-]+$/;function ai({providerId:a}){let b=(0,af.i)(),[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)([{name:"",value:""}]),[i,k]=(0,e.useState)({}),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(!1),p=(a,b,c)=>{h(d=>d.map((d,e)=>e===a?{...d,[b]:c}:d))},q=(0,e.useCallback)(async()=>{let c={};for(let a of g.filter(a=>a.name.trim())){let d=a.name.trim();if(!ah.test(d))return void b.error(`Invalid header name: ${d}`);if(ag.includes(d.toLowerCase()))return void b.error(`Header ${d} cannot be overridden`);if(d in c)return void b.error(`Duplicate header name: ${d}`);a.value!==i[d]&&(c[d]=a.value)}o(!0);try{let d=await fetch(`/api/providers/${a}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:c})});if(!d.ok){let a=await d.json().catch(()=>({}));b.error(a.error||"Failed to save");return}m(Object.keys(c).length>0),b.success("Custom headers saved")}finally{o(!1)}},[g,i,a,b]);return 0!==Object.keys(i).length||l?(0,d.jsxs)(j.Zp,{padding:"xs",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),className:"flex w-full items-center justify-between text-left",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,d.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),l&&(0,d.jsx)(j.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:c?"expand_less":"expand_more"})]}),c&&(0,d.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,d.jsx)("div",{className:"flex flex-col gap-2",children:g.map((a,b)=>{let c=a.name.trim()in i&&a.value!==i[a.name.trim()];return(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{value:a.name,onChange:a=>p(b,"name",a.target.value),placeholder:"Header-Name",spellCheck:!1,className:"w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none"}),(0,d.jsx)("input",{value:a.value,onChange:a=>p(b,"value",a.target.value),placeholder:"Value",spellCheck:!1,title:c?"Overridden":a.name.trim()in i?"Registry default":"",className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none ${c?"border-amber-400/60":"border-border"}`}),(0,d.jsx)("button",{type:"button",title:"Remove header",onClick:()=>h(a=>a.length>1?a.filter((a,c)=>c!==b):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},b)})}),(0,d.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>h(a=>[...a,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{type:"button",disabled:n,onClick:()=>{h(Object.entries(i).map(([a,b])=>({name:a,value:b})))},className:"rounded-md border border-border px-3 py-1.5 text-xs hover:bg-black/[0.03] dark:hover:bg-white/[0.03] disabled:opacity-50",children:"Reset"}),(0,d.jsx)("button",{type:"button",disabled:n,onClick:q,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:n?"Saving...":"Save"})]})]})]})]}):null}ai.propTypes={providerId:G().string.isRequired};var aj=c(56020),ak=c(54589),al=c(15279),am=c(54918),an=c(22588);let ao=new Set(["minimax-code","minimax-code-global"]),ap={claude:"claudeAutoPing",codex:"codexAutoPing"};function aq(){let a,b,c,g=(0,f.useParams)(),m=(0,f.useRouter)(),n=g.id,{getCaps:o}=(0,B.y)(),[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)([]),[t,u]=(0,e.useState)(!0),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(!1),[F,G]=(0,e.useState)(!1),[J,K]=(0,e.useState)(!1),[M,N]=(0,e.useState)(""),[P,T]=(0,e.useState)(!1),[V,X]=(0,e.useState)(!1),[Y,$]=(0,e.useState)(!1),[aa,ab]=(0,e.useState)(!1),[ac,ad]=(0,e.useState)(null),[af,ag]=(0,e.useState)({}),[ah,aq]=(0,e.useState)([]),[ar,as]=(0,e.useState)(!1),[at,au]=(0,e.useState)({}),[av,aw]=(0,e.useState)(""),[ax,ay]=(0,e.useState)(null),[az,aA]=(0,e.useState)(()=>new Set),[aB,aC]=(0,e.useState)(!1),[aD,aE]=(0,e.useState)(null),[aF,aG]=(0,e.useState)(""),[aH,aI]=(0,e.useState)(!1),[aJ,aK]=(0,e.useState)("30"),[aL,aM]=(0,e.useState)("auto"),[aN,aO]=(0,e.useState)({enabled:!1,connections:{},schedules:{}}),[aP,aQ]=(0,e.useState)(null),[aR,aS]=(0,e.useState)([]),[aT,aU]=(0,e.useState)([]),[aV,aW]=(0,e.useState)([]),[aX,aY]=(0,e.useState)([]),[aZ,a$]=(0,e.useState)(null),[a_,a0]=(0,e.useState)(!1),[a1,a2]=(0,e.useState)(!1),[a3,a4]=(0,e.useState)(!1),[a5,a6]=(0,e.useState)(null),[a7,a8]=(0,e.useState)({}),[a9,ba]=(0,e.useState)(null),bb=(0,e.useRef)(!1),bc=(0,e.useRef)(null),bd=(0,e.useRef)(0),be=(0,e.useRef)(0),[bf,bg]=(0,e.useState)(!1),[bh,bi]=(0,e.useState)(""),[bj,bk]=(0,e.useState)(!1),[bl,bm]=(0,e.useState)(null),[bn,bo]=(0,e.useState)({}),[bp,bq]=(0,e.useState)({}),[br,bs]=(0,e.useState)("all"),{copied:bt,copy:bu}=(0,A.C)(),bv=v?{id:v.id,name:v.name||("anthropic-compatible"===v.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===v.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===v.type?"AC":"OC",apiType:v.apiType,baseUrl:v.baseUrl,type:v.type}:k.zN[n]||k.fg[n]||k.IS[n]||k.nJ[n]||k.br[n],bw=bv?.authModes||[],bx=!!k.zN[n]||!!k.IS[n]||bw.includes("oauth"),by=!!k.fg[n]||bw.includes("apikey"),bz=!!k.IS[n]?.noAuth,bA=(0,l.KC)(n),bB=(()=>{let a=new Map(bA.map(a=>[a.id,a]));for(let b of aT)b?.id&&a.set(b.id,{...a.get(b.id),...b});return[...a.values()]})(),bC=(0,k.wG)(n),bD=(0,k.mq)(n),bE=(0,k.gb)(n),bF=bD||bE,bG=p.some(a=>!1!==a.isActive),bH=function({isCompatible:a,hasActiveConnection:b}){let c=!a,d=!a;return{showToolbar:c||b||d,showImport:c,showVerify:b,showBulkControls:d}}({isCompatible:bF,hasActiveConnection:bG}),bI=!bF&&bx&&by,bJ="xai"===n?"Grok Build OAuth":"OAuth",bK="xai"===n?"xAI API Key":"qoder"===n||"qoder-cn"===n?"PAT":"API Key",bL=()=>{y(!0)},bM=()=>{bx?bL():(N(""),K(!0))},bN=()=>{N(""),K(!0)},bO=()=>{bx?bM():bN()},bP=a=>{if(!aL||"auto"===aL)return null;let b=z(n,a);return b&&b.includes(aL)?aL:null},bQ=(()=>{let a=new Set;for(let b of bB){let c=z(n,b.id);c&&c.forEach(b=>{"none"!==b&&a.add(b)})}return a.size?["auto",...a]:null})(),bR=bF?n:bC,bS=bF?v?.prefix||n:bC,bT=(0,D.Iz)(aX,bR),bU=a=>(0,D.uJ)(bT,a,bR),bV=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bR)}`,{cache:"no-store"}),b=await a.json();a.ok&&aY(b.ids||[])}catch(a){(0,I.s)("Error fetching disabled models:",a)}},[bR]),bW=async a=>{try{await (0,am.x)("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bR,ids:[a]})}),await bV()}catch(a){(0,I.s)("Error disabling model:",a)}},bX=async a=>{try{return await (0,am.x)(`/api/models/disabled?providerAlias=${encodeURIComponent(bR)}&id=${encodeURIComponent(a)}`,{method:"DELETE"}),await bV(),!0}catch(a){return(0,I.s)("Error enabling model:",a),!1}},bY=async a=>{a.length&&a$({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{a$(null);try{await (0,am.x)("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bR,ids:a})}),await bV()}catch(a){(0,I.s)("Error disabling all models:",a)}}})},bZ=async()=>{try{await (0,am.x)(`/api/models/disabled?providerAlias=${encodeURIComponent(bR)}`,{method:"DELETE"}),await bV()}catch(a){(0,I.s)("Error enabling all models:",a)}},b$=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&ag(b.aliases||{})}catch(a){(0,I.s)("Error fetching aliases:",a)}},[]),b_=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/custom",{cache:"no-store"}),b=await a.json();a.ok&&aq(b.models||[])}catch(a){(0,I.s)("Error fetching custom models:",a)}},[]),b0=(0,e.useCallback)(async()=>{try{let[a,b,c]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),d=await a.json(),e=await b.json(),f=c.ok?await c.json():{};if(a.ok){let a=(d.connections||[]).filter(a=>a.provider===n);q(a)}let g=(f.providerStrategies||{})[n]||{};aE(g.fallbackStrategy||null),aG(null!=g.stickyRoundRobinLimit?String(g.stickyRoundRobinLimit):"1");let h=g.accountScheduler||{};aI(!0===h.enabled),aK(String(Math.max(1,Math.round((h.sessionAffinityTtlSeconds||1800)/60))));let i=(f.providerThinking||{})[n]||{};aM(i.mode||"auto");let j=ap[n],k=j&&f[j]||{};if(aO({enabled:!0===k.enabled,connections:k.connections||{},schedules:k.schedules||{}}),b.ok){let a=(e.nodes||[]).find(a=>a.id===n)||null;if(!a&&bF)for(let b=0;b<3;b+=1){await new Promise(a=>setTimeout(a,150));let b=await fetch("/api/provider-nodes",{cache:"no-store"});if(b.ok&&(a=((await b.json()).nodes||[]).find(a=>a.id===n)||null))break}w(a)}}catch(a){(0,I.s)("Error fetching connections:",a)}finally{u(!1)}},[n,bF]),b1=(0,e.useCallback)(async(a=null)=>{let b=++be.current,c=a?p.find(b=>b.id===a&&!1!==b.isActive):p.find(a=>r.includes(a.id)&&!1!==a.isActive)||p.find(a=>!1!==a.isActive);if(!c){bq({}),bo({});return}try{let a=await fetch(`/api/providers/${c.id}/model-probes`,{cache:"no-store"});if(!a.ok)return;let d=await a.json().catch(()=>({})),e={},f={};for(let a of d.probes||[])e[a.modelId]="ok"===a.status?"ok":"dead"===a.status?"dead":"retry",null!=a.latencyMs&&(f[a.modelId]=a.latencyMs);if(b!==be.current)return;bq(e),bo(f)}catch{}},[p,r]),b2=async a=>{try{let b=await fetch(`/api/provider-nodes/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();b.ok?(w(c.node),await b0(),ab(!1)):(0,I.s)(c?.error||"Failed to update provider node")}catch(a){(0,I.s)("Error updating provider node:",a)}},b3=async(a,b)=>{try{return await (0,an.T)(n,c=>{let d={...c};return a?d.fallbackStrategy=a:delete d.fallbackStrategy,"round-robin"===a&&""!==b?d.stickyRoundRobinLimit=Number(b)||3:a||delete d.stickyRoundRobinLimit,d}),!0}catch(a){return(0,I.s)("Error saving provider strategy:",a),!1}},b4=async(a,b)=>{let c=Math.min(1440,Math.max(1,Number.parseInt(b,10)||30));try{return await (0,an.T)(n,b=>({...b,accountScheduler:{...b.accountScheduler||{},enabled:a,sessionAffinityTtlSeconds:60*c}})),!0}catch(a){return(0,I.s)("Error saving balanced scheduler:",a),!1}},b5=async a=>{let b=a?"round-robin":null,c=a?aF||"1":aF;await b3(b,c)&&(a&&!aF&&aG("1"),aE(b))},b6=async a=>{await b3("round-robin",a)&&aG(a)},b7=async a=>{await b4(a,aJ)&&aI(a)},b8=async a=>{await b4(aH,a)&&aK(a)},b9=async a=>{try{let b=await fetch("/api/settings",{cache:"no-store"}),c={...(b.ok?await b.json():{}).providerThinking||{}};a&&"auto"!==a?c[n]={mode:a}:delete c[n],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:c})})}catch(a){(0,I.s)("Error saving thinking config:",a)}},ca=async a=>{let b=ap[n];if(b){aO(a);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[b]:a})})}catch(a){(0,I.s)("Error saving auto-ping config:",a)}}},cb=(0,e.useCallback)(a=>{let b=++bd.current;bc.current&&(clearTimeout(bc.current),bc.current=null);let c=async()=>{try{let d=await fetch(`/api/providers/${a}/model-probes/verify/status`,{cache:"no-store"}),e=await d.json().catch(()=>null);if(b!==bd.current)return;if(!d.ok||!e?.status)throw Error("Verify status temporarily unavailable");bm(e&&e.status?e:null),e?.status==="running"?bc.current=setTimeout(c,1500):(bc.current=null,await b1(a))}catch{b===bd.current&&(bc.current=setTimeout(c,1500))}};bc.current=setTimeout(c,0)},[b1]),cc=async(a,b,c=bC)=>{let d=`${c}/${a}`;try{let a=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d,alias:b})});if(a.ok)await b$();else{let b=await a.json();(0,I.s)(b.error||"Failed to set alias")}}catch(a){(0,I.s)("Error setting alias:",a)}},cd=async a=>{try{await (0,am.x)(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"}),await b$()}catch(a){(0,I.s)("Error deleting alias:",a)}},ce=async(a,b="llm",c=bR,d,e)=>{try{let f=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:c,id:a,type:b,...d?{caps:d}:{},...e?{transport:e}:{}})});if(f.ok)await b_();else{let a=await f.json();(0,I.s)(a.error||"Failed to add custom model")}}catch(a){(0,I.s)("Error adding custom model:",a)}},cf=async(a,b="llm",c=bR)=>{try{let d=new URLSearchParams({providerAlias:c,id:a,type:b});await (0,am.x)(`/api/models/custom?${d}`,{method:"DELETE"}),await b_()}catch(a){(0,I.s)("Error deleting custom model:",a)}},cg=async()=>{if(bf)return;let a=p.find(a=>r.includes(a.id)&&!1!==a.isActive)||p.find(a=>!1!==a.isActive);if(!a)return void(0,I.s)((0,C.Tl)("Add an active connection first"));bg(!0),bi("");try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json().catch(()=>({}));if(!b.ok)return void(0,I.s)(c.error||(0,C.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void(0,I.s)(c.warning||(0,C.Tl)("No models returned"));let e=new Set;try{let b=await fetch(`/api/providers/${a.id}/model-probes`,{cache:"no-store"});for(let a of(await b.json().catch(()=>({}))).probes||[])"dead"===a.status&&e.add(a.modelId)}catch{}let f=0,g=new Set(bB.map(a=>a.id)),h=[],i=[],j=new Set;for(let a of d){let b=(0,E.R2)(a,bR);if(!b)continue;let{id:c,name:d,type:k}=b;if(e.has((0,al.v)(c,bR))){f+=1;continue}let l=`${k}|${c}`;if(j.has(l))continue;if(j.add(l),g.has(c)){bU(c)&&i.push(c);continue}if(ah.some(a=>a.providerAlias===bR&&a.id===c&&(0,E.ki)(a.kind||a.type||"llm")===k))continue;let m=`${bR}/${c}`;Object.values(af).includes(m)||h.push({providerAlias:bR,id:c,type:k,name:d,...b.reasoning?{reasoning:b.reasoning}:{}})}let k=0;if(i.length>0)try{for(let a of i)(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bR)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&(k+=1);await bV()}catch{}let l=0;if(h.length>0){let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:h})}),b=await a.json().catch(()=>({}));if(!a.ok)return void(0,I.s)(b.error||(0,C.Tl)("Failed to save models"));l=b.added??h.length,await b_()}let m=h.filter(a=>"llm"!==a.type).length,n=[];if(l>0&&n.push(`${l} new`),k>0&&n.push(`${k} re-enabled`),0===n.length)bi((0,C.Tl)("All models already in list"));else{let a=`Imported ${n.join(" \xb7 ")} (${d.length} from provider)`;m>0&&(a+=" \xb7 non-chat types stored for media pages"),c.warning&&(a+=` \xb7 ${c.warning}`),bi(a)}if(f>0&&bi(a=>`${a} \xb7 ${f} skipped (known dead)`),l>0||k>0)try{let b=[...bB,...h.map(a=>({id:a.id,name:a.name,kind:a.type}))],c=await fetch(`/api/providers/${a.id}/model-probes/verify/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:b,providerAlias:bR})}),d=await c.json().catch(()=>({}));if(!c.ok)throw Error(d.error||"Failed to start auto-verify");bm(d&&d.status?d:null),cb(a.id)}catch(a){bi(b=>`${b} \xb7 auto-verify failed: ${a?.message||a}`)}}catch(a){(0,I.s)("Error importing models:",a),(0,I.s)((0,C.Tl)("Error fetching models")+": "+(a?.message||a))}finally{bg(!1)}},ch=async()=>{if(a1||0===p.length)return;let a=Object.fromEntries(p.map(a=>[a.id,{state:"queued",error:null}]));bb.current=!1,a2(!0),a4(!1),a6(null),a8(a),ba({total:p.length,completed:0,passed:0,failed:0,stopped:!1});let b=0,c=0;try{for(let a=0;a<p.length;a+=1){if(bb.current){ba({total:p.length,completed:a,passed:b,failed:c,stopped:!0});break}let d=p[a];a6(d.id),a8(a=>({...a,[d.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${d.id}/test`,{method:"POST"}),e=await a.json(),f=!!e.valid;f?b+=1:c+=1,a8(a=>({...a,[d.id]:{state:f?"success":"failed",error:f?null:e.error||null}}))}catch(a){c+=1,a8(b=>({...b,[d.id]:{state:"failed",error:a.message||"Test failed"}}))}ba({total:p.length,completed:a+1,passed:b,failed:c,stopped:!1}),a<p.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{a6(null),a2(!1),a4(!1),bb.current=!1}},ci=async a=>{let b=p.find(b=>b.id===a),c=b?.name?.trim()||b?.email?.trim()||a;a$({title:"Delete Connection",message:`Delete connection “${c}”?`,onConfirm:async()=>{a$(null);try{await (0,am.x)(`/api/providers/${a}`,{method:"DELETE"}),q(b=>b.filter(b=>b.id!==a))}catch(a){(0,I.s)("Error deleting connection:",a)}}})},cj=()=>{b0(),y(!1)},ck=async a=>{N("");try{let b=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:n,...a})}),c=null;try{c=await b.json()}catch{c=null}if(b.ok){await b0(),K(!1);return}N(c?.error||"Failed to save connection")}catch(a){(0,I.s)("Error saving connection:",a),N("Failed to save connection")}},cl=async a=>{try{await (0,am.x)(`/api/providers/${ac.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),await b0(),$(!1)}catch(a){(0,I.s)("Error updating connection:",a)}},cm=async(a,b)=>{try{await (0,am.x)(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})}),q(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){(0,I.s)("Error updating connection status:",a)}},cn=async a=>{let b,c=a?.providerSpecificData?.baseUrl;if(c){try{b=new URL(c).hostname.toLowerCase().replace(/^\[|\]$/g,"")}catch{(0,I.s)("Cannot allow-list: invalid base URL",c);return}try{let a=await fetch("/api/settings",{cache:"no-store"});if(!a.ok)throw Error(`Failed to load settings (${a.status})`);let c=await a.json(),d=[...new Set([...c.ssrfAllowHosts||[],b])],e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ssrfAllowHosts:d})});if(!e.ok)throw Error(`Failed to update allow list (${e.status})`);await b0()}catch(a){(0,I.s)("Error adding host to allow list:",a)}}},co=async(a,b)=>{let c=[...p];[c[a],c[b]]=[c[b],c[a]],q(c);try{if((await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b})})])).some(a=>!a.ok))throw Error("Failed to reorder connections")}catch(a){(0,I.s)("Error swapping priority:",a),await b0()}},cp=p.length>0&&r.length===p.length,cq=(0,d.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:p.map((a,b)=>(0,d.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,d.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,d.jsx)("input",{type:"checkbox",checked:r.includes(a.id),onChange:()=>{var b;return b=a.id,void s(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(O,{connection:a,isOAuth:bx,isFirst:0===b,isLast:b===p.length-1,onMoveUp:()=>co(b,b-1),onMoveDown:()=>co(b,b+1),onToggleActive:b=>cm(a.id,b),autoPing:ap[n]&&"oauth"===a.authType?{isActive:!0===aN.connections[a.id]||aN.schedules?.[a.id]?.enabled===!0,reactiveOn:!0===aN.connections[a.id],provider:n,scheduleOn:aN.schedules?.[a.id]?.enabled===!0,scheduleSummary:(0,ak.JW)(aN.schedules?.[a.id]).join(" / "),onConfigure:()=>aQ(a)}:null,onEdit:()=>{ad(a),$(!0)},onDelete:()=>ci(a.id),onAllowlistHost:()=>cn(a),oneByOneStatus:a7[a.id]||null})})]},a.id))}),cr=async a=>{if(!az.has(a)){aA(b=>new Set(b).add(a));try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${bR}/${a}`})}),c=await b.json();au(b=>({...b,[a]:c.ok?"ok":"error"})),aw(c.ok?"":c.error||"Model not reachable")}catch{au(b=>({...b,[a]:"error"})),aw("Network error")}finally{aA(b=>{let c=new Set(b);return c.delete(a),c})}}};return t?(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(j.Qv,{}),(0,d.jsx)(j.Qv,{})]}):bv?(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)(h(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,d.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${bv.color}15`},children:ar?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:bv.color},children:bv.textIcon||bv.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.default,{src:bD&&bv.apiType?"responses"===bv.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":bE?"/providers/anthropic-m.png":`/providers/${bv.id}.png`,alt:bv.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>as(!0)})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:bv.name}),(bv.notice?.apiKeyUrl||bv.notice?.signupUrl||bv.website)&&(0,d.jsxs)("a",{href:bv.notice?.apiKeyUrl||bv.notice?.signupUrl||bv.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),bv.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[p.length," connection",1===p.length?"":"s"]})]})]})]}),bv.deprecated&&(0,d.jsxs)("div",{className:"flex items-start gap-3 rounded-xl border border-amber-500/25 bg-amber-500/8 px-4 py-3 text-xs text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-amber-500 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"leading-relaxed font-normal",children:String(bv.deprecationNotice).replace(/^⚠️\s*⚠️?\s*/,"")})]}),bv.notice?.text&&!bv.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,d.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:bv.notice.text}),bv.notice.apiKeyUrl&&(0,d.jsx)("a",{href:bv.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 →"})]}),bF&&v&&(0,d.jsx)(j.Zp,{children:(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:bE?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[bE?"Messages API":"responses"===v.apiType?"Responses API":"Chat Completions"," \xb7 ",(v.baseUrl||"").replace(/\/$/,""),"/",bE?"messages":"responses"===v.apiType?"responses":"chat/completions"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:()=>{N(""),K(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ab(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{a$({title:"Delete Compatible Node",message:`Delete this ${bE?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{a$(null);try{await (0,am.x)(`/api/provider-nodes/${n}`,{method:"DELETE"}),m.push("/dashboard/providers")}catch(a){(0,I.s)("Error deleting provider node:",a)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),bz?(0,d.jsx)(j.gw,{providerId:n}):(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[p.length>0&&(0,d.jsxs)(d.Fragment,{children:[r.length>0&&(0,d.jsxs)(j.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let a=r.length;0!==a&&a$({title:`Delete ${a} Connection${a>1?"s":""}`,message:`Delete ${a} connection${a>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{a$(null);let a=0,b=[...r],c=[];for(let d of b)try{(await fetch(`/api/providers/${d}`,{method:"DELETE"})).ok?c.push(d):a+=1}catch(b){(0,I.s)("Error deleting connection:",b),a+=1}q(a=>a.filter(a=>!c.includes(a.id))),s([]),a>0&&(0,I.s)(`Deleted ${b.length-a} connection(s), ${a} failed.`)}})},children:["Delete Selected (",r.length,")"]}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:ch,disabled:a1,children:a1?"Testing Connection One-by-One...":"Test Connection One-by-One"}),a1&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{a1&&(bb.current=!0,a4(!0))},disabled:a3,children:a3?"Stopping...":"Stop"})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border/60 bg-surface-2/40 p-3",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-text-main",children:"Balanced Scheduler"}),(0,d.jsx)(j.m_,{text:"Process-local least-inflight scheduling with fresh quota signals. Sessions stay on one account and rebind on failure, cooldown, or cap.",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] text-text-muted cursor-help",children:"info"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[aH&&(0,d.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:["Affinity",(0,d.jsx)("input",{"aria-label":"Session affinity minutes",type:"number",min:1,max:1440,value:aJ,onChange:a=>b8(a.target.value),className:"w-14 px-2 py-0.5 text-xs border border-border rounded-md bg-background text-text-main focus:outline-none focus:border-primary"}),(0,d.jsx)("span",{className:"text-[11px]",children:"min"})]}),(0,d.jsx)(j.lM,{checked:aH,onChange:b7,"aria-label":"Balanced scheduler"})]})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 pt-2 border-t border-border/40",title:aH?"Saved and used again when balanced scheduling is off":void 0,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-text-main",children:"Round Robin"}),(0,d.jsx)(j.m_,{text:"Cycles through connections sequentially in round-robin fashion.",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] text-text-muted cursor-help",children:"info"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:["round-robin"===aD&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,d.jsx)("input",{type:"number",min:1,value:aF,onChange:a=>b6(a.target.value),placeholder:"1",disabled:aH,title:aH?"Saved and used again when balanced scheduling is off":void 0,className:"w-14 px-2 py-0.5 text-xs border border-border rounded-md bg-background text-text-main focus:outline-none focus:border-primary disabled:cursor-not-allowed disabled:opacity-50"})]}),(0,d.jsx)(j.lM,{checked:"round-robin"===aD,onChange:b5,"aria-label":"Round Robin",disabled:aH,title:aH?"Saved and used again when balanced scheduling is off":void 0})]})]})]})]})]}),0===p.length?(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:bx?"lock":"key"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),bI&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",bJ," or ",bK,"."]})]})]}),(0,d.jsx)("div",{className:"flex gap-2",children:bI?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bM,children:bJ}),(0,d.jsx)(j.$n,{size:"sm",icon:"key",onClick:bN,children:bK})]}):(0,d.jsxs)(d.Fragment,{children:[!bF&&ao.has(n)&&(0,d.jsx)(R,{providerId:n,onConnected:b0}),!bF&&"iflow"===n&&(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>G(!0),children:"Cookie"}),"codex"===n&&(0,d.jsx)(j.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>T(!0),children:(0,C.Tl)("Bulk Add")}),"grok-cli"===n&&(0,d.jsx)(j.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>X(!0),children:(0,C.Tl)("Bulk Add")}),(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:bO,children:bF?"Add API Key":"iflow"===n?"OAuth":"Add Connection"})]})})]}):(0,d.jsxs)(d.Fragment,{children:[a9&&(0,d.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,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("span",{children:["Total: ",a9.total]}),(0,d.jsxs)("span",{children:["Completed: ",a9.completed]}),(0,d.jsxs)("span",{children:["Passed: ",a9.passed]}),(0,d.jsxs)("span",{children:["Failed: ",a9.failed]}),a9.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),a1&&a5&&(0,d.jsxs)("span",{children:["Running: ",p.find(a=>a.id===a5)?.name||a5]})]})}),p.length>0&&(0,d.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,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,d.jsx)("input",{type:"checkbox",checked:cp,onChange:()=>{cp?s([]):s(p.map(a=>a.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),cq,!bF&&(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===n&&(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>G(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===n&&(0,d.jsx)(j.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>T(!0),title:(0,C.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,C.Tl)("Bulk Add")}),"grok-cli"===n&&(0,d.jsx)(j.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>X(!0),title:(0,C.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,C.Tl)("Bulk Add")}),bI?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bM,className:"w-full sm:w-auto",children:bJ}),(0,d.jsx)(j.$n,{size:"sm",icon:"key",onClick:bN,className:"w-full sm:w-auto",children:bK})]}):(0,d.jsxs)(d.Fragment,{children:[ao.has(n)&&(0,d.jsx)(R,{providerId:n,onConnected:b0}),(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:bO,className:"w-full sm:w-auto",children:"Add"})]})]})]})]}),(0,d.jsx)(ae,{providerId:n,scheduleKey:bS},n),(0,d.jsx)(ai,{providerId:n}),(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),bQ&&(0,d.jsx)("select",{value:aL,onChange:a=>{var b;aM(b=a.target.value),b9(b)},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:bQ.map(a=>(0,d.jsx)("option",{value:a,children:`Thinking: ${a.charAt(0).toUpperCase()+a.slice(1)}`},a))})]}),bH.showToolbar&&(a=(bH.showBulkControls?[...bB,...aV.filter(a=>!bB.some(b=>b.id===a.id))].filter(a=>{let b=(0,l.CP)(a);return!b||"llm"===b}).map(a=>a.id):[]).filter(a=>!bU(a)),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[bH.showImport&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:bf?"progress_activity":"cloud_download",onClick:cg,disabled:bf||!bG,title:bG?"Import models from the active connection":"Add an active connection to import models",children:bf?"Importing...":"Import models"}),bH.showVerify&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:bl?.status==="running"?"progress_activity":"science",onClick:()=>bk(a=>!a),children:bl?.status==="running"?`Verifying ${bl.done}/${bl.total}`:bj?"Hide verify":"Verify models"}),bH.showBulkControls&&aX.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:bZ,children:"Active All"}),bH.showBulkControls&&a.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>bY(a),children:"Disable All"})]}))]}),!!av&&(0,d.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:av}),"zed"===n&&!!ax&&(0,d.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:ax}),bh&&(0,d.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-2 rounded-xl border border-primary/30 bg-primary/10 px-3.5 py-2 text-xs font-medium text-text-main",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"info"}),(0,d.jsx)("span",{children:bh})]}),(0,d.jsx)("button",{onClick:()=>bi(""),className:"text-text-muted hover:text-text-main p-0.5 rounded",title:"Dismiss",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]}),bj&&(b=p.find(a=>r.includes(a.id)&&!1!==a.isActive)||p.find(a=>!1!==a.isActive),c=[...(0,D.R3)({customModels:ah,modelAliases:af,providerAlias:bR,builtInModels:bB,type:"llm"}).filter(a=>!bU(a.id)).map(a=>({id:a.id,name:a.name||a.id,kind:"llm"})),...bB.filter(a=>{let b=(0,l.CP)(a);return(!b||"llm"===b)&&!bU(a.id)}).map(a=>({id:a.id,name:a.name||a.id,kind:"llm"}))],(0,d.jsx)(_,{connectionId:b?.id,providerAlias:bR,models:c,jobSnapshot:bl,onClose:()=>bk(!1),onStarted:a=>{bm(a&&a.status?a:null);let c=a?.connectionId||b?.id;c&&cb(c)},onComplete:async a=>{a?.removedStatus&&bm(b=>b?{...b,dead:Number(a.dead??b.dead??0),retryable:Number(a.retryable??b.retryable??0),retryableAuthOnly:!0===a.retryableAuthOnly}:b),a?.removed>0&&await b_(),a?.removed>0&&await bV(),(a?.removed>0||a?.cacheCleared)&&await b1(b?.id)}})),(()=>{let a,b,c;if(bF)return(0,d.jsx)(L,{providerStorageAlias:bR,providerDisplayAlias:bS,modelAliases:af,customModels:ah,copied:bt,onCopy:bu,onSetAlias:cc,onDeleteAlias:cd,onAddCustomModel:a=>ce(a,"llm",bR),onDeleteCustomModel:a=>cf(a,"llm",bR),onRefreshModels:b_,connections:p,isAnthropic:bE,disabledModelIds:aX,onEnableModel:bX});let e=[...bB,...aV.filter(a=>!bB.some(b=>b.id===a.id))].filter(a=>{let b=(0,l.CP)(a);return!b||"llm"===b}),f=e.filter(a=>!bU(a.id)),g=e.filter(a=>bU(a.id)),h=(0,D.R3)({customModels:ah,modelAliases:af,providerAlias:bR,builtInModels:bB,type:"llm"}),i=h.filter(a=>!bU(a.id)&&("all"===br||(bp[(0,al.v)(a.id,bR)]||null)===br)),j=f.filter(a=>"all"===br||(bp[(0,al.v)(a.id,bR)]||null)===br);return(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("div",{className:"mb-2 flex flex-wrap items-center gap-1.5 text-xs",children:[{id:"all",label:"All",count:f.length+h.filter(a=>!bU(a.id)).length},{id:"ok",label:"Reachable",count:[...f,...h].filter(a=>!bU(a.id)&&("ok"===bp[(0,al.v)(a.id,bR)]||"ok"===at[a.id])).length},{id:"dead",label:"Dead",count:[...f,...h].filter(a=>!bU(a.id)&&("dead"===bp[(0,al.v)(a.id,bR)]||"error"===at[a.id])).length},{id:"retry",label:"Retry",count:[...f,...h].filter(a=>!bU(a.id)&&"retry"===bp[(0,al.v)(a.id,bR)]).length}].map(a=>(0,d.jsxs)("button",{onClick:()=>bs(a.id),className:`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium transition-all ${br===a.id?"bg-primary text-black font-semibold shadow-sm":"bg-surface-2/60 border border-border/40 text-text-muted hover:border-border hover:text-text-main"}`,children:[(0,d.jsx)("span",{children:a.label}),(0,d.jsx)("span",{className:`rounded-full px-1.5 py-0.2 text-[10px] tabular-nums ${br===a.id?"bg-black/20 text-black font-bold":"bg-black/10 dark:bg-white/10 text-text-muted"}`,children:a.count})]},a.id))}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[i.map(a=>{let b=(0,al.v)(a.id,bR);return(0,d.jsx)(H,{model:{id:a.id,name:a.name},fullModel:`${bS}/${a.id}`,alias:a.alias,copied:bt,onCopy:bu,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===a.source?cf(a.id,"llm",bR):cd(a.alias)},testStatus:at[a.id],onTest:p.length>0||bz?()=>cr(a.id):void 0,isTesting:az.has(a.id),isCustom:!0,isFree:!1,caps:o(`${n}/${a.id}`),thinkingSuffix:bP(a.id),latencyMs:bn[a.id]??bn[b],probeState:bl?.status==="running"&&bl?.perModel?.[b]?bl.perModel[b]:bp[b]||null},`${a.source}-${a.fullModel}`)}),j.map(a=>{let b=`${bR}/${a.id}`,c=`${n}/${a.id}`,e=Object.entries(af).find(([,a])=>a===b||a===c)?.[0],f=(0,al.v)(a.id,bR);return(0,d.jsx)(H,{model:a,fullModel:`${bS}/${a.id}`,alias:e,copied:bt,onSetAlias:b=>cc(a.id,b,bR),onCopy:bu,onDeleteAlias:()=>cd(e),testStatus:at[a.id],onTest:p.length>0||bz?()=>cr(a.id):void 0,isTesting:az.has(a.id),isFree:a.isFree,onDisable:()=>bW(a.id),caps:o(`${n}/${a.id}`),thinkingSuffix:bP(a.id),latencyMs:bn[a.id]??bn[f],probeState:bl?.status==="running"&&bl?.perModel?.[f]?bl.perModel[f]:bp[f]||null},a.id)}),(0,d.jsxs)("button",{onClick:()=>aC(!0),className:"flex min-h-[58px] min-w-[200px] flex-1 items-center justify-center gap-2 rounded-xl border border-dashed border-primary/40 bg-primary/5 px-4 py-3 text-xs font-medium text-primary transition-all hover:border-primary hover:bg-primary/10 hover:shadow-soft sm:flex-none",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add_circle"}),"Add Custom Model"]}),aR.length>0&&(a=new Set([...Object.values(af),...h.map(a=>a.fullModel)]),b=new Set(bB.map(a=>a.id)),0===(c=aR.filter(c=>!a.has(`${bR}/${c.id}`)&&!b.has(c.id))).length?null:(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(a=>(0,d.jsxs)("button",{onClick:async()=>{await ce(a.id,"llm",bR)},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:`${a.name} \xb7 ${(a.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id.split("/").pop()]},a.id))})]})),g.length>0&&(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",g.length,"):"]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:g.map(a=>(0,d.jsxs)("button",{onClick:()=>bX(a.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,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id]},a.id))})]})]})]})})()]}),"kiro"===n?(0,d.jsx)(j.Mh,{isOpen:x,providerInfo:bv,onSuccess:cj,onClose:()=>y(!1)}):"cursor"===n?(0,d.jsx)(j.G9,{isOpen:x,onSuccess:cj,onClose:()=>y(!1)}):"zed"===n?(0,d.jsx)(j.TE,{isOpen:x,providerInfo:bv,onSuccess:cj,onClose:()=>y(!1)}):"gitlab"===n?(0,d.jsx)(j.vj,{isOpen:x,providerInfo:bv,onSuccess:cj,onClose:()=>y(!1)}):(0,d.jsx)(j.LF,{isOpen:x,provider:n,providerInfo:bv,onSuccess:cj,onClose:()=>y(!1)}),"iflow"===n&&(0,d.jsx)(j.vE,{isOpen:F,onSuccess:()=>{b0(),G(!1)},onClose:()=>G(!1)}),(0,d.jsx)(Q,{isOpen:J,provider:n,providerName:bv.name,isCompatible:bF,isAnthropic:bE,authType:bv?.authType,authHint:bv?.authHint,website:bv?.website,error:M,onSave:ck,onBulkDone:b0,onClose:()=>{N(""),K(!1)}}),(0,d.jsx)(j.wI,{isOpen:Y,connection:ac,onSave:cl,onClose:()=>$(!1)}),bF&&(0,d.jsx)(S,{isOpen:aa,node:v,onSave:b2,onClose:()=>ab(!1),isAnthropic:bE}),!bF&&(0,d.jsx)(U,{isOpen:aB,providerAlias:bR,providerDisplayAlias:bS,onSave:async(a,b,c,d)=>{await ce(a,c||"llm",bR,b,d),aC(!1)},onClose:()=>aC(!1)}),"codex"===n&&(0,d.jsx)(W,{isOpen:P,onClose:()=>T(!1),onSuccess:b0}),"grok-cli"===n&&(0,d.jsx)(Z,{isOpen:V,onClose:()=>X(!1),onSuccess:b0}),aP&&(0,d.jsx)(aj.A,{isOpen:!!aP,onClose:()=>aQ(null),connection:aP,reactive:!0===aN.connections[aP.id],schedule:aN.schedules?.[aP.id]||null,onSave:a=>((a,{reactive:b,schedule:c})=>{ca({...aN,connections:{...aN.connections,[a]:b},schedules:{...aN.schedules,[a]:c}})})(aP.id,a)}),(0,d.jsx)(j.uo,{isOpen:a_,onClose:()=>a0(!1),onConfirm:()=>{(a0(!1),bx)?bL():bN()},title:"Risk Notice",message:bv?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,d.jsx)(j.uo,{isOpen:!!aZ,onClose:()=>a$(null),onConfirm:aZ?.onConfirm,title:aZ?.title||"Confirm",message:aZ?.message,variant:"danger"})]}):(0,d.jsxs)("div",{className:"text-center py-20",children:[(0,d.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,d.jsx)(h(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},22588:(a,b,c)=>{"use strict";c.d(b,{T:()=>f});let d=Symbol("delete-provider-strategy"),e=Promise.resolve();async function f(a,b,c=fetch){let d=e.then(()=>g(a,b,c));return e=d.catch(()=>{}),d}async function g(a,b,c){let e=await c("/api/settings",{cache:"no-store"});if(!e.ok)throw Error(`Failed to load settings (${e.status})`);let f=(await e.json()).providerStrategies||{},g=f[a]||{},h=b(g);if(void 0===h)return console.warn(`[patchProviderStrategy] updater for "${a}" returned undefined; keeping previous entry`),g;let i={...f};h===d?delete i[a]:h&&Object.keys(h).length>0?i[a]=h:delete i[a];let j=await c("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:i})});if(!j.ok)throw Error(`Failed to save settings (${j.status})`);return h===d?void 0:h}},24889:(a,b,c)=>{Promise.resolve().then(c.bind(c,17634))},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},38522:a=>{"use strict";a.exports=require("node:zlib")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},54589:(a,b,c)=>{"use strict";function d(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}c.d(b,{JW:()=>i,Vm:()=>d,fB:()=>f,gy:()=>e,nz:()=>g});let e={anchor:"09:30",timezone:d(),windowHours:5,slotsPerDay:3};function f(a){let b=/^(\d{1,2}):(\d{2})$/.exec(String(a||"").trim());if(!b)return null;let c=Number(b[1]),d=Number(b[2]);return c>23||d>59?null:{hour:c,minute:d}}function g(a){return Math.max(1,Math.floor(24/a))}function h(a,b,c,d){let e="number"==typeof a?a:Number(a);return Number.isFinite(e)?Math.min(d,Math.max(c,e)):b}function i(a){let b=function(a){if(!a||!0!==a.enabled)return null;let b=f(a.anchor)||f(e.anchor),c=`${String(b.hour).padStart(2,"0")}:${String(b.minute).padStart(2,"0")}`,d=!function(a){if(!a||"string"!=typeof a)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:a}),!0}catch{return!1}}(a.timezone)?e.timezone:a.timezone,i=h(a.windowHours,e.windowHours,.5,24),j=Math.round(h(a.slotsPerDay,e.slotsPerDay,1,g(i)));return{enabled:!0,anchor:c,timezone:d,windowHours:i,slotsPerDay:j}}(a);if(!b)return[];let{hour:c,minute:d}=f(b.anchor),i=60*c+d;return Array.from({length:b.slotsPerDay},(a,c)=>{let d=Math.round(i+c*b.windowHours*60)%1440;return`${String(Math.floor(d/60)).padStart(2,"0")}:${String(d%60).padStart(2,"0")}`})}},54918:(a,b,c)=>{"use strict";async function d(a,b){let c=await fetch(a,{...b,headers:{"Content-Type":"application/json",...b?.headers||{}},credentials:"same-origin"}),d=null;try{d=await c.json()}catch{d=null}if(!c.ok){let a=d&&(d.error||d.message)||`Request failed (${c.status})`,b=Error("string"==typeof a?a:"Request failed");throw b.status=c.status,b.data=d,b}return d}c.d(b,{x:()=>d})},55511:a=>{"use strict";a.exports=require("crypto")},56020:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(71404),j=c(54589);let k=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function l({isOpen:a,onClose:b,onSave:c,connection:f,reactive:g=!1,schedule:m=null}){let[n,o]=(0,e.useState)(()=>({mode:m?.enabled===!0?"schedule":!0===g?"reset":"off",anchor:m?.anchor||j.gy.anchor,timezone:(0,j.Vm)(),windowHours:String(m?.windowHours??j.gy.windowHours),slotsPerDay:String(m?.slotsPerDay??j.gy.slotsPerDay)})),p=Number(n.windowHours),q=Number(n.slotsPerDay),r=!!(0,j.fB)(n.anchor),s=Number.isFinite(p)&&p>=.5&&p<=24,t=s?(0,j.nz)(p):24,u=Number.isInteger(q)&&q>=1&&q<=t,v=r&&s&&u,w="schedule"!==n.mode||v,x=v?(0,j.JW)({enabled:!0,...n,windowHours:p,slotsPerDay:q}):[],y=x.length&&s?(()=>{let{hour:a,minute:b}=(0,j.fB)(n.anchor),c=Math.round(60*a+b+q*p*60)%1440;return`${String(Math.floor(c/60)).padStart(2,"0")}:${String(c%60).padStart(2,"0")}`})():"",z=a=>o(b=>({...b,...a}));return(0,d.jsx)(h.aF,{isOpen:a,onClose:b,title:"Auto-ping settings",size:"lg",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$n,{variant:"secondary",onClick:b,children:"Cancel"}),(0,d.jsx)(h.$n,{onClick:()=>{w&&(c({reactive:"reset"===n.mode,schedule:"schedule"===n.mode?{enabled:!0,anchor:n.anchor,timezone:n.timezone,windowHours:p,slotsPerDay:q}:{enabled:!1}}),b())},disabled:!w,children:"Save"})]}),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",f?.name?` for ${f.name}`:""," — pick one mode."]}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:k.map(a=>{let b=n.mode===a.value;return(0,d.jsxs)("button",{type:"button",onClick:()=>z({mode:a.value}),className:(0,i.cn)("flex h-9 items-center justify-center gap-1.5 rounded-[8px] px-3 text-sm font-medium transition-all",b?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:a.icon}),(0,d.jsx)("span",{children:a.label})]},a.value)})}),"reset"===n.mode&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===n.mode&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,d.jsx)(h.pd,{label:"Anchor time",type:"time",value:n.anchor,onChange:a=>z({anchor:a.target.value}),error:r?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:n.windowHours,onChange:a=>z({windowHours:a.target.value}),error:s?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Pings per day",type:"number",min:"1",max:String(t),step:"1",value:n.slotsPerDay,onChange:a=>z({slotsPerDay:a.target.value}),error:u?"":`1 – ${t}`,hint:u?`Max ${t}`:"",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"})]}),x.length>0&&(0,d.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,d.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",n.timezone,")"]}),(0,d.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:x.join(" → ")}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",x[0]," – ",y,", then pauses until ",x[0]," next day."]})]})]})]})})}l.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSave:g().func.isRequired,connection:g().object,reactive:g().bool,schedule:g().object}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},72089:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},73024:a=>{"use strict";a.exports=require("node:fs")},74875:(a,b,c)=>{"use strict";function d(a){return"error"===a||"expired"===a||"unavailable"===a||"reauth_required"===a||"invalid"===a}function e(a,b){return!1===a?"default":"active"===b||"success"===b?"success":d(b)?"error":"default"}c.d(b,{g:()=>e,t:()=>d})},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78405:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>z,handler:()=>B,routeModule:()=>A});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,32059))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,30508))),o=(0,d.p)(()=>Promise.resolve().then(c.bind(c,57097))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),t=(0,d.p)(()=>Promise.resolve().then(c.bind(c,70160))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),v=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),w=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),x={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,93110))),"/home/runner/work/switchboard-router/switchboard-router/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[w,"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[v,"next/dist/client/components/builtin/global-error.js"]},[]]},{loading:[t,"/home/runner/work/switchboard-router/switchboard-router/src/app/(dashboard)/dashboard/loading.js"],"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/home/runner/work/switchboard-router/switchboard-router/src/app/(dashboard)/layout.js"],error:[o,"/home/runner/work/switchboard-router/switchboard-router/src/app/(dashboard)/error.js"],"global-error":[p,"next/dist/client/components/builtin/global-error.js"],"not-found":[q,"next/dist/client/components/builtin/not-found.js"],forbidden:[r,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[s,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/home/runner/work/switchboard-router/switchboard-router/src/app/layout.js"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,y=(0,e.H)({tree:x,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),z=y.__next_app__,A=y.routeModule,B=y.handler},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},93110:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/switchboard-router/switchboard-router/src/app/(dashboard)/dashboard/providers/[id]/page.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/switchboard-router/switchboard-router/src/app/(dashboard)/dashboard/providers/[id]/page.js","default")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,2430,4160,2712,5137,232,9662,5350,869,2142,5781,9353,2766,7757,6544,4041,5624],()=>b(b.s=78405));module.exports=c})();
|
|
28
|
+
]`;function Y(a){let b,c=a.trim();if(!c)return[];try{b=JSON.parse(c)}catch(a){try{let a=c;a.startsWith("[")||((a=a.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(a=a.slice(0,-1)),a=`[${a}]`),b=JSON.parse(a)}catch{throw a}}if(Array.isArray(b))return b;if(b&&"object"==typeof b)return Array.isArray(b.accounts)?b.accounts:[b];throw Error("Input must be a JSON object or array of objects")}function Z({isOpen:a,onClose:b,onSuccess:c}){let[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[k,l]=(0,e.useState)(""),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=()=>{h||(g(""),l(""),n(null),r(null),p(!1),b())},u=async a=>{if(!a||0===a.length)return;l("");let b=Array.from(a).filter(a=>a.name.endsWith(".json")||"application/json"===a.type||""===a.type);if(0===b.length)return void l((0,C.Tl)("Please select valid .json files"));try{let a=[];for(let c of b){let b=await c.text(),d=Y(b);Array.isArray(d)?a.push(...d):d&&a.push(d)}if(0===a.length)return void l((0,C.Tl)("No accounts found in selected files"));g(JSON.stringify(a,null,2)),r({filesCount:b.length,accountsCount:a.length})}catch(a){l(`${(0,C.Tl)("Error reading files")}: ${a.message}`)}},v=async()=>{let a;l(""),n(null);try{a=Y(f)}catch(a){l(`${(0,C.Tl)("Invalid JSON")}: ${a.message}`);return}if(!a||0===a.length)return void l((0,C.Tl)("No accounts found in input"));i(!0);try{let b=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:a})}),d=await b.json();if(!b.ok)return void l(d?.error||`Request failed: ${b.status}`);n(d),d.success>0&&"function"==typeof c&&c()}catch(a){l(a.message||(0,C.Tl)("Request failed"))}finally{i(!1)}},w=m?.results?.filter(a=>!a.ok)||[];return(0,d.jsx)(j.aF,{isOpen:a,title:(0,C.Tl)("Bulk Add Grok CLI Accounts"),onClose:t,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,C.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,d.jsx)("input",{ref:s,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:a=>{u(a.target.files),a.target&&(a.target.value="")}}),(0,d.jsx)(j.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>s.current?.click(),disabled:h,children:(0,C.Tl)("Upload JSON Files")})]}),(0,d.jsxs)("div",{onDragOver:a=>{a.preventDefault(),p(!0)},onDragLeave:a=>{a.preventDefault(),p(!1)},onDrop:a=>{a.preventDefault(),p(!1),a.dataTransfer?.files?.length>0&&u(a.dataTransfer.files)},className:`relative rounded border transition-colors ${o?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,d.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:X,value:f,onChange:a=>{g(a.target.value),r(null)},disabled:h}),o&&(0,d.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-sidebar/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,d.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,C.Tl)("Drop .json files here")})]})]}),q&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-green-400 font-medium bg-green-500/10 border border-green-500/20 px-2.5 py-1.5 rounded",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,d.jsxs)("span",{children:[(0,C.Tl)("Loaded")," ",q.accountsCount," ",(0,C.Tl)("account(s) from")," ",q.filesCount," ",(0,C.Tl)("file(s)")]})]}),k&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:k}),m&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:`text-sm font-medium ${m.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",m.success," ",(0,C.Tl)("added"),m.failed>0?`, ✗ ${m.failed} ${(0,C.Tl)("failed")}`:""]}),w.length>0&&(0,d.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:w.map(a=>(0,d.jsxs)("li",{className:"text-red-400",children:["[",a.index,"] ",a.error]},a.index))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:v,fullWidth:!0,disabled:h||!f.trim(),children:h?(0,C.Tl)("Importing..."):(0,C.Tl)("Import All")}),(0,d.jsx)(j.$n,{onClick:t,variant:"ghost",fullWidth:!0,disabled:h,children:(0,C.Tl)("Close")})]})]})})}Z.propTypes={isOpen:G().bool.isRequired,onClose:G().func.isRequired,onSuccess:G().func};var $=c(78097);function _({connectionId:a,providerAlias:b,models:c,jobSnapshot:f,onComplete:g,onStarted:h,onClose:i}){let[k,l]=(0,e.useState)(4),[m,n]=(0,e.useState)(50),[o,p]=(0,e.useState)(Math.round(20)),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)(""),C=(0,e.useRef)({onComplete:g,onStarted:h}),D=(0,e.useRef)(null),E=(0,e.useRef)(a),F=(0,e.useRef)(null),G=c?.length||0,H=(0,e.useMemo)(()=>`max concurrency 16 \xb7 batch 200 \xb7 timeout ${60}s`,[]);async function I(){if(q||!a||0===G)return;r(!0),x(""),v(null),z("Starting…");let d={concurrency:Math.max(1,Math.min(16,Number(k)||4)),batchSize:Math.max(1,Math.min(200,Number(m)||50)),timeoutMs:Math.max(1e3,Math.min(6e4,1e3*(Number(o)||20)))};F.current=a;try{let e=await fetch(`/api/providers/${a}/model-probes/verify/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:c,providerAlias:b,...d,timeoutMs:d.timeoutMs})}),f=await e.json().catch(()=>({}));if(E.current!==a){F.current=null,r(!1);return}if(!e.ok){F.current=null,x(f.error||"Failed to start"),r(!1);return}C.current.onStarted?.(f),function(a){if(a){if("idle"===a.status){F.current=null,r(!1);return}if(t({done:a.done||0,total:a.total||0,ok:a.ok||0,dead:a.dead||0,retryable:a.retryable||0,skippedDead:a.skippedDead||0,skippedDup:a.skippedDup||0}),"running"===a.status&&(F.current=a.connectionId||E.current,D.current=null,r(!0)),a.currentRange&&z(`Probing ${a.currentRange.from}–${a.currentRange.to} of ${a.total}…`),a.error&&x(a.error),"done"===a.status||"cancelled"===a.status||"error"===a.status){F.current=null,r(!1);let b={ok:a.ok||0,dead:a.dead||0,retryable:a.retryable||0,tested:a.done||0,skippedDead:a.skippedDead||0,skippedDup:a.skippedDup||0,cancelled:"cancelled"===a.status,retryableAuthOnly:!0===a.retryableAuthOnly};v(b),z("cancelled"===a.status?"Cancelled (partial results saved).":"error"===a.status?"Stopped.":"Done.");let c=`${a.startedAt||"unknown"}:${a.status}`;D.current!==c&&(D.current=c,C.current.onComplete?.(b))}}}(f),"running"!==f.status&&r(!1)}catch(a){F.current=null,x(a?.message||"Verify failed"),r(!1)}}async function J(){let b=F.current||a;await fetch(`/api/providers/${b}/model-probes/verify/cancel`,{method:"POST"}).catch(()=>{})}async function K(c){if(!a)return;let d="retryable"===c,e=d?Number(u?.retryable||0):Number(u?.dead||0);if(!d||await (0,$.l)({title:"Remove retry-failed models?",message:`Review ${e} retryable result(s) and remove the eligible models? Timeouts, rate limits, network failures, and provider errors may be temporary. Credential failures are kept. Removed models can be enabled or imported again later.`,confirmText:"Remove eligible"})){B(c),x(""),z(`Removing ${d?"retry-failed":"dead"} models…`);try{let e=await fetch(`/api/providers/${a}/model-probes/remove-unavailable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:b,kind:"llm",status:c})}),f=await e.json().catch(()=>({}));if(!e.ok)return void x(f.error||"Remove failed");let g=Number(f.removed||0),h=Number(f.kept||0),i=u?{...u,[d?"retryable":"dead"]:h,...d?{retryableAuthOnly:h>0}:{}}:u;v(i),z(`Removed ${g} ${d?"retry-failed":"dead"} model(s).`+(h>0?` Kept ${h} credential failure(s).`:"")),C.current.onComplete?.({...i||{},removed:g,kept:h,removedStatus:c})}catch(a){x(a?.message||"Remove failed")}finally{B("")}}}async function L(){if(!a)return;let b=await fetch(`/api/providers/${a}/model-probes/cache`,{method:"DELETE"}),c=await b.json().catch(()=>({}));b.ok?(z(`Cleared probe cache (${c.cleared||0} rows). Next verify will re-test everything.`),v(null),t(null),C.current.onComplete?.({cacheCleared:!0,cleared:c.cleared||0})):x(c.error||"Clear cache failed")}let M=s?.total?Math.min(100,Math.round(s.done/s.total*100)):0;return(0,d.jsxs)("div",{className:"mb-4 rounded-lg border border-border bg-sidebar/40 p-3 space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Verify models"}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted mt-0.5",children:["Batch-ping availability and latency. Dead = permanently unavailable (missing, blocked, or deprecated) and can be removed; retry = transient (timeout/429/5xx). Known-dead models are skipped until you Clear cache. Caps: ",H,"."]})]}),i&&(0,d.jsx)("button",{type:"button",onClick:i,className:"p-1 text-text-muted hover:text-text-main rounded",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-3 items-end",children:[(0,d.jsxs)("label",{className:"text-xs text-text-muted",children:["Concurrency",(0,d.jsx)("input",{type:"number",min:1,max:16,value:k,disabled:q,onChange:a=>l(a.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,d.jsxs)("label",{className:"text-xs text-text-muted",children:["Batch size",(0,d.jsx)("input",{type:"number",min:1,max:200,value:m,disabled:q,onChange:a=>n(a.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,d.jsxs)("label",{className:"text-xs text-text-muted",children:["Timeout (s)",(0,d.jsx)("input",{type:"number",min:1,max:60,value:o,disabled:q,onChange:a=>p(a.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[q?(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"stop",onClick:J,children:"Cancel"}):(0,d.jsx)(j.$n,{size:"sm",icon:"science",onClick:I,disabled:!a||0===G,children:"Start"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"delete_sweep",onClick:L,disabled:q,children:"Clear cache"})]})]}),s&&(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("div",{className:"h-1.5 w-full rounded-full bg-border overflow-hidden",children:(0,d.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${M}%`}})}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted flex flex-wrap gap-x-2",children:[(0,d.jsxs)("span",{title:"Models probed this run",children:[s.done,"/",s.total," tested"]}),(0,d.jsxs)("span",{title:"Reachable",children:["\xb7 ok ",s.ok]}),(0,d.jsxs)("span",{title:"Permanently unavailable this run (missing, blocked, or deprecated)",children:["\xb7 dead ",s.dead]}),(0,d.jsxs)("span",{title:"Transient failure this run (timeout / 429 / 5xx / network); re-testable",children:["\xb7 retry ",s.retryable]}),s.skippedDead?(0,d.jsxs)("span",{title:"Not probed — cache already marks them dead. Clear cache to re-test.",children:["\xb7 skipped known-dead ",s.skippedDead]}):null,s.skippedDup?(0,d.jsxs)("span",{title:"Duplicate ids collapsed",children:["\xb7 dupes ",s.skippedDup]}):null]})]}),y&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:y}),w&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:w}),u&&(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[(0,d.jsxs)("span",{className:"text-xs text-text-main",children:["Summary: ",u.ok," ok \xb7 ",u.dead," dead \xb7 ",u.retryable," retry",u.skippedDead?` \xb7 ${u.skippedDead} skipped known-dead`:"",u.cancelled?" \xb7 cancelled":""]}),u.dead>0&&(0,d.jsxs)(j.$n,{size:"sm",variant:"primary",icon:"delete_sweep",onClick:()=>K("dead"),disabled:q||!!A,loading:"dead"===A,children:["Remove ",u.dead," dead"]}),u.retryable>0&&!u.retryableAuthOnly&&(0,d.jsxs)(j.$n,{size:"sm",variant:"danger",icon:"delete_sweep",onClick:()=>K("retryable"),disabled:q||!!A,loading:"retryable"===A,children:["Remove ",u.retryable," retry failures"]})]})]})}_.propTypes={connectionId:G().string,providerAlias:G().string,models:G().arrayOf(G().object),jobSnapshot:G().object,onComplete:G().func,onStarted:G().func,onClose:G().func};var aa=c(81847);let ab=["UTC","America/Los_Angeles","America/Denver","America/Chicago","America/New_York","America/Sao_Paulo","Europe/London","Europe/Berlin","Europe/Moscow","Asia/Kolkata","Asia/Shanghai","Asia/Tokyo","Asia/Singapore","Australia/Sydney"],ac=(()=>{let a=[];try{a=Intl.supportedValuesOf?.("timeZone")||[]}catch{a=[]}try{let a=Intl.DateTimeFormat().resolvedOptions().timeZone;a&&!ab.includes(a)&&ab.unshift(a)}catch{}return[...new Set([...ab,...a.filter(a=>!ab.includes(a))])]})(),ad={mon:"Mo",tue:"Tu",wed:"We",thu:"Th",fri:"Fr",sat:"Sa",sun:"Su"};function ae({providerId:a,scheduleKey:b}){let c=b||a,f=(0,e.useId)(),[g,h]=(0,e.useState)(!1),[i,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)("UTC"),[n,o]=(0,e.useState)("offPeak"),[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(""),[v,w]=(0,e.useState)(0),[,x]=(0,e.useState)(0),y=(0,e.useCallback)(a=>{let b=aa.Z9.find(b=>b.id===a);b&&(m(b.config.timezone||"UTC"),o("peak"===b.config.defaultState?"peak":"offPeak"),q(b.config.windows.map(a=>({type:a.type,start:a.start,end:a.end,days:Array.isArray(a.days)&&a.days.length?[...a.days]:[...aa.de]}))),w(0))},[]),z=(0,e.useMemo)(()=>i?{timezone:l,defaultState:n,windows:p}:null,[i,l,n,p]),A=(0,aa.yW)(z),B="unscheduled"===A?null:(0,aa.bC)(z),C=(0,e.useCallback)((a,b)=>{q(c=>c.map((c,d)=>d===a?{...c,...b}:c)),w(0)},[]),D=(0,e.useCallback)((a,b)=>{q(c=>c.map((c,d)=>{if(d!==a)return c;let e=c.days.includes(b)?c.days.filter(a=>a!==b):[...c.days,b];return{...c,days:e.length?e:c.days}})),w(0)},[]),E=async()=>{u("");let b=i?(0,aa.v2)({timezone:l,defaultState:n,windows:p},a):null;if(i&&b.error)return void u(b.error);s(!0);try{let a=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSchedules:{[c]:i?b.value:null}})});if(!a.ok){let b=await a.json().catch(()=>({}));u(b.error||`Failed to save peak hours (${a.status})`);return}w(Date.now())}catch{u("Failed to save peak hours")}finally{s(!1)}};return g?(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Peak hours"}),"unscheduled"!==A&&(0,d.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium ${"peak"===A?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-green-500/10 text-green-600 dark:text-green-400"}`,title:B?`Changes at ${function(a,b){try{return new Intl.DateTimeFormat("en-US",{timeZone:b,weekday:"short",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(new Date(a))}catch{return a}}(new Date(B).toISOString(),l)}`:void 0,children:[(0,d.jsx)("span",{className:`size-1.5 rounded-full ${"peak"===A?"bg-red-500":"bg-green-500"}`}),"peak"===A?"Peak now":"Off-peak now",B?` \xb7 ${(0,aa.zt)(B-Date.now())} left`:""]})]}),(0,d.jsx)(j.lM,{checked:i,onChange:a=>{k(a),w(0),a&&!p.length&&(m("UTC"),o("offPeak"),q([{type:"peak",start:"09:00",end:"17:00",days:[...aa.de]}]))},label:"Enable peak / off-peak hours",size:"sm"})]}),(0,d.jsx)("p",{className:"mb-3 text-xs text-text-muted leading-relaxed",children:"Optional. Some providers (e.g. DeepSeek) charge less outside peak hours. Define this provider's windows once, then mark models in a combo as peak-only or off-peak-only to skip them at the wrong hours."}),i&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsx)("label",{htmlFor:f,className:"text-sm font-medium text-text-main",children:"Timezone"}),(0,d.jsx)("input",{id:f,list:`${f}-zones`,value:l,onChange:a=>{m(a.target.value),w(0)},placeholder:"UTC — type to search IANA zones",className:"rounded-md border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",autoComplete:"off"}),(0,d.jsx)("datalist",{id:`${f}-zones`,children:ac.map(a=>(0,d.jsx)("option",{value:a},a))}),(0,d.jsx)("p",{className:"text-[10px] text-text-muted",children:"Windows are wall-clock in this zone (provider docs usually quote UTC)"})]}),(0,d.jsx)(j.l6,{label:"Outside all windows is",options:[{value:"offPeak",label:"Off-peak (peak is the exception)"},{value:"peak",label:"Peak (off-peak discount is the exception)"}],value:n,onChange:a=>{o(a.target.value),w(0)}})]}),(0,d.jsx)(j.l6,{label:"Load a preset",options:aa.Z9.map(a=>({value:a.id,label:a.label})),value:"",onChange:a=>y(a.target.value),placeholder:"Choose a known provider policy…",hint:"Fills the editor below — review the provider's current pricing page, then Save"}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[p.map((a,b)=>(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2 rounded-md border border-border bg-black/[0.02] px-2 py-2 dark:bg-white/[0.02]",children:[(0,d.jsxs)("select",{value:a.type,onChange:a=>C(b,{type:a.target.value}),className:"rounded-md border border-border bg-background px-2 py-1 text-xs","aria-label":`Window ${b+1} type`,children:[(0,d.jsx)("option",{value:"peak",children:"Peak"}),(0,d.jsx)("option",{value:"offPeak",children:"Off-peak"})]}),(0,d.jsx)("input",{type:"time",value:a.start,onChange:a=>C(b,{start:a.target.value}),className:"rounded-md border border-border bg-background px-2 py-1 text-xs","aria-label":`Window ${b+1} start`}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"→"}),(0,d.jsx)("input",{type:"time",value:a.end,onChange:a=>C(b,{end:a.target.value}),className:"rounded-md border border-border bg-background px-2 py-1 text-xs","aria-label":`Window ${b+1} end`}),(0,d.jsx)("div",{className:"flex items-center gap-1",children:aa.de.map(c=>(0,d.jsx)("button",{type:"button",onClick:()=>D(b,c),className:`size-6 rounded text-[10px] font-medium transition-colors ${a.days.includes(c)?"bg-primary/15 text-primary":"text-text-muted hover:bg-black/5 dark:hover:bg-white/5"}`,title:c,children:ad[c]},c))}),(0,d.jsx)("button",{type:"button",onClick:()=>{q(a=>a.filter((a,c)=>c!==b)),w(0)},className:"ml-auto rounded p-1 text-text-muted transition-colors hover:bg-red-500/10 hover:text-red-500",title:"Remove window","aria-label":`Remove window ${b+1}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},b)),(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>{q(a=>[...a,{type:"peak",start:"09:00",end:"17:00",days:[...aa.de]}]),w(0)},children:"Add window"})})]})]}),t&&(0,d.jsx)("p",{className:"mt-2 text-xs text-red-500",children:t}),v>0&&!t&&(0,d.jsx)("p",{className:"mt-2 text-xs text-green-600 dark:text-green-400",children:"Saved"}),(0,d.jsx)("div",{className:"mt-3",children:(0,d.jsx)(j.$n,{size:"sm",onClick:E,disabled:r,children:r?"Saving...":i?"Save peak hours":"Save (disable schedule)"})})]}):null}var af=c(41371);let ag=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],ah=/^[A-Za-z0-9-]+$/;function ai({providerId:a}){let b=(0,af.i)(),[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)([{name:"",value:""}]),[i,k]=(0,e.useState)({}),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(!1),p=(a,b,c)=>{h(d=>d.map((d,e)=>e===a?{...d,[b]:c}:d))},q=(0,e.useCallback)(async()=>{let c={};for(let a of g.filter(a=>a.name.trim())){let d=a.name.trim();if(!ah.test(d))return void b.error(`Invalid header name: ${d}`);if(ag.includes(d.toLowerCase()))return void b.error(`Header ${d} cannot be overridden`);if(d in c)return void b.error(`Duplicate header name: ${d}`);a.value!==i[d]&&(c[d]=a.value)}o(!0);try{let d=await fetch(`/api/providers/${a}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:c})});if(!d.ok){let a=await d.json().catch(()=>({}));b.error(a.error||"Failed to save");return}m(Object.keys(c).length>0),b.success("Custom headers saved")}catch{b.error("Failed to save custom headers. Check your connection and try again.")}finally{o(!1)}},[g,i,a,b]);return 0!==Object.keys(i).length||l?(0,d.jsxs)(j.Zp,{padding:"xs",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),className:"flex w-full items-center justify-between text-left",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,d.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),l&&(0,d.jsx)(j.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:c?"expand_less":"expand_more"})]}),c&&(0,d.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,d.jsx)("div",{className:"flex flex-col gap-2",children:g.map((a,b)=>{let c=a.name.trim()in i&&a.value!==i[a.name.trim()];return(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{value:a.name,onChange:a=>p(b,"name",a.target.value),placeholder:"Header-Name",spellCheck:!1,className:"w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none"}),(0,d.jsx)("input",{value:a.value,onChange:a=>p(b,"value",a.target.value),placeholder:"Value",spellCheck:!1,title:c?"Overridden":a.name.trim()in i?"Registry default":"",className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none ${c?"border-amber-400/60":"border-border"}`}),(0,d.jsx)("button",{type:"button",title:"Remove header",onClick:()=>h(a=>a.length>1?a.filter((a,c)=>c!==b):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},b)})}),(0,d.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>h(a=>[...a,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{type:"button",disabled:n,onClick:()=>{h(Object.entries(i).map(([a,b])=>({name:a,value:b})))},className:"rounded-md border border-border px-3 py-1.5 text-xs hover:bg-black/[0.03] dark:hover:bg-white/[0.03] disabled:opacity-50",children:"Reset"}),(0,d.jsx)("button",{type:"button",disabled:n,onClick:q,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:n?"Saving...":"Save"})]})]})]})]}):null}ai.propTypes={providerId:G().string.isRequired};var aj=c(56020),ak=c(54589),al=c(15279),am=c(54918),an=c(22588);let ao=new Set(["minimax-code","minimax-code-global"]),ap={claude:"claudeAutoPing",codex:"codexAutoPing"};function aq(){let a,b,c,g=(0,f.useParams)(),m=(0,f.useRouter)(),n=g.id,{getCaps:o}=(0,B.y)(),[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)([]),[t,u]=(0,e.useState)(!0),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(!1),[F,G]=(0,e.useState)(!1),[J,K]=(0,e.useState)(!1),[M,N]=(0,e.useState)(""),[P,T]=(0,e.useState)(!1),[V,X]=(0,e.useState)(!1),[Y,$]=(0,e.useState)(!1),[aa,ab]=(0,e.useState)(!1),[ac,ad]=(0,e.useState)(null),[af,ag]=(0,e.useState)({}),[ah,aq]=(0,e.useState)([]),[ar,as]=(0,e.useState)(!1),[at,au]=(0,e.useState)({}),[av,aw]=(0,e.useState)(""),[ax,ay]=(0,e.useState)(null),[az,aA]=(0,e.useState)(()=>new Set),[aB,aC]=(0,e.useState)(!1),[aD,aE]=(0,e.useState)(null),[aF,aG]=(0,e.useState)(""),[aH,aI]=(0,e.useState)(!1),[aJ,aK]=(0,e.useState)("30"),[aL,aM]=(0,e.useState)("auto"),[aN,aO]=(0,e.useState)({enabled:!1,connections:{},schedules:{}}),[aP,aQ]=(0,e.useState)(null),[aR,aS]=(0,e.useState)([]),[aT,aU]=(0,e.useState)([]),[aV,aW]=(0,e.useState)([]),[aX,aY]=(0,e.useState)([]),[aZ,a$]=(0,e.useState)(null),[a_,a0]=(0,e.useState)(!1),[a1,a2]=(0,e.useState)(!1),[a3,a4]=(0,e.useState)(!1),[a5,a6]=(0,e.useState)(null),[a7,a8]=(0,e.useState)({}),[a9,ba]=(0,e.useState)(null),bb=(0,e.useRef)(!1),bc=(0,e.useRef)(null),bd=(0,e.useRef)(0),be=(0,e.useRef)(0),[bf,bg]=(0,e.useState)(!1),[bh,bi]=(0,e.useState)(""),[bj,bk]=(0,e.useState)(!1),[bl,bm]=(0,e.useState)(null),[bn,bo]=(0,e.useState)({}),[bp,bq]=(0,e.useState)({}),[br,bs]=(0,e.useState)("all"),{copied:bt,copy:bu}=(0,A.C)(),bv=v?{id:v.id,name:v.name||("anthropic-compatible"===v.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===v.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===v.type?"AC":"OC",apiType:v.apiType,baseUrl:v.baseUrl,type:v.type}:k.zN[n]||k.fg[n]||k.IS[n]||k.nJ[n]||k.br[n],bw=bv?.authModes||[],bx=!!k.zN[n]||!!k.IS[n]||bw.includes("oauth"),by=!!k.fg[n]||bw.includes("apikey"),bz=!!k.IS[n]?.noAuth,bA=(0,l.KC)(n),bB=(()=>{let a=new Map(bA.map(a=>[a.id,a]));for(let b of aT)b?.id&&a.set(b.id,{...a.get(b.id),...b});return[...a.values()]})(),bC=(0,k.wG)(n),bD=(0,k.mq)(n),bE=(0,k.gb)(n),bF=bD||bE,bG=p.some(a=>!1!==a.isActive),bH=function({isCompatible:a,hasActiveConnection:b}){let c=!a,d=!a;return{showToolbar:c||b||d,showImport:c,showVerify:b,showBulkControls:d}}({isCompatible:bF,hasActiveConnection:bG}),bI=!bF&&bx&&by,bJ="xai"===n?"Grok Build OAuth":"OAuth",bK="xai"===n?"xAI API Key":"qoder"===n||"qoder-cn"===n?"PAT":"API Key",bL=()=>{y(!0)},bM=()=>{bx?bL():(N(""),K(!0))},bN=()=>{N(""),K(!0)},bO=()=>{bx?bM():bN()},bP=a=>{if(!aL||"auto"===aL)return null;let b=z(n,a);return b&&b.includes(aL)?aL:null},bQ=(()=>{let a=new Set;for(let b of bB){let c=z(n,b.id);c&&c.forEach(b=>{"none"!==b&&a.add(b)})}return a.size?["auto",...a]:null})(),bR=bF?n:bC,bS=bF?v?.prefix||n:bC,bT=(0,D.Iz)(aX,bR),bU=a=>(0,D.uJ)(bT,a,bR),bV=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bR)}`,{cache:"no-store"}),b=await a.json();a.ok&&aY(b.ids||[])}catch(a){(0,I.s)("Error fetching disabled models:",a)}},[bR]),bW=async a=>{try{await (0,am.x)("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bR,ids:[a]})}),await bV()}catch(a){(0,I.s)("Error disabling model:",a)}},bX=async a=>{try{return await (0,am.x)(`/api/models/disabled?providerAlias=${encodeURIComponent(bR)}&id=${encodeURIComponent(a)}`,{method:"DELETE"}),await bV(),!0}catch(a){return(0,I.s)("Error enabling model:",a),!1}},bY=async a=>{a.length&&a$({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{a$(null);try{await (0,am.x)("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bR,ids:a})}),await bV()}catch(a){(0,I.s)("Error disabling all models:",a)}}})},bZ=async()=>{try{await (0,am.x)(`/api/models/disabled?providerAlias=${encodeURIComponent(bR)}`,{method:"DELETE"}),await bV()}catch(a){(0,I.s)("Error enabling all models:",a)}},b$=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&ag(b.aliases||{})}catch(a){(0,I.s)("Error fetching aliases:",a)}},[]),b_=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/custom",{cache:"no-store"}),b=await a.json();a.ok&&aq(b.models||[])}catch(a){(0,I.s)("Error fetching custom models:",a)}},[]),b0=(0,e.useCallback)(async()=>{try{let[a,b,c]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),d=await a.json(),e=await b.json(),f=c.ok?await c.json():{};if(a.ok){let a=(d.connections||[]).filter(a=>a.provider===n);q(a)}let g=(f.providerStrategies||{})[n]||{};aE(g.fallbackStrategy||null),aG(null!=g.stickyRoundRobinLimit?String(g.stickyRoundRobinLimit):"1");let h=g.accountScheduler||{};aI(!0===h.enabled),aK(String(Math.max(1,Math.round((h.sessionAffinityTtlSeconds||1800)/60))));let i=(f.providerThinking||{})[n]||{};aM(i.mode||"auto");let j=ap[n],k=j&&f[j]||{};if(aO({enabled:!0===k.enabled,connections:k.connections||{},schedules:k.schedules||{}}),b.ok){let a=(e.nodes||[]).find(a=>a.id===n)||null;if(!a&&bF)for(let b=0;b<3;b+=1){await new Promise(a=>setTimeout(a,150));let b=await fetch("/api/provider-nodes",{cache:"no-store"});if(b.ok&&(a=((await b.json()).nodes||[]).find(a=>a.id===n)||null))break}w(a)}}catch(a){(0,I.s)("Error fetching connections:",a)}finally{u(!1)}},[n,bF]),b1=(0,e.useCallback)(async(a=null)=>{let b=++be.current,c=a?p.find(b=>b.id===a&&!1!==b.isActive):p.find(a=>r.includes(a.id)&&!1!==a.isActive)||p.find(a=>!1!==a.isActive);if(!c){bq({}),bo({});return}try{let a=await fetch(`/api/providers/${c.id}/model-probes`,{cache:"no-store"});if(!a.ok)return;let d=await a.json().catch(()=>({})),e={},f={};for(let a of d.probes||[])e[a.modelId]="ok"===a.status?"ok":"dead"===a.status?"dead":"retry",null!=a.latencyMs&&(f[a.modelId]=a.latencyMs);if(b!==be.current)return;bq(e),bo(f)}catch{}},[p,r]),b2=async a=>{try{let b=await fetch(`/api/provider-nodes/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();b.ok?(w(c.node),await b0(),ab(!1)):(0,I.s)(c?.error||"Failed to update provider node")}catch(a){(0,I.s)("Error updating provider node:",a)}},b3=async(a,b)=>{try{return await (0,an.T)(n,c=>{let d={...c};return a?d.fallbackStrategy=a:delete d.fallbackStrategy,"round-robin"===a&&""!==b?d.stickyRoundRobinLimit=Number(b)||3:a||delete d.stickyRoundRobinLimit,d}),!0}catch(a){return(0,I.s)("Error saving provider strategy:",a),!1}},b4=async(a,b)=>{let c=Math.min(1440,Math.max(1,Number.parseInt(b,10)||30));try{return await (0,an.T)(n,b=>({...b,accountScheduler:{...b.accountScheduler||{},enabled:a,sessionAffinityTtlSeconds:60*c}})),!0}catch(a){return(0,I.s)("Error saving balanced scheduler:",a),!1}},b5=async a=>{let b=a?"round-robin":null,c=a?aF||"1":aF;await b3(b,c)&&(a&&!aF&&aG("1"),aE(b))},b6=async a=>{await b3("round-robin",a)&&aG(a)},b7=async a=>{await b4(a,aJ)&&aI(a)},b8=async a=>{await b4(aH,a)&&aK(a)},b9=async a=>{try{let b=await fetch("/api/settings",{cache:"no-store"}),c={...(b.ok?await b.json():{}).providerThinking||{}};a&&"auto"!==a?c[n]={mode:a}:delete c[n],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:c})})}catch(a){(0,I.s)("Error saving thinking config:",a)}},ca=async a=>{let b=ap[n];if(b){aO(a);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[b]:a})})}catch(a){(0,I.s)("Error saving auto-ping config:",a)}}},cb=(0,e.useCallback)(a=>{let b=++bd.current;bc.current&&(clearTimeout(bc.current),bc.current=null);let c=async()=>{try{let d=await fetch(`/api/providers/${a}/model-probes/verify/status`,{cache:"no-store"}),e=await d.json().catch(()=>null);if(b!==bd.current)return;if(!d.ok||!e?.status)throw Error("Verify status temporarily unavailable");bm(e&&e.status?e:null),e?.status==="running"?bc.current=setTimeout(c,1500):(bc.current=null,await b1(a))}catch{b===bd.current&&(bc.current=setTimeout(c,1500))}};bc.current=setTimeout(c,0)},[b1]),cc=async(a,b,c=bC)=>{let d=`${c}/${a}`;try{let a=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d,alias:b})});if(a.ok)await b$();else{let b=await a.json();(0,I.s)(b.error||"Failed to set alias")}}catch(a){(0,I.s)("Error setting alias:",a)}},cd=async a=>{try{await (0,am.x)(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"}),await b$()}catch(a){(0,I.s)("Error deleting alias:",a)}},ce=async(a,b="llm",c=bR,d,e)=>{try{let f=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:c,id:a,type:b,...d?{caps:d}:{},...e?{transport:e}:{}})});if(f.ok)await b_();else{let a=await f.json();(0,I.s)(a.error||"Failed to add custom model")}}catch(a){(0,I.s)("Error adding custom model:",a)}},cf=async(a,b="llm",c=bR)=>{try{let d=new URLSearchParams({providerAlias:c,id:a,type:b});await (0,am.x)(`/api/models/custom?${d}`,{method:"DELETE"}),await b_()}catch(a){(0,I.s)("Error deleting custom model:",a)}},cg=async()=>{if(bf)return;let a=p.find(a=>r.includes(a.id)&&!1!==a.isActive)||p.find(a=>!1!==a.isActive);if(!a)return void(0,I.s)((0,C.Tl)("Add an active connection first"));bg(!0),bi("");try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json().catch(()=>({}));if(!b.ok)return void(0,I.s)(c.error||(0,C.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void(0,I.s)(c.warning||(0,C.Tl)("No models returned"));let e=new Set;try{let b=await fetch(`/api/providers/${a.id}/model-probes`,{cache:"no-store"});for(let a of(await b.json().catch(()=>({}))).probes||[])"dead"===a.status&&e.add(a.modelId)}catch{}let f=0,g=new Set(bB.map(a=>a.id)),h=[],i=[],j=new Set;for(let a of d){let b=(0,E.R2)(a,bR);if(!b)continue;let{id:c,name:d,type:k}=b;if(e.has((0,al.v)(c,bR))){f+=1;continue}let l=`${k}|${c}`;if(j.has(l))continue;if(j.add(l),g.has(c)){bU(c)&&i.push(c);continue}if(ah.some(a=>a.providerAlias===bR&&a.id===c&&(0,E.ki)(a.kind||a.type||"llm")===k))continue;let m=`${bR}/${c}`;Object.values(af).includes(m)||h.push({providerAlias:bR,id:c,type:k,name:d,...b.reasoning?{reasoning:b.reasoning}:{}})}let k=0;if(i.length>0)try{for(let a of i)(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bR)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&(k+=1);await bV()}catch{}let l=0;if(h.length>0){let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:h})}),b=await a.json().catch(()=>({}));if(!a.ok)return void(0,I.s)(b.error||(0,C.Tl)("Failed to save models"));l=b.added??h.length,await b_()}let m=h.filter(a=>"llm"!==a.type).length,n=[];if(l>0&&n.push(`${l} new`),k>0&&n.push(`${k} re-enabled`),0===n.length)bi((0,C.Tl)("All models already in list"));else{let a=`Imported ${n.join(" \xb7 ")} (${d.length} from provider)`;m>0&&(a+=" \xb7 non-chat types stored for media pages"),c.warning&&(a+=` \xb7 ${c.warning}`),bi(a)}if(f>0&&bi(a=>`${a} \xb7 ${f} skipped (known dead)`),l>0||k>0)try{let b=[...bB,...h.map(a=>({id:a.id,name:a.name,kind:a.type}))],c=await fetch(`/api/providers/${a.id}/model-probes/verify/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:b,providerAlias:bR})}),d=await c.json().catch(()=>({}));if(!c.ok)throw Error(d.error||"Failed to start auto-verify");bm(d&&d.status?d:null),cb(a.id)}catch(a){bi(b=>`${b} \xb7 auto-verify failed: ${a?.message||a}`)}}catch(a){(0,I.s)("Error importing models:",a),(0,I.s)((0,C.Tl)("Error fetching models")+": "+(a?.message||a))}finally{bg(!1)}},ch=async()=>{if(a1||0===p.length)return;let a=Object.fromEntries(p.map(a=>[a.id,{state:"queued",error:null}]));bb.current=!1,a2(!0),a4(!1),a6(null),a8(a),ba({total:p.length,completed:0,passed:0,failed:0,stopped:!1});let b=0,c=0;try{for(let a=0;a<p.length;a+=1){if(bb.current){ba({total:p.length,completed:a,passed:b,failed:c,stopped:!0});break}let d=p[a];a6(d.id),a8(a=>({...a,[d.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${d.id}/test`,{method:"POST"}),e=await a.json(),f=!!e.valid;f?b+=1:c+=1,a8(a=>({...a,[d.id]:{state:f?"success":"failed",error:f?null:e.error||null}}))}catch(a){c+=1,a8(b=>({...b,[d.id]:{state:"failed",error:a.message||"Test failed"}}))}ba({total:p.length,completed:a+1,passed:b,failed:c,stopped:!1}),a<p.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{a6(null),a2(!1),a4(!1),bb.current=!1}},ci=async a=>{let b=p.find(b=>b.id===a),c=b?.name?.trim()||b?.email?.trim()||a;a$({title:"Delete Connection",message:`Delete connection “${c}”?`,onConfirm:async()=>{a$(null);try{await (0,am.x)(`/api/providers/${a}`,{method:"DELETE"}),q(b=>b.filter(b=>b.id!==a))}catch(a){(0,I.s)("Error deleting connection:",a)}}})},cj=()=>{b0(),y(!1)},ck=async a=>{N("");try{let b=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:n,...a})}),c=null;try{c=await b.json()}catch{c=null}if(b.ok){await b0(),K(!1);return}N(c?.error||"Failed to save connection")}catch(a){(0,I.s)("Error saving connection:",a),N("Failed to save connection")}},cl=async a=>{try{await (0,am.x)(`/api/providers/${ac.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),await b0(),$(!1)}catch(a){(0,I.s)("Error updating connection:",a)}},cm=async(a,b)=>{try{await (0,am.x)(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})}),q(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){(0,I.s)("Error updating connection status:",a)}},cn=async a=>{let b,c=a?.providerSpecificData?.baseUrl;if(c){try{b=new URL(c).hostname.toLowerCase().replace(/^\[|\]$/g,"")}catch{(0,I.s)("Cannot allow-list: invalid base URL",c);return}try{let a=await fetch("/api/settings",{cache:"no-store"});if(!a.ok)throw Error(`Failed to load settings (${a.status})`);let c=await a.json(),d=[...new Set([...c.ssrfAllowHosts||[],b])],e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ssrfAllowHosts:d})});if(!e.ok)throw Error(`Failed to update allow list (${e.status})`);await b0()}catch(a){(0,I.s)("Error adding host to allow list:",a)}}},co=async(a,b)=>{let c=[...p];[c[a],c[b]]=[c[b],c[a]],q(c);try{if((await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b})})])).some(a=>!a.ok))throw Error("Failed to reorder connections")}catch(a){(0,I.s)("Error swapping priority:",a),await b0()}},cp=p.length>0&&r.length===p.length,cq=(0,d.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:p.map((a,b)=>(0,d.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,d.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,d.jsx)("input",{type:"checkbox",checked:r.includes(a.id),onChange:()=>{var b;return b=a.id,void s(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(O,{connection:a,isOAuth:bx,isFirst:0===b,isLast:b===p.length-1,onMoveUp:()=>co(b,b-1),onMoveDown:()=>co(b,b+1),onToggleActive:b=>cm(a.id,b),autoPing:ap[n]&&"oauth"===a.authType?{isActive:!0===aN.connections[a.id]||aN.schedules?.[a.id]?.enabled===!0,reactiveOn:!0===aN.connections[a.id],provider:n,scheduleOn:aN.schedules?.[a.id]?.enabled===!0,scheduleSummary:(0,ak.JW)(aN.schedules?.[a.id]).join(" / "),onConfigure:()=>aQ(a)}:null,onEdit:()=>{ad(a),$(!0)},onDelete:()=>ci(a.id),onAllowlistHost:()=>cn(a),oneByOneStatus:a7[a.id]||null})})]},a.id))}),cr=async a=>{if(!az.has(a)){aA(b=>new Set(b).add(a));try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${bR}/${a}`})}),c=await b.json();au(b=>({...b,[a]:c.ok?"ok":"error"})),aw(c.ok?"":c.error||"Model not reachable")}catch{au(b=>({...b,[a]:"error"})),aw("Network error")}finally{aA(b=>{let c=new Set(b);return c.delete(a),c})}}};return t?(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(j.Qv,{}),(0,d.jsx)(j.Qv,{})]}):bv?(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)(h(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,d.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${bv.color}15`},children:ar?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:bv.color},children:bv.textIcon||bv.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.default,{src:bD&&bv.apiType?"responses"===bv.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":bE?"/providers/anthropic-m.png":`/providers/${bv.id}.png`,alt:bv.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>as(!0)})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:bv.name}),(bv.notice?.apiKeyUrl||bv.notice?.signupUrl||bv.website)&&(0,d.jsxs)("a",{href:bv.notice?.apiKeyUrl||bv.notice?.signupUrl||bv.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),bv.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[p.length," connection",1===p.length?"":"s"]})]})]})]}),bv.deprecated&&(0,d.jsxs)("div",{className:"flex items-start gap-3 rounded-xl border border-amber-500/25 bg-amber-500/8 px-4 py-3 text-xs text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-amber-500 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"leading-relaxed font-normal",children:String(bv.deprecationNotice).replace(/^⚠️\s*⚠️?\s*/,"")})]}),bv.notice?.text&&!bv.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,d.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:bv.notice.text}),bv.notice.apiKeyUrl&&(0,d.jsx)("a",{href:bv.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 →"})]}),bF&&v&&(0,d.jsx)(j.Zp,{children:(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:bE?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[bE?"Messages API":"responses"===v.apiType?"Responses API":"Chat Completions"," \xb7 ",(v.baseUrl||"").replace(/\/$/,""),"/",bE?"messages":"responses"===v.apiType?"responses":"chat/completions"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:()=>{N(""),K(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ab(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{a$({title:"Delete Compatible Node",message:`Delete this ${bE?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{a$(null);try{await (0,am.x)(`/api/provider-nodes/${n}`,{method:"DELETE"}),m.push("/dashboard/providers")}catch(a){(0,I.s)("Error deleting provider node:",a)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),bz?(0,d.jsx)(j.gw,{providerId:n}):(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[p.length>0&&(0,d.jsxs)(d.Fragment,{children:[r.length>0&&(0,d.jsxs)(j.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let a=r.length;0!==a&&a$({title:`Delete ${a} Connection${a>1?"s":""}`,message:`Delete ${a} connection${a>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{a$(null);let a=0,b=[...r],c=[];for(let d of b)try{(await fetch(`/api/providers/${d}`,{method:"DELETE"})).ok?c.push(d):a+=1}catch(b){(0,I.s)("Error deleting connection:",b),a+=1}q(a=>a.filter(a=>!c.includes(a.id))),s([]),a>0&&(0,I.s)(`Deleted ${b.length-a} connection(s), ${a} failed.`)}})},children:["Delete Selected (",r.length,")"]}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:ch,disabled:a1,children:a1?"Testing Connection One-by-One...":"Test Connection One-by-One"}),a1&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{a1&&(bb.current=!0,a4(!0))},disabled:a3,children:a3?"Stopping...":"Stop"})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border/60 bg-surface-2/40 p-3",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-text-main",children:"Balanced Scheduler"}),(0,d.jsx)(j.m_,{text:"Process-local least-inflight scheduling with fresh quota signals. Sessions stay on one account and rebind on failure, cooldown, or cap.",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] text-text-muted cursor-help",children:"info"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[aH&&(0,d.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:["Affinity",(0,d.jsx)("input",{"aria-label":"Session affinity minutes",type:"number",min:1,max:1440,value:aJ,onChange:a=>b8(a.target.value),className:"w-14 px-2 py-0.5 text-xs border border-border rounded-md bg-background text-text-main focus:outline-none focus:border-primary"}),(0,d.jsx)("span",{className:"text-[11px]",children:"min"})]}),(0,d.jsx)(j.lM,{checked:aH,onChange:b7,"aria-label":"Balanced scheduler"})]})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 pt-2 border-t border-border/40",title:aH?"Saved and used again when balanced scheduling is off":void 0,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-text-main",children:"Round Robin"}),(0,d.jsx)(j.m_,{text:"Cycles through connections sequentially in round-robin fashion.",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] text-text-muted cursor-help",children:"info"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:["round-robin"===aD&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,d.jsx)("input",{type:"number",min:1,value:aF,onChange:a=>b6(a.target.value),placeholder:"1",disabled:aH,title:aH?"Saved and used again when balanced scheduling is off":void 0,className:"w-14 px-2 py-0.5 text-xs border border-border rounded-md bg-background text-text-main focus:outline-none focus:border-primary disabled:cursor-not-allowed disabled:opacity-50"})]}),(0,d.jsx)(j.lM,{checked:"round-robin"===aD,onChange:b5,"aria-label":"Round Robin",disabled:aH,title:aH?"Saved and used again when balanced scheduling is off":void 0})]})]})]})]})]}),0===p.length?(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:bx?"lock":"key"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),bI&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",bJ," or ",bK,"."]})]})]}),(0,d.jsx)("div",{className:"flex gap-2",children:bI?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bM,children:bJ}),(0,d.jsx)(j.$n,{size:"sm",icon:"key",onClick:bN,children:bK})]}):(0,d.jsxs)(d.Fragment,{children:[!bF&&ao.has(n)&&(0,d.jsx)(R,{providerId:n,onConnected:b0}),!bF&&"iflow"===n&&(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>G(!0),children:"Cookie"}),"codex"===n&&(0,d.jsx)(j.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>T(!0),children:(0,C.Tl)("Bulk Add")}),"grok-cli"===n&&(0,d.jsx)(j.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>X(!0),children:(0,C.Tl)("Bulk Add")}),(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:bO,children:bF?"Add API Key":"iflow"===n?"OAuth":"Add Connection"})]})})]}):(0,d.jsxs)(d.Fragment,{children:[a9&&(0,d.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,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("span",{children:["Total: ",a9.total]}),(0,d.jsxs)("span",{children:["Completed: ",a9.completed]}),(0,d.jsxs)("span",{children:["Passed: ",a9.passed]}),(0,d.jsxs)("span",{children:["Failed: ",a9.failed]}),a9.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),a1&&a5&&(0,d.jsxs)("span",{children:["Running: ",p.find(a=>a.id===a5)?.name||a5]})]})}),p.length>0&&(0,d.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,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,d.jsx)("input",{type:"checkbox",checked:cp,onChange:()=>{cp?s([]):s(p.map(a=>a.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),cq,!bF&&(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===n&&(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>G(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===n&&(0,d.jsx)(j.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>T(!0),title:(0,C.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,C.Tl)("Bulk Add")}),"grok-cli"===n&&(0,d.jsx)(j.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>X(!0),title:(0,C.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,C.Tl)("Bulk Add")}),bI?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bM,className:"w-full sm:w-auto",children:bJ}),(0,d.jsx)(j.$n,{size:"sm",icon:"key",onClick:bN,className:"w-full sm:w-auto",children:bK})]}):(0,d.jsxs)(d.Fragment,{children:[ao.has(n)&&(0,d.jsx)(R,{providerId:n,onConnected:b0}),(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:bO,className:"w-full sm:w-auto",children:"Add"})]})]})]})]}),(0,d.jsx)(ae,{providerId:n,scheduleKey:bS},n),(0,d.jsx)(ai,{providerId:n}),(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),bQ&&(0,d.jsx)("select",{value:aL,onChange:a=>{var b;aM(b=a.target.value),b9(b)},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:bQ.map(a=>(0,d.jsx)("option",{value:a,children:`Thinking: ${a.charAt(0).toUpperCase()+a.slice(1)}`},a))})]}),bH.showToolbar&&(a=(bH.showBulkControls?[...bB,...aV.filter(a=>!bB.some(b=>b.id===a.id))].filter(a=>{let b=(0,l.CP)(a);return!b||"llm"===b}).map(a=>a.id):[]).filter(a=>!bU(a)),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[bH.showImport&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:bf?"progress_activity":"cloud_download",onClick:cg,disabled:bf||!bG,title:bG?"Import models from the active connection":"Add an active connection to import models",children:bf?"Importing...":"Import models"}),bH.showVerify&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:bl?.status==="running"?"progress_activity":"science",onClick:()=>bk(a=>!a),children:bl?.status==="running"?`Verifying ${bl.done}/${bl.total}`:bj?"Hide verify":"Verify models"}),bH.showBulkControls&&aX.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:bZ,children:"Active All"}),bH.showBulkControls&&a.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>bY(a),children:"Disable All"})]}))]}),!!av&&(0,d.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:av}),"zed"===n&&!!ax&&(0,d.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:ax}),bh&&(0,d.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-2 rounded-xl border border-primary/30 bg-primary/10 px-3.5 py-2 text-xs font-medium text-text-main",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"info"}),(0,d.jsx)("span",{children:bh})]}),(0,d.jsx)("button",{onClick:()=>bi(""),className:"text-text-muted hover:text-text-main p-0.5 rounded",title:"Dismiss",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]}),bj&&(b=p.find(a=>r.includes(a.id)&&!1!==a.isActive)||p.find(a=>!1!==a.isActive),c=[...(0,D.R3)({customModels:ah,modelAliases:af,providerAlias:bR,builtInModels:bB,type:"llm"}).filter(a=>!bU(a.id)).map(a=>({id:a.id,name:a.name||a.id,kind:"llm"})),...bB.filter(a=>{let b=(0,l.CP)(a);return(!b||"llm"===b)&&!bU(a.id)}).map(a=>({id:a.id,name:a.name||a.id,kind:"llm"}))],(0,d.jsx)(_,{connectionId:b?.id,providerAlias:bR,models:c,jobSnapshot:bl,onClose:()=>bk(!1),onStarted:a=>{bm(a&&a.status?a:null);let c=a?.connectionId||b?.id;c&&cb(c)},onComplete:async a=>{a?.removedStatus&&bm(b=>b?{...b,dead:Number(a.dead??b.dead??0),retryable:Number(a.retryable??b.retryable??0),retryableAuthOnly:!0===a.retryableAuthOnly}:b),a?.removed>0&&await b_(),a?.removed>0&&await bV(),(a?.removed>0||a?.cacheCleared)&&await b1(b?.id)}})),(()=>{let a,b,c;if(bF)return(0,d.jsx)(L,{providerStorageAlias:bR,providerDisplayAlias:bS,modelAliases:af,customModels:ah,copied:bt,onCopy:bu,onSetAlias:cc,onDeleteAlias:cd,onAddCustomModel:a=>ce(a,"llm",bR),onDeleteCustomModel:a=>cf(a,"llm",bR),onRefreshModels:b_,connections:p,isAnthropic:bE,disabledModelIds:aX,onEnableModel:bX});let e=[...bB,...aV.filter(a=>!bB.some(b=>b.id===a.id))].filter(a=>{let b=(0,l.CP)(a);return!b||"llm"===b}),f=e.filter(a=>!bU(a.id)),g=e.filter(a=>bU(a.id)),h=(0,D.R3)({customModels:ah,modelAliases:af,providerAlias:bR,builtInModels:bB,type:"llm"}),i=h.filter(a=>!bU(a.id)&&("all"===br||(bp[(0,al.v)(a.id,bR)]||null)===br)),j=f.filter(a=>"all"===br||(bp[(0,al.v)(a.id,bR)]||null)===br);return(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("div",{className:"mb-2 flex flex-wrap items-center gap-1.5 text-xs",children:[{id:"all",label:"All",count:f.length+h.filter(a=>!bU(a.id)).length},{id:"ok",label:"Reachable",count:[...f,...h].filter(a=>!bU(a.id)&&("ok"===bp[(0,al.v)(a.id,bR)]||"ok"===at[a.id])).length},{id:"dead",label:"Dead",count:[...f,...h].filter(a=>!bU(a.id)&&("dead"===bp[(0,al.v)(a.id,bR)]||"error"===at[a.id])).length},{id:"retry",label:"Retry",count:[...f,...h].filter(a=>!bU(a.id)&&"retry"===bp[(0,al.v)(a.id,bR)]).length}].map(a=>(0,d.jsxs)("button",{onClick:()=>bs(a.id),className:`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium transition-all ${br===a.id?"bg-primary text-black font-semibold shadow-sm":"bg-surface-2/60 border border-border/40 text-text-muted hover:border-border hover:text-text-main"}`,children:[(0,d.jsx)("span",{children:a.label}),(0,d.jsx)("span",{className:`rounded-full px-1.5 py-0.2 text-[10px] tabular-nums ${br===a.id?"bg-black/20 text-black font-bold":"bg-black/10 dark:bg-white/10 text-text-muted"}`,children:a.count})]},a.id))}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[i.map(a=>{let b=(0,al.v)(a.id,bR);return(0,d.jsx)(H,{model:{id:a.id,name:a.name},fullModel:`${bS}/${a.id}`,alias:a.alias,copied:bt,onCopy:bu,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===a.source?cf(a.id,"llm",bR):cd(a.alias)},testStatus:at[a.id],onTest:p.length>0||bz?()=>cr(a.id):void 0,isTesting:az.has(a.id),isCustom:!0,isFree:!1,caps:o(`${n}/${a.id}`),thinkingSuffix:bP(a.id),latencyMs:bn[a.id]??bn[b],probeState:bl?.status==="running"&&bl?.perModel?.[b]?bl.perModel[b]:bp[b]||null},`${a.source}-${a.fullModel}`)}),j.map(a=>{let b=`${bR}/${a.id}`,c=`${n}/${a.id}`,e=Object.entries(af).find(([,a])=>a===b||a===c)?.[0],f=(0,al.v)(a.id,bR);return(0,d.jsx)(H,{model:a,fullModel:`${bS}/${a.id}`,alias:e,copied:bt,onSetAlias:b=>cc(a.id,b,bR),onCopy:bu,onDeleteAlias:()=>cd(e),testStatus:at[a.id],onTest:p.length>0||bz?()=>cr(a.id):void 0,isTesting:az.has(a.id),isFree:a.isFree,onDisable:()=>bW(a.id),caps:o(`${n}/${a.id}`),thinkingSuffix:bP(a.id),latencyMs:bn[a.id]??bn[f],probeState:bl?.status==="running"&&bl?.perModel?.[f]?bl.perModel[f]:bp[f]||null},a.id)}),(0,d.jsxs)("button",{onClick:()=>aC(!0),className:"flex min-h-[58px] min-w-[200px] flex-1 items-center justify-center gap-2 rounded-xl border border-dashed border-primary/40 bg-primary/5 px-4 py-3 text-xs font-medium text-primary transition-all hover:border-primary hover:bg-primary/10 hover:shadow-soft sm:flex-none",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add_circle"}),"Add Custom Model"]}),aR.length>0&&(a=new Set([...Object.values(af),...h.map(a=>a.fullModel)]),b=new Set(bB.map(a=>a.id)),0===(c=aR.filter(c=>!a.has(`${bR}/${c.id}`)&&!b.has(c.id))).length?null:(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(a=>(0,d.jsxs)("button",{onClick:async()=>{await ce(a.id,"llm",bR)},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:`${a.name} \xb7 ${(a.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id.split("/").pop()]},a.id))})]})),g.length>0&&(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",g.length,"):"]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:g.map(a=>(0,d.jsxs)("button",{onClick:()=>bX(a.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,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id]},a.id))})]})]})]})})()]}),"kiro"===n?(0,d.jsx)(j.Mh,{isOpen:x,providerInfo:bv,onSuccess:cj,onClose:()=>y(!1)}):"cursor"===n?(0,d.jsx)(j.G9,{isOpen:x,onSuccess:cj,onClose:()=>y(!1)}):"zed"===n?(0,d.jsx)(j.TE,{isOpen:x,providerInfo:bv,onSuccess:cj,onClose:()=>y(!1)}):"gitlab"===n?(0,d.jsx)(j.vj,{isOpen:x,providerInfo:bv,onSuccess:cj,onClose:()=>y(!1)}):(0,d.jsx)(j.LF,{isOpen:x,provider:n,providerInfo:bv,onSuccess:cj,onClose:()=>y(!1)}),"iflow"===n&&(0,d.jsx)(j.vE,{isOpen:F,onSuccess:()=>{b0(),G(!1)},onClose:()=>G(!1)}),(0,d.jsx)(Q,{isOpen:J,provider:n,providerName:bv.name,isCompatible:bF,isAnthropic:bE,authType:bv?.authType,authHint:bv?.authHint,website:bv?.website,error:M,onSave:ck,onBulkDone:b0,onClose:()=>{N(""),K(!1)}}),(0,d.jsx)(j.wI,{isOpen:Y,connection:ac,onSave:cl,onClose:()=>$(!1)}),bF&&(0,d.jsx)(S,{isOpen:aa,node:v,onSave:b2,onClose:()=>ab(!1),isAnthropic:bE}),!bF&&(0,d.jsx)(U,{isOpen:aB,providerAlias:bR,providerDisplayAlias:bS,onSave:async(a,b,c,d)=>{await ce(a,c||"llm",bR,b,d),aC(!1)},onClose:()=>aC(!1)}),"codex"===n&&(0,d.jsx)(W,{isOpen:P,onClose:()=>T(!1),onSuccess:b0}),"grok-cli"===n&&(0,d.jsx)(Z,{isOpen:V,onClose:()=>X(!1),onSuccess:b0}),aP&&(0,d.jsx)(aj.A,{isOpen:!!aP,onClose:()=>aQ(null),connection:aP,reactive:!0===aN.connections[aP.id],schedule:aN.schedules?.[aP.id]||null,onSave:a=>((a,{reactive:b,schedule:c})=>{ca({...aN,connections:{...aN.connections,[a]:b},schedules:{...aN.schedules,[a]:c}})})(aP.id,a)}),(0,d.jsx)(j.uo,{isOpen:a_,onClose:()=>a0(!1),onConfirm:()=>{(a0(!1),bx)?bL():bN()},title:"Risk Notice",message:bv?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,d.jsx)(j.uo,{isOpen:!!aZ,onClose:()=>a$(null),onConfirm:aZ?.onConfirm,title:aZ?.title||"Confirm",message:aZ?.message,variant:"danger"})]}):(0,d.jsxs)("div",{className:"text-center py-20",children:[(0,d.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,d.jsx)(h(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},22588:(a,b,c)=>{"use strict";c.d(b,{T:()=>f});let d=Symbol("delete-provider-strategy"),e=Promise.resolve();async function f(a,b,c=fetch){let d=e.then(()=>g(a,b,c));return e=d.catch(()=>{}),d}async function g(a,b,c){let e=await c("/api/settings",{cache:"no-store"});if(!e.ok)throw Error(`Failed to load settings (${e.status})`);let f=(await e.json()).providerStrategies||{},g=f[a]||{},h=b(g);if(void 0===h)return console.warn(`[patchProviderStrategy] updater for "${a}" returned undefined; keeping previous entry`),g;let i={...f};h===d?delete i[a]:h&&Object.keys(h).length>0?i[a]=h:delete i[a];let j=await c("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:i})});if(!j.ok)throw Error(`Failed to save settings (${j.status})`);return h===d?void 0:h}},24889:(a,b,c)=>{Promise.resolve().then(c.bind(c,17634))},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},38522:a=>{"use strict";a.exports=require("node:zlib")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},54589:(a,b,c)=>{"use strict";function d(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}c.d(b,{JW:()=>i,Vm:()=>d,fB:()=>f,gy:()=>e,nz:()=>g});let e={anchor:"09:30",timezone:d(),windowHours:5,slotsPerDay:3};function f(a){let b=/^(\d{1,2}):(\d{2})$/.exec(String(a||"").trim());if(!b)return null;let c=Number(b[1]),d=Number(b[2]);return c>23||d>59?null:{hour:c,minute:d}}function g(a){return Math.max(1,Math.floor(24/a))}function h(a,b,c,d){let e="number"==typeof a?a:Number(a);return Number.isFinite(e)?Math.min(d,Math.max(c,e)):b}function i(a){let b=function(a){if(!a||!0!==a.enabled)return null;let b=f(a.anchor)||f(e.anchor),c=`${String(b.hour).padStart(2,"0")}:${String(b.minute).padStart(2,"0")}`,d=!function(a){if(!a||"string"!=typeof a)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:a}),!0}catch{return!1}}(a.timezone)?e.timezone:a.timezone,i=h(a.windowHours,e.windowHours,.5,24),j=Math.round(h(a.slotsPerDay,e.slotsPerDay,1,g(i)));return{enabled:!0,anchor:c,timezone:d,windowHours:i,slotsPerDay:j}}(a);if(!b)return[];let{hour:c,minute:d}=f(b.anchor),i=60*c+d;return Array.from({length:b.slotsPerDay},(a,c)=>{let d=Math.round(i+c*b.windowHours*60)%1440;return`${String(Math.floor(d/60)).padStart(2,"0")}:${String(d%60).padStart(2,"0")}`})}},54918:(a,b,c)=>{"use strict";async function d(a,b){let c=await fetch(a,{...b,headers:{"Content-Type":"application/json",...b?.headers||{}},credentials:"same-origin"}),d=null;try{d=await c.json()}catch{d=null}if(!c.ok){let a=d&&(d.error||d.message)||`Request failed (${c.status})`,b=Error("string"==typeof a?a:"Request failed");throw b.status=c.status,b.data=d,b}return d}c.d(b,{x:()=>d})},55511:a=>{"use strict";a.exports=require("crypto")},56020:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(71404),j=c(54589);let k=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function l({isOpen:a,onClose:b,onSave:c,connection:f,reactive:g=!1,schedule:m=null}){let[n,o]=(0,e.useState)(()=>({mode:m?.enabled===!0?"schedule":!0===g?"reset":"off",anchor:m?.anchor||j.gy.anchor,timezone:(0,j.Vm)(),windowHours:String(m?.windowHours??j.gy.windowHours),slotsPerDay:String(m?.slotsPerDay??j.gy.slotsPerDay)})),p=Number(n.windowHours),q=Number(n.slotsPerDay),r=!!(0,j.fB)(n.anchor),s=Number.isFinite(p)&&p>=.5&&p<=24,t=s?(0,j.nz)(p):24,u=Number.isInteger(q)&&q>=1&&q<=t,v=r&&s&&u,w="schedule"!==n.mode||v,x=v?(0,j.JW)({enabled:!0,...n,windowHours:p,slotsPerDay:q}):[],y=x.length&&s?(()=>{let{hour:a,minute:b}=(0,j.fB)(n.anchor),c=Math.round(60*a+b+q*p*60)%1440;return`${String(Math.floor(c/60)).padStart(2,"0")}:${String(c%60).padStart(2,"0")}`})():"",z=a=>o(b=>({...b,...a}));return(0,d.jsx)(h.aF,{isOpen:a,onClose:b,title:"Auto-ping settings",size:"lg",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$n,{variant:"secondary",onClick:b,children:"Cancel"}),(0,d.jsx)(h.$n,{onClick:()=>{w&&(c({reactive:"reset"===n.mode,schedule:"schedule"===n.mode?{enabled:!0,anchor:n.anchor,timezone:n.timezone,windowHours:p,slotsPerDay:q}:{enabled:!1}}),b())},disabled:!w,children:"Save"})]}),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",f?.name?` for ${f.name}`:""," — pick one mode."]}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:k.map(a=>{let b=n.mode===a.value;return(0,d.jsxs)("button",{type:"button",onClick:()=>z({mode:a.value}),className:(0,i.cn)("flex h-9 items-center justify-center gap-1.5 rounded-[8px] px-3 text-sm font-medium transition-all",b?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:a.icon}),(0,d.jsx)("span",{children:a.label})]},a.value)})}),"reset"===n.mode&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===n.mode&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,d.jsx)(h.pd,{label:"Anchor time",type:"time",value:n.anchor,onChange:a=>z({anchor:a.target.value}),error:r?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:n.windowHours,onChange:a=>z({windowHours:a.target.value}),error:s?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Pings per day",type:"number",min:"1",max:String(t),step:"1",value:n.slotsPerDay,onChange:a=>z({slotsPerDay:a.target.value}),error:u?"":`1 – ${t}`,hint:u?`Max ${t}`:"",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"})]}),x.length>0&&(0,d.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,d.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",n.timezone,")"]}),(0,d.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:x.join(" → ")}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",x[0]," – ",y,", then pauses until ",x[0]," next day."]})]})]})]})})}l.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSave:g().func.isRequired,connection:g().object,reactive:g().bool,schedule:g().object}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},72089:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},73024:a=>{"use strict";a.exports=require("node:fs")},74875:(a,b,c)=>{"use strict";function d(a){return"error"===a||"expired"===a||"unavailable"===a||"reauth_required"===a||"invalid"===a}function e(a,b){return!1===a?"default":"active"===b||"success"===b?"success":d(b)?"error":"default"}c.d(b,{g:()=>e,t:()=>d})},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78405:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>z,handler:()=>B,routeModule:()=>A});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,32059))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,30508))),o=(0,d.p)(()=>Promise.resolve().then(c.bind(c,57097))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),t=(0,d.p)(()=>Promise.resolve().then(c.bind(c,70160))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),v=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),w=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),x={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,93110))),"/home/runner/work/switchboard-router/switchboard-router/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[w,"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[v,"next/dist/client/components/builtin/global-error.js"]},[]]},{loading:[t,"/home/runner/work/switchboard-router/switchboard-router/src/app/(dashboard)/dashboard/loading.js"],"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/home/runner/work/switchboard-router/switchboard-router/src/app/(dashboard)/layout.js"],error:[o,"/home/runner/work/switchboard-router/switchboard-router/src/app/(dashboard)/error.js"],"global-error":[p,"next/dist/client/components/builtin/global-error.js"],"not-found":[q,"next/dist/client/components/builtin/not-found.js"],forbidden:[r,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[s,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/home/runner/work/switchboard-router/switchboard-router/src/app/layout.js"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,y=(0,e.H)({tree:x,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),z=y.__next_app__,A=y.routeModule,B=y.handler},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},93110:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/switchboard-router/switchboard-router/src/app/(dashboard)/dashboard/providers/[id]/page.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/switchboard-router/switchboard-router/src/app/(dashboard)/dashboard/providers/[id]/page.js","default")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,2430,4160,2712,5137,232,9662,5350,869,2142,5781,9353,2766,7757,6544,4041,5624],()=>b(b.s=78405));module.exports=c})();
|
package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"files":["../../../../../../../node_modules/@swc/helpers/_/_interop_require_default/package.json","../../../../../../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../../../../../../node_modules/@swc/helpers/esm/_interop_require_default.js","../../../../../../../node_modules/@swc/helpers/package.json","../../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../../node_modules/better-sqlite3/package.json","../../../../../../../node_modules/bindings/bindings.js","../../../../../../../node_modules/bindings/package.json","../../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../../node_modules/next/dist/build/adapter/setup-node-env.external.js","../../../../../../../node_modules/next/dist/client/components/hooks-server-context.js","../../../../../../../node_modules/next/dist/client/components/static-generation-bailout.js","../../../../../../../node_modules/next/dist/client/lib/console.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../node_modules/next/dist/compiled/hash.js/sha256/256.js","../../../../../../../node_modules/next/dist/compiled/hash.js/sha256/package.json","../../../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../node_modules/next/dist/compiled/source-map/package.json","../../../../../../../node_modules/next/dist/compiled/source-map/source-map.js","../../../../../../../node_modules/next/dist/compiled/stacktrace-parser/package.json","../../../../../../../node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js","../../../../../../../node_modules/next/dist/compiled/ws/index.js","../../../../../../../node_modules/next/dist/compiled/ws/package.json","../../../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../../../node_modules/next/dist/lib/constants.js","../../../../../../../node_modules/next/dist/lib/framework/boundary-constants.js","../../../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../../../node_modules/next/dist/lib/is-error.js","../../../../../../../node_modules/next/dist/lib/picocolors.js","../../../../../../../node_modules/next/dist/lib/scheduler.js","../../../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../../../node_modules/next/dist/server/app-render/blocking-route-messages.js","../../../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../../../node_modules/next/dist/server/app-render/console-async-storage-instance.js","../../../../../../../node_modules/next/dist/server/app-render/console-async-storage.external.js","../../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../../../node_modules/next/dist/server/app-render/dynamic-rendering.js","../../../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js","../../../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-tracking.js","../../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../../../node_modules/next/dist/server/app-render/staged-rendering.js","../../../../../../../node_modules/next/dist/server/app-render/sync-io-messages.js","../../../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../../../node_modules/next/dist/server/dev/browser-logs/file-logger.js","../../../../../../../node_modules/next/dist/server/dynamic-rendering-utils.js","../../../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../../../node_modules/next/dist/server/lib/parse-stack.js","../../../../../../../node_modules/next/dist/server/lib/route-cache-key.js","../../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../../../node_modules/next/dist/server/lib/source-maps.js","../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../../../node_modules/next/dist/server/node-environment-baseline.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/console-dim.external.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/console-exit.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/console-file.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/date.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/error-inspect.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/io-utils.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/node-crypto.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/random.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/web-crypto.js","../../../../../../../node_modules/next/dist/server/node-environment.js","../../../../../../../node_modules/next/dist/server/node-polyfill-crypto.js","../../../../../../../node_modules/next/dist/server/normalizers/built/app/app-pathname-normalizer.js","../../../../../../../node_modules/next/dist/server/normalizers/normalizers.js","../../../../../../../node_modules/next/dist/server/normalizers/underscore-normalizer.js","../../../../../../../node_modules/next/dist/server/normalizers/wrap-normalizer-fn.js","../../../../../../../node_modules/next/dist/server/patch-error-inspect.js","../../../../../../../node_modules/next/dist/server/require-hook.js","../../../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../../../node_modules/next/dist/server/route-kind.js","../../../../../../../node_modules/next/dist/server/runtime-reacts.external.js","../../../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../../../node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js","../../../../../../../node_modules/next/dist/shared/lib/instant-messages.js","../../../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js","../../../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../../../node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js","../../../../../../../node_modules/next/dist/shared/lib/page-path/normalize-page-path.js","../../../../../../../node_modules/next/dist/shared/lib/promise-with-resolvers.js","../../../../../../../node_modules/next/dist/shared/lib/router/utils/app-paths.js","../../../../../../../node_modules/next/dist/shared/lib/router/utils/index.js","../../../../../../../node_modules/next/dist/shared/lib/router/utils/interception-routes.js","../../../../../../../node_modules/next/dist/shared/lib/router/utils/is-dynamic.js","../../../../../../../node_modules/next/dist/shared/lib/router/utils/sorted-routes.js","../../../../../../../node_modules/next/dist/shared/lib/segment.js","../../../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../../../node_modules/next/dist/shared/lib/utils.js","../../../../../../../node_modules/next/package.json","../../../../../../../node_modules/react/cjs/react.development.js","../../../../../../../node_modules/react/cjs/react.production.js","../../../../../../../node_modules/react/index.js","../../../../../../../node_modules/react/package.json","../../../../../../../node_modules/sql.js/dist/sql-wasm.js","../../../../../../../node_modules/sql.js/package.json","../../../../../../../package.json","../../../../../../package.json","../../../../../chunks/1129.js","../../../../../chunks/1161.js","../../../../../chunks/1202.js","../../../../../chunks/1294.js","../../../../../chunks/1350.js","../../../../../chunks/1425.js","../../../../../chunks/1531.js","../../../../../chunks/1564.js","../../../../../chunks/1656.js","../../../../../chunks/1757.js","../../../../../chunks/1792.js","../../../../../chunks/1808.js","../../../../../chunks/1813.js","../../../../../chunks/1818.js","../../../../../chunks/1998.js","../../../../../chunks/2003.js","../../../../../chunks/2142.js","../../../../../chunks/232.js","../../../../../chunks/2348.js","../../../../../chunks/2409.js","../../../../../chunks/241.js","../../../../../chunks/2430.js","../../../../../chunks/2434.js","../../../../../chunks/2574.js","../../../../../chunks/2600.js","../../../../../chunks/27.js","../../../../../chunks/2712.js","../../../../../chunks/2750.js","../../../../../chunks/2766.js","../../../../../chunks/2770.js","../../../../../chunks/2935.js","../../../../../chunks/2970.js","../../../../../chunks/3072.js","../../../../../chunks/3294.js","../../../../../chunks/3449.js","../../../../../chunks/3593.js","../../../../../chunks/3675.js","../../../../../chunks/369.js","../../../../../chunks/3734.js","../../../../../chunks/3766.js","../../../../../chunks/3771.js","../../../../../chunks/3904.js","../../../../../chunks/4041.js","../../../../../chunks/4160.js","../../../../../chunks/4176.js","../../../../../chunks/4177.js","../../../../../chunks/4190.js","../../../../../chunks/428.js","../../../../../chunks/4434.js","../../../../../chunks/4454.js","../../../../../chunks/4646.js","../../../../../chunks/4739.js","../../../../../chunks/4780.js","../../../../../chunks/4803.js","../../../../../chunks/507.js","../../../../../chunks/5115.js","../../../../../chunks/5137.js","../../../../../chunks/5207.js","../../../../../chunks/5258.js","../../../../../chunks/5350.js","../../../../../chunks/5568.js","../../../../../chunks/5624.js","../../../../../chunks/5711.js","../../../../../chunks/5781.js","../../../../../chunks/5888.js","../../../../../chunks/5920.js","../../../../../chunks/6074.js","../../../../../chunks/6103.js","../../../../../chunks/6186.js","../../../../../chunks/6194.js","../../../../../chunks/6252.js","../../../../../chunks/629.js","../../../../../chunks/646.js","../../../../../chunks/6492.js","../../../../../chunks/6498.js","../../../../../chunks/6544.js","../../../../../chunks/6708.js","../../../../../chunks/6737.js","../../../../../chunks/6757.js","../../../../../chunks/6844.js","../../../../../chunks/6947.js","../../../../../chunks/698.js","../../../../../chunks/7066.js","../../../../../chunks/7133.js","../../../../../chunks/7554.js","../../../../../chunks/7557.js","../../../../../chunks/7650.js","../../../../../chunks/7662.js","../../../../../chunks/7726.js","../../../../../chunks/7753.js","../../../../../chunks/7757.js","../../../../../chunks/7774.js","../../../../../chunks/7828.js","../../../../../chunks/7856.js","../../../../../chunks/7965.js","../../../../../chunks/8062.js","../../../../../chunks/8080.js","../../../../../chunks/8197.js","../../../../../chunks/8400.js","../../../../../chunks/845.js","../../../../../chunks/8469.js","../../../../../chunks/849.js","../../../../../chunks/8520.js","../../../../../chunks/8658.js","../../../../../chunks/869.js","../../../../../chunks/8775.js","../../../../../chunks/8789.js","../../../../../chunks/881.js","../../../../../chunks/8942.js","../../../../../chunks/8998.js","../../../../../chunks/9078.js","../../../../../chunks/9091.js","../../../../../chunks/9155.js","../../../../../chunks/9264.js","../../../../../chunks/9353.js","../../../../../chunks/9421.js","../../../../../chunks/9662.js","../../../../../chunks/995.js","../../../../../chunks/static/media/catalog.b2c6512a.json","../../../../../chunks/static/media/versions.fd0ef9e7.json","../../../../../webpack-runtime.js","page_client-reference-manifest.js","../../../../../../../open-sse/providers/generated/catalog.json","../../../../../../../node_modules/impit/CHANGELOG.md","../../../../../../../node_modules/impit/dts-header.d.ts","../../../../../../../node_modules/impit/errors.js","../../../../../../../node_modules/impit/index.d.ts","../../../../../../../node_modules/impit/index.js","../../../../../../../node_modules/impit/index.wrapper.js","../../../../../../../node_modules/impit/package.json","../../../../../../../node_modules/impit/pnpm-workspace.yaml","../../../../../../../node_modules/impit/README.md","../../../../../../../node_modules/impit/tsconfig.docs.json","../../../../../../../node_modules/impit-linux-x64-gnu/impit-node.linux-x64-gnu.node","../../../../../../../node_modules/impit-linux-x64-gnu/package.json","../../../../../../../node_modules/impit-linux-x64-gnu/README.md","../../../../../../../node_modules/impit-linux-x64-musl/impit-node.linux-x64-musl.node","../../../../../../../node_modules/impit-linux-x64-musl/package.json","../../../../../../../node_modules/impit-linux-x64-musl/README.md","../../../../../../../open-sse/identity/tls/bin/darwin/arm64/switchboard-claude-tls","../../../../../../../open-sse/identity/tls/bin/darwin/x64/switchboard-claude-tls","../../../../../../../open-sse/identity/tls/bin/linux/arm64/switchboard-claude-tls","../../../../../../../open-sse/identity/tls/bin/linux/x64/switchboard-claude-tls","../../../../../../../open-sse/identity/tls/bin/win32/arm64/switchboard-claude-tls.exe","../../../../../../../open-sse/identity/tls/bin/win32/x64/switchboard-claude-tls.exe"]}
|
|
1
|
+
{"version":1,"files":["../../../../../../../node_modules/@swc/helpers/_/_interop_require_default/package.json","../../../../../../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../../../../../../node_modules/@swc/helpers/esm/_interop_require_default.js","../../../../../../../node_modules/@swc/helpers/package.json","../../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../../node_modules/better-sqlite3/package.json","../../../../../../../node_modules/bindings/bindings.js","../../../../../../../node_modules/bindings/package.json","../../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../../node_modules/next/dist/build/adapter/setup-node-env.external.js","../../../../../../../node_modules/next/dist/client/components/hooks-server-context.js","../../../../../../../node_modules/next/dist/client/components/static-generation-bailout.js","../../../../../../../node_modules/next/dist/client/lib/console.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../node_modules/next/dist/compiled/hash.js/sha256/256.js","../../../../../../../node_modules/next/dist/compiled/hash.js/sha256/package.json","../../../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../node_modules/next/dist/compiled/source-map/package.json","../../../../../../../node_modules/next/dist/compiled/source-map/source-map.js","../../../../../../../node_modules/next/dist/compiled/stacktrace-parser/package.json","../../../../../../../node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js","../../../../../../../node_modules/next/dist/compiled/ws/index.js","../../../../../../../node_modules/next/dist/compiled/ws/package.json","../../../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../../../node_modules/next/dist/lib/constants.js","../../../../../../../node_modules/next/dist/lib/framework/boundary-constants.js","../../../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../../../node_modules/next/dist/lib/is-error.js","../../../../../../../node_modules/next/dist/lib/picocolors.js","../../../../../../../node_modules/next/dist/lib/scheduler.js","../../../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../../../node_modules/next/dist/server/app-render/blocking-route-messages.js","../../../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../../../node_modules/next/dist/server/app-render/console-async-storage-instance.js","../../../../../../../node_modules/next/dist/server/app-render/console-async-storage.external.js","../../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../../../node_modules/next/dist/server/app-render/dynamic-rendering.js","../../../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js","../../../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-tracking.js","../../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../../../node_modules/next/dist/server/app-render/staged-rendering.js","../../../../../../../node_modules/next/dist/server/app-render/sync-io-messages.js","../../../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../../../node_modules/next/dist/server/dev/browser-logs/file-logger.js","../../../../../../../node_modules/next/dist/server/dynamic-rendering-utils.js","../../../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../../../node_modules/next/dist/server/lib/parse-stack.js","../../../../../../../node_modules/next/dist/server/lib/route-cache-key.js","../../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../../../node_modules/next/dist/server/lib/source-maps.js","../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../../../node_modules/next/dist/server/node-environment-baseline.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/console-dim.external.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/console-exit.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/console-file.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/date.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/error-inspect.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/io-utils.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/node-crypto.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/random.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js","../../../../../../../node_modules/next/dist/server/node-environment-extensions/web-crypto.js","../../../../../../../node_modules/next/dist/server/node-environment.js","../../../../../../../node_modules/next/dist/server/node-polyfill-crypto.js","../../../../../../../node_modules/next/dist/server/normalizers/built/app/app-pathname-normalizer.js","../../../../../../../node_modules/next/dist/server/normalizers/normalizers.js","../../../../../../../node_modules/next/dist/server/normalizers/underscore-normalizer.js","../../../../../../../node_modules/next/dist/server/normalizers/wrap-normalizer-fn.js","../../../../../../../node_modules/next/dist/server/patch-error-inspect.js","../../../../../../../node_modules/next/dist/server/require-hook.js","../../../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../../../node_modules/next/dist/server/route-kind.js","../../../../../../../node_modules/next/dist/server/runtime-reacts.external.js","../../../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../../../node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js","../../../../../../../node_modules/next/dist/shared/lib/instant-messages.js","../../../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js","../../../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../../../node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js","../../../../../../../node_modules/next/dist/shared/lib/page-path/normalize-page-path.js","../../../../../../../node_modules/next/dist/shared/lib/promise-with-resolvers.js","../../../../../../../node_modules/next/dist/shared/lib/router/utils/app-paths.js","../../../../../../../node_modules/next/dist/shared/lib/router/utils/index.js","../../../../../../../node_modules/next/dist/shared/lib/router/utils/interception-routes.js","../../../../../../../node_modules/next/dist/shared/lib/router/utils/is-dynamic.js","../../../../../../../node_modules/next/dist/shared/lib/router/utils/sorted-routes.js","../../../../../../../node_modules/next/dist/shared/lib/segment.js","../../../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../../../node_modules/next/dist/shared/lib/utils.js","../../../../../../../node_modules/next/package.json","../../../../../../../node_modules/react/cjs/react.development.js","../../../../../../../node_modules/react/cjs/react.production.js","../../../../../../../node_modules/react/index.js","../../../../../../../node_modules/react/package.json","../../../../../../../node_modules/sql.js/dist/sql-wasm.js","../../../../../../../node_modules/sql.js/package.json","../../../../../../../package.json","../../../../../../package.json","../../../../../chunks/1129.js","../../../../../chunks/1161.js","../../../../../chunks/1202.js","../../../../../chunks/1294.js","../../../../../chunks/1350.js","../../../../../chunks/1425.js","../../../../../chunks/1531.js","../../../../../chunks/1564.js","../../../../../chunks/1656.js","../../../../../chunks/1757.js","../../../../../chunks/1792.js","../../../../../chunks/1808.js","../../../../../chunks/1813.js","../../../../../chunks/1818.js","../../../../../chunks/1998.js","../../../../../chunks/2003.js","../../../../../chunks/2142.js","../../../../../chunks/232.js","../../../../../chunks/2348.js","../../../../../chunks/2409.js","../../../../../chunks/241.js","../../../../../chunks/2430.js","../../../../../chunks/2434.js","../../../../../chunks/2574.js","../../../../../chunks/2600.js","../../../../../chunks/27.js","../../../../../chunks/2712.js","../../../../../chunks/2750.js","../../../../../chunks/2766.js","../../../../../chunks/2770.js","../../../../../chunks/2935.js","../../../../../chunks/2970.js","../../../../../chunks/3072.js","../../../../../chunks/3294.js","../../../../../chunks/3449.js","../../../../../chunks/3593.js","../../../../../chunks/3675.js","../../../../../chunks/369.js","../../../../../chunks/3734.js","../../../../../chunks/3766.js","../../../../../chunks/3771.js","../../../../../chunks/3904.js","../../../../../chunks/4041.js","../../../../../chunks/4160.js","../../../../../chunks/4176.js","../../../../../chunks/4177.js","../../../../../chunks/4190.js","../../../../../chunks/428.js","../../../../../chunks/4434.js","../../../../../chunks/4454.js","../../../../../chunks/4646.js","../../../../../chunks/4739.js","../../../../../chunks/4780.js","../../../../../chunks/4803.js","../../../../../chunks/507.js","../../../../../chunks/5115.js","../../../../../chunks/5137.js","../../../../../chunks/5207.js","../../../../../chunks/5258.js","../../../../../chunks/5350.js","../../../../../chunks/5568.js","../../../../../chunks/5624.js","../../../../../chunks/5711.js","../../../../../chunks/5781.js","../../../../../chunks/5888.js","../../../../../chunks/5920.js","../../../../../chunks/6103.js","../../../../../chunks/6186.js","../../../../../chunks/6194.js","../../../../../chunks/6252.js","../../../../../chunks/629.js","../../../../../chunks/646.js","../../../../../chunks/6492.js","../../../../../chunks/6498.js","../../../../../chunks/6544.js","../../../../../chunks/6708.js","../../../../../chunks/6737.js","../../../../../chunks/6757.js","../../../../../chunks/6844.js","../../../../../chunks/6947.js","../../../../../chunks/698.js","../../../../../chunks/7066.js","../../../../../chunks/7133.js","../../../../../chunks/7554.js","../../../../../chunks/7557.js","../../../../../chunks/7650.js","../../../../../chunks/7662.js","../../../../../chunks/7726.js","../../../../../chunks/7730.js","../../../../../chunks/7753.js","../../../../../chunks/7757.js","../../../../../chunks/7774.js","../../../../../chunks/7828.js","../../../../../chunks/7856.js","../../../../../chunks/7965.js","../../../../../chunks/8062.js","../../../../../chunks/8080.js","../../../../../chunks/8102.js","../../../../../chunks/8197.js","../../../../../chunks/8400.js","../../../../../chunks/845.js","../../../../../chunks/8469.js","../../../../../chunks/849.js","../../../../../chunks/8520.js","../../../../../chunks/8658.js","../../../../../chunks/869.js","../../../../../chunks/8775.js","../../../../../chunks/8789.js","../../../../../chunks/881.js","../../../../../chunks/8942.js","../../../../../chunks/8998.js","../../../../../chunks/9078.js","../../../../../chunks/9091.js","../../../../../chunks/9155.js","../../../../../chunks/9264.js","../../../../../chunks/9353.js","../../../../../chunks/9421.js","../../../../../chunks/9662.js","../../../../../chunks/995.js","../../../../../chunks/static/media/catalog.b2c6512a.json","../../../../../chunks/static/media/versions.fd0ef9e7.json","../../../../../webpack-runtime.js","page_client-reference-manifest.js","../../../../../../../open-sse/providers/generated/catalog.json","../../../../../../../node_modules/impit/CHANGELOG.md","../../../../../../../node_modules/impit/dts-header.d.ts","../../../../../../../node_modules/impit/errors.js","../../../../../../../node_modules/impit/index.d.ts","../../../../../../../node_modules/impit/index.js","../../../../../../../node_modules/impit/index.wrapper.js","../../../../../../../node_modules/impit/package.json","../../../../../../../node_modules/impit/pnpm-workspace.yaml","../../../../../../../node_modules/impit/README.md","../../../../../../../node_modules/impit/tsconfig.docs.json","../../../../../../../node_modules/impit-linux-x64-gnu/impit-node.linux-x64-gnu.node","../../../../../../../node_modules/impit-linux-x64-gnu/package.json","../../../../../../../node_modules/impit-linux-x64-gnu/README.md","../../../../../../../node_modules/impit-linux-x64-musl/impit-node.linux-x64-musl.node","../../../../../../../node_modules/impit-linux-x64-musl/package.json","../../../../../../../node_modules/impit-linux-x64-musl/README.md","../../../../../../../open-sse/identity/tls/bin/darwin/arm64/switchboard-claude-tls","../../../../../../../open-sse/identity/tls/bin/darwin/x64/switchboard-claude-tls","../../../../../../../open-sse/identity/tls/bin/linux/arm64/switchboard-claude-tls","../../../../../../../open-sse/identity/tls/bin/linux/x64/switchboard-claude-tls","../../../../../../../open-sse/identity/tls/bin/win32/arm64/switchboard-claude-tls.exe","../../../../../../../open-sse/identity/tls/bin/win32/x64/switchboard-claude-tls.exe"]}
|