@thangnm.nip/irouter 0.0.10 → 0.0.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 (843) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +7 -5
  3. package/app/.next/build-manifest.json +4 -4
  4. package/app/.next/prerender-manifest.json +27 -3
  5. package/app/.next/required-server-files.json +6 -3
  6. package/app/.next/routes-manifest.json +12 -0
  7. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -0
  8. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -0
  9. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -0
  10. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  11. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  14. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  17. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  18. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/employees/[keyId]/page.js +2 -2
  20. package/app/.next/server/app/(dashboard)/dashboard/employees/[keyId]/page.js.nft.json +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/employees/[keyId]/page_client-reference-manifest.js +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/employees/page.js +2 -2
  23. package/app/.next/server/app/(dashboard)/dashboard/employees/page.js.nft.json +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/employees/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +3 -3
  26. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  29. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  32. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  33. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  35. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  36. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  38. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  39. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  41. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  42. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  43. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  44. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  45. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  46. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  47. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  48. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  49. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  50. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  51. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  52. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  53. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  54. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  55. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  56. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  57. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  58. package/app/.next/server/app/_global-error/page.js +3 -3
  59. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  60. package/app/.next/server/app/_global-error.html +1 -1
  61. package/app/.next/server/app/_global-error.rsc +1 -1
  62. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  63. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  64. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  65. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  66. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  67. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  68. package/app/.next/server/app/_not-found/page.js +2 -2
  69. package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
  70. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  71. package/app/.next/server/app/_not-found.html +1 -1
  72. package/app/.next/server/app/_not-found.rsc +5 -4
  73. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +5 -4
  74. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  75. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +5 -4
  76. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  77. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  78. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +3 -2
  79. package/app/.next/server/app/api/auth/login/route.js +1 -1
  80. package/app/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  81. package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  82. package/app/.next/server/app/api/auth/logout/route.js +1 -1
  83. package/app/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  84. package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  85. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  86. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  87. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  88. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +2 -2
  89. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  90. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  91. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
  92. package/app/.next/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  93. package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  94. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
  95. package/app/.next/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  96. package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  97. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  98. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  99. package/app/.next/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +1 -1
  100. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
  101. package/app/.next/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  102. package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  103. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  104. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  105. package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  106. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  107. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  108. package/app/.next/server/app/api/cli-tools/opencode-settings/route_client-reference-manifest.js +1 -1
  109. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  110. package/app/.next/server/app/api/cloud/auth/route.js.nft.json +1 -1
  111. package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
  112. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  113. package/app/.next/server/app/api/cloud/credentials/update/route.js.nft.json +1 -1
  114. package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
  115. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  116. package/app/.next/server/app/api/cloud/model/resolve/route.js.nft.json +1 -1
  117. package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
  118. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  119. package/app/.next/server/app/api/cloud/models/alias/route.js.nft.json +1 -1
  120. package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
  121. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  122. package/app/.next/server/app/api/combos/[id]/route.js.nft.json +1 -1
  123. package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  124. package/app/.next/server/app/api/combos/route.js +1 -1
  125. package/app/.next/server/app/api/combos/route.js.nft.json +1 -1
  126. package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
  127. package/app/.next/server/app/api/employees/[keyId]/stats/route.js +66 -1
  128. package/app/.next/server/app/api/employees/[keyId]/stats/route.js.nft.json +1 -1
  129. package/app/.next/server/app/api/employees/[keyId]/stats/route_client-reference-manifest.js +1 -1
  130. package/app/.next/server/app/api/employees/stats/route.js +66 -1
  131. package/app/.next/server/app/api/employees/stats/route.js.nft.json +1 -1
  132. package/app/.next/server/app/api/employees/stats/route_client-reference-manifest.js +1 -1
  133. package/app/.next/server/app/api/init/route.js +1 -1
  134. package/app/.next/server/app/api/init/route.js.nft.json +1 -1
  135. package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  136. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  137. package/app/.next/server/app/api/keys/[id]/route.js.nft.json +1 -1
  138. package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  139. package/app/.next/server/app/api/keys/route.js +1 -1
  140. package/app/.next/server/app/api/keys/route.js.nft.json +1 -1
  141. package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
  142. package/app/.next/server/app/api/locale/route.js +1 -1
  143. package/app/.next/server/app/api/locale/route.js.nft.json +1 -1
  144. package/app/.next/server/app/api/locale/route_client-reference-manifest.js +1 -1
  145. package/app/.next/server/app/api/models/alias/route.js +1 -1
  146. package/app/.next/server/app/api/models/alias/route.js.nft.json +1 -1
  147. package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  148. package/app/.next/server/app/api/models/availability/route.js +1 -0
  149. package/app/.next/server/app/api/models/availability/route.js.nft.json +1 -0
  150. package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -0
  151. package/app/.next/server/app/api/models/route.js +1 -1
  152. package/app/.next/server/app/api/models/route.js.nft.json +1 -1
  153. package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  154. package/app/.next/server/app/api/models/test/route.js +1 -1
  155. package/app/.next/server/app/api/models/test/route.js.nft.json +1 -1
  156. package/app/.next/server/app/api/models/test/route_client-reference-manifest.js +1 -1
  157. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  158. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  159. package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  160. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  161. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  162. package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  163. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  164. package/app/.next/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  165. package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  166. package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
  167. package/app/.next/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  168. package/app/.next/server/app/api/oauth/iflow/cookie/route_client-reference-manifest.js +1 -1
  169. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  170. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  171. package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  172. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  173. package/app/.next/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  174. package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  175. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  176. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  177. package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  178. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  179. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  180. package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  181. package/app/.next/server/app/api/pricing/route.js +1 -1
  182. package/app/.next/server/app/api/pricing/route.js.nft.json +1 -1
  183. package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  184. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  185. package/app/.next/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  186. package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  187. package/app/.next/server/app/api/provider-nodes/route.js +1 -1
  188. package/app/.next/server/app/api/provider-nodes/route.js.nft.json +1 -1
  189. package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  190. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  191. package/app/.next/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  192. package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  193. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  194. package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  195. package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  196. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  197. package/app/.next/server/app/api/providers/[id]/route.js.nft.json +1 -1
  198. package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  199. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  200. package/app/.next/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  201. package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  202. package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
  203. package/app/.next/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  204. package/app/.next/server/app/api/providers/[id]/test-models/route_client-reference-manifest.js +1 -1
  205. package/app/.next/server/app/api/providers/client/route.js +1 -1
  206. package/app/.next/server/app/api/providers/client/route.js.nft.json +1 -1
  207. package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  208. package/app/.next/server/app/api/providers/route.js +1 -1
  209. package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
  210. package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
  211. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  212. package/app/.next/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  213. package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  214. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  215. package/app/.next/server/app/api/providers/validate/route.js.nft.json +1 -1
  216. package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  217. package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
  218. package/app/.next/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  219. package/app/.next/server/app/api/proxy-pools/[id]/route_client-reference-manifest.js +1 -1
  220. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  221. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  222. package/app/.next/server/app/api/proxy-pools/[id]/test/route_client-reference-manifest.js +1 -1
  223. package/app/.next/server/app/api/proxy-pools/route.js +1 -1
  224. package/app/.next/server/app/api/proxy-pools/route.js.nft.json +1 -1
  225. package/app/.next/server/app/api/proxy-pools/route_client-reference-manifest.js +1 -1
  226. package/app/.next/server/app/api/settings/database/route.js +1 -1
  227. package/app/.next/server/app/api/settings/database/route.js.nft.json +1 -1
  228. package/app/.next/server/app/api/settings/database/route_client-reference-manifest.js +1 -1
  229. package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
  230. package/app/.next/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  231. package/app/.next/server/app/api/settings/proxy-test/route_client-reference-manifest.js +1 -1
  232. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  233. package/app/.next/server/app/api/settings/require-login/route.js.nft.json +1 -1
  234. package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
  235. package/app/.next/server/app/api/settings/route.js +1 -1
  236. package/app/.next/server/app/api/settings/route.js.nft.json +1 -1
  237. package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  238. package/app/.next/server/app/api/shutdown/route.js +1 -1
  239. package/app/.next/server/app/api/shutdown/route.js.nft.json +1 -1
  240. package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  241. package/app/.next/server/app/api/tags/route.js +1 -1
  242. package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  243. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  244. package/app/.next/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  245. package/app/.next/server/app/api/translator/console-logs/route_client-reference-manifest.js +1 -1
  246. package/app/.next/server/app/api/translator/console-logs/stream/route.js +2 -2
  247. package/app/.next/server/app/api/translator/console-logs/stream/route_client-reference-manifest.js +1 -1
  248. package/app/.next/server/app/api/translator/load/route.js +1 -1
  249. package/app/.next/server/app/api/translator/load/route.js.nft.json +1 -1
  250. package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  251. package/app/.next/server/app/api/translator/save/route.js +1 -1
  252. package/app/.next/server/app/api/translator/save/route.js.nft.json +1 -1
  253. package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  254. package/app/.next/server/app/api/translator/send/route.js +1 -1
  255. package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
  256. package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  257. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  258. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  259. package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  260. package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
  261. package/app/.next/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  262. package/app/.next/server/app/api/tunnel/disable/route_client-reference-manifest.js +1 -1
  263. package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
  264. package/app/.next/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  265. package/app/.next/server/app/api/tunnel/enable/route_client-reference-manifest.js +1 -1
  266. package/app/.next/server/app/api/tunnel/status/route.js +1 -1
  267. package/app/.next/server/app/api/tunnel/status/route.js.nft.json +1 -1
  268. package/app/.next/server/app/api/tunnel/status/route_client-reference-manifest.js +1 -1
  269. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  270. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  271. package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  272. package/app/.next/server/app/api/usage/chart/route.js +66 -1
  273. package/app/.next/server/app/api/usage/chart/route.js.nft.json +1 -1
  274. package/app/.next/server/app/api/usage/chart/route_client-reference-manifest.js +1 -1
  275. package/app/.next/server/app/api/usage/history/route.js +66 -1
  276. package/app/.next/server/app/api/usage/history/route.js.nft.json +1 -1
  277. package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  278. package/app/.next/server/app/api/usage/logs/route.js +66 -1
  279. package/app/.next/server/app/api/usage/logs/route.js.nft.json +1 -1
  280. package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
  281. package/app/.next/server/app/api/usage/providers/route.js +66 -1
  282. package/app/.next/server/app/api/usage/providers/route.js.nft.json +1 -1
  283. package/app/.next/server/app/api/usage/providers/route_client-reference-manifest.js +1 -1
  284. package/app/.next/server/app/api/usage/request-details/[id]/route.js +1 -1
  285. package/app/.next/server/app/api/usage/request-details/[id]/route.js.nft.json +1 -1
  286. package/app/.next/server/app/api/usage/request-details/[id]/route_client-reference-manifest.js +1 -1
  287. package/app/.next/server/app/api/usage/request-details/route.js +66 -1
  288. package/app/.next/server/app/api/usage/request-details/route.js.nft.json +1 -1
  289. package/app/.next/server/app/api/usage/request-details/route_client-reference-manifest.js +1 -1
  290. package/app/.next/server/app/api/usage/request-logs/route.js +66 -1
  291. package/app/.next/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  292. package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  293. package/app/.next/server/app/api/usage/stats/route.js +66 -1
  294. package/app/.next/server/app/api/usage/stats/route.js.nft.json +1 -1
  295. package/app/.next/server/app/api/usage/stats/route_client-reference-manifest.js +1 -1
  296. package/app/.next/server/app/api/usage/stream/route.js +69 -4
  297. package/app/.next/server/app/api/usage/stream/route.js.nft.json +1 -1
  298. package/app/.next/server/app/api/usage/stream/route_client-reference-manifest.js +1 -1
  299. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  300. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  301. package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  302. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  303. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  304. package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
  305. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  306. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  307. package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
  308. package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
  309. package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
  310. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  311. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  312. package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
  313. package/app/.next/server/app/api/v1/models/route.js +1 -1
  314. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  315. package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  316. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  317. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  318. package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  319. package/app/.next/server/app/api/v1/route.js +1 -1
  320. package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
  321. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  322. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  323. package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  324. package/app/.next/server/app/api/v1beta/models/route.js +1 -1
  325. package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  326. package/app/.next/server/app/api/v1internal/route.js +1 -1
  327. package/app/.next/server/app/api/v1internal/route.js.nft.json +1 -1
  328. package/app/.next/server/app/api/v1internal/route_client-reference-manifest.js +1 -1
  329. package/app/.next/server/app/api/version/route.js +1 -1
  330. package/app/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
  331. package/app/.next/server/app/callback/page.js +2 -2
  332. package/app/.next/server/app/callback/page.js.nft.json +1 -1
  333. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  334. package/app/.next/server/app/callback.html +1 -1
  335. package/app/.next/server/app/callback.rsc +6 -5
  336. package/app/.next/server/app/callback.segments/_full.segment.rsc +6 -5
  337. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  338. package/app/.next/server/app/callback.segments/_index.segment.rsc +5 -4
  339. package/app/.next/server/app/callback.segments/_tree.segment.rsc +3 -2
  340. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
  341. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  342. package/app/.next/server/app/dashboard/basic-chat.html +1 -0
  343. package/app/.next/server/app/dashboard/basic-chat.meta +17 -0
  344. package/app/.next/server/app/dashboard/basic-chat.rsc +24 -0
  345. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +6 -0
  346. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +5 -0
  347. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +5 -0
  348. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +6 -0
  349. package/app/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +24 -0
  350. package/app/.next/server/app/dashboard/basic-chat.segments/_head.segment.rsc +6 -0
  351. package/app/.next/server/app/dashboard/basic-chat.segments/_index.segment.rsc +9 -0
  352. package/app/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +6 -0
  353. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  354. package/app/.next/server/app/dashboard/cli-tools.rsc +8 -7
  355. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  356. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  357. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  358. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  359. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +8 -7
  360. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  361. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +5 -4
  362. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +3 -2
  363. package/app/.next/server/app/dashboard/combos.html +1 -1
  364. package/app/.next/server/app/dashboard/combos.rsc +7 -6
  365. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  366. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  367. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  368. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  369. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +7 -6
  370. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  371. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +5 -4
  372. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +3 -2
  373. package/app/.next/server/app/dashboard/employees.html +1 -1
  374. package/app/.next/server/app/dashboard/employees.rsc +7 -6
  375. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk/dashboard/employees/__PAGE__.segment.rsc +2 -2
  376. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk/dashboard/employees.segment.rsc +1 -1
  377. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  378. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  379. package/app/.next/server/app/dashboard/employees.segments/_full.segment.rsc +7 -6
  380. package/app/.next/server/app/dashboard/employees.segments/_head.segment.rsc +1 -1
  381. package/app/.next/server/app/dashboard/employees.segments/_index.segment.rsc +5 -4
  382. package/app/.next/server/app/dashboard/employees.segments/_tree.segment.rsc +3 -2
  383. package/app/.next/server/app/dashboard/endpoint.html +1 -1
  384. package/app/.next/server/app/dashboard/endpoint.rsc +8 -7
  385. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  386. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  387. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  388. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  389. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +8 -7
  390. package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  391. package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +5 -4
  392. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +3 -2
  393. package/app/.next/server/app/dashboard/mitm.html +1 -1
  394. package/app/.next/server/app/dashboard/mitm.rsc +7 -6
  395. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  396. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  397. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  398. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  399. package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -6
  400. package/app/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  401. package/app/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +5 -4
  402. package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +3 -2
  403. package/app/.next/server/app/dashboard/profile.html +1 -1
  404. package/app/.next/server/app/dashboard/profile.rsc +7 -6
  405. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  406. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  407. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  408. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  409. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +7 -6
  410. package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  411. package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +5 -4
  412. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +3 -2
  413. package/app/.next/server/app/dashboard/providers/new.html +1 -1
  414. package/app/.next/server/app/dashboard/providers/new.rsc +7 -6
  415. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  416. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  417. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  418. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  419. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  420. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -6
  421. package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  422. package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +5 -4
  423. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +3 -2
  424. package/app/.next/server/app/dashboard/providers.html +1 -1
  425. package/app/.next/server/app/dashboard/providers.rsc +7 -6
  426. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  427. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  428. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  429. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  430. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +7 -6
  431. package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  432. package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +5 -4
  433. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +3 -2
  434. package/app/.next/server/app/dashboard/proxy-pools.html +1 -1
  435. package/app/.next/server/app/dashboard/proxy-pools.rsc +7 -6
  436. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  437. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  438. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  439. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  440. package/app/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -6
  441. package/app/.next/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  442. package/app/.next/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +5 -4
  443. package/app/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +3 -2
  444. package/app/.next/server/app/dashboard/quota.html +2 -2
  445. package/app/.next/server/app/dashboard/quota.rsc +8 -7
  446. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  447. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  448. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  449. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  450. package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +8 -7
  451. package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  452. package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +5 -4
  453. package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +3 -2
  454. package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
  455. package/app/.next/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  456. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  457. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  458. package/app/.next/server/app/dashboard/settings/pricing.rsc +6 -5
  459. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -5
  460. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  461. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -4
  462. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +3 -2
  463. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  464. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  465. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  466. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  467. package/app/.next/server/app/dashboard/translator.html +1 -1
  468. package/app/.next/server/app/dashboard/translator.rsc +7 -6
  469. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  470. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  471. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  472. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  473. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +7 -6
  474. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  475. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +5 -4
  476. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +3 -2
  477. package/app/.next/server/app/dashboard/usage.html +1 -1
  478. package/app/.next/server/app/dashboard/usage.rsc +7 -6
  479. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  480. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  481. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  482. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  483. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +7 -6
  484. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  485. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +5 -4
  486. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +3 -2
  487. package/app/.next/server/app/dashboard.html +1 -1
  488. package/app/.next/server/app/dashboard.rsc +6 -5
  489. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +1 -1
  490. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  491. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  492. package/app/.next/server/app/dashboard.segments/_full.segment.rsc +6 -5
  493. package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
  494. package/app/.next/server/app/dashboard.segments/_index.segment.rsc +5 -4
  495. package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +3 -2
  496. package/app/.next/server/app/favicon.ico/route.js +1 -1
  497. package/app/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  498. package/app/.next/server/app/index.html +1 -1
  499. package/app/.next/server/app/index.rsc +5 -4
  500. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  501. package/app/.next/server/app/index.segments/_full.segment.rsc +5 -4
  502. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  503. package/app/.next/server/app/index.segments/_index.segment.rsc +5 -4
  504. package/app/.next/server/app/index.segments/_tree.segment.rsc +3 -2
  505. package/app/.next/server/app/landing/page.js +2 -2
  506. package/app/.next/server/app/landing/page.js.nft.json +1 -1
  507. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  508. package/app/.next/server/app/landing.html +1 -1
  509. package/app/.next/server/app/landing.rsc +6 -5
  510. package/app/.next/server/app/landing.segments/_full.segment.rsc +6 -5
  511. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  512. package/app/.next/server/app/landing.segments/_index.segment.rsc +5 -4
  513. package/app/.next/server/app/landing.segments/_tree.segment.rsc +3 -2
  514. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  515. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  516. package/app/.next/server/app/login/page.js +2 -2
  517. package/app/.next/server/app/login/page.js.nft.json +1 -1
  518. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  519. package/app/.next/server/app/login.html +1 -1
  520. package/app/.next/server/app/login.rsc +6 -5
  521. package/app/.next/server/app/login.segments/_full.segment.rsc +6 -5
  522. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  523. package/app/.next/server/app/login.segments/_index.segment.rsc +5 -4
  524. package/app/.next/server/app/login.segments/_tree.segment.rsc +3 -2
  525. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  526. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  527. package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
  528. package/app/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  529. package/app/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  530. package/app/.next/server/app/page.js +2 -2
  531. package/app/.next/server/app/page.js.nft.json +1 -1
  532. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  533. package/app/.next/server/app-paths-manifest.json +7 -5
  534. package/app/.next/server/chunks/1130.js +1 -1
  535. package/app/.next/server/chunks/118.js +1 -0
  536. package/app/.next/server/chunks/1220.js +1 -1
  537. package/app/.next/server/chunks/1424.js +1 -1
  538. package/app/.next/server/chunks/2664.js +1 -0
  539. package/app/.next/server/chunks/3093.js +72 -7
  540. package/app/.next/server/chunks/336.js +66 -1
  541. package/app/.next/server/chunks/412.js +2 -2
  542. package/app/.next/server/chunks/5270.js +1 -1
  543. package/app/.next/server/chunks/5708.js +1 -0
  544. package/app/.next/server/chunks/6072.js +43 -0
  545. package/app/.next/server/chunks/6182.js +4 -4
  546. package/app/.next/server/chunks/63.js +3 -3
  547. package/app/.next/server/chunks/649.js +1 -1
  548. package/app/.next/server/chunks/6828.js +1 -1
  549. package/app/.next/server/chunks/7774.js +2 -2
  550. package/app/.next/server/chunks/8895.js +2 -2
  551. package/app/.next/server/chunks/9201.js +1 -1
  552. package/app/.next/server/chunks/9718.js +1 -1
  553. package/app/.next/server/middleware-build-manifest.js +1 -1
  554. package/app/.next/server/middleware.js +3 -3
  555. package/app/.next/server/next-font-manifest.js +1 -1
  556. package/app/.next/server/next-font-manifest.json +1 -1
  557. package/app/.next/server/pages/404.html +1 -1
  558. package/app/.next/server/pages/500.html +1 -1
  559. package/app/.next/server/server-reference-manifest.js +1 -1
  560. package/app/.next/server/server-reference-manifest.json +1 -1
  561. package/app/.next/static/9Nr3N83B_j66eng2tH-u9/_buildManifest.js +1 -0
  562. package/app/.next/static/chunks/5242-250aca99680a5860.js +1 -0
  563. package/app/.next/static/chunks/5497-c246d6c185ae4515.js +7 -0
  564. package/app/.next/static/chunks/5772-901f1092d831ec37.js +3 -0
  565. package/app/.next/static/chunks/6902-135c924f2deafe46.js +1 -0
  566. package/app/.next/static/chunks/{9242-b33771537db21368.js → 9242-35c67551a31e8ed3.js} +2 -2
  567. package/app/.next/static/chunks/app/(dashboard)/dashboard/basic-chat/page-dbf8fae8c8837130.js +1 -0
  568. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-89c2a22ca02ca0d8.js +1 -0
  569. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-db322270ec972db0.js +1 -0
  570. package/app/.next/static/chunks/app/(dashboard)/dashboard/console-log/page-7b0d61cbbe1a47c2.js +1 -0
  571. package/app/.next/static/chunks/app/(dashboard)/dashboard/employees/[keyId]/page-260c2e244f08d44e.js +1 -0
  572. package/app/.next/static/chunks/app/(dashboard)/dashboard/employees/{page-8eb8511823bab5a8.js → page-1186beab09df32f8.js} +1 -1
  573. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/{page-5c259d7d447b6aee.js → page-11d04ce754400525.js} +2 -2
  574. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/{page-2346c1fbdc93e171.js → page-7bb014b116bacd70.js} +1 -1
  575. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-bc93a8fd4c287f29.js +1 -0
  576. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-f113b1a6fd5bf364.js +1 -0
  577. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-4d697847e773ee9f.js +1 -0
  578. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/{page-f38b4a179ec6ebeb.js → page-7d54c03780f36a77.js} +1 -1
  579. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-07b03df6908bbfc0.js +1 -0
  580. package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-e4f676cf79e465b1.js → page-5268c095e868ce3d.js} +2 -2
  581. package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/page-f33a92ade5e4806e.js +1 -0
  582. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-2bb6f99a3d1d9206.js +1 -0
  583. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-527700ed764617bf.js +1 -0
  584. package/app/.next/static/chunks/app/(dashboard)/{layout-0c70201c7bb15ab5.js → layout-fc4ee3669b9e2432.js} +1 -1
  585. package/app/.next/static/chunks/app/_global-error/page-bc93a8fd4c287f29.js +1 -0
  586. package/app/.next/static/chunks/app/_not-found/page-277ff0ac5be7dff3.js +1 -0
  587. package/app/.next/static/chunks/app/api/auth/login/route-bc93a8fd4c287f29.js +1 -0
  588. package/app/.next/static/chunks/app/api/auth/logout/route-bc93a8fd4c287f29.js +1 -0
  589. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-bc93a8fd4c287f29.js +1 -0
  590. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-bc93a8fd4c287f29.js +1 -0
  591. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-bc93a8fd4c287f29.js +1 -0
  592. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-bc93a8fd4c287f29.js +1 -0
  593. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-bc93a8fd4c287f29.js +1 -0
  594. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-bc93a8fd4c287f29.js +1 -0
  595. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-bc93a8fd4c287f29.js +1 -0
  596. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-bc93a8fd4c287f29.js +1 -0
  597. package/app/.next/static/chunks/app/api/cloud/auth/route-bc93a8fd4c287f29.js +1 -0
  598. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-bc93a8fd4c287f29.js +1 -0
  599. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-bc93a8fd4c287f29.js +1 -0
  600. package/app/.next/static/chunks/app/api/cloud/models/alias/route-bc93a8fd4c287f29.js +1 -0
  601. package/app/.next/static/chunks/app/api/combos/[id]/route-bc93a8fd4c287f29.js +1 -0
  602. package/app/.next/static/chunks/app/api/combos/route-bc93a8fd4c287f29.js +1 -0
  603. package/app/.next/static/chunks/app/api/employees/[keyId]/stats/route-bc93a8fd4c287f29.js +1 -0
  604. package/app/.next/static/chunks/app/api/employees/stats/route-bc93a8fd4c287f29.js +1 -0
  605. package/app/.next/static/chunks/app/api/init/route-bc93a8fd4c287f29.js +1 -0
  606. package/app/.next/static/chunks/app/api/keys/[id]/route-bc93a8fd4c287f29.js +1 -0
  607. package/app/.next/static/chunks/app/api/keys/route-bc93a8fd4c287f29.js +1 -0
  608. package/app/.next/static/chunks/app/api/locale/route-bc93a8fd4c287f29.js +1 -0
  609. package/app/.next/static/chunks/app/api/models/alias/route-bc93a8fd4c287f29.js +1 -0
  610. package/app/.next/static/chunks/app/api/models/availability/route-bc93a8fd4c287f29.js +1 -0
  611. package/app/.next/static/chunks/app/api/models/route-bc93a8fd4c287f29.js +1 -0
  612. package/app/.next/static/chunks/app/api/models/test/route-bc93a8fd4c287f29.js +1 -0
  613. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-bc93a8fd4c287f29.js +1 -0
  614. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-bc93a8fd4c287f29.js +1 -0
  615. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-bc93a8fd4c287f29.js +1 -0
  616. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-bc93a8fd4c287f29.js +1 -0
  617. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-bc93a8fd4c287f29.js +1 -0
  618. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-bc93a8fd4c287f29.js +1 -0
  619. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-bc93a8fd4c287f29.js +1 -0
  620. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-bc93a8fd4c287f29.js +1 -0
  621. package/app/.next/static/chunks/app/api/pricing/route-bc93a8fd4c287f29.js +1 -0
  622. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-bc93a8fd4c287f29.js +1 -0
  623. package/app/.next/static/chunks/app/api/provider-nodes/route-bc93a8fd4c287f29.js +1 -0
  624. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-bc93a8fd4c287f29.js +1 -0
  625. package/app/.next/static/chunks/app/api/providers/[id]/models/route-bc93a8fd4c287f29.js +1 -0
  626. package/app/.next/static/chunks/app/api/providers/[id]/route-bc93a8fd4c287f29.js +1 -0
  627. package/app/.next/static/chunks/app/api/providers/[id]/test/route-bc93a8fd4c287f29.js +1 -0
  628. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-bc93a8fd4c287f29.js +1 -0
  629. package/app/.next/static/chunks/app/api/providers/client/route-bc93a8fd4c287f29.js +1 -0
  630. package/app/.next/static/chunks/app/api/providers/route-bc93a8fd4c287f29.js +1 -0
  631. package/app/.next/static/chunks/app/api/providers/test-batch/route-bc93a8fd4c287f29.js +1 -0
  632. package/app/.next/static/chunks/app/api/providers/validate/route-bc93a8fd4c287f29.js +1 -0
  633. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-bc93a8fd4c287f29.js +1 -0
  634. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-bc93a8fd4c287f29.js +1 -0
  635. package/app/.next/static/chunks/app/api/proxy-pools/route-bc93a8fd4c287f29.js +1 -0
  636. package/app/.next/static/chunks/app/api/settings/database/route-bc93a8fd4c287f29.js +1 -0
  637. package/app/.next/static/chunks/app/api/settings/proxy-test/route-bc93a8fd4c287f29.js +1 -0
  638. package/app/.next/static/chunks/app/api/settings/require-login/route-bc93a8fd4c287f29.js +1 -0
  639. package/app/.next/static/chunks/app/api/settings/route-bc93a8fd4c287f29.js +1 -0
  640. package/app/.next/static/chunks/app/api/shutdown/route-bc93a8fd4c287f29.js +1 -0
  641. package/app/.next/static/chunks/app/api/tags/route-bc93a8fd4c287f29.js +1 -0
  642. package/app/.next/static/chunks/app/api/translator/console-logs/route-bc93a8fd4c287f29.js +1 -0
  643. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-bc93a8fd4c287f29.js +1 -0
  644. package/app/.next/static/chunks/app/api/translator/load/route-bc93a8fd4c287f29.js +1 -0
  645. package/app/.next/static/chunks/app/api/translator/save/route-bc93a8fd4c287f29.js +1 -0
  646. package/app/.next/static/chunks/app/api/translator/send/route-bc93a8fd4c287f29.js +1 -0
  647. package/app/.next/static/chunks/app/api/translator/translate/route-bc93a8fd4c287f29.js +1 -0
  648. package/app/.next/static/chunks/app/api/tunnel/disable/route-bc93a8fd4c287f29.js +1 -0
  649. package/app/.next/static/chunks/app/api/tunnel/enable/route-bc93a8fd4c287f29.js +1 -0
  650. package/app/.next/static/chunks/app/api/tunnel/status/route-bc93a8fd4c287f29.js +1 -0
  651. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-bc93a8fd4c287f29.js +1 -0
  652. package/app/.next/static/chunks/app/api/usage/chart/route-bc93a8fd4c287f29.js +1 -0
  653. package/app/.next/static/chunks/app/api/usage/history/route-bc93a8fd4c287f29.js +1 -0
  654. package/app/.next/static/chunks/app/api/usage/logs/route-bc93a8fd4c287f29.js +1 -0
  655. package/app/.next/static/chunks/app/api/usage/providers/route-bc93a8fd4c287f29.js +1 -0
  656. package/app/.next/static/chunks/app/api/usage/request-details/[id]/route-bc93a8fd4c287f29.js +1 -0
  657. package/app/.next/static/chunks/app/api/usage/request-details/route-bc93a8fd4c287f29.js +1 -0
  658. package/app/.next/static/chunks/app/api/usage/request-logs/route-bc93a8fd4c287f29.js +1 -0
  659. package/app/.next/static/chunks/app/api/usage/stats/route-bc93a8fd4c287f29.js +1 -0
  660. package/app/.next/static/chunks/app/api/usage/stream/route-bc93a8fd4c287f29.js +1 -0
  661. package/app/.next/static/chunks/app/api/v1/api/chat/route-bc93a8fd4c287f29.js +1 -0
  662. package/app/.next/static/chunks/app/api/v1/chat/completions/route-bc93a8fd4c287f29.js +1 -0
  663. package/app/.next/static/chunks/app/api/v1/embeddings/route-bc93a8fd4c287f29.js +1 -0
  664. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-bc93a8fd4c287f29.js +1 -0
  665. package/app/.next/static/chunks/app/api/v1/messages/route-bc93a8fd4c287f29.js +1 -0
  666. package/app/.next/static/chunks/app/api/v1/models/route-bc93a8fd4c287f29.js +1 -0
  667. package/app/.next/static/chunks/app/api/v1/responses/route-bc93a8fd4c287f29.js +1 -0
  668. package/app/.next/static/chunks/app/api/v1/route-bc93a8fd4c287f29.js +1 -0
  669. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-bc93a8fd4c287f29.js +1 -0
  670. package/app/.next/static/chunks/app/api/v1beta/models/route-bc93a8fd4c287f29.js +1 -0
  671. package/app/.next/static/chunks/app/api/v1internal/route-bc93a8fd4c287f29.js +1 -0
  672. package/app/.next/static/chunks/app/api/version/route-bc93a8fd4c287f29.js +1 -0
  673. package/app/.next/static/chunks/app/callback/{page-9d25f25730ec1a87.js → page-a288ef2f47fd5eb3.js} +1 -1
  674. package/app/.next/static/chunks/app/dashboard/settings/pricing/{page-107a395e4ebca682.js → page-f94017840394ebe8.js} +1 -1
  675. package/app/.next/static/chunks/app/landing/page-1d109564bc0bc007.js +1 -0
  676. package/app/.next/static/chunks/app/{layout-24366c741111b3ce.js → layout-372932853e1ca466.js} +1 -1
  677. package/app/.next/static/chunks/app/login/page-60dcddda96a06c28.js +1 -0
  678. package/app/.next/static/chunks/app/manifest.webmanifest/route-bc93a8fd4c287f29.js +1 -0
  679. package/app/.next/static/chunks/app/page-bc93a8fd4c287f29.js +1 -0
  680. package/app/.next/static/chunks/{main-app-d65284096ddebd50.js → main-app-825c409f56c59467.js} +1 -1
  681. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-bc93a8fd4c287f29.js +1 -0
  682. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-bc93a8fd4c287f29.js +1 -0
  683. package/app/.next/static/chunks/next/dist/client/components/builtin/global-error-45c792615bbed600.js +1 -0
  684. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-bc93a8fd4c287f29.js +1 -0
  685. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-bc93a8fd4c287f29.js +1 -0
  686. package/app/.next/static/chunks/{webpack-1094c4a28660424b.js → webpack-a2cf08368369c277.js} +1 -1
  687. package/app/.next/static/css/081a0afca5a9bd20.css +1 -0
  688. package/app/.next/static/css/bc7b15f1fd95fc16.css +1 -0
  689. package/app/i18n/README.ja-JP.md +1209 -0
  690. package/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
  691. package/app/node_modules/better-sqlite3/lib/database.js +90 -0
  692. package/app/node_modules/better-sqlite3/lib/index.js +3 -0
  693. package/app/node_modules/better-sqlite3/lib/methods/aggregate.js +43 -0
  694. package/app/node_modules/better-sqlite3/lib/methods/backup.js +67 -0
  695. package/app/node_modules/better-sqlite3/lib/methods/function.js +31 -0
  696. package/app/node_modules/better-sqlite3/lib/methods/inspect.js +7 -0
  697. package/app/node_modules/better-sqlite3/lib/methods/pragma.js +12 -0
  698. package/app/node_modules/better-sqlite3/lib/methods/serialize.js +16 -0
  699. package/app/node_modules/better-sqlite3/lib/methods/table.js +189 -0
  700. package/app/node_modules/better-sqlite3/lib/methods/transaction.js +78 -0
  701. package/app/node_modules/better-sqlite3/lib/methods/wrappers.js +54 -0
  702. package/app/node_modules/better-sqlite3/lib/sqlite-error.js +20 -0
  703. package/app/node_modules/better-sqlite3/lib/util.js +12 -0
  704. package/app/node_modules/better-sqlite3/package.json +59 -0
  705. package/app/node_modules/bindings/bindings.js +221 -0
  706. package/app/node_modules/bindings/package.json +28 -0
  707. package/app/node_modules/file-uri-to-path/index.js +66 -0
  708. package/app/node_modules/file-uri-to-path/package.json +32 -0
  709. package/app/open-sse/executors/iflow.js +5 -1
  710. package/app/open-sse/handlers/chatCore/nonStreamingHandler.js +10 -0
  711. package/app/open-sse/handlers/chatCore/sseToJsonHandler.js +61 -4
  712. package/app/open-sse/services/accountFallback.js +6 -0
  713. package/app/open-sse/services/combo.js +59 -7
  714. package/app/open-sse/translator/helpers/geminiHelper.js +9 -1
  715. package/app/open-sse/translator/request/openai-to-claude.js +5 -0
  716. package/app/open-sse/translator/request/openai-to-gemini.js +4 -2
  717. package/app/open-sse/translator/request/openai-to-kiro.js +32 -19
  718. package/app/open-sse/translator/response/openai-responses.js +6 -3
  719. package/app/package.json +3 -2
  720. package/app/public/providers/assemblyai.png +0 -0
  721. package/app/public/providers/deepgram.png +0 -0
  722. package/app/public/providers/hyperbolic.png +0 -0
  723. package/app/public/providers/nanobanana.png +0 -0
  724. package/app/server.js +1 -1
  725. package/package.json +1 -1
  726. package/app/.next/server/chunks/4755.js +0 -1
  727. package/app/.next/server/chunks/4989.js +0 -2
  728. package/app/.next/server/chunks/5984.js +0 -1
  729. package/app/.next/server/chunks/6649.js +0 -1
  730. package/app/.next/server/chunks/6836.js +0 -1
  731. package/app/.next/static/6NQ1tUqoUU-Vnz_TZ3Qh-/_buildManifest.js +0 -1
  732. package/app/.next/static/chunks/5497-9d0bc17e435a8c93.js +0 -7
  733. package/app/.next/static/chunks/5772-81f907ca6ec17897.js +0 -3
  734. package/app/.next/static/chunks/6902-59c9bd4da89daa6c.js +0 -1
  735. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-498aa76895400b7f.js +0 -1
  736. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-a2900807101b8a33.js +0 -1
  737. package/app/.next/static/chunks/app/(dashboard)/dashboard/console-log/page-6f9b44a8af082c71.js +0 -1
  738. package/app/.next/static/chunks/app/(dashboard)/dashboard/employees/[keyId]/page-349626384b53a093.js +0 -1
  739. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-aed1b231bb49a704.js +0 -1
  740. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-493eb2eac64153a5.js +0 -1
  741. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-7efc5c1ea19f02ec.js +0 -1
  742. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-cd17e15c22790e9b.js +0 -1
  743. package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/page-a6bd29ee2d2672c6.js +0 -1
  744. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-173679dc8c62c4a0.js +0 -1
  745. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-de3fbce2b737ec72.js +0 -1
  746. package/app/.next/static/chunks/app/_global-error/page-aed1b231bb49a704.js +0 -1
  747. package/app/.next/static/chunks/app/_not-found/page-7e26da6572c546ac.js +0 -1
  748. package/app/.next/static/chunks/app/api/auth/login/route-aed1b231bb49a704.js +0 -1
  749. package/app/.next/static/chunks/app/api/auth/logout/route-aed1b231bb49a704.js +0 -1
  750. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-aed1b231bb49a704.js +0 -1
  751. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-aed1b231bb49a704.js +0 -1
  752. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-aed1b231bb49a704.js +0 -1
  753. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-aed1b231bb49a704.js +0 -1
  754. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-aed1b231bb49a704.js +0 -1
  755. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-aed1b231bb49a704.js +0 -1
  756. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-aed1b231bb49a704.js +0 -1
  757. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-aed1b231bb49a704.js +0 -1
  758. package/app/.next/static/chunks/app/api/cloud/auth/route-aed1b231bb49a704.js +0 -1
  759. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-aed1b231bb49a704.js +0 -1
  760. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-aed1b231bb49a704.js +0 -1
  761. package/app/.next/static/chunks/app/api/cloud/models/alias/route-aed1b231bb49a704.js +0 -1
  762. package/app/.next/static/chunks/app/api/combos/[id]/route-aed1b231bb49a704.js +0 -1
  763. package/app/.next/static/chunks/app/api/combos/route-aed1b231bb49a704.js +0 -1
  764. package/app/.next/static/chunks/app/api/employees/[keyId]/stats/route-aed1b231bb49a704.js +0 -1
  765. package/app/.next/static/chunks/app/api/employees/stats/route-aed1b231bb49a704.js +0 -1
  766. package/app/.next/static/chunks/app/api/init/route-aed1b231bb49a704.js +0 -1
  767. package/app/.next/static/chunks/app/api/keys/[id]/route-aed1b231bb49a704.js +0 -1
  768. package/app/.next/static/chunks/app/api/keys/route-aed1b231bb49a704.js +0 -1
  769. package/app/.next/static/chunks/app/api/locale/route-aed1b231bb49a704.js +0 -1
  770. package/app/.next/static/chunks/app/api/models/alias/route-aed1b231bb49a704.js +0 -1
  771. package/app/.next/static/chunks/app/api/models/route-aed1b231bb49a704.js +0 -1
  772. package/app/.next/static/chunks/app/api/models/test/route-aed1b231bb49a704.js +0 -1
  773. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-aed1b231bb49a704.js +0 -1
  774. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-aed1b231bb49a704.js +0 -1
  775. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-aed1b231bb49a704.js +0 -1
  776. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-aed1b231bb49a704.js +0 -1
  777. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-aed1b231bb49a704.js +0 -1
  778. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-aed1b231bb49a704.js +0 -1
  779. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-aed1b231bb49a704.js +0 -1
  780. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-aed1b231bb49a704.js +0 -1
  781. package/app/.next/static/chunks/app/api/pricing/route-aed1b231bb49a704.js +0 -1
  782. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-aed1b231bb49a704.js +0 -1
  783. package/app/.next/static/chunks/app/api/provider-nodes/route-aed1b231bb49a704.js +0 -1
  784. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-aed1b231bb49a704.js +0 -1
  785. package/app/.next/static/chunks/app/api/providers/[id]/models/route-aed1b231bb49a704.js +0 -1
  786. package/app/.next/static/chunks/app/api/providers/[id]/route-aed1b231bb49a704.js +0 -1
  787. package/app/.next/static/chunks/app/api/providers/[id]/test/route-aed1b231bb49a704.js +0 -1
  788. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-aed1b231bb49a704.js +0 -1
  789. package/app/.next/static/chunks/app/api/providers/client/route-aed1b231bb49a704.js +0 -1
  790. package/app/.next/static/chunks/app/api/providers/route-aed1b231bb49a704.js +0 -1
  791. package/app/.next/static/chunks/app/api/providers/test-batch/route-aed1b231bb49a704.js +0 -1
  792. package/app/.next/static/chunks/app/api/providers/validate/route-aed1b231bb49a704.js +0 -1
  793. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-aed1b231bb49a704.js +0 -1
  794. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-aed1b231bb49a704.js +0 -1
  795. package/app/.next/static/chunks/app/api/proxy-pools/route-aed1b231bb49a704.js +0 -1
  796. package/app/.next/static/chunks/app/api/settings/database/route-aed1b231bb49a704.js +0 -1
  797. package/app/.next/static/chunks/app/api/settings/proxy-test/route-aed1b231bb49a704.js +0 -1
  798. package/app/.next/static/chunks/app/api/settings/require-login/route-aed1b231bb49a704.js +0 -1
  799. package/app/.next/static/chunks/app/api/settings/route-aed1b231bb49a704.js +0 -1
  800. package/app/.next/static/chunks/app/api/shutdown/route-aed1b231bb49a704.js +0 -1
  801. package/app/.next/static/chunks/app/api/tags/route-aed1b231bb49a704.js +0 -1
  802. package/app/.next/static/chunks/app/api/translator/console-logs/route-aed1b231bb49a704.js +0 -1
  803. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-aed1b231bb49a704.js +0 -1
  804. package/app/.next/static/chunks/app/api/translator/load/route-aed1b231bb49a704.js +0 -1
  805. package/app/.next/static/chunks/app/api/translator/save/route-aed1b231bb49a704.js +0 -1
  806. package/app/.next/static/chunks/app/api/translator/send/route-aed1b231bb49a704.js +0 -1
  807. package/app/.next/static/chunks/app/api/translator/translate/route-aed1b231bb49a704.js +0 -1
  808. package/app/.next/static/chunks/app/api/tunnel/disable/route-aed1b231bb49a704.js +0 -1
  809. package/app/.next/static/chunks/app/api/tunnel/enable/route-aed1b231bb49a704.js +0 -1
  810. package/app/.next/static/chunks/app/api/tunnel/status/route-aed1b231bb49a704.js +0 -1
  811. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-aed1b231bb49a704.js +0 -1
  812. package/app/.next/static/chunks/app/api/usage/chart/route-aed1b231bb49a704.js +0 -1
  813. package/app/.next/static/chunks/app/api/usage/history/route-aed1b231bb49a704.js +0 -1
  814. package/app/.next/static/chunks/app/api/usage/logs/route-aed1b231bb49a704.js +0 -1
  815. package/app/.next/static/chunks/app/api/usage/providers/route-aed1b231bb49a704.js +0 -1
  816. package/app/.next/static/chunks/app/api/usage/request-details/[id]/route-aed1b231bb49a704.js +0 -1
  817. package/app/.next/static/chunks/app/api/usage/request-details/route-aed1b231bb49a704.js +0 -1
  818. package/app/.next/static/chunks/app/api/usage/request-logs/route-aed1b231bb49a704.js +0 -1
  819. package/app/.next/static/chunks/app/api/usage/stats/route-aed1b231bb49a704.js +0 -1
  820. package/app/.next/static/chunks/app/api/usage/stream/route-aed1b231bb49a704.js +0 -1
  821. package/app/.next/static/chunks/app/api/v1/api/chat/route-aed1b231bb49a704.js +0 -1
  822. package/app/.next/static/chunks/app/api/v1/chat/completions/route-aed1b231bb49a704.js +0 -1
  823. package/app/.next/static/chunks/app/api/v1/embeddings/route-aed1b231bb49a704.js +0 -1
  824. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-aed1b231bb49a704.js +0 -1
  825. package/app/.next/static/chunks/app/api/v1/messages/route-aed1b231bb49a704.js +0 -1
  826. package/app/.next/static/chunks/app/api/v1/models/route-aed1b231bb49a704.js +0 -1
  827. package/app/.next/static/chunks/app/api/v1/responses/route-aed1b231bb49a704.js +0 -1
  828. package/app/.next/static/chunks/app/api/v1/route-aed1b231bb49a704.js +0 -1
  829. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-aed1b231bb49a704.js +0 -1
  830. package/app/.next/static/chunks/app/api/v1beta/models/route-aed1b231bb49a704.js +0 -1
  831. package/app/.next/static/chunks/app/api/v1internal/route-aed1b231bb49a704.js +0 -1
  832. package/app/.next/static/chunks/app/api/version/route-aed1b231bb49a704.js +0 -1
  833. package/app/.next/static/chunks/app/landing/page-a9fde23d5773613c.js +0 -1
  834. package/app/.next/static/chunks/app/login/page-650676272c54863b.js +0 -1
  835. package/app/.next/static/chunks/app/manifest.webmanifest/route-aed1b231bb49a704.js +0 -1
  836. package/app/.next/static/chunks/app/page-aed1b231bb49a704.js +0 -1
  837. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-aed1b231bb49a704.js +0 -1
  838. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-aed1b231bb49a704.js +0 -1
  839. package/app/.next/static/chunks/next/dist/client/components/builtin/global-error-3c2797dc10ec6327.js +0 -1
  840. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-aed1b231bb49a704.js +0 -1
  841. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-aed1b231bb49a704.js +0 -1
  842. package/app/.next/static/css/d8615a67dff78a65.css +0 -3
  843. /package/app/.next/static/{6NQ1tUqoUU-Vnz_TZ3Qh- → 9Nr3N83B_j66eng2tH-u9}/_ssgManifest.js +0 -0
@@ -12,4 +12,4 @@ model_provider = "9router"
12
12
  name = "9Router"
13
13
  base_url = "${P()}"
14
14
  wire_api = "responses"
15
- `},{filename:"~/.codex/auth.json",content:JSON.stringify({OPENAI_API_KEY:p},null,2)}])})]})}let k=process.env.NEXT_PUBLIC_CLOUD_URL;function l({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:m,cloudEnabled:n,initialStatus:o}){let p,q,r,s,[t,u]=(0,e.useState)(o||null),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)(""),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)({}),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)("");(0,e.useRef)(!1);let P=(()=>{if(!t?.installed)return null;let a=t.settings?.customModels?.find(a=>"custom:9Router-0"===a.id);if(!a)return"not_configured";let b=a.baseUrl?.includes("localhost")||a.baseUrl?.includes("127.0.0.1"),c=n&&k&&a.baseUrl?.startsWith(k),d=h&&a.baseUrl?.startsWith(h);return b||c||d?"configured":"other"})(),Q=async()=>{w(!0);try{let a=await fetch("/api/cli-tools/droid-settings"),b=await a.json();u(b)}catch(a){u({installed:!1,error:a.message})}finally{w(!1)}},R=()=>{let a=N||h;return a.endsWith("/v1")?a:`${a}/v1`},S=async()=>{y(!0),C(null);try{let a=D?.trim()||(j?.length>0?j[0].key:null)||(n?null:"sk_9router"),b=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:R(),apiKey:a,model:F})}),c=await b.json();b.ok?(C({type:"success",text:"Settings applied successfully!"}),Q()):C({type:"error",text:c.error||"Failed to apply settings"})}catch(a){C({type:"error",text:a.message})}finally{y(!1)}},T=async()=>{A(!0),C(null);try{let a=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),b=await a.json();a.ok?(C({type:"success",text:"Settings reset successfully!"}),G(""),E(""),Q()):C({type:"error",text:b.error||"Failed to reset settings"})}catch(a){C({type:"error",text:a.message})}finally{A(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/droid.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===P&&(0,d.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"===P&&(0,d.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"===P&&(0,d.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,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[v&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Factory Droid CLI..."})]}),!v&&t&&!t.installed&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Factory Droid CLI not installed"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Please install Factory Droid CLI to use this feature."})]})]}),!v&&t?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[t?.settings?.customModels?.find(a=>"custom:9Router-0"===a.id)?.baseUrl&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:t.settings.customModels.find(a=>"custom:9Router-0"===a.id).baseUrl})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:(p=N||h).endsWith("/v1")?p:`${p}/v1`,onChange:a=>O(a.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&&N!==h&&(0,d.jsx)("button",{onClick:()=>O(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),j.length>0?(0,d.jsx)("select",{value:D,onChange:a=>E(a.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:j.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:n?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:F,onChange:a=>G(a.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,d.jsx)("button",{onClick:()=>I(!0),disabled:!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),F&&(0,d.jsx)("button",{onClick:()=>G(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),B&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===B.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===B.type?"check_circle":"error"}),(0,d.jsx)("span",{children:B.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:S,disabled:!F,loading:x,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:T,disabled:!t?.has9Router,loading:z,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>M(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:H,onClose:()=>I(!1),onSelect:a=>{G(a.value),I(!1)},selectedModel:F,activeProviders:m,modelAliases:J,title:"Select Model for Factory Droid"}),(0,d.jsx)(f.uR,{isOpen:L,onClose:()=>M(!1),title:"Factory Droid - Manual Configuration",configs:(q=D&&D.trim()?D:n?"<API_KEY_FROM_DASHBOARD>":"sk_9router",r={customModels:[{model:F||"provider/model-id",id:"custom:9Router-0",index:0,baseUrl:R(),apiKey:q,displayName:F||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},s="u">typeof navigator&&navigator.platform,[{filename:s?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(r,null,2)}])})]})}function m({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:k,cloudEnabled:l,initialStatus:n}){let o,p,[q,r]=(0,e.useState)(n||null),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)({}),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)("");(0,e.useRef)(!1);let M=(()=>{if(!q?.installed)return null;let a=q.settings?.models?.providers?.["9router"];if(!a)return"not_configured";let b=a.baseUrl?.includes("localhost")||a.baseUrl?.includes("127.0.0.1")||a.baseUrl?.includes("0.0.0.0"),c=h&&a.baseUrl?.startsWith(h);return b||c?"configured":"other"})(),N=async()=>{t(!0);try{let a=await fetch("/api/cli-tools/openclaw-settings"),b=await a.json();r(b)}catch(a){r({installed:!1,error:a.message})}finally{t(!1)}},O=()=>{let a=K||"http://127.0.0.1:20128";return a.endsWith("/v1")?a:`${a}/v1`},P=async()=>{v(!0),z(null);try{let a=A?.trim()||(j?.length>0?j[0].key:null)||(l?null:"sk_9router"),b=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:O(),apiKey:a,model:C})}),c=await b.json();b.ok?(z({type:"success",text:"Settings applied successfully!"}),N()):z({type:"error",text:c.error||"Failed to apply settings"})}catch(a){z({type:"error",text:a.message})}finally{v(!1)}},Q=async()=>{x(!0),z(null);try{let a=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),b=await a.json();a.ok?(z({type:"success",text:"Settings reset successfully!"}),D(""),B(""),N()):z({type:"error",text:b.error||"Failed to reset settings"})}catch(a){z({type:"error",text:a.message})}finally{x(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/openclaw.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===M&&(0,d.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"===M&&(0,d.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"===M&&(0,d.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,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[s&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Open Claw CLI..."})]}),!s&&q&&!q.installed&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Open Claw CLI not installed"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Please install Open Claw CLI to use this feature."})]})]}),!s&&q?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[q?.settings?.models?.providers?.["9router"]?.baseUrl&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:q.settings.models.providers["9router"].baseUrl})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:(o=K||"http://127.0.0.1:20128").endsWith("/v1")?o:`${o}/v1`,onChange:a=>L(a.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"}),K&&K!==h&&(0,d.jsx)("button",{onClick:()=>L(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),j.length>0?(0,d.jsx)("select",{value:A,onChange:a=>B(a.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:j.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:l?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:C,onChange:a=>D(a.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,d.jsx)("button",{onClick:()=>F(!0),disabled:!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),C&&(0,d.jsx)("button",{onClick:()=>D(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),y&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===y.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===y.type?"check_circle":"error"}),(0,d.jsx)("span",{children:y.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:P,disabled:!C,loading:u,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:Q,disabled:!q?.has9Router,loading:w,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>J(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:E,onClose:()=>F(!1),onSelect:a=>{D(a.value),F(!1)},selectedModel:C,activeProviders:k,modelAliases:G,title:"Select Model for Open Claw"}),(0,d.jsx)(f.uR,{isOpen:I,onClose:()=>J(!1),title:"Open Claw - Manual Configuration",configs:(p=A&&A.trim()?A:l?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`9router/${C||"provider/model-id"}`}}},models:{providers:{"9router":{baseUrl:O(),apiKey:p,api:"openai-completions",models:[{id:C||"provider/model-id",name:(C||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}function n({toolId:a,tool:b,isExpanded:c,onToggle:h,baseUrl:i,apiKeys:j,activeProviders:k=[],cloudEnabled:l=!1,tunnelEnabled:m=!1}){let[o,p]=(0,e.useState)(null),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(()=>j?.length>0?j[0].key:""),w=a=>{let b=u&&u.trim()?u:l?"your-api-key":"sk_9router",c=i||"http://localhost:20128",d=c.endsWith("/v1")?c:`${c}/v1`;return a.replace(/\{\{baseUrl\}\}/g,d).replace(/\{\{apiKey\}\}/g,b).replace(/\{\{model\}\}/g,s||"provider/model-id")},x=async(a,b)=>{await navigator.clipboard.writeText(w(a)),p(b),setTimeout(()=>p(null),2e3)},y=k.length>0,z=()=>(!b.requiresExternalUrl||!!l||!!m)&&(!b.requiresCloud||!!l);return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:h,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:b.image?(0,d.jsx)(g.default,{src:b.image,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}}):b.icon?(0,d.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:b.color},children:b.icon}):(0,d.jsx)(g.default,{src:`/providers/${a}.png`,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:b.name}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:b.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${c?"rotate-180":""}`,children:"expand_more"})]}),c&&(0,d.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:b.guideSteps?(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[b.notes&&0!==b.notes.length?(0,d.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:b.notes.map((a,b)=>{if("cloudCheck"===a.type&&(l||m))return null;let c="warning"===a.type,e="cloudCheck"===a.type&&!l&&!m,f="bg-blue-500/10 border-blue-500/30",g="text-blue-600 dark:text-blue-400",h="text-blue-500",i="info";return c?(f="bg-yellow-500/10 border-yellow-500/30",g="text-yellow-600 dark:text-yellow-400",h="text-yellow-500",i="warning"):e&&(f="bg-red-500/10 border-red-500/30",g="text-red-600 dark:text-red-400",h="text-red-500",i="error"),(0,d.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${f}`,children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-lg ${h}`,children:i}),(0,d.jsx)("p",{className:`text-sm ${g}`,children:a.text})]},b)})}):null,z()&&b.guideSteps.map(a=>(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[(0,d.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:b.color},children:a.step}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-text",children:a.title}),a.desc&&(0,d.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:a.desc}),"apiKeySelector"===a.type&&(0,d.jsx)("div",{className:"mt-2 flex items-center gap-2",children:j&&j.length>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("select",{value:u,onChange:a=>v(a.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:j.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}),(0,d.jsx)("button",{onClick:()=>x(u,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===o?"check":"content_copy"})})]}):(0,d.jsx)("span",{className:"text-sm text-text-muted",children:l?"No API keys - Create one in Keys page":"sk_9router"})}),"modelSelector"===a.type&&(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:s,onChange:a=>t(a.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,d.jsx)("button",{onClick:()=>r(!0),disabled:!y,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${y?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),s&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:()=>x(s,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===o?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>t(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),a.value&&(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:w(a.value)}),a.copyable&&(0,d.jsx)("button",{onClick:()=>x(a.value,`${a.step}-${a.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:o===`${a.step}-${a.title}`?"check":"content_copy"})})]})]})]},a.step)),z()&&b.codeBlock&&(0,d.jsxs)("div",{className:"mt-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:b.codeBlock.language}),(0,d.jsxs)("button",{onClick:()=>x(b.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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===o?"check":"content_copy"}),"codeblock"===o?"Copied!":"Copy"]})]}),(0,d.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,d.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:w(b.codeBlock.code)})})]})]}):(0,d.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,d.jsx)(f.rq,{isOpen:q,onClose:()=>r(!1),onSelect:a=>{t(a.value)},selectedModel:s,activeProviders:k,title:"Select Model"})]})}function o({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:l}){let m,[n,p]=(0,e.useState)(l||null),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)({}),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)(""),M=(()=>{if(!n?.installed)return null;if(!n.config)return"not_configured";let a=n.config?.provider?.["9router"]?.options?.baseURL||"",b=a.includes("localhost")||a.includes("127.0.0.1");return n.has9Router&&(b||a.includes(h))?"configured":n.has9Router?"other":"not_configured"})(),N=()=>{let a=K||h;return a.endsWith("/v1")?a:`${a}/v1`},O=async()=>{r(!0);try{let a=await fetch("/api/cli-tools/opencode-settings"),b=await a.json();p(b)}catch(a){p({installed:!1,error:a.message})}finally{r(!1)}},P=async()=>{t(!0),x(null);try{let a=A&&A.trim()||k?A:"sk_9router",b=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:N(),apiKey:a,model:C})}),c=await b.json();b.ok?(x({type:"success",text:"Settings applied successfully!"}),O()):x({type:"error",text:c.error||"Failed to apply settings"})}catch(a){x({type:"error",text:a.message})}finally{t(!1)}},Q=async()=>{v(!0),x(null);try{let a=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),b=await a.json();a.ok?(x({type:"success",text:"Settings reset successfully!"}),D(""),O()):x({type:"error",text:b.error||"Failed to reset settings"})}catch(a){x({type:"error",text:a.message})}finally{v(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/opencode.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===M&&(0,d.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"===M&&(0,d.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"===M&&(0,d.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,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[q&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking OpenCode CLI..."})]}),!q&&n&&!n.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"OpenCode CLI not installed"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Please install OpenCode CLI to use auto-apply feature."})]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>z(!y),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:y?"expand_less":"help"}),y?"Hide":"How to Install"]})]}),y&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux:"}),(0,d.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,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"opencode"})," to verify."]})]})]})]}),!q&&n?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[n?.config?.provider?.["9router"]?.options?.baseURL&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:n.config.provider["9router"].options.baseURL})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:K||`${h}/v1`,onChange:a=>L(a.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"}),K&&K!==`${h}/v1`&&(0,d.jsx)("button",{onClick:()=>L(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),i.length>0?(0,d.jsx)("select",{value:A,onChange:a=>B(a.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:i.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:k?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:C,onChange:a=>D(a.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,d.jsx)("button",{onClick:()=>F(!0),disabled:!j?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),C&&(0,d.jsx)("button",{onClick:()=>D(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),w&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===w.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===w.type?"check_circle":"error"}),(0,d.jsx)("span",{children:w.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:P,disabled:!C,loading:s,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:Q,disabled:!n.has9Router,loading:u,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>J(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:E,onClose:()=>F(!1),onSelect:a=>{D(a.value),F(!1)},selectedModel:C,activeProviders:j,modelAliases:G,title:"Select Model for OpenCode"}),(0,d.jsx)(f.uR,{isOpen:I,onClose:()=>J(!1),title:"OpenCode - Manual Configuration",configs:(m=A&&A.trim()?A:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{"9router":{npm:"@ai-sdk/openai-compatible",options:{baseURL:N(),apiKey:m},models:{[C||"provider/model-id"]:{name:C||"provider/model-id"}}}},model:`9router/${C||"provider/model-id"}`},null,2)}])})]})}function p({apiKeys:a,cloudEnabled:b,onStatusChange:c}){let[g,h]=(0,e.useState)(null),[i,j]=(0,e.useState)(!1),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)(null),v="u">typeof navigator&&navigator.userAgent?.includes("Windows"),w=g?.isAdmin!==!1,x=async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm");if(a.ok){let b=await a.json();h(b),c?.(b)}}catch{h({running:!1,certExists:!1,dnsStatus:{}})}},y=a=>{v||g?.hasCachedPassword?z(a,""):(u(a),l(!0),s(null))},z=async(c,d)=>{j(!0),s(null);try{if("trust-cert"===c){let a=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"trust-cert",sudoPassword:d})}),b=await a.json();a.ok?s({type:"success",text:"Certificate trusted successfully"}):s({type:"error",text:b.error||"Failed to trust certificate"})}else if("start"===c){let c=o?.trim()||(a?.length>0?a[0].key:null)||(b?null:"sk_9router"),e=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:c,sudoPassword:d})}),f=await e.json();e.ok?s({type:"success",text:"Server started"}):s({type:"error",text:f.error||"Failed to start server"})}else{let a=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:d})}),b=await a.json();a.ok?s({type:"success",text:"Server stopped — all DNS cleared"}):s({type:"error",text:b.error||"Failed to stop server"})}l(!1),n(""),await x()}catch(a){s({type:"error",text:a.message})}finally{j(!1),u(null)}},A=()=>{m.trim()?z(t,m):s({type:"error",text:"Sudo password is required"})},B=g?.running;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.Zp,{padding:"sm",className:"border-primary/20 bg-primary/5",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"security"}),(0,d.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"MITM Server"}),B?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Running"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Stopped"})]}),(0,d.jsx)("div",{className:"flex items-center gap-1 text-xs text-text-muted","data-i18n-skip":"true",children:[{label:"Cert",ok:g?.certExists},{label:"Trusted",ok:g?.certTrusted},{label:"Server",ok:B}].map(({label:a,ok:b})=>(0,d.jsxs)("span",{className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded ${b?"text-green-600":"text-text-muted"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:b?"check_circle":"cancel"}),a]},a))})]}),(0,d.jsxs)("div",{className:"px-2 py-2 rounded-lg bg-surface/50 border border-border/50 flex flex-col gap-2",children:[(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Purpose:"})," Use Antigravity IDE & GitHub Copilot → with ANY provider/model from iRouter"]}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Antigravity/Copilot IDE request → DNS redirect to localhost:443 → MITM proxy intercepts → iRouter → response to Antigravity/Copilot"]})]}),!B&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted shrink-0",children:"API Key"}),a?.length>0?(0,d.jsx)("select",{value:o,onChange:a=>q(a.target.value),className:"flex-1 px-2 py-1 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:a.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"text-xs text-text-muted",children:b?"No API keys — create one in Keys page":"sk_9router (default)"})]}),r&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===r.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===r.type?"check_circle":"error"}),(0,d.jsx)("span",{children:r.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap","data-i18n-skip":"true",children:[g?.certExists&&!g?.certTrusted&&(0,d.jsxs)("button",{onClick:()=>y("trust-cert"),disabled:i,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,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"verified_user"}),"Trust Cert"]}),B?(0,d.jsxs)("button",{onClick:()=>y("stop"),disabled:i,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,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop Server"]}):(0,d.jsxs)("button",{onClick:()=>y("start"),disabled:i||v&&!w,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,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start Server"]}),B&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),v&&!w&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"shield_lock"}),(0,d.jsx)("span",{children:"Administrator required — restart iRouter as Administrator to use MITM"})]})]})}),k&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.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,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and server startup"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:m,onChange:a=>n(a.target.value),onKeyDown:a=>{"Enter"!==a.key||i||A()}}),r&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:r.text})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{l(!1),n(""),s(null)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:A,loading:i,children:"Confirm"})]})]})})]})}function q({tool:a,isExpanded:b,onToggle:c,serverRunning:h,dnsActive:i,hasCachedPassword:j,apiKeys:k,activeProviders:l,hasActiveProviders:m,modelAliases:n={},cloudEnabled:o,onDnsChange:p}){let[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(null),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(""),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useState)({}),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(null),H="u">typeof navigator&&navigator.userAgent?.includes("Windows"),I=(0,e.useCallback)(async b=>{try{await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,mappings:b})})}catch{}},[a.id]),J=(a,b)=>{C(c=>({...c,[a]:b}))},K=()=>{if(!h)return;let a=i?"disable":"enable";H||j?L(a,""):(A(a),w(!0),u(null))},L=async(b,c)=>{s(!0),u(null);try{let d=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,action:b,sudoPassword:c})}),e=await d.json();if(!d.ok)throw Error(e.error||"Failed to toggle DNS");"enable"===b?u({type:"success",text:"DNS enabled successfully.",warning:`Please restart ${a.name} to apply changes.`}):u({type:"success",text:"DNS disabled — traffic restored"}),w(!1),y(""),p?.(e)}catch(a){u({type:"error",text:a.message})}finally{s(!1),A(null)}},M=()=>{x.trim()?L(z,x):u({type:"error",text:"Sudo password is required"})};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),h?i?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Active"}):(0,d.jsx)(f.Ex,{variant:"warning",size:"sm",children:"DNS off"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Server off"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Intercept ",a.name," requests via MITM proxy"]})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted px-1",children:[(0,d.jsxs)("p",{children:["Toggle DNS to redirect ",a.name," traffic through iRouter via MITM."]}),!i&&(0,d.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),t&&(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===t.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===t.type?"check_circle":"error"}),(0,d.jsx)("span",{children:t.text})]}),t.warning&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-amber-500/10 text-amber-600 border border-amber-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,d.jsx)("span",{className:"font-medium",children:t.warning})]})]}),a.defaultModels?.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-2",children:a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-36 shrink-0 text-xs font-semibold text-text-main text-right",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:B[a.alias]||"",onChange:b=>J(a.alias,b.target.value),onBlur:b=>{var c,d;return c=a.alias,d=b.target.value,void I({...B,[c]:d})},placeholder:"provider/model-id",disabled:!i,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 ${!i?"opacity-50 cursor-not-allowed":""}`}),(0,d.jsx)("button",{onClick:()=>{G(a.alias),E(!0)},disabled:!m||!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 ${m&&i?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),B[a.alias]&&(0,d.jsx)("button",{onClick:()=>{J(a.alias,""),I({...B,[a.alias]:""})},className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},a.alias))}),a.defaultModels?.length===0&&(0,d.jsx)("p",{className:"text-xs text-text-muted px-1",children:"Model mappings will be available soon."}),(0,d.jsx)("div",{children:i?(0,d.jsxs)("button",{onClick:K,disabled:!h||r,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,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop DNS"]}):(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:K,loading:r,disabled:!h||r,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"play_circle"}),"Start DNS"]})})]})]}),v&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.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,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required to modify /etc/hosts and flush DNS cache"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:x,onChange:a=>y(a.target.value),onKeyDown:a=>{"Enter"!==a.key||r||M()}}),t&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:t.text})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{w(!1),y(""),u(null)},disabled:r,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:M,loading:r,children:"Confirm"})]})]})}),(0,d.jsx)(f.rq,{isOpen:D,onClose:()=>E(!1),onSelect:a=>{if(!F||a.isPlaceholder)return;let b={...B,[F]:a.value};C(b),I(b)},selectedModel:F?B[F]:null,activeProviders:l,modelAliases:n,title:`Select model for ${F}`})]})}}};
15
+ `},{filename:"~/.codex/auth.json",content:JSON.stringify({OPENAI_API_KEY:p},null,2)}])})]})}let k=process.env.NEXT_PUBLIC_CLOUD_URL;function l({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:m,cloudEnabled:n,initialStatus:o}){let p,q,r,s,[t,u]=(0,e.useState)(o||null),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)(""),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)({}),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)("");(0,e.useRef)(!1);let P=(()=>{if(!t?.installed)return null;let a=t.settings?.customModels?.find(a=>"custom:9Router-0"===a.id);if(!a)return"not_configured";let b=a.baseUrl?.includes("localhost")||a.baseUrl?.includes("127.0.0.1"),c=n&&k&&a.baseUrl?.startsWith(k),d=h&&a.baseUrl?.startsWith(h);return b||c||d?"configured":"other"})(),Q=async()=>{w(!0);try{let a=await fetch("/api/cli-tools/droid-settings"),b=await a.json();u(b)}catch(a){u({installed:!1,error:a.message})}finally{w(!1)}},R=()=>{let a=N||h;return a.endsWith("/v1")?a:`${a}/v1`},S=async()=>{y(!0),C(null);try{let a=D?.trim()||(j?.length>0?j[0].key:null)||(n?null:"sk_9router"),b=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:R(),apiKey:a,model:F})}),c=await b.json();b.ok?(C({type:"success",text:"Settings applied successfully!"}),Q()):C({type:"error",text:c.error||"Failed to apply settings"})}catch(a){C({type:"error",text:a.message})}finally{y(!1)}},T=async()=>{A(!0),C(null);try{let a=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),b=await a.json();a.ok?(C({type:"success",text:"Settings reset successfully!"}),G(""),E(""),Q()):C({type:"error",text:b.error||"Failed to reset settings"})}catch(a){C({type:"error",text:a.message})}finally{A(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/droid.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===P&&(0,d.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"===P&&(0,d.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"===P&&(0,d.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,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[v&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Factory Droid CLI..."})]}),!v&&t&&!t.installed&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Factory Droid CLI not installed"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Please install Factory Droid CLI to use this feature."})]})]}),!v&&t?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[t?.settings?.customModels?.find(a=>"custom:9Router-0"===a.id)?.baseUrl&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:t.settings.customModels.find(a=>"custom:9Router-0"===a.id).baseUrl})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:(p=N||h).endsWith("/v1")?p:`${p}/v1`,onChange:a=>O(a.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&&N!==h&&(0,d.jsx)("button",{onClick:()=>O(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),j.length>0?(0,d.jsx)("select",{value:D,onChange:a=>E(a.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:j.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:n?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:F,onChange:a=>G(a.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,d.jsx)("button",{onClick:()=>I(!0),disabled:!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),F&&(0,d.jsx)("button",{onClick:()=>G(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),B&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===B.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===B.type?"check_circle":"error"}),(0,d.jsx)("span",{children:B.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:S,disabled:!F,loading:x,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:T,disabled:!t?.has9Router,loading:z,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>M(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:H,onClose:()=>I(!1),onSelect:a=>{G(a.value),I(!1)},selectedModel:F,activeProviders:m,modelAliases:J,title:"Select Model for Factory Droid"}),(0,d.jsx)(f.uR,{isOpen:L,onClose:()=>M(!1),title:"Factory Droid - Manual Configuration",configs:(q=D&&D.trim()?D:n?"<API_KEY_FROM_DASHBOARD>":"sk_9router",r={customModels:[{model:F||"provider/model-id",id:"custom:9Router-0",index:0,baseUrl:R(),apiKey:q,displayName:F||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},s="u">typeof navigator&&navigator.platform,[{filename:s?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(r,null,2)}])})]})}function m({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:k,cloudEnabled:l,initialStatus:n}){let o,p,[q,r]=(0,e.useState)(n||null),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)({}),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)("");(0,e.useRef)(!1);let M=(()=>{if(!q?.installed)return null;let a=q.settings?.models?.providers?.["9router"];if(!a)return"not_configured";let b=a.baseUrl?.includes("localhost")||a.baseUrl?.includes("127.0.0.1")||a.baseUrl?.includes("0.0.0.0"),c=h&&a.baseUrl?.startsWith(h);return b||c?"configured":"other"})(),N=async()=>{t(!0);try{let a=await fetch("/api/cli-tools/openclaw-settings"),b=await a.json();r(b)}catch(a){r({installed:!1,error:a.message})}finally{t(!1)}},O=()=>{let a=K||"http://127.0.0.1:20128";return a.endsWith("/v1")?a:`${a}/v1`},P=async()=>{v(!0),z(null);try{let a=A?.trim()||(j?.length>0?j[0].key:null)||(l?null:"sk_9router"),b=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:O(),apiKey:a,model:C})}),c=await b.json();b.ok?(z({type:"success",text:"Settings applied successfully!"}),N()):z({type:"error",text:c.error||"Failed to apply settings"})}catch(a){z({type:"error",text:a.message})}finally{v(!1)}},Q=async()=>{x(!0),z(null);try{let a=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),b=await a.json();a.ok?(z({type:"success",text:"Settings reset successfully!"}),D(""),B(""),N()):z({type:"error",text:b.error||"Failed to reset settings"})}catch(a){z({type:"error",text:a.message})}finally{x(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/openclaw.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===M&&(0,d.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"===M&&(0,d.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"===M&&(0,d.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,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[s&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Open Claw CLI..."})]}),!s&&q&&!q.installed&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Open Claw CLI not installed"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Please install Open Claw CLI to use this feature."})]})]}),!s&&q?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[q?.settings?.models?.providers?.["9router"]?.baseUrl&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:q.settings.models.providers["9router"].baseUrl})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:(o=K||"http://127.0.0.1:20128").endsWith("/v1")?o:`${o}/v1`,onChange:a=>L(a.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"}),K&&K!==h&&(0,d.jsx)("button",{onClick:()=>L(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),j.length>0?(0,d.jsx)("select",{value:A,onChange:a=>B(a.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:j.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:l?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:C,onChange:a=>D(a.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,d.jsx)("button",{onClick:()=>F(!0),disabled:!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),C&&(0,d.jsx)("button",{onClick:()=>D(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),y&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===y.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===y.type?"check_circle":"error"}),(0,d.jsx)("span",{children:y.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:P,disabled:!C,loading:u,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:Q,disabled:!q?.has9Router,loading:w,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>J(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:E,onClose:()=>F(!1),onSelect:a=>{D(a.value),F(!1)},selectedModel:C,activeProviders:k,modelAliases:G,title:"Select Model for Open Claw"}),(0,d.jsx)(f.uR,{isOpen:I,onClose:()=>J(!1),title:"Open Claw - Manual Configuration",configs:(p=A&&A.trim()?A:l?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`9router/${C||"provider/model-id"}`}}},models:{providers:{"9router":{baseUrl:O(),apiKey:p,api:"openai-completions",models:[{id:C||"provider/model-id",name:(C||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}function n({toolId:a,tool:b,isExpanded:c,onToggle:h,baseUrl:i,apiKeys:j,activeProviders:k=[],cloudEnabled:l=!1,tunnelEnabled:m=!1}){let[o,p]=(0,e.useState)(null),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(()=>j?.length>0?j[0].key:""),w=a=>{let b=u&&u.trim()?u:l?"your-api-key":"sk_9router",c=i||"http://localhost:20128",d=c.endsWith("/v1")?c:`${c}/v1`;return a.replace(/\{\{baseUrl\}\}/g,d).replace(/\{\{apiKey\}\}/g,b).replace(/\{\{model\}\}/g,s||"provider/model-id")},x=async(a,b)=>{await navigator.clipboard.writeText(w(a)),p(b),setTimeout(()=>p(null),2e3)},y=k.length>0,z=()=>(!b.requiresExternalUrl||!!l||!!m)&&(!b.requiresCloud||!!l);return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:h,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:b.image?(0,d.jsx)(g.default,{src:b.image,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}}):b.icon?(0,d.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:b.color},children:b.icon}):(0,d.jsx)(g.default,{src:`/providers/${a}.png`,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:b.name}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:b.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${c?"rotate-180":""}`,children:"expand_more"})]}),c&&(0,d.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:b.guideSteps?(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[b.notes&&0!==b.notes.length?(0,d.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:b.notes.map((a,b)=>{if("cloudCheck"===a.type&&(l||m))return null;let c="warning"===a.type,e="cloudCheck"===a.type&&!l&&!m,f="bg-blue-500/10 border-blue-500/30",g="text-blue-600 dark:text-blue-400",h="text-blue-500",i="info";return c?(f="bg-yellow-500/10 border-yellow-500/30",g="text-yellow-600 dark:text-yellow-400",h="text-yellow-500",i="warning"):e&&(f="bg-red-500/10 border-red-500/30",g="text-red-600 dark:text-red-400",h="text-red-500",i="error"),(0,d.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${f}`,children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-lg ${h}`,children:i}),(0,d.jsx)("p",{className:`text-sm ${g}`,children:a.text})]},b)})}):null,z()&&b.guideSteps.map(a=>(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[(0,d.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:b.color},children:a.step}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-text",children:a.title}),a.desc&&(0,d.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:a.desc}),"apiKeySelector"===a.type&&(0,d.jsx)("div",{className:"mt-2 flex items-center gap-2",children:j&&j.length>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("select",{value:u,onChange:a=>v(a.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:j.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}),(0,d.jsx)("button",{onClick:()=>x(u,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===o?"check":"content_copy"})})]}):(0,d.jsx)("span",{className:"text-sm text-text-muted",children:l?"No API keys - Create one in Keys page":"sk_9router"})}),"modelSelector"===a.type&&(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:s,onChange:a=>t(a.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,d.jsx)("button",{onClick:()=>r(!0),disabled:!y,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${y?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),s&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:()=>x(s,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===o?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>t(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),a.value&&(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:w(a.value)}),a.copyable&&(0,d.jsx)("button",{onClick:()=>x(a.value,`${a.step}-${a.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:o===`${a.step}-${a.title}`?"check":"content_copy"})})]})]})]},a.step)),z()&&b.codeBlock&&(0,d.jsxs)("div",{className:"mt-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:b.codeBlock.language}),(0,d.jsxs)("button",{onClick:()=>x(b.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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===o?"check":"content_copy"}),"codeblock"===o?"Copied!":"Copy"]})]}),(0,d.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,d.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:w(b.codeBlock.code)})})]})]}):(0,d.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,d.jsx)(f.rq,{isOpen:q,onClose:()=>r(!1),onSelect:a=>{t(a.value)},selectedModel:s,activeProviders:k,title:"Select Model"})]})}function o({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:l}){let m,[n,p]=(0,e.useState)(l||null),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)({}),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)(""),M=(()=>{if(!n?.installed)return null;if(!n.config)return"not_configured";let a=n.config?.provider?.["9router"]?.options?.baseURL||"",b=a.includes("localhost")||a.includes("127.0.0.1");return n.has9Router&&(b||a.includes(h))?"configured":n.has9Router?"other":"not_configured"})(),N=()=>{let a=K||h;return a.endsWith("/v1")?a:`${a}/v1`},O=async()=>{r(!0);try{let a=await fetch("/api/cli-tools/opencode-settings"),b=await a.json();p(b)}catch(a){p({installed:!1,error:a.message})}finally{r(!1)}},P=async()=>{t(!0),x(null);try{let a=A&&A.trim()||k?A:"sk_9router",b=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:N(),apiKey:a,model:C})}),c=await b.json();b.ok?(x({type:"success",text:"Settings applied successfully!"}),O()):x({type:"error",text:c.error||"Failed to apply settings"})}catch(a){x({type:"error",text:a.message})}finally{t(!1)}},Q=async()=>{v(!0),x(null);try{let a=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),b=await a.json();a.ok?(x({type:"success",text:"Settings reset successfully!"}),D(""),O()):x({type:"error",text:b.error||"Failed to reset settings"})}catch(a){x({type:"error",text:a.message})}finally{v(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/opencode.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===M&&(0,d.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"===M&&(0,d.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"===M&&(0,d.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,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[q&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking OpenCode CLI..."})]}),!q&&n&&!n.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"OpenCode CLI not installed"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Please install OpenCode CLI to use auto-apply feature."})]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>z(!y),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:y?"expand_less":"help"}),y?"Hide":"How to Install"]})]}),y&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux:"}),(0,d.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,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"opencode"})," to verify."]})]})]})]}),!q&&n?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[n?.config?.provider?.["9router"]?.options?.baseURL&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:n.config.provider["9router"].options.baseURL})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:K||`${h}/v1`,onChange:a=>L(a.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"}),K&&K!==`${h}/v1`&&(0,d.jsx)("button",{onClick:()=>L(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),i.length>0?(0,d.jsx)("select",{value:A,onChange:a=>B(a.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:i.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:k?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:C,onChange:a=>D(a.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,d.jsx)("button",{onClick:()=>F(!0),disabled:!j?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),C&&(0,d.jsx)("button",{onClick:()=>D(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),w&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===w.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===w.type?"check_circle":"error"}),(0,d.jsx)("span",{children:w.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:P,disabled:!C,loading:s,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:Q,disabled:!n.has9Router,loading:u,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>J(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:E,onClose:()=>F(!1),onSelect:a=>{D(a.value),F(!1)},selectedModel:C,activeProviders:j,modelAliases:G,title:"Select Model for OpenCode"}),(0,d.jsx)(f.uR,{isOpen:I,onClose:()=>J(!1),title:"OpenCode - Manual Configuration",configs:(m=A&&A.trim()?A:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{"9router":{npm:"@ai-sdk/openai-compatible",options:{baseURL:N(),apiKey:m},models:{[C||"provider/model-id"]:{name:C||"provider/model-id"}}}},model:`9router/${C||"provider/model-id"}`},null,2)}])})]})}function p({apiKeys:a,cloudEnabled:b,onStatusChange:c}){let[g,h]=(0,e.useState)(null),[i,j]=(0,e.useState)(!1),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)(null),v="u">typeof navigator&&navigator.userAgent?.includes("Windows"),w=g?.isAdmin!==!1,x=async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm");if(a.ok){let b=await a.json();h(b),c?.(b)}}catch{h({running:!1,certExists:!1,dnsStatus:{}})}},y=a=>{v||g?.hasCachedPassword?z(a,""):(s(a),l(!0),u(null))},z=async(c,d)=>{j(!0);try{if("trust-cert"===c)await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"trust-cert",sudoPassword:d})});else if("start"===c){let c=o?.trim()||(a?.length>0?a[0].key:null)||(b?null:"sk_9router");await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:c,sudoPassword:d})})}else await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:d})});l(!1),n(""),await x()}catch{}finally{j(!1),s(null)}},A=()=>{m.trim()?z(r,m):u("Sudo password is required")},B=g?.running;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.Zp,{padding:"sm",className:"border-primary/20 bg-primary/5",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"security"}),(0,d.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"MITM Server"}),B?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Running"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Stopped"})]}),(0,d.jsx)("div",{className:"flex items-center gap-1 text-xs text-text-muted","data-i18n-skip":"true",children:[{label:"Cert",ok:g?.certExists},{label:"Trusted",ok:g?.certTrusted},{label:"Server",ok:B}].map(({label:a,ok:b})=>(0,d.jsxs)("span",{className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded ${b?"text-green-600":"text-text-muted"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:b?"check_circle":"cancel"}),a]},a))})]}),(0,d.jsxs)("div",{className:"px-2 py-2 rounded-lg bg-surface/50 border border-border/50 flex flex-col gap-2",children:[(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Purpose:"})," Use Antigravity IDE & GitHub Copilot → with ANY provider/model from iRouter"]}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Antigravity/Copilot IDE request → DNS redirect to localhost:443 → MITM proxy intercepts → iRouter → response to Antigravity/Copilot"]})]}),!B&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted shrink-0",children:"API Key"}),a?.length>0?(0,d.jsx)("select",{value:o,onChange:a=>q(a.target.value),className:"flex-1 px-2 py-1 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:a.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"text-xs text-text-muted",children:b?"No API keys — create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap","data-i18n-skip":"true",children:[g?.certExists&&!g?.certTrusted&&(0,d.jsxs)("button",{onClick:()=>y("trust-cert"),disabled:i,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,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"verified_user"}),"Trust Cert"]}),B?(0,d.jsxs)("button",{onClick:()=>y("stop"),disabled:i,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,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop Server"]}):(0,d.jsxs)("button",{onClick:()=>y("start"),disabled:i||v&&!w,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,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start Server"]}),B&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),v&&!w&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"shield_lock"}),(0,d.jsx)("span",{children:"Administrator required — restart iRouter as Administrator to use MITM"})]})]})}),k&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.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,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and server startup"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:m,onChange:a=>n(a.target.value),onKeyDown:a=>{"Enter"!==a.key||i||A()}}),t&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:t})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{l(!1),n(""),u(null)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:A,loading:i,children:"Confirm"})]})]})})]})}function q({tool:a,isExpanded:b,onToggle:c,serverRunning:h,dnsActive:i,hasCachedPassword:j,apiKeys:k,activeProviders:l,hasActiveProviders:m,modelAliases:n={},cloudEnabled:o,onDnsChange:p}){let[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(null),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(""),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)({}),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(null),J="u">typeof navigator&&navigator.userAgent?.includes("Windows"),K=(0,e.useCallback)(async b=>{try{await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,mappings:b})})}catch{}},[a.id]),L=(a,b)=>{E(c=>({...c,[a]:b}))},M=()=>{if(!h)return;let a=i?"disable":"enable";J||j?N(a,""):(A(a),w(!0),C(null))},N=async(b,c)=>{s(!0),u(null);try{let d=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,action:b,sudoPassword:c})}),e=await d.json();if(!d.ok)throw Error(e.error||"Failed to toggle DNS");"enable"===b&&u(`Restart ${a.name} to apply changes`),w(!1),y(""),p?.(e)}catch{}finally{s(!1),A(null)}},O=()=>{x.trim()?N(z,x):C("Sudo password is required")};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),h?i?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Active"}):(0,d.jsx)(f.Ex,{variant:"warning",size:"sm",children:"DNS off"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Server off"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Intercept ",a.name," requests via MITM proxy"]})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted px-1",children:[(0,d.jsxs)("p",{children:["Toggle DNS to redirect ",a.name," traffic through iRouter via MITM."]}),!i&&(0,d.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),a.defaultModels?.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-2",children:a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-36 shrink-0 text-xs font-semibold text-text-main text-right",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:D[a.alias]||"",onChange:b=>L(a.alias,b.target.value),onBlur:b=>{var c,d;return c=a.alias,d=b.target.value,void K({...D,[c]:d})},placeholder:"provider/model-id",disabled:!i,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 ${!i?"opacity-50 cursor-not-allowed":""}`}),(0,d.jsx)("button",{onClick:()=>{I(a.alias),G(!0)},disabled:!m||!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 ${m&&i?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),D[a.alias]&&(0,d.jsx)("button",{onClick:()=>{L(a.alias,""),K({...D,[a.alias]:""})},className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},a.alias))}),a.defaultModels?.length===0&&(0,d.jsx)("p",{className:"text-xs text-text-muted px-1",children:"Model mappings will be available soon."}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 items-start",children:[i?(0,d.jsxs)("button",{onClick:M,disabled:!h||r,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,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop DNS"]}):(0,d.jsxs)("button",{onClick:M,disabled:!h||r,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,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start DNS"]}),t&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-amber-500/10 text-amber-600 border border-amber-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,d.jsx)("span",{children:t})]})]})]})]}),v&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.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,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required to modify /etc/hosts and flush DNS cache"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:x,onChange:a=>y(a.target.value),onKeyDown:a=>{"Enter"!==a.key||r||O()}}),B&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:B})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{w(!1),y(""),C(null)},disabled:r,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:O,loading:r,children:"Confirm"})]})]})}),(0,d.jsx)(f.rq,{isOpen:F,onClose:()=>G(!1),onSelect:a=>{if(!H||a.isPlaceholder)return;let b={...D,[H]:a.value};E(b),K(b)},selectedModel:H?D[H]:null,activeProviders:l,modelAliases:n,title:`Select model for ${H}`})]})}}};