@hilbras/omnihilbras 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +15 -15
- package/app/.next-cli-build/build-manifest.json +3 -3
- package/app/.next-cli-build/react-loadable-manifest.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +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 +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.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 +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/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +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 +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.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-settings/route.js.nft.json +1 -1
- 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/codewhale-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/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
- 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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +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.nft.json +1 -1
- 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/omp-settings/route.js.nft.json +1 -1
- 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.nft.json +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/smelt-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +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 +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/oauth/xiaomi-mimo/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js +2 -2
- package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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 +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 +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/settings/database/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +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.nft.json +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.nft.json +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.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.nft.json +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.nft.json +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.nft.json +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.nft.json +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.nft.json +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.nft.json +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.nft.json +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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page.js.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 +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- 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 +15 -15
- package/app/.next-cli-build/server/chunks/1019.js +1 -1
- package/app/.next-cli-build/server/chunks/1998.js +1 -1
- package/app/.next-cli-build/server/chunks/2132.js +1 -1
- package/app/.next-cli-build/server/chunks/3770.js +1 -1
- package/app/.next-cli-build/server/chunks/3799.js +1 -1
- package/app/.next-cli-build/server/chunks/4043.js +1 -1
- package/app/.next-cli-build/server/chunks/4049.js +1 -1
- package/app/.next-cli-build/server/chunks/412.js +1 -1
- package/app/.next-cli-build/server/chunks/436.js +1 -1
- package/app/.next-cli-build/server/chunks/4663.js +1 -1
- package/app/.next-cli-build/server/chunks/5245.js +1 -1
- package/app/.next-cli-build/server/chunks/5615.js +3 -3
- package/app/.next-cli-build/server/chunks/5919.js +1 -1
- package/app/.next-cli-build/server/chunks/7211.js +1 -1
- package/app/.next-cli-build/server/chunks/7525.js +1 -1
- package/app/.next-cli-build/server/chunks/7557.js +1 -1
- package/app/.next-cli-build/server/chunks/7736.js +1 -0
- package/app/.next-cli-build/server/chunks/7811.js +1 -1
- package/app/.next-cli-build/server/chunks/7828.js +1 -1
- package/app/.next-cli-build/server/chunks/827.js +1 -1
- package/app/.next-cli-build/server/chunks/8416.js +1 -1
- package/app/.next-cli-build/server/chunks/915.js +1 -1
- package/app/.next-cli-build/server/chunks/9609.js +1 -1
- package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js.nft.json +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/static/chunks/5497-a21609d14a7bf81a.js +7 -0
- package/app/.next-cli-build/static/chunks/{85-abdd4f18753cba17.js → 85-5b93a7c74cd0ee26.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-e0e9fb7e9f122644.js → page-4e274865de44f799.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-1d6c37a1e6f380be.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-20e79861e79ed846.js → layout-f29206280cf7fde5.js} +1 -1
- package/app/.next-cli-build/static/chunks/{webpack-bdd19f62aea907f6.js → webpack-4d7bf920753b8f78.js} +1 -1
- package/app/cli/.build-home/.omnihilbras/db/data.sqlite +0 -0
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/app/.next-cli-build/server/chunks/5036.js +0 -1
- package/app/.next-cli-build/static/chunks/5497-dea83eee58687b78.js +0 -7
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-61bfa3b2f16b0c6d.js +0 -1
- /package/app/.next-cli-build/static/{2lzaQ8Vt54PR86aQkWaou → 3z1LvLny5fEVNyQctTtoy}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{2lzaQ8Vt54PR86aQkWaou → 3z1LvLny5fEVNyQctTtoy}/_ssgManifest.js +0 -0
|
@@ -24,4 +24,4 @@ pt-only-auto-named`:M,[G,Z]=(0,i.useState)("single"),[Q,V]=(0,i.useState)(""),[X
|
|
|
24
24
|
"id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
|
|
25
25
|
"email": "account2@example.com"
|
|
26
26
|
}
|
|
27
|
-
]`;function B(e){let t,s=e.trim();if(!s)return[];try{t=JSON.parse(s)}catch(e){try{let e=s;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),t=JSON.parse(e)}catch{throw e}}if(Array.isArray(t))return t;if(t&&"object"==typeof t)return Array.isArray(t.accounts)?t.accounts:[t];throw Error("Input must be a JSON object or array of objects")}function G({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,i.useState)(""),[n,o]=(0,i.useState)(!1),[d,c]=(0,i.useState)(""),[m,u]=(0,i.useState)(null),[x,h]=(0,i.useState)(!1),[f,g]=(0,i.useState)(null),y=(0,i.useRef)(null),b=()=>{n||(r(""),c(""),u(null),g(null),h(!1),t())},v=async e=>{if(!e||0===e.length)return;c("");let t=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===t.length)return void c((0,$.Tl)("Please select valid .json files"));try{let e=[];for(let s of t){let t=await s.text(),a=B(t);Array.isArray(a)?e.push(...a):a&&e.push(a)}if(0===e.length)return void c((0,$.Tl)("No accounts found in selected files"));r(JSON.stringify(e,null,2)),g({filesCount:t.length,accountsCount:e.length})}catch(e){c(`${(0,$.Tl)("Error reading files")}: ${e.message}`)}},j=async()=>{let e;c(""),u(null);try{e=B(l)}catch(e){c(`${(0,$.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void c((0,$.Tl)("No accounts found in input"));o(!0);try{let t=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),a=await t.json();if(!t.ok)return void c(a?.error||`Request failed: ${t.status}`);u(a),a.success>0&&"function"==typeof s&&s()}catch(e){c(e.message||(0,$.Tl)("Request failed"))}finally{o(!1)}},w=m?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(p.aF,{isOpen:e,title:(0,$.Tl)("Bulk Add Grok CLI Accounts"),onClose:b,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,$.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,a.jsx)("input",{ref:y,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{v(e.target.files),e.target&&(e.target.value="")}}),(0,a.jsx)(p.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>y.current?.click(),disabled:n,children:(0,$.Tl)("Upload JSON Files")})]}),(0,a.jsxs)("div",{onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:e=>{e.preventDefault(),h(!1)},onDrop:e=>{e.preventDefault(),h(!1),e.dataTransfer?.files?.length>0&&v(e.dataTransfer.files)},className:`relative rounded border transition-colors ${x?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,a.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:W,value:l,onChange:e=>{r(e.target.value),g(null)},disabled:n}),x&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,a.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,$.Tl)("Drop .json files here")})]})]}),f&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,a.jsxs)("span",{children:[(0,$.Tl)("Loaded")," ",f.accountsCount," ",(0,$.Tl)("account(s) from")," ",f.filesCount," ",(0,$.Tl)("file(s)")]})]}),d&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),m&&m.failed>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",m.failed," ",(0,$.Tl)("failed")]}),w.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:w.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(p.$n,{onClick:j,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,$.Tl)("Importing..."):(0,$.Tl)("Import All")}),(0,a.jsx)(p.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:n,children:(0,$.Tl)("Close")})]})]})})}var Z=s(65921);let Q=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],V=/^[A-Za-z0-9-]+$/;function X({providerId:e}){let t=(0,Z.i)(),[s,l]=(0,i.useState)(!1),[r,n]=(0,i.useState)([{name:"",value:""}]),[o,d]=(0,i.useState)({}),[c,m]=(0,i.useState)(!1),[u,x]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let t=!1;return fetch(`/api/providers/${e}/overrides`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>{if(t||!e)return;let s=e.builtinHeaders||{},a=Object.entries({...s,...e.headers||{}}).map(([e,t])=>({name:e,value:t}));d(s),n(a.length?a:[{name:"",value:""}]),m(Object.keys(e.headers||{}).length>0)}).catch(()=>{}),()=>{t=!0}},[e]);let h=(e,t,s)=>{n(a=>a.map((a,i)=>i===e?{...a,[t]:s}:a))},f=(0,i.useCallback)(async()=>{let s={};for(let e of r.filter(e=>e.name.trim())){let a=e.name.trim();if(!V.test(a))return void t.error(`Invalid header name: ${a}`);if(Q.includes(a.toLowerCase()))return void t.error(`Header ${a} cannot be overridden`);if(a in s)return void t.error(`Duplicate header name: ${a}`);e.value!==o[a]&&(s[a]=e.value)}x(!0);try{let a=await fetch(`/api/providers/${e}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:s})});if(!a.ok){let e=await a.json().catch(()=>({}));t.error(e.error||"Failed to save");return}m(Object.keys(s).length>0),t.success("Custom headers saved")}finally{x(!1)}},[r,o,e,t]);return 0!==Object.keys(o).length||c?(0,a.jsxs)(p.Zp,{padding:"xs",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>l(e=>!e),className:"flex w-full items-center justify-between text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,a.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),c&&(0,a.jsx)(p.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:s?"expand_less":"expand_more"})]}),s&&(0,a.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,a.jsx)("div",{className:"flex flex-col gap-2",children:r.map((e,t)=>{let s=e.name.trim()in o&&e.value!==o[e.name.trim()];return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:e.name,onChange:e=>h(t,"name",e.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,a.jsx)("input",{value:e.value,onChange:e=>h(t,"value",e.target.value),placeholder:"Value",spellCheck:!1,title:s?"Overridden":e.name.trim()in o?"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 ${s?"border-amber-400/60":"border-border"}`}),(0,a.jsx)("button",{type:"button",title:"Remove header",onClick:()=>n(e=>e.length>1?e.filter((e,s)=>s!==t):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},t)})}),(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>n(e=>[...e,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{type:"button",disabled:u,onClick:()=>{n(Object.entries(o).map(([e,t])=>({name:e,value:t})))},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,a.jsx)("button",{type:"button",disabled:u,onClick:f,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:u?"Saving...":"Save"})]})]})]})]}):null}X.propTypes={providerId:r().string.isRequired};var Y=s(97132),ee=s(93195);let et=[{value:"all",label:"All"},{value:"untested",label:"Untested"},{value:"passed",label:"Passed"},{value:"failed",label:"Failed"}],es={claude:"claudeAutoPing",codex:"codexAutoPing"};function ea({label:e,value:t,icon:s,tone:i="text-muted"}){return(0,a.jsxs)("div",{className:"rounded-xl border border-line bg-bg-soft/70 p-3.5",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[17px] ${i}`,"aria-hidden":"true",children:s}),(0,a.jsx)("p",{className:"muted mt-3 text-[10px] uppercase tracking-[0.1em]",children:e}),(0,a.jsx)("p",{className:"mt-1 truncate font-mono text-sm font-semibold",children:t})]})}function ei(){let e,t,s,l,r,o,h=(0,n.useParams)(),f=(0,n.useRouter)(),g=h.id,{getCaps:y}=(0,A.y)(),[b,v]=(0,i.useState)([]),[j,w]=(0,i.useState)(!0),[k,N]=(0,i.useState)(null),[T,E]=(0,i.useState)([]),[R,z]=(0,i.useState)(!1),[q,M]=(0,i.useState)(!1),[F,J]=(0,i.useState)(!1),[W,B]=(0,i.useState)(!1),[Z,Q]=(0,i.useState)(""),[V,ei]=(0,i.useState)(!1),[el,er]=(0,i.useState)(!1),[en,eo]=(0,i.useState)(!1),[ed,ec]=(0,i.useState)(!1),[em,ep]=(0,i.useState)(!1),[eu,ex]=(0,i.useState)(null),[eh,ef]=(0,i.useState)({}),[eg,ey]=(0,i.useState)([]),[eb,ev]=(0,i.useState)(!1),[ej,ew]=(0,i.useState)({}),[ek,eN]=(0,i.useState)(""),[eC,eS]=(0,i.useState)(()=>new Set),[eA,e$]=(0,i.useState)(""),[eT,eO]=(0,i.useState)("all"),[eP,eI]=(0,i.useState)(!1),[eE,eD]=(0,i.useState)([]),[eR,ez]=(0,i.useState)("__none__"),[eq,e_]=(0,i.useState)(!1),[eM,eU]=(0,i.useState)(null),[eK,eF]=(0,i.useState)(""),[eL,eJ]=(0,i.useState)("auto"),[eH,eW]=(0,i.useState)({enabled:!1,connections:{},schedules:{}}),[eB,eG]=(0,i.useState)(null),[eZ,eQ]=(0,i.useState)([]),[eV,eX]=(0,i.useState)(!1),[eY,e0]=(0,i.useState)(null),[e1,e2]=(0,i.useState)([]),[e5,e3]=(0,i.useState)(null),[e4,e6]=(0,i.useState)([]),[e9,e8]=(0,i.useState)([]),[e7,te]=(0,i.useState)(null),[tt,ts]=(0,i.useState)(!1),[ta,ti]=(0,i.useState)(!1),[tl,tr]=(0,i.useState)(!1),[tn,to]=(0,i.useState)(null),[td,tc]=(0,i.useState)({}),[tm,tp]=(0,i.useState)(null),tu=(0,i.useRef)(!1),[tx,th]=(0,i.useState)(!1),[tf,tg]=(0,i.useState)(!1),{copied:ty,copy:tb}=(0,S.C)(),tv="ag_risk_confirmed",tj=()=>{z(!0)},tw=()=>{"antigravity"===g&&"true"!==window.localStorage.getItem(tv)?ts(!0):"xiaomi-mimo"===g?M(!0):tA?tj():(Q(""),B(!0))},tk=()=>{Q(""),B(!0)},tN=()=>{tA?tw():tk()},tC=k?{id:k.id,name:k.name||("anthropic-compatible"===k.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===k.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===k.type?"AC":"OC",apiType:k.apiType,baseUrl:k.baseUrl,type:k.type}:u.zN[g]||u.fg[g]||u.IS[g]||u.nJ[g]||u.br[g],tS=tC?.authModes||[],tA=!!u.zN[g]||!!u.IS[g]||tS.includes("oauth"),t$=!!u.fg[g]||tS.includes("apikey"),tT=!!u.IS[g]?.noAuth,tO=(0,x.KC)(g),tP=(0,i.useMemo)(()=>(0,u.Q5)(g),[g]),tI="opencode"===g||!tP,tE=("cursor"===g||"zed"===g)&&e1.length>0?e1:tI?tO:[],tD=(0,u.wG)(g),tR=(0,u.mq)(g),tz=(0,u.gb)(g),tq=tR||tz,t_=!tq&&tA&&t$,tM="xai"===g?"Grok Build OAuth":"grok-cli"===g?"Grok CLI Device Login":"kimi"===g?"Kimi Coding OAuth":"OAuth",tU="xai"===g?"xAI API Key":"kimi"===g?"Kimi API Key":"qoder"===g||"qoder-cn"===g?"PAT":"API Key",tK=e=>{if(!eL||"auto"===eL)return null;let t=C(g,e);return t&&t.includes(eL)?eL:null},tF=tq?g:tD,tL=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let a=C(g,s);a&&a.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tE)s(e.id);for(let e of e4)s(e.id);for(let e of eg)e.providerAlias===tF&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tJ=tq?k?.prefix||g:tD,tH=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tF)}`,{cache:"no-store"}),t=await e.json();e.ok&&e8(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tF]),tW=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tF,ids:[e]})})).ok&&await tH()}catch(e){console.log("Error disabling model:",e)}},tB=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tF)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tH()}catch(e){console.log("Error enabling model:",e)}},tG=async e=>{e.length&&te({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{te(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tF,ids:e})})).ok&&await tH()}catch(e){console.log("Error disabling all models:",e)}}})},tZ=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tF)}`,{method:"DELETE"})).ok&&await tH()}catch(e){console.log("Error enabling all models:",e)}},tQ=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&ef(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tV=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ey(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===g&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&e6(e.models)}).catch(()=>{})},[g]);let tX=(0,i.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),l=await t.json(),r=await s.json(),n=a.ok?await a.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===g);v(e)}s.ok&&E(r.proxyPools||[]);let o=(n.providerStrategies||{})[g]||{};eU(o.fallbackStrategy||null),eF(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1");let d=(n.providerThinking||{})[g]||{};eJ(d.mode||"auto");let c=es[g],m=c&&n[c]||{};if(eW({enabled:!0===m.enabled,connections:m.connections||{},schedules:m.schedules||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===g)||null;if(!e&&tq)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===g)||null))break}N(e)}}catch(e){console.log("Error fetching connections:",e)}finally{w(!1)}},[g,tq]),tY=async e=>{try{let t=await fetch(`/api/provider-nodes/${g}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(N(s.node),await tX(),ec(!1))}catch(e){console.log("Error updating provider node:",e)}},t0=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...a};0===Object.keys(i).length?delete l[g]:l[g]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},t1=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[g]={mode:e}:delete s[g],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},t2=async e=>{let t=es[g];if(t){eW(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,i.useEffect)(()=>{tX(),tQ(),tV(),tH()},[tX,tQ,tV,tH]),(0,i.useEffect)(()=>{if("cursor"!==g&&"zed"!==g)return void e2([]);let e=b.find(e=>!1!==e.isActive);if(!e?.id){e2([]),"zed"===g&&e3(null);return}let t=!1;return"zed"===g&&e3(null),fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json().catch(()=>null)})).then(({ok:e,data:s})=>{if(!t){if(e&&Array.isArray(s?.models)&&s.models.length>0){e2(s.models),"zed"===g&&s?.warning&&e3(s.warning);return}"zed"===g&&(e2([]),e3(s?.warning||s?.error||"Zed returned no live models."))}}).catch(()=>{t||"zed"!==g||(e2([]),e3("Failed to reach the Zed model catalog."))}),()=>{t=!0}},[g,b]);let t5=async(e=!1,{autoAdd:t=!1}={})=>{if(tP){eX(!0);try{let{data:s,error:a}=await O(tP,g,{force:e});if(eQ(s),0===s.length)return void e0({ok:!1,text:a||"The provider returned no models."});if(!t)return void e0({ok:!0,text:`Fetched ${s.length} models.`});let i=new Set;for(let e of tE)i.add(`${tF}/${e.id}`);for(let e of eg)e.providerAlias===tF&&e.id&&i.add(`${tF}/${e.id}`);for(let e of Object.values(eh))"string"==typeof e&&i.add(e);let l=0,r=0;for(let e of s)if(!i.has(`${tF}/${e.id}`))try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tF,id:e.id,type:"llm",name:e.name||e.id,origin:"fetch"})})).ok?l+=1:r+=1}catch{r+=1}l>0&&(await tV(),window.dispatchEvent(new CustomEvent("customModelChanged")));let n=s.length-l-r,o=[];l>0&&o.push(`Added ${l} model${1===l?"":"s"}`),r>0&&o.push(`${r} failed`),n>0&&o.push(`${n} already in the list`),e0({ok:0===r&&l>0,text:o.join(" \xb7 ")||"All models already in the list."})}finally{eX(!1)}}};(0,i.useEffect)(()=>{let e=!1;if(tP)return O(tP,g).then(({data:t})=>{e||eQ(t)}),()=>{e=!0}},[g,tP]);let t3=async(e,t,s=tD)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await tQ();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},t4=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tQ()}catch(e){console.log("Error deleting alias:",e)}},t6=async(e,t="llm",s=tF,a,i)=>{try{let l=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t,...a?{caps:a}:{},...i?{transport:i}:{}})});if(l.ok)await tV(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await l.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},t9=async(e,t="llm",s=tF)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await tV(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},t8=async()=>{if(tx)return;let e=b.find(e=>!1!==e.isActive);if(!e)return void alert((0,$.Tl)("Please add an active Qoder connection first"));th(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,$.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,$.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^(qoder-cn|qoder)\//,"");eg.some(e=>e.providerAlias===tF&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(eh).includes(`${tF}/${s}`)||(await t6(s,"llm",tF),i+=1)}0===i?alert((0,$.Tl)("All models already exist, no new models added")):alert((0,$.Tl)("Successfully added")+` ${i} `+(0,$.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,$.Tl)("Error fetching models")+": "+e.message)}finally{th(!1)}},t7=async()=>{if(tf)return;let e=b.find(e=>!1!==e.isActive);if(!e)return void alert((0,$.Tl)("Please add an active Cline connection first"));tg(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,$.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,$.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;t&&(eg.some(e=>e.providerAlias===tF&&e.id===t&&"llm"===(e.kind||e.type||"llm"))||Object.values(eh).includes(`${tF}/${t}`)||(await t6(t,"llm",tF),i+=1))}0===i?alert((0,$.Tl)("All models already exist, no new models added")):alert((0,$.Tl)("Successfully added")+` ${i} `+(0,$.Tl)("models"))}catch(e){console.log("Error importing Cline models:",e),alert((0,$.Tl)("Error fetching models")+": "+e.message)}finally{tg(!1)}},se=async()=>{if(ta||0===b.length)return;let e=Object.fromEntries(b.map(e=>[e.id,{state:"queued",error:null}]));tu.current=!1,ti(!0),tr(!1),to(null),tc(e),tp({total:b.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<b.length;e+=1){if(tu.current){tp({total:b.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=b[e];to(a.id),tc(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:s+=1,tc(e=>({...e,[a.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){s+=1,tc(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}tp({total:b.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<b.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{to(null),ti(!1),tr(!1),tu.current=!1}},st=async e=>{te({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{te(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&v(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},ss=()=>{tX(),z(!1)},sa=async e=>{Q("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:g,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tX(),B(!1),t5(!0,{autoAdd:!0});return}Q(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),Q("Failed to save connection")}},si=async e=>{try{(await fetch(`/api/providers/${eu.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tX(),eo(!1),t5(!0,{autoAdd:!0}))}catch(e){console.log("Error updating connection:",e)}},sl=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&v(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},sr=async(e,t)=>{let s=[...b];[s[e],s[t]]=[s[t],s[e]],v(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tX()}},sn=b.filter(e=>eE.includes(e.id)),so=b.length>0&&eE.length===b.length;(0,i.useEffect)(()=>{eD(e=>e.filter(e=>b.some(t=>t.id===e)))},[b]),(()=>{if(0===sn.length)return;let e=new Set(sn.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=T.find(e=>e.id===t);return s?.name}})();let sd=()=>{eq||ep(!1)},sc=async e=>{e_(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tX(),ep(!1)}finally{e_(!1)}},sm=e=>sc(b.map(t=>({connectionId:t.id,proxyPoolId:e}))),sp=(0,a.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:b.map((e,t)=>{let s;return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,a.jsx)("input",{type:"checkbox",checked:(s=e.id,eE.includes(s)),onChange:()=>{var t;return t=e.id,void eD(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(_,{connection:e,proxyPools:T,isOAuth:tA,isFirst:0===t,isLast:t===b.length-1,onMoveUp:()=>sr(t,t-1),onMoveDown:()=>sr(t,t+1),onToggleActive:t=>sl(e.id,t),autoPing:es[g]&&"oauth"===e.authType?{isActive:!0===eH.connections[e.id]||eH.schedules?.[e.id]?.enabled===!0,reactiveOn:!0===eH.connections[e.id],provider:g,scheduleOn:eH.schedules?.[e.id]?.enabled===!0,scheduleSummary:(0,ee.JW)(eH.schedules?.[e.id]).join(" / "),onConfigure:()=>eG(e)}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&v(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{ex(e),eo(!0)},onDelete:()=>st(e.id),oneByOneStatus:td[e.id]||null})})]},e.id)})}),su=T.filter(e=>!0===e.isActive),sx=(0,a.jsx)(p.aF,{isOpen:em,onClose:sd,title:`Apply Proxy (${b.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:()=>{let e=T.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):sc(b.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eq||0===su.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>sm(null),disabled:eq,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),T.map(e=>(0,a.jsxs)("button",{onClick:()=>sm(e.id),disabled:eq||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eq&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(p.$n,{onClick:sd,variant:"ghost",fullWidth:!0,disabled:eq,children:"Cancel"})]})}),sh=async e=>{if(!eC.has(e)){eS(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tF}/${e}`})}),s=await t.json();ew(t=>({...t,[e]:s.ok?"ok":"error"})),eN(s.ok?"":s.error||"Model not reachable")}catch{ew(t=>({...t,[e]:"error"})),eN("Network error")}finally{eS(t=>{let s=new Set(t);return s.delete(e),s})}}};if(j)return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(p.Qv,{}),(0,a.jsx)(p.Qv,{})]});if(!tC)return(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(d(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let sf=()=>tR&&tC.apiType?"responses"===tC.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tz?"/providers/anthropic-m.png":(0,m.HY)(tC.id);return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(d(),{href:"/dashboard/providers",className:"btn-quiet -ml-2 mb-4 !px-2 !py-1.5 !text-xs inline-flex",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"arrow_back"}),"Back to providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col justify-between gap-4 sm:flex-row sm:items-start",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-3.5 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-xl border border-line",style:{backgroundColor:`${tC.color}15`},children:eb||!sf()?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:tC.color},children:tC.textIcon||tC.id.slice(0,2).toUpperCase()}):(0,a.jsx)(c.A,{src:sf(),alt:tC.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,m.Kw)(tC.id),ev(!0)},loading:"lazy",decoding:"async"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-[-0.035em] sm:text-3xl",children:tC.name}),b.length>0?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-success/25 bg-success/10 px-2 py-1 font-mono text-[9px] text-success",children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-success","aria-hidden":"true"}),b.length," Connected"]}):(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-line-strong bg-surface-2 px-2 py-1 font-mono text-[9px] text-muted",children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-muted","aria-hidden":"true"}),"Not connected"]})]}),(tC.notice?.apiKeyUrl||tC.notice?.signupUrl||tC.website)&&(0,a.jsxs)("a",{href:tC.notice?.apiKeyUrl||tC.notice?.signupUrl||tC.website,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-flex items-center gap-1 text-xs text-gold-text hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm","aria-hidden":"true",children:"open_in_new"}),tC.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]}),(0,a.jsxs)("p",{className:"muted mt-1 text-xs",children:[b.length," connection",1===b.length?"":"s"," \xb7 local workspace"]})]})]}),(0,a.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:(0,a.jsx)(p.$n,{size:"sm",icon:"add",onClick:tN,className:"btn-gold !px-3 !py-2.5 !text-xs",children:tq?"Add API Key":"Add connection"})})]})]}),(0,a.jsxs)("section",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Provider summary",children:[(0,a.jsx)(ea,{label:"Connections",value:String(b.length),icon:"key",tone:b.length>0?"text-success":"text-muted"}),(0,a.jsx)(ea,{label:"Models",value:(e=[...tE,...e4.filter(e=>!tE.some(t=>t.id===e.id))].filter(e=>{let t=(0,x.CP)(e);return!t||"llm"===t}).length)>0?String(e):"—",icon:"memory",tone:"text-[#5d98e8]"}),(0,a.jsx)(ea,{label:"Status",value:b.length>0?"Connected":"Not connected",icon:"activity",tone:b.length>0?"text-success":"text-muted"}),(0,a.jsx)(ea,{label:"Endpoint",value:tC.website?new URL(tC.website).hostname:g,icon:"dns",tone:"text-gold-text"})]}),tC.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:tC.deprecationNotice})]}),tC.notice?.text&&!tC.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:tC.notice.text}),tC.notice.apiKeyUrl&&(0,a.jsx)("a",{href:tC.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 →"})]}),tq&&k&&(0,a.jsx)(p.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tz?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tz?"Messages API":"responses"===k.apiType?"Responses API":"Chat Completions"," \xb7 ",(k.baseUrl||"").replace(/\/$/,""),"/",tz?"messages":"responses"===k.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(p.$n,{size:"sm",icon:"add",onClick:()=>{Q(""),B(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ec(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{te({title:"Delete Compatible Node",message:`Delete this ${tz?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{te(null);try{(await fetch(`/api/provider-nodes/${g}`,{method:"DELETE"})).ok&&f.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tT?(0,a.jsx)(p.gw,{providerId:g}):(0,a.jsxs)(p.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Connections"}),(0,a.jsx)("p",{className:"muted mt-1 text-xs",children:"Credentials and endpoints used by this provider."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[b.length>0&&T.length>0&&(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>ep(!0),children:"Apply Proxy"}),b.length>0&&(0,a.jsxs)(a.Fragment,{children:[eE.length>0&&(0,a.jsxs)(p.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eE.length;0!==e&&te({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{te(null);let e=0,t=[...eE];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}v(e=>e.filter(e=>!t.includes(e.id))),eD([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eE.length,")"]}),(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:se,disabled:ta,children:ta?"Testing Connection One-by-One...":"Test Connection One-by-One"}),ta&&(0,a.jsx)(p.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{ta&&(tu.current=!0,tr(!0))},disabled:tl,children:tl?"Stopping...":"Stop"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(p.lM,{checked:"round-robin"===eM,onChange:e=>{let t=e?"round-robin":null,s=e?eK||"1":eK;e&&!eK&&eF("1"),eU(t),t0(t,s)}}),"round-robin"===eM&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:eK,onChange:e=>{var t;eF(t=e.target.value),t0("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===b.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tA?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),t_&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tM," or ",tU,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:t_?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tw,children:tM}),(0,a.jsx)(p.$n,{size:"sm",icon:"key",onClick:tk,children:tU})]}):(0,a.jsxs)(a.Fragment,{children:[!tq&&"iflow"===g&&(0,a.jsx)(p.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>J(!0),children:"Cookie"}),"codex"===g&&(0,a.jsx)(p.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ei(!0),children:(0,$.Tl)("Bulk Add")}),"grok-cli"===g&&(0,a.jsx)(p.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>er(!0),children:(0,$.Tl)("Bulk Add")}),(0,a.jsx)(p.$n,{size:"sm",icon:"add",onClick:tN,children:tq?"Add API Key":"iflow"===g?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[tm&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:["Total: ",tm.total]}),(0,a.jsxs)("span",{children:["Completed: ",tm.completed]}),(0,a.jsxs)("span",{children:["Passed: ",tm.passed]}),(0,a.jsxs)("span",{children:["Failed: ",tm.failed]}),tm.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),ta&&tn&&(0,a.jsxs)("span",{children:["Running: ",b.find(e=>e.id===tn)?.name||tn]})]})}),b.length>0&&(0,a.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:so,onChange:()=>{so?eD([]):eD(b.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),sp,!tq&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===g&&(0,a.jsx)(p.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>J(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===g&&(0,a.jsx)(p.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ei(!0),title:(0,$.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,$.Tl)("Bulk Add")}),"grok-cli"===g&&(0,a.jsx)(p.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>er(!0),title:(0,$.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,$.Tl)("Bulk Add")}),t_?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tw,className:"w-full sm:w-auto",children:tM}),(0,a.jsx)(p.$n,{size:"sm",icon:"key",onClick:tk,className:"w-full sm:w-auto",children:tU})]}):(0,a.jsx)(p.$n,{size:"sm",icon:"add",onClick:tN,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsx)(X,{providerId:g}),(0,a.jsxs)(p.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col justify-between gap-3 sm:flex-row sm:items-start",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Available models"}),(0,a.jsx)("p",{className:"muted mt-1 text-xs",children:"Models currently exposed by this provider route. Test sends one real minimal request."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[eY&&(0,a.jsx)("span",{role:"status",className:`max-w-[240px] truncate rounded-lg border px-2 py-1 text-[11px] ${eY.ok?"border-success/25 bg-success/10 text-success":"border-danger/30 bg-danger/10 text-danger"}`,title:eY.text,children:eY.text}),tP&&(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:eV?"progress_activity":"cloud_download",onClick:()=>void t5(!0),disabled:eV,title:"Fetch the live model list from the provider API (uses your saved key)",className:eV?"[&_.material-symbols-outlined]:animate-spin":"",children:eV?"Fetching…":"Fetch models"}),tL&&(0,a.jsx)("select",{value:eL,onChange:e=>{var t;eJ(t=e.target.value),t1(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-line bg-surface px-2 py-1 text-[11px] focus:border-gold focus:outline-none",children:tL.map(e=>(0,a.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))}),!tq&&(t=[...tE,...e4.filter(e=>!tE.some(t=>t.id===e.id))].filter(e=>{let t=(0,x.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!e9.includes(e)),(0,a.jsxs)(a.Fragment,{children:[e9.length>0&&(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tZ,children:"Active All"}),t.length>0&&(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tG(t),children:"Disable All"})]}))]})]}),!tq&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,a.jsxs)("label",{className:"relative block flex-1",children:[(0,a.jsx)("span",{className:"sr-only",children:"Search models"}),(0,a.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-[15px] text-muted","aria-hidden":"true",children:"search"}),(0,a.jsx)("input",{value:eA,onChange:e=>e$(e.target.value),placeholder:"Search models","aria-label":"Search models",className:"input !h-9 !w-full !py-2 !pl-9 !pr-8 !text-xs",autoComplete:"off",spellCheck:!1}),eA&&(0,a.jsx)("button",{type:"button",onClick:()=>e$(""),"aria-label":"Clear model search",title:"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 rounded p-1 text-muted transition-colors hover:text-text",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px]","aria-hidden":"true",children:"close"})})]}),(0,a.jsx)("div",{className:"flex shrink-0 overflow-x-auto rounded-lg border border-line bg-bg-soft p-0.5",role:"tablist","aria-label":"Filter models by test result",children:et.map(e=>(0,a.jsx)("button",{type:"button",role:"tab","aria-selected":eT===e.value,onClick:()=>eO(e.value),className:`whitespace-nowrap rounded-md px-2.5 py-1.5 text-[10px] font-medium transition-colors ${eT===e.value?"bg-surface text-gold-text shadow-sm":"text-muted hover:text-text"}`,children:e.label},e.value))})]}),!!ek&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:ek}),/RegionError|hosted in China|regionNotAllowed/i.test(ek)&&(l=(s="string"==typeof ek?ek:JSON.stringify(ek)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),r=s.match(/wrk_[0-9A-Za-z]+/),o=l?l[0].endsWith("/go")?l[0]:`${l[0]}/go`:r?`https://opencode.ai/workspace/${r[0]}/go`:"https://opencode.ai",(0,a.jsx)("div",{className:"mt-1.5",children:(0,a.jsxs)("a",{href:o,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,a.jsx)("span",{children:"Allow China-hosted models"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===g&&!!e5&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:e5}),(()=>{let e,t,s;if(tq)return(0,a.jsx)(D,{providerStorageAlias:tF,providerDisplayAlias:tJ,modelAliases:eh,customModels:eg,copied:ty,onCopy:tb,onSetAlias:t3,onDeleteAlias:t4,onAddCustomModel:e=>t6(e,"llm",tF),onDeleteCustomModel:e=>t9(e,"llm",tF),connections:b,isAnthropic:tz});let i=[...tE,...e4.filter(e=>!tE.some(t=>t.id===e.id))].filter(e=>{let t=(0,x.CP)(e);return!t||"llm"===t}),l=new Set(e9),r=eA.trim().toLowerCase(),n=e=>!r||e.id.toLowerCase().includes(r)||(e.name||"").toLowerCase().includes(r),o=e=>{if("all"===eT)return!0;let t=ej[e.id];return"untested"===eT?!t:"passed"===eT?"ok"===t:"failed"!==eT||"error"===t},d=i.filter(e=>!l.has(e.id)&&n(e)&&o(e)),c=i.filter(e=>l.has(e.id)),m=P({customModels:eg,modelAliases:eh,providerAlias:tF,builtInModels:tE,type:"llm"}).filter(e=>n({id:e.id,name:e.name})&&o({id:e.id}));return(0,a.jsxs)("div",{className:"group/model-list space-y-2",children:[0===m.length&&0===d.length&&(0,a.jsxs)("div",{className:"rounded-xl border border-dashed border-line-strong px-5 py-9 text-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined mx-auto text-[24px] text-muted","aria-hidden":"true",children:"memory"}),(0,a.jsx)("p",{className:"mt-3 text-sm font-semibold",children:eA.trim()||"all"!==eT?"No matching models":"No models discovered"}),(0,a.jsx)("p",{className:"muted mt-1 text-xs",children:eA.trim()||"all"!==eT?"Try a different search or filter.":"Connect the provider or add a custom model ID below."})]}),m.map(e=>(0,a.jsx)(I,{model:{id:e.id,name:e.name},fullModel:`${tJ}/${e.id}`,alias:e.alias,copied:ty,onCopy:tb,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?t9(e.id,"llm",tF):t4(e.alias)},testStatus:ej[e.id],onTest:b.length>0||tT?()=>sh(e.id):void 0,isTesting:eC.has(e.id),isCustom:"fetch"!==e.origin,isFree:!1,caps:y(`${g}/${e.id}`),thinkingSuffix:tK(e.id)},`${e.source}-${e.fullModel}`)),d.map(e=>{let t=`${tF}/${e.id}`,s=`${g}/${e.id}`,i=Object.entries(eh).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(I,{model:e,fullModel:`${tJ}/${e.id}`,alias:i,copied:ty,onCopy:tb,onSetAlias:t=>t3(e.id,t,tF),onDeleteAlias:()=>t4(i),testStatus:ej[e.id],onTest:b.length>0||tT?()=>sh(e.id):void 0,isTesting:eC.has(e.id),isFree:e.isFree,onDisable:()=>tW(e.id),caps:y(`${g}/${e.id}`),thinkingSuffix:tK(e.id)},e.id)}),(0,a.jsxs)("button",{onClick:()=>eI(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-gold/40 px-3 py-2 text-xs font-medium text-gold-text transition-colors hover:border-gold hover:bg-gold-soft sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm","aria-hidden":"true",children:"add"}),"Add Model"]}),("qoder"===g||"qoder-cn"===g)&&b.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t8,disabled:tx,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:tx?{animation:"spin 1s linear infinite"}:void 0,children:tx?"progress_activity":"download"}),tx?(0,$.Tl)("Fetching..."):(0,$.Tl)("Fetch Qoder Models")]}),("cline"===g||"clinepass"===g)&&b.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t7,disabled:tf,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:tf?{animation:"spin 1s linear infinite"}:void 0,children:tf?"progress_activity":"download"}),tf?(0,$.Tl)("Fetching..."):(0,$.Tl)("Import from /models")]}),eZ.length>0&&(e=new Set([...Object.values(eh),...m.map(e=>e.fullModel)]),t=new Set(tE.map(e=>e.id)),0===(s=eZ.filter(s=>!e.has(`${tF}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested models from the provider API:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await t6(e.id,"llm",tF)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:e.contextLength?`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`:e.name||e.id,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),c.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",c.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(e=>(0,a.jsxs)("button",{onClick:()=>tB(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),sx,"kiro"===g?(0,a.jsx)(p.Mh,{isOpen:R,providerInfo:tC,onSuccess:ss,onClose:()=>z(!1)}):"cursor"===g?(0,a.jsx)(p.G9,{isOpen:R,onSuccess:ss,onClose:()=>z(!1)}):"zed"===g?(0,a.jsx)(p.TE,{isOpen:R,providerInfo:tC,onSuccess:ss,onClose:()=>z(!1)}):"gitlab"===g?(0,a.jsx)(p.vj,{isOpen:R,providerInfo:tC,onSuccess:ss,onClose:()=>z(!1)}):(0,a.jsx)(p.LF,{isOpen:R,provider:g,providerInfo:tC,onSuccess:ss,onClose:()=>z(!1)}),(0,a.jsx)(p.LH,{isOpen:q,onSuccess:ss,onClose:()=>M(!1)}),"iflow"===g&&(0,a.jsx)(p.vE,{isOpen:F,onSuccess:()=>{tX(),J(!1)},onClose:()=>J(!1)}),(0,a.jsx)(U,{isOpen:W,provider:g,providerName:tC.name,isCompatible:tq,isAnthropic:tz,authType:tC?.authType,authHint:tC?.authHint,website:tC?.website,proxyPools:T,error:Z,existingNames:b.map(e=>e.name).filter(Boolean),onSave:sa,onBulkDone:tX,onClose:()=>{Q(""),B(!1)}}),(0,a.jsx)(p.wI,{isOpen:en,connection:eu,proxyPools:T,onSave:si,onClose:()=>eo(!1)}),tq&&(0,a.jsx)(K,{isOpen:ed,node:k,onSave:tY,onClose:()=>ec(!1),isAnthropic:tz}),!tq&&(0,a.jsx)(L,{isOpen:eP,providerAlias:tF,providerDisplayAlias:tJ,onSave:async(e,t,s)=>{await t6(e,t?.stt?"stt":"llm",tF,t,s),eI(!1)},onClose:()=>eI(!1)}),"codex"===g&&(0,a.jsx)(H,{isOpen:V,onClose:()=>ei(!1),onSuccess:tX}),"grok-cli"===g&&(0,a.jsx)(G,{isOpen:el,onClose:()=>er(!1),onSuccess:tX}),eB&&(0,a.jsx)(Y.A,{isOpen:!!eB,onClose:()=>eG(null),connection:eB,reactive:!0===eH.connections[eB.id],schedule:eH.schedules?.[eB.id]||null,onSave:e=>((e,{reactive:t,schedule:s})=>{t2({...eH,connections:{...eH.connections,[e]:t},schedules:{...eH.schedules,[e]:s}})})(eB.id,e)}),(0,a.jsx)(p.uo,{isOpen:tt,onClose:()=>ts(!1),onConfirm:()=>{(window.localStorage.setItem(tv,"true"),ts(!1),tA)?tj():tk()},title:"Risk Notice",message:tC?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(p.uo,{isOpen:!!e7,onClose:()=>te(null),onConfirm:e7?.onConfirm,title:e7?.title||"Confirm",message:e7?.message,variant:"danger"})]})}ea.propTypes={label:r().string.isRequired,value:r().string.isRequired,icon:r().string.isRequired,tone:r().string}},93195:(e,t,s)=>{"use strict";function a(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}s.d(t,{JW:()=>o,Vm:()=>a,fB:()=>l,gy:()=>i,nz:()=>r});let i={anchor:"09:30",timezone:a(),windowHours:5,slotsPerDay:3};function l(e){let t=/^(\d{1,2}):(\d{2})$/.exec(String(e||"").trim());if(!t)return null;let s=Number(t[1]),a=Number(t[2]);return s>23||a>59?null:{hour:s,minute:a}}function r(e){return Math.max(1,Math.floor(24/e))}function n(e,t,s,a){let i="number"==typeof e?e:Number(e);return Number.isFinite(i)?Math.min(a,Math.max(s,i)):t}function o(e){let t=function(e){if(!e||!0!==e.enabled)return null;let t=l(e.anchor)||l(i.anchor),s=`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}`,a=!function(e){if(!e||"string"!=typeof e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}(e.timezone)?i.timezone:e.timezone,o=n(e.windowHours,i.windowHours,.5,24),d=Math.round(n(e.slotsPerDay,i.slotsPerDay,1,r(o)));return{enabled:!0,anchor:s,timezone:a,windowHours:o,slotsPerDay:d}}(e);if(!t)return[];let{hour:s,minute:a}=l(t.anchor),o=60*s+a;return Array.from({length:t.slotsPerDay},(e,s)=>{let a=Math.round(o+s*t.windowHours*60)%1440;return`${String(Math.floor(a/60)).padStart(2,"0")}:${String(a%60).padStart(2,"0")}`})}},97132:(e,t,s)=>{"use strict";s.d(t,{A:()=>m});var a=s(95155),i=s(12115),l=s(14051),r=s.n(l),n=s(35497),o=s(31474),d=s(93195);let c=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function m({isOpen:e,onClose:t,onSave:s,connection:l,reactive:r=!1,schedule:p=null}){let[u,x]=(0,i.useState)(()=>({mode:p?.enabled===!0?"schedule":!0===r?"reset":"off",anchor:p?.anchor||d.gy.anchor,timezone:(0,d.Vm)(),windowHours:String(p?.windowHours??d.gy.windowHours),slotsPerDay:String(p?.slotsPerDay??d.gy.slotsPerDay)})),h=Number(u.windowHours),f=Number(u.slotsPerDay),g=!!(0,d.fB)(u.anchor),y=Number.isFinite(h)&&h>=.5&&h<=24,b=y?(0,d.nz)(h):24,v=Number.isInteger(f)&&f>=1&&f<=b,j=g&&y&&v,w="schedule"!==u.mode||j,k=j?(0,d.JW)({enabled:!0,...u,windowHours:h,slotsPerDay:f}):[],N=k.length&&y?(()=>{let{hour:e,minute:t}=(0,d.fB)(u.anchor),s=Math.round(60*e+t+f*h*60)%1440;return`${String(Math.floor(s/60)).padStart(2,"0")}:${String(s%60).padStart(2,"0")}`})():"",C=e=>x(t=>({...t,...e}));return(0,a.jsx)(n.aF,{isOpen:e,onClose:t,title:"Auto-ping settings",size:"lg",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.$n,{variant:"secondary",onClick:t,children:"Cancel"}),(0,a.jsx)(n.$n,{onClick:()=>{w&&(s({reactive:"reset"===u.mode,schedule:"schedule"===u.mode?{enabled:!0,anchor:u.anchor,timezone:u.timezone,windowHours:h,slotsPerDay:f}:{enabled:!1}}),t())},disabled:!w,children:"Save"})]}),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",l?.name?` for ${l.name}`:""," — pick one mode."]}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:c.map(e=>{let t=u.mode===e.value;return(0,a.jsxs)("button",{type:"button",onClick:()=>C({mode:e.value}),className:(0,o.cn)("flex h-9 items-center justify-center gap-1.5 rounded-[8px] px-3 text-sm font-medium transition-all",t?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:e.icon}),(0,a.jsx)("span",{children:e.label})]},e.value)})}),"reset"===u.mode&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===u.mode&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,a.jsx)(n.pd,{label:"Anchor time",type:"time",value:u.anchor,onChange:e=>C({anchor:e.target.value}),error:g?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,a.jsx)(n.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:u.windowHours,onChange:e=>C({windowHours:e.target.value}),error:y?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,a.jsx)(n.pd,{label:"Pings per day",type:"number",min:"1",max:String(b),step:"1",value:u.slotsPerDay,onChange:e=>C({slotsPerDay:e.target.value}),error:v?"":`1 – ${b}`,hint:v?`Max ${b}`:"",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"})]}),k.length>0&&(0,a.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,a.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",u.timezone,")"]}),(0,a.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:k.join(" → ")}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",k[0]," – ",N,", then pauses until ",k[0]," next day."]})]})]})]})})}m.propTypes={isOpen:r().bool.isRequired,onClose:r().func.isRequired,onSave:r().func.isRequired,connection:r().object,reactive:r().bool,schedule:r().object}}},e=>{e.O(0,[8500,246,5772,85,705,5497,8441,3794,7358],()=>e(e.s=30840)),_N_E=e.O()}]);
|
|
27
|
+
]`;function B(e){let t,s=e.trim();if(!s)return[];try{t=JSON.parse(s)}catch(e){try{let e=s;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),t=JSON.parse(e)}catch{throw e}}if(Array.isArray(t))return t;if(t&&"object"==typeof t)return Array.isArray(t.accounts)?t.accounts:[t];throw Error("Input must be a JSON object or array of objects")}function G({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,i.useState)(""),[n,o]=(0,i.useState)(!1),[d,c]=(0,i.useState)(""),[m,u]=(0,i.useState)(null),[x,h]=(0,i.useState)(!1),[f,g]=(0,i.useState)(null),y=(0,i.useRef)(null),b=()=>{n||(r(""),c(""),u(null),g(null),h(!1),t())},v=async e=>{if(!e||0===e.length)return;c("");let t=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===t.length)return void c((0,$.Tl)("Please select valid .json files"));try{let e=[];for(let s of t){let t=await s.text(),a=B(t);Array.isArray(a)?e.push(...a):a&&e.push(a)}if(0===e.length)return void c((0,$.Tl)("No accounts found in selected files"));r(JSON.stringify(e,null,2)),g({filesCount:t.length,accountsCount:e.length})}catch(e){c(`${(0,$.Tl)("Error reading files")}: ${e.message}`)}},j=async()=>{let e;c(""),u(null);try{e=B(l)}catch(e){c(`${(0,$.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void c((0,$.Tl)("No accounts found in input"));o(!0);try{let t=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),a=await t.json();if(!t.ok)return void c(a?.error||`Request failed: ${t.status}`);u(a),a.success>0&&"function"==typeof s&&s()}catch(e){c(e.message||(0,$.Tl)("Request failed"))}finally{o(!1)}},w=m?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(p.aF,{isOpen:e,title:(0,$.Tl)("Bulk Add Grok CLI Accounts"),onClose:b,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,$.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,a.jsx)("input",{ref:y,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{v(e.target.files),e.target&&(e.target.value="")}}),(0,a.jsx)(p.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>y.current?.click(),disabled:n,children:(0,$.Tl)("Upload JSON Files")})]}),(0,a.jsxs)("div",{onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:e=>{e.preventDefault(),h(!1)},onDrop:e=>{e.preventDefault(),h(!1),e.dataTransfer?.files?.length>0&&v(e.dataTransfer.files)},className:`relative rounded border transition-colors ${x?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,a.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:W,value:l,onChange:e=>{r(e.target.value),g(null)},disabled:n}),x&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,a.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,$.Tl)("Drop .json files here")})]})]}),f&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,a.jsxs)("span",{children:[(0,$.Tl)("Loaded")," ",f.accountsCount," ",(0,$.Tl)("account(s) from")," ",f.filesCount," ",(0,$.Tl)("file(s)")]})]}),d&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),m&&m.failed>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",m.failed," ",(0,$.Tl)("failed")]}),w.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:w.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(p.$n,{onClick:j,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,$.Tl)("Importing..."):(0,$.Tl)("Import All")}),(0,a.jsx)(p.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:n,children:(0,$.Tl)("Close")})]})]})})}var Z=s(65921);let Q=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],V=/^[A-Za-z0-9-]+$/;function X({providerId:e}){let t=(0,Z.i)(),[s,l]=(0,i.useState)(!1),[r,n]=(0,i.useState)([{name:"",value:""}]),[o,d]=(0,i.useState)({}),[c,m]=(0,i.useState)(!1),[u,x]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let t=!1;return fetch(`/api/providers/${e}/overrides`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>{if(t||!e)return;let s=e.builtinHeaders||{},a=Object.entries({...s,...e.headers||{}}).map(([e,t])=>({name:e,value:t}));d(s),n(a.length?a:[{name:"",value:""}]),m(Object.keys(e.headers||{}).length>0)}).catch(()=>{}),()=>{t=!0}},[e]);let h=(e,t,s)=>{n(a=>a.map((a,i)=>i===e?{...a,[t]:s}:a))},f=(0,i.useCallback)(async()=>{let s={};for(let e of r.filter(e=>e.name.trim())){let a=e.name.trim();if(!V.test(a))return void t.error(`Invalid header name: ${a}`);if(Q.includes(a.toLowerCase()))return void t.error(`Header ${a} cannot be overridden`);if(a in s)return void t.error(`Duplicate header name: ${a}`);e.value!==o[a]&&(s[a]=e.value)}x(!0);try{let a=await fetch(`/api/providers/${e}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:s})});if(!a.ok){let e=await a.json().catch(()=>({}));t.error(e.error||"Failed to save");return}m(Object.keys(s).length>0),t.success("Custom headers saved")}finally{x(!1)}},[r,o,e,t]);return 0!==Object.keys(o).length||c?(0,a.jsxs)(p.Zp,{padding:"xs",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>l(e=>!e),className:"flex w-full items-center justify-between text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,a.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),c&&(0,a.jsx)(p.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:s?"expand_less":"expand_more"})]}),s&&(0,a.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,a.jsx)("div",{className:"flex flex-col gap-2",children:r.map((e,t)=>{let s=e.name.trim()in o&&e.value!==o[e.name.trim()];return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:e.name,onChange:e=>h(t,"name",e.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,a.jsx)("input",{value:e.value,onChange:e=>h(t,"value",e.target.value),placeholder:"Value",spellCheck:!1,title:s?"Overridden":e.name.trim()in o?"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 ${s?"border-amber-400/60":"border-border"}`}),(0,a.jsx)("button",{type:"button",title:"Remove header",onClick:()=>n(e=>e.length>1?e.filter((e,s)=>s!==t):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},t)})}),(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>n(e=>[...e,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{type:"button",disabled:u,onClick:()=>{n(Object.entries(o).map(([e,t])=>({name:e,value:t})))},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,a.jsx)("button",{type:"button",disabled:u,onClick:f,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:u?"Saving...":"Save"})]})]})]})]}):null}X.propTypes={providerId:r().string.isRequired};var Y=s(97132),ee=s(93195);let et=[{value:"all",label:"All"},{value:"untested",label:"Untested"},{value:"passed",label:"Passed"},{value:"failed",label:"Failed"}],es={claude:"claudeAutoPing",codex:"codexAutoPing"};function ea({label:e,value:t,icon:s,tone:i="text-muted"}){return(0,a.jsxs)("div",{className:"rounded-xl border border-line bg-bg-soft/70 p-3.5",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[17px] ${i}`,"aria-hidden":"true",children:s}),(0,a.jsx)("p",{className:"muted mt-3 text-[10px] uppercase tracking-[0.1em]",children:e}),(0,a.jsx)("p",{className:"mt-1 truncate font-mono text-sm font-semibold",children:t})]})}function ei(){let e,t,s,l,r,o,h=(0,n.useParams)(),f=(0,n.useRouter)(),g=h.id,{getCaps:y}=(0,A.y)(),[b,v]=(0,i.useState)([]),[j,w]=(0,i.useState)(!0),[k,N]=(0,i.useState)(null),[T,E]=(0,i.useState)([]),[R,z]=(0,i.useState)(!1),[q,M]=(0,i.useState)(!1),[F,J]=(0,i.useState)(!1),[W,B]=(0,i.useState)(!1),[Z,Q]=(0,i.useState)(""),[V,ei]=(0,i.useState)(!1),[el,er]=(0,i.useState)(!1),[en,eo]=(0,i.useState)(!1),[ed,ec]=(0,i.useState)(!1),[em,ep]=(0,i.useState)(!1),[eu,ex]=(0,i.useState)(null),[eh,ef]=(0,i.useState)({}),[eg,ey]=(0,i.useState)([]),[eb,ev]=(0,i.useState)(!1),[ej,ew]=(0,i.useState)({}),[ek,eN]=(0,i.useState)(""),[eC,eS]=(0,i.useState)(()=>new Set),[eA,e$]=(0,i.useState)(""),[eT,eO]=(0,i.useState)("all"),[eP,eI]=(0,i.useState)(!1),[eE,eD]=(0,i.useState)([]),[eR,ez]=(0,i.useState)("__none__"),[eq,e_]=(0,i.useState)(!1),[eM,eU]=(0,i.useState)(null),[eK,eF]=(0,i.useState)(""),[eL,eJ]=(0,i.useState)("auto"),[eH,eW]=(0,i.useState)({enabled:!1,connections:{},schedules:{}}),[eB,eG]=(0,i.useState)(null),[eZ,eQ]=(0,i.useState)([]),[eV,eX]=(0,i.useState)(!1),[eY,e0]=(0,i.useState)(null),[e1,e2]=(0,i.useState)([]),[e5,e3]=(0,i.useState)(null),[e4,e6]=(0,i.useState)([]),[e9,e8]=(0,i.useState)([]),[e7,te]=(0,i.useState)(null),[tt,ts]=(0,i.useState)(!1),[ta,ti]=(0,i.useState)(!1),[tl,tr]=(0,i.useState)(!1),[tn,to]=(0,i.useState)(null),[td,tc]=(0,i.useState)({}),[tm,tp]=(0,i.useState)(null),tu=(0,i.useRef)(!1),[tx,th]=(0,i.useState)(!1),[tf,tg]=(0,i.useState)(!1),{copied:ty,copy:tb}=(0,S.C)(),tv="ag_risk_confirmed",tj=()=>{z(!0)},tw=()=>{"antigravity"===g&&"true"!==window.localStorage.getItem(tv)?ts(!0):"xiaomi-mimo"===g?M(!0):tA?tj():(Q(""),B(!0))},tk=()=>{Q(""),B(!0)},tN=()=>{tA?tw():tk()},tC=k?{id:k.id,name:k.name||("anthropic-compatible"===k.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===k.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===k.type?"AC":"OC",apiType:k.apiType,baseUrl:k.baseUrl,type:k.type}:u.zN[g]||u.fg[g]||u.IS[g]||u.nJ[g]||u.br[g],tS=tC?.authModes||[],tA=!!u.zN[g]||!!u.IS[g]||tS.includes("oauth"),t$=!!u.fg[g]||tS.includes("apikey"),tT=!!u.IS[g]?.noAuth,tO=(0,x.KC)(g),tP=(0,i.useMemo)(()=>(0,u.Q5)(g),[g]),tI="opencode"===g||!tP,tE=("cursor"===g||"zed"===g)&&e1.length>0?e1:tI?tO:[],tD=(0,u.wG)(g),tR=(0,u.mq)(g),tz=(0,u.gb)(g),tq=tR||tz,t_=!tq&&tA&&t$,tM="xai"===g?"Grok Build OAuth":"grok-cli"===g?"Grok CLI Device Login":"kimi"===g?"Kimi Coding OAuth":"tokenharbor"===g?"Token Harbor Login":"OAuth",tU="xai"===g?"xAI API Key":"kimi"===g?"Kimi API Key":"qoder"===g||"qoder-cn"===g?"PAT":"API Key",tK=e=>{if(!eL||"auto"===eL)return null;let t=C(g,e);return t&&t.includes(eL)?eL:null},tF=tq?g:tD,tL=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let a=C(g,s);a&&a.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tE)s(e.id);for(let e of e4)s(e.id);for(let e of eg)e.providerAlias===tF&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tJ=tq?k?.prefix||g:tD,tH=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tF)}`,{cache:"no-store"}),t=await e.json();e.ok&&e8(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tF]),tW=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tF,ids:[e]})})).ok&&await tH()}catch(e){console.log("Error disabling model:",e)}},tB=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tF)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tH()}catch(e){console.log("Error enabling model:",e)}},tG=async e=>{e.length&&te({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{te(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tF,ids:e})})).ok&&await tH()}catch(e){console.log("Error disabling all models:",e)}}})},tZ=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tF)}`,{method:"DELETE"})).ok&&await tH()}catch(e){console.log("Error enabling all models:",e)}},tQ=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&ef(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tV=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ey(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===g&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&e6(e.models)}).catch(()=>{})},[g]);let tX=(0,i.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),l=await t.json(),r=await s.json(),n=a.ok?await a.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===g);v(e)}s.ok&&E(r.proxyPools||[]);let o=(n.providerStrategies||{})[g]||{};eU(o.fallbackStrategy||null),eF(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1");let d=(n.providerThinking||{})[g]||{};eJ(d.mode||"auto");let c=es[g],m=c&&n[c]||{};if(eW({enabled:!0===m.enabled,connections:m.connections||{},schedules:m.schedules||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===g)||null;if(!e&&tq)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===g)||null))break}N(e)}}catch(e){console.log("Error fetching connections:",e)}finally{w(!1)}},[g,tq]),tY=async e=>{try{let t=await fetch(`/api/provider-nodes/${g}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(N(s.node),await tX(),ec(!1))}catch(e){console.log("Error updating provider node:",e)}},t0=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...a};0===Object.keys(i).length?delete l[g]:l[g]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},t1=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[g]={mode:e}:delete s[g],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},t2=async e=>{let t=es[g];if(t){eW(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,i.useEffect)(()=>{tX(),tQ(),tV(),tH()},[tX,tQ,tV,tH]),(0,i.useEffect)(()=>{if("cursor"!==g&&"zed"!==g)return void e2([]);let e=b.find(e=>!1!==e.isActive);if(!e?.id){e2([]),"zed"===g&&e3(null);return}let t=!1;return"zed"===g&&e3(null),fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json().catch(()=>null)})).then(({ok:e,data:s})=>{if(!t){if(e&&Array.isArray(s?.models)&&s.models.length>0){e2(s.models),"zed"===g&&s?.warning&&e3(s.warning);return}"zed"===g&&(e2([]),e3(s?.warning||s?.error||"Zed returned no live models."))}}).catch(()=>{t||"zed"!==g||(e2([]),e3("Failed to reach the Zed model catalog."))}),()=>{t=!0}},[g,b]);let t5=async(e=!1,{autoAdd:t=!1}={})=>{if(tP){eX(!0);try{let{data:s,error:a}=await O(tP,g,{force:e});if(eQ(s),0===s.length)return void e0({ok:!1,text:a||"The provider returned no models."});if(!t)return void e0({ok:!0,text:`Fetched ${s.length} models.`});let i=new Set;for(let e of tE)i.add(`${tF}/${e.id}`);for(let e of eg)e.providerAlias===tF&&e.id&&i.add(`${tF}/${e.id}`);for(let e of Object.values(eh))"string"==typeof e&&i.add(e);let l=0,r=0;for(let e of s)if(!i.has(`${tF}/${e.id}`))try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tF,id:e.id,type:"llm",name:e.name||e.id,origin:"fetch"})})).ok?l+=1:r+=1}catch{r+=1}l>0&&(await tV(),window.dispatchEvent(new CustomEvent("customModelChanged")));let n=s.length-l-r,o=[];l>0&&o.push(`Added ${l} model${1===l?"":"s"}`),r>0&&o.push(`${r} failed`),n>0&&o.push(`${n} already in the list`),e0({ok:0===r&&l>0,text:o.join(" \xb7 ")||"All models already in the list."})}finally{eX(!1)}}};(0,i.useEffect)(()=>{let e=!1;if(tP)return O(tP,g).then(({data:t})=>{e||eQ(t)}),()=>{e=!0}},[g,tP]);let t3=async(e,t,s=tD)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await tQ();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},t4=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tQ()}catch(e){console.log("Error deleting alias:",e)}},t6=async(e,t="llm",s=tF,a,i)=>{try{let l=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t,...a?{caps:a}:{},...i?{transport:i}:{}})});if(l.ok)await tV(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await l.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},t9=async(e,t="llm",s=tF)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await tV(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},t8=async()=>{if(tx)return;let e=b.find(e=>!1!==e.isActive);if(!e)return void alert((0,$.Tl)("Please add an active Qoder connection first"));th(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,$.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,$.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^(qoder-cn|qoder)\//,"");eg.some(e=>e.providerAlias===tF&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(eh).includes(`${tF}/${s}`)||(await t6(s,"llm",tF),i+=1)}0===i?alert((0,$.Tl)("All models already exist, no new models added")):alert((0,$.Tl)("Successfully added")+` ${i} `+(0,$.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,$.Tl)("Error fetching models")+": "+e.message)}finally{th(!1)}},t7=async()=>{if(tf)return;let e=b.find(e=>!1!==e.isActive);if(!e)return void alert((0,$.Tl)("Please add an active Cline connection first"));tg(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,$.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,$.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;t&&(eg.some(e=>e.providerAlias===tF&&e.id===t&&"llm"===(e.kind||e.type||"llm"))||Object.values(eh).includes(`${tF}/${t}`)||(await t6(t,"llm",tF),i+=1))}0===i?alert((0,$.Tl)("All models already exist, no new models added")):alert((0,$.Tl)("Successfully added")+` ${i} `+(0,$.Tl)("models"))}catch(e){console.log("Error importing Cline models:",e),alert((0,$.Tl)("Error fetching models")+": "+e.message)}finally{tg(!1)}},se=async()=>{if(ta||0===b.length)return;let e=Object.fromEntries(b.map(e=>[e.id,{state:"queued",error:null}]));tu.current=!1,ti(!0),tr(!1),to(null),tc(e),tp({total:b.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<b.length;e+=1){if(tu.current){tp({total:b.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=b[e];to(a.id),tc(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:s+=1,tc(e=>({...e,[a.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){s+=1,tc(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}tp({total:b.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<b.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{to(null),ti(!1),tr(!1),tu.current=!1}},st=async e=>{te({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{te(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&v(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},ss=()=>{tX(),z(!1)},sa=async e=>{Q("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:g,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tX(),B(!1),t5(!0,{autoAdd:!0});return}Q(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),Q("Failed to save connection")}},si=async e=>{try{(await fetch(`/api/providers/${eu.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tX(),eo(!1),t5(!0,{autoAdd:!0}))}catch(e){console.log("Error updating connection:",e)}},sl=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&v(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},sr=async(e,t)=>{let s=[...b];[s[e],s[t]]=[s[t],s[e]],v(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tX()}},sn=b.filter(e=>eE.includes(e.id)),so=b.length>0&&eE.length===b.length;(0,i.useEffect)(()=>{eD(e=>e.filter(e=>b.some(t=>t.id===e)))},[b]),(()=>{if(0===sn.length)return;let e=new Set(sn.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=T.find(e=>e.id===t);return s?.name}})();let sd=()=>{eq||ep(!1)},sc=async e=>{e_(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tX(),ep(!1)}finally{e_(!1)}},sm=e=>sc(b.map(t=>({connectionId:t.id,proxyPoolId:e}))),sp=(0,a.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:b.map((e,t)=>{let s;return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,a.jsx)("input",{type:"checkbox",checked:(s=e.id,eE.includes(s)),onChange:()=>{var t;return t=e.id,void eD(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(_,{connection:e,proxyPools:T,isOAuth:tA,isFirst:0===t,isLast:t===b.length-1,onMoveUp:()=>sr(t,t-1),onMoveDown:()=>sr(t,t+1),onToggleActive:t=>sl(e.id,t),autoPing:es[g]&&"oauth"===e.authType?{isActive:!0===eH.connections[e.id]||eH.schedules?.[e.id]?.enabled===!0,reactiveOn:!0===eH.connections[e.id],provider:g,scheduleOn:eH.schedules?.[e.id]?.enabled===!0,scheduleSummary:(0,ee.JW)(eH.schedules?.[e.id]).join(" / "),onConfigure:()=>eG(e)}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&v(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{ex(e),eo(!0)},onDelete:()=>st(e.id),oneByOneStatus:td[e.id]||null})})]},e.id)})}),su=T.filter(e=>!0===e.isActive),sx=(0,a.jsx)(p.aF,{isOpen:em,onClose:sd,title:`Apply Proxy (${b.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:()=>{let e=T.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):sc(b.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eq||0===su.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>sm(null),disabled:eq,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),T.map(e=>(0,a.jsxs)("button",{onClick:()=>sm(e.id),disabled:eq||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eq&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(p.$n,{onClick:sd,variant:"ghost",fullWidth:!0,disabled:eq,children:"Cancel"})]})}),sh=async e=>{if(!eC.has(e)){eS(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tF}/${e}`})}),s=await t.json();ew(t=>({...t,[e]:s.ok?"ok":"error"})),eN(s.ok?"":s.error||"Model not reachable")}catch{ew(t=>({...t,[e]:"error"})),eN("Network error")}finally{eS(t=>{let s=new Set(t);return s.delete(e),s})}}};if(j)return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(p.Qv,{}),(0,a.jsx)(p.Qv,{})]});if(!tC)return(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(d(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let sf=()=>tR&&tC.apiType?"responses"===tC.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tz?"/providers/anthropic-m.png":(0,m.HY)(tC.id);return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(d(),{href:"/dashboard/providers",className:"btn-quiet -ml-2 mb-4 !px-2 !py-1.5 !text-xs inline-flex",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"arrow_back"}),"Back to providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col justify-between gap-4 sm:flex-row sm:items-start",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-3.5 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-xl border border-line",style:{backgroundColor:`${tC.color}15`},children:eb||!sf()?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:tC.color},children:tC.textIcon||tC.id.slice(0,2).toUpperCase()}):(0,a.jsx)(c.A,{src:sf(),alt:tC.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,m.Kw)(tC.id),ev(!0)},loading:"lazy",decoding:"async"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-[-0.035em] sm:text-3xl",children:tC.name}),b.length>0?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-success/25 bg-success/10 px-2 py-1 font-mono text-[9px] text-success",children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-success","aria-hidden":"true"}),b.length," Connected"]}):(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-line-strong bg-surface-2 px-2 py-1 font-mono text-[9px] text-muted",children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-muted","aria-hidden":"true"}),"Not connected"]})]}),(tC.notice?.apiKeyUrl||tC.notice?.signupUrl||tC.website)&&(0,a.jsxs)("a",{href:tC.notice?.apiKeyUrl||tC.notice?.signupUrl||tC.website,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-flex items-center gap-1 text-xs text-gold-text hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm","aria-hidden":"true",children:"open_in_new"}),tC.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]}),(0,a.jsxs)("p",{className:"muted mt-1 text-xs",children:[b.length," connection",1===b.length?"":"s"," \xb7 local workspace"]})]})]}),(0,a.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:(0,a.jsx)(p.$n,{size:"sm",icon:"add",onClick:tN,className:"btn-gold !px-3 !py-2.5 !text-xs",children:tq?"Add API Key":"Add connection"})})]})]}),(0,a.jsxs)("section",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Provider summary",children:[(0,a.jsx)(ea,{label:"Connections",value:String(b.length),icon:"key",tone:b.length>0?"text-success":"text-muted"}),(0,a.jsx)(ea,{label:"Models",value:(e=[...tE,...e4.filter(e=>!tE.some(t=>t.id===e.id))].filter(e=>{let t=(0,x.CP)(e);return!t||"llm"===t}).length)>0?String(e):"—",icon:"memory",tone:"text-[#5d98e8]"}),(0,a.jsx)(ea,{label:"Status",value:b.length>0?"Connected":"Not connected",icon:"activity",tone:b.length>0?"text-success":"text-muted"}),(0,a.jsx)(ea,{label:"Endpoint",value:tC.website?new URL(tC.website).hostname:g,icon:"dns",tone:"text-gold-text"})]}),tC.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:tC.deprecationNotice})]}),tC.notice?.text&&!tC.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:tC.notice.text}),tC.notice.apiKeyUrl&&(0,a.jsx)("a",{href:tC.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 →"})]}),tq&&k&&(0,a.jsx)(p.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tz?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tz?"Messages API":"responses"===k.apiType?"Responses API":"Chat Completions"," \xb7 ",(k.baseUrl||"").replace(/\/$/,""),"/",tz?"messages":"responses"===k.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(p.$n,{size:"sm",icon:"add",onClick:()=>{Q(""),B(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ec(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{te({title:"Delete Compatible Node",message:`Delete this ${tz?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{te(null);try{(await fetch(`/api/provider-nodes/${g}`,{method:"DELETE"})).ok&&f.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tT?(0,a.jsx)(p.gw,{providerId:g}):(0,a.jsxs)(p.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Connections"}),(0,a.jsx)("p",{className:"muted mt-1 text-xs",children:"Credentials and endpoints used by this provider."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[b.length>0&&T.length>0&&(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>ep(!0),children:"Apply Proxy"}),b.length>0&&(0,a.jsxs)(a.Fragment,{children:[eE.length>0&&(0,a.jsxs)(p.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eE.length;0!==e&&te({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{te(null);let e=0,t=[...eE];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}v(e=>e.filter(e=>!t.includes(e.id))),eD([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eE.length,")"]}),(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:se,disabled:ta,children:ta?"Testing Connection One-by-One...":"Test Connection One-by-One"}),ta&&(0,a.jsx)(p.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{ta&&(tu.current=!0,tr(!0))},disabled:tl,children:tl?"Stopping...":"Stop"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(p.lM,{checked:"round-robin"===eM,onChange:e=>{let t=e?"round-robin":null,s=e?eK||"1":eK;e&&!eK&&eF("1"),eU(t),t0(t,s)}}),"round-robin"===eM&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:eK,onChange:e=>{var t;eF(t=e.target.value),t0("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===b.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tA?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),t_&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tM," or ",tU,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:t_?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tw,children:tM}),(0,a.jsx)(p.$n,{size:"sm",icon:"key",onClick:tk,children:tU})]}):(0,a.jsxs)(a.Fragment,{children:[!tq&&"iflow"===g&&(0,a.jsx)(p.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>J(!0),children:"Cookie"}),"codex"===g&&(0,a.jsx)(p.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ei(!0),children:(0,$.Tl)("Bulk Add")}),"grok-cli"===g&&(0,a.jsx)(p.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>er(!0),children:(0,$.Tl)("Bulk Add")}),(0,a.jsx)(p.$n,{size:"sm",icon:"add",onClick:tN,children:tq?"Add API Key":"iflow"===g?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[tm&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:["Total: ",tm.total]}),(0,a.jsxs)("span",{children:["Completed: ",tm.completed]}),(0,a.jsxs)("span",{children:["Passed: ",tm.passed]}),(0,a.jsxs)("span",{children:["Failed: ",tm.failed]}),tm.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),ta&&tn&&(0,a.jsxs)("span",{children:["Running: ",b.find(e=>e.id===tn)?.name||tn]})]})}),b.length>0&&(0,a.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:so,onChange:()=>{so?eD([]):eD(b.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),sp,!tq&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===g&&(0,a.jsx)(p.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>J(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===g&&(0,a.jsx)(p.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ei(!0),title:(0,$.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,$.Tl)("Bulk Add")}),"grok-cli"===g&&(0,a.jsx)(p.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>er(!0),title:(0,$.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,$.Tl)("Bulk Add")}),t_?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tw,className:"w-full sm:w-auto",children:tM}),(0,a.jsx)(p.$n,{size:"sm",icon:"key",onClick:tk,className:"w-full sm:w-auto",children:tU})]}):(0,a.jsx)(p.$n,{size:"sm",icon:"add",onClick:tN,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsx)(X,{providerId:g}),(0,a.jsxs)(p.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col justify-between gap-3 sm:flex-row sm:items-start",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Available models"}),(0,a.jsx)("p",{className:"muted mt-1 text-xs",children:"Models currently exposed by this provider route. Test sends one real minimal request."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[eY&&(0,a.jsx)("span",{role:"status",className:`max-w-[240px] truncate rounded-lg border px-2 py-1 text-[11px] ${eY.ok?"border-success/25 bg-success/10 text-success":"border-danger/30 bg-danger/10 text-danger"}`,title:eY.text,children:eY.text}),tP&&(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:eV?"progress_activity":"cloud_download",onClick:()=>void t5(!0),disabled:eV,title:"Fetch the live model list from the provider API (uses your saved key)",className:eV?"[&_.material-symbols-outlined]:animate-spin":"",children:eV?"Fetching…":"Fetch models"}),tL&&(0,a.jsx)("select",{value:eL,onChange:e=>{var t;eJ(t=e.target.value),t1(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-line bg-surface px-2 py-1 text-[11px] focus:border-gold focus:outline-none",children:tL.map(e=>(0,a.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))}),!tq&&(t=[...tE,...e4.filter(e=>!tE.some(t=>t.id===e.id))].filter(e=>{let t=(0,x.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!e9.includes(e)),(0,a.jsxs)(a.Fragment,{children:[e9.length>0&&(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tZ,children:"Active All"}),t.length>0&&(0,a.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tG(t),children:"Disable All"})]}))]})]}),!tq&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,a.jsxs)("label",{className:"relative block flex-1",children:[(0,a.jsx)("span",{className:"sr-only",children:"Search models"}),(0,a.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-[15px] text-muted","aria-hidden":"true",children:"search"}),(0,a.jsx)("input",{value:eA,onChange:e=>e$(e.target.value),placeholder:"Search models","aria-label":"Search models",className:"input !h-9 !w-full !py-2 !pl-9 !pr-8 !text-xs",autoComplete:"off",spellCheck:!1}),eA&&(0,a.jsx)("button",{type:"button",onClick:()=>e$(""),"aria-label":"Clear model search",title:"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 rounded p-1 text-muted transition-colors hover:text-text",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px]","aria-hidden":"true",children:"close"})})]}),(0,a.jsx)("div",{className:"flex shrink-0 overflow-x-auto rounded-lg border border-line bg-bg-soft p-0.5",role:"tablist","aria-label":"Filter models by test result",children:et.map(e=>(0,a.jsx)("button",{type:"button",role:"tab","aria-selected":eT===e.value,onClick:()=>eO(e.value),className:`whitespace-nowrap rounded-md px-2.5 py-1.5 text-[10px] font-medium transition-colors ${eT===e.value?"bg-surface text-gold-text shadow-sm":"text-muted hover:text-text"}`,children:e.label},e.value))})]}),!!ek&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:ek}),/RegionError|hosted in China|regionNotAllowed/i.test(ek)&&(l=(s="string"==typeof ek?ek:JSON.stringify(ek)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),r=s.match(/wrk_[0-9A-Za-z]+/),o=l?l[0].endsWith("/go")?l[0]:`${l[0]}/go`:r?`https://opencode.ai/workspace/${r[0]}/go`:"https://opencode.ai",(0,a.jsx)("div",{className:"mt-1.5",children:(0,a.jsxs)("a",{href:o,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,a.jsx)("span",{children:"Allow China-hosted models"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===g&&!!e5&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:e5}),(()=>{let e,t,s;if(tq)return(0,a.jsx)(D,{providerStorageAlias:tF,providerDisplayAlias:tJ,modelAliases:eh,customModels:eg,copied:ty,onCopy:tb,onSetAlias:t3,onDeleteAlias:t4,onAddCustomModel:e=>t6(e,"llm",tF),onDeleteCustomModel:e=>t9(e,"llm",tF),connections:b,isAnthropic:tz});let i=[...tE,...e4.filter(e=>!tE.some(t=>t.id===e.id))].filter(e=>{let t=(0,x.CP)(e);return!t||"llm"===t}),l=new Set(e9),r=eA.trim().toLowerCase(),n=e=>!r||e.id.toLowerCase().includes(r)||(e.name||"").toLowerCase().includes(r),o=e=>{if("all"===eT)return!0;let t=ej[e.id];return"untested"===eT?!t:"passed"===eT?"ok"===t:"failed"!==eT||"error"===t},d=i.filter(e=>!l.has(e.id)&&n(e)&&o(e)),c=i.filter(e=>l.has(e.id)),m=P({customModels:eg,modelAliases:eh,providerAlias:tF,builtInModels:tE,type:"llm"}).filter(e=>n({id:e.id,name:e.name})&&o({id:e.id}));return(0,a.jsxs)("div",{className:"group/model-list space-y-2",children:[0===m.length&&0===d.length&&(0,a.jsxs)("div",{className:"rounded-xl border border-dashed border-line-strong px-5 py-9 text-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined mx-auto text-[24px] text-muted","aria-hidden":"true",children:"memory"}),(0,a.jsx)("p",{className:"mt-3 text-sm font-semibold",children:eA.trim()||"all"!==eT?"No matching models":"No models discovered"}),(0,a.jsx)("p",{className:"muted mt-1 text-xs",children:eA.trim()||"all"!==eT?"Try a different search or filter.":"Connect the provider or add a custom model ID below."})]}),m.map(e=>(0,a.jsx)(I,{model:{id:e.id,name:e.name},fullModel:`${tJ}/${e.id}`,alias:e.alias,copied:ty,onCopy:tb,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?t9(e.id,"llm",tF):t4(e.alias)},testStatus:ej[e.id],onTest:b.length>0||tT?()=>sh(e.id):void 0,isTesting:eC.has(e.id),isCustom:"fetch"!==e.origin,isFree:!1,caps:y(`${g}/${e.id}`),thinkingSuffix:tK(e.id)},`${e.source}-${e.fullModel}`)),d.map(e=>{let t=`${tF}/${e.id}`,s=`${g}/${e.id}`,i=Object.entries(eh).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(I,{model:e,fullModel:`${tJ}/${e.id}`,alias:i,copied:ty,onCopy:tb,onSetAlias:t=>t3(e.id,t,tF),onDeleteAlias:()=>t4(i),testStatus:ej[e.id],onTest:b.length>0||tT?()=>sh(e.id):void 0,isTesting:eC.has(e.id),isFree:e.isFree,onDisable:()=>tW(e.id),caps:y(`${g}/${e.id}`),thinkingSuffix:tK(e.id)},e.id)}),(0,a.jsxs)("button",{onClick:()=>eI(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-gold/40 px-3 py-2 text-xs font-medium text-gold-text transition-colors hover:border-gold hover:bg-gold-soft sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm","aria-hidden":"true",children:"add"}),"Add Model"]}),("qoder"===g||"qoder-cn"===g)&&b.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t8,disabled:tx,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:tx?{animation:"spin 1s linear infinite"}:void 0,children:tx?"progress_activity":"download"}),tx?(0,$.Tl)("Fetching..."):(0,$.Tl)("Fetch Qoder Models")]}),("cline"===g||"clinepass"===g)&&b.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t7,disabled:tf,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:tf?{animation:"spin 1s linear infinite"}:void 0,children:tf?"progress_activity":"download"}),tf?(0,$.Tl)("Fetching..."):(0,$.Tl)("Import from /models")]}),eZ.length>0&&(e=new Set([...Object.values(eh),...m.map(e=>e.fullModel)]),t=new Set(tE.map(e=>e.id)),0===(s=eZ.filter(s=>!e.has(`${tF}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested models from the provider API:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await t6(e.id,"llm",tF)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:e.contextLength?`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`:e.name||e.id,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),c.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",c.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(e=>(0,a.jsxs)("button",{onClick:()=>tB(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),sx,"kiro"===g?(0,a.jsx)(p.Mh,{isOpen:R,providerInfo:tC,onSuccess:ss,onClose:()=>z(!1)}):"cursor"===g?(0,a.jsx)(p.G9,{isOpen:R,onSuccess:ss,onClose:()=>z(!1)}):"zed"===g?(0,a.jsx)(p.TE,{isOpen:R,providerInfo:tC,onSuccess:ss,onClose:()=>z(!1)}):"gitlab"===g?(0,a.jsx)(p.vj,{isOpen:R,providerInfo:tC,onSuccess:ss,onClose:()=>z(!1)}):"tokenharbor"===g?(0,a.jsx)(p.O1,{isOpen:R,providerInfo:tC,onSuccess:ss,onClose:()=>z(!1)}):(0,a.jsx)(p.LF,{isOpen:R,provider:g,providerInfo:tC,onSuccess:ss,onClose:()=>z(!1)}),(0,a.jsx)(p.LH,{isOpen:q,onSuccess:ss,onClose:()=>M(!1)}),"iflow"===g&&(0,a.jsx)(p.vE,{isOpen:F,onSuccess:()=>{tX(),J(!1)},onClose:()=>J(!1)}),(0,a.jsx)(U,{isOpen:W,provider:g,providerName:tC.name,isCompatible:tq,isAnthropic:tz,authType:tC?.authType,authHint:tC?.authHint,website:tC?.website,proxyPools:T,error:Z,existingNames:b.map(e=>e.name).filter(Boolean),onSave:sa,onBulkDone:tX,onClose:()=>{Q(""),B(!1)}}),(0,a.jsx)(p.wI,{isOpen:en,connection:eu,proxyPools:T,onSave:si,onClose:()=>eo(!1)}),tq&&(0,a.jsx)(K,{isOpen:ed,node:k,onSave:tY,onClose:()=>ec(!1),isAnthropic:tz}),!tq&&(0,a.jsx)(L,{isOpen:eP,providerAlias:tF,providerDisplayAlias:tJ,onSave:async(e,t,s)=>{await t6(e,t?.stt?"stt":"llm",tF,t,s),eI(!1)},onClose:()=>eI(!1)}),"codex"===g&&(0,a.jsx)(H,{isOpen:V,onClose:()=>ei(!1),onSuccess:tX}),"grok-cli"===g&&(0,a.jsx)(G,{isOpen:el,onClose:()=>er(!1),onSuccess:tX}),eB&&(0,a.jsx)(Y.A,{isOpen:!!eB,onClose:()=>eG(null),connection:eB,reactive:!0===eH.connections[eB.id],schedule:eH.schedules?.[eB.id]||null,onSave:e=>((e,{reactive:t,schedule:s})=>{t2({...eH,connections:{...eH.connections,[e]:t},schedules:{...eH.schedules,[e]:s}})})(eB.id,e)}),(0,a.jsx)(p.uo,{isOpen:tt,onClose:()=>ts(!1),onConfirm:()=>{(window.localStorage.setItem(tv,"true"),ts(!1),tA)?tj():tk()},title:"Risk Notice",message:tC?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(p.uo,{isOpen:!!e7,onClose:()=>te(null),onConfirm:e7?.onConfirm,title:e7?.title||"Confirm",message:e7?.message,variant:"danger"})]})}ea.propTypes={label:r().string.isRequired,value:r().string.isRequired,icon:r().string.isRequired,tone:r().string}},93195:(e,t,s)=>{"use strict";function a(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}s.d(t,{JW:()=>o,Vm:()=>a,fB:()=>l,gy:()=>i,nz:()=>r});let i={anchor:"09:30",timezone:a(),windowHours:5,slotsPerDay:3};function l(e){let t=/^(\d{1,2}):(\d{2})$/.exec(String(e||"").trim());if(!t)return null;let s=Number(t[1]),a=Number(t[2]);return s>23||a>59?null:{hour:s,minute:a}}function r(e){return Math.max(1,Math.floor(24/e))}function n(e,t,s,a){let i="number"==typeof e?e:Number(e);return Number.isFinite(i)?Math.min(a,Math.max(s,i)):t}function o(e){let t=function(e){if(!e||!0!==e.enabled)return null;let t=l(e.anchor)||l(i.anchor),s=`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}`,a=!function(e){if(!e||"string"!=typeof e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}(e.timezone)?i.timezone:e.timezone,o=n(e.windowHours,i.windowHours,.5,24),d=Math.round(n(e.slotsPerDay,i.slotsPerDay,1,r(o)));return{enabled:!0,anchor:s,timezone:a,windowHours:o,slotsPerDay:d}}(e);if(!t)return[];let{hour:s,minute:a}=l(t.anchor),o=60*s+a;return Array.from({length:t.slotsPerDay},(e,s)=>{let a=Math.round(o+s*t.windowHours*60)%1440;return`${String(Math.floor(a/60)).padStart(2,"0")}:${String(a%60).padStart(2,"0")}`})}},97132:(e,t,s)=>{"use strict";s.d(t,{A:()=>m});var a=s(95155),i=s(12115),l=s(14051),r=s.n(l),n=s(35497),o=s(31474),d=s(93195);let c=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function m({isOpen:e,onClose:t,onSave:s,connection:l,reactive:r=!1,schedule:p=null}){let[u,x]=(0,i.useState)(()=>({mode:p?.enabled===!0?"schedule":!0===r?"reset":"off",anchor:p?.anchor||d.gy.anchor,timezone:(0,d.Vm)(),windowHours:String(p?.windowHours??d.gy.windowHours),slotsPerDay:String(p?.slotsPerDay??d.gy.slotsPerDay)})),h=Number(u.windowHours),f=Number(u.slotsPerDay),g=!!(0,d.fB)(u.anchor),y=Number.isFinite(h)&&h>=.5&&h<=24,b=y?(0,d.nz)(h):24,v=Number.isInteger(f)&&f>=1&&f<=b,j=g&&y&&v,w="schedule"!==u.mode||j,k=j?(0,d.JW)({enabled:!0,...u,windowHours:h,slotsPerDay:f}):[],N=k.length&&y?(()=>{let{hour:e,minute:t}=(0,d.fB)(u.anchor),s=Math.round(60*e+t+f*h*60)%1440;return`${String(Math.floor(s/60)).padStart(2,"0")}:${String(s%60).padStart(2,"0")}`})():"",C=e=>x(t=>({...t,...e}));return(0,a.jsx)(n.aF,{isOpen:e,onClose:t,title:"Auto-ping settings",size:"lg",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.$n,{variant:"secondary",onClick:t,children:"Cancel"}),(0,a.jsx)(n.$n,{onClick:()=>{w&&(s({reactive:"reset"===u.mode,schedule:"schedule"===u.mode?{enabled:!0,anchor:u.anchor,timezone:u.timezone,windowHours:h,slotsPerDay:f}:{enabled:!1}}),t())},disabled:!w,children:"Save"})]}),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",l?.name?` for ${l.name}`:""," — pick one mode."]}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:c.map(e=>{let t=u.mode===e.value;return(0,a.jsxs)("button",{type:"button",onClick:()=>C({mode:e.value}),className:(0,o.cn)("flex h-9 items-center justify-center gap-1.5 rounded-[8px] px-3 text-sm font-medium transition-all",t?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:e.icon}),(0,a.jsx)("span",{children:e.label})]},e.value)})}),"reset"===u.mode&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===u.mode&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,a.jsx)(n.pd,{label:"Anchor time",type:"time",value:u.anchor,onChange:e=>C({anchor:e.target.value}),error:g?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,a.jsx)(n.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:u.windowHours,onChange:e=>C({windowHours:e.target.value}),error:y?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,a.jsx)(n.pd,{label:"Pings per day",type:"number",min:"1",max:String(b),step:"1",value:u.slotsPerDay,onChange:e=>C({slotsPerDay:e.target.value}),error:v?"":`1 – ${b}`,hint:v?`Max ${b}`:"",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"})]}),k.length>0&&(0,a.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,a.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",u.timezone,")"]}),(0,a.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:k.join(" → ")}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",k[0]," – ",N,", then pauses until ",k[0]," next day."]})]})]})]})})}m.propTypes={isOpen:r().bool.isRequired,onClose:r().func.isRequired,onSave:r().func.isRequired,connection:r().object,reactive:r().bool,schedule:r().object}}},e=>{e.O(0,[8500,246,5772,85,705,5497,8441,3794,7358],()=>e(e.s=30840)),_N_E=e.O()}]);
|
package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-1d6c37a1e6f380be.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{898:(e,t,r)=>{Promise.resolve().then(r.bind(r,75095)),Promise.resolve().then(r.bind(r,25086))},75095:(e,t,r)=>{"use strict";r.d(t,{default:()=>z});var a=r(95155),i=r(12115),s=r(73321),n=r(57250),l=r(13097);let o="quotaCacheData",d="quotaAutoRefresh",c=[10,20,50,100],u=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],m=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function x(e){return e.name?.trim()||e.email?.trim()||e.displayName?.trim()||null}function h(e,t){let r=t[e.id]?.quotas?.[0];return r&&"number"==typeof r.remaining?r.remaining:1/0}function p(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function b(e,t){let r=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>r.has(e)))}async function g(e,t){return await e(t)}function f(){try{let e=window.localStorage.getItem(o);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function y(e,t){try{let r=f();r[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(o,JSON.stringify(r))}catch(e){console.error("Error writing quota cache:",e)}}function w(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function v(e){return e&&"object"==typeof e?String(e.modelKey||e.name||"").trim():""}function k(e,t,r=[]){let a=t?.[e]?.hidden;return Array.isArray(a)&&0!==a.length?new Set((r.length>0?function(e=[],t=[]){if(!Array.isArray(e)||0===e.length)return[];let r=new Set(t.map(v).filter(Boolean));return[...new Set(e.map(e=>String(e).trim()).filter(e=>r.has(e)))]}(a,r):a).map(String)):new Set}function j({quotas:e=[],compact:t=!1,sortMode:r="default",showSortLabel:s=!1,onHideQuota:n=null}){let[l,o]=(0,i.useState)(1),d=(0,i.useMemo)(()=>e.map((e,t)=>({...e,index:t,remaining:e?.remaining!==void 0?Math.max(0,Math.round(e.remaining)):e?.remainingPercentage!==void 0?Math.round(e.remainingPercentage):w(e?.used,e?.total)})),[e]),c=(0,i.useMemo)(()=>"remaining-asc"===r?[...d].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?[...d].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):d,[d,r]),u=Math.max(1,Math.ceil(c.length/10));if((0,i.useEffect)(()=>{o(1)},[r,e]),(0,i.useEffect)(()=>{o(e=>Math.min(e,u))},[u]),!e||0===e.length)return null;let m=c.slice((l-1)*10,10*l),x=0===c.length?0:(l-1)*10+1,h=Math.min(10*l,c.length),p=t?"py-1 px-1.5":"py-2 px-3",b=t?"text-[11px]":"text-sm",g=t?"text-[11px]":"text-sm",f=t?"text-[10px] leading-tight":"text-xs",y="function"==typeof n;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"text-[10px] text-text-muted",children:[c.length," quota",c.length>1?"s":""]}),s&&(0,a.jsx)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1 text-[10px] text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"Sorted by account remaining"})]}),(0,a.jsx)("div",{className:"space-y-px",children:m.map(e=>{var r;let i=!0===e.unlimited,s=!0===e.isCreditBalance,l=s?{text:"text-blue-600 dark:text-blue-400",bg:"bg-blue-500",bgLight:"bg-blue-500/10",emoji:"\uD83D\uDCB0"}:i||(r=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:r>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},o=e.neverExpires?"-":function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,r=new Date,a=t-r;if(a<=0)return"-";let i=Math.ceil(a/6e4);if(i<60)return`${i}m`;let s=Math.floor(i/60),n=i%60;if(s<24)return`${s}h ${n}m`;let l=Math.floor(s/24);return`${l}d ${s%24}h ${n}m`}catch(e){return"-"}}(e.resetAt),d=!e.neverExpires&&!e.resetAt&&!!e.detailUrl,c=e.neverExpires?"Never expires":d?"See details":function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),i=new Date(a);i.setDate(i.getDate()+1);let s="";s=t>=a&&t<i?"Today":t>=i&&t<new Date(i.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let n=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${s}, ${n}`}catch{return null}}(e.resetAt),u=d&&e.detailUrl?e.detailUrl:c,m=!1!==e.recurring?`in ${o}`:`expires in ${o}`,x=t=>d?(0,a.jsxs)("a",{href:e.detailUrl,target:"_blank",rel:"noopener noreferrer",className:`${t} inline-flex items-center gap-0.5 hover:text-text-primary hover:underline`,title:`Open usage details: ${u}`,"aria-label":`Open usage details for ${e.name}`,children:[c,(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"})]}):c;return(0,a.jsxs)("div",{className:`flex items-center gap-2 border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${p}`,children:[(0,a.jsxs)("div",{className:"flex w-36 min-w-0 items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-[10px] shrink-0",children:l.emoji}),(0,a.jsx)("span",{className:`${b} font-medium text-text-primary truncate`,children:e.name})]}),(0,a.jsxs)("div",{className:`min-w-0 flex-1 ${t?"space-y-1":"space-y-1.5"}`,children:[!i&&!s&&(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${l.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,a.jsx)("div",{className:`h-full transition-all duration-300 ${l.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,a.jsxs)("div",{className:`flex items-center justify-between gap-1 min-w-0 ${t?"text-[10px]":"text-xs"}`,children:[(0,a.jsx)("span",{className:"text-text-muted truncate",title:i?`${e.used.toLocaleString()} used \xb7 Unlimited`:s?`Credit balance: ${e.total.toFixed(2)} ${e.currency||""}`:`${e.used.toLocaleString()} / ${e.total>0?e.total.toLocaleString():"∞"}`,children:i?`${e.used.toLocaleString()} used \xb7 Unlimited`:s?`Credit: ${e.total.toFixed(2)} ${e.currency||""}`:`${e.used.toLocaleString()} / ${e.total>0?e.total.toLocaleString():"∞"}${e.unit?` ${e.unit}`:""}`}),(0,a.jsx)("span",{className:`font-medium ${i?"text-green-600 dark:text-green-400":s?"text-blue-600 dark:text-blue-400":l.text} shrink-0`,children:i?"Unlimited":s?"":`${e.remaining}%`})]})]}),(0,a.jsx)("div",{className:"min-w-0 shrink",children:"-"!==o||c?t?(0,a.jsx)("div",{className:`${g} text-text-primary font-medium truncate`,title:u||"",children:"-"!==o?m:x(g)}):(0,a.jsxs)("div",{className:"min-w-0 space-y-0.5",children:["-"!==o&&(0,a.jsx)("div",{className:`${g} text-text-primary font-medium truncate`,children:m}),c&&(0,a.jsx)("div",{className:`${f} text-text-muted truncate`,children:x(f)})]}):(0,a.jsx)("div",{className:`${g} text-text-muted italic`,children:"N/A"})}),y&&(0,a.jsx)("button",{type:"button",onClick:()=>n(e),className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5",title:"Hide this quota row","aria-label":`Hide quota ${e.name}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"visibility_off"})})]},`${e.name}-${e.index}`)})}),u>1&&(0,a.jsxs)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{children:["Showing ",x,"-",h," of ",c.length]}),(0,a.jsxs)("span",{children:["Page ",l," / ",u]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>o(e=>Math.max(1,e-1)),disabled:1===l,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Prev"}),(0,a.jsx)("button",{type:"button",onClick:()=>o(e=>Math.min(u,e+1)),disabled:l===u,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Next"})]})]})]})}var N=r(98542),C=r(97677),S=r(84588),A=r(35497),$=r(97132),P=r(93195),q=r(88105),E=r(11059);let _={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"},D={claude:"claudeAutoPing",codex:"codexAutoPing"};function O(e){return e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null}function T(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}let M={five_hour:"session",seven_day:"weekly",seven_day_overage_included:"weekly",seven_day_opus:"Opus weekly",seven_day_sonnet:"Sonnet weekly"};function F(e){let t=[...new Set((e||[]).map(e=>M[e]).filter(Boolean))];return t.length?`${t.join(" + ")} limits`:"limits"}function L(e){return q.Q2[e]?.name||e}function I(e){if(!e)return"N/A";let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"N/A"}function R(e){if(!e)return"N/A";let t=new Date(e).getTime()-Date.now();if(!Number.isFinite(t))return"N/A";if(t<=0)return"Expired";let r=Math.ceil(t/36e5),a=Math.floor(r/24),i=r%24;return a>0?`${a}d ${i}h`:`${i}h`}function z(){let{copied:e,copy:t}=(0,E.C)(),r=(0,s.useSearchParams)(),M=(0,s.useRouter)(),z=(0,s.usePathname)(),[U,H]=(0,i.useState)([]),[W,B]=(0,i.useState)({}),[J,K]=(0,i.useState)({}),[V,G]=(0,i.useState)({}),[Q,Z]=(0,i.useState)(!0),[Y,X]=(0,i.useState)({claude:{},codex:{}}),[ee,et]=(0,i.useState)(null),[er,ea]=(0,i.useState)(null),[ei,es]=(0,i.useState)(!1),[en,el]=(0,i.useState)(!1),[eo,ed]=(0,i.useState)(60),[ec,eu]=(0,i.useState)(!0),[em,ex]=(0,i.useState)(null),[eh,ep]=(0,i.useState)(null),[eb,eg]=(0,i.useState)(null),[ef,ey]=(0,i.useState)(null),[ew,ev]=(0,i.useState)(null),[ek,ej]=(0,i.useState)(!1),[eN,eC]=(0,i.useState)(null),[eS,eA]=(0,i.useState)([]),[e$,eP]=(0,i.useState)(()=>r?.get("provider")||"all"),eq=(0,i.useCallback)(e=>{eP(e);try{let t=new URLSearchParams(r?.toString()||"");"all"===e?t.delete("provider"):t.set("provider",e);let a=t.toString()?`${z}?${t.toString()}`:z;M.replace(a,{scroll:!1})}catch{}},[z,M,r]),[eE,e_]=(0,i.useState)([]),[eD,eO]=(0,i.useState)("all"),[eT,eM]=(0,i.useState)("default"),[eF,eL]=(0,i.useState)({}),[eI,eR]=(0,i.useState)(!1),[ez,eU]=(0,i.useState)(!1),[eH,eW]=(0,i.useState)(!1),[eB,eJ]=(0,i.useState)(1),[eK,eV]=(0,i.useState)(20),[eG,eQ]=(0,i.useState)(String(20)),[eZ,eY]=(0,i.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eX,e0]=(0,i.useState)({eligibleConnections:0,providerFilteredConnections:0}),e1=(0,i.useRef)(null),e5=(0,i.useRef)(null),e2=(0,i.useRef)(0),e3=(0,i.useCallback)(async(e=eB)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(eK),accountStatus:eD,sort:"priority"});"all"!==e$&&a.set("provider",e$);let i=await fetch(`/api/providers/client?${a.toString()}`);if(!i.ok)throw Error("Failed to fetch connections");let s=await i.json(),n=s.connections||[],l=(t=s.pagination,t||{page:1,pageSize:eK,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(s.totals,n.length);return H(n),e_(s.providerOptions||[]),eY(l),e0(o),eJ((r=s.pagination,r?.page||e)),n}catch(e){return console.error("Error fetching connections:",e),H([]),e_([]),eY({page:1,pageSize:eK,total:0,totalPages:1}),e0({eligibleConnections:0,providerFilteredConnections:0}),[]}},[eD,eI,eB,eK,e$]),e4=(0,i.useCallback)(async(e,t,{force:r=!1}={})=>{K(t=>({...t,[e]:!0})),G(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let a=`/api/usage/${e}${r?"?force=1":""}`,i=await fetch(a);if(!i.ok){let r=(await i.json().catch(()=>({}))).error||i.statusText;if(404===i.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===i.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,r);let a={quotas:[],message:r};B(t=>({...t,[e]:a})),y(e,a);return}throw Error(`HTTP ${i.status}: ${r}`)}let s=await i.json();console.log(`[ProviderLimits] Got quota for ${t}:`,s);let n={quotas:function(e,t){if(!t||"object"!=typeof t)return[];let r=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":if(t.quotas){let e=Object.entries(t.quotas),a=new Set(["gemini_weekly","claude_gpt_weekly"]),i=new Set(["gemini_session","claude_gpt_session"]),s=new Set([...a,...i]),n=e.filter(([e])=>e.startsWith("gemini-")&&!e.includes("image")),l=e.filter(([e])=>e.startsWith("claude-")),o=e.filter(([e])=>e.includes("image")),d=e.filter(([e])=>s.has(e)),c=e.filter(([e])=>!e.startsWith("gemini-")&&!e.startsWith("claude-")&&!e.includes("image")&&!s.has(e)),u=!!t.quotas.gemini_weekly,m=!!t.quotas.gemini_session,x=!!t.quotas.claude_gpt_weekly,h=!!t.quotas.claude_gpt_session;if(m)d.filter(([e])=>"gemini_session"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});else if(n.length>0){let e=n.reduce((e,t)=>(t[1].remainingPercentage??100)<(e[1].remainingPercentage??100)?t:e)[1],a=t.quotas.gemini_weekly?.resetAt;u&&e.resetAt===a&&(e.remainingPercentage??0)===0||r.push({name:"Gemini (Flash / Pro)",modelKey:"gemini",used:e.used||0,total:e.total||0,resetAt:e.resetAt||null,remainingPercentage:e.remainingPercentage})}if(u&&d.filter(([e])=>"gemini_weekly"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),h)d.filter(([e])=>"claude_gpt_session"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});else if(l.length>0){let e=l.reduce((e,t)=>(t[1].remainingPercentage??100)<(e[1].remainingPercentage??100)?t:e)[1],a=t.quotas.claude_gpt_weekly?.resetAt;x&&e.resetAt===a&&(e.remainingPercentage??0)===0||r.push({name:"Claude (Sonnet / Opus)",modelKey:"claude",used:e.used||0,total:e.total||0,resetAt:e.resetAt||null,remainingPercentage:e.remainingPercentage})}x&&d.filter(([e])=>"claude_gpt_weekly"===e).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),o.forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})}),x||h||c.forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})})}break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{let a=e;"spark_session"===e?a="Spark (5h)":"spark_weekly"===e?a="Spark (Weekly)":"session"===e?a="5h":"weekly"===e?a="Weekly":"review_session"===e?a="Review (5h)":"review_weekly"===e&&(a="Review (Weekly)"),r.push({name:a,quotaType:e,used:t.used||0,total:t.total||0,remaining:t.remaining,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"qoder":case"qoder-cn":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{t&&0!==(Number(t.total)||0)&&r.push({name:"user"===e?"Personal":"organization"===e?"Organization":"addOn"===e?"Add-on":e,used:t.used||0,total:t.total||0,unit:t.unit,resetAt:t.resetAt||null,neverExpires:!0===t.neverExpires,detailUrl:t.detailUrl||null})});break;case"claude":t.message?r.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:void 0!==t.remaining?t.remaining:Math.max(0,(t.total||100)-(t.used||0)),remainingPercentage:void 0!==t.remainingPercentage?t.remainingPercentage:w(t.used,t.total),resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codebuddy-cn":case"codebuddy-intl":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,recurring:!1!==t.recurring})});break;case"grok-cli":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"kimi":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"deepseek":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage,isCreditBalance:t.isCreditBalance??!0,currency:t.currency||(e.includes("(")?e.slice(e.indexOf("(")+1,e.indexOf(")")):"USD")})});break;case"cursor":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"groq":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"ollama":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"zed":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage,unlimited:t.unlimited})});break;case"minimax-code":case"minimax-code-global":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:t.remaining,remainingPercentage:t.remainingPercentage,resetAt:t.resetAt||null,message:t.message,isCreditBalance:t.isCreditBalance,currency:t.currency})});break;case"tokenharbor":case"nara-router":case"apmix":case"apinex":case"tiarina":case"xkiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total,remainingPercentage:t.remainingPercentage,resetAt:t.resetAt||null,unlimited:!0===t.unlimited,isCreditBalance:!0===t.isCreditBalance,currency:t.currency||"USD"})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}if(e?.toLowerCase()==="claude"){let e={"session (5h)":0,"weekly (7d)":1,"weekly fable (7d)":2,"weekly opus (7d)":3,"weekly sonnet (7d)":4};return r.sort((t,r)=>(e[t.name]??99)-(e[r.name]??99)),r}let a=(0,l.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));r.sort((t,r)=>{let a=t.modelKey||t.name,i=r.modelKey||r.name;return("gemini"===a||"gemini_session"===a)&&(a="gemini-3.8-flash-high"),("claude"===a||"claude_gpt_session"===a)&&(a="claude-sonnet-4-6"),("gemini"===i||"gemini_session"===i)&&(i="gemini-3.8-flash-high"),("claude"===i||"claude_gpt_session"===i)&&(i="claude-sonnet-4-6"),(e.get(a)??999)-(e.get(i)??999)})}return r}(t,s),plan:s.plan||null,message:s.message||null,raw:s};B(t=>({...t,[e]:n})),y(e,n)}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),G(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{K(t=>({...t,[e]:!1}))}},[]),e8=(0,i.useCallback)(async(e,t)=>{await e4(e,t,{force:!0}),ea(new Date)},[e4]),e6=(0,i.useCallback)(async(e,t)=>{if(("codex"===t||"claude"===t)&&!eb){eg(e),G(t=>({...t,[e]:null}));try{let r="claude"===t?await fetch(`/api/usage/${e}/claude-reset`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grantId:W[e]?.raw?.resetCredits?.nextGrantId})}):await fetch(`/api/usage/${e}/codex-reset-credits`,{method:"POST"}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.message||a.error||a.code||"Failed to reset limit");await e4(e,t,{force:!0}),ea(new Date)}catch(t){G(r=>({...r,[e]:t.message||"Failed to reset limit"}))}finally{eg(null)}}},[e4,eb,W]),e9=(0,i.useCallback)((e,t)=>{ev({connection:e,loading:!1,error:null,data:{kind:"claude",...t}})},[]),e7=(0,i.useCallback)(async e=>{ev({connection:e,loading:!0,error:null,data:null});try{let t=await fetch(`/api/usage/${e.id}/codex-reset-credits`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error(r.error||r.message||"Failed to load Codex reset credits");let a=Array.isArray(r.credits)?[...r.credits]:[];a.sort((e,t)=>(e.expiresAt?new Date(e.expiresAt).getTime():1/0)-(t.expiresAt?new Date(t.expiresAt).getTime():1/0)),ev({connection:e,loading:!1,error:null,data:{...r,credits:a}})}catch(t){ev({connection:e,loading:!1,error:t.message||"Failed to load Codex reset credits",data:null})}},[]),te=(0,i.useCallback)(async e=>{if(confirm("Delete this connection?")){ex(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){B(t=>{let r={...t};return delete r[e],r}),K(t=>{let r={...t};return delete r[e],r}),G(t=>{let r={...t};return delete r[e],r});try{let t=f();t[e]&&(delete t[e],window.localStorage.setItem(o,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await g(e3,eB)}}catch(e){console.error("Error deleting connection:",e)}finally{ex(null)}}},[e3,eB]),tt=(0,i.useCallback)(async(e,t)=>{ep(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(B(e=>({...e})),await g(e3,eB))}catch(e){console.error("Error updating connection status:",e)}finally{ep(null)}},[e3,eB]),tr=(0,i.useCallback)(async e=>{if(!eN?.id)return;let t=eN.id,r=eN.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await e3(),ej(!1),eC(null),q.wb.includes(r)&&await e4(t,r))}catch(e){console.error("Error saving connection:",e)}},[eN,e3,e4]);(0,i.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&eA(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let ta=(0,i.useCallback)(async(e=!1)=>{if(en)return;el(!0),ed(60);let t=e2.current+=1;try{let r=await e3(eB);K(p(r)),G(e=>b(e,r)),B(e=>b(e,r)),await Promise.all(r.filter(r=>e||"claude"!==r.provider||t%10==0).map(e=>e4(e.id,e.provider))),ea(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{el(!1)}},[en,e3,e4,eB]);(0,i.useEffect)(()=>{(async()=>{eu(!0);let e=await e3(eB);eu(!1),K(p(e)),G(t=>b(t,e)),B(t=>b(t,e)),await Promise.all(e.map(e=>e4(e.id,e.provider))),ea(new Date)})()},[e3,e4,eB]),(0,i.useEffect)(()=>{let e=window.localStorage.getItem(d);Z(null===e||"true"===e),es(!0)},[]),(0,i.useEffect)(()=>{ei&&window.localStorage.setItem(d,String(Q))},[Q,ei]),(0,i.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>{X({claude:e?.claudeAutoPing||{},codex:e?.codexAutoPing||{}}),eL(e?.quotaVisibility||{})}).catch(()=>{})},[]);let ti=(0,i.useCallback)(async(e,t,{reactive:r,schedule:a})=>{let i=D[t];if(!i)return;let s=Y[t]||{},n={...s,connections:{...s.connections||{},[e]:r},schedules:{...s.schedules||{},[e]:a}};X({...Y,[t]:n});try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[i]||{},connections:n.connections,schedules:n.schedules};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[i]:t})})}catch{X(Y)}},[Y]),ts=(0,i.useCallback)(async(e,t)=>{eL(e);try{if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({quotaVisibility:e})})).ok)throw Error("Failed to update quota visibility")}catch(e){console.error("Error updating quota visibility:",e),eL(t)}},[]),tn=(0,i.useCallback)((e,t)=>{let r=v(t);if(!e||!r)return;let a=eF[e]||{},i=new Set(a.hidden||[]);if(i.add(r),"antigravity"===e){if("gemini"===r)for(let e of i)e.startsWith("gemini-")&&!e.includes("image")&&i.delete(e);else if("claude"===r)for(let e of i)e.startsWith("claude-")&&i.delete(e)}ts({...eF,[e]:{...a,hidden:[...i]}},eF)},[eF,ts]),tl=(0,i.useCallback)((e,t)=>{let r=v(t);if(!e||!r)return;let a=eF[e]||{},i=new Set(a.hidden||[]);if(i.delete(r),"antigravity"===e){if("gemini"===r)for(let e of i)e.startsWith("gemini-")&&!e.includes("image")&&i.delete(e);else if("claude"===r)for(let e of i)e.startsWith("claude-")&&i.delete(e)}ts({...eF,[e]:{...a,hidden:[...i]}},eF)},[eF,ts]);(0,i.useEffect)(()=>{if(!ei||!Q){e1.current&&(clearInterval(e1.current),e1.current=null),e5.current&&(clearInterval(e5.current),e5.current=null);return}return e1.current=setInterval(()=>{ta()},6e4),e5.current=setInterval(()=>{ed(e=>e<=1?60:e-1)},1e3),()=>{e1.current&&clearInterval(e1.current),e5.current&&clearInterval(e5.current)}},[Q,ta,ei]),(0,i.useEffect)(()=>{let e=()=>{document.hidden?(e1.current&&(clearInterval(e1.current),e1.current=null),e5.current&&(clearInterval(e5.current),e5.current=null)):Q&&ei&&(e1.current=setInterval(()=>ta(),6e4),e5.current=setInterval(()=>{ed(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[Q,ta,ei]);let to=(0,i.useMemo)(()=>(function(e,t,r,a,i){if("codex"===a&&"default"!==i)return[...e].sort((e,r)=>{let a=h(e,t),s=h(r,t),n="remaining-asc"===i?a-s:s-a;return 0!==n?n:(x(e)||"").localeCompare(x(r)||"")});if(!r){let t=new Map;for(let r of e){let e=r.provider||"";t.has(e)||t.set(e,[]),t.get(e).push(r)}return Array.from(t.values()).flat()}let s=e=>{let r=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return r.length>0?Math.min(...r):1/0};return[...e].sort((e,t)=>{let r=s(e)-s(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(x(e)||"").localeCompare(x(t)||"")})})(U,W,eI,e$,eT),[U,W,eI,e$,eT]),td=e=>{let t=W[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=w(e.used,e.total))},tc=(0,i.useCallback)(async(e,t)=>{if(e.length&&!eH){eW(!0);try{await Promise.all(e.map(e=>fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}))),await g(e3,eB)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eW(!1)}}},[eH,e3,eB]),tu="all"===e$?"All providers":L(e$),tm=eX.eligibleConnections>0,tx=to.length>0,th=eX.eligibleConnections?eX.providerFilteredConnections?{icon:"filter_alt_off",title:"No Accounts On This Page",description:"Try moving to another page or refreshing the current filters."}:{icon:"filter_alt_off",title:"No Accounts Match Current Filters",description:"all"===e$?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===eD?"turned off":"active"===eD?"active":"matching"} accounts found for ${e$}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},tp=function(e){var t;let{start:r,end:a}=(t=e).total?{start:(t.page-1)*t.pageSize+1,end:Math.min(t.page*t.pageSize,t.total)}:{start:0,end:0};return`Showing ${r}-${a} of ${e.total}`}(eZ),tb=!c.includes(eK);return ec||tm?ec||tx?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eU(e=>!e),className:"flex h-8 items-center justify-between gap-1 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-haspopup":"menu","aria-expanded":ez,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===e$?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(n.A,{src:`/providers/${e$}.png`,alt:e$,size:18,className:"size-[18px] rounded object-contain",fallbackText:e$.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate hidden lg:inline",children:tu})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),ez&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>eU(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-2 w-64 overflow-hidden rounded-2xl border border-black/10 bg-surface/95 p-1.5 shadow-xl shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-72",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==e$&&eJ(1),eq("all"),eU(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===e$?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===e$&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]}),(0,a.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,a.jsx)("div",{className:"max-h-72 overflow-y-auto pr-1",children:eE.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{e$!==e&&eJ(1),eq(e),eU(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${e$===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(n.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium",children:L(e)}),e$===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:eD,onChange:e=>{let t=e.target.value;eD!==t&&eJ(1),eO(t)},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter accounts by status",children:u.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===e$&&(0,a.jsx)("select",{value:eT,onChange:e=>eM(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Sort Codex quotas by remaining",children:m.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsxs)("button",{type:"button",onClick:()=>eR(e=>!e),"aria-pressed":eI,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${eI?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{tc(to.filter(e=>(e.isActive??!0)&&td(e)).map(e=>e.id),!1)},disabled:eH,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10 disabled:opacity-50",title:"Disable connections with depleted quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn off Empty"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{tc(to.filter(e=>!(e.isActive??!0)&&!td(e)).map(e=>e.id),!0)},disabled:eH,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-emerald-500/30 px-2 text-xs text-emerald-500 transition-colors hover:bg-emerald-500/10 disabled:opacity-50",title:"Enable connections that still have quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn on Available"})]}),(0,a.jsxs)("button",{onClick:()=>Z(e=>!e),className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:Q?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${Q?"text-primary":"text-text-muted"}`,children:Q?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),Q&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",eo,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>ta(!0),disabled:en,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5 disabled:opacity-50",title:"Refresh all",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${en?"animate-spin":""}`,children:"refresh"})})]})}),eI&&(0,a.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Expiring-first currently reorders accounts inside the current page. Cross-page ordering still follows backend pagination."}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:to.map(r=>{let i,s,l,o=W[r.id],d=J[r.id],c=V[r.id],u=!1===r.isActive,m="codex"===r.provider,h="claude"===r.provider?o?.raw?.resetCredits:null,p=m?"Codex reset credit":"Claude limit reset",b=Number.isFinite(s="number"==typeof(i=o?.raw?.resetCredits?.availableCount)?i:Number(i))?Math.max(0,s):0,g=eb===r.id,f=em===r.id||eh===r.id||g,y=o?.quotas||[],w=function(e,t=[],r={}){if(!Array.isArray(t)||0===t.length)return[];let a=k(e,r,t);return 0===a.size?t:t.filter(e=>!a.has(v(e)))}(r.provider,y,eF),A=function(e,t=[],r={}){if(!Array.isArray(t)||0===t.length)return[];let a=k(e,r,t);return 0===a.size?[]:t.filter(e=>a.has(v(e)))}(r.provider,y,eF);return(0,a.jsxs)(S.default,{padding:"none",className:`min-w-0 ${u?"opacity-60":""}`,children:[(0,a.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,a.jsx)(n.A,{src:`/providers/${r.provider}.png`,alt:r.provider,size:32,className:"object-contain",fallbackText:r.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary truncate",children:L(r.provider)}),x(r)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:x(r)}):null,O(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:O(r)}):null,"kiro"===r.provider&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[(0,a.jsx)("span",{className:"rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:(l=r.providerSpecificData?.authMethod)&&_[l]?_[l]:"api_key"===r.authType?"API Key":"OAuth"}),T(r)&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:T(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${u?"bg-surface-2 text-text-muted":"active"===r.testStatus||"success"===r.testStatus?"bg-green-500/10 text-green-600 dark:text-green-400":"error"===r.testStatus||"expired"===r.testStatus||"unavailable"===r.testStatus?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-surface-2 text-text-muted"}`,children:u?"disabled":r.testStatus||"unknown"}),r.providerSpecificData?.profileArn&&(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.providerSpecificData.profileArn,r.id),title:r.providerSpecificData.profileArn,className:"inline-flex max-w-full items-center gap-1 rounded-full border border-border-subtle px-2 py-0.5 text-[10px] text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:e===r.id?"check":"content_copy"}),(0,a.jsx)("code",{className:"truncate font-mono",children:r.providerSpecificData.profileArn})]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(m||h)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C.default,{text:b>0?h?`Use your reset now (${b} left, use by ${I(h.expiresAt)}) \xb7 refills ${F(h.clears)}`:`Use one ${p}. Available: ${b}`:`No ${p}s available`,children:(0,a.jsxs)("button",{type:"button",onClick:()=>ey({connection:r,resetCreditCount:b}),disabled:b<=0||d||f,"aria-label":b>0?`Use one ${p}. ${b} available.`:`No ${p}s available`,className:`flex h-8 min-w-10 items-center justify-center gap-1 rounded-lg border px-2 text-[11px] font-medium tabular-nums transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/60 disabled:cursor-not-allowed disabled:opacity-60 ${b>0?"border-primary/30 bg-primary/5 text-primary hover:bg-primary/10":"border-black/10 bg-black/[0.02] text-text-muted dark:border-white/10 dark:bg-white/[0.03]"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[15px] ${g?"animate-spin":""}`,children:g?"progress_activity":"restart_alt"}),(0,a.jsx)("span",{children:b})]})}),(0,a.jsx)(C.default,{text:m?"View Codex reset credit expiry":"View Claude Code reset expiry",children:(0,a.jsx)("button",{type:"button",onClick:()=>m?e7(r):e9(r,h),disabled:d||f,"aria-label":m?"View Codex reset credit expiry":"View Claude Code reset expiry",className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-muted transition-colors hover:bg-black/5 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10 dark:hover:bg-white/5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[17px]",children:"schedule"})})})]}),D[r.provider]&&"oauth"===r.authType&&(()=>{let e=Y[r.provider]||{},t=e.connections?.[r.id]===!0,i=e.schedules?.[r.id],s=i?.enabled===!0,n=[];if(t&&n.push("On reset"),s){let e=(0,P.JW)(i).join(" / ");n.push(`Scheduled (${e||"active"})`)}let l=n.length>0?`Auto-ping active: ${n.join(" + ")}. Click to configure.`:"codex"===r.provider?"Auto-starts the next 5h Codex window after reset or on schedule. Click to configure.":"Auto-starts a new window on quota reset or fixed schedule. Click to configure.";return(0,a.jsx)(C.default,{text:l,children:(0,a.jsx)("button",{type:"button",onClick:()=>et(r),"aria-label":"Configure auto-ping",className:`flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${t||s?"text-primary":"text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})})})(),(0,a.jsx)(C.default,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>e8(r.id,r.provider),disabled:d||f,"aria-label":"Refresh quota",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${d?"animate-spin":""}`,children:"refresh"})})}),(0,a.jsx)(C.default,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{eC(r),ej(!0)},disabled:f,"aria-label":"Edit connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})})}),(0,a.jsx)(C.default,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>te(r.id),disabled:f,"aria-label":"Delete connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${em===r.id?"animate-pulse":""}`,children:"delete"})})}),(0,a.jsx)("div",{className:"inline-flex items-center pl-0.5",title:r.isActive??!0?"Disable connection":"Enable connection",children:(0,a.jsx)(N.default,{size:"sm",checked:r.isActive??!0,disabled:f,onChange:e=>tt(r.id,e)})})]})]})}),(0,a.jsxs)("div",{className:"px-2 py-1.5",children:[d?(0,a.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):c?(0,a.jsxs)("div",{className:"text-center py-5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:c})]}):o?.message?(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:o.message})}):(0,a.jsx)(j,{quotas:w,compact:!0,sortMode:"default",showSortLabel:"codex"===r.provider&&"default"!==eT,onHideQuota:e=>tn(r.provider,e)}),o?.message&&!c&&!d&&(0,a.jsx)("p",{className:"mt-2 px-1 text-[10px] leading-relaxed text-text-muted",children:o.message}),A.length>0&&(0,a.jsxs)("div",{className:"mt-2 flex min-w-0 items-center gap-1 border-t border-black/5 pt-2 text-[10px] text-text-muted dark:border-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[14px]",children:"visibility_off"}),(0,a.jsx)("span",{className:"shrink-0",children:"Hidden:"}),(0,a.jsx)("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap pb-2",children:A.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>tl(r.provider,e),className:"shrink-0 rounded-md border border-black/10 px-1.5 py-0.5 transition-colors hover:bg-black/5 hover:text-text-primary dark:border-white/10 dark:hover:bg-white/5",title:"Show this quota row",children:e.name},v(e)))})]})]})]},r.id)})}),(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:tp}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:tb?"custom":String(eK),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(eJ(1),eV(r),eQ(String(r)))},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Accounts per page",children:[c.map(e=>(0,a.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,a.jsx)("option",{value:"custom",children:"Custom"})]}),(0,a.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:eG,onChange:e=>eQ(e.target.value),onBlur:()=>{let e=Number.parseInt(eG,10);if(!Number.isFinite(e))return void eQ(String(eK));let t=Math.min(500,Math.max(1,e));eJ(1),eV(t),eQ(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eG,10);if(!Number.isFinite(t))return void eQ(String(eK));let r=Math.min(500,Math.max(1,t));eJ(1),eV(r),eQ(String(r))},className:"h-8 w-20 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Custom accounts per page",placeholder:"Custom"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",eZ.page," / ",eZ.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>eJ(1),disabled:eZ.page<=1||ec||en,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"First Page"}),(0,a.jsx)("button",{type:"button",onClick:()=>eJ(e=>Math.max(1,e-1)),disabled:eZ.page<=1||ec||en,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Previous accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eJ(e=>Math.min(eZ.totalPages,e+1)),disabled:eZ.page>=eZ.totalPages||ec||en,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Next accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eJ(eZ.totalPages),disabled:eZ.page>=eZ.totalPages||ec||en,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Last Page"})]})]})}),(0,a.jsx)(A.uo,{isOpen:!!ef,onClose:()=>{eb||ey(null)},onConfirm:async()=>{let e=ef?.connection;e&&(await e6(e.id,e.provider),ey(null))},title:ef?.connection?.provider==="claude"?"Reset Claude limits?":"Reset Codex limit?",message:ef?.connection?.provider==="claude"?`Refills your ${F(W[ef.connection.id]?.raw?.resetCredits?.clears)} now for ${x(ef.connection)||"this account"} \xb7 your weekly reset day stays ${I(W[ef.connection.id]?.raw?.resetCredits?.weeklyResetsAt)}. This cannot be undone. Resets left: ${ef.resetCreditCount??0}.`:`Use 1 Codex reset credit for ${x(ef?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${ef?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!eb}),ew&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"w-full max-w-2xl overflow-hidden rounded-2xl border border-black/15 bg-white shadow-2xl ring-1 ring-black/10 dark:border-white/15 dark:bg-neutral-950 dark:ring-white/10",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 border-b border-black/10 bg-black/[0.03] px-4 py-3 dark:border-white/10 dark:bg-white/[0.04]",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-text-primary",children:ew.data?.kind==="claude"?"Claude Code Limit Resets":"Codex Reset Credit Expiry"}),(0,a.jsx)("p",{className:"mt-0.5 truncate text-xs text-text-muted",children:x(ew.connection)||(ew.data?.kind==="claude"?"Claude account":"Codex account")})]}),(0,a.jsx)("button",{type:"button",onClick:()=>ev(null),className:"flex h-8 w-8 items-center justify-center rounded-lg text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5","aria-label":"Close reset credit expiry modal",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,a.jsx)("div",{className:"max-h-[70vh] overflow-auto bg-white p-4 dark:bg-neutral-950",children:ew.loading?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading reset credits..."]}):ew.error?(0,a.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300",children:ew.error}):ew.data?.kind==="claude"&&ew.data.grants?.length?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("span",{children:[ew.data.availableCount??0," reset",1===ew.data.availableCount?"":"s"," left"]}),(0,a.jsxs)("span",{children:["Weekly reset day: ",I(ew.data.weeklyResetsAt)]})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,a.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,a.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Reset"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Left"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Refills"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Use By"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,a.jsx)("tbody",{children:(ew.data.grants||[]).map(e=>(0,a.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,a.jsxs)("td",{className:"px-3 py-2",children:[(0,a.jsx)("div",{className:"text-text-primary",children:e.label||e.id}),(0,a.jsx)("span",{className:"mt-1 inline-block rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.resetsLeft<=0?"used":e.paused?"paused":e.endsAt&&new Date(e.endsAt).getTime()<=Date.now()?"expired":e.usableNow?"usable now":e.startsAt&&new Date(e.startsAt).getTime()>Date.now()?"not started":e.useRequiresLimit?"at limit only":"unavailable"})]}),(0,a.jsxs)("td",{className:"whitespace-nowrap px-3 py-2 font-medium tabular-nums text-text-primary",children:[e.resetsLeft," / ",e.resetsTotal]}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-muted",children:F(e.clears)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:I(e.endsAt)}),(0,a.jsx)("td",{className:"whitespace-nowrap px-3 py-2 font-medium text-text-primary",children:R(e.endsAt)})]},e.id))})]})})]}):ew.data?.credits?.length?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("span",{children:[ew.data.credits.length," reset credit",1===ew.data.credits.length?"":"s"]}),(0,a.jsxs)("span",{children:[ew.data.availableCount??0," available"]})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,a.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,a.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Granted At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Expires At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,a.jsx)("tbody",{children:ew.data.credits.map((e,t)=>(0,a.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.status||"unknown"})}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-muted",children:I(e.grantedAt)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:I(e.expiresAt)}),(0,a.jsx)("td",{className:"px-3 py-2 font-medium text-text-primary",children:R(e.expiresAt)})]},`${e.status}-${e.expiresAt||t}`))})]})})]}):(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-8 text-center text-sm text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:ew.data?.kind==="claude"?"No limit resets available for this account.":"No reset credit details returned for this account."})})]})}),(0,a.jsx)(A.wI,{isOpen:ek,connection:eN,proxyPools:eS,onSave:tr,onClose:()=>{ej(!1),eC(null)}}),ee&&(0,a.jsx)($.A,{isOpen:!!ee,onClose:()=>et(null),connection:ee,reactive:Y[ee.provider]?.connections?.[ee.id]===!0,schedule:Y[ee.provider]?.schedules?.[ee.id]||null,onSave:e=>ti(ee.id,ee.provider,e)})]}):(0,a.jsx)(S.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:th.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:th.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:th.description})]})}):(0,a.jsx)(S.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})})}},93195:(e,t,r)=>{"use strict";function a(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}r.d(t,{JW:()=>o,Vm:()=>a,fB:()=>s,gy:()=>i,nz:()=>n});let i={anchor:"09:30",timezone:a(),windowHours:5,slotsPerDay:3};function s(e){let t=/^(\d{1,2}):(\d{2})$/.exec(String(e||"").trim());if(!t)return null;let r=Number(t[1]),a=Number(t[2]);return r>23||a>59?null:{hour:r,minute:a}}function n(e){return Math.max(1,Math.floor(24/e))}function l(e,t,r,a){let i="number"==typeof e?e:Number(e);return Number.isFinite(i)?Math.min(a,Math.max(r,i)):t}function o(e){let t=function(e){if(!e||!0!==e.enabled)return null;let t=s(e.anchor)||s(i.anchor),r=`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}`,a=!function(e){if(!e||"string"!=typeof e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return!1}}(e.timezone)?i.timezone:e.timezone,o=l(e.windowHours,i.windowHours,.5,24),d=Math.round(l(e.slotsPerDay,i.slotsPerDay,1,n(o)));return{enabled:!0,anchor:r,timezone:a,windowHours:o,slotsPerDay:d}}(e);if(!t)return[];let{hour:r,minute:a}=s(t.anchor),o=60*r+a;return Array.from({length:t.slotsPerDay},(e,r)=>{let a=Math.round(o+r*t.windowHours*60)%1440;return`${String(Math.floor(a/60)).padStart(2,"0")}:${String(a%60).padStart(2,"0")}`})}},97132:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var a=r(95155),i=r(12115),s=r(14051),n=r.n(s),l=r(35497),o=r(31474),d=r(93195);let c=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function u({isOpen:e,onClose:t,onSave:r,connection:s,reactive:n=!1,schedule:m=null}){let[x,h]=(0,i.useState)(()=>({mode:m?.enabled===!0?"schedule":!0===n?"reset":"off",anchor:m?.anchor||d.gy.anchor,timezone:(0,d.Vm)(),windowHours:String(m?.windowHours??d.gy.windowHours),slotsPerDay:String(m?.slotsPerDay??d.gy.slotsPerDay)})),p=Number(x.windowHours),b=Number(x.slotsPerDay),g=!!(0,d.fB)(x.anchor),f=Number.isFinite(p)&&p>=.5&&p<=24,y=f?(0,d.nz)(p):24,w=Number.isInteger(b)&&b>=1&&b<=y,v=g&&f&&w,k="schedule"!==x.mode||v,j=v?(0,d.JW)({enabled:!0,...x,windowHours:p,slotsPerDay:b}):[],N=j.length&&f?(()=>{let{hour:e,minute:t}=(0,d.fB)(x.anchor),r=Math.round(60*e+t+b*p*60)%1440;return`${String(Math.floor(r/60)).padStart(2,"0")}:${String(r%60).padStart(2,"0")}`})():"",C=e=>h(t=>({...t,...e}));return(0,a.jsx)(l.aF,{isOpen:e,onClose:t,title:"Auto-ping settings",size:"lg",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.$n,{variant:"secondary",onClick:t,children:"Cancel"}),(0,a.jsx)(l.$n,{onClick:()=>{k&&(r({reactive:"reset"===x.mode,schedule:"schedule"===x.mode?{enabled:!0,anchor:x.anchor,timezone:x.timezone,windowHours:p,slotsPerDay:b}:{enabled:!1}}),t())},disabled:!k,children:"Save"})]}),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",s?.name?` for ${s.name}`:""," — pick one mode."]}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:c.map(e=>{let t=x.mode===e.value;return(0,a.jsxs)("button",{type:"button",onClick:()=>C({mode:e.value}),className:(0,o.cn)("flex h-9 items-center justify-center gap-1.5 rounded-[8px] px-3 text-sm font-medium transition-all",t?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:e.icon}),(0,a.jsx)("span",{children:e.label})]},e.value)})}),"reset"===x.mode&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===x.mode&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,a.jsx)(l.pd,{label:"Anchor time",type:"time",value:x.anchor,onChange:e=>C({anchor:e.target.value}),error:g?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,a.jsx)(l.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:x.windowHours,onChange:e=>C({windowHours:e.target.value}),error:f?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,a.jsx)(l.pd,{label:"Pings per day",type:"number",min:"1",max:String(y),step:"1",value:x.slotsPerDay,onChange:e=>C({slotsPerDay:e.target.value}),error:w?"":`1 – ${y}`,hint:w?`Max ${y}`:"",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"})]}),j.length>0&&(0,a.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,a.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",x.timezone,")"]}),(0,a.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:j.join(" → ")}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",j[0]," – ",N,", then pauses until ",j[0]," next day."]})]})]})]})})}u.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onSave:n().func.isRequired,connection:n().object,reactive:n().bool,schedule:n().object}}},e=>{e.O(0,[8500,246,85,705,5497,8441,3794,7358],()=>e(e.s=898)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9305],{
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9305],{26043:(e,s,n)=>{Promise.resolve().then(n.bind(n,96748)),Promise.resolve().then(n.bind(n,56319)),Promise.resolve().then(n.bind(n,56061)),Promise.resolve().then(n.bind(n,92542)),Promise.resolve().then(n.bind(n,29366)),Promise.resolve().then(n.bind(n,84588)),Promise.resolve().then(n.bind(n,40197)),Promise.resolve().then(n.bind(n,45455)),Promise.resolve().then(n.bind(n,30815)),Promise.resolve().then(n.bind(n,73579)),Promise.resolve().then(n.bind(n,92173)),Promise.resolve().then(n.bind(n,95088)),Promise.resolve().then(n.bind(n,24747)),Promise.resolve().then(n.bind(n,80752)),Promise.resolve().then(n.bind(n,23936)),Promise.resolve().then(n.bind(n,11910)),Promise.resolve().then(n.bind(n,61500)),Promise.resolve().then(n.bind(n,62899)),Promise.resolve().then(n.bind(n,94230)),Promise.resolve().then(n.bind(n,21931)),Promise.resolve().then(n.bind(n,91450)),Promise.resolve().then(n.bind(n,7648)),Promise.resolve().then(n.bind(n,25086)),Promise.resolve().then(n.bind(n,28815)),Promise.resolve().then(n.bind(n,28058)),Promise.resolve().then(n.bind(n,81127)),Promise.resolve().then(n.bind(n,28011)),Promise.resolve().then(n.bind(n,67968)),Promise.resolve().then(n.bind(n,4823)),Promise.resolve().then(n.bind(n,90882)),Promise.resolve().then(n.bind(n,51825)),Promise.resolve().then(n.bind(n,23615)),Promise.resolve().then(n.bind(n,28067)),Promise.resolve().then(n.bind(n,98)),Promise.resolve().then(n.bind(n,92622)),Promise.resolve().then(n.bind(n,21110)),Promise.resolve().then(n.bind(n,38587)),Promise.resolve().then(n.bind(n,98542)),Promise.resolve().then(n.bind(n,23308)),Promise.resolve().then(n.bind(n,97677)),Promise.resolve().then(n.bind(n,40684)),Promise.resolve().then(n.bind(n,30312))}},e=>{e.O(0,[8500,246,85,705,5497,8441,3794,7358],()=>e(e.s=26043)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e,t,r,a,o,n,i,s,c,l={},u={};function d(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}},a=!0;try{l[e].call(r.exports,r,r.exports,d),a=!1}finally{a&&delete u[e]}return r.exports}d.m=l,e=[],d.O=(t,r,a,o)=>{if(r){o=o||0;for(var n=e.length;n>0&&e[n-1][2]>o;n--)e[n]=e[n-1];e[n]=[r,a,o];return}for(var i=1/0,n=0;n<e.length;n++){for(var[r,a,o]=e[n],s=!0,c=0;c<r.length;c++)(!1&o||i>=o)&&Object.keys(d.O).every(e=>d.O[e](r[c]))?r.splice(c--,1):(s=!1,o<i&&(i=o));if(s){e.splice(n--,1);var l=a();void 0!==l&&(t=l)}}return t},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,a){if(1&a&&(e=this(e)),8&a||"object"==typeof e&&e&&(4&a&&e.__esModule||16&a&&"function"==typeof e.then))return e;var o=Object.create(null);d.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var i=2&a&&e;"object"==typeof i&&!~t.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach(t=>n[t]=()=>e[t]);return n.default=()=>e,d.d(o,n),o},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce((t,r)=>(d.f[r](e,t),t),[])),d.u=e=>85===e?"static/chunks/85-
|
|
1
|
+
(()=>{"use strict";var e,t,r,a,o,n,i,s,c,l={},u={};function d(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}},a=!0;try{l[e].call(r.exports,r,r.exports,d),a=!1}finally{a&&delete u[e]}return r.exports}d.m=l,e=[],d.O=(t,r,a,o)=>{if(r){o=o||0;for(var n=e.length;n>0&&e[n-1][2]>o;n--)e[n]=e[n-1];e[n]=[r,a,o];return}for(var i=1/0,n=0;n<e.length;n++){for(var[r,a,o]=e[n],s=!0,c=0;c<r.length;c++)(!1&o||i>=o)&&Object.keys(d.O).every(e=>d.O[e](r[c]))?r.splice(c--,1):(s=!1,o<i&&(i=o));if(s){e.splice(n--,1);var l=a();void 0!==l&&(t=l)}}return t},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,a){if(1&a&&(e=this(e)),8&a||"object"==typeof e&&e&&(4&a&&e.__esModule||16&a&&"function"==typeof e.then))return e;var o=Object.create(null);d.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var i=2&a&&e;"object"==typeof i&&!~t.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach(t=>n[t]=()=>e[t]);return n.default=()=>e,d.d(o,n),o},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce((t,r)=>(d.f[r](e,t),t),[])),d.u=e=>85===e?"static/chunks/85-5b93a7c74cd0ee26.js":6808===e?"static/chunks/6808-ada8d917f8f60e64.js":3842===e?"static/chunks/3842-cc4f39fa50ab8b93.js":5815===e?"static/chunks/5815-2eb6990de66e825b.js":1649===e?"static/chunks/1649-772a31b7f3a65900.js":"static/chunks/"+(3862===e?"1a258343":e)+"."+({6:"a39be827fd6d332c",124:"c092990b4bdb9713",2435:"8a5a02e626c780d0",3521:"3af5cf89706546d6",3862:"290297ea7c7f28c0",5462:"c82c64c26a864ec0",6357:"99dc54a064c984c0",8202:"69dace5daa86686d",8569:"df0d706176dc1f57",9233:"b5ad25d75f88baa7"})[e]+".js",d.miniCssF=e=>"static/css/e07f2bf4fa519943.css",d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},d.l=(e,t,r,o)=>{if(a[e])return void a[e].push(t);if(void 0!==r)for(var n,i,s=document.getElementsByTagName("script"),c=0;c<s.length;c++){var l=s[c];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")=="_N_E:"+r){n=l;break}}n||(i=!0,(n=document.createElement("script")).charset="utf-8",n.timeout=120,d.nc&&n.setAttribute("nonce",d.nc),n.setAttribute("data-webpack","_N_E:"+r),n.src=d.tu(e)),a[e]=[t];var u=(t,r)=>{n.onerror=n.onload=null,clearTimeout(f);var o=a[e];if(delete a[e],n.parentNode&&n.parentNode.removeChild(n),o&&o.forEach(e=>e(r)),t)return t(r)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=u.bind(null,n.onerror),n.onload=u.bind(null,n.onload),i&&document.head.appendChild(n)},d.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.tt=()=>(void 0===o&&(o={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(o=trustedTypes.createPolicy("nextjs#bundler",o))),o),d.tu=e=>d.tt().createScriptURL(e),d.p="/_next/",n={8068:0},d.f.miniCss=(e,t)=>{if(n[e])t.push(n[e]);else 0!==n[e]&&({2574:1})[e]&&t.push(n[e]=new Promise((t,r)=>{var a=d.miniCssF(e),o=d.p+a;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),a=0;a<r.length;a++){var o=r[a],n=o.getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(n===e||n===t))return o}for(var i=document.getElementsByTagName("style"),a=0;a<i.length;a++){var o=i[a],n=o.getAttribute("data-href");if(n===e||n===t)return o}})(a,o))return t();((e,t,r,a)=>{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.onerror=o.onload=n=>{if(o.onerror=o.onload=null,"load"===n.type)r();else{var i=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.href||t,c=Error("Loading CSS chunk "+e+" failed.\n("+s+")");c.code="CSS_CHUNK_LOAD_FAILED",c.type=i,c.request=s,o.parentNode.removeChild(o),a(c)}},o.href=t;if("function"==typeof _N_E_STYLE_LOAD){var n=o.href,i=o.onload,s=o.onerror;_N_E_STYLE_LOAD(0===n.indexOf(window.location.origin)?new URL(n).pathname:n).then(function(){i&&i.call(o,{type:"load"})},function(){s&&s.call(o,{})})}else document.head.appendChild(o)})(e,o,t,r)}).then(()=>{n[e]=0},t=>{throw delete n[e],t}))},i={8068:0,8982:0,3334:0},d.f.j=(e,t)=>{var r=d.o(i,e)?i[e]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(2574|3334|8068|8982)$/.test(e))i[e]=0;else{var a=new Promise((t,a)=>r=i[e]=[t,a]);t.push(r[2]=a);var o=d.p+d.u(e),n=Error();d.l(o,t=>{if(d.o(i,e)&&(0!==(r=i[e])&&(i[e]=void 0),r)){var a=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;n.message="Loading chunk "+e+" failed.\n("+a+": "+o+")",n.name="ChunkLoadError",n.type=a,n.request=o,r[1](n)}},"chunk-"+e,e)}},d.O.j=e=>0===i[e],s=(e,t)=>{var r,a,[o,n,s]=t,c=0;if(o.some(e=>0!==i[e])){for(r in n)d.o(n,r)&&(d.m[r]=n[r]);if(s)var l=s(d)}for(e&&e(t);c<o.length;c++)a=o[c],d.o(i,a)&&i[a]&&i[a][0](),i[a]=0;return d.O(l)},(c=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(s.bind(null,0)),c.push=s.bind(null,c.push.bind(c))})();
|
|
Binary file
|
package/app/package.json
CHANGED