@yina-npm/openrouterx 0.4.23 → 0.4.25

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.
Files changed (274) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +1 -1
  3. package/app/.next/build-manifest.json +2 -2
  4. package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page_client-reference-manifest.js +1 -1
  5. package/app/.next/server/app/(dashboard)/dashboard/admin/users/page.js +1 -1
  6. package/app/.next/server/app/(dashboard)/dashboard/admin/users/page_client-reference-manifest.js +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +11 -11
  13. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  18. package/app/.next/server/app/(dashboard)/dashboard/page.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/user/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/_global-error.html +1 -1
  34. package/app/.next/server/app/_global-error.rsc +1 -1
  35. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  36. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  37. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  38. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  39. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  40. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  41. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  42. package/app/.next/server/app/_not-found.html +1 -1
  43. package/app/.next/server/app/_not-found.rsc +4 -4
  44. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  45. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  46. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  47. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  48. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  49. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  50. package/app/.next/server/app/api/auth/login/route.js +1 -1
  51. package/app/.next/server/app/api/auth/me/route.js +1 -1
  52. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  53. package/app/.next/server/app/api/cli-tools/antigravity-mitm/test/route.js +1 -1
  54. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +1 -1
  55. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
  56. package/app/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  57. package/app/.next/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  58. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +1 -1
  59. package/app/.next/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  60. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  61. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  62. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  63. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  64. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  65. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  66. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  67. package/app/.next/server/app/api/combos/route.js +1 -1
  68. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  69. package/app/.next/server/app/api/keys/route.js +1 -1
  70. package/app/.next/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  71. package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  72. package/app/.next/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  73. package/app/.next/server/app/api/models/alias/route.js +1 -1
  74. package/app/.next/server/app/api/models/availability/route.js +1 -1
  75. package/app/.next/server/app/api/models/custom/route.js +1 -1
  76. package/app/.next/server/app/api/models/disabled/route.js +1 -1
  77. package/app/.next/server/app/api/models/route.js +1 -1
  78. package/app/.next/server/app/api/models/test/route.js +1 -1
  79. package/app/.next/server/app/api/models/test/route.js.nft.json +1 -1
  80. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
  81. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  82. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  83. package/app/.next/server/app/api/oauth/gitlab/pat/route.js +1 -1
  84. package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
  85. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  86. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  87. package/app/.next/server/app/api/pricing/route.js +1 -1
  88. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  89. package/app/.next/server/app/api/provider-nodes/route.js +1 -1
  90. package/app/.next/server/app/api/provider-nodes/route.js.nft.json +1 -1
  91. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  92. package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  93. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  94. package/app/.next/server/app/api/providers/[id]/route.js.nft.json +1 -1
  95. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  96. package/app/.next/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  97. package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
  98. package/app/.next/server/app/api/providers/client/route.js +1 -1
  99. package/app/.next/server/app/api/providers/client/route.js.nft.json +1 -1
  100. package/app/.next/server/app/api/providers/route.js +1 -1
  101. package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
  102. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  103. package/app/.next/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  104. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  105. package/app/.next/server/app/api/providers/validate/route.js.nft.json +1 -1
  106. package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
  107. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  108. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  109. package/app/.next/server/app/api/proxy-pools/route.js +1 -1
  110. package/app/.next/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
  111. package/app/.next/server/app/api/settings/database/route.js +1 -1
  112. package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
  113. package/app/.next/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  114. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  115. package/app/.next/server/app/api/settings/route.js +1 -1
  116. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  117. package/app/.next/server/app/api/translator/console-logs/stream/route.js +1 -1
  118. package/app/.next/server/app/api/translator/send/route.js +1 -1
  119. package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
  120. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  121. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  122. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  123. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  124. package/app/.next/server/app/api/usage/api-keys/route.js +1 -1
  125. package/app/.next/server/app/api/usage/chart/route.js +1 -1
  126. package/app/.next/server/app/api/usage/history/route.js +1 -1
  127. package/app/.next/server/app/api/usage/logs/route.js +1 -1
  128. package/app/.next/server/app/api/usage/providers/route.js +1 -1
  129. package/app/.next/server/app/api/usage/request-details/route.js +1 -1
  130. package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
  131. package/app/.next/server/app/api/usage/stats/route.js +1 -1
  132. package/app/.next/server/app/api/usage/stream/route.js +2 -2
  133. package/app/.next/server/app/api/users/[id]/route.js +1 -1
  134. package/app/.next/server/app/api/users/route.js +1 -1
  135. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  136. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  137. package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
  138. package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  139. package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
  140. package/app/.next/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  141. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  142. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  143. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  144. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  145. package/app/.next/server/app/api/v1/images/generations/route.js +2 -2
  146. package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  147. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  148. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  149. package/app/.next/server/app/api/v1/models/[kind]/route.js +1 -1
  150. package/app/.next/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  151. package/app/.next/server/app/api/v1/models/route.js +1 -1
  152. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  153. package/app/.next/server/app/api/v1/responses/compact/route.js +1 -1
  154. package/app/.next/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  155. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  156. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  157. package/app/.next/server/app/api/v1/route.js +1 -1
  158. package/app/.next/server/app/api/v1/route.js.nft.json +1 -1
  159. package/app/.next/server/app/api/v1/search/route.js +1 -1
  160. package/app/.next/server/app/api/v1/search/route.js.nft.json +1 -1
  161. package/app/.next/server/app/api/v1/web/fetch/route.js +1 -1
  162. package/app/.next/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  163. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  164. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  165. package/app/.next/server/app/api/version/route.js +1 -1
  166. package/app/.next/server/app/api/version/update/route.js +1 -1
  167. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  168. package/app/.next/server/app/callback.html +1 -1
  169. package/app/.next/server/app/callback.rsc +4 -4
  170. package/app/.next/server/app/callback.segments/_full.segment.rsc +4 -4
  171. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  172. package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
  173. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  174. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  175. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  176. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  177. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  178. package/app/.next/server/app/dashboard/settings/pricing.rsc +4 -4
  179. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  180. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  181. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  182. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  183. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  184. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  185. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  186. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  187. package/app/.next/server/app/index.html +1 -1
  188. package/app/.next/server/app/index.rsc +4 -4
  189. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  190. package/app/.next/server/app/index.segments/_full.segment.rsc +4 -4
  191. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  192. package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
  193. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  194. package/app/.next/server/app/landing/page.js +1 -1
  195. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  196. package/app/.next/server/app/landing.html +1 -1
  197. package/app/.next/server/app/landing.rsc +5 -5
  198. package/app/.next/server/app/landing.segments/_full.segment.rsc +5 -5
  199. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  200. package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
  201. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  202. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  203. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  204. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  205. package/app/.next/server/app/login.html +1 -1
  206. package/app/.next/server/app/login.rsc +5 -5
  207. package/app/.next/server/app/login.segments/_full.segment.rsc +5 -5
  208. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  209. package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
  210. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  211. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  212. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  213. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  214. package/app/.next/server/app-paths-manifest.json +1 -1
  215. package/app/.next/server/chunks/1679.js +1 -0
  216. package/app/.next/server/chunks/2506.js +2 -2
  217. package/app/.next/server/chunks/2549.js +1 -1
  218. package/app/.next/server/chunks/2574.js +1 -0
  219. package/app/.next/server/chunks/3110.js +14 -0
  220. package/app/.next/server/chunks/3605.js +1 -0
  221. package/app/.next/server/chunks/3855.js +1 -1
  222. package/app/.next/server/chunks/4122.js +1 -1
  223. package/app/.next/server/chunks/4664.js +1 -1
  224. package/app/.next/server/chunks/4989.js +2 -2
  225. package/app/.next/server/chunks/5627.js +2 -2
  226. package/app/.next/server/chunks/5681.js +1 -1
  227. package/app/.next/server/chunks/6108.js +1 -1
  228. package/app/.next/server/chunks/6182.js +4 -3
  229. package/app/.next/server/chunks/6774.js +1 -1
  230. package/app/.next/server/chunks/7341.js +1 -1
  231. package/app/.next/server/chunks/7595.js +1 -1
  232. package/app/.next/server/chunks/7828.js +1 -1
  233. package/app/.next/server/chunks/7937.js +7 -16
  234. package/app/.next/server/chunks/8590.js +1 -1
  235. package/app/.next/server/chunks/8760.js +1 -1
  236. package/app/.next/server/chunks/8895.js +1 -1
  237. package/app/.next/server/chunks/9489.js +1 -1
  238. package/app/.next/server/chunks/9547.js +4 -14
  239. package/app/.next/server/chunks/9609.js +1 -1
  240. package/app/.next/server/chunks/9718.js +1 -1
  241. package/app/.next/server/middleware-build-manifest.js +1 -1
  242. package/app/.next/server/middleware.js +1 -1
  243. package/app/.next/server/pages/404.html +1 -1
  244. package/app/.next/server/pages/500.html +1 -1
  245. package/app/.next/static/chunks/1321-d98e54ebc0972392.js +1 -0
  246. package/app/.next/static/chunks/2336-36a1f30358e691c6.js +28 -0
  247. package/app/.next/static/chunks/app/(dashboard)/dashboard/admin/users/page-adc5d5e8da3a0761.js +1 -0
  248. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-eb5193b550d3e8de.js → page-c77fedcd9ba7bcac.js} +14 -14
  249. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-ceb9bffbc34711bc.js +1 -0
  250. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-39ab11dad9bb6b89.js +1 -0
  251. package/app/.next/static/chunks/app/landing/{page-c7ae6a40e2a2228d.js → page-4644660041715534.js} +1 -1
  252. package/app/.next/static/css/dcb19ed9cc4c0c31.css +1 -0
  253. package/app/package.json +1 -1
  254. package/app/public/providers/commandcode.png +0 -0
  255. package/app/src/mitm/cert/install.js +13 -8
  256. package/app/src/mitm/cert/rootCA.js +20 -5
  257. package/app/src/mitm/config.js +12 -1
  258. package/app/src/mitm/dns/dnsConfig.js +2 -2
  259. package/app/src/mitm/handlers/openrouter.js +82 -3
  260. package/app/src/mitm/manager.js +2 -2
  261. package/package.json +1 -1
  262. package/src/cli/api/client.js +2 -2
  263. package/src/cli/terminalUI.js +2 -2
  264. package/src/cli/tray/autostart.js +25 -24
  265. package/src/cli/tray/tray.js +3 -3
  266. package/app/.next/server/chunks/2343.js +0 -1
  267. package/app/.next/static/chunks/1321-c90a1f54884edb62.js +0 -1
  268. package/app/.next/static/chunks/2336-4ac589bb36571207.js +0 -38
  269. package/app/.next/static/chunks/app/(dashboard)/dashboard/admin/users/page-15091159f6d63fb7.js +0 -1
  270. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-6289612ce5f7c181.js +0 -1
  271. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-0dc79ccb25aab919.js +0 -1
  272. package/app/.next/static/css/81b7abc9204a4458.css +0 -1
  273. /package/app/.next/static/{s_c_Y_7O0OBMovBwrwXBp → 8lL2B4zuUt2JCMuDcfoON}/_buildManifest.js +0 -0
  274. /package/app/.next/static/{s_c_Y_7O0OBMovBwrwXBp → 8lL2B4zuUt2JCMuDcfoON}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{53655:(e,t,s)=>{Promise.resolve().then(s.bind(s,84893))},84893:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>S});var i=s(95155),a=s(12115),r=s(73321),l=s(98500),o=s.n(l),n=s(5772),d=s(35497),c=s(52679),p=s(28777),m=s(11059);let x=new Map;async function u(e){if(!e?.url||!e?.type)return[];let t=x.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let i=(await s.json()).data??[];return x.set(e.url,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}var h=s(14051),f=s.n(h);function y({model:e,fullModel:t,displayModel:s,alias:a,copied:r,onCopy:l,testStatus:o,isCustom:n,isFree:d,onDeleteAlias:c,onTest:p,isTesting:m,onDisable:x}){let u="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,i.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:u?{color:u}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,i.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:s||t}),e.name&&(0,i.jsx)("span",{className:"truncate pl-1 text-[9px] italic text-text-muted/70",children:e.name})]}),p&&(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:p,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:m?"Testing...":"Test"})]}),(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:()=>l(t,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===`model-${e.id}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:r===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,i.jsx)("button",{onClick:c,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):x?(0,i.jsx)("button",{onClick:x,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function g({modelId:e,fullModel:t,copied:s,onCopy:a,onDeleteAlias:r,onTest:l,testStatus:o,isTesting:n}){let d="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,i.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),l&&(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:l,disabled:n,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:n?{animation:"spin 1s linear infinite"}:void 0,children:n?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:n?"Testing...":"Test"})]})]})]}),(0,i.jsx)("button",{onClick:r,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function b({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,copied:r,onCopy:l,onSetAlias:o,onDeleteAlias:n,connections:c,isAnthropic:p}){let[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(!1),[f,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[N,w]=(0,a.useState)({}),k=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),i=await s.json();w(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{w(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=Object.entries(s).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,s])=>({modelId:s.replace(`${e}/`,""),fullModel:s,alias:t})),S=i=>{let a,r=`${e}/${i}`;if(Object.values(s).includes(r))return null;let l=(a=i.split("/"))[a.length-1];if(!s[l])return l;let o=`${t}-${l}`;return s[o]?null:o},$=async()=>{if(!m.trim()||u)return;let t=m.trim(),s=S(t);if(!s)return void alert("All suggested aliases already exist. Please choose a different model or remove conflicting aliases.");h(!0);try{await o(t,s,e),x("")}catch(e){console.log("Error adding model:",e)}finally{h(!1)}},A=async()=>{if(f)return;let t=c.find(e=>!1!==e.isActive);if(t){y(!0);try{let s=await fetch(`/api/providers/${t.id}/models`),i=await s.json();if(!s.ok)return void alert(i.error||"Failed to import models");let a=i.models||[];if(0===a.length)return void alert("No models returned from /models.");let r=0;for(let t of a){let s=t.id||t.name||t.model;if(!s)continue;let i=S(s);i&&(await o(s,i,e),r+=1)}0===r&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{y(!1)}}},T=c.some(e=>!1!==e.isActive);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",p?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,i.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,i.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,i.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,i.jsx)("input",{id:"new-compatible-model-input",type:"text",value:m,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&$(),placeholder:p?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,i.jsx)(d.$n,{size:"sm",icon:"add",onClick:$,disabled:!m.trim()||u,children:u?"Adding...":"Add"}),(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"download",onClick:A,disabled:!T||f,children:f?"Importing...":"Import from /models"})]}),!T&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({modelId:e,fullModel:s,alias:a})=>(0,i.jsx)(g,{modelId:e,fullModel:`${t}/${e}`,copied:r,onCopy:l,onDeleteAlias:()=>n(a),onTest:c.length>0?()=>k(e):void 0,testStatus:N[e],isTesting:v===e},s))})]})}function v({until:e}){let[t,s]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let i=Math.floor(t/1e3);if(i<60)s(`${i}s`);else if(i<3600)s(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);s(`${e}h ${t}m`)}};t();let i=setInterval(t,1e3);return()=>clearInterval(i)},[e]),t)?(0,i.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function j({connection:e,proxyPools:t,isOAuth:s,isFirst:r,isLast:l,onMoveUp:o,onMoveDown:n,onToggleActive:c,onUpdateProxy:p,onEdit:m,onDelete:x}){let[u,h]=(0,a.useState)(!1),[f,y]=(0,a.useState)(!1),g=(0,a.useRef)(null),b=new Map((t||[]).map(e=>[e.id,e])),N=e.providerSpecificData?.proxyPoolId||null,w=N?b.get(N):null,k=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!N||k,S=w?`Pool: ${w.name}`:N?`Pool: ${N} (inactive/missing)`:k?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",$="";if(w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);$=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{$=t}}let A=w?.noProxy||e.providerSpecificData?.connectionNoProxy||"",T="default";w?.isActive===!0?T="success":(N||k)&&(T="error"),(0,a.useEffect)(()=>{if(!u)return;let e=e=>{g.current&&!g.current.contains(e.target)&&h(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[u]);let O=async e=>{y(!0);try{await p("__none__"===e?null:e)}finally{y(!1),h(!1)}},P=e=>"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),I=s?P(e.email)?e.email:P(e.name)?e.name:e.name||e.email||e.displayName||"OAuth Account":e.name,[E,R]=(0,a.useState)(!1),_=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{R(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=_?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[_]);let U="unavailable"!==e.testStatus||E?e.testStatus:"active";return(0,i.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,i.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,i.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,i.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:s?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:I}),(0,i.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,i.jsx)(d.Ex,{variant:!1===e.isActive?"default":"active"===U||"success"===U?"success":"error"===U||"expired"===U||"unavailable"===U?"error":"default",size:"sm",dot:!0,children:!1===e.isActive?"disabled":U||"Unknown"}),C&&(0,i.jsx)(d.Ex,{variant:T,size:"sm",children:"Proxy"}),E&&!1!==e.isActive&&(0,i.jsx)(v,{until:_}),e.lastError&&!1!==e.isActive&&(0,i.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]})]}),C&&(0,i.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,i.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:S,children:S}),$&&(0,i.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:$}),A&&(0,i.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:A,children:["no_proxy: ",A]})]})]})]}),(0,i.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,i.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,i.jsxs)("div",{className:"relative",ref:g,children:[(0,i.jsxs)("button",{onClick:()=>h(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:f,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:f?"progress_activity":"lan"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),u&&(0,i.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,i.jsx)("button",{onClick:()=>O("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!N?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,i.jsx)("button",{onClick:()=>O(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${N===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,i.jsxs)("button",{onClick:m,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,i.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,i.jsx)(d.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}function N({isOpen:e,provider:t,providerName:s,isCompatible:r,isAnthropic:l,authType:o,authHint:n,website:c,proxyPools:p,onSave:m,onClose:x}){let u="__none__",h="ollama-local"===t,f="cookie"===o,y=f?"Cookie Value":"API Key",g=f?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":"",b="azure"===t,v="cloudflare-ai"===t,[j,w]=(0,a.useState)({name:"",apiKey:"",priority:1,proxyPoolId:u,ollamaHostUrl:""}),[k,C]=(0,a.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[S,$]=(0,a.useState)({accountId:""}),[A,T]=(0,a.useState)(!1),[O,P]=(0,a.useState)(null),[I,E]=(0,a.useState)(!1),R=h?"Ollama Local":f?`${s||t} Cookie`:"Production Key";(0,a.useEffect)(()=>{e&&(w({name:r?R:"",apiKey:"",priority:1,proxyPoolId:u,ollamaHostUrl:""}),C({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),$({accountId:""}),T(!1),P(null),E(!1))},[R,r,e]);let _=()=>h&&j.ollamaHostUrl.trim()?{baseUrl:j.ollamaHostUrl.trim()}:b?{azureEndpoint:k.azureEndpoint,apiVersion:k.apiVersion,deployment:k.deployment,organization:k.organization}:v?{accountId:S.accountId}:void 0,U=async()=>{T(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:j.apiKey,providerSpecificData:_()})}),s=await e.json();P(s.valid?"success":"failed")}catch{P("failed")}finally{T(!1)}},D=async()=>{if(!t||!h&&!j.apiKey)return;let e=j.name.trim()||R;E(!0);try{let s=!1;try{T(!0),P(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:j.apiKey,providerSpecificData:_()})});s=!!(await e.json()).valid,P(s?"success":"failed")}catch{P("failed")}finally{T(!1)}await m({name:e,apiKey:j.apiKey,priority:j.priority,proxyPoolId:j.proxyPoolId===u?null:j.proxyPoolId,testStatus:s?"active":"unknown",providerSpecificData:_()})}finally{E(!1)}};return t?(0,i.jsx)(d.aF,{isOpen:e,title:`Add ${s||t} ${y}`,onClose:x,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(d.pd,{label:"Name",value:j.name,onChange:e=>w({...j,name:e.target.value}),placeholder:R}),h&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.pd,{label:"Ollama Host URL",value:j.ollamaHostUrl,onChange:e=>w({...j,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(d.$n,{onClick:U,disabled:A||I,variant:"secondary",children:A?"Checking...":"Check"})})]}),!h&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.pd,{label:y,type:f?"text":"password",value:j.apiKey,onChange:e=>w({...j,apiKey:e.target.value}),placeholder:g,className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(d.$n,{onClick:U,disabled:!j.apiKey||A||I,variant:"secondary",children:A?"Checking...":"Check"})})]}),f&&n&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:[n,c&&(0,i.jsxs)(i.Fragment,{children:[" ",(0,i.jsxs)("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",c.replace(/^https?:\/\//,"")]})]})]}),h&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,i.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,i.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),O&&(0,i.jsx)(d.Ex,{variant:"success"===O?"success":"error",children:"success"===O?"Valid":"Invalid"}),r&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:l?`Validation checks ${s||"Anthropic Compatible"} by verifying the API key.`:`Validation checks ${s||"OpenAI Compatible"} via /models on your base URL.`}),v&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,i.jsx)(d.pd,{label:"Account ID",value:S.accountId,onChange:e=>$({...S,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,i.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),b&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(d.pd,{label:"Azure Endpoint",value:k.azureEndpoint,onChange:e=>C({...k,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,i.jsx)(d.pd,{label:"Deployment Name",value:k.deployment,onChange:e=>C({...k,deployment:e.target.value}),placeholder:"gpt-4"}),(0,i.jsx)(d.pd,{label:"API Version",value:k.apiVersion,onChange:e=>C({...k,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,i.jsx)(d.pd,{label:"Organization",value:k.organization,onChange:e=>C({...k,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,i.jsx)(d.pd,{label:"Priority",type:"number",value:j.priority,onChange:e=>w({...j,priority:Number.parseInt(e.target.value)||1})}),(0,i.jsx)(d.l6,{label:"Proxy Pool",value:j.proxyPoolId,onChange:e=>w({...j,proxyPoolId:e.target.value}),options:[{value:u,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.$n,{onClick:D,fullWidth:!0,disabled:I||!h&&!j.apiKey||b&&(!k.azureEndpoint||!k.deployment||!k.organization)||v&&!S.accountId,children:I?"Saving...":"Save"}),(0,i.jsx)(d.$n,{onClick:x,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function w({isOpen:e,node:t,onSave:s,onClose:r,isAnthropic:l}){let[o,n]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,p]=(0,a.useState)(!1),[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(""),[f,y]=(0,a.useState)(!1),[g,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&n({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(l?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,l]);let v=async()=>{if(o.name.trim()&&o.prefix.trim()&&o.baseUrl.trim()){p(!0);try{let e={name:o.name,prefix:o.prefix,baseUrl:o.baseUrl};l||(e.apiType=o.apiType),await s(e)}finally{p(!1)}}},j=async()=>{y(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:o.baseUrl,apiKey:m,type:l?"anthropic-compatible":"openai-compatible",modelId:u.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{y(!1)}};return t?(0,i.jsx)(d.aF,{isOpen:e,title:`Edit ${l?"Anthropic":"OpenAI"} Compatible`,onClose:r,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(d.pd,{label:"Name",value:o.name,onChange:e=>n({...o,name:e.target.value}),placeholder:`${l?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,i.jsx)(d.pd,{label:"Prefix",value:o.prefix,onChange:e=>n({...o,prefix:e.target.value}),placeholder:l?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!l&&(0,i.jsx)(d.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:o.apiType,onChange:e=>n({...o,apiType:e.target.value})}),(0,i.jsx)(d.pd,{label:"Base URL",value:o.baseUrl,onChange:e=>n({...o,baseUrl:e.target.value}),placeholder:l?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${l?"Anthropic":"OpenAI"}-compatible API.`}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:e=>x(e.target.value),className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(d.$n,{onClick:j,disabled:!m||f||!o.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,i.jsx)(d.pd,{label:"Model ID (optional)",value:u,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),g&&(0,i.jsx)(d.Ex,{variant:"success"===g?"success":"error",children:"success"===g?"Valid":"Invalid"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.$n,{onClick:v,fullWidth:!0,disabled:!o.name.trim()||!o.prefix.trim()||!o.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,i.jsx)(d.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function k({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:r,onClose:l}){var o;let n,[c,p]=(0,a.useState)(""),[m,x]=(0,a.useState)(null),[u,h]=(0,a.useState)(""),[f,y]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&(p(""),x(null),h(""),y(!1))},[e]);let g=(o=c.trim(),n=`${t}/`,o.startsWith(n)?o.slice(n.length):o),b=async()=>{if(g){x("testing"),h("");try{let e=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${g}`})}),s=await e.json();x(s.ok?"ok":"error"),h(s.error||"")}catch(e){x("error"),h(e.message)}}},v=async()=>{if(g&&!f){y(!0);try{await r(g)}finally{y(!1)}}};return(0,i.jsx)(d.aF,{isOpen:e,onClose:l,title:"Add Custom Model",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("input",{type:"text",value:c,onChange:e=>{p(e.target.value),x(null),h("")},onKeyDown:e=>{"Enter"===e.key&&b()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,i.jsx)(d.$n,{type:"button",variant:"secondary",icon:"science",loading:"testing"===m,onClick:b,disabled:!g||"testing"===m,children:"testing"===m?"Testing...":"Test"})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,i.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:g||"model-id"})]})]}),"ok"===m&&(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===m&&(0,i.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,i.jsx)("span",{children:u||"Model not reachable"})]}),(0,i.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,i.jsx)(d.$n,{type:"button",onClick:l,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,i.jsx)(d.$n,{type:"button",onClick:v,fullWidth:!0,size:"sm",disabled:!g||f,children:f?"Adding...":"Add Model"})]})]})})}function C({isOpen:e,onClose:t,onSuccess:s}){let[r,l]=(0,a.useState)([]),[o,n]=(0,a.useState)(""),[c,p]=(0,a.useState)(!1),[m,x]=(0,a.useState)(null),[u,h]=(0,a.useState)(null),f=()=>{l([]),n(""),x(null),h(null),t()},y=async()=>{p(!0),x(null),h(null);try{let e=await Promise.all(r.map(async e=>({filename:e.name,jsonText:await e.text()}))),t=o.trim()?[{filename:"pasted JSON",jsonText:o.trim()}]:[],i=[...e,...t];if(0===i.length)throw Error("Select JSON files or paste JSON first");let a=await fetch("/api/oauth/codex/import-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:i})}),l=await a.json();if(!a.ok)throw Error(l.error||"Failed to import accounts");x(l),l.imported?.length>0&&s?.()}catch(e){h(e.message||"Failed to import accounts")}finally{p(!1)}},g=m?.imported?.length||0,b=m?.skipped?.length||0;return(0,i.jsx)(d.aF,{isOpen:e,title:"Import Codex Accounts",onClose:f,size:"lg",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"rounded-lg border border-border bg-surface/50 p-3",children:[(0,i.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"JSON files"}),(0,i.jsx)("input",{type:"file",accept:".json,application/json",multiple:!0,onChange:e=>l(Array.from(e.target.files||[])),className:"block w-full text-sm text-text-muted file:mr-3 file:rounded-md file:border-0 file:bg-primary file:px-3 file:py-1.5 file:text-sm file:font-medium file:text-white hover:file:bg-primary/90"}),r.length>0&&(0,i.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:r.map(e=>(0,i.jsx)("span",{className:"rounded bg-primary/10 px-2 py-0.5 text-xs text-primary",children:e.name},`${e.name}-${e.size}`))})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"Paste JSON"}),(0,i.jsx)("textarea",{value:o,onChange:e=>n(e.target.value),placeholder:'[{ "type": "codex", "access_token": "...", "refresh_token": "..." }]',className:"h-36 w-full resize-none rounded-md border border-black/10 bg-white px-3 py-2 font-mono text-xs text-text-main shadow-inner transition-all placeholder-text-muted/60 focus:border-primary/50 focus:outline-none focus:ring-1 focus:ring-primary/30 dark:border-white/10 dark:bg-white/5"})]}),(0,i.jsx)("div",{className:"rounded-lg border border-border bg-background/60 px-3 py-2 text-xs text-text-muted",children:"Auto-detects Codex Session JSON, CLI Proxy API Auth JSON, and Sub2API JSON."}),u&&(0,i.jsx)("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-600",children:u}),m&&(0,i.jsxs)("div",{className:"rounded-lg border border-border bg-surface/40 p-3",children:[(0,i.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2 text-sm",children:[(0,i.jsxs)("span",{className:"font-medium text-green-600",children:[g," imported"]}),b>0&&(0,i.jsxs)("span",{className:"text-text-muted",children:[b," skipped"]})]}),m.imported?.length>0&&(0,i.jsx)("div",{className:"max-h-32 overflow-auto rounded border border-border/70",children:m.imported.map(e=>(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border/70 px-2 py-1.5 last:border-b-0",children:[(0,i.jsx)("span",{className:"min-w-0 truncate text-xs",children:e.email||e.displayName||e.name||e.id}),(0,i.jsx)("span",{className:"shrink-0 text-xs text-text-muted",children:e.sourceFormat})]},e.id))}),m.skipped?.length>0&&(0,i.jsx)("div",{className:"mt-2 max-h-28 overflow-auto rounded border border-border/70",children:m.skipped.map((e,t)=>(0,i.jsxs)("div",{className:"border-b border-border/70 px-2 py-1.5 text-xs last:border-b-0",children:[(0,i.jsx)("span",{className:"font-medium",children:e.filename}),(0,i.jsxs)("span",{className:"text-text-muted",children:[" \xb7 ",e.reason]})]},`${e.filename}-${t}`))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.$n,{onClick:y,loading:c,disabled:c||!r.length&&!o.trim(),fullWidth:!0,children:"Import"}),(0,i.jsx)(d.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Close"})]})]})})}function S(){let e,t=(0,r.useParams)(),s=(0,r.useRouter)(),l=t.id,[x,h]=(0,a.useState)([]),[f,g]=(0,a.useState)(!0),[v,S]=(0,a.useState)(null),[$,A]=(0,a.useState)([]),[T,O]=(0,a.useState)(!1),[P,I]=(0,a.useState)(!1),[E,R]=(0,a.useState)(!1),[_,U]=(0,a.useState)(!1),[D,z]=(0,a.useState)(null),[q,M]=(0,a.useState)(!1),[J,L]=(0,a.useState)(!1),[F,K]=(0,a.useState)(!1),[W,V]=(0,a.useState)(!1),[H,B]=(0,a.useState)(null),[G,Q]=(0,a.useState)({}),[Z,X]=(0,a.useState)(!1),[Y,ee]=(0,a.useState)({}),[et,es]=(0,a.useState)(""),[ei,ea]=(0,a.useState)(null),[er,el]=(0,a.useState)(!1),[eo,en]=(0,a.useState)([]),[ed,ec]=(0,a.useState)("__none__"),[ep,em]=(0,a.useState)(!1),[ex,eu]=(0,a.useState)(null),[eh,ef]=(0,a.useState)(""),[ey,eg]=(0,a.useState)("auto"),[eb,ev]=(0,a.useState)([]),[ej,eN]=(0,a.useState)([]),[ew,ek]=(0,a.useState)([]),{copied:eC,copy:eS}=(0,m.C)(),e$=v?{id:v.id,name:v.name||("anthropic-compatible"===v.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===v.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===v.type?"AC":"OC",apiType:v.apiType,baseUrl:v.baseUrl,type:v.type}:c.zN[l]||c.fg[l]||c.IS[l]||c.nJ[l]||c.br[l],eA=!!c.zN[l]||!!c.IS[l],eT=!!c.IS[l]?.noAuth,eO=(0,p.KC)(l),eP=(0,c.wG)(l),eI=(0,c.mq)(l),eE=(0,c.gb)(l),eR=eI||eE;c.Q2[l]?.thinkingConfig||c.s9.extended;let e_=eR?l:eP,eU=eR?v?.prefix||l:eP,eD="codex"===l,ez=(0,a.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(e_)}`,{cache:"no-store"}),t=await e.json();e.ok&&ek(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[e_]),eq=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:e_,ids:[e]})})).ok&&await ez()}catch(e){console.log("Error disabling model:",e)}},eM=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(e_)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await ez()}catch(e){console.log("Error enabling model:",e)}},eJ=async e=>{if(e.length&&confirm(`Disable all ${e.length} model(s)?`))try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:e_,ids:e})})).ok&&await ez()}catch(e){console.log("Error disabling all models:",e)}},eL=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(e_)}`,{method:"DELETE"})).ok&&await ez()}catch(e){console.log("Error enabling all models:",e)}},eF=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&Q(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]);(0,a.useEffect)(()=>{"kilocode"===l&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eN(e.models)}).catch(()=>{})},[l]);let eK=(0,a.useCallback)(async()=>{try{let[e,t,s,i]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),a=await e.json(),r=await t.json(),o=await s.json(),n=i.ok?await i.json():{};if(e.ok){let e=(a.connections||[]).filter(e=>e.provider===l);h(e)}s.ok&&A(o.proxyPools||[]);let d=(n.providerStrategies||{})[l]||{};eu(d.fallbackStrategy||null),ef(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(n.providerThinking||{})[l]||{};if(eg(c.mode||"auto"),t.ok){let e=(r.nodes||[]).find(e=>e.id===l)||null;if(!e&&eR)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===l)||null))break}S(e)}}catch(e){console.log("Error fetching connections:",e)}finally{g(!1)}},[l,eR]),eW=async e=>{try{let t=await fetch(`/api/provider-nodes/${l}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(S(s.node),await eK(),K(!1))}catch(e){console.log("Error updating provider node:",e)}},eV=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),i=(s.ok?await s.json():{}).providerStrategies||{},a={};e&&(a.fallbackStrategy=e),"round-robin"===e&&""!==t&&(a.stickyRoundRobinLimit=Number(t)||3);let r={...i};0===Object.keys(a).length?delete r[l]:r[l]=a,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:r})})}catch(e){console.log("Error saving provider strategy:",e)}};(0,a.useEffect)(()=>{(async()=>{await Promise.all([eK(),eF(),ez()])})()},[eK,eF,ez]),(0,a.useEffect)(()=>{let e=(c.zN[l]||c.fg[l]||c.IS[l]||c.nJ[l])?.modelsFetcher;e&&u(e).then(ev)},[l]);let eH=async(e,t,s=eP)=>{let i=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:i,alias:t})});if(e.ok)await eF();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},eB=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await eF()}catch(e){console.log("Error deleting alias:",e)}},eG=async e=>{if(confirm("Delete this connection?"))try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&h(x.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}},eQ=()=>{eK(),O(!1)},eZ=async()=>{if(!_){U(!0),z(null);try{let e=await fetch("/api/oauth/codex/refresh-all",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),t=await e.json();if(!e.ok&&!t?.refreshed?.length)throw Error(t.error||"Failed to refresh Codex tokens");z(t),await eK()}catch(e){z({error:e.message,refreshed:[],failed:[],skipped:[]})}finally{U(!1)}}},eX=async e=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:l,...e})})).ok&&(await eK(),M(!1))}catch(e){console.log("Error saving connection:",e)}},eY=async e=>{try{(await fetch(`/api/providers/${H.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eK(),L(!1))}catch(e){console.log("Error updating connection:",e)}},e0=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&h(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},e1=async(e,t)=>{let s=[...x];[s[e],s[t]]=[s[t],s[e]],h(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await eK()}},e2=(0,a.useMemo)(()=>new Set(x.map(e=>e.id)),[x]),e5=(0,a.useMemo)(()=>eo.filter(e=>e2.has(e)),[eo,e2]),e3=x.filter(e=>e5.includes(e.id));x.length>0&&(e5.length,x.length);let e4=(()=>{if(0===e3.length)return"";let e=new Set(e3.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return"All selected currently unbound";let s=$.find(e=>e.id===t);return`All selected currently bound to ${s?.name||t}`}return"Selected connections have mixed proxy bindings"})(),e6=()=>{ep||V(!1)},e7=async()=>{if(0===e5.length)return;let e="__none__"===ed?null:ed;em(!0);try{let t=[];for(let s of e5)try{let i=await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:e})});t.push(i.ok)}catch(e){console.log("Error applying bulk proxy pool for",s,e),t.push(!1)}let s=t.filter(e=>!e).length;s>0&&alert(`Updated with ${s} failed request(s).`),await eK(),en([]),ec("__none__"),V(!1)}catch(e){console.log("Error applying bulk proxy pool:",e)}finally{em(!1)}},e8=(0,i.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/3 dark:divide-white/3",children:x.map((e,t)=>(0,i.jsx)("div",{className:"flex min-w-0 items-stretch",children:(0,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(j,{connection:e,proxyPools:$,isOAuth:eA,isFirst:0===t,isLast:t===x.length-1,onMoveUp:()=>e1(t,t-1),onMoveDown:()=>e1(t,t+1),onToggleActive:t=>e0(e.id,t),onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&h(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{B(e),L(!0)},onDelete:()=>eG(e.id)})})},e.id))}),e9=[{value:"__none__",label:"None"},...$.map(e=>({value:e.id,label:e.name}))],te=0===e5.length?"Select one or more connections, then click Proxy Action.":e4,tt=e5.length>0&&!ep,ts=(0,i.jsx)(d.aF,{isOpen:W,onClose:e6,title:`Proxy Action (${e5.length} selected)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(d.l6,{label:"Proxy Pool",value:ed,onChange:e=>ec(e.target.value),options:e9,placeholder:"None"}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:te}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Selecting None will unbind selected connections from proxy pool."}),(0,i.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,i.jsx)(d.$n,{onClick:e7,fullWidth:!0,disabled:!tt,children:ep?"Applying...":"Apply"}),(0,i.jsx)(d.$n,{onClick:e6,variant:"ghost",fullWidth:!0,disabled:ep,children:"Cancel"})]})]})}),ti=async e=>{if(!ei){ea(e);try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e_}/${e}`})}),s=await t.json();ee(t=>({...t,[e]:s.ok?"ok":"error"})),es(s.ok?"":s.error||"Model not reachable")}catch{ee(t=>({...t,[e]:"error"})),es("Network error")}finally{ea(null)}}};return f?(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(d.Qv,{}),(0,i.jsx)(d.Qv,{})]}):e$?(0,i.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)(o(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,i.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e$.color}15`},children:Z?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:e$.color},children:e$.textIcon||e$.id.slice(0,2).toUpperCase()}):(0,i.jsx)(n.default,{src:eI&&e$.apiType?"responses"===e$.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":eE?"/providers/anthropic-m.png":`/providers/${e$.id}.png`,alt:e$.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>X(!0)})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,i.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e$.name}),(e$.notice?.apiKeyUrl||e$.notice?.signupUrl||e$.website)&&(0,i.jsxs)("a",{href:e$.notice?.apiKeyUrl||e$.notice?.signupUrl||e$.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e$.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[x.length," connection",1===x.length?"":"s"]})]})]})]}),e$.deprecated&&(0,i.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,i.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e$.deprecationNotice})]}),e$.notice?.text&&!e$.deprecated&&(0,i.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:e$.notice.text}),e$.notice.apiKeyUrl&&(0,i.jsx)("a",{href:e$.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),eR&&v&&(0,i.jsxs)(d.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:eE?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[eE?"Messages API":"responses"===v.apiType?"Responses API":"Chat Completions"," \xb7 ",(v.baseUrl||"").replace(/\/$/,""),"/",eE?"messages":"responses"===v.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>M(!0),disabled:x.length>0,className:"w-full sm:w-auto",children:"Add"}),(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>K(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{if(confirm(`Delete this ${eE?"Anthropic":"OpenAI"} Compatible node?`))try{(await fetch(`/api/provider-nodes/${l}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}},className:"w-full sm:w-auto",children:"Delete"})]})]}),x.length>0&&(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"Only one connection is allowed per compatible node. Add another node if you need more connections."})]}),eT?(0,i.jsx)(d.gw,{providerId:l}):(0,i.jsxs)(d.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,i.jsx)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,i.jsx)(d.lM,{checked:"round-robin"===ex,onChange:e=>{let t=e?"round-robin":null,s=e?eh||"1":eh;e&&!eh&&ef("1"),eu(t),eV(t,s)}}),"round-robin"===ex&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,i.jsx)("input",{type:"number",min:1,value:eh,onChange:e=>{var t;ef(t=e.target.value),eV("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})})]}),0===x.length?(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:eA?"lock":"key"})}),(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"})]}),!eR&&(0,i.jsxs)("div",{className:"flex gap-2",children:["iflow"===l&&(0,i.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),children:"Cookie"}),(0,i.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>eA?O(!0):M(!0),children:"iflow"===l?"OAuth":"Add Connection"}),"codex"===l&&(0,i.jsx)(d.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>R(!0),children:"Batch Import"}),"codex"===l&&(0,i.jsx)(d.$n,{size:"sm",icon:"sync",variant:"secondary",onClick:eZ,loading:_,children:"Refresh Tokens"})]})]}):(0,i.jsxs)(i.Fragment,{children:[e8,!eR&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===l&&(0,i.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),(0,i.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>eA?O(!0):M(!0),className:"w-full sm:w-auto",children:"Add"}),"codex"===l&&(0,i.jsx)(d.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>R(!0),className:"w-full sm:w-auto",children:"Batch Import"}),"codex"===l&&(0,i.jsx)(d.$n,{size:"sm",icon:"sync",variant:"secondary",onClick:eZ,loading:_,className:"w-full sm:w-auto",children:"Refresh Tokens"})]})]}),"codex"===l&&D&&(0,i.jsx)("div",{className:`mt-4 rounded-lg border px-3 py-2 text-sm ${D.error?"border-red-500/30 bg-red-500/10 text-red-600":"border-green-500/30 bg-green-500/10 text-green-700 dark:text-green-300"}`,children:D.error?D.error:`Token refresh complete: ${D.refreshed?.length||0} refreshed, ${D.failed?.length||0} failed, ${D.skipped?.length||0} skipped.`})]}),(0,i.jsxs)(d.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!eR&&(e=[...eO,...ej.filter(e=>!eO.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type).map(e=>e.id).filter(e=>!ew.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[ew.length>0&&(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:eL,children:"Active All"}),e.length>0&&(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>eJ(e),children:"Disable All"})]}))]}),!!et&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 wrap-break-word",children:et}),(()=>{let e,t,s;if(eR)return(0,i.jsx)(b,{providerStorageAlias:e_,providerDisplayAlias:eU,modelAliases:G,copied:eC,onCopy:eS,onSetAlias:eH,onDeleteAlias:eB,connections:x,isAnthropic:eE});let a=[...eO,...ej.filter(e=>!eO.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type),r=new Set(ew),o=a.filter(e=>!r.has(e.id)),n=a.filter(e=>r.has(e.id)),d=Object.entries(G).filter(([e,t])=>{let s=`${e_}/`;if(!t.startsWith(s))return!1;let i=t.slice(s.length);return e$.passthroughModels?!eO.some(e=>e.id===i):!eO.some(e=>e.id===i)&&e===i}).map(([e,t])=>({id:t.slice(`${e_}/`.length),alias:e,fullModel:t}));return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,i.jsx)(y,{model:{id:e.id},fullModel:`${eU}/${e.id}`,displayModel:eD?e.id:`${eU}/${e.id}`,alias:e.alias,copied:eC,onCopy:eS,onSetAlias:()=>{},onDeleteAlias:()=>eB(e.alias),testStatus:Y[e.id],onTest:x.length>0||eT?()=>ti(e.id):void 0,isTesting:ei===e.id,isCustom:!0,isFree:!1},e.id)),o.map(e=>{let t=`${e_}/${e.id}`,s=`${l}/${e.id}`,a=Object.entries(G).find(([,e])=>e===t||e===s)?.[0];return(0,i.jsx)(y,{model:e,fullModel:`${eU}/${e.id}`,displayModel:eD?e.id:`${eU}/${e.id}`,alias:a,copied:eC,onCopy:eS,onSetAlias:t=>eH(e.id,t,e_),onDeleteAlias:()=>eB(a),testStatus:Y[e.id],onTest:x.length>0||eT?()=>ti(e.id):void 0,isTesting:ei===e.id,isFree:e.isFree,onDisable:()=>eq(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>el(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),eb.length>0&&(e=new Set(Object.values(G)),t=new Set(eO.map(e=>e.id)),0===(s=eb.filter(s=>!e.has(`${e_}/${s.id}`)&&!t.has(s.id))).length?null:(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,i.jsxs)("button",{onClick:async()=>{let t=e.id.split("/").pop();await eH(e.id,t,e_)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,i.jsxs)("button",{onClick:()=>eM(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),ts,"kiro"===l?(0,i.jsx)(d.Mh,{isOpen:T,providerInfo:e$,onSuccess:eQ,onClose:()=>O(!1)}):"cursor"===l?(0,i.jsx)(d.G9,{isOpen:T,onSuccess:eQ,onClose:()=>O(!1)}):"gitlab"===l?(0,i.jsx)(d.vj,{isOpen:T,providerInfo:e$,onSuccess:eQ,onClose:()=>O(!1)}):(0,i.jsx)(d.LF,{isOpen:T,provider:l,providerInfo:e$,onSuccess:eQ,onClose:()=>O(!1)}),"iflow"===l&&(0,i.jsx)(d.vE,{isOpen:P,onSuccess:()=>{eK(),I(!1)},onClose:()=>I(!1)}),"codex"===l&&(0,i.jsx)(C,{isOpen:E,onSuccess:eK,onClose:()=>R(!1)}),(0,i.jsx)(N,{isOpen:q,provider:l,providerName:e$.name,isCompatible:eR,isAnthropic:eE,authType:e$?.authType,authHint:e$?.authHint,website:e$?.website,proxyPools:$,onSave:eX,onClose:()=>M(!1)}),(0,i.jsx)(d.wI,{isOpen:J,connection:H,proxyPools:$,onSave:eY,onClose:()=>L(!1)}),eR&&(0,i.jsx)(w,{isOpen:F,node:v,onSave:eW,onClose:()=>K(!1),isAnthropic:eE}),!eR&&(0,i.jsx)(k,{isOpen:er,providerAlias:e_,providerDisplayAlias:eU,onSave:async e=>{let t=e$?.passthroughModels?e.split("/").pop():e;await eH(e,t,e_),el(!1)},onClose:()=>el(!1)})]}):(0,i.jsxs)("div",{className:"text-center py-20",children:[(0,i.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,i.jsx)(o(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}y.propTypes={model:f().shape({id:f().string.isRequired}).isRequired,fullModel:f().string.isRequired,displayModel:f().string,alias:f().string,copied:f().string,onCopy:f().func.isRequired,testStatus:f().oneOf(["ok","error"]),isCustom:f().bool,isFree:f().bool,onDeleteAlias:f().func,onTest:f().func,isTesting:f().bool,onDisable:f().func},f().string.isRequired,f().string.isRequired,f().string,f().func.isRequired,f().func.isRequired,f().func,f().oneOf(["ok","error"]),f().bool,f().string.isRequired,f().object.isRequired,f().string,f().func.isRequired,f().func.isRequired,f().func.isRequired,b.propTypes={providerStorageAlias:f().string.isRequired,providerDisplayAlias:f().string.isRequired,modelAliases:f().object.isRequired,copied:f().string,onCopy:f().func.isRequired,onSetAlias:f().func.isRequired,onDeleteAlias:f().func.isRequired,connections:f().arrayOf(f().shape({id:f().string,isActive:f().bool})).isRequired,isAnthropic:f().bool},v.propTypes={until:f().string.isRequired},j.propTypes={connection:f().shape({id:f().string,name:f().string,email:f().string,displayName:f().string,modelLockUntil:f().string,testStatus:f().string,isActive:f().bool,lastError:f().string,priority:f().number,globalPriority:f().number}).isRequired,proxyPools:f().arrayOf(f().shape({id:f().string,name:f().string,proxyUrl:f().string,noProxy:f().string,isActive:f().bool})),isOAuth:f().bool.isRequired,isFirst:f().bool.isRequired,isLast:f().bool.isRequired,onMoveUp:f().func.isRequired,onMoveDown:f().func.isRequired,onToggleActive:f().func.isRequired,onUpdateProxy:f().func,onEdit:f().func.isRequired,onDelete:f().func.isRequired},N.propTypes={isOpen:f().bool.isRequired,provider:f().string,providerName:f().string,isCompatible:f().bool,isAnthropic:f().bool,authType:f().string,authHint:f().string,website:f().string,proxyPools:f().arrayOf(f().shape({id:f().string,name:f().string})),onSave:f().func.isRequired,onClose:f().func.isRequired},w.propTypes={isOpen:f().bool.isRequired,node:f().shape({id:f().string,name:f().string,prefix:f().string,apiType:f().string,baseUrl:f().string}),onSave:f().func.isRequired,onClose:f().func.isRequired,isAnthropic:f().bool},k.propTypes={isOpen:f().bool.isRequired,providerAlias:f().string.isRequired,providerDisplayAlias:f().string.isRequired,onSave:f().func.isRequired,onClose:f().func.isRequired},C.propTypes={isOpen:f().bool.isRequired,onClose:f().func.isRequired,onSuccess:f().func}}},e=>{e.O(0,[2574,3862,1051,5772,1321,5497,8441,3794,7358],()=>e(e.s=53655)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7018],{11059:(e,t,s)=>{"use strict";s.d(t,{C:()=>a});var r=s(12115);function a(e=2e3){let[t,s]=(0,r.useState)(null),l=(0,r.useRef)(null);return{copied:t,copy:(0,r.useCallback)((t,r="default")=>{(async()=>{if(navigator?.clipboard?.writeText)await navigator.clipboard.writeText(t);else{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}})(),s(r),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s(null)},e)},[e])}}},39993:(e,t,s)=>{Promise.resolve().then(s.bind(s,85941))},57250:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var r=s(95155),a=s(12115),l=s(14051),o=s.n(l);function n({src:e,alt:t,size:s=32,className:l="",fallbackText:o="?",fallbackColor:i}){let[d,c]=(0,a.useState)(!1);return!e||d?(0,r.jsx)("span",{className:`inline-flex items-center justify-center font-bold rounded-lg ${l}`.trim(),style:{width:s,height:s,color:i,fontSize:Math.max(10,Math.floor(.38*s))},children:o}):(0,r.jsx)("img",{src:e,alt:t,width:s,height:s,className:l,onError:()=>c(!0)})}n.propTypes={src:o().string,alt:o().string,size:o().number,className:o().string,fallbackText:o().string,fallbackColor:o().string}},85941:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>v});var r=s(95155),a=s(39092),l=s.n(a),o=s(73321),n=s(12115);function i(){let[e,t]=(0,n.useState)(!1),s=(0,o.useRouter)();return(0,r.jsxs)("nav",{className:"fixed top-0 z-50 w-full bg-[#181411]/80 backdrop-blur-md border-b border-[#3a2f27]",children:[(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[(0,r.jsxs)("button",{type:"button",className:"flex items-center gap-3 cursor-pointer bg-transparent border-none p-0",onClick:()=>s.push("/"),"aria-label":"Navigate to home",children:[(0,r.jsx)("div",{className:"size-8 rounded bg-linear-to-br from-[#f97815] to-orange-700 flex items-center justify-center text-white",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"hub"})}),(0,r.jsx)("h2",{className:"text-white text-xl font-bold tracking-tight",children:"9Router"})]}),(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-8",children:[(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",children:"Features"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",children:"How it Works"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/decolua/9router#readme",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,r.jsxs)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors flex items-center gap-1",href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",children:["GitHub ",(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"open_in_new"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("button",{onClick:()=>s.push("/dashboard"),className:"hidden sm:flex h-9 items-center justify-center rounded-lg px-4 bg-[#f97815] hover:bg-[#e0650a] transition-all text-[#181411] text-sm font-bold shadow-[0_0_15px_rgba(249,120,21,0.4)] hover:shadow-[0_0_20px_rgba(249,120,21,0.6)]",children:"Get Started"}),(0,r.jsx)("button",{className:"md:hidden text-white",onClick:()=>t(!e),children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:e?"close":"menu"})})]})]}),e&&(0,r.jsx)("div",{className:"md:hidden border-t border-[#3a2f27] bg-[#181411]/95 backdrop-blur-md",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4 p-6",children:[(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",onClick:()=>t(!1),children:"Features"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",onClick:()=>t(!1),children:"How it Works"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/decolua/9router#readme",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("button",{onClick:()=>s.push("/dashboard"),className:"h-9 rounded-lg bg-[#f97815] hover:bg-[#e0650a] text-[#181411] text-sm font-bold",children:"Get Started"})]})})]})}function d(){return(0,r.jsxs)("section",{className:"relative pt-32 pb-20 px-6 min-h-[90vh] flex flex-col items-center justify-center overflow-hidden",children:[(0,r.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[1000px] h-[500px] bg-[#f97815]/10 rounded-full blur-[120px] pointer-events-none"}),(0,r.jsxs)("div",{className:"relative z-10 max-w-4xl w-full text-center flex flex-col items-center gap-8",children:[(0,r.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-[#3a2f27] bg-[#23180f]/50 px-3 py-1 text-xs font-medium text-[#f97815]",children:[(0,r.jsx)("span",{className:"flex h-2 w-2 rounded-full bg-[#f97815] animate-pulse"}),"v1.0 is now live"]}),(0,r.jsxs)("h1",{className:"text-5xl md:text-7xl font-black leading-[1.1] tracking-tight",children:["One Endpoint for ",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#f97815]",children:"All AI Providers"})]}),(0,r.jsx)("p",{className:"text-lg md:text-xl text-gray-400 max-w-2xl mx-auto font-light",children:"AI endpoint proxy with web dashboard - A JavaScript port of CLIProxyAPI. Works seamlessly with Claude Code, OpenAI Codex, Cline, RooCode, and other CLI tools."}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-4 w-full",children:[(0,r.jsxs)("button",{className:"h-12 px-8 rounded-lg bg-[#f97815] hover:bg-[#e0650a] text-[#181411] text-base font-bold transition-all shadow-[0_0_15px_rgba(249,120,21,0.4)] flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined",children:"rocket_launch"}),"Get Started"]}),(0,r.jsxs)("a",{href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",className:"h-12 px-8 rounded-lg border border-[#3a2f27] bg-[#23180f] hover:bg-[#3a2f27] text-white text-base font-bold transition-all flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined",children:"code"}),"View on GitHub"]})]})]})]})}var c=s(57250);let x=[{id:"claude",name:"Claude Code",image:"/providers/claude.png"},{id:"codex",name:"OpenAI Codex",image:"/providers/codex.png"},{id:"cline",name:"Cline",image:"/providers/cline.png"},{id:"cursor",name:"Cursor",image:"/providers/cursor.png"}],m=[{id:"openai",name:"OpenAI",color:"bg-emerald-500",textColor:"text-white"},{id:"anthropic",name:"Anthropic",color:"bg-orange-400",textColor:"text-white"},{id:"gemini",name:"Gemini",color:"bg-blue-500",textColor:"text-white"},{id:"github",name:"GitHub Copilot",color:"bg-gray-700",textColor:"text-white"}];function h(){let[e,t]=(0,n.useState)(0);return(0,n.useEffect)(()=>{let e=setInterval(()=>{t(e=>(e+1)%m.length)},2e3);return()=>clearInterval(e)},[]),(0,r.jsxs)("div",{className:"mt-16 w-full max-w-4xl relative h-[360px] hidden md:flex items-center justify-center animate-[float_6s_ease-in-out_infinite]",children:[(0,r.jsxs)("div",{className:"relative z-20 w-32 h-32 rounded-full bg-[#23180f] border-2 border-[#f97815] shadow-[0_0_40px_rgba(249,120,21,0.3)] flex flex-col items-center justify-center gap-1 group cursor-pointer hover:scale-105 transition-transform duration-500",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-[#f97815]",children:"hub"}),(0,r.jsx)("span",{className:"text-xs font-bold text-white tracking-widest uppercase",children:"openrouterx"}),(0,r.jsx)("div",{className:"absolute inset-0 rounded-full border border-[#f97815]/30 animate-ping opacity-20"})]}),(0,r.jsx)("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 flex flex-col gap-7",children:x.map(e=>(0,r.jsx)("div",{className:"flex items-center gap-3 opacity-70 hover:opacity-100 transition-opacity group",children:(0,r.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-[#23180f] border border-[#3a2f27] flex items-center justify-center overflow-hidden p-2 hover:border-[#f97815]/50 transition-all hover:scale-105",children:(0,r.jsx)(c.A,{src:e.image,alt:e.name,size:48,className:"object-contain rounded-xl max-w-[48px] max-h-[48px]",fallbackText:e.name.slice(0,2).toUpperCase()})})},e.id))}),(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none stroke-yellow-700",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 50 C 250 70, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 140 C 250 140, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 210 C 250 210, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 300 C 250 280, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"})]}),(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 50, 740 50",fill:"none",stroke:0===e?"#f97815":"rgb(75, 85, 99)",strokeWidth:0===e?"3":"2",className:0===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 130, 740 130",fill:"none",stroke:1===e?"#f97815":"rgb(75, 85, 99)",strokeWidth:1===e?"3":"2",className:1===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 230, 740 230",fill:"none",stroke:2===e?"#f97815":"rgb(75, 85, 99)",strokeWidth:2===e?"3":"2",className:2===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 310, 740 310",fill:"none",stroke:3===e?"#f97815":"rgb(75, 85, 99)",strokeWidth:3===e?"3":"2",className:3===e?"animate-pulse":""})]}),(0,r.jsx)("div",{className:"absolute right-0 top-0 bottom-0 flex flex-col justify-between py-6",children:m.map((t,s)=>(0,r.jsx)("div",{className:`px-4 py-2 rounded-lg ${t.color} ${t.textColor} flex items-center justify-center font-bold text-xs shadow-lg hover:scale-110 transition-all cursor-help min-w-[140px] ${e===s?"ring-4 ring-[#f97815]/50 scale-110":""}`,title:t.name,children:t.name},t.id))}),(0,r.jsx)("div",{className:"md:hidden mt-8 w-full p-4 rounded-lg bg-[#23180f] border border-[#3a2f27]",children:(0,r.jsx)("p",{className:"text-sm text-center text-gray-400",children:"Interactive diagram visible on desktop"})})]})}function f(){return(0,r.jsx)("section",{className:"py-24 border-y border-[#3a2f27] bg-[#23180f]/30",id:"how-it-works",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-6",children:[(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"How 9Router Works"}),(0,r.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Data flows seamlessly from your application through our intelligent routing layer to the best provider for the job."})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 relative",children:[(0,r.jsx)("div",{className:"hidden md:block absolute top-12 left-[16%] right-[16%] h-[2px] bg-linear-to-r from-gray-700 via-[#f97815] to-gray-700 -z-10"}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#181411] border border-[#3a2f27] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-gray-300",children:"terminal"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2",children:"1. CLI & SDKs"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"Your requests start from your favorite tools or our unified SDK. Just change the base URL."})]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-center md:text-center",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#181411] border-2 border-[#f97815] flex items-center justify-center shadow-[0_0_30px_rgba(249,120,21,0.2)] z-10 mx-auto",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-[#f97815] animate-pulse",children:"hub"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2 text-[#f97815]",children:"2. 9Router Hub"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"Our engine analyzes the prompt, checks provider health, and routes for lowest latency or cost."})]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-end md:text-right",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#181411] border border-[#3a2f27] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"})]})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2",children:"3. AI Providers"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"The request is fulfilled by OpenAI, Anthropic, Gemini, or others instantly."})]})]})]})]})})}let u=[{icon:"link",title:"Unified Endpoint",desc:"Access all providers via a single standard API URL.",colors:{border:"hover:border-blue-500/50",bg:"hover:bg-blue-500/5",iconBg:"bg-blue-500/10",iconText:"text-blue-500",titleHover:"group-hover:text-blue-400"}},{icon:"bolt",title:"Easy Setup",desc:"Get up and running in minutes with npx command.",colors:{border:"hover:border-orange-500/50",bg:"hover:bg-orange-500/5",iconBg:"bg-orange-500/10",iconText:"text-orange-500",titleHover:"group-hover:text-orange-400"}},{icon:"shield_with_heart",title:"Model Fallback",desc:"Automatically switch providers on failure or high latency.",colors:{border:"hover:border-rose-500/50",bg:"hover:bg-rose-500/5",iconBg:"bg-rose-500/10",iconText:"text-rose-500",titleHover:"group-hover:text-rose-400"}},{icon:"monitoring",title:"Usage Tracking",desc:"Detailed analytics and cost monitoring across all models.",colors:{border:"hover:border-purple-500/50",bg:"hover:bg-purple-500/5",iconBg:"bg-purple-500/10",iconText:"text-purple-500",titleHover:"group-hover:text-purple-400"}},{icon:"key",title:"OAuth & API Keys",desc:"Securely manage credentials in one vault.",colors:{border:"hover:border-amber-500/50",bg:"hover:bg-amber-500/5",iconBg:"bg-amber-500/10",iconText:"text-amber-500",titleHover:"group-hover:text-amber-400"}},{icon:"cloud_sync",title:"Cloud Sync",desc:"Sync your configurations across devices instantly.",colors:{border:"hover:border-sky-500/50",bg:"hover:bg-sky-500/5",iconBg:"bg-sky-500/10",iconText:"text-sky-500",titleHover:"group-hover:text-sky-400"}},{icon:"terminal",title:"CLI Support",desc:"Works with Claude Code, Codex, Cline, Cursor, and more.",colors:{border:"hover:border-emerald-500/50",bg:"hover:bg-emerald-500/5",iconBg:"bg-emerald-500/10",iconText:"text-emerald-500",titleHover:"group-hover:text-emerald-400"}},{icon:"dashboard",title:"Dashboard",desc:"Visual dashboard for real-time traffic analysis.",colors:{border:"hover:border-fuchsia-500/50",bg:"hover:bg-fuchsia-500/5",iconBg:"bg-fuchsia-500/10",iconText:"text-fuchsia-500",titleHover:"group-hover:text-fuchsia-400"}}];function b(){return(0,r.jsx)("section",{className:"py-24 px-6",id:"features",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Powerful Features"}),(0,r.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Everything you need to manage your AI infrastructure in one place, built for scale."})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:u.map(e=>(0,r.jsxs)("div",{className:`p-6 rounded-xl bg-[#23180f] border border-[#3a2f27] ${e.colors.border} ${e.colors.bg} transition-all duration-300 group`,children:[(0,r.jsx)("div",{className:`w-10 h-10 rounded-lg ${e.colors.iconBg} flex items-center justify-center mb-4 ${e.colors.iconText} group-hover:scale-110 transition-transform duration-300`,children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:e.icon})}),(0,r.jsx)("h3",{className:`text-lg font-bold mb-2 ${e.colors.titleHover} transition-colors`,children:e.title}),(0,r.jsx)("p",{className:"text-sm text-gray-400 leading-relaxed",children:e.desc})]},e.title))})]})})}var g=s(11059);function p(){let{copied:e,copy:t}=(0,g.C)();return(0,r.jsx)("section",{className:"py-24 px-6 bg-[#120f0d]",children:(0,r.jsx)("div",{className:"max-w-7xl mx-auto",children:(0,r.jsxs)("div",{className:"flex flex-col lg:flex-row gap-16 items-start",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-6",children:"Get Started in 30 Seconds"}),(0,r.jsx)("p",{className:"text-gray-400 text-lg mb-8",children:"Install 9Router, configure your providers via web dashboard, and start routing AI requests."}),(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#f97815]/20 text-[#f97815] flex items-center justify-center font-bold",children:"1"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Install 9Router"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Run npx command to start the server instantly"})]})]}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#f97815]/20 text-[#f97815] flex items-center justify-center font-bold",children:"2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Open Dashboard"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Configure providers and API keys via web interface"})]})]}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#f97815]/20 text-[#f97815] flex items-center justify-center font-bold",children:"3"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Route Requests"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Point your CLI tools to http://localhost:20128"})]})]})]})]}),(0,r.jsx)("div",{className:"flex-1 w-full",children:(0,r.jsxs)("div",{className:"rounded-xl overflow-hidden bg-[#1e1e1e] border border-[#3a2f27] shadow-2xl",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 bg-[#252526] border-b border-gray-700",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-green-500"}),(0,r.jsx)("div",{className:"ml-2 text-xs text-gray-500 font-mono",children:"terminal"})]}),(0,r.jsxs)("div",{className:"p-6 font-mono text-sm leading-relaxed overflow-x-auto",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4 group cursor-pointer",onClick:()=>{t("npx 9router","landing")},children:[(0,r.jsx)("span",{className:"text-green-400",children:"$"}),(0,r.jsx)("span",{className:"text-white",children:"npx 9router"}),(0,r.jsx)("span",{className:"ml-auto text-gray-500 text-xs opacity-0 group-hover:opacity-100",children:"landing"===e?"✓ Copied":"Copy"})]}),(0,r.jsxs)("div",{className:"text-gray-400 mb-6",children:[(0,r.jsx)("span",{className:"text-[#f97815]",children:">"})," Starting 9Router...",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#f97815]",children:">"})," Server running on ",(0,r.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#f97815]",children:">"})," Dashboard: ",(0,r.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128/dashboard"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-green-400",children:">"})," Ready to route! ✓"]}),(0,r.jsx)("div",{className:"text-xs text-gray-500 mb-2 border-t border-gray-700 pt-4",children:"\uD83D\uDCDD Configure providers in dashboard or use environment variables"}),(0,r.jsxs)("div",{className:"text-gray-400 text-xs",children:[(0,r.jsx)("span",{className:"text-purple-400",children:"Data Location:"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-gray-500",children:" macOS/Linux:"})," ~/.9router/db.json",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-gray-500",children:" Windows:"})," %APPDATA%/9router/db.json"]})]})]})})]})})})}function j(){return(0,r.jsx)("footer",{className:"border-t border-[#3a2f27] bg-[#120f0d] pt-16 pb-8 px-6",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-8 mb-16",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,r.jsx)("div",{className:"size-6 rounded bg-[#f97815] flex items-center justify-center text-white",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"hub"})}),(0,r.jsx)("h3",{className:"text-white text-lg font-bold",children:"9Router"})]}),(0,r.jsx)("p",{className:"text-gray-500 text-sm max-w-xs mb-6",children:"The unified endpoint for AI generation. Connect, route, and manage your AI providers with ease."}),(0,r.jsx)("div",{className:"flex gap-4",children:(0,r.jsx)("a",{className:"text-gray-400 hover:text-white transition-colors",href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"code"})})})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Product"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"#features",children:"Features"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"/dashboard",children:"Dashboard"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",children:"Changelog"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Resources"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://github.com/decolua/9router#readme",target:"_blank",rel:"noopener noreferrer",children:"Documentation"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://www.npmjs.com/package/9router",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Legal"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://github.com/decolua/9router/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:"MIT License"})]})]}),(0,r.jsxs)("div",{className:"border-t border-[#3a2f27] pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsx)("p",{className:"text-gray-600 text-sm",children:"\xa9 2025 9Router. All rights reserved."}),(0,r.jsxs)("div",{className:"flex gap-6",children:[(0,r.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://www.npmjs.com/package/9router",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]})]})]})})}function v(){let e=(0,o.useRouter)();return(0,r.jsxs)("div",{className:"jsx-3853dfda129ea3f2 relative text-white font-sans overflow-x-hidden antialiased selection:bg-[#f97815] selection:text-white",children:[(0,r.jsxs)("div",{className:"jsx-3853dfda129ea3f2 fixed inset-0 z-0 overflow-hidden pointer-events-none bg-[#181411]",children:[(0,r.jsx)("div",{style:{backgroundImage:"linear-gradient(to right, #f97815 1px, transparent 1px), linear-gradient(to bottom, #f97815 1px, transparent 1px)",backgroundSize:"50px 50px"},className:"jsx-3853dfda129ea3f2 absolute inset-0 opacity-[0.06]"}),(0,r.jsx)("div",{className:"jsx-3853dfda129ea3f2 absolute top-0 left-1/4 w-[700px] h-[700px] bg-[#f97815]/12 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{style:{animationDelay:"2s",animationDuration:"22s"},className:"jsx-3853dfda129ea3f2 absolute top-1/3 right-1/4 w-[600px] h-[600px] bg-purple-500/10 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{style:{animationDelay:"4s",animationDuration:"25s"},className:"jsx-3853dfda129ea3f2 absolute bottom-0 left-1/2 w-[650px] h-[650px] bg-blue-500/8 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{style:{background:"radial-gradient(circle at center, transparent 0%, rgba(24, 20, 17, 0.4) 100%)"},className:"jsx-3853dfda129ea3f2 absolute inset-0"})]}),(0,r.jsxs)("div",{className:"jsx-3853dfda129ea3f2 relative z-10",children:[(0,r.jsx)(i,{}),(0,r.jsxs)("main",{className:"jsx-3853dfda129ea3f2",children:[(0,r.jsxs)("div",{className:"jsx-3853dfda129ea3f2 relative",children:[(0,r.jsx)(d,{}),(0,r.jsx)("div",{className:"jsx-3853dfda129ea3f2 flex justify-center pb-20",children:(0,r.jsx)(h,{})})]}),(0,r.jsx)(p,{}),(0,r.jsx)(f,{}),(0,r.jsx)(b,{}),(0,r.jsxs)("section",{className:"jsx-3853dfda129ea3f2 py-32 px-6 relative overflow-hidden",children:[(0,r.jsx)("div",{className:"jsx-3853dfda129ea3f2 absolute inset-0 bg-linear-to-t from-[#f97815]/5 to-transparent pointer-events-none"}),(0,r.jsxs)("div",{className:"jsx-3853dfda129ea3f2 max-w-4xl mx-auto text-center relative z-10",children:[(0,r.jsx)("h2",{className:"jsx-3853dfda129ea3f2 text-4xl md:text-5xl font-black mb-6",children:"Ready to Simplify Your AI Infrastructure?"}),(0,r.jsx)("p",{className:"jsx-3853dfda129ea3f2 text-xl text-gray-400 mb-10 max-w-2xl mx-auto",children:"Join developers who are streamlining their AI integrations with 9Router. Open source and free to start."}),(0,r.jsxs)("div",{className:"jsx-3853dfda129ea3f2 flex flex-col sm:flex-row items-center justify-center gap-4",children:[(0,r.jsx)("button",{onClick:()=>e.push("/dashboard"),className:"jsx-3853dfda129ea3f2 w-full sm:w-auto h-14 px-10 rounded-lg bg-[#f97815] hover:bg-[#e0650a] text-[#181411] text-lg font-bold transition-all shadow-[0_0_20px_rgba(249,120,21,0.5)]",children:"Start Free"}),(0,r.jsx)("button",{onClick:()=>window.open("https://github.com/decolua/9router#readme","_blank"),className:"jsx-3853dfda129ea3f2 w-full sm:w-auto h-14 px-10 rounded-lg border border-[#3a2f27] hover:bg-[#23180f] text-white text-lg font-bold transition-all",children:"Read Documentation"})]})]})]})]}),(0,r.jsx)(j,{})]}),(0,r.jsx)(l(),{id:"3853dfda129ea3f2",children:"@keyframes float{0%,100%{transform:translatey(0)}50%{transform:translatey(-10px)}}@keyframes dash{to{stroke-dashoffset:-20}}@keyframes blob{0%,100%{transform:translate(0,0)scale(1)}33%{transform:translate(30px,-50px)scale(1.1)}66%{transform:translate(-20px,20px)scale(.9)}}.animate-blob{animation:blob 20s ease-in-out infinite}"})]})}}},e=>{e.O(0,[5242,8441,3794,7358],()=>e(e.s=39993)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7018],{11059:(e,t,s)=>{"use strict";s.d(t,{C:()=>a});var r=s(12115);function a(e=2e3){let[t,s]=(0,r.useState)(null),l=(0,r.useRef)(null);return{copied:t,copy:(0,r.useCallback)((t,r="default")=>{(async()=>{if(navigator?.clipboard?.writeText)await navigator.clipboard.writeText(t);else{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}})(),s(r),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s(null)},e)},[e])}}},39993:(e,t,s)=>{Promise.resolve().then(s.bind(s,85941))},57250:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var r=s(95155),a=s(12115),l=s(14051),o=s.n(l);function n({src:e,alt:t,size:s=32,className:l="",fallbackText:o="?",fallbackColor:i}){let[d,c]=(0,a.useState)(!1);return!e||d?(0,r.jsx)("span",{className:`inline-flex items-center justify-center font-bold rounded-lg ${l}`.trim(),style:{width:s,height:s,color:i,fontSize:Math.max(10,Math.floor(.38*s))},children:o}):(0,r.jsx)("img",{src:e,alt:t,width:s,height:s,className:l,onError:()=>c(!0)})}n.propTypes={src:o().string,alt:o().string,size:o().number,className:o().string,fallbackText:o().string,fallbackColor:o().string}},85941:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>v});var r=s(95155),a=s(39092),l=s.n(a),o=s(73321),n=s(12115);function i(){let[e,t]=(0,n.useState)(!1),s=(0,o.useRouter)();return(0,r.jsxs)("nav",{className:"fixed top-0 z-50 w-full bg-[#181411]/80 backdrop-blur-md border-b border-[#3a2f27]",children:[(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[(0,r.jsxs)("button",{type:"button",className:"flex items-center gap-3 cursor-pointer bg-transparent border-none p-0",onClick:()=>s.push("/"),"aria-label":"Navigate to home",children:[(0,r.jsx)("div",{className:"size-8 rounded bg-linear-to-br from-[#f97815] to-orange-700 flex items-center justify-center text-white",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"hub"})}),(0,r.jsx)("h2",{className:"text-white text-xl font-bold tracking-tight",children:"9Router"})]}),(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-8",children:[(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",children:"Features"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",children:"How it Works"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/decolua/9router#readme",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,r.jsxs)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors flex items-center gap-1",href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",children:["GitHub ",(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"open_in_new"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("button",{onClick:()=>s.push("/dashboard"),className:"hidden sm:flex h-9 items-center justify-center rounded-lg px-4 bg-[#f97815] hover:bg-[#e0650a] transition-all text-[#181411] text-sm font-bold shadow-[0_0_15px_rgba(249,120,21,0.4)] hover:shadow-[0_0_20px_rgba(249,120,21,0.6)]",children:"Get Started"}),(0,r.jsx)("button",{className:"md:hidden text-white",onClick:()=>t(!e),children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:e?"close":"menu"})})]})]}),e&&(0,r.jsx)("div",{className:"md:hidden border-t border-[#3a2f27] bg-[#181411]/95 backdrop-blur-md",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4 p-6",children:[(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",onClick:()=>t(!1),children:"Features"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",onClick:()=>t(!1),children:"How it Works"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/decolua/9router#readme",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("button",{onClick:()=>s.push("/dashboard"),className:"h-9 rounded-lg bg-[#f97815] hover:bg-[#e0650a] text-[#181411] text-sm font-bold",children:"Get Started"})]})})]})}function d(){return(0,r.jsxs)("section",{className:"relative pt-32 pb-20 px-6 min-h-[90vh] flex flex-col items-center justify-center overflow-hidden",children:[(0,r.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[1000px] h-[500px] bg-[#f97815]/10 rounded-full blur-[120px] pointer-events-none"}),(0,r.jsxs)("div",{className:"relative z-10 max-w-4xl w-full text-center flex flex-col items-center gap-8",children:[(0,r.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-[#3a2f27] bg-[#23180f]/50 px-3 py-1 text-xs font-medium text-[#f97815]",children:[(0,r.jsx)("span",{className:"flex h-2 w-2 rounded-full bg-[#f97815] animate-pulse"}),"v1.0 is now live"]}),(0,r.jsxs)("h1",{className:"text-5xl md:text-7xl font-black leading-[1.1] tracking-tight",children:["One Endpoint for ",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#f97815]",children:"All AI Providers"})]}),(0,r.jsx)("p",{className:"text-lg md:text-xl text-gray-400 max-w-2xl mx-auto font-light",children:"AI endpoint proxy with web dashboard - A JavaScript port of CLIProxyAPI. Works seamlessly with Claude Code, OpenAI Codex, Cline, RooCode, and other CLI tools."}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-4 w-full",children:[(0,r.jsxs)("button",{className:"h-12 px-8 rounded-lg bg-[#f97815] hover:bg-[#e0650a] text-[#181411] text-base font-bold transition-all shadow-[0_0_15px_rgba(249,120,21,0.4)] flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined",children:"rocket_launch"}),"Get Started"]}),(0,r.jsxs)("a",{href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",className:"h-12 px-8 rounded-lg border border-[#3a2f27] bg-[#23180f] hover:bg-[#3a2f27] text-white text-base font-bold transition-all flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined",children:"code"}),"View on GitHub"]})]})]})]})}var c=s(57250);let x=[{id:"claude",name:"Claude Code",image:"/providers/claude.png"},{id:"codex",name:"OpenAI Codex",image:"/providers/codex.png"},{id:"cline",name:"Cline",image:"/providers/cline.png"},{id:"cursor",name:"Cursor",image:"/providers/cursor.png"}],m=[{id:"openai",name:"OpenAI",color:"bg-emerald-500",textColor:"text-white"},{id:"anthropic",name:"Anthropic",color:"bg-orange-400",textColor:"text-white"},{id:"gemini",name:"Gemini",color:"bg-blue-500",textColor:"text-white"},{id:"github",name:"GitHub Copilot",color:"bg-gray-700",textColor:"text-white"}];function h(){let[e,t]=(0,n.useState)(0);return(0,n.useEffect)(()=>{let e=setInterval(()=>{t(e=>(e+1)%m.length)},2e3);return()=>clearInterval(e)},[]),(0,r.jsxs)("div",{className:"mt-16 w-full max-w-4xl relative h-[360px] hidden md:flex items-center justify-center animate-[float_6s_ease-in-out_infinite]",children:[(0,r.jsxs)("div",{className:"relative z-20 w-32 h-32 rounded-full bg-[#23180f] border-2 border-[#f97815] shadow-[0_0_40px_rgba(249,120,21,0.3)] flex flex-col items-center justify-center gap-1 group cursor-pointer hover:scale-105 transition-transform duration-500",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-[#f97815]",children:"hub"}),(0,r.jsx)("span",{className:"text-xs font-bold text-white tracking-widest uppercase",children:"openrouterx"}),(0,r.jsx)("div",{className:"absolute inset-0 rounded-full border border-[#f97815]/30 animate-ping opacity-20"})]}),(0,r.jsx)("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 flex flex-col gap-7",children:x.map(e=>(0,r.jsx)("div",{className:"flex items-center gap-3 opacity-70 hover:opacity-100 transition-opacity group",children:(0,r.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-[#23180f] border border-[#3a2f27] flex items-center justify-center overflow-hidden p-2 hover:border-[#f97815]/50 transition-all hover:scale-105",children:(0,r.jsx)(c.A,{src:e.image,alt:e.name,size:48,className:"object-contain rounded-xl max-w-[48px] max-h-[48px]",fallbackText:e.name.slice(0,2).toUpperCase()})})},e.id))}),(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none stroke-yellow-700",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 50 C 250 70, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 140 C 250 140, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 210 C 250 210, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 300 C 250 280, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"})]}),(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 50, 740 50",fill:"none",stroke:0===e?"#f97815":"rgb(75, 85, 99)",strokeWidth:0===e?"3":"2",className:0===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 130, 740 130",fill:"none",stroke:1===e?"#f97815":"rgb(75, 85, 99)",strokeWidth:1===e?"3":"2",className:1===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 230, 740 230",fill:"none",stroke:2===e?"#f97815":"rgb(75, 85, 99)",strokeWidth:2===e?"3":"2",className:2===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 310, 740 310",fill:"none",stroke:3===e?"#f97815":"rgb(75, 85, 99)",strokeWidth:3===e?"3":"2",className:3===e?"animate-pulse":""})]}),(0,r.jsx)("div",{className:"absolute right-0 top-0 bottom-0 flex flex-col justify-between py-6",children:m.map((t,s)=>(0,r.jsx)("div",{className:`px-4 py-2 rounded-lg ${t.color} ${t.textColor} flex items-center justify-center font-bold text-xs shadow-lg hover:scale-110 transition-all cursor-help min-w-[140px] ${e===s?"ring-4 ring-[#f97815]/50 scale-110":""}`,title:t.name,children:t.name},t.id))}),(0,r.jsx)("div",{className:"md:hidden mt-8 w-full p-4 rounded-lg bg-[#23180f] border border-[#3a2f27]",children:(0,r.jsx)("p",{className:"text-sm text-center text-gray-400",children:"Interactive diagram visible on desktop"})})]})}function f(){return(0,r.jsx)("section",{className:"py-24 border-y border-[#3a2f27] bg-[#23180f]/30",id:"how-it-works",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-6",children:[(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"How 9Router Works"}),(0,r.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Data flows seamlessly from your application through our intelligent routing layer to the best provider for the job."})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 relative",children:[(0,r.jsx)("div",{className:"hidden md:block absolute top-12 left-[16%] right-[16%] h-[2px] bg-linear-to-r from-gray-700 via-[#f97815] to-gray-700 -z-10"}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#181411] border border-[#3a2f27] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-gray-300",children:"terminal"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2",children:"1. CLI & SDKs"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"Your requests start from your favorite tools or our unified SDK. Just change the base URL."})]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-center md:text-center",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#181411] border-2 border-[#f97815] flex items-center justify-center shadow-[0_0_30px_rgba(249,120,21,0.2)] z-10 mx-auto",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-[#f97815] animate-pulse",children:"hub"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2 text-[#f97815]",children:"2. 9Router Hub"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"Our engine analyzes the prompt, checks provider health, and routes for lowest latency or cost."})]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-end md:text-right",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#181411] border border-[#3a2f27] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"})]})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2",children:"3. AI Providers"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"The request is fulfilled by OpenAI, Anthropic, Gemini, or others instantly."})]})]})]})]})})}let u=[{icon:"link",title:"Unified Endpoint",desc:"Access all providers via a single standard API URL.",colors:{border:"hover:border-blue-500/50",bg:"hover:bg-blue-500/5",iconBg:"bg-blue-500/10",iconText:"text-blue-500",titleHover:"group-hover:text-blue-400"}},{icon:"bolt",title:"Easy Setup",desc:"Get up and running in minutes with npx command.",colors:{border:"hover:border-orange-500/50",bg:"hover:bg-orange-500/5",iconBg:"bg-orange-500/10",iconText:"text-orange-500",titleHover:"group-hover:text-orange-400"}},{icon:"shield_with_heart",title:"Model Fallback",desc:"Automatically switch providers on failure or high latency.",colors:{border:"hover:border-rose-500/50",bg:"hover:bg-rose-500/5",iconBg:"bg-rose-500/10",iconText:"text-rose-500",titleHover:"group-hover:text-rose-400"}},{icon:"monitoring",title:"Usage Tracking",desc:"Detailed analytics and cost monitoring across all models.",colors:{border:"hover:border-purple-500/50",bg:"hover:bg-purple-500/5",iconBg:"bg-purple-500/10",iconText:"text-purple-500",titleHover:"group-hover:text-purple-400"}},{icon:"key",title:"OAuth & API Keys",desc:"Securely manage credentials in one vault.",colors:{border:"hover:border-amber-500/50",bg:"hover:bg-amber-500/5",iconBg:"bg-amber-500/10",iconText:"text-amber-500",titleHover:"group-hover:text-amber-400"}},{icon:"cloud_sync",title:"Cloud Sync",desc:"Sync your configurations across devices instantly.",colors:{border:"hover:border-sky-500/50",bg:"hover:bg-sky-500/5",iconBg:"bg-sky-500/10",iconText:"text-sky-500",titleHover:"group-hover:text-sky-400"}},{icon:"terminal",title:"CLI Support",desc:"Works with Claude Code, Codex, Cline, Cursor, and more.",colors:{border:"hover:border-emerald-500/50",bg:"hover:bg-emerald-500/5",iconBg:"bg-emerald-500/10",iconText:"text-emerald-500",titleHover:"group-hover:text-emerald-400"}},{icon:"dashboard",title:"Dashboard",desc:"Visual dashboard for real-time traffic analysis.",colors:{border:"hover:border-fuchsia-500/50",bg:"hover:bg-fuchsia-500/5",iconBg:"bg-fuchsia-500/10",iconText:"text-fuchsia-500",titleHover:"group-hover:text-fuchsia-400"}}];function b(){return(0,r.jsx)("section",{className:"py-24 px-6",id:"features",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Powerful Features"}),(0,r.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Everything you need to manage your AI infrastructure in one place, built for scale."})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:u.map(e=>(0,r.jsxs)("div",{className:`p-6 rounded-xl bg-[#23180f] border border-[#3a2f27] ${e.colors.border} ${e.colors.bg} transition-all duration-300 group`,children:[(0,r.jsx)("div",{className:`w-10 h-10 rounded-lg ${e.colors.iconBg} flex items-center justify-center mb-4 ${e.colors.iconText} group-hover:scale-110 transition-transform duration-300`,children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:e.icon})}),(0,r.jsx)("h3",{className:`text-lg font-bold mb-2 ${e.colors.titleHover} transition-colors`,children:e.title}),(0,r.jsx)("p",{className:"text-sm text-gray-400 leading-relaxed",children:e.desc})]},e.title))})]})})}var g=s(11059);function p(){let{copied:e,copy:t}=(0,g.C)();return(0,r.jsx)("section",{className:"py-24 px-6 bg-[#120f0d]",children:(0,r.jsx)("div",{className:"max-w-7xl mx-auto",children:(0,r.jsxs)("div",{className:"flex flex-col lg:flex-row gap-16 items-start",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-6",children:"Get Started in 30 Seconds"}),(0,r.jsx)("p",{className:"text-gray-400 text-lg mb-8",children:"Install 9Router, configure your providers via web dashboard, and start routing AI requests."}),(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#f97815]/20 text-[#f97815] flex items-center justify-center font-bold",children:"1"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Install 9Router"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Run npx command to start the server instantly"})]})]}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#f97815]/20 text-[#f97815] flex items-center justify-center font-bold",children:"2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Open Dashboard"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Configure providers and API keys via web interface"})]})]}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#f97815]/20 text-[#f97815] flex items-center justify-center font-bold",children:"3"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Route Requests"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Point your CLI tools to http://localhost:20128"})]})]})]})]}),(0,r.jsx)("div",{className:"flex-1 w-full",children:(0,r.jsxs)("div",{className:"rounded-xl overflow-hidden bg-[#1e1e1e] border border-[#3a2f27] shadow-2xl",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 bg-[#252526] border-b border-gray-700",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-green-500"}),(0,r.jsx)("div",{className:"ml-2 text-xs text-gray-500 font-mono",children:"terminal"})]}),(0,r.jsxs)("div",{className:"p-6 font-mono text-sm leading-relaxed overflow-x-auto",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4 group cursor-pointer",onClick:()=>{t("npx 9router","landing")},children:[(0,r.jsx)("span",{className:"text-green-400",children:"$"}),(0,r.jsx)("span",{className:"text-white",children:"npx 9router"}),(0,r.jsx)("span",{className:"ml-auto text-gray-500 text-xs opacity-0 group-hover:opacity-100",children:"landing"===e?"✓ Copied":"Copy"})]}),(0,r.jsxs)("div",{className:"text-gray-400 mb-6",children:[(0,r.jsx)("span",{className:"text-[#f97815]",children:">"})," Starting 9Router...",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#f97815]",children:">"})," Server running on ",(0,r.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#f97815]",children:">"})," Dashboard: ",(0,r.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128/dashboard"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-green-400",children:">"})," Ready to route! ✓"]}),(0,r.jsx)("div",{className:"text-xs text-gray-500 mb-2 border-t border-gray-700 pt-4",children:"\uD83D\uDCDD Configure providers in dashboard or use environment variables"}),(0,r.jsxs)("div",{className:"text-gray-400 text-xs",children:[(0,r.jsx)("span",{className:"text-purple-400",children:"Data Location:"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-gray-500",children:" macOS/Linux:"})," ~/.openrouterx/db.json",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-gray-500",children:" Windows:"})," %APPDATA%/openrouterx/db.json"]})]})]})})]})})})}function j(){return(0,r.jsx)("footer",{className:"border-t border-[#3a2f27] bg-[#120f0d] pt-16 pb-8 px-6",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-8 mb-16",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,r.jsx)("div",{className:"size-6 rounded bg-[#f97815] flex items-center justify-center text-white",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"hub"})}),(0,r.jsx)("h3",{className:"text-white text-lg font-bold",children:"9Router"})]}),(0,r.jsx)("p",{className:"text-gray-500 text-sm max-w-xs mb-6",children:"The unified endpoint for AI generation. Connect, route, and manage your AI providers with ease."}),(0,r.jsx)("div",{className:"flex gap-4",children:(0,r.jsx)("a",{className:"text-gray-400 hover:text-white transition-colors",href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"code"})})})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Product"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"#features",children:"Features"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"/dashboard",children:"Dashboard"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",children:"Changelog"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Resources"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://github.com/decolua/9router#readme",target:"_blank",rel:"noopener noreferrer",children:"Documentation"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://www.npmjs.com/package/9router",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Legal"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#f97815] text-sm transition-colors",href:"https://github.com/decolua/9router/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:"MIT License"})]})]}),(0,r.jsxs)("div",{className:"border-t border-[#3a2f27] pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsx)("p",{className:"text-gray-600 text-sm",children:"\xa9 2025 9Router. All rights reserved."}),(0,r.jsxs)("div",{className:"flex gap-6",children:[(0,r.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://github.com/decolua/9router",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://www.npmjs.com/package/9router",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]})]})]})})}function v(){let e=(0,o.useRouter)();return(0,r.jsxs)("div",{className:"jsx-3853dfda129ea3f2 relative text-white font-sans overflow-x-hidden antialiased selection:bg-[#f97815] selection:text-white",children:[(0,r.jsxs)("div",{className:"jsx-3853dfda129ea3f2 fixed inset-0 z-0 overflow-hidden pointer-events-none bg-[#181411]",children:[(0,r.jsx)("div",{style:{backgroundImage:"linear-gradient(to right, #f97815 1px, transparent 1px), linear-gradient(to bottom, #f97815 1px, transparent 1px)",backgroundSize:"50px 50px"},className:"jsx-3853dfda129ea3f2 absolute inset-0 opacity-[0.06]"}),(0,r.jsx)("div",{className:"jsx-3853dfda129ea3f2 absolute top-0 left-1/4 w-[700px] h-[700px] bg-[#f97815]/12 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{style:{animationDelay:"2s",animationDuration:"22s"},className:"jsx-3853dfda129ea3f2 absolute top-1/3 right-1/4 w-[600px] h-[600px] bg-purple-500/10 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{style:{animationDelay:"4s",animationDuration:"25s"},className:"jsx-3853dfda129ea3f2 absolute bottom-0 left-1/2 w-[650px] h-[650px] bg-blue-500/8 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{style:{background:"radial-gradient(circle at center, transparent 0%, rgba(24, 20, 17, 0.4) 100%)"},className:"jsx-3853dfda129ea3f2 absolute inset-0"})]}),(0,r.jsxs)("div",{className:"jsx-3853dfda129ea3f2 relative z-10",children:[(0,r.jsx)(i,{}),(0,r.jsxs)("main",{className:"jsx-3853dfda129ea3f2",children:[(0,r.jsxs)("div",{className:"jsx-3853dfda129ea3f2 relative",children:[(0,r.jsx)(d,{}),(0,r.jsx)("div",{className:"jsx-3853dfda129ea3f2 flex justify-center pb-20",children:(0,r.jsx)(h,{})})]}),(0,r.jsx)(p,{}),(0,r.jsx)(f,{}),(0,r.jsx)(b,{}),(0,r.jsxs)("section",{className:"jsx-3853dfda129ea3f2 py-32 px-6 relative overflow-hidden",children:[(0,r.jsx)("div",{className:"jsx-3853dfda129ea3f2 absolute inset-0 bg-linear-to-t from-[#f97815]/5 to-transparent pointer-events-none"}),(0,r.jsxs)("div",{className:"jsx-3853dfda129ea3f2 max-w-4xl mx-auto text-center relative z-10",children:[(0,r.jsx)("h2",{className:"jsx-3853dfda129ea3f2 text-4xl md:text-5xl font-black mb-6",children:"Ready to Simplify Your AI Infrastructure?"}),(0,r.jsx)("p",{className:"jsx-3853dfda129ea3f2 text-xl text-gray-400 mb-10 max-w-2xl mx-auto",children:"Join developers who are streamlining their AI integrations with 9Router. Open source and free to start."}),(0,r.jsxs)("div",{className:"jsx-3853dfda129ea3f2 flex flex-col sm:flex-row items-center justify-center gap-4",children:[(0,r.jsx)("button",{onClick:()=>e.push("/dashboard"),className:"jsx-3853dfda129ea3f2 w-full sm:w-auto h-14 px-10 rounded-lg bg-[#f97815] hover:bg-[#e0650a] text-[#181411] text-lg font-bold transition-all shadow-[0_0_20px_rgba(249,120,21,0.5)]",children:"Start Free"}),(0,r.jsx)("button",{onClick:()=>window.open("https://github.com/decolua/9router#readme","_blank"),className:"jsx-3853dfda129ea3f2 w-full sm:w-auto h-14 px-10 rounded-lg border border-[#3a2f27] hover:bg-[#23180f] text-white text-lg font-bold transition-all",children:"Read Documentation"})]})]})]})]}),(0,r.jsx)(j,{})]}),(0,r.jsx)(l(),{id:"3853dfda129ea3f2",children:"@keyframes float{0%,100%{transform:translatey(0)}50%{transform:translatey(-10px)}}@keyframes dash{to{stroke-dashoffset:-20}}@keyframes blob{0%,100%{transform:translate(0,0)scale(1)}33%{transform:translate(30px,-50px)scale(1.1)}66%{transform:translate(-20px,20px)scale(.9)}}.animate-blob{animation:blob 20s ease-in-out infinite}"})]})}}},e=>{e.O(0,[5242,8441,3794,7358],()=>e(e.s=39993)),_N_E=e.O()}]);