@rabbi696/ezrouter 0.5.95 → 0.5.96
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 +2 -2
- 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_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_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 +2 -2
- package/app/.next-cli-build/server/chunks/476.js +1 -1
- package/app/.next-cli-build/server/chunks/7456.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/8326.js +1 -1
- package/app/.next-cli-build/server/chunks/8901.js +1 -1
- package/app/.next-cli-build/server/chunks/8906.js +1 -1
- package/app/.next-cli-build/server/chunks/9043.js +1 -1
- package/app/.next-cli-build/server/chunks/9212.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-97a7f58329269b33.js → 1321-bea18679b679ccb7.js} +1 -1
- package/app/.next-cli-build/static/chunks/{5497-70982dd63f19eedb.js → 5497-16ec7c092c25165c.js} +1 -1
- package/app/CHANGELOG.md +7 -0
- package/app/package.json +1 -1
- package/app/public/CHANGELOG.md +7 -0
- package/package.json +1 -1
- /package/app/.next-cli-build/static/{6y4mZuVQ0V-18N48d69gy → N7MFB6FryWphA8XhyZjdQ}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{6y4mZuVQ0V-18N48d69gy → N7MFB6FryWphA8XhyZjdQ}/_ssgManifest.js +0 -0
package/app/.next-cli-build/static/chunks/{5497-70982dd63f19eedb.js → 5497-16ec7c092c25165c.js}
RENAMED
|
@@ -14,4 +14,4 @@ Steps:
|
|
|
14
14
|
`,children:[r?(0,s.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"block"}):a&&(0,s.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),e.name]},e.id)})})]}),Object.entries(G).map(([e,t])=>(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,s.jsx)(o.A,{src:`/providers/${e}.png`,alt:t.name,size:14,fallbackText:(t.name||e).slice(0,2).toUpperCase(),fallbackColor:t.color}),(0,s.jsx)("span",{className:"text-xs font-medium text-primary",children:t.name}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",t.models.length,")"]})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.models.map(e=>{let t=i===e.value,a=e.isPlaceholder;return(0,s.jsx)("button",{onClick:()=>J(e),title:a?"Select to pre-fill, then edit model ID in the input":void 0,className:`
|
|
15
15
|
px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
|
|
16
16
|
${a?"border-dashed border-border text-text-muted hover:border-primary/50 hover:text-primary bg-surface italic":t?"bg-primary text-white border-primary":y.includes(e.value)?"bg-primary border-primary text-white hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
|
|
17
|
-
`,children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[y.includes(e.value)&&!a&&(0,s.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),a?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),e.name]}):(0,s.jsxs)(s.Fragment,{children:[e.value,(0,s.jsx)(d.default,{caps:C(e.value)})]})]})},e.value)})})]},e)),0===Object.keys(G).length&&0===V.length&&(0,s.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,s.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}h.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onSelect:i().func.isRequired,onDeselect:i().func,selectedModel:i().string,activeProviders:i().arrayOf(i().shape({provider:i().string.isRequired})),title:i().string,modelAliases:i().object,kindFilter:i().string,addedModelValues:i().arrayOf(i().string),closeOnSelect:i().bool,comboContext:i().shape({id:i().string,name:i().string})}},73147:(e,t,a)=>{a.d(t,{BM:()=>u,MY:()=>i,TJ:()=>m,eK:()=>o,yM:()=>x,zV:()=>l});let s="9router:lastSeenVersion",r="9router:updateFromVersion";function n(e,t){if(!e&&!t)return 0;if(!e)return -1;if(!t)return 1;let a=e=>String(e).trim().replace(/^v/i,"").split(/[.+-]/).map(e=>{let t=parseInt(e,10);return Number.isFinite(t)?t:0}),s=a(e),r=a(t),n=Math.max(s.length,r.length);for(let e=0;e<n;e++){let t=s[e]||0,a=r[e]||0;if(t>a)return 1;if(t<a)return -1}return 0}function i(e){let t;if(!e||"string"!=typeof e)return[];let a=/^#\s+v?(\d+\.\d+\.\d+[^\s)]*)\s*([^\n]*)/gm,s=[];for(;null!==(t=a.exec(e));)s.push({version:t[1].trim(),heading:t[0].replace(/^#\s+/,"").trim(),index:t.index,headerEnd:t.index+t[0].length});return 0===s.length?[]:s.map((t,a)=>{let r=t.headerEnd,n=a+1<s.length?s[a+1].index:e.length,i=e.slice(r,n).trim(),l=i.split(/\r?\n/).map(e=>e.trim()).filter(e=>/^[-*]\s+/.test(e)).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(Boolean);return{version:t.version,heading:t.heading,body:i,bullets:l}})}function l(e,t,a=null){let s=i(e);return 0===s.length?[]:s.filter(e=>!(a&&n(e.version,a)>0||t&&0>=n(e.version,t))&&(!!t||!!a&&0===n(e.version,a)))}function o(e,{maxBullets:t=10}={}){let a=[],s=[];for(let t of e)for(let e of(a.includes(t.version)||a.push(t.version),t.bullets)){var r;s.push({text:(r=e)?String(r).replace(/\*\*(.+?)\*\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").trim():"",version:t.version})}let n=s.length>t;return{bullets:s.slice(0,t),truncated:n,versions:a}}function d(e){try{if("u"<typeof localStorage)return null;return localStorage.getItem(e)}catch{return null}}function c(e,t){try{if("u"<typeof localStorage)return;localStorage.setItem(e,t)}catch{}}function m(e){e&&c(r,String(e).replace(/^v/i,""))}function u(e){let t=String(e||"").replace(/^v/i,"");if(!t)return{show:!1,fromVersion:null,toVersion:t};let a=d(r),i=d(s);return i||a?a&&n(t,a)>0?{show:!0,fromVersion:a,toVersion:t}:i&&n(t,i)>0?{show:!0,fromVersion:i,toVersion:t}:(i&&0===n(t,i)||c(s,t),{show:!1,fromVersion:null,toVersion:t}):(c(s,t),{show:!1,fromVersion:null,toVersion:t})}function x(e){let t=String(e||"").replace(/^v/i,"");t&&c(s,t),function(e){try{if("u"<typeof localStorage)return;localStorage.removeItem(e)}catch{}}(r)}},73579:(e,t,a)=>{a.d(t,{default:()=>h});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(11910),d=a(98),c=a(92542),m=a(56061),u=a(88105),x=a(78177);function p({connection:e,thresholds:t,onChange:a}){let r=(0,x.XD)(e),n=e?.lastQuotaSnapshot?.windows||[];return(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1 text-sm",children:"Quota Safety Buffer"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Pause this account when a quota window's remaining % drops to/below its value. Set a window to 0 to disable it."}),r.eligible?0===n.length?(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No quota windows known yet. Open the Quota Tracker to fetch usage first, then set per-window buffers here."}):(0,s.jsx)("div",{className:"flex flex-col gap-2",children:n.map(e=>{let r=Number(t[e.key])||0;return(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"flex-1 min-w-0 truncate text-sm",title:e.key,children:e.key}),(0,s.jsx)("span",{className:"text-xs text-text-muted tabular-nums w-14 text-right",children:"number"==typeof e.remainingPercentage?`${e.remainingPercentage}%`:"—"}),(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"≤"}),(0,s.jsx)("input",{type:"number",min:0,max:100,value:r,onChange:t=>a(e.key,Number.parseInt(t.target.value,10)||0),className:"w-16 px-2 py-1 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"%"})]},e.key)})}):(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Usage tracking isn't available for this account type, so the buffer can't be applied."})]})}function h({isOpen:e,connection:t,proxyPools:a,onSave:n,onClose:i}){let[x,g]=(0,r.useState)({name:"",priority:1,apiKey:""}),[f,b]=(0,r.useState)({}),[v,j]=(0,r.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[y,k]=(0,r.useState)({accountId:""}),[N,w]=(0,r.useState)(""),[C,S]=(0,r.useState)({location:"global",reasoningEffort:"high"}),[O,F]=(0,r.useState)(!1),[T,I]=(0,r.useState)(null),[$,P]=(0,r.useState)(!1),[W,E]=(0,r.useState)(null),[A,R]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(t){g({name:t.name||"",priority:t.priority||1,apiKey:""}),"azure"===t.provider&&t.providerSpecificData&&j({azureEndpoint:t.providerSpecificData.azureEndpoint||"",apiVersion:t.providerSpecificData.apiVersion||"2024-10-01-preview",deployment:t.providerSpecificData.deployment||"",organization:t.providerSpecificData.organization||""}),"cloudflare-ai"===t.provider&&t.providerSpecificData&&k({accountId:t.providerSpecificData.accountId||""});let e=u.Q2?.[t.provider];e?.regions&&w(t.providerSpecificData?.region||e.defaultRegion||e.regions[0]?.id||""),("vertex"===t.provider||"vertex-partner"===t.provider)&&t.providerSpecificData&&S({location:t.providerSpecificData.location||"global",reasoningEffort:t.providerSpecificData.reasoningEffort||"high"}),I(null),E(null),b(t.quotaPauseThresholds&&"object"==typeof t.quotaPauseThresholds?{...t.quotaPauseThresholds}:{})}},[t]);let _=t?.authType==="oauth",q=t?.provider==="azure",M=t?.provider==="cloudflare-ai",z=t?.provider==="vertex"||t?.provider==="vertex-partner",L=!!t&&((0,u.mq)(t.provider)||(0,u.gb)(t.provider)),D=t&&u.Q2?.[t.provider]?.regions||null,U=()=>{if(D&&N)return{...t?.providerSpecificData||{},region:N}},K=async()=>{if(t?.provider){F(!0),I(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),a=await e.json();I(a.valid?"success":"failed")}catch{I("failed")}finally{F(!1)}}},V=async()=>{if(t?.provider&&x.apiKey){P(!0),E(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:x.apiKey,...q?{providerSpecificData:v}:{},...M?{providerSpecificData:y}:{},...D?{providerSpecificData:U()}:{},...z?{providerSpecificData:C}:{}})}),a=await e.json();E(a.valid?"success":"failed")}catch{E("failed")}finally{P(!1)}}},B=async()=>{if(t){R(!0);try{let e={name:x.name,priority:x.priority,quotaPauseThresholds:{...f}};if(!_&&x.apiKey){e.apiKey=x.apiKey;let a="success"===W;if(!a)try{P(!0),E(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:x.apiKey,...q?{providerSpecificData:v}:{},...M?{providerSpecificData:y}:{},...D?{providerSpecificData:U()}:{},...z?{providerSpecificData:C}:{}})});a=!!(await e.json()).valid,E(a?"success":"failed")}catch{E("failed")}finally{P(!1)}a&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null)}q&&(e.providerSpecificData={azureEndpoint:v.azureEndpoint,apiVersion:v.apiVersion,deployment:v.deployment,organization:v.organization}),M&&(e.providerSpecificData={accountId:y.accountId}),D&&N&&(e.providerSpecificData=U()),z&&(e.providerSpecificData={location:C.location||"global",reasoningEffort:C.reasoningEffort||"high"}),await n(e)}finally{R(!1)}}};return t?(0,s.jsx)(l.default,{isOpen:e,title:"Edit Connection",onClose:i,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(o.default,{label:"Name",value:x.name,onChange:e=>g({...x,name:e.target.value}),placeholder:_?"Account name":"Production Key"}),_&&t.email&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,s.jsx)("p",{className:"font-medium",children:t.email})]}),(0,s.jsx)(o.default,{label:"Priority",type:"number",value:x.priority,onChange:e=>g({...x,priority:Number.parseInt(e.target.value,10)||1})}),(0,s.jsx)(p,{thresholds:f,onChange:(e,t)=>b(a=>({...a,[e]:t})),connection:t}),!_&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.default,{label:"API Key",type:"password",value:x.apiKey,onChange:e=>g({...x,apiKey:e.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(c.default,{onClick:V,disabled:!x.apiKey||$||A,variant:"secondary",children:$?"Checking...":"Check"})})]}),W&&(0,s.jsx)(m.default,{variant:"success"===W?"success":"error",children:"success"===W?"Valid":"Invalid"})]}),q&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)(o.default,{label:"Azure Endpoint",value:v.azureEndpoint,onChange:e=>j({...v,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com",hint:"Your Azure OpenAI resource endpoint URL"}),(0,s.jsx)(o.default,{label:"Deployment Name",value:v.deployment,onChange:e=>j({...v,deployment:e.target.value}),placeholder:"gpt-4",hint:"The deployment name in your Azure resource"}),(0,s.jsx)(o.default,{label:"API Version",value:v.apiVersion,onChange:e=>j({...v,apiVersion:e.target.value}),placeholder:"2024-10-01-preview",hint:"Azure OpenAI API version to use"}),(0,s.jsx)(o.default,{label:"Organization",value:v.organization,onChange:e=>j({...v,organization:e.target.value}),placeholder:"Organization ID",hint:"Required for billing"})]})]}),D&&(0,s.jsx)(d.default,{label:"Region",value:N,onChange:e=>w(e.target.value),options:D.map(e=>({value:e.id,label:e.label}))}),z&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Vertex AI Configuration"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)(d.default,{label:"Location",value:C.location,onChange:e=>S({...C,location:e.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,s.jsx)(d.default,{label:"Reasoning Effort (default)",value:C.reasoningEffort,onChange:e=>S({...C,reasoningEffort:e.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,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Location ",(0,s.jsx)("code",{children:"global"})," is required for Gemini 3.1 Pro Preview."]})]})]}),!L&&!q&&!M&&!z&&(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(c.default,{onClick:K,variant:"secondary",disabled:O,children:O?"Testing...":"Test Connection"}),T&&(0,s.jsx)(m.default,{variant:"success"===T?"success":"error",children:"success"===T?"Valid":"Failed"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(c.default,{onClick:B,fullWidth:!0,disabled:A,children:A?"Saving...":"Save"}),(0,s.jsx)(c.default,{onClick:i,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}p.propTypes={connection:i().object,thresholds:i().object.isRequired,onChange:i().func.isRequired},h.propTypes={isOpen:i().bool.isRequired,connection:i().shape({id:i().string,name:i().string,email:i().string,priority:i().number,authType:i().string,provider:i().string,providerSpecificData:i().object}),proxyPools:i().arrayOf(i().shape({id:i().string,name:i().string})),onSave:i().func.isRequired,onClose:i().func.isRequired}},78177:(e,t,a)=>{a.d(t,{XD:()=>l});var s=a(88105);function r(e){if(!e)return!1;let t="oauth"===e.authType,a=("apikey"===e.authType||"api_key"===e.authType)&&s.jO.includes(e.provider);return t||a}function n(e){let t=e?.quotaPauseThresholds;return t&&"object"==typeof t?t:{}}function i(e){let t=Number(e);return!Number.isFinite(t)||t<=0||t>100?0:t}function l(e){let t=n(e),a=e?.lastQuotaSnapshot?.windows||[],s=Object.values(t).some(e=>i(e)>0),l=function(e){if(!r(e))return null;let t=n(e),a=e?.lastQuotaSnapshot?.windows;if(!a||!Array.isArray(a)||0===a.length)return null;let s=null;for(let e of a){if(!e||!0===e.unlimited)continue;let a=i(t[e.key]);if(!a)continue;let r=Number(e.remainingPercentage);Number.isFinite(r)&&r<=a&&(null===s||r<Number(s.remainingPercentage))&&(s={key:e.key,remainingPercentage:r,threshold:a})}return s}(e);return{enabled:s,paused:null!==l,triggered:l,eligible:r(e),windows:a.map(e=>{let a=i(t[e.key]),s=Number(e.remainingPercentage);return{key:e.key,remainingPercentage:Number.isFinite(s)?s:null,threshold:a,configured:a>0,paused:a>0&&!e.unlimited&&Number.isFinite(s)&&s<=a}})}}},80752:(e,t,a)=>{a.d(t,{default:()=>m});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(1620),o=a(97556),d=a(81127);function c({icon:e,label:t,onClick:a,trailing:r,danger:n}){return(0,s.jsxs)("button",{onClick:a,className:`flex items-center gap-3 w-full px-4 py-2.5 text-sm transition-colors ${n?"text-red-500 hover:bg-red-500/10":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[20px] ${n?"":"text-text-muted"}`,children:e}),(0,s.jsx)("span",{className:"flex-1 text-left",children:t}),r&&(0,s.jsx)("span",{className:"text-base",children:r})]})}function m({onLogout:e}){let[t,a]=(0,r.useState)(!1),[n,i]=(0,r.useState)(!1),[u,x]=(0,r.useState)(!1),[p,h]=(0,r.useState)(!1),{toggleTheme:g,isDark:f}=(0,l.D)(),b=(0,r.useRef)(null),v=async()=>{h(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch(e){}h(!1),x(!1)};return(0,r.useEffect)(()=>{let e=e=>{b.current&&!b.current.contains(e.target)&&a(!1)};if(t)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[t]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"relative",ref:b,children:[(0,s.jsx)("button",{onClick:()=>a(e=>!e),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Menu",children:(0,s.jsx)("span",{className:"material-symbols-outlined",children:"grid_view"})}),t&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-60 bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl z-50 animate-in fade-in zoom-in-95 duration-150 overflow-hidden py-1",children:[(0,s.jsx)(c,{icon:"history",label:"Change Log",onClick:()=>{a(!1),i(!0)}}),(0,s.jsx)(c,{icon:f?"light_mode":"dark_mode",label:"Theme",onClick:()=>{g(),a(!1)}}),(0,s.jsx)(c,{icon:"power_settings_new",label:"Shutdown",danger:!0,onClick:()=>{a(!1),x(!0)}}),(0,s.jsx)(c,{icon:"logout",label:"Logout",danger:!0,onClick:()=>{a(!1),e()}})]})]}),(0,s.jsx)(o.default,{isOpen:n,onClose:()=>i(!1)}),(0,s.jsx)(d.ConfirmModal,{isOpen:u,onClose:()=>x(!1),onConfirm:v,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:p})]})}c.propTypes={icon:i().string.isRequired,label:i().string.isRequired,onClick:i().func.isRequired,trailing:i().node,danger:i().bool},m.propTypes={onLogout:i().func.isRequired}},81127:(e,t,a)=>{a.d(t,{ConfirmModal:()=>d,default:()=>o});var s=a(95155),r=a(12115),n=a(31474),i=a(92542),l=a(97677);function o({isOpen:e,onClose:t,title:a,children:i,footer:d,size:c="md",closeOnOverlay:m=!0,showTrafficLights:u=!0,className:x}){return((0,r.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,r.useEffect)(()=>{let a=a=>{"Escape"===a.key&&e&&t()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t]),e)?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:m?t:void 0}),(0,s.jsxs)("div",{className:(0,n.cn)("relative w-full bg-surface","border border-border-subtle","rounded-[14px] shadow-[var(--shadow-elev)]","fade-in",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[c],x),children:[(a||u)&&(0,s.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border-subtle",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[u&&(0,s.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,s.jsx)(l.default,{text:"Close",position:"top",color:"#FF5F56",children:(0,s.jsx)("button",{onClick:t,"aria-label":"Close",title:"Close",className:"w-4 h-4 rounded-full bg-[#FF5F56] hover:brightness-90 transition-all cursor-pointer flex items-center justify-center group/dot",children:(0,s.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),a&&(0,s.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:a})]}),(0,s.jsx)("button",{onClick:t,"aria-label":"Close",className:"md:hidden p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,s.jsx)("div",{className:"p-6 max-h-[calc(85vh-100px)] overflow-y-auto custom-scrollbar",children:i}),d&&(0,s.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:d})]})]}):null}function d({isOpen:e,onClose:t,onConfirm:a,title:r="Confirm",message:n,confirmText:l="Confirm",cancelText:c="Cancel",variant:m="danger",loading:u=!1}){return(0,s.jsx)(o,{isOpen:e,onClose:t,title:r,size:"sm",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.default,{variant:"ghost",onClick:t,disabled:u,children:c}),(0,s.jsx)(i.default,{variant:m,onClick:a,loading:u,children:l})]}),children:(0,s.jsx)("p",{className:"text-text-muted",children:n})})}},84130:(e,t,a)=>{a.d(t,{default:()=>N});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(98500),o=a.n(l),d=a(73321),c=a(31474),m=a(90620),u=a(88105),x=a(11059),p=a(92542),h=a(97556),g=a(73147);function f({currentVersion:e,latestVersion:t,installCmd:a,onClose:n}){let[i,l]=(0,r.useState)("auto"),[o,d]=(0,r.useState)("idle"),[c,u]=(0,r.useState)(null),[x,b]=(0,r.useState)(null),[v,j]=(0,r.useState)(!1),[y,k]=(0,r.useState)(0),[N,w]=(0,r.useState)(!1),[C,S]=(0,r.useState)({bullets:[],truncated:!1,loading:!0,error:null,versions:[]}),[O,F]=(0,r.useState)(!1),T=(0,r.useRef)(null),I=(0,r.useRef)(null),$=(0,r.useRef)(!1),P=(0,r.useCallback)(()=>{T.current&&(clearInterval(T.current),T.current=null),I.current&&(clearInterval(I.current),I.current=null)},[]);(0,r.useEffect)(()=>()=>{$.current=!0,P()},[P]),(0,r.useEffect)(()=>{let a=!1;return S(e=>({...e,loading:!0,error:null})),fetch(m.Nu.changelogUrl,{cache:"no-store"}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.text()}).then(s=>{if(a)return;let r=(0,g.zV)(s,e,t);if(0===r.length&&t&&(r=(0,g.zV)(s,null,t)),0===r.length&&e&&(r=(0,g.zV)(s,e,null).slice(0,2)),0===r.length){let e=(0,g.MY)(s);e.length>0&&(r=[e[0]])}let{bullets:n,truncated:i,versions:l}=(0,g.eK)(r,{maxBullets:10});S({bullets:n,truncated:i,loading:!1,error:null,versions:l})}).catch(e=>{a||S({bullets:[],truncated:!1,loading:!1,error:e.message||"Failed to load release notes",versions:[]})}),()=>{a=!0}},[e,t]);let W=(0,r.useCallback)(()=>{(0,g.TJ)(e)},[e]),E=(0,r.useCallback)(()=>{P();let e=function(e=m.h0.statusPort){return`http://127.0.0.1:${e}/update/status`}(),t=async()=>{if(!$.current)try{let t=await fetch(e,{cache:"no-store"});if(!t.ok)return;let a=await t.json();if($.current)return;(u(a),d("running"),a&&a.done&&a.success)?(d("success"),I.current||(I.current=setInterval(()=>{globalThis.location.reload()},2e3),setTimeout(()=>{try{globalThis.location.reload()}catch{}},2500)),T.current&&(clearInterval(T.current),T.current=null)):a&&("error"===a.phase||a.done&&!a.success)&&(d("failed"),b(a.error||"Install failed"),l("manual"),T.current&&(clearInterval(T.current),T.current=null))}catch{}};t(),T.current=setInterval(t,m.h0.statusPollIntervalMs)},[P]),A=(0,r.useCallback)(async()=>{b(null),u(null),d("starting"),$.current=!1,W();try{let e=await fetch("/api/version/update",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok){b(t.message||`Auto-update unavailable (${e.status})`),d("failed"),l("manual");return}d("running"),E()}catch(e){d("running"),E(),e?.message&&b(null)}},[E,W]),R=async()=>{W();try{await navigator.clipboard.writeText(a)}catch{}j(!0);let e=m.h0.shutdownCountdownSec;k(e);let t=setInterval(()=>{k(e-=1),e<=0&&(clearInterval(t),fetch("/api/version/shutdown",{method:"POST"}).catch(()=>{}),w(!0))},1e3)},_=function(e){if(!e||"object"!=typeof e)return 5;let{phase:t,attempt:a=0,maxRetries:s=m.h0.installRetries,done:r,success:n}=e;if(r&&n)return 100;if("error"===t||r&&!n)return 90;switch(t){case"starting":return 8;case"waitingForExit":return 22;case"installing":{let e=Math.max(1,s);return Math.round(35+Math.min(a,e)/e*50)}case"done":return 100;default:return 5}}(c||{phase:"starting"===o?"starting":null}),q="starting"===o?"Contacting updater…":"success"===o?"Update complete — reloading when app is ready…":function(e,t={}){let a=t.attempt||0,s=t.maxRetries||m.h0.installRetries;switch(e){case"starting":return"Starting updater…";case"waitingForExit":return"Stopping current app (releasing file locks)…";case"installing":return a>0?`Installing package (attempt ${a}/${s})…`:"Installing package…";case"done":return"Update complete — restarting app…";case"error":return"Update failed";default:return e?String(e):"Preparing…"}}(c?.phase,{attempt:c?.attempt,maxRetries:c?.maxRetries}),M=Array.isArray(c?.logTail)?c.logTail:[],z="starting"===o||"running"===o||"success"===o,L=`Update EzRouter${t?` to v${t}`:""}`,D=(0,s.jsxs)("div",{className:"mb-4 rounded-lg border border-white/10 bg-white/5 p-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-2",children:[(0,s.jsxs)("p",{className:"text-xs font-semibold text-white/90",children:["What's new",t?(0,s.jsxs)("span",{className:"font-normal text-white/50",children:[" ",e?`v${e} → `:"","v",t]}):null]}),(0,s.jsx)("button",{type:"button",onClick:()=>F(!0),className:"text-[10px] text-white/50 hover:text-white/80 transition-colors shrink-0",children:"Full changelog"})]}),C.loading&&(0,s.jsxs)("p",{className:"text-[11px] text-white/50 flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] animate-spin",children:"progress_activity"}),"Loading release notes…"]}),!C.loading&&C.error&&(0,s.jsxs)("p",{className:"text-[11px] text-white/50",children:["Couldn't load release notes (",C.error,"). You can still update."]}),!C.loading&&!C.error&&0===C.bullets.length&&(0,s.jsx)("p",{className:"text-[11px] text-white/50",children:"No release notes found for this range yet. Check the full changelog after updating."}),!C.loading&&C.bullets.length>0&&(0,s.jsxs)("ul",{className:"max-h-40 overflow-y-auto space-y-1 text-[11px] text-white/75 list-disc list-inside",children:[C.bullets.map((e,t)=>(0,s.jsxs)("li",{className:"leading-snug",title:e.text,children:[(0,s.jsxs)("span",{className:"text-white/40 mr-1",children:["v",e.version]}),e.text]},`${e.version}-${t}`)),C.truncated&&(0,s.jsx)("li",{className:"list-none text-white/40 pl-0",children:"…more in full changelog"})]})]});if("auto"===i)return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"w-full max-w-xl rounded-xl bg-neutral-900/95 border border-white/10 p-6 text-white",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsx)("div",{className:"flex items-center justify-center size-11 rounded-full bg-green-500/20 text-green-400",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:"success"===o?"check_circle":"system_update"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:L}),(0,s.jsx)("p",{className:"text-xs text-white/60",children:"One-click install. The app will stop, update, and restart automatically."})]})]}),"idle"===o&&(0,s.jsxs)(s.Fragment,{children:[D,(0,s.jsxs)("ul",{className:"text-xs text-white/70 space-y-1.5 list-disc list-inside mb-4",children:[(0,s.jsxs)("li",{children:["Works with the production ",(0,s.jsx)("code",{className:"px-1 rounded bg-white/10",children:"ezrouter"})," CLI install"]}),(0,s.jsx)("li",{children:"Takes about 1–2 minutes (npm global install + restart)"}),(0,s.jsx)("li",{children:"You can switch to manual install if auto fails"})]}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,s.jsx)(p.default,{variant:"secondary",onClick:n,className:"sm:w-auto",children:"Cancel"}),(0,s.jsx)(p.default,{variant:"primary",fullWidth:!0,onClick:A,children:"Update & Restart"})]}),(0,s.jsx)("button",{type:"button",onClick:()=>l("manual"),className:"mt-3 w-full text-center text-[11px] text-white/50 hover:text-white/80 transition-colors",children:"Prefer manual install instead?"})]}),z&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs mb-1.5",children:[(0,s.jsx)("span",{className:"text-white/80",children:q}),(0,s.jsxs)("span",{className:"text-white/50 tabular-nums",children:[_,"%"]})]}),(0,s.jsx)("div",{className:"h-1.5 rounded-full bg-white/10 overflow-hidden",children:(0,s.jsx)("div",{className:"h-full bg-green-500 transition-all duration-500",style:{width:`${Math.min(100,_)}%`}})})]}),M.length>0&&(0,s.jsx)("div",{className:"mb-3 max-h-32 overflow-y-auto rounded bg-black/40 px-2 py-1.5 font-mono text-[10px] text-white/60 space-y-0.5",children:M.map((e,t)=>(0,s.jsx)("div",{className:"truncate",children:e},`${t}-${e.slice(0,24)}`))}),"success"===o?(0,s.jsx)("p",{className:"text-xs text-green-400/90 mb-3",children:"Install succeeded. Waiting for the app to come back, then reloading…"}):(0,s.jsx)("p",{className:"text-xs text-white/50 mb-3",children:"Keep this tab open. Do not close the browser until the update finishes."}),"success"!==o&&(0,s.jsx)("button",{type:"button",onClick:()=>{P(),l("manual"),d("failed")},className:"w-full text-center text-[11px] text-white/50 hover:text-white/80 transition-colors",children:"Stuck? Switch to manual install"})]}),"failed"===o&&"auto"===i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-3 rounded border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-300",children:x||"Auto-update failed."}),(0,s.jsx)(p.default,{variant:"primary",fullWidth:!0,onClick:()=>l("manual"),children:"Open manual install"})]})]}),(0,s.jsx)(h.default,{isOpen:O,onClose:()=>F(!1)})]});let U=y>0;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"w-full max-w-xl rounded-xl bg-neutral-900/95 border border-white/10 p-6 text-white",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsx)("div",{className:"flex items-center justify-center size-11 rounded-full bg-amber-500/20 text-amber-400",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:"content_copy"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:L}),(0,s.jsx)("p",{className:"text-xs text-white/60",children:N?"Server stopped. Paste the command into a terminal to install.":U?`Command copied. Server will stop in ${y}s...`:x?"Auto-update unavailable — install manually.":"Copy the install command, stop the server, then re-run ezrouter."})]})]}),!N&&!U&&D,x&&(0,s.jsx)("div",{className:"mb-3 rounded border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-200",children:x}),(0,s.jsx)("p",{className:"text-sm text-white/80 mb-2",children:"Install command:"}),(0,s.jsx)("div",{className:"w-full px-3 py-2 rounded bg-white/5 mb-4",children:(0,s.jsx)("code",{className:"text-xs font-mono text-amber-400 break-all",children:a})}),(0,s.jsxs)("ol",{className:"text-xs text-white/70 space-y-1 list-decimal list-inside mb-4",children:[(0,s.jsxs)("li",{children:["Click ",(0,s.jsx)("strong",{children:"Copy & Shutdown"})," below."]}),(0,s.jsx)("li",{children:"Paste the command into your terminal and press Enter."}),(0,s.jsxs)("li",{children:["Run ",(0,s.jsx)("code",{className:"px-1 rounded bg-white/10 text-green-400",children:"ezrouter"})," again after install."]})]}),N?(0,s.jsx)(p.default,{variant:"secondary",fullWidth:!0,onClick:()=>globalThis.location.reload(),children:"Reload Page"}):(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,s.jsx)(p.default,{variant:"secondary",onClick:()=>{z||n()},disabled:U,className:"sm:w-auto",children:"Cancel"}),(0,s.jsx)(p.default,{variant:"primary",fullWidth:!0,onClick:R,disabled:U,children:v?"✓ Copied — shutting down...":U?`Shutting down in ${y}s`:"Copy & Shutdown"})]}),!N&&!U&&(0,s.jsx)("button",{type:"button",onClick:()=>{l("auto"),d("idle"),b(null),u(null)},className:"mt-3 w-full text-center text-[11px] text-white/50 hover:text-white/80 transition-colors",children:"Try automatic update instead"})]}),(0,s.jsx)(h.default,{isOpen:O,onClose:()=>F(!1)})]})}f.propTypes={currentVersion:i().string,latestVersion:i().string,installCmd:i().string.isRequired,onClose:i().func.isRequired};let b=["embedding","image","video","tts","stt"],v="/dashboard/media-providers/web",j=[{href:"/dashboard/endpoint",label:"Endpoint & Key",icon:"api"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combo & Vision Adapter",icon:"layers"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/routing-health",label:"Routing Health",icon:"speed"},{href:"/dashboard/token-saver",label:"Token Saver",icon:"savings"},{href:"/dashboard/convoy",label:"Input Guard",icon:"filter_alt"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],y=[{href:"/dashboard/console-log",label:"Console Log",icon:"terminal"},{href:"/dashboard/error-log",label:"Error Log",icon:"error"},{href:"/dashboard/translator",label:"Translator",icon:"translate"}],k=[{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/skills",label:"Skills",icon:"extension"}];function N({onClose:e}){let t=(0,d.usePathname)(),[a,n]=(0,r.useState)(!1),[i,l]=(0,r.useState)(null),[p,h]=(0,r.useState)(!1),[g,w]=(0,r.useState)(!1),{copied:C,copy:S}=(0,x.C)(2e3),O=m.h0.installCmdLatest;(0,r.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{e.enableTranslator&&w(!0)}).catch(()=>{})},[]),(0,r.useEffect)(()=>{fetch("/api/version").then(e=>e.json()).then(e=>{e.hasUpdate&&l(e)}).catch(()=>{})},[]);let F=e=>"/dashboard/endpoint"===e?"/dashboard"===t||t.startsWith("/dashboard/endpoint"):t.startsWith(e);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("aside",{className:"flex w-72 flex-col border-r border-border-subtle bg-vibrancy backdrop-blur-xl transition-colors duration-300 min-h-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-6 pt-5 pb-2",children:[(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),(0,s.jsxs)("div",{className:"px-6 py-4 flex flex-col gap-2",children:[(0,s.jsxs)(o(),{href:"/dashboard",className:"flex items-center gap-3",children:[(0,s.jsx)("img",{src:"/logo.png",alt:"EzRouter",className:"size-9 rounded-[10px] object-contain shadow-[var(--shadow-warm)]",onError:e=>{e.currentTarget.onerror=null,e.currentTarget.src="/favicon.svg"}}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("h1",{className:"text-lg font-semibold tracking-tight text-text-main",children:m.vQ.name}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["v",m.vQ.version]})]})]}),i&&(0,s.jsxs)("div",{className:"flex flex-col gap-1.5 rounded p-1 -m-1",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-green-600 dark:text-amber-500",children:["↑ New version available: v",i.latestVersion]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:()=>h(!0),className:"px-2 py-1 rounded bg-green-600 hover:bg-green-700 dark:bg-amber-500 dark:hover:bg-amber-600 text-white text-[11px] font-semibold transition-colors cursor-pointer",children:"Update now"}),(0,s.jsx)("button",{onClick:()=>S(O),title:"Copy install command",className:"flex-1 text-left hover:opacity-80 transition-opacity cursor-pointer min-w-0",children:(0,s.jsx)("code",{className:"block text-[10px] text-green-600/80 dark:text-amber-400/70 font-mono truncate",children:C?"✓ copied!":O})})]})]})]}),(0,s.jsxs)("nav",{className:"flex-1 px-4 py-2 space-y-0.5 overflow-y-auto custom-scrollbar",children:[j.map(t=>(0,s.jsxs)(o(),{href:t.href,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",F(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px]",F(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,s.jsx)("span",{className:"text-[13px] font-medium",children:t.label})]},t.href)),(0,s.jsxs)("div",{className:"pt-3 mt-2 space-y-0.5",children:[(0,s.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"System"}),(0,s.jsxs)("button",{onClick:()=>n(e=>!e),className:(0,c.cn)("w-full flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",t.startsWith("/dashboard/media-providers")?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"perm_media"}),(0,s.jsx)("span",{className:"text-[13px] font-medium flex-1 text-left",children:"Media Providers"}),(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] transition-transform",style:{transform:a?"rotate(180deg)":"rotate(0deg)"},children:"expand_more"})]}),a&&(0,s.jsxs)("div",{className:"pl-4",children:[u.rj.filter(e=>b.includes(e.id)).map(a=>(0,s.jsxs)(o(),{href:`/dashboard/media-providers/${a.id}`,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-4 py-1 rounded-lg transition-all group",t.startsWith(`/dashboard/media-providers/${a.id}`)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:a.icon}),(0,s.jsx)("span",{className:"text-sm",children:a.label})]},a.id)),(0,s.jsxs)(o(),{href:v,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-4 py-1 rounded-lg transition-all group",t.startsWith(v)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"travel_explore"}),(0,s.jsx)("span",{className:"text-sm",children:"Web Fetch & Search"})]},"web")]}),k.map(t=>(0,s.jsxs)(o(),{href:t.href,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",F(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px]",F(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,s.jsx)("span",{className:"text-[13px] font-medium",children:t.label})]},t.href)),y.map(t=>"/dashboard/translator"!==t.href||g?(0,s.jsxs)(o(),{href:t.href,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",F(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px]",F(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,s.jsx)("span",{className:"text-[13px] font-medium",children:t.label})]},t.href):null),(0,s.jsxs)(o(),{href:"/dashboard/profile",onClick:e,className:(0,c.cn)("flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",F("/dashboard/profile")?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px]",F("/dashboard/profile")?"fill-1":"group-hover:text-primary transition-colors"),children:"settings"}),(0,s.jsx)("span",{className:"text-[13px] font-medium",children:"Settings"})]})]})]})]}),p&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm p-6",children:(0,s.jsx)(f,{currentVersion:i?.currentVersion||m.vQ.version,latestVersion:i?.latestVersion,installCmd:O,onClose:()=>h(!1)})})]})}N.propTypes={onClose:i().func}},85416:(e,t,a)=>{a.d(t,{default:()=>c});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(35497);let o="auto",d=[{value:o,label:"Auto-detect (recommended)"},{value:"us-east-1",label:"US East (N. Virginia)"},{value:"eu-central-1",label:"Europe (Frankfurt)"}];function c({isOpen:e,onMethodSelect:t,onClose:a}){let[n,i]=(0,r.useState)(null),[m,u]=(0,r.useState)(""),[x,p]=(0,r.useState)("us-east-1"),[h,g]=(0,r.useState)(""),[f,b]=(0,r.useState)(""),[v,j]=(0,r.useState)(""),[y,k]=(0,r.useState)(o),[N,w]=(0,r.useState)(null),[C,S]=(0,r.useState)(!1),[O,F]=(0,r.useState)(!1),[T,I]=(0,r.useState)(!1),[$,P]=(0,r.useState)(null);(0,r.useEffect)(()=>{"import"===n&&e&&(async()=>{F(!0),w(null),I(!1),P(null);try{let e=await fetch("/api/oauth/kiro/auto-import"),t=await e.json();t.found?(g(t.refreshToken),I(!0),t.clientId&&t.clientSecret&&P({clientId:t.clientId,clientSecret:t.clientSecret,region:t.region,authMethod:t.authMethod,profileArn:t.profileArn})):w(t.error||"Could not auto-detect token")}catch(e){w("Failed to auto-detect token")}finally{F(!1)}})()},[n,e]);let W=e=>{i(e),w(null)},E=()=>{i(null),w(null)},A=async()=>{if(!h.trim())return void w("Please enter a refresh token");S(!0),w(null);try{let e=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:h.trim(),...$||{}})}),a=await e.json();if(!e.ok)throw Error(a.error||"Import failed");t("import")}catch(e){w(e.message)}finally{S(!1)}},R=async()=>{if(!f.trim())return void w("Please paste CLIProxyAPI auth JSON");S(!0),w(null);try{let e=await fetch("/api/oauth/kiro/import-cli-proxy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({json:f.trim()})}),a=await e.json();if(!e.ok)throw Error(a.error||"CLIProxyAPI import failed");t("import-cli-proxy")}catch(e){w(e.message)}finally{S(!1)}},_=async()=>{if(!v.trim())return void w("Please enter an API key");S(!0),w(null);try{let e=await fetch("/api/oauth/kiro/api-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:v.trim(),region:y})}),a=await e.json();if(!e.ok)throw Error(a.error||"Import failed");t("api-key")}catch(e){w(e.message)}finally{S(!1)}},q=e=>{t("social",{provider:e})};return(0,s.jsx)(l.aF,{isOpen:e,title:"Connect Kiro",onClose:a,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[!n&&(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,s.jsx)("button",{onClick:()=>t("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,s.jsx)("button",{onClick:()=>W("idc"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,s.jsx)("button",{onClick:()=>W("api-key"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"key"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"API Key"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Use a long-lived Kiro/CodeWhisperer API key (headless auth)."})]})]})}),(0,s.jsx)("button",{onClick:()=>W("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,s.jsx)("button",{onClick:()=>W("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,s.jsx)("button",{onClick:()=>W("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})}),(0,s.jsx)("button",{onClick:()=>W("import-cli-proxy"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"data_object"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"Import CLIProxyAPI JSON"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Paste external_idp auth JSON from CLIProxyAPI/Kiro Microsoft login."})]})]})})]}),"idc"===n&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(l.pd,{value:m,onChange:e=>u(e.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,s.jsx)(l.pd,{value:x,onChange:e=>p(e.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),N&&(0,s.jsx)("p",{className:"text-sm text-red-600",children:N}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:()=>{m.trim()?t("idc",{startUrl:m.trim(),region:x}):w("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,s.jsx)(l.$n,{onClick:E,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"api-key"===n&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.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,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,s.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Paste a long-lived Kiro/CodeWhisperer API key. It is validated against AWS and stored directly as a bearer credential (no refresh)."})]})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["API Key ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(l.pd,{value:v,onChange:e=>j(e.target.value),placeholder:"Paste your Kiro API key...",className:"font-mono text-sm"})]}),(0,s.jsx)(l.l6,{label:"AWS Region",value:y,onChange:e=>k(e.target.value),options:d}),N&&(0,s.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,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:N})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:_,fullWidth:!0,disabled:C||!v.trim(),children:C?"Validating...":"Add API Key"}),(0,s.jsx)(l.$n,{onClick:E,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===n&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,s.jsxs)("div",{className:"flex-1 text-sm",children:[(0,s.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,s.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:()=>q("google"),fullWidth:!0,children:"Continue with Google"}),(0,s.jsx)(l.$n,{onClick:E,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===n&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,s.jsxs)("div",{className:"flex-1 text-sm",children:[(0,s.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,s.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:()=>q("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,s.jsx)(l.$n,{onClick:E,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===n&&(0,s.jsxs)("div",{className:"space-y-4",children:[O&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!O&&(0,s.jsxs)(s.Fragment,{children:[T&&(0,s.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,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,s.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!T&&!N&&(0,s.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,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,s.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(l.pd,{value:h,onChange:e=>g(e.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),N&&(0,s.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,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:N})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:A,fullWidth:!0,disabled:C||!h.trim(),children:C?"Importing...":"Import Token"}),(0,s.jsx)(l.$n,{onClick:E,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]}),"import-cli-proxy"===n&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.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,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,s.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Paste the Kiro CLIProxyAPI auth JSON containing auth_method=external_idp. Only Microsoft login token endpoints are accepted."})]})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["CLIProxyAPI Auth JSON ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("textarea",{value:f,onChange:e=>b(e.target.value),placeholder:'{"auth_method":"external_idp","access_token":"...","refresh_token":"...","client_id":"...","token_endpoint":"https://login.microsoftonline.com/.../oauth2/v2.0/token","profile_arn":"...","scopes":"..."}',className:"min-h-40 w-full rounded-md border border-border bg-background p-3 font-mono text-sm outline-none focus:border-primary"})]}),N&&(0,s.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,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:N})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:R,fullWidth:!0,disabled:C||!f.trim(),children:C?"Importing...":"Import CLIProxyAPI JSON"}),(0,s.jsx)(l.$n,{onClick:E,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})})}c.propTypes={isOpen:i().bool.isRequired,onMethodSelect:i().func.isRequired,onClose:i().func.isRequired}},90882:(e,t,a)=>{a.d(t,{default:()=>d});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(35497),o=a(11059);function d({isOpen:e,provider:t,providerInfo:a,onSuccess:n,onClose:i,oauthMeta:c,idcConfig:m}){let[u,x]=(0,r.useState)("waiting"),[p,h]=(0,r.useState)(null),[g,f]=(0,r.useState)(""),[b,v]=(0,r.useState)(null),[j,y]=(0,r.useState)(!1),[k,N]=(0,r.useState)(null),[w,C]=(0,r.useState)(!1),[S,O]=(0,r.useState)(!1),F=(0,r.useRef)(null),T=(0,r.useRef)(!1),I=(0,r.useRef)(!1),{copied:$,copy:P}=(0,o.C)(),[W,E]=(0,r.useState)(!1),[A,R]=(0,r.useState)("/callback?code=..."),_=(0,r.useRef)(!1);(0,r.useEffect)(()=>{E("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),R(`${window.location.origin}/callback?code=...`)},[]);let q=(0,r.useCallback)(async(e,a)=>{try{O(!0),v(null);let s=p?.redirectUri||`${window.location.origin}/callback`,r=p?.codeVerifier||null,i=a||p?.state||null,l=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:s,codeVerifier:r,state:i,...c?{meta:c}:{}})}),o=await l.json();if(!l.ok)throw Error(o.error||"Token exchange failed");x("success"),n?.()}catch(e){v(e.message),x("error")}finally{O(!1)}},[p,t,n,c]),M=(0,r.useCallback)(async e=>{if(p?.state)try{let t=await fetch("/api/oauth/xai/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,state:p.state})}),a=await t.json();if(!t.ok)throw Error(a.error);x("success"),n?.()}catch(e){v(e.message),x("error")}},[p,n]),z=(0,r.useCallback)(async(e,a,s,r,i)=>{T.current=!1,C(!0);let l=Date.now()+(Number.isFinite(i)&&i>0?i:12e4);for(;Date.now()<l;){if(T.current){console.log("[OAuthModal] Polling aborted"),C(!1);return}if(await new Promise(e=>setTimeout(e,1e3*s)),T.current){console.log("[OAuthModal] Polling aborted after sleep"),C(!1);return}try{let i=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:a,extraData:r,..."cursor"===t?{state:e}:{}})}),l=await i.json();if(l.success){T.current=!0,x("success"),C(!1),n?.();return}if("expired_token"===l.error||"access_denied"===l.error)throw Error(l.errorDescription||l.error);"slow_down"===l.error&&(s=Math.min(s+5,30))}catch(e){v(e.message),x("error"),C(!1);return}}v("Authorization timeout"),x("error"),C(!1)},[t,n]),L=(0,r.useCallback)(async()=>{if(t)try{let e;if(v(null),"cursor"===t){y(!0),x("waiting");let e=await fetch(`/api/oauth/cursor/authorize?redirect_uri=${encodeURIComponent(window.location.origin+"/callback")}`),t=await e.json();if(!e.ok)throw Error(t.error);h(t),N({verification_uri:t.authUrl,user_code:""}),t.authUrl&&window.open(t.authUrl,"_blank","noopener,noreferrer"),z(t.state,null,2,null,1e3*(t.expiresIn||300));return}if(["github","qwen","kiro","kimi","kimi-coding","kilocode","codebuddy-cn","qoder","grok-cli","frontier-for-all"].includes(t)){y(!0),x("waiting");let e=new URL(`/api/oauth/${t}/device-code`,window.location.origin);"kiro"===t&&m?.startUrl&&(e.searchParams.set("start_url",m.startUrl),m.region&&e.searchParams.set("region",m.region),e.searchParams.set("auth_method","idc"));let a=await fetch(e.toString()),s=await a.json();if(!a.ok)throw Error(s.error);N(s);let r=s.verification_uri_complete||s.verification_uri;r&&window.open(r,"_blank","noopener,noreferrer");let n="kiro"===t?{_clientId:s._clientId,_clientSecret:s._clientSecret,_region:s._region,_authMethod:s._authMethod,_startUrl:s._startUrl}:"qoder"===t?{_qoderNonce:s._qoderNonce,_qoderMachineId:s._qoderMachineId,_qoderVerifier:s.codeVerifier}:"kimi"===t||"kimi-coding"===t?{_kimiDeviceId:s._kimiDeviceId}:null;z(s.device_code,s.codeVerifier,s.interval||5,n,Number.isFinite(s.expires_in)&&s.expires_in>0?1e3*s.expires_in:void 0);return}let a=window.location.port||("https:"===window.location.protocol?"443":"80");e="codex"===t?"http://localhost:1455/auth/callback":"xai"===t?"http://127.0.0.1:56121/callback":`http://localhost:${a}/callback`;let s=new URL(`/api/oauth/${t}/authorize`,window.location.origin);s.searchParams.set("redirect_uri",e),c&&Object.entries(c).forEach(([e,t])=>{t&&s.searchParams.set(e,t)});let r=await fetch(s.toString()),n=await r.json();if(!r.ok)throw Error(n.error);let i=!1,l=!1;if("codex"===t)try{let t=new URL("/api/oauth/codex/start-proxy",window.location.origin);t.searchParams.set("app_port",a),t.searchParams.set("state",n.state),t.searchParams.set("code_verifier",n.codeVerifier),t.searchParams.set("redirect_uri",e);let s=await fetch(t.toString()),r=await s.json();i=r.success,l=!!r.serverSide}catch{i=!1}let o=!1,d=!1;if("xai"===t)try{let t=new URL("/api/oauth/xai/start-proxy",window.location.origin);t.searchParams.set("app_port",a),t.searchParams.set("state",n.state),t.searchParams.set("code_verifier",n.codeVerifier),t.searchParams.set("redirect_uri",e);let s=await fetch(t.toString()),r=await s.json();if(o=r.success,d=!!r.serverSide,!o&&"port_busy"===r.reason)throw Error("Port 56121 in use; close the conflicting process and retry")}catch(e){if(e?.message)throw e;o=!1}if(h({...n,redirectUri:e,codexServerSide:l,xaiServerSide:d}),!n.authUrl){if("device_code"===n.flowType)throw Error(`Provider ${t} uses device-code login but is not wired in the OAuth modal device-code list`);throw Error("No authorization URL returned from OAuth provider")}"codex"===t&&i||"xai"===t&&o||W&&"codex"!==t&&"xai"!==t?(x("waiting"),F.current=window.open(n.authUrl,"oauth_popup","width=600,height=700"),F.current||x("input")):(x("input"),window.open(n.authUrl,"_blank"))}catch(e){v(e.message),x("error")}},[t,W,z,c,m]);(0,r.useEffect)(()=>{e&&t?I.current||(I.current=!0,h(null),f(""),v(null),y(!1),N(null),C(!1),T.current=!1,L()):e||(T.current=!0,I.current=!1,"codex"===t?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===t&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}))},[e,t,L]),(0,r.useEffect)(()=>{if(!p?.state||!t||_.current)return;let e=!1,a=0,s=async()=>{if(!e&&!_.current){a+=1;try{let a=await fetch(`/api/oauth/${t}/poll-status?state=${encodeURIComponent(p.state)}`),s=await a.json();if(e||_.current)return;if("done"===s.status){_.current=!0,x("success"),n?.();return}if("error"===s.status){_.current=!0,v(s.error||"Authentication failed"),x("error");return}}catch{}if(a>=300){_.current=!0,v("Authentication timeout"),x("error");return}setTimeout(s,1e3)}},r=setTimeout(s,1e3);return()=>{e=!0,clearTimeout(r)}},[p,t,n]),(0,r.useEffect)(()=>{let e;if(!p)return;_.current=!1;let t=async e=>{let{code:t,token:a,state:s,error:r,errorDescription:n,fullUrl:i}=e;if(i?f(i):t&&f(`${window.location.origin}/callback?state=${encodeURIComponent(s||"")}&code=${encodeURIComponent(t)}`),!_.current){if(r){_.current=!0,v(n||r),x("error");return}(a||t)&&(_.current=!0,await q(a||t,s))}},a=e=>{let a=e.origin.includes("localhost")||e.origin.includes("127.0.0.1"),s=e.origin===window.location.origin;(a||s)&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",a);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){console.log("BroadcastChannel not supported")}let s=e=>{if("oauth_callback"===e.key&&e.newValue)try{let a=JSON.parse(e.newValue);t(a),localStorage.removeItem("oauth_callback")}catch(e){console.log("Failed to parse localStorage data")}};window.addEventListener("storage",s);try{let e=localStorage.getItem("oauth_callback");if(e){let a=JSON.parse(e);a.timestamp&&Date.now()-a.timestamp<3e4&&t(a),localStorage.removeItem("oauth_callback")}}catch{}return()=>{window.removeEventListener("message",a),window.removeEventListener("storage",s),e&&e.close()}},[p,q]);let D=async()=>{try{v(null);let e=g.trim();if(!e)return;if(O(!0),e.startsWith("eyJ")&&e.includes("."))return void await q(e,null);if("xai"===t&&e&&!e.includes("://")&&!e.includes("?")&&!e.includes("code="))return void await M(e);if("kimchi"===t&&e&&!e.includes("://")&&!e.includes("?"))return void await q(e,null);let a=null,s=null,r=null,n=null;if(e.includes("://")||e.startsWith("/")||e.startsWith("?")){let t=e.startsWith("/")||e.startsWith("?")?`http://localhost${e.startsWith("?")?"":"/"}${e}`:e;try{let e=new URL(t);if(a=e.searchParams.get("code"),s=e.searchParams.get("token"),r=e.searchParams.get("state"),n=e.searchParams.get("error"))throw Error(e.searchParams.get("error_description")||n)}catch(t){if(n)throw t;a=e}}else a=e;if(!a&&!s)throw Error("xai"===t?"Paste the callback URL or copied xAI code":"kimchi"===t?"No Kimchi token found in URL":"No authorization code found in URL");await q(s||a,r)}catch(e){v(e.message),x("error")}finally{O(!1)}},U=(0,r.useCallback)(()=>{"codex"===t?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===t&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}),i()},[i,t]);if(!t||!a)return null;let K="xai"===t,V="kimchi"===t,B=k?.verification_uri_complete||k?.verification_uri||"",G=K?"Connect Grok Build OAuth":`Connect ${a.name}`,J=K?"http://127.0.0.1:56121/callback?code=... or copied code":V?`${A.replace("code=...","token=...")} or copied token`:A;return(0,s.jsx)(l.aF,{isOpen:e,title:G,onClose:U,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[("waiting"===u||"input"===u)&&!j&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,s.jsx)("span",{className:"text-sm",children:K?"Waiting for Grok Build OAuth…":"Waiting for popup authorization…"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 my-1",children:[(0,s.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,s.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wider",children:"Or paste callback URL manually"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 1: Open this ",K?"Grok Build OAuth URL":"URL"," in your browser"]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.pd,{value:p?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,s.jsx)(l.$n,{variant:"secondary",icon:"auth_url"===$?"check":"content_copy",onClick:()=>P(p?.authUrl,"auth_url"),disabled:!p?.authUrl,children:"Copy"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 2: Paste the ","xai"===t?"callback URL or copied code":V?"callback URL or copied token":"callback URL"," here"]}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"xai"===t?"If xAI shows a code instead of redirecting, paste that code here.":V?"After authorization, copy the full callback URL or token from your browser.":"After authorization, copy the full URL from your browser."}),(0,s.jsx)(l.pd,{value:g,onChange:e=>f(e.target.value),placeholder:J,className:"font-mono text-xs"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:D,fullWidth:!0,disabled:!g.trim()||S,children:S?"Connecting...":"Connect"}),(0,s.jsx)(l.$n,{onClick:U,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"waiting"===u&&j&&k&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"text-center py-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the login URL below and authorize:"}),(0,s.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Login URL"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("code",{className:"flex-1 text-sm break-all",children:B}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",icon:"login_url"===$?"check":"content_copy",onClick:()=>P(B,"login_url"),disabled:!B}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",icon:"open_in_new",onClick:()=>window.open(B,"_blank","noopener,noreferrer"),disabled:!B,children:"Open"})]})]}),k.user_code&&(0,s.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,s.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:k.user_code}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",icon:"user_code"===$?"check":"content_copy",onClick:()=>P(k.user_code,"user_code")})]})]})]}),w&&(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"success"===u&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",a.name," account has been connected."]}),(0,s.jsx)(l.$n,{onClick:U,fullWidth:!0,children:"Done"})]}),"error"===u&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,s.jsx)("p",{className:"text-sm text-red-600 mb-4",children:b}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:L,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,s.jsx)(l.$n,{onClick:U,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}d.propTypes={isOpen:i().bool.isRequired,provider:i().string,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired,oauthMeta:i().object,idcConfig:i().shape({startUrl:i().string,region:i().string})}},91450:(e,t,a)=>{a.d(t,{default:()=>l});var s=a(95155),r=a(14051),n=a.n(r),i=a(38587);function l({children:e}){return(0,s.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,s.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,s.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,s.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,s.jsx)(i.default,{variant:"card"})}),(0,s.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}l.propTypes={children:n().node.isRequired}},92173:(e,t,a)=>{a.d(t,{default:()=>c});var s=a(95155),r=a(98500),n=a.n(r),i=a(90620);let l=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],d=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function c(){return(0,s.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,s.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,s.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,s.jsx)("div",{className:"size-6 text-primary",children:(0,s.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,s.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,s.jsx)("span",{className:"text-xl font-bold text-text-main",children:i.vQ.name})]}),(0,s.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,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.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,s.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.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,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:l.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(n(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(n(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:d.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(n(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,s.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",i.vQ.name," Inc. All rights reserved."]}),(0,s.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,s.jsx)(n(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,s.jsx)(n(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},92542:(e,t,a)=>{a.d(t,{default:()=>l});var s=a(95155),r=a(31474);let n={primary:"bg-brand-500 hover:bg-brand-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-brand-500/40",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",danger:"bg-red-500 hover:bg-red-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-green-600 hover:bg-green-700 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},i={sm:"h-7 px-3 text-xs rounded-[8px]",md:"h-9 px-4 text-sm rounded-[10px]",lg:"h-11 px-6 text-sm rounded-[10px]"};function l({children:e,variant:t="primary",size:a="md",icon:o,iconRight:d,disabled:c=!1,loading:m=!1,fullWidth:u=!1,className:x,...p}){return(0,s.jsxs)("button",{className:(0,r.cn)("inline-flex items-center justify-center gap-2 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.97] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",n[t],i[a],u&&"w-full",x),disabled:c||m,...p,children:[m?(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):o?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o}):null,e,d&&!m&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:d})]})}},94230:(e,t,a)=>{a.d(t,{default:()=>d});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(35497),o=a(11059);function d({isOpen:e,provider:t,onSuccess:a,onClose:n}){let[i,c]=(0,r.useState)("loading"),[m,u]=(0,r.useState)(""),[x,p]=(0,r.useState)(null),[h,g]=(0,r.useState)(""),[f,b]=(0,r.useState)(null),{copied:v,copy:j}=(0,o.C)(),y=(0,r.useRef)(!1);(0,r.useEffect)(()=>{e||(y.current=!1)},[e]),(0,r.useEffect)(()=>{e&&t&&(async()=>{try{b(null),c("loading");let e=await fetch(`/api/oauth/kiro/social-authorize?provider=${t}`),a=await e.json();if(!e.ok)throw Error(a.error);p(a),u(a.authUrl),c("input"),y.current||(y.current=!0,window.open(a.authUrl,"_blank"))}catch(e){b(e.message),c("error")}})()},[e,t]);let k=async()=>{try{let e;b(null);try{e=new URL(h)}catch(e){throw Error("Invalid callback URL format")}let s=e.searchParams.get("code");e.searchParams.get("state");let r=e.searchParams.get("error");if(r)throw Error(e.searchParams.get("error_description")||r);if(!s)throw Error("No authorization code found in URL");let n=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:s,codeVerifier:x.codeVerifier,provider:t})}),i=await n.json();if(!n.ok)throw Error(i.error);c("success"),a?.()}catch(e){b(e.message),c("error")}},N="google"===t?"Google":"GitHub";return(0,s.jsx)(l.aF,{isOpen:e,title:`Connect Kiro via ${N}`,onClose:n,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===i&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",N," authentication"]})]}),"input"===i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.pd,{value:m,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,s.jsx)(l.$n,{variant:"secondary",icon:"auth_url"===v?"check":"content_copy",onClick:()=>j(m,"auth_url"),children:"Copy"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,s.jsx)(l.pd,{value:h,onChange:e=>g(e.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:k,fullWidth:!0,disabled:!h,children:"Connect"}),(0,s.jsx)(l.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===i&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",N," has been connected."]}),(0,s.jsx)(l.$n,{onClick:n,fullWidth:!0,children:"Done"})]}),"error"===i&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,s.jsx)("p",{className:"text-sm text-red-600 mb-4",children:f}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:()=>c("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,s.jsx)(l.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}d.propTypes={isOpen:i().bool.isRequired,provider:i().oneOf(["google","github"]).isRequired,onSuccess:i().func,onClose:i().func.isRequired}},95088:(e,t,a)=>{a.d(t,{default:()=>d});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(35497);let o="https://gitlab.com";function d({isOpen:e,providerInfo:t,onSuccess:a,onClose:n}){let i,[c,m]=(0,r.useState)(null),[u,x]=(0,r.useState)(o),[p,h]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),[b,v]=(0,r.useState)(""),[j,y]=(0,r.useState)(!1),[k,N]=(0,r.useState)(null),[w,C]=(0,r.useState)(!1),[S,O]=(0,r.useState)(null),F=()=>{m(null),x(o),h(""),f(""),v(""),N(null),y(!1),C(!1),O(null),n()},T=async()=>{if(!b.trim())return void N("Personal Access Token is required");y(!0),N(null);try{let e=await fetch("/api/oauth/gitlab/pat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:b.trim(),baseUrl:u.trim()||o})}),t=await e.json();if(!e.ok)throw Error(t.error||"Authentication failed");a?.(),F()}catch(e){N(e.message)}finally{y(!1)}};return e?w&&S?(0,s.jsx)(l.LF,{isOpen:!0,provider:"gitlab",providerInfo:t,oauthMeta:S,onSuccess:()=>{a?.(),F()},onClose:()=>{C(!1),O(null)}}):(0,s.jsx)(l.aF,{isOpen:e,title:"Connect GitLab Duo",onClose:F,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[!c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Choose how to authenticate with GitLab Duo:"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("button",{onClick:()=>m("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,s.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"OAuth App"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab OAuth application"})]})]}),(0,s.jsxs)("button",{onClick:()=>m("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,s.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Personal Access Token"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab PAT with api scope"})]})]})]})]}),"oauth"===c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Create an OAuth app at"," ",(0,s.jsx)("a",{href:`${u.trim()||o}/-/profile/applications`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Applications"})," ","with redirect URI"," ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:(i=window.location.port||("https:"===window.location.protocol?"443":"80"),`http://localhost:${i}/callback`)})]}),(0,s.jsx)(l.pd,{label:"GitLab Base URL",value:u,onChange:e=>x(e.target.value),placeholder:o}),(0,s.jsx)(l.pd,{label:"Client ID",value:p,onChange:e=>h(e.target.value),placeholder:"Your OAuth application client ID"}),(0,s.jsx)(l.pd,{label:"Client Secret (optional for PKCE)",value:g,onChange:e=>f(e.target.value),placeholder:"Leave empty for public PKCE app"}),k&&(0,s.jsx)("p",{className:"text-sm text-red-500",children:k}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:()=>{p.trim()?(N(null),O({baseUrl:u.trim()||o,clientId:p.trim(),clientSecret:g.trim()}),C(!0)):N("Client ID is required")},fullWidth:!0,disabled:!p.trim(),children:"Authorize"}),(0,s.jsx)(l.$n,{onClick:()=>{m(null),N(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"pat"===c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Create a PAT at"," ",(0,s.jsx)("a",{href:`${u.trim()||o}/-/user_settings/personal_access_tokens`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Access Tokens"})," ","with scopes: ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"api"}),","," ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"read_user"}),", and"," ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"ai_features"}),"."]}),(0,s.jsx)(l.pd,{label:"GitLab Base URL",value:u,onChange:e=>x(e.target.value),placeholder:o}),(0,s.jsx)(l.pd,{label:"Personal Access Token",value:b,onChange:e=>v(e.target.value),placeholder:"glpat-****************",type:"password"}),k&&(0,s.jsx)("p",{className:"text-sm text-red-500",children:k}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:T,fullWidth:!0,disabled:!b.trim()||j,loading:j,children:"Connect"}),(0,s.jsx)(l.$n,{onClick:()=>{m(null),N(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}d.propTypes={isOpen:i().bool.isRequired,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},96748:(e,t,a)=>{a.d(t,{default:()=>d});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(35497);let o="https://api.openai.com/v1";function d({isOpen:e,onClose:t,onCreated:a,onSaved:n,node:i}){let c=!!i,[m,u]=(0,r.useState)({name:"",prefix:"",baseUrl:o}),[x,p]=(0,r.useState)(!1),[h,g]=(0,r.useState)(""),[f,b]=(0,r.useState)(""),[v,j]=(0,r.useState)(!1),[y,k]=(0,r.useState)(null);(0,r.useEffect)(()=>{e&&(k(null),g(""),b(""),c?u({name:i.name||"",prefix:i.prefix||"",baseUrl:i.baseUrl||o}):u({name:"",prefix:"",baseUrl:o}))},[e,c,i]);let N=async()=>{if(m.name.trim()&&m.prefix.trim()&&m.baseUrl.trim()){p(!0);try{let e=c?`/api/provider-nodes/${i.id}`:"/api/provider-nodes",t=c?"PUT":"POST",s={name:m.name,prefix:m.prefix,baseUrl:m.baseUrl};c||(s.type="custom-embedding");let r=await fetch(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),l=await r.json();r.ok&&(c?n?.(l.node):a?.(l.node))}catch(e){console.log("Error saving custom embedding node:",e)}finally{p(!1)}}},w=async()=>{j(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:m.baseUrl,apiKey:h,type:"custom-embedding",modelId:f.trim()||void 0})}),t=await e.json();k(t)}catch{k({valid:!1,error:"Network error"})}finally{j(!1)}};return(0,s.jsx)(l.aF,{isOpen:e,title:c?"Edit Custom Embedding":"Add Custom Embedding",onClose:t,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(l.pd,{label:"Name",value:m.name,onChange:e=>u({...m,name:e.target.value}),placeholder:"Voyage AI",hint:"Required. A friendly label for this embedding provider."}),(0,s.jsx)(l.pd,{label:"Prefix",value:m.prefix,onChange:e=>u({...m,prefix:e.target.value}),placeholder:"voyage",hint:"Required. Used as the provider prefix for model IDs (e.g. voyage/voyage-3)."}),(0,s.jsx)(l.pd,{label:"Base URL",value:m.baseUrl,onChange:e=>u({...m,baseUrl:e.target.value}),placeholder:"https://api.voyageai.com/v1",hint:"Most embedding APIs are OpenAI-compatible: Voyage, Cohere, Jina, Mistral, Together..."}),(0,s.jsx)(l.pd,{label:"API Key (for Check)",type:"password",value:h,onChange:e=>g(e.target.value)}),(0,s.jsx)(l.pd,{label:"Model ID (for Check)",value:f,onChange:e=>b(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0, text-embedding-3-small",hint:"Required for validation. Will send a test embeddings request."}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(l.$n,{onClick:w,disabled:!h||!f.trim()||v||!m.baseUrl.trim(),variant:"secondary",children:v?"Checking...":"Check"}),(()=>{if(!y)return null;let{valid:e,error:t,dimensions:a}=y;return e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.Ex,{variant:"success",children:"Valid"}),a&&(0,s.jsxs)("span",{className:"text-sm text-text-muted",children:[a," dims"]})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(l.Ex,{variant:"error",children:"Invalid"}),t&&(0,s.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:N,fullWidth:!0,disabled:!m.name.trim()||!m.prefix.trim()||!m.baseUrl.trim()||x,children:x?c?"Saving...":"Creating...":c?"Save":"Create"}),(0,s.jsx)(l.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}d.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func,onSaved:i().func,node:i().shape({id:i().string,name:i().string,prefix:i().string,baseUrl:i().string})}},97556:(e,t,a)=>{a.d(t,{default:()=>c});var s=a(95155),r=a(12115),n=a(47650),i=a(14051),l=a.n(i),o=a(9233),d=a(90620);function c({isOpen:e,onClose:t}){let[a,i]=(0,r.useState)(""),[l,m]=(0,r.useState)(!1),[u,x]=(0,r.useState)(""),p=(0,r.useRef)(null);return((0,r.useEffect)(()=>{e&&(m(!0),x(""),fetch(d.Nu.changelogUrl,{cache:"no-store"}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.text()}).then(e=>i(o.xI.parse(e))).catch(e=>x(e.message||"Failed to load")).finally(()=>m(!1)))},[e]),(0,r.useEffect)(()=>{let a=e=>{p.current&&!p.current.contains(e.target)&&t()};if(e)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e,t]),!e||"u"<typeof document)?null:(0,n.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:t}),(0,s.jsxs)("div",{ref:p,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,s.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Change Log"}),(0,s.jsx)("button",{onClick:t,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,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,s.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[l&&(0,s.jsxs)("div",{className:"flex items-center justify-center py-10 text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"progress_activity"}),"Loading..."]}),u&&(0,s.jsxs)("div",{className:"text-red-500 py-4",children:["Failed to load changelog: ",u]}),!l&&!u&&a&&(0,s.jsx)("div",{className:"changelog-body text-text-main",dangerouslySetInnerHTML:{__html:a}})]})]})]}),document.body)}o.xI.setOptions({gfm:!0,breaks:!0}),c.propTypes={isOpen:l().bool.isRequired,onClose:l().func.isRequired}},97677:(e,t,a)=>{a.d(t,{default:()=>r});var s=a(95155);function r({text:e,children:t,position:a="top",color:n}){let i=n?"":"bg-gray-900";return(0,s.jsxs)("div",{className:"relative inline-flex group/tt",children:[t,(0,s.jsx)("div",{className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[a]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug ${i} text-white opacity-0 group-hover/tt:opacity-100 transition-opacity duration-150 whitespace-normal`,style:n?{backgroundColor:n}:{},children:e})]})}},98254:(e,t,a)=>{a.d(t,{default:()=>x});var s=a(95155),r=a(12115),n=a(73321),i=a(65921),l=a(84130),o=a(8823),d=a(90620),c=a(73147),m=a(97556);function u(){let[e,t]=(0,r.useState)(!1),[a,n]=(0,r.useState)(null),[i,l]=(0,r.useState)(null),[o,u]=(0,r.useState)([]),[x,p]=(0,r.useState)(!1),[h,g]=(0,r.useState)(!1),[f,b]=(0,r.useState)(!1);return((0,r.useEffect)(()=>{let e=(0,c.BM)(d.vQ.version);if(!e.show)return;t(!0),n(e.fromVersion),l(e.toVersion);let a=!1;return fetch(d.Nu.changelogUrl,{cache:"no-store"}).then(e=>e.ok?e.text():Promise.reject(Error(`HTTP ${e.status}`))).then(t=>{if(a)return;let s=(0,c.zV)(t,e.fromVersion,e.toVersion),r=s.length>0?s:(0,c.zV)(t,null,e.toVersion),{bullets:n,truncated:i}=(0,c.eK)(r.length?r:[],{maxBullets:6});u(n),p(i)}).catch(()=>{}),()=>{a=!0}},[]),e)?(0,s.jsxs)(s.Fragment,{children:[(0,s.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,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5 text-green-600 dark:text-green-400 shrink-0",children:"celebration"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"text-xs font-semibold",children:["Updated to v",i,a?(0,s.jsxs)("span",{className:"font-normal opacity-80",children:[" (from v",a,")"]}):null]}),!f&&0===o.length&&(0,s.jsx)("p",{className:"text-[11px] opacity-80 mt-0.5",children:"You're on the latest install."}),f&&o.length>0&&(0,s.jsxs)("ul",{className:"mt-1.5 space-y-0.5 text-[11px] opacity-90 list-disc list-inside",children:[o.map((e,t)=>(0,s.jsx)("li",{className:"truncate",title:e.text,children:e.text},`${e.version}-${t}`)),x&&(0,s.jsx)("li",{className:"list-none opacity-70 pl-0",children:"…and more"})]}),(0,s.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2",children:[o.length>0&&(0,s.jsx)("button",{type:"button",onClick:()=>b(e=>!e),className:"text-[11px] font-medium underline-offset-2 hover:underline",children:f?"Hide changes":"See what changed"}),(0,s.jsx)("button",{type:"button",onClick:()=>g(!0),className:"text-[11px] font-medium underline-offset-2 hover:underline opacity-80",children:"Full changelog"})]})]}),(0,s.jsx)("button",{type:"button",onClick:()=>{(0,c.yM)(d.vQ.version),t(!1)},className:"text-current/70 hover:text-current shrink-0","aria-label":"Dismiss",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]})}),(0,s.jsx)(m.default,{isOpen:h,onClose:()=>g(!1)})]}):null}function x({children:e}){let[t,a]=(0,r.useState)(!1),d=(0,n.usePathname)(),c=(0,i.i)(e=>e.notifications),m=(0,i.i)(e=>e.removeNotification);return(0,s.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[(0,s.jsxs)("div",{className:"fixed top-4 right-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",children:[(0,s.jsx)(u,{}),c.map(e=>{var t;let a="success"===(t=e.type)?{wrapper:"border-green-500/30 bg-green-500/10 text-green-600 dark:text-green-400",icon:"check_circle"}:"error"===t?{wrapper:"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400",icon:"error"}:"warning"===t?{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,s.jsx)("div",{className:`rounded-lg border px-3 py-2 shadow-lg backdrop-blur-sm ${a.wrapper}`,children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5",children:a.icon}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[e.title?(0,s.jsx)("p",{className:"text-xs font-semibold mb-0.5",children:e.title}):null,(0,s.jsx)("p",{className:"text-xs whitespace-pre-wrap break-words",children:e.message})]}),e.dismissible?(0,s.jsx)("button",{type:"button",onClick:()=>m(e.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},e.id)})]}),t&&(0,s.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 lg:hidden",onClick:()=>a(!1)}),(0,s.jsx)("div",{className:"hidden lg:flex",children:(0,s.jsx)(l.default,{})}),(0,s.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-300 ease-in-out ${t?"translate-x-0":"-translate-x-full"}`,children:(0,s.jsx)(l.default,{onClose:()=>a(!1)})}),(0,s.jsxs)("main",{className:"flex flex-col flex-1 h-full min-w-0 relative transition-colors duration-300 isolate",children:[(0,s.jsx)("div",{className:"landing-grid absolute inset-0 pointer-events-none -z-10","aria-hidden":"true"}),(0,s.jsx)(o.default,{onMenuClick:()=>a(!0)},d),(0,s.jsx)("div",{className:`flex-1 overflow-y-auto custom-scrollbar ${"/dashboard/basic-chat"===d?"":"p-6 lg:p-10"} ${"/dashboard/basic-chat"===d?"flex flex-col overflow-hidden":""}`,children:(0,s.jsx)("div",{className:`${"/dashboard/basic-chat"===d?"flex-1 w-full h-full flex flex-col":"max-w-7xl mx-auto"}`,children:e})})]})]})}u.propTypes={}},98542:(e,t,a)=>{a.d(t,{default:()=>n});var s=a(95155),r=a(31474);function n({checked:e=!1,onChange:t,label:a,description:i,disabled:l=!1,size:o="md",className:d}){let c={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,s.jsxs)("div",{className:(0,r.cn)("flex items-center gap-3",l&&"opacity-50 cursor-not-allowed",d),children:[(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:l,onClick:()=>{!l&&t&&t(!e)},className:(0,r.cn)("relative inline-flex shrink-0 cursor-pointer rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-2 focus:ring-brand-500/30",e?"bg-brand-500":"bg-surface-3",c[o].track,l&&"cursor-not-allowed"),children:(0,s.jsx)("span",{className:(0,r.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",e?c[o].translate:"translate-x-0.5",c[o].thumb,"mt-0.5")})}),(a||i)&&(0,s.jsxs)("div",{className:"flex flex-col",children:[a&&(0,s.jsx)("span",{className:"text-sm font-medium text-text-main",children:a}),i&&(0,s.jsx)("span",{className:"text-xs text-text-muted",children:i})]})]})}}}]);
|
|
17
|
+
`,children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[y.includes(e.value)&&!a&&(0,s.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),a?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),e.name]}):(0,s.jsxs)(s.Fragment,{children:[e.value,(0,s.jsx)(d.default,{caps:C(e.value)})]})]})},e.value)})})]},e)),0===Object.keys(G).length&&0===V.length&&(0,s.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,s.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}h.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onSelect:i().func.isRequired,onDeselect:i().func,selectedModel:i().string,activeProviders:i().arrayOf(i().shape({provider:i().string.isRequired})),title:i().string,modelAliases:i().object,kindFilter:i().string,addedModelValues:i().arrayOf(i().string),closeOnSelect:i().bool,comboContext:i().shape({id:i().string,name:i().string})}},73147:(e,t,a)=>{a.d(t,{BM:()=>u,MY:()=>i,TJ:()=>m,eK:()=>o,yM:()=>x,zV:()=>l});let s="9router:lastSeenVersion",r="9router:updateFromVersion";function n(e,t){if(!e&&!t)return 0;if(!e)return -1;if(!t)return 1;let a=e=>String(e).trim().replace(/^v/i,"").split(/[.+-]/).map(e=>{let t=parseInt(e,10);return Number.isFinite(t)?t:0}),s=a(e),r=a(t),n=Math.max(s.length,r.length);for(let e=0;e<n;e++){let t=s[e]||0,a=r[e]||0;if(t>a)return 1;if(t<a)return -1}return 0}function i(e){let t;if(!e||"string"!=typeof e)return[];let a=/^#\s+v?(\d+\.\d+\.\d+[^\s)]*)\s*([^\n]*)/gm,s=[];for(;null!==(t=a.exec(e));)s.push({version:t[1].trim(),heading:t[0].replace(/^#\s+/,"").trim(),index:t.index,headerEnd:t.index+t[0].length});return 0===s.length?[]:s.map((t,a)=>{let r=t.headerEnd,n=a+1<s.length?s[a+1].index:e.length,i=e.slice(r,n).trim(),l=i.split(/\r?\n/).map(e=>e.trim()).filter(e=>/^[-*]\s+/.test(e)).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(Boolean);return{version:t.version,heading:t.heading,body:i,bullets:l}})}function l(e,t,a=null){let s=i(e);return 0===s.length?[]:s.filter(e=>!(a&&n(e.version,a)>0||t&&0>=n(e.version,t))&&(!!t||!!a&&0===n(e.version,a)))}function o(e,{maxBullets:t=10}={}){let a=[],s=[];for(let t of e)for(let e of(a.includes(t.version)||a.push(t.version),t.bullets)){var r;s.push({text:(r=e)?String(r).replace(/\*\*(.+?)\*\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").trim():"",version:t.version})}let n=s.length>t;return{bullets:s.slice(0,t),truncated:n,versions:a}}function d(e){try{if("u"<typeof localStorage)return null;return localStorage.getItem(e)}catch{return null}}function c(e,t){try{if("u"<typeof localStorage)return;localStorage.setItem(e,t)}catch{}}function m(e){e&&c(r,String(e).replace(/^v/i,""))}function u(e){let t=String(e||"").replace(/^v/i,"");if(!t)return{show:!1,fromVersion:null,toVersion:t};let a=d(r),i=d(s);return i||a?a&&n(t,a)>0?{show:!0,fromVersion:a,toVersion:t}:i&&n(t,i)>0?{show:!0,fromVersion:i,toVersion:t}:(i&&0===n(t,i)||c(s,t),{show:!1,fromVersion:null,toVersion:t}):(c(s,t),{show:!1,fromVersion:null,toVersion:t})}function x(e){let t=String(e||"").replace(/^v/i,"");t&&c(s,t),function(e){try{if("u"<typeof localStorage)return;localStorage.removeItem(e)}catch{}}(r)}},73579:(e,t,a)=>{a.d(t,{default:()=>h});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(11910),d=a(98),c=a(92542),m=a(56061),u=a(88105),x=a(78177);function p({connection:e,thresholds:t,onChange:a}){let r=(0,x.XD)(e),n=e?.lastQuotaSnapshot?.windows||[];return(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1 text-sm",children:"Quota Safety Buffer"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Pause this account when a quota window's remaining % drops to/below its value. Set a window to 0 to disable it."}),r.eligible?0===n.length?(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No quota windows known yet. Open the Quota Tracker to fetch usage first, then set per-window buffers here."}):(0,s.jsx)("div",{className:"flex flex-col gap-2",children:n.map(e=>{let r=Number(t[e.key])||0;return(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"flex-1 min-w-0 truncate text-sm",title:e.key,children:e.key}),(0,s.jsx)("span",{className:"text-xs text-text-muted tabular-nums w-14 text-right",children:"number"==typeof e.remainingPercentage?`${e.remainingPercentage}%`:"—"}),(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"≤"}),(0,s.jsx)("input",{type:"number",min:0,max:100,value:r,onChange:t=>a(e.key,Number.parseInt(t.target.value,10)||0),className:"w-16 px-2 py-1 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"%"})]},e.key)})}):(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Usage tracking isn't available for this account type, so the buffer can't be applied."})]})}function h({isOpen:e,connection:t,proxyPools:a,onSave:n,onClose:i}){let[x,g]=(0,r.useState)({name:"",priority:1,apiKey:""}),[f,b]=(0,r.useState)({}),[v,j]=(0,r.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[y,k]=(0,r.useState)({accountId:""}),[N,w]=(0,r.useState)(""),[C,S]=(0,r.useState)({location:"global",reasoningEffort:"high"}),[O,F]=(0,r.useState)(!1),[T,I]=(0,r.useState)(null),[$,P]=(0,r.useState)(!1),[W,E]=(0,r.useState)(null),[A,R]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(t){g({name:t.name||"",priority:t.priority||1,apiKey:""}),"azure"===t.provider&&t.providerSpecificData&&j({azureEndpoint:t.providerSpecificData.azureEndpoint||"",apiVersion:t.providerSpecificData.apiVersion||"2024-10-01-preview",deployment:t.providerSpecificData.deployment||"",organization:t.providerSpecificData.organization||""}),"cloudflare-ai"===t.provider&&t.providerSpecificData&&k({accountId:t.providerSpecificData.accountId||""});let e=u.Q2?.[t.provider];e?.regions&&w(t.providerSpecificData?.region||e.defaultRegion||e.regions[0]?.id||""),("vertex"===t.provider||"vertex-partner"===t.provider)&&t.providerSpecificData&&S({location:t.providerSpecificData.location||"global",reasoningEffort:t.providerSpecificData.reasoningEffort||"high"}),I(null),E(null),b(t.quotaPauseThresholds&&"object"==typeof t.quotaPauseThresholds?{...t.quotaPauseThresholds}:{})}},[t]);let _=t?.authType==="oauth",q=t?.provider==="azure",M=t?.provider==="cloudflare-ai",z=t?.provider==="vertex"||t?.provider==="vertex-partner",L=!!t&&((0,u.mq)(t.provider)||(0,u.gb)(t.provider)),D=t&&u.Q2?.[t.provider]?.regions||null,U=()=>{if(D&&N)return{...t?.providerSpecificData||{},region:N}},K=async()=>{if(t?.provider){F(!0),I(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),a=await e.json();I(a.valid?"success":"failed")}catch{I("failed")}finally{F(!1)}}},V=async()=>{if(t?.provider&&x.apiKey){P(!0),E(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:x.apiKey,...q?{providerSpecificData:v}:{},...M?{providerSpecificData:y}:{},...D?{providerSpecificData:U()}:{},...z?{providerSpecificData:C}:{}})}),a=await e.json();E(a.valid?"success":"failed")}catch{E("failed")}finally{P(!1)}}},B=async()=>{if(t){R(!0);try{let e={name:x.name,priority:x.priority,quotaPauseThresholds:{...f}};if(!_&&x.apiKey){e.apiKey=x.apiKey;let a="success"===W;if(!a)try{P(!0),E(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:x.apiKey,...q?{providerSpecificData:v}:{},...M?{providerSpecificData:y}:{},...D?{providerSpecificData:U()}:{},...z?{providerSpecificData:C}:{}})});a=!!(await e.json()).valid,E(a?"success":"failed")}catch{E("failed")}finally{P(!1)}a&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null)}q&&(e.providerSpecificData={azureEndpoint:v.azureEndpoint,apiVersion:v.apiVersion,deployment:v.deployment,organization:v.organization}),M&&(e.providerSpecificData={accountId:y.accountId}),D&&N&&(e.providerSpecificData=U()),z&&(e.providerSpecificData={location:C.location||"global",reasoningEffort:C.reasoningEffort||"high"}),await n(e)}finally{R(!1)}}};return t?(0,s.jsx)(l.default,{isOpen:e,title:"Edit Connection",onClose:i,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(o.default,{label:"Name",value:x.name,onChange:e=>g({...x,name:e.target.value}),placeholder:_?"Account name":"Production Key"}),_&&t.email&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,s.jsx)("p",{className:"font-medium",children:t.email})]}),(0,s.jsx)(o.default,{label:"Priority",type:"number",value:x.priority,onChange:e=>g({...x,priority:Number.parseInt(e.target.value,10)||1})}),(0,s.jsx)(p,{thresholds:f,onChange:(e,t)=>b(a=>({...a,[e]:t})),connection:t}),!_&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.default,{label:"API Key",type:"password",value:x.apiKey,onChange:e=>g({...x,apiKey:e.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(c.default,{onClick:V,disabled:!x.apiKey||$||A,variant:"secondary",children:$?"Checking...":"Check"})})]}),W&&(0,s.jsx)(m.default,{variant:"success"===W?"success":"error",children:"success"===W?"Valid":"Invalid"})]}),q&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)(o.default,{label:"Azure Endpoint",value:v.azureEndpoint,onChange:e=>j({...v,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com",hint:"Your Azure OpenAI resource endpoint URL"}),(0,s.jsx)(o.default,{label:"Deployment Name",value:v.deployment,onChange:e=>j({...v,deployment:e.target.value}),placeholder:"gpt-4",hint:"The deployment name in your Azure resource"}),(0,s.jsx)(o.default,{label:"API Version",value:v.apiVersion,onChange:e=>j({...v,apiVersion:e.target.value}),placeholder:"2024-10-01-preview",hint:"Azure OpenAI API version to use"}),(0,s.jsx)(o.default,{label:"Organization",value:v.organization,onChange:e=>j({...v,organization:e.target.value}),placeholder:"Organization ID",hint:"Required for billing"})]})]}),D&&(0,s.jsx)(d.default,{label:"Region",value:N,onChange:e=>w(e.target.value),options:D.map(e=>({value:e.id,label:e.label}))}),z&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Vertex AI Configuration"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)(d.default,{label:"Location",value:C.location,onChange:e=>S({...C,location:e.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,s.jsx)(d.default,{label:"Reasoning Effort (default)",value:C.reasoningEffort,onChange:e=>S({...C,reasoningEffort:e.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,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Location ",(0,s.jsx)("code",{children:"global"})," is required for Gemini 3.1 Pro Preview."]})]})]}),!L&&!q&&!M&&!z&&(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(c.default,{onClick:K,variant:"secondary",disabled:O,children:O?"Testing...":"Test Connection"}),T&&(0,s.jsx)(m.default,{variant:"success"===T?"success":"error",children:"success"===T?"Valid":"Failed"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(c.default,{onClick:B,fullWidth:!0,disabled:A,children:A?"Saving...":"Save"}),(0,s.jsx)(c.default,{onClick:i,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}p.propTypes={connection:i().object,thresholds:i().object.isRequired,onChange:i().func.isRequired},h.propTypes={isOpen:i().bool.isRequired,connection:i().shape({id:i().string,name:i().string,email:i().string,priority:i().number,authType:i().string,provider:i().string,providerSpecificData:i().object}),proxyPools:i().arrayOf(i().shape({id:i().string,name:i().string})),onSave:i().func.isRequired,onClose:i().func.isRequired}},78177:(e,t,a)=>{a.d(t,{XD:()=>l});var s=a(88105);function r(e){if(!e)return!1;let t="oauth"===e.authType,a=("apikey"===e.authType||"api_key"===e.authType)&&s.jO.includes(e.provider);return t||a}function n(e){let t=e?.quotaPauseThresholds;return t&&"object"==typeof t?t:{}}function i(e){let t=Number(e);return!Number.isFinite(t)||t<=0||t>100?0:t}function l(e){let t=n(e),a=e?.lastQuotaSnapshot?.windows||[],s=Object.values(t).some(e=>i(e)>0),l=function(e){if(!r(e))return null;let t=n(e),a=e?.lastQuotaSnapshot?.windows;if(!a||!Array.isArray(a)||0===a.length)return null;let s=null;for(let e of a){if(!e||!0===e.unlimited)continue;let a=i(t[e.key]);if(!a)continue;let r=Number(e.remainingPercentage);Number.isFinite(r)&&r<=a&&(null===s||r<Number(s.remainingPercentage))&&(s={key:e.key,remainingPercentage:r,threshold:a})}return s}(e);return{enabled:s,paused:null!==l,triggered:l,eligible:r(e),windows:a.map(e=>{let a=i(t[e.key]),s=Number(e.remainingPercentage);return{key:e.key,remainingPercentage:Number.isFinite(s)?s:null,threshold:a,configured:a>0,paused:a>0&&!e.unlimited&&Number.isFinite(s)&&s<=a}})}}},80752:(e,t,a)=>{a.d(t,{default:()=>m});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(1620),o=a(97556),d=a(81127);function c({icon:e,label:t,onClick:a,trailing:r,danger:n}){return(0,s.jsxs)("button",{onClick:a,className:`flex items-center gap-3 w-full px-4 py-2.5 text-sm transition-colors ${n?"text-red-500 hover:bg-red-500/10":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[20px] ${n?"":"text-text-muted"}`,children:e}),(0,s.jsx)("span",{className:"flex-1 text-left",children:t}),r&&(0,s.jsx)("span",{className:"text-base",children:r})]})}function m({onLogout:e}){let[t,a]=(0,r.useState)(!1),[n,i]=(0,r.useState)(!1),[u,x]=(0,r.useState)(!1),[p,h]=(0,r.useState)(!1),{toggleTheme:g,isDark:f}=(0,l.D)(),b=(0,r.useRef)(null),v=async()=>{h(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch(e){}h(!1),x(!1)};return(0,r.useEffect)(()=>{let e=e=>{b.current&&!b.current.contains(e.target)&&a(!1)};if(t)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[t]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"relative",ref:b,children:[(0,s.jsx)("button",{onClick:()=>a(e=>!e),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Menu",children:(0,s.jsx)("span",{className:"material-symbols-outlined",children:"grid_view"})}),t&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-60 bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl z-50 animate-in fade-in zoom-in-95 duration-150 overflow-hidden py-1",children:[(0,s.jsx)(c,{icon:"history",label:"Change Log",onClick:()=>{a(!1),i(!0)}}),(0,s.jsx)(c,{icon:f?"light_mode":"dark_mode",label:"Theme",onClick:()=>{g(),a(!1)}}),(0,s.jsx)(c,{icon:"power_settings_new",label:"Shutdown",danger:!0,onClick:()=>{a(!1),x(!0)}}),(0,s.jsx)(c,{icon:"logout",label:"Logout",danger:!0,onClick:()=>{a(!1),e()}})]})]}),(0,s.jsx)(o.default,{isOpen:n,onClose:()=>i(!1)}),(0,s.jsx)(d.ConfirmModal,{isOpen:u,onClose:()=>x(!1),onConfirm:v,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:p})]})}c.propTypes={icon:i().string.isRequired,label:i().string.isRequired,onClick:i().func.isRequired,trailing:i().node,danger:i().bool},m.propTypes={onLogout:i().func.isRequired}},81127:(e,t,a)=>{a.d(t,{ConfirmModal:()=>d,default:()=>o});var s=a(95155),r=a(12115),n=a(31474),i=a(92542),l=a(97677);function o({isOpen:e,onClose:t,title:a,children:i,footer:d,size:c="md",closeOnOverlay:m=!0,showTrafficLights:u=!0,className:x}){return((0,r.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,r.useEffect)(()=>{let a=a=>{"Escape"===a.key&&e&&t()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t]),e)?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:m?t:void 0}),(0,s.jsxs)("div",{className:(0,n.cn)("relative w-full bg-surface","border border-border-subtle","rounded-[14px] shadow-[var(--shadow-elev)]","fade-in",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[c],x),children:[(a||u)&&(0,s.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border-subtle",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[u&&(0,s.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,s.jsx)(l.default,{text:"Close",position:"top",color:"#FF5F56",children:(0,s.jsx)("button",{onClick:t,"aria-label":"Close",title:"Close",className:"w-4 h-4 rounded-full bg-[#FF5F56] hover:brightness-90 transition-all cursor-pointer flex items-center justify-center group/dot",children:(0,s.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),a&&(0,s.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:a})]}),(0,s.jsx)("button",{onClick:t,"aria-label":"Close",className:"md:hidden p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,s.jsx)("div",{className:"p-6 max-h-[calc(85vh-100px)] overflow-y-auto custom-scrollbar",children:i}),d&&(0,s.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:d})]})]}):null}function d({isOpen:e,onClose:t,onConfirm:a,title:r="Confirm",message:n,confirmText:l="Confirm",cancelText:c="Cancel",variant:m="danger",loading:u=!1}){return(0,s.jsx)(o,{isOpen:e,onClose:t,title:r,size:"sm",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.default,{variant:"ghost",onClick:t,disabled:u,children:c}),(0,s.jsx)(i.default,{variant:m,onClick:a,loading:u,children:l})]}),children:(0,s.jsx)("p",{className:"text-text-muted",children:n})})}},84130:(e,t,a)=>{a.d(t,{default:()=>N});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(98500),o=a.n(l),d=a(73321),c=a(31474),m=a(90620),u=a(88105),x=a(11059),p=a(92542),h=a(97556),g=a(73147);function f({currentVersion:e,latestVersion:t,installCmd:a,onClose:n}){let[i,l]=(0,r.useState)("auto"),[o,d]=(0,r.useState)("idle"),[c,u]=(0,r.useState)(null),[x,b]=(0,r.useState)(null),[v,j]=(0,r.useState)(!1),[y,k]=(0,r.useState)(0),[N,w]=(0,r.useState)(!1),[C,S]=(0,r.useState)({bullets:[],truncated:!1,loading:!0,error:null,versions:[]}),[O,F]=(0,r.useState)(!1),T=(0,r.useRef)(null),I=(0,r.useRef)(null),$=(0,r.useRef)(!1),P=(0,r.useCallback)(()=>{T.current&&(clearInterval(T.current),T.current=null),I.current&&(clearInterval(I.current),I.current=null)},[]);(0,r.useEffect)(()=>()=>{$.current=!0,P()},[P]),(0,r.useEffect)(()=>{let a=!1;return S(e=>({...e,loading:!0,error:null})),fetch(m.Nu.changelogUrl,{cache:"no-store"}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.text()}).then(s=>{if(a)return;let r=(0,g.zV)(s,e,t);if(0===r.length&&t&&(r=(0,g.zV)(s,null,t)),0===r.length&&e&&(r=(0,g.zV)(s,e,null).slice(0,2)),0===r.length){let e=(0,g.MY)(s);e.length>0&&(r=[e[0]])}let{bullets:n,truncated:i,versions:l}=(0,g.eK)(r,{maxBullets:10});S({bullets:n,truncated:i,loading:!1,error:null,versions:l})}).catch(e=>{a||S({bullets:[],truncated:!1,loading:!1,error:e.message||"Failed to load release notes",versions:[]})}),()=>{a=!0}},[e,t]);let W=(0,r.useCallback)(()=>{(0,g.TJ)(e)},[e]),E=(0,r.useCallback)(()=>{P();let e=function(e=m.h0.statusPort){return`http://127.0.0.1:${e}/update/status`}(),t=async()=>{if(!$.current)try{let t=await fetch(e,{cache:"no-store"});if(!t.ok)return;let a=await t.json();if($.current)return;(u(a),d("running"),a&&a.done&&a.success)?(d("success"),I.current||(I.current=setInterval(()=>{globalThis.location.reload()},2e3),setTimeout(()=>{try{globalThis.location.reload()}catch{}},2500)),T.current&&(clearInterval(T.current),T.current=null)):a&&("error"===a.phase||a.done&&!a.success)&&(d("failed"),b(a.error||"Install failed"),l("manual"),T.current&&(clearInterval(T.current),T.current=null))}catch{}};t(),T.current=setInterval(t,m.h0.statusPollIntervalMs)},[P]),A=(0,r.useCallback)(async()=>{b(null),u(null),d("starting"),$.current=!1,W();try{let e=await fetch("/api/version/update",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok){b(t.message||`Auto-update unavailable (${e.status})`),d("failed"),l("manual");return}d("running"),E()}catch(e){d("running"),E(),e?.message&&b(null)}},[E,W]),R=async()=>{W();try{await navigator.clipboard.writeText(a)}catch{}j(!0);let e=m.h0.shutdownCountdownSec;k(e);let t=setInterval(()=>{k(e-=1),e<=0&&(clearInterval(t),fetch("/api/version/shutdown",{method:"POST"}).catch(()=>{}),w(!0))},1e3)},_=function(e){if(!e||"object"!=typeof e)return 5;let{phase:t,attempt:a=0,maxRetries:s=m.h0.installRetries,done:r,success:n}=e;if(r&&n)return 100;if("error"===t||r&&!n)return 90;switch(t){case"starting":return 8;case"waitingForExit":return 22;case"installing":{let e=Math.max(1,s);return Math.round(35+Math.min(a,e)/e*50)}case"done":return 100;default:return 5}}(c||{phase:"starting"===o?"starting":null}),q="starting"===o?"Contacting updater…":"success"===o?"Update complete — reloading when app is ready…":function(e,t={}){let a=t.attempt||0,s=t.maxRetries||m.h0.installRetries;switch(e){case"starting":return"Starting updater…";case"waitingForExit":return"Stopping current app (releasing file locks)…";case"installing":return a>0?`Installing package (attempt ${a}/${s})…`:"Installing package…";case"done":return"Update complete — restarting app…";case"error":return"Update failed";default:return e?String(e):"Preparing…"}}(c?.phase,{attempt:c?.attempt,maxRetries:c?.maxRetries}),M=Array.isArray(c?.logTail)?c.logTail:[],z="starting"===o||"running"===o||"success"===o,L=`Update EzRouter${t?` to v${t}`:""}`,D=(0,s.jsxs)("div",{className:"mb-4 rounded-lg border border-white/10 bg-white/5 p-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-2",children:[(0,s.jsxs)("p",{className:"text-xs font-semibold text-white/90",children:["What's new",t?(0,s.jsxs)("span",{className:"font-normal text-white/50",children:[" ",e?`v${e} → `:"","v",t]}):null]}),(0,s.jsx)("button",{type:"button",onClick:()=>F(!0),className:"text-[10px] text-white/50 hover:text-white/80 transition-colors shrink-0",children:"Full changelog"})]}),C.loading&&(0,s.jsxs)("p",{className:"text-[11px] text-white/50 flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] animate-spin",children:"progress_activity"}),"Loading release notes…"]}),!C.loading&&C.error&&(0,s.jsxs)("p",{className:"text-[11px] text-white/50",children:["Couldn't load release notes (",C.error,"). You can still update."]}),!C.loading&&!C.error&&0===C.bullets.length&&(0,s.jsx)("p",{className:"text-[11px] text-white/50",children:"No release notes found for this range yet. Check the full changelog after updating."}),!C.loading&&C.bullets.length>0&&(0,s.jsxs)("ul",{className:"max-h-40 overflow-y-auto space-y-1 text-[11px] text-white/75 list-disc list-inside",children:[C.bullets.map((e,t)=>(0,s.jsxs)("li",{className:"leading-snug",title:e.text,children:[(0,s.jsxs)("span",{className:"text-white/40 mr-1",children:["v",e.version]}),e.text]},`${e.version}-${t}`)),C.truncated&&(0,s.jsx)("li",{className:"list-none text-white/40 pl-0",children:"…more in full changelog"})]})]});if("auto"===i)return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"w-full max-w-xl rounded-xl bg-neutral-900/95 border border-white/10 p-6 text-white",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsx)("div",{className:"flex items-center justify-center size-11 rounded-full bg-green-500/20 text-green-400",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:"success"===o?"check_circle":"system_update"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:L}),(0,s.jsx)("p",{className:"text-xs text-white/60",children:"One-click install. The app will stop, update, and restart automatically."})]})]}),"idle"===o&&(0,s.jsxs)(s.Fragment,{children:[D,(0,s.jsxs)("ul",{className:"text-xs text-white/70 space-y-1.5 list-disc list-inside mb-4",children:[(0,s.jsxs)("li",{children:["Works with the production ",(0,s.jsx)("code",{className:"px-1 rounded bg-white/10",children:"ezrouter"})," CLI install"]}),(0,s.jsx)("li",{children:"Takes about 1–2 minutes (npm global install + restart)"}),(0,s.jsx)("li",{children:"You can switch to manual install if auto fails"})]}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,s.jsx)(p.default,{variant:"secondary",onClick:n,className:"sm:w-auto",children:"Cancel"}),(0,s.jsx)(p.default,{variant:"primary",fullWidth:!0,onClick:A,children:"Update & Restart"})]}),(0,s.jsx)("button",{type:"button",onClick:()=>l("manual"),className:"mt-3 w-full text-center text-[11px] text-white/50 hover:text-white/80 transition-colors",children:"Prefer manual install instead?"})]}),z&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs mb-1.5",children:[(0,s.jsx)("span",{className:"text-white/80",children:q}),(0,s.jsxs)("span",{className:"text-white/50 tabular-nums",children:[_,"%"]})]}),(0,s.jsx)("div",{className:"h-1.5 rounded-full bg-white/10 overflow-hidden",children:(0,s.jsx)("div",{className:"h-full bg-green-500 transition-all duration-500",style:{width:`${Math.min(100,_)}%`}})})]}),M.length>0&&(0,s.jsx)("div",{className:"mb-3 max-h-32 overflow-y-auto rounded bg-black/40 px-2 py-1.5 font-mono text-[10px] text-white/60 space-y-0.5",children:M.map((e,t)=>(0,s.jsx)("div",{className:"truncate",children:e},`${t}-${e.slice(0,24)}`))}),"success"===o?(0,s.jsx)("p",{className:"text-xs text-green-400/90 mb-3",children:"Install succeeded. Waiting for the app to come back, then reloading…"}):(0,s.jsx)("p",{className:"text-xs text-white/50 mb-3",children:"Keep this tab open. Do not close the browser until the update finishes."}),"success"!==o&&(0,s.jsx)("button",{type:"button",onClick:()=>{P(),l("manual"),d("failed")},className:"w-full text-center text-[11px] text-white/50 hover:text-white/80 transition-colors",children:"Stuck? Switch to manual install"})]}),"failed"===o&&"auto"===i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-3 rounded border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-300",children:x||"Auto-update failed."}),(0,s.jsx)(p.default,{variant:"primary",fullWidth:!0,onClick:()=>l("manual"),children:"Open manual install"})]})]}),(0,s.jsx)(h.default,{isOpen:O,onClose:()=>F(!1)})]});let U=y>0;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"w-full max-w-xl rounded-xl bg-neutral-900/95 border border-white/10 p-6 text-white",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsx)("div",{className:"flex items-center justify-center size-11 rounded-full bg-amber-500/20 text-amber-400",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:"content_copy"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:L}),(0,s.jsx)("p",{className:"text-xs text-white/60",children:N?"Server stopped. Paste the command into a terminal to install.":U?`Command copied. Server will stop in ${y}s...`:x?"Auto-update unavailable — install manually.":"Copy the install command, stop the server, then re-run ezrouter."})]})]}),!N&&!U&&D,x&&(0,s.jsx)("div",{className:"mb-3 rounded border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-200",children:x}),(0,s.jsx)("p",{className:"text-sm text-white/80 mb-2",children:"Install command:"}),(0,s.jsx)("div",{className:"w-full px-3 py-2 rounded bg-white/5 mb-4",children:(0,s.jsx)("code",{className:"text-xs font-mono text-amber-400 break-all",children:a})}),(0,s.jsxs)("ol",{className:"text-xs text-white/70 space-y-1 list-decimal list-inside mb-4",children:[(0,s.jsxs)("li",{children:["Click ",(0,s.jsx)("strong",{children:"Copy & Shutdown"})," below."]}),(0,s.jsx)("li",{children:"Paste the command into your terminal and press Enter."}),(0,s.jsxs)("li",{children:["Run ",(0,s.jsx)("code",{className:"px-1 rounded bg-white/10 text-green-400",children:"ezrouter"})," again after install."]})]}),N?(0,s.jsx)(p.default,{variant:"secondary",fullWidth:!0,onClick:()=>globalThis.location.reload(),children:"Reload Page"}):(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,s.jsx)(p.default,{variant:"secondary",onClick:()=>{z||n()},disabled:U,className:"sm:w-auto",children:"Cancel"}),(0,s.jsx)(p.default,{variant:"primary",fullWidth:!0,onClick:R,disabled:U,children:v?"✓ Copied — shutting down...":U?`Shutting down in ${y}s`:"Copy & Shutdown"})]}),!N&&!U&&(0,s.jsx)("button",{type:"button",onClick:()=>{l("auto"),d("idle"),b(null),u(null)},className:"mt-3 w-full text-center text-[11px] text-white/50 hover:text-white/80 transition-colors",children:"Try automatic update instead"})]}),(0,s.jsx)(h.default,{isOpen:O,onClose:()=>F(!1)})]})}f.propTypes={currentVersion:i().string,latestVersion:i().string,installCmd:i().string.isRequired,onClose:i().func.isRequired};let b=["embedding","image","video","tts","stt"],v="/dashboard/media-providers/web",j=[{href:"/dashboard/endpoint",label:"Endpoint & Key",icon:"api"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combo & Vision Adapter",icon:"layers"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/routing-health",label:"Routing Health",icon:"speed"},{href:"/dashboard/token-saver",label:"Token Saver",icon:"savings"},{href:"/dashboard/convoy",label:"Input Guard",icon:"filter_alt"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],y=[{href:"/dashboard/console-log",label:"Console Log",icon:"terminal"},{href:"/dashboard/error-log",label:"Error Log",icon:"error"},{href:"/dashboard/translator",label:"Translator",icon:"translate"}],k=[{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/skills",label:"Skills",icon:"extension"}];function N({onClose:e}){let t=(0,d.usePathname)(),[a,n]=(0,r.useState)(!1),[i,l]=(0,r.useState)(null),[p,h]=(0,r.useState)(!1),[g,w]=(0,r.useState)(!1),{copied:C,copy:S}=(0,x.C)(2e3),O=m.h0.installCmdLatest;(0,r.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{e.enableTranslator&&w(!0)}).catch(()=>{})},[]),(0,r.useEffect)(()=>{fetch("/api/version").then(e=>e.json()).then(e=>{e.hasUpdate&&l(e)}).catch(()=>{})},[]);let F=e=>"/dashboard/endpoint"===e?"/dashboard"===t||t.startsWith("/dashboard/endpoint"):t.startsWith(e);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("aside",{className:"flex w-72 flex-col border-r border-border-subtle bg-vibrancy backdrop-blur-xl transition-colors duration-300 min-h-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-6 pt-5 pb-2",children:[(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),(0,s.jsxs)("div",{className:"px-6 py-4 flex flex-col gap-2",children:[(0,s.jsxs)(o(),{href:"/dashboard",className:"flex items-center gap-3",children:[(0,s.jsx)("img",{src:"/logo.png",alt:"EzRouter",className:"size-9 rounded-[10px] object-contain shadow-[var(--shadow-warm)]",onError:e=>{e.currentTarget.onerror=null,e.currentTarget.src="/favicon.svg"}}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("h1",{className:"text-lg font-semibold tracking-tight text-text-main",children:m.vQ.name}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["v",m.vQ.version]})]})]}),i&&(0,s.jsxs)("div",{className:"flex flex-col gap-1.5 rounded p-1 -m-1",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-green-600 dark:text-amber-500",children:["↑ New version available: v",i.latestVersion]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:()=>h(!0),className:"px-2 py-1 rounded bg-green-600 hover:bg-green-700 dark:bg-amber-500 dark:hover:bg-amber-600 text-white text-[11px] font-semibold transition-colors cursor-pointer",children:"Update now"}),(0,s.jsx)("button",{onClick:()=>S(O),title:"Copy install command",className:"flex-1 text-left hover:opacity-80 transition-opacity cursor-pointer min-w-0",children:(0,s.jsx)("code",{className:"block text-[10px] text-green-600/80 dark:text-amber-400/70 font-mono truncate",children:C?"✓ copied!":O})})]})]})]}),(0,s.jsxs)("nav",{className:"flex-1 px-4 py-2 space-y-0.5 overflow-y-auto custom-scrollbar",children:[j.map(t=>(0,s.jsxs)(o(),{href:t.href,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",F(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px]",F(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,s.jsx)("span",{className:"text-[13px] font-medium",children:t.label})]},t.href)),(0,s.jsxs)("div",{className:"pt-3 mt-2 space-y-0.5",children:[(0,s.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"System"}),(0,s.jsxs)("button",{onClick:()=>n(e=>!e),className:(0,c.cn)("w-full flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",t.startsWith("/dashboard/media-providers")?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"perm_media"}),(0,s.jsx)("span",{className:"text-[13px] font-medium flex-1 text-left",children:"Media Providers"}),(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] transition-transform",style:{transform:a?"rotate(180deg)":"rotate(0deg)"},children:"expand_more"})]}),a&&(0,s.jsxs)("div",{className:"pl-4",children:[u.rj.filter(e=>b.includes(e.id)).map(a=>(0,s.jsxs)(o(),{href:`/dashboard/media-providers/${a.id}`,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-4 py-1 rounded-lg transition-all group",t.startsWith(`/dashboard/media-providers/${a.id}`)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:a.icon}),(0,s.jsx)("span",{className:"text-sm",children:a.label})]},a.id)),(0,s.jsxs)(o(),{href:v,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-4 py-1 rounded-lg transition-all group",t.startsWith(v)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"travel_explore"}),(0,s.jsx)("span",{className:"text-sm",children:"Web Fetch & Search"})]},"web")]}),k.map(t=>(0,s.jsxs)(o(),{href:t.href,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",F(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px]",F(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,s.jsx)("span",{className:"text-[13px] font-medium",children:t.label})]},t.href)),y.map(t=>"/dashboard/translator"!==t.href||g?(0,s.jsxs)(o(),{href:t.href,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",F(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px]",F(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,s.jsx)("span",{className:"text-[13px] font-medium",children:t.label})]},t.href):null),(0,s.jsxs)(o(),{href:"/dashboard/profile",onClick:e,className:(0,c.cn)("flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",F("/dashboard/profile")?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,s.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px]",F("/dashboard/profile")?"fill-1":"group-hover:text-primary transition-colors"),children:"settings"}),(0,s.jsx)("span",{className:"text-[13px] font-medium",children:"Settings"})]})]})]})]}),p&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm p-6",children:(0,s.jsx)(f,{currentVersion:i?.currentVersion||m.vQ.version,latestVersion:i?.latestVersion,installCmd:O,onClose:()=>h(!1)})})]})}N.propTypes={onClose:i().func}},85416:(e,t,a)=>{a.d(t,{default:()=>c});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(35497);let o="auto",d=[{value:o,label:"Auto-detect (recommended)"},{value:"us-east-1",label:"US East (N. Virginia)"},{value:"eu-central-1",label:"Europe (Frankfurt)"}];function c({isOpen:e,onMethodSelect:t,onClose:a}){let[n,i]=(0,r.useState)(null),[m,u]=(0,r.useState)(""),[x,p]=(0,r.useState)("us-east-1"),[h,g]=(0,r.useState)(""),[f,b]=(0,r.useState)(""),[v,j]=(0,r.useState)(""),[y,k]=(0,r.useState)(o),[N,w]=(0,r.useState)(null),[C,S]=(0,r.useState)(!1),[O,F]=(0,r.useState)(!1),[T,I]=(0,r.useState)(!1),[$,P]=(0,r.useState)(null);(0,r.useEffect)(()=>{"import"===n&&e&&(async()=>{F(!0),w(null),I(!1),P(null);try{let e=await fetch("/api/oauth/kiro/auto-import"),t=await e.json();t.found?(g(t.refreshToken),I(!0),t.clientId&&t.clientSecret&&P({clientId:t.clientId,clientSecret:t.clientSecret,region:t.region,authMethod:t.authMethod,profileArn:t.profileArn})):w(t.error||"Could not auto-detect token")}catch(e){w("Failed to auto-detect token")}finally{F(!1)}})()},[n,e]);let W=e=>{i(e),w(null)},E=()=>{i(null),w(null)},A=async()=>{if(!h.trim())return void w("Please enter a refresh token");S(!0),w(null);try{let e=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:h.trim(),...$||{}})}),a=await e.json();if(!e.ok)throw Error(a.error||"Import failed");t("import")}catch(e){w(e.message)}finally{S(!1)}},R=async()=>{if(!f.trim())return void w("Please paste CLIProxyAPI auth JSON");S(!0),w(null);try{let e=await fetch("/api/oauth/kiro/import-cli-proxy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({json:f.trim()})}),a=await e.json();if(!e.ok)throw Error(a.error||"CLIProxyAPI import failed");t("import-cli-proxy")}catch(e){w(e.message)}finally{S(!1)}},_=async()=>{if(!v.trim())return void w("Please enter an API key");S(!0),w(null);try{let e=await fetch("/api/oauth/kiro/api-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:v.trim(),region:y})}),a=await e.json();if(!e.ok)throw Error(a.error||"Import failed");t("api-key")}catch(e){w(e.message)}finally{S(!1)}},q=e=>{t("social",{provider:e})};return(0,s.jsx)(l.aF,{isOpen:e,title:"Connect Kiro",onClose:a,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[!n&&(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,s.jsx)("button",{onClick:()=>t("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,s.jsx)("button",{onClick:()=>W("idc"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,s.jsx)("button",{onClick:()=>W("api-key"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"key"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"API Key"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Use a long-lived Kiro/CodeWhisperer API key (headless auth)."})]})]})}),(0,s.jsx)("button",{onClick:()=>W("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,s.jsx)("button",{onClick:()=>W("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,s.jsx)("button",{onClick:()=>W("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})}),(0,s.jsx)("button",{onClick:()=>W("import-cli-proxy"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"data_object"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"Import CLIProxyAPI JSON"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Paste external_idp auth JSON from CLIProxyAPI/Kiro Microsoft login."})]})]})})]}),"idc"===n&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(l.pd,{value:m,onChange:e=>u(e.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,s.jsx)(l.pd,{value:x,onChange:e=>p(e.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),N&&(0,s.jsx)("p",{className:"text-sm text-red-600",children:N}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:()=>{m.trim()?t("idc",{startUrl:m.trim(),region:x}):w("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,s.jsx)(l.$n,{onClick:E,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"api-key"===n&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.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,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,s.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Paste a long-lived Kiro/CodeWhisperer API key. It is validated against AWS and stored directly as a bearer credential (no refresh)."})]})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["API Key ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(l.pd,{value:v,onChange:e=>j(e.target.value),placeholder:"Paste your Kiro API key...",className:"font-mono text-sm"})]}),(0,s.jsx)(l.l6,{label:"AWS Region",value:y,onChange:e=>k(e.target.value),options:d}),N&&(0,s.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,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:N})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:_,fullWidth:!0,disabled:C||!v.trim(),children:C?"Validating...":"Add API Key"}),(0,s.jsx)(l.$n,{onClick:E,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===n&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,s.jsxs)("div",{className:"flex-1 text-sm",children:[(0,s.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,s.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:()=>q("google"),fullWidth:!0,children:"Continue with Google"}),(0,s.jsx)(l.$n,{onClick:E,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===n&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,s.jsxs)("div",{className:"flex-1 text-sm",children:[(0,s.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,s.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:()=>q("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,s.jsx)(l.$n,{onClick:E,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===n&&(0,s.jsxs)("div",{className:"space-y-4",children:[O&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!O&&(0,s.jsxs)(s.Fragment,{children:[T&&(0,s.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,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,s.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!T&&!N&&(0,s.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,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,s.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(l.pd,{value:h,onChange:e=>g(e.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),N&&(0,s.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,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:N})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:A,fullWidth:!0,disabled:C||!h.trim(),children:C?"Importing...":"Import Token"}),(0,s.jsx)(l.$n,{onClick:E,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]}),"import-cli-proxy"===n&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.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,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,s.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Paste the Kiro CLIProxyAPI auth JSON containing auth_method=external_idp. Only Microsoft login token endpoints are accepted."})]})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["CLIProxyAPI Auth JSON ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("textarea",{value:f,onChange:e=>b(e.target.value),placeholder:'{"auth_method":"external_idp","access_token":"...","refresh_token":"...","client_id":"...","token_endpoint":"https://login.microsoftonline.com/.../oauth2/v2.0/token","profile_arn":"...","scopes":"..."}',className:"min-h-40 w-full rounded-md border border-border bg-background p-3 font-mono text-sm outline-none focus:border-primary"})]}),N&&(0,s.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,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:N})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:R,fullWidth:!0,disabled:C||!f.trim(),children:C?"Importing...":"Import CLIProxyAPI JSON"}),(0,s.jsx)(l.$n,{onClick:E,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})})}c.propTypes={isOpen:i().bool.isRequired,onMethodSelect:i().func.isRequired,onClose:i().func.isRequired}},90882:(e,t,a)=>{a.d(t,{default:()=>d});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(35497),o=a(11059);function d({isOpen:e,provider:t,providerInfo:a,onSuccess:n,onClose:i,oauthMeta:c,idcConfig:m}){let[u,x]=(0,r.useState)("waiting"),[p,h]=(0,r.useState)(null),[g,f]=(0,r.useState)(""),[b,v]=(0,r.useState)(null),[j,y]=(0,r.useState)(!1),[k,N]=(0,r.useState)(null),[w,C]=(0,r.useState)(!1),[S,O]=(0,r.useState)(!1),F=(0,r.useRef)(null),T=(0,r.useRef)(!1),I=(0,r.useRef)(!1),{copied:$,copy:P}=(0,o.C)(),[W,E]=(0,r.useState)(!1),[A,R]=(0,r.useState)("/callback?code=..."),_=(0,r.useRef)(!1);(0,r.useEffect)(()=>{E("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),R(`${window.location.origin}/callback?code=...`)},[]);let q=(0,r.useCallback)(async(e,a)=>{try{O(!0),v(null);let s=p?.redirectUri||`${window.location.origin}/callback`,r=p?.codeVerifier||null,i=a||p?.state||null,l=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:s,codeVerifier:r,state:i,...c?{meta:c}:{}})}),o=await l.json();if(!l.ok)throw Error(o.error||"Token exchange failed");x("success"),n?.()}catch(e){v(e.message),x("error")}finally{O(!1)}},[p,t,n,c]),M=(0,r.useCallback)(async e=>{if(p?.state)try{let t=await fetch("/api/oauth/xai/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,state:p.state})}),a=await t.json();if(!t.ok)throw Error(a.error);x("success"),n?.()}catch(e){v(e.message),x("error")}},[p,n]),z=(0,r.useCallback)(async(e,a,s,r,i)=>{T.current=!1,C(!0);let l=Date.now()+(Number.isFinite(i)&&i>0?i:12e4);for(;Date.now()<l;){if(T.current){console.log("[OAuthModal] Polling aborted"),C(!1);return}if(await new Promise(e=>setTimeout(e,1e3*s)),T.current){console.log("[OAuthModal] Polling aborted after sleep"),C(!1);return}try{let i=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:a,extraData:r,..."cursor"===t?{state:e}:{}})}),l=await i.json();if(l.success){T.current=!0,x("success"),C(!1),n?.();return}if("expired_token"===l.error||"access_denied"===l.error)throw Error(l.errorDescription||l.error);"slow_down"===l.error&&(s=Math.min(s+5,30))}catch(e){v(e.message),x("error"),C(!1);return}}v("Authorization timeout"),x("error"),C(!1)},[t,n]),L=(0,r.useCallback)(async()=>{if(t)try{let e;if(v(null),"cursor"===t){y(!0),x("waiting");let e=await fetch(`/api/oauth/cursor/authorize?redirect_uri=${encodeURIComponent(window.location.origin+"/callback")}`),t=await e.json();if(!e.ok)throw Error(t.error);h(t),N({verification_uri:t.authUrl,user_code:""}),t.authUrl&&window.open(t.authUrl,"_blank","noopener,noreferrer"),z(t.state,null,2,null,1e3*(t.expiresIn||300));return}if(["github","qwen","kiro","kimi","kimi-coding","kilocode","codebuddy-cn","qoder","grok-cli","frontier-for-all"].includes(t)){y(!0),x("waiting");let e=new URL(`/api/oauth/${t}/device-code`,window.location.origin);"kiro"===t&&m?.startUrl&&(e.searchParams.set("start_url",m.startUrl),m.region&&e.searchParams.set("region",m.region),e.searchParams.set("auth_method","idc"));let a=await fetch(e.toString()),s=await a.json();if(!a.ok)throw Error(s.error);N(s);let r=s.verification_uri_complete||s.verification_uri;r&&window.open(r,"_blank","noopener,noreferrer");let n="kiro"===t?{_clientId:s._clientId,_clientSecret:s._clientSecret,_region:s._region,_authMethod:s._authMethod,_startUrl:s._startUrl}:"qoder"===t?{_qoderNonce:s._qoderNonce,_qoderMachineId:s._qoderMachineId,_qoderVerifier:s.codeVerifier}:"kimi"===t||"kimi-coding"===t?{_kimiDeviceId:s._kimiDeviceId}:null;z(s.device_code,s.codeVerifier,s.interval||5,n,Number.isFinite(s.expires_in)&&s.expires_in>0?1e3*s.expires_in:void 0);return}let a=window.location.port||("https:"===window.location.protocol?"443":"80");e="codex"===t?"http://localhost:1455/auth/callback":"xai"===t?"http://127.0.0.1:56121/callback":`http://localhost:${a}/callback`;let s=new URL(`/api/oauth/${t}/authorize`,window.location.origin);s.searchParams.set("redirect_uri",e),c&&Object.entries(c).forEach(([e,t])=>{t&&s.searchParams.set(e,t)});let r=await fetch(s.toString()),n=await r.json();if(!r.ok)throw Error(n.error);let i=!1,l=!1;if("codex"===t)try{let t=new URL("/api/oauth/codex/start-proxy",window.location.origin);t.searchParams.set("app_port",a),t.searchParams.set("state",n.state),t.searchParams.set("code_verifier",n.codeVerifier),t.searchParams.set("redirect_uri",e);let s=await fetch(t.toString()),r=await s.json();i=r.success,l=!!r.serverSide}catch{i=!1}let o=!1,d=!1;if("xai"===t)try{let t=new URL("/api/oauth/xai/start-proxy",window.location.origin);t.searchParams.set("app_port",a),t.searchParams.set("state",n.state),t.searchParams.set("code_verifier",n.codeVerifier),t.searchParams.set("redirect_uri",e);let s=await fetch(t.toString()),r=await s.json();if(o=r.success,d=!!r.serverSide,!o&&"port_busy"===r.reason)throw Error("Port 56121 in use; close the conflicting process and retry")}catch(e){if(e?.message)throw e;o=!1}if(h({...n,redirectUri:e,codexServerSide:l,xaiServerSide:d}),!n.authUrl){if("device_code"===n.flowType)throw Error(`Provider ${t} uses device-code login but is not wired in the OAuth modal device-code list`);throw Error("No authorization URL returned from OAuth provider")}"codex"===t&&i||"xai"===t&&o||W&&"codex"!==t&&"xai"!==t?(x("waiting"),F.current=window.open(n.authUrl,"oauth_popup","width=600,height=700"),F.current||x("input")):(x("input"),window.open(n.authUrl,"_blank"))}catch(e){v(e.message),x("error")}},[t,W,z,c,m]);(0,r.useEffect)(()=>{e&&t?I.current||(I.current=!0,h(null),f(""),v(null),y(!1),N(null),C(!1),T.current=!1,L()):e||(T.current=!0,I.current=!1,"codex"===t?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===t&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}))},[e,t,L]),(0,r.useEffect)(()=>{if(!p?.state||!t)return;let e=!1,a=0,s=async()=>{if(!e){a+=1;try{let a=await fetch(`/api/oauth/${t}/poll-status?state=${encodeURIComponent(p.state)}`),s=await a.json();if(e)return;if("done"===s.status){_.current=!0,x("success"),n?.();return}if("error"===s.status){_.current=!0,v(s.error||"Authentication failed"),x("error");return}}catch{}if(a>=300){_.current=!0,v("Authentication timeout"),x("error");return}e||setTimeout(s,1e3)}},r=setTimeout(s,1e3);return()=>{e=!0,clearTimeout(r)}},[p,t,n]),(0,r.useEffect)(()=>{let e;if(!p)return;_.current=!1;let t=async e=>{let{code:t,token:a,state:s,error:r,errorDescription:n,fullUrl:i}=e;if(i?f(i):t&&f(`${window.location.origin}/callback?state=${encodeURIComponent(s||"")}&code=${encodeURIComponent(t)}`),!_.current){if(r){_.current=!0,v(n||r),x("error");return}(a||t)&&(_.current=!0,await q(a||t,s))}},a=e=>{let a=e.origin.includes("localhost")||e.origin.includes("127.0.0.1"),s=e.origin===window.location.origin;(a||s)&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",a);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){console.log("BroadcastChannel not supported")}let s=e=>{if("oauth_callback"===e.key&&e.newValue)try{let a=JSON.parse(e.newValue);t(a),localStorage.removeItem("oauth_callback")}catch(e){console.log("Failed to parse localStorage data")}};window.addEventListener("storage",s);try{let e=localStorage.getItem("oauth_callback");if(e){let a=JSON.parse(e);a.timestamp&&Date.now()-a.timestamp<3e4&&t(a),localStorage.removeItem("oauth_callback")}}catch{}return()=>{window.removeEventListener("message",a),window.removeEventListener("storage",s),e&&e.close()}},[p,q]);let D=async()=>{try{v(null);let e=g.trim();if(!e)return;if(O(!0),e.startsWith("eyJ")&&e.includes("."))return void await q(e,null);if("xai"===t&&e&&!e.includes("://")&&!e.includes("?")&&!e.includes("code="))return void await M(e);if("kimchi"===t&&e&&!e.includes("://")&&!e.includes("?"))return void await q(e,null);let a=null,s=null,r=null,n=null;if(e.includes("://")||e.startsWith("/")||e.startsWith("?")){let t=e.startsWith("/")||e.startsWith("?")?`http://localhost${e.startsWith("?")?"":"/"}${e}`:e;try{let e=new URL(t);if(a=e.searchParams.get("code"),s=e.searchParams.get("token"),r=e.searchParams.get("state"),n=e.searchParams.get("error"))throw Error(e.searchParams.get("error_description")||n)}catch(t){if(n)throw t;a=e}}else a=e;if(!a&&!s)throw Error("xai"===t?"Paste the callback URL or copied xAI code":"kimchi"===t?"No Kimchi token found in URL":"No authorization code found in URL");await q(s||a,r)}catch(e){v(e.message),x("error")}finally{O(!1)}},U=(0,r.useCallback)(()=>{"codex"===t?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===t&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}),i()},[i,t]);if(!t||!a)return null;let K="xai"===t,V="kimchi"===t,B=k?.verification_uri_complete||k?.verification_uri||"",G=K?"Connect Grok Build OAuth":`Connect ${a.name}`,J=K?"http://127.0.0.1:56121/callback?code=... or copied code":V?`${A.replace("code=...","token=...")} or copied token`:A;return(0,s.jsx)(l.aF,{isOpen:e,title:G,onClose:U,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[("waiting"===u||"input"===u)&&!j&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,s.jsx)("span",{className:"text-sm",children:K?"Waiting for Grok Build OAuth…":"Waiting for popup authorization…"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 my-1",children:[(0,s.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,s.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wider",children:"Or paste callback URL manually"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 1: Open this ",K?"Grok Build OAuth URL":"URL"," in your browser"]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.pd,{value:p?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,s.jsx)(l.$n,{variant:"secondary",icon:"auth_url"===$?"check":"content_copy",onClick:()=>P(p?.authUrl,"auth_url"),disabled:!p?.authUrl,children:"Copy"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 2: Paste the ","xai"===t?"callback URL or copied code":V?"callback URL or copied token":"callback URL"," here"]}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"xai"===t?"If xAI shows a code instead of redirecting, paste that code here.":V?"After authorization, copy the full callback URL or token from your browser.":"After authorization, copy the full URL from your browser."}),(0,s.jsx)(l.pd,{value:g,onChange:e=>f(e.target.value),placeholder:J,className:"font-mono text-xs"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:D,fullWidth:!0,disabled:!g.trim()||S,children:S?"Connecting...":"Connect"}),(0,s.jsx)(l.$n,{onClick:U,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"waiting"===u&&j&&k&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"text-center py-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the login URL below and authorize:"}),(0,s.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Login URL"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("code",{className:"flex-1 text-sm break-all",children:B}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",icon:"login_url"===$?"check":"content_copy",onClick:()=>P(B,"login_url"),disabled:!B}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",icon:"open_in_new",onClick:()=>window.open(B,"_blank","noopener,noreferrer"),disabled:!B,children:"Open"})]})]}),k.user_code&&(0,s.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,s.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:k.user_code}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",icon:"user_code"===$?"check":"content_copy",onClick:()=>P(k.user_code,"user_code")})]})]})]}),w&&(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"success"===u&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",a.name," account has been connected."]}),(0,s.jsx)(l.$n,{onClick:U,fullWidth:!0,children:"Done"})]}),"error"===u&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,s.jsx)("p",{className:"text-sm text-red-600 mb-4",children:b}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:L,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,s.jsx)(l.$n,{onClick:U,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}d.propTypes={isOpen:i().bool.isRequired,provider:i().string,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired,oauthMeta:i().object,idcConfig:i().shape({startUrl:i().string,region:i().string})}},91450:(e,t,a)=>{a.d(t,{default:()=>l});var s=a(95155),r=a(14051),n=a.n(r),i=a(38587);function l({children:e}){return(0,s.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,s.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,s.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,s.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,s.jsx)(i.default,{variant:"card"})}),(0,s.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}l.propTypes={children:n().node.isRequired}},92173:(e,t,a)=>{a.d(t,{default:()=>c});var s=a(95155),r=a(98500),n=a.n(r),i=a(90620);let l=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],d=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function c(){return(0,s.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,s.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,s.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,s.jsx)("div",{className:"size-6 text-primary",children:(0,s.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,s.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,s.jsx)("span",{className:"text-xl font-bold text-text-main",children:i.vQ.name})]}),(0,s.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,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.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,s.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.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,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:l.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(n(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(n(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:d.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(n(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,s.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",i.vQ.name," Inc. All rights reserved."]}),(0,s.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,s.jsx)(n(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,s.jsx)(n(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},92542:(e,t,a)=>{a.d(t,{default:()=>l});var s=a(95155),r=a(31474);let n={primary:"bg-brand-500 hover:bg-brand-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-brand-500/40",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",danger:"bg-red-500 hover:bg-red-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-green-600 hover:bg-green-700 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},i={sm:"h-7 px-3 text-xs rounded-[8px]",md:"h-9 px-4 text-sm rounded-[10px]",lg:"h-11 px-6 text-sm rounded-[10px]"};function l({children:e,variant:t="primary",size:a="md",icon:o,iconRight:d,disabled:c=!1,loading:m=!1,fullWidth:u=!1,className:x,...p}){return(0,s.jsxs)("button",{className:(0,r.cn)("inline-flex items-center justify-center gap-2 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.97] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",n[t],i[a],u&&"w-full",x),disabled:c||m,...p,children:[m?(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):o?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o}):null,e,d&&!m&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:d})]})}},94230:(e,t,a)=>{a.d(t,{default:()=>d});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(35497),o=a(11059);function d({isOpen:e,provider:t,onSuccess:a,onClose:n}){let[i,c]=(0,r.useState)("loading"),[m,u]=(0,r.useState)(""),[x,p]=(0,r.useState)(null),[h,g]=(0,r.useState)(""),[f,b]=(0,r.useState)(null),{copied:v,copy:j}=(0,o.C)(),y=(0,r.useRef)(!1);(0,r.useEffect)(()=>{e||(y.current=!1)},[e]),(0,r.useEffect)(()=>{e&&t&&(async()=>{try{b(null),c("loading");let e=await fetch(`/api/oauth/kiro/social-authorize?provider=${t}`),a=await e.json();if(!e.ok)throw Error(a.error);p(a),u(a.authUrl),c("input"),y.current||(y.current=!0,window.open(a.authUrl,"_blank"))}catch(e){b(e.message),c("error")}})()},[e,t]);let k=async()=>{try{let e;b(null);try{e=new URL(h)}catch(e){throw Error("Invalid callback URL format")}let s=e.searchParams.get("code");e.searchParams.get("state");let r=e.searchParams.get("error");if(r)throw Error(e.searchParams.get("error_description")||r);if(!s)throw Error("No authorization code found in URL");let n=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:s,codeVerifier:x.codeVerifier,provider:t})}),i=await n.json();if(!n.ok)throw Error(i.error);c("success"),a?.()}catch(e){b(e.message),c("error")}},N="google"===t?"Google":"GitHub";return(0,s.jsx)(l.aF,{isOpen:e,title:`Connect Kiro via ${N}`,onClose:n,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===i&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",N," authentication"]})]}),"input"===i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.pd,{value:m,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,s.jsx)(l.$n,{variant:"secondary",icon:"auth_url"===v?"check":"content_copy",onClick:()=>j(m,"auth_url"),children:"Copy"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,s.jsx)(l.pd,{value:h,onChange:e=>g(e.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:k,fullWidth:!0,disabled:!h,children:"Connect"}),(0,s.jsx)(l.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===i&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",N," has been connected."]}),(0,s.jsx)(l.$n,{onClick:n,fullWidth:!0,children:"Done"})]}),"error"===i&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,s.jsx)("p",{className:"text-sm text-red-600 mb-4",children:f}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:()=>c("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,s.jsx)(l.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}d.propTypes={isOpen:i().bool.isRequired,provider:i().oneOf(["google","github"]).isRequired,onSuccess:i().func,onClose:i().func.isRequired}},95088:(e,t,a)=>{a.d(t,{default:()=>d});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(35497);let o="https://gitlab.com";function d({isOpen:e,providerInfo:t,onSuccess:a,onClose:n}){let i,[c,m]=(0,r.useState)(null),[u,x]=(0,r.useState)(o),[p,h]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),[b,v]=(0,r.useState)(""),[j,y]=(0,r.useState)(!1),[k,N]=(0,r.useState)(null),[w,C]=(0,r.useState)(!1),[S,O]=(0,r.useState)(null),F=()=>{m(null),x(o),h(""),f(""),v(""),N(null),y(!1),C(!1),O(null),n()},T=async()=>{if(!b.trim())return void N("Personal Access Token is required");y(!0),N(null);try{let e=await fetch("/api/oauth/gitlab/pat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:b.trim(),baseUrl:u.trim()||o})}),t=await e.json();if(!e.ok)throw Error(t.error||"Authentication failed");a?.(),F()}catch(e){N(e.message)}finally{y(!1)}};return e?w&&S?(0,s.jsx)(l.LF,{isOpen:!0,provider:"gitlab",providerInfo:t,oauthMeta:S,onSuccess:()=>{a?.(),F()},onClose:()=>{C(!1),O(null)}}):(0,s.jsx)(l.aF,{isOpen:e,title:"Connect GitLab Duo",onClose:F,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[!c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Choose how to authenticate with GitLab Duo:"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("button",{onClick:()=>m("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,s.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"OAuth App"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab OAuth application"})]})]}),(0,s.jsxs)("button",{onClick:()=>m("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,s.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Personal Access Token"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab PAT with api scope"})]})]})]})]}),"oauth"===c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Create an OAuth app at"," ",(0,s.jsx)("a",{href:`${u.trim()||o}/-/profile/applications`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Applications"})," ","with redirect URI"," ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:(i=window.location.port||("https:"===window.location.protocol?"443":"80"),`http://localhost:${i}/callback`)})]}),(0,s.jsx)(l.pd,{label:"GitLab Base URL",value:u,onChange:e=>x(e.target.value),placeholder:o}),(0,s.jsx)(l.pd,{label:"Client ID",value:p,onChange:e=>h(e.target.value),placeholder:"Your OAuth application client ID"}),(0,s.jsx)(l.pd,{label:"Client Secret (optional for PKCE)",value:g,onChange:e=>f(e.target.value),placeholder:"Leave empty for public PKCE app"}),k&&(0,s.jsx)("p",{className:"text-sm text-red-500",children:k}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:()=>{p.trim()?(N(null),O({baseUrl:u.trim()||o,clientId:p.trim(),clientSecret:g.trim()}),C(!0)):N("Client ID is required")},fullWidth:!0,disabled:!p.trim(),children:"Authorize"}),(0,s.jsx)(l.$n,{onClick:()=>{m(null),N(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"pat"===c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Create a PAT at"," ",(0,s.jsx)("a",{href:`${u.trim()||o}/-/user_settings/personal_access_tokens`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Access Tokens"})," ","with scopes: ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"api"}),","," ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"read_user"}),", and"," ",(0,s.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"ai_features"}),"."]}),(0,s.jsx)(l.pd,{label:"GitLab Base URL",value:u,onChange:e=>x(e.target.value),placeholder:o}),(0,s.jsx)(l.pd,{label:"Personal Access Token",value:b,onChange:e=>v(e.target.value),placeholder:"glpat-****************",type:"password"}),k&&(0,s.jsx)("p",{className:"text-sm text-red-500",children:k}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:T,fullWidth:!0,disabled:!b.trim()||j,loading:j,children:"Connect"}),(0,s.jsx)(l.$n,{onClick:()=>{m(null),N(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}d.propTypes={isOpen:i().bool.isRequired,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},96748:(e,t,a)=>{a.d(t,{default:()=>d});var s=a(95155),r=a(12115),n=a(14051),i=a.n(n),l=a(35497);let o="https://api.openai.com/v1";function d({isOpen:e,onClose:t,onCreated:a,onSaved:n,node:i}){let c=!!i,[m,u]=(0,r.useState)({name:"",prefix:"",baseUrl:o}),[x,p]=(0,r.useState)(!1),[h,g]=(0,r.useState)(""),[f,b]=(0,r.useState)(""),[v,j]=(0,r.useState)(!1),[y,k]=(0,r.useState)(null);(0,r.useEffect)(()=>{e&&(k(null),g(""),b(""),c?u({name:i.name||"",prefix:i.prefix||"",baseUrl:i.baseUrl||o}):u({name:"",prefix:"",baseUrl:o}))},[e,c,i]);let N=async()=>{if(m.name.trim()&&m.prefix.trim()&&m.baseUrl.trim()){p(!0);try{let e=c?`/api/provider-nodes/${i.id}`:"/api/provider-nodes",t=c?"PUT":"POST",s={name:m.name,prefix:m.prefix,baseUrl:m.baseUrl};c||(s.type="custom-embedding");let r=await fetch(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),l=await r.json();r.ok&&(c?n?.(l.node):a?.(l.node))}catch(e){console.log("Error saving custom embedding node:",e)}finally{p(!1)}}},w=async()=>{j(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:m.baseUrl,apiKey:h,type:"custom-embedding",modelId:f.trim()||void 0})}),t=await e.json();k(t)}catch{k({valid:!1,error:"Network error"})}finally{j(!1)}};return(0,s.jsx)(l.aF,{isOpen:e,title:c?"Edit Custom Embedding":"Add Custom Embedding",onClose:t,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(l.pd,{label:"Name",value:m.name,onChange:e=>u({...m,name:e.target.value}),placeholder:"Voyage AI",hint:"Required. A friendly label for this embedding provider."}),(0,s.jsx)(l.pd,{label:"Prefix",value:m.prefix,onChange:e=>u({...m,prefix:e.target.value}),placeholder:"voyage",hint:"Required. Used as the provider prefix for model IDs (e.g. voyage/voyage-3)."}),(0,s.jsx)(l.pd,{label:"Base URL",value:m.baseUrl,onChange:e=>u({...m,baseUrl:e.target.value}),placeholder:"https://api.voyageai.com/v1",hint:"Most embedding APIs are OpenAI-compatible: Voyage, Cohere, Jina, Mistral, Together..."}),(0,s.jsx)(l.pd,{label:"API Key (for Check)",type:"password",value:h,onChange:e=>g(e.target.value)}),(0,s.jsx)(l.pd,{label:"Model ID (for Check)",value:f,onChange:e=>b(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0, text-embedding-3-small",hint:"Required for validation. Will send a test embeddings request."}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(l.$n,{onClick:w,disabled:!h||!f.trim()||v||!m.baseUrl.trim(),variant:"secondary",children:v?"Checking...":"Check"}),(()=>{if(!y)return null;let{valid:e,error:t,dimensions:a}=y;return e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.Ex,{variant:"success",children:"Valid"}),a&&(0,s.jsxs)("span",{className:"text-sm text-text-muted",children:[a," dims"]})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(l.Ex,{variant:"error",children:"Invalid"}),t&&(0,s.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:N,fullWidth:!0,disabled:!m.name.trim()||!m.prefix.trim()||!m.baseUrl.trim()||x,children:x?c?"Saving...":"Creating...":c?"Save":"Create"}),(0,s.jsx)(l.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}d.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func,onSaved:i().func,node:i().shape({id:i().string,name:i().string,prefix:i().string,baseUrl:i().string})}},97556:(e,t,a)=>{a.d(t,{default:()=>c});var s=a(95155),r=a(12115),n=a(47650),i=a(14051),l=a.n(i),o=a(9233),d=a(90620);function c({isOpen:e,onClose:t}){let[a,i]=(0,r.useState)(""),[l,m]=(0,r.useState)(!1),[u,x]=(0,r.useState)(""),p=(0,r.useRef)(null);return((0,r.useEffect)(()=>{e&&(m(!0),x(""),fetch(d.Nu.changelogUrl,{cache:"no-store"}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.text()}).then(e=>i(o.xI.parse(e))).catch(e=>x(e.message||"Failed to load")).finally(()=>m(!1)))},[e]),(0,r.useEffect)(()=>{let a=e=>{p.current&&!p.current.contains(e.target)&&t()};if(e)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e,t]),!e||"u"<typeof document)?null:(0,n.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:t}),(0,s.jsxs)("div",{ref:p,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,s.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Change Log"}),(0,s.jsx)("button",{onClick:t,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,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,s.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[l&&(0,s.jsxs)("div",{className:"flex items-center justify-center py-10 text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"progress_activity"}),"Loading..."]}),u&&(0,s.jsxs)("div",{className:"text-red-500 py-4",children:["Failed to load changelog: ",u]}),!l&&!u&&a&&(0,s.jsx)("div",{className:"changelog-body text-text-main",dangerouslySetInnerHTML:{__html:a}})]})]})]}),document.body)}o.xI.setOptions({gfm:!0,breaks:!0}),c.propTypes={isOpen:l().bool.isRequired,onClose:l().func.isRequired}},97677:(e,t,a)=>{a.d(t,{default:()=>r});var s=a(95155);function r({text:e,children:t,position:a="top",color:n}){let i=n?"":"bg-gray-900";return(0,s.jsxs)("div",{className:"relative inline-flex group/tt",children:[t,(0,s.jsx)("div",{className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[a]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug ${i} text-white opacity-0 group-hover/tt:opacity-100 transition-opacity duration-150 whitespace-normal`,style:n?{backgroundColor:n}:{},children:e})]})}},98254:(e,t,a)=>{a.d(t,{default:()=>x});var s=a(95155),r=a(12115),n=a(73321),i=a(65921),l=a(84130),o=a(8823),d=a(90620),c=a(73147),m=a(97556);function u(){let[e,t]=(0,r.useState)(!1),[a,n]=(0,r.useState)(null),[i,l]=(0,r.useState)(null),[o,u]=(0,r.useState)([]),[x,p]=(0,r.useState)(!1),[h,g]=(0,r.useState)(!1),[f,b]=(0,r.useState)(!1);return((0,r.useEffect)(()=>{let e=(0,c.BM)(d.vQ.version);if(!e.show)return;t(!0),n(e.fromVersion),l(e.toVersion);let a=!1;return fetch(d.Nu.changelogUrl,{cache:"no-store"}).then(e=>e.ok?e.text():Promise.reject(Error(`HTTP ${e.status}`))).then(t=>{if(a)return;let s=(0,c.zV)(t,e.fromVersion,e.toVersion),r=s.length>0?s:(0,c.zV)(t,null,e.toVersion),{bullets:n,truncated:i}=(0,c.eK)(r.length?r:[],{maxBullets:6});u(n),p(i)}).catch(()=>{}),()=>{a=!0}},[]),e)?(0,s.jsxs)(s.Fragment,{children:[(0,s.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,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5 text-green-600 dark:text-green-400 shrink-0",children:"celebration"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"text-xs font-semibold",children:["Updated to v",i,a?(0,s.jsxs)("span",{className:"font-normal opacity-80",children:[" (from v",a,")"]}):null]}),!f&&0===o.length&&(0,s.jsx)("p",{className:"text-[11px] opacity-80 mt-0.5",children:"You're on the latest install."}),f&&o.length>0&&(0,s.jsxs)("ul",{className:"mt-1.5 space-y-0.5 text-[11px] opacity-90 list-disc list-inside",children:[o.map((e,t)=>(0,s.jsx)("li",{className:"truncate",title:e.text,children:e.text},`${e.version}-${t}`)),x&&(0,s.jsx)("li",{className:"list-none opacity-70 pl-0",children:"…and more"})]}),(0,s.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2",children:[o.length>0&&(0,s.jsx)("button",{type:"button",onClick:()=>b(e=>!e),className:"text-[11px] font-medium underline-offset-2 hover:underline",children:f?"Hide changes":"See what changed"}),(0,s.jsx)("button",{type:"button",onClick:()=>g(!0),className:"text-[11px] font-medium underline-offset-2 hover:underline opacity-80",children:"Full changelog"})]})]}),(0,s.jsx)("button",{type:"button",onClick:()=>{(0,c.yM)(d.vQ.version),t(!1)},className:"text-current/70 hover:text-current shrink-0","aria-label":"Dismiss",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]})}),(0,s.jsx)(m.default,{isOpen:h,onClose:()=>g(!1)})]}):null}function x({children:e}){let[t,a]=(0,r.useState)(!1),d=(0,n.usePathname)(),c=(0,i.i)(e=>e.notifications),m=(0,i.i)(e=>e.removeNotification);return(0,s.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[(0,s.jsxs)("div",{className:"fixed top-4 right-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",children:[(0,s.jsx)(u,{}),c.map(e=>{var t;let a="success"===(t=e.type)?{wrapper:"border-green-500/30 bg-green-500/10 text-green-600 dark:text-green-400",icon:"check_circle"}:"error"===t?{wrapper:"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400",icon:"error"}:"warning"===t?{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,s.jsx)("div",{className:`rounded-lg border px-3 py-2 shadow-lg backdrop-blur-sm ${a.wrapper}`,children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5",children:a.icon}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[e.title?(0,s.jsx)("p",{className:"text-xs font-semibold mb-0.5",children:e.title}):null,(0,s.jsx)("p",{className:"text-xs whitespace-pre-wrap break-words",children:e.message})]}),e.dismissible?(0,s.jsx)("button",{type:"button",onClick:()=>m(e.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},e.id)})]}),t&&(0,s.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 lg:hidden",onClick:()=>a(!1)}),(0,s.jsx)("div",{className:"hidden lg:flex",children:(0,s.jsx)(l.default,{})}),(0,s.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-300 ease-in-out ${t?"translate-x-0":"-translate-x-full"}`,children:(0,s.jsx)(l.default,{onClose:()=>a(!1)})}),(0,s.jsxs)("main",{className:"flex flex-col flex-1 h-full min-w-0 relative transition-colors duration-300 isolate",children:[(0,s.jsx)("div",{className:"landing-grid absolute inset-0 pointer-events-none -z-10","aria-hidden":"true"}),(0,s.jsx)(o.default,{onMenuClick:()=>a(!0)},d),(0,s.jsx)("div",{className:`flex-1 overflow-y-auto custom-scrollbar ${"/dashboard/basic-chat"===d?"":"p-6 lg:p-10"} ${"/dashboard/basic-chat"===d?"flex flex-col overflow-hidden":""}`,children:(0,s.jsx)("div",{className:`${"/dashboard/basic-chat"===d?"flex-1 w-full h-full flex flex-col":"max-w-7xl mx-auto"}`,children:e})})]})]})}u.propTypes={}},98542:(e,t,a)=>{a.d(t,{default:()=>n});var s=a(95155),r=a(31474);function n({checked:e=!1,onChange:t,label:a,description:i,disabled:l=!1,size:o="md",className:d}){let c={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,s.jsxs)("div",{className:(0,r.cn)("flex items-center gap-3",l&&"opacity-50 cursor-not-allowed",d),children:[(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:l,onClick:()=>{!l&&t&&t(!e)},className:(0,r.cn)("relative inline-flex shrink-0 cursor-pointer rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-2 focus:ring-brand-500/30",e?"bg-brand-500":"bg-surface-3",c[o].track,l&&"cursor-not-allowed"),children:(0,s.jsx)("span",{className:(0,r.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",e?c[o].translate:"translate-x-0.5",c[o].thumb,"mt-0.5")})}),(a||i)&&(0,s.jsxs)("div",{className:"flex flex-col",children:[a&&(0,s.jsx)("span",{className:"text-sm font-medium text-text-main",children:a}),i&&(0,s.jsx)("span",{className:"text-xs text-text-muted",children:i})]})]})}}}]);
|
package/app/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# v0.5.96 (2026-09-01)
|
|
2
|
+
|
|
3
|
+
## Features & Improvements
|
|
4
|
+
- **Continuous Polling & Auto-Close Reliability**:
|
|
5
|
+
- Ensured OAuth session polling continuously checks for server-side exchange completion without premature cancellation.
|
|
6
|
+
- Automatically closes modal and refreshes accounts table as soon as authorization completes in the background.
|
|
7
|
+
|
|
1
8
|
# v0.5.95 (2026-09-01)
|
|
2
9
|
|
|
3
10
|
## Features & Improvements
|