@yina-npm/openrouterx 0.4.10 → 0.4.11

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 (788) hide show
  1. package/README.md +250 -1124
  2. package/app/.next/BUILD_ID +1 -1
  3. package/app/.next/app-path-routes-manifest.json +9 -2
  4. package/app/.next/build-manifest.json +3 -3
  5. package/app/.next/prerender-manifest.json +3 -339
  6. package/app/.next/react-loadable-manifest.json +1 -8
  7. package/app/.next/routes-manifest.json +44 -0
  8. package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page.js +2 -0
  9. package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page.js.nft.json +1 -0
  10. package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page_client-reference-manifest.js +1 -0
  11. package/app/.next/server/app/(dashboard)/dashboard/admin/users/page.js +2 -0
  12. package/app/.next/server/app/(dashboard)/dashboard/admin/users/page.js.nft.json +1 -0
  13. package/app/.next/server/app/(dashboard)/dashboard/admin/users/page_client-reference-manifest.js +1 -0
  14. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  15. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  18. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  21. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  24. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  27. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  30. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  33. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  35. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page.js +3 -3
  36. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page.js.nft.json +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  39. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  41. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  42. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  43. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  44. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  45. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  46. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  47. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  48. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  49. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  50. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  51. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  52. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  53. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  54. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  55. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  57. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  58. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  59. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +2 -2
  60. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  61. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  62. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  63. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  64. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  65. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  66. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  67. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  68. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  69. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  70. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  71. package/app/.next/server/app/(dashboard)/dashboard/user/page.js +5 -0
  72. package/app/.next/server/app/(dashboard)/dashboard/user/page.js.nft.json +1 -0
  73. package/app/.next/server/app/(dashboard)/dashboard/user/page_client-reference-manifest.js +1 -0
  74. package/app/.next/server/app/_global-error/page.js +2 -2
  75. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  76. package/app/.next/server/app/_global-error.html +1 -1
  77. package/app/.next/server/app/_global-error.rsc +1 -1
  78. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  79. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  80. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  81. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  82. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  83. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  84. package/app/.next/server/app/_not-found/page.js +2 -2
  85. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  86. package/app/.next/server/app/_not-found.html +1 -1
  87. package/app/.next/server/app/_not-found.rsc +4 -4
  88. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  89. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  90. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  91. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  92. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  93. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  94. package/app/.next/server/app/api/auth/login/route.js +1 -1
  95. package/app/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  96. package/app/.next/server/app/api/auth/logout/route.js +1 -1
  97. package/app/.next/server/app/api/auth/me/route.js +1 -0
  98. package/app/.next/server/app/api/auth/me/route.js.nft.json +1 -0
  99. package/app/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -0
  100. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  101. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  102. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
  103. package/app/.next/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  104. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +3 -3
  105. package/app/.next/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  106. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  107. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
  108. package/app/.next/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  109. package/app/.next/server/app/api/cli-tools/hermes-settings/route.js +7 -7
  110. package/app/.next/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  111. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  112. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  113. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  114. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  115. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  116. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  117. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  118. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  119. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  120. package/app/.next/server/app/api/combos/route.js +1 -1
  121. package/app/.next/server/app/api/health/route.js +1 -1
  122. package/app/.next/server/app/api/init/route.js +1 -1
  123. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  124. package/app/.next/server/app/api/keys/[id]/route.js.nft.json +1 -1
  125. package/app/.next/server/app/api/keys/route.js +1 -1
  126. package/app/.next/server/app/api/keys/route.js.nft.json +1 -1
  127. package/app/.next/server/app/api/locale/route.js +1 -1
  128. package/app/.next/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  129. package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  130. package/app/.next/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  131. package/app/.next/server/app/api/media-providers/tts/voices/route.js +1 -1
  132. package/app/.next/server/app/api/models/alias/route.js +1 -1
  133. package/app/.next/server/app/api/models/availability/route.js +1 -1
  134. package/app/.next/server/app/api/models/custom/route.js +1 -1
  135. package/app/.next/server/app/api/models/route.js +1 -1
  136. package/app/.next/server/app/api/models/test/route.js +1 -1
  137. package/app/.next/server/app/api/models/test/route.js.nft.json +1 -1
  138. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  139. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  140. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  141. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  142. package/app/.next/server/app/api/oauth/gitlab/pat/route.js +1 -1
  143. package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
  144. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  145. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  146. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  147. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  148. package/app/.next/server/app/api/pricing/route.js +1 -1
  149. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  150. package/app/.next/server/app/api/provider-nodes/route.js +1 -1
  151. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  152. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  153. package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  154. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  155. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  156. package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
  157. package/app/.next/server/app/api/providers/client/route.js +1 -1
  158. package/app/.next/server/app/api/providers/client/route.js.nft.json +1 -1
  159. package/app/.next/server/app/api/providers/kilo/free-models/route.js +1 -1
  160. package/app/.next/server/app/api/providers/route.js +1 -1
  161. package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
  162. package/app/.next/server/app/api/providers/suggested-models/route.js +1 -1
  163. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  164. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  165. package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
  166. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  167. package/app/.next/server/app/api/proxy-pools/route.js +1 -1
  168. package/app/.next/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  169. package/app/.next/server/app/api/settings/database/route.js +1 -1
  170. package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
  171. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  172. package/app/.next/server/app/api/settings/route.js +1 -1
  173. package/app/.next/server/app/api/settings/route.js.nft.json +1 -1
  174. package/app/.next/server/app/api/shutdown/route.js +1 -1
  175. package/app/.next/server/app/api/tags/route.js +1 -1
  176. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  177. package/app/.next/server/app/api/translator/console-logs/stream/route.js +2 -2
  178. package/app/.next/server/app/api/translator/load/route.js +1 -1
  179. package/app/.next/server/app/api/translator/save/route.js +1 -1
  180. package/app/.next/server/app/api/translator/send/route.js +1 -1
  181. package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
  182. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  183. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  184. package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
  185. package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
  186. package/app/.next/server/app/api/tunnel/status/route.js +1 -1
  187. package/app/.next/server/app/api/tunnel/tailscale-check/route.js +2 -2
  188. package/app/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  189. package/app/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  190. package/app/.next/server/app/api/tunnel/tailscale-install/route.js +2 -2
  191. package/app/.next/server/app/api/tunnel/tailscale-login/route.js +3 -3
  192. package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route.js +2 -2
  193. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  194. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  195. package/app/.next/server/app/api/usage/api-keys/route.js +1 -0
  196. package/app/.next/server/app/api/usage/api-keys/route.js.nft.json +1 -0
  197. package/app/.next/server/app/api/usage/api-keys/route_client-reference-manifest.js +1 -0
  198. package/app/.next/server/app/api/usage/chart/route.js +1 -1
  199. package/app/.next/server/app/api/usage/chart/route.js.nft.json +1 -1
  200. package/app/.next/server/app/api/usage/history/route.js +1 -1
  201. package/app/.next/server/app/api/usage/history/route.js.nft.json +1 -1
  202. package/app/.next/server/app/api/usage/logs/route.js +1 -1
  203. package/app/.next/server/app/api/usage/logs/route.js.nft.json +1 -1
  204. package/app/.next/server/app/api/usage/providers/route.js +1 -1
  205. package/app/.next/server/app/api/usage/providers/route.js.nft.json +1 -1
  206. package/app/.next/server/app/api/usage/request-details/route.js +1 -1
  207. package/app/.next/server/app/api/usage/request-details/route.js.nft.json +1 -1
  208. package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
  209. package/app/.next/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  210. package/app/.next/server/app/api/usage/stats/route.js +1 -1
  211. package/app/.next/server/app/api/usage/stats/route.js.nft.json +1 -1
  212. package/app/.next/server/app/api/usage/stream/route.js +4 -4
  213. package/app/.next/server/app/api/usage/stream/route.js.nft.json +1 -1
  214. package/app/.next/server/app/api/users/[id]/route.js +1 -0
  215. package/app/.next/server/app/api/users/[id]/route.js.nft.json +1 -0
  216. package/app/.next/server/app/api/users/[id]/route_client-reference-manifest.js +1 -0
  217. package/app/.next/server/app/api/users/route.js +1 -0
  218. package/app/.next/server/app/api/users/route.js.nft.json +1 -0
  219. package/app/.next/server/app/api/users/route_client-reference-manifest.js +1 -0
  220. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  221. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  222. package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
  223. package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  224. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  225. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  226. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  227. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  228. package/app/.next/server/app/api/v1/images/generations/route.js +2 -2
  229. package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  230. package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
  231. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  232. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  233. package/app/.next/server/app/api/v1/models/route.js +1 -1
  234. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  235. package/app/.next/server/app/api/v1/responses/compact/route.js +1 -1
  236. package/app/.next/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  237. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  238. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  239. package/app/.next/server/app/api/v1/route.js +1 -1
  240. package/app/.next/server/app/api/v1/search/route.js +1 -1
  241. package/app/.next/server/app/api/v1/search/route.js.nft.json +1 -1
  242. package/app/.next/server/app/api/v1/web/fetch/route.js +1 -1
  243. package/app/.next/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  244. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  245. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  246. package/app/.next/server/app/api/v1beta/models/route.js +1 -1
  247. package/app/.next/server/app/api/version/route.js +1 -1
  248. package/app/.next/server/app/api/version/update/route.js +1 -1
  249. package/app/.next/server/app/callback/page.js +2 -2
  250. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  251. package/app/.next/server/app/callback.html +1 -1
  252. package/app/.next/server/app/callback.rsc +4 -4
  253. package/app/.next/server/app/callback.segments/_full.segment.rsc +4 -4
  254. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  255. package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
  256. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  257. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  258. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  259. package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
  260. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  261. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  262. package/app/.next/server/app/dashboard/settings/pricing.rsc +4 -4
  263. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  264. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  265. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  266. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  267. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  268. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  269. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  270. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  271. package/app/.next/server/app/favicon.ico/route.js +1 -1
  272. package/app/.next/server/app/index.html +1 -1
  273. package/app/.next/server/app/index.rsc +4 -4
  274. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  275. package/app/.next/server/app/index.segments/_full.segment.rsc +4 -4
  276. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  277. package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
  278. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  279. package/app/.next/server/app/landing/page.js +2 -2
  280. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  281. package/app/.next/server/app/landing.html +1 -1
  282. package/app/.next/server/app/landing.rsc +4 -4
  283. package/app/.next/server/app/landing.segments/_full.segment.rsc +4 -4
  284. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  285. package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
  286. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  287. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  288. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  289. package/app/.next/server/app/login/page.js +2 -2
  290. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  291. package/app/.next/server/app/login.html +1 -1
  292. package/app/.next/server/app/login.rsc +5 -5
  293. package/app/.next/server/app/login.segments/_full.segment.rsc +5 -5
  294. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  295. package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
  296. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  297. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  298. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  299. package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
  300. package/app/.next/server/app/page.js +2 -2
  301. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  302. package/app/.next/server/app-paths-manifest.json +9 -2
  303. package/app/.next/server/chunks/1256.js +1 -0
  304. package/app/.next/server/chunks/{1202.js → 1263.js} +2 -2
  305. package/app/.next/server/chunks/2417.js +1 -1
  306. package/app/.next/server/chunks/3913.js +2 -2
  307. package/app/.next/server/chunks/4013.js +1 -0
  308. package/app/.next/server/chunks/412.js +2 -2
  309. package/app/.next/server/chunks/4122.js +1 -1
  310. package/app/.next/server/chunks/4664.js +1 -0
  311. package/app/.next/server/chunks/4989.js +2 -2
  312. package/app/.next/server/chunks/5573.js +1 -1
  313. package/app/.next/server/chunks/5599.js +12 -12
  314. package/app/.next/server/chunks/6184.js +1 -0
  315. package/app/.next/server/chunks/7595.js +1 -1
  316. package/app/.next/server/chunks/{318.js → 7937.js} +2 -2
  317. package/app/.next/server/chunks/8590.js +1 -1
  318. package/app/.next/server/chunks/8895.js +2 -2
  319. package/app/.next/server/chunks/9489.js +1 -1
  320. package/app/.next/server/chunks/{1220.js → 9641.js} +2 -2
  321. package/app/.next/server/chunks/9718.js +1 -1
  322. package/app/.next/server/middleware-build-manifest.js +1 -1
  323. package/app/.next/server/middleware-react-loadable-manifest.js +1 -1
  324. package/app/.next/server/middleware.js +2 -2
  325. package/app/.next/server/pages/404.html +1 -1
  326. package/app/.next/server/pages/500.html +1 -1
  327. package/app/.next/server/server-reference-manifest.js +1 -1
  328. package/app/.next/server/server-reference-manifest.json +1 -1
  329. package/app/.next/static/chunks/{1321-4ac1e9664ca05f67.js → 1321-e040e8704e8038e6.js} +1 -1
  330. package/app/.next/static/chunks/5497-4da88480a15dec4c.js +7 -0
  331. package/app/.next/static/chunks/{5555-c4cf1b2b38d07337.js → 5555-91932fc7b159e521.js} +2 -2
  332. package/app/.next/static/chunks/698-64c9bb7a1ba1f521.js +23 -0
  333. package/app/.next/static/chunks/app/(dashboard)/dashboard/admin/keys/page-e7d9455fb9021069.js +1 -0
  334. package/app/.next/static/chunks/app/(dashboard)/dashboard/admin/users/page-c8e5a4b31bc18425.js +1 -0
  335. package/app/.next/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-ece69a38800356c3.js → page-a4b2b832a4892e6d.js} +1 -1
  336. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-4a745b1296f08667.js +1 -0
  337. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/{page-0d9325464cd6e849.js → page-842b00e6db9de7ae.js} +1 -1
  338. package/app/.next/static/chunks/app/(dashboard)/dashboard/console-log/page-fbdc1506f7259342.js +1 -0
  339. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/page-f8681cfb4c894f96.js +1 -0
  340. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-f0bbe6b3b1bfb85e.js +1 -0
  341. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-d6d08994d9d6d690.js +1 -0
  342. package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-b2443c6d810b0207.js +2 -0
  343. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-24023a32c248257e.js +1 -0
  344. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-48fc1f090d936818.js +1 -0
  345. package/app/.next/static/chunks/app/(dashboard)/dashboard/user/page-e9ab0043e9b15204.js +4 -0
  346. package/app/.next/static/chunks/app/(dashboard)/{layout-91efa9c70d2328e0.js → layout-d368218e0e87c124.js} +1 -1
  347. package/app/.next/static/chunks/app/_global-error/page-24023a32c248257e.js +1 -0
  348. package/app/.next/static/chunks/app/api/auth/login/route-24023a32c248257e.js +1 -0
  349. package/app/.next/static/chunks/app/api/auth/logout/route-24023a32c248257e.js +1 -0
  350. package/app/.next/static/chunks/app/api/auth/me/route-24023a32c248257e.js +1 -0
  351. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-24023a32c248257e.js +1 -0
  352. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-24023a32c248257e.js +1 -0
  353. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-24023a32c248257e.js +1 -0
  354. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-24023a32c248257e.js +1 -0
  355. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-24023a32c248257e.js +1 -0
  356. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-24023a32c248257e.js +1 -0
  357. package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-24023a32c248257e.js +1 -0
  358. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-24023a32c248257e.js +1 -0
  359. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-24023a32c248257e.js +1 -0
  360. package/app/.next/static/chunks/app/api/cloud/auth/route-24023a32c248257e.js +1 -0
  361. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-24023a32c248257e.js +1 -0
  362. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-24023a32c248257e.js +1 -0
  363. package/app/.next/static/chunks/app/api/cloud/models/alias/route-24023a32c248257e.js +1 -0
  364. package/app/.next/static/chunks/app/api/combos/[id]/route-24023a32c248257e.js +1 -0
  365. package/app/.next/static/chunks/app/api/combos/route-24023a32c248257e.js +1 -0
  366. package/app/.next/static/chunks/app/api/health/route-24023a32c248257e.js +1 -0
  367. package/app/.next/static/chunks/app/api/init/route-24023a32c248257e.js +1 -0
  368. package/app/.next/static/chunks/app/api/keys/[id]/route-24023a32c248257e.js +1 -0
  369. package/app/.next/static/chunks/app/api/keys/route-24023a32c248257e.js +1 -0
  370. package/app/.next/static/chunks/app/api/locale/route-24023a32c248257e.js +1 -0
  371. package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-24023a32c248257e.js +1 -0
  372. package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-24023a32c248257e.js +1 -0
  373. package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-24023a32c248257e.js +1 -0
  374. package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-24023a32c248257e.js +1 -0
  375. package/app/.next/static/chunks/app/api/models/alias/route-24023a32c248257e.js +1 -0
  376. package/app/.next/static/chunks/app/api/models/availability/route-24023a32c248257e.js +1 -0
  377. package/app/.next/static/chunks/app/api/models/custom/route-24023a32c248257e.js +1 -0
  378. package/app/.next/static/chunks/app/api/models/route-24023a32c248257e.js +1 -0
  379. package/app/.next/static/chunks/app/api/models/test/route-24023a32c248257e.js +1 -0
  380. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-24023a32c248257e.js +1 -0
  381. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-24023a32c248257e.js +1 -0
  382. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-24023a32c248257e.js +1 -0
  383. package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-24023a32c248257e.js +1 -0
  384. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-24023a32c248257e.js +1 -0
  385. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-24023a32c248257e.js +1 -0
  386. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-24023a32c248257e.js +1 -0
  387. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-24023a32c248257e.js +1 -0
  388. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-24023a32c248257e.js +1 -0
  389. package/app/.next/static/chunks/app/api/pricing/route-24023a32c248257e.js +1 -0
  390. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-24023a32c248257e.js +1 -0
  391. package/app/.next/static/chunks/app/api/provider-nodes/route-24023a32c248257e.js +1 -0
  392. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-24023a32c248257e.js +1 -0
  393. package/app/.next/static/chunks/app/api/providers/[id]/models/route-24023a32c248257e.js +1 -0
  394. package/app/.next/static/chunks/app/api/providers/[id]/route-24023a32c248257e.js +1 -0
  395. package/app/.next/static/chunks/app/api/providers/[id]/test/route-24023a32c248257e.js +1 -0
  396. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-24023a32c248257e.js +1 -0
  397. package/app/.next/static/chunks/app/api/providers/client/route-24023a32c248257e.js +1 -0
  398. package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-24023a32c248257e.js +1 -0
  399. package/app/.next/static/chunks/app/api/providers/route-24023a32c248257e.js +1 -0
  400. package/app/.next/static/chunks/app/api/providers/suggested-models/route-24023a32c248257e.js +1 -0
  401. package/app/.next/static/chunks/app/api/providers/test-batch/route-24023a32c248257e.js +1 -0
  402. package/app/.next/static/chunks/app/api/providers/validate/route-24023a32c248257e.js +1 -0
  403. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-24023a32c248257e.js +1 -0
  404. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-24023a32c248257e.js +1 -0
  405. package/app/.next/static/chunks/app/api/proxy-pools/route-24023a32c248257e.js +1 -0
  406. package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-24023a32c248257e.js +1 -0
  407. package/app/.next/static/chunks/app/api/settings/database/route-24023a32c248257e.js +1 -0
  408. package/app/.next/static/chunks/app/api/settings/proxy-test/route-24023a32c248257e.js +1 -0
  409. package/app/.next/static/chunks/app/api/settings/require-login/route-24023a32c248257e.js +1 -0
  410. package/app/.next/static/chunks/app/api/settings/route-24023a32c248257e.js +1 -0
  411. package/app/.next/static/chunks/app/api/shutdown/route-24023a32c248257e.js +1 -0
  412. package/app/.next/static/chunks/app/api/tags/route-24023a32c248257e.js +1 -0
  413. package/app/.next/static/chunks/app/api/translator/console-logs/route-24023a32c248257e.js +1 -0
  414. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-24023a32c248257e.js +1 -0
  415. package/app/.next/static/chunks/app/api/translator/load/route-24023a32c248257e.js +1 -0
  416. package/app/.next/static/chunks/app/api/translator/save/route-24023a32c248257e.js +1 -0
  417. package/app/.next/static/chunks/app/api/translator/send/route-24023a32c248257e.js +1 -0
  418. package/app/.next/static/chunks/app/api/translator/translate/route-24023a32c248257e.js +1 -0
  419. package/app/.next/static/chunks/app/api/tunnel/disable/route-24023a32c248257e.js +1 -0
  420. package/app/.next/static/chunks/app/api/tunnel/enable/route-24023a32c248257e.js +1 -0
  421. package/app/.next/static/chunks/app/api/tunnel/status/route-24023a32c248257e.js +1 -0
  422. package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-24023a32c248257e.js +1 -0
  423. package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-24023a32c248257e.js +1 -0
  424. package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-24023a32c248257e.js +1 -0
  425. package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-24023a32c248257e.js +1 -0
  426. package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-24023a32c248257e.js +1 -0
  427. package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-24023a32c248257e.js +1 -0
  428. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-24023a32c248257e.js +1 -0
  429. package/app/.next/static/chunks/app/api/usage/api-keys/route-24023a32c248257e.js +1 -0
  430. package/app/.next/static/chunks/app/api/usage/chart/route-24023a32c248257e.js +1 -0
  431. package/app/.next/static/chunks/app/api/usage/history/route-24023a32c248257e.js +1 -0
  432. package/app/.next/static/chunks/app/api/usage/logs/route-24023a32c248257e.js +1 -0
  433. package/app/.next/static/chunks/app/api/usage/providers/route-24023a32c248257e.js +1 -0
  434. package/app/.next/static/chunks/app/api/usage/request-details/route-24023a32c248257e.js +1 -0
  435. package/app/.next/static/chunks/app/api/usage/request-logs/route-24023a32c248257e.js +1 -0
  436. package/app/.next/static/chunks/app/api/usage/stats/route-24023a32c248257e.js +1 -0
  437. package/app/.next/static/chunks/app/api/usage/stream/route-24023a32c248257e.js +1 -0
  438. package/app/.next/static/chunks/app/api/users/[id]/route-24023a32c248257e.js +1 -0
  439. package/app/.next/static/chunks/app/api/users/route-24023a32c248257e.js +1 -0
  440. package/app/.next/static/chunks/app/api/v1/api/chat/route-24023a32c248257e.js +1 -0
  441. package/app/.next/static/chunks/app/api/v1/audio/speech/route-24023a32c248257e.js +1 -0
  442. package/app/.next/static/chunks/app/api/v1/chat/completions/route-24023a32c248257e.js +1 -0
  443. package/app/.next/static/chunks/app/api/v1/embeddings/route-24023a32c248257e.js +1 -0
  444. package/app/.next/static/chunks/app/api/v1/images/generations/route-24023a32c248257e.js +1 -0
  445. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-24023a32c248257e.js +1 -0
  446. package/app/.next/static/chunks/app/api/v1/messages/route-24023a32c248257e.js +1 -0
  447. package/app/.next/static/chunks/app/api/v1/models/route-24023a32c248257e.js +1 -0
  448. package/app/.next/static/chunks/app/api/v1/responses/compact/route-24023a32c248257e.js +1 -0
  449. package/app/.next/static/chunks/app/api/v1/responses/route-24023a32c248257e.js +1 -0
  450. package/app/.next/static/chunks/app/api/v1/route-24023a32c248257e.js +1 -0
  451. package/app/.next/static/chunks/app/api/v1/search/route-24023a32c248257e.js +1 -0
  452. package/app/.next/static/chunks/app/api/v1/web/fetch/route-24023a32c248257e.js +1 -0
  453. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-24023a32c248257e.js +1 -0
  454. package/app/.next/static/chunks/app/api/v1beta/models/route-24023a32c248257e.js +1 -0
  455. package/app/.next/static/chunks/app/api/version/route-24023a32c248257e.js +1 -0
  456. package/app/.next/static/chunks/app/api/version/update/route-24023a32c248257e.js +1 -0
  457. package/app/.next/static/chunks/app/login/page-f8fd97681568bf8f.js +1 -0
  458. package/app/.next/static/chunks/app/manifest.webmanifest/route-24023a32c248257e.js +1 -0
  459. package/app/.next/static/chunks/app/page-24023a32c248257e.js +1 -0
  460. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-24023a32c248257e.js +1 -0
  461. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-24023a32c248257e.js +1 -0
  462. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-24023a32c248257e.js +1 -0
  463. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-24023a32c248257e.js +1 -0
  464. package/app/.next/static/chunks/webpack-d1740476c6ab968a.js +1 -0
  465. package/app/.next/static/css/733bbed45c0f373c.css +1 -0
  466. package/app/.next/static/kSw7ik2y0Lphlofn8QbuF/_buildManifest.js +1 -0
  467. package/app/package.json +1 -1
  468. package/app/public/i18n/literals/ar.json +4 -4
  469. package/app/public/i18n/literals/bn.json +4 -4
  470. package/app/public/i18n/literals/cs.json +4 -4
  471. package/app/public/i18n/literals/da.json +4 -4
  472. package/app/public/i18n/literals/de.json +4 -4
  473. package/app/public/i18n/literals/el.json +4 -4
  474. package/app/public/i18n/literals/es.json +4 -4
  475. package/app/public/i18n/literals/fi.json +4 -4
  476. package/app/public/i18n/literals/fr.json +4 -4
  477. package/app/public/i18n/literals/he.json +4 -4
  478. package/app/public/i18n/literals/hi.json +4 -4
  479. package/app/public/i18n/literals/hu.json +4 -4
  480. package/app/public/i18n/literals/id.json +4 -4
  481. package/app/public/i18n/literals/it.json +4 -4
  482. package/app/public/i18n/literals/ja.json +4 -4
  483. package/app/public/i18n/literals/ko.json +4 -4
  484. package/app/public/i18n/literals/nl.json +4 -4
  485. package/app/public/i18n/literals/no.json +4 -4
  486. package/app/public/i18n/literals/pl.json +4 -4
  487. package/app/public/i18n/literals/pt-BR.json +4 -4
  488. package/app/public/i18n/literals/pt-PT.json +4 -4
  489. package/app/public/i18n/literals/ro.json +4 -4
  490. package/app/public/i18n/literals/ru.json +4 -4
  491. package/app/public/i18n/literals/sv.json +4 -4
  492. package/app/public/i18n/literals/th.json +4 -4
  493. package/app/public/i18n/literals/tl.json +4 -4
  494. package/app/public/i18n/literals/tr.json +4 -4
  495. package/app/public/i18n/literals/uk.json +4 -4
  496. package/app/public/i18n/literals/ur.json +4 -4
  497. package/app/public/i18n/literals/vi.json +4 -4
  498. package/app/public/i18n/literals/zh-CN.json +7 -7
  499. package/app/public/i18n/literals/zh-TW.json +4 -4
  500. package/app/src/shared/constants/mitmToolHosts.js +12 -0
  501. package/package.json +1 -1
  502. package/app/.next/server/app/dashboard/basic-chat.html +0 -1
  503. package/app/.next/server/app/dashboard/basic-chat.meta +0 -17
  504. package/app/.next/server/app/dashboard/basic-chat.rsc +0 -24
  505. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +0 -6
  506. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +0 -5
  507. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  508. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  509. package/app/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +0 -24
  510. package/app/.next/server/app/dashboard/basic-chat.segments/_head.segment.rsc +0 -6
  511. package/app/.next/server/app/dashboard/basic-chat.segments/_index.segment.rsc +0 -9
  512. package/app/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +0 -6
  513. package/app/.next/server/app/dashboard/cli-tools.html +0 -1
  514. package/app/.next/server/app/dashboard/cli-tools.meta +0 -17
  515. package/app/.next/server/app/dashboard/cli-tools.rsc +0 -25
  516. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +0 -6
  517. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +0 -5
  518. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  519. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  520. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +0 -25
  521. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +0 -6
  522. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +0 -9
  523. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +0 -6
  524. package/app/.next/server/app/dashboard/combos.html +0 -1
  525. package/app/.next/server/app/dashboard/combos.meta +0 -17
  526. package/app/.next/server/app/dashboard/combos.rsc +0 -27
  527. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +0 -9
  528. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +0 -5
  529. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  530. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  531. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +0 -27
  532. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +0 -6
  533. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +0 -9
  534. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +0 -6
  535. package/app/.next/server/app/dashboard/endpoint.html +0 -1
  536. package/app/.next/server/app/dashboard/endpoint.meta +0 -17
  537. package/app/.next/server/app/dashboard/endpoint.rsc +0 -25
  538. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +0 -6
  539. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +0 -5
  540. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  541. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  542. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +0 -25
  543. package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +0 -6
  544. package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +0 -9
  545. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +0 -6
  546. package/app/.next/server/app/dashboard/media-providers/web.html +0 -1
  547. package/app/.next/server/app/dashboard/media-providers/web.meta +0 -18
  548. package/app/.next/server/app/dashboard/media-providers/web.rsc +0 -27
  549. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +0 -9
  550. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +0 -5
  551. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +0 -5
  552. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  553. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  554. package/app/.next/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +0 -27
  555. package/app/.next/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +0 -6
  556. package/app/.next/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +0 -9
  557. package/app/.next/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +0 -6
  558. package/app/.next/server/app/dashboard/mitm.html +0 -1
  559. package/app/.next/server/app/dashboard/mitm.meta +0 -17
  560. package/app/.next/server/app/dashboard/mitm.rsc +0 -24
  561. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +0 -6
  562. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +0 -5
  563. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  564. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  565. package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +0 -24
  566. package/app/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +0 -6
  567. package/app/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +0 -9
  568. package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +0 -6
  569. package/app/.next/server/app/dashboard/profile.html +0 -1
  570. package/app/.next/server/app/dashboard/profile.meta +0 -17
  571. package/app/.next/server/app/dashboard/profile.rsc +0 -27
  572. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +0 -9
  573. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +0 -5
  574. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  575. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  576. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +0 -27
  577. package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +0 -6
  578. package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +0 -9
  579. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +0 -6
  580. package/app/.next/server/app/dashboard/providers/new.html +0 -1
  581. package/app/.next/server/app/dashboard/providers/new.meta +0 -18
  582. package/app/.next/server/app/dashboard/providers/new.rsc +0 -27
  583. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +0 -9
  584. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +0 -5
  585. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +0 -5
  586. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  587. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  588. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +0 -27
  589. package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +0 -6
  590. package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +0 -9
  591. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +0 -6
  592. package/app/.next/server/app/dashboard/providers.html +0 -1
  593. package/app/.next/server/app/dashboard/providers.meta +0 -17
  594. package/app/.next/server/app/dashboard/providers.rsc +0 -27
  595. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +0 -9
  596. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +0 -5
  597. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  598. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  599. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +0 -27
  600. package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +0 -6
  601. package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +0 -9
  602. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +0 -6
  603. package/app/.next/server/app/dashboard/proxy-pools.html +0 -1
  604. package/app/.next/server/app/dashboard/proxy-pools.meta +0 -17
  605. package/app/.next/server/app/dashboard/proxy-pools.rsc +0 -27
  606. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +0 -9
  607. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +0 -5
  608. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  609. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  610. package/app/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +0 -27
  611. package/app/.next/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +0 -6
  612. package/app/.next/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +0 -9
  613. package/app/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +0 -6
  614. package/app/.next/server/app/dashboard/quota.html +0 -2
  615. package/app/.next/server/app/dashboard/quota.meta +0 -17
  616. package/app/.next/server/app/dashboard/quota.rsc +0 -25
  617. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +0 -7
  618. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +0 -5
  619. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  620. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  621. package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +0 -25
  622. package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +0 -6
  623. package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +0 -9
  624. package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +0 -6
  625. package/app/.next/server/app/dashboard/translator.html +0 -1
  626. package/app/.next/server/app/dashboard/translator.meta +0 -17
  627. package/app/.next/server/app/dashboard/translator.rsc +0 -27
  628. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +0 -9
  629. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +0 -5
  630. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  631. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  632. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +0 -27
  633. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +0 -6
  634. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +0 -9
  635. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +0 -6
  636. package/app/.next/server/app/dashboard/usage.html +0 -1
  637. package/app/.next/server/app/dashboard/usage.meta +0 -17
  638. package/app/.next/server/app/dashboard/usage.rsc +0 -27
  639. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +0 -9
  640. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +0 -5
  641. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  642. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  643. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +0 -27
  644. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +0 -6
  645. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +0 -9
  646. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +0 -6
  647. package/app/.next/server/app/dashboard.html +0 -1
  648. package/app/.next/server/app/dashboard.meta +0 -16
  649. package/app/.next/server/app/dashboard.rsc +0 -25
  650. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +0 -6
  651. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  652. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -6
  653. package/app/.next/server/app/dashboard.segments/_full.segment.rsc +0 -25
  654. package/app/.next/server/app/dashboard.segments/_head.segment.rsc +0 -6
  655. package/app/.next/server/app/dashboard.segments/_index.segment.rsc +0 -9
  656. package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +0 -6
  657. package/app/.next/server/chunks/2020.js +0 -1
  658. package/app/.next/server/chunks/6114.js +0 -1
  659. package/app/.next/server/chunks/7924.js +0 -1
  660. package/app/.next/server/chunks/8491.js +0 -1
  661. package/app/.next/static/ahyS0wV6v2JdXWYSEruR6/_buildManifest.js +0 -1
  662. package/app/.next/static/chunks/5497-9056ce5497a8e830.js +0 -7
  663. package/app/.next/static/chunks/698-438ce154948ce831.js +0 -23
  664. package/app/.next/static/chunks/8202.1ffc6ce531e066ce.js +0 -1
  665. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-2f4bb06a89cb1e96.js +0 -1
  666. package/app/.next/static/chunks/app/(dashboard)/dashboard/console-log/page-d690c6133fec8d11.js +0 -1
  667. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/page-ed08f60a5fb7f3eb.js +0 -1
  668. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-478d456890cb93f8.js +0 -1
  669. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-9fb9fc4557dbea57.js +0 -1
  670. package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-4d43dabc1455a54b.js +0 -2
  671. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-4fc78ec3c912ea4c.js +0 -1
  672. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-6204a1c1bfe6aee1.js +0 -1
  673. package/app/.next/static/chunks/app/_global-error/page-a95908d3fe52339a.js +0 -1
  674. package/app/.next/static/chunks/app/api/auth/login/route-a95908d3fe52339a.js +0 -1
  675. package/app/.next/static/chunks/app/api/auth/logout/route-a95908d3fe52339a.js +0 -1
  676. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-a95908d3fe52339a.js +0 -1
  677. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-a95908d3fe52339a.js +0 -1
  678. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-a95908d3fe52339a.js +0 -1
  679. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-a95908d3fe52339a.js +0 -1
  680. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-a95908d3fe52339a.js +0 -1
  681. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-a95908d3fe52339a.js +0 -1
  682. package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-a95908d3fe52339a.js +0 -1
  683. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-a95908d3fe52339a.js +0 -1
  684. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-a95908d3fe52339a.js +0 -1
  685. package/app/.next/static/chunks/app/api/cloud/auth/route-a95908d3fe52339a.js +0 -1
  686. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-a95908d3fe52339a.js +0 -1
  687. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-a95908d3fe52339a.js +0 -1
  688. package/app/.next/static/chunks/app/api/cloud/models/alias/route-a95908d3fe52339a.js +0 -1
  689. package/app/.next/static/chunks/app/api/combos/[id]/route-a95908d3fe52339a.js +0 -1
  690. package/app/.next/static/chunks/app/api/combos/route-a95908d3fe52339a.js +0 -1
  691. package/app/.next/static/chunks/app/api/health/route-a95908d3fe52339a.js +0 -1
  692. package/app/.next/static/chunks/app/api/init/route-a95908d3fe52339a.js +0 -1
  693. package/app/.next/static/chunks/app/api/keys/[id]/route-a95908d3fe52339a.js +0 -1
  694. package/app/.next/static/chunks/app/api/keys/route-a95908d3fe52339a.js +0 -1
  695. package/app/.next/static/chunks/app/api/locale/route-a95908d3fe52339a.js +0 -1
  696. package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-a95908d3fe52339a.js +0 -1
  697. package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-a95908d3fe52339a.js +0 -1
  698. package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-a95908d3fe52339a.js +0 -1
  699. package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-a95908d3fe52339a.js +0 -1
  700. package/app/.next/static/chunks/app/api/models/alias/route-a95908d3fe52339a.js +0 -1
  701. package/app/.next/static/chunks/app/api/models/availability/route-a95908d3fe52339a.js +0 -1
  702. package/app/.next/static/chunks/app/api/models/custom/route-a95908d3fe52339a.js +0 -1
  703. package/app/.next/static/chunks/app/api/models/route-a95908d3fe52339a.js +0 -1
  704. package/app/.next/static/chunks/app/api/models/test/route-a95908d3fe52339a.js +0 -1
  705. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-a95908d3fe52339a.js +0 -1
  706. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-a95908d3fe52339a.js +0 -1
  707. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-a95908d3fe52339a.js +0 -1
  708. package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-a95908d3fe52339a.js +0 -1
  709. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-a95908d3fe52339a.js +0 -1
  710. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-a95908d3fe52339a.js +0 -1
  711. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-a95908d3fe52339a.js +0 -1
  712. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-a95908d3fe52339a.js +0 -1
  713. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-a95908d3fe52339a.js +0 -1
  714. package/app/.next/static/chunks/app/api/pricing/route-a95908d3fe52339a.js +0 -1
  715. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-a95908d3fe52339a.js +0 -1
  716. package/app/.next/static/chunks/app/api/provider-nodes/route-a95908d3fe52339a.js +0 -1
  717. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-a95908d3fe52339a.js +0 -1
  718. package/app/.next/static/chunks/app/api/providers/[id]/models/route-a95908d3fe52339a.js +0 -1
  719. package/app/.next/static/chunks/app/api/providers/[id]/route-a95908d3fe52339a.js +0 -1
  720. package/app/.next/static/chunks/app/api/providers/[id]/test/route-a95908d3fe52339a.js +0 -1
  721. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-a95908d3fe52339a.js +0 -1
  722. package/app/.next/static/chunks/app/api/providers/client/route-a95908d3fe52339a.js +0 -1
  723. package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-a95908d3fe52339a.js +0 -1
  724. package/app/.next/static/chunks/app/api/providers/route-a95908d3fe52339a.js +0 -1
  725. package/app/.next/static/chunks/app/api/providers/suggested-models/route-a95908d3fe52339a.js +0 -1
  726. package/app/.next/static/chunks/app/api/providers/test-batch/route-a95908d3fe52339a.js +0 -1
  727. package/app/.next/static/chunks/app/api/providers/validate/route-a95908d3fe52339a.js +0 -1
  728. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-a95908d3fe52339a.js +0 -1
  729. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-a95908d3fe52339a.js +0 -1
  730. package/app/.next/static/chunks/app/api/proxy-pools/route-a95908d3fe52339a.js +0 -1
  731. package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-a95908d3fe52339a.js +0 -1
  732. package/app/.next/static/chunks/app/api/settings/database/route-a95908d3fe52339a.js +0 -1
  733. package/app/.next/static/chunks/app/api/settings/proxy-test/route-a95908d3fe52339a.js +0 -1
  734. package/app/.next/static/chunks/app/api/settings/require-login/route-a95908d3fe52339a.js +0 -1
  735. package/app/.next/static/chunks/app/api/settings/route-a95908d3fe52339a.js +0 -1
  736. package/app/.next/static/chunks/app/api/shutdown/route-a95908d3fe52339a.js +0 -1
  737. package/app/.next/static/chunks/app/api/tags/route-a95908d3fe52339a.js +0 -1
  738. package/app/.next/static/chunks/app/api/translator/console-logs/route-a95908d3fe52339a.js +0 -1
  739. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-a95908d3fe52339a.js +0 -1
  740. package/app/.next/static/chunks/app/api/translator/load/route-a95908d3fe52339a.js +0 -1
  741. package/app/.next/static/chunks/app/api/translator/save/route-a95908d3fe52339a.js +0 -1
  742. package/app/.next/static/chunks/app/api/translator/send/route-a95908d3fe52339a.js +0 -1
  743. package/app/.next/static/chunks/app/api/translator/translate/route-a95908d3fe52339a.js +0 -1
  744. package/app/.next/static/chunks/app/api/tunnel/disable/route-a95908d3fe52339a.js +0 -1
  745. package/app/.next/static/chunks/app/api/tunnel/enable/route-a95908d3fe52339a.js +0 -1
  746. package/app/.next/static/chunks/app/api/tunnel/status/route-a95908d3fe52339a.js +0 -1
  747. package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-a95908d3fe52339a.js +0 -1
  748. package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-a95908d3fe52339a.js +0 -1
  749. package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-a95908d3fe52339a.js +0 -1
  750. package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-a95908d3fe52339a.js +0 -1
  751. package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-a95908d3fe52339a.js +0 -1
  752. package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-a95908d3fe52339a.js +0 -1
  753. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-a95908d3fe52339a.js +0 -1
  754. package/app/.next/static/chunks/app/api/usage/chart/route-a95908d3fe52339a.js +0 -1
  755. package/app/.next/static/chunks/app/api/usage/history/route-a95908d3fe52339a.js +0 -1
  756. package/app/.next/static/chunks/app/api/usage/logs/route-a95908d3fe52339a.js +0 -1
  757. package/app/.next/static/chunks/app/api/usage/providers/route-a95908d3fe52339a.js +0 -1
  758. package/app/.next/static/chunks/app/api/usage/request-details/route-a95908d3fe52339a.js +0 -1
  759. package/app/.next/static/chunks/app/api/usage/request-logs/route-a95908d3fe52339a.js +0 -1
  760. package/app/.next/static/chunks/app/api/usage/stats/route-a95908d3fe52339a.js +0 -1
  761. package/app/.next/static/chunks/app/api/usage/stream/route-a95908d3fe52339a.js +0 -1
  762. package/app/.next/static/chunks/app/api/v1/api/chat/route-a95908d3fe52339a.js +0 -1
  763. package/app/.next/static/chunks/app/api/v1/audio/speech/route-a95908d3fe52339a.js +0 -1
  764. package/app/.next/static/chunks/app/api/v1/chat/completions/route-a95908d3fe52339a.js +0 -1
  765. package/app/.next/static/chunks/app/api/v1/embeddings/route-a95908d3fe52339a.js +0 -1
  766. package/app/.next/static/chunks/app/api/v1/images/generations/route-a95908d3fe52339a.js +0 -1
  767. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-a95908d3fe52339a.js +0 -1
  768. package/app/.next/static/chunks/app/api/v1/messages/route-a95908d3fe52339a.js +0 -1
  769. package/app/.next/static/chunks/app/api/v1/models/route-a95908d3fe52339a.js +0 -1
  770. package/app/.next/static/chunks/app/api/v1/responses/compact/route-a95908d3fe52339a.js +0 -1
  771. package/app/.next/static/chunks/app/api/v1/responses/route-a95908d3fe52339a.js +0 -1
  772. package/app/.next/static/chunks/app/api/v1/route-a95908d3fe52339a.js +0 -1
  773. package/app/.next/static/chunks/app/api/v1/search/route-a95908d3fe52339a.js +0 -1
  774. package/app/.next/static/chunks/app/api/v1/web/fetch/route-a95908d3fe52339a.js +0 -1
  775. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-a95908d3fe52339a.js +0 -1
  776. package/app/.next/static/chunks/app/api/v1beta/models/route-a95908d3fe52339a.js +0 -1
  777. package/app/.next/static/chunks/app/api/version/route-a95908d3fe52339a.js +0 -1
  778. package/app/.next/static/chunks/app/api/version/update/route-a95908d3fe52339a.js +0 -1
  779. package/app/.next/static/chunks/app/login/page-4cbcd0b23f8d9304.js +0 -1
  780. package/app/.next/static/chunks/app/manifest.webmanifest/route-a95908d3fe52339a.js +0 -1
  781. package/app/.next/static/chunks/app/page-a95908d3fe52339a.js +0 -1
  782. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-a95908d3fe52339a.js +0 -1
  783. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-a95908d3fe52339a.js +0 -1
  784. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-a95908d3fe52339a.js +0 -1
  785. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-a95908d3fe52339a.js +0 -1
  786. package/app/.next/static/chunks/webpack-7fe9f68a976b08ff.js +0 -1
  787. package/app/.next/static/css/1ef6107a5d5fd71c.css +0 -1
  788. /package/app/.next/static/{ahyS0wV6v2JdXWYSEruR6 → kSw7ik2y0Lphlofn8QbuF}/_ssgManifest.js +0 -0
@@ -1,23 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[698],{3534:(e,t,s)=>{s.d(t,{dM:()=>a,wn:()=>l});let l={antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",mitmDomain:"daily-cloudcode-pa.googleapis.com",modelAliases:["claude-opus-4-6-thinking","claude-sonnet-4-6","gemini-3-flash","gpt-oss-120b-medium","gemini-3-pro-high","gemini-3-pro-low"],defaultModels:[{id:"gemini-3.1-pro-high",name:"Gemini 3.1 Pro High",alias:"gemini-3.1-pro-high"},{id:"gemini-3.1-pro-low",name:"Gemini 3.1 Pro Low",alias:"gemini-3.1-pro-low"},{id:"gemini-3-flash",name:"Gemini 3 Flash / Default",alias:"gemini-3-flash"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",alias:"claude-sonnet-4-6"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking",alias:"claude-opus-4-6-thinking"},{id:"gpt-oss-120b-medium",name:"GPT OSS 120B Medium",alias:"gpt-oss-120b-medium"}]},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot IDE with MITM",configType:"mitm",mitmDomain:"api.individual.githubcopilot.com",modelAliases:["gpt-4o-mini","claude-haiku-4.5","gpt-4o","gpt-5-mini"],defaultModels:[{id:"gpt-4o",name:"GPT-4o",alias:"gpt-4o"},{id:"gpt-4.1",name:"GPT-4.1",alias:"gpt-4.1"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"}]},kiro:{id:"kiro",name:"Kiro",image:"/providers/kiro.png",color:"#FF6B00",description:"Kiro IDE with MITM",configType:"mitm",mitmDomain:"q.us-east-1.amazonaws.com",defaultModels:[{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5",alias:"claude-sonnet-4.5"},{id:"claude-sonnet-4",name:"Claude Sonnet 4",alias:"claude-sonnet-4"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"},{id:"deepseek-3.2",name:"DeepSeek 3.2",alias:"deepseek-3.2"},{id:"minimax-m2.1",name:"MiniMax M2.1",alias:"minimax-m2.1"},{id:"simple-task",name:"Qwen3 Coder Next",alias:"simple-task"}]},openrouter:{id:"openrouter",name:"OpenRouter",image:"/providers/openrouter.png",color:"#8B5CF6",description:"OpenRouter with MITM",configType:"mitm",mitmDomain:"openrouter.ai",modelAliases:["openai/gpt-5.4","openai/gpt-5.5","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet-4.7"],defaultModels:[{id:"openai/gpt-5.4",name:"OpenAI: GPT-5.4",alias:"openai/gpt-5.4"},{id:"openai/gpt-5.5",name:"OpenAI: GPT-5.5",alias:"openai/gpt-5.5"},{id:"anthropic/claude-sonnet-4.6",name:"Anthropic: Claude-Sonnet-4.6",alias:"anthropic/claude-sonnet-4.6"},{id:"anthropic/claude-sonnet-4.7",name:"Anthropic: Claude Sonnet 4.7",alias:"anthropic/claude-sonnet-4.7"}]}},a={claude:{id:"claude",name:"Claude Code",icon:"terminal",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-4-6"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-6"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},codex:{id:"codex",name:"OpenAI Codex CLI",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom"},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresExternalUrl:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor routes requests through its own server, so local endpoint is not supported. Please enable Tunnel or Cloud Endpoint in Settings."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]},cline:{id:"cline",name:"Cline",image:"/providers/cline.png",color:"#00D1B2",description:"Cline AI Coding Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Cline Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → OpenAI Compatible"},{step:3,title:"Base URL",value:"{{baseUrl}}/v1",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Kilo Code Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → OpenAI Compatible"},{step:3,title:"Base URL",value:"{{baseUrl}}/v1",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},roo:{id:"roo",name:"Roo",image:"/providers/roo.png",color:"#FF6B6B",description:"Roo AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Roo Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → Ollama"},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},continue:{id:"continue",name:"Continue",image:"/providers/continue.png",color:"#7C3AED",description:"Continue AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Config",desc:"Open Continue configuration file"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Select Model",type:"modelSelector"},{step:4,title:"Add Model Config",desc:"Add the following configuration to your models array:"}],codeBlock:{language:"json",code:`{
2
- "apiBase": "{{baseUrl}}",
3
- "title": "{{model}}",
4
- "model": "{{model}}",
5
- "provider": "openai",
6
- "apiKey": "{{apiKey}}"
7
- }`}},hermes:{id:"hermes",name:"Hermes Agent",image:"/providers/hermes.png",color:"#8B5CF6",description:"Nous Research self-improving AI agent",configType:"custom"}}},40295:e=>{e.exports={TOOL_HOSTS:{antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]}}},82997:(e,t,s)=>{s.d(t,{Tk:()=>o,Ah:()=>d,a7:()=>g,ZM:()=>x,RF:()=>u,gY:()=>k,tA:()=>b,kn:()=>N,yZ:()=>m,qO:()=>f});var l=s(95155),a=s(12115),r=s(35497),i=s(5772);let n="https://9router.com";function o({tool:e,isExpanded:t,onToggle:s,activeProviders:d,modelMappings:c,onModelMappingChange:x,baseUrl:m,hasActiveProviders:p,apiKeys:u,cloudEnabled:h,initialStatus:g}){let f,y,b,[j,N]=(0,a.useState)(g||null),[v,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(!1),[S,_]=(0,a.useState)(!1),[A,E]=(0,a.useState)(null),[O,M]=(0,a.useState)(!1),[I,R]=(0,a.useState)(!1),[T,P]=(0,a.useState)(null),[$,K]=(0,a.useState)(""),[z,D]=(0,a.useState)({}),[L,U]=(0,a.useState)(!1),[F,H]=(0,a.useState)(""),[B,q]=(0,a.useState)(!1),W=(0,a.useRef)(!1),G=(()=>{if(!j?.installed)return null;let e=j.settings?.env?.ANTHROPIC_BASE_URL;if(!e)return"not_configured";let t=e.includes("localhost")||e.includes("127.0.0.1"),s=h&&n&&e.startsWith(n),l=m&&e.startsWith(m);return t||s||l?"configured":"other"})();(0,a.useEffect)(()=>{u?.length>0&&!$&&K(u[0].key)},[u,$]),(0,a.useEffect)(()=>{g&&N(g)},[g]),(0,a.useEffect)(()=>{t&&!j&&(Y(),Z()),t&&Z()},[t]),(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{q(!!e.ccFilterNaming)}).catch(()=>{})},[]);let J=async e=>{let t=e.target.checked;q(t),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:t})}).catch(()=>{})},Z=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&D(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(j?.installed&&!W.current){W.current=!0;let t=j.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let s=t[e.envKey]||e.defaultValue||"";s&&x(e.alias,s)}});let s=t.ANTHROPIC_AUTH_TOKEN;s&&u?.some(e=>e.key===s)&&K(s)}},[j,u,e.defaultModels,x]);let Y=async()=>{w(!0);try{let e=await fetch("/api/cli-tools/claude-settings"),t=await e.json();N(t)}catch(e){N({installed:!1,error:e.message})}finally{w(!1)}},V=()=>{let e=F||m;return e.endsWith("/v1")?e:`${e}/v1`},Q=async()=>{C(!0),E(null);try{let t={ANTHROPIC_BASE_URL:V()},s=$?.trim()||(u?.length>0?u[0].key:null)||(h?null:"sk_9router");s&&(t.ANTHROPIC_AUTH_TOKEN=s),e.defaultModels.forEach(e=>{let s=c[e.alias];s&&e.envKey&&(t[e.envKey]=s)});let l=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t})}),a=await l.json();l.ok?(E({type:"success",text:"Settings applied successfully!"}),N(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:t}}))):E({type:"error",text:a.error||"Failed to apply settings"})}catch(e){E({type:"error",text:e.message})}finally{C(!1)}},X=async()=>{_(!0),E(null);try{let t=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),s=await t.json();t.ok?(E({type:"success",text:"Settings reset successfully!"}),e.defaultModels.forEach(e=>x(e.alias,e.defaultValue||"")),K("")):E({type:"error",text:s.error||"Failed to reset settings"})}catch(e){E({type:"error",text:e.message})}finally{_(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.default,{src:"/providers/claude.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===G&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===G&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===G&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[v&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Claude CLI..."})]}),!v&&j&&!j.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>U(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>M(!O),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:O?"expand_less":"help"}),O?"Hide":"How to Install"]})]})]}),O&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!v&&j?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[j?.settings?.env?.ANTHROPIC_BASE_URL&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:j.settings.env.ANTHROPIC_BASE_URL})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:(f=F||m).endsWith("/v1")?f:`${f}/v1`,onChange:e=>H(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),F&&F!==m&&(0,l.jsx)("button",{onClick:()=>H(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),u.length>0?(0,l.jsx)("select",{value:$,onChange:e=>K(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:u.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:h?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),e.defaultModels.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:c[e.alias]||"",onChange:t=>x(e.alias,t.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>{P(e.alias),R(!0)},disabled:!p,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${p?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),c[e.alias]&&(0,l.jsx)("button",{onClick:()=>x(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias)),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Filter naming"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)("input",{type:"checkbox",checked:B,onChange:J,className:"w-3.5 h-3.5 accent-primary cursor-pointer"}),(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"Filter naming requests"})]}),(0,l.jsx)(r.m_,{text:"Intercepts Claude Code's topic-naming requests and returns a fake response locally, saving API tokens.",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] cursor-help",children:"info"})})]})]}),A&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,l.jsx)("span",{children:A.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:Q,disabled:!p,loading:k,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:X,disabled:!j?.has9Router,loading:S,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>U(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:I,onClose:()=>R(!1),onSelect:e=>{T&&x(T,e.value)},selectedModel:T?c[T]:null,activeProviders:d,modelAliases:z,title:`Select model for ${T}`}),(0,l.jsx)(r.uR,{isOpen:L,onClose:()=>U(!1),title:"Claude CLI - Manual Configuration",configs:(y=$&&$.trim()?$:h?"<API_KEY_FROM_DASHBOARD>":"sk_9router",b={ANTHROPIC_BASE_URL:V(),ANTHROPIC_AUTH_TOKEN:y},e.defaultModels.forEach(e=>{let t=c[e.alias];t&&e.envKey&&(b[e.envKey]=t)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:b},null,2)}])})]})}function d({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:c,cloudEnabled:x,initialStatus:m}){let p,u,h,g,[f,y]=(0,a.useState)(m||null),[b,j]=(0,a.useState)(!1),[N,v]=(0,a.useState)(!1),[w,k]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),[_,A]=(0,a.useState)(!1),[E,O]=(0,a.useState)(""),[M,I]=(0,a.useState)(""),[R,T]=(0,a.useState)(""),[P,$]=(0,a.useState)(!1),[K,z]=(0,a.useState)(!1),[D,L]=(0,a.useState)({}),[U,F]=(0,a.useState)(!1),[H,B]=(0,a.useState)("");(0,a.useEffect)(()=>{o?.length>0&&!E&&O(o[0].key)},[o,E]),(0,a.useEffect)(()=>{m&&y(m)},[m]),(0,a.useEffect)(()=>{t&&!f&&(J(),q()),t&&q()},[t]);let q=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&L(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(f?.config){let e=f.config.match(/^model\s*=\s*"([^"]+)"/m);e&&I(e[1]);let t=f.config.match(/\[agents\.subagent\]\s*\n\s*model\s*=\s*"([^"]+)"/m);t&&T(t[1])}},[f]);let W=f?.installed?f.config?f.config.includes(n)||f.config.includes("localhost")||f.config.includes("127.0.0.1")?"configured":"other":"not_configured":null,G=()=>{let e=H||`${n}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},J=async()=>{j(!0);try{let e=await fetch("/api/cli-tools/codex-settings"),t=await e.json();y(t)}catch(e){y({installed:!1,error:e.message})}finally{j(!1)}},Z=async()=>{v(!0),S(null);try{let e=E&&E.trim()||x?E:"sk_9router",t=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:G(),apiKey:e,model:M,subagentModel:R||M})}),s=await t.json();t.ok?(S({type:"success",text:"Settings applied successfully!"}),J()):S({type:"error",text:s.error||"Failed to apply settings"})}catch(e){S({type:"error",text:e.message})}finally{v(!1)}},Y=async()=>{k(!0),S(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),t=await e.json();e.ok?(S({type:"success",text:"Settings reset successfully!"}),I(""),T(""),J()):S({type:"error",text:t.error||"Failed to reset settings"})}catch(e){S({type:"error",text:e.message})}finally{k(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.default,{src:"/providers/codex.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===W&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===W&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===W&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[b&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Codex CLI..."})]}),!b&&f&&!f.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Codex CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>F(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>A(!_),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:_?"expand_less":"help"}),_?"Hide":"How to Install"]})]})]}),_&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,l.jsx)("div",{className:"pt-2 border-t border-border",children:(0,l.jsxs)("p",{className:"text-text-muted text-xs",children:["Codex uses ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/auth.json"})," with ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"OPENAI_API_KEY"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!b&&f?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[f?.config&&((u=(p=f.config.match(/base_url\s*=\s*"([^"]+)"/))?p[1]:null)?(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:u})]}):null),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:H||`${n}/v1`,onChange:e=>B(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),H&&H!==`${n}/v1`&&(0,l.jsx)("button",{onClick:()=>B(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),o.length>0?(0,l.jsx)("select",{value:E,onChange:e=>O(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:M,onChange:e=>I(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>$(!0),disabled:!c?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${c?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),M&&(0,l.jsx)("button",{onClick:()=>I(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Subagent Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:R,onChange:e=>T(e.target.value),placeholder:M||"provider/model-id (defaults to main model)",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>z(!0),disabled:!c?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${c?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),R&&(0,l.jsx)("button",{onClick:()=>T(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),C&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===C.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===C.type?"check_circle":"error"}),(0,l.jsx)("span",{children:C.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:Z,disabled:!E&&x&&o.length>0||!M,loading:N,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:Y,disabled:w,loading:w,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>F(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:P,onClose:()=>$(!1),onSelect:e=>{I(e.value),R||T(e.value),$(!1)},selectedModel:M,activeProviders:c,modelAliases:D,title:"Select Model for Codex"}),(0,l.jsx)(r.rq,{isOpen:K,onClose:()=>z(!1),onSelect:e=>{T(e.value),z(!1)},selectedModel:R,activeProviders:c,modelAliases:D,title:"Select Subagent Model for Codex"}),(0,l.jsx)(r.uR,{isOpen:U,onClose:()=>F(!1),title:"Codex CLI - Manual Configuration",configs:(h=E&&E.trim()?E:x?"<API_KEY_FROM_DASHBOARD>":"sk_9router",g=R||M,[{filename:"~/.codex/config.toml",content:`# 9Router Configuration for Codex CLI
8
- model = "${M}"
9
- model_provider = "9router"
10
-
11
- [model_providers.9router]
12
- name = "9Router"
13
- base_url = "${G()}"
14
- wire_api = "responses"
15
-
16
- [agents.subagent]
17
- model = "${g}"
18
- `},{filename:"~/.codex/auth.json",content:JSON.stringify({auth_mode:"apikey",OPENAI_API_KEY:h},null,2)}])})]})}let c="https://9router.com";function x({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:o,apiKeys:d,activeProviders:m,cloudEnabled:p,initialStatus:u}){let h,g,f,y,[b,j]=(0,a.useState)(u||null),[N,v]=(0,a.useState)(!1),[w,k]=(0,a.useState)(!1),[C,S]=(0,a.useState)(!1),[_,A]=(0,a.useState)(null),[E,O]=(0,a.useState)(""),[M,I]=(0,a.useState)([]),[R,T]=(0,a.useState)(""),[P,$]=(0,a.useState)(!1),[K,z]=(0,a.useState)({}),[D,L]=(0,a.useState)(!1),[U,F]=(0,a.useState)(!1),[H,B]=(0,a.useState)(""),q=(0,a.useRef)(!1),W=(()=>{if(!b?.installed)return null;let e=b.settings?.customModels?.find(e=>e.id?.startsWith("custom:9Router"));if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=p&&c&&e.baseUrl?.startsWith(c),l=n&&e.baseUrl?.startsWith(n);return t||s||l?"configured":"other"})();(0,a.useEffect)(()=>{d?.length>0&&!E&&O(d[0].key)},[d,E]),(0,a.useEffect)(()=>{u&&j(u)},[u]),(0,a.useEffect)(()=>{t&&!b&&(J(),G()),t&&G()},[t]);let G=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&z(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(b?.installed&&!q.current){q.current=!0;let e=(b.settings?.customModels||[]).filter(e=>e.id?.startsWith("custom:9Router")).sort((e,t)=>(e.index||0)-(t.index||0)).map(e=>e.model);if(e.length>0)I(e);else{let e=b.settings?.customModels?.find(e=>"custom:9Router-0"===e.id);e?.model&&I([e.model])}}},[b]);let J=async()=>{v(!0);try{let e=await fetch("/api/cli-tools/droid-settings"),t=await e.json();j(t)}catch(e){j({installed:!1,error:e.message})}finally{v(!1)}},Z=()=>{let e=H||n;return e.endsWith("/v1")?e:`${e}/v1`},Y=()=>{let e=R.trim();!e||M.includes(e)||(I(t=>[...t,e]),T(""))},V=async()=>{k(!0),A(null);try{let e=E?.trim()||(d?.length>0?d[0].key:null)||(p?null:"sk_9router"),t=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:Z(),apiKey:e,models:M,activeModel:M[0]||""})}),s=await t.json();t.ok?(A({type:"success",text:"Settings applied successfully!"}),J()):A({type:"error",text:s.error||"Failed to apply settings"})}catch(e){A({type:"error",text:e.message})}finally{k(!1)}},Q=async()=>{S(!0),A(null);try{let e=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),t=await e.json();e.ok?(A({type:"success",text:"Settings reset successfully!"}),I([]),J()):A({type:"error",text:t.error||"Failed to reset settings"})}catch(e){A({type:"error",text:e.message})}finally{S(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.default,{src:"/providers/droid.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===W&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===W&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===W&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[N&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Factory Droid CLI..."})]}),!N&&b&&!b.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Factory Droid CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>L(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>F(!U),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:U?"expand_less":"help"}),U?"Hide":"How to Install"]})]})]}),U&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"curl -fsSL https://app.factory.ai/cli | sh"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"droid"})," to verify."]})]})]})]}),!N&&b?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[b?.settings?.customModels?.find(e=>e.id?.startsWith("custom:9Router"))?.baseUrl&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:b.settings.customModels.find(e=>e.id?.startsWith("custom:9Router")).baseUrl})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:(h=H||n).endsWith("/v1")?h:`${h}/v1`,onChange:e=>B(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),H&&H!==n&&(0,l.jsx)("button",{onClick:()=>B(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,l.jsx)("select",{value:E,onChange:e=>O(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:p?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:["Models ",M.length>0&&(0,l.jsxs)("span",{className:"text-primary",children:["(",M.length,")"]})]}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"flex-1 flex flex-col gap-1",children:[M.length>0&&(0,l.jsx)("div",{className:"flex flex-col gap-0.5 mb-1",children:M.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-bg-secondary rounded border border-border",children:[(0,l.jsx)("span",{className:"flex-1 text-xs font-mono truncate",children:e}),(0,l.jsx)("button",{onClick:()=>I(t=>t.filter(t=>t!==e)),className:"text-text-muted hover:text-red-500 transition-colors shrink-0",title:"Remove",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e))}),(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)("input",{type:"text",value:R,onChange:e=>T(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),Y())},placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>$(!0),disabled:!o,className:`px-2 py-1.5 rounded border text-xs shrink-0 ${o?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),(0,l.jsx)("button",{onClick:Y,disabled:!R.trim(),className:"px-2 py-1.5 rounded border bg-surface border-border hover:border-primary text-xs shrink-0 disabled:opacity-50",title:"Add model",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"add"})})]})]})]})]}),_&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===_.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===_.type?"check_circle":"error"}),(0,l.jsx)("span",{children:_.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:V,disabled:0===M.length,loading:w,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:Q,disabled:!b?.has9Router,loading:C,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>L(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:P,onClose:()=>$(!1),onSelect:e=>{!e.value||M.includes(e.value)||(I(t=>[...t,e.value]),$(!1))},selectedModel:null,activeProviders:m,modelAliases:K,title:"Select Model for Factory Droid"}),(0,l.jsx)(r.uR,{isOpen:D,onClose:()=>L(!1),title:"Factory Droid - Manual Configuration",configs:(g=E&&E.trim()?E:p?"<API_KEY_FROM_DASHBOARD>":"sk_9router",f={customModels:M.map((e,t)=>({model:e,id:`custom:9Router-${t}`,index:t,baseUrl:Z(),apiKey:g,displayName:e,maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}))},y="u">typeof navigator&&navigator.platform,[{filename:y?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(f,null,2)}])})]})}function m({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:o,apiKeys:d,activeProviders:c,cloudEnabled:x,initialStatus:p}){let u,h,[g,f]=(0,a.useState)(p||null),[y,b]=(0,a.useState)(!1),[j,N]=(0,a.useState)(!1),[v,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(null),[S,_]=(0,a.useState)(""),[A,E]=(0,a.useState)(""),[O,M]=(0,a.useState)({}),[I,R]=(0,a.useState)(null),[T,P]=(0,a.useState)(!1),[$,K]=(0,a.useState)({}),[z,D]=(0,a.useState)(!1),[L,U]=(0,a.useState)(""),F=(0,a.useRef)(!1),H=(()=>{if(!g?.installed)return null;let e=g.settings?.models?.providers?.["9router"];if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1")||e.baseUrl?.includes("0.0.0.0"),s=n&&e.baseUrl?.startsWith(n);return t||s?"configured":"other"})();(0,a.useEffect)(()=>{d?.length>0&&!S&&_(d[0].key)},[d,S]),(0,a.useEffect)(()=>{p&&f(p)},[p]),(0,a.useEffect)(()=>{t&&!g&&(q(),B()),t&&B()},[t]);let B=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&K(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(g?.installed&&!F.current){F.current=!0;let e=g.settings?.models?.providers?.["9router"];if(e){let t=g.settings?.agents?.defaults?.model?.primary;t&&E(t.replace("9router/","")),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&_(e.apiKey)}let t=g.agents||[],s={};t.forEach(e=>{e.currentModel&&(s[e.id]=e.currentModel)}),M(s)}},[g,d]);let q=async()=>{b(!0);try{let e=await fetch("/api/cli-tools/openclaw-settings"),t=await e.json();f(t)}catch(e){f({installed:!1,error:e.message})}finally{b(!1)}},W=()=>window.location.origin.replace("://localhost","://127.0.0.1"),G=()=>{let e=L||W();return e.endsWith("/v1")?e:`${e}/v1`},J=async()=>{N(!0),C(null);try{let e=S?.trim()||(d?.length>0?d[0].key:null)||(x?null:"sk_9router"),t=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:G(),apiKey:e,model:A,agentModels:O})}),s=await t.json();t.ok?(C({type:"success",text:"Settings applied successfully!"}),q()):C({type:"error",text:s.error||"Failed to apply settings"})}catch(e){C({type:"error",text:e.message})}finally{N(!1)}},Z=async()=>{w(!0),C(null);try{let e=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),t=await e.json();e.ok?(C({type:"success",text:"Settings reset successfully!"}),E(""),_(""),q()):C({type:"error",text:t.error||"Failed to reset settings"})}catch(e){C({type:"error",text:e.message})}finally{w(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.default,{src:"/providers/openclaw.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===H&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===H&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===H&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[y&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Open Claw CLI..."})]}),!y&&g&&!g.installed&&(0,l.jsx)("div",{className:"flex flex-col gap-4",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Open Claw CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,l.jsx)("div",{className:"flex items-center gap-2 pl-9",children:(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>D(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]})}),!y&&g?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[g?.settings?.models?.providers?.["9router"]?.baseUrl&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:g.settings.models.providers["9router"].baseUrl})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:(u=L||W()).endsWith("/v1")?u:`${u}/v1`,onChange:e=>U(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),L&&L!==n&&(0,l.jsx)("button",{onClick:()=>U(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,l.jsx)("select",{value:S,onChange:e=>_(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Default Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:A,onChange:e=>E(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>{R(null),P(!0)},disabled:!o,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${o?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),A&&(0,l.jsx)("button",{onClick:()=>E(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(g.agents||[]).filter(e=>e.agentDir).map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-4",children:[(0,l.jsxs)("span",{className:"w-32 shrink-0 text-xs text-primary text-right truncate",title:e.name||e.id,children:["Agent ",e.name||e.id]}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:O[e.id]||"",onChange:t=>M(s=>({...s,[e.id]:t.target.value})),placeholder:`default (${A||"provider/model-id"})`,className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>{R(e.id),P(!0)},disabled:!o,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${o?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),O[e.id]&&(0,l.jsx)("button",{onClick:()=>M(t=>({...t,[e.id]:""})),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.id))]}),k&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===k.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===k.type?"check_circle":"error"}),(0,l.jsx)("span",{children:k.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:J,disabled:!A,loading:j,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:Z,disabled:!g?.has9Router,loading:v,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>D(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:T,onClose:()=>P(!1),onSelect:e=>{I?(M(t=>({...t,[I]:e.value})),R(null)):E(e.value),P(!1)},selectedModel:A,activeProviders:c,modelAliases:$,title:"Select Model for Open Claw"}),(0,l.jsx)(r.uR,{isOpen:z,onClose:()=>D(!1),title:"Open Claw - Manual Configuration",configs:(h=S&&S.trim()?S:x?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`9router/${A||"provider/model-id"}`}}},models:{providers:{"9router":{baseUrl:G(),apiKey:h,api:"openai-completions",models:[{id:A||"provider/model-id",name:(A||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}let p="/api/cli-tools/hermes-settings";function u({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:o,apiKeys:d,activeProviders:c,cloudEnabled:x,initialStatus:m}){let h,[g,f]=(0,a.useState)(m||null),[y,b]=(0,a.useState)(!1),[j,N]=(0,a.useState)(!1),[v,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(null),[S,_]=(0,a.useState)(""),[A,E]=(0,a.useState)(""),[O,M]=(0,a.useState)(!1),[I,R]=(0,a.useState)({}),[T,P]=(0,a.useState)(!1),[$,K]=(0,a.useState)(""),z=(0,a.useRef)(!1),D=(()=>{if(!g?.installed)return null;let e=g.settings?.model;if(!e?.base_url)return"not_configured";let t=/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(e.base_url),s=n&&e.base_url.startsWith(n);return t||s?"configured":"other"})();(0,a.useEffect)(()=>{d?.length>0&&!S&&_(d[0].key)},[d,S]),(0,a.useEffect)(()=>{m&&f(m)},[m]),(0,a.useEffect)(()=>{t&&!g&&(U(),L()),t&&L()},[t]);let L=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&R(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(g?.installed&&!z.current){z.current=!0;let e=g.settings?.model;e?.default&&E(e.default)}},[g]);let U=async()=>{b(!0);try{let e=await fetch(p),t=await e.json();f(t)}catch(e){f({installed:!1,error:e.message})}finally{b(!1)}},F=()=>{let e=$||window.location.origin.replace("://localhost","://127.0.0.1");return e.endsWith("/v1")?e:`${e}/v1`},H=async()=>{N(!0),C(null);try{let e=S?.trim()||(d?.length>0?d[0].key:null)||(x?null:"sk_9router"),t=await fetch(p,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:F(),apiKey:e,model:A})}),s=await t.json();t.ok?(C({type:"success",text:"Settings applied successfully!"}),U()):C({type:"error",text:s.error||"Failed to apply settings"})}catch(e){C({type:"error",text:e.message})}finally{N(!1)}},B=async()=>{w(!0),C(null);try{let e=await fetch(p,{method:"DELETE"}),t=await e.json();e.ok?(C({type:"success",text:"Settings reset successfully!"}),E(""),U()):C({type:"error",text:t.error||"Failed to reset settings"})}catch(e){C({type:"error",text:e.message})}finally{w(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.default,{src:"/providers/hermes.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===D&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===D&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===D&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[y&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Hermes Agent..."})]}),!y&&g&&!g.installed&&(0,l.jsx)("div",{className:"flex flex-col gap-4",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Hermes Agent not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Install: curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash"})]})]}),(0,l.jsx)("div",{className:"flex items-center gap-2 pl-9",children:(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>P(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]})}),!y&&g?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[g?.settings?.model?.base_url&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:g.settings.model.base_url})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:F(),onChange:e=>K(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),$&&$!==n&&(0,l.jsx)("button",{onClick:()=>K(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,l.jsx)("select",{value:S,onChange:e=>_(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Default Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:A,onChange:e=>E(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>M(!0),disabled:!o,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${o?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),A&&(0,l.jsx)("button",{onClick:()=>E(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),k&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===k.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===k.type?"check_circle":"error"}),(0,l.jsx)("span",{children:k.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:H,disabled:!A,loading:j,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:B,disabled:!g?.has9Router,loading:v,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>P(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:O,onClose:()=>M(!1),onSelect:e=>{E(e.value),M(!1)},selectedModel:A,activeProviders:c,modelAliases:I,title:"Select Model for Hermes Agent"}),(0,l.jsx)(r.uR,{isOpen:T,onClose:()=>P(!1),title:"Hermes Agent - Manual Configuration",configs:(h=S&&S.trim()?S:x?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.hermes/config.yaml",content:`model:
19
- default: "${A||"provider/model-id"}"
20
- provider: "custom"
21
- base_url: "${F()}"
22
- `},{filename:"~/.hermes/.env",content:`OPENAI_API_KEY=${h}
23
- `}])})]})}var h=s(11059);function g({toolId:e,tool:t,isExpanded:s,onToggle:n,baseUrl:o,apiKeys:d,activeProviders:c=[],cloudEnabled:x=!1,tunnelEnabled:m=!1}){let[p,u]=(0,a.useState)(null),[f,y]=(0,a.useState)(!1),[b,j]=(0,a.useState)(""),[N,v]=(0,a.useState)(()=>d?.length>0?d[0].key:""),w=e=>{let t=N&&N.trim()?N:x?"your-api-key":"sk_9router",s=o||"http://localhost:20128",l=s.endsWith("/v1")?s:`${s}/v1`;return e.replace(/\{\{baseUrl\}\}/g,l).replace(/\{\{apiKey\}\}/g,t).replace(/\{\{model\}\}/g,b||"provider/model-id")},{copy:k}=(0,h.C)(),C=async(e,t)=>{await k(w(e),`toolcard-${t}`),u(t),setTimeout(()=>u(null),2e3)},S=c.length>0,_=()=>(!t.requiresExternalUrl||!!x||!!m)&&(!t.requiresCloud||!!x);return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:n,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:t.image?(0,l.jsx)(i.default,{src:t.image,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):t.icon?(0,l.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:t.color},children:t.icon}):(0,l.jsx)(i.default,{src:`/providers/${e}.png`,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:t.name}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:t.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${s?"rotate-180":""}`,children:"expand_more"})]}),s&&(0,l.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:t.guideSteps?(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[t.notes&&0!==t.notes.length?(0,l.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:t.notes.map((e,t)=>{if("cloudCheck"===e.type&&(x||m))return null;let s="warning"===e.type,a="cloudCheck"===e.type&&!x&&!m,r="bg-blue-500/10 border-blue-500/30",i="text-blue-600 dark:text-blue-400",n="text-blue-500",o="info";return s?(r="bg-yellow-500/10 border-yellow-500/30",i="text-yellow-600 dark:text-yellow-400",n="text-yellow-500",o="warning"):a&&(r="bg-red-500/10 border-red-500/30",i="text-red-600 dark:text-red-400",n="text-red-500",o="error"),(0,l.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${r}`,children:[(0,l.jsx)("span",{className:`material-symbols-outlined text-lg ${n}`,children:o}),(0,l.jsx)("p",{className:`text-sm ${i}`,children:e.text})]},t)})}):null,_()&&t.guideSteps.map(e=>(0,l.jsxs)("div",{className:"flex items-start gap-4",children:[(0,l.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:t.color},children:e.step}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("p",{className:"font-medium text-text",children:e.title}),e.desc&&(0,l.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:e.desc}),"apiKeySelector"===e.type&&(0,l.jsx)("div",{className:"mt-2 flex items-center gap-2",children:d&&d.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("select",{value:N,onChange:e=>v(e.target.value),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}),(0,l.jsx)("button",{onClick:()=>C(N,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===p?"check":"content_copy"})})]}):(0,l.jsx)("span",{className:"text-sm text-text-muted",children:x?"No API keys - Create one in Keys page":"sk_9router"})}),"modelSelector"===e.type&&(0,l.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,l.jsx)("input",{type:"text",value:b,onChange:e=>j(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>y(!0),disabled:!S,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${S?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),b&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{onClick:()=>C(b,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===p?"check":"content_copy"})}),(0,l.jsx)("button",{onClick:()=>j(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),e.value&&(0,l.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,l.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:w(e.value)}),e.copyable&&(0,l.jsx)("button",{onClick:()=>C(e.value,`${e.step}-${e.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-lg",children:p===`${e.step}-${e.title}`?"check":"content_copy"})})]})]})]},e.step)),_()&&t.codeBlock&&(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,l.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:t.codeBlock.language}),(0,l.jsxs)("button",{onClick:()=>C(t.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===p?"check":"content_copy"}),"codeblock"===p?"Copied!":"Copy"]})]}),(0,l.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,l.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:w(t.codeBlock.code)})})]})]}):(0,l.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,l.jsx)(r.rq,{isOpen:f,onClose:()=>y(!1),onSelect:e=>{j(e.value)},selectedModel:b,activeProviders:c,title:"Select Model"})]})}function f({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:x}){let m,p,u,h,g,[y,b]=(0,a.useState)(x||null),[j,N]=(0,a.useState)(!1),[v,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(!1),[S,_]=(0,a.useState)(null),[A,E]=(0,a.useState)(!1),[O,M]=(0,a.useState)(""),[I,R]=(0,a.useState)(""),[T,P]=(0,a.useState)(""),[$,K]=(0,a.useState)(!1),[z,D]=(0,a.useState)(!1),[L,U]=(0,a.useState)({}),[F,H]=(0,a.useState)(!1),[B,q]=(0,a.useState)(""),[W,G]=(0,a.useState)([]),[J,Z]=(0,a.useState)("");(0,a.useEffect)(()=>{o?.length>0&&!O&&M(o[0].key)},[o,O]),(0,a.useEffect)(()=>{x&&b(x)},[x]),(0,a.useEffect)(()=>{t&&!y&&(X(),Y()),t&&Y()},[t]),(0,a.useEffect)(()=>{y?.opencode?.models&&G(y.opencode.models),y?.opencode?.activeModel&&Z(y.opencode.activeModel),y?.config?.agent?.explorer?.model?.startsWith("9router/")&&P(y.config.agent.explorer.model.replace("9router/",""))},[y]);let Y=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&U(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},V=(()=>{if(!y?.installed)return null;if(!y.config)return"not_configured";let e=y.config?.provider?.["9router"]?.options?.baseURL||"",t=e.includes("localhost")||e.includes("127.0.0.1");return y.has9Router&&(t||e.includes(n))?"configured":y.has9Router?"other":"not_configured"})(),Q=()=>{let e=B||n;return e.endsWith("/v1")?e:`${e}/v1`},X=async()=>{N(!0);try{let e=await fetch("/api/cli-tools/opencode-settings"),t=await e.json();b(t)}catch(e){b({installed:!1,error:e.message})}finally{N(!1)}},ee=async()=>{w(!0),_(null);try{let e=O&&O.trim()||c?O:"sk_9router",t=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:Q(),apiKey:e,models:W,activeModel:""===J?"":J||W[0],subagentModel:T})}),s=await t.json();t.ok?(_({type:"success",text:"Settings applied successfully!"}),X()):_({type:"error",text:s.error||"Failed to apply settings"})}catch(e){_({type:"error",text:e.message})}finally{w(!1)}},et=async()=>{C(!0),_(null);try{let e=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),t=await e.json();e.ok?(_({type:"success",text:"Settings reset successfully!"}),R(""),P(""),G([]),Z(""),X()):_({type:"error",text:t.error||"Failed to reset settings"})}catch(e){_({type:"error",text:e.message})}finally{C(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.default,{src:"/providers/opencode.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===V&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===V&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===V&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[j&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking OpenCode CLI..."})]}),!j&&y&&!y.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"OpenCode CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>H(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>E(!A),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:A?"expand_less":"help"}),A?"Hide":"How to Install"]})]})]}),A&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g opencode-ai"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"opencode"})," to verify."]})]})]})]}),!j&&y?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[y?.config?.provider?.["9router"]?.options?.baseURL&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:y.config.provider["9router"].options.baseURL})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:B||`${n}/v1`,onChange:e=>q(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),B&&B!==`${n}/v1`&&(0,l.jsx)("button",{onClick:()=>q(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),o.length>0?(0,l.jsx)("select",{value:O,onChange:e=>M(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:c?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,l.jsxs)("div",{className:"flex items-start gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Models"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===W.length?(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):W.map(e=>(0,l.jsxs)("span",{onClick:async()=>{if(e===J)try{(await fetch("/api/cli-tools/opencode-settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({clearActiveModel:!0})})).ok&&(Z(""),X())}catch(e){console.log("Error clearing active model:",e)}else Z(e)},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs cursor-pointer transition-colors ${e===J?"bg-primary/10 text-primary border border-primary":"bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border"}`,title:e===J?"Click to clear active model":"Click to set as active",children:[e===J&&(0,l.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:"star"}),e,(0,l.jsx)("button",{onClick:async t=>{t.stopPropagation();try{if((await fetch(`/api/cli-tools/opencode-settings?model=${encodeURIComponent(e)}`,{method:"DELETE"})).ok){let t=W.filter(t=>t!==e);G(t),J===e&&Z(""),X()}}catch(e){console.log("Error removing model:",e)}},className:"ml-0.5 hover:text-red-500",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e))}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("button",{onClick:()=>K(!0),disabled:!d?.length,className:`px-2 py-1 rounded border text-xs transition-colors ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Add Model"}),(0,l.jsx)("span",{className:"text-xs text-text-muted",children:W.length>0&&J?(0,l.jsxs)(l.Fragment,{children:["Active: ",(0,l.jsx)("span",{className:"text-primary",children:J})]}):W.length>0?(0,l.jsx)("span",{className:"text-yellow-500",children:"Click a model to set/clear active"}):"Select models to add"})]})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Subagent Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:T,onChange:e=>P(e.target.value),placeholder:I||"provider/model-id (defaults to main model)",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>D(!0),disabled:!d?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),T&&(0,l.jsx)("button",{onClick:()=>P(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),S&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===S.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===S.type?"check_circle":"error"}),(0,l.jsx)("span",{children:S.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ee,disabled:0===W.length,loading:v,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:et,disabled:!y.has9Router,loading:k,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>H(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:$,onClose:()=>K(!1),onSelect:e=>{!W.includes(e.value)&&(G([...W,e.value]),J||Z(e.value)),K(!1)},selectedModel:null,activeProviders:d,modelAliases:L,title:"Add Model for OpenCode"}),(0,l.jsx)(r.rq,{isOpen:z,onClose:()=>D(!1),onSelect:e=>{P(e.value),D(!1)},selectedModel:T,activeProviders:d,modelAliases:L,title:"Select Subagent Model for OpenCode"}),(0,l.jsx)(r.uR,{isOpen:F,onClose:()=>H(!1),title:"OpenCode - Manual Configuration",configs:(m=O&&O.trim()?O:c?"<API_KEY_FROM_DASHBOARD>":"sk_9router",p=W.length>0?W:["provider/model-id"],u=J||W[0]||p[0],h=T||u,g={},p.forEach(e=>{g[e]={name:e}}),[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{"9router":{npm:"@ai-sdk/openai-compatible",options:{baseURL:Q(),apiKey:m},models:g}},model:`9router/${u}`,agent:{explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:`9router/${h}`}}},null,2)}])})]})}let y="http://localhost:20128";function b({apiKeys:e,cloudEnabled:t,onStatusChange:s}){let[i,n]=(0,a.useState)(null),[o,d]=(0,a.useState)(!1),[c,x]=(0,a.useState)(!1),[m,p]=(0,a.useState)(""),[u,h]=(0,a.useState)(""),[g,f]=(0,a.useState)(null),[j,N]=(0,a.useState)(null),[v,w]=(0,a.useState)(null),[k,C]=(0,a.useState)(y),S="u">typeof navigator&&navigator.userAgent?.includes("Windows"),_=i?.isAdmin!==!1;(0,a.useEffect)(()=>{e?.length>0&&!u&&h(e[0].key)},[e,u]),(0,a.useEffect)(()=>{A()},[]);let A=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm");if(e.ok){let t=await e.json();n(t),t.mitmRouterBaseUrl&&C(t.mitmRouterBaseUrl),s?.(t)}}catch{n({running:!1,certExists:!1,dnsStatus:{}})}},E=e=>{w(null),S||i?.hasCachedPassword?O(e,""):(f(e),x(!0),N(null))},O=async(s,l)=>{d(!0),w(null);try{let a;if("trust-cert"===s)a=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"trust-cert",sudoPassword:l})});else if("start"===s){let s=u?.trim()||(e?.length>0?e[0].key:null)||(t?null:"sk_9router");a=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:s,sudoPassword:l,mitmRouterBaseUrl:k.trim()||y})})}else a=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:l})});if(!a.ok){let e=await a.json().catch(()=>({}));w(e.error||`Failed to ${s} MITM server`);return}x(!1),p(""),await A()}catch(e){w(e.message||"Network error")}finally{d(!1),f(null)}},M=()=>{m.trim()?O(g,m):N("Sudo password is required")},I=i?.running;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.Zp,{padding:"sm",className:"border-primary/20 bg-primary/5",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"security"}),(0,l.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"MITM Server"}),I?(0,l.jsx)(r.Ex,{variant:"success",size:"sm",children:"Running"}):(0,l.jsx)(r.Ex,{variant:"default",size:"sm",children:"Stopped"})]}),(0,l.jsx)("div",{className:"flex items-center gap-1 text-xs text-text-muted","data-i18n-skip":"true",children:[{label:"Cert",ok:i?.certExists},{label:"Trusted",ok:i?.certTrusted},{label:"Server",ok:I}].map(({label:e,ok:t})=>(0,l.jsxs)("span",{className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded ${t?"text-green-600":"text-text-muted"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:t?"check_circle":"cancel"}),e]},e))})]}),(0,l.jsxs)("div",{className:"px-2 py-2 rounded-lg bg-surface/50 border border-border/50 flex flex-col gap-2",children:[(0,l.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Purpose:"})," Use Antigravity IDE & GitHub Copilot → with ANY provider/model from 9Router"]}),(0,l.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Antigravity/Copilot IDE request → DNS redirect to localhost:443 → MITM proxy intercepts → 9Router → response to Antigravity/Copilot"]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"9Router Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:k,onChange:e=>C(e.target.value),placeholder:y,disabled:I,className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50 disabled:opacity-50"})]}),!I&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",list:"mitm-api-keys",value:u,onChange:e=>h(e.target.value),placeholder:t?"Enter or pick API key":"sk_9router (default)",className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50"}),e?.length>0&&(0,l.jsx)("datalist",{id:"mitm-api-keys",children:e.map(e=>(0,l.jsx)("option",{value:e.key,children:e.name||e.key},e.id))})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 flex-wrap","data-i18n-skip":"true",children:[i?.certExists&&!i?.certTrusted&&(0,l.jsxs)("button",{onClick:()=>E("trust-cert"),disabled:o,className:"px-4 py-1.5 rounded-lg bg-yellow-500/10 border border-yellow-500/30 text-yellow-600 font-medium text-xs flex items-center gap-1.5 hover:bg-yellow-500/20 transition-colors disabled:opacity-50",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"verified_user"}),"Trust Cert"]}),I?(0,l.jsxs)("button",{onClick:()=>E("stop"),disabled:o,className:"px-4 py-1.5 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-xs flex items-center gap-1.5 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop Server"]}):(0,l.jsxs)("button",{onClick:()=>E("start"),disabled:o||S&&!_,className:"px-4 py-1.5 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-xs flex items-center gap-1.5 hover:bg-primary/20 transition-colors disabled:opacity-50",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start Server"]}),I&&(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),v&&(0,l.jsxs)("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5 shrink-0",children:"error"}),(0,l.jsx)("span",{children:v})]}),S&&!_&&(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 border border-red-500/20",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"shield_lock"}),(0,l.jsx)("span",{children:"Administrator required — restart 9Router as Administrator to use MITM"})]})]})}),c&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,l.jsxs)("div",{className:"bg-surface border border-border rounded-xl p-6 w-full max-w-sm flex flex-col gap-4 shadow-xl",children:[(0,l.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,l.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and server startup"})]}),(0,l.jsx)(r.pd,{type:"password",placeholder:"Enter sudo password",value:m,onChange:e=>p(e.target.value),onKeyDown:e=>{"Enter"!==e.key||o||M()}}),j&&(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,l.jsx)("span",{children:j})]}),(0,l.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,l.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{x(!1),p(""),N(null)},disabled:o,children:"Cancel"}),(0,l.jsx)(r.$n,{variant:"primary",size:"sm",onClick:M,loading:o,children:"Confirm"})]})]})})]})}var j=s(40295);function N({tool:e,isExpanded:t,onToggle:s,serverRunning:n,dnsActive:o,hasCachedPassword:d,apiKeys:c,activeProviders:x,hasActiveProviders:m,modelAliases:p={},cloudEnabled:u,onDnsChange:h}){let[g,f]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null),[v,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(""),[S,_]=(0,a.useState)(null),[A,E]=(0,a.useState)(null),[O,M]=(0,a.useState)({}),[I,R]=(0,a.useState)(!1),[T,P]=(0,a.useState)(null),$=j.TOOL_HOSTS[e.id]??[],K="u">typeof navigator&&navigator.userAgent?.includes("Windows");(0,a.useEffect)(()=>{t&&z()},[t]);let z=async()=>{try{let t=await fetch(`/api/cli-tools/antigravity-mitm/alias?tool=${e.id}`);if(t.ok){let e=await t.json();Object.keys(e.aliases||{}).length>0&&M(e.aliases)}}catch{}},D=(0,a.useCallback)(async t=>{try{await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:e.id,mappings:t})})}catch{}},[e.id]),L=(e,t)=>{M(s=>({...s,[e]:t}))},U=()=>{if(!n)return;let e=o?"disable":"enable";K||d?F(e,""):(_(e),w(!0),E(null))},F=async(t,s)=>{f(!0),b(null);try{let l=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:e.id,action:t,sudoPassword:s})}),a=await l.json();if(!l.ok)throw Error(a.error||"Failed to toggle DNS");"enable"===t&&b(`Restart ${e.name} to apply changes`),w(!1),C(""),h?.(a)}catch{}finally{f(!1),_(null)}},H=()=>{k.trim()?F(S,k):E("Sudo password is required")};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),n?o?(0,l.jsx)(r.Ex,{variant:"success",size:"sm",children:"Active"}):(0,l.jsx)(r.Ex,{variant:"warning",size:"sm",children:"DNS off"}):(0,l.jsx)(r.Ex,{variant:"default",size:"sm",children:"Server off"})]}),(0,l.jsxs)("p",{className:"text-xs text-text-muted",children:["Intercept ",e.name," requests via MITM proxy"]})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[$.length>0&&(0,l.jsxs)("div",{className:"mt-2 rounded-md border border-border bg-surface/50 px-2 py-1.5",children:[(0,l.jsx)("p",{className:"text-[10px] font-medium tracking-wide text-text-main/80 mb-1",children:"Edit hosts file manually to add the following entries:"}),(0,l.jsx)("ul",{className:"list-none space-y-0.5 font-mono text-[10px] text-text-muted break-all",children:$.map(e=>(0,l.jsxs)("li",{children:["127.0.0.1 ",e]},e))})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted px-1",children:[(0,l.jsxs)("p",{children:["Toggle DNS to redirect ",e.name," traffic through 9Router via MITM."]}),!o&&(0,l.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),e.defaultModels?.length>0&&(0,l.jsx)("div",{className:"flex flex-col gap-2",children:e.defaultModels.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-36 shrink-0 text-xs font-semibold text-text-main text-right",children:e.name}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:O[e.alias]||"",onChange:t=>L(e.alias,t.target.value),onBlur:t=>{var s,l;return s=e.alias,l=t.target.value,void D({...O,[s]:l})},placeholder:"provider/model-id",disabled:!o,className:`flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 ${!o?"opacity-50 cursor-not-allowed":""}`}),(0,l.jsx)("button",{onClick:()=>{P(e.alias),R(!0)},disabled:!m||!o,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 ${m&&o?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),O[e.alias]&&(0,l.jsx)("button",{onClick:()=>{L(e.alias,""),D({...O,[e.alias]:""})},className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias))}),e.defaultModels?.length===0&&(0,l.jsx)("p",{className:"text-xs text-text-muted px-1",children:"Model mappings will be available soon."}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 items-start",children:[o?(0,l.jsxs)("button",{onClick:U,disabled:!n||g,className:"px-4 py-1.5 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-xs flex items-center gap-1.5 hover:bg-red-500/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop DNS"]}):(0,l.jsxs)("button",{onClick:U,disabled:!n||g,className:"px-4 py-1.5 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-xs flex items-center gap-1.5 hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start DNS"]}),y&&(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs text-amber-500",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,l.jsx)("span",{children:y})]})]})]})]}),v&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,l.jsxs)("div",{className:"bg-surface border border-border rounded-xl p-6 w-full max-w-sm flex flex-col gap-4 shadow-xl",children:[(0,l.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,l.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Required to modify /etc/hosts and flush DNS cache"})]}),(0,l.jsx)(r.pd,{type:"password",placeholder:"Enter sudo password",value:k,onChange:e=>C(e.target.value),onKeyDown:e=>{"Enter"!==e.key||g||H()}}),A&&(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,l.jsx)("span",{children:A})]}),(0,l.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,l.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{w(!1),C(""),E(null)},disabled:g,children:"Cancel"}),(0,l.jsx)(r.$n,{variant:"primary",size:"sm",onClick:H,loading:g,children:"Confirm"})]})]})}),(0,l.jsx)(r.rq,{isOpen:I,onClose:()=>R(!1),onSelect:e=>{if(!T||e.isPlaceholder)return;let t={...O,[T]:e.value};M(t),D(t)},selectedModel:T?O[T]:null,activeProviders:x,modelAliases:p,title:`Select model for ${T}`})]})}var v=s(98500),w=s.n(v);function k({tool:e}){return(0,l.jsx)(w(),{href:"/dashboard/mitm",className:"block",children:(0,l.jsx)(r.Zp,{padding:"sm",className:"overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-purple-500/10 text-purple-600 dark:text-purple-400 rounded-full",children:"MITM"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"chevron_right"})]})})})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8202],{28202:(e,t,r)=>{function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){var n,o;n=t,o=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e){return function t(){for(var r=this,n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(r,[].concat(o,n))}}}function l(e){return({}).toString.call(e).includes("Object")}function s(e){return"function"==typeof e}r.r(t),r.d(t,{DiffEditor:()=>K,Editor:()=>Z,default:()=>ee,loader:()=>L,useMonaco:()=>Q});var f,d,g=a(function(e,t){throw Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),p=function(e,t){return l(t)||g("changeType"),Object.keys(t).some(function(t){return!Object.prototype.hasOwnProperty.call(e,t)})&&g("changeField"),t},h=function(e){s(e)||g("selectorType")},y=function(e){s(e)||l(e)||g("handlerType"),l(e)&&Object.values(e).some(function(e){return!s(e)})&&g("handlersType")},m=function(e){e||g("initialIsRequired"),l(e)||g("initialType"),Object.keys(e).length||g("initialContent")};function v(e,t){return s(t)?t(e.current):t}function b(e,t){return e.current=u(u({},e.current),t),t}function O(e,t,r){return s(t)?t(e.current):Object.keys(r).forEach(function(r){var n;return null==(n=t[r])?void 0:n.call(t,e.current[r])}),r}var w={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},j=(f=function(e,t){throw Error(e[t]||e.default)},function e(){for(var t=this,r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];return n.length>=f.length?f.apply(this,n):function(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return e.apply(t,[].concat(n,o))}})(w),M=function(e){return(e||j("configIsRequired"),({}).toString.call(e).includes("Object")||j("configType"),e.urls)?(console.warn(w.deprecation),{paths:{vs:e.urls.monacoBase}}):e},E=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}},P={type:"cancelation",msg:"operation is manually canceled"};function R(e){var t=!1,r=new Promise(function(r,n){e.then(function(e){return t?n(P):r(e)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var S=["monaco"],k=function(e){if(Array.isArray(e))return e}(d=({create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(e),y(t);var r={current:e},n=a(O)(r,t),o=a(b)(r),i=a(p)(e),c=a(v)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return h(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}})(n,o,i,c)(e)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,n,o,i,c=[],u=!0,a=!1;try{o=(t=t.call(e)).next,!1;for(;!(u=(r=o.call(t)).done)&&(c.push(r.value),2!==c.length);u=!0);}catch(e){a=!0,n=e}finally{try{if(!u&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(a)throw n}}return c}}(d)||function(e){if(e){if("string"==typeof e)return n(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,2):void 0}}(d)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),T=k[0],C=k[1];function I(e){return document.body.appendChild(e)}function x(e){var t,r,n=T(function(e){return{config:e.config,reject:e.reject}}),o=(t="".concat(n.config.paths.vs,"/loader.js"),r=document.createElement("script"),t&&(r.src=t),r);return o.onload=function(){return e()},o.onerror=n.reject,o}function A(){var e=T(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var r=t.m||t;D(r),e.resolve(r)},function(t){e.reject(t)})}function D(e){T().monaco||C({monaco:e})}var V=new Promise(function(e,t){return C({resolve:e,reject:t})}),L={config:function(e){var t=M(e),r=t.monaco,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,S);C(function(e){return{config:function e(t,r){return Object.keys(r).forEach(function(n){r[n]instanceof Object&&t[n]&&Object.assign(r[n],e(t[n],r[n]))}),i(i({},t),r)}(e.config,n),monaco:r}})},init:function(){var e=T(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(C({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),R(V);if(window.monaco&&window.monaco.editor)return D(window.monaco),e.resolve(window.monaco),R(V);E(I,x)(A)}return R(V)},__getMonacoInstance:function(){return T(function(e){return e.monaco})}},_=r(12115),N={display:"flex",position:"relative",textAlign:"initial"},q={width:"100%"},z={display:"none"},F={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"},U=function({children:e}){return _.createElement("div",{style:F},e)},B=(0,_.memo)(function({width:e,height:t,isEditorReady:r,loading:n,_ref:o,className:i,wrapperProps:c}){return _.createElement("section",{style:{...N,width:e,height:t},...c},!r&&_.createElement(U,null,n),_.createElement("div",{ref:o,style:{...q,...!r&&z},className:i}))}),Y=function(e){(0,_.useEffect)(e,[])},$=function(e,t,r=!0){let n=(0,_.useRef)(!0);(0,_.useEffect)(n.current||!r?()=>{n.current=!1}:e,t)};function G(){}function H(e,t,r,n){var o,i,c,u,a,l;return o=e,i=n,o.editor.getModel(J(o,i))||(c=e,u=t,a=r,l=n,c.editor.createModel(u,a,l?J(c,l):void 0))}function J(e,t){return e.Uri.parse(t)}var K=(0,_.memo)(function({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:c,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:a=!1,theme:l="light",loading:s="Loading...",options:f={},height:d="100%",width:g="100%",className:p,wrapperProps:h={},beforeMount:y=G,onMount:m=G}){let[v,b]=(0,_.useState)(!1),[O,w]=(0,_.useState)(!0),j=(0,_.useRef)(null),M=(0,_.useRef)(null),E=(0,_.useRef)(null),P=(0,_.useRef)(m),R=(0,_.useRef)(y),S=(0,_.useRef)(!1);Y(()=>{let e=L.init();return e.then(e=>(M.current=e)&&w(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return j.current?(t=j.current?.getModel(),void(u||t?.original?.dispose(),a||t?.modified?.dispose(),j.current?.dispose())):e.cancel()}}),$(()=>{if(j.current&&M.current){let t=j.current.getOriginalEditor(),o=H(M.current,e||"",n||r||"text",i||"");o!==t.getModel()&&t.setModel(o)}},[i],v),$(()=>{if(j.current&&M.current){let e=j.current.getModifiedEditor(),n=H(M.current,t||"",o||r||"text",c||"");n!==e.getModel()&&e.setModel(n)}},[c],v),$(()=>{let e=j.current.getModifiedEditor();e.getOption(M.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),$(()=>{j.current?.getModel()?.original.setValue(e||"")},[e],v),$(()=>{let{original:e,modified:t}=j.current.getModel();M.current.editor.setModelLanguage(e,n||r||"text"),M.current.editor.setModelLanguage(t,o||r||"text")},[r,n,o],v),$(()=>{M.current?.editor.setTheme(l)},[l],v),$(()=>{j.current?.updateOptions(f)},[f],v);let k=(0,_.useCallback)(()=>{if(!M.current)return;R.current(M.current);let u=H(M.current,e||"",n||r||"text",i||""),a=H(M.current,t||"",o||r||"text",c||"");j.current?.setModel({original:u,modified:a})},[r,t,o,e,n,i,c]),T=(0,_.useCallback)(()=>{!S.current&&E.current&&(j.current=M.current.editor.createDiffEditor(E.current,{automaticLayout:!0,...f}),k(),M.current?.editor.setTheme(l),b(!0),S.current=!0)},[f,l,k]);return(0,_.useEffect)(()=>{v&&P.current(j.current,M.current)},[v]),(0,_.useEffect)(()=>{O||v||T()},[O,v,T]),_.createElement(B,{width:g,height:d,isEditorReady:v,loading:s,_ref:E,className:p,wrapperProps:h})}),Q=function(){let[e,t]=(0,_.useState)(L.__getMonacoInstance());return Y(()=>{let r;return e||(r=L.init()).then(e=>{t(e)}),()=>r?.cancel()}),e},W=function(e){let t=(0,_.useRef)();return(0,_.useEffect)(()=>{t.current=e},[e]),t.current},X=new Map,Z=(0,_.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:o,path:i,theme:c="light",line:u,loading:a="Loading...",options:l={},overrideServices:s={},saveViewState:f=!0,keepCurrentModel:d=!1,width:g="100%",height:p="100%",className:h,wrapperProps:y={},beforeMount:m=G,onMount:v=G,onChange:b,onValidate:O=G}){let[w,j]=(0,_.useState)(!1),[M,E]=(0,_.useState)(!0),P=(0,_.useRef)(null),R=(0,_.useRef)(null),S=(0,_.useRef)(null),k=(0,_.useRef)(v),T=(0,_.useRef)(m),C=(0,_.useRef)(),I=(0,_.useRef)(n),x=W(i),A=(0,_.useRef)(!1),D=(0,_.useRef)(!1);Y(()=>{let e=L.init();return e.then(e=>(P.current=e)&&E(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>R.current?void(C.current?.dispose(),d?f&&X.set(i,R.current.saveViewState()):R.current.getModel()?.dispose(),R.current.dispose()):e.cancel()}),$(()=>{let c=H(P.current,e||n||"",t||o||"",i||r||"");c!==R.current?.getModel()&&(f&&X.set(x,R.current?.saveViewState()),R.current?.setModel(c),f&&R.current?.restoreViewState(X.get(i)))},[i],w),$(()=>{R.current?.updateOptions(l)},[l],w),$(()=>{R.current&&void 0!==n&&(R.current.getOption(P.current.editor.EditorOption.readOnly)?R.current.setValue(n):n!==R.current.getValue()&&(D.current=!0,R.current.executeEdits("",[{range:R.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),R.current.pushUndoStop(),D.current=!1))},[n],w),$(()=>{let e=R.current?.getModel();e&&o&&P.current?.editor.setModelLanguage(e,o)},[o],w),$(()=>{void 0!==u&&R.current?.revealLine(u)},[u],w),$(()=>{P.current?.editor.setTheme(c)},[c],w);let V=(0,_.useCallback)(()=>{if(!(!S.current||!P.current)&&!A.current){T.current(P.current);let a=i||r,d=H(P.current,n||e||"",t||o||"",a||"");R.current=P.current?.editor.create(S.current,{model:d,automaticLayout:!0,...l},s),f&&R.current.restoreViewState(X.get(a)),P.current.editor.setTheme(c),void 0!==u&&R.current.revealLine(u),j(!0),A.current=!0}},[e,t,r,n,o,i,l,s,f,c,u]);return(0,_.useEffect)(()=>{w&&k.current(R.current,P.current)},[w]),(0,_.useEffect)(()=>{M||w||V()},[M,w,V]),I.current=n,(0,_.useEffect)(()=>{w&&b&&(C.current?.dispose(),C.current=R.current?.onDidChangeModelContent(e=>{D.current||b(R.current.getValue(),e)}))},[w,b]),(0,_.useEffect)(()=>{if(w){let e=P.current.editor.onDidChangeMarkers(e=>{let t=R.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=P.current.editor.getModelMarkers({resource:t});O?.(e)}});return()=>{e?.dispose()}}return()=>{}},[w,O]),_.createElement(B,{width:g,height:p,isEditorReady:w,loading:a,_ref:S,className:h,wrapperProps:y})}),ee=Z}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{25374:(e,t,a)=>{Promise.resolve().then(a.bind(a,75228))},75228:(e,t,a)=>{"use strict";a.d(t,{default:()=>u});var s=a(95155),i=a(12115),l=a(35497),o=a(3534),r=a(28777),c=a(82997);let n="https://9router.com",d={claude:"/api/cli-tools/claude-settings",codex:"/api/cli-tools/codex-settings",opencode:"/api/cli-tools/opencode-settings",droid:"/api/cli-tools/droid-settings",openclaw:"/api/cli-tools/openclaw-settings",hermes:"/api/cli-tools/hermes-settings"};function u({machineId:e}){let t,a,p,[v,h]=(0,i.useState)([]),[f,g]=(0,i.useState)(!0),[x,j]=(0,i.useState)(null),[b,w]=(0,i.useState)({}),[E,m]=(0,i.useState)(!1),[S,y]=(0,i.useState)(!1),[P,k]=(0,i.useState)(""),[N,A]=(0,i.useState)([]),[O,_]=(0,i.useState)({});(0,i.useEffect)(()=>{I(),M(),$(),C()},[]);let C=async()=>{try{let e=await Promise.all(Object.entries(d).map(async([e,t])=>{try{let a=await fetch(t),s=await a.json();return[e,s]}catch{return[e,null]}}));_(Object.fromEntries(e))}catch(e){console.log("Error fetching tool statuses:",e)}},M=async()=>{try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status")]);if(e.ok){let t=await e.json();m(t.cloudEnabled||!1)}if(t.ok){let e=await t.json();y(e.enabled||!1),k(e.publicUrl||"")}}catch(e){console.log("Error loading settings:",e)}},$=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let t=await e.json();A(t.keys||[])}}catch(e){console.log("Error fetching API keys:",e)}},I=async()=>{try{let e=await fetch("/api/providers"),t=await e.json();e.ok&&h(t.connections||[])}catch(e){console.log("Error fetching connections:",e)}finally{g(!1)}},Q=()=>v.filter(e=>!1!==e.isActive),T=(0,i.useCallback)((e,t,a)=>{w(s=>s[e]?.[t]===a?s:{...s,[e]:{...s[e],[t]:a}})},[]);if(f)return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(l.Qv,{}),(0,s.jsx)(l.Qv,{}),(0,s.jsx)(l.Qv,{})]});let U=(t=Q(),a=[],p=new Set,t.forEach(e=>{let t=r.Xg[e.provider]||e.provider;(0,r.KC)(e.provider).forEach(s=>{let i=`${t}/${s.id}`;p.has(i)||(p.add(i),a.push({value:i,label:`${t}/${s.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:s.id}))})}),a).length>0,Z=Object.entries(o.dM),q=Object.entries(o.wn);return(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)("div",{className:"flex flex-col gap-4",children:Z.map(([e,t])=>((e,t)=>{let a={tool:t,isExpanded:x===e,onToggle:()=>j(x===e?null:e),baseUrl:S&&P?P:E&&n?n:window.location.origin,apiKeys:N};switch(e){case"claude":return(0,s.jsx)(c.Tk,{...a,activeProviders:Q(),modelMappings:b[e]||{},onModelMappingChange:(t,a)=>T(e,t,a),hasActiveProviders:U,cloudEnabled:E,initialStatus:O.claude},e);case"codex":return(0,s.jsx)(c.Ah,{...a,activeProviders:Q(),cloudEnabled:E,initialStatus:O.codex},e);case"opencode":return(0,s.jsx)(c.qO,{...a,activeProviders:Q(),cloudEnabled:E,initialStatus:O.opencode},e);case"droid":return(0,s.jsx)(c.ZM,{...a,activeProviders:Q(),hasActiveProviders:U,cloudEnabled:E,initialStatus:O.droid},e);case"openclaw":return(0,s.jsx)(c.yZ,{...a,activeProviders:Q(),hasActiveProviders:U,cloudEnabled:E,initialStatus:O.openclaw},e);case"hermes":return(0,s.jsx)(c.RF,{...a,activeProviders:Q(),hasActiveProviders:U,cloudEnabled:E,initialStatus:O.hermes},e);default:return(0,s.jsx)(c.a7,{toolId:e,...a,activeProviders:Q(),cloudEnabled:E,tunnelEnabled:S},e)}})(e,t))}),(0,s.jsx)("div",{className:"flex flex-col gap-4",children:q.map(([e,t])=>(0,s.jsx)(c.gY,{tool:t},e))})]})}}},e=>{e.O(0,[2574,3862,1051,5772,1321,5497,698,8441,3794,7358],()=>e(e.s=25374)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{44493:(e,t,l)=>{"use strict";l.d(t,{default:()=>o});var s=l(95155),n=l(12115),r=l(35497),a=l(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,t]=(0,n.useState)([]),[l,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),u=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-a.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)(r.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,s.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:u,children:"Clear"})}),(0,s.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,s.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,n;return(0,s.jsx)("div",{children:(n=c[(l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,s.jsx)("span",{className:n,children:e}))},t)})})})]})})}},93579:(e,t,l)=>{Promise.resolve().then(l.bind(l,44493))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=93579)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6607],{23879:(e,s,t)=>{"use strict";t.d(s,{default:()=>d});var a=t(95155),n=t(12115),i=t(3534),l=t(28777),c=t(52679),o=t(82997);function d(){let[e,s]=(0,n.useState)([]),[t,d]=(0,n.useState)([]),[r,u]=(0,n.useState)({}),[h,f]=(0,n.useState)(!1),[p,v]=(0,n.useState)(null),[w,g]=(0,n.useState)({running:!1,certExists:!1,dnsStatus:{},hasCachedPassword:!1});(0,n.useEffect)(()=>{y(),S(),k(),x()},[]);let y=async()=>{try{let e=await fetch("/api/providers");if(e.ok){let t=await e.json();s(t.connections||[])}}catch{}},S=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let s=await e.json();d(s.keys||[])}}catch{}},k=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let s=await e.json();u(s.aliases||{})}}catch{}},x=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();f(s.cloudEnabled||!1)}}catch{}},j=()=>e.filter(e=>!1!==e.isActive),E=Object.entries(i.wn);return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(o.tA,{apiKeys:t,cloudEnabled:h,onStatusChange:g}),(0,a.jsx)("div",{className:"flex flex-col gap-2",children:E.map(([e,s])=>(0,a.jsx)(o.kn,{tool:s,isExpanded:p===e,onToggle:()=>v(p===e?null:e),serverRunning:w.running,dnsActive:w.dnsStatus?.[e]||!1,hasCachedPassword:w.hasCachedPassword||!1,apiKeys:t,activeProviders:j(),hasActiveProviders:j().some(e=>(0,l.KC)(e.provider).length>0||(0,c.mq)(e.provider)||(0,c.gb)(e.provider)),modelAliases:r,cloudEnabled:h,onDnsChange:e=>g(s=>({...s,dnsStatus:e.dnsStatus??s.dnsStatus}))},e))})]})}},51167:(e,s,t)=>{Promise.resolve().then(t.bind(t,23879))}},e=>{e.O(0,[2574,3862,1051,5772,1321,5497,698,8441,3794,7358],()=>e(e.s=51167)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3471],{39600:(e,t,s)=>{Promise.resolve().then(s.bind(s,64561))},64561:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var a=s(95155),r=s(12115),o=s(35497),n=s(1620),i=s(31474),l=s(90620);function d(){let{theme:e,setTheme:t,isDark:s}=(0,n.D)(),[d,c]=(0,r.useState)({fallbackStrategy:"fill-first"}),[m,x]=(0,r.useState)(!0),[p,u]=(0,r.useState)({current:"",new:"",confirm:""}),[h,b]=(0,r.useState)({type:"",message:""}),[y,g]=(0,r.useState)(!1),[f,j]=(0,r.useState)(!1),[N,v]=(0,r.useState)({type:"",message:""}),w=(0,r.useRef)(null),[P,k]=(0,r.useState)({outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:""}),[C,S]=(0,r.useState)({type:"",message:""}),[O,R]=(0,r.useState)(!1),[E,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{c(e),k({outboundProxyEnabled:e?.outboundProxyEnabled===!0,outboundProxyUrl:e?.outboundProxyUrl||"",outboundNoProxy:e?.outboundNoProxy||""}),x(!1)}).catch(e=>{console.error("Failed to fetch settings:",e),x(!1)})},[]);let L=async e=>{if(e.preventDefault(),!0===d.outboundProxyEnabled){R(!0),S({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyUrl:P.outboundProxyUrl,outboundNoProxy:P.outboundNoProxy})}),t=await e.json();e.ok?(c(e=>({...e,...t})),S({type:"success",message:"Proxy settings applied"})):S({type:"error",message:t.error||"Failed to update proxy settings"})}catch(e){S({type:"error",message:"An error occurred"})}finally{R(!1)}}},F=async()=>{if(!0!==d.outboundProxyEnabled)return;let e=(P.outboundProxyUrl||"").trim();if(!e)return void S({type:"error",message:"Please enter a Proxy URL to test"});T(!0),S({type:"",message:""});try{let t=await fetch("/api/settings/proxy-test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyUrl:e})}),s=await t.json();t.ok&&s?.ok?S({type:"success",message:`Proxy test OK (${s.status}) in ${s.elapsedMs}ms`}):S({type:"error",message:s?.error||"Proxy test failed"})}catch(e){S({type:"error",message:"An error occurred"})}finally{T(!1)}},U=async e=>{R(!0),S({type:"",message:""});try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyEnabled:e})}),s=await t.json();t.ok?(c(e=>({...e,...s})),k(e=>({...e,outboundProxyEnabled:s?.outboundProxyEnabled===!0})),S({type:"success",message:e?"Proxy enabled":"Proxy disabled"})):S({type:"error",message:s.error||"Failed to update proxy settings"})}catch(e){S({type:"error",message:"An error occurred"})}finally{R(!1)}},A=async e=>{if(e.preventDefault(),p.new!==p.confirm)return void b({type:"error",message:"Passwords do not match"});g(!0),b({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:p.current,newPassword:p.new})}),t=await e.json();e.ok?(b({type:"success",message:"Password updated successfully"}),u({current:"",new:"",confirm:""})):b({type:"error",message:t.error||"Failed to update password"})}catch(e){b({type:"error",message:"An error occurred"})}finally{g(!1)}},q=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fallbackStrategy:e})})).ok&&c(t=>({...t,fallbackStrategy:e}))}catch(e){console.error("Failed to update settings:",e)}},J=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategy:e})})).ok&&c(t=>({...t,comboStrategy:e}))}catch(e){console.error("Failed to update combo strategy:",e)}},$=async e=>{let t=parseInt(e);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stickyRoundRobinLimit:t})})).ok&&c(e=>({...e,stickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update sticky limit:",e)}},D=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&c(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},H=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enableObservability:e})})).ok&&c(t=>({...t,enableObservability:e}))}catch(e){console.error("Failed to update enableObservability:",e)}},M=async()=>{try{let e=await fetch("/api/settings");if(!e.ok)return;let t=await e.json();c(t)}catch(e){console.error("Failed to reload settings:",e)}},_=async()=>{j(!0),v({type:"",message:""});try{let e=await fetch("/api/settings/database");if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||"Failed to export database")}let t=await e.json(),s=JSON.stringify(t,null,2),a=new Blob([s],{type:"application/json"}),r=URL.createObjectURL(a),o=document.createElement("a"),n=new Date().toISOString().replace(/[.:]/g,"-");o.href=r,o.download=`9router-backup-${n}.json`,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r),v({type:"success",message:"Database backup downloaded"})}catch(e){v({type:"error",message:e.message||"Failed to export database"})}finally{j(!1)}},Z=async e=>{let t=e.target.files?.[0];if(t){j(!0),v({type:"",message:""});try{let e=await t.text(),s=JSON.parse(e),a=await fetch("/api/settings/database",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),r=await a.json().catch(()=>({}));if(!a.ok)throw Error(r.error||"Failed to import database");await M(),v({type:"success",message:"Database imported successfully"})}catch(e){v({type:"error",message:e.message||"Invalid backup file"})}finally{w.current&&(w.current.value=""),j(!1)}}},I=!0===d.enableObservability;return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"size-12 rounded-lg bg-green-500/10 text-green-500 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-2xl",children:"computer"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"Local Mode"}),(0,a.jsx)("p",{className:"text-text-muted",children:"Running on your machine"})]})]}),(0,a.jsx)("div",{className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{type:"button",onClick:()=>t(s),className:(0,i.cn)("flex items-center gap-1.5 px-3 py-1.5 rounded-md font-medium transition-all",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{className:"capitalize text-sm",children:s})]},s))})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-4 border-t border-border",children:[(0,a.jsx)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-bg border border-border",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Database Location"}),(0,a.jsx)("p",{className:"text-sm text-text-muted font-mono",children:"~/.9router/db.json"})]})}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(o.$n,{variant:"secondary",icon:"download",onClick:_,loading:f,children:"Download Backup"}),(0,a.jsx)(o.$n,{variant:"outline",icon:"upload",onClick:()=>w.current?.click(),disabled:f,children:"Import Backup"}),(0,a.jsx)("input",{ref:w,type:"file",accept:"application/json,.json",className:"hidden",onChange:Z})]}),N.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===N.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:N.message})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"shield"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Security"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require login"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,a.jsx)(o.lM,{checked:!0===d.requireLogin,onChange:()=>D(!d.requireLogin),disabled:m})]}),!0===d.requireLogin&&(0,a.jsxs)("form",{onSubmit:A,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[d.hasPassword&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Current Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Enter current password",value:p.current,onChange:e=>u({...p,current:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"New Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Enter new password",value:p.new,onChange:e=>u({...p,new:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Confirm New Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Confirm new password",value:p.confirm,onChange:e=>u({...p,confirm:e.target.value}),required:!0})]})]}),h.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===h.type?"text-red-500":"text-green-500"}`,children:h.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(o.$n,{type:"submit",variant:"primary",loading:y,children:d.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"route"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Cycle through accounts to distribute load"})]}),(0,a.jsx)(o.lM,{checked:"round-robin"===d.fallbackStrategy,onChange:()=>q("round-robin"===d.fallbackStrategy?"fill-first":"round-robin"),disabled:m})]}),"round-robin"===d.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Sticky Limit"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Calls per account before switching"})]}),(0,a.jsx)(o.pd,{type:"number",min:"1",max:"10",value:d.stickyRoundRobinLimit||3,onChange:e=>$(e.target.value),disabled:m,className:"w-20 text-center"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4 border-t border-border/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Combo Round Robin"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Cycle through providers in combos instead of always starting with first"})]}),(0,a.jsx)(o.lM,{checked:"round-robin"===d.comboStrategy,onChange:()=>J("round-robin"===d.comboStrategy?"fallback":"round-robin"),disabled:m})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:"round-robin"===d.fallbackStrategy?`Currently distributing requests across all available accounts with ${d.stickyRoundRobinLimit||3} calls per account.`:"Currently using accounts in priority order (Fill First)."})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"wifi"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Network"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Outbound Proxy"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Enable proxy for OAuth + provider outbound requests."})]}),(0,a.jsx)(o.lM,{checked:!0===d.outboundProxyEnabled,onChange:()=>U(!0!==d.outboundProxyEnabled),disabled:m||O})]}),!0===d.outboundProxyEnabled&&(0,a.jsxs)("form",{onSubmit:L,className:"flex flex-col gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium",children:"Proxy URL"}),(0,a.jsx)(o.pd,{placeholder:"http://127.0.0.1:7897",value:P.outboundProxyUrl,onChange:e=>k(t=>({...t,outboundProxyUrl:e.target.value})),disabled:m||O}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Leave empty to inherit existing env proxy (if any)."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)("label",{className:"font-medium",children:"No Proxy"}),(0,a.jsx)(o.pd,{placeholder:"localhost,127.0.0.1",value:P.outboundNoProxy,onChange:e=>k(t=>({...t,outboundNoProxy:e.target.value})),disabled:m||O}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Comma-separated hostnames/domains to bypass the proxy."})]}),(0,a.jsxs)("div",{className:"pt-2 border-t border-border/50 flex items-center gap-2",children:[(0,a.jsx)(o.$n,{type:"button",variant:"secondary",loading:E,disabled:m||O,onClick:F,children:"Test proxy URL"}),(0,a.jsx)(o.$n,{type:"submit",variant:"primary",loading:O,children:"Apply"})]})]}),C.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===C.type?"text-red-500":"text-green-500"} pt-2 border-t border-border/50`,children:C.message})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"monitoring"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Observability"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Enable Observability"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Record request details for inspection in the logs view"})]}),(0,a.jsx)(o.lM,{checked:I,onChange:H,disabled:m})]})]}),(0,a.jsxs)("div",{className:"text-center text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[l.vQ.name," v",l.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode - All data stored on your machine"})]})]})})}}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=39600)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{18255:(e,t,s)=>{Promise.resolve().then(s.bind(s,52154))},52154:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var r=s(95155),a=s(12115),l=s(14051),i=s.n(l),n=s(35497),o=s(57250),d=s(90620),c=s(52679),p=s(98500),m=s.n(p),x=s(65921);let u={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function h(){let[e,t]=(0,a.useState)(null),[s,l]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!1),[d,c]=(0,a.useState)(null),p=(0,a.useRef)(null),m=(0,x.i)(),h=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let s=await e.json();t(s)}}catch{}finally{l(!1)}},[]);(0,a.useEffect)(()=>{h();let e=setInterval(h,3e4);return()=>clearInterval(e)},[h]),(0,a.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&o(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let f=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(m.success(`Cooldown cleared for ${t}`),await h()):m.error("Failed to clear cooldown")}catch{m.error("Failed to clear cooldown")}finally{c(null)}};if(s)return null;let b=e?.models||[],v=0===(e?.unavailableCount||b.filter(e=>"available"!==e.status).length),g={};return b.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";g[t]||(g[t]=[]),g[t].push(e)}),(0,r.jsx)("div",{className:"relative",ref:p,children:i&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:v?"#22c55e":"#f59e0b"},children:v?"verified":"warning"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,r.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:v?(0,r.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,r.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(g).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=u[e.status]||u.unknown,s=d===`${e.provider}:${e.model}`;return(0,r.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,r.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,r.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>f(e.provider,e.model),disabled:s,className:"text-[10px] px-1.5! py-0.5! ml-2",children:s?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}function f(e,t,s){let a=[];if(e>0&&a.push((0,r.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=s?`${t} Error (${s})`:`${t} Error`;a.push((0,r.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,r.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function b(){let[e,t]=(0,a.useState)([]),[s,l]=(0,a.useState)([]),[i,o]=(0,a.useState)(!0),[p,m]=(0,a.useState)(!1),[u,f]=(0,a.useState)(!1),[b,C]=(0,a.useState)(null),[k,T]=(0,a.useState)(null),w=(0,x.i)();(0,a.useEffect)(()=>{(async()=>{try{let[e,s]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),r=await e.json(),a=await s.json();e.ok&&t(r.connections||[]),s.ok&&l(a.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{o(!1)}})()},[]);let A=(t,s)=>{let r=e.filter(e=>e.provider===t&&e.authType===s),a=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},l=r.filter(e=>{let t=a(e);return"active"===t||"success"===t}).length,i=r.filter(e=>{let t=a(e);return"error"===t||"expired"===t||"unavailable"===t}),n=i.length,o=r.length,d=o>0&&r.every(e=>!1===e.isActive),c=i.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:l,error:n,total:o,errorCode:c?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let r=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===r||"403"===r)return"AUTH";if(r&&"ERR"!==r)return r;let a=(e.lastError||"").toLowerCase();return a.includes("runtime")||a.includes("not runnable")||a.includes("not installed")?"RUNTIME":a.includes("invalid api key")||a.includes("token invalid")||a.includes("revoked")||a.includes("unauthorized")?"AUTH":"ERR"}(c):null,errorTime:c?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let r=Math.floor(s/24);return`${r}d ago`}(c.lastErrorAt):null,allDisabled:d}},I=async(s,r,a)=>{let l=e.filter(e=>e.provider===s&&e.authType===r);t(e=>e.map(e=>e.provider===s&&e.authType===r?{...e,isActive:a}:e)),await Promise.allSettled(l.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:a})})))},E=async(e,t=null)=>{if(!b){C("provider"===e?t:e),T(null);try{let s=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),r=await s.json();if(T(r),r.summary){let{passed:e,failed:t,total:s}=r.summary;0===t?w.success(`All ${s} tests passed`):w.warning(`${e}/${s} passed, ${t} failed`)}}catch(e){T({error:"Test request failed"}),w.error("Provider test failed")}finally{C(null)}}},$=s.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})),R=s.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"}));return i?(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(n.Qv,{}),(0,r.jsx)(n.Qv,{})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:"OAuth Providers"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(h,{}),(0,r.jsxs)("button",{onClick:()=>E("oauth"),disabled:!!b,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"oauth"===b?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===b?" animate-spin":""}`,children:"play_arrow"}),"oauth"===b?"Testing...":"Test All"]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Object.entries(d.zN).map(([e,t])=>(0,r.jsx)(v,{providerId:e,provider:t,stats:A(e,"oauth"),authType:"oauth",onToggle:t=>I(e,"oauth",t)},e))})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:"Free & Free Tier Providers"}),(0,r.jsxs)("button",{onClick:()=>E("free"),disabled:!!b,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"free"===b?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===b?" animate-spin":""}`,children:"play_arrow"}),"free"===b?"Testing...":"Test All"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[Object.entries(c.IS).map(([e,t])=>(0,r.jsx)(v,{providerId:e,provider:t,stats:A(e,"oauth"),authType:"free",onToggle:t=>I(e,"oauth",t)},e)),Object.entries(c.nJ).map(([e,t])=>(0,r.jsx)(g,{providerId:e,provider:t,stats:A(e,"apikey"),authType:"apikey",onToggle:t=>I(e,"apikey",t)},e))]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:["API Key Providers"," "]}),(0,r.jsxs)("button",{onClick:()=>E("apikey"),disabled:!!b,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"apikey"===b?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===b?" animate-spin":""}`,children:"play_arrow"}),"apikey"===b?"Testing...":"Test All"]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Object.entries(d.fg).filter(([,e])=>(e.serviceKinds??["llm"]).includes("llm")).map(([e,t])=>(0,r.jsx)(g,{providerId:e,provider:t,stats:A(e,"apikey"),authType:"apikey",onToggle:t=>I(e,"apikey",t)},e))})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:["API Key Compatible Providers"," "]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>f(!0),children:"Add Anthropic Compatible"}),(0,r.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>m(!0),className:"!bg-white !text-black hover:!bg-gray-100",children:"Add OpenAI Compatible"})]})]}),0===$.length&&0===R.length?(0,r.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"extension"}),(0,r.jsx)("p",{className:"text-text-muted text-sm",children:"No compatible providers added yet"}),(0,r.jsx)("p",{className:"text-text-muted text-xs mt-1",children:"Use the buttons above to add OpenAI or Anthropic compatible endpoints"})]}):(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[...$,...R].map(e=>(0,r.jsx)(g,{providerId:e.id,provider:e,stats:A(e.id,"apikey"),authType:"compatible",onToggle:t=>I(e.id,"apikey",t)},e.id))})]}),(0,r.jsx)(j,{isOpen:p,onClose:()=>m(!1),onCreated:e=>{l(t=>[...t,e]),m(!1)}}),(0,r.jsx)(y,{isOpen:u,onClose:()=>f(!1),onCreated:e=>{l(t=>[...t,e]),f(!1)}}),k&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[10vh]",onClick:()=>T(null),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,r.jsx)("button",{onClick:()=>T(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,r.jsx)("div",{className:"p-5",children:(0,r.jsx)(N,{results:k})})]})]})]})}function v({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:c,errorTime:p,allDisabled:x}=s,u=!!t.noAuth;return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${x?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:x?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):u?(0,r.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,r.jsxs)(r.Fragment,{children:[f(i,d,c),p&&(0,r.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,r.jsx)("div",{className:"flex items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!x)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!x,onChange:()=>{},title:x?"Enable provider":"Disable provider"})})})]})})})}function g({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:p,errorTime:x,allDisabled:u}=s,h=e.startsWith(c.JH),b=e.startsWith(c.DI);return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${u?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:h?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":b?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:u?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,r.jsxs)(r.Fragment,{children:[f(i,d,p),h&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),b&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),x&&(0,r.jsx)("span",{className:"text-text-muted",children:x})]})})]})]}),(0,r.jsx)("div",{className:"flex items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!u)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!u,onChange:()=>{},title:u?"Enable provider":"Disable provider"})})})]})})})}function j({isOpen:e,onClose:t,onCreated:s}){let[l,i]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[o,d]=(0,a.useState)(!1),[c,p]=(0,a.useState)(""),[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(!1),[f,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{i(e=>({...e,baseUrl:"https://api.openai.com/v1"}))},[l.apiType]);let v=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,apiType:l.apiType,baseUrl:l.baseUrl,type:"openai-compatible"})}),t=await e.json();e.ok&&(s(t.node),i({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),p(""),b(null))}catch(e){console.log("Error creating OpenAI Compatible node:",e)}finally{d(!1)}}},g=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"openai-compatible",modelId:m.trim()||void 0})}),t=await e.json();b(t)}catch{b({valid:!1,error:"Network error"})}finally{h(!1)}};return(0,r.jsx)(n.aF,{isOpen:e,title:"Add OpenAI Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"OpenAI Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(n.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:l.apiType,onChange:e=>i({...l,apiType:e.target.value})}),(0,r.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.openai.com/v1",hint:"Use the base URL (ending in /v1) for your OpenAI-compatible API."}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:m,onChange:e=>x(e.target.value),placeholder:"e.g. gpt-4, claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(n.$n,{onClick:g,disabled:!c||u||!l.baseUrl.trim(),variant:"secondary",children:u?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:s}=f;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:v,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function y({isOpen:e,onClose:t,onCreated:s}){let[l,i]=(0,a.useState)({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),[o,d]=(0,a.useState)(!1),[c,p]=(0,a.useState)(""),[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(!1),[f,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&(b(null),p(""),x(""))},[e]);let v=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,baseUrl:l.baseUrl,type:"anthropic-compatible"})}),t=await e.json();e.ok&&(s(t.node),i({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),p(""),b(null))}catch(e){console.log("Error creating Anthropic Compatible node:",e)}finally{d(!1)}}},g=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"anthropic-compatible",modelId:m.trim()||void 0})}),t=await e.json();b(t)}catch{b({valid:!1,error:"Network error"})}finally{h(!1)}};return(0,r.jsx)(n.aF,{isOpen:e,title:"Add Anthropic Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"Anthropic Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"ac-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.anthropic.com/v1",hint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages."}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:m,onChange:e=>x(e.target.value),placeholder:"e.g. claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(n.$n,{onClick:g,disabled:!c||u||!l.baseUrl.trim(),variant:"secondary",children:u?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:s}=f;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:v,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function N({results:e}){if(e.error&&!e.results)return(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,r.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:s}=e,a=e.results||[];return(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[t&&(0,r.jsxs)("div",{className:"flex items-center gap-3 text-xs mb-1",children:[(0,r.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[s]||s," Test"]}),(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,r.jsxs)("span",{className:"text-text-muted ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-2 text-xs px-3 py-2 rounded-lg bg-black/[0.03] dark:bg-white/[0.03]",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"font-medium",children:e.connectionName}),(0,r.jsxs)("span",{className:"text-text-muted ml-1.5",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,r.jsxs)("span",{className:"text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,r.jsx)("span",{className:`text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===a.length&&(0,r.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}v.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},g.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},j.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},y.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},N.propTypes={results:i().shape({mode:i().string,results:i().array,summary:i().shape({total:i().number,passed:i().number,failed:i().number}),error:i().string}).isRequired}}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=18255)),_N_E=e.O()}]);
@@ -1,2 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6812],{41483:(e,t,r)=>{Promise.resolve().then(r.bind(r,57076))},57076:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var l=r(95155),s=r(12115),o=r(35497),a=r(65921);function i(e={}){return{name:e.name||"",proxyUrl:e.proxyUrl||"",noProxy:e.noProxy||"",isActive:!1!==e.isActive,strictProxy:!0===e.strictProxy}}function n(){let[e,t]=(0,s.useState)([]),[r,n]=(0,s.useState)(!0),[c,d]=(0,s.useState)(!1),[x,p]=(0,s.useState)(!1),[m,h]=(0,s.useState)(!1),[u,y]=(0,s.useState)(null),[f,v]=(0,s.useState)(i()),[j,g]=(0,s.useState)(""),[b,N]=(0,s.useState)({vercelToken:"",projectName:"vercel-relay"}),[k,P]=(0,s.useState)(!1),[w,C]=(0,s.useState)(!1),[$,S]=(0,s.useState)(!1),[E,U]=(0,s.useState)(null),T=(0,a.i)(),A=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/proxy-pools?includeUsage=true",{cache:"no-store"}),r=await e.json();e.ok&&t(r.proxyPools||[])}catch(e){console.log("Error fetching proxy pools:",e)}finally{n(!1)}},[]);(0,s.useEffect)(()=>{A()},[A]);let I=()=>{y(null),v(i())},O=()=>{I(),d(!0)},D=()=>{d(!1),I()},F=async()=>{let e={name:f.name.trim(),proxyUrl:f.proxyUrl.trim(),noProxy:f.noProxy.trim(),isActive:!0===f.isActive,strictProxy:!0===f.strictProxy};if(e.name&&e.proxyUrl){P(!0);try{let t=!!u,r=await fetch(t?`/api/proxy-pools/${u.id}`:"/api/proxy-pools",{method:t?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.ok)await A(),D(),T.success(u?"Proxy pool updated":"Proxy pool created");else{let e=await r.json();T.error(e.error||"Failed to save proxy pool")}}catch(e){console.log("Error saving proxy pool:",e)}finally{P(!1)}}},V=async e=>{if(confirm(`Delete proxy pool "${e.name}"?`))try{let r=await fetch(`/api/proxy-pools/${e.id}`,{method:"DELETE"});if(r.ok){t(t=>t.filter(t=>t.id!==e.id)),T.success("Proxy pool deleted");return}let l=await r.json();409===r.status?T.warning(`Cannot delete: ${l.boundConnectionCount||0} connection(s) are still using this pool.`):T.error(l.error||"Failed to delete proxy pool")}catch(e){console.log("Error deleting proxy pool:",e),T.error("Failed to delete proxy pool")}},L=async e=>{U(e);try{let t=await fetch(`/api/proxy-pools/${e}/test`,{method:"POST"}),r=await t.json();if(!t.ok)return void T.error(r.error||"Failed to test proxy");await A(),T.success(r.ok?"Proxy test passed":"Proxy test failed")}catch(e){console.log("Error testing proxy pool:",e),T.error("Failed to test proxy")}finally{U(null)}},_=()=>{w||p(!1)},R=()=>{$||h(!1)},W=async()=>{if(b.vercelToken.trim()){S(!0);try{let e=await fetch("/api/proxy-pools/vercel-deploy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),t=await e.json();e.ok?(await A(),R(),T.success(`Deployed: ${t.deployUrl}`)):T.error(t.error||"Deploy failed")}catch(e){console.log("Error deploying Vercel relay:",e),T.error("Deploy failed")}finally{S(!1)}}},B=async()=>{let t=j.split(/\r?\n/).map(e=>e.trim()).filter(Boolean);if(0===t.length)return void T.warning("Please paste at least one proxy line.");let r=[],l=[];if(t.forEach((e,t)=>{try{let l=(e=>{let t=e.trim();if(!t)return null;if(t.includes("://")){let e=new URL(t),r=e.port?`${e.hostname}:${e.port}`:e.hostname;return{proxyUrl:e.toString(),name:`Imported ${r}`}}let r=t.split(":");if(4===r.length){let[e,t,l,s]=r;if(!e||!t||!l||!s)throw Error("Invalid host:port:user:pass format");return{proxyUrl:new URL(`http://${encodeURIComponent(l)}:${encodeURIComponent(s)}@${e}:${t}`).toString(),name:`Imported ${e}:${t}`}}throw Error("Unsupported format")})(e);l&&r.push({...l,lineNumber:t+1})}catch(e){l.push(`Line ${t+1}: ${e.message}`)}}),l.length>0)return void T.error(`Invalid proxy format:
2
- ${l.join("\n")}`);C(!0);try{let t=new Set(e.map(e=>`${(e.proxyUrl||"").trim()}|||${(e.noProxy||"").trim()}`)),l=0,s=0,o=0;for(let e of r){let r=`${e.proxyUrl}|||`;if(t.has(r)){s+=1;continue}(await fetch("/api/proxy-pools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,proxyUrl:e.proxyUrl,noProxy:"",isActive:!0})})).ok?(l+=1,t.add(r)):o+=1}await A(),p(!1),T.success(`Batch import completed: Created ${l}, Skipped ${s}, Failed ${o}`)}catch(e){console.log("Error batch importing proxies:",e),T.error("Batch import failed")}finally{C(!1)}},z=(0,s.useMemo)(()=>e.filter(e=>!0===e.isActive).length,[e]);return r?(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(o.Qv,{}),(0,l.jsx)(o.Qv,{})]}):(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"text-2xl font-semibold",children:"Proxy Pools"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Manage reusable per-connection proxies and bind them to provider connections."})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(o.$n,{variant:"secondary",icon:"cloud_upload",onClick:()=>{N({vercelToken:"",projectName:"vercel-relay"}),h(!0)},children:"Vercel Relay"}),(0,l.jsx)(o.$n,{variant:"secondary",icon:"upload",onClick:()=>{g(""),p(!0)},children:"Batch Import"}),(0,l.jsx)(o.$n,{icon:"add",onClick:O,children:"Add Proxy Pool"})]})]}),(0,l.jsxs)(o.Zp,{children:[(0,l.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(o.Ex,{variant:"default",children:["Total: ",e.length]}),(0,l.jsxs)(o.Ex,{variant:"success",children:["Active: ",z]})]})}),0===e.length?(0,l.jsxs)("div",{className:"text-center py-10",children:[(0,l.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No proxy pool entries yet"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create a proxy pool entry, then assign it to connections."}),(0,l.jsx)(o.$n,{icon:"add",onClick:O,children:"Add Proxy Pool"})]}):(0,l.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.04] dark:divide-white/[0.05]",children:e.map(e=>{var t;return(0,l.jsxs)("div",{className:"py-3 flex items-center justify-between gap-3 group",children:[(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,l.jsx)("p",{className:"text-sm font-medium truncate",children:e.name}),(0,l.jsx)(o.Ex,{variant:"active"===(t=e.testStatus)?"success":"error"===t?"error":"default",size:"sm",dot:!0,children:e.testStatus||"unknown"}),(0,l.jsx)(o.Ex,{variant:e.isActive?"success":"default",size:"sm",children:e.isActive?"active":"inactive"}),"vercel"===e.type&&(0,l.jsx)(o.Ex,{variant:"default",size:"sm",children:"vercel relay"}),(0,l.jsxs)(o.Ex,{variant:"default",size:"sm",children:[e.boundConnectionCount||0," bound"]})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate mt-1",children:e.proxyUrl}),e.noProxy?(0,l.jsxs)("p",{className:"text-xs text-text-muted truncate",children:["No proxy: ",e.noProxy]}):null,(0,l.jsxs)("p",{className:"text-[11px] text-text-muted mt-1",children:["Last tested: ",function(e){if(!e)return"Never";let t=new Date(e);return Number.isNaN(t.getTime())?"Never":t.toLocaleString()}(e.lastTestedAt),e.lastError?` \xb7 ${e.lastError}`:""]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,l.jsx)("button",{onClick:()=>L(e.id),className:"p-2 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",title:"Test proxy",disabled:E===e.id,children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:E===e.id?{animation:"spin 1s linear infinite"}:void 0,children:E===e.id?"progress_activity":"science"})}),(0,l.jsx)("button",{onClick:()=>{y(e),v(i(e)),d(!0)},className:"p-2 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",title:"Edit",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,l.jsx)("button",{onClick:()=>V(e),className:"p-2 rounded hover:bg-red-500/10 text-red-500",title:"Delete",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,l.jsx)(o.aF,{isOpen:x,title:"Batch Import Proxies",onClose:_,children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"text-sm font-medium text-text-main mb-1 block",children:"Paste Proxy List (One per line)"}),(0,l.jsx)("textarea",{value:j,onChange:e=>g(e.target.value),placeholder:"http://user:pass@127.0.0.1:7897\n127.0.0.1:7897:user:pass",className:"w-full min-h-[180px] py-2 px-3 text-sm text-text-main bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none transition-all"}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Supported formats: protocol://user:pass@host:port, host:port:user:pass"})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(o.$n,{fullWidth:!0,onClick:B,disabled:!j.trim()||w,children:w?"Importing...":"Import"}),(0,l.jsx)(o.$n,{fullWidth:!0,variant:"ghost",onClick:_,disabled:w,children:"Cancel"})]})]})}),(0,l.jsx)(o.aF,{isOpen:m,title:"Deploy Vercel Relay",onClose:R,children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"rounded-lg bg-blue-500/5 border border-blue-500/10 p-3 flex flex-col gap-1.5",children:[(0,l.jsx)("p",{className:"text-sm text-text-main font-medium",children:"What is Vercel Relay?"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Deploys an edge relay function to Vercel. All AI provider requests will be forwarded through Vercel's edge network, masking your real IP from providers."}),(0,l.jsxs)("ul",{className:"text-xs text-text-muted list-disc pl-4 space-y-0.5",children:[(0,l.jsx)("li",{children:"Your IP is replaced by Vercel's dynamic edge IPs (hundreds of IPs across 20+ global regions)"}),(0,l.jsx)("li",{children:"Vercel serves millions of apps — providers can't block Vercel IPs without affecting legitimate traffic"}),(0,l.jsx)("li",{children:"Free tier: 100GB bandwidth/month, 500K edge invocations"}),(0,l.jsx)("li",{children:"Deploy multiple relays on different accounts for more IP diversity"})]})]}),(0,l.jsx)(o.pd,{label:"Vercel API Token",value:b.vercelToken,onChange:e=>N(t=>({...t,vercelToken:e.target.value})),placeholder:"your-vercel-api-token",hint:(0,l.jsxs)(l.Fragment,{children:["Token is used once for deployment and not stored. ",(0,l.jsx)("a",{href:"https://vercel.com/account/tokens",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Get token →"})]}),type:"password"}),(0,l.jsx)(o.pd,{label:"Project Name",value:b.projectName,onChange:e=>N(t=>({...t,projectName:e.target.value})),placeholder:"my-relay",hint:"Unique name for your Vercel project. Leave empty for auto-generated name."}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(o.$n,{fullWidth:!0,onClick:W,disabled:!b.vercelToken.trim()||$,children:$?"Deploying... (may take ~1 min)":"Deploy"}),(0,l.jsx)(o.$n,{fullWidth:!0,variant:"ghost",onClick:R,disabled:$,children:"Cancel"})]})]})}),(0,l.jsx)(o.aF,{isOpen:c,title:u?"Edit Proxy Pool":"Add Proxy Pool",onClose:D,children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(o.pd,{label:"Name",value:f.name,onChange:e=>v(t=>({...t,name:e.target.value})),placeholder:"Office Proxy"}),(0,l.jsx)(o.pd,{label:"Proxy URL",value:f.proxyUrl,onChange:e=>v(t=>({...t,proxyUrl:e.target.value})),placeholder:"http://127.0.0.1:7897"}),(0,l.jsx)(o.pd,{label:"No Proxy",value:f.noProxy,onChange:e=>v(t=>({...t,noProxy:e.target.value})),placeholder:"localhost,127.0.0.1,.internal",hint:"Comma-separated hosts/domains to bypass proxy"}),(0,l.jsxs)("div",{className:"rounded-lg border border-border/50 p-3 flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-medium text-sm",children:"Active"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Inactive pools are ignored by runtime resolution."})]}),(0,l.jsx)(o.lM,{checked:!0===f.isActive,onChange:()=>v(e=>({...e,isActive:!e.isActive})),disabled:k})]}),(0,l.jsxs)("div",{className:"rounded-lg border border-border/50 p-3 flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-medium text-sm",children:"Strict Proxy"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Fail request if proxy is unreachable instead of falling back to direct."})]}),(0,l.jsx)(o.lM,{checked:!0===f.strictProxy,onChange:()=>v(e=>({...e,strictProxy:!e.strictProxy})),disabled:k})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(o.$n,{fullWidth:!0,onClick:F,disabled:!f.name.trim()||!f.proxyUrl.trim()||k,children:k?"Saving...":"Save"}),(0,l.jsx)(o.$n,{fullWidth:!0,variant:"ghost",onClick:D,disabled:k,children:"Cancel"})]})]})})]})}}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=41483)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3528],{5214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=n(17828)},17825:(e,t,n)=>{Promise.resolve().then(n.bind(n,69472))},17828:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,n(64054).createAsyncLocalStorage)()},21957:(e,t,n)=>{"use strict";function r({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return r}}),n(95155),n(47650),n(5214),n(2451),n(53887)},41112:(e,t,n)=>{"use strict";function r({reason:e,children:t}){return t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),n(1980)},64054:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={bindSnapshot:function(){return i},createAsyncLocalStorage:function(){return o},createSnapshot:function(){return d}};for(var r in n)Object.defineProperty(t,r,{enumerable:!0,get:n[r]});let a=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class s{disable(){throw a}getStore(){}run(){throw a}exit(){throw a}enterWith(){throw a}static bind(e){return e}}let l="u">typeof globalThis&&globalThis.AsyncLocalStorage;function o(){return l?new l:new s}function i(e){return l?l.bind(e):s.bind(e)}function d(){return l?l.snapshot():function(e,...t){return e(...t)}}},68635:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let r=n(95155),a=n(12115),s=n(41112);function l(e){return{default:e&&"default"in e?e.default:e}}n(21957);let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},i=function(e){let t={...o,...e},n=(0,a.lazy)(()=>t.loader().then(l)),i=t.loading;function d(e){let l=i?(0,r.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,d=o?a.Suspense:a.Fragment,c=t.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(d,{...o?{fallback:l}:{},children:c})}return d.displayName="LoadableComponent",d}},69472:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var r=n(95155),a=n(12115),s=n(35497),l=n(11059),o=n(75707);let i=n.n(o)()(()=>n.e(8202).then(n.bind(n,28202)),{loadableGenerated:{webpack:()=>[28202]},ssr:!1}),d=[{id:1,label:"Client Request",file:"1_req_client.json",lang:"json",desc:"Raw request from client"},{id:2,label:"Source Body",file:"2_req_source.json",lang:"json",desc:"After initial conversion"},{id:3,label:"OpenAI Intermediate",file:"3_req_openai.json",lang:"json",desc:"source → openai"},{id:4,label:"Target Request",file:"4_req_target.json",lang:"json",desc:"openai → target + URL + headers"},{id:5,label:"Provider Response",file:"5_res_provider.txt",lang:"text",desc:"Raw SSE from provider"},{id:6,label:"OpenAI Response",file:"6_res_openai.txt",lang:"text",desc:"target → openai (response)"},{id:7,label:"Client Response",file:"7_res_client.txt",lang:"text",desc:"Final response to client"}],c={minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0};function u(){let[e,t]=(0,a.useState)({}),[n,o]=(0,a.useState)({1:!0}),[u,f]=(0,a.useState)({}),[m,x]=(0,a.useState)(null),g=(e,t)=>f(n=>({...n,[e]:t})),h=(e,n)=>t(t=>({...t,[e]:n})),b=e=>o(t=>{let n={};return d.forEach(e=>{n[e.id]=!1}),n[e]=!0,n}),y=async e=>{let t=d.find(t=>t.id===e);g(`load-${e}`,!0);try{let n=await fetch(`/api/translator/load?file=${t.file}`),r=await n.json();r.success?(h(e,r.content),1===e&&await j(r.content)):alert(r.error||"File not found")}catch(e){alert(e.message)}g(`load-${e}`,!1)},j=async e=>{try{let t="string"==typeof e?JSON.parse(e):e,n=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:1,body:t})}),r=await n.json();r.success&&x(r.result)}catch{}},_=(e,t)=>fetch("/api/translator/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,content:t})}).catch(()=>{}),v=async()=>{g("toOpenAI",!0);try{let t=e[1],n=JSON.parse(t);_("1_req_client.json",t),_("2_req_source.json",JSON.stringify({timestamp:new Date().toISOString(),headers:{},body:n.body||n},null,2));let r=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:2,body:n})}),a=await r.json();if(!a.success)return void alert(a.error);let s=JSON.stringify(a.result.body,null,2);h(3,s),b(3)}catch(e){alert(e.message)}g("toOpenAI",!1)},O=async()=>{g("toTarget",!0);try{let t=e[3],n=JSON.parse(t);_("3_req_openai.json",t);let r=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:3,body:{...n,provider:m?.provider,model:m?.model}})}),a=await r.json();if(!a.success)return void alert(a.error);let s={...a.result,provider:m?.provider,model:m?.model};h(4,JSON.stringify(s,null,2)),b(4)}catch(e){alert(e.message)}g("toTarget",!1)},S=async()=>{g("send",!0);try{let t=e[4],n=JSON.parse(t);_("4_req_target.json",t);let r=n.provider||m?.provider,a=n.model||m?.model;if(!r||!a)return void alert("Missing provider or model. Please run step 1 first to detect them.");let s=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,model:a,body:n.body||n})});if(!s.ok){let e=await s.json().catch(()=>({error:s.statusText}));alert(e.error||"Send failed");return}let l=s.body.getReader(),o=new TextDecoder,i="";for(;;){let{done:e,value:t}=await l.read();if(e)break;i+=o.decode(t,{stream:!0})}h(5,i),b(5),await fetch("/api/translator/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:"5_res_provider.txt",content:i})})}catch(e){alert(e.message)}finally{g("send",!1)}},{copy:w}=(0,l.C)(),N=async t=>{e[t]&&w(e[t],`translator-step-${t}`)};return(0,r.jsxs)("div",{className:"p-8 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Translator Debug"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Replay request flow — matches log files"})]}),m&&(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap justify-end",children:[(0,r.jsx)(p,{label:"src",value:m.sourceFormat,color:"blue"}),(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,r.jsx)(p,{label:"dst",value:m.targetFormat,color:"orange"}),(0,r.jsx)(p,{label:"provider",value:m.provider,color:"green"}),(0,r.jsx)(p,{label:"model",value:m.model,color:"purple"})]})]}),d.map(t=>{var a;let l=1===(a=t.id)?(0,r.jsx)(s.$n,{size:"sm",icon:"arrow_forward",loading:u.toOpenAI,onClick:v,children:"→ OpenAI"}):3===a?(0,r.jsx)(s.$n,{size:"sm",icon:"arrow_forward",loading:u.toTarget,onClick:O,children:"→ Target"}):4===a?(0,r.jsx)(s.$n,{size:"sm",icon:"send",loading:u.send,onClick:S,children:"Send"}):null,d=!!n[t.id],p=e[t.id]||"";return(0,r.jsx)(s.Zp,{children:(0,r.jsxs)("div",{className:"p-4 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("button",{onClick:()=>{let e;return e=t.id,o(t=>({...t,[e]:!t[e]}))},className:"flex items-center gap-2 flex-1 text-left group",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px] text-text-muted group-hover:text-primary transition-colors",children:d?"expand_more":"chevron_right"}),(0,r.jsx)("span",{className:"text-xs font-mono text-text-muted/60 w-4",children:t.id}),(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:t.label}),(0,r.jsx)("span",{className:"text-xs text-text-muted/60 font-mono",children:t.file}),p&&(0,r.jsxs)("span",{className:"text-xs text-green-500",children:["(",p.length," chars)"]})]}),!d&&(0,r.jsxs)("div",{className:"flex gap-1 shrink-0",children:[(0,r.jsx)(s.$n,{size:"sm",variant:"ghost",icon:"folder_open",loading:u[`load-${t.id}`],onClick:()=>y(t.id)}),l]})]}),d&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,r.jsx)(i,{height:"400px",defaultLanguage:"text"===t.lang?"plaintext":"json",value:p,onChange:e=>{h(t.id,e||""),1===t.id&&j(e||"")},theme:"vs-dark",options:c})}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,r.jsx)(s.$n,{size:"sm",variant:"outline",icon:"folder_open",loading:u[`load-${t.id}`],onClick:()=>y(t.id),children:"Load"}),(0,r.jsx)(s.$n,{size:"sm",variant:"outline",icon:"data_object",onClick:()=>(t=>{try{let n=JSON.parse(e[t]);h(t,JSON.stringify(n,null,2))}catch{}})(t.id),children:"Format"}),(0,r.jsx)(s.$n,{size:"sm",variant:"outline",icon:"content_copy",onClick:()=>N(t.id),children:"Copy"}),l]})]})]})},t.id)})]})}function p({label:e,value:t,color:n}){return(0,r.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-mono ${{blue:"bg-blue-500/10 text-blue-500",orange:"bg-orange-500/10 text-orange-500",green:"bg-green-500/10 text-green-500",purple:"bg-purple-500/10 text-purple-500"}[n]}`,children:[(0,r.jsxs)("span",{className:"text-text-muted/70 font-sans text-[10px]",children:[e,":"]}),t]})}},75707:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let r=n(73623)._(n(68635));function a(e,t){let n={};"function"==typeof e&&(n.loader=e);let a={...n,...t};return(0,r.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=17825)),_N_E=e.O()}]);