@rabbi696/ezrouter 0.5.69 → 0.5.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +15 -15
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +15 -15
- package/app/.next-cli-build/server/chunks/412.js +1 -1
- package/app/.next-cli-build/server/chunks/4843.js +1 -1
- package/app/.next-cli-build/server/chunks/5767.js +1 -1
- package/app/.next-cli-build/server/chunks/7591.js +1 -1
- package/app/.next-cli-build/server/chunks/7775.js +1 -1
- package/app/.next-cli-build/server/chunks/7889.js +1 -1
- package/app/.next-cli-build/server/chunks/8327.js +1 -1
- package/app/.next-cli-build/server/chunks/921.js +1 -1
- package/app/.next-cli-build/server/chunks/9212.js +1 -1
- package/app/.next-cli-build/server/chunks/9356.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/{1321-930f84897ead6c2c.js → 1321-075e69c1029a3be9.js} +1 -1
- package/app/.next-cli-build/static/chunks/{5497-93fc7728cdff1521.js → 5497-b8180f32d8b8d12d.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-b5741659c03ca56b.js → page-f767dcc53bb237c6.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-d8b0749a7237200c.js +1 -0
- package/app/CHANGELOG.md +4 -2
- package/app/package.json +1 -1
- package/app/public/CHANGELOG.md +4 -2
- package/package.json +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-842dac87c3271933.js +0 -1
- /package/app/.next-cli-build/static/{-oFClfdQrsC_KzLfqx9kb → SMVZ1Q84_Ws1e4PoYXFub}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{-oFClfdQrsC_KzLfqx9kb → SMVZ1Q84_Ws1e4PoYXFub}/_ssgManifest.js +0 -0
|
@@ -115,53 +115,53 @@
|
|
|
115
115
|
"/api/version/update/route": "app/api/version/update/route.js",
|
|
116
116
|
"/favicon.ico/route": "app/favicon.ico/route.js",
|
|
117
117
|
"/manifest.webmanifest/route": "app/manifest.webmanifest/route.js",
|
|
118
|
-
"/api/cli-tools/codex-native/readiness/route": "app/api/cli-tools/codex-native/readiness/route.js",
|
|
119
118
|
"/api/cli-tools/devin-settings/route": "app/api/cli-tools/devin-settings/route.js",
|
|
120
119
|
"/api/combos/export/route": "app/api/combos/export/route.js",
|
|
121
|
-
"/api/
|
|
120
|
+
"/api/cli-tools/codex-native/readiness/route": "app/api/cli-tools/codex-native/readiness/route.js",
|
|
122
121
|
"/api/combos/route": "app/api/combos/route.js",
|
|
123
|
-
"/api/convoy/rules/route": "app/api/convoy/rules/route.js",
|
|
124
122
|
"/api/headroom/extras/route": "app/api/headroom/extras/route.js",
|
|
125
|
-
"/api/
|
|
123
|
+
"/api/convoy/rules/route": "app/api/convoy/rules/route.js",
|
|
126
124
|
"/api/headroom/restart/route": "app/api/headroom/restart/route.js",
|
|
127
|
-
"/api/headroom/start/route": "app/api/headroom/start/route.js",
|
|
128
125
|
"/api/headroom/status/route": "app/api/headroom/status/route.js",
|
|
126
|
+
"/api/headroom/start/route": "app/api/headroom/start/route.js",
|
|
129
127
|
"/api/headroom/stop/route": "app/api/headroom/stop/route.js",
|
|
130
|
-
"/api/
|
|
131
|
-
"/api/
|
|
128
|
+
"/api/headroom/proxy/[...path]/route": "app/api/headroom/proxy/[...path]/route.js",
|
|
129
|
+
"/api/combos/import/route": "app/api/combos/import/route.js",
|
|
132
130
|
"/api/mcp/[plugin]/message/route": "app/api/mcp/[plugin]/message/route.js",
|
|
131
|
+
"/api/keys/route": "app/api/keys/route.js",
|
|
133
132
|
"/api/mcp/[plugin]/sse/route": "app/api/mcp/[plugin]/sse/route.js",
|
|
133
|
+
"/api/internal/codex-native/lease/[action]/route": "app/api/internal/codex-native/lease/[action]/route.js",
|
|
134
134
|
"/api/models/alias/route": "app/api/models/alias/route.js",
|
|
135
135
|
"/api/models/custom/route": "app/api/models/custom/route.js",
|
|
136
136
|
"/api/models/disabled/route": "app/api/models/disabled/route.js",
|
|
137
|
-
"/api/oauth/[provider]/[action]/route": "app/api/oauth/[provider]/[action]/route.js",
|
|
138
137
|
"/api/oauth/kiro/import-cli-proxy/route": "app/api/oauth/kiro/import-cli-proxy/route.js",
|
|
138
|
+
"/api/oauth/[provider]/[action]/route": "app/api/oauth/[provider]/[action]/route.js",
|
|
139
139
|
"/api/provider-nodes/route": "app/api/provider-nodes/route.js",
|
|
140
140
|
"/api/providers/[id]/refresh-profile/route": "app/api/providers/[id]/refresh-profile/route.js",
|
|
141
141
|
"/api/providers/[id]/route": "app/api/providers/[id]/route.js",
|
|
142
|
-
"/api/providers/[id]/models/route": "app/api/providers/[id]/models/route.js",
|
|
143
142
|
"/api/providers/client/route": "app/api/providers/client/route.js",
|
|
144
|
-
"/api/providers/route": "app/api/providers/route.js",
|
|
145
143
|
"/api/providers/suggested-models/route": "app/api/providers/suggested-models/route.js",
|
|
146
144
|
"/api/proxy-pools/[id]/test/route": "app/api/proxy-pools/[id]/test/route.js",
|
|
145
|
+
"/api/providers/route": "app/api/providers/route.js",
|
|
147
146
|
"/api/proxy-pools/[id]/route": "app/api/proxy-pools/[id]/route.js",
|
|
148
147
|
"/api/proxy-pools/cloudflare-deploy/route": "app/api/proxy-pools/cloudflare-deploy/route.js",
|
|
149
148
|
"/api/proxy-pools/deno-deploy/route": "app/api/proxy-pools/deno-deploy/route.js",
|
|
150
|
-
"/api/proxy-pools/route": "app/api/proxy-pools/route.js",
|
|
151
|
-
"/api/proxy-pools/vercel-deploy/route": "app/api/proxy-pools/vercel-deploy/route.js",
|
|
152
149
|
"/api/pxpipe/health/route": "app/api/pxpipe/health/route.js",
|
|
153
150
|
"/api/pxpipe/install/route": "app/api/pxpipe/install/route.js",
|
|
151
|
+
"/api/proxy-pools/route": "app/api/proxy-pools/route.js",
|
|
154
152
|
"/api/pxpipe/logs/route": "app/api/pxpipe/logs/route.js",
|
|
155
153
|
"/api/pxpipe/restart/route": "app/api/pxpipe/restart/route.js",
|
|
154
|
+
"/api/proxy-pools/vercel-deploy/route": "app/api/proxy-pools/vercel-deploy/route.js",
|
|
156
155
|
"/api/pxpipe/start/route": "app/api/pxpipe/start/route.js",
|
|
157
156
|
"/api/pxpipe/stats/route": "app/api/pxpipe/stats/route.js",
|
|
158
157
|
"/api/pxpipe/status/route": "app/api/pxpipe/status/route.js",
|
|
159
158
|
"/api/pxpipe/stop/route": "app/api/pxpipe/stop/route.js",
|
|
159
|
+
"/api/providers/[id]/models/route": "app/api/providers/[id]/models/route.js",
|
|
160
160
|
"/api/routing-health/route": "app/api/routing-health/route.js",
|
|
161
161
|
"/api/settings/database/route": "app/api/settings/database/route.js",
|
|
162
162
|
"/api/settings/proxy-test/route": "app/api/settings/proxy-test/route.js",
|
|
163
|
-
"/api/settings/route": "app/api/settings/route.js",
|
|
164
163
|
"/api/token-saver/stats/route": "app/api/token-saver/stats/route.js",
|
|
164
|
+
"/api/settings/route": "app/api/settings/route.js",
|
|
165
165
|
"/api/token-saver/stream/route": "app/api/token-saver/stream/route.js",
|
|
166
166
|
"/api/translator/console-logs/stream/route": "app/api/translator/console-logs/stream/route.js",
|
|
167
167
|
"/api/translator/send/route": "app/api/translator/send/route.js",
|
|
@@ -177,8 +177,8 @@
|
|
|
177
177
|
"/api/v1/codex/responses/compact/route": "app/api/v1/codex/responses/compact/route.js",
|
|
178
178
|
"/api/v1/codex/responses/route": "app/api/v1/codex/responses/route.js",
|
|
179
179
|
"/api/v1/models/info/route": "app/api/v1/models/info/route.js",
|
|
180
|
-
"/api/v1/models/route": "app/api/v1/models/route.js",
|
|
181
180
|
"/api/v1beta/models/[...path]/route": "app/api/v1beta/models/[...path]/route.js",
|
|
181
|
+
"/api/v1/models/route": "app/api/v1/models/route.js",
|
|
182
182
|
"/callback/page": "app/callback/page.js",
|
|
183
183
|
"/dashboard/settings/pricing/page": "app/dashboard/settings/pricing/page.js",
|
|
184
184
|
"/landing/page": "app/landing/page.js",
|
|
@@ -206,8 +206,8 @@
|
|
|
206
206
|
"/(dashboard)/dashboard/usage/page": "app/(dashboard)/dashboard/usage/page.js",
|
|
207
207
|
"/(dashboard)/dashboard/console-log/page": "app/(dashboard)/dashboard/console-log/page.js",
|
|
208
208
|
"/(dashboard)/dashboard/error-log/page": "app/(dashboard)/dashboard/error-log/page.js",
|
|
209
|
-
"/(dashboard)/dashboard/profile/page": "app/(dashboard)/dashboard/profile/page.js",
|
|
210
209
|
"/(dashboard)/dashboard/providers/page": "app/(dashboard)/dashboard/providers/page.js",
|
|
210
|
+
"/(dashboard)/dashboard/profile/page": "app/(dashboard)/dashboard/profile/page.js",
|
|
211
211
|
"/(dashboard)/dashboard/proxy-pools/page": "app/(dashboard)/dashboard/proxy-pools/page.js",
|
|
212
212
|
"/(dashboard)/dashboard/providers/[id]/page": "app/(dashboard)/dashboard/providers/[id]/page.js"
|
|
213
213
|
}
|
|
@@ -8,7 +8,7 @@ Steps:
|
|
|
8
8
|
`:b.ok?a+=`#${b.index} ${b.model}: OK (${b.latencyMs}ms) - SERVED REQUEST
|
|
9
9
|
Preview: ${b.preview||"N/A"}
|
|
10
10
|
`:a+=`#${b.index} ${b.model}: FAILED (${b.latencyMs}ms) - ${b.error}
|
|
11
|
-
`}),a})(),"combo-test-summary"),className:"text-[11px] text-primary hover:underline flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"combo-test-summary"===z?"check":"content_copy"}),"combo-test-summary"===z?"Copied Summary":"Copy Diagnostic Summary"]})]}),(0,d.jsx)("div",{className:"flex flex-col gap-2 max-h-[320px] overflow-y-auto custom-scrollbar pr-1",children:u.steps?.map(a=>(0,d.jsxs)("div",{className:`rounded-lg border p-3 text-xs transition-all ${a.servedRequest?"border-emerald-500/40 bg-emerald-500/5 dark:bg-emerald-500/10 shadow-xs":a.fallbackTriggered?"border-amber-500/40 bg-amber-500/5 dark:bg-amber-500/10":"border-border-subtle bg-surface-2 opacity-60"}`,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)("span",{className:`size-5 rounded-full flex items-center justify-center font-bold text-[10px] shrink-0 ${a.servedRequest?"bg-emerald-500 text-white":a.fallbackTriggered?"bg-amber-500 text-white":"bg-black/20 dark:bg-white/20 text-text-muted"}`,children:a.index}),(0,d.jsx)("code",{className:"font-mono text-xs font-semibold text-text-main truncate",children:a.model})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[a.servedRequest&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 font-semibold px-2 py-0.5 text-[10px]",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"verified"}),"SERVED REQUEST"]}),a.fallbackTriggered&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-500/20 text-amber-700 dark:text-amber-300 font-semibold px-2 py-0.5 text-[10px]",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),"FALLBACK TRIGGERED"]}),a.skipped&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-black/10 dark:bg-white/10 text-text-muted font-medium px-2 py-0.5 text-[10px]",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"skip_next"}),"SKIPPED"]}),!a.skipped&&(0,d.jsxs)("span",{className:"font-mono text-[11px] text-text-muted",children:[a.latencyMs,"ms"]})]})]}),a.fallbackTriggered&&(0,d.jsxs)("div",{className:"mt-2 rounded bg-red-500/10 border border-red-500/20 p-2 font-mono text-[11px] text-red-500 break-words",children:[(0,d.jsx)("span",{className:"font-bold",children:"Error: "}),a.error||`HTTP ${a.status}`]}),a.servedRequest&&a.preview&&(0,d.jsxs)("div",{className:"mt-2 rounded bg-surface p-2 border border-emerald-500/30 text-[11px] text-text-main font-mono whitespace-pre-wrap max-h-24 overflow-y-auto custom-scrollbar",children:[(0,d.jsx)("span",{className:"text-[10px] text-emerald-600 dark:text-emerald-400 font-bold block mb-0.5",children:"Output Preview:"}),a.preview]}),a.skipped&&(0,d.jsx)("div",{className:"mt-1 text-[11px] text-text-muted italic",children:a.reason})]},a.index))})]})]})]})})}},43182:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);let i="https://gitlab.com";function j({isOpen:a,providerInfo:b,onSuccess:c,onClose:f}){let[g,k]=(0,e.useState)(null),[l,m]=(0,e.useState)(i),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(null),B=()=>{k(null),m(i),o(""),q(""),s(""),w(null),u(!1),y(!1),A(null),f()},C=async()=>{if(!r.trim())return void w("Personal Access Token is required");u(!0),w(null);try{let a=await fetch("/api/oauth/gitlab/pat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:r.trim(),baseUrl:l.trim()||i})}),b=await a.json();if(!a.ok)throw Error(b.error||"Authentication failed");c?.(),B()}catch(a){w(a.message)}finally{u(!1)}};return a?x&&z?(0,d.jsx)(h.LF,{isOpen:!0,provider:"gitlab",providerInfo:b,oauthMeta:z,onSuccess:()=>{c?.(),B()},onClose:()=>{y(!1),A(null)}}):(0,d.jsx)(h.aF,{isOpen:a,title:"Connect GitLab Duo",onClose:B,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Choose how to authenticate with GitLab Duo:"}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsxs)("button",{onClick:()=>k("oauth"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"OAuth App"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab OAuth application"})]})]}),(0,d.jsxs)("button",{onClick:()=>k("pat"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Personal Access Token"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab PAT with api scope"})]})]})]})]}),"oauth"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Create an OAuth app at"," ",(0,d.jsx)("a",{href:`${l.trim()||i}/-/profile/applications`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Applications"})," ","with redirect URI"," ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"http://localhost/callback"})]}),(0,d.jsx)(h.pd,{label:"GitLab Base URL",value:l,onChange:a=>m(a.target.value),placeholder:i}),(0,d.jsx)(h.pd,{label:"Client ID",value:n,onChange:a=>o(a.target.value),placeholder:"Your OAuth application client ID"}),(0,d.jsx)(h.pd,{label:"Client Secret (optional for PKCE)",value:p,onChange:a=>q(a.target.value),placeholder:"Leave empty for public PKCE app"}),v&&(0,d.jsx)("p",{className:"text-sm text-red-500",children:v}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>{n.trim()?(w(null),A({baseUrl:l.trim()||i,clientId:n.trim(),clientSecret:p.trim()}),y(!0)):w("Client ID is required")},fullWidth:!0,disabled:!n.trim(),children:"Authorize"}),(0,d.jsx)(h.$n,{onClick:()=>{k(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"pat"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Create a PAT at"," ",(0,d.jsx)("a",{href:`${l.trim()||i}/-/user_settings/personal_access_tokens`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Access Tokens"})," ","with scopes: ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"api"}),","," ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"read_user"}),", and"," ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"ai_features"}),"."]}),(0,d.jsx)(h.pd,{label:"GitLab Base URL",value:l,onChange:a=>m(a.target.value),placeholder:i}),(0,d.jsx)(h.pd,{label:"Personal Access Token",value:r,onChange:a=>s(a.target.value),placeholder:"glpat-****************",type:"password"}),v&&(0,d.jsx)("p",{className:"text-sm text-red-500",children:v}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:C,fullWidth:!0,disabled:!r.trim()||t,loading:t,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:()=>{k(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}j.propTypes={isOpen:g().bool.isRequired,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired}},45623:(a,b,c)=>{c.d(b,{default:()=>n});var d=c(48249),e=c(67484),f=c(19099),g=c(41371),h=c(17174),i=c(32456),j=c(12020),k=c(17447),l=c(54510);function m(){let[a,b]=(0,e.useState)(!1),[c,f]=(0,e.useState)(null),[g,h]=(0,e.useState)(null),[i,m]=(0,e.useState)([]),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1);return a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"pointer-events-auto w-full rounded-lg border border-green-500/30 bg-green-500/10 text-green-800 dark:text-green-200 shadow-lg backdrop-blur-sm px-3 py-2.5",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5 text-green-600 dark:text-green-400 shrink-0",children:"celebration"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:"text-xs font-semibold",children:["Updated to v",g,c?(0,d.jsxs)("span",{className:"font-normal opacity-80",children:[" (from v",c,")"]}):null]}),!r&&0===i.length&&(0,d.jsx)("p",{className:"text-[11px] opacity-80 mt-0.5",children:"You're on the latest install."}),r&&i.length>0&&(0,d.jsxs)("ul",{className:"mt-1.5 space-y-0.5 text-[11px] opacity-90 list-disc list-inside",children:[i.map((a,b)=>(0,d.jsx)("li",{className:"truncate",title:a.text,children:a.text},`${a.version}-${b}`)),n&&(0,d.jsx)("li",{className:"list-none opacity-70 pl-0",children:"…and more"})]}),(0,d.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2",children:[i.length>0&&(0,d.jsx)("button",{type:"button",onClick:()=>s(a=>!a),className:"text-[11px] font-medium underline-offset-2 hover:underline",children:r?"Hide changes":"See what changed"}),(0,d.jsx)("button",{type:"button",onClick:()=>q(!0),className:"text-[11px] font-medium underline-offset-2 hover:underline opacity-80",children:"Full changelog"})]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>{(0,k.yM)(j.vQ.version),b(!1)},className:"text-current/70 hover:text-current shrink-0","aria-label":"Dismiss",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]})}),(0,d.jsx)(l.default,{isOpen:p,onClose:()=>q(!1)})]}):null}function n({children:a}){let[b,c]=(0,e.useState)(!1),j=(0,f.usePathname)(),k=(0,g.i)(a=>a.notifications),l=(0,g.i)(a=>a.removeNotification);return(0,d.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[(0,d.jsxs)("div",{className:"fixed top-4 right-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",children:[(0,d.jsx)(m,{}),k.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",{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",{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:()=>l(a.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},a.id)})]}),b&&(0,d.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 lg:hidden",onClick:()=>c(!1)}),(0,d.jsx)("div",{className:"hidden lg:flex",children:(0,d.jsx)(h.default,{})}),(0,d.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-300 ease-in-out ${b?"translate-x-0":"-translate-x-full"}`,children:(0,d.jsx)(h.default,{onClose:()=>c(!1)})}),(0,d.jsxs)("main",{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"}),(0,d.jsx)(i.default,{onMenuClick:()=>c(!0)},j),(0,d.jsx)("div",{className:`flex-1 overflow-y-auto custom-scrollbar ${"/dashboard/basic-chat"===j?"":"p-6 lg:p-10"} ${"/dashboard/basic-chat"===j?"flex flex-col overflow-hidden":""}`,children:(0,d.jsx)("div",{className:`${"/dashboard/basic-chat"===j?"flex-1 w-full h-full flex flex-col":"max-w-7xl mx-auto"}`,children:a})})]})]})}m.propTypes={}},47814:(a,b,c)=>{c.d(b,{T1:()=>d});let d=[{value:"today",label:"Today"},{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"},{value:"90d",label:"90D"},{value:"180d",label:"180D"},{value:"365d",label:"365D"},{value:"all",label:"All"}];d.map(a=>a.value)},48781:(a,b,c)=>{c.d(b,{default:()=>k});var d=c(48249),e=c(2116),f=c.n(e),g=c(12020);let h=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],i=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],j=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function k(){return(0,d.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,d.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,d.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,d.jsx)("div",{className:"size-6 text-primary",children:(0,d.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,d.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,d.jsx)("span",{className:"text-xl font-bold text-text-main",children:g.vQ.name})]}),(0,d.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,d.jsxs)("div",{className:"flex gap-4",children:[(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:h.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:j.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",g.vQ.name," Inc. All rights reserved."]}),(0,d.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},50377:(a,b,c)=>{c.d(b,{C:()=>e});var d=c(67484);function e(a=2e3){let[b,c]=(0,d.useState)(null),f=(0,d.useRef)(null);return{copied:b,copy:(0,d.useCallback)((b,d="default")=>{(async()=>{if(navigator?.clipboard?.writeText)await navigator.clipboard.writeText(b);else{let a=document.createElement("textarea");a.value=b,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select(),document.execCommand("copy"),document.body.removeChild(a)}})(),c(d),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{c(null)},a)},[a])}}},50412:(a,b,c)=>{c.d(b,{x0:()=>x.default,fA:()=>y.default,Ex:()=>j.default,$n:()=>d.default,nh:()=>D.default,Zp:()=>g.default,Qv:()=>i.CardSkeleton,CK:()=>o.default,St:()=>E.default,uo:()=>h.ConfirmModal,G9:()=>t.default,wI:()=>w.default,vj:()=>v.default,vE:()=>u.default,pd:()=>e.default,Mh:()=>s.default,uR:()=>n.default,Nf:()=>p.default,aF:()=>h.default,rq:()=>m.default,gw:()=>z.default,LF:()=>l.default,Wx:()=>C.default,gM:()=>r.default,Iz:()=>A.default,l6:()=>f.default,lM:()=>k.default,m_:()=>B.default,jK:()=>q.default});var d=c(99070),e=c(83552),f=c(4770),g=c(17660),h=c(95145),i=c(74812);c(25919);var j=c(75171),k=c(95514);c(53845),c(19308),c(17174),c(32456),c(48781);var l=c(79346),m=c(60971),n=c(39645),o=c(62727),p=c(20084),q=c(59026);c(267),c(29370),c(3236),c(54510);var r=c(91809);c(31457);var s=c(5291);c(56110);var t=c(51109),u=c(79488),v=c(43182),w=c(51585),x=c(67738),y=c(73816);c(85158);var z=c(50585),A=c(91099),B=c(32971),C=c(11633),D=c(38930),E=c(42285);c(45623),c(53838)},50585:(a,b,c)=>{c.d(b,{default:()=>m});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(17660),i=c(4770),j=c(75171);let k="__none__",l=[{value:"none",label:"None (single pool)"},{value:"round-robin",label:"Round-robin"},{value:"random",label:"Random"}];function m({providerId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(k),[n,o]=(0,e.useState)("none"),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),t=(0,e.useCallback)(async(b,c)=>{q(!0);try{let d=await fetch("/api/settings",{cache:"no-store"}),e=(d.ok?await d.json():{}).providerStrategies||{},f={...e[a]||{}};b===k?delete f.proxyPoolId:f.proxyPoolId=b,"none"===c?delete f.rotateStrategy:f.rotateStrategy=c;let g={...e};0===Object.keys(f).length?delete g[a]:g[a]=f,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:g})}),s(!0),setTimeout(()=>s(!1),1500)}catch(a){console.log("Save proxy config error:",a)}finally{q(!1)}},[a]),u=b.length>=2,v="none"!==n;return(0,d.jsxs)(h.default,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-green-500/10 text-green-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"lock_open"})}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"No authentication required"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"This provider is ready to use. Optionally route requests through a proxy pool to bypass IP-based limits."})]}),r&&(0,d.jsx)(j.default,{variant:"success",size:"sm",children:"Saved"})]}),(0,d.jsx)(i.default,{label:"Proxy Pool",value:f,onChange:a=>{var b;g(b=a.target.value),t(b,n)},disabled:p||v,options:[{value:k,label:"None (direct)"},...b.map(a=>({value:a.id,label:a.name}))],hint:v?"Pool selector is ignored when rotation is active — all active pools are used.":void 0}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 mt-4",children:[(0,d.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Rotation Strategy"}),(0,d.jsx)("select",{value:n,onChange:a=>{var b;o(b=a.target.value),t(f,b)},disabled:p,className:"py-2 px-3 text-sm text-text-main bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none transition-all disabled:opacity-50",children:l.map(a=>(0,d.jsx)("option",{value:a.value,disabled:"none"!==a.value&&!u,children:a.label},a.value))}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:u?v?"round-robin"===n?`Rotating through all ${b.length} active pools in order. State is in-memory (resets on restart).`:`Picking a random pool from ${b.length} active pools each request.`:"Uses the selected pool above. Set to Round-robin or Random to rotate across all active pools.":"Need at least 2 active proxy pools for rotation."})]})]})}m.propTypes={providerId:g().string.isRequired}},51109:(a,b,c)=>{c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onSuccess:b,onClose:c}){let[f,g]=(0,e.useState)(""),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),v=async()=>{q(!0),m(null),s(!1),u(!1);try{let a=await fetch("/api/oauth/cursor/auto-import"),b=await a.json();b.found?(g(b.accessToken),k(b.machineId),s(!0)):b.windowsManual?u(!0):m(b.error||"Could not auto-detect tokens")}catch(a){m("Failed to auto-detect tokens")}finally{q(!1)}},w=async()=>{if(!f.trim())return void m("Please enter an access token");if(!j.trim())return void m("Please enter a machine ID");o(!0),m(null);try{let a=await fetch("/api/oauth/cursor/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:f.trim(),machineId:j.trim()})}),d=await a.json();if(!a.ok)throw Error(d.error||"Import failed");b?.(),c()}catch(a){m(a.message)}finally{o(!1)}};return(0,d.jsx)(h.aF,{isOpen:a,title:"Connect Cursor IDE",onClose:c,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[p&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting tokens..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from Cursor IDE database"})]}),!p&&(0,d.jsxs)(d.Fragment,{children:[r&&(0,d.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",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:"Tokens auto-detected from Cursor IDE successfully!"})]})}),t&&(0,d.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-3 rounded-lg border border-amber-200 dark:border-amber-800 flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Could not read Cursor database automatically."})]}),(0,d.jsxs)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:["Make sure Cursor IDE has been opened at least once, then click ",(0,d.jsx)("strong",{children:"Retry"}),". If the problem persists, paste your tokens manually below."]}),(0,d.jsx)(h.$n,{onClick:v,variant:"outline",fullWidth:!0,children:"Retry"})]}),!r&&!t&&!l&&(0,d.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",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:"Cursor IDE not detected. Please paste your tokens manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Access Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("textarea",{value:f,onChange:a=>g(a.target.value),placeholder:"Access token will be auto-filled...",rows:3,className:"w-full px-3 py-2 text-sm font-mono border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Machine ID ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:j,onChange:a=>k(a.target.value),placeholder:"Machine ID will be auto-filled...",className:"font-mono text-sm"})]}),l&&(0,d.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:l})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:w,fullWidth:!0,disabled:n||!f.trim()||!j.trim(),children:n?"Importing...":"Import Token"}),(0,d.jsx)(h.$n,{onClick:c,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onSuccess:g().func,onClose:g().func.isRequired}},51585:(a,b,c)=>{c.d(b,{default:()=>n});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(95145),i=c(83552),j=c(4770),k=c(99070),l=c(75171),m=c(92592);function n({isOpen:a,connection:b,proxyPools:c,onSave:f,onClose:g}){let[o,p]=(0,e.useState)({name:"",priority:1,apiKey:""}),[q,r]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[s,t]=(0,e.useState)({accountId:""}),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)({location:"global",reasoningEffort:"high"}),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(null),[G,H]=(0,e.useState)(!1),I=b?.authType==="oauth",J=b?.provider==="azure",K=b?.provider==="cloudflare-ai",L=b?.provider==="vertex"||b?.provider==="vertex-partner",M=!!b&&((0,m.mq)(b.provider)||(0,m.gb)(b.provider)),N=b&&m.Q2?.[b.provider]?.regions||null,O=()=>{if(N&&u)return{...b?.providerSpecificData||{},region:u}},P=async()=>{if(b?.provider){z(!0),B(null);try{let a=await fetch(`/api/providers/${b.id}/test`,{method:"POST"}),c=await a.json();B(c.valid?"success":"failed")}catch{B("failed")}finally{z(!1)}}},Q=async()=>{if(b?.provider&&o.apiKey){D(!0),F(null);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b.provider,apiKey:o.apiKey,...J?{providerSpecificData:q}:{},...K?{providerSpecificData:s}:{},...N?{providerSpecificData:O()}:{},...L?{providerSpecificData:w}:{}})}),c=await a.json();F(c.valid?"success":"failed")}catch{F("failed")}finally{D(!1)}}},R=async()=>{if(b){H(!0);try{let a={name:o.name,priority:o.priority};if(!I&&o.apiKey){a.apiKey=o.apiKey;let c="success"===E;if(!c)try{D(!0),F(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b.provider,apiKey:o.apiKey,...J?{providerSpecificData:q}:{},...K?{providerSpecificData:s}:{},...N?{providerSpecificData:O()}:{},...L?{providerSpecificData:w}:{}})});c=!!(await a.json()).valid,F(c?"success":"failed")}catch{F("failed")}finally{D(!1)}c&&(a.testStatus="active",a.lastError=null,a.lastErrorAt=null)}J&&(a.providerSpecificData={azureEndpoint:q.azureEndpoint,apiVersion:q.apiVersion,deployment:q.deployment,organization:q.organization}),K&&(a.providerSpecificData={accountId:s.accountId}),N&&u&&(a.providerSpecificData=O()),L&&(a.providerSpecificData={location:w.location||"global",reasoningEffort:w.reasoningEffort||"high"}),await f(a)}finally{H(!1)}}};return b?(0,d.jsx)(h.default,{isOpen:a,title:"Edit Connection",onClose:g,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(i.default,{label:"Name",value:o.name,onChange:a=>p({...o,name:a.target.value}),placeholder:I?"Account name":"Production Key"}),I&&b.email&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,d.jsx)("p",{className:"font-medium",children:b.email})]}),(0,d.jsx)(i.default,{label:"Priority",type:"number",value:o.priority,onChange:a=>p({...o,priority:Number.parseInt(a.target.value,10)||1})}),!I&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.default,{label:"API Key",type:"password",value:o.apiKey,onChange:a=>p({...o,apiKey:a.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(k.default,{onClick:Q,disabled:!o.apiKey||C||G,variant:"secondary",children:C?"Checking...":"Check"})})]}),E&&(0,d.jsx)(l.default,{variant:"success"===E?"success":"error",children:"success"===E?"Valid":"Invalid"})]}),J&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(i.default,{label:"Azure Endpoint",value:q.azureEndpoint,onChange:a=>r({...q,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com",hint:"Your Azure OpenAI resource endpoint URL"}),(0,d.jsx)(i.default,{label:"Deployment Name",value:q.deployment,onChange:a=>r({...q,deployment:a.target.value}),placeholder:"gpt-4",hint:"The deployment name in your Azure resource"}),(0,d.jsx)(i.default,{label:"API Version",value:q.apiVersion,onChange:a=>r({...q,apiVersion:a.target.value}),placeholder:"2024-10-01-preview",hint:"Azure OpenAI API version to use"}),(0,d.jsx)(i.default,{label:"Organization",value:q.organization,onChange:a=>r({...q,organization:a.target.value}),placeholder:"Organization ID",hint:"Required for billing"})]})]}),N&&(0,d.jsx)(j.default,{label:"Region",value:u,onChange:a=>v(a.target.value),options:N.map(a=>({value:a.id,label:a.label}))}),L&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Vertex AI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(j.default,{label:"Location",value:w.location,onChange:a=>x({...w,location:a.target.value}),options:[{value:"global",label:"global (recommended for Gemini 3.x)"},{value:"us-central1",label:"us-central1"},{value:"us-east4",label:"us-east4"},{value:"europe-west1",label:"europe-west1"},{value:"europe-west4",label:"europe-west4"},{value:"asia-east1",label:"asia-east1"},{value:"asia-northeast1",label:"asia-northeast1"}]}),(0,d.jsx)(j.default,{label:"Reasoning Effort (default)",value:w.reasoningEffort,onChange:a=>x({...w,reasoningEffort:a.target.value}),options:[{value:"high",label:"high (32k tokens — default for Pro)"},{value:"medium",label:"medium (8k tokens)"},{value:"low",label:"low (1k tokens)"},{value:"",label:"none (let model decide)"}]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Location ",(0,d.jsx)("code",{children:"global"})," is required for Gemini 3.1 Pro Preview."]})]})]}),!M&&!J&&!K&&!L&&(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)(k.default,{onClick:P,variant:"secondary",disabled:y,children:y?"Testing...":"Test Connection"}),A&&(0,d.jsx)(l.default,{variant:"success"===A?"success":"error",children:"success"===A?"Valid":"Failed"})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.default,{onClick:R,fullWidth:!0,disabled:G,children:G?"Saving...":"Save"}),(0,d.jsx)(k.default,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}n.propTypes={isOpen:g().bool.isRequired,connection:g().shape({id:g().string,name:g().string,email:g().string,priority:g().number,authType:g().string,provider:g().string,providerSpecificData:g().object}),proxyPools:g().arrayOf(g().shape({id:g().string,name:g().string})),onSave:g().func.isRequired,onClose:g().func.isRequired}},53838:(a,b,c)=>{c.d(b,{default:()=>h});var d=c(48249),e=c(49885),f=c.n(e),g=c(53845);function h({children:a}){return(0,d.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,d.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,d.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,d.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,d.jsx)(g.default,{variant:"card"})}),(0,d.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:a})]})}h.propTypes={children:f().node.isRequired}},53845:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(42118),f=c(71404);function g({className:a,variant:b="default"}){let{isDark:c,toggleTheme:h}=(0,e.D)(),i={default:(0,f.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted hover:text-text-main","hover:bg-surface-2 transition-colors"),card:(0,f.cn)("flex items-center justify-center size-11 rounded-full","bg-surface/60 hover:bg-surface","border border-border","backdrop-blur-md shadow-sm hover:shadow-[var(--shadow-warm)]","text-text-muted hover:text-brand-500","transition-all group")};return(0,d.jsx)("button",{onClick:h,className:(0,f.cn)(i[b],a),"aria-label":`Switch to ${c?"light":"dark"} mode`,title:`Switch to ${c?"light":"dark"} mode`,children:(0,d.jsx)("span",{className:(0,f.cn)("material-symbols-outlined text-[22px]","card"===b&&"transition-transform duration-300 group-hover:rotate-12"),children:c?"light_mode":"dark_mode"})})}},54510:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(49885),h=c.n(g),i=c(26921);function j({isOpen:a,onClose:b}){let[c,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[k,l]=(0,e.useState)(""),m=(0,e.useRef)(null);return!a||"u"<typeof document?null:(0,f.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:b}),(0,d.jsxs)("div",{ref:m,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-3xl flex flex-col max-h-[85vh]",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Change Log"}),(0,d.jsx)("button",{onClick:b,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[h&&(0,d.jsxs)("div",{className:"flex items-center justify-center py-10 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"progress_activity"}),"Loading..."]}),k&&(0,d.jsxs)("div",{className:"text-red-500 py-4",children:["Failed to load changelog: ",k]}),!h&&!k&&c&&(0,d.jsx)("div",{className:"changelog-body text-text-main",dangerouslySetInnerHTML:{__html:c}})]})]})]}),document.body)}c(12020),i.xI.setOptions({gfm:!0,breaks:!0}),j.propTypes={isOpen:h().bool.isRequired,onClose:h().func.isRequired}},56110:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);function j({isOpen:a,provider:b,onSuccess:c,onClose:f}){let[g,k]=(0,e.useState)("loading"),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(null),{copied:t,copy:u}=(0,i.C)();(0,e.useRef)(!1);let v=async()=>{try{let a;s(null);try{a=new URL(p)}catch(a){throw Error("Invalid callback URL format")}let d=a.searchParams.get("code");a.searchParams.get("state");let e=a.searchParams.get("error");if(e)throw Error(a.searchParams.get("error_description")||e);if(!d)throw Error("No authorization code found in URL");let f=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:d,codeVerifier:n.codeVerifier,provider:b})}),g=await f.json();if(!f.ok)throw Error(g.error);k("success"),c?.()}catch(a){s(a.message),k("error")}},w="google"===b?"Google":"GitHub";return(0,d.jsx)(h.aF,{isOpen:a,title:`Connect Kiro via ${w}`,onClose:f,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",w," authentication"]})]}),"input"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:l,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"auth_url"===t?"check":"content_copy",onClick:()=>u(l,"auth_url"),children:"Copy"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,d.jsx)(h.pd,{value:p,onChange:a=>q(a.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:v,fullWidth:!0,disabled:!p,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",w," has been connected."]}),(0,d.jsx)(h.$n,{onClick:f,fullWidth:!0,children:"Done"})]}),"error"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,d.jsx)("p",{className:"text-sm text-red-600 mb-4",children:r}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>k("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,d.jsx)(h.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}j.propTypes={isOpen:g().bool.isRequired,provider:g().oneOf(["google","github"]).isRequired,onSuccess:g().func,onClose:g().func.isRequired}},59026:(a,b,c)=>{c.d(b,{default:()=>S});var d=c(48249),e=c(67484),f=c(19099),g=c(92592),h=c(47814),i=c(91431),j=c(75171),k=c(17660),l=c(49885),m=c.n(l);let n=a=>new Intl.NumberFormat().format(a||0);function o({stats:a}){let b;return(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5 sm:gap-4",children:[(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold",children:n(a.totalRequests)})]}),(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-primary",children:n(a.totalPromptTokens)})]}),(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Cached Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-info",children:n(a.totalCachedTokens)})]}),(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-success",children:n(a.totalCompletionTokens)})]}),(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Est. Cost"}),(0,d.jsxs)("span",{className:"truncate text-2xl font-bold text-warning",children:["~",(b=a.totalCost,`$${(b||0).toFixed(2)}`)]}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"Estimated, not actual billing"})]})]})}o.propTypes={stats:m().object.isRequired};let p=a=>new Intl.NumberFormat().format(a||0),q=a=>`$${(a||0).toFixed(2)}`;function r(a){if(!a)return"Never";let b=Math.floor((Date.now()-new Date(a))/6e4);return b<1?"Just now":b<60?`${b}m ago`:b<1440?`${Math.floor(b/60)}h ago`:new Date(a).toLocaleDateString()}function s({field:a,currentSort:b,currentOrder:c}){return b!==a?(0,d.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,d.jsx)("span",{className:"ml-1",children:"asc"===c?"↑":"↓"})}function t({item:a,viewMode:b,isSummary:c=!1}){return"tokens"===b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.promptTokens?"—":p(a.promptTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:a.cachedTokens?p(a.cachedTokens):"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.completionTokens?"—":p(a.completionTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:p(a.totalTokens)})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.inputCost?"—":q(a.inputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:a.cachedCost?q(a.cachedCost):"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.outputCost?"—":q(a.outputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:q(a.totalCost||a.cost)})]})}function u({title:a,columns:b,groupedData:c,tableType:f,sortBy:g,sortOrder:h,onToggleSort:i,viewMode:j,storageKey:l,renderDetailCells:m,renderSummaryCells:n,emptyMessage:o}){let[p,q]=(0,e.useState)(new Set),r=(0,e.useCallback)(a=>{q(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),v=(0,e.useMemo)(()=>"tokens"===j?[{field:"promptTokens",label:"Input Tokens"},{field:"cachedTokens",label:"Cached"},{field:"completionTokens",label:"Output Tokens"},{field:"totalTokens",label:"Total Tokens"}]:[{field:"promptTokens",label:"Input Cost"},{field:"cachedCost",label:"Cached Cost"},{field:"completionTokens",label:"Output Cost"},{field:"cost",label:"Total Cost"}],[j]),w=b.length+v.length;return(0,d.jsxs)(k.default,{className:"overflow-hidden",children:[(0,d.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,d.jsx)("h3",{className:"font-semibold",children:a})}),(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,d.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,d.jsxs)("tr",{children:[b.map(a=>(0,d.jsxs)("th",{className:`px-6 py-3 cursor-pointer hover:bg-bg-subtle/50 ${"right"===a.align?"text-right":""}`,onClick:()=>i(f,a.field),children:[a.label," ",(0,d.jsx)(s,{field:a.field,currentSort:g,currentOrder:h})]},a.field)),v.map(a=>(0,d.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>i(f,a.field),children:[a.label," ",(0,d.jsx)(s,{field:a.field,currentSort:g,currentOrder:h})]},a.field))]})}),(0,d.jsxs)("tbody",{className:"divide-y divide-border",children:[c.map(a=>(0,d.jsxs)(e.Fragment,{children:[(0,d.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>r(a.groupKey),children:[(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${p.has(a.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,d.jsx)("span",{className:`font-medium transition-colors ${a.summary.pending>0?"text-primary":""}`,children:a.groupKey})]})}),n(a),(0,d.jsx)(t,{item:a.summary,viewMode:j,isSummary:!0})]}),p.has(a.groupKey)&&a.items.map(a=>(0,d.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[m(a),(0,d.jsx)(t,{item:a,viewMode:j})]},`detail-${a.key}`))]},a.groupKey)),0===c.length&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:w,className:"px-6 py-8 text-center text-text-muted",children:o})})]})]})})]})}s.propTypes={field:m().string.isRequired,currentSort:m().string.isRequired,currentOrder:m().string.isRequired},t.propTypes={item:m().object.isRequired,viewMode:m().string.isRequired,isSummary:m().bool},u.propTypes={title:m().string.isRequired,columns:m().arrayOf(m().shape({field:m().string.isRequired,label:m().string.isRequired,align:m().string})).isRequired,groupedData:m().array.isRequired,tableType:m().string.isRequired,sortBy:m().string.isRequired,sortOrder:m().string.isRequired,onToggleSort:m().func.isRequired,viewMode:m().string.isRequired,storageKey:m().string.isRequired,renderDetailCells:m().func.isRequired,renderSummaryCells:m().func.isRequired,emptyMessage:m().string.isRequired};var v=c(90314),w=c(48679),x=c(70452),y=c(5277),z=c(22393),A=c(54206),B=c(96317),C=c(66355);let D=a=>a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a||0),E=a=>`$${(a||0).toFixed(4)}`;function F({period:a="7d",refreshKey:b=0}){let[c,f]=(0,e.useState)([]),[g,h]=(0,e.useState)(!0),[i,j]=(0,e.useState)("tokens");(0,e.useCallback)(async()=>{h(!0);try{let b=Intl.DateTimeFormat().resolvedOptions().timeZone,c=await fetch(`/api/usage/chart?period=${a}&tz=${encodeURIComponent(b)}`);if(c.ok){let a=await c.json();f(a)}}catch(a){console.error("Failed to fetch chart data:",a)}finally{h(!1)}},[a,b]);let l=c.some(a=>a.tokens>0||a.cost>0);return(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col gap-3 p-3 sm:p-4",children:[(0,d.jsxs)("div",{className:"grid w-full grid-cols-2 items-center gap-1 rounded-lg border border-border bg-bg-subtle p-1 sm:w-auto sm:self-start",children:[(0,d.jsx)("button",{onClick:()=>j("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===i?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"}),(0,d.jsx)("button",{onClick:()=>j("cost"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"cost"===i?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Cost"})]}),g?(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"Loading..."}):l?(0,d.jsx)(w.u,{width:"100%",height:220,children:(0,d.jsxs)(x.Q,{data:c,margin:{top:4,right:8,left:0,bottom:0},children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:"gradTokens",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#6366f1",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#6366f1",stopOpacity:0})]}),(0,d.jsxs)("linearGradient",{id:"gradCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#f59e0b",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#f59e0b",stopOpacity:0})]})]}),(0,d.jsx)(y.d,{strokeDasharray:"3 3",strokeOpacity:.1}),(0,d.jsx)(z.W,{dataKey:"label",tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,interval:"preserveStartEnd"}),(0,d.jsx)(A.h,{tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,tickFormatter:"tokens"===i?D:E,width:50}),(0,d.jsx)(B.m,{contentStyle:{backgroundColor:"var(--color-bg)",border:"1px solid var(--color-border)",borderRadius:"8px",fontSize:"12px"},formatter:(a,b)=>"tokens"===b?[D(a),"Tokens"]:[E(a),"Cost"]}),"tokens"===i?(0,d.jsx)(C.Gk,{type:"monotone",dataKey:"tokens",stroke:"#6366f1",strokeWidth:2,fill:"url(#gradTokens)",dot:!1,activeDot:{r:4}}):(0,d.jsx)(C.Gk,{type:"monotone",dataKey:"cost",stroke:"#f59e0b",strokeWidth:2,fill:"url(#gradCost)",dot:!1,activeDot:{r:4}})]})}):(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"No data for this period"})]})}F.propTypes={period:m().string,refreshKey:m().number};let G=(0,v.default)(async()=>{},{loadableGenerated:{modules:["shared/components/UsageStats.js -> @/app/(dashboard)/dashboard/usage/components/ProviderTopology"]},ssr:!1});function H({timestamp:a}){let b,[,c]=(0,e.useState)(0);return(0,d.jsx)(d.Fragment,{children:(b=Math.floor((Date.now()-new Date(a))/1e3))<60?`${b}s ago`:b<3600?`${Math.floor(b/60)}m ago`:b<86400?`${Math.floor(b/3600)}h ago`:`${Math.floor(b/86400)}d ago`})}function I({requests:a=[]}){let[b,c]=(0,e.useState)(!1);return(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col overflow-hidden",padding:"sm",style:{height:480},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-1 py-2 border-b border-border shrink-0",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:"Recent Requests"}),(0,d.jsxs)("div",{className:"relative grid grid-cols-2 items-center rounded-lg border border-border bg-bg-subtle p-0.5 text-[11px] font-medium",title:"Model ID shows the provider/model id (oc/big-pickle); Model Name shows the bare name (big-pickle)",children:[(0,d.jsx)("span",{"aria-hidden":!0,className:`absolute inset-y-0.5 rounded-md bg-primary shadow-sm transition-all duration-200 ease-in-out ${b?"left-0.5 right-1/2":"left-1/2 right-0.5"}`}),(0,d.jsx)("button",{onClick:()=>c(!0),className:`relative z-10 rounded-md px-2 py-0.5 transition-colors ${b?"text-white":"text-text-muted hover:text-text"}`,children:"Model ID"}),(0,d.jsx)("button",{onClick:()=>c(!1),className:`relative z-10 rounded-md px-2 py-0.5 transition-colors ${b?"text-text-muted hover:text-text":"text-white"}`,children:"Model Name"})]})]}),a.length?(0,d.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,d.jsxs)("table",{className:"w-full min-w-[300px] border-collapse text-xs",children:[(0,d.jsx)("thead",{className:"sticky top-0 bg-bg z-10",children:(0,d.jsxs)("tr",{className:"border-b border-border",children:[(0,d.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted w-2"}),(0,d.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted",children:"Model"}),(0,d.jsx)("th",{className:"py-1.5 text-center font-semibold text-text-muted",children:"Guard"}),(0,d.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted whitespace-nowrap",children:"In / Out"}),(0,d.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted",children:"When"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border/50",children:a.map((a,c)=>{let e,f,g=!a.status||"ok"===a.status||"success"===a.status,{bare:h,prefixed:j}=(e=a.model||a.requestedModel||"—",f=a.requestedModel&&a.requestedModel.includes("/")?a.requestedModel:a.model&&a.provider?`${i.Xg[a.provider]||a.provider}/${a.model}`:e,{bare:e,prefixed:f}),k=b?j:h;return(0,d.jsxs)("tr",{className:"hover:bg-bg-subtle transition-colors",children:[(0,d.jsx)("td",{className:"py-1.5",children:(0,d.jsx)("span",{className:`block w-1.5 h-1.5 rounded-full ${g?"bg-success":"bg-error"}`})}),(0,d.jsx)("td",{className:"py-1.5 font-mono truncate max-w-[120px]",title:b?h:j,children:k}),(0,d.jsx)("td",{className:"py-1.5 text-center",children:a.convoy?.applied?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded bg-emerald-500/15 px-1.5 py-0.5 text-[10px] text-emerald-500",title:a.convoy.hits?.map(a=>a.ruleName).join(", "),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"filter_alt"}),a.convoy.hits?.length||0]}):(0,d.jsx)("span",{className:"text-text-muted",children:"-"})}),(0,d.jsxs)("td",{className:"py-1.5 text-right whitespace-nowrap",children:[(0,d.jsxs)("span",{className:"text-primary",children:[p(a.promptTokens),"↑"]})," ",(0,d.jsxs)("span",{className:"text-success",children:[p(a.completionTokens),"↓"]})]}),(0,d.jsx)("td",{className:"py-1.5 text-right text-text-muted whitespace-nowrap",children:(0,d.jsx)(H,{timestamp:a.timestamp})})]},c)})})]})}):(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center text-text-muted text-sm",children:"No requests yet."})]})}function J(a,b={},c,d){return Object.entries(a||{}).map(([a,c])=>{let d=(c.promptTokens||0)+(c.completionTokens||0),e=c.cost||0,f=c.cachedTokens||0,g=Math.max(0,(c.promptTokens||0)-f),h=d>0?(c.completionTokens||0)*(e/d):0;return{...c,key:a,totalTokens:d,totalCost:e,inputCost:d>0?e/d*g:0,cachedCost:d>0?e/d*f:0,outputCost:h,pending:b[a]||0}}).sort((a,b)=>{let e=a[c],f=b[c];return("string"==typeof e&&(e=e.toLowerCase()),"string"==typeof f&&(f=f.toLowerCase()),e<f)?"asc"===d?-1:1:e>f?"asc"===d?1:-1:0})}function K(a,b){if(!Array.isArray(a))return[];let c={};return a.forEach(a=>{let d=function(a,b){switch(b){case"rawModel":return a.rawModel||"Unknown Model";case"accountName":return a.accountName||`Account ${a.connectionId?.slice(0,8)}...`||"Unknown Account";case"keyName":return a.keyName||"Unknown Key";case"endpoint":return a.endpoint||"Unknown Endpoint";default:return a[b]||"Unknown"}}(a,b);c[d]||(c[d]={groupKey:d,summary:{requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,totalTokens:0,cost:0,inputCost:0,cachedCost:0,outputCost:0,lastUsed:null,pending:0},items:[]});let e=c[d].summary;e.requests+=a.requests||0,e.promptTokens+=a.promptTokens||0,e.completionTokens+=a.completionTokens||0,e.cachedTokens+=a.cachedTokens||0,e.totalTokens+=a.totalTokens||0,e.cost+=a.cost||0,e.inputCost+=a.inputCost||0,e.cachedCost+=a.cachedCost||0,e.outputCost+=a.outputCost||0,e.pending+=a.pending||0,a.lastUsed&&(!e.lastUsed||new Date(a.lastUsed)>new Date(e.lastUsed))&&(e.lastUsed=a.lastUsed),c[d].items.push(a)}),Object.values(c)}function L(a){return 1===a.items.length?a.items[0]:null}let M=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],N=[{field:"accountName",label:"Account"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],O=[{field:"keyName",label:"API Key Name"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],P=[{field:"endpoint",label:"Endpoint"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],Q=[{value:"model",label:"Usage by Model"},{value:"account",label:"Usage by Account"},{value:"apiKey",label:"Usage by API Key"},{value:"endpoint",label:"Usage by Endpoint"}],R=h.T1;function S({period:a,setPeriod:b,hidePeriodSelector:c=!1}={}){let h=(0,f.useRouter)(),i=(0,f.useSearchParams)(),k=i.get("sortBy")||"rawModel",l=i.get("sortOrder")||"asc",[m,n]=(0,e.useState)(null),[q,s]=(0,e.useState)(!0),[t,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)("model"),[y,z]=(0,e.useState)("tokens"),[A,B]=(0,e.useState)([]),[C,D]=(0,e.useState)([]),[E,H]=(0,e.useState)("today");(0,e.useRef)(!0),(0,e.useRef)(!1),(0,e.useRef)(null);let T=a??E,U=b??H,V=(0,e.useCallback)((a,b)=>{let c=new URLSearchParams(i.toString());c.get("sortBy")===b?c.set("sortOrder","asc"===c.get("sortOrder")?"desc":"asc"):(c.set("sortBy",b),c.set("sortOrder","asc")),h.replace(`?${c.toString()}`,{scroll:!1})},[i,h]),W=(0,e.useMemo)(()=>{if(!m)return null;switch(w){case"model":{let a=m.pending?.byModel||{};return{columns:M,groupedData:K(J(m.byModel,a,k,l),"rawModel"),storageKey:"usage-stats:expanded-models",emptyMessage:"No usage recorded yet.",renderSummaryCells:a=>{let b=L(a);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3",children:b?(0,d.jsx)(j.default,{variant:b.pending>0?"primary":"neutral",size:"sm",children:b.provider||"—"}):(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.summary.lastUsed)})]})},renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(j.default,{variant:a.pending>0?"primary":"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.lastUsed)})]})}}case"account":{let a={};return m?.pending?.byAccount&&Object.entries(m.byAccount||{}).forEach(([b,c])=>{let d=m.pending.byAccount[c.connectionId];if(d){let e=c.provider?`${c.rawModel} (${c.provider})`:c.rawModel;a[b]=d[e]||0}}),{columns:N,groupedData:K(J(m.byAccount,a,k,l),"accountName"),storageKey:"usage-stats:expanded-accounts",emptyMessage:"No account-specific usage recorded yet.",renderSummaryCells:a=>{let b=L(a);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3",children:b?.rawModel||(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3",children:b?(0,d.jsx)(j.default,{variant:b.pending>0?"primary":"neutral",size:"sm",children:b.provider||"—"}):(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.summary.lastUsed)})]})},renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.accountName||`Account ${a.connectionId?.slice(0,8)}...`}),(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(j.default,{variant:a.pending>0?"primary":"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.lastUsed)})]})}}case"apiKey":return{columns:O,groupedData:K(J(m.byApiKey,{},k,l),"keyName"),storageKey:"usage-stats:expanded-apikeys",emptyMessage:"No API key usage recorded yet.",renderSummaryCells:a=>{let b=L(a);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3",children:b?.rawModel||(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3",children:b?(0,d.jsx)(j.default,{variant:"neutral",size:"sm",children:b.provider||"—"}):(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.summary.lastUsed)})]})},renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 font-medium",children:a.keyName}),(0,d.jsx)("td",{className:"px-6 py-3",children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(j.default,{variant:"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.lastUsed)})]})};default:return{columns:P,groupedData:K(J(m.byEndpoint,{},k,l),"endpoint"),storageKey:"usage-stats:expanded-endpoints",emptyMessage:"No endpoint usage recorded yet.",renderSummaryCells:a=>{let b=L(a);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3",children:b?.rawModel||(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3",children:b?(0,d.jsx)(j.default,{variant:"neutral",size:"sm",children:b.provider||"—"}):(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.summary.lastUsed)})]})},renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 font-medium font-mono text-sm",children:a.endpoint}),(0,d.jsx)("td",{className:"px-6 py-3",children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(j.default,{variant:"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.lastUsed)})]})}}},[m,w,k,l]);if(!m&&!q)return(0,d.jsx)("div",{className:"text-text-muted",children:"Failed to load usage statistics."});let X=(0,d.jsx)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px] animate-spin",children:"progress_activity"})}),Y=(0,e.useMemo)(()=>{let a={};return m?.byModel&&Object.values(m.byModel).forEach(b=>{let c=b.provider?.toLowerCase();c&&(a[c]||(a[c]=new Set),b.rawModel&&a[c].add(b.rawModel))}),A.map(b=>{let c=b.provider?.toLowerCase(),d=((g.Q2[c]||g.Q2[b.provider]||{}).models||[]).map(a=>"string"==typeof a?a:a.id).filter(Boolean),e=Array.from(new Set([...a[c]?Array.from(a[c]):[],...d]));return 0===e.length&&("antigravity"===c?e=["gemini-2.5-flash","gemini-3-flash","claude-sonnet-4-6"]:"codex"===c?e=["gpt-5.4","gpt-5.4-mini","gpt-4o"]:"groq"===c?e=["llama-3.3-70b-versatile","llama-3.1-8b-instant"]:"cerebras"===c?e=["llama-3.3-70b","llama3.1-8b"]:"mistral"===c?e=["codestral-latest","mistral-large-latest"]:"deepseek"===c?e=["deepseek-chat","deepseek-coder"]:"openrouter"===c?e=["auto","free"]:"opencode"===c&&(e=["deepseek-v4-flash-free"])),e.length>6&&(e=e.slice(0,6)),{...b,models:e}})},[A,m?.byModel]);return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[!c&&(0,d.jsxs)("div",{className:"flex w-full items-center gap-2 sm:w-auto sm:self-end",children:[(0,d.jsx)("div",{className:"flex flex-1 flex-wrap items-center gap-1 rounded-lg border border-border bg-bg-subtle p-1 sm:flex-none",children:R.map(a=>(0,d.jsx)("button",{onClick:()=>U(a.value),disabled:t,className:`rounded-md px-3 py-1 text-sm font-medium transition-colors ${T===a.value?"bg-primary text-white shadow-sm":"text-text-muted hover:bg-bg-hover hover:text-text"}`,children:a.label},a.value))}),t&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted animate-spin",children:"progress_activity"})]}),q?X:(0,d.jsx)(o,{stats:m}),q?X:(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-1 items-stretch gap-2 lg:grid-cols-[minmax(0,2fr)_minmax(280px,1fr)]",children:[(0,d.jsx)(G,{providers:Y,activeRequests:m.activeRequests||[],lastProvider:m.recentRequests?.[0]?.provider||"",errorProvider:m.errorProvider||"",rules:C}),(0,d.jsx)(I,{requests:m.recentRequests||[]})]}),q?X:(0,d.jsx)(F,{period:T,refreshKey:m.totalRequests}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("select",{value:w,onChange:a=>x(a.target.value),className:"w-full rounded-lg border border-border bg-surface px-3 py-1.5 text-sm font-medium text-text-main focus:outline-none focus:ring-2 focus:ring-primary/50 sm:w-auto",style:{colorScheme:"auto"},children:Q.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))}),(0,d.jsxs)("div",{className:"grid grid-cols-2 items-center gap-1 rounded-lg border border-border bg-bg-subtle p-1 sm:flex",children:[(0,d.jsx)("button",{onClick:()=>z("costs"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"costs"===y?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Costs"}),(0,d.jsx)("button",{onClick:()=>z("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===y?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"})]})]}),q?X:W&&(0,d.jsx)(u,{title:"",columns:W.columns,groupedData:W.groupedData,tableType:w,sortBy:k,sortOrder:l,onToggleSort:V,viewMode:y,storageKey:W.storageKey,renderSummaryCells:W.renderSummaryCells,renderDetailCells:W.renderDetailCells,emptyMessage:W.emptyMessage})]})]})}},60971:(a,b,c)=>{c.d(b,{default:()=>p});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(95145),i=c(72738),j=c(38930),k=c(29476),l=c(91431),m=c(92592);let n=[...Object.keys(m.zN),...Object.keys(m.IS),...Object.keys(m.nJ),...Object.keys(m.fg)],o=Object.keys(m.IS).filter(a=>m.IS[a].noAuth);function p({isOpen:a,onClose:b,onSelect:c,onDeselect:f,selectedModel:g,activeProviders:q=[],title:r="Select Model",modelAliases:s={},kindFilter:t=null,capFilter:u=null,addedModelValues:v=[],closeOnSelect:w=!0,comboContext:x=null}){let y=(0,e.useMemo)(()=>t?q.filter(a=>{let b=m.Q2[a.provider];return(b?.serviceKinds||["llm"]).includes(t)}):q,[q,t]),{getCaps:z}=(0,k.y)(),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)([]),[E,F]=(0,e.useState)([]),[G,H]=(0,e.useState)([]),[I,J]=(0,e.useState)({}),[K,L]=(0,e.useState)([]);(0,e.useMemo)(()=>q.filter(a=>"cursor"===a.provider&&a.id).map(a=>a.id),[q]);let M=(0,e.useMemo)(()=>({...m.zN,...m.IS,...m.nJ,...m.fg}),[]),N=(0,e.useMemo)(()=>{let a={},b=new Set(["webSearch","webFetch"]),c=new Set(["image","tts","stt","embedding","imageToText"]),d=new Set(["tts","image","webFetch"]);return[...new Set([...y.map(a=>a.provider),...t?o.filter(a=>(m.Q2[a]?.serviceKinds||["llm"]).includes(t)):o])].sort((a,b)=>{let c=n.indexOf(a),d=n.indexOf(b);return(-1===c?999:c)-(-1===d?999:d)}).forEach(e=>{let f=(0,m.wG)(e),g=M[e]||{name:e,color:"#666"},h=(0,m.mq)(e)||(0,m.gb)(e);if(t&&b.has(t)){a[e]={name:g.name,alias:f,color:g.color,models:[{id:e,name:g.name,value:e}]};return}if(g.passthroughModels){let b=Object.entries(s).filter(([,a])=>a.startsWith(`${f}/`)).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b})),h=G.filter(a=>a.providerAlias===f).map(a=>({id:a.id,name:a.name||a.id,value:`${f}/${a.id}`,kind:(0,l.CP)(a),isCustom:!0})),i=b;if(t&&c.has(t)){let a=h.filter(a=>(0,l.CP)(a)===t);0===(i=[...a,...(0,l.KC)(e).filter(a=>(0,l.CP)(a)===t).map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,kind:(0,l.CP)(a)})).filter(b=>!a.some(a=>a.value===b.value))]).length&&d.has(t)&&(g.serviceKinds||["llm"]).includes(t)&&(i=[{id:e,name:g.name,value:f}])}else{let a=h.filter(a=>!(0,l.CP)(a)||"llm"===(0,l.CP)(a)),c=new Set([...b,...a].map(a=>a.value)),d=(0,l.KC)(e).filter(a=>!(0,l.CP)(a)||"llm"===(0,l.CP)(a)).map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,kind:(0,l.CP)(a)})).filter(a=>!c.has(a.value));i=[...a,...b.filter(b=>!a.some(a=>a.value===b.value)),...d]}if(i.length>0){let b=E.find(a=>a.id===e),c=b?.name||g.name;a[e]={name:c,alias:f,color:g.color,models:i}}}else if(h){if(t&&c.has(t))return;let b=q.find(a=>a.provider===e),d=E.find(a=>a.id===e),f=d?.name||b?.name||g.name,h=b?.providerSpecificData?.prefix||d?.prefix||e,i=Object.entries(s).filter(([,a])=>a.startsWith(`${e}/`)).map(([a,b])=>({id:b.replace(`${e}/`,""),name:a,value:`${h}/${b.replace(`${e}/`,"")}`})),j=G.filter(a=>a.providerAlias===e).map(a=>({id:a.id,name:a.name||a.id,value:`${h}/${a.id}`,isCustom:!0})),k=new Set(i.map(a=>a.value)),l=[...i,...j.filter(a=>!k.has(a.value))],m=l.length>0?l:[{id:`__placeholder__${e}`,name:`${h}/model-id`,value:`${h}/model-id`,isPlaceholder:!0}];a[e]={name:f,alias:h,color:g.color,models:m,isCustom:!0,hasModels:l.length>0}}else{var i;let b="cursor"===e&&K.length>0?K:(0,l.KC)(e),h=new Set(b.map(a=>a.id)),j=b.length>0,k=Object.entries(s).filter(([a,b])=>b.startsWith(`${f}/`)&&(!j||a===b.replace(`${f}/`,""))&&!h.has(b.replace(`${f}/`,""))).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b,isCustom:!0})),m=new Set(k.map(a=>a.id)),n=G.filter(a=>a.providerAlias===f&&!h.has(a.id)&&!m.has(a.id)).map(a=>({id:a.id,name:a.name||a.id,value:`${f}/${a.id}`,isCustom:!0})),o=[...b.map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,kind:(0,l.CP)(a)})),...k,...n],p=new Set,q=(i=o.filter(a=>!p.has(a.value)&&(p.add(a.value),!0)),t?c.has(t)?i.filter(a=>a.isPlaceholder||(0,l.CP)(a)===t):i:i.filter(a=>a.isPlaceholder||a.isCustom||!(0,l.CP)(a)||"llm"===(0,l.CP)(a)));0===q.length&&t&&d.has(t)&&(g.serviceKinds||["llm"]).includes(t)&&(q=[{id:e,name:g.name,value:f}]),q.length>0&&(a[e]={name:g.name,alias:f,color:g.color,models:q})}}),Object.entries(a).forEach(([b,c])=>{let d=new Set([...I[(0,m.wG)(b)]||[],...I[b]||[]]);0!==d.size&&(c.models=c.models.filter(a=>!d.has(a.id)),0===c.models.length&&delete a[b])}),a},[y,s,M,E,G,I,t,q,K]),O=(0,e.useMemo)(()=>{if(t||u)return[];if(!A.trim())return C;let a=A.toLowerCase();return C.filter(b=>b.name.toLowerCase().includes(a))},[C,A,t]),P=function(a,b){let c=b?.name?.trim(),d=b?.id;if(!c&&!d)return new Set;let e=new Map(a.filter(a=>a.id!==d).map(a=>[a.name,Array.isArray(a.models)?a.models:[]])),f=(a,b=new Set)=>{if(c&&a===c)return!0;if(b.has(a))return!1;let d=e.get(a);if(!d)return!1;b.add(a);let g=d.some(a=>f(a,b));return b.delete(a),g};return new Set(a.filter(a=>a.id===d||f(a.name)).map(a=>a.name))}(C,x),Q=(0,e.useMemo)(()=>{let a=A.trim().toLowerCase(),b={};return Object.entries(N).forEach(([c,d])=>{var e;let f=d.models;if(!u||0!==(f=f.filter(a=>z(a.value)?.[u]===!0)).length){if(a){let b=d.name.toLowerCase().includes(a);if(0===(f=f.filter(b=>b.name.toLowerCase().includes(a)||b.id.toLowerCase().includes(a))).length&&!b)return}b[c]={...d,models:[...(e=f).filter(a=>v.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name)),...e.filter(a=>!v.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name))]}}}),b},[N,A,v]),R=a=>{let d=a?.value||a?.name||a;v.includes(d)&&f?f(a):c(a),w&&(b(),B(""))};return(0,d.jsxs)(h.default,{isOpen:a,onClose:()=>{b(),B("")},title:r,size:"md",className:"p-4!",footer:null,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-2.5 py-2 bg-primary/8 border border-primary/20 rounded-lg text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0",style:{fontSize:"14px"},children:"info"}),(0,d.jsx)("span",{children:"Click to add, click again to remove. Changes are saved automatically."})]}),(0,d.jsx)("div",{className:"mb-3",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,d.jsx)("input",{type:"text",placeholder:"Search...",value:A,onChange:a=>B(a.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,d.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-3",children:[O.length>0&&(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)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",O.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:O.map(a=>{let b=g===a.name,c=v.includes(a.name),e=!c&&P.has(a.name);return(0,d.jsxs)("button",{disabled:e,onClick:()=>R({id:a.name,name:a.name,value:a.name}),title:e?"Selecting this combo would create a circular reference":void 0,className:`
|
|
11
|
+
`}),a})(),"combo-test-summary"),className:"text-[11px] text-primary hover:underline flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"combo-test-summary"===z?"check":"content_copy"}),"combo-test-summary"===z?"Copied Summary":"Copy Diagnostic Summary"]})]}),(0,d.jsx)("div",{className:"flex flex-col gap-2 max-h-[320px] overflow-y-auto custom-scrollbar pr-1",children:u.steps?.map(a=>(0,d.jsxs)("div",{className:`rounded-lg border p-3 text-xs transition-all ${a.servedRequest?"border-emerald-500/40 bg-emerald-500/5 dark:bg-emerald-500/10 shadow-xs":a.fallbackTriggered?"border-amber-500/40 bg-amber-500/5 dark:bg-amber-500/10":"border-border-subtle bg-surface-2 opacity-60"}`,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)("span",{className:`size-5 rounded-full flex items-center justify-center font-bold text-[10px] shrink-0 ${a.servedRequest?"bg-emerald-500 text-white":a.fallbackTriggered?"bg-amber-500 text-white":"bg-black/20 dark:bg-white/20 text-text-muted"}`,children:a.index}),(0,d.jsx)("code",{className:"font-mono text-xs font-semibold text-text-main truncate",children:a.model})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[a.servedRequest&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 font-semibold px-2 py-0.5 text-[10px]",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"verified"}),"SERVED REQUEST"]}),a.fallbackTriggered&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-500/20 text-amber-700 dark:text-amber-300 font-semibold px-2 py-0.5 text-[10px]",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),"FALLBACK TRIGGERED"]}),a.skipped&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-black/10 dark:bg-white/10 text-text-muted font-medium px-2 py-0.5 text-[10px]",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"skip_next"}),"SKIPPED"]}),!a.skipped&&(0,d.jsxs)("span",{className:"font-mono text-[11px] text-text-muted",children:[a.latencyMs,"ms"]})]})]}),a.fallbackTriggered&&(0,d.jsxs)("div",{className:"mt-2 rounded bg-red-500/10 border border-red-500/20 p-2 font-mono text-[11px] text-red-500 break-words",children:[(0,d.jsx)("span",{className:"font-bold",children:"Error: "}),a.error||`HTTP ${a.status}`]}),a.servedRequest&&a.preview&&(0,d.jsxs)("div",{className:"mt-2 rounded bg-surface p-2 border border-emerald-500/30 text-[11px] text-text-main font-mono whitespace-pre-wrap max-h-24 overflow-y-auto custom-scrollbar",children:[(0,d.jsx)("span",{className:"text-[10px] text-emerald-600 dark:text-emerald-400 font-bold block mb-0.5",children:"Output Preview:"}),a.preview]}),a.skipped&&(0,d.jsx)("div",{className:"mt-1 text-[11px] text-text-muted italic",children:a.reason})]},a.index))})]})]})]})})}},43182:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);let i="https://gitlab.com";function j({isOpen:a,providerInfo:b,onSuccess:c,onClose:f}){let[g,k]=(0,e.useState)(null),[l,m]=(0,e.useState)(i),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(null),B=()=>{k(null),m(i),o(""),q(""),s(""),w(null),u(!1),y(!1),A(null),f()},C=async()=>{if(!r.trim())return void w("Personal Access Token is required");u(!0),w(null);try{let a=await fetch("/api/oauth/gitlab/pat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:r.trim(),baseUrl:l.trim()||i})}),b=await a.json();if(!a.ok)throw Error(b.error||"Authentication failed");c?.(),B()}catch(a){w(a.message)}finally{u(!1)}};return a?x&&z?(0,d.jsx)(h.LF,{isOpen:!0,provider:"gitlab",providerInfo:b,oauthMeta:z,onSuccess:()=>{c?.(),B()},onClose:()=>{y(!1),A(null)}}):(0,d.jsx)(h.aF,{isOpen:a,title:"Connect GitLab Duo",onClose:B,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Choose how to authenticate with GitLab Duo:"}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsxs)("button",{onClick:()=>k("oauth"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"OAuth App"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab OAuth application"})]})]}),(0,d.jsxs)("button",{onClick:()=>k("pat"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Personal Access Token"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab PAT with api scope"})]})]})]})]}),"oauth"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Create an OAuth app at"," ",(0,d.jsx)("a",{href:`${l.trim()||i}/-/profile/applications`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Applications"})," ","with redirect URI"," ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"http://localhost/callback"})]}),(0,d.jsx)(h.pd,{label:"GitLab Base URL",value:l,onChange:a=>m(a.target.value),placeholder:i}),(0,d.jsx)(h.pd,{label:"Client ID",value:n,onChange:a=>o(a.target.value),placeholder:"Your OAuth application client ID"}),(0,d.jsx)(h.pd,{label:"Client Secret (optional for PKCE)",value:p,onChange:a=>q(a.target.value),placeholder:"Leave empty for public PKCE app"}),v&&(0,d.jsx)("p",{className:"text-sm text-red-500",children:v}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>{n.trim()?(w(null),A({baseUrl:l.trim()||i,clientId:n.trim(),clientSecret:p.trim()}),y(!0)):w("Client ID is required")},fullWidth:!0,disabled:!n.trim(),children:"Authorize"}),(0,d.jsx)(h.$n,{onClick:()=>{k(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"pat"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Create a PAT at"," ",(0,d.jsx)("a",{href:`${l.trim()||i}/-/user_settings/personal_access_tokens`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Access Tokens"})," ","with scopes: ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"api"}),","," ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"read_user"}),", and"," ",(0,d.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"ai_features"}),"."]}),(0,d.jsx)(h.pd,{label:"GitLab Base URL",value:l,onChange:a=>m(a.target.value),placeholder:i}),(0,d.jsx)(h.pd,{label:"Personal Access Token",value:r,onChange:a=>s(a.target.value),placeholder:"glpat-****************",type:"password"}),v&&(0,d.jsx)("p",{className:"text-sm text-red-500",children:v}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:C,fullWidth:!0,disabled:!r.trim()||t,loading:t,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:()=>{k(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}j.propTypes={isOpen:g().bool.isRequired,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired}},45623:(a,b,c)=>{c.d(b,{default:()=>n});var d=c(48249),e=c(67484),f=c(19099),g=c(41371),h=c(17174),i=c(32456),j=c(12020),k=c(17447),l=c(54510);function m(){let[a,b]=(0,e.useState)(!1),[c,f]=(0,e.useState)(null),[g,h]=(0,e.useState)(null),[i,m]=(0,e.useState)([]),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1);return a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"pointer-events-auto w-full rounded-lg border border-green-500/30 bg-green-500/10 text-green-800 dark:text-green-200 shadow-lg backdrop-blur-sm px-3 py-2.5",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5 text-green-600 dark:text-green-400 shrink-0",children:"celebration"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:"text-xs font-semibold",children:["Updated to v",g,c?(0,d.jsxs)("span",{className:"font-normal opacity-80",children:[" (from v",c,")"]}):null]}),!r&&0===i.length&&(0,d.jsx)("p",{className:"text-[11px] opacity-80 mt-0.5",children:"You're on the latest install."}),r&&i.length>0&&(0,d.jsxs)("ul",{className:"mt-1.5 space-y-0.5 text-[11px] opacity-90 list-disc list-inside",children:[i.map((a,b)=>(0,d.jsx)("li",{className:"truncate",title:a.text,children:a.text},`${a.version}-${b}`)),n&&(0,d.jsx)("li",{className:"list-none opacity-70 pl-0",children:"…and more"})]}),(0,d.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2",children:[i.length>0&&(0,d.jsx)("button",{type:"button",onClick:()=>s(a=>!a),className:"text-[11px] font-medium underline-offset-2 hover:underline",children:r?"Hide changes":"See what changed"}),(0,d.jsx)("button",{type:"button",onClick:()=>q(!0),className:"text-[11px] font-medium underline-offset-2 hover:underline opacity-80",children:"Full changelog"})]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>{(0,k.yM)(j.vQ.version),b(!1)},className:"text-current/70 hover:text-current shrink-0","aria-label":"Dismiss",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]})}),(0,d.jsx)(l.default,{isOpen:p,onClose:()=>q(!1)})]}):null}function n({children:a}){let[b,c]=(0,e.useState)(!1),j=(0,f.usePathname)(),k=(0,g.i)(a=>a.notifications),l=(0,g.i)(a=>a.removeNotification);return(0,d.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[(0,d.jsxs)("div",{className:"fixed top-4 right-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",children:[(0,d.jsx)(m,{}),k.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",{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",{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:()=>l(a.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},a.id)})]}),b&&(0,d.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 lg:hidden",onClick:()=>c(!1)}),(0,d.jsx)("div",{className:"hidden lg:flex",children:(0,d.jsx)(h.default,{})}),(0,d.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-300 ease-in-out ${b?"translate-x-0":"-translate-x-full"}`,children:(0,d.jsx)(h.default,{onClose:()=>c(!1)})}),(0,d.jsxs)("main",{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"}),(0,d.jsx)(i.default,{onMenuClick:()=>c(!0)},j),(0,d.jsx)("div",{className:`flex-1 overflow-y-auto custom-scrollbar ${"/dashboard/basic-chat"===j?"":"p-6 lg:p-10"} ${"/dashboard/basic-chat"===j?"flex flex-col overflow-hidden":""}`,children:(0,d.jsx)("div",{className:`${"/dashboard/basic-chat"===j?"flex-1 w-full h-full flex flex-col":"max-w-7xl mx-auto"}`,children:a})})]})]})}m.propTypes={}},47814:(a,b,c)=>{c.d(b,{T1:()=>d});let d=[{value:"today",label:"Today"},{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"},{value:"90d",label:"90D"},{value:"180d",label:"180D"},{value:"365d",label:"365D"},{value:"all",label:"All"}];d.map(a=>a.value)},48781:(a,b,c)=>{c.d(b,{default:()=>k});var d=c(48249),e=c(2116),f=c.n(e),g=c(12020);let h=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],i=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],j=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function k(){return(0,d.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,d.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,d.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,d.jsx)("div",{className:"size-6 text-primary",children:(0,d.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,d.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,d.jsx)("span",{className:"text-xl font-bold text-text-main",children:g.vQ.name})]}),(0,d.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,d.jsxs)("div",{className:"flex gap-4",children:[(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:h.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:j.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",g.vQ.name," Inc. All rights reserved."]}),(0,d.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},50377:(a,b,c)=>{c.d(b,{C:()=>e});var d=c(67484);function e(a=2e3){let[b,c]=(0,d.useState)(null),f=(0,d.useRef)(null);return{copied:b,copy:(0,d.useCallback)((b,d="default")=>{(async()=>{if(navigator?.clipboard?.writeText)await navigator.clipboard.writeText(b);else{let a=document.createElement("textarea");a.value=b,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select(),document.execCommand("copy"),document.body.removeChild(a)}})(),c(d),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{c(null)},a)},[a])}}},50412:(a,b,c)=>{c.d(b,{x0:()=>x.default,fA:()=>y.default,Ex:()=>j.default,$n:()=>d.default,nh:()=>E.default,Zp:()=>g.default,Qv:()=>i.CardSkeleton,CK:()=>o.default,St:()=>F.default,uo:()=>h.ConfirmModal,G9:()=>t.default,wI:()=>w.default,vj:()=>v.default,vE:()=>u.default,pd:()=>e.default,Mh:()=>s.default,uR:()=>n.default,Nf:()=>p.default,aF:()=>h.default,rq:()=>m.default,gw:()=>A.default,LF:()=>l.default,dK:()=>z.default,Wx:()=>D.default,gM:()=>r.default,Iz:()=>B.default,l6:()=>f.default,lM:()=>k.default,m_:()=>C.default,jK:()=>q.default});var d=c(99070),e=c(83552),f=c(4770),g=c(17660),h=c(95145),i=c(74812);c(25919);var j=c(75171),k=c(95514);c(53845),c(19308),c(17174),c(32456),c(48781);var l=c(79346),m=c(60971),n=c(39645),o=c(62727),p=c(20084),q=c(59026);c(267),c(29370),c(3236),c(54510);var r=c(91809);c(31457);var s=c(5291);c(56110);var t=c(51109),u=c(79488),v=c(43182),w=c(51585),x=c(67738),y=c(73816),z=c(85158),A=c(50585),B=c(91099),C=c(32971),D=c(11633),E=c(38930),F=c(42285);c(45623),c(53838)},50585:(a,b,c)=>{c.d(b,{default:()=>m});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(17660),i=c(4770),j=c(75171);let k="__none__",l=[{value:"none",label:"None (single pool)"},{value:"round-robin",label:"Round-robin"},{value:"random",label:"Random"}];function m({providerId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(k),[n,o]=(0,e.useState)("none"),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),t=(0,e.useCallback)(async(b,c)=>{q(!0);try{let d=await fetch("/api/settings",{cache:"no-store"}),e=(d.ok?await d.json():{}).providerStrategies||{},f={...e[a]||{}};b===k?delete f.proxyPoolId:f.proxyPoolId=b,"none"===c?delete f.rotateStrategy:f.rotateStrategy=c;let g={...e};0===Object.keys(f).length?delete g[a]:g[a]=f,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:g})}),s(!0),setTimeout(()=>s(!1),1500)}catch(a){console.log("Save proxy config error:",a)}finally{q(!1)}},[a]),u=b.length>=2,v="none"!==n;return(0,d.jsxs)(h.default,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-green-500/10 text-green-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"lock_open"})}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"No authentication required"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"This provider is ready to use. Optionally route requests through a proxy pool to bypass IP-based limits."})]}),r&&(0,d.jsx)(j.default,{variant:"success",size:"sm",children:"Saved"})]}),(0,d.jsx)(i.default,{label:"Proxy Pool",value:f,onChange:a=>{var b;g(b=a.target.value),t(b,n)},disabled:p||v,options:[{value:k,label:"None (direct)"},...b.map(a=>({value:a.id,label:a.name}))],hint:v?"Pool selector is ignored when rotation is active — all active pools are used.":void 0}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 mt-4",children:[(0,d.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Rotation Strategy"}),(0,d.jsx)("select",{value:n,onChange:a=>{var b;o(b=a.target.value),t(f,b)},disabled:p,className:"py-2 px-3 text-sm text-text-main bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none transition-all disabled:opacity-50",children:l.map(a=>(0,d.jsx)("option",{value:a.value,disabled:"none"!==a.value&&!u,children:a.label},a.value))}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:u?v?"round-robin"===n?`Rotating through all ${b.length} active pools in order. State is in-memory (resets on restart).`:`Picking a random pool from ${b.length} active pools each request.`:"Uses the selected pool above. Set to Round-robin or Random to rotate across all active pools.":"Need at least 2 active proxy pools for rotation."})]})]})}m.propTypes={providerId:g().string.isRequired}},51109:(a,b,c)=>{c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onSuccess:b,onClose:c}){let[f,g]=(0,e.useState)(""),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),v=async()=>{q(!0),m(null),s(!1),u(!1);try{let a=await fetch("/api/oauth/cursor/auto-import"),b=await a.json();b.found?(g(b.accessToken),k(b.machineId),s(!0)):b.windowsManual?u(!0):m(b.error||"Could not auto-detect tokens")}catch(a){m("Failed to auto-detect tokens")}finally{q(!1)}},w=async()=>{if(!f.trim())return void m("Please enter an access token");if(!j.trim())return void m("Please enter a machine ID");o(!0),m(null);try{let a=await fetch("/api/oauth/cursor/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:f.trim(),machineId:j.trim()})}),d=await a.json();if(!a.ok)throw Error(d.error||"Import failed");b?.(),c()}catch(a){m(a.message)}finally{o(!1)}};return(0,d.jsx)(h.aF,{isOpen:a,title:"Connect Cursor IDE",onClose:c,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[p&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting tokens..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from Cursor IDE database"})]}),!p&&(0,d.jsxs)(d.Fragment,{children:[r&&(0,d.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",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:"Tokens auto-detected from Cursor IDE successfully!"})]})}),t&&(0,d.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-3 rounded-lg border border-amber-200 dark:border-amber-800 flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Could not read Cursor database automatically."})]}),(0,d.jsxs)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:["Make sure Cursor IDE has been opened at least once, then click ",(0,d.jsx)("strong",{children:"Retry"}),". If the problem persists, paste your tokens manually below."]}),(0,d.jsx)(h.$n,{onClick:v,variant:"outline",fullWidth:!0,children:"Retry"})]}),!r&&!t&&!l&&(0,d.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",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:"Cursor IDE not detected. Please paste your tokens manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Access Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("textarea",{value:f,onChange:a=>g(a.target.value),placeholder:"Access token will be auto-filled...",rows:3,className:"w-full px-3 py-2 text-sm font-mono border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Machine ID ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:j,onChange:a=>k(a.target.value),placeholder:"Machine ID will be auto-filled...",className:"font-mono text-sm"})]}),l&&(0,d.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:l})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:w,fullWidth:!0,disabled:n||!f.trim()||!j.trim(),children:n?"Importing...":"Import Token"}),(0,d.jsx)(h.$n,{onClick:c,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onSuccess:g().func,onClose:g().func.isRequired}},51585:(a,b,c)=>{c.d(b,{default:()=>n});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(95145),i=c(83552),j=c(4770),k=c(99070),l=c(75171),m=c(92592);function n({isOpen:a,connection:b,proxyPools:c,onSave:f,onClose:g}){let[o,p]=(0,e.useState)({name:"",priority:1,apiKey:""}),[q,r]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[s,t]=(0,e.useState)({accountId:""}),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)({location:"global",reasoningEffort:"high"}),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(null),[G,H]=(0,e.useState)(!1),I=b?.authType==="oauth",J=b?.provider==="azure",K=b?.provider==="cloudflare-ai",L=b?.provider==="vertex"||b?.provider==="vertex-partner",M=!!b&&((0,m.mq)(b.provider)||(0,m.gb)(b.provider)),N=b&&m.Q2?.[b.provider]?.regions||null,O=()=>{if(N&&u)return{...b?.providerSpecificData||{},region:u}},P=async()=>{if(b?.provider){z(!0),B(null);try{let a=await fetch(`/api/providers/${b.id}/test`,{method:"POST"}),c=await a.json();B(c.valid?"success":"failed")}catch{B("failed")}finally{z(!1)}}},Q=async()=>{if(b?.provider&&o.apiKey){D(!0),F(null);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b.provider,apiKey:o.apiKey,...J?{providerSpecificData:q}:{},...K?{providerSpecificData:s}:{},...N?{providerSpecificData:O()}:{},...L?{providerSpecificData:w}:{}})}),c=await a.json();F(c.valid?"success":"failed")}catch{F("failed")}finally{D(!1)}}},R=async()=>{if(b){H(!0);try{let a={name:o.name,priority:o.priority};if(!I&&o.apiKey){a.apiKey=o.apiKey;let c="success"===E;if(!c)try{D(!0),F(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b.provider,apiKey:o.apiKey,...J?{providerSpecificData:q}:{},...K?{providerSpecificData:s}:{},...N?{providerSpecificData:O()}:{},...L?{providerSpecificData:w}:{}})});c=!!(await a.json()).valid,F(c?"success":"failed")}catch{F("failed")}finally{D(!1)}c&&(a.testStatus="active",a.lastError=null,a.lastErrorAt=null)}J&&(a.providerSpecificData={azureEndpoint:q.azureEndpoint,apiVersion:q.apiVersion,deployment:q.deployment,organization:q.organization}),K&&(a.providerSpecificData={accountId:s.accountId}),N&&u&&(a.providerSpecificData=O()),L&&(a.providerSpecificData={location:w.location||"global",reasoningEffort:w.reasoningEffort||"high"}),await f(a)}finally{H(!1)}}};return b?(0,d.jsx)(h.default,{isOpen:a,title:"Edit Connection",onClose:g,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(i.default,{label:"Name",value:o.name,onChange:a=>p({...o,name:a.target.value}),placeholder:I?"Account name":"Production Key"}),I&&b.email&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,d.jsx)("p",{className:"font-medium",children:b.email})]}),(0,d.jsx)(i.default,{label:"Priority",type:"number",value:o.priority,onChange:a=>p({...o,priority:Number.parseInt(a.target.value,10)||1})}),!I&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(i.default,{label:"API Key",type:"password",value:o.apiKey,onChange:a=>p({...o,apiKey:a.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(k.default,{onClick:Q,disabled:!o.apiKey||C||G,variant:"secondary",children:C?"Checking...":"Check"})})]}),E&&(0,d.jsx)(l.default,{variant:"success"===E?"success":"error",children:"success"===E?"Valid":"Invalid"})]}),J&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(i.default,{label:"Azure Endpoint",value:q.azureEndpoint,onChange:a=>r({...q,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com",hint:"Your Azure OpenAI resource endpoint URL"}),(0,d.jsx)(i.default,{label:"Deployment Name",value:q.deployment,onChange:a=>r({...q,deployment:a.target.value}),placeholder:"gpt-4",hint:"The deployment name in your Azure resource"}),(0,d.jsx)(i.default,{label:"API Version",value:q.apiVersion,onChange:a=>r({...q,apiVersion:a.target.value}),placeholder:"2024-10-01-preview",hint:"Azure OpenAI API version to use"}),(0,d.jsx)(i.default,{label:"Organization",value:q.organization,onChange:a=>r({...q,organization:a.target.value}),placeholder:"Organization ID",hint:"Required for billing"})]})]}),N&&(0,d.jsx)(j.default,{label:"Region",value:u,onChange:a=>v(a.target.value),options:N.map(a=>({value:a.id,label:a.label}))}),L&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Vertex AI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(j.default,{label:"Location",value:w.location,onChange:a=>x({...w,location:a.target.value}),options:[{value:"global",label:"global (recommended for Gemini 3.x)"},{value:"us-central1",label:"us-central1"},{value:"us-east4",label:"us-east4"},{value:"europe-west1",label:"europe-west1"},{value:"europe-west4",label:"europe-west4"},{value:"asia-east1",label:"asia-east1"},{value:"asia-northeast1",label:"asia-northeast1"}]}),(0,d.jsx)(j.default,{label:"Reasoning Effort (default)",value:w.reasoningEffort,onChange:a=>x({...w,reasoningEffort:a.target.value}),options:[{value:"high",label:"high (32k tokens — default for Pro)"},{value:"medium",label:"medium (8k tokens)"},{value:"low",label:"low (1k tokens)"},{value:"",label:"none (let model decide)"}]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Location ",(0,d.jsx)("code",{children:"global"})," is required for Gemini 3.1 Pro Preview."]})]})]}),!M&&!J&&!K&&!L&&(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)(k.default,{onClick:P,variant:"secondary",disabled:y,children:y?"Testing...":"Test Connection"}),A&&(0,d.jsx)(l.default,{variant:"success"===A?"success":"error",children:"success"===A?"Valid":"Failed"})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.default,{onClick:R,fullWidth:!0,disabled:G,children:G?"Saving...":"Save"}),(0,d.jsx)(k.default,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}n.propTypes={isOpen:g().bool.isRequired,connection:g().shape({id:g().string,name:g().string,email:g().string,priority:g().number,authType:g().string,provider:g().string,providerSpecificData:g().object}),proxyPools:g().arrayOf(g().shape({id:g().string,name:g().string})),onSave:g().func.isRequired,onClose:g().func.isRequired}},53838:(a,b,c)=>{c.d(b,{default:()=>h});var d=c(48249),e=c(49885),f=c.n(e),g=c(53845);function h({children:a}){return(0,d.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,d.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,d.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,d.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,d.jsx)(g.default,{variant:"card"})}),(0,d.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:a})]})}h.propTypes={children:f().node.isRequired}},53845:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(48249),e=c(42118),f=c(71404);function g({className:a,variant:b="default"}){let{isDark:c,toggleTheme:h}=(0,e.D)(),i={default:(0,f.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted hover:text-text-main","hover:bg-surface-2 transition-colors"),card:(0,f.cn)("flex items-center justify-center size-11 rounded-full","bg-surface/60 hover:bg-surface","border border-border","backdrop-blur-md shadow-sm hover:shadow-[var(--shadow-warm)]","text-text-muted hover:text-brand-500","transition-all group")};return(0,d.jsx)("button",{onClick:h,className:(0,f.cn)(i[b],a),"aria-label":`Switch to ${c?"light":"dark"} mode`,title:`Switch to ${c?"light":"dark"} mode`,children:(0,d.jsx)("span",{className:(0,f.cn)("material-symbols-outlined text-[22px]","card"===b&&"transition-transform duration-300 group-hover:rotate-12"),children:c?"light_mode":"dark_mode"})})}},54510:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(49885),h=c.n(g),i=c(26921);function j({isOpen:a,onClose:b}){let[c,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[k,l]=(0,e.useState)(""),m=(0,e.useRef)(null);return!a||"u"<typeof document?null:(0,f.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:b}),(0,d.jsxs)("div",{ref:m,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-3xl flex flex-col max-h-[85vh]",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Change Log"}),(0,d.jsx)("button",{onClick:b,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[h&&(0,d.jsxs)("div",{className:"flex items-center justify-center py-10 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"progress_activity"}),"Loading..."]}),k&&(0,d.jsxs)("div",{className:"text-red-500 py-4",children:["Failed to load changelog: ",k]}),!h&&!k&&c&&(0,d.jsx)("div",{className:"changelog-body text-text-main",dangerouslySetInnerHTML:{__html:c}})]})]})]}),document.body)}c(12020),i.xI.setOptions({gfm:!0,breaks:!0}),j.propTypes={isOpen:h().bool.isRequired,onClose:h().func.isRequired}},56110:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);function j({isOpen:a,provider:b,onSuccess:c,onClose:f}){let[g,k]=(0,e.useState)("loading"),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(null),{copied:t,copy:u}=(0,i.C)();(0,e.useRef)(!1);let v=async()=>{try{let a;s(null);try{a=new URL(p)}catch(a){throw Error("Invalid callback URL format")}let d=a.searchParams.get("code");a.searchParams.get("state");let e=a.searchParams.get("error");if(e)throw Error(a.searchParams.get("error_description")||e);if(!d)throw Error("No authorization code found in URL");let f=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:d,codeVerifier:n.codeVerifier,provider:b})}),g=await f.json();if(!f.ok)throw Error(g.error);k("success"),c?.()}catch(a){s(a.message),k("error")}},w="google"===b?"Google":"GitHub";return(0,d.jsx)(h.aF,{isOpen:a,title:`Connect Kiro via ${w}`,onClose:f,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",w," authentication"]})]}),"input"===g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:l,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"auth_url"===t?"check":"content_copy",onClick:()=>u(l,"auth_url"),children:"Copy"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,d.jsx)(h.pd,{value:p,onChange:a=>q(a.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:v,fullWidth:!0,disabled:!p,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",w," has been connected."]}),(0,d.jsx)(h.$n,{onClick:f,fullWidth:!0,children:"Done"})]}),"error"===g&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,d.jsx)("p",{className:"text-sm text-red-600 mb-4",children:r}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>k("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,d.jsx)(h.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}j.propTypes={isOpen:g().bool.isRequired,provider:g().oneOf(["google","github"]).isRequired,onSuccess:g().func,onClose:g().func.isRequired}},59026:(a,b,c)=>{c.d(b,{default:()=>S});var d=c(48249),e=c(67484),f=c(19099),g=c(92592),h=c(47814),i=c(91431),j=c(75171),k=c(17660),l=c(49885),m=c.n(l);let n=a=>new Intl.NumberFormat().format(a||0);function o({stats:a}){let b;return(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5 sm:gap-4",children:[(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold",children:n(a.totalRequests)})]}),(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-primary",children:n(a.totalPromptTokens)})]}),(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Cached Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-info",children:n(a.totalCachedTokens)})]}),(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-success",children:n(a.totalCompletionTokens)})]}),(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Est. Cost"}),(0,d.jsxs)("span",{className:"truncate text-2xl font-bold text-warning",children:["~",(b=a.totalCost,`$${(b||0).toFixed(2)}`)]}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"Estimated, not actual billing"})]})]})}o.propTypes={stats:m().object.isRequired};let p=a=>new Intl.NumberFormat().format(a||0),q=a=>`$${(a||0).toFixed(2)}`;function r(a){if(!a)return"Never";let b=Math.floor((Date.now()-new Date(a))/6e4);return b<1?"Just now":b<60?`${b}m ago`:b<1440?`${Math.floor(b/60)}h ago`:new Date(a).toLocaleDateString()}function s({field:a,currentSort:b,currentOrder:c}){return b!==a?(0,d.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,d.jsx)("span",{className:"ml-1",children:"asc"===c?"↑":"↓"})}function t({item:a,viewMode:b,isSummary:c=!1}){return"tokens"===b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.promptTokens?"—":p(a.promptTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:a.cachedTokens?p(a.cachedTokens):"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.completionTokens?"—":p(a.completionTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:p(a.totalTokens)})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.inputCost?"—":q(a.inputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:a.cachedCost?q(a.cachedCost):"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.outputCost?"—":q(a.outputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:q(a.totalCost||a.cost)})]})}function u({title:a,columns:b,groupedData:c,tableType:f,sortBy:g,sortOrder:h,onToggleSort:i,viewMode:j,storageKey:l,renderDetailCells:m,renderSummaryCells:n,emptyMessage:o}){let[p,q]=(0,e.useState)(new Set),r=(0,e.useCallback)(a=>{q(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),v=(0,e.useMemo)(()=>"tokens"===j?[{field:"promptTokens",label:"Input Tokens"},{field:"cachedTokens",label:"Cached"},{field:"completionTokens",label:"Output Tokens"},{field:"totalTokens",label:"Total Tokens"}]:[{field:"promptTokens",label:"Input Cost"},{field:"cachedCost",label:"Cached Cost"},{field:"completionTokens",label:"Output Cost"},{field:"cost",label:"Total Cost"}],[j]),w=b.length+v.length;return(0,d.jsxs)(k.default,{className:"overflow-hidden",children:[(0,d.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,d.jsx)("h3",{className:"font-semibold",children:a})}),(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,d.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,d.jsxs)("tr",{children:[b.map(a=>(0,d.jsxs)("th",{className:`px-6 py-3 cursor-pointer hover:bg-bg-subtle/50 ${"right"===a.align?"text-right":""}`,onClick:()=>i(f,a.field),children:[a.label," ",(0,d.jsx)(s,{field:a.field,currentSort:g,currentOrder:h})]},a.field)),v.map(a=>(0,d.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>i(f,a.field),children:[a.label," ",(0,d.jsx)(s,{field:a.field,currentSort:g,currentOrder:h})]},a.field))]})}),(0,d.jsxs)("tbody",{className:"divide-y divide-border",children:[c.map(a=>(0,d.jsxs)(e.Fragment,{children:[(0,d.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>r(a.groupKey),children:[(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${p.has(a.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,d.jsx)("span",{className:`font-medium transition-colors ${a.summary.pending>0?"text-primary":""}`,children:a.groupKey})]})}),n(a),(0,d.jsx)(t,{item:a.summary,viewMode:j,isSummary:!0})]}),p.has(a.groupKey)&&a.items.map(a=>(0,d.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[m(a),(0,d.jsx)(t,{item:a,viewMode:j})]},`detail-${a.key}`))]},a.groupKey)),0===c.length&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:w,className:"px-6 py-8 text-center text-text-muted",children:o})})]})]})})]})}s.propTypes={field:m().string.isRequired,currentSort:m().string.isRequired,currentOrder:m().string.isRequired},t.propTypes={item:m().object.isRequired,viewMode:m().string.isRequired,isSummary:m().bool},u.propTypes={title:m().string.isRequired,columns:m().arrayOf(m().shape({field:m().string.isRequired,label:m().string.isRequired,align:m().string})).isRequired,groupedData:m().array.isRequired,tableType:m().string.isRequired,sortBy:m().string.isRequired,sortOrder:m().string.isRequired,onToggleSort:m().func.isRequired,viewMode:m().string.isRequired,storageKey:m().string.isRequired,renderDetailCells:m().func.isRequired,renderSummaryCells:m().func.isRequired,emptyMessage:m().string.isRequired};var v=c(90314),w=c(48679),x=c(70452),y=c(5277),z=c(22393),A=c(54206),B=c(96317),C=c(66355);let D=a=>a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a||0),E=a=>`$${(a||0).toFixed(4)}`;function F({period:a="7d",refreshKey:b=0}){let[c,f]=(0,e.useState)([]),[g,h]=(0,e.useState)(!0),[i,j]=(0,e.useState)("tokens");(0,e.useCallback)(async()=>{h(!0);try{let b=Intl.DateTimeFormat().resolvedOptions().timeZone,c=await fetch(`/api/usage/chart?period=${a}&tz=${encodeURIComponent(b)}`);if(c.ok){let a=await c.json();f(a)}}catch(a){console.error("Failed to fetch chart data:",a)}finally{h(!1)}},[a,b]);let l=c.some(a=>a.tokens>0||a.cost>0);return(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col gap-3 p-3 sm:p-4",children:[(0,d.jsxs)("div",{className:"grid w-full grid-cols-2 items-center gap-1 rounded-lg border border-border bg-bg-subtle p-1 sm:w-auto sm:self-start",children:[(0,d.jsx)("button",{onClick:()=>j("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===i?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"}),(0,d.jsx)("button",{onClick:()=>j("cost"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"cost"===i?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Cost"})]}),g?(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"Loading..."}):l?(0,d.jsx)(w.u,{width:"100%",height:220,children:(0,d.jsxs)(x.Q,{data:c,margin:{top:4,right:8,left:0,bottom:0},children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:"gradTokens",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#6366f1",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#6366f1",stopOpacity:0})]}),(0,d.jsxs)("linearGradient",{id:"gradCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#f59e0b",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#f59e0b",stopOpacity:0})]})]}),(0,d.jsx)(y.d,{strokeDasharray:"3 3",strokeOpacity:.1}),(0,d.jsx)(z.W,{dataKey:"label",tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,interval:"preserveStartEnd"}),(0,d.jsx)(A.h,{tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,tickFormatter:"tokens"===i?D:E,width:50}),(0,d.jsx)(B.m,{contentStyle:{backgroundColor:"var(--color-bg)",border:"1px solid var(--color-border)",borderRadius:"8px",fontSize:"12px"},formatter:(a,b)=>"tokens"===b?[D(a),"Tokens"]:[E(a),"Cost"]}),"tokens"===i?(0,d.jsx)(C.Gk,{type:"monotone",dataKey:"tokens",stroke:"#6366f1",strokeWidth:2,fill:"url(#gradTokens)",dot:!1,activeDot:{r:4}}):(0,d.jsx)(C.Gk,{type:"monotone",dataKey:"cost",stroke:"#f59e0b",strokeWidth:2,fill:"url(#gradCost)",dot:!1,activeDot:{r:4}})]})}):(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"No data for this period"})]})}F.propTypes={period:m().string,refreshKey:m().number};let G=(0,v.default)(async()=>{},{loadableGenerated:{modules:["shared/components/UsageStats.js -> @/app/(dashboard)/dashboard/usage/components/ProviderTopology"]},ssr:!1});function H({timestamp:a}){let b,[,c]=(0,e.useState)(0);return(0,d.jsx)(d.Fragment,{children:(b=Math.floor((Date.now()-new Date(a))/1e3))<60?`${b}s ago`:b<3600?`${Math.floor(b/60)}m ago`:b<86400?`${Math.floor(b/3600)}h ago`:`${Math.floor(b/86400)}d ago`})}function I({requests:a=[]}){let[b,c]=(0,e.useState)(!1);return(0,d.jsxs)(k.default,{className:"flex min-w-0 flex-col overflow-hidden",padding:"sm",style:{height:480},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-1 py-2 border-b border-border shrink-0",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:"Recent Requests"}),(0,d.jsxs)("div",{className:"relative grid grid-cols-2 items-center rounded-lg border border-border bg-bg-subtle p-0.5 text-[11px] font-medium",title:"Model ID shows the provider/model id (oc/big-pickle); Model Name shows the bare name (big-pickle)",children:[(0,d.jsx)("span",{"aria-hidden":!0,className:`absolute inset-y-0.5 rounded-md bg-primary shadow-sm transition-all duration-200 ease-in-out ${b?"left-0.5 right-1/2":"left-1/2 right-0.5"}`}),(0,d.jsx)("button",{onClick:()=>c(!0),className:`relative z-10 rounded-md px-2 py-0.5 transition-colors ${b?"text-white":"text-text-muted hover:text-text"}`,children:"Model ID"}),(0,d.jsx)("button",{onClick:()=>c(!1),className:`relative z-10 rounded-md px-2 py-0.5 transition-colors ${b?"text-text-muted hover:text-text":"text-white"}`,children:"Model Name"})]})]}),a.length?(0,d.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,d.jsxs)("table",{className:"w-full min-w-[300px] border-collapse text-xs",children:[(0,d.jsx)("thead",{className:"sticky top-0 bg-bg z-10",children:(0,d.jsxs)("tr",{className:"border-b border-border",children:[(0,d.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted w-2"}),(0,d.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted",children:"Model"}),(0,d.jsx)("th",{className:"py-1.5 text-center font-semibold text-text-muted",children:"Guard"}),(0,d.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted whitespace-nowrap",children:"In / Out"}),(0,d.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted",children:"When"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border/50",children:a.map((a,c)=>{let e,f,g=!a.status||"ok"===a.status||"success"===a.status,{bare:h,prefixed:j}=(e=a.model||a.requestedModel||"—",f=a.requestedModel&&a.requestedModel.includes("/")?a.requestedModel:a.model&&a.provider?`${i.Xg[a.provider]||a.provider}/${a.model}`:e,{bare:e,prefixed:f}),k=b?j:h;return(0,d.jsxs)("tr",{className:"hover:bg-bg-subtle transition-colors",children:[(0,d.jsx)("td",{className:"py-1.5",children:(0,d.jsx)("span",{className:`block w-1.5 h-1.5 rounded-full ${g?"bg-success":"bg-error"}`})}),(0,d.jsx)("td",{className:"py-1.5 font-mono truncate max-w-[120px]",title:b?h:j,children:k}),(0,d.jsx)("td",{className:"py-1.5 text-center",children:a.convoy?.applied?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded bg-emerald-500/15 px-1.5 py-0.5 text-[10px] text-emerald-500",title:a.convoy.hits?.map(a=>a.ruleName).join(", "),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"filter_alt"}),a.convoy.hits?.length||0]}):(0,d.jsx)("span",{className:"text-text-muted",children:"-"})}),(0,d.jsxs)("td",{className:"py-1.5 text-right whitespace-nowrap",children:[(0,d.jsxs)("span",{className:"text-primary",children:[p(a.promptTokens),"↑"]})," ",(0,d.jsxs)("span",{className:"text-success",children:[p(a.completionTokens),"↓"]})]}),(0,d.jsx)("td",{className:"py-1.5 text-right text-text-muted whitespace-nowrap",children:(0,d.jsx)(H,{timestamp:a.timestamp})})]},c)})})]})}):(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center text-text-muted text-sm",children:"No requests yet."})]})}function J(a,b={},c,d){return Object.entries(a||{}).map(([a,c])=>{let d=(c.promptTokens||0)+(c.completionTokens||0),e=c.cost||0,f=c.cachedTokens||0,g=Math.max(0,(c.promptTokens||0)-f),h=d>0?(c.completionTokens||0)*(e/d):0;return{...c,key:a,totalTokens:d,totalCost:e,inputCost:d>0?e/d*g:0,cachedCost:d>0?e/d*f:0,outputCost:h,pending:b[a]||0}}).sort((a,b)=>{let e=a[c],f=b[c];return("string"==typeof e&&(e=e.toLowerCase()),"string"==typeof f&&(f=f.toLowerCase()),e<f)?"asc"===d?-1:1:e>f?"asc"===d?1:-1:0})}function K(a,b){if(!Array.isArray(a))return[];let c={};return a.forEach(a=>{let d=function(a,b){switch(b){case"rawModel":return a.rawModel||"Unknown Model";case"accountName":return a.accountName||`Account ${a.connectionId?.slice(0,8)}...`||"Unknown Account";case"keyName":return a.keyName||"Unknown Key";case"endpoint":return a.endpoint||"Unknown Endpoint";default:return a[b]||"Unknown"}}(a,b);c[d]||(c[d]={groupKey:d,summary:{requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,totalTokens:0,cost:0,inputCost:0,cachedCost:0,outputCost:0,lastUsed:null,pending:0},items:[]});let e=c[d].summary;e.requests+=a.requests||0,e.promptTokens+=a.promptTokens||0,e.completionTokens+=a.completionTokens||0,e.cachedTokens+=a.cachedTokens||0,e.totalTokens+=a.totalTokens||0,e.cost+=a.cost||0,e.inputCost+=a.inputCost||0,e.cachedCost+=a.cachedCost||0,e.outputCost+=a.outputCost||0,e.pending+=a.pending||0,a.lastUsed&&(!e.lastUsed||new Date(a.lastUsed)>new Date(e.lastUsed))&&(e.lastUsed=a.lastUsed),c[d].items.push(a)}),Object.values(c)}function L(a){return 1===a.items.length?a.items[0]:null}let M=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],N=[{field:"accountName",label:"Account"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],O=[{field:"keyName",label:"API Key Name"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],P=[{field:"endpoint",label:"Endpoint"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],Q=[{value:"model",label:"Usage by Model"},{value:"account",label:"Usage by Account"},{value:"apiKey",label:"Usage by API Key"},{value:"endpoint",label:"Usage by Endpoint"}],R=h.T1;function S({period:a,setPeriod:b,hidePeriodSelector:c=!1}={}){let h=(0,f.useRouter)(),i=(0,f.useSearchParams)(),k=i.get("sortBy")||"rawModel",l=i.get("sortOrder")||"asc",[m,n]=(0,e.useState)(null),[q,s]=(0,e.useState)(!0),[t,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)("model"),[y,z]=(0,e.useState)("tokens"),[A,B]=(0,e.useState)([]),[C,D]=(0,e.useState)([]),[E,H]=(0,e.useState)("today");(0,e.useRef)(!0),(0,e.useRef)(!1),(0,e.useRef)(null);let T=a??E,U=b??H,V=(0,e.useCallback)((a,b)=>{let c=new URLSearchParams(i.toString());c.get("sortBy")===b?c.set("sortOrder","asc"===c.get("sortOrder")?"desc":"asc"):(c.set("sortBy",b),c.set("sortOrder","asc")),h.replace(`?${c.toString()}`,{scroll:!1})},[i,h]),W=(0,e.useMemo)(()=>{if(!m)return null;switch(w){case"model":{let a=m.pending?.byModel||{};return{columns:M,groupedData:K(J(m.byModel,a,k,l),"rawModel"),storageKey:"usage-stats:expanded-models",emptyMessage:"No usage recorded yet.",renderSummaryCells:a=>{let b=L(a);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3",children:b?(0,d.jsx)(j.default,{variant:b.pending>0?"primary":"neutral",size:"sm",children:b.provider||"—"}):(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.summary.lastUsed)})]})},renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(j.default,{variant:a.pending>0?"primary":"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.lastUsed)})]})}}case"account":{let a={};return m?.pending?.byAccount&&Object.entries(m.byAccount||{}).forEach(([b,c])=>{let d=m.pending.byAccount[c.connectionId];if(d){let e=c.provider?`${c.rawModel} (${c.provider})`:c.rawModel;a[b]=d[e]||0}}),{columns:N,groupedData:K(J(m.byAccount,a,k,l),"accountName"),storageKey:"usage-stats:expanded-accounts",emptyMessage:"No account-specific usage recorded yet.",renderSummaryCells:a=>{let b=L(a);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3",children:b?.rawModel||(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3",children:b?(0,d.jsx)(j.default,{variant:b.pending>0?"primary":"neutral",size:"sm",children:b.provider||"—"}):(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.summary.lastUsed)})]})},renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.accountName||`Account ${a.connectionId?.slice(0,8)}...`}),(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(j.default,{variant:a.pending>0?"primary":"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.lastUsed)})]})}}case"apiKey":return{columns:O,groupedData:K(J(m.byApiKey,{},k,l),"keyName"),storageKey:"usage-stats:expanded-apikeys",emptyMessage:"No API key usage recorded yet.",renderSummaryCells:a=>{let b=L(a);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3",children:b?.rawModel||(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3",children:b?(0,d.jsx)(j.default,{variant:"neutral",size:"sm",children:b.provider||"—"}):(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.summary.lastUsed)})]})},renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 font-medium",children:a.keyName}),(0,d.jsx)("td",{className:"px-6 py-3",children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(j.default,{variant:"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.lastUsed)})]})};default:return{columns:P,groupedData:K(J(m.byEndpoint,{},k,l),"endpoint"),storageKey:"usage-stats:expanded-endpoints",emptyMessage:"No endpoint usage recorded yet.",renderSummaryCells:a=>{let b=L(a);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3",children:b?.rawModel||(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3",children:b?(0,d.jsx)(j.default,{variant:"neutral",size:"sm",children:b.provider||"—"}):(0,d.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.summary.lastUsed)})]})},renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 font-medium font-mono text-sm",children:a.endpoint}),(0,d.jsx)("td",{className:"px-6 py-3",children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(j.default,{variant:"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:p(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:r(a.lastUsed)})]})}}},[m,w,k,l]);if(!m&&!q)return(0,d.jsx)("div",{className:"text-text-muted",children:"Failed to load usage statistics."});let X=(0,d.jsx)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px] animate-spin",children:"progress_activity"})}),Y=(0,e.useMemo)(()=>{let a={};return m?.byModel&&Object.values(m.byModel).forEach(b=>{let c=b.provider?.toLowerCase();c&&(a[c]||(a[c]=new Set),b.rawModel&&a[c].add(b.rawModel))}),A.map(b=>{let c=b.provider?.toLowerCase(),d=((g.Q2[c]||g.Q2[b.provider]||{}).models||[]).map(a=>"string"==typeof a?a:a.id).filter(Boolean),e=Array.from(new Set([...a[c]?Array.from(a[c]):[],...d]));return 0===e.length&&("antigravity"===c?e=["gemini-2.5-flash","gemini-3-flash","claude-sonnet-4-6"]:"codex"===c?e=["gpt-5.4","gpt-5.4-mini","gpt-4o"]:"groq"===c?e=["llama-3.3-70b-versatile","llama-3.1-8b-instant"]:"cerebras"===c?e=["llama-3.3-70b","llama3.1-8b"]:"mistral"===c?e=["codestral-latest","mistral-large-latest"]:"deepseek"===c?e=["deepseek-chat","deepseek-coder"]:"openrouter"===c?e=["auto","free"]:"opencode"===c&&(e=["deepseek-v4-flash-free"])),e.length>6&&(e=e.slice(0,6)),{...b,models:e}})},[A,m?.byModel]);return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[!c&&(0,d.jsxs)("div",{className:"flex w-full items-center gap-2 sm:w-auto sm:self-end",children:[(0,d.jsx)("div",{className:"flex flex-1 flex-wrap items-center gap-1 rounded-lg border border-border bg-bg-subtle p-1 sm:flex-none",children:R.map(a=>(0,d.jsx)("button",{onClick:()=>U(a.value),disabled:t,className:`rounded-md px-3 py-1 text-sm font-medium transition-colors ${T===a.value?"bg-primary text-white shadow-sm":"text-text-muted hover:bg-bg-hover hover:text-text"}`,children:a.label},a.value))}),t&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted animate-spin",children:"progress_activity"})]}),q?X:(0,d.jsx)(o,{stats:m}),q?X:(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-1 items-stretch gap-2 lg:grid-cols-[minmax(0,2fr)_minmax(280px,1fr)]",children:[(0,d.jsx)(G,{providers:Y,activeRequests:m.activeRequests||[],lastProvider:m.recentRequests?.[0]?.provider||"",errorProvider:m.errorProvider||"",rules:C}),(0,d.jsx)(I,{requests:m.recentRequests||[]})]}),q?X:(0,d.jsx)(F,{period:T,refreshKey:m.totalRequests}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("select",{value:w,onChange:a=>x(a.target.value),className:"w-full rounded-lg border border-border bg-surface px-3 py-1.5 text-sm font-medium text-text-main focus:outline-none focus:ring-2 focus:ring-primary/50 sm:w-auto",style:{colorScheme:"auto"},children:Q.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))}),(0,d.jsxs)("div",{className:"grid grid-cols-2 items-center gap-1 rounded-lg border border-border bg-bg-subtle p-1 sm:flex",children:[(0,d.jsx)("button",{onClick:()=>z("costs"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"costs"===y?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Costs"}),(0,d.jsx)("button",{onClick:()=>z("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===y?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"})]})]}),q?X:W&&(0,d.jsx)(u,{title:"",columns:W.columns,groupedData:W.groupedData,tableType:w,sortBy:k,sortOrder:l,onToggleSort:V,viewMode:y,storageKey:W.storageKey,renderSummaryCells:W.renderSummaryCells,renderDetailCells:W.renderDetailCells,emptyMessage:W.emptyMessage})]})]})}},60971:(a,b,c)=>{c.d(b,{default:()=>p});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(95145),i=c(72738),j=c(38930),k=c(29476),l=c(91431),m=c(92592);let n=[...Object.keys(m.zN),...Object.keys(m.IS),...Object.keys(m.nJ),...Object.keys(m.fg)],o=Object.keys(m.IS).filter(a=>m.IS[a].noAuth);function p({isOpen:a,onClose:b,onSelect:c,onDeselect:f,selectedModel:g,activeProviders:q=[],title:r="Select Model",modelAliases:s={},kindFilter:t=null,capFilter:u=null,addedModelValues:v=[],closeOnSelect:w=!0,comboContext:x=null}){let y=(0,e.useMemo)(()=>t?q.filter(a=>{let b=m.Q2[a.provider];return(b?.serviceKinds||["llm"]).includes(t)}):q,[q,t]),{getCaps:z}=(0,k.y)(),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)([]),[E,F]=(0,e.useState)([]),[G,H]=(0,e.useState)([]),[I,J]=(0,e.useState)({}),[K,L]=(0,e.useState)([]);(0,e.useMemo)(()=>q.filter(a=>"cursor"===a.provider&&a.id).map(a=>a.id),[q]);let M=(0,e.useMemo)(()=>({...m.zN,...m.IS,...m.nJ,...m.fg}),[]),N=(0,e.useMemo)(()=>{let a={},b=new Set(["webSearch","webFetch"]),c=new Set(["image","tts","stt","embedding","imageToText"]),d=new Set(["tts","image","webFetch"]);return[...new Set([...y.map(a=>a.provider),...t?o.filter(a=>(m.Q2[a]?.serviceKinds||["llm"]).includes(t)):o])].sort((a,b)=>{let c=n.indexOf(a),d=n.indexOf(b);return(-1===c?999:c)-(-1===d?999:d)}).forEach(e=>{let f=(0,m.wG)(e),g=M[e]||{name:e,color:"#666"},h=(0,m.mq)(e)||(0,m.gb)(e);if(t&&b.has(t)){a[e]={name:g.name,alias:f,color:g.color,models:[{id:e,name:g.name,value:e}]};return}if(g.passthroughModels){let b=Object.entries(s).filter(([,a])=>a.startsWith(`${f}/`)).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b})),h=G.filter(a=>a.providerAlias===f).map(a=>({id:a.id,name:a.name||a.id,value:`${f}/${a.id}`,kind:(0,l.CP)(a),isCustom:!0})),i=b;if(t&&c.has(t)){let a=h.filter(a=>(0,l.CP)(a)===t);0===(i=[...a,...(0,l.KC)(e).filter(a=>(0,l.CP)(a)===t).map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,kind:(0,l.CP)(a)})).filter(b=>!a.some(a=>a.value===b.value))]).length&&d.has(t)&&(g.serviceKinds||["llm"]).includes(t)&&(i=[{id:e,name:g.name,value:f}])}else{let a=h.filter(a=>!(0,l.CP)(a)||"llm"===(0,l.CP)(a)),c=new Set([...b,...a].map(a=>a.value)),d=(0,l.KC)(e).filter(a=>!(0,l.CP)(a)||"llm"===(0,l.CP)(a)).map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,kind:(0,l.CP)(a)})).filter(a=>!c.has(a.value));i=[...a,...b.filter(b=>!a.some(a=>a.value===b.value)),...d]}if(i.length>0){let b=E.find(a=>a.id===e),c=b?.name||g.name;a[e]={name:c,alias:f,color:g.color,models:i}}}else if(h){if(t&&c.has(t))return;let b=q.find(a=>a.provider===e),d=E.find(a=>a.id===e),f=d?.name||b?.name||g.name,h=b?.providerSpecificData?.prefix||d?.prefix||e,i=Object.entries(s).filter(([,a])=>a.startsWith(`${e}/`)).map(([a,b])=>({id:b.replace(`${e}/`,""),name:a,value:`${h}/${b.replace(`${e}/`,"")}`})),j=G.filter(a=>a.providerAlias===e).map(a=>({id:a.id,name:a.name||a.id,value:`${h}/${a.id}`,isCustom:!0})),k=new Set(i.map(a=>a.value)),l=[...i,...j.filter(a=>!k.has(a.value))],m=l.length>0?l:[{id:`__placeholder__${e}`,name:`${h}/model-id`,value:`${h}/model-id`,isPlaceholder:!0}];a[e]={name:f,alias:h,color:g.color,models:m,isCustom:!0,hasModels:l.length>0}}else{var i;let b="cursor"===e&&K.length>0?K:(0,l.KC)(e),h=new Set(b.map(a=>a.id)),j=b.length>0,k=Object.entries(s).filter(([a,b])=>b.startsWith(`${f}/`)&&(!j||a===b.replace(`${f}/`,""))&&!h.has(b.replace(`${f}/`,""))).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b,isCustom:!0})),m=new Set(k.map(a=>a.id)),n=G.filter(a=>a.providerAlias===f&&!h.has(a.id)&&!m.has(a.id)).map(a=>({id:a.id,name:a.name||a.id,value:`${f}/${a.id}`,isCustom:!0})),o=[...b.map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,kind:(0,l.CP)(a)})),...k,...n],p=new Set,q=(i=o.filter(a=>!p.has(a.value)&&(p.add(a.value),!0)),t?c.has(t)?i.filter(a=>a.isPlaceholder||(0,l.CP)(a)===t):i:i.filter(a=>a.isPlaceholder||a.isCustom||!(0,l.CP)(a)||"llm"===(0,l.CP)(a)));0===q.length&&t&&d.has(t)&&(g.serviceKinds||["llm"]).includes(t)&&(q=[{id:e,name:g.name,value:f}]),q.length>0&&(a[e]={name:g.name,alias:f,color:g.color,models:q})}}),Object.entries(a).forEach(([b,c])=>{let d=new Set([...I[(0,m.wG)(b)]||[],...I[b]||[]]);0!==d.size&&(c.models=c.models.filter(a=>!d.has(a.id)),0===c.models.length&&delete a[b])}),a},[y,s,M,E,G,I,t,q,K]),O=(0,e.useMemo)(()=>{if(t||u)return[];if(!A.trim())return C;let a=A.toLowerCase();return C.filter(b=>b.name.toLowerCase().includes(a))},[C,A,t]),P=function(a,b){let c=b?.name?.trim(),d=b?.id;if(!c&&!d)return new Set;let e=new Map(a.filter(a=>a.id!==d).map(a=>[a.name,Array.isArray(a.models)?a.models:[]])),f=(a,b=new Set)=>{if(c&&a===c)return!0;if(b.has(a))return!1;let d=e.get(a);if(!d)return!1;b.add(a);let g=d.some(a=>f(a,b));return b.delete(a),g};return new Set(a.filter(a=>a.id===d||f(a.name)).map(a=>a.name))}(C,x),Q=(0,e.useMemo)(()=>{let a=A.trim().toLowerCase(),b={};return Object.entries(N).forEach(([c,d])=>{var e;let f=d.models;if(!u||0!==(f=f.filter(a=>z(a.value)?.[u]===!0)).length){if(a){let b=d.name.toLowerCase().includes(a);if(0===(f=f.filter(b=>b.name.toLowerCase().includes(a)||b.id.toLowerCase().includes(a))).length&&!b)return}b[c]={...d,models:[...(e=f).filter(a=>v.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name)),...e.filter(a=>!v.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name))]}}}),b},[N,A,v]),R=a=>{let d=a?.value||a?.name||a;v.includes(d)&&f?f(a):c(a),w&&(b(),B(""))};return(0,d.jsxs)(h.default,{isOpen:a,onClose:()=>{b(),B("")},title:r,size:"md",className:"p-4!",footer:null,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-2.5 py-2 bg-primary/8 border border-primary/20 rounded-lg text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0",style:{fontSize:"14px"},children:"info"}),(0,d.jsx)("span",{children:"Click to add, click again to remove. Changes are saved automatically."})]}),(0,d.jsx)("div",{className:"mb-3",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,d.jsx)("input",{type:"text",placeholder:"Search...",value:A,onChange:a=>B(a.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,d.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-3",children:[O.length>0&&(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)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",O.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:O.map(a=>{let b=g===a.name,c=v.includes(a.name),e=!c&&P.has(a.name);return(0,d.jsxs)("button",{disabled:e,onClick:()=>R({id:a.name,name:a.name,value:a.name}),title:e?"Selecting this combo would create a circular reference":void 0,className:`
|
|
12
12
|
px-2 py-1 rounded-xl text-xs font-medium transition-all border flex items-center gap-1
|
|
13
13
|
${e?"bg-surface border-border text-text-muted opacity-50 cursor-not-allowed":b?"bg-primary text-white border-primary":c?"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 hover:cursor-pointer"}
|
|
14
14
|
`,children:[e?(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"block"}):c&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),a.name]},a.id)})})]}),Object.entries(Q).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:()=>R(a),title:c?"Select to pre-fill, then edit model ID in the input":void 0,className:`
|