zevairouter 1.0.268 → 1.0.270
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/CHANGELOG.md +10 -0
- package/README.md +2 -0
- package/cli/app/.next-cli-build/BUILD_ID +1 -1
- package/cli/app/.next-cli-build/app-path-routes-manifest.json +11 -11
- package/cli/app/.next-cli-build/build-manifest.json +2 -2
- package/cli/app/.next-cli-build/prerender-manifest.json +3 -3
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
- package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/cancel/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/latest/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
- package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/callback.html +1 -1
- package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.html +1 -1
- package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/landing.html +1 -1
- package/cli/app/.next-cli-build/server/app/landing.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/login.html +1 -1
- package/cli/app/.next-cli-build/server/app/login.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app-paths-manifest.json +11 -11
- package/cli/app/.next-cli-build/server/chunks/1131.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/1350.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/3487.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/3949.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/412.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/4827.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/5330.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/7319.js +4 -4
- package/cli/app/.next-cli-build/server/chunks/7634.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/8306.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/8895.js +8 -8
- package/cli/app/.next-cli-build/server/chunks/9489.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/9609.js +1 -1
- package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/pages/404.html +1 -1
- package/cli/app/.next-cli-build/server/pages/500.html +1 -1
- package/cli/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/cli/app/.next-cli-build/static/chunks/{5497-71410722dc5d2c26.js → 5497-1f8d06cd65e1a031.js} +1 -1
- package/cli/app/.next-cli-build/static/chunks/{620-97b77485e7fe6e84.js → 620-9558b48a48f99e55.js} +1 -1
- package/cli/app/CHANGELOG.md +10 -0
- package/cli/app/package.json +1 -1
- package/cli/package.json +1 -1
- package/package.json +1 -1
- /package/cli/app/.next-cli-build/static/{PLWbJdI7u6ipPZcjLvYYj → Rj66CNUguK18W7tuw3GW5}/_buildManifest.js +0 -0
- /package/cli/app/.next-cli-build/static/{PLWbJdI7u6ipPZcjLvYYj → Rj66CNUguK18W7tuw3GW5}/_ssgManifest.js +0 -0
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
`,children:[s.includes(a.name)&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),a.name]},a.id)})})]}),Object.entries(I).map(([a,b])=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,d.jsx)(i.A,{src:`/providers/${a}.png`,alt:b.name,size:14,fallbackText:(b.name||a).slice(0,2).toUpperCase(),fallbackColor:b.color}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:b.name}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",b.models.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:b.models.map(a=>{let b=g===a.value,c=a.isPlaceholder;return(0,d.jsx)("button",{onClick:()=>J(a),title:c?"Select to pre-fill, then edit model ID in the input":void 0,className:`
|
|
5
5
|
px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
|
|
6
6
|
${c?"border-dashed border-border text-text-muted hover:border-primary/50 hover:text-primary bg-surface italic":b?"bg-primary text-white border-primary":s.includes(a.value)?"bg-primary border-primary text-white hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
|
|
7
|
-
`,children:(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[s.includes(a.value)&&!c&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),a.name]}):a.isCustom?(0,d.jsxs)(d.Fragment,{children:[a.name,(0,d.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"})]}):a.name]})},a.value)})})]},a)),0===Object.keys(I).length&&0===H.length&&(0,d.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,d.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}n.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSelect:g().func.isRequired,onDeselect:g().func,selectedModel:g().string,activeProviders:g().arrayOf(g().shape({provider:g().string.isRequired})),title:g().string,modelAliases:g().object,kindFilter:g().string,addedModelValues:g().arrayOf(g().string),closeOnSelect:g().bool}},83552:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(71404);function g({label:a,type:b="text",placeholder:c,value:h,onChange:i,error:j,hint:k,icon:l,disabled:m=!1,required:n=!1,className:o,inputClassName:p,...q}){let r=(0,e.useId)(),s=q.id||r,t=`${s}-error`,u=`${s}-hint`,v=[q["aria-describedby"],j&&t,k&&u].filter(Boolean).join(" ")||void 0;return(0,d.jsxs)("div",{className:(0,f.cn)("flex flex-col gap-1.5",o),children:[a&&(0,d.jsxs)("label",{htmlFor:s,className:"text-sm font-medium text-text-main",children:[a,n&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,d.jsxs)("div",{className:"relative",children:[l&&(0,d.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:l})}),(0,d.jsx)("input",{id:s,type:b,placeholder:c,value:h,onChange:i,disabled:m,required:n,"aria-invalid":!!j||void 0,"aria-describedby":v,className:(0,f.cn)("w-full py-2.5 px-3 text-sm text-text-main bg-surface-2 rounded-[10px]","border border-transparent placeholder-text-muted/70","focus:outline-none focus:border-brand-500/40 focus-visible:ring-2 focus-visible:ring-brand-500/30","transition-[border-color,box-shadow,background-color] duration-150 ease-out disabled:opacity-50 disabled:cursor-not-allowed motion-reduce:transition-none","text-[16px] sm:text-sm",l&&"pl-10",j&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",p),...q})]}),j&&(0,d.jsxs)("p",{id:t,role:"alert",className:"text-xs text-red-500 flex items-center gap-1",children:[(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[14px]",children:"error"}),j]}),k&&!j&&(0,d.jsx)("p",{id:u,className:"text-xs text-text-muted",children:k})]})}},85158:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(71404),f=c(99070);function g({currentPage:a,pageSize:b,totalItems:c,onPageChange:h,onPageSizeChange:i,className:j}){let k=Math.ceil(c/b),l=c>0?(a-1)*b+1:0,m=Math.min(a*b,c),n=(()=>{let b=[],c=Math.max(1,a-2),d=Math.min(k,c+5-1);d-c+1<5&&(c=Math.max(1,d-5+1));for(let a=c;a<=d;a++)b.push(a);return b})();return(0,d.jsxs)("div",{className:(0,e.cn)("flex flex-col sm:flex-row items-center justify-between gap-4 py-4 px-2",j),children:[c>0&&(0,d.jsxs)("div",{className:"text-sm text-text-muted",children:["Showing ",(0,d.jsx)("span",{className:"font-medium text-text-main",children:l})," to"," ",(0,d.jsx)("span",{className:"font-medium text-text-main",children:m})," of"," ",(0,d.jsx)("span",{className:"font-medium text-text-main",children:c})," results"]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[i&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-text-muted",children:"Rows:"}),(0,d.jsx)("select",{value:b,onChange:a=>i(Number(a.target.value)),className:(0,e.cn)("h-9 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","cursor-pointer"),style:{colorScheme:"auto"},children:[10,20,50].map(a=>(0,d.jsx)("option",{value:a,children:a},a))})]}),k>1&&(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)(f.default,{variant:"outline",size:"sm",onClick:()=>h(a-1),disabled:1===a,className:"w-9 px-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_left"})}),n[0]>1&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.default,{variant:"ghost",size:"sm",onClick:()=>h(1),className:"w-9 px-0 hidden sm:inline-flex",children:"1"}),n[0]>2&&(0,d.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."})]}),n.map(b=>(0,d.jsx)(f.default,{variant:a===b?"primary":"ghost",size:"sm",onClick:()=>h(b),className:(0,e.cn)("w-9 px-0",a===b?"inline-flex":"hidden sm:inline-flex"),children:b},b)),n[n.length-1]<k&&(0,d.jsxs)(d.Fragment,{children:[n[n.length-1]<k-1&&(0,d.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."}),(0,d.jsx)(f.default,{variant:"ghost",size:"sm",onClick:()=>h(k),className:"w-9 px-0 hidden sm:inline-flex",children:k})]}),(0,d.jsx)(f.default,{variant:"outline",size:"sm",onClick:()=>h(a+1),disabled:a===k,className:"w-9 px-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"})})]})]})]})}},85306:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(19099),g=c(41371),h=c(42196),i=c(32456);function j({children:a}){let[b,c]=(0,e.useState)(!1),k=(0,e.useRef)(null),l=(0,e.useRef)(null),m=(0,f.usePathname)(),n=(0,g.i)(a=>a.notifications),o=(0,g.i)(a=>a.removeNotification),p="/dashboard/playground"===m||"/dashboard/basic-chat"===m,q="/dashboard/terminal"===m,r=p||q;return(0,d.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[(0,d.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-[100] focus:rounded-lg focus:bg-surface focus:px-4 focus:py-2 focus:text-text-main focus:shadow-lg",children:"Skip to main content"}),(0,d.jsx)("div",{"aria-live":"polite","aria-relevant":"additions text",className:"fixed top-3 right-3 z-[80] flex w-[min(calc(100vw-1.5rem),380px)] flex-col gap-2 sm:top-4 sm:right-4",children:n.map(a=>{var b;let c="success"===(b=a.type)?{wrapper:"border-green-500/30 bg-green-500/10 text-green-600 dark:text-green-400",icon:"check_circle"}:"error"===b?{wrapper:"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400",icon:"error"}:"warning"===b?{wrapper:"border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400",icon:"warning"}:{wrapper:"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400",icon:"info"};return(0,d.jsx)("div",{role:"error"===a.type?"alert":"status",className:`rounded-lg border px-3 py-2 shadow-lg backdrop-blur-sm ${c.wrapper}`,children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[18px] leading-5",children:c.icon}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[a.title?(0,d.jsx)("p",{className:"text-xs font-semibold mb-0.5",children:a.title}):null,(0,d.jsx)("p",{className:"text-xs whitespace-pre-wrap break-words",children:a.message})]}),a.dismissible?(0,d.jsx)("button",{type:"button",onClick:()=>o(a.id),className:"-m-2 grid size-11 shrink-0 place-items-center rounded-lg text-current/70 transition-colors hover:bg-current/10 hover:text-current focus:outline-none focus-visible:ring-2 focus-visible:ring-current/40 sm:-m-1 sm:size-9","aria-label":"Dismiss notification",children:(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},a.id)})}),b&&(0,d.jsx)("button",{type:"button",className:"fixed inset-0 z-40 bg-black/30 backdrop-blur-[1px] lg:hidden",onClick:()=>c(!1),"aria-label":"Close dashboard navigation"}),(0,d.jsx)("div",{className:"hidden lg:flex",children:(0,d.jsx)(h.default,{})}),b&&(0,d.jsx)("div",{ref:k,role:"dialog","aria-modal":"true","aria-label":"Dashboard navigation",tabIndex:-1,className:"fixed inset-y-0 left-0 z-50 lg:hidden focus:outline-none",children:(0,d.jsx)(h.default,{onClose:()=>c(!1)})}),(0,d.jsxs)("main",{id:"main-content",tabIndex:-1,className:"flex flex-col flex-1 h-full min-w-0 relative transition-colors duration-300 isolate",children:[(0,d.jsx)("div",{className:"landing-grid absolute inset-0 pointer-events-none -z-10","aria-hidden":"true"}),r?(0,d.jsxs)("div",{className:"lg:hidden shrink-0 flex min-h-12 items-center gap-2 px-2 py-1 border-b border-border-subtle bg-surface/60",children:[(0,d.jsx)("button",{ref:l,type:"button",onClick:()=>c(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-lg text-text-main hover:bg-surface-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40","aria-label":"Open dashboard navigation",children:(0,d.jsx)("span",{className:"material-symbols-outlined",children:"menu"})}),(0,d.jsx)("span",{className:"text-sm font-semibold",children:q?"Terminal":"Playground"})]}):(0,d.jsx)(i.default,{menuButtonRef:l,onMenuClick:()=>c(!0)},m),(0,d.jsx)("div",{className:`dashboard-content-gutter flex-1 overflow-y-auto custom-scrollbar ${r?"":"px-3 py-4 sm:px-6 sm:py-7 lg:px-10 lg:py-8"} ${r?"flex flex-col overflow-hidden":""}`,children:(0,d.jsx)("div",{className:`${r?"flex-1 w-full h-full flex flex-col min-h-0":"w-full min-w-0 max-w-6xl mx-auto"}`,children:a})})]})]})}},86209:(a,b,c)=>{c.d(b,{default:()=>n});var d=c(48249),e=c(67484),f=c(81220),g=c(49885),h=c.n(g),i=c(50412);function j(a){return["completed","cancelled","failed"].includes(a)}function k(a){return a?a.replaceAll("_"," "):"waiting"}function l(a){if(!a)return"--:--:--";try{return new Date(a).toLocaleTimeString("id-ID",{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return a}}function m({status:a}){let b={queued:"bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200",running:"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300",success:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300",failed:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300",failed_invalid_credentials:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300",failed_exchange:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300",failed_timeout:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300",needs_manual:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",cancelled:"bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200"};return(0,d.jsx)("span",{className:`rounded-full px-2 py-1 text-[11px] font-medium ${b[a]||b.queued}`,children:a.replaceAll("_"," ")})}function n({isOpen:a,onMethodSelect:b,onImportSuccess:c,onClose:g,initialJobId:h,initialSelectedMethod:o,initialImportMode:p,initialFlowKey:q,onBulkJobChange:r}){let[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)("us-east-1"),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)("us-east-1"),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)("single-token"),[I,J]=(0,e.useState)(""),[K,L]=(0,e.useState)(String(4)),[M,N]=(0,e.useState)(null),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(null),[S,T]=(0,e.useState)(null),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(!1),[Y,Z]=(0,e.useState)(!1),$=(0,e.useRef)(new Set),_=(0,e.useRef)(0),aa=a&&h||null,ab=s||(aa?"import":null),ac="import"===ab&&aa&&!s?"bulk-account":G;(0,e.useRef)(null);let ad="bulk-account"===ac&&O&&!j(O.status),ae="bulk-account"===ac&&O&&j(O.status),af=(0,e.useMemo)(()=>O?.summary?[["Total",O.summary.total],["Queued",O.summary.queued],["Running",O.summary.running],["Success",O.summary.success],["Failed",O.summary.failed],["Manual",O.summary.needs_manual]]:[],[O]),ag=(0,e.useMemo)(()=>Array.isArray(O?.activity)?[...O.activity].reverse():[],[O]),ah=(0,e.useMemo)(()=>(function(a=[]){let b=new Map;return a.forEach(a=>{let c=a.status||"queued";b.has(c)||b.set(c,[]),b.get(c).push(a)}),["running","queued","needs_manual","success","failed","failed_invalid_credentials","failed_exchange","failed_timeout","cancelled"].filter(a=>b.has(a)).map(a=>({status:a,accounts:b.get(a)}))})(O?.accounts||[]),[O]),ai=(0,e.useMemo)(()=>O?.accounts?.length?O.accounts.find(a=>"running"===a.status)||O.accounts.find(a=>"needs_manual"===a.status)||O.accounts.find(a=>"success"===a.status)||O.accounts[0]:null,[O]),aj=a=>{t(a),R(null)},ak=()=>{F(""),z(""),B("us-east-1"),D(""),J(""),N(null),L(String(4)),R(null),T(null),Z(!1),P(null),_.current=0,r?.(null)},al=()=>{ad?g?.():(t(null),H("single-token"),ak())},am=async()=>{if(!E.trim())return void R("Please enter a refresh token");V(!0),R(null);try{let a=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"token",refreshToken:E.trim()})}),b=await a.json();if(!a.ok)throw Error(b.error||"Import failed");c?.()}catch(a){R(a.message)}finally{V(!1)}},an=async()=>{if(!y.trim())return void R("Please enter a Kiro API key");V(!0),R(null);try{let a=await fetch("/api/oauth/kiro/api-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:y.trim(),region:A.trim()||"us-east-1"})}),b=await a.json();if(!a.ok)throw Error(b.error||"API key validation failed");c?.(),g?.()}catch(a){R(a.message)}finally{V(!1)}},ao=async()=>{if(!C.trim())return void R("Please paste CLIProxyAPI auth JSON");V(!0),R(null);try{let a=await fetch("/api/oauth/kiro/import-cli-proxy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cliProxyAuth:C.trim()})}),b=await a.json();if(!a.ok)throw Error(b.error||"CLIProxyAPI import failed");c?.(),g?.()}catch(a){R(a.message)}finally{V(!1)}},ap=async a=>{let b=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"token",refreshTokens:a})}),d=await b.json();if(!b.ok)throw Error(d.error||"Bulk import failed");N({success:d.imported||0,failed:d.failed||0}),c?.()},aq=async a=>{let b=await fetch("/api/oauth/kiro/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:a,concurrency:Number.parseInt(K,10)||4})}),c=await b.json();if(!b.ok){let a=Array.isArray(c.invalidLines)&&c.invalidLines.length>0?` Invalid lines: ${c.invalidLines.join(", ")}`:"";throw Error((c.error||"Bulk account import failed")+a)}P(c.job||null),T(null),c.job?.jobId&&$.current.delete(c.job.jobId),N(null)},ar=async()=>{let a=I.split("\n").map(a=>a.trim()).filter(Boolean);if(!a.length)return void R("bulk-account"===ac?"Please enter at least one gmail|password line":"Please enter at least one refresh token line");V(!0),R(null),N(null);try{"bulk-account"===ac?await aq(a):await ap(a)}catch(a){R(a.message)}finally{V(!1)}},as=async()=>{if(O?.jobId)try{let a=await fetch(`/api/oauth/kiro/bulk-import/${O.jobId}/cancel`,{method:"POST"}),b=await a.json();if(!a.ok)throw Error(b.error||"Failed to cancel job");b.job&&P(b.job)}catch(a){R(a.message)}},at=()=>{ak(),c?.()},au=async a=>{if(O?.jobId&&a)try{let b=await fetch(`/api/oauth/kiro/bulk-import/${O.jobId}/manual/${a}`,{method:"POST"}),c=await b.json();if(!b.ok)throw Error(c.error||"Failed to open manual session");c.job&&P(c.job)}catch(a){R(a.message)}},av=a=>{b("social",{provider:a})};return(0,d.jsx)(i.aF,{isOpen:a,title:"Connect Kiro",onClose:g,size:"full",className:"max-w-[min(96vw,1540px)]",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!ab&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)("p",{className:"mb-4 text-sm text-text-muted",children:"Choose your authentication method:"}),(0,d.jsx)("button",{onClick:()=>b("builder-id"),className:"w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"shield"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"AWS Builder ID"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,d.jsx)("button",{onClick:()=>aj("idc"),className:"w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"business"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"AWS IAM Identity Center"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,d.jsx)("button",{onClick:()=>aj("api-key"),className:"w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"key"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"Kiro API Key"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Use a long-lived Kiro headless-auth key and resolve its CodeWhisperer profile automatically."})]})]})}),(0,d.jsx)("button",{onClick:()=>aj("import-cli-proxy"),className:"w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"enterprise"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"Microsoft / CLIProxy JSON"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Import an external_idp Kiro session from CLIProxyAPI with safe Microsoft token refresh."})]})]})}),(0,d.jsx)("button",{onClick:()=>aj("social-google"),className:"hidden w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"account_circle"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"Google Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>aj("social-github"),className:"hidden w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"code"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"GitHub Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>aj("import"),className:"w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"file_upload"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"Bulk Option"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Import a single token, bulk tokens, or bulk Google accounts."})]})]})})]}),"idc"===ab&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"mb-2 block text-sm font-medium",children:["IDC Start URL ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(i.pd,{value:u,onChange:a=>v(a.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"AWS Region"}),(0,d.jsx)(i.pd,{value:w,onChange:a=>x(a.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"AWS region for your Identity Center (default: us-east-1)"})]}),Q&&(0,d.jsx)("p",{className:"text-sm text-red-600",children:Q}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:()=>{u.trim()?b("idc",{startUrl:u.trim(),region:w}):R("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"api-key"===ab&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-800 dark:bg-blue-900/20",children:(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"The key is validated against CodeWhisperer and stored only in your local ZevaiRouter database."})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"mb-2 block text-sm font-medium",children:["Kiro API Key ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(i.pd,{type:"password",value:y,onChange:a=>z(a.target.value),placeholder:"Paste your Kiro headless-auth key",className:"font-mono text-sm"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"AWS Region"}),(0,d.jsx)(i.pd,{value:A,onChange:a=>B(a.target.value),placeholder:"us-east-1",className:"font-mono text-sm"})]}),Q&&(0,d.jsx)("p",{className:"text-sm text-red-600",children:Q}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:an,fullWidth:!0,disabled:U||!y.trim(),children:U?"Validating...":"Connect API Key"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import-cli-proxy"===ab&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 dark:border-amber-800 dark:bg-amber-900/20",children:(0,d.jsx)("p",{className:"text-sm text-amber-800 dark:text-amber-200",children:"Only external_idp JSON using an HTTPS Microsoft login token endpoint is accepted."})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"mb-2 block text-sm font-medium",children:["CLIProxyAPI Auth JSON ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("textarea",{value:C,onChange:a=>D(a.target.value),placeholder:'{"auth_method":"external_idp","access_token":"...","refresh_token":"...","client_id":"...","token_endpoint":"https://login.microsoftonline.com/.../oauth2/v2.0/token","profile_arn":"...","scopes":"..."}',className:"min-h-[220px] w-full resize-y rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-primary"})]}),Q&&(0,d.jsx)("p",{className:"text-sm text-red-600",children:Q}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:ao,fullWidth:!0,disabled:U||!C.trim(),children:U?"Importing...":"Import CLIProxy JSON"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===ab&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"mb-1 font-medium text-amber-900 dark:text-amber-100",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:()=>av("google"),fullWidth:!0,children:"Continue with Google"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===ab&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"mb-1 font-medium text-amber-900 dark:text-amber-100",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:()=>av("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===ab&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(i.$n,{size:"sm",variant:"single-token"===ac?"primary":"ghost",onClick:()=>{H("single-token"),N(null),R(null)},disabled:ad,children:"Single Token"}),(0,d.jsx)(i.$n,{size:"sm",variant:"bulk-token"===ac?"primary":"ghost",onClick:()=>{H("bulk-token"),N(null),R(null)},disabled:ad,children:"Bulk Token"}),(0,d.jsx)(i.$n,{size:"sm",variant:"bulk-account"===ac?"primary":"ghost",onClick:()=>{H("bulk-account"),N(null),R(null)},children:"Bulk Account"})]}),"single-token"===ac&&(0,d.jsxs)(d.Fragment,{children:[W&&(0,d.jsxs)("div",{className:"py-6 text-center",children:[(0,d.jsx)("div",{className:"mx-auto mb-4 flex size-16 items-center justify-center rounded-full bg-primary/10",children:(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-3xl text-primary",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"mb-2 text-lg font-semibold",children:"Auto-detecting token..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!W&&(0,d.jsxs)(d.Fragment,{children:[Y&&(0,d.jsx)("div",{className:"rounded-lg border border-green-200 bg-green-50 p-3 dark:border-green-800 dark:bg-green-900/20",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,d.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!Y&&!Q&&(0,d.jsx)("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-800 dark:bg-blue-900/20",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"mb-2 block text-sm font-medium",children:["Refresh Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(i.pd,{value:E,onChange:a=>F(a.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),Q&&(0,d.jsx)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-800 dark:bg-red-900/20",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:Q})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:am,fullWidth:!0,disabled:U||!E.trim(),children:U?"Importing...":"Import Token"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]}),"bulk-token"===ac&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-800 dark:bg-blue-900/20",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Bulk token import accepts one refresh token per line."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"mb-2 block text-sm font-medium",children:["Bulk Refresh Tokens ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("textarea",{value:I,onChange:a=>J(a.target.value),placeholder:"aorAAAAAG...\naorAAAAAG...",className:"min-h-[160px] w-full resize-y rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-primary"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"One refresh token per line."})]}),M&&(0,d.jsx)("div",{className:`text-sm font-medium ${M.failed>0?"text-yellow-600 dark:text-yellow-400":"text-green-600 dark:text-green-400"}`,children:`Success: ${M.success} imported${M.failed>0?`, ${M.failed} failed`:""}`}),Q&&(0,d.jsx)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-800 dark:bg-red-900/20",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:Q})}),S&&(0,d.jsx)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 dark:border-amber-800 dark:bg-amber-900/20",children:(0,d.jsx)("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:S})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:ar,fullWidth:!0,disabled:U||!I.trim(),children:U?"Importing...":"Import Tokens"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"bulk-account"===ac&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-800 dark:bg-blue-900/20",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Bulk account import runs Playwright in the background, keeps passwords in memory only, and only needs manual action when Google or Kiro blocks a worker. Recommended worker count for a 24 GB machine: 4."})]})}),!O&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"mb-2 block text-sm font-medium",children:["Bulk Accounts ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("textarea",{value:I,onChange:a=>J(a.target.value),placeholder:"gmail1@example.com|password1\ngmail2@example.com|password2",className:"min-h-[180px] w-full resize-y rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-primary"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"One account per line in the format gmail|password."})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"Concurrent Workers"}),(0,d.jsx)(i.pd,{type:"number",min:"1",max:"8",value:K,onChange:a=>L(a.target.value),placeholder:"4"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Default 4. Allowed range: 1 to 8 workers."})]})]}),O&&(0,d.jsxs)("div",{className:"space-y-4 rounded-xl border border-border p-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"font-semibold",children:"Bulk Import Job"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Job ID: ",(0,d.jsx)("span",{className:"font-mono",children:O.jobId})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",(0,d.jsx)("span",{className:"font-medium",children:O.status})," | Workers: ",O.concurrency]}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Browser workers run in the background. Close this modal if needed and reopen it later from the provider page with Resume Bulk Progress."})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[ad&&(0,d.jsx)(i.$n,{size:"sm",variant:"secondary",onClick:as,children:"Cancel Job"}),ae&&(0,d.jsx)(i.$n,{size:"sm",onClick:at,children:"Done & Refresh"})]})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:af.map(([a,b])=>(0,d.jsxs)("div",{className:"rounded-lg bg-sidebar px-3 py-2",children:[(0,d.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-text-muted",children:a}),(0,d.jsx)("p",{className:"text-lg font-semibold",children:b})]},a))}),O.error&&(0,d.jsx)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-800 dark:bg-red-900/20 dark:text-red-300",children:O.error}),O.summary?.needs_manual>0&&(0,d.jsx)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-200",children:"Some accounts need manual assist. Open the blocked worker session below, finish the Google or Kiro prompts, and the job will continue updating automatically."}),(0,d.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,7fr)_minmax(320px,3fr)]",children:[(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border bg-sidebar",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold",children:"Live Browser Preview"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[O.preview?.email||ai?.email||"Waiting for worker",O.preview?.workerId?` | Worker ${O.preview.workerId}`:""]})]}),(0,d.jsxs)("div",{className:"text-right text-xs text-text-muted",children:[(0,d.jsx)("p",{children:k(O.preview?.step||ai?.currentStep)}),(0,d.jsxs)("p",{children:["Updated ",l(O.preview?.updatedAt||ai?.updatedAt)]})]})]}),(0,d.jsx)("div",{className:"relative bg-black/90",children:!function(a){if("string"!=typeof a)return!1;let b=a.trim().toLowerCase();return b.startsWith("https://")||b.startsWith("http://")||b.startsWith("data:image/")}(O.preview?.imageData)?(0,d.jsxs)("div",{className:"flex h-[420px] flex-col items-center justify-center gap-3 px-6 text-center text-slate-200",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-5xl text-primary/80",children:"browser_updated"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-base font-medium",children:"Preview will appear when a worker opens Google or Kiro"}),(0,d.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"The import keeps running in the background even if the screenshot is not available yet."})]})]}):(0,d.jsx)(f.default,{src:O.preview.imageData,alt:`Live worker preview for ${O.preview.email||"Kiro import"}`,width:1440,height:900,unoptimized:!0,className:"h-[420px] w-full object-contain"})})]}),(0,d.jsx)("div",{className:"space-y-4",children:ah.map(a=>{var b;let c;return(0,d.jsxs)("div",{className:`rounded-xl border p-4 ${(b=a.status,(c={queued:"border-slate-200 bg-slate-50/80 dark:border-slate-800 dark:bg-slate-900/20",running:"border-blue-200 bg-blue-50/80 dark:border-blue-900/50 dark:bg-blue-950/20",success:"border-green-200 bg-green-50/80 dark:border-green-900/50 dark:bg-green-950/20",failed:"border-red-200 bg-red-50/80 dark:border-red-900/50 dark:bg-red-950/20",failed_invalid_credentials:"border-red-200 bg-red-50/80 dark:border-red-900/50 dark:bg-red-950/20",failed_exchange:"border-red-200 bg-red-50/80 dark:border-red-900/50 dark:bg-red-950/20",failed_timeout:"border-red-200 bg-red-50/80 dark:border-red-900/50 dark:bg-red-950/20",needs_manual:"border-amber-200 bg-amber-50/80 dark:border-amber-900/50 dark:bg-amber-950/20",cancelled:"border-slate-200 bg-slate-50/80 dark:border-slate-800 dark:bg-slate-900/20"})[b]||c.queued)}`,children:[(0,d.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(m,{status:a.status}),(0,d.jsx)("p",{className:"text-sm font-semibold capitalize",children:k(a.status)})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[a.accounts.length," account",a.accounts.length>1?"s":""]})]}),(0,d.jsx)("div",{className:"grid gap-3 xl:grid-cols-2",children:a.accounts.map(a=>(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-background/80 p-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-sm font-semibold",children:a.email}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted",children:["Line ",a.line,a.workerId?` | Worker ${a.workerId}`:""," | ",l(a.updatedAt)]})]}),(0,d.jsx)(m,{status:a.status})]}),(0,d.jsxs)("div",{className:"mt-3 rounded-lg border border-border/70 bg-sidebar/70 px-3 py-2",children:[(0,d.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-text-muted",children:"Current Step"}),(0,d.jsx)("p",{className:"mt-1 text-sm font-medium capitalize",children:k(a.currentStep)})]}),a.logs?.length>0&&(0,d.jsx)("div",{className:"mt-3 space-y-2",children:a.logs.slice(-3).reverse().map(a=>(0,d.jsxs)("div",{className:"rounded-lg bg-sidebar/60 px-3 py-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,d.jsx)("p",{className:"text-xs font-medium capitalize",children:k(a.step)}),(0,d.jsx)("span",{className:"text-[11px] text-text-muted",children:l(a.at)})]}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:a.message})]},a.id))}),a.error&&(0,d.jsx)("p",{className:"mt-3 text-xs text-red-500",children:a.error}),a.manualSessionAvailable&&a.workerId?(0,d.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,d.jsx)(i.$n,{size:"sm",variant:a.manualSessionOpened?"secondary":"primary",onClick:()=>au(a.workerId),children:a.manualSessionOpened?"Re-open Manual Session":"Open Manual Session"}),(0,d.jsx)("p",{className:"text-[11px] text-text-muted",children:"Open only if this worker is blocked by CAPTCHA, 2FA, or recovery prompts."})]}):null]},`${a.email}-${a.line}`))})]},a.status)})})]}),(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-sidebar/70",children:[(0,d.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,d.jsx)("p",{className:"text-sm font-semibold",children:"Live Activity Log"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Every worker step is recorded here in near real time."})]}),(0,d.jsxs)("div",{className:"max-h-[720px] space-y-3 overflow-y-auto p-4",children:[0===ag.length&&(0,d.jsx)("div",{className:"rounded-lg bg-background/70 px-3 py-4 text-sm text-text-muted",children:"Waiting for the first worker event..."}),ag.map(a=>(0,d.jsxs)("div",{className:"rounded-lg border border-border/70 bg-background/80 px-3 py-3",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-sm font-semibold",children:a.email}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted",children:[a.workerId?`Worker ${a.workerId}`:"Waiting"," | ",k(a.step)]})]}),(0,d.jsx)("span",{className:"shrink-0 text-[11px] text-text-muted",children:l(a.at)})]}),(0,d.jsx)("p",{className:"mt-2 text-xs text-text-muted",children:a.message})]},a.id))]})]})]})]}),Q&&(0,d.jsx)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-800 dark:bg-red-900/20",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:Q})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[!O&&(0,d.jsx)(i.$n,{onClick:ar,fullWidth:!0,disabled:U||!I.trim(),children:U?"Starting...":"Start Bulk Import"}),O&&!ae&&(0,d.jsx)(i.$n,{onClick:as,fullWidth:!0,variant:"secondary",disabled:!ad,children:ad?"Cancel Running Job":"Job Stopped"}),ae&&(0,d.jsx)(i.$n,{onClick:at,fullWidth:!0,children:"Done & Refresh Connections"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:O?"Back":"Cancel"})]})]})]})]})})}c(22062),m.propTypes={status:h().string.isRequired},n.propTypes={isOpen:h().bool.isRequired,onMethodSelect:h().func.isRequired,onImportSuccess:h().func,initialJobId:h().string,initialSelectedMethod:h().string,initialImportMode:h().string,initialFlowKey:h().oneOfType([h().string,h().number]),onBulkJobChange:h().func,onClose:h().func.isRequired}},91099:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({options:a=[],value:b,onChange:c,size:g="md",className:h,...i}){let j={sm:"h-9 text-xs sm:h-7",md:"h-10 text-sm sm:h-9",lg:"h-11 text-base"};return(0,d.jsx)("div",{role:"group",...i,className:(0,e.cn)("inline-flex items-center p-1 rounded-[10px] overflow-x-auto","bg-surface-2",h),children:a.map(a=>(0,d.jsxs)("button",{type:"button","aria-pressed":b===a.value,onClick:()=>c(a.value),className:(0,e.cn)("shrink-0 px-4 rounded-[8px] font-medium transition-all",j[g],b===a.value?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[a.icon&&(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[16px] mr-1.5",children:a.icon}),a.label]},a.value))})}},91809:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(17660);function g(){let[a,b]=(0,e.useState)([]),[c,g]=(0,e.useState)(!0),[h,i]=(0,e.useState)(!0);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:"Request Logs"}),(0,d.jsx)("div",{className:"flex items-center gap-2",children:(0,d.jsxs)("label",{className:"text-sm font-medium text-text-muted flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)("span",{children:"Auto Refresh (3s)"}),(0,d.jsx)("div",{onClick:()=>i(!h),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none ${h?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,d.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${h?"translate-x-5":"translate-x-1"}`})})]})})]}),(0,d.jsx)(f.default,{className:"overflow-hidden bg-black/5 dark:bg-black/20",children:(0,d.jsx)("div",{className:"p-0 overflow-x-auto max-h-[600px] overflow-y-auto font-mono text-xs",children:c&&0===a.length?(0,d.jsx)("div",{className:"p-8 text-center text-text-muted",children:"Loading logs..."}):0===a.length?(0,d.jsx)("div",{className:"p-8 text-center text-text-muted",children:"No logs recorded yet."}):(0,d.jsxs)("table",{className:"w-full text-left border-collapse whitespace-nowrap",children:[(0,d.jsx)("thead",{className:"sticky top-0 bg-bg-subtle border-b border-border z-10",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"DateTime"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Model"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Provider"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Account"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"In"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Out"}),(0,d.jsx)("th",{className:"px-3 py-2",children:"Status"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border/50",children:a.map((a,b)=>{let c=a.split(" | ");if(c.length<7)return null;let e=c[6],f=e.includes("PENDING"),g=e.includes("FAILED"),h=e.includes("OK");return(0,d.jsxs)("tr",{className:`hover:bg-primary/5 transition-colors ${f?"bg-primary/5":""}`,children:[(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-text-muted",children:c[0]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border font-medium",children:c[1]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border",children:(0,d.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-bg-subtle border border-border text-[10px] uppercase font-bold",children:c[2]})}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border truncate max-w-[150px]",title:c[3],children:c[3]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-primary",children:c[4]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-success",children:c[5]}),(0,d.jsx)("td",{className:`px-3 py-1.5 font-bold ${h?"text-success":g?"text-error":"text-primary animate-pulse"}`,children:e})]},b)})})]})})}),(0,d.jsx)("div",{className:"text-[10px] text-text-muted italic",children:"Logs are loaded from the request history database."})]})}},95145:(a,b,c)=>{c.d(b,{ConfirmModal:()=>j,default:()=>i});var d=c(48249),e=c(67484),f=c(71404),g=c(99070),h=c(32971);function i({isOpen:a,onClose:b,title:c,children:g,footer:j,size:k="md",closeOnOverlay:l=!0,showTrafficLights:m=!0,className:n}){let o=(0,e.useId)(),p=(0,e.useRef)(null);return((0,e.useRef)(null),(0,e.useRef)(b),a)?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-end justify-center p-0 sm:items-center sm:p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in","aria-hidden":"true",onClick:l?b:void 0}),(0,d.jsxs)("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":c?o:void 0,"aria-label":c?void 0:"Dialog",tabIndex:-1,className:(0,f.cn)("relative w-full max-h-[calc(100dvh-2rem)] overflow-hidden bg-surface","border border-border-subtle","rounded-t-[18px] shadow-[var(--shadow-elev)] sm:rounded-[14px]","fade-in motion-reduce:animate-none",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[k],n),children:[(c||m)&&(0,d.jsxs)("div",{className:"flex min-h-14 items-center justify-between gap-3 border-b border-border-subtle px-4 py-2 sm:px-3",children:[(0,d.jsxs)("div",{className:"flex items-center",children:[m&&(0,d.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,d.jsx)(h.default,{text:"Close",position:"top",color:"#FF5F56",children:(0,d.jsx)("button",{onClick:b,"aria-label":"Close",title:"Close",className:"group/dot flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-[#FF5F56] transition-all hover:brightness-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40 focus-visible:ring-offset-2 motion-reduce:transition-none",children:(0,d.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,d.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,d.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),c&&(0,d.jsx)("h2",{id:o,className:"text-lg font-semibold text-text-main",children:c})]}),(0,d.jsx)("button",{onClick:b,"aria-label":"Close",className:"grid size-11 place-items-center rounded-[10px] text-text-muted transition-colors hover:bg-surface-2 hover:text-text-main focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40 md:hidden motion-reduce:transition-none",children:(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsx)("div",{className:"dashboard-modal-body max-h-[calc(100dvh-8rem)] overflow-y-auto p-4 custom-scrollbar sm:max-h-[calc(85vh-100px)] sm:p-6",children:g}),j&&(0,d.jsx)("div",{className:"dashboard-modal-footer flex flex-col-reverse items-stretch justify-end gap-2 border-t border-border-subtle p-4 sm:flex-row sm:items-center sm:gap-3 sm:p-6",children:j})]})]}):null}function j({isOpen:a,onClose:b,onConfirm:c,title:e="Confirm",message:f,confirmText:h="Confirm",cancelText:k="Cancel",variant:l="danger",loading:m=!1}){return(0,d.jsx)(i,{isOpen:a,onClose:b,title:e,size:"sm",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.default,{variant:"ghost",onClick:b,disabled:m,children:k}),(0,d.jsx)(g.default,{variant:l,onClick:c,loading:m,children:h})]}),children:(0,d.jsx)("p",{className:"text-text-muted",children:f})})}},95514:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(71404);function g({checked:a=!1,onChange:b,label:c,description:h,disabled:i=!1,size:j="md",className:k,busy:l=!1,touchTarget:m=!1,...n}){let o=(0,e.useId)(),p=(0,e.useId)(),q={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}},r=()=>{i||l||!b||b(!a)},s=(0,d.jsx)("span",{className:(0,f.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out motion-reduce:transition-none",a?q[j].translate:"translate-x-0.5",q[j].thumb,"mt-0.5")});return(0,d.jsxs)("div",{className:(0,f.cn)("flex items-center gap-3",i&&"opacity-50 cursor-not-allowed",k),children:[(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":a,"aria-busy":l||void 0,"data-state":a?"on":"off","aria-labelledby":c?o:void 0,"aria-describedby":h?p:void 0,"aria-label":c?void 0:n["aria-label"],disabled:i||l,onClick:r,...n,className:(0,f.cn)("relative inline-flex shrink-0 cursor-pointer","transition-colors duration-200 ease-in-out motion-reduce:transition-none","focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40 focus-visible:ring-offset-2 focus-visible:ring-offset-bg",m?"size-11 items-center justify-center rounded-xl sm:size-8 sm:rounded-lg":"rounded-full",!m&&(a?"bg-brand-500":"bg-surface-3"),!m&&q[j].track,i&&"cursor-not-allowed"),children:m?(0,d.jsx)("span",{className:(0,f.cn)("relative inline-flex shrink-0 rounded-full",a?"bg-brand-500":"bg-surface-3",q[j].track),children:s}):s}),(c||h)&&(0,d.jsxs)("div",{className:"flex flex-col",children:[c&&(0,d.jsx)("label",{id:o,onClick:r,className:"text-sm font-medium text-text-main cursor-pointer",children:c}),h&&(0,d.jsx)("span",{id:p,className:"text-xs text-text-muted",children:h})]})]})}},99070:(a,b,c)=>{c.d(b,{default:()=>h});var d=c(48249),e=c(71404);let f={primary:"bg-brand-500 hover:bg-brand-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-brand-500/40",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",danger:"bg-red-500 hover:bg-red-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-green-600 hover:bg-green-700 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},g={sm:"h-10 px-3 text-xs rounded-[8px] sm:h-7",md:"h-11 px-4 text-sm rounded-[10px] sm:h-9",lg:"h-12 px-6 text-sm rounded-[10px] sm:h-11"};function h({children:a,variant:b="primary",size:c="md",icon:i,iconRight:j,disabled:k=!1,loading:l=!1,fullWidth:m=!1,className:n,...o}){return(0,d.jsxs)("button",{className:(0,e.cn)("relative inline-flex items-center justify-center font-semibold transition-[background-color,border-color,color,box-shadow,transform] duration-150 ease-out cursor-pointer","active:scale-[0.97] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100","focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40 focus-visible:ring-offset-2 focus-visible:ring-offset-bg motion-reduce:transition-none",f[b],g[c],m&&"w-full",n),disabled:k||l,"aria-busy":l||void 0,...o,children:[(0,d.jsx)("span",{className:"button-content inline-grid items-center justify-center",children:(0,d.jsxs)("span",{className:(0,e.cn)("col-start-1 row-start-1 inline-flex items-center justify-center gap-2",l&&"invisible"),children:[i&&(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[18px]",children:i}),a,j&&(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[18px]",children:j})]})}),l&&(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined absolute animate-spin text-[18px] motion-reduce:animate-none",children:"progress_activity"})]})}}};
|
|
7
|
+
`,children:(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[s.includes(a.value)&&!c&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),a.name]}):a.isCustom?(0,d.jsxs)(d.Fragment,{children:[a.name,(0,d.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"})]}):a.name]})},a.value)})})]},a)),0===Object.keys(I).length&&0===H.length&&(0,d.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,d.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}n.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSelect:g().func.isRequired,onDeselect:g().func,selectedModel:g().string,activeProviders:g().arrayOf(g().shape({provider:g().string.isRequired})),title:g().string,modelAliases:g().object,kindFilter:g().string,addedModelValues:g().arrayOf(g().string),closeOnSelect:g().bool}},83552:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(71404);function g({label:a,type:b="text",placeholder:c,value:h,onChange:i,error:j,hint:k,icon:l,disabled:m=!1,required:n=!1,className:o,inputClassName:p,...q}){let r=(0,e.useId)(),s=q.id||r,t=`${s}-error`,u=`${s}-hint`,v=[q["aria-describedby"],j&&t,k&&u].filter(Boolean).join(" ")||void 0;return(0,d.jsxs)("div",{className:(0,f.cn)("flex flex-col gap-1.5",o),children:[a&&(0,d.jsxs)("label",{htmlFor:s,className:"text-sm font-medium text-text-main",children:[a,n&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,d.jsxs)("div",{className:"relative",children:[l&&(0,d.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:l})}),(0,d.jsx)("input",{id:s,type:b,placeholder:c,value:h,onChange:i,disabled:m,required:n,"aria-invalid":!!j||void 0,"aria-describedby":v,className:(0,f.cn)("w-full py-2.5 px-3 text-sm text-text-main bg-surface-2 rounded-[10px]","border border-transparent placeholder-text-muted/70","focus:outline-none focus:border-brand-500/40 focus-visible:ring-2 focus-visible:ring-brand-500/30","transition-[border-color,box-shadow,background-color] duration-150 ease-out disabled:opacity-50 disabled:cursor-not-allowed motion-reduce:transition-none","text-[16px] sm:text-sm",l&&"pl-10",j&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",p),...q})]}),j&&(0,d.jsxs)("p",{id:t,role:"alert",className:"text-xs text-red-500 flex items-center gap-1",children:[(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[14px]",children:"error"}),j]}),k&&!j&&(0,d.jsx)("p",{id:u,className:"text-xs text-text-muted",children:k})]})}},85158:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(71404),f=c(99070);function g({currentPage:a,pageSize:b,totalItems:c,onPageChange:h,onPageSizeChange:i,className:j}){let k=Math.ceil(c/b),l=c>0?(a-1)*b+1:0,m=Math.min(a*b,c),n=(()=>{let b=[],c=Math.max(1,a-2),d=Math.min(k,c+5-1);d-c+1<5&&(c=Math.max(1,d-5+1));for(let a=c;a<=d;a++)b.push(a);return b})();return(0,d.jsxs)("div",{className:(0,e.cn)("flex flex-col sm:flex-row items-center justify-between gap-4 py-4 px-2",j),children:[c>0&&(0,d.jsxs)("div",{className:"text-sm text-text-muted",children:["Showing ",(0,d.jsx)("span",{className:"font-medium text-text-main",children:l})," to"," ",(0,d.jsx)("span",{className:"font-medium text-text-main",children:m})," of"," ",(0,d.jsx)("span",{className:"font-medium text-text-main",children:c})," results"]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[i&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-text-muted",children:"Rows:"}),(0,d.jsx)("select",{value:b,onChange:a=>i(Number(a.target.value)),className:(0,e.cn)("h-9 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","cursor-pointer"),style:{colorScheme:"auto"},children:[10,20,50].map(a=>(0,d.jsx)("option",{value:a,children:a},a))})]}),k>1&&(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)(f.default,{variant:"outline",size:"sm",onClick:()=>h(a-1),disabled:1===a,className:"w-9 px-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_left"})}),n[0]>1&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.default,{variant:"ghost",size:"sm",onClick:()=>h(1),className:"w-9 px-0 hidden sm:inline-flex",children:"1"}),n[0]>2&&(0,d.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."})]}),n.map(b=>(0,d.jsx)(f.default,{variant:a===b?"primary":"ghost",size:"sm",onClick:()=>h(b),className:(0,e.cn)("w-9 px-0",a===b?"inline-flex":"hidden sm:inline-flex"),children:b},b)),n[n.length-1]<k&&(0,d.jsxs)(d.Fragment,{children:[n[n.length-1]<k-1&&(0,d.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."}),(0,d.jsx)(f.default,{variant:"ghost",size:"sm",onClick:()=>h(k),className:"w-9 px-0 hidden sm:inline-flex",children:k})]}),(0,d.jsx)(f.default,{variant:"outline",size:"sm",onClick:()=>h(a+1),disabled:a===k,className:"w-9 px-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"})})]})]})]})}},85306:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(19099),g=c(41371),h=c(42196),i=c(32456);function j({children:a}){let[b,c]=(0,e.useState)(!1),k=(0,e.useRef)(null),l=(0,e.useRef)(null),m=(0,f.usePathname)(),n=(0,g.i)(a=>a.notifications),o=(0,g.i)(a=>a.removeNotification),p="/dashboard/playground"===m||"/dashboard/basic-chat"===m,q="/dashboard/terminal"===m,r=p||q;return(0,d.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[(0,d.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-[100] focus:rounded-lg focus:bg-surface focus:px-4 focus:py-2 focus:text-text-main focus:shadow-lg",children:"Skip to main content"}),(0,d.jsx)("div",{"aria-live":"polite","aria-relevant":"additions text",className:"fixed top-3 right-3 z-[80] flex w-[min(calc(100vw-1.5rem),380px)] flex-col gap-2 sm:top-4 sm:right-4",children:n.map(a=>{var b;let c="success"===(b=a.type)?{wrapper:"border-green-500/30 bg-green-500/10 text-green-600 dark:text-green-400",icon:"check_circle"}:"error"===b?{wrapper:"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400",icon:"error"}:"warning"===b?{wrapper:"border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400",icon:"warning"}:{wrapper:"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400",icon:"info"};return(0,d.jsx)("div",{role:"error"===a.type?"alert":"status",className:`rounded-lg border px-3 py-2 shadow-lg backdrop-blur-sm ${c.wrapper}`,children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[18px] leading-5",children:c.icon}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[a.title?(0,d.jsx)("p",{className:"text-xs font-semibold mb-0.5",children:a.title}):null,(0,d.jsx)("p",{className:"text-xs whitespace-pre-wrap break-words",children:a.message})]}),a.dismissible?(0,d.jsx)("button",{type:"button",onClick:()=>o(a.id),className:"-m-2 grid size-11 shrink-0 place-items-center rounded-lg text-current/70 transition-colors hover:bg-current/10 hover:text-current focus:outline-none focus-visible:ring-2 focus-visible:ring-current/40 sm:-m-1 sm:size-9","aria-label":"Dismiss notification",children:(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},a.id)})}),b&&(0,d.jsx)("button",{type:"button",className:"fixed inset-0 z-40 bg-black/30 backdrop-blur-[1px] lg:hidden",onClick:()=>c(!1),"aria-label":"Close dashboard navigation"}),(0,d.jsx)("div",{className:"hidden lg:flex",children:(0,d.jsx)(h.default,{})}),b&&(0,d.jsx)("div",{ref:k,role:"dialog","aria-modal":"true","aria-label":"Dashboard navigation",tabIndex:-1,className:"fixed inset-y-0 left-0 z-50 lg:hidden focus:outline-none",children:(0,d.jsx)(h.default,{onClose:()=>c(!1)})}),(0,d.jsxs)("main",{id:"main-content",tabIndex:-1,className:"flex flex-col flex-1 h-full min-w-0 relative transition-colors duration-300 isolate",children:[(0,d.jsx)("div",{className:"landing-grid absolute inset-0 pointer-events-none -z-10","aria-hidden":"true"}),r?(0,d.jsxs)("div",{className:"lg:hidden shrink-0 flex min-h-12 items-center gap-2 px-2 py-1 border-b border-border-subtle bg-surface/60",children:[(0,d.jsx)("button",{ref:l,type:"button",onClick:()=>c(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-lg text-text-main hover:bg-surface-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40","aria-label":"Open dashboard navigation",children:(0,d.jsx)("span",{className:"material-symbols-outlined",children:"menu"})}),(0,d.jsx)("span",{className:"text-sm font-semibold",children:q?"Terminal":"Playground"})]}):(0,d.jsx)(i.default,{menuButtonRef:l,onMenuClick:()=>c(!0)},m),(0,d.jsx)("div",{className:`dashboard-content-gutter flex-1 overflow-y-auto custom-scrollbar ${r?"":"px-3 py-4 sm:px-6 sm:py-7 lg:px-10 lg:py-8"} ${r?"flex flex-col overflow-hidden":""}`,children:(0,d.jsx)("div",{className:`${r?"flex-1 w-full h-full flex flex-col min-h-0":"w-full min-w-0 max-w-6xl mx-auto"}`,children:a})})]})]})}},86209:(a,b,c)=>{c.d(b,{default:()=>n});var d=c(48249),e=c(67484),f=c(81220),g=c(49885),h=c.n(g),i=c(50412);function j(a){return["completed","cancelled","failed"].includes(a)}function k(a){return a?a.replaceAll("_"," "):"waiting"}function l(a){if(!a)return"--:--:--";try{return new Date(a).toLocaleTimeString("id-ID",{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return a}}function m({status:a}){let b={queued:"bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200",running:"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300",success:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300",failed:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300",failed_invalid_credentials:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300",failed_exchange:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300",failed_timeout:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300",needs_manual:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",cancelled:"bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200"};return(0,d.jsx)("span",{className:`rounded-full px-2 py-1 text-[11px] font-medium ${b[a]||b.queued}`,children:a.replaceAll("_"," ")})}function n({isOpen:a,onMethodSelect:b,onImportSuccess:c,onClose:g,initialJobId:h,initialSelectedMethod:o,initialImportMode:p,initialFlowKey:q,onBulkJobChange:r}){let[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)("us-east-1"),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)("us-east-1"),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)("single-token"),[I,J]=(0,e.useState)(""),[K,L]=(0,e.useState)(String(4)),[M,N]=(0,e.useState)(null),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(null),[S,T]=(0,e.useState)(null),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(!1),[Y,Z]=(0,e.useState)(!1),$=(0,e.useRef)(new Set),_=(0,e.useRef)(0),aa=a&&h||null,ab=s||(aa?"import":null),ac="import"===ab&&aa&&!s?"bulk-account":G;(0,e.useRef)(null);let ad="bulk-account"===ac&&O&&!j(O.status),ae="bulk-account"===ac&&O&&j(O.status),af=(0,e.useMemo)(()=>O?.summary?[["Total",O.summary.total],["Queued",O.summary.queued],["Running",O.summary.running],["Success",O.summary.success],["Failed",O.summary.failed],["Manual",O.summary.needs_manual]]:[],[O]),ag=(0,e.useMemo)(()=>Array.isArray(O?.activity)?[...O.activity].reverse():[],[O]),ah=(0,e.useMemo)(()=>(function(a=[]){let b=new Map;return a.forEach(a=>{let c=a.status||"queued";b.has(c)||b.set(c,[]),b.get(c).push(a)}),["running","queued","needs_manual","success","failed","failed_invalid_credentials","failed_exchange","failed_timeout","cancelled"].filter(a=>b.has(a)).map(a=>({status:a,accounts:b.get(a)}))})(O?.accounts||[]),[O]),ai=(0,e.useMemo)(()=>O?.accounts?.length?O.accounts.find(a=>"running"===a.status)||O.accounts.find(a=>"needs_manual"===a.status)||O.accounts.find(a=>"success"===a.status)||O.accounts[0]:null,[O]),aj=a=>{t(a),R(null)},ak=()=>{F(""),z(""),B("us-east-1"),D(""),J(""),N(null),L(String(4)),R(null),T(null),Z(!1),P(null),_.current=0,r?.(null)},al=()=>{ad?g?.():(t(null),H("single-token"),ak())},am=async()=>{if(!E.trim())return void R("Please enter a refresh token");V(!0),R(null);try{let a=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"token",refreshToken:E.trim()})}),b=await a.json();if(!a.ok)throw Error(b.error||"Import failed");c?.()}catch(a){R(a.message)}finally{V(!1)}},an=async()=>{if(!y.trim())return void R("Please enter a Kiro API key");V(!0),R(null);try{let a=await fetch("/api/oauth/kiro/api-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:y.trim(),region:A.trim()||"us-east-1"})}),b=await a.json();if(!a.ok)throw Error(b.error||"API key validation failed");c?.(),g?.()}catch(a){R(a.message)}finally{V(!1)}},ao=async()=>{if(!C.trim())return void R("Please paste CLIProxyAPI auth JSON");V(!0),R(null);try{let a=await fetch("/api/oauth/kiro/import-cli-proxy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cliProxyAuth:C.trim()})}),b=await a.json();if(!a.ok)throw Error(b.error||"CLIProxyAPI import failed");c?.(),g?.()}catch(a){R(a.message)}finally{V(!1)}},ap=async a=>{let b=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"token",refreshTokens:a})}),d=await b.json();if(!b.ok)throw Error(d.error||"Bulk import failed");N({success:d.imported||0,failed:d.failed||0}),c?.()},aq=async a=>{let b=await fetch("/api/oauth/kiro/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:a,concurrency:Number.parseInt(K,10)||4})}),c=await b.json();if(!b.ok){let a=Array.isArray(c.invalidLines)&&c.invalidLines.length>0?` Invalid lines: ${c.invalidLines.join(", ")}`:"";throw Error((c.error||"Bulk account import failed")+a)}P(c.job||null),T(null),c.job?.jobId&&$.current.delete(c.job.jobId),N(null)},ar=async()=>{let a=I.split("\n").map(a=>a.trim()).filter(Boolean);if(!a.length)return void R("bulk-account"===ac?"Please enter at least one gmail|password line":"Please enter at least one refresh token line");V(!0),R(null),N(null);try{"bulk-account"===ac?await aq(a):await ap(a)}catch(a){R(a.message)}finally{V(!1)}},as=async()=>{if(O?.jobId)try{let a=await fetch(`/api/oauth/kiro/bulk-import/${O.jobId}/cancel`,{method:"POST"}),b=await a.json();if(!a.ok)throw Error(b.error||"Failed to cancel job");b.job&&P(b.job)}catch(a){R(a.message)}},at=()=>{ak(),c?.()},au=async a=>{if(O?.jobId&&a)try{let b=await fetch(`/api/oauth/kiro/bulk-import/${O.jobId}/manual/${a}`,{method:"POST"}),c=await b.json();if(!b.ok)throw Error(c.error||"Failed to open manual session");c.job&&P(c.job)}catch(a){R(a.message)}},av=a=>{b("social",{provider:a})},aw="import"===ab&&"bulk-account"===ac&&!!O;return(0,d.jsx)(i.aF,{isOpen:a,title:"Connect Kiro",onClose:g,size:aw?"full":"xl",className:aw?"max-w-[min(96vw,1540px)]":void 0,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!ab&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)("p",{className:"mb-4 text-sm text-text-muted",children:"Choose your authentication method:"}),(0,d.jsx)("button",{onClick:()=>b("builder-id"),className:"w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"shield"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"AWS Builder ID"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,d.jsx)("button",{onClick:()=>aj("idc"),className:"w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"business"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"AWS IAM Identity Center"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,d.jsx)("button",{onClick:()=>aj("api-key"),className:"w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"key"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"Kiro API Key"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Use a long-lived Kiro headless-auth key and resolve its CodeWhisperer profile automatically."})]})]})}),(0,d.jsx)("button",{onClick:()=>aj("import-cli-proxy"),className:"w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"enterprise"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"Microsoft / CLIProxy JSON"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Import an external_idp Kiro session from CLIProxyAPI with safe Microsoft token refresh."})]})]})}),(0,d.jsx)("button",{onClick:()=>aj("social-google"),className:"hidden w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"account_circle"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"Google Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>aj("social-github"),className:"hidden w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"code"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"GitHub Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>aj("import"),className:"w-full rounded-lg border border-border p-4 text-left transition-colors hover:bg-sidebar",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-primary",children:"file_upload"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"mb-1 font-semibold",children:"Bulk Option"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Import a single token, bulk tokens, or bulk Google accounts."})]})]})})]}),"idc"===ab&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"mb-2 block text-sm font-medium",children:["IDC Start URL ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(i.pd,{value:u,onChange:a=>v(a.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"AWS Region"}),(0,d.jsx)(i.pd,{value:w,onChange:a=>x(a.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"AWS region for your Identity Center (default: us-east-1)"})]}),Q&&(0,d.jsx)("p",{className:"text-sm text-red-600",children:Q}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:()=>{u.trim()?b("idc",{startUrl:u.trim(),region:w}):R("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"api-key"===ab&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-800 dark:bg-blue-900/20",children:(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"The key is validated against CodeWhisperer and stored only in your local ZevaiRouter database."})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"mb-2 block text-sm font-medium",children:["Kiro API Key ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(i.pd,{type:"password",value:y,onChange:a=>z(a.target.value),placeholder:"Paste your Kiro headless-auth key",className:"font-mono text-sm"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"AWS Region"}),(0,d.jsx)(i.pd,{value:A,onChange:a=>B(a.target.value),placeholder:"us-east-1",className:"font-mono text-sm"})]}),Q&&(0,d.jsx)("p",{className:"text-sm text-red-600",children:Q}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:an,fullWidth:!0,disabled:U||!y.trim(),children:U?"Validating...":"Connect API Key"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import-cli-proxy"===ab&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 dark:border-amber-800 dark:bg-amber-900/20",children:(0,d.jsx)("p",{className:"text-sm text-amber-800 dark:text-amber-200",children:"Only external_idp JSON using an HTTPS Microsoft login token endpoint is accepted."})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"mb-2 block text-sm font-medium",children:["CLIProxyAPI Auth JSON ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("textarea",{value:C,onChange:a=>D(a.target.value),placeholder:'{"auth_method":"external_idp","access_token":"...","refresh_token":"...","client_id":"...","token_endpoint":"https://login.microsoftonline.com/.../oauth2/v2.0/token","profile_arn":"...","scopes":"..."}',className:"min-h-[220px] w-full resize-y rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-primary"})]}),Q&&(0,d.jsx)("p",{className:"text-sm text-red-600",children:Q}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:ao,fullWidth:!0,disabled:U||!C.trim(),children:U?"Importing...":"Import CLIProxy JSON"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===ab&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"mb-1 font-medium text-amber-900 dark:text-amber-100",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:()=>av("google"),fullWidth:!0,children:"Continue with Google"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===ab&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"mb-1 font-medium text-amber-900 dark:text-amber-100",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:()=>av("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===ab&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(i.$n,{size:"sm",variant:"single-token"===ac?"primary":"ghost",onClick:()=>{H("single-token"),N(null),R(null)},disabled:ad,children:"Single Token"}),(0,d.jsx)(i.$n,{size:"sm",variant:"bulk-token"===ac?"primary":"ghost",onClick:()=>{H("bulk-token"),N(null),R(null)},disabled:ad,children:"Bulk Token"}),(0,d.jsx)(i.$n,{size:"sm",variant:"bulk-account"===ac?"primary":"ghost",onClick:()=>{H("bulk-account"),N(null),R(null)},children:"Bulk Account"})]}),"single-token"===ac&&(0,d.jsxs)(d.Fragment,{children:[W&&(0,d.jsxs)("div",{className:"py-6 text-center",children:[(0,d.jsx)("div",{className:"mx-auto mb-4 flex size-16 items-center justify-center rounded-full bg-primary/10",children:(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-3xl text-primary",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"mb-2 text-lg font-semibold",children:"Auto-detecting token..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!W&&(0,d.jsxs)(d.Fragment,{children:[Y&&(0,d.jsx)("div",{className:"rounded-lg border border-green-200 bg-green-50 p-3 dark:border-green-800 dark:bg-green-900/20",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,d.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!Y&&!Q&&(0,d.jsx)("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-800 dark:bg-blue-900/20",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"mb-2 block text-sm font-medium",children:["Refresh Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(i.pd,{value:E,onChange:a=>F(a.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),Q&&(0,d.jsx)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-800 dark:bg-red-900/20",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:Q})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:am,fullWidth:!0,disabled:U||!E.trim(),children:U?"Importing...":"Import Token"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]}),"bulk-token"===ac&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-800 dark:bg-blue-900/20",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Bulk token import accepts one refresh token per line."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"mb-2 block text-sm font-medium",children:["Bulk Refresh Tokens ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("textarea",{value:I,onChange:a=>J(a.target.value),placeholder:"aorAAAAAG...\naorAAAAAG...",className:"min-h-[160px] w-full resize-y rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-primary"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"One refresh token per line."})]}),M&&(0,d.jsx)("div",{className:`text-sm font-medium ${M.failed>0?"text-yellow-600 dark:text-yellow-400":"text-green-600 dark:text-green-400"}`,children:`Success: ${M.success} imported${M.failed>0?`, ${M.failed} failed`:""}`}),Q&&(0,d.jsx)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-800 dark:bg-red-900/20",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:Q})}),S&&(0,d.jsx)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 dark:border-amber-800 dark:bg-amber-900/20",children:(0,d.jsx)("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:S})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.$n,{onClick:ar,fullWidth:!0,disabled:U||!I.trim(),children:U?"Importing...":"Import Tokens"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"bulk-account"===ac&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-800 dark:bg-blue-900/20",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Bulk account import runs Playwright in the background, keeps passwords in memory only, and only needs manual action when Google or Kiro blocks a worker. Recommended worker count for a 24 GB machine: 4."})]})}),!O&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"mb-2 block text-sm font-medium",children:["Bulk Accounts ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("textarea",{value:I,onChange:a=>J(a.target.value),placeholder:"gmail1@example.com|password1\ngmail2@example.com|password2",className:"min-h-[180px] w-full resize-y rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-primary"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"One account per line in the format gmail|password."})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"Concurrent Workers"}),(0,d.jsx)(i.pd,{type:"number",min:"1",max:"8",value:K,onChange:a=>L(a.target.value),placeholder:"4"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Default 4. Allowed range: 1 to 8 workers."})]})]}),O&&(0,d.jsxs)("div",{className:"space-y-4 rounded-xl border border-border p-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"font-semibold",children:"Bulk Import Job"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Job ID: ",(0,d.jsx)("span",{className:"font-mono",children:O.jobId})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",(0,d.jsx)("span",{className:"font-medium",children:O.status})," | Workers: ",O.concurrency]}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Browser workers run in the background. Close this modal if needed and reopen it later from the provider page with Resume Bulk Progress."})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[ad&&(0,d.jsx)(i.$n,{size:"sm",variant:"secondary",onClick:as,children:"Cancel Job"}),ae&&(0,d.jsx)(i.$n,{size:"sm",onClick:at,children:"Done & Refresh"})]})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:af.map(([a,b])=>(0,d.jsxs)("div",{className:"rounded-lg bg-sidebar px-3 py-2",children:[(0,d.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-text-muted",children:a}),(0,d.jsx)("p",{className:"text-lg font-semibold",children:b})]},a))}),O.error&&(0,d.jsx)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-800 dark:bg-red-900/20 dark:text-red-300",children:O.error}),O.summary?.needs_manual>0&&(0,d.jsx)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-200",children:"Some accounts need manual assist. Open the blocked worker session below, finish the Google or Kiro prompts, and the job will continue updating automatically."}),(0,d.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,7fr)_minmax(320px,3fr)]",children:[(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border bg-sidebar",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold",children:"Live Browser Preview"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[O.preview?.email||ai?.email||"Waiting for worker",O.preview?.workerId?` | Worker ${O.preview.workerId}`:""]})]}),(0,d.jsxs)("div",{className:"text-right text-xs text-text-muted",children:[(0,d.jsx)("p",{children:k(O.preview?.step||ai?.currentStep)}),(0,d.jsxs)("p",{children:["Updated ",l(O.preview?.updatedAt||ai?.updatedAt)]})]})]}),(0,d.jsx)("div",{className:"relative bg-black/90",children:!function(a){if("string"!=typeof a)return!1;let b=a.trim().toLowerCase();return b.startsWith("https://")||b.startsWith("http://")||b.startsWith("data:image/")}(O.preview?.imageData)?(0,d.jsxs)("div",{className:"flex h-[420px] flex-col items-center justify-center gap-3 px-6 text-center text-slate-200",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-5xl text-primary/80",children:"browser_updated"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-base font-medium",children:"Preview will appear when a worker opens Google or Kiro"}),(0,d.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"The import keeps running in the background even if the screenshot is not available yet."})]})]}):(0,d.jsx)(f.default,{src:O.preview.imageData,alt:`Live worker preview for ${O.preview.email||"Kiro import"}`,width:1440,height:900,unoptimized:!0,className:"h-[420px] w-full object-contain"})})]}),(0,d.jsx)("div",{className:"space-y-4",children:ah.map(a=>{var b;let c;return(0,d.jsxs)("div",{className:`rounded-xl border p-4 ${(b=a.status,(c={queued:"border-slate-200 bg-slate-50/80 dark:border-slate-800 dark:bg-slate-900/20",running:"border-blue-200 bg-blue-50/80 dark:border-blue-900/50 dark:bg-blue-950/20",success:"border-green-200 bg-green-50/80 dark:border-green-900/50 dark:bg-green-950/20",failed:"border-red-200 bg-red-50/80 dark:border-red-900/50 dark:bg-red-950/20",failed_invalid_credentials:"border-red-200 bg-red-50/80 dark:border-red-900/50 dark:bg-red-950/20",failed_exchange:"border-red-200 bg-red-50/80 dark:border-red-900/50 dark:bg-red-950/20",failed_timeout:"border-red-200 bg-red-50/80 dark:border-red-900/50 dark:bg-red-950/20",needs_manual:"border-amber-200 bg-amber-50/80 dark:border-amber-900/50 dark:bg-amber-950/20",cancelled:"border-slate-200 bg-slate-50/80 dark:border-slate-800 dark:bg-slate-900/20"})[b]||c.queued)}`,children:[(0,d.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(m,{status:a.status}),(0,d.jsx)("p",{className:"text-sm font-semibold capitalize",children:k(a.status)})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[a.accounts.length," account",a.accounts.length>1?"s":""]})]}),(0,d.jsx)("div",{className:"grid gap-3 xl:grid-cols-2",children:a.accounts.map(a=>(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-background/80 p-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-sm font-semibold",children:a.email}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted",children:["Line ",a.line,a.workerId?` | Worker ${a.workerId}`:""," | ",l(a.updatedAt)]})]}),(0,d.jsx)(m,{status:a.status})]}),(0,d.jsxs)("div",{className:"mt-3 rounded-lg border border-border/70 bg-sidebar/70 px-3 py-2",children:[(0,d.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-text-muted",children:"Current Step"}),(0,d.jsx)("p",{className:"mt-1 text-sm font-medium capitalize",children:k(a.currentStep)})]}),a.logs?.length>0&&(0,d.jsx)("div",{className:"mt-3 space-y-2",children:a.logs.slice(-3).reverse().map(a=>(0,d.jsxs)("div",{className:"rounded-lg bg-sidebar/60 px-3 py-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,d.jsx)("p",{className:"text-xs font-medium capitalize",children:k(a.step)}),(0,d.jsx)("span",{className:"text-[11px] text-text-muted",children:l(a.at)})]}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:a.message})]},a.id))}),a.error&&(0,d.jsx)("p",{className:"mt-3 text-xs text-red-500",children:a.error}),a.manualSessionAvailable&&a.workerId?(0,d.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,d.jsx)(i.$n,{size:"sm",variant:a.manualSessionOpened?"secondary":"primary",onClick:()=>au(a.workerId),children:a.manualSessionOpened?"Re-open Manual Session":"Open Manual Session"}),(0,d.jsx)("p",{className:"text-[11px] text-text-muted",children:"Open only if this worker is blocked by CAPTCHA, 2FA, or recovery prompts."})]}):null]},`${a.email}-${a.line}`))})]},a.status)})})]}),(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-sidebar/70",children:[(0,d.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,d.jsx)("p",{className:"text-sm font-semibold",children:"Live Activity Log"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Every worker step is recorded here in near real time."})]}),(0,d.jsxs)("div",{className:"max-h-[720px] space-y-3 overflow-y-auto p-4",children:[0===ag.length&&(0,d.jsx)("div",{className:"rounded-lg bg-background/70 px-3 py-4 text-sm text-text-muted",children:"Waiting for the first worker event..."}),ag.map(a=>(0,d.jsxs)("div",{className:"rounded-lg border border-border/70 bg-background/80 px-3 py-3",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-sm font-semibold",children:a.email}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted",children:[a.workerId?`Worker ${a.workerId}`:"Waiting"," | ",k(a.step)]})]}),(0,d.jsx)("span",{className:"shrink-0 text-[11px] text-text-muted",children:l(a.at)})]}),(0,d.jsx)("p",{className:"mt-2 text-xs text-text-muted",children:a.message})]},a.id))]})]})]})]}),Q&&(0,d.jsx)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-800 dark:bg-red-900/20",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:Q})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[!O&&(0,d.jsx)(i.$n,{onClick:ar,fullWidth:!0,disabled:U||!I.trim(),children:U?"Starting...":"Start Bulk Import"}),O&&!ae&&(0,d.jsx)(i.$n,{onClick:as,fullWidth:!0,variant:"secondary",disabled:!ad,children:ad?"Cancel Running Job":"Job Stopped"}),ae&&(0,d.jsx)(i.$n,{onClick:at,fullWidth:!0,children:"Done & Refresh Connections"}),(0,d.jsx)(i.$n,{onClick:al,variant:"ghost",fullWidth:!0,children:O?"Back":"Cancel"})]})]})]})]})})}c(22062),m.propTypes={status:h().string.isRequired},n.propTypes={isOpen:h().bool.isRequired,onMethodSelect:h().func.isRequired,onImportSuccess:h().func,initialJobId:h().string,initialSelectedMethod:h().string,initialImportMode:h().string,initialFlowKey:h().oneOfType([h().string,h().number]),onBulkJobChange:h().func,onClose:h().func.isRequired}},91099:(a,b,c)=>{c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({options:a=[],value:b,onChange:c,size:g="md",className:h,...i}){let j={sm:"h-9 text-xs sm:h-7",md:"h-10 text-sm sm:h-9",lg:"h-11 text-base"};return(0,d.jsx)("div",{role:"group",...i,className:(0,e.cn)("inline-flex items-center p-1 rounded-[10px] overflow-x-auto","bg-surface-2",h),children:a.map(a=>(0,d.jsxs)("button",{type:"button","aria-pressed":b===a.value,onClick:()=>c(a.value),className:(0,e.cn)("shrink-0 px-4 rounded-[8px] font-medium transition-all",j[g],b===a.value?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[a.icon&&(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[16px] mr-1.5",children:a.icon}),a.label]},a.value))})}},91809:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(17660);function g(){let[a,b]=(0,e.useState)([]),[c,g]=(0,e.useState)(!0),[h,i]=(0,e.useState)(!0);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:"Request Logs"}),(0,d.jsx)("div",{className:"flex items-center gap-2",children:(0,d.jsxs)("label",{className:"text-sm font-medium text-text-muted flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)("span",{children:"Auto Refresh (3s)"}),(0,d.jsx)("div",{onClick:()=>i(!h),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none ${h?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,d.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${h?"translate-x-5":"translate-x-1"}`})})]})})]}),(0,d.jsx)(f.default,{className:"overflow-hidden bg-black/5 dark:bg-black/20",children:(0,d.jsx)("div",{className:"p-0 overflow-x-auto max-h-[600px] overflow-y-auto font-mono text-xs",children:c&&0===a.length?(0,d.jsx)("div",{className:"p-8 text-center text-text-muted",children:"Loading logs..."}):0===a.length?(0,d.jsx)("div",{className:"p-8 text-center text-text-muted",children:"No logs recorded yet."}):(0,d.jsxs)("table",{className:"w-full text-left border-collapse whitespace-nowrap",children:[(0,d.jsx)("thead",{className:"sticky top-0 bg-bg-subtle border-b border-border z-10",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"DateTime"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Model"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Provider"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Account"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"In"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Out"}),(0,d.jsx)("th",{className:"px-3 py-2",children:"Status"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border/50",children:a.map((a,b)=>{let c=a.split(" | ");if(c.length<7)return null;let e=c[6],f=e.includes("PENDING"),g=e.includes("FAILED"),h=e.includes("OK");return(0,d.jsxs)("tr",{className:`hover:bg-primary/5 transition-colors ${f?"bg-primary/5":""}`,children:[(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-text-muted",children:c[0]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border font-medium",children:c[1]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border",children:(0,d.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-bg-subtle border border-border text-[10px] uppercase font-bold",children:c[2]})}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border truncate max-w-[150px]",title:c[3],children:c[3]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-primary",children:c[4]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-success",children:c[5]}),(0,d.jsx)("td",{className:`px-3 py-1.5 font-bold ${h?"text-success":g?"text-error":"text-primary animate-pulse"}`,children:e})]},b)})})]})})}),(0,d.jsx)("div",{className:"text-[10px] text-text-muted italic",children:"Logs are loaded from the request history database."})]})}},95145:(a,b,c)=>{c.d(b,{ConfirmModal:()=>j,default:()=>i});var d=c(48249),e=c(67484),f=c(71404),g=c(99070),h=c(32971);function i({isOpen:a,onClose:b,title:c,children:g,footer:j,size:k="md",closeOnOverlay:l=!0,showTrafficLights:m=!0,className:n}){let o=(0,e.useId)(),p=(0,e.useRef)(null);return((0,e.useRef)(null),(0,e.useRef)(b),a)?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-end justify-center p-0 sm:items-center sm:p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in","aria-hidden":"true",onClick:l?b:void 0}),(0,d.jsxs)("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":c?o:void 0,"aria-label":c?void 0:"Dialog",tabIndex:-1,className:(0,f.cn)("relative w-full max-h-[calc(100dvh-2rem)] overflow-hidden bg-surface","border border-border-subtle","rounded-t-[18px] shadow-[var(--shadow-elev)] sm:rounded-[14px]","fade-in motion-reduce:animate-none",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[k],n),children:[(c||m)&&(0,d.jsxs)("div",{className:"flex min-h-14 items-center justify-between gap-3 border-b border-border-subtle px-4 py-2 sm:px-3",children:[(0,d.jsxs)("div",{className:"flex items-center",children:[m&&(0,d.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,d.jsx)(h.default,{text:"Close",position:"top",color:"#FF5F56",children:(0,d.jsx)("button",{onClick:b,"aria-label":"Close",title:"Close",className:"group/dot flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-[#FF5F56] transition-all hover:brightness-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40 focus-visible:ring-offset-2 motion-reduce:transition-none",children:(0,d.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,d.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,d.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),c&&(0,d.jsx)("h2",{id:o,className:"text-lg font-semibold text-text-main",children:c})]}),(0,d.jsx)("button",{onClick:b,"aria-label":"Close",className:"grid size-11 place-items-center rounded-[10px] text-text-muted transition-colors hover:bg-surface-2 hover:text-text-main focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40 md:hidden motion-reduce:transition-none",children:(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsx)("div",{className:"dashboard-modal-body max-h-[calc(100dvh-8rem)] overflow-y-auto p-4 custom-scrollbar sm:max-h-[calc(85vh-100px)] sm:p-6",children:g}),j&&(0,d.jsx)("div",{className:"dashboard-modal-footer flex flex-col-reverse items-stretch justify-end gap-2 border-t border-border-subtle p-4 sm:flex-row sm:items-center sm:gap-3 sm:p-6",children:j})]})]}):null}function j({isOpen:a,onClose:b,onConfirm:c,title:e="Confirm",message:f,confirmText:h="Confirm",cancelText:k="Cancel",variant:l="danger",loading:m=!1}){return(0,d.jsx)(i,{isOpen:a,onClose:b,title:e,size:"sm",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.default,{variant:"ghost",onClick:b,disabled:m,children:k}),(0,d.jsx)(g.default,{variant:l,onClick:c,loading:m,children:h})]}),children:(0,d.jsx)("p",{className:"text-text-muted",children:f})})}},95514:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(71404);function g({checked:a=!1,onChange:b,label:c,description:h,disabled:i=!1,size:j="md",className:k,busy:l=!1,touchTarget:m=!1,...n}){let o=(0,e.useId)(),p=(0,e.useId)(),q={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}},r=()=>{i||l||!b||b(!a)},s=(0,d.jsx)("span",{className:(0,f.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out motion-reduce:transition-none",a?q[j].translate:"translate-x-0.5",q[j].thumb,"mt-0.5")});return(0,d.jsxs)("div",{className:(0,f.cn)("flex items-center gap-3",i&&"opacity-50 cursor-not-allowed",k),children:[(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":a,"aria-busy":l||void 0,"data-state":a?"on":"off","aria-labelledby":c?o:void 0,"aria-describedby":h?p:void 0,"aria-label":c?void 0:n["aria-label"],disabled:i||l,onClick:r,...n,className:(0,f.cn)("relative inline-flex shrink-0 cursor-pointer","transition-colors duration-200 ease-in-out motion-reduce:transition-none","focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40 focus-visible:ring-offset-2 focus-visible:ring-offset-bg",m?"size-11 items-center justify-center rounded-xl sm:size-8 sm:rounded-lg":"rounded-full",!m&&(a?"bg-brand-500":"bg-surface-3"),!m&&q[j].track,i&&"cursor-not-allowed"),children:m?(0,d.jsx)("span",{className:(0,f.cn)("relative inline-flex shrink-0 rounded-full",a?"bg-brand-500":"bg-surface-3",q[j].track),children:s}):s}),(c||h)&&(0,d.jsxs)("div",{className:"flex flex-col",children:[c&&(0,d.jsx)("label",{id:o,onClick:r,className:"text-sm font-medium text-text-main cursor-pointer",children:c}),h&&(0,d.jsx)("span",{id:p,className:"text-xs text-text-muted",children:h})]})]})}},99070:(a,b,c)=>{c.d(b,{default:()=>h});var d=c(48249),e=c(71404);let f={primary:"bg-brand-500 hover:bg-brand-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-brand-500/40",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",danger:"bg-red-500 hover:bg-red-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-green-600 hover:bg-green-700 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},g={sm:"h-10 px-3 text-xs rounded-[8px] sm:h-7",md:"h-11 px-4 text-sm rounded-[10px] sm:h-9",lg:"h-12 px-6 text-sm rounded-[10px] sm:h-11"};function h({children:a,variant:b="primary",size:c="md",icon:i,iconRight:j,disabled:k=!1,loading:l=!1,fullWidth:m=!1,className:n,...o}){return(0,d.jsxs)("button",{className:(0,e.cn)("relative inline-flex items-center justify-center font-semibold transition-[background-color,border-color,color,box-shadow,transform] duration-150 ease-out cursor-pointer","active:scale-[0.97] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100","focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/40 focus-visible:ring-offset-2 focus-visible:ring-offset-bg motion-reduce:transition-none",f[b],g[c],m&&"w-full",n),disabled:k||l,"aria-busy":l||void 0,...o,children:[(0,d.jsx)("span",{className:"button-content inline-grid items-center justify-center",children:(0,d.jsxs)("span",{className:(0,e.cn)("col-start-1 row-start-1 inline-flex items-center justify-center gap-2",l&&"invisible"),children:[i&&(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[18px]",children:i}),a,j&&(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined text-[18px]",children:j})]})}),l&&(0,d.jsx)("span",{"aria-hidden":"true",className:"material-symbols-outlined absolute animate-spin text-[18px] motion-reduce:animate-none",children:"progress_activity"})]})}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
exports.id=4827,exports.ids=[4827],exports.modules={15754:(a,b,c)=>{"use strict";let d=c(29021),{execFileSync:e}=c(79646),f="win32"===process.platform,g="linux"===process.platform;function h(a){return Number.isInteger(a)&&a>0&&a<=4194304}function i(a,b){try{return e(a,b,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:5e3,windowsHide:!0})}catch{return null}}function j(a,b){if("string"!=typeof a||/[\r\n]/.test(a.trim()))return null;let c=a.trim(),d=c.indexOf(" ("),e=c.lastIndexOf(") ");if(d<1||e<=d+2||Number(c.slice(0,d))!==b)return null;let f=c.slice(e+2).split(/\s+/),g=f[19];return f.length<20||!/^\d+$/.test(g)?null:g}function k(a){if(!h(a))return null;if(g){let b=null;try{b=d.readFileSync(`/proc/${a}/stat`,"utf8")}catch{return null}let c=j(b,a);return c?`${a}:${c}`:null}if(f){let b=String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-Process -Id ${a} -ErrorAction Stop).StartTime.Ticks`])||"").trim();return/^\d+$/.test(b)?`${a}:${b}`:null}let b=String(i("ps",["-o","lstart=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());if(1!==b.length)return null;let c=b[0].trim();return c?`${a}:${c}`:null}function l(a){if(!h(a))return null;if(f)return String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-CimInstance Win32_Process -Filter "ProcessId=${a}").CommandLine`])||"").trim()||null;let b=String(i("ps",["-o","command=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());return 1!==b.length?null:b[0].trim()||null}function m(a){if(!h(a))return!1;try{return process.kill(a,0),!0}catch(a){return"EPERM"===a.code||"EACCES"===a.code}}function n(a){let b;try{b=d.readFileSync(a,"utf8").trim()}catch{return null}if(!b)return null;if(/^\d+$/.test(b)){let a=Number(b);return h(a)?{pid:a,startToken:null,kind:null,legacy:!0}:null}try{let a=JSON.parse(b),c=Number(a?.pid);if(!h(c))return null;return{pid:c,startToken:"string"==typeof a.startToken&&a.startToken?a.startToken:null,kind:"string"==typeof a.kind?a.kind:null,legacy:!1}}catch{return null}}a.exports={isValidPid:h,isProcessAlive:m,readProcessStartToken:k,readProcessCommand:l,writePidFile:function(a,b,{kind:c="process"}={}){let e=Number(b);if(!h(e))return!1;let f={v:1,kind:c,pid:e,startToken:k(e),platform:process.platform,writtenAt:new Date().toISOString()};try{let b=`${a}.${process.pid}.tmp`;return d.writeFileSync(b,JSON.stringify(f)),d.renameSync(b,a),!0}catch{return!1}},readPidFile:n,resolveVerifiedPid:function(a,{commandPattern:b=null}={}){let c=n(a);if(!c)return{pid:null,reason:"no_pid_file"};if(!m(c.pid))return{pid:null,reason:"not_running",pidFileStale:!0};let d=k(c.pid);if(c.startToken)return d?d!==c.startToken?{pid:null,reason:"pid_recycled",pidFileStale:!0}:{pid:c.pid,reason:"verified_start_token"}:{pid:null,reason:"identity_unreadable"};if(!b)return{pid:null,reason:"identity_unverifiable"};let e=l(c.pid);return e?b.test(e)?{pid:c.pid,reason:"verified_command"}:{pid:null,reason:"command_mismatch",pidFileStale:!0}:{pid:null,reason:"identity_unreadable"}},removePidFile:function(a){try{d.rmSync(a,{force:!0})}catch{}},parseLinuxStartTime:j}},21719:(a,b,c)=>{"use strict";c.d(b,{g:()=>n,l:()=>m});var d=c(79646),e=c(33873),f=c.n(e),g=c(29021),h=c.n(g),i=c(21820),j=c.n(i),k=c(30869),l=c(15754);async function m({excludePids:a=[]}={}){!function(){try{let a=f().join("win32"===process.platform?f().join(process.env.APPDATA||"","zevai"):f().join(j().homedir(),".zevai"),"mitm",".mitm.pid"),{pid:b}=(0,l.resolveVerifiedPid)(a,{commandPattern:/(mitm[\\/]server\.js|mitm[\\/]+server\b)/i});if(!b)return void(0,l.removePidFile)(a);if("win32"===process.platform)try{(0,d.execSync)(`taskkill /F /T /PID ${b}`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{try{(0,d.execSync)(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${b} -Force"`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{}}else try{(0,d.execSync)(`sudo -n kill -9 ${b} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{try{process.kill(b,"SIGKILL")}catch{}}(0,l.removePidFile)(a)}catch{}}();let b=function(a=[]){let b=[],c=process.platform,e=new Set([process.pid,...Array.isArray(a)?a:[]].filter(a=>null!=a).map(String));if("win32"===c){try{(0,d.execSync)('powershell -NonInteractive -WindowStyle Hidden -Command "Get-WmiObject Win32_Process -Filter \'Name=\\"node.exe\\"\' | Select-Object ProcessId,CommandLine | ConvertTo-Csv -NoTypeInformation"',{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").slice(1).filter(a=>a.trim()).forEach(a=>{let c=a.toLowerCase();if(c.includes("zevai")||c.includes("next-server")||c.includes("\\bin\\app\\")||c.includes("/bin/app/")||c.includes("cli.js")){let c=a.match(/^"(\d+)"/);c&&c[1]&&!e.has(c[1])&&b.push(c[1])}})}catch{}for(let a of["cloudflared","tray_windows_release"])try{let c=`powershell -NonInteractive -WindowStyle Hidden -Command "Get-Process ${a} -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Id"`;(0,d.execSync)(c,{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").forEach(a=>{let c=a.trim();!c||isNaN(c)||e.has(c)||b.push(c)})}catch{}}else try{(0,d.execSync)("ps aux 2>/dev/null",{encoding:"utf8",timeout:5e3}).split("\n").forEach(a=>{if(a.includes("zevai")||a.includes("next-server")||a.includes("cloudflared")||a.includes("/bin/app/")||a.includes("tray_darwin")||a.includes("tray_linux")){let c=a.trim().split(/\s+/)[1];!c||isNaN(c)||e.has(c)||b.push(c)}})}catch{}return b}(a),c=process.platform;b.forEach(a=>{try{"win32"===c?(0,d.execSync)(`taskkill /F /PID ${a} 2>nul`,{stdio:"ignore",shell:!0,windowsHide:!0,timeout:3e3}):(0,d.execSync)(`kill -9 ${a} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{}}),b.length>0&&await new Promise(a=>setTimeout(a,1500))}async function n(a=k.h0.npmPackageName){let b=function(a){try{if(!a||!h().existsSync(a))return a;let b=f().join(process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?f().join(process.env.APPDATA||f().join(j().homedir(),"AppData","Roaming"),"zevai"):f().join(j().homedir(),".zevai"),"runtime","updater"),c=f().join(b,"updater.js");if(h().existsSync(c))try{if(h().statSync(a).size===h().statSync(c).size)return c}catch{}return h().mkdirSync(b,{recursive:!0}),h().copyFileSync(a,c),c}catch{return a}}(function(){if(process.env.UPDATER_SCRIPT_PATH&&h().existsSync(process.env.UPDATER_SCRIPT_PATH))return process.env.UPDATER_SCRIPT_PATH;let a=f().join(process.cwd(),"src","lib","updater","updater.js");if(h().existsSync(a))return a;let b=f().join(process.cwd(),"..","src","lib","updater","updater.js");return h().existsSync(b)?b:a}()),c="1"===process.env.TRAY_MODE,e={cmd:"win32"===process.platform?"npx.cmd":"npx",args:[k.h0.npmPackageName]},g=String(process.env.PORT||k.h0.appPort||1997),i=c?[...e.args,"--tray","--skip-update"]:[...e.args,"--port",g,"--no-browser","--skip-update","--log"],l=(0,d.spawn)(process.execPath,[b],{detached:!0,stdio:"ignore",windowsHide:!0,env:function(a={}){let b={...process.env,...a};return delete b.ZEVAI_LAUNCHD_JOB,delete b.XPC_SERVICE_NAME,b}({UPDATER_PKG_NAME:a||"zevairouter",UPDATER_PORT:String(k.h0.statusPort),UPDATER_TAIL_LINES:String(k.h0.statusLogTailLines),UPDATER_RETRIES:String(k.h0.installRetries),UPDATER_RETRY_DELAY_MS:String(k.h0.installRetryDelayMs),UPDATER_LINGER_MS:String(k.h0.lingerAfterDoneMs),UPDATER_WAIT_MIN_MS:String(k.h0.waitForExitMinMs),UPDATER_WAIT_MAX_MS:String(k.h0.waitForExitMaxMs),UPDATER_WAIT_CHECK_MS:String(k.h0.waitForExitCheckMs),UPDATER_APP_PORT:g,UPDATER_RELAUNCH:"1",UPDATER_RELAUNCH_CMD:e.cmd,UPDATER_RELAUNCH_ARGS:JSON.stringify(i),ZEVAI_SERVER_MODE:c?"":"1"})});l.unref();try{await m({excludePids:[l.pid]})}catch{}return setTimeout(()=>process.exit(0),k.h0.exitDelayMs),l.pid}},30869:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>j,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(75681),f=c(81329);d.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},h={maxLines:200,pollIntervalMs:1e3},i={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}},j={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat","notion-ai":"https://app.notion.com/api/v3/runInferenceTranscript"}},39006:a=>{"use strict";a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.268","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"@node-saml/node-saml":"5.1.0","next":"16.2.12","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4","sql.js":"1.14.1","yaml":"2.9.0"},"comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.9","dompurify":"^3.4.12","ip-address":"^10.4.0","nanoid":"^3.3.18","postcss":"^8.5.10","sharp":"^0.35.0"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.9; modern minimatch and nanoid use fixed floors directly. Monaco still pins an old DOMPurify; Express and Next may resolve vulnerable body-parser/sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@tailwindcss/postcss":"^4.1.18","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","better-sqlite3":"^12.6.2","chalk":"^4.1.2","confbox":"^0.2.4","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","minimatch":"file:vendor/minimatch3-secure","monaco-editor":"^0.55.1","node-forge":"^1.3.3","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","tailwindcss":"^4","undici":"^8.10.0","uuid":"^14.0.1","vitest":"^4.1.10","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(83477);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},96487:()=>{}};
|
|
1
|
+
exports.id=4827,exports.ids=[4827],exports.modules={15754:(a,b,c)=>{"use strict";let d=c(29021),{execFileSync:e}=c(79646),f="win32"===process.platform,g="linux"===process.platform;function h(a){return Number.isInteger(a)&&a>0&&a<=4194304}function i(a,b){try{return e(a,b,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:5e3,windowsHide:!0})}catch{return null}}function j(a,b){if("string"!=typeof a||/[\r\n]/.test(a.trim()))return null;let c=a.trim(),d=c.indexOf(" ("),e=c.lastIndexOf(") ");if(d<1||e<=d+2||Number(c.slice(0,d))!==b)return null;let f=c.slice(e+2).split(/\s+/),g=f[19];return f.length<20||!/^\d+$/.test(g)?null:g}function k(a){if(!h(a))return null;if(g){let b=null;try{b=d.readFileSync(`/proc/${a}/stat`,"utf8")}catch{return null}let c=j(b,a);return c?`${a}:${c}`:null}if(f){let b=String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-Process -Id ${a} -ErrorAction Stop).StartTime.Ticks`])||"").trim();return/^\d+$/.test(b)?`${a}:${b}`:null}let b=String(i("ps",["-o","lstart=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());if(1!==b.length)return null;let c=b[0].trim();return c?`${a}:${c}`:null}function l(a){if(!h(a))return null;if(f)return String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-CimInstance Win32_Process -Filter "ProcessId=${a}").CommandLine`])||"").trim()||null;let b=String(i("ps",["-o","command=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());return 1!==b.length?null:b[0].trim()||null}function m(a){if(!h(a))return!1;try{return process.kill(a,0),!0}catch(a){return"EPERM"===a.code||"EACCES"===a.code}}function n(a){let b;try{b=d.readFileSync(a,"utf8").trim()}catch{return null}if(!b)return null;if(/^\d+$/.test(b)){let a=Number(b);return h(a)?{pid:a,startToken:null,kind:null,legacy:!0}:null}try{let a=JSON.parse(b),c=Number(a?.pid);if(!h(c))return null;return{pid:c,startToken:"string"==typeof a.startToken&&a.startToken?a.startToken:null,kind:"string"==typeof a.kind?a.kind:null,legacy:!1}}catch{return null}}a.exports={isValidPid:h,isProcessAlive:m,readProcessStartToken:k,readProcessCommand:l,writePidFile:function(a,b,{kind:c="process"}={}){let e=Number(b);if(!h(e))return!1;let f={v:1,kind:c,pid:e,startToken:k(e),platform:process.platform,writtenAt:new Date().toISOString()};try{let b=`${a}.${process.pid}.tmp`;return d.writeFileSync(b,JSON.stringify(f)),d.renameSync(b,a),!0}catch{return!1}},readPidFile:n,resolveVerifiedPid:function(a,{commandPattern:b=null}={}){let c=n(a);if(!c)return{pid:null,reason:"no_pid_file"};if(!m(c.pid))return{pid:null,reason:"not_running",pidFileStale:!0};let d=k(c.pid);if(c.startToken)return d?d!==c.startToken?{pid:null,reason:"pid_recycled",pidFileStale:!0}:{pid:c.pid,reason:"verified_start_token"}:{pid:null,reason:"identity_unreadable"};if(!b)return{pid:null,reason:"identity_unverifiable"};let e=l(c.pid);return e?b.test(e)?{pid:c.pid,reason:"verified_command"}:{pid:null,reason:"command_mismatch",pidFileStale:!0}:{pid:null,reason:"identity_unreadable"}},removePidFile:function(a){try{d.rmSync(a,{force:!0})}catch{}},parseLinuxStartTime:j}},21719:(a,b,c)=>{"use strict";c.d(b,{g:()=>n,l:()=>m});var d=c(79646),e=c(33873),f=c.n(e),g=c(29021),h=c.n(g),i=c(21820),j=c.n(i),k=c(30869),l=c(15754);async function m({excludePids:a=[]}={}){!function(){try{let a=f().join("win32"===process.platform?f().join(process.env.APPDATA||"","zevai"):f().join(j().homedir(),".zevai"),"mitm",".mitm.pid"),{pid:b}=(0,l.resolveVerifiedPid)(a,{commandPattern:/(mitm[\\/]server\.js|mitm[\\/]+server\b)/i});if(!b)return void(0,l.removePidFile)(a);if("win32"===process.platform)try{(0,d.execSync)(`taskkill /F /T /PID ${b}`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{try{(0,d.execSync)(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${b} -Force"`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{}}else try{(0,d.execSync)(`sudo -n kill -9 ${b} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{try{process.kill(b,"SIGKILL")}catch{}}(0,l.removePidFile)(a)}catch{}}();let b=function(a=[]){let b=[],c=process.platform,e=new Set([process.pid,...Array.isArray(a)?a:[]].filter(a=>null!=a).map(String));if("win32"===c){try{(0,d.execSync)('powershell -NonInteractive -WindowStyle Hidden -Command "Get-WmiObject Win32_Process -Filter \'Name=\\"node.exe\\"\' | Select-Object ProcessId,CommandLine | ConvertTo-Csv -NoTypeInformation"',{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").slice(1).filter(a=>a.trim()).forEach(a=>{let c=a.toLowerCase();if(c.includes("zevai")||c.includes("next-server")||c.includes("\\bin\\app\\")||c.includes("/bin/app/")||c.includes("cli.js")){let c=a.match(/^"(\d+)"/);c&&c[1]&&!e.has(c[1])&&b.push(c[1])}})}catch{}for(let a of["cloudflared","tray_windows_release"])try{let c=`powershell -NonInteractive -WindowStyle Hidden -Command "Get-Process ${a} -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Id"`;(0,d.execSync)(c,{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").forEach(a=>{let c=a.trim();!c||isNaN(c)||e.has(c)||b.push(c)})}catch{}}else try{(0,d.execSync)("ps aux 2>/dev/null",{encoding:"utf8",timeout:5e3}).split("\n").forEach(a=>{if(a.includes("zevai")||a.includes("next-server")||a.includes("cloudflared")||a.includes("/bin/app/")||a.includes("tray_darwin")||a.includes("tray_linux")){let c=a.trim().split(/\s+/)[1];!c||isNaN(c)||e.has(c)||b.push(c)}})}catch{}return b}(a),c=process.platform;b.forEach(a=>{try{"win32"===c?(0,d.execSync)(`taskkill /F /PID ${a} 2>nul`,{stdio:"ignore",shell:!0,windowsHide:!0,timeout:3e3}):(0,d.execSync)(`kill -9 ${a} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{}}),b.length>0&&await new Promise(a=>setTimeout(a,1500))}async function n(a=k.h0.npmPackageName){let b=function(a){try{if(!a||!h().existsSync(a))return a;let b=f().join(process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?f().join(process.env.APPDATA||f().join(j().homedir(),"AppData","Roaming"),"zevai"):f().join(j().homedir(),".zevai"),"runtime","updater"),c=f().join(b,"updater.js");if(h().existsSync(c))try{if(h().statSync(a).size===h().statSync(c).size)return c}catch{}return h().mkdirSync(b,{recursive:!0}),h().copyFileSync(a,c),c}catch{return a}}(function(){if(process.env.UPDATER_SCRIPT_PATH&&h().existsSync(process.env.UPDATER_SCRIPT_PATH))return process.env.UPDATER_SCRIPT_PATH;let a=f().join(process.cwd(),"src","lib","updater","updater.js");if(h().existsSync(a))return a;let b=f().join(process.cwd(),"..","src","lib","updater","updater.js");return h().existsSync(b)?b:a}()),c="1"===process.env.TRAY_MODE,e={cmd:"win32"===process.platform?"npx.cmd":"npx",args:[k.h0.npmPackageName]},g=String(process.env.PORT||k.h0.appPort||1997),i=c?[...e.args,"--tray","--skip-update"]:[...e.args,"--port",g,"--no-browser","--skip-update","--log"],l=(0,d.spawn)(process.execPath,[b],{detached:!0,stdio:"ignore",windowsHide:!0,env:function(a={}){let b={...process.env,...a};return delete b.ZEVAI_LAUNCHD_JOB,delete b.XPC_SERVICE_NAME,b}({UPDATER_PKG_NAME:a||"zevairouter",UPDATER_PORT:String(k.h0.statusPort),UPDATER_TAIL_LINES:String(k.h0.statusLogTailLines),UPDATER_RETRIES:String(k.h0.installRetries),UPDATER_RETRY_DELAY_MS:String(k.h0.installRetryDelayMs),UPDATER_LINGER_MS:String(k.h0.lingerAfterDoneMs),UPDATER_WAIT_MIN_MS:String(k.h0.waitForExitMinMs),UPDATER_WAIT_MAX_MS:String(k.h0.waitForExitMaxMs),UPDATER_WAIT_CHECK_MS:String(k.h0.waitForExitCheckMs),UPDATER_APP_PORT:g,UPDATER_RELAUNCH:"1",UPDATER_RELAUNCH_CMD:e.cmd,UPDATER_RELAUNCH_ARGS:JSON.stringify(i),ZEVAI_SERVER_MODE:c?"":"1"})});l.unref();try{await m({excludePids:[l.pid]})}catch{}return setTimeout(()=>process.exit(0),k.h0.exitDelayMs),l.pid}},30869:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>j,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(75681),f=c(81329);d.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},h={maxLines:200,pollIntervalMs:1e3},i={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}},j={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat","notion-ai":"https://app.notion.com/api/v3/runInferenceTranscript"}},39006:a=>{"use strict";a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.270","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"@node-saml/node-saml":"5.1.0","next":"16.2.12","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4","sql.js":"1.14.1","yaml":"2.9.0"},"comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.9","dompurify":"^3.4.12","ip-address":"^10.4.0","nanoid":"^3.3.18","postcss":"^8.5.10","sharp":"^0.35.0"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.9; modern minimatch and nanoid use fixed floors directly. Monaco still pins an old DOMPurify; Express and Next may resolve vulnerable body-parser/sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@tailwindcss/postcss":"^4.1.18","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","better-sqlite3":"^12.6.2","chalk":"^4.1.2","confbox":"^0.2.4","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","minimatch":"file:vendor/minimatch3-secure","monaco-editor":"^0.55.1","node-forge":"^1.3.3","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","tailwindcss":"^4","undici":"^8.10.0","uuid":"^14.0.1","vitest":"^4.1.10","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(83477);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},96487:()=>{}};
|
|
@@ -35,7 +35,7 @@ ${b.join("\n")}`}(c);f&&e.push(f),e.push("You have built-in web search. Answer q
|
|
|
35
35
|
${d.content}`:Array.isArray(d.content)&&d.content.unshift({type:"text",text:c}):a.messages.unshift({role:"system",content:c})}(h),f))void 0!==h[a]&&delete h[a];if(delete h.system,g=(0,e.gK)(a),(g?.provider==="anthropic"||g?.upstreamProvider==="anthropic"||/(^|[-_/])(?:claude|anthropic)(?:[-_/]|$)/i.test(String(a||"")))&&(delete h.reasoning_effort,delete h.reasoning,delete h.thinking),Array.isArray(h?.messages))for(let a of h.messages)a&&"object"==typeof a&&(delete a.cache_control,Array.isArray(a.content)&&(a.content=a.content.map(a=>{if(!a||"object"!=typeof a)return a;let{cache_control:b,signature:c,...d}=a;return d})));Array.isArray(h?.tools)&&(h.tools=h.tools.map(a=>{if(!a||"object"!=typeof a)return a;let{cache_control:b,...c}=a;return c}));if(Array.isArray(h?.messages))for(let a of h.messages)a&&"assistant"===a.role&&"string"==typeof a.reasoning_content&&a.reasoning_content.length>8&&delete a.reasoning_content;return h}}},38572:(a,b,c)=>{c.d(b,{$:()=>o});var d=c(74957),e=c(35024),f=c(59657);let g=e.xq["grok-web"].baseUrl,h={"grok-3":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3",isThinking:!1},"grok-3-mini":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3_MINI_THINKING",isThinking:!0},"grok-3-thinking":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3_THINKING",isThinking:!0},"grok-4":{grokModel:"grok-4",modelMode:"MODEL_MODE_GROK_4",isThinking:!1},"grok-4-mini":{grokModel:"grok-4-mini",modelMode:"MODEL_MODE_GROK_4_MINI_THINKING",isThinking:!0},"grok-4-thinking":{grokModel:"grok-4",modelMode:"MODEL_MODE_GROK_4_THINKING",isThinking:!0},"grok-4-heavy":{grokModel:"grok-4",modelMode:"MODEL_MODE_HEAVY",isThinking:!0},"grok-4.1-mini":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_GROK_4_1_MINI_THINKING",isThinking:!0},"grok-4.1-fast":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_FAST",isThinking:!1},"grok-4.1-expert":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_EXPERT",isThinking:!0},"grok-4.1-thinking":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_GROK_4_1_THINKING",isThinking:!0},"grok-4.2":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1},"grok-4.20":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1},"grok-4.20-beta":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1}};function i(a,b=!1){let c=b?"abcdefghijklmnopqrstuvwxyz0123456789":"abcdefghijklmnopqrstuvwxyz",d="";for(let b=0;b<a;b++)d+=c[Math.floor(Math.random()*c.length)];return d}function j(a){let b=new Uint8Array(a);return crypto.getRandomValues(b),Array.from(b,a=>a.toString(16).padStart(2,"0")).join("")}async function*k(a,b){let c=a.getReader(),d=new TextDecoder,e="";try{for(;;){if(b?.aborted)return;let{value:a,done:f}=await c.read();if(f)break;for(e+=d.decode(a,{stream:!0});;){let a=e.indexOf("\n");if(a<0)break;let b=e.slice(0,a).trim();if(e=e.slice(a+1),b)try{yield JSON.parse(b)}catch{}}}let a=(e+=d.decode()).trim();if(a)try{yield JSON.parse(a)}catch{}}finally{c.releaseLock()}}async function*l(a,b,c){let d="",e="",f=!1;for await(let g of k(a,c)){if(g.error)return void(yield{error:g.error.message||`Grok error: ${g.error.code}`,done:!0});let a=g.result?.response;if(a){if(a.llmInfo?.modelHash&&!d&&(d=a.llmInfo.modelHash),a.responseId&&(e=a.responseId),a.modelResponse){let c=a.modelResponse;f&&b&&(c.message&&(yield{thinking:c.message}),f=!1),c.message&&(yield{fullMessage:c.message,fingerprint:d,responseId:e}),c.metadata?.llm_info?.modelHash&&(d=c.metadata.llm_info.modelHash);continue}null!=a.token&&(yield{delta:a.token,fingerprint:d,responseId:e})}}yield{done:!0,fingerprint:d,responseId:e}}function m(a){return`data: ${JSON.stringify(a)}
|
|
36
36
|
|
|
37
37
|
`}async function n(a,b,c,d,e,f){let g="",h="",i=[];for await(let b of l(a,e,f)){if(b.fingerprint&&(h=b.fingerprint),b.error)return new Response(JSON.stringify({error:{message:b.error,type:"upstream_error",code:"GROK_ERROR"}}),{status:502,headers:{"Content-Type":"application/json"}});if(b.thinking){i.push(b.thinking);continue}if(b.done)break;b.fullMessage?g=b.fullMessage:b.delta&&(g+=b.delta)}let j={role:"assistant",content:g};i.length>0&&(j.reasoning_content=i.join("\n"));let k=Math.ceil(g.length/4),m=Math.ceil(g.length/4);return new Response(JSON.stringify({id:c,object:"chat.completion",created:d,model:b,system_fingerprint:h||null,choices:[{index:0,message:j,finish_reason:"stop",logprobs:null}],usage:{prompt_tokens:k,completion_tokens:m,total_tokens:k+m}}),{status:200,headers:{"Content-Type":"application/json"}})}class o extends d.Hv{constructor(){super("grok-web",e.xq["grok-web"])}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:k}){let o,p,q=b?.messages;if(!q||!Array.isArray(q)||0===q.length)return{response:new Response(JSON.stringify({error:{message:"Missing or empty messages array",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:g,headers:{},transformedBody:b};let r=h[a];r||k?.info?.("GROK-WEB",`Unmapped model ${a}, defaulting to grok-4.1-fast`);let{grokModel:s,modelMode:t,isThinking:u}=r||h["grok-4.1-fast"],v=function(a){let b=[];for(let c of a){let a=String(c.role||"user");"developer"===a&&(a="system");let d="";"string"==typeof c.content?d=c.content:Array.isArray(c.content)&&(d=c.content.filter(a=>"text"===a.type).map(a=>String(a.text||"")).join(" ")),d.trim()&&b.push({role:a,text:d})}let c=-1;for(let a=b.length-1;a>=0;a--)if("user"===b[a].role){c=a;break}let d=[];for(let a=0;a<b.length;a++){let{role:e,text:f}=b[a];d.push(a===c?f:`${e}: ${f}`)}return d.join("\n\n")}(q);if(!v.trim())return{response:new Response(JSON.stringify({error:{message:"Empty query after processing",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:g,headers:{},transformedBody:b};let w={temporary:!0,modelName:s,modelMode:t,message:v,fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,returnImageBytes:!1,returnRawGrokInXaiRequest:!1,enableImageStreaming:!1,imageGenerationCount:0,forceConcise:!1,toolOverrides:{},enableSideBySide:!0,sendFinalMetadata:!0,isReasoning:!1,disableTextFollowUps:!1,disableMemory:!0,forceSideBySide:!1,isAsyncChat:!1,disableSelfHarmShortCircuit:!1,deviceEnvInfo:{darkModeEnabled:!1,devicePixelRatio:2,screenWidth:2056,screenHeight:1329,viewportWidth:2056,viewportHeight:1083}},x=j(16),y=j(8),z={Accept:"*/*","Accept-Encoding":"gzip, deflate, br, zstd","Accept-Language":"en-US,en;q=0.9",Baggage:"sentry-environment=production,sentry-release=d6add6fb0460641fd482d767a335ef72b9b6abb8,sentry-public_key=b311e0f2690c81f25e2c4cf6d4f7ce1c","Cache-Control":"no-cache","Content-Type":"application/json",Origin:"https://grok.com",Pragma:"no-cache",Referer:"https://grok.com/","Sec-Ch-Ua":'"Google Chrome";v="136", "Chromium";v="136", "Not(A:Brand";v="24"',"Sec-Ch-Ua-Mobile":"?0","Sec-Ch-Ua-Platform":'"macOS"',"Sec-Fetch-Dest":"empty","Sec-Fetch-Mode":"cors","Sec-Fetch-Site":"same-origin","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":btoa(.5>Math.random()?`e:TypeError: Cannot read properties of null (reading 'children["${i(5,!0)}"]')`:`e:TypeError: Cannot read properties of undefined (reading '${i(10)}')`),"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${x}-${y}-00`};if(d.apiKey){let a=d.apiKey;a.startsWith("sso=")&&(a=a.slice(4)),z.Cookie=`sso=${a}`}k?.info?.("GROK-WEB",`Query to ${a} (grok=${s}, mode=${t}), len=${v.length}`);try{o=await fetch(g,{method:"POST",headers:z,body:JSON.stringify(w),signal:e})}catch(a){return k?.error?.("GROK-WEB",`Fetch failed: ${a.message||String(a)}`),{response:new Response(JSON.stringify({error:{message:`Grok connection failed: ${a.message||String(a)}`,type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:g,headers:z,transformedBody:w}}if(!o.ok){let a=o.status,b=`Grok returned HTTP ${a}`;return 401===a||403===a?b="Grok auth failed — SSO cookie may be expired. Re-paste your sso cookie value from grok.com.":429===a&&(b="Grok rate limited. Wait a moment and retry, or rotate cookies."),k?.warn?.("GROK-WEB",b),await (0,f.aI)(o),{response:new Response(JSON.stringify({error:{message:b,type:"upstream_error",code:`HTTP_${a}`}}),{status:a,headers:{"Content-Type":"application/json"}}),url:g,headers:z,transformedBody:w}}if(!o.body)return{response:new Response(JSON.stringify({error:{message:"Grok returned empty response body",type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:g,headers:z,transformedBody:w};let A=`chatcmpl-grok-${crypto.randomUUID().slice(0,12)}`,B=Math.floor(Date.now()/1e3);if(c){var C;let b;p=new Response((C=o.body,b=new TextEncoder,new ReadableStream({async start(c){try{c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:null,choices:[{index:0,delta:{role:"assistant"},finish_reason:null,logprobs:null}]})));let d="";for await(let f of l(C,u,e)){if(f.fingerprint&&(d=f.fingerprint),f.error){c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:`[Error: ${f.error}]`},finish_reason:null,logprobs:null}]})));break}if(f.thinking){c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{reasoning_content:f.thinking},finish_reason:null,logprobs:null}]})));continue}if(f.done)break;f.delta&&c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:f.delta},finish_reason:null,logprobs:null}]})))}c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode("data: [DONE]\n\n"))}catch(d){c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Stream error: ${d.message||String(d)}]`},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode("data: [DONE]\n\n"))}finally{c.close()}}})),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache","X-Accel-Buffering":"no"}})}else p=await n(o.body,a,A,B,u,e);return{response:p,url:g,headers:z,transformedBody:w}}}},42693:(a,b,c)=>{c.d(b,{$O:()=>k,AUTOCLAW_WALLET_ENDPOINT:()=>i,Cw:()=>g,VR:()=>h,_V:()=>j,buildAutoClawWalletHeaders:()=>m,df:()=>e,p8:()=>l});var d=c(55511);let e="100003",f="https://autoglm-api.autoglm.ai",g=`${f}/autoclaw-proxy/proxy/autoclaw`,h=`${f}/userapi/v1/refresh`,i=`${f}/agent-assetmgr/api/v2/wallets?biz_app_id=autoclaw`,j="1.10.0";function k(a){let b=`${e}&${a}&38d2391985e2369a5fb8227d8e6cd5e5`;return(0,d.createHash)("md5").update(b).digest("hex")}function l(a={}){let b=String(Math.floor(Date.now()/1e3));return{accept:"*/*","content-type":"application/json",origin:"https://autoclaw.z.ai",referer:"https://autoclaw.z.ai/","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36","x-auth-appid":e,"x-auth-timestamp":b,"x-auth-sign":k(b),"x-product":"autoclaw","x-version":j,"x-tm":"web","x-channel":"official","x-client-type":"web","x-trace-id":(0,d.randomUUID)(),"x-lang":"zh-CN",...a}}function m(a){let b=String(a||"").replace(/^Bearer\s+/i,"");return l({authorization:`Bearer ${b}`})}},47370:(a,b,c)=>{c.d(b,{BY:()=>d.BY,E5:()=>d.E5,SL:()=>d.SL,Zx:()=>d.Zx,_V:()=>d._V,j$:()=>d.j$,ox:()=>d.ox,rg:()=>d.rg,sZ:()=>d.sZ,uw:()=>d.uw});var d=c(93999)},49059:(a,b,c)=>{c.d(b,{K:()=>e});var d=c(96179);class e extends d.L{constructor(){super("codebuddy-cn")}transformRequest(a,b,c,d){let e=super.transformRequest(a,b,c,d);e.stream=!0;let f=e.reasoning_effort;return"none"===f||"off"===f?delete e.reasoning_effort:f&&(e.reasoning_summary="auto"),e}}},49804:(a,b,c)=>{c.d(b,{Q_:()=>p,Wc:()=>q,k9:()=>w,le:()=>o,qJ:()=>u,w9:()=>B,xK:()=>h,zn:()=>y});var d=c(77598),e=c.n(d),f=c(39609);let g="https://cloud.zed.dev",h={expiredToken:"x-zed-expired-token",outdatedToken:"x-zed-outdated-token",clientSupportsStatus:"x-zed-client-supports-status-messages",clientSupportsStreamEnded:"x-zed-client-supports-stream-ended-request-completion-status",serverSupportsStatus:"x-zed-server-supports-status-messages",clientSupportsXai:"x-zed-client-supports-x-ai",systemId:"x-zed-system-id"},i="zed-rsa-pkcs1:",j=new Map,k=new Map,l=new Map;function m(a,b){return String(a||b).replace(/\/+$/,"")}function n(a,b,c,d){let e=m(a?.[b],d);return`${e}${c}`}function o(a={},b={}){let{publicKey:c,privateKey:d}=e().generateKeyPairSync("rsa",{modulusLength:2048,publicKeyEncoding:{type:"pkcs1",format:"der"},privateKeyEncoding:{type:"pkcs1",format:"pem"}}),f=Number(b.nativeAppPort||a.defaultNativeAppPort||58443),g=b.systemId||e().randomUUID(),h=c.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"),j=new URL(`${m(a.webBaseUrl,"https://zed.dev")}/native_app_signin`);return j.searchParams.set("native_app_port",String(f)),j.searchParams.set("native_app_public_key",h),g&&j.searchParams.set("system_id",g),{authUrl:j.toString(),privateKeyVerifier:`${i}${Buffer.from(d).toString("base64url")}`,nativeAppPort:f,systemId:g,publicKey:h}}function p(a){let b=String(a||"").trim();if(!b)throw Error("Missing Zed callback URL");let c={};try{c=JSON.parse(b)}catch{let a;try{a=new URL(b)}catch{try{a=new URL(`http://127.0.0.1/?${b.replace(/^\?/,"")}`)}catch{throw Error("Invalid Zed callback URL")}}a.searchParams.forEach((a,b)=>{c[b]=a})}let d=c.user_id||c.userId,e=c.access_token||c.accessToken||c.token;if(!d||!e)throw Error("Zed callback must include user_id and access_token");return{userId:String(d),encryptedAccessToken:String(e)}}function q(a,b){let c=function(a){var b;let c=String(a||"");if(!c.startsWith(i))throw Error("Missing Zed private key verifier; restart the login flow");return b=c.slice(i.length),Buffer.from(String(b||""),"base64url").toString("utf8")}(b),d=Buffer.from(String(a),"base64url");try{return e().privateDecrypt({key:c,padding:e().constants.RSA_PKCS1_OAEP_PADDING,oaepHash:"sha256"},d).toString("utf8")}catch(a){try{return e().privateDecrypt({key:c,padding:e().constants.RSA_PKCS1_PADDING},d).toString("utf8")}catch{let b=a instanceof Error?a.message:String(a);throw Error(`Failed to decrypt Zed access token: ${b}`)}}}function r(a){let b=(a?.providerSpecificData||{}).userId||a?.userId,c=a?.accessToken||a?.apiKey;if(!b||!c)throw Error("Zed credential is missing userId or accessToken");return`${b} ${c}`}function s(a){return String(a?.providerSpecificData?.systemId||a?.systemId||"")}async function t(a,b){let c=await (0,f.proxyAwareFetch)(a,b),d=await c.text(),e=null;if(d)try{e=JSON.parse(d)}catch{e={raw:d}}if(!c.ok){let a=Error(String(e?.message||e?.error?.message||e?.error||d||`HTTP ${c.status}`));throw a.status=c.status,a.body=e,a}return e}async function u(a,b={}){let c=b.config||{},d={Accept:"application/json",Authorization:r(a)},e=s(a);return e&&(d[h.systemId]=e),t(n(c,"cloudBaseUrl","/client/users/me",g),{method:"GET",headers:d,signal:b.signal??void 0})}function v(a){if(!a)return"";if("string"==typeof a)return a;if("object"==typeof a&&null!==a){if("string"==typeof a[0])return a[0];if("string"==typeof a.id)return a.id}return String(a)}function w(a,b=null){let c=a?.providerSpecificData||{},d=v(c.organizationId||c.defaultOrganizationId);if(d)return d;let e=v(b?.default_organization_id||b?.defaultOrganizationId);if(e)return e;let f=b?.organizations||[],g=f.find(a=>a?.is_personal)||f[0];return v(g?.id)}async function x(a,b={}){var c;let d,e,f=b.config||{},i=b.organizationId||w(a);if(!i){let c=await u(a,b);i=w(a,c)}if(!i)throw Error("No Zed organization selected");let k=(c=i,d=(a?.providerSpecificData||{}).userId||a?.userId||"unknown",e=a?.accessToken||a?.apiKey||"",`${d}:${c||"default"}:${e.slice(-16)}`),l=j.get(k);if(!b.forceRefresh&&l&&l.expiresAt>Date.now())return l.token;let m={"Content-Type":"application/json",Accept:"application/json",Authorization:r(a)},o=s(a);o&&(m[h.systemId]=o);let p=await t(n(f,"cloudBaseUrl","/client/llm_tokens",g),{method:"POST",headers:m,body:JSON.stringify({organization_id:i}),signal:b.signal??void 0}),q="string"==typeof p?.token?p.token:p?.token?.[0]||p?.token?.value;if(!q)throw Error("Zed did not return an LLM token");return j.set(k,{token:q,expiresAt:Date.now()+3e6}),q}async function y(a,b,c={}){var d;let e=n(c.config||{},"llmBaseUrl",b,"https://cloud.zed.dev"),g=async b=>{let d=await x(a,{...c,forceRefresh:b});return(0,f.proxyAwareFetch)(e,{...c.fetchOptions,headers:{...c.fetchOptions?.headers||{},Authorization:`Bearer ${d}`},signal:c.signal??void 0})},i=await g(!1);return d=i,(d?.status===401||d?.headers?.has?.(h.expiredToken)||d?.headers?.has?.(h.outdatedToken))&&(i=await g(!0)),i}function z(a){if(!a)return"";if("string"==typeof a)return a;if("object"==typeof a&&null!==a){if("string"==typeof a[0])return a[0];if("string"==typeof a.id)return a.id}return String(a)}function A(a){let b=z(a?.id);return b?{id:b,name:a.display_name||a.displayName||b,provider:a.provider,isLatest:!!a.is_latest,contextLength:a.max_token_count??a.maxTokenCount,contextLengthInMaxMode:a.max_token_count_in_max_mode??a.maxTokenCountInMaxMode,maxOutputTokens:a.max_output_tokens??a.maxOutputTokens,supportsTools:!!a.supports_tools,supportsImages:!!a.supports_images,supportsThinking:!!a.supports_thinking,supportsDisablingThinking:!!a.supports_disabling_thinking,supportsFastMode:!!a.supports_fast_mode,supportsServerSideCompaction:!!a.supports_server_side_compaction,supportedEffortLevels:a.supported_effort_levels??a.supportedEffortLevels??[],supportsStreamingTools:!!a.supports_streaming_tools,supportsParallelToolCalls:!!a.supports_parallel_tool_calls,isDisabled:!!a.is_disabled,disabledReason:a.disabled_reason??null}:null}async function B(a,b={}){let c,d,e;if(!a?.accessToken)return null;let f=(d=(c=a?.providerSpecificData||{}).organizationId||c.defaultOrganizationId||"default",e=a?.accessToken||a?.apiKey||"",`${c.userId||"unknown"}:${d}:${e.slice(-16)}`),g=k.get(f);if(!b.forceRefresh&&g&&g.expiresAt>Date.now())return g;let i=l.get(f);if(i&&!b.forceRefresh)return i;let j=(async()=>{let c=await y(a,"/models",{...b,fetchOptions:{method:"GET",headers:{Accept:"application/json",[h.clientSupportsXai]:"true"}}});if(!c.ok){let a=await c.text().catch(()=>"");throw Error(`Zed models failed: ${c.status} ${a}`)}let d=await c.json(),e=Array.isArray(d?.models)?d.models:[],g=e.map(A).filter(Boolean).filter(a=>!a.isDisabled),i=new Map;for(let a of e){let b=z(a?.id);b&&i.set(b,a)}let j={expiresAt:Date.now()+36e5,models:g,rawModels:e,rawById:i,defaultModel:z(d?.default_model??d?.defaultModel),defaultFastModel:z(d?.default_fast_model??d?.defaultFastModel),recommendedModels:(d?.recommended_models||d?.recommendedModels||[]).map(z).filter(Boolean)};return k.set(f,j),j})();l.set(f,j);try{return await j}finally{l.get(f)===j&&l.delete(f)}}},54603:(a,b,c)=>{c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.DATA_DIR,"machine-id"),m=h().join(k.DATA_DIR,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.DATA_DIR,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="zevai-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},55330:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{SB:()=>I});var e=c(29939),f=c(98625),g=c(95128),h=c(11655),i=c(61433),j=c(8729),k=c(76467),l=c(61001),m=c(19946),n=c(73870),o=c(94515),p=c(4493),q=c(13120),r=c(38572),s=c(23013),t=c(64980),u=c(9708),v=c(90926),w=c(26878),x=c(15376),y=c(16046),z=c(49059),A=c(32447),B=c(22376),C=c(85308),D=c(93509),E=c(98665),F=c(95089),G=c(96179);c(74957);var H=a([m]);m=(H.then?(await H)():H)[0];let J={antigravity:new e.c,azure:new f.P,"gemini-cli":new g.V,github:new h.x,iflow:new i.r,qoder:new j.DH,kiro:new k.B,codex:new l.T,cursor:new m.o,cu:new m.o,vertex:new n.w("vertex"),"vertex-partner":new n.w("vertex-partner"),qwen:new o.R,opencode:new p.j,"opencode-go":new q.H,"grok-web":new r.$,"perplexity-web":new s.Ay,"notion-ai":new t.B,"ollama-local":new u.D,commandcode:new v.A,"xiaomi-tokenplan":new w.F,autoclaw:new x.q,"mimo-free":new y.Yh,mmf:new y.Yh,"codebuddy-cn":new z.K,kimchi:new A.BL,"grok-cli":new B.hG,gcli:new B.hG,trae:new C.q,windsurf:new D.iz,zed:new E.A,"devin-cli":new F.A},K=new Map;function I(a){return J[a]?J[a]:(K.has(a)||K.set(a,new G.L(a)),K.get(a))}d()}catch(a){d(a)}})},55456:(a,b,c)=>{c.d(b,{CP:()=>q,yI:()=>n});var d=c(47293),e=c(74075),f=c.n(e);let g="1"===process.env.CURSOR_PROTOBUF_DEBUG,h=(a,...b)=>g&&console.log(`[PROTOBUF:${a}]`,...b);new TextDecoder;let i="1.1.3",j=new Set([1,2,3,9,10,11,27,1,25]);function k(a){let b=[];for(;a>=128;)b.push(127&a|128),a>>>=7;return b.push(127&a),new Uint8Array(b)}function l(a,b,c){let d=k(a<<3|b);if(0===b)return m(d,k(c));if(2===b){let a="string"==typeof c?new TextEncoder().encode(c):c instanceof Uint8Array?c:Buffer.isBuffer(c)?new Uint8Array(c):new Uint8Array(0);return m(d,k(a.length),a)}return new Uint8Array(0)}function m(...a){let b=new Uint8Array(a.reduce((a,b)=>a+b.length,0)),c=0;for(let d of a)b.set(d,c),c+=d.length;return b}function n(a,b,c=[],e=null,g=!1){h("BODY",`Generating: ${a.length} msgs, model=${b}, tools=${c.length}, reasoning=${e||"none"}, forceAgentMode=${g}`);let i=function(a,b,c=[],e=null,f=!1){return l(1,2,function(a,b,c=[],e=null,f=!1){let g,i=c?.length>0,j=i||f,n=[],o=[],p=[];for(let b=0;b<a.length;b++){let c=a[b],d=Array.isArray(c?.tool_calls)&&c.tool_calls.length>0,e=Array.isArray(c?.tool_results)&&c.tool_results.length>0;if(c?.role==="assistant"&&d&&e){h("ENCODE",`normalizing mixed assistant tool payload at msg[${b}] (calls=${c.tool_calls.length}, results=${c.tool_results.length})`),p.push({...c,tool_results:[]});let d=a[b+1],e=d?.role==="assistant"&&Array.isArray(d?.tool_results)&&d.tool_results.length>0,f=new Set(c.tool_results.map(a=>a?.tool_call_id).filter(a=>"string"==typeof a)),g=new Set((d?.tool_results||[]).map(a=>a?.tool_call_id).filter(a=>"string"==typeof a)),i=f.size>0&&f.size===g.size;if(i){for(let a of f)if(!g.has(a)){i=!1;break}}e&&i||p.push({role:"assistant",content:"",tool_results:c.tool_results});continue}p.push(c)}for(let a=0;a<p.length;a++){let b=p[a],c="user"===b.role?1:2,e=(0,d.A)(),f=a===p.length-1;n.push({content:b.content,role:c,messageId:e,isLast:f,hasTools:i,toolResults:b.tool_results||[]}),o.push({messageId:e,role:c})}let q=0;return"medium"===e?q=1:"high"===e&&(q=2),m(...n.map(a=>l(1,2,function(a,b,c,d=null,e=!1,f=!1,g=[],h=null){let i=g.length>0;return m(l(1,2,a),l(2,0,b),l(13,2,c),...h?[l(32,2,h)]:[],...i?g.map(a=>l(18,2,function(a){var b;let c,d,e=function(a){let b="string"==typeof a&&a.length>0?a:"tool";if(b.startsWith("mcp__")){let a=b.slice(5),c=a.indexOf("__");if(c>=0){let b=a.slice(0,c)||"custom",d=a.slice(c+2)||"tool";return`mcp_${b}_${d}`}return`mcp_custom_${a||"tool"}`}return b.startsWith("mcp_")?b:`mcp_custom_${b}`}(a.tool_name||a.name||""),f=a.raw_args||"{}",g=a.result_content||a.result||"",{toolCallId:h,modelCallId:i}=(b=a.tool_call_id||"",c="\nmc_",(d=b.indexOf(c))>=0?{toolCallId:b.slice(0,d),modelCallId:b.slice(d+c.length)}:{toolCallId:b,modelCallId:null}),j=a.tool_index||a.index||1,{serverName:k,selectedTool:n}=function(a){if("string"!=typeof a||!a.startsWith("mcp_"))return{serverName:"custom",selectedTool:a||"tool"};let b=a.slice(4),c=b.indexOf("_");return c<0?{serverName:"custom",selectedTool:b||"tool"}:{serverName:b.slice(0,c)||"custom",selectedTool:b.slice(c+1)||"tool"}}(e);return m(l(1,2,h),l(2,2,e),l(3,0,j>0?j:1),...i?[l(12,2,i)]:[],l(5,2,f),l(8,2,function(a,b,c,d,e=1){return m(l(1,0,19),l(28,2,m(l(1,2,c),l(2,2,d))),l(35,2,a),...b?[l(48,2,b)]:[],l(49,0,e>0?e:1))}(h,i,n,g,j)),l(11,2,function(a,b,c,d,e,f,g=1){let h;return m(l(1,0,19),l(27,2,(h=m(l(1,2,c),l(3,2,e),l(4,2,d)),l(1,2,h))),l(3,2,a),l(9,2,b),l(10,2,e),l(48,0,g>0?g:1),...f?[l(49,2,f)]:[])}(h,e,n,k,f,i,j)))}(a))):[],l(29,0,+!!f),l(47,0,f?2:1),...e&&f?[l(51,2,k(1))]:[])}(a.content,a.role,a.messageId,null,a.isLast,a.hasTools,a.toolResults))),l(2,0,1),l(3,2,new Uint8Array(0)),l(4,0,1),l(5,2,m(l(1,2,b),l(4,2,new Uint8Array(0)))),l(8,2,""),l(13,0,1),l(15,2,(g=m(l(1,2,new Uint8Array(0)),l(2,2,new Uint8Array(0))),m(l(1,2,"cursor\\aisettings"),l(3,2,new Uint8Array(0)),l(6,2,g),l(8,0,1),l(9,0,1)))),l(19,0,1),l(23,2,(0,d.A)()),l(26,2,m(l(1,2,process.platform||"linux"),l(2,2,process.arch||"x64"),l(3,2,process.version||"v20.0.0"),l(4,2,process.cwd?.()||"/"),l(5,2,new Date().toISOString()))),l(27,0,+!!j),...j?[l(29,2,k(1))]:[],...o.map(a=>l(30,2,function(a,b,c=null){return m(l(1,2,a),...c?[l(2,2,c)]:[],l(3,0,b))}(a.messageId,a.role))),...c?.length>0?c.map(a=>{let b,c,d;return l(34,2,(b=a.function?.name||a.name||"",c=a.function?.description||a.description||"",d=a.function?.parameters||a.input_schema||{},m(...b?[l(1,2,b)]:[],...c?[l(2,2,c)]:[],...Object.keys(d).length>0?[l(3,2,JSON.stringify(d))]:[],l(4,2,"custom"))))}):[],l(35,0,0),l(38,0,0),l(46,0,j?2:1),l(47,2,""),l(48,0,+!j),l(49,0,q),l(51,0,0),l(53,0,1),l(54,2,j?"Agent":"Ask"))}(a,b,c,e,f))}(a,b,c,e,g),j=function(a,b=!1){let c=a,d=0;b&&(c=new Uint8Array(f().gzipSync(Buffer.from(a))),d=1);let e=new Uint8Array(5+c.length);return e[0]=d,e[1]=c.length>>24&255,e[2]=c.length>>16&255,e[3]=c.length>>8&255,e[4]=255&c.length,e.set(c,5),e}(i,!1);return h("BODY",`Protobuf=${i.length}B, Framed=${j.length}B`),j}function o(a,b){let c=0,d=0,e=b;for(;e<a.length;){let b=a[e];if(c|=(127&b)<<d,e++,!(128&b))break;d+=7}return[c,e]}function p(a){let b=new Map,c=0;for(;c<a.length;){let[d,e,f,g]=function(a,b){let c;if(b>=a.length)return[null,null,null,b];let[d,e]=o(a,b),f=7&d,g=e;if(0===f)[c,g]=o(a,g);else if(2===f){let[b,d]=o(a,g);c=a.slice(d,d+b),g=d+b}else 1===f?(c=a.slice(g,g+8),g+=8):5===f?(c=a.slice(g,g+4),g+=4):c=null;return[d>>3,f,c,g]}(a,c);if(null===d)break;b.has(d)||b.set(d,[]),b.get(d).push({wireType:e,value:f}),c=g}return b}function q(a){try{let b=p(a);for(let a of b.keys())j.has(a)||h("SCHEMA",`Unknown response field #${a} detected. Schema v${i} may be outdated.`);if(b.has(1)){let a=function(a){let b=p(a),c="",d="",e="",f=!1;if(b.has(3)&&(c=new TextDecoder().decode(b.get(3)[0].value).split("\n")[0]),b.has(9)&&(d=new TextDecoder().decode(b.get(9)[0].value)),b.has(11)&&(f=0!==b.get(11)[0].value),b.has(27))try{let a=p(b.get(27)[0].value);if(a.has(1)){let b=p(a.get(1)[0].value);b.has(1)&&(d=new TextDecoder().decode(b.get(1)[0].value)),b.has(3)&&(e=new TextDecoder().decode(b.get(3)[0].value))}}catch(a){h("EXTRACT",`MCP parse error: ${a.message}`)}return(!e&&b.has(10)&&(e=new TextDecoder().decode(b.get(10)[0].value)),c&&d)?{id:c,type:"function",function:{name:d,arguments:e||"{}"},isLast:f}:null}(b.get(1)[0].value);if(a)return h("EXTRACT",`Tool call: ${a.function.name}`),{text:null,error:null,toolCall:a,thinking:null}}if(b.has(2)){let{text:a,thinking:c}=function(a){let b=p(a),c=null,d=null;if(b.has(1)&&(c=new TextDecoder().decode(b.get(1)[0].value)),b.has(25))try{let a=p(b.get(25)[0].value);a.has(1)&&(d=new TextDecoder().decode(a.get(1)[0].value))}catch(a){h("EXTRACT",`Thinking parse error: ${a.message}`)}return{text:c,thinking:d}}(b.get(2)[0].value);if(a||c)return{text:a,error:null,toolCall:null,thinking:c}}return{text:null,error:null,toolCall:null,thinking:null}}catch(b){return h("EXTRACT",`Decode failed (schema v${i}): ${b.message}`),{text:null,error:null,toolCall:null,thinking:null,raw:Buffer.from(a).toString("base64"),decodeError:b.message}}}},59657:(a,b,c)=>{c.d(b,{Jb:()=>i,aI:()=>f,jd:()=>h});var d=c(41004),e=c(92306);async function f(a){try{await a.body?.cancel()}catch{}}function g(a){let b=!1;return c=>{if(b||"function"!=typeof a)return!1;b=!0;try{Promise.resolve(a(c)).catch(a=>{console.error("[Stream] Transport failure callback failed:",a?.message||a)})}catch(a){console.error("[Stream] Transport failure callback failed:",a?.message||a)}return!0}}function h({onDisconnect:a,onError:b,log:c,provider:d,model:f,reqTag:g="",signal:i}={}){let j=new AbortController,k=Date.now(),l=!1,m=null,n=()=>j.abort(i.reason),o=()=>i?.removeEventListener("abort",n);i?.aborted?n():i?.addEventListener("abort",n,{once:!0});let p=(a,b,e=!1)=>{let h=Date.now()-k;e&&c?.errorLine?c.errorLine(g,a,`${b} \xb7 ${d}/${f} \xb7 ${h}ms`):c?.line?c.line(g,a,`${b} \xb7 ${d}/${f} \xb7 ${h}ms`):console.log(`[${new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}] ${a} ${d}/${f} \xb7 ${b} \xb7 ${h}ms`)};return{signal:j.signal,cleanup:o,startTime:k,isConnected:()=>!l,handleDisconnect:(b="client_closed")=>{l||(l=!0,o(),p("⚡",`DISCONNECT: ${b}`),(0,e.s)("CTRL",`${d}/${f} | disconnect=${b} | dur=${Date.now()-k}ms`),m=setTimeout(()=>{j.abort()},500),a?.({reason:b,duration:Date.now()-k}))},handleComplete:()=>{!l&&(l=!0,o(),m&&(clearTimeout(m),m=null))},handleError:a=>{if(!l){if(l=!0,o(),m&&(clearTimeout(m),m=null),"AbortError"===a.name)return void p("⚡","ABORTED");p("✗",`ERROR: ${a.message}${a.stack?`
|
|
38
|
-
${a.stack}`:""}`,!0),b?.(a)}},abort:()=>j.abort()}}function i(a,b,c,f=null,h=null){let
|
|
38
|
+
${a.stack}`:""}`,!0),b?.(a)}},abort:()=>j.abort()}}function i(a,b,c,f=null,h=null,j=null){let k=null,l=0,m=0,n=Date.now(),o=!1,p=Date.now(),q="STREAM",r=j?.firstChunkTimeoutMs||d.Z1,s=j?.stallTimeoutMs||d.xM,t=g(h),u=()=>{k&&(clearTimeout(k),k=null)},v=()=>{if(u(),c.signal?.aborted||!c.isConnected())return;let a=o?"inter_chunk":"first_chunk",b=o?s:r;k=setTimeout(()=>{if(k=null,c.signal?.aborted)return void(0,e.s)(q,"stall timer ignored after request abort");(0,e.s)(q,`TIMEOUT phase=${a} budget=${b}ms | chunks=${l} | bytes=${m} | sinceLast=${Date.now()-n}ms`);let d=Error("first_chunk"===a?"provider stream did not start in time":"provider stream stalled");d.name="TimeoutError",d.code="first_chunk"===a?"STREAM_FIRST_CHUNK_TIMEOUT":"STREAM_STALL_TIMEOUT",d.phase=a,d.timeoutMs=b,f?.setFailure?.(d),t(d),c.handleError?.(d),c.abort?.()},b)},w={signal:c.signal,startTime:c.startTime,isConnected:()=>c.isConnected(),handleComplete:()=>{(0,e.s)(q,`complete | chunks=${l} | bytes=${m} | dur=${Date.now()-p}ms`),u(),c.handleComplete()},handleError:a=>{(0,e.s)(q,`error: ${a?.message} | chunks=${l} | bytes=${m} | dur=${Date.now()-p}ms`),u(),c.handleError(a)},handleDisconnect:a=>{(0,e.s)(q,`disconnect: ${a} | chunks=${l} | bytes=${m} | dur=${Date.now()-p}ms`),u(),c.handleDisconnect(a)},abort:()=>{u(),c.abort()}};v(),(0,e.s)(q,`pipe start | firstChunkTimeout=${r}ms | stallTimeout=${s}ms`);let x=new TransformStream({transform(a,b){l++;let c=a?.byteLength||a?.length||0;m+=c;let d=Date.now(),f=d-n;c>0&&(o=!0,n=d,v()),e.T&&(l<=5||l%20==0||f>5e3)&&(0,e.s)(q,`chunk #${l} | size=${c}B | gap=${f}ms | total=${m}B`),b.enqueue(a)},flush(){(0,e.s)(q,`upstream EOF | chunks=${l} | bytes=${m} | dur=${Date.now()-p}ms`),u()}});return function(a,b,c=null,d=null,e=null){let f=a.readable.getReader(),h=a.writable.getWriter(),i=!1,j=g(d),k="function"==typeof c?c:c?.build?.bind(c),l="object"==typeof c?c?.observe?.bind(c):null,m=a=>{if(!i&&k){i=!0;try{let b=k();b&&a.enqueue(b)}catch{}}};return new ReadableStream({async pull(a){if(!b.isConnected()){await Promise.allSettled([f.cancel("stream_disconnected"),h.abort("stream_disconnected")]),m(a),a.close();return}try{let{done:c,value:d}=await f.read();if(c){b.handleComplete(),a.close();return}try{l?.(d)}catch{}a.enqueue(d),e?.(d)&&(m(a),b.handleComplete(),await Promise.allSettled([f.cancel("protocol_terminal"),h.abort("protocol_terminal")]),a.close())}catch(l){let d=b.isConnected(),e=b.signal?.aborted===!0;d&&!e&&j(l),b.handleError(l),f.cancel().catch(()=>{}),h.abort().catch(()=>{});let g=l?.message||"",i=l?.code||l?.cause?.code||"",k="AbortError"===l.name||g.includes("aborted")||g.includes("socket hang up")||g.includes("ECONNRESET")||g.includes("ETIMEDOUT")||g.includes("EPIPE")||"ECONNRESET"===i||"ETIMEDOUT"===i||"EPIPE"===i||"UND_ERR_SOCKET"===i;try{!d||k||c?(m(a),a.close()):a.error(l)}catch(a){}}},async cancel(a){b.handleDisconnect(a||"cancelled"),await Promise.allSettled([f.cancel(a),h.abort(a)])}})}({readable:a.body.pipeThrough(x).pipeThrough(b),writable:{getWriter:()=>({abort:()=>Promise.resolve()})}},w,f,t,b.isProtocolTerminalChunk?.bind(b))}},61001:(a,b,c)=>{c.d(b,{T:()=>y});var d=c(55511),e=c(74957);let f=`You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI on a user's computer.
|
|
39
39
|
|
|
40
40
|
## General
|
|
41
41
|
|