9router 0.3.32 → 0.3.34

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 (564) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +45 -44
  3. package/app/.next/build-manifest.json +2 -2
  4. package/app/.next/routes-manifest.json +6 -0
  5. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  6. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  18. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/page.js +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  33. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  35. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  36. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  39. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  41. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  42. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  43. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  44. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  45. package/app/.next/server/app/_global-error.html +2 -2
  46. package/app/.next/server/app/_global-error.rsc +1 -1
  47. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  48. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  49. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  50. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  51. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  52. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  53. package/app/.next/server/app/_not-found/page.js +2 -2
  54. package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
  55. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/_not-found.html +1 -1
  57. package/app/.next/server/app/_not-found.rsc +15 -14
  58. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +15 -14
  59. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  60. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +6 -5
  61. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  62. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  63. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  64. package/app/.next/server/app/api/auth/login/route.js +1 -1
  65. package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  66. package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  67. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  68. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  69. package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  70. package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  71. package/app/.next/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +1 -1
  72. package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  73. package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  74. package/app/.next/server/app/api/cli-tools/opencode-settings/route_client-reference-manifest.js +1 -1
  75. package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
  76. package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
  77. package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
  78. package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
  79. package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  80. package/app/.next/server/app/api/combos/route.js +1 -1
  81. package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
  82. package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  83. package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  84. package/app/.next/server/app/api/keys/route.js +1 -1
  85. package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
  86. package/app/.next/server/app/api/locale/route.js +1 -0
  87. package/app/.next/server/app/api/locale/route.js.nft.json +1 -0
  88. package/app/.next/server/app/api/locale/route_client-reference-manifest.js +1 -0
  89. package/app/.next/server/app/api/models/alias/route.js +1 -1
  90. package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  91. package/app/.next/server/app/api/models/route.js +1 -1
  92. package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  93. package/app/.next/server/app/api/models/test/route_client-reference-manifest.js +1 -1
  94. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  95. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  96. package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  97. package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  98. package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  99. package/app/.next/server/app/api/oauth/iflow/cookie/route_client-reference-manifest.js +1 -1
  100. package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  101. package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  102. package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  103. package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  104. package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  105. package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  106. package/app/.next/server/app/api/provider-nodes/route.js +1 -1
  107. package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  108. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  109. package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  110. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  111. package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  112. package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  113. package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  114. package/app/.next/server/app/api/providers/[id]/test-models/route_client-reference-manifest.js +1 -1
  115. package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  116. package/app/.next/server/app/api/providers/route.js +1 -1
  117. package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
  118. package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  119. package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  120. package/app/.next/server/app/api/settings/database/route_client-reference-manifest.js +1 -1
  121. package/app/.next/server/app/api/settings/proxy-test/route_client-reference-manifest.js +1 -1
  122. package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
  123. package/app/.next/server/app/api/settings/route.js +1 -1
  124. package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  125. package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  126. package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  127. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  128. package/app/.next/server/app/api/translator/console-logs/route_client-reference-manifest.js +1 -1
  129. package/app/.next/server/app/api/translator/console-logs/stream/route.js +1 -1
  130. package/app/.next/server/app/api/translator/console-logs/stream/route_client-reference-manifest.js +1 -1
  131. package/app/.next/server/app/api/translator/load/route.js +1 -1
  132. package/app/.next/server/app/api/translator/load/route.js.nft.json +1 -1
  133. package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  134. package/app/.next/server/app/api/translator/save/route.js +1 -1
  135. package/app/.next/server/app/api/translator/save/route.js.nft.json +1 -1
  136. package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  137. package/app/.next/server/app/api/translator/send/route.js +1 -1
  138. package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
  139. package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  140. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  141. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  142. package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  143. package/app/.next/server/app/api/tunnel/disable/route_client-reference-manifest.js +1 -1
  144. package/app/.next/server/app/api/tunnel/enable/route_client-reference-manifest.js +1 -1
  145. package/app/.next/server/app/api/tunnel/status/route_client-reference-manifest.js +1 -1
  146. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  147. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  148. package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  149. package/app/.next/server/app/api/usage/chart/route_client-reference-manifest.js +1 -1
  150. package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  151. package/app/.next/server/app/api/usage/providers/route_client-reference-manifest.js +1 -1
  152. package/app/.next/server/app/api/usage/request-details/route_client-reference-manifest.js +1 -1
  153. package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  154. package/app/.next/server/app/api/usage/stats/route_client-reference-manifest.js +1 -1
  155. package/app/.next/server/app/api/usage/stream/route_client-reference-manifest.js +1 -1
  156. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  157. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  158. package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  159. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  160. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  161. package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
  162. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  163. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  164. package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
  165. package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
  166. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  167. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  168. package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
  169. package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  170. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  171. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  172. package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  173. package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
  174. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  175. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  176. package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  177. package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  178. package/app/.next/server/app/api/version/route.js +1 -1
  179. package/app/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
  180. package/app/.next/server/app/callback/page.js +2 -2
  181. package/app/.next/server/app/callback/page.js.nft.json +1 -1
  182. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  183. package/app/.next/server/app/callback.html +1 -1
  184. package/app/.next/server/app/callback.rsc +19 -18
  185. package/app/.next/server/app/callback.segments/_full.segment.rsc +19 -18
  186. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  187. package/app/.next/server/app/callback.segments/_index.segment.rsc +6 -5
  188. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  189. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  190. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  191. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  192. package/app/.next/server/app/dashboard/cli-tools.rsc +18 -17
  193. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  194. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  195. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  196. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  197. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +18 -17
  198. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  199. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +6 -5
  200. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  201. package/app/.next/server/app/dashboard/combos.html +1 -1
  202. package/app/.next/server/app/dashboard/combos.rsc +20 -19
  203. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  204. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  205. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  206. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  207. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +20 -19
  208. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  209. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +6 -5
  210. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  211. package/app/.next/server/app/dashboard/endpoint.html +1 -1
  212. package/app/.next/server/app/dashboard/endpoint.rsc +18 -17
  213. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  214. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  215. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  216. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  217. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +18 -17
  218. package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  219. package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +6 -5
  220. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  221. package/app/.next/server/app/dashboard/mitm.html +1 -1
  222. package/app/.next/server/app/dashboard/mitm.rsc +17 -16
  223. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  224. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  225. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  226. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  227. package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +17 -16
  228. package/app/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  229. package/app/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +6 -5
  230. package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  231. package/app/.next/server/app/dashboard/profile.html +1 -1
  232. package/app/.next/server/app/dashboard/profile.rsc +20 -19
  233. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  234. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  235. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  236. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  237. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +20 -19
  238. package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  239. package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +6 -5
  240. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  241. package/app/.next/server/app/dashboard/providers/new.html +1 -1
  242. package/app/.next/server/app/dashboard/providers/new.rsc +20 -19
  243. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  244. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  245. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  246. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  247. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  248. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +20 -19
  249. package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  250. package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +6 -5
  251. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  252. package/app/.next/server/app/dashboard/providers.html +1 -1
  253. package/app/.next/server/app/dashboard/providers.rsc +20 -19
  254. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  255. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  256. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  257. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  258. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +20 -19
  259. package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  260. package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +6 -5
  261. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  262. package/app/.next/server/app/dashboard/quota.html +2 -2
  263. package/app/.next/server/app/dashboard/quota.rsc +18 -17
  264. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +1 -1
  265. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  266. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  267. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  268. package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +18 -17
  269. package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  270. package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +6 -5
  271. package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  272. package/app/.next/server/app/dashboard/settings/pricing/page.js +1 -1
  273. package/app/.next/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  274. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  275. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  276. package/app/.next/server/app/dashboard/settings/pricing.rsc +19 -18
  277. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +19 -18
  278. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  279. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +6 -5
  280. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  281. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  282. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  283. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  284. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  285. package/app/.next/server/app/dashboard/translator.html +1 -1
  286. package/app/.next/server/app/dashboard/translator.rsc +20 -19
  287. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  288. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  289. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  290. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  291. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +20 -19
  292. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  293. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +6 -5
  294. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  295. package/app/.next/server/app/dashboard/usage.html +1 -1
  296. package/app/.next/server/app/dashboard/usage.rsc +20 -19
  297. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  298. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  299. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  300. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  301. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +20 -19
  302. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  303. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +6 -5
  304. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  305. package/app/.next/server/app/dashboard.html +1 -1
  306. package/app/.next/server/app/dashboard.rsc +18 -17
  307. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  308. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  309. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  310. package/app/.next/server/app/dashboard.segments/_full.segment.rsc +18 -17
  311. package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
  312. package/app/.next/server/app/dashboard.segments/_index.segment.rsc +6 -5
  313. package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  314. package/app/.next/server/app/index.html +1 -1
  315. package/app/.next/server/app/index.rsc +16 -15
  316. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  317. package/app/.next/server/app/index.segments/_full.segment.rsc +16 -15
  318. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  319. package/app/.next/server/app/index.segments/_index.segment.rsc +6 -5
  320. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  321. package/app/.next/server/app/landing/page.js +1 -1
  322. package/app/.next/server/app/landing/page.js.nft.json +1 -1
  323. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  324. package/app/.next/server/app/landing.html +1 -1
  325. package/app/.next/server/app/landing.rsc +19 -18
  326. package/app/.next/server/app/landing.segments/_full.segment.rsc +19 -18
  327. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  328. package/app/.next/server/app/landing.segments/_index.segment.rsc +6 -5
  329. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  330. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  331. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  332. package/app/.next/server/app/login/page.js +1 -1
  333. package/app/.next/server/app/login/page.js.nft.json +1 -1
  334. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  335. package/app/.next/server/app/login.html +1 -1
  336. package/app/.next/server/app/login.rsc +19 -18
  337. package/app/.next/server/app/login.segments/_full.segment.rsc +19 -18
  338. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  339. package/app/.next/server/app/login.segments/_index.segment.rsc +6 -5
  340. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  341. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  342. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  343. package/app/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  344. package/app/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  345. package/app/.next/server/app/page.js +1 -1
  346. package/app/.next/server/app/page.js.nft.json +1 -1
  347. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  348. package/app/.next/server/app-paths-manifest.json +45 -44
  349. package/app/.next/server/chunks/1114.js +1 -0
  350. package/app/.next/server/chunks/{4822.js → 1220.js} +1 -1
  351. package/app/.next/server/chunks/2470.js +1 -1
  352. package/app/.next/server/chunks/318.js +162 -0
  353. package/app/.next/server/chunks/412.js +4 -4
  354. package/app/.next/server/chunks/6182.js +2 -2
  355. package/app/.next/server/chunks/649.js +1 -1
  356. package/app/.next/server/chunks/7132.js +1 -0
  357. package/app/.next/server/chunks/7861.js +1 -0
  358. package/app/.next/server/chunks/8590.js +1 -1
  359. package/app/.next/server/chunks/8895.js +1 -1
  360. package/app/.next/server/pages/404.html +1 -1
  361. package/app/.next/server/pages/500.html +2 -2
  362. package/app/.next/server/server-reference-manifest.js +1 -1
  363. package/app/.next/server/server-reference-manifest.json +1 -1
  364. package/app/.next/static/chunks/5497-a182d950887a90ed.js +7 -0
  365. package/app/.next/static/chunks/{9242-ebb05a40387b301d.js → 9242-b217d166d0bd8f13.js} +1 -1
  366. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/page-088e98717d308134.js +1 -0
  367. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-38f44aef01bdee63.js +1 -0
  368. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-be6d430d1375fbb5.js +1 -0
  369. package/app/.next/static/chunks/app/(dashboard)/layout-305ccb9e5615ce7d.js +1 -0
  370. package/app/.next/static/chunks/app/_global-error/page-bacff678ec57ee01.js +1 -0
  371. package/app/.next/static/chunks/app/api/auth/login/route-bacff678ec57ee01.js +1 -0
  372. package/app/.next/static/chunks/app/api/auth/logout/route-bacff678ec57ee01.js +1 -0
  373. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-bacff678ec57ee01.js +1 -0
  374. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-bacff678ec57ee01.js +1 -0
  375. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-bacff678ec57ee01.js +1 -0
  376. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-bacff678ec57ee01.js +1 -0
  377. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-bacff678ec57ee01.js +1 -0
  378. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-bacff678ec57ee01.js +1 -0
  379. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-bacff678ec57ee01.js +1 -0
  380. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-bacff678ec57ee01.js +1 -0
  381. package/app/.next/static/chunks/app/api/cloud/auth/route-bacff678ec57ee01.js +1 -0
  382. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-bacff678ec57ee01.js +1 -0
  383. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-bacff678ec57ee01.js +1 -0
  384. package/app/.next/static/chunks/app/api/cloud/models/alias/route-bacff678ec57ee01.js +1 -0
  385. package/app/.next/static/chunks/app/api/combos/[id]/route-bacff678ec57ee01.js +1 -0
  386. package/app/.next/static/chunks/app/api/combos/route-bacff678ec57ee01.js +1 -0
  387. package/app/.next/static/chunks/app/api/init/route-bacff678ec57ee01.js +1 -0
  388. package/app/.next/static/chunks/app/api/keys/[id]/route-bacff678ec57ee01.js +1 -0
  389. package/app/.next/static/chunks/app/api/keys/route-bacff678ec57ee01.js +1 -0
  390. package/app/.next/static/chunks/app/api/locale/route-bacff678ec57ee01.js +1 -0
  391. package/app/.next/static/chunks/app/api/models/alias/route-bacff678ec57ee01.js +1 -0
  392. package/app/.next/static/chunks/app/api/models/route-bacff678ec57ee01.js +1 -0
  393. package/app/.next/static/chunks/app/api/models/test/route-bacff678ec57ee01.js +1 -0
  394. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-bacff678ec57ee01.js +1 -0
  395. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-bacff678ec57ee01.js +1 -0
  396. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-bacff678ec57ee01.js +1 -0
  397. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-bacff678ec57ee01.js +1 -0
  398. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-bacff678ec57ee01.js +1 -0
  399. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-bacff678ec57ee01.js +1 -0
  400. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-bacff678ec57ee01.js +1 -0
  401. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-bacff678ec57ee01.js +1 -0
  402. package/app/.next/static/chunks/app/api/pricing/route-bacff678ec57ee01.js +1 -0
  403. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-bacff678ec57ee01.js +1 -0
  404. package/app/.next/static/chunks/app/api/provider-nodes/route-bacff678ec57ee01.js +1 -0
  405. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-bacff678ec57ee01.js +1 -0
  406. package/app/.next/static/chunks/app/api/providers/[id]/models/route-bacff678ec57ee01.js +1 -0
  407. package/app/.next/static/chunks/app/api/providers/[id]/route-bacff678ec57ee01.js +1 -0
  408. package/app/.next/static/chunks/app/api/providers/[id]/test/route-bacff678ec57ee01.js +1 -0
  409. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-bacff678ec57ee01.js +1 -0
  410. package/app/.next/static/chunks/app/api/providers/client/route-bacff678ec57ee01.js +1 -0
  411. package/app/.next/static/chunks/app/api/providers/route-bacff678ec57ee01.js +1 -0
  412. package/app/.next/static/chunks/app/api/providers/test-batch/route-bacff678ec57ee01.js +1 -0
  413. package/app/.next/static/chunks/app/api/providers/validate/route-bacff678ec57ee01.js +1 -0
  414. package/app/.next/static/chunks/app/api/settings/database/route-bacff678ec57ee01.js +1 -0
  415. package/app/.next/static/chunks/app/api/settings/proxy-test/route-bacff678ec57ee01.js +1 -0
  416. package/app/.next/static/chunks/app/api/settings/require-login/route-bacff678ec57ee01.js +1 -0
  417. package/app/.next/static/chunks/app/api/settings/route-bacff678ec57ee01.js +1 -0
  418. package/app/.next/static/chunks/app/api/shutdown/route-bacff678ec57ee01.js +1 -0
  419. package/app/.next/static/chunks/app/api/tags/route-bacff678ec57ee01.js +1 -0
  420. package/app/.next/static/chunks/app/api/translator/console-logs/route-bacff678ec57ee01.js +1 -0
  421. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-bacff678ec57ee01.js +1 -0
  422. package/app/.next/static/chunks/app/api/translator/load/route-bacff678ec57ee01.js +1 -0
  423. package/app/.next/static/chunks/app/api/translator/save/route-bacff678ec57ee01.js +1 -0
  424. package/app/.next/static/chunks/app/api/translator/send/route-bacff678ec57ee01.js +1 -0
  425. package/app/.next/static/chunks/app/api/translator/translate/route-bacff678ec57ee01.js +1 -0
  426. package/app/.next/static/chunks/app/api/tunnel/disable/route-bacff678ec57ee01.js +1 -0
  427. package/app/.next/static/chunks/app/api/tunnel/enable/route-bacff678ec57ee01.js +1 -0
  428. package/app/.next/static/chunks/app/api/tunnel/status/route-bacff678ec57ee01.js +1 -0
  429. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-bacff678ec57ee01.js +1 -0
  430. package/app/.next/static/chunks/app/api/usage/chart/route-bacff678ec57ee01.js +1 -0
  431. package/app/.next/static/chunks/app/api/usage/history/route-bacff678ec57ee01.js +1 -0
  432. package/app/.next/static/chunks/app/api/usage/providers/route-bacff678ec57ee01.js +1 -0
  433. package/app/.next/static/chunks/app/api/usage/request-details/route-bacff678ec57ee01.js +1 -0
  434. package/app/.next/static/chunks/app/api/usage/request-logs/route-bacff678ec57ee01.js +1 -0
  435. package/app/.next/static/chunks/app/api/usage/stats/route-bacff678ec57ee01.js +1 -0
  436. package/app/.next/static/chunks/app/api/usage/stream/route-bacff678ec57ee01.js +1 -0
  437. package/app/.next/static/chunks/app/api/v1/api/chat/route-bacff678ec57ee01.js +1 -0
  438. package/app/.next/static/chunks/app/api/v1/chat/completions/route-bacff678ec57ee01.js +1 -0
  439. package/app/.next/static/chunks/app/api/v1/embeddings/route-bacff678ec57ee01.js +1 -0
  440. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-bacff678ec57ee01.js +1 -0
  441. package/app/.next/static/chunks/app/api/v1/messages/route-bacff678ec57ee01.js +1 -0
  442. package/app/.next/static/chunks/app/api/v1/models/route-bacff678ec57ee01.js +1 -0
  443. package/app/.next/static/chunks/app/api/v1/responses/route-bacff678ec57ee01.js +1 -0
  444. package/app/.next/static/chunks/app/api/v1/route-bacff678ec57ee01.js +1 -0
  445. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-bacff678ec57ee01.js +1 -0
  446. package/app/.next/static/chunks/app/api/v1beta/models/route-bacff678ec57ee01.js +1 -0
  447. package/app/.next/static/chunks/app/api/version/route-bacff678ec57ee01.js +1 -0
  448. package/app/.next/static/chunks/app/layout-e2ea1fe43c8d1853.js +1 -0
  449. package/app/.next/static/chunks/app/manifest.webmanifest/route-bacff678ec57ee01.js +1 -0
  450. package/app/.next/static/chunks/app/page-bacff678ec57ee01.js +1 -0
  451. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-bacff678ec57ee01.js +1 -0
  452. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-bacff678ec57ee01.js +1 -0
  453. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-bacff678ec57ee01.js +1 -0
  454. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-bacff678ec57ee01.js +1 -0
  455. package/app/.next/static/css/e0bde17827867456.css +3 -0
  456. package/app/.next/static/sxWcLJ3M3jKWxLlhk7_mc/_buildManifest.js +1 -0
  457. package/app/package.json +2 -1
  458. package/app/public/i18n/literals/vi.json +196 -0
  459. package/app/public/i18n/literals/zh-CN.json +515 -0
  460. package/app/public/providers/chutes.png +0 -0
  461. package/app/public/providers/kilocode.png +0 -0
  462. package/app/public/providers/siliconflow.png +0 -0
  463. package/app/src/mitm/manager.js +2 -2
  464. package/cli.js +23 -20
  465. package/package.json +3 -2
  466. package/src/cli/tray/autostart.js +56 -35
  467. package/app/.next/server/chunks/1238.js +0 -151
  468. package/app/.next/server/chunks/2280.js +0 -1
  469. package/app/.next/server/chunks/3919.js +0 -1
  470. package/app/.next/server/chunks/4841.js +0 -12
  471. package/app/.next/server/chunks/6384.js +0 -1
  472. package/app/.next/server/chunks/7647.js +0 -1
  473. package/app/.next/static/chunks/5497-839d8b620b5b944c.js +0 -7
  474. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/page-d81fceb6f0154d11.js +0 -1
  475. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-a304dab86115ff4c.js +0 -1
  476. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-8b678c522493c335.js +0 -1
  477. package/app/.next/static/chunks/app/(dashboard)/layout-e85ef8386b3bd547.js +0 -1
  478. package/app/.next/static/chunks/app/_global-error/page-3afc9e982dbedc92.js +0 -1
  479. package/app/.next/static/chunks/app/api/auth/login/route-3afc9e982dbedc92.js +0 -1
  480. package/app/.next/static/chunks/app/api/auth/logout/route-3afc9e982dbedc92.js +0 -1
  481. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-3afc9e982dbedc92.js +0 -1
  482. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-3afc9e982dbedc92.js +0 -1
  483. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-3afc9e982dbedc92.js +0 -1
  484. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-3afc9e982dbedc92.js +0 -1
  485. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-3afc9e982dbedc92.js +0 -1
  486. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-3afc9e982dbedc92.js +0 -1
  487. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-3afc9e982dbedc92.js +0 -1
  488. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-3afc9e982dbedc92.js +0 -1
  489. package/app/.next/static/chunks/app/api/cloud/auth/route-3afc9e982dbedc92.js +0 -1
  490. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-3afc9e982dbedc92.js +0 -1
  491. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-3afc9e982dbedc92.js +0 -1
  492. package/app/.next/static/chunks/app/api/cloud/models/alias/route-3afc9e982dbedc92.js +0 -1
  493. package/app/.next/static/chunks/app/api/combos/[id]/route-3afc9e982dbedc92.js +0 -1
  494. package/app/.next/static/chunks/app/api/combos/route-3afc9e982dbedc92.js +0 -1
  495. package/app/.next/static/chunks/app/api/init/route-3afc9e982dbedc92.js +0 -1
  496. package/app/.next/static/chunks/app/api/keys/[id]/route-3afc9e982dbedc92.js +0 -1
  497. package/app/.next/static/chunks/app/api/keys/route-3afc9e982dbedc92.js +0 -1
  498. package/app/.next/static/chunks/app/api/models/alias/route-3afc9e982dbedc92.js +0 -1
  499. package/app/.next/static/chunks/app/api/models/route-3afc9e982dbedc92.js +0 -1
  500. package/app/.next/static/chunks/app/api/models/test/route-3afc9e982dbedc92.js +0 -1
  501. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-3afc9e982dbedc92.js +0 -1
  502. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-3afc9e982dbedc92.js +0 -1
  503. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-3afc9e982dbedc92.js +0 -1
  504. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-3afc9e982dbedc92.js +0 -1
  505. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-3afc9e982dbedc92.js +0 -1
  506. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-3afc9e982dbedc92.js +0 -1
  507. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-3afc9e982dbedc92.js +0 -1
  508. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-3afc9e982dbedc92.js +0 -1
  509. package/app/.next/static/chunks/app/api/pricing/route-3afc9e982dbedc92.js +0 -1
  510. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-3afc9e982dbedc92.js +0 -1
  511. package/app/.next/static/chunks/app/api/provider-nodes/route-3afc9e982dbedc92.js +0 -1
  512. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-3afc9e982dbedc92.js +0 -1
  513. package/app/.next/static/chunks/app/api/providers/[id]/models/route-3afc9e982dbedc92.js +0 -1
  514. package/app/.next/static/chunks/app/api/providers/[id]/route-3afc9e982dbedc92.js +0 -1
  515. package/app/.next/static/chunks/app/api/providers/[id]/test/route-3afc9e982dbedc92.js +0 -1
  516. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-3afc9e982dbedc92.js +0 -1
  517. package/app/.next/static/chunks/app/api/providers/client/route-3afc9e982dbedc92.js +0 -1
  518. package/app/.next/static/chunks/app/api/providers/route-3afc9e982dbedc92.js +0 -1
  519. package/app/.next/static/chunks/app/api/providers/test-batch/route-3afc9e982dbedc92.js +0 -1
  520. package/app/.next/static/chunks/app/api/providers/validate/route-3afc9e982dbedc92.js +0 -1
  521. package/app/.next/static/chunks/app/api/settings/database/route-3afc9e982dbedc92.js +0 -1
  522. package/app/.next/static/chunks/app/api/settings/proxy-test/route-3afc9e982dbedc92.js +0 -1
  523. package/app/.next/static/chunks/app/api/settings/require-login/route-3afc9e982dbedc92.js +0 -1
  524. package/app/.next/static/chunks/app/api/settings/route-3afc9e982dbedc92.js +0 -1
  525. package/app/.next/static/chunks/app/api/shutdown/route-3afc9e982dbedc92.js +0 -1
  526. package/app/.next/static/chunks/app/api/tags/route-3afc9e982dbedc92.js +0 -1
  527. package/app/.next/static/chunks/app/api/translator/console-logs/route-3afc9e982dbedc92.js +0 -1
  528. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-3afc9e982dbedc92.js +0 -1
  529. package/app/.next/static/chunks/app/api/translator/load/route-3afc9e982dbedc92.js +0 -1
  530. package/app/.next/static/chunks/app/api/translator/save/route-3afc9e982dbedc92.js +0 -1
  531. package/app/.next/static/chunks/app/api/translator/send/route-3afc9e982dbedc92.js +0 -1
  532. package/app/.next/static/chunks/app/api/translator/translate/route-3afc9e982dbedc92.js +0 -1
  533. package/app/.next/static/chunks/app/api/tunnel/disable/route-3afc9e982dbedc92.js +0 -1
  534. package/app/.next/static/chunks/app/api/tunnel/enable/route-3afc9e982dbedc92.js +0 -1
  535. package/app/.next/static/chunks/app/api/tunnel/status/route-3afc9e982dbedc92.js +0 -1
  536. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-3afc9e982dbedc92.js +0 -1
  537. package/app/.next/static/chunks/app/api/usage/chart/route-3afc9e982dbedc92.js +0 -1
  538. package/app/.next/static/chunks/app/api/usage/history/route-3afc9e982dbedc92.js +0 -1
  539. package/app/.next/static/chunks/app/api/usage/providers/route-3afc9e982dbedc92.js +0 -1
  540. package/app/.next/static/chunks/app/api/usage/request-details/route-3afc9e982dbedc92.js +0 -1
  541. package/app/.next/static/chunks/app/api/usage/request-logs/route-3afc9e982dbedc92.js +0 -1
  542. package/app/.next/static/chunks/app/api/usage/stats/route-3afc9e982dbedc92.js +0 -1
  543. package/app/.next/static/chunks/app/api/usage/stream/route-3afc9e982dbedc92.js +0 -1
  544. package/app/.next/static/chunks/app/api/v1/api/chat/route-3afc9e982dbedc92.js +0 -1
  545. package/app/.next/static/chunks/app/api/v1/chat/completions/route-3afc9e982dbedc92.js +0 -1
  546. package/app/.next/static/chunks/app/api/v1/embeddings/route-3afc9e982dbedc92.js +0 -1
  547. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-3afc9e982dbedc92.js +0 -1
  548. package/app/.next/static/chunks/app/api/v1/messages/route-3afc9e982dbedc92.js +0 -1
  549. package/app/.next/static/chunks/app/api/v1/models/route-3afc9e982dbedc92.js +0 -1
  550. package/app/.next/static/chunks/app/api/v1/responses/route-3afc9e982dbedc92.js +0 -1
  551. package/app/.next/static/chunks/app/api/v1/route-3afc9e982dbedc92.js +0 -1
  552. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-3afc9e982dbedc92.js +0 -1
  553. package/app/.next/static/chunks/app/api/v1beta/models/route-3afc9e982dbedc92.js +0 -1
  554. package/app/.next/static/chunks/app/api/version/route-3afc9e982dbedc92.js +0 -1
  555. package/app/.next/static/chunks/app/layout-053c430c558380e6.js +0 -1
  556. package/app/.next/static/chunks/app/manifest.webmanifest/route-3afc9e982dbedc92.js +0 -1
  557. package/app/.next/static/chunks/app/page-3afc9e982dbedc92.js +0 -1
  558. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-3afc9e982dbedc92.js +0 -1
  559. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-3afc9e982dbedc92.js +0 -1
  560. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-3afc9e982dbedc92.js +0 -1
  561. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-3afc9e982dbedc92.js +0 -1
  562. package/app/.next/static/css/d3d9432d809fcee0.css +0 -3
  563. package/app/.next/static/cva2-X-MI1QYEhGt-TYDp/_buildManifest.js +0 -1
  564. /package/app/.next/static/{cva2-X-MI1QYEhGt-TYDp → sxWcLJ3M3jKWxLlhk7_mc}/_ssgManifest.js +0 -0
@@ -10,11 +10,11 @@ Dim ps\r
10
10
  ps = Chr(34) & "powershell.exe" & Chr(34)\r
11
11
  Dim args\r
12
12
  args = "-NoProfile -ExecutionPolicy Bypass -File " & Chr(34) & "${k}" & Chr(34)\r
13
- oShell.ShellExecute ps, args, "", "runas", 1`,m=g.join(i.tmpdir(),`mitm_uac_${Date.now()}.vbs`);h.writeFileSync(m,l,"utf8"),e("wscript.exe",[m],{stdio:"ignore",windowsHide:!1,detached:!0}).unref(),await new Promise((a,c)=>{let d=Date.now()+9e4,e=()=>{if(h.existsSync(b)){try{h.unlinkSync(b),h.unlinkSync(k),h.unlinkSync(m)}catch{}return a()}if(Date.now()>d)return c(Error("Timed out waiting for UAC confirmation."));setTimeout(e,500)};e()}),G&&await G({mitmCertInstalled:!0}).catch(()=>{})}else(y=e("sudo",["-S","-E","sh","-c",`ROUTER_API_KEY='${a}' NODE_ENV='production' '${process.execPath}' '${v}'`],{detached:!1,stdio:["pipe","pipe","pipe"]})).stdin.write(`${b}
13
+ oShell.ShellExecute ps, args, "", "runas", 1`,m=g.join(i.tmpdir(),`mitm_uac_${Date.now()}.vbs`);h.writeFileSync(m,l,"utf8"),e("wscript.exe",[m],{stdio:"ignore",windowsHide:!0,detached:!0}).unref(),await new Promise((a,c)=>{let d=Date.now()+9e4,e=()=>{if(h.existsSync(b)){try{h.unlinkSync(b),h.unlinkSync(k),h.unlinkSync(m)}catch{}return a()}if(Date.now()>d)return c(Error("Timed out waiting for UAC confirmation."));setTimeout(e,500)};e()}),G&&await G({mitmCertInstalled:!0}).catch(()=>{})}else(y=e("sudo",["-S","-E","sh","-c",`ROUTER_API_KEY='${a}' NODE_ENV='production' '${process.execPath}' '${v}'`],{detached:!1,stdio:["pipe","pipe","pipe"]})).stdin.write(`${b}
14
14
  `),y.stdin.end();!q&&y&&(z=y.pid,h.writeFileSync(u,String(z)));let o=null;q||(y.stdout.on("data",a=>{console.log(`[MITM Server] ${a.toString().trim()}`)}),y.stderr.on("data",a=>{let b=a.toString().trim();!b||b.includes("Password:")||b.includes("password for")||(console.error(`[MITM Server Error] ${b}`),o=b)}),y.on("exit",a=>{console.log(`MITM server exited with code ${a}`),y=null,z=null;try{h.unlinkSync(u)}catch{}}));let p=await function(a,b=443){return new Promise(c=>{let d=Date.now()+a,e=()=>{let a=k.request({hostname:"127.0.0.1",port:b,path:"/_mitm_health",method:"GET",rejectUnauthorized:!1},a=>{let b="";a.on("data",a=>{b+=a}),a.on("end",()=>{try{let a=JSON.parse(b);c(!0===a.ok?{ok:!0,pid:a.pid||null}:null)}catch{c(null)}})});a.on("error",()=>{Date.now()<d?setTimeout(e,500):c(null)}),a.end()};e()})}(q?15e3:8e3,443);if(!p){q&&(y=null);let a=function(){try{if(q){let a=f('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{encoding:"utf8",windowsHide:!0}).trim(),b=parseInt(a,10);if(b&&b>4){let a=f(`tasklist /FI "PID eq ${b}" /FO CSV /NH`,{encoding:"utf8",windowsHide:!0}).match(/"([^"]+)"/);if(a)return a[1].replace(".exe","")}}else{let a=f("lsof -i :443",{encoding:"utf8"}).trim().split("\n");if(a.length>1)return a[1].split(/\s+/)[0]}}catch{}return null}(),b=a?` Port 443 already in use by ${a}.`:"",c=o||`Check sudo password or port 443 access.${b}`;throw Error(`MITM server failed to start. ${c}`)}return q&&G&&await G({mitmCertInstalled:!0}).catch(()=>{}),q&&p.pid&&(z=p.pid,h.writeFileSync(u,String(z))),await H(!0,b),b&&B(b),{running:!0,pid:z}}async function M(a){console.log("[MITM] Removing all DNS entries before stopping server..."),await o(a);let b=y;if(b&&!b.killed)console.log("Stopping MITM server..."),D(b.pid,!1,a),await new Promise(a=>setTimeout(a,1e3)),C(b.pid)&&D(b.pid,!0,a),y=null,z=null;else{try{if(h.existsSync(u)){let b=parseInt(h.readFileSync(u,"utf-8").trim(),10);b&&C(b)&&(console.log(`Killing MITM server (PID: ${b})...`),D(b,!1,a),await new Promise(a=>setTimeout(a,1e3)),C(b)&&D(b,!0,a))}}catch{}y=null,z=null}if(q){let a=g.join(process.env.SystemRoot||"C:\\Windows","System32","drivers","etc","hosts"),{TOOL_HOSTS:b}=c(66936),d=Object.values(b).flat(),f="";try{f=h.readFileSync(a,"utf8")}catch{}let j=f.split(/\r?\n/).filter(a=>!d.some(b=>a.includes(b))).join("\r\n"),k=g.join(i.tmpdir(),"mitm_hosts_clean.tmp");h.writeFileSync(k,j,"utf8");let l=g.join(i.tmpdir(),"mitm_stop_done.flag"),m=`Copy-Item -Path '${k.replace(/'/g,"''")}' -Destination '${a.replace(/'/g,"''")}' -Force
15
15
  & ipconfig /flushdns | Out-Null
16
16
  Remove-Item '${k.replace(/'/g,"''")}' -ErrorAction SilentlyContinue
17
17
  Set-Content -Path '${l.replace(/'/g,"''")}' -Value 'done' -Encoding UTF8`,n=g.join(i.tmpdir(),"mitm_stop.ps1");h.writeFileSync(n,m,"utf8");let o=`Set oShell = CreateObject("Shell.Application")\r
18
18
  Dim args\r
19
19
  args = "-NoProfile -ExecutionPolicy Bypass -File " & Chr(34) & "${n}" & Chr(34)\r
20
- oShell.ShellExecute "powershell.exe", args, "", "runas", 1`,p=g.join(i.tmpdir(),"mitm_stop_uac.vbs");h.writeFileSync(p,o,"utf8"),e("wscript.exe",[p],{stdio:"ignore",windowsHide:!1,detached:!0}).unref(),await new Promise(a=>{let b=Date.now()+3e4,c=()=>{if(h.existsSync(l)){try{h.unlinkSync(l),h.unlinkSync(n),h.unlinkSync(p)}catch{}return a()}if(Date.now()>b)return a();setTimeout(c,500)};c()})}try{h.unlinkSync(u)}catch{}return await H(!1,null),{running:!1,pid:null}}async function N(a,b){if(!(await K()).running)throw Error("MITM server is not running. Start the server first.");let c=b||A()||await I();return await m(a,c),{success:!0}}a.exports={getMitmStatus:K,startServer:L,stopServer:M,enableToolDNS:N,disableToolDNS:async function a(a,b){let c=b||A()||await I();return await n(a,c),{success:!0}},startMitm:L,stopMitm:M,getCachedPassword:A,setCachedPassword:B,loadEncryptedPassword:I,initDbHooks:function(a,b){F=a,G=b}}}};
20
+ oShell.ShellExecute "powershell.exe", args, "", "runas", 1`,p=g.join(i.tmpdir(),"mitm_stop_uac.vbs");h.writeFileSync(p,o,"utf8"),e("wscript.exe",[p],{stdio:"ignore",windowsHide:!0,detached:!0}).unref(),await new Promise(a=>{let b=Date.now()+3e4,c=()=>{if(h.existsSync(l)){try{h.unlinkSync(l),h.unlinkSync(n),h.unlinkSync(p)}catch{}return a()}if(Date.now()>b)return a();setTimeout(c,500)};c()})}try{h.unlinkSync(u)}catch{}return await H(!1,null),{running:!1,pid:null}}async function N(a,b){if(!(await K()).running)throw Error("MITM server is not running. Start the server first.");let c=b||A()||await I();return await m(a,c),{success:!0}}a.exports={getMitmStatus:K,startServer:L,stopServer:M,enableToolDNS:N,disableToolDNS:async function a(a,b){let c=b||A()||await I();return await n(a,c),{success:!0}},startMitm:L,stopMitm:M,getCachedPassword:A,setCachedPassword:B,loadEncryptedPassword:I,initDbHooks:function(a,b){F=a,G=b}}}};
@@ -12,4 +12,4 @@ model_provider = "9router"
12
12
  name = "9Router"
13
13
  base_url = "${O()}"
14
14
  wire_api = "responses"
15
- `},{filename:"~/.codex/auth.json",content:JSON.stringify({OPENAI_API_KEY:o},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:l,cloudEnabled:m,initialStatus:n}){let o,p,q,r,[s,t]=(0,e.useState)(n||null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)({}),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)("");(0,e.useRef)(!1);let O=(()=>{if(!s?.installed)return null;let a=s.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=m&&k&&a.baseUrl?.startsWith(k),d=h&&a.baseUrl?.startsWith(h);return b||c||d?"configured":"other"})(),P=async()=>{v(!0);try{let a=await fetch("/api/cli-tools/droid-settings"),b=await a.json();t(b)}catch(a){t({installed:!1,error:a.message})}finally{v(!1)}},Q=()=>{let a=M||h;return a.endsWith("/v1")?a:`${a}/v1`},R=async()=>{x(!0),B(null);try{let a=C?.trim()||(j?.length>0?j[0].key:null)||(m?null:"sk_9router"),b=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:Q(),apiKey:a,model:E})}),c=await b.json();b.ok?(B({type:"success",text:"Settings applied successfully!"}),P()):B({type:"error",text:c.error||"Failed to apply settings"})}catch(a){B({type:"error",text:a.message})}finally{x(!1)}},S=async()=>{z(!0),B(null);try{let a=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),b=await a.json();a.ok?(B({type:"success",text:"Settings reset successfully!"}),F(""),D(""),P()):B({type:"error",text:b.error||"Failed to reset settings"})}catch(a){B({type:"error",text:a.message})}finally{z(!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"===O&&(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"===O&&(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"===O&&(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:[u&&(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..."})]}),!u&&s&&!s.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."})]})]}),!u&&s?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[s?.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:s.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:(o=M||h).endsWith("/v1")?o:`${o}/v1`,onChange:a=>N(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"}),M&&M!==h&&(0,d.jsx)("button",{onClick:()=>N(""),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:C,onChange:a=>D(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:m?"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:E,onChange:a=>F(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:()=>H(!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"}),E&&(0,d.jsx)("button",{onClick:()=>F(""),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&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,d.jsx)("span",{children:A.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:R,disabled:!E,loading:w,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:S,disabled:!s?.has9Router,loading:y,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:()=>L(!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:G,onClose:()=>H(!1),onSelect:a=>{F(a.value),H(!1)},selectedModel:E,activeProviders:l,modelAliases:I,title:"Select Model for Factory Droid"}),(0,d.jsx)(f.uR,{isOpen:K,onClose:()=>L(!1),title:"Factory Droid - Manual Configuration",configs:(p=C&&C.trim()?C:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",q={customModels:[{model:E||"provider/model-id",id:"custom:9Router-0",index:0,baseUrl:Q(),apiKey:p,displayName:E||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},r="u">typeof navigator&&navigator.platform,[{filename:r?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(q,null,2)}])})]})}function m({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:k,cloudEnabled:l,initialStatus:m}){let n,o,[p,q]=(0,e.useState)(m||null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)({}),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)("");(0,e.useRef)(!1);let L=(()=>{if(!p?.installed)return null;let a=p.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"})(),M=async()=>{s(!0);try{let a=await fetch("/api/cli-tools/openclaw-settings"),b=await a.json();q(b)}catch(a){q({installed:!1,error:a.message})}finally{s(!1)}},N=()=>{let a=J||"http://127.0.0.1:20128";return a.endsWith("/v1")?a:`${a}/v1`},O=async()=>{u(!0),y(null);try{let a=z?.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:N(),apiKey:a,model:B})}),c=await b.json();b.ok?(y({type:"success",text:"Settings applied successfully!"}),M()):y({type:"error",text:c.error||"Failed to apply settings"})}catch(a){y({type:"error",text:a.message})}finally{u(!1)}},P=async()=>{w(!0),y(null);try{let a=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),b=await a.json();a.ok?(y({type:"success",text:"Settings reset successfully!"}),C(""),A(""),M()):y({type:"error",text:b.error||"Failed to reset settings"})}catch(a){y({type:"error",text:a.message})}finally{w(!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"===L&&(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"===L&&(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"===L&&(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:[r&&(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..."})]}),!r&&p&&!p.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."})]})]}),!r&&p?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[p?.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:p.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:(n=J||"http://127.0.0.1:20128").endsWith("/v1")?n:`${n}/v1`,onChange:a=>K(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"}),J&&J!==h&&(0,d.jsx)("button",{onClick:()=>K(""),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:z,onChange:a=>A(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:B,onChange:a=>C(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:()=>E(!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"}),B&&(0,d.jsx)("button",{onClick:()=>C(""),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"})})]})]}),x&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===x.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"===x.type?"check_circle":"error"}),(0,d.jsx)("span",{children:x.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:O,disabled:!B,loading:t,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:P,disabled:!p?.has9Router,loading:v,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:()=>I(!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:D,onClose:()=>E(!1),onSelect:a=>{C(a.value),E(!1)},selectedModel:B,activeProviders:k,modelAliases:F,title:"Select Model for Open Claw"}),(0,d.jsx)(f.uR,{isOpen:H,onClose:()=>I(!1),title:"Open Claw - Manual Configuration",configs:(o=z&&z.trim()?z:l?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`9router/${B||"provider/model-id"}`}}},models:{providers:{"9router":{baseUrl:N(),apiKey:o,api:"openai-completions",models:[{id:B||"provider/model-id",name:(B||"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[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(()=>j?.length>0?j[0].key:""),v=a=>{let b=t&&t.trim()?t: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,r||"provider/model-id")},w=async(a,b)=>{await navigator.clipboard.writeText(v(a)),o(b),setTimeout(()=>o(null),2e3)},x=k.length>0,y=()=>(!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,y()&&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:t,onChange:a=>u(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:()=>w(t,"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"===n?"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:r,onChange:a=>s(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:()=>q(!0),disabled:!x,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${x?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:()=>w(r,"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"===n?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>s(""),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:v(a.value)}),a.copyable&&(0,d.jsx)("button",{onClick:()=>w(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:n===`${a.step}-${a.title}`?"check":"content_copy"})})]})]})]},a.step)),y()&&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:()=>w(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"===n?"check":"content_copy"}),"codeblock"===n?"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:v(b.codeBlock.code)})})]})]}):(0,d.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,d.jsx)(f.rq,{isOpen:p,onClose:()=>q(!1),onSelect:a=>{s(a.value)},selectedModel:r,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,o]=(0,e.useState)(l||null),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)({}),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(""),L=(()=>{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"})(),M=()=>{let a=J||h;return a.endsWith("/v1")?a:`${a}/v1`},N=async()=>{q(!0);try{let a=await fetch("/api/cli-tools/opencode-settings"),b=await a.json();o(b)}catch(a){o({installed:!1,error:a.message})}finally{q(!1)}},O=async()=>{s(!0),w(null);try{let a=z&&z.trim()||k?z:"sk_9router",b=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:M(),apiKey:a,model:B})}),c=await b.json();b.ok?(w({type:"success",text:"Settings applied successfully!"}),N()):w({type:"error",text:c.error||"Failed to apply settings"})}catch(a){w({type:"error",text:a.message})}finally{s(!1)}},P=async()=>{u(!0),w(null);try{let a=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),b=await a.json();a.ok?(w({type:"success",text:"Settings reset successfully!"}),C(""),N()):w({type:"error",text:b.error||"Failed to reset settings"})}catch(a){w({type:"error",text:a.message})}finally{u(!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"===L&&(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"===L&&(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"===L&&(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:[p&&(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..."})]}),!p&&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:()=>y(!x),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:x?"expand_less":"help"}),x?"Hide":"How to Install"]})]}),x&&(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."]})]})]})]}),!p&&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:J||`${h}/v1`,onChange:a=>K(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"}),J&&J!==`${h}/v1`&&(0,d.jsx)("button",{onClick:()=>K(""),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:z,onChange:a=>A(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:B,onChange:a=>C(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:()=>E(!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"}),B&&(0,d.jsx)("button",{onClick:()=>C(""),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"})})]})]}),v&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===v.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"===v.type?"check_circle":"error"}),(0,d.jsx)("span",{children:v.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:O,disabled:!B,loading:r,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:P,disabled:!n.has9Router,loading:t,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:()=>I(!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:D,onClose:()=>E(!1),onSelect:a=>{C(a.value),E(!1)},selectedModel:B,activeProviders:j,modelAliases:F,title:"Select Model for OpenCode"}),(0,d.jsx)(f.uR,{isOpen:H,onClose:()=>I(!1),title:"OpenCode - Manual Configuration",configs:(m=z&&z.trim()?z:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{"9router":{npm:"@ai-sdk/openai-compatible",options:{baseURL:M(),apiKey:m},models:{[B||"provider/model-id"]:{name:B||"provider/model-id"}}}},model:`9router/${B||"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,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),u="u">typeof navigator&&navigator.userAgent?.includes("Windows"),v=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:{}})}},w=a=>{u||g?.hasCachedPassword?x(a,""):(t(a),l(!0),r(null))},x=async(c,d)=>{j(!0),r(null);try{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?r({type:"success",text:"Server started"}):r({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?r({type:"success",text:"Server stopped — all DNS cleared"}):r({type:"error",text:b.error||"Failed to stop server"})}l(!1),n(""),await v()}catch(a){r({type:"error",text:a.message})}finally{j(!1),t(null)}},y=()=>{m.trim()?x(s,m):r({type:"error",text:"Sudo password is required"})},z=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"}),z?(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",children:[{label:"Cert",ok:g?.certExists},{label:"Server",ok:z}].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":"radio_button_unchecked"}),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 9Router"]}),(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 → 9Router → response to Antigravity/Copilot"]})]}),!z&&(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=>p(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)"})]}),q&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===q.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"===q.type?"check_circle":"error"}),(0,d.jsx)("span",{children:q.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[z?(0,d.jsxs)("button",{onClick:()=>w("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:()=>w("start"),disabled:i,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"]}),z&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),!z&&u&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-yellow-500/10 text-yellow-600 border border-yellow-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,d.jsx)("span",{children:"Windows: Run 9Router terminal as Administrator"})]})]})}),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||y()}}),q&&(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:q.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(""),r(null)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:y,loading:i,children:"Confirm"})]})]})})]})}function q({tool:a,isExpanded:b,onToggle:c,serverRunning:h,dnsActive:i,hasCachedPassword:j,apiKeys:k,activeProviders:l,hasActiveProviders:m,cloudEnabled:n,onDnsChange:o}){let[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)({}),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(null),F="u">typeof navigator&&navigator.userAgent?.includes("Windows"),G=(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]),H=(a,b)=>{A(c=>({...c,[a]:b}))},I=()=>{if(!h)return;let a=i?"disable":"enable";F||j?J(a,""):(y(a),u(!0),s(null))},J=async(b,c)=>{q(!0),s(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?s({type:"success",text:`DNS enabled successfully. Please restart ${a.name} to apply changes.`}):s({type:"success",text:"DNS disabled — traffic restored"}),u(!1),w(""),o?.(e)}catch(a){s({type:"error",text:a.message})}finally{q(!1),y(null)}},K=()=>{v.trim()?J(x,v):s({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 9Router via MITM."]}),!i&&(0,d.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),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})]}),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:z[a.alias]||"",onChange:b=>H(a.alias,b.target.value),onBlur:b=>{var c,d;return c=a.alias,d=b.target.value,void G({...z,[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:()=>{E(a.alias),C(!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"}),z[a.alias]&&(0,d.jsx)("button",{onClick:()=>{H(a.alias,""),G({...z,[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:I,disabled:!h||p,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:I,loading:p,disabled:!h||p,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"play_circle"}),"Start DNS"]})})]})]}),t&&(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:v,onChange:a=>w(a.target.value),onKeyDown:a=>{"Enter"!==a.key||p||K()}}),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:()=>{u(!1),w(""),s(null)},disabled:p,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:K,loading:p,children:"Confirm"})]})]})}),(0,d.jsx)(f.rq,{isOpen:B,onClose:()=>C(!1),onSelect:a=>{if(!D)return;let b={...z,[D]:a.value};A(b),G(b)},selectedModel:D?z[D]:null,activeProviders:l,title:`Select model for ${D}`})]})}}};
15
+ `},{filename:"~/.codex/auth.json",content:JSON.stringify({OPENAI_API_KEY:o},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:l,cloudEnabled:m,initialStatus:n}){let o,p,q,r,[s,t]=(0,e.useState)(n||null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)({}),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)("");(0,e.useRef)(!1);let O=(()=>{if(!s?.installed)return null;let a=s.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=m&&k&&a.baseUrl?.startsWith(k),d=h&&a.baseUrl?.startsWith(h);return b||c||d?"configured":"other"})(),P=async()=>{v(!0);try{let a=await fetch("/api/cli-tools/droid-settings"),b=await a.json();t(b)}catch(a){t({installed:!1,error:a.message})}finally{v(!1)}},Q=()=>{let a=M||h;return a.endsWith("/v1")?a:`${a}/v1`},R=async()=>{x(!0),B(null);try{let a=C?.trim()||(j?.length>0?j[0].key:null)||(m?null:"sk_9router"),b=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:Q(),apiKey:a,model:E})}),c=await b.json();b.ok?(B({type:"success",text:"Settings applied successfully!"}),P()):B({type:"error",text:c.error||"Failed to apply settings"})}catch(a){B({type:"error",text:a.message})}finally{x(!1)}},S=async()=>{z(!0),B(null);try{let a=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),b=await a.json();a.ok?(B({type:"success",text:"Settings reset successfully!"}),F(""),D(""),P()):B({type:"error",text:b.error||"Failed to reset settings"})}catch(a){B({type:"error",text:a.message})}finally{z(!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"===O&&(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"===O&&(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"===O&&(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:[u&&(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..."})]}),!u&&s&&!s.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."})]})]}),!u&&s?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[s?.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:s.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:(o=M||h).endsWith("/v1")?o:`${o}/v1`,onChange:a=>N(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"}),M&&M!==h&&(0,d.jsx)("button",{onClick:()=>N(""),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:C,onChange:a=>D(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:m?"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:E,onChange:a=>F(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:()=>H(!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"}),E&&(0,d.jsx)("button",{onClick:()=>F(""),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&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,d.jsx)("span",{children:A.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:R,disabled:!E,loading:w,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:S,disabled:!s?.has9Router,loading:y,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:()=>L(!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:G,onClose:()=>H(!1),onSelect:a=>{F(a.value),H(!1)},selectedModel:E,activeProviders:l,modelAliases:I,title:"Select Model for Factory Droid"}),(0,d.jsx)(f.uR,{isOpen:K,onClose:()=>L(!1),title:"Factory Droid - Manual Configuration",configs:(p=C&&C.trim()?C:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",q={customModels:[{model:E||"provider/model-id",id:"custom:9Router-0",index:0,baseUrl:Q(),apiKey:p,displayName:E||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},r="u">typeof navigator&&navigator.platform,[{filename:r?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(q,null,2)}])})]})}function m({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:k,cloudEnabled:l,initialStatus:m}){let n,o,[p,q]=(0,e.useState)(m||null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)({}),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)("");(0,e.useRef)(!1);let L=(()=>{if(!p?.installed)return null;let a=p.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"})(),M=async()=>{s(!0);try{let a=await fetch("/api/cli-tools/openclaw-settings"),b=await a.json();q(b)}catch(a){q({installed:!1,error:a.message})}finally{s(!1)}},N=()=>{let a=J||"http://127.0.0.1:20128";return a.endsWith("/v1")?a:`${a}/v1`},O=async()=>{u(!0),y(null);try{let a=z?.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:N(),apiKey:a,model:B})}),c=await b.json();b.ok?(y({type:"success",text:"Settings applied successfully!"}),M()):y({type:"error",text:c.error||"Failed to apply settings"})}catch(a){y({type:"error",text:a.message})}finally{u(!1)}},P=async()=>{w(!0),y(null);try{let a=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),b=await a.json();a.ok?(y({type:"success",text:"Settings reset successfully!"}),C(""),A(""),M()):y({type:"error",text:b.error||"Failed to reset settings"})}catch(a){y({type:"error",text:a.message})}finally{w(!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"===L&&(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"===L&&(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"===L&&(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:[r&&(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..."})]}),!r&&p&&!p.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."})]})]}),!r&&p?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[p?.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:p.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:(n=J||"http://127.0.0.1:20128").endsWith("/v1")?n:`${n}/v1`,onChange:a=>K(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"}),J&&J!==h&&(0,d.jsx)("button",{onClick:()=>K(""),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:z,onChange:a=>A(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:B,onChange:a=>C(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:()=>E(!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"}),B&&(0,d.jsx)("button",{onClick:()=>C(""),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"})})]})]}),x&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===x.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"===x.type?"check_circle":"error"}),(0,d.jsx)("span",{children:x.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:O,disabled:!B,loading:t,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:P,disabled:!p?.has9Router,loading:v,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:()=>I(!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:D,onClose:()=>E(!1),onSelect:a=>{C(a.value),E(!1)},selectedModel:B,activeProviders:k,modelAliases:F,title:"Select Model for Open Claw"}),(0,d.jsx)(f.uR,{isOpen:H,onClose:()=>I(!1),title:"Open Claw - Manual Configuration",configs:(o=z&&z.trim()?z:l?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`9router/${B||"provider/model-id"}`}}},models:{providers:{"9router":{baseUrl:N(),apiKey:o,api:"openai-completions",models:[{id:B||"provider/model-id",name:(B||"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[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(()=>j?.length>0?j[0].key:""),v=a=>{let b=t&&t.trim()?t: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,r||"provider/model-id")},w=async(a,b)=>{await navigator.clipboard.writeText(v(a)),o(b),setTimeout(()=>o(null),2e3)},x=k.length>0,y=()=>(!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,y()&&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:t,onChange:a=>u(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:()=>w(t,"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"===n?"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:r,onChange:a=>s(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:()=>q(!0),disabled:!x,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${x?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:()=>w(r,"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"===n?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>s(""),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:v(a.value)}),a.copyable&&(0,d.jsx)("button",{onClick:()=>w(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:n===`${a.step}-${a.title}`?"check":"content_copy"})})]})]})]},a.step)),y()&&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:()=>w(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"===n?"check":"content_copy"}),"codeblock"===n?"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:v(b.codeBlock.code)})})]})]}):(0,d.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,d.jsx)(f.rq,{isOpen:p,onClose:()=>q(!1),onSelect:a=>{s(a.value)},selectedModel:r,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,o]=(0,e.useState)(l||null),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)({}),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(""),L=(()=>{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"})(),M=()=>{let a=J||h;return a.endsWith("/v1")?a:`${a}/v1`},N=async()=>{q(!0);try{let a=await fetch("/api/cli-tools/opencode-settings"),b=await a.json();o(b)}catch(a){o({installed:!1,error:a.message})}finally{q(!1)}},O=async()=>{s(!0),w(null);try{let a=z&&z.trim()||k?z:"sk_9router",b=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:M(),apiKey:a,model:B})}),c=await b.json();b.ok?(w({type:"success",text:"Settings applied successfully!"}),N()):w({type:"error",text:c.error||"Failed to apply settings"})}catch(a){w({type:"error",text:a.message})}finally{s(!1)}},P=async()=>{u(!0),w(null);try{let a=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),b=await a.json();a.ok?(w({type:"success",text:"Settings reset successfully!"}),C(""),N()):w({type:"error",text:b.error||"Failed to reset settings"})}catch(a){w({type:"error",text:a.message})}finally{u(!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"===L&&(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"===L&&(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"===L&&(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:[p&&(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..."})]}),!p&&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:()=>y(!x),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:x?"expand_less":"help"}),x?"Hide":"How to Install"]})]}),x&&(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."]})]})]})]}),!p&&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:J||`${h}/v1`,onChange:a=>K(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"}),J&&J!==`${h}/v1`&&(0,d.jsx)("button",{onClick:()=>K(""),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:z,onChange:a=>A(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:B,onChange:a=>C(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:()=>E(!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"}),B&&(0,d.jsx)("button",{onClick:()=>C(""),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"})})]})]}),v&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===v.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"===v.type?"check_circle":"error"}),(0,d.jsx)("span",{children:v.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:O,disabled:!B,loading:r,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:P,disabled:!n.has9Router,loading:t,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:()=>I(!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:D,onClose:()=>E(!1),onSelect:a=>{C(a.value),E(!1)},selectedModel:B,activeProviders:j,modelAliases:F,title:"Select Model for OpenCode"}),(0,d.jsx)(f.uR,{isOpen:H,onClose:()=>I(!1),title:"OpenCode - Manual Configuration",configs:(m=z&&z.trim()?z:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{"9router":{npm:"@ai-sdk/openai-compatible",options:{baseURL:M(),apiKey:m},models:{[B||"provider/model-id"]:{name:B||"provider/model-id"}}}},model:`9router/${B||"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,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),u="u">typeof navigator&&navigator.userAgent?.includes("Windows"),v=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:{}})}},w=a=>{u||g?.hasCachedPassword?x(a,""):(t(a),l(!0),r(null))},x=async(c,d)=>{j(!0),r(null);try{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?r({type:"success",text:"Server started"}):r({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?r({type:"success",text:"Server stopped — all DNS cleared"}):r({type:"error",text:b.error||"Failed to stop server"})}l(!1),n(""),await v()}catch(a){r({type:"error",text:a.message})}finally{j(!1),t(null)}},y=()=>{m.trim()?x(s,m):r({type:"error",text:"Sudo password is required"})},z=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"}),z?(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",children:[{label:"Cert",ok:g?.certExists},{label:"Server",ok:z}].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":"radio_button_unchecked"}),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 9Router"]}),(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 → 9Router → response to Antigravity/Copilot"]})]}),!z&&(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=>p(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)"})]}),q&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===q.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"===q.type?"check_circle":"error"}),(0,d.jsx)("span",{children:q.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[z?(0,d.jsxs)("button",{onClick:()=>w("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:()=>w("start"),disabled:i,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"]}),z&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),!z&&u&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-yellow-500/10 text-yellow-600 border border-yellow-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,d.jsx)("span",{children:"Windows: Run 9Router terminal as Administrator"})]})]})}),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||y()}}),q&&(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:q.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(""),r(null)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:y,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[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)({}),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(null),G="u">typeof navigator&&navigator.userAgent?.includes("Windows"),H=(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]),I=(a,b)=>{B(c=>({...c,[a]:b}))},J=()=>{if(!h)return;let a=i?"disable":"enable";G||j?K(a,""):(z(a),v(!0),t(null))},K=async(b,c)=>{r(!0),t(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?t({type:"success",text:`DNS enabled successfully. Please restart ${a.name} to apply changes.`}):t({type:"success",text:"DNS disabled — traffic restored"}),v(!1),x(""),p?.(e)}catch(a){t({type:"error",text:a.message})}finally{r(!1),z(null)}},L=()=>{w.trim()?K(y,w):t({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 9Router via MITM."]}),!i&&(0,d.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),s&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===s.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===s.type?"check_circle":"error"}),(0,d.jsx)("span",{children:s.text})]}),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:A[a.alias]||"",onChange:b=>I(a.alias,b.target.value),onBlur:b=>{var c,d;return c=a.alias,d=b.target.value,void H({...A,[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:()=>{F(a.alias),D(!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"}),A[a.alias]&&(0,d.jsx)("button",{onClick:()=>{I(a.alias,""),H({...A,[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:J,disabled:!h||q,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:J,loading:q,disabled:!h||q,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"play_circle"}),"Start DNS"]})})]})]}),u&&(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:w,onChange:a=>x(a.target.value),onKeyDown:a=>{"Enter"!==a.key||q||L()}}),s&&(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:s.text})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{v(!1),x(""),t(null)},disabled:q,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:L,loading:q,children:"Confirm"})]})]})}),(0,d.jsx)(f.rq,{isOpen:C,onClose:()=>D(!1),onSelect:a=>{if(!E||a.isPlaceholder)return;let b={...A,[E]:a.value};B(b),H(b)},selectedModel:E?A[E]:null,activeProviders:l,modelAliases:n,title:`Select model for ${E}`})]})}}};
@@ -0,0 +1 @@
1
+ exports.id=7132,exports.ids=[7132],exports.modules={2422:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/UsageStats.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/UsageStats.js","default")},3080:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/OAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/OAuthModal.js","default")},7290:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Card.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Card.js","default")},10079:(a,b,c)=>{"use strict";c.d(b,{ConfirmModal:()=>f,default:()=>e});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Modal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Modal.js","default"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call ConfirmModal() from the server but ConfirmModal is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Modal.js","ConfirmModal")},14285:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/KiroOAuthWrapper.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/KiroOAuthWrapper.js","default")},19083:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/RequestLogger.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/RequestLogger.js","default")},23553:(a,b,c)=>{Promise.resolve().then(c.bind(c,70061)),Promise.resolve().then(c.bind(c,33893)),Promise.resolve().then(c.bind(c,45512)),Promise.resolve().then(c.bind(c,7290)),Promise.resolve().then(c.bind(c,40167)),Promise.resolve().then(c.bind(c,49123)),Promise.resolve().then(c.bind(c,92669)),Promise.resolve().then(c.bind(c,80342)),Promise.resolve().then(c.bind(c,71230)),Promise.resolve().then(c.bind(c,82448)),Promise.resolve().then(c.bind(c,14285)),Promise.resolve().then(c.bind(c,87228)),Promise.resolve().then(c.bind(c,45205)),Promise.resolve().then(c.bind(c,64420)),Promise.resolve().then(c.bind(c,61780)),Promise.resolve().then(c.bind(c,92082)),Promise.resolve().then(c.bind(c,70603)),Promise.resolve().then(c.bind(c,10079)),Promise.resolve().then(c.bind(c,94582)),Promise.resolve().then(c.bind(c,3080)),Promise.resolve().then(c.bind(c,19083)),Promise.resolve().then(c.bind(c,54065)),Promise.resolve().then(c.bind(c,83784)),Promise.resolve().then(c.bind(c,26866)),Promise.resolve().then(c.bind(c,89886)),Promise.resolve().then(c.bind(c,40515)),Promise.resolve().then(c.bind(c,70092)),Promise.resolve().then(c.bind(c,2422))},26866:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Sidebar.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Sidebar.js","default")},30508:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(5735);c(45512),c(71230),c(83784),c(7290),c(10079),c(92082),c(70061),c(33893),c(70092),c(40515),c(89886),c(26866),c(92669),c(49123),c(3080),c(94582),c(70603),c(2422),c(45205),c(19083),c(82448),c(14285),c(87228),c(40167),c(80342),c(54065);var e=c(61780);function f({children:a}){return(0,d.jsx)(e.default,{children:a})}c(64420)},33893:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Badge.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Badge.js","default")},36705:(a,b,c)=>{Promise.resolve().then(c.bind(c,25919)),Promise.resolve().then(c.bind(c,75171)),Promise.resolve().then(c.bind(c,99070)),Promise.resolve().then(c.bind(c,17660)),Promise.resolve().then(c.bind(c,51109)),Promise.resolve().then(c.bind(c,48781)),Promise.resolve().then(c.bind(c,86739)),Promise.resolve().then(c.bind(c,79488)),Promise.resolve().then(c.bind(c,83552)),Promise.resolve().then(c.bind(c,86209)),Promise.resolve().then(c.bind(c,5291)),Promise.resolve().then(c.bind(c,56110)),Promise.resolve().then(c.bind(c,267)),Promise.resolve().then(c.bind(c,53838)),Promise.resolve().then(c.bind(c,85306)),Promise.resolve().then(c.bind(c,74812)),Promise.resolve().then(c.bind(c,39645)),Promise.resolve().then(c.bind(c,95145)),Promise.resolve().then(c.bind(c,83352)),Promise.resolve().then(c.bind(c,79346)),Promise.resolve().then(c.bind(c,91809)),Promise.resolve().then(c.bind(c,91099)),Promise.resolve().then(c.bind(c,4770)),Promise.resolve().then(c.bind(c,42196)),Promise.resolve().then(c.bind(c,19308)),Promise.resolve().then(c.bind(c,53845)),Promise.resolve().then(c.bind(c,95514)),Promise.resolve().then(c.bind(c,87226))},40167:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/CursorAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/CursorAuthModal.js","default")},40515:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/ThemeToggle.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/ThemeToggle.js","default")},45205:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/LanguageSwitcher.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/LanguageSwitcher.js","default")},45512:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Button.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Button.js","default")},49123:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Footer.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Footer.js","default")},54065:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/SegmentedControl.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/SegmentedControl.js","default")},61780:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/layouts/DashboardLayout.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/layouts/DashboardLayout.js","default")},64420:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/layouts/AuthLayout.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/layouts/AuthLayout.js","default")},70061:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Avatar.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Avatar.js","default")},70092:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Toggle.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Toggle.js","default")},70603:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/ManualConfigModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/ManualConfigModal.js","default")},71230:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Input.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Input.js","default")},80342:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/IFlowCookieModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/IFlowCookieModal.js","default")},82448:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/KiroAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/KiroAuthModal.js","default")},83784:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Select.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Select.js","default")},87228:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/KiroSocialOAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/KiroSocialOAuthModal.js","default")},92082:(a,b,c)=>{"use strict";c.d(b,{CardSkeleton:()=>h,PageLoading:()=>f,Skeleton:()=>g,Spinner:()=>e,default:()=>i});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Spinner() from the server but Spinner is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Loading.js","Spinner"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageLoading() from the server but PageLoading is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Loading.js","PageLoading"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call Skeleton() from the server but Skeleton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Loading.js","Skeleton"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call CardSkeleton() from the server but CardSkeleton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Loading.js","CardSkeleton"),i=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Loading.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Loading.js","default")},92669:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Header.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/Header.js","default")},94582:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/ModelSelectModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/shared/components/ModelSelectModal.js","default")}};
@@ -0,0 +1 @@
1
+ exports.id=7861,exports.ids=[7861],exports.modules={300:(a,b,c)=>{"use strict";c.d(b,{Zr:()=>e});let d=a=>b=>{try{let c=a(b);if(c instanceof Promise)return c;return{then:a=>d(a)(c),catch(a){return this}}}catch(a){return{then(a){return this},catch:b=>d(b)(a)}}},e=(a,b)=>(c,e,f)=>{let g,h={storage:function(a,b){let c;try{c=a()}catch(a){return}return{getItem:a=>{var b;let d=a=>null===a?null:JSON.parse(a,void 0),e=null!=(b=c.getItem(a))?b:null;return e instanceof Promise?e.then(d):d(e)},setItem:(a,b)=>c.setItem(a,JSON.stringify(b,void 0)),removeItem:a=>c.removeItem(a)}}(()=>window.localStorage),partialize:a=>a,version:0,merge:(a,b)=>({...b,...a}),...b},i=!1,j=0,k=new Set,l=new Set,m=h.storage;if(!m)return a((...a)=>{console.warn(`[zustand persist middleware] Unable to update item '${h.name}', the given storage is currently unavailable.`),c(...a)},e,f);let n=()=>{let a=h.partialize({...e()});return m.setItem(h.name,{state:a,version:h.version})},o=f.setState;f.setState=(a,b)=>(o(a,b),n());let p=a((...a)=>(c(...a),n()),e,f);f.getInitialState=()=>p;let q=()=>{var a,b;if(!m)return;let f=++j;i=!1,k.forEach(a=>{var b;return a(null!=(b=e())?b:p)});let o=(null==(b=h.onRehydrateStorage)?void 0:b.call(h,null!=(a=e())?a:p))||void 0;return d(m.getItem.bind(m))(h.name).then(a=>{if(a)if("number"!=typeof a.version||a.version===h.version)return[!1,a.state];else{if(h.migrate){let b=h.migrate(a.state,a.version);return b instanceof Promise?b.then(a=>[!0,a]):[!0,b]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(a=>{var b;if(f!==j)return;let[d,i]=a;if(c(g=h.merge(i,null!=(b=e())?b:p),!0),d)return n()}).then(()=>{f===j&&(null==o||o(g,void 0),g=e(),i=!0,l.forEach(a=>a(g)))}).catch(a=>{f===j&&(null==o||o(void 0,a))})};return f.persist={setOptions:a=>{h={...h,...a},a.storage&&(m=a.storage)},clearStorage:()=>{null==m||m.removeItem(h.name)},getOptions:()=>h,rehydrate:()=>q(),hasHydrated:()=>i,onHydrate:a=>(k.add(a),()=>{k.delete(a)}),onFinishHydration:a=>(l.add(a),()=>{l.delete(a)})},h.skipHydration||q(),g||p}},5439:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={getPreviouslyRevalidatedTags:function(){return w},getServerUtils:function(){return v},interpolateDynamicPath:function(){return t},normalizeCdnUrl:function(){return s},normalizeDynamicRouteParams:function(){return u}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(13973),g=c(41659),h=c(31797),i=c(71544),j=c(89964),k=c(77165),l=c(66796),m=c(47929),n=c(62018),o=c(23101),p=c(37525),q=c(95491);function r(a,b){for(let c in delete a.nextInternalLocale,a){let d=c!==m.NEXT_QUERY_PARAM_PREFIX&&c.startsWith(m.NEXT_QUERY_PARAM_PREFIX),e=c!==m.NEXT_INTERCEPTION_MARKER_PREFIX&&c.startsWith(m.NEXT_INTERCEPTION_MARKER_PREFIX);(d||e||b.includes(c))&&delete a[c]}}function s(a,b){let c=(0,p.parseReqUrl)(a.url);if(!c)return a.url;delete c.search,r(c.query,b),a.url=(0,q.formatUrl)(c)}function t(a,b,c){if(!c)return a;for(let d of Object.keys(c.groups)){let e,{optional:f,repeat:g}=c.groups[d],h=`[${g?"...":""}${d}]`;f&&(h=`[${h}]`);let i=b[d];((e=Array.isArray(i)?i.map(a=>a&&encodeURIComponent(a)).join("/"):i?encodeURIComponent(i):"")||f)&&(a=a.replaceAll(h,e))}return a}function u(a,b,c,d){let e={};for(let f of Object.keys(b.groups)){let g=a[f];"string"==typeof g?g=(0,l.normalizeRscURL)(g):Array.isArray(g)&&(g=g.map(l.normalizeRscURL));let h=c[f],i=b.groups[f].optional;if((Array.isArray(h)?h.some(a=>Array.isArray(g)?g.some(b=>b.includes(a)):null==g?void 0:g.includes(a)):null==g?void 0:g.includes(h))||void 0===g&&!(i&&d))return{params:{},hasValidParams:!1};i&&(!g||Array.isArray(g)&&1===g.length&&("index"===g[0]||g[0]===`[[...${f}]]`)||"index"===g||g===`[[...${f}]]`)&&(g=void 0,delete a[f]),g&&"string"==typeof g&&b.groups[f].repeat&&(g=g.split("/")),g&&(e[f]=g)}return{params:e,hasValidParams:!0}}function v({page:a,i18n:b,basePath:c,rewrites:d,pageIsDynamic:e,trailingSlash:l,caseSensitive:m}){let p,q,v;return e&&(p=(0,h.getNamedRouteRegex)(a,{prefixRouteKeys:!1}),v=(q=(0,i.getRouteMatcher)(p))(a)),{handleRewrites:function(h,i){let n=structuredClone(i),o={},p=n.pathname,r=d=>{let i=(0,g.getPathMatch)(d.source+(l?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!m});if(!n.pathname)return!1;let k=i(n.pathname);if((d.has||d.missing)&&k){let a=(0,j.matchHas)(h,n.query,d.has,d.missing);a?Object.assign(k,a):k=!1}if(k){let{parsedDestination:g,destQuery:h}=(0,j.prepareDestination)({appendParamsToQuery:!0,destination:d.destination,params:k,query:n.query});if(g.protocol)return!0;if(Object.assign(o,h,k),Object.assign(n.query,g.query),delete g.query,Object.assign(n,g),!(p=n.pathname))return!1;if(c&&(p=p.replace(RegExp(`^${c}`),"")||"/"),b){let a=(0,f.normalizeLocalePath)(p,b.locales);p=a.pathname,n.query.nextInternalLocale=a.detectedLocale||k.nextInternalLocale}if(p===a)return!0;if(e&&q){let a=q(p);if(a)return n.query={...n.query,...a},!0}}return!1};for(let a of d.beforeFiles||[])r(a);if(p!==a){let b,c=!1;for(let a of d.afterFiles||[])if(c=r(a))break;if(!c&&!((b=(0,k.removeTrailingSlash)(p||""))===(0,k.removeTrailingSlash)(a)||(null==q?void 0:q(b)))){for(let a of d.fallback||[])if(c=r(a))break}}return{rewriteParams:o,rewrittenParsedUrl:n}},defaultRouteRegex:p,dynamicRouteMatcher:q,defaultRouteMatches:v,normalizeQueryParams:function(a,b){for(let[c,d]of(delete a.nextInternalLocale,Object.entries(a))){let e=(0,n.normalizeNextQueryParam)(c);e&&(delete a[c],b.add(e),void 0!==d&&(a[e]=Array.isArray(d)?d.map(a=>(0,o.decodeQueryPathParameter)(a)):(0,o.decodeQueryPathParameter)(d)))}},getParamsFromRouteMatches:function(a){if(!p)return null;let{groups:b,routeKeys:c}=p,d=(0,i.getRouteMatcher)({re:{exec:a=>{let d=Object.fromEntries(new URLSearchParams(a));for(let[a,b]of Object.entries(d)){let c=(0,n.normalizeNextQueryParam)(a);c&&(d[c]=b,delete d[a])}let e={};for(let a of Object.keys(c)){let f=c[a];if(!f)continue;let g=b[f],h=d[a];if(!g.optional&&!h)return null;e[g.pos]=h}return e}},groups:b})(a);return d||null},normalizeDynamicRouteParams:(a,b)=>p&&v?u(a,p,v,b):{params:{},hasValidParams:!1},normalizeCdnUrl:(a,b)=>s(a,b),interpolateDynamicPath:(a,b)=>t(a,b,p),filterInternalQuery:(a,b)=>r(a,b)}}function w(a,b){return"string"==typeof a[m.NEXT_CACHE_REVALIDATED_TAGS_HEADER]&&a[m.NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER]===b?a[m.NEXT_CACHE_REVALIDATED_TAGS_HEADER].split(","):[]}},9787:(a,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var c={assign:function(){return h},searchParamsToUrlQuery:function(){return e},urlQueryToSearchParams:function(){return g}};for(var d in c)Object.defineProperty(b,d,{enumerable:!0,get:c[d]});function e(a){let b={};for(let[c,d]of a.entries()){let a=b[c];void 0===a?b[c]=d:Array.isArray(a)?a.push(d):b[c]=[a,d]}return b}function f(a){return"string"==typeof a?a:("number"!=typeof a||isNaN(a))&&"boolean"!=typeof a?"":String(a)}function g(a){let b=new URLSearchParams;for(let[c,d]of Object.entries(a))if(Array.isArray(d))for(let a of d)b.append(c,f(a));else b.set(c,f(d));return b}function h(a,...b){for(let c of b){for(let b of c.keys())a.delete(b);for(let[b,d]of c.entries())a.append(b,d)}return a}},10684:(a,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var c={PARAM_SEPARATOR:function(){return e},hasAdjacentParameterIssues:function(){return f},normalizeAdjacentParameters:function(){return g},normalizeTokensForRegexp:function(){return h},stripNormalizedSeparators:function(){return i},stripParameterSeparators:function(){return j}};for(var d in c)Object.defineProperty(b,d,{enumerable:!0,get:c[d]});let e="_NEXTSEP_";function f(a){return"string"==typeof a&&!!(/\/\(\.{1,3}\):[^/\s]+/.test(a)||/:[a-zA-Z_][a-zA-Z0-9_]*:[a-zA-Z_][a-zA-Z0-9_]*/.test(a))}function g(a){let b=a;return(b=b.replace(/(\([^)]*\)):([^/\s]+)/g,`$1${e}:$2`)).replace(/:([^:/\s)]+)(?=:)/g,`:$1${e}`)}function h(a){return a.map(a=>"object"==typeof a&&null!==a&&"modifier"in a&&("*"===a.modifier||"+"===a.modifier)&&"prefix"in a&&"suffix"in a&&""===a.prefix&&""===a.suffix?{...a,prefix:"/"}:a)}function i(a){return a.replace(RegExp(`\\)${e}`,"g"),")")}function j(a){let b={};for(let[c,d]of Object.entries(a))"string"==typeof d?b[c]=d.replace(RegExp(`^${e}`),""):Array.isArray(d)?b[c]=d.map(a=>"string"==typeof a?a.replace(RegExp(`^${e}`),""):a):b[c]=d;return b}},19099:(a,b,c)=>{"use strict";var d=c(54839);c.o(d,"useParams")&&c.d(b,{useParams:function(){return d.useParams}}),c.o(d,"usePathname")&&c.d(b,{usePathname:function(){return d.usePathname}}),c.o(d,"useRouter")&&c.d(b,{useRouter:function(){return d.useRouter}}),c.o(d,"useSearchParams")&&c.d(b,{useSearchParams:function(){return d.useSearchParams}})},23101:(a,b)=>{"use strict";function c(a){try{return decodeURIComponent(a)}catch{return a}}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"decodeQueryPathParameter",{enumerable:!0,get:function(){return c}})},23315:(a,b)=>{"use strict";function c(a){return a.replace(/\\/g,"/")}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"normalizePathSep",{enumerable:!0,get:function(){return c}})},27196:a=>{(()=>{"use strict";"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab=__dirname+"/");var b={};(()=>{function a(a,b){void 0===b&&(b={});for(var c=function(a){for(var b=[],c=0;c<a.length;){var d=a[c];if("*"===d||"+"===d||"?"===d){b.push({type:"MODIFIER",index:c,value:a[c++]});continue}if("\\"===d){b.push({type:"ESCAPED_CHAR",index:c++,value:a[c++]});continue}if("{"===d){b.push({type:"OPEN",index:c,value:a[c++]});continue}if("}"===d){b.push({type:"CLOSE",index:c,value:a[c++]});continue}if(":"===d){for(var e="",f=c+1;f<a.length;){var g=a.charCodeAt(f);if(g>=48&&g<=57||g>=65&&g<=90||g>=97&&g<=122||95===g){e+=a[f++];continue}break}if(!e)throw TypeError("Missing parameter name at ".concat(c));b.push({type:"NAME",index:c,value:e}),c=f;continue}if("("===d){var h=1,i="",f=c+1;if("?"===a[f])throw TypeError('Pattern cannot start with "?" at '.concat(f));for(;f<a.length;){if("\\"===a[f]){i+=a[f++]+a[f++];continue}if(")"===a[f]){if(0==--h){f++;break}}else if("("===a[f]&&(h++,"?"!==a[f+1]))throw TypeError("Capturing groups are not allowed at ".concat(f));i+=a[f++]}if(h)throw TypeError("Unbalanced pattern at ".concat(c));if(!i)throw TypeError("Missing pattern at ".concat(c));b.push({type:"PATTERN",index:c,value:i}),c=f;continue}b.push({type:"CHAR",index:c,value:a[c++]})}return b.push({type:"END",index:c,value:""}),b}(a),d=b.prefixes,f=void 0===d?"./":d,g=b.delimiter,h=void 0===g?"/#?":g,i=[],j=0,k=0,l="",m=function(a){if(k<c.length&&c[k].type===a)return c[k++].value},n=function(a){var b=m(a);if(void 0!==b)return b;var d=c[k],e=d.type,f=d.index;throw TypeError("Unexpected ".concat(e," at ").concat(f,", expected ").concat(a))},o=function(){for(var a,b="";a=m("CHAR")||m("ESCAPED_CHAR");)b+=a;return b},p=function(a){for(var b=0;b<h.length;b++){var c=h[b];if(a.indexOf(c)>-1)return!0}return!1},q=function(a){var b=i[i.length-1],c=a||(b&&"string"==typeof b?b:"");if(b&&!c)throw TypeError('Must have text between two parameters, missing text after "'.concat(b.name,'"'));return!c||p(c)?"[^".concat(e(h),"]+?"):"(?:(?!".concat(e(c),")[^").concat(e(h),"])+?")};k<c.length;){var r=m("CHAR"),s=m("NAME"),t=m("PATTERN");if(s||t){var u=r||"";-1===f.indexOf(u)&&(l+=u,u=""),l&&(i.push(l),l=""),i.push({name:s||j++,prefix:u,suffix:"",pattern:t||q(u),modifier:m("MODIFIER")||""});continue}var v=r||m("ESCAPED_CHAR");if(v){l+=v;continue}if(l&&(i.push(l),l=""),m("OPEN")){var u=o(),w=m("NAME")||"",x=m("PATTERN")||"",y=o();n("CLOSE"),i.push({name:w||(x?j++:""),pattern:w&&!x?q(u):x,prefix:u,suffix:y,modifier:m("MODIFIER")||""});continue}n("END")}return i}function c(a,b){void 0===b&&(b={});var c=f(b),d=b.encode,e=void 0===d?function(a){return a}:d,g=b.validate,h=void 0===g||g,i=a.map(function(a){if("object"==typeof a)return new RegExp("^(?:".concat(a.pattern,")$"),c)});return function(b){for(var c="",d=0;d<a.length;d++){var f=a[d];if("string"==typeof f){c+=f;continue}var g=b?b[f.name]:void 0,j="?"===f.modifier||"*"===f.modifier,k="*"===f.modifier||"+"===f.modifier;if(Array.isArray(g)){if(!k)throw TypeError('Expected "'.concat(f.name,'" to not repeat, but got an array'));if(0===g.length){if(j)continue;throw TypeError('Expected "'.concat(f.name,'" to not be empty'))}for(var l=0;l<g.length;l++){var m=e(g[l],f);if(h&&!i[d].test(m))throw TypeError('Expected all "'.concat(f.name,'" to match "').concat(f.pattern,'", but got "').concat(m,'"'));c+=f.prefix+m+f.suffix}continue}if("string"==typeof g||"number"==typeof g){var m=e(String(g),f);if(h&&!i[d].test(m))throw TypeError('Expected "'.concat(f.name,'" to match "').concat(f.pattern,'", but got "').concat(m,'"'));c+=f.prefix+m+f.suffix;continue}if(!j){var n=k?"an array":"a string";throw TypeError('Expected "'.concat(f.name,'" to be ').concat(n))}}return c}}function d(a,b,c){void 0===c&&(c={});var d=c.decode,e=void 0===d?function(a){return a}:d;return function(c){var d=a.exec(c);if(!d)return!1;for(var f=d[0],g=d.index,h=Object.create(null),i=1;i<d.length;i++)!function(a){if(void 0!==d[a]){var c=b[a-1];"*"===c.modifier||"+"===c.modifier?h[c.name]=d[a].split(c.prefix+c.suffix).map(function(a){return e(a,c)}):h[c.name]=e(d[a],c)}}(i);return{path:f,index:g,params:h}}}function e(a){return a.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function f(a){return a&&a.sensitive?"":"i"}function g(a,b,c){void 0===c&&(c={});for(var d=c.strict,g=void 0!==d&&d,h=c.start,i=c.end,j=c.encode,k=void 0===j?function(a){return a}:j,l=c.delimiter,m=c.endsWith,n="[".concat(e(void 0===m?"":m),"]|$"),o="[".concat(e(void 0===l?"/#?":l),"]"),p=void 0===h||h?"^":"",q=0;q<a.length;q++){var r=a[q];if("string"==typeof r)p+=e(k(r));else{var s=e(k(r.prefix)),t=e(k(r.suffix));if(r.pattern)if(b&&b.push(r),s||t)if("+"===r.modifier||"*"===r.modifier){var u="*"===r.modifier?"?":"";p+="(?:".concat(s,"((?:").concat(r.pattern,")(?:").concat(t).concat(s,"(?:").concat(r.pattern,"))*)").concat(t,")").concat(u)}else p+="(?:".concat(s,"(").concat(r.pattern,")").concat(t,")").concat(r.modifier);else{if("+"===r.modifier||"*"===r.modifier)throw TypeError('Can not repeat "'.concat(r.name,'" without a prefix and suffix'));p+="(".concat(r.pattern,")").concat(r.modifier)}else p+="(?:".concat(s).concat(t,")").concat(r.modifier)}}if(void 0===i||i)g||(p+="".concat(o,"?")),p+=c.endsWith?"(?=".concat(n,")"):"$";else{var v=a[a.length-1],w="string"==typeof v?o.indexOf(v[v.length-1])>-1:void 0===v;g||(p+="(?:".concat(o,"(?=").concat(n,"))?")),w||(p+="(?=".concat(o,"|").concat(n,")"))}return new RegExp(p,f(c))}function h(b,c,d){if(b instanceof RegExp){var e;if(!c)return b;for(var i=/\((?:\?<(.*?)>)?(?!\?)/g,j=0,k=i.exec(b.source);k;)c.push({name:k[1]||j++,prefix:"",suffix:"",modifier:"",pattern:""}),k=i.exec(b.source);return b}return Array.isArray(b)?(e=b.map(function(a){return h(a,c,d).source}),new RegExp("(?:".concat(e.join("|"),")"),f(d))):g(a(b,d),c,d)}Object.defineProperty(b,"__esModule",{value:!0}),b.pathToRegexp=b.tokensToRegexp=b.regexpToFunction=b.match=b.tokensToFunction=b.compile=b.parse=void 0,b.parse=a,b.compile=function(b,d){return c(a(b,d),d)},b.tokensToFunction=c,b.match=function(a,b){var c=[];return d(h(a,c,b),c,b)},b.regexpToFunction=d,b.tokensToRegexp=g,b.pathToRegexp=h})(),a.exports=b})()},31383:(a,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"escapeStringRegexp",{enumerable:!0,get:function(){return e}});let c=/[|\\{}()[\]^$+*?.-]/,d=/[|\\{}()[\]^$+*?.-]/g;function e(a){return c.test(a)?a.replace(d,"\\$&"):a}},31417:(a,b,c)=>{"use strict";c.d(b,{v:()=>g});var d=c(67484);let e=a=>{let b,c=new Set,d=(a,d)=>{let e="function"==typeof a?a(b):a;if(!Object.is(e,b)){let a=b;b=(null!=d?d:"object"!=typeof e||null===e)?e:Object.assign({},b,e),c.forEach(c=>c(b,a))}},e=()=>b,f={setState:d,getState:e,getInitialState:()=>g,subscribe:a=>(c.add(a),()=>c.delete(a))},g=b=a(d,e,f);return f},f=a=>{let b=a?e(a):e,c=a=>(function(a,b=a=>a){let c=d.useSyncExternalStore(a.subscribe,d.useCallback(()=>b(a.getState()),[a,b]),d.useCallback(()=>b(a.getInitialState()),[a,b]));return d.useDebugValue(c),c})(b,a);return Object.assign(c,b),c},g=a=>a?f(a):f},31797:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={getNamedMiddlewareRegex:function(){return p},getNamedRouteRegex:function(){return o},getRouteRegex:function(){return l}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(47929),g=c(32107),h=c(31383),i=c(77165),j=c(93646);function k(a,b,c){let d={},e=1,f=[];for(let k of(0,i.removeTrailingSlash)(a).slice(1).split("/")){let a=g.INTERCEPTION_ROUTE_MARKERS.find(a=>k.startsWith(a)),i=k.match(j.PARAMETER_PATTERN);if(a&&i&&i[2]){let{key:b,optional:c,repeat:g}=(0,j.parseMatchedParameter)(i[2]);d[b]={pos:e++,repeat:g,optional:c},f.push(`/${(0,h.escapeStringRegexp)(a)}([^/]+?)`)}else if(i&&i[2]){let{key:a,repeat:b,optional:g}=(0,j.parseMatchedParameter)(i[2]);d[a]={pos:e++,repeat:b,optional:g},c&&i[1]&&f.push(`/${(0,h.escapeStringRegexp)(i[1])}`);let k=b?g?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)";c&&i[1]&&(k=k.substring(1)),f.push(k)}else f.push(`/${(0,h.escapeStringRegexp)(k)}`);b&&i&&i[3]&&f.push((0,h.escapeStringRegexp)(i[3]))}return{parameterizedRoute:f.join(""),groups:d}}function l(a,{includeSuffix:b=!1,includePrefix:c=!1,excludeOptionalTrailingSlash:d=!1}={}){let{parameterizedRoute:e,groups:f}=k(a,b,c),g=e;return d||(g+="(?:/)?"),{re:RegExp(`^${g}$`),groups:f}}function m({interceptionMarker:a,getSafeRouteKey:b,segment:c,routeKeys:d,keyPrefix:e,backreferenceDuplicateKeys:f}){let g,{key:i,optional:k,repeat:l}=(0,j.parseMatchedParameter)(c),m=i.replace(/\W/g,"");e&&(m=`${e}${m}`);let n=!1;(0===m.length||m.length>30)&&(n=!0),isNaN(parseInt(m.slice(0,1)))||(n=!0),n&&(m=b());let o=m in d;e?d[m]=`${e}${i}`:d[m]=i;let p=a?(0,h.escapeStringRegexp)(a):"";return g=o&&f?`\\k<${m}>`:l?`(?<${m}>.+?)`:`(?<${m}>[^/]+?)`,{key:i,pattern:k?`(?:/${p}${g})?`:`/${p}${g}`,cleanedKey:m,optional:k,repeat:l}}function n(a,b,c,d,e,k={names:{},intercepted:{}}){let l,o=(l=0,()=>{let a="",b=++l;for(;b>0;)a+=String.fromCharCode(97+(b-1)%26),b=Math.floor((b-1)/26);return a}),p={},q=[],r=[];for(let l of(k=structuredClone(k),(0,i.removeTrailingSlash)(a).slice(1).split("/"))){let a,i=g.INTERCEPTION_ROUTE_MARKERS.some(a=>l.startsWith(a)),n=l.match(j.PARAMETER_PATTERN),s=i?n?.[1]:void 0;if(s&&n?.[2]?(a=b?f.NEXT_INTERCEPTION_MARKER_PREFIX:void 0,k.intercepted[n[2]]=s):a=n?.[2]&&k.intercepted[n[2]]?b?f.NEXT_INTERCEPTION_MARKER_PREFIX:void 0:b?f.NEXT_QUERY_PARAM_PREFIX:void 0,s&&n&&n[2]){let{key:b,pattern:c,cleanedKey:d,repeat:f,optional:g}=m({getSafeRouteKey:o,interceptionMarker:s,segment:n[2],routeKeys:p,keyPrefix:a,backreferenceDuplicateKeys:e});q.push(c),r.push(`/${n[1]}:${k.names[b]??d}${f?g?"*":"+":""}`),k.names[b]??=d}else if(n&&n[2]){d&&n[1]&&(q.push(`/${(0,h.escapeStringRegexp)(n[1])}`),r.push(`/${n[1]}`));let{key:b,pattern:c,cleanedKey:f,repeat:g,optional:i}=m({getSafeRouteKey:o,segment:n[2],routeKeys:p,keyPrefix:a,backreferenceDuplicateKeys:e}),j=c;d&&n[1]&&(j=j.substring(1)),q.push(j),r.push(`/:${k.names[b]??f}${g?i?"*":"+":""}`),k.names[b]??=f}else q.push(`/${(0,h.escapeStringRegexp)(l)}`),r.push(`/${l}`);c&&n&&n[3]&&(q.push((0,h.escapeStringRegexp)(n[3])),r.push(n[3]))}return{namedParameterizedRoute:q.join(""),routeKeys:p,pathToRegexpPattern:r.join(""),reference:k}}function o(a,b){let c=n(a,b.prefixRouteKeys,b.includeSuffix??!1,b.includePrefix??!1,b.backreferenceDuplicateKeys??!1,b.reference),d=c.namedParameterizedRoute;return b.excludeOptionalTrailingSlash||(d+="(?:/)?"),{...l(a,b),namedRegex:`^${d}$`,routeKeys:c.routeKeys,pathToRegexpPattern:c.pathToRegexpPattern,reference:c.reference}}function p(a,b){let{parameterizedRoute:c}=k(a,!1,!1),{catchAll:d=!0}=b;if("/"===c)return{namedRegex:`^/${d?".*":""}$`};let{namedParameterizedRoute:e}=n(a,!1,!1,!1,!1,void 0);return{namedRegex:`^${e}${d?"(?:(/.*)?)":""}$`}}},41659:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"getPathMatch",{enumerable:!0,get:function(){return e}});let d=c(27196);function e(a,b){let c=[],e=(0,d.pathToRegexp)(a,c,{delimiter:"/",sensitive:"boolean"==typeof b?.sensitive&&b.sensitive,strict:b?.strict}),f=(0,d.regexpToFunction)(b?.regexModifier?new RegExp(b.regexModifier(e.source),e.flags):e,c);return(a,d)=>{if("string"!=typeof a)return!1;let e=f(a);if(!e)return!1;if(b?.removeUnnamedParams)for(let a of c)"number"==typeof a.name&&delete e.params[a.name];return{...d,...e.params}}}},49286:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"parseRelativeUrl",{enumerable:!0,get:function(){return e}}),c(16433);let d=c(9787);function e(a,b,c=!0){let f=new URL("http://n"),g=b?new URL(b,f):a.startsWith(".")?new URL("http://n"):f,{pathname:h,searchParams:i,search:j,hash:k,href:l,origin:m}=new URL(a,g);if(m!==f.origin)throw Object.defineProperty(Error(`invariant: invalid relative URL, router received ${a}`),"__NEXT_ERROR_CODE",{value:"E159",enumerable:!1,configurable:!0});return{pathname:h,query:c?(0,d.searchParamsToUrlQuery)(i):void 0,search:j,hash:k,href:l.slice(m.length),slashes:void 0}}},55091:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"default",{enumerable:!0,get:function(){return f}});let d=c(5735),e=c(22675);function f(){return(0,d.jsx)(e.HTTPAccessErrorFallback,{status:404,message:"This page could not be found."})}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},68097:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"parseUrl",{enumerable:!0,get:function(){return f}});let d=c(9787),e=c(49286);function f(a){if(a.startsWith("/"))return(0,e.parseRelativeUrl)(a);let b=new URL(a);return{hash:b.hash,hostname:b.hostname,href:b.href,pathname:b.pathname,port:b.port,protocol:b.protocol,query:(0,d.searchParamsToUrlQuery)(b.searchParams),search:b.search,origin:b.origin,slashes:"//"===b.href.slice(b.protocol.length,b.protocol.length+2)}}},71544:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"getRouteMatcher",{enumerable:!0,get:function(){return f}});let d=c(16433),e=c(89151);function f({re:a,groups:b}){return(0,e.safeRouteMatcher)(c=>{let e=a.exec(c);if(!e)return!1;let f=a=>{try{return decodeURIComponent(a)}catch{throw Object.defineProperty(new d.DecodeError("failed to decode param"),"__NEXT_ERROR_CODE",{value:"E528",enumerable:!1,configurable:!0})}},g={};for(let[a,c]of Object.entries(b)){let b=e[c.pos];void 0!==b&&(c.repeat?g[a]=b.split("/").map(a=>f(a)):g[a]=f(b))}return g})}},75329:a=>{a.exports={style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"},className:"__className_f367f3",variable:"__variable_f367f3"}},85420:(a,b)=>{"use strict";function c(a){return a.endsWith("/route")}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"isAppRouteRoute",{enumerable:!0,get:function(){return c}})},86318:(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}function e(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}c.r(b),c.d(b,{_:()=>e})},88868:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d,e={fillMetadataSegment:function(){return p},normalizeMetadataPageToRoute:function(){return r},normalizeMetadataRoute:function(){return q}};for(var f in e)Object.defineProperty(b,f,{enumerable:!0,get:e[f]});let g=c(93302),h=(d=c(16225))&&d.__esModule?d:{default:d},i=c(5439),j=c(31797),k=c(38462),l=c(66796),m=c(23315),n=c(64929);function o(a){let b=h.default.dirname(a);if(a.endsWith("/sitemap")||a.endsWith("/sitemap.xml"))return"";let c="";return b.split("/").some(a=>(0,n.isGroupSegment)(a)||(0,n.isParallelRouteSegment)(a))&&(c=(0,k.djb2Hash)(b).toString(36).slice(0,6)),c}function p(a,b,c){let d=(0,l.normalizeAppPath)(a),e=(0,j.getNamedRouteRegex)(d,{prefixRouteKeys:!1}),f=(0,i.interpolateDynamicPath)(d,b,e),{name:g,ext:k}=h.default.parse(c),n=o(h.default.posix.join(a,g)),p=n?`-${n}`:"";return(0,m.normalizePathSep)(h.default.join(f,`${g}${p}${k}`))}function q(a){if(!(0,g.isMetadataPage)(a))return a;let b=a,c="";if("/robots"===a?b+=".txt":"/manifest"===a?b+=".webmanifest":c=o(a),!b.endsWith("/route")){let{dir:a,name:d,ext:e}=h.default.parse(b);b=h.default.posix.join(a,`${d}${c?`-${c}`:""}${e}`,"route")}return b}function r(a,b){let c=a.endsWith("/route"),d=c?a.slice(0,-6):a,e=d.endsWith("/sitemap")?".xml":"";return(b?`${d}/[__metadata_id__]`:`${d}${e}`)+(c?"/route":"")}},89151:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={safeCompile:function(){return i},safePathToRegexp:function(){return h},safeRegexpToFunction:function(){return j},safeRouteMatcher:function(){return k}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(27196),g=c(10684);function h(a,b,c){if("string"!=typeof a)return(0,f.pathToRegexp)(a,b,c);let d=(0,g.hasAdjacentParameterIssues)(a),e=d?(0,g.normalizeAdjacentParameters)(a):a;try{return(0,f.pathToRegexp)(e,b,c)}catch(e){if(!d)try{let d=(0,g.normalizeAdjacentParameters)(a);return(0,f.pathToRegexp)(d,b,c)}catch(a){}throw e}}function i(a,b){let c=(0,g.hasAdjacentParameterIssues)(a),d=c?(0,g.normalizeAdjacentParameters)(a):a;try{let a=(0,f.compile)(d,b);if(c)return b=>(0,g.stripNormalizedSeparators)(a(b));return a}catch(d){if(!c)try{let c=(0,g.normalizeAdjacentParameters)(a),d=(0,f.compile)(c,b);return a=>(0,g.stripNormalizedSeparators)(d(a))}catch(a){}throw d}}function j(a,b){let c=(0,f.regexpToFunction)(a,b||[]);return a=>{let b=c(a);return!!b&&{...b,params:(0,g.stripParameterSeparators)(b.params)}}}function k(a){return b=>{let c=a(b);return!!c&&(0,g.stripParameterSeparators)(c)}}},89964:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={compileNonPath:function(){return m},matchHas:function(){return l},parseDestination:function(){return n},prepareDestination:function(){return o}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(31383),g=c(68097),h=c(32107),i=c(85782),j=c(89151);function k(a){return a.replace(/__ESC_COLON_/gi,":")}function l(a,b,c=[],d=[]){let e={},f=c=>{let d,f=c.key;switch(c.type){case"header":f=f.toLowerCase(),d=a.headers[f];break;case"cookie":d="cookies"in a?a.cookies[c.key]:(0,i.getCookieParser)(a.headers)()[c.key];break;case"query":d=b[f];break;case"host":{let{host:b}=a?.headers||{};d=b?.split(":",1)[0].toLowerCase()}}if(!c.value&&d)return e[function(a){let b="";for(let c=0;c<a.length;c++){let d=a.charCodeAt(c);(d>64&&d<91||d>96&&d<123)&&(b+=a[c])}return b}(f)]=d,!0;if(d){let a=RegExp(`^${c.value}$`),b=Array.isArray(d)?d.slice(-1)[0].match(a):d.match(a);if(b)return Array.isArray(b)&&(b.groups?Object.keys(b.groups).forEach(a=>{e[a]=b.groups[a]}):"host"===c.type&&b[0]&&(e.host=b[0])),!0}return!1};return!(!c.every(a=>f(a))||d.some(a=>f(a)))&&e}function m(a,b){if(!a.includes(":"))return a;for(let c of Object.keys(b))a.includes(`:${c}`)&&(a=a.replace(RegExp(`:${c}\\*`,"g"),`:${c}--ESCAPED_PARAM_ASTERISKS`).replace(RegExp(`:${c}\\?`,"g"),`:${c}--ESCAPED_PARAM_QUESTION`).replace(RegExp(`:${c}\\+`,"g"),`:${c}--ESCAPED_PARAM_PLUS`).replace(RegExp(`:${c}(?!\\w)`,"g"),`--ESCAPED_PARAM_COLON${c}`));return a=a.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),(0,j.safeCompile)(`/${a}`,{validate:!1})(b).slice(1)}function n(a){let b=a.destination;for(let c of Object.keys({...a.params,...a.query}))c&&(b=b.replace(RegExp(`:${(0,f.escapeStringRegexp)(c)}`,"g"),`__ESC_COLON_${c}`));let c=(0,g.parseUrl)(b),d=c.pathname;d&&(d=k(d));let e=c.href;e&&(e=k(e));let h=c.hostname;h&&(h=k(h));let i=c.hash;i&&(i=k(i));let j=c.search;j&&(j=k(j));let l=c.origin;return l&&(l=k(l)),{...c,pathname:d,hostname:h,href:e,hash:i,search:j,origin:l}}function o(a){let b,c,d=n(a),{hostname:e,query:f,search:g}=d,i=d.pathname;d.hash&&(i=`${i}${d.hash}`);let l=[],o=[];for(let a of((0,j.safePathToRegexp)(i,o),o))l.push(a.name);if(e){let a=[];for(let b of((0,j.safePathToRegexp)(e,a),a))l.push(b.name)}let p=(0,j.safeCompile)(i,{validate:!1});for(let[c,d]of(e&&(b=(0,j.safeCompile)(e,{validate:!1})),Object.entries(f)))Array.isArray(d)?f[c]=d.map(b=>m(k(b),a.params)):"string"==typeof d&&(f[c]=m(k(d),a.params));let q=Object.keys(a.params).filter(a=>"nextInternalLocale"!==a);if(a.appendParamsToQuery&&!q.some(a=>l.includes(a)))for(let b of q)b in f||(f[b]=a.params[b]);if((0,h.isInterceptionRouteAppPath)(i))for(let b of i.split("/")){let c=h.INTERCEPTION_ROUTE_MARKERS.find(a=>b.startsWith(a));if(c){"(..)(..)"===c?(a.params["0"]="(..)",a.params["1"]="(..)"):a.params["0"]=c;break}}try{let[e,f]=(c=p(a.params)).split("#",2);b&&(d.hostname=b(a.params)),d.pathname=e,d.hash=`${f?"#":""}${f||""}`,d.search=g?m(g,a.params):""}catch(a){if(a.message.match(/Expected .*? to not repeat, but got an array/))throw Object.defineProperty(Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match"),"__NEXT_ERROR_CODE",{value:"E329",enumerable:!1,configurable:!0});throw a}return d.query={...a.query,...d.query},{newUrl:c,destQuery:f,parsedDestination:d}}},93302:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={DEFAULT_METADATA_ROUTE_EXTENSIONS:function(){return j},STATIC_METADATA_IMAGES:function(){return i},getExtensionRegexString:function(){return k},isMetadataPage:function(){return u},isMetadataRoute:function(){return v},isMetadataRouteFile:function(){return s},isStaticMetadataFile:function(){return l},isStaticMetadataRoute:function(){return t}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(23315),g=c(66796),h=c(85420),i={icon:{filename:"icon",extensions:["ico","jpg","jpeg","png","svg"]},apple:{filename:"apple-icon",extensions:["jpg","jpeg","png"]},favicon:{filename:"favicon",extensions:["ico"]},openGraph:{filename:"opengraph-image",extensions:["jpg","jpeg","png","gif"]},twitter:{filename:"twitter-image",extensions:["jpg","jpeg","png","gif"]}},j=["js","jsx","ts","tsx"],k=(a,b)=>b&&0!==b.length?`(?:\\.(${a.join("|")})|(\\.(${b.join("|")})))`:`(\\.(?:${a.join("|")}))`;function l(a){return s(a,[],!0)}let m=/^[\\/]favicon\.ico$/,n=/^[\\/]robots\.txt$/,o=/^[\\/]manifest\.json$/,p=/^[\\/]manifest\.webmanifest$/,q=/[\\/]sitemap\.xml$/,r=new Map;function s(a,b,c){if(!a||a.length<2)return!1;let d=(0,f.normalizePathSep)(a),e=!!(m.test(d)||n.test(d)||o.test(d)||p.test(d)||q.test(d))||(!!d.includes("robots")||!!d.includes("manifest")||!!d.includes("sitemap")||!!d.includes("icon")||!!d.includes("apple-icon")||!!d.includes("opengraph-image")||!!d.includes("twitter-image")||!!d.includes("favicon"))&&null;if(null!==e)return e;let g=function(a,b){let c=`${a.join(",")}|${b}`,d=r.get(c);if(d)return d;let e=b?"$":"?$",f="\\d?"+(b?"":"(-\\w{6})?"),g=a.length>0?[...a,"txt"]:["txt"],h=a.length>0?[...a,"webmanifest","json"]:["webmanifest","json"],j=[RegExp(`^[\\\\/]robots${k(g,null)}${e}`),RegExp(`^[\\\\/]manifest${k(h,null)}${e}`),RegExp(`[\\\\/]sitemap${k(["xml"],a)}${e}`),RegExp(`[\\\\/]icon${f}${k(i.icon.extensions,a)}${e}`),RegExp(`[\\\\/]apple-icon${f}${k(i.apple.extensions,a)}${e}`),RegExp(`[\\\\/]opengraph-image${f}${k(i.openGraph.extensions,a)}${e}`),RegExp(`[\\\\/]twitter-image${f}${k(i.twitter.extensions,a)}${e}`)];return r.set(c,j),j}(b,c);for(let a=0;a<g.length;a++)if(g[a].test(d))return!0;return!1}function t(a){let b=a.replace(/\/route$/,"");return(0,h.isAppRouteRoute)(a)&&s(b,[],!0)&&"/robots.txt"!==b&&"/manifest.webmanifest"!==b&&!b.endsWith("/sitemap.xml")}function u(a){return!(0,h.isAppRouteRoute)(a)&&s(a,[],!1)}function v(a){let b=(0,g.normalizeAppPath)(a).replace(/^\/?app\//,"").replace("/[__metadata_id__]","").replace(/\/route$/,"");return"/"!==b[0]&&(b="/"+b),(0,h.isAppRouteRoute)(a)&&s(b,[],!1)}},93646:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={PARAMETER_PATTERN:function(){return l},getDynamicParam:function(){return k},interpolateParallelRouteParams:function(){return j},parseMatchedParameter:function(){return n},parseParameter:function(){return m}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(72339),g=c(92122),h=c(4772),i=c(86070);function j(a,b,c,d){let e=structuredClone(b),j=[{tree:a,depth:0}],k=(0,h.parseAppRoute)(c,!0);for(;j.length>0;){let{tree:a,depth:b}=j.pop(),{segment:c,parallelRoutes:l}=(0,g.parseLoaderTree)(a),m=(0,h.parseAppRouteSegment)(c);if(m?.type==="dynamic"&&!e.hasOwnProperty(m.param.paramName)&&!d?.has(m.param.paramName)){let{paramName:a,paramType:c}=m.param,d=(0,i.resolveParamValue)(a,c,b,k,e);if(void 0!==d)e[a]=d;else if("optional-catchall"!==c)throw Object.defineProperty(new f.InvariantError(`Could not resolve param value for segment: ${a}`),"__NEXT_ERROR_CODE",{value:"E932",enumerable:!1,configurable:!0})}let n=b;for(let a of(m&&"route-group"!==m.type&&"parallel-route"!==m.type&&n++,Object.values(l)))j.push({tree:a,depth:n})}return e}function k(a,b,c,d){let e=function(a,b,c){let d=a[b];if(c?.has(b)){let[a]=c.get(b);d=a}else Array.isArray(d)?d=d.map(a=>encodeURIComponent(a)):"string"==typeof d&&(d=encodeURIComponent(d));return d}(a,b,d);if(!e||0===e.length){if("oc"===c)return{param:b,value:null,type:c,treeSegment:[b,"",c]};throw Object.defineProperty(new f.InvariantError(`Missing value for segment key: "${b}" with dynamic param type: ${c}`),"__NEXT_ERROR_CODE",{value:"E864",enumerable:!1,configurable:!0})}return{param:b,value:e,treeSegment:[b,Array.isArray(e)?e.join("/"):e,c],type:c}}let l=/^([^[]*)\[((?:\[[^\]]*\])|[^\]]+)\](.*)$/;function m(a){let b=a.match(l);return b?n(b[2]):n(a)}function n(a){let b=a.startsWith("[")&&a.endsWith("]");b&&(a=a.slice(1,-1));let c=a.startsWith("...");return c&&(a=a.slice(3)),{key:a,repeat:c,optional:b}}},95491:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={formatUrl:function(){return h},formatWithValidation:function(){return j},urlObjectKeys:function(){return i}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(86318)._(c(9787)),g=/https?|ftp|gopher|file/;function h(a){let{auth:b,hostname:c}=a,d=a.protocol||"",e=a.pathname||"",h=a.hash||"",i=a.query||"",j=!1;b=b?encodeURIComponent(b).replace(/%3A/i,":")+"@":"",a.host?j=b+a.host:c&&(j=b+(~c.indexOf(":")?`[${c}]`:c),a.port&&(j+=":"+a.port)),i&&"object"==typeof i&&(i=String(f.urlQueryToSearchParams(i)));let k=a.search||i&&`?${i}`||"";return d&&!d.endsWith(":")&&(d+=":"),a.slashes||(!d||g.test(d))&&!1!==j?(j="//"+(j||""),e&&"/"!==e[0]&&(e="/"+e)):j||(j=""),h&&"#"!==h[0]&&(h="#"+h),k&&"?"!==k[0]&&(k="?"+k),e=e.replace(/[?#]/g,encodeURIComponent),k=k.replace("#","%23"),`${d}${j}${e}${k}${h}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function j(a){return h(a)}}};
@@ -1 +1 @@
1
- "use strict";exports.id=8590,exports.ids=[8590],exports.modules={8590:(a,b,c)=>{c.d(b,{I9:()=>g,Ql:()=>j,iD:()=>n,jR:()=>m,oD:()=>e,qZ:()=>o});var d=c(2255);let e=3e5;async function f(a,b){let c=await fetch(d.NA.anthropic.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.claude.clientId})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Claude OAuth token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Claude OAuth token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function g(a,b,c,e){let f=await fetch(d.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:b,client_secret:c})});if(!f.ok){let a=await f.text();return e?.error?.("TOKEN_REFRESH","Failed to refresh Google token",{status:f.status,error:a}),null}let g=await f.json();return e?.info?.("TOKEN_REFRESH","Successfully refreshed Google token",{hasNewAccessToken:!!g.access_token,hasNewRefreshToken:!!g.refresh_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}async function h(a,b){let c=d.NA.qwen.token;try{let e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.qwen.clientId})});if(200===e.status){let c=await e.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Qwen token",{hasNewAccessToken:!!c.access_token,hasNewRefreshToken:!!c.refresh_token,expiresIn:c.expires_in}),{accessToken:c.access_token,refreshToken:c.refresh_token||a,expiresIn:c.expires_in,providerSpecificData:c.resource_url?{resourceUrl:c.resource_url}:void 0}}{let a=await e.text().catch(()=>"");b?.warn?.("TOKEN_REFRESH","Error with Qwen endpoint",{status:e.status,error:a})}}catch(a){b?.warn?.("TOKEN_REFRESH","Network error trying Qwen endpoint",{error:a.message})}return b?.error?.("TOKEN_REFRESH","Failed to refresh Qwen token"),null}async function i(a,b){let c=await fetch(d.NA.openai.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.codex.clientId,scope:"openid profile email offline_access"})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Codex token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Codex token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function j(a,b,c){let e=b?.authMethod,f=b?.clientId,g=b?.clientSecret,h=b?.region;if(f&&g){let b="idc"===e&&h?`https://oidc.${h}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",d=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:f,clientSecret:g,refreshToken:a,grantType:"refresh_token"})});if(!d.ok){let a=await d.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro AWS token",{status:d.status,error:a}),null}let i=await d.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!i.accessToken,expiresIn:i.expiresIn}),{accessToken:i.accessToken,refreshToken:i.refreshToken||a,expiresIn:i.expiresIn}}let i=await fetch(d.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:a})});if(!i.ok){let a=await i.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro social token",{status:i.status,error:a}),null}let j=await i.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!j.accessToken,expiresIn:j.expiresIn}),{accessToken:j.accessToken,refreshToken:j.refreshToken||a,expiresIn:j.expiresIn}}async function k(a,b){let c=btoa(`${d.xq.iflow.clientId}:${d.xq.iflow.clientSecret}`),e=await fetch(d.NA.iflow.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.iflow.clientId,client_secret:d.xq.iflow.clientSecret})});if(!e.ok){let a=await e.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh iFlow token",{status:e.status,error:a}),null}let f=await e.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed iFlow token",{hasNewAccessToken:!!f.access_token,hasNewRefreshToken:!!f.refresh_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,expiresIn:f.expires_in}}async function l(a,b){let c=await fetch(d.NA.github.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.github.clientId,client_secret:d.xq.github.clientSecret})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh GitHub token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed GitHub token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function m(a,b){try{let c=await fetch("https://api.github.com/copilot_internal/v2/token",{headers:{Authorization:`token ${a}`,"User-Agent":d.x0.USER_AGENT,"Editor-Version":`vscode/${d.x0.VSCODE_VERSION}`,"Editor-Plugin-Version":`copilot-chat/${d.x0.COPILOT_CHAT_VERSION}`,Accept:"application/json","x-github-api-version":d.x0.API_VERSION}});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Copilot token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Copilot token",{hasToken:!!e.token,expiresAt:e.expires_at}),{token:e.token,expiresAt:e.expires_at}}catch(a){return b?.error?.("TOKEN_REFRESH","Error refreshing Copilot token",{error:a.message}),null}}async function n(a,b,c){if(!b||!b.refreshToken)return c?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null;switch(a){case"gemini":case"gemini-cli":case"antigravity":return await g(b.refreshToken,d.xq[a].clientId,d.xq[a].clientSecret,c);case"claude":return await f(b.refreshToken,c);case"codex":return await i(b.refreshToken,c);case"qwen":return await h(b.refreshToken,c);case"iflow":return await k(b.refreshToken,c);case"github":return await l(b.refreshToken,c);case"kiro":return await j(b.refreshToken,b.providerSpecificData,c);default:return c?.warn?.("TOKEN_REFRESH",`Unsupported provider for token refresh: ${a}`),null}}async function o(a,b=3,c=null){for(let d=0;d<b;d++){if(d>0){let a=1e3*d;c?.debug?.("TOKEN_REFRESH",`Retry ${d}/${b} after ${a}ms`),await new Promise(b=>setTimeout(b,a))}try{let b=await a();if(b)return b}catch(a){c?.warn?.("TOKEN_REFRESH",`Attempt ${d+1}/${b} failed: ${a.message}`)}}return c?.error?.("TOKEN_REFRESH",`All ${b} retry attempts failed`),null}}};
1
+ "use strict";exports.id=8590,exports.ids=[8590],exports.modules={2255:(a,b,c)=>{let d,e;c.d(b,{$V:()=>q,A9:()=>h,Bm:()=>y,C8:()=>z,Cn:()=>i,Co:()=>p,EQ:()=>x,Ic:()=>m,K:()=>k,LY:()=>v,NA:()=>r,O:()=>w,Ox:()=>j,Uc:()=>s,eo:()=>t,gx:()=>u,nZ:()=>l,x0:()=>g,xq:()=>o,zv:()=>n});var f=c(21820);let g={VSCODE_VERSION:"1.110.0",COPILOT_CHAT_VERSION:"0.38.0",USER_AGENT:"GitHubCopilotChat/0.38.0",API_VERSION:"2025-04-01"};function h(){let a=(0,f.platform)(),b=(0,f.arch)();return`antigravity/1.104.0 ${a}/${b}`}let i={ideType:9,platform:(d=(0,f.platform)(),e=(0,f.arch)(),"darwin"===d?"arm64"===e?2:1:"linux"===d?"arm64"===e?4:3:5*("win32"===d)),pluginType:2},j={name:"x-request-source",value:"local"},k={"X-Client-Name":"antigravity","X-Client-Version":"1.107.0","x-goog-api-client":"gl-node/18.18.2 fire/0.8.6 grpc/1.10.x","User-Agent":"antigravity/1.107.0 darwin/arm64"},l={loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},m={"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1","Client-Metadata":JSON.stringify({ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"})},n={ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"},o={claude:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":"claude-cli/2.1.63 (external, cli)","X-App":"cli","X-Stainless-Helper-Method":"stream","X-Stainless-Retry-Count":"0","X-Stainless-Runtime-Version":"v24.3.0","X-Stainless-Package-Version":"0.74.0","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":function(){switch((0,f.arch)()){case"x64":return"x64";case"arm64":return"arm64";case"ia32":return"x86";default:return`other::${(0,f.arch)()}`}}(),"X-Stainless-Os":function(){switch((0,f.platform)()){case"darwin":return"MacOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";default:return`Other::${(0,f.platform)()}`}}(),"X-Stainless-Timeout":"600"},clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",tokenUrl:"https://api.anthropic.com/v1/oauth/token"},gemini:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",format:"gemini",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},"gemini-cli":{baseUrl:"https://cloudcode-pa.googleapis.com/v1internal",format:"gemini-cli",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},codex:{baseUrl:"https://chatgpt.com/backend-api/codex/responses",format:"openai-responses",headers:{originator:"codex-cli","User-Agent":"codex-cli/1.0.18 (macOS; arm64)"},clientId:"app_EMoamEEZ73f0CkXaXp7hrann",clientSecret:"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",tokenUrl:"https://auth.openai.com/oauth/token"},qwen:{baseUrl:"https://portal.qwen.ai/v1/chat/completions",format:"openai",headers:{"User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"gl-node/22.17.0"},clientId:"f0304373b74a44d2b584a3fb70ca9e56",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",authUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{baseUrl:"https://apis.iflow.cn/v1/chat/completions",format:"openai",headers:{"User-Agent":"iFlow-Cli"},clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://iflow.cn/oauth/token",authUrl:"https://iflow.cn/oauth"},antigravity:{baseUrls:["https://daily-cloudcode-pa.googleapis.com","https://cloudcode-pa.googleapis.com"],format:"antigravity",headers:{"User-Agent":h()},clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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"},openrouter:{baseUrl:"https://openrouter.ai/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"}},openai:{baseUrl:"https://api.openai.com/v1/chat/completions",format:"openai"},glm:{baseUrl:"https://api.z.ai/api/anthropic/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},"glm-cn":{baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",format:"openai",headers:{}},kimi:{baseUrl:"https://api.kimi.com/coding/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},minimax:{baseUrl:"https://api.minimax.io/anthropic/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},"minimax-cn":{baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},alicode:{baseUrl:"https://coding.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},github:{baseUrl:"https://api.githubcopilot.com/chat/completions",responsesUrl:"https://api.githubcopilot.com/responses",format:"openai",headers:{"copilot-integration-id":"vscode-chat","editor-version":`vscode/${g.VSCODE_VERSION}`,"editor-plugin-version":`copilot-chat/${g.COPILOT_CHAT_VERSION}`,"user-agent":g.USER_AGENT,"openai-intent":"conversation-panel","x-github-api-version":g.API_VERSION,"x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user",Accept:"application/json","Content-Type":"application/json"}},kiro:{baseUrl:"https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse",format:"kiro",headers:{"Content-Type":"application/json",Accept:"application/vnd.amazon.eventstream","X-Amz-Target":"AmazonCodeWhispererStreamingService.GenerateAssistantResponse","User-Agent":"AWS-SDK-JS/3.0.0 kiro-ide/1.0.0","X-Amz-User-Agent":"aws-sdk-js/3.0.0 kiro-ide/1.0.0"},tokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authUrl:"https://prod.us-east-1.auth.desktop.kiro.dev"},cursor:{baseUrl:"https://api2.cursor.sh",chatPath:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",format:"cursor",headers:{"connect-accept-encoding":"gzip","connect-protocol-version":"1","Content-Type":"application/connect+proto","User-Agent":"connect-es/1.6.1"},clientVersion:"1.1.3"},"kimi-coding":{baseUrl:"https://api.kimi.com/coding/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},clientId:"17e5f671-d194-4dfb-9706-5516cb48c098",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshUrl:"https://auth.kimi.com/api/oauth/token"},kilocode:{baseUrl:"https://api.kilo.ai/api/openrouter/chat/completions",format:"openai",headers:{}},cline:{baseUrl:"https://api.cline.bot/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://cline.bot","X-Title":"Cline"},tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},nvidia:{baseUrl:"https://integrate.api.nvidia.com/v1/chat/completions",format:"openai"},anthropic:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},deepseek:{baseUrl:"https://api.deepseek.com/chat/completions",format:"openai"},groq:{baseUrl:"https://api.groq.com/openai/v1/chat/completions",format:"openai"},xai:{baseUrl:"https://api.x.ai/v1/chat/completions",format:"openai"},mistral:{baseUrl:"https://api.mistral.ai/v1/chat/completions",format:"openai"},perplexity:{baseUrl:"https://api.perplexity.ai/chat/completions",format:"openai"},together:{baseUrl:"https://api.together.xyz/v1/chat/completions",format:"openai"},fireworks:{baseUrl:"https://api.fireworks.ai/inference/v1/chat/completions",format:"openai"},cerebras:{baseUrl:"https://api.cerebras.ai/v1/chat/completions",format:"openai"},cohere:{baseUrl:"https://api.cohere.ai/v1/chat/completions",format:"openai"},nebius:{baseUrl:"https://api.studio.nebius.ai/v1/chat/completions",format:"openai"},siliconflow:{baseUrl:"https://api.siliconflow.cn/v1/chat/completions",format:"openai"},hyperbolic:{baseUrl:"https://api.hyperbolic.xyz/v1/chat/completions",format:"openai"},deepgram:{baseUrl:"https://api.deepgram.com/v1/listen",format:"openai"},assemblyai:{baseUrl:"https://api.assemblyai.com/v1/audio/transcriptions",format:"openai"},nanobanana:{baseUrl:"https://api.nanobananaapi.ai/v1/chat/completions",format:"openai"},chutes:{baseUrl:"https://llm.chutes.ai/v1/chat/completions",format:"openai"}},p="You are a Claude agent, built on Anthropic's Claude Agent SDK.",q="You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**",r={google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://api.anthropic.com/v1/oauth/token",auth:"https://api.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://chat.qwen.ai/api/v1/oauth2/token",auth:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}},s=64e3,t=32e3,u={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},v={[u.BAD_REQUEST]:{type:"invalid_request_error",code:"bad_request"},[u.UNAUTHORIZED]:{type:"authentication_error",code:"invalid_api_key"},[u.FORBIDDEN]:{type:"permission_error",code:"insufficient_quota"},[u.NOT_FOUND]:{type:"invalid_request_error",code:"model_not_found"},[u.NOT_ACCEPTABLE]:{type:"invalid_request_error",code:"model_not_supported"},[u.RATE_LIMITED]:{type:"rate_limit_error",code:"rate_limit_exceeded"},[u.SERVER_ERROR]:{type:"server_error",code:"internal_server_error"},[u.BAD_GATEWAY]:{type:"server_error",code:"bad_gateway"},[u.SERVICE_UNAVAILABLE]:{type:"server_error",code:"service_unavailable"},[u.GATEWAY_TIMEOUT]:{type:"server_error",code:"gateway_timeout"}},w={[u.BAD_REQUEST]:"Bad request",[u.UNAUTHORIZED]:"Invalid API key provided",[u.FORBIDDEN]:"You exceeded your current quota",[u.NOT_FOUND]:"Model not found",[u.NOT_ACCEPTABLE]:"Model not supported",[u.RATE_LIMITED]:"Rate limit exceeded",[u.SERVER_ERROR]:"Internal server error",[u.BAD_GATEWAY]:"Bad gateway - upstream provider error",[u.SERVICE_UNAVAILABLE]:"Service temporarily unavailable",[u.GATEWAY_TIMEOUT]:"Gateway timeout"},x={base:1e3,max:12e4,maxLevel:15},y={unauthorized:12e4,paymentRequired:12e4,notFound:12e4,transient:3e4,requestNotAllowed:5e3,rateLimit:12e4,serviceUnavailable:2e3,authExpired:12e4},z=["Please write a 5-10 word title for the following conversation:"]},8590:(a,b,c)=>{c.d(b,{$B:()=>p,I9:()=>h,Ql:()=>k,iD:()=>o,jR:()=>n,oD:()=>e,qZ:()=>q});var d=c(2255);let e=3e5;async function f(a,b,c,e){let f=d.xq[a];if(!f||!f.refreshUrl)return e?.warn?.("TOKEN_REFRESH",`No refresh URL configured for provider: ${a}`),null;if(!b)return e?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null;try{let c=await fetch(f.refreshUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:b,client_id:f.clientId,client_secret:f.clientSecret})});if(!c.ok){let b=await c.text();return e?.error?.("TOKEN_REFRESH",`Failed to refresh token for ${a}`,{status:c.status,error:b}),null}let d=await c.json();return e?.info?.("TOKEN_REFRESH",`Successfully refreshed token for ${a}`,{hasNewAccessToken:!!d.access_token,hasNewRefreshToken:!!d.refresh_token,expiresIn:d.expires_in}),{accessToken:d.access_token,refreshToken:d.refresh_token||b,expiresIn:d.expires_in}}catch(b){return e?.error?.("TOKEN_REFRESH",`Error refreshing token for ${a}`,{error:b.message}),null}}async function g(a,b){let c=await fetch(d.NA.anthropic.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.claude.clientId})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Claude OAuth token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Claude OAuth token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function h(a,b,c,e){let f=await fetch(d.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:b,client_secret:c})});if(!f.ok){let a=await f.text();return e?.error?.("TOKEN_REFRESH","Failed to refresh Google token",{status:f.status,error:a}),null}let g=await f.json();return e?.info?.("TOKEN_REFRESH","Successfully refreshed Google token",{hasNewAccessToken:!!g.access_token,hasNewRefreshToken:!!g.refresh_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}async function i(a,b){let c=d.NA.qwen.token;try{let e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.qwen.clientId})});if(200===e.status){let c=await e.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Qwen token",{hasNewAccessToken:!!c.access_token,hasNewRefreshToken:!!c.refresh_token,expiresIn:c.expires_in}),{accessToken:c.access_token,refreshToken:c.refresh_token||a,expiresIn:c.expires_in,providerSpecificData:c.resource_url?{resourceUrl:c.resource_url}:void 0}}{let a=await e.text().catch(()=>"");b?.warn?.("TOKEN_REFRESH","Error with Qwen endpoint",{status:e.status,error:a})}}catch(a){b?.warn?.("TOKEN_REFRESH","Network error trying Qwen endpoint",{error:a.message})}return b?.error?.("TOKEN_REFRESH","Failed to refresh Qwen token"),null}async function j(a,b){let c=await fetch(d.NA.openai.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.codex.clientId,scope:"openid profile email offline_access"})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Codex token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Codex token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function k(a,b,c){let e=b?.authMethod,f=b?.clientId,g=b?.clientSecret,h=b?.region;if(f&&g){let b="idc"===e&&h?`https://oidc.${h}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",d=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:f,clientSecret:g,refreshToken:a,grantType:"refresh_token"})});if(!d.ok){let a=await d.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro AWS token",{status:d.status,error:a}),null}let i=await d.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!i.accessToken,expiresIn:i.expiresIn}),{accessToken:i.accessToken,refreshToken:i.refreshToken||a,expiresIn:i.expiresIn}}let i=await fetch(d.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:a})});if(!i.ok){let a=await i.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro social token",{status:i.status,error:a}),null}let j=await i.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!j.accessToken,expiresIn:j.expiresIn}),{accessToken:j.accessToken,refreshToken:j.refreshToken||a,expiresIn:j.expiresIn}}async function l(a,b){let c=btoa(`${d.xq.iflow.clientId}:${d.xq.iflow.clientSecret}`),e=await fetch(d.NA.iflow.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.iflow.clientId,client_secret:d.xq.iflow.clientSecret})});if(!e.ok){let a=await e.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh iFlow token",{status:e.status,error:a}),null}let f=await e.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed iFlow token",{hasNewAccessToken:!!f.access_token,hasNewRefreshToken:!!f.refresh_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,expiresIn:f.expires_in}}async function m(a,b){let c=await fetch(d.NA.github.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.github.clientId,client_secret:d.xq.github.clientSecret})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh GitHub token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed GitHub token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function n(a,b){try{let c=await fetch("https://api.github.com/copilot_internal/v2/token",{headers:{Authorization:`token ${a}`,"User-Agent":d.x0.USER_AGENT,"Editor-Version":`vscode/${d.x0.VSCODE_VERSION}`,"Editor-Plugin-Version":`copilot-chat/${d.x0.COPILOT_CHAT_VERSION}`,Accept:"application/json","x-github-api-version":d.x0.API_VERSION}});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Copilot token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Copilot token",{hasToken:!!e.token,expiresAt:e.expires_at}),{token:e.token,expiresAt:e.expires_at}}catch(a){return b?.error?.("TOKEN_REFRESH","Error refreshing Copilot token",{error:a.message}),null}}async function o(a,b,c){if(!b||!b.refreshToken)return c?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null;switch(a){case"gemini":case"gemini-cli":case"antigravity":return await h(b.refreshToken,d.xq[a].clientId,d.xq[a].clientSecret,c);case"claude":return await g(b.refreshToken,c);case"codex":return await j(b.refreshToken,c);case"qwen":return await i(b.refreshToken,c);case"iflow":return await l(b.refreshToken,c);case"github":return await m(b.refreshToken,c);case"kiro":return await k(b.refreshToken,b.providerSpecificData,c);default:return c?.warn?.("TOKEN_REFRESH",`Unsupported provider for token refresh: ${a}`),null}}async function p(a,b,c){if(!b.refreshToken)return null;switch(a){case"gemini-cli":case"antigravity":return h(b.refreshToken,d.xq[a].clientId,d.xq[a].clientSecret,c);case"claude":return g(b.refreshToken,c);case"codex":return j(b.refreshToken,c);case"qwen":return i(b.refreshToken,c);case"iflow":return l(b.refreshToken,c);case"github":return m(b.refreshToken,c);case"kiro":return k(b.refreshToken,b.providerSpecificData,c);default:return f(a,b.refreshToken,b,c)}}async function q(a,b=3,c=null){for(let d=0;d<b;d++){if(d>0){let a=1e3*d;c?.debug?.("TOKEN_REFRESH",`Retry ${d}/${b} after ${a}ms`),await new Promise(b=>setTimeout(b,a))}try{let b=await a();if(b)return b}catch(a){c?.warn?.("TOKEN_REFRESH",`Attempt ${d+1}/${b} failed: ${a.message}`)}}return c?.error?.("TOKEN_REFRESH",`All ${b} retry attempts failed`),null}}};