@thangnm.nip/irouter 0.0.18 → 0.0.19

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 (570) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +5 -4
  3. package/app/.next/build-manifest.json +2 -2
  4. package/app/.next/routes-manifest.json +8 -0
  5. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  6. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  8. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  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 +2 -2
  12. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/employees/[keyId]/page.js +2 -2
  14. package/app/.next/server/app/(dashboard)/dashboard/employees/[keyId]/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/employees/page.js +4 -4
  16. package/app/.next/server/app/(dashboard)/dashboard/employees/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +3 -3
  18. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  20. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  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 +2 -2
  24. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  26. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  28. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  30. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  32. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  34. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  35. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  36. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  38. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  39. package/app/.next/server/app/_global-error/page.js +2 -2
  40. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  41. package/app/.next/server/app/_global-error.html +1 -1
  42. package/app/.next/server/app/_global-error.rsc +1 -1
  43. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  44. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  45. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  46. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  47. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  48. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  49. package/app/.next/server/app/_not-found/page.js +2 -2
  50. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  51. package/app/.next/server/app/_not-found.html +1 -1
  52. package/app/.next/server/app/_not-found.rsc +4 -4
  53. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  54. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  55. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  56. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  57. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  58. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  59. package/app/.next/server/app/api/9remote/install/route.js +1 -1
  60. package/app/.next/server/app/api/9remote/start/route.js +1 -1
  61. package/app/.next/server/app/api/9remote/status/route.js +1 -1
  62. package/app/.next/server/app/api/auth/login/route.js +1 -1
  63. package/app/.next/server/app/api/auth/logout/route.js +1 -1
  64. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  65. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +2 -2
  66. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
  67. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
  68. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +1 -1
  69. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
  70. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  71. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  72. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  73. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  74. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  75. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  76. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  77. package/app/.next/server/app/api/combos/route.js +1 -1
  78. package/app/.next/server/app/api/employees/[keyId]/stats/route.js +2 -2
  79. package/app/.next/server/app/api/employees/stats/route.js +2 -2
  80. package/app/.next/server/app/api/init/route.js +1 -1
  81. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  82. package/app/.next/server/app/api/keys/route.js +1 -1
  83. package/app/.next/server/app/api/locale/route.js +1 -1
  84. package/app/.next/server/app/api/models/alias/route.js +1 -1
  85. package/app/.next/server/app/api/models/availability/route.js +1 -1
  86. package/app/.next/server/app/api/models/route.js +1 -1
  87. package/app/.next/server/app/api/models/test/route.js +1 -1
  88. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  89. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  90. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  91. package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
  92. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  93. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  94. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  95. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  96. package/app/.next/server/app/api/pricing/route.js +1 -1
  97. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  98. package/app/.next/server/app/api/provider-nodes/route.js +1 -1
  99. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  100. package/app/.next/server/app/api/providers/[id]/access-policy/route.js +1 -0
  101. package/app/.next/server/app/api/providers/[id]/access-policy/route.js.nft.json +1 -0
  102. package/app/.next/server/app/api/providers/[id]/access-policy/route_client-reference-manifest.js +1 -0
  103. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  104. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  105. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  106. package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
  107. package/app/.next/server/app/api/providers/client/route.js +1 -1
  108. package/app/.next/server/app/api/providers/route.js +1 -1
  109. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  110. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  111. package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
  112. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  113. package/app/.next/server/app/api/proxy-pools/route.js +1 -1
  114. package/app/.next/server/app/api/settings/database/route.js +1 -1
  115. package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
  116. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  117. package/app/.next/server/app/api/settings/route.js +1 -1
  118. package/app/.next/server/app/api/shutdown/route.js +1 -1
  119. package/app/.next/server/app/api/tags/route.js +1 -1
  120. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  121. package/app/.next/server/app/api/translator/console-logs/stream/route.js +2 -2
  122. package/app/.next/server/app/api/translator/load/route.js +1 -1
  123. package/app/.next/server/app/api/translator/save/route.js +1 -1
  124. package/app/.next/server/app/api/translator/send/route.js +1 -1
  125. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  126. package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
  127. package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
  128. package/app/.next/server/app/api/tunnel/status/route.js +1 -1
  129. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  130. package/app/.next/server/app/api/usage/chart/route.js +2 -2
  131. package/app/.next/server/app/api/usage/history/route.js +2 -2
  132. package/app/.next/server/app/api/usage/logs/route.js +2 -2
  133. package/app/.next/server/app/api/usage/providers/route.js +2 -2
  134. package/app/.next/server/app/api/usage/request-details/[id]/download/route.js +2 -2
  135. package/app/.next/server/app/api/usage/request-details/[id]/route.js +1 -1
  136. package/app/.next/server/app/api/usage/request-details/aggregate/route.js +13 -13
  137. package/app/.next/server/app/api/usage/request-details/route.js +2 -2
  138. package/app/.next/server/app/api/usage/request-logs/route.js +2 -2
  139. package/app/.next/server/app/api/usage/stats/route.js +2 -2
  140. package/app/.next/server/app/api/usage/stream/route.js +8 -8
  141. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  142. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  143. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  144. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  145. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  146. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  147. package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
  148. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  149. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  150. package/app/.next/server/app/api/v1/models/route.js +1 -1
  151. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  152. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  153. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  154. package/app/.next/server/app/api/v1/route.js +1 -1
  155. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  156. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  157. package/app/.next/server/app/api/v1beta/models/route.js +1 -1
  158. package/app/.next/server/app/api/v1internal/route.js +1 -1
  159. package/app/.next/server/app/api/v1internal/route.js.nft.json +1 -1
  160. package/app/.next/server/app/api/version/route.js +1 -1
  161. package/app/.next/server/app/callback/page.js +2 -2
  162. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  163. package/app/.next/server/app/callback.html +1 -1
  164. package/app/.next/server/app/callback.rsc +4 -4
  165. package/app/.next/server/app/callback.segments/_full.segment.rsc +4 -4
  166. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  167. package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
  168. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  169. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  170. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  171. package/app/.next/server/app/dashboard/basic-chat.html +1 -1
  172. package/app/.next/server/app/dashboard/basic-chat.rsc +6 -6
  173. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  174. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  175. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  176. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  177. package/app/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  178. package/app/.next/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  179. package/app/.next/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  180. package/app/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  181. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  182. package/app/.next/server/app/dashboard/cli-tools.rsc +6 -6
  183. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  184. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  185. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  186. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  187. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  188. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  189. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  190. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  191. package/app/.next/server/app/dashboard/combos.html +1 -1
  192. package/app/.next/server/app/dashboard/combos.rsc +6 -6
  193. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  194. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  195. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  196. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  197. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  198. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  199. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  200. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  201. package/app/.next/server/app/dashboard/employees.html +1 -1
  202. package/app/.next/server/app/dashboard/employees.rsc +6 -6
  203. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk/dashboard/employees/__PAGE__.segment.rsc +2 -2
  204. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk/dashboard/employees.segment.rsc +1 -1
  205. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  206. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  207. package/app/.next/server/app/dashboard/employees.segments/_full.segment.rsc +6 -6
  208. package/app/.next/server/app/dashboard/employees.segments/_head.segment.rsc +1 -1
  209. package/app/.next/server/app/dashboard/employees.segments/_index.segment.rsc +4 -4
  210. package/app/.next/server/app/dashboard/employees.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 +6 -6
  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 +6 -6
  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 +4 -4
  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 +6 -6
  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 +6 -6
  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 +4 -4
  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 +6 -6
  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 +6 -6
  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 +4 -4
  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 +6 -6
  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 +6 -6
  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 +4 -4
  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 +6 -6
  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 +6 -6
  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 +4 -4
  261. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  262. package/app/.next/server/app/dashboard/proxy-pools.html +1 -1
  263. package/app/.next/server/app/dashboard/proxy-pools.rsc +6 -6
  264. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  265. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  266. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  267. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  268. package/app/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  269. package/app/.next/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  270. package/app/.next/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  271. package/app/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  272. package/app/.next/server/app/dashboard/quota.html +2 -2
  273. package/app/.next/server/app/dashboard/quota.rsc +5 -5
  274. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +1 -1
  275. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  276. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  277. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  278. package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +5 -5
  279. package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  280. package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  281. package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  282. package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
  283. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  284. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  285. package/app/.next/server/app/dashboard/settings/pricing.rsc +4 -4
  286. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  287. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  288. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  289. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  290. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  291. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  292. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  293. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  294. package/app/.next/server/app/dashboard/translator.html +1 -1
  295. package/app/.next/server/app/dashboard/translator.rsc +6 -6
  296. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  297. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  298. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  299. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  300. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  301. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  302. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  303. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  304. package/app/.next/server/app/dashboard/usage.html +1 -1
  305. package/app/.next/server/app/dashboard/usage.rsc +6 -6
  306. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  307. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  308. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  309. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  310. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  311. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  312. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  313. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  314. package/app/.next/server/app/dashboard.html +1 -1
  315. package/app/.next/server/app/dashboard.rsc +5 -5
  316. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +1 -1
  317. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  318. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  319. package/app/.next/server/app/dashboard.segments/_full.segment.rsc +5 -5
  320. package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
  321. package/app/.next/server/app/dashboard.segments/_index.segment.rsc +4 -4
  322. package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  323. package/app/.next/server/app/favicon.ico/route.js +1 -1
  324. package/app/.next/server/app/index.html +1 -1
  325. package/app/.next/server/app/index.rsc +4 -4
  326. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  327. package/app/.next/server/app/index.segments/_full.segment.rsc +4 -4
  328. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  329. package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
  330. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  331. package/app/.next/server/app/landing/page.js +2 -2
  332. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  333. package/app/.next/server/app/landing.html +1 -1
  334. package/app/.next/server/app/landing.rsc +4 -4
  335. package/app/.next/server/app/landing.segments/_full.segment.rsc +4 -4
  336. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  337. package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
  338. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  339. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  340. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  341. package/app/.next/server/app/login/page.js +2 -2
  342. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  343. package/app/.next/server/app/login.html +1 -1
  344. package/app/.next/server/app/login.rsc +5 -5
  345. package/app/.next/server/app/login.segments/_full.segment.rsc +5 -5
  346. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  347. package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
  348. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  349. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  350. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  351. package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
  352. package/app/.next/server/app/page.js +2 -2
  353. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  354. package/app/.next/server/app-paths-manifest.json +5 -4
  355. package/app/.next/server/chunks/1051.js +1 -0
  356. package/app/.next/server/chunks/2664.js +1 -1
  357. package/app/.next/server/chunks/3093.js +1 -1
  358. package/app/.next/server/chunks/6811.js +1 -1
  359. package/app/.next/server/chunks/6898.js +1 -1
  360. package/app/.next/server/chunks/9489.js +1 -0
  361. package/app/.next/server/chunks/9718.js +1 -1
  362. package/app/.next/server/middleware-build-manifest.js +1 -1
  363. package/app/.next/server/pages/404.html +1 -1
  364. package/app/.next/server/pages/500.html +1 -1
  365. package/app/.next/static/chunks/{5497-f66eb2acf4020098.js → 5497-189ace2180e8dc37.js} +1 -1
  366. package/app/.next/static/chunks/app/{_global-error/page-12c5a5ad06b69231.js → (dashboard)/dashboard/page-378b8dff959a5ad8.js} +1 -1
  367. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-592b4c4f5e745ebe.js +1 -0
  368. package/app/.next/static/chunks/app/{api/9remote/install/route-12c5a5ad06b69231.js → _global-error/page-378b8dff959a5ad8.js} +1 -1
  369. package/app/.next/static/chunks/app/{(dashboard)/dashboard/page-12c5a5ad06b69231.js → api/9remote/install/route-378b8dff959a5ad8.js} +1 -1
  370. package/app/.next/static/chunks/app/api/9remote/start/{route-12c5a5ad06b69231.js → route-378b8dff959a5ad8.js} +1 -1
  371. package/app/.next/static/chunks/app/api/9remote/status/route-378b8dff959a5ad8.js +1 -0
  372. package/app/.next/static/chunks/app/api/auth/login/route-378b8dff959a5ad8.js +1 -0
  373. package/app/.next/static/chunks/app/api/auth/logout/route-378b8dff959a5ad8.js +1 -0
  374. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-378b8dff959a5ad8.js +1 -0
  375. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-378b8dff959a5ad8.js +1 -0
  376. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-378b8dff959a5ad8.js +1 -0
  377. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-378b8dff959a5ad8.js +1 -0
  378. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-378b8dff959a5ad8.js +1 -0
  379. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-378b8dff959a5ad8.js +1 -0
  380. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-378b8dff959a5ad8.js +1 -0
  381. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-378b8dff959a5ad8.js +1 -0
  382. package/app/.next/static/chunks/app/api/cloud/auth/route-378b8dff959a5ad8.js +1 -0
  383. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-378b8dff959a5ad8.js +1 -0
  384. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-378b8dff959a5ad8.js +1 -0
  385. package/app/.next/static/chunks/app/api/cloud/models/alias/route-378b8dff959a5ad8.js +1 -0
  386. package/app/.next/static/chunks/app/api/combos/[id]/route-378b8dff959a5ad8.js +1 -0
  387. package/app/.next/static/chunks/app/api/combos/route-378b8dff959a5ad8.js +1 -0
  388. package/app/.next/static/chunks/app/api/employees/[keyId]/stats/route-378b8dff959a5ad8.js +1 -0
  389. package/app/.next/static/chunks/app/api/employees/stats/route-378b8dff959a5ad8.js +1 -0
  390. package/app/.next/static/chunks/app/api/init/route-378b8dff959a5ad8.js +1 -0
  391. package/app/.next/static/chunks/app/api/keys/[id]/route-378b8dff959a5ad8.js +1 -0
  392. package/app/.next/static/chunks/app/api/keys/route-378b8dff959a5ad8.js +1 -0
  393. package/app/.next/static/chunks/app/api/locale/route-378b8dff959a5ad8.js +1 -0
  394. package/app/.next/static/chunks/app/api/models/alias/route-378b8dff959a5ad8.js +1 -0
  395. package/app/.next/static/chunks/app/api/models/availability/route-378b8dff959a5ad8.js +1 -0
  396. package/app/.next/static/chunks/app/api/models/route-378b8dff959a5ad8.js +1 -0
  397. package/app/.next/static/chunks/app/api/models/test/route-378b8dff959a5ad8.js +1 -0
  398. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-378b8dff959a5ad8.js +1 -0
  399. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-378b8dff959a5ad8.js +1 -0
  400. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-378b8dff959a5ad8.js +1 -0
  401. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-378b8dff959a5ad8.js +1 -0
  402. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-378b8dff959a5ad8.js +1 -0
  403. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-378b8dff959a5ad8.js +1 -0
  404. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-378b8dff959a5ad8.js +1 -0
  405. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-378b8dff959a5ad8.js +1 -0
  406. package/app/.next/static/chunks/app/api/pricing/route-378b8dff959a5ad8.js +1 -0
  407. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-378b8dff959a5ad8.js +1 -0
  408. package/app/.next/static/chunks/app/api/provider-nodes/route-378b8dff959a5ad8.js +1 -0
  409. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-378b8dff959a5ad8.js +1 -0
  410. package/app/.next/static/chunks/app/api/providers/[id]/access-policy/route-378b8dff959a5ad8.js +1 -0
  411. package/app/.next/static/chunks/app/api/providers/[id]/models/route-378b8dff959a5ad8.js +1 -0
  412. package/app/.next/static/chunks/app/api/providers/[id]/route-378b8dff959a5ad8.js +1 -0
  413. package/app/.next/static/chunks/app/api/providers/[id]/test/route-378b8dff959a5ad8.js +1 -0
  414. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-378b8dff959a5ad8.js +1 -0
  415. package/app/.next/static/chunks/app/api/providers/client/route-378b8dff959a5ad8.js +1 -0
  416. package/app/.next/static/chunks/app/api/providers/route-378b8dff959a5ad8.js +1 -0
  417. package/app/.next/static/chunks/app/api/providers/test-batch/route-378b8dff959a5ad8.js +1 -0
  418. package/app/.next/static/chunks/app/api/providers/validate/route-378b8dff959a5ad8.js +1 -0
  419. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-378b8dff959a5ad8.js +1 -0
  420. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-378b8dff959a5ad8.js +1 -0
  421. package/app/.next/static/chunks/app/api/proxy-pools/route-378b8dff959a5ad8.js +1 -0
  422. package/app/.next/static/chunks/app/api/settings/database/route-378b8dff959a5ad8.js +1 -0
  423. package/app/.next/static/chunks/app/api/settings/proxy-test/route-378b8dff959a5ad8.js +1 -0
  424. package/app/.next/static/chunks/app/api/settings/require-login/route-378b8dff959a5ad8.js +1 -0
  425. package/app/.next/static/chunks/app/api/settings/route-378b8dff959a5ad8.js +1 -0
  426. package/app/.next/static/chunks/app/api/shutdown/route-378b8dff959a5ad8.js +1 -0
  427. package/app/.next/static/chunks/app/api/tags/route-378b8dff959a5ad8.js +1 -0
  428. package/app/.next/static/chunks/app/api/translator/console-logs/route-378b8dff959a5ad8.js +1 -0
  429. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-378b8dff959a5ad8.js +1 -0
  430. package/app/.next/static/chunks/app/api/translator/load/route-378b8dff959a5ad8.js +1 -0
  431. package/app/.next/static/chunks/app/api/translator/save/route-378b8dff959a5ad8.js +1 -0
  432. package/app/.next/static/chunks/app/api/translator/send/route-378b8dff959a5ad8.js +1 -0
  433. package/app/.next/static/chunks/app/api/translator/translate/route-378b8dff959a5ad8.js +1 -0
  434. package/app/.next/static/chunks/app/api/tunnel/disable/route-378b8dff959a5ad8.js +1 -0
  435. package/app/.next/static/chunks/app/api/tunnel/enable/route-378b8dff959a5ad8.js +1 -0
  436. package/app/.next/static/chunks/app/api/tunnel/status/route-378b8dff959a5ad8.js +1 -0
  437. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-378b8dff959a5ad8.js +1 -0
  438. package/app/.next/static/chunks/app/api/usage/chart/route-378b8dff959a5ad8.js +1 -0
  439. package/app/.next/static/chunks/app/api/usage/history/route-378b8dff959a5ad8.js +1 -0
  440. package/app/.next/static/chunks/app/api/usage/logs/route-378b8dff959a5ad8.js +1 -0
  441. package/app/.next/static/chunks/app/api/usage/providers/route-378b8dff959a5ad8.js +1 -0
  442. package/app/.next/static/chunks/app/api/usage/request-details/[id]/download/route-378b8dff959a5ad8.js +1 -0
  443. package/app/.next/static/chunks/app/api/usage/request-details/[id]/route-378b8dff959a5ad8.js +1 -0
  444. package/app/.next/static/chunks/app/api/usage/request-details/aggregate/route-378b8dff959a5ad8.js +1 -0
  445. package/app/.next/static/chunks/app/api/usage/request-details/route-378b8dff959a5ad8.js +1 -0
  446. package/app/.next/static/chunks/app/api/usage/request-logs/route-378b8dff959a5ad8.js +1 -0
  447. package/app/.next/static/chunks/app/api/usage/stats/route-378b8dff959a5ad8.js +1 -0
  448. package/app/.next/static/chunks/app/api/usage/stream/route-378b8dff959a5ad8.js +1 -0
  449. package/app/.next/static/chunks/app/api/v1/api/chat/route-378b8dff959a5ad8.js +1 -0
  450. package/app/.next/static/chunks/app/api/v1/chat/completions/route-378b8dff959a5ad8.js +1 -0
  451. package/app/.next/static/chunks/app/api/v1/embeddings/route-378b8dff959a5ad8.js +1 -0
  452. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-378b8dff959a5ad8.js +1 -0
  453. package/app/.next/static/chunks/app/api/v1/messages/route-378b8dff959a5ad8.js +1 -0
  454. package/app/.next/static/chunks/app/api/v1/models/route-378b8dff959a5ad8.js +1 -0
  455. package/app/.next/static/chunks/app/api/v1/responses/route-378b8dff959a5ad8.js +1 -0
  456. package/app/.next/static/chunks/app/api/v1/route-378b8dff959a5ad8.js +1 -0
  457. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-378b8dff959a5ad8.js +1 -0
  458. package/app/.next/static/chunks/app/api/v1beta/models/route-378b8dff959a5ad8.js +1 -0
  459. package/app/.next/static/chunks/app/api/v1internal/route-378b8dff959a5ad8.js +1 -0
  460. package/app/.next/static/chunks/app/api/version/route-378b8dff959a5ad8.js +1 -0
  461. package/app/.next/static/chunks/app/{layout-224ac805b7ae89a3.js → layout-dcc32c615c88bd9b.js} +1 -1
  462. package/app/.next/static/chunks/app/manifest.webmanifest/route-378b8dff959a5ad8.js +1 -0
  463. package/app/.next/static/chunks/app/page-378b8dff959a5ad8.js +1 -0
  464. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-378b8dff959a5ad8.js +1 -0
  465. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-378b8dff959a5ad8.js +1 -0
  466. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-378b8dff959a5ad8.js +1 -0
  467. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-378b8dff959a5ad8.js +1 -0
  468. package/app/.next/static/css/bcba695583d9b815.css +1 -0
  469. package/app/package.json +1 -1
  470. package/package.json +1 -1
  471. package/app/.next/server/chunks/289.js +0 -1
  472. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-81e062741834b97d.js +0 -1
  473. package/app/.next/static/chunks/app/api/9remote/status/route-12c5a5ad06b69231.js +0 -1
  474. package/app/.next/static/chunks/app/api/auth/login/route-12c5a5ad06b69231.js +0 -1
  475. package/app/.next/static/chunks/app/api/auth/logout/route-12c5a5ad06b69231.js +0 -1
  476. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-12c5a5ad06b69231.js +0 -1
  477. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-12c5a5ad06b69231.js +0 -1
  478. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-12c5a5ad06b69231.js +0 -1
  479. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-12c5a5ad06b69231.js +0 -1
  480. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-12c5a5ad06b69231.js +0 -1
  481. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-12c5a5ad06b69231.js +0 -1
  482. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-12c5a5ad06b69231.js +0 -1
  483. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-12c5a5ad06b69231.js +0 -1
  484. package/app/.next/static/chunks/app/api/cloud/auth/route-12c5a5ad06b69231.js +0 -1
  485. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-12c5a5ad06b69231.js +0 -1
  486. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-12c5a5ad06b69231.js +0 -1
  487. package/app/.next/static/chunks/app/api/cloud/models/alias/route-12c5a5ad06b69231.js +0 -1
  488. package/app/.next/static/chunks/app/api/combos/[id]/route-12c5a5ad06b69231.js +0 -1
  489. package/app/.next/static/chunks/app/api/combos/route-12c5a5ad06b69231.js +0 -1
  490. package/app/.next/static/chunks/app/api/employees/[keyId]/stats/route-12c5a5ad06b69231.js +0 -1
  491. package/app/.next/static/chunks/app/api/employees/stats/route-12c5a5ad06b69231.js +0 -1
  492. package/app/.next/static/chunks/app/api/init/route-12c5a5ad06b69231.js +0 -1
  493. package/app/.next/static/chunks/app/api/keys/[id]/route-12c5a5ad06b69231.js +0 -1
  494. package/app/.next/static/chunks/app/api/keys/route-12c5a5ad06b69231.js +0 -1
  495. package/app/.next/static/chunks/app/api/locale/route-12c5a5ad06b69231.js +0 -1
  496. package/app/.next/static/chunks/app/api/models/alias/route-12c5a5ad06b69231.js +0 -1
  497. package/app/.next/static/chunks/app/api/models/availability/route-12c5a5ad06b69231.js +0 -1
  498. package/app/.next/static/chunks/app/api/models/route-12c5a5ad06b69231.js +0 -1
  499. package/app/.next/static/chunks/app/api/models/test/route-12c5a5ad06b69231.js +0 -1
  500. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-12c5a5ad06b69231.js +0 -1
  501. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-12c5a5ad06b69231.js +0 -1
  502. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-12c5a5ad06b69231.js +0 -1
  503. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-12c5a5ad06b69231.js +0 -1
  504. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-12c5a5ad06b69231.js +0 -1
  505. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-12c5a5ad06b69231.js +0 -1
  506. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-12c5a5ad06b69231.js +0 -1
  507. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-12c5a5ad06b69231.js +0 -1
  508. package/app/.next/static/chunks/app/api/pricing/route-12c5a5ad06b69231.js +0 -1
  509. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-12c5a5ad06b69231.js +0 -1
  510. package/app/.next/static/chunks/app/api/provider-nodes/route-12c5a5ad06b69231.js +0 -1
  511. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-12c5a5ad06b69231.js +0 -1
  512. package/app/.next/static/chunks/app/api/providers/[id]/models/route-12c5a5ad06b69231.js +0 -1
  513. package/app/.next/static/chunks/app/api/providers/[id]/route-12c5a5ad06b69231.js +0 -1
  514. package/app/.next/static/chunks/app/api/providers/[id]/test/route-12c5a5ad06b69231.js +0 -1
  515. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-12c5a5ad06b69231.js +0 -1
  516. package/app/.next/static/chunks/app/api/providers/client/route-12c5a5ad06b69231.js +0 -1
  517. package/app/.next/static/chunks/app/api/providers/route-12c5a5ad06b69231.js +0 -1
  518. package/app/.next/static/chunks/app/api/providers/test-batch/route-12c5a5ad06b69231.js +0 -1
  519. package/app/.next/static/chunks/app/api/providers/validate/route-12c5a5ad06b69231.js +0 -1
  520. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-12c5a5ad06b69231.js +0 -1
  521. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-12c5a5ad06b69231.js +0 -1
  522. package/app/.next/static/chunks/app/api/proxy-pools/route-12c5a5ad06b69231.js +0 -1
  523. package/app/.next/static/chunks/app/api/settings/database/route-12c5a5ad06b69231.js +0 -1
  524. package/app/.next/static/chunks/app/api/settings/proxy-test/route-12c5a5ad06b69231.js +0 -1
  525. package/app/.next/static/chunks/app/api/settings/require-login/route-12c5a5ad06b69231.js +0 -1
  526. package/app/.next/static/chunks/app/api/settings/route-12c5a5ad06b69231.js +0 -1
  527. package/app/.next/static/chunks/app/api/shutdown/route-12c5a5ad06b69231.js +0 -1
  528. package/app/.next/static/chunks/app/api/tags/route-12c5a5ad06b69231.js +0 -1
  529. package/app/.next/static/chunks/app/api/translator/console-logs/route-12c5a5ad06b69231.js +0 -1
  530. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-12c5a5ad06b69231.js +0 -1
  531. package/app/.next/static/chunks/app/api/translator/load/route-12c5a5ad06b69231.js +0 -1
  532. package/app/.next/static/chunks/app/api/translator/save/route-12c5a5ad06b69231.js +0 -1
  533. package/app/.next/static/chunks/app/api/translator/send/route-12c5a5ad06b69231.js +0 -1
  534. package/app/.next/static/chunks/app/api/translator/translate/route-12c5a5ad06b69231.js +0 -1
  535. package/app/.next/static/chunks/app/api/tunnel/disable/route-12c5a5ad06b69231.js +0 -1
  536. package/app/.next/static/chunks/app/api/tunnel/enable/route-12c5a5ad06b69231.js +0 -1
  537. package/app/.next/static/chunks/app/api/tunnel/status/route-12c5a5ad06b69231.js +0 -1
  538. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-12c5a5ad06b69231.js +0 -1
  539. package/app/.next/static/chunks/app/api/usage/chart/route-12c5a5ad06b69231.js +0 -1
  540. package/app/.next/static/chunks/app/api/usage/history/route-12c5a5ad06b69231.js +0 -1
  541. package/app/.next/static/chunks/app/api/usage/logs/route-12c5a5ad06b69231.js +0 -1
  542. package/app/.next/static/chunks/app/api/usage/providers/route-12c5a5ad06b69231.js +0 -1
  543. package/app/.next/static/chunks/app/api/usage/request-details/[id]/download/route-12c5a5ad06b69231.js +0 -1
  544. package/app/.next/static/chunks/app/api/usage/request-details/[id]/route-12c5a5ad06b69231.js +0 -1
  545. package/app/.next/static/chunks/app/api/usage/request-details/aggregate/route-12c5a5ad06b69231.js +0 -1
  546. package/app/.next/static/chunks/app/api/usage/request-details/route-12c5a5ad06b69231.js +0 -1
  547. package/app/.next/static/chunks/app/api/usage/request-logs/route-12c5a5ad06b69231.js +0 -1
  548. package/app/.next/static/chunks/app/api/usage/stats/route-12c5a5ad06b69231.js +0 -1
  549. package/app/.next/static/chunks/app/api/usage/stream/route-12c5a5ad06b69231.js +0 -1
  550. package/app/.next/static/chunks/app/api/v1/api/chat/route-12c5a5ad06b69231.js +0 -1
  551. package/app/.next/static/chunks/app/api/v1/chat/completions/route-12c5a5ad06b69231.js +0 -1
  552. package/app/.next/static/chunks/app/api/v1/embeddings/route-12c5a5ad06b69231.js +0 -1
  553. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-12c5a5ad06b69231.js +0 -1
  554. package/app/.next/static/chunks/app/api/v1/messages/route-12c5a5ad06b69231.js +0 -1
  555. package/app/.next/static/chunks/app/api/v1/models/route-12c5a5ad06b69231.js +0 -1
  556. package/app/.next/static/chunks/app/api/v1/responses/route-12c5a5ad06b69231.js +0 -1
  557. package/app/.next/static/chunks/app/api/v1/route-12c5a5ad06b69231.js +0 -1
  558. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-12c5a5ad06b69231.js +0 -1
  559. package/app/.next/static/chunks/app/api/v1beta/models/route-12c5a5ad06b69231.js +0 -1
  560. package/app/.next/static/chunks/app/api/v1internal/route-12c5a5ad06b69231.js +0 -1
  561. package/app/.next/static/chunks/app/api/version/route-12c5a5ad06b69231.js +0 -1
  562. package/app/.next/static/chunks/app/manifest.webmanifest/route-12c5a5ad06b69231.js +0 -1
  563. package/app/.next/static/chunks/app/page-12c5a5ad06b69231.js +0 -1
  564. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-12c5a5ad06b69231.js +0 -1
  565. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-12c5a5ad06b69231.js +0 -1
  566. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-12c5a5ad06b69231.js +0 -1
  567. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-12c5a5ad06b69231.js +0 -1
  568. package/app/.next/static/css/1af9dd740b1b289e.css +0 -1
  569. /package/app/.next/static/{jRzqJ3I-9P1BJUJputQ6t → fnUmDHie_XiGTj2DnZpYB}/_buildManifest.js +0 -0
  570. /package/app/.next/static/{jRzqJ3I-9P1BJUJputQ6t → fnUmDHie_XiGTj2DnZpYB}/_ssgManifest.js +0 -0
@@ -4,4 +4,4 @@
4
4
  `,children:e.name},e.id)})})]}),Object.entries(C).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,r.jsx)("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t.color}}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:t.name}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",t.models.length,")"]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.models.map(e=>{let t=l===e.value,s=e.isPlaceholder;return(0,r.jsx)("button",{onClick:()=>S(e),title:s?"Select to pre-fill, then edit model ID in the input":void 0,className:`
5
5
  px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
6
6
  ${s?"border-dashed border-border text-text-muted hover:border-primary/50 hover:text-primary bg-surface italic":t?"bg-primary text-white border-primary":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
7
- `,children:s?(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),e.name]}):e.isCustom?(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[e.name,(0,r.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"})]}):e.name},e.id)})})]},e)),0===Object.keys(C).length&&0===k.length&&(0,r.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,r.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}m.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onSelect:n().func.isRequired,selectedModel:n().string,activeProviders:n().arrayOf(n().shape({provider:n().string.isRequired})),title:n().string,modelAliases:n().object}},73006:(e,t,s)=>{s.d(t,{FE:()=>x,Tl:()=>d,wn:()=>u});var r=s(93308);let a={},l=r.Xn,n=[];function i(){if("u"<typeof document)return r.Xn;let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${r.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):r.Xn;return(0,r.QC)(t)}async function o(e){if("en"===e){a={};return}try{let t=await fetch(`/i18n/literals/${e}.json`);a=await t.json()}catch(e){console.error("Failed to load translations:",e),a={}}}function d(e){if(!e||"string"!=typeof e)return e;let t=e.trim();return t&&"en"!==l&&a[t]||e}function c(e){if(!e.nodeValue||!e.nodeValue.trim())return;let t=e.parentElement;if(!t)return;let s=t;for(;s;){if(s.hasAttribute&&s.hasAttribute("data-i18n-skip"))return;s=s.parentElement}if(["script","style","code","pre","colgroup","table","thead","tbody","tfoot","tr","select","datalist","optgroup"].includes(t.tagName?.toLowerCase()))return;e._originalText||(e._originalText=e.nodeValue);let r=d(e._originalText);r!==e.nodeValue&&(e.nodeValue=r)}function m(e){let t;if(!e)return;let s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),r=[];for(;t=s.nextNode();)r.push(t);r.forEach(c)}async function x(){l=i(),await o(l),m(document.body),new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE?m(e):e.nodeType===Node.TEXT_NODE&&c(e)})})}).observe(document.body,{childList:!0,subtree:!0})}async function u(){l=i(),await o(l),n.forEach(e=>e()),m(document.body)}},74891:(e,t,s)=>{s.d(t,{default:()=>p});var r=s(95155),a=s(73321),l=s(12115),n=s(98500),i=s.n(n),o=s(14051),d=s.n(o),c=s(57250),m=s(35497),x=s(36548),u=s(90620),h=s(73006);function p({onMenuClick:e,showMenuButton:t=!0}){let s=(0,a.usePathname)(),n=(0,a.useRouter)(),{title:o,description:d,breadcrumbs:f}=(0,l.useMemo)(()=>(e=>{if(!e)return{title:"",description:"",breadcrumbs:[]};let t=e.match(/\/providers\/([^/]+)$/);if(t){let e=t[1],s=u.zN[e]||u.fg[e];if(s)return{title:s.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:s.name,image:`/providers/${s.id}.png`}]}}return e.includes("/providers")?{title:"Providers",description:"Manage your AI provider connections",breadcrumbs:[]}:e.includes("/combos")?{title:"Combos",description:"Model combos with fallback",breadcrumbs:[]}:e.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",breadcrumbs:[]}:e.includes("/mitm")?{title:"MITM Proxy",description:"Intercept CLI tool traffic and route through 9Router",breadcrumbs:[]}:e.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",breadcrumbs:[]}:e.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:e.includes("/profile")?{title:"Settings",description:"Manage your preferences",breadcrumbs:[]}:e.includes("/translator")?{title:"Translator",description:"Debug translation flow between formats",breadcrumbs:[]}:e.includes("/console-log")?{title:"Console Log",description:"Live server console output",breadcrumbs:[]}:"/dashboard"===e?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(s),[s]),b=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(n.push("/login"),n.refresh())}catch(e){console.error("Failed to logout:",e)}};return(0,r.jsxs)("header",{className:"flex items-center justify-between px-8 py-5 border-b border-black/5 dark:border-white/5 bg-bg/80 backdrop-blur-xl z-10 sticky top-0",children:[(0,r.jsx)("div",{className:"flex items-center gap-3 lg:hidden",children:t&&(0,r.jsx)("button",{onClick:e,className:"text-text-main hover:text-primary transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"menu"})})}),(0,r.jsx)("div",{className:"hidden lg:flex flex-col",children:f.length>0?(0,r.jsx)("div",{className:"flex items-center gap-2",children:f.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[t>0&&(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted text-base",children:"chevron_right"}),e.href?(0,r.jsx)(i(),{href:e.href,className:"text-text-muted hover:text-primary transition-colors",children:e.label}):(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[e.image&&(0,r.jsx)(c.A,{src:e.image,alt:e.label,size:28,className:"object-contain rounded max-w-[28px] max-h-[28px]",fallbackText:e.label.slice(0,2).toUpperCase()}),(0,r.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:(0,h.Tl)(e.label)})]})]},`${e.label}-${e.href||"current"}`))}):o?(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:(0,h.Tl)(o)}),d&&(0,r.jsx)("p",{className:"text-sm text-text-muted",children:(0,h.Tl)(d)})]}):null}),(0,r.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,r.jsx)(x.default,{}),(0,r.jsx)(m.c5,{}),(0,r.jsx)(m.UW,{}),(0,r.jsx)("button",{onClick:b,className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-all",title:"Logout",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"logout"})})]})]})}p.propTypes={onMenuClick:d().func,showMenuButton:d().bool}},81127:(e,t,s)=>{s.d(t,{ConfirmModal:()=>o,default:()=>i});var r=s(95155),a=s(12115),l=s(31474),n=s(92542);function i({isOpen:e,onClose:t,title:s,children:n,footer:o,size:d="md",closeOnOverlay:c=!0,showCloseButton:m=!0,className:x}){return((0,a.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,a.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e)?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:c?t:void 0}),(0,r.jsxs)("div",{className:(0,l.cn)("relative w-full bg-surface","border border-black/10 dark:border-white/10","rounded-xl shadow-2xl","animate-in fade-in zoom-in-95 duration-200",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[d],x),children:[(s||m)&&(0,r.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-black/5 dark:border-white/5",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mr-4",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),s&&(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})]}),m&&(0,r.jsx)("button",{onClick:t,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsx)("div",{className:"p-6 max-h-[calc(80vh-140px)] overflow-y-auto",children:n}),o&&(0,r.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-black/5 dark:border-white/5",children:o})]})]}):null}function o({isOpen:e,onClose:t,onConfirm:s,title:a="Confirm",message:l,confirmText:d="Confirm",cancelText:c="Cancel",variant:m="danger",loading:x=!1}){return(0,r.jsx)(i,{isOpen:e,onClose:t,title:a,size:"sm",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.default,{variant:"ghost",onClick:t,disabled:x,children:c}),(0,r.jsx)(n.default,{variant:m,onClick:s,loading:x,children:d})]}),children:(0,r.jsx)("p",{className:"text-text-muted",children:l})})}},84588:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(95155),a=s(31474);function l({children:e,title:t,subtitle:s,icon:n,action:i,padding:o="md",hover:d=!1,className:c,...m}){return(0,r.jsxs)("div",{className:(0,a.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",d&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[o],c),...m,children:[(t||i)&&(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[n&&(0,r.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:n})}),(0,r.jsxs)("div",{children:[t&&(0,r.jsx)("h3",{className:"text-text-main font-semibold",children:t}),s&&(0,r.jsx)("p",{className:"text-sm text-text-muted",children:s})]})]}),i]}),e]})}l.Section=function({children:e,className:t,...s}){return(0,r.jsx)("div",{className:(0,a.cn)("p-4 rounded-lg","bg-black/[0.02] dark:bg-white/[0.02]","border border-black/5 dark:border-white/5",t),...s,children:e})},l.Row=function({children:e,className:t,...s}){return(0,r.jsx)("div",{className:(0,a.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-black/5 dark:border-white/5 last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]",t),...s,children:e})},l.ListItem=function({children:e,actions:t,className:s,...l}){return(0,r.jsxs)("div",{className:(0,a.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]","transition-colors",s),...l,children:[(0,r.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,r.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:t})]})}},90085:(e,t,s)=>{s.d(t,{A:()=>i});var r=s(1934),a=s(31692),l=s(90620);function n(e){let t=document.documentElement,s=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";"dark"===("system"===e?s:e)?t.classList.add("dark"):t.classList.remove("dark")}let i=(0,r.v)((0,a.Zr)((e,t)=>({theme:l.B2.defaultTheme,setTheme:t=>{e({theme:t}),n(t)},toggleTheme:()=>{let s="dark"===t().theme?"light":"dark";e({theme:s}),n(s)},initTheme:()=>{n(t().theme)}}),{name:l.B2.storageKey}))},90620:(e,t,s)=>{s.d(t,{Q2:()=>r.Q2,fg:()=>r.fg,vQ:()=>a,MA:()=>r.MA,UY:()=>n,zN:()=>r.zN,B2:()=>l});var r=s(52679);s(28777);let a={name:"iRouter - Server",description:"Enterprise AI Infrastructure Management",version:"0.3.64-i16"},l={storageKey:"theme",defaultTheme:"system"},n={maxLines:200,pollIntervalMs:1e3}},90882:(e,t,s)=>{s.d(t,{default:()=>d});var r=s(95155),a=s(12115),l=s(14051),n=s.n(l),i=s(35497),o=s(11059);function d({isOpen:e,provider:t,providerInfo:s,onSuccess:l,onClose:n}){let[c,m]=(0,a.useState)("waiting"),[x,u]=(0,a.useState)(null),[h,p]=(0,a.useState)(""),[f,b]=(0,a.useState)(null),[g,j]=(0,a.useState)(!1),[y,v]=(0,a.useState)(null),[N,w]=(0,a.useState)(!1),k=(0,a.useRef)(null),C=(0,a.useRef)(!1),{copied:S,copy:T}=(0,o.C)(),[M,R]=(0,a.useState)(!1),[$,E]=(0,a.useState)("/callback?code=..."),I=(0,a.useRef)(!1);(0,a.useEffect)(()=>{R("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),E(`${window.location.origin}/callback?code=...`)},[]);let D=(0,a.useCallback)(async(e,s)=>{if(x)try{let r=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:x.redirectUri,codeVerifier:x.codeVerifier,state:s})}),a=await r.json();if(!r.ok)throw Error(a.error);m("success"),l?.()}catch(e){b(e.message),m("error")}},[x,t,l]),O=(0,a.useCallback)(async(e,s,r,a)=>{C.current=!1,w(!0);for(let n=0;n<60;n++){if(C.current){console.log("[OAuthModal] Polling aborted"),w(!1);return}if(await new Promise(e=>setTimeout(e,1e3*r)),C.current){console.log("[OAuthModal] Polling aborted after sleep"),w(!1);return}try{let n=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:s,extraData:a})}),i=await n.json();if(i.success){C.current=!0,m("success"),w(!1),l?.();return}if("expired_token"===i.error||"access_denied"===i.error)throw Error(i.errorDescription||i.error);"slow_down"===i.error&&(r=Math.min(r+5,30))}catch(e){b(e.message),m("error"),w(!1);return}}b("Authorization timeout"),m("error"),w(!1)},[t,l]),L=(0,a.useCallback)(async()=>{if(t)try{let e;if(b(null),["github","qwen","kiro","kimi-coding","kilocode"].includes(t)){j(!0),m("waiting");let e=await fetch(`/api/oauth/${t}/device-code`),s=await e.json();if(!e.ok)throw Error(s.error);v(s);let r=s.verification_uri_complete||s.verification_uri;r&&window.open(r,"_blank");let a="kiro"===t?{_clientId:s._clientId,_clientSecret:s._clientSecret}:null;O(s.device_code,s.codeVerifier,s.interval||5,a);return}if("codex"===t)e="http://localhost:1455/auth/callback";else{let t=window.location.port||("https:"===window.location.protocol?"443":"80");e=`http://localhost:${t}/callback`}let s=await fetch(`/api/oauth/${t}/authorize?redirect_uri=${encodeURIComponent(e)}`),r=await s.json();if(!s.ok)throw Error(r.error);u({...r,redirectUri:e}),"codex"!==t&&M?(m("waiting"),k.current=window.open(r.authUrl,"oauth_popup","width=600,height=700"),k.current||m("input")):(m("input"),window.open(r.authUrl,"_blank"))}catch(e){b(e.message),m("error")}},[t,M,O]);(0,a.useEffect)(()=>{e&&t?(u(null),p(""),b(null),j(!1),v(null),w(!1),C.current=!1,L()):e||(C.current=!0)},[e,t,L]),(0,a.useEffect)(()=>{let e;if(!x)return;I.current=!1;let t=async e=>{if(I.current)return;let{code:t,state:s,error:r,errorDescription:a}=e;if(r){I.current=!0,b(a||r),m("error");return}t&&(I.current=!0,await D(t,s))},s=e=>{let s=e.origin.includes("localhost")||e.origin.includes("127.0.0.1"),r=e.origin===window.location.origin;(s||r)&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",s);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){console.log("BroadcastChannel not supported")}let r=e=>{if("oauth_callback"===e.key&&e.newValue)try{let s=JSON.parse(e.newValue);t(s),localStorage.removeItem("oauth_callback")}catch(e){console.log("Failed to parse localStorage data")}};window.addEventListener("storage",r);try{let e=localStorage.getItem("oauth_callback");if(e){let s=JSON.parse(e);s.timestamp&&Date.now()-s.timestamp<3e4&&t(s),localStorage.removeItem("oauth_callback")}}catch{}return()=>{window.removeEventListener("message",s),window.removeEventListener("storage",r),e&&e.close()}},[x,D]);let z=async()=>{try{b(null);let e=new URL(h),t=e.searchParams.get("code"),s=e.searchParams.get("state"),r=e.searchParams.get("error");if(r)throw Error(e.searchParams.get("error_description")||r);if(!t)throw Error("No authorization code found in URL");await D(t,s)}catch(e){b(e.message),m("error")}},_=(0,a.useCallback)(()=>{n()},[n]);return t&&s?(0,r.jsx)(i.aF,{isOpen:e,title:`Connect ${s.name}`,onClose:_,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["waiting"===c&&!g&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Waiting for Authorization"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Complete the authorization in the popup window."}),(0,r.jsx)(i.$n,{variant:"ghost",onClick:()=>m("input"),children:"Popup blocked? Enter URL manually"})]}),"waiting"===c&&g&&y&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"text-center py-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the URL below and enter the code:"}),(0,r.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Verification URL"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("code",{className:"flex-1 text-sm break-all",children:y.verification_uri}),(0,r.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"verify_url"===S?"check":"content_copy",onClick:()=>T(y.verification_uri,"verify_url")})]})]}),(0,r.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:y.user_code}),(0,r.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"user_code"===S?"check":"content_copy",onClick:()=>T(y.user_code,"user_code")})]})]})]}),N&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"input"===c&&!g&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.pd,{value:x?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(i.$n,{variant:"secondary",icon:"auth_url"===S?"check":"content_copy",onClick:()=>T(x?.authUrl,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser."}),(0,r.jsx)(i.pd,{value:h,onChange:e=>p(e.target.value),placeholder:$,className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:z,fullWidth:!0,disabled:!h,children:"Connect"}),(0,r.jsx)(i.$n,{onClick:_,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===c&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",s.name," account has been connected."]}),(0,r.jsx)(i.$n,{onClick:_,fullWidth:!0,children:"Done"})]}),"error"===c&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:f}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:L,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(i.$n,{onClick:_,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}d.propTypes={isOpen:n().bool.isRequired,provider:n().string,providerInfo:n().shape({name:n().string}),onSuccess:n().func,onClose:n().func.isRequired}},91450:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(95155),a=s(14051),l=s.n(a),n=s(38587);function i({children:e}){return(0,r.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,r.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,r.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,r.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,r.jsx)(n.default,{variant:"card"})}),(0,r.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}i.propTypes={children:l().node.isRequired}},92173:(e,t,s)=>{s.d(t,{default:()=>c});var r=s(95155),a=s(98500),l=s.n(a),n=s(90620);let i=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],d=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function c(){return(0,r.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,r.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,r.jsx)("div",{className:"size-6 text-primary",children:(0,r.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,r.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,r.jsx)("span",{className:"text-xl font-bold text-text-main",children:n.vQ.name})]}),(0,r.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:d.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,r.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",n.vQ.name," Inc. All rights reserved."]}),(0,r.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,r.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,r.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},92542:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(95155),a=s(31474);let l={primary:"bg-gradient-to-b from-primary to-primary-hover text-white shadow-sm",secondary:"bg-white dark:bg-white/10 border border-black/10 dark:border-white/10 text-text-main hover:bg-black/5 dark:hover:bg-white/5",outline:"border border-black/15 dark:border-white/15 text-text-main hover:bg-black/5",ghost:"text-text-muted hover:bg-black/5 dark:hover:bg-white/5 hover:text-text-main",danger:"bg-red-500 text-white hover:bg-red-600 shadow-sm"},n={sm:"h-7 px-3 text-xs rounded-md",md:"h-9 px-4 text-sm rounded-lg",lg:"h-11 px-6 text-sm rounded-lg"};function i({children:e,variant:t="primary",size:s="md",icon:o,iconRight:d,disabled:c=!1,loading:m=!1,fullWidth:x=!1,className:u,...h}){return(0,r.jsxs)("button",{className:(0,a.cn)("inline-flex items-center justify-center gap-2 font-medium transition-all duration-200 cursor-pointer","active:scale-[0.99] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",l[t],n[s],x&&"w-full",u),disabled:c||m,...h,children:[m?(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):o?(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o}):null,e,d&&!m&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:d})]})}},92622:(e,t,s)=>{s.d(t,{default:()=>b});var r=s(95155),a=s(12115),l=s(14051),n=s.n(l),i=s(98500),o=s.n(i),d=s(73321),c=s(31474),m=s(90620),x=s(92542),u=s(81127);let h=[{href:"/dashboard/employees",label:"E Dashboard",icon:"badge"},{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combos",icon:"layers"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/mitm",label:"MITM",icon:"security"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],p=[{href:"/dashboard/console-log",label:"Console Log",icon:"terminal"}],f=[{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/profile",label:"Settings",icon:"settings"}];function b({onClose:e}){let t=(0,d.usePathname)(),[s,l]=(0,a.useState)(!1),[n,i]=(0,a.useState)(!1),[g,j]=(0,a.useState)(!1),[y,v]=(0,a.useState)(null),[N,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(!1);(0,a.useEffect)(()=>{"true"===localStorage.getItem("sidebarCollapsed")&&C(!0)},[]),(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{e.enableTranslator&&w(!0)}).catch(()=>{})},[]),(0,a.useEffect)(()=>{fetch("/api/version").then(e=>e.json()).then(e=>{e.hasUpdate&&v(e)}).catch(()=>{})},[]);let S=e=>"/dashboard/endpoint"===e?"/dashboard"===t||t.startsWith("/dashboard/endpoint"):t.startsWith(e),T=async()=>{i(!0);try{await fetch("/api/shutdown",{method:"POST"})}catch(e){}i(!1),l(!1),j(!0)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("aside",{className:(0,c.cn)("flex flex-col border-r border-black/5 dark:border-white/5 bg-vibrancy backdrop-blur-xl transition-[width] duration-300 min-h-full relative overflow-hidden",k?"w-[72px]":"w-72"),children:[(0,r.jsx)("button",{onClick:()=>{C(e=>{let t=!e;return localStorage.setItem("sidebarCollapsed",String(t)),t})},className:(0,c.cn)("absolute z-10 p-1.5 rounded-lg text-text-muted hover:bg-surface/50 hover:text-text-main transition-all hidden lg:flex items-center justify-center bg-bg/80 backdrop-blur-md border border-black/5 dark:border-white/5 shadow-sm",k?"top-4 left-1/2 -translate-x-1/2":"top-4 right-4"),title:k?"Expand sidebar":"Collapse sidebar",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:k?"keyboard_double_arrow_right":"keyboard_double_arrow_left"})}),(0,r.jsxs)("div",{className:(0,c.cn)("flex items-center gap-2 transition-all duration-300",k?"px-0 h-0 pt-0 pb-0 opacity-0 overflow-hidden":"px-6 pt-5 pb-2 opacity-100"),children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56] shrink-0"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E] shrink-0"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F] shrink-0"})]}),(0,r.jsxs)("div",{className:(0,c.cn)("py-4 flex flex-col gap-2 transition-all duration-300",k?"px-0 items-center mt-[52px]":"px-6"),children:[(0,r.jsxs)(o(),{href:"/dashboard",className:(0,c.cn)("flex items-center",k?"justify-center":"gap-3"),children:[(0,r.jsx)("img",{src:"/favicon.svg",alt:"iRouter",className:"size-9 rounded shrink-0"}),!k&&(0,r.jsxs)("div",{className:"flex flex-col whitespace-nowrap overflow-hidden opacity-100 transition-opacity duration-300",children:[(0,r.jsx)("h1",{className:"text-lg font-semibold tracking-tight text-text-main",children:m.vQ.name}),(0,r.jsxs)("span",{className:"text-xs text-text-muted",children:["v",m.vQ.version]})]})]}),y&&!k&&(0,r.jsxs)("div",{className:"flex flex-col gap-0.5 whitespace-nowrap overflow-hidden opacity-100 transition-opacity duration-300",children:[(0,r.jsxs)("span",{className:"text-xs font-semibold text-green-600 dark:text-amber-500",children:["↑ New version available: v",y.latestVersion]}),(0,r.jsx)("code",{className:"text-[10px] text-green-600/80 dark:text-amber-400/70 font-mono select-all overflow-hidden text-ellipsis",children:"npm install -g 9router@latest"})]})]}),(0,r.jsxs)("nav",{className:(0,c.cn)("flex-1 py-4 space-y-1 overflow-y-auto custom-scrollbar",k?"px-2":"px-4"),children:[h.map(t=>(0,r.jsxs)(o(),{href:t.href,onClick:e,title:k?t.label:void 0,className:(0,c.cn)("flex items-center py-2.5 rounded-lg transition-all group",k?"px-0 justify-center":"gap-3 px-4",S(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px] shrink-0",S(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),!k&&(0,r.jsx)("span",{className:"text-sm font-medium whitespace-nowrap overflow-hidden text-ellipsis",children:t.label})]},t.href)),(0,r.jsxs)("div",{className:(0,c.cn)("pt-4 mt-2",k?"border-t border-black/5 dark:border-white/5 mx-2":"mx-1"),children:[!k&&(0,r.jsx)("p",{className:"px-3 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"Debug"}),N&&(0,r.jsxs)(o(),{href:"/dashboard/translator",onClick:e,title:k?"Translator":void 0,className:(0,c.cn)("flex items-center py-2.5 rounded-lg transition-all group",k?"px-0 justify-center":"gap-3 px-3",S("/dashboard/translator")?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px] shrink-0",S("/dashboard/translator")?"fill-1":"group-hover:text-primary transition-colors"),children:"translate"}),!k&&(0,r.jsx)("span",{className:"text-sm font-medium whitespace-nowrap overflow-hidden text-ellipsis",children:"Translator"})]}),p.map(t=>(0,r.jsxs)(o(),{href:t.href,onClick:e,title:k?t.label:void 0,className:(0,c.cn)("flex items-center py-2.5 rounded-lg transition-all group",k?"px-0 justify-center":"gap-3 px-3",S(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px] shrink-0",S(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),!k&&(0,r.jsx)("span",{className:"text-sm font-medium whitespace-nowrap overflow-hidden text-ellipsis",children:t.label})]},t.href))]}),(0,r.jsxs)("div",{className:(0,c.cn)("pt-4 mt-2",k?"border-t border-black/5 dark:border-white/5 mx-2":"mx-1"),children:[!k&&(0,r.jsx)("p",{className:"px-3 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"System"}),f.map(t=>(0,r.jsxs)(o(),{href:t.href,onClick:e,title:k?t.label:void 0,className:(0,c.cn)("flex items-center py-2.5 rounded-lg transition-all group",k?"px-0 justify-center":"gap-3 px-3",S(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px] shrink-0",S(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),!k&&(0,r.jsx)("span",{className:"text-sm font-medium whitespace-nowrap overflow-hidden text-ellipsis",children:t.label})]},t.href))]})]}),(0,r.jsxs)("div",{className:(0,c.cn)("p-3 border-t border-black/5 dark:border-white/5",k?"px-2":"p-3"),children:[!k&&(0,r.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-surface/50 mb-2 overflow-hidden transition-all duration-300",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-6 rounded-md bg-blue-500/10 text-blue-500 shrink-0 mt-0.5",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"})}),(0,r.jsx)("div",{className:"flex flex-col",children:(0,r.jsx)("span",{className:"text-xs font-medium text-text-main leading-relaxed",children:"Service is running in terminal. You can close this web page. Shutdown will stop the service."})})]}),(0,r.jsx)(x.default,{variant:"outline",fullWidth:!k,icon:"power_settings_new",onClick:()=>l(!0),className:(0,c.cn)("text-red-500 border-red-200 hover:bg-red-50 hover:border-red-300 transition-all",k?"p-2 w-full flex flex-col items-center justify-center aspect-square shadow-sm [&_span]:!mr-0 [&_span]:!text-[20px]":"shadow-sm"),title:k?"Shutdown":void 0,children:!k&&"Shutdown"})]})]}),(0,r.jsx)(u.ConfirmModal,{isOpen:s,onClose:()=>l(!1),onConfirm:T,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:n}),g&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"text-center p-8",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-16 rounded-full bg-red-500/20 text-red-500 mx-auto mb-4",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"power_off"})}),(0,r.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Server Disconnected"}),(0,r.jsx)("p",{className:"text-text-muted mb-6",children:"The proxy server has been stopped."}),(0,r.jsx)(x.default,{variant:"secondary",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]})})]})}b.propTypes={onClose:n().func}},93308:(e,t,s)=>{s.d(t,{CL:()=>l,QC:()=>n,Xn:()=>a,YZ:()=>r});let r=["en","vi","zh-CN","zh-TW","ja","pt-BR","pt-PT","ko","es","de","fr","he","ar","ru","pl","cs","nl","tr","uk","tl","id","th","hi","bn","ur","ro","sv","it","el","hu","fi","da","no"],a="en",l="locale";function n(e){return"zh"===e||"zh-CN"===e?"zh-CN":"en"===e?"en":"vi"===e?"vi":"zh-TW"===e?"zh-TW":"ja"===e?"ja":"pt-BR"===e?"pt-BR":"pt-PT"===e?"pt-PT":"ko"===e?"ko":"es"===e?"es":"de"===e?"de":"fr"===e?"fr":"he"===e?"he":"ar"===e?"ar":"ru"===e?"ru":"pl"===e?"pl":"cs"===e?"cs":"nl"===e?"nl":"tr"===e?"tr":"uk"===e?"uk":"tl"===e?"tl":"id"===e?"id":"th"===e?"th":"hi"===e?"hi":"bn"===e?"bn":"ur"===e?"ur":"ro"===e?"ro":"sv"===e?"sv":"it"===e?"it":"el"===e?"el":"hu"===e?"hu":"fi"===e?"fi":"da"===e?"da":"no"===e?"no":a}},93927:(e,t,s)=>{s.d(t,{default:()=>z});var r=s(95155),a=s(12115),l=s(73321),n=s(56061),i=s(84588),o=s(14051),d=s.n(o);let c=e=>new Intl.NumberFormat().format(e||0);function m({stats:e}){let t;return(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,r.jsxs)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,r.jsx)("span",{className:"text-2xl font-bold",children:c(e.totalRequests)})]}),(0,r.jsxs)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,r.jsx)("span",{className:"text-2xl font-bold text-primary",children:c(e.totalPromptTokens)})]}),(0,r.jsxs)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,r.jsx)("span",{className:"text-2xl font-bold text-success",children:c(e.totalCompletionTokens)})]}),(0,r.jsxs)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Est. Cost"}),(0,r.jsxs)("span",{className:"text-2xl font-bold text-warning",children:["~",(t=e.totalCost,`$${(t||0).toFixed(2)}`)]}),(0,r.jsx)("span",{className:"text-[10px] text-text-muted",children:"Estimated, not actual billing"})]})]})}m.propTypes={stats:d().object.isRequired};let x=e=>new Intl.NumberFormat().format(e||0),u=e=>`$${(e||0).toFixed(2)}`;function h(e){if(!e)return"Never";let t=Math.floor((Date.now()-new Date(e))/6e4);return t<1?"Just now":t<60?`${t}m ago`:t<1440?`${Math.floor(t/60)}h ago`:new Date(e).toLocaleDateString()}function p({field:e,currentSort:t,currentOrder:s}){return t!==e?(0,r.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,r.jsx)("span",{className:"ml-1",children:"asc"===s?"↑":"↓"})}function f({item:e,viewMode:t,isSummary:s=!1}){return"tokens"===t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:s&&void 0===e.promptTokens?"—":x(e.promptTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:s&&void 0===e.completionTokens?"—":x(e.completionTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:x(e.totalTokens)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:s&&void 0===e.inputCost?"—":u(e.inputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:s&&void 0===e.outputCost?"—":u(e.outputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:u(e.totalCost||e.cost)})]})}function b({title:e,columns:t,groupedData:s,tableType:l,sortBy:n,sortOrder:o,onToggleSort:d,viewMode:c,storageKey:m,renderDetailCells:x,renderSummaryCells:u,emptyMessage:h}){let[g,j]=(0,a.useState)(new Set);(0,a.useEffect)(()=>{try{let e=localStorage.getItem(m);e&&j(new Set(JSON.parse(e)))}catch(e){console.error(`Failed to load ${m}:`,e)}},[m]),(0,a.useEffect)(()=>{try{localStorage.setItem(m,JSON.stringify([...g]))}catch(e){console.error(`Failed to save ${m}:`,e)}},[g,m]);let y=(0,a.useCallback)(e=>{j(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),v=(0,a.useMemo)(()=>"tokens"===c?[{field:"promptTokens",label:"Input Tokens"},{field:"completionTokens",label:"Output Tokens"},{field:"totalTokens",label:"Total Tokens"}]:[{field:"promptTokens",label:"Input Cost"},{field:"completionTokens",label:"Output Cost"},{field:"cost",label:"Total Cost"}],[c]),N=t.length+v.length;return(0,r.jsxs)(i.default,{className:"overflow-hidden",children:[(0,r.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,r.jsx)("h3",{className:"font-semibold",children:e})}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,r.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,r.jsxs)("tr",{children:[t.map(e=>(0,r.jsxs)("th",{className:`px-6 py-3 cursor-pointer hover:bg-bg-subtle/50 ${"right"===e.align?"text-right":""}`,onClick:()=>d(l,e.field),children:[e.label," ",(0,r.jsx)(p,{field:e.field,currentSort:n,currentOrder:o})]},e.field)),v.map(e=>(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>d(l,e.field),children:[e.label," ",(0,r.jsx)(p,{field:e.field,currentSort:n,currentOrder:o})]},e.field))]})}),(0,r.jsxs)("tbody",{className:"divide-y divide-border",children:[s.map(e=>(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>y(e.groupKey),children:[(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${g.has(e.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,r.jsx)("span",{className:`font-medium transition-colors ${e.summary.pending>0?"text-primary":""}`,children:e.groupKey})]})}),u(e),(0,r.jsx)(f,{item:e.summary,viewMode:c,isSummary:!0})]}),g.has(e.groupKey)&&e.items.map(e=>(0,r.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[x(e),(0,r.jsx)(f,{item:e,viewMode:c})]},`detail-${e.key}`))]},e.groupKey)),0===s.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:N,className:"px-6 py-8 text-center text-text-muted",children:h})})]})]})})]})}p.propTypes={field:d().string.isRequired,currentSort:d().string.isRequired,currentOrder:d().string.isRequired},f.propTypes={item:d().object.isRequired,viewMode:d().string.isRequired,isSummary:d().bool},b.propTypes={title:d().string.isRequired,columns:d().arrayOf(d().shape({field:d().string.isRequired,label:d().string.isRequired,align:d().string})).isRequired,groupedData:d().array.isRequired,tableType:d().string.isRequired,sortBy:d().string.isRequired,sortOrder:d().string.isRequired,onToggleSort:d().func.isRequired,viewMode:d().string.isRequired,storageKey:d().string.isRequired,renderDetailCells:d().func.isRequired,renderSummaryCells:d().func.isRequired,emptyMessage:d().string.isRequired};var g=s(81750),j=s(6793);s(53255);var y=s(52679);function v({data:e}){let{label:t,color:s,imageUrl:l,textIcon:n,active:i}=e,[o,d]=(0,a.useState)(!1);return(0,r.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-2.5 rounded-lg border-2 transition-all duration-300 bg-bg",style:{borderColor:i?s:"var(--color-border)",boxShadow:i?`0 0 16px ${s}40`:"none",minWidth:"150px"},children:[(0,r.jsx)(g.h7,{type:"target",position:j.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)(g.h7,{type:"target",position:j.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)(g.h7,{type:"target",position:j.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)(g.h7,{type:"target",position:j.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)("div",{className:"w-8 h-8 rounded-md flex items-center justify-center shrink-0",style:{backgroundColor:`${s}15`},children:o?(0,r.jsx)("span",{className:"text-sm font-bold",style:{color:s},children:n}):(0,r.jsx)("img",{src:l,alt:t,className:"w-6 h-6 rounded-sm object-contain",onError:()=>d(!0)})}),(0,r.jsx)("span",{className:"text-base font-medium truncate",style:{color:i?s:"var(--color-text)"},children:t}),i&&(0,r.jsxs)("span",{className:"relative flex h-2 w-2 shrink-0",children:[(0,r.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:s}}),(0,r.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2",style:{backgroundColor:s}})]})]})}function N({data:e}){return(0,r.jsxs)("div",{className:"flex items-center justify-center px-5 py-3 rounded-xl border-2 border-primary bg-primary/5 shadow-md min-w-[130px]",children:[(0,r.jsx)(g.h7,{type:"source",position:j.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)(g.h7,{type:"source",position:j.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)(g.h7,{type:"source",position:j.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)(g.h7,{type:"source",position:j.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)("img",{src:"/favicon.svg",alt:"iRouter",className:"w-6 h-6 mr-2"}),(0,r.jsx)("span",{className:"text-sm font-bold text-primary",children:"iRouter"}),e.activeCount>0&&(0,r.jsx)("span",{className:"ml-2 px-1.5 py-0.5 rounded-full bg-primary text-white text-xs font-bold",children:e.activeCount})]})}v.propTypes={data:d().object.isRequired},N.propTypes={data:d().object.isRequired};let w={provider:v,router:N};function k({providers:e=[],activeRequests:t=[],lastProvider:s="",errorProvider:l=""}){let n=(0,a.useMemo)(()=>t.map(e=>e.provider?.toLowerCase()).filter(Boolean).sort().join(","),[t]),i=s?.toLowerCase()||"",o=l?.toLowerCase()||"",d=(0,a.useMemo)(()=>new Set(n?n.split(","):[]),[n]),c=(0,a.useMemo)(()=>new Set(i?[i]:[]),[i]),m=(0,a.useMemo)(()=>new Set(o?[o]:[]),[o]),{nodes:x,edges:u}=(0,a.useMemo)(()=>(function(e,t,s,r){let a=e.length,l=Math.max(320,204*a/(2*Math.PI)),n=Math.max(200,.55*l);if(0===a)return{nodes:[{id:"router",type:"router",position:{x:0,y:0},data:{activeCount:0},draggable:!1}],edges:[]};let i=[],o=[];return i.push({id:"router",type:"router",position:{x:-60,y:-22},data:{activeCount:t.size},draggable:!1}),e.forEach((e,d)=>{var c,m;let x,u,h=(c=e.provider,y.Q2[c]||{color:"#6b7280",name:c}),p=t.has(e.provider?.toLowerCase()),f=!p&&s.has(e.provider?.toLowerCase()),b=!p&&r.has(e.provider?.toLowerCase()),g=`provider-${e.provider}`,j={label:(h.name!==e.provider?h.name:null)||e.name||e.provider,color:h.color||"#6b7280",imageUrl:(m=e.provider,`/providers/${m}.png`),textIcon:h.textIcon||(e.provider||"?").slice(0,2).toUpperCase(),active:p},v=-Math.PI/2+2*Math.PI*d/a,N=l*Math.cos(v),w=n*Math.sin(v);Math.abs(v+Math.PI/2)<Math.PI/4||Math.abs(v-3*Math.PI/2)<Math.PI/4?(x="top",u="bottom"):Math.abs(v-Math.PI/2)<Math.PI/4?(x="bottom",u="top"):N>0?(x="right",u="left"):(x="left",u="right"),i.push({id:g,type:"provider",position:{x:N-90,y:w-15},data:j,draggable:!1}),o.push({id:`e-${g}`,source:"router",sourceHandle:x,target:g,targetHandle:u,animated:p,style:(h.color,b?{stroke:"#ef4444",strokeWidth:2.5,opacity:.9}:p?{stroke:"#22c55e",strokeWidth:2.5,opacity:.9}:f?{stroke:"#f59e0b",strokeWidth:2,opacity:.7}:{stroke:"var(--color-border)",strokeWidth:1,opacity:.3})})}),{nodes:i,edges:o}})(e,d,c,m),[e,n,i,o]),h=(0,a.useMemo)(()=>e.map(e=>e.provider).sort().join(","),[e]),p=(0,a.useRef)(null),f=(0,a.useCallback)(e=>{p.current=e,setTimeout(()=>e.fitView({padding:.3}),50)},[]);return(0,r.jsx)("div",{className:"w-full rounded-lg border border-border bg-bg-subtle/30",style:{height:480},children:0===e.length?(0,r.jsx)("div",{className:"h-full flex items-center justify-center text-text-muted text-sm",children:"No providers connected"}):(0,r.jsx)(g.Gc,{nodes:x,edges:u,nodeTypes:w,fitView:!0,fitViewOptions:{padding:.3},onInit:f,proOptions:{hideAttribution:!0},panOnDrag:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1},h)})}k.propTypes={providers:d().arrayOf(d().shape({id:d().string,provider:d().string,name:d().string})),activeRequests:d().arrayOf(d().shape({provider:d().string,model:d().string,account:d().string})),lastProvider:d().string,errorProvider:d().string};var C=s(10124);function S({timestamp:e}){let t,[,s]=(0,a.useState)(0);return(0,a.useEffect)(()=>{let e=setInterval(()=>s(e=>e+1),1e3);return()=>clearInterval(e)},[]),(0,r.jsx)(r.Fragment,{children:(t=Math.floor((Date.now()-new Date(e))/1e3))<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`})}function T({requests:e=[]}){return(0,r.jsxs)(i.default,{className:"flex flex-col overflow-hidden",padding:"sm",style:{height:480},children:[(0,r.jsx)("div",{className:"px-1 py-2 border-b border-border shrink-0",children:(0,r.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:"Recent Requests"})}),e.length?(0,r.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,r.jsxs)("table",{className:"w-full text-xs border-collapse",children:[(0,r.jsx)("thead",{className:"sticky top-0 bg-bg z-10",children:(0,r.jsxs)("tr",{className:"border-b border-border",children:[(0,r.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted w-2"}),(0,r.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted",children:"Model"}),(0,r.jsx)("th",{className:"py-1.5 pl-3 text-left font-semibold text-text-muted",children:"API Key"}),(0,r.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted whitespace-nowrap",children:"In / Out"}),(0,r.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted",children:"When"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border/50",children:e.map((e,t)=>{let s=!e.status||"ok"===e.status||"success"===e.status;return(0,r.jsxs)("tr",{className:"hover:bg-bg-subtle transition-colors",children:[(0,r.jsx)("td",{className:"py-1.5",children:(0,r.jsx)("span",{className:`block w-1.5 h-1.5 rounded-full ${s?"bg-success":"bg-error"}`})}),(0,r.jsx)("td",{className:"py-1.5 font-mono truncate max-w-[120px]",title:e.model,children:e.model}),(0,r.jsx)("td",{className:"py-1.5 pl-3 truncate max-w-[100px] text-secondary",title:e.keyName,children:e.keyName||"—"}),(0,r.jsxs)("td",{className:"py-1.5 text-right whitespace-nowrap",children:[(0,r.jsxs)("span",{className:"text-primary",children:[x(e.promptTokens),"↑"]})," ",(0,r.jsxs)("span",{className:"text-success",children:[x(e.completionTokens),"↓"]})]}),(0,r.jsx)("td",{className:"py-1.5 text-right text-text-muted whitespace-nowrap",children:(0,r.jsx)(S,{timestamp:e.timestamp})})]},t)})})]})}):(0,r.jsx)("div",{className:"flex-1 flex items-center justify-center text-text-muted text-sm",children:"No requests yet."})]})}function M(e,t={},s,r){return Object.entries(e||{}).map(([e,s])=>{let r=(s.promptTokens||0)+(s.completionTokens||0),a=s.cost||0,l=r>0?(s.promptTokens||0)*(a/r):0,n=r>0?(s.completionTokens||0)*(a/r):0;return{...s,key:e,totalTokens:r,totalCost:a,inputCost:l,outputCost:n,pending:t[e]||0}}).sort((e,t)=>{let a=e[s],l=t[s];return("string"==typeof a&&(a=a.toLowerCase()),"string"==typeof l&&(l=l.toLowerCase()),a<l)?"asc"===r?-1:1:a>l?"asc"===r?1:-1:0})}function R(e,t){if(!Array.isArray(e))return[];let s={};return e.forEach(e=>{let r=function(e,t){switch(t){case"rawModel":return e.rawModel||"Unknown Model";case"accountName":return e.accountName||`Account ${e.connectionId?.slice(0,8)}...`||"Unknown Account";case"keyName":return e.keyName||"Unknown Key";case"endpoint":return e.endpoint||"Unknown Endpoint";default:return e[t]||"Unknown"}}(e,t);s[r]||(s[r]={groupKey:r,summary:{requests:0,promptTokens:0,completionTokens:0,totalTokens:0,cost:0,inputCost:0,outputCost:0,lastUsed:null,pending:0},items:[]});let a=s[r].summary;a.requests+=e.requests||0,a.promptTokens+=e.promptTokens||0,a.completionTokens+=e.completionTokens||0,a.totalTokens+=e.totalTokens||0,a.cost+=e.cost||0,a.inputCost+=e.inputCost||0,a.outputCost+=e.outputCost||0,a.pending+=e.pending||0,e.lastUsed&&(!a.lastUsed||new Date(e.lastUsed)>new Date(a.lastUsed))&&(a.lastUsed=e.lastUsed),s[r].items.push(e)}),Object.values(s)}let $=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],E=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"accountName",label:"Account"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],I=[{field:"keyName",label:"API Key Name"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],D=[{field:"endpoint",label:"Endpoint"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],O=[{value:"model",label:"Usage by Model"},{value:"account",label:"Usage by Account"},{value:"apiKey",label:"Usage by API Key"},{value:"endpoint",label:"Usage by Endpoint"}],L=[{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function z(){let e=(0,l.useRouter)(),t=(0,l.useSearchParams)(),s=t.get("sortBy")||"rawModel",i=t.get("sortOrder")||"asc",[o,d]=(0,a.useState)(null),[c,u]=(0,a.useState)(!0),[p,f]=(0,a.useState)(!1),[g,j]=(0,a.useState)("model"),[y,v]=(0,a.useState)([]),[N,w]=(0,a.useState)("7d");(0,a.useEffect)(()=>{fetch("/api/providers").then(e=>e.ok?e.json():null).then(e=>{if(!e?.connections)return;let t=new Set;v(e.connections.filter(e=>!t.has(e.provider)&&(t.add(e.provider),!0)))}).catch(()=>{})},[]),(0,a.useEffect)(()=>{o?f(!0):u(!0),fetch(`/api/usage/stats?period=${N}`).then(e=>e.ok?e.json():null).then(e=>{e&&d(t=>({...t,...e}))}).catch(()=>{}).finally(()=>{u(!1),f(!1)})},[N]),(0,a.useEffect)(()=>{let e=new EventSource("/api/usage/stream");return e.onmessage=e=>{try{let t=JSON.parse(e.data);d(e=>e?{...e,activeRequests:t.activeRequests,recentRequests:t.recentRequests,errorProvider:t.errorProvider,pending:t.pending}:t),u(!1)}catch(e){console.error("[SSE CLIENT] parse error:",e)}},e.onerror=()=>u(!1),()=>e.close()},[]);let S=(0,a.useCallback)((s,r)=>{let a=new URLSearchParams(t.toString());a.get("sortBy")===r?a.set("sortOrder","asc"===a.get("sortOrder")?"desc":"asc"):(a.set("sortBy",r),a.set("sortOrder","asc")),e.replace(`?${a.toString()}`,{scroll:!1})},[t,e]),z=(0,a.useMemo)(()=>{if(!o)return null;switch(g){case"model":{let e=o.pending?.byModel||{};return{columns:$,groupedData:R(M(o.byModel,e,s,i),"rawModel"),storageKey:"usage-stats:expanded-models",emptyMessage:"No usage recorded yet.",renderSummaryCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.summary.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.summary.lastUsed)})]}),renderDetailCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(n.default,{variant:e.pending>0?"primary":"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.lastUsed)})]})}}case"account":{let e={};return o?.pending?.byAccount&&Object.entries(o.byAccount||{}).forEach(([t,s])=>{let r=o.pending.byAccount[s.connectionId];if(r){let a=s.provider?`${s.rawModel} (${s.provider})`:s.rawModel;e[t]=r[a]||0}}),{columns:E,groupedData:R(M(o.byAccount,e,s,i),"accountName"),storageKey:"usage-stats:expanded-accounts",emptyMessage:"No account-specific usage recorded yet.",renderSummaryCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.summary.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.summary.lastUsed)})]}),renderDetailCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.accountName||`Account ${e.connectionId?.slice(0,8)}...`}),(0,r.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(n.default,{variant:e.pending>0?"primary":"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.lastUsed)})]})}}case"apiKey":return{columns:I,groupedData:R(M(o.byApiKey,{},s,i),"keyName"),storageKey:"usage-stats:expanded-apikeys",emptyMessage:"No API key usage recorded yet.",renderSummaryCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.summary.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.summary.lastUsed)})]}),renderDetailCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 font-medium",children:e.keyName}),(0,r.jsx)("td",{className:"px-6 py-3",children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(n.default,{variant:"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.lastUsed)})]})};default:return{columns:D,groupedData:R(M(o.byEndpoint,{},s,i),"endpoint"),storageKey:"usage-stats:expanded-endpoints",emptyMessage:"No endpoint usage recorded yet.",renderSummaryCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.summary.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.summary.lastUsed)})]}),renderDetailCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 font-medium font-mono text-sm",children:e.endpoint}),(0,r.jsx)("td",{className:"px-6 py-3",children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(n.default,{variant:"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.lastUsed)})]})}}},[o,g,s,i]);if(!o&&!c)return(0,r.jsx)("div",{className:"text-text-muted",children:"Failed to load usage statistics."});let _=(0,r.jsx)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] animate-spin",children:"progress_activity"})});return(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 self-end",children:[(0,r.jsx)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border",children:L.map(e=>(0,r.jsx)("button",{onClick:()=>w(e.value),disabled:p,className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${N===e.value?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:e.label},e.value))}),p&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted animate-spin",children:"progress_activity"})]}),c?_:(0,r.jsx)(m,{stats:o}),c?_:(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] gap-2 items-stretch",children:[(0,r.jsx)(k,{providers:y,activeRequests:o.activeRequests||[],lastProvider:o.recentRequests?.[0]?.provider||"",errorProvider:o.errorProvider||""}),(0,r.jsx)(T,{requests:o.recentRequests||[]})]}),c?_:(0,r.jsx)(C.A,{period:N}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-between",children:(0,r.jsx)("select",{value:g,onChange:e=>j(e.target.value),className:"px-3 py-1.5 rounded-lg border border-border bg-bg-subtle text-sm font-medium text-text focus:outline-none focus:ring-2 focus:ring-primary/50",children:O.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})}),c?_:z&&(0,r.jsx)(b,{title:"",columns:z.columns,groupedData:z.groupedData,tableType:g,sortBy:s,sortOrder:i,onToggleSort:S,storageKey:z.storageKey,renderSummaryCells:z.renderSummaryCells,renderDetailCells:z.renderDetailCells,emptyMessage:z.emptyMessage})]})]})}},94230:(e,t,s)=>{s.d(t,{default:()=>d});var r=s(95155),a=s(12115),l=s(14051),n=s.n(l),i=s(35497),o=s(11059);function d({isOpen:e,provider:t,onSuccess:s,onClose:l}){let[n,c]=(0,a.useState)("loading"),[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(null),[p,f]=(0,a.useState)(""),[b,g]=(0,a.useState)(null),{copied:j,copy:y}=(0,o.C)();(0,a.useEffect)(()=>{e&&t&&(async()=>{try{g(null),c("loading");let e=await fetch(`/api/oauth/kiro/social-authorize?provider=${t}`),s=await e.json();if(!e.ok)throw Error(s.error);h(s),x(s.authUrl),c("input"),window.open(s.authUrl,"_blank")}catch(e){g(e.message),c("error")}})()},[e,t]);let v=async()=>{try{let e;g(null);try{e=new URL(p)}catch(e){throw Error("Invalid callback URL format")}let r=e.searchParams.get("code");e.searchParams.get("state");let a=e.searchParams.get("error");if(a)throw Error(e.searchParams.get("error_description")||a);if(!r)throw Error("No authorization code found in URL");let l=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:r,codeVerifier:u.codeVerifier,provider:t})}),n=await l.json();if(!l.ok)throw Error(n.error);c("success"),s?.()}catch(e){g(e.message),c("error")}},N="google"===t?"Google":"GitHub";return(0,r.jsx)(i.aF,{isOpen:e,title:`Connect Kiro via ${N}`,onClose:l,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===n&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",N," authentication"]})]}),"input"===n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.pd,{value:m,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(i.$n,{variant:"secondary",icon:"auth_url"===j?"check":"content_copy",onClick:()=>y(m,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,r.jsx)(i.pd,{value:p,onChange:e=>f(e.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:v,fullWidth:!0,disabled:!p,children:"Connect"}),(0,r.jsx)(i.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===n&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",N," has been connected."]}),(0,r.jsx)(i.$n,{onClick:l,fullWidth:!0,children:"Done"})]}),"error"===n&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:b}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:()=>c("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(i.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}d.propTypes={isOpen:n().bool.isRequired,provider:n().oneOf(["google","github"]).isRequired,onSuccess:n().func,onClose:n().func.isRequired}},97677:(e,t,s)=>{s.d(t,{default:()=>a});var r=s(95155);function a({text:e,children:t,position:s="top"}){return(0,r.jsxs)("div",{className:"relative inline-flex group",children:[t,(0,r.jsx)("div",{className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[s]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug bg-gray-900 text-white opacity-0 group-hover:opacity-100 transition-opacity duration-150 whitespace-normal`,children:e})]})}},98542:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(95155),a=s(31474);function l({checked:e=!1,onChange:t,label:s,description:n,disabled:i=!1,size:o="md",className:d}){let c={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,r.jsxs)("div",{className:(0,a.cn)("flex items-center gap-3",i&&"opacity-50 cursor-not-allowed",d),children:[(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:i,onClick:()=>{!i&&t&&t(!e)},className:(0,a.cn)("relative inline-flex shrink-0 cursor-pointer rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-1 focus:ring-primary/30",e?"bg-primary":"bg-black/10 dark:bg-white/20",c[o].track,i&&"cursor-not-allowed"),children:(0,r.jsx)("span",{className:(0,a.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",e?c[o].translate:"translate-x-0.5",c[o].thumb,"mt-0.5")})}),(s||n)&&(0,r.jsxs)("div",{className:"flex flex-col",children:[s&&(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:s}),n&&(0,r.jsx)("span",{className:"text-xs text-text-muted",children:n})]})]})}}}]);
7
+ `,children:s?(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),e.name]}):e.isCustom?(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[e.name,(0,r.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"})]}):e.name},e.id)})})]},e)),0===Object.keys(C).length&&0===k.length&&(0,r.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,r.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}m.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onSelect:n().func.isRequired,selectedModel:n().string,activeProviders:n().arrayOf(n().shape({provider:n().string.isRequired})),title:n().string,modelAliases:n().object}},73006:(e,t,s)=>{s.d(t,{FE:()=>x,Tl:()=>d,wn:()=>u});var r=s(93308);let a={},l=r.Xn,n=[];function i(){if("u"<typeof document)return r.Xn;let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${r.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):r.Xn;return(0,r.QC)(t)}async function o(e){if("en"===e){a={};return}try{let t=await fetch(`/i18n/literals/${e}.json`);a=await t.json()}catch(e){console.error("Failed to load translations:",e),a={}}}function d(e){if(!e||"string"!=typeof e)return e;let t=e.trim();return t&&"en"!==l&&a[t]||e}function c(e){if(!e.nodeValue||!e.nodeValue.trim())return;let t=e.parentElement;if(!t)return;let s=t;for(;s;){if(s.hasAttribute&&s.hasAttribute("data-i18n-skip"))return;s=s.parentElement}if(["script","style","code","pre","colgroup","table","thead","tbody","tfoot","tr","select","datalist","optgroup"].includes(t.tagName?.toLowerCase()))return;e._originalText||(e._originalText=e.nodeValue);let r=d(e._originalText);r!==e.nodeValue&&(e.nodeValue=r)}function m(e){let t;if(!e)return;let s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),r=[];for(;t=s.nextNode();)r.push(t);r.forEach(c)}async function x(){l=i(),await o(l),m(document.body),new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE?m(e):e.nodeType===Node.TEXT_NODE&&c(e)})})}).observe(document.body,{childList:!0,subtree:!0})}async function u(){l=i(),await o(l),n.forEach(e=>e()),m(document.body)}},74891:(e,t,s)=>{s.d(t,{default:()=>p});var r=s(95155),a=s(73321),l=s(12115),n=s(98500),i=s.n(n),o=s(14051),d=s.n(o),c=s(57250),m=s(35497),x=s(36548),u=s(90620),h=s(73006);function p({onMenuClick:e,showMenuButton:t=!0}){let s=(0,a.usePathname)(),n=(0,a.useRouter)(),{title:o,description:d,breadcrumbs:f}=(0,l.useMemo)(()=>(e=>{if(!e)return{title:"",description:"",breadcrumbs:[]};let t=e.match(/\/providers\/([^/]+)$/);if(t){let e=t[1],s=u.zN[e]||u.fg[e];if(s)return{title:s.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:s.name,image:`/providers/${s.id}.png`}]}}return e.includes("/providers")?{title:"Providers",description:"Manage your AI provider connections",breadcrumbs:[]}:e.includes("/combos")?{title:"Combos",description:"Model combos with fallback",breadcrumbs:[]}:e.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",breadcrumbs:[]}:e.includes("/mitm")?{title:"MITM Proxy",description:"Intercept CLI tool traffic and route through 9Router",breadcrumbs:[]}:e.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",breadcrumbs:[]}:e.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:e.includes("/profile")?{title:"Settings",description:"Manage your preferences",breadcrumbs:[]}:e.includes("/translator")?{title:"Translator",description:"Debug translation flow between formats",breadcrumbs:[]}:e.includes("/console-log")?{title:"Console Log",description:"Live server console output",breadcrumbs:[]}:"/dashboard"===e?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(s),[s]),b=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(n.push("/login"),n.refresh())}catch(e){console.error("Failed to logout:",e)}};return(0,r.jsxs)("header",{className:"flex items-center justify-between px-8 py-5 border-b border-black/5 dark:border-white/5 bg-bg/80 backdrop-blur-xl z-10 sticky top-0",children:[(0,r.jsx)("div",{className:"flex items-center gap-3 lg:hidden",children:t&&(0,r.jsx)("button",{onClick:e,className:"text-text-main hover:text-primary transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"menu"})})}),(0,r.jsx)("div",{className:"hidden lg:flex flex-col",children:f.length>0?(0,r.jsx)("div",{className:"flex items-center gap-2",children:f.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[t>0&&(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted text-base",children:"chevron_right"}),e.href?(0,r.jsx)(i(),{href:e.href,className:"text-text-muted hover:text-primary transition-colors",children:e.label}):(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[e.image&&(0,r.jsx)(c.A,{src:e.image,alt:e.label,size:28,className:"object-contain rounded max-w-[28px] max-h-[28px]",fallbackText:e.label.slice(0,2).toUpperCase()}),(0,r.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:(0,h.Tl)(e.label)})]})]},`${e.label}-${e.href||"current"}`))}):o?(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:(0,h.Tl)(o)}),d&&(0,r.jsx)("p",{className:"text-sm text-text-muted",children:(0,h.Tl)(d)})]}):null}),(0,r.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,r.jsx)(x.default,{}),(0,r.jsx)(m.c5,{}),(0,r.jsx)(m.UW,{}),(0,r.jsx)("button",{onClick:b,className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-all",title:"Logout",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"logout"})})]})]})}p.propTypes={onMenuClick:d().func,showMenuButton:d().bool}},81127:(e,t,s)=>{s.d(t,{ConfirmModal:()=>o,default:()=>i});var r=s(95155),a=s(12115),l=s(31474),n=s(92542);function i({isOpen:e,onClose:t,title:s,children:n,footer:o,size:d="md",closeOnOverlay:c=!0,showCloseButton:m=!0,className:x}){return((0,a.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,a.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e)?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:c?t:void 0}),(0,r.jsxs)("div",{className:(0,l.cn)("relative w-full bg-surface","border border-black/10 dark:border-white/10","rounded-xl shadow-2xl","animate-in fade-in zoom-in-95 duration-200",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[d],x),children:[(s||m)&&(0,r.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-black/5 dark:border-white/5",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mr-4",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),s&&(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})]}),m&&(0,r.jsx)("button",{onClick:t,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsx)("div",{className:"p-6 max-h-[calc(80vh-140px)] overflow-y-auto",children:n}),o&&(0,r.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-black/5 dark:border-white/5",children:o})]})]}):null}function o({isOpen:e,onClose:t,onConfirm:s,title:a="Confirm",message:l,confirmText:d="Confirm",cancelText:c="Cancel",variant:m="danger",loading:x=!1}){return(0,r.jsx)(i,{isOpen:e,onClose:t,title:a,size:"sm",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.default,{variant:"ghost",onClick:t,disabled:x,children:c}),(0,r.jsx)(n.default,{variant:m,onClick:s,loading:x,children:d})]}),children:(0,r.jsx)("p",{className:"text-text-muted",children:l})})}},84588:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(95155),a=s(31474);function l({children:e,title:t,subtitle:s,icon:n,action:i,padding:o="md",hover:d=!1,className:c,...m}){return(0,r.jsxs)("div",{className:(0,a.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",d&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[o],c),...m,children:[(t||i)&&(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[n&&(0,r.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:n})}),(0,r.jsxs)("div",{children:[t&&(0,r.jsx)("h3",{className:"text-text-main font-semibold",children:t}),s&&(0,r.jsx)("p",{className:"text-sm text-text-muted",children:s})]})]}),i]}),e]})}l.Section=function({children:e,className:t,...s}){return(0,r.jsx)("div",{className:(0,a.cn)("p-4 rounded-lg","bg-black/[0.02] dark:bg-white/[0.02]","border border-black/5 dark:border-white/5",t),...s,children:e})},l.Row=function({children:e,className:t,...s}){return(0,r.jsx)("div",{className:(0,a.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-black/5 dark:border-white/5 last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]",t),...s,children:e})},l.ListItem=function({children:e,actions:t,className:s,...l}){return(0,r.jsxs)("div",{className:(0,a.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]","transition-colors",s),...l,children:[(0,r.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,r.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:t})]})}},90085:(e,t,s)=>{s.d(t,{A:()=>i});var r=s(1934),a=s(31692),l=s(90620);function n(e){let t=document.documentElement,s=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";"dark"===("system"===e?s:e)?t.classList.add("dark"):t.classList.remove("dark")}let i=(0,r.v)((0,a.Zr)((e,t)=>({theme:l.B2.defaultTheme,setTheme:t=>{e({theme:t}),n(t)},toggleTheme:()=>{let s="dark"===t().theme?"light":"dark";e({theme:s}),n(s)},initTheme:()=>{n(t().theme)}}),{name:l.B2.storageKey}))},90620:(e,t,s)=>{s.d(t,{Q2:()=>r.Q2,fg:()=>r.fg,vQ:()=>a,MA:()=>r.MA,UY:()=>n,zN:()=>r.zN,B2:()=>l});var r=s(52679);s(28777);let a={name:"iRouter - Server",description:"Enterprise AI Infrastructure Management",version:"0.3.64-i17"},l={storageKey:"theme",defaultTheme:"system"},n={maxLines:200,pollIntervalMs:1e3}},90882:(e,t,s)=>{s.d(t,{default:()=>d});var r=s(95155),a=s(12115),l=s(14051),n=s.n(l),i=s(35497),o=s(11059);function d({isOpen:e,provider:t,providerInfo:s,onSuccess:l,onClose:n}){let[c,m]=(0,a.useState)("waiting"),[x,u]=(0,a.useState)(null),[h,p]=(0,a.useState)(""),[f,b]=(0,a.useState)(null),[g,j]=(0,a.useState)(!1),[y,v]=(0,a.useState)(null),[N,w]=(0,a.useState)(!1),k=(0,a.useRef)(null),C=(0,a.useRef)(!1),{copied:S,copy:T}=(0,o.C)(),[M,R]=(0,a.useState)(!1),[$,E]=(0,a.useState)("/callback?code=..."),I=(0,a.useRef)(!1);(0,a.useEffect)(()=>{R("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),E(`${window.location.origin}/callback?code=...`)},[]);let D=(0,a.useCallback)(async(e,s)=>{if(x)try{let r=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:x.redirectUri,codeVerifier:x.codeVerifier,state:s})}),a=await r.json();if(!r.ok)throw Error(a.error);m("success"),l?.()}catch(e){b(e.message),m("error")}},[x,t,l]),O=(0,a.useCallback)(async(e,s,r,a)=>{C.current=!1,w(!0);for(let n=0;n<60;n++){if(C.current){console.log("[OAuthModal] Polling aborted"),w(!1);return}if(await new Promise(e=>setTimeout(e,1e3*r)),C.current){console.log("[OAuthModal] Polling aborted after sleep"),w(!1);return}try{let n=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:s,extraData:a})}),i=await n.json();if(i.success){C.current=!0,m("success"),w(!1),l?.();return}if("expired_token"===i.error||"access_denied"===i.error)throw Error(i.errorDescription||i.error);"slow_down"===i.error&&(r=Math.min(r+5,30))}catch(e){b(e.message),m("error"),w(!1);return}}b("Authorization timeout"),m("error"),w(!1)},[t,l]),L=(0,a.useCallback)(async()=>{if(t)try{let e;if(b(null),["github","qwen","kiro","kimi-coding","kilocode"].includes(t)){j(!0),m("waiting");let e=await fetch(`/api/oauth/${t}/device-code`),s=await e.json();if(!e.ok)throw Error(s.error);v(s);let r=s.verification_uri_complete||s.verification_uri;r&&window.open(r,"_blank");let a="kiro"===t?{_clientId:s._clientId,_clientSecret:s._clientSecret}:null;O(s.device_code,s.codeVerifier,s.interval||5,a);return}if("codex"===t)e="http://localhost:1455/auth/callback";else{let t=window.location.port||("https:"===window.location.protocol?"443":"80");e=`http://localhost:${t}/callback`}let s=await fetch(`/api/oauth/${t}/authorize?redirect_uri=${encodeURIComponent(e)}`),r=await s.json();if(!s.ok)throw Error(r.error);u({...r,redirectUri:e}),"codex"!==t&&M?(m("waiting"),k.current=window.open(r.authUrl,"oauth_popup","width=600,height=700"),k.current||m("input")):(m("input"),window.open(r.authUrl,"_blank"))}catch(e){b(e.message),m("error")}},[t,M,O]);(0,a.useEffect)(()=>{e&&t?(u(null),p(""),b(null),j(!1),v(null),w(!1),C.current=!1,L()):e||(C.current=!0)},[e,t,L]),(0,a.useEffect)(()=>{let e;if(!x)return;I.current=!1;let t=async e=>{if(I.current)return;let{code:t,state:s,error:r,errorDescription:a}=e;if(r){I.current=!0,b(a||r),m("error");return}t&&(I.current=!0,await D(t,s))},s=e=>{let s=e.origin.includes("localhost")||e.origin.includes("127.0.0.1"),r=e.origin===window.location.origin;(s||r)&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",s);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){console.log("BroadcastChannel not supported")}let r=e=>{if("oauth_callback"===e.key&&e.newValue)try{let s=JSON.parse(e.newValue);t(s),localStorage.removeItem("oauth_callback")}catch(e){console.log("Failed to parse localStorage data")}};window.addEventListener("storage",r);try{let e=localStorage.getItem("oauth_callback");if(e){let s=JSON.parse(e);s.timestamp&&Date.now()-s.timestamp<3e4&&t(s),localStorage.removeItem("oauth_callback")}}catch{}return()=>{window.removeEventListener("message",s),window.removeEventListener("storage",r),e&&e.close()}},[x,D]);let z=async()=>{try{b(null);let e=new URL(h),t=e.searchParams.get("code"),s=e.searchParams.get("state"),r=e.searchParams.get("error");if(r)throw Error(e.searchParams.get("error_description")||r);if(!t)throw Error("No authorization code found in URL");await D(t,s)}catch(e){b(e.message),m("error")}},_=(0,a.useCallback)(()=>{n()},[n]);return t&&s?(0,r.jsx)(i.aF,{isOpen:e,title:`Connect ${s.name}`,onClose:_,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["waiting"===c&&!g&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Waiting for Authorization"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Complete the authorization in the popup window."}),(0,r.jsx)(i.$n,{variant:"ghost",onClick:()=>m("input"),children:"Popup blocked? Enter URL manually"})]}),"waiting"===c&&g&&y&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"text-center py-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the URL below and enter the code:"}),(0,r.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Verification URL"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("code",{className:"flex-1 text-sm break-all",children:y.verification_uri}),(0,r.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"verify_url"===S?"check":"content_copy",onClick:()=>T(y.verification_uri,"verify_url")})]})]}),(0,r.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:y.user_code}),(0,r.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"user_code"===S?"check":"content_copy",onClick:()=>T(y.user_code,"user_code")})]})]})]}),N&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"input"===c&&!g&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.pd,{value:x?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(i.$n,{variant:"secondary",icon:"auth_url"===S?"check":"content_copy",onClick:()=>T(x?.authUrl,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser."}),(0,r.jsx)(i.pd,{value:h,onChange:e=>p(e.target.value),placeholder:$,className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:z,fullWidth:!0,disabled:!h,children:"Connect"}),(0,r.jsx)(i.$n,{onClick:_,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===c&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",s.name," account has been connected."]}),(0,r.jsx)(i.$n,{onClick:_,fullWidth:!0,children:"Done"})]}),"error"===c&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:f}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:L,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(i.$n,{onClick:_,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}d.propTypes={isOpen:n().bool.isRequired,provider:n().string,providerInfo:n().shape({name:n().string}),onSuccess:n().func,onClose:n().func.isRequired}},91450:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(95155),a=s(14051),l=s.n(a),n=s(38587);function i({children:e}){return(0,r.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,r.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,r.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,r.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,r.jsx)(n.default,{variant:"card"})}),(0,r.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}i.propTypes={children:l().node.isRequired}},92173:(e,t,s)=>{s.d(t,{default:()=>c});var r=s(95155),a=s(98500),l=s.n(a),n=s(90620);let i=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],d=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function c(){return(0,r.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,r.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,r.jsx)("div",{className:"size-6 text-primary",children:(0,r.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,r.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,r.jsx)("span",{className:"text-xl font-bold text-text-main",children:n.vQ.name})]}),(0,r.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:d.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,r.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",n.vQ.name," Inc. All rights reserved."]}),(0,r.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,r.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,r.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},92542:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(95155),a=s(31474);let l={primary:"bg-gradient-to-b from-primary to-primary-hover text-white shadow-sm",secondary:"bg-white dark:bg-white/10 border border-black/10 dark:border-white/10 text-text-main hover:bg-black/5 dark:hover:bg-white/5",outline:"border border-black/15 dark:border-white/15 text-text-main hover:bg-black/5",ghost:"text-text-muted hover:bg-black/5 dark:hover:bg-white/5 hover:text-text-main",danger:"bg-red-500 text-white hover:bg-red-600 shadow-sm"},n={sm:"h-7 px-3 text-xs rounded-md",md:"h-9 px-4 text-sm rounded-lg",lg:"h-11 px-6 text-sm rounded-lg"};function i({children:e,variant:t="primary",size:s="md",icon:o,iconRight:d,disabled:c=!1,loading:m=!1,fullWidth:x=!1,className:u,...h}){return(0,r.jsxs)("button",{className:(0,a.cn)("inline-flex items-center justify-center gap-2 font-medium transition-all duration-200 cursor-pointer","active:scale-[0.99] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",l[t],n[s],x&&"w-full",u),disabled:c||m,...h,children:[m?(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):o?(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o}):null,e,d&&!m&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:d})]})}},92622:(e,t,s)=>{s.d(t,{default:()=>b});var r=s(95155),a=s(12115),l=s(14051),n=s.n(l),i=s(98500),o=s.n(i),d=s(73321),c=s(31474),m=s(90620),x=s(92542),u=s(81127);let h=[{href:"/dashboard/employees",label:"E Dashboard",icon:"badge"},{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combos",icon:"layers"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/mitm",label:"MITM",icon:"security"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],p=[{href:"/dashboard/console-log",label:"Console Log",icon:"terminal"}],f=[{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/profile",label:"Settings",icon:"settings"}];function b({onClose:e}){let t=(0,d.usePathname)(),[s,l]=(0,a.useState)(!1),[n,i]=(0,a.useState)(!1),[g,j]=(0,a.useState)(!1),[y,v]=(0,a.useState)(null),[N,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(!1);(0,a.useEffect)(()=>{"true"===localStorage.getItem("sidebarCollapsed")&&C(!0)},[]),(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{e.enableTranslator&&w(!0)}).catch(()=>{})},[]),(0,a.useEffect)(()=>{fetch("/api/version").then(e=>e.json()).then(e=>{e.hasUpdate&&v(e)}).catch(()=>{})},[]);let S=e=>"/dashboard/endpoint"===e?"/dashboard"===t||t.startsWith("/dashboard/endpoint"):t.startsWith(e),T=async()=>{i(!0);try{await fetch("/api/shutdown",{method:"POST"})}catch(e){}i(!1),l(!1),j(!0)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("aside",{className:(0,c.cn)("flex flex-col border-r border-black/5 dark:border-white/5 bg-vibrancy backdrop-blur-xl transition-[width] duration-300 min-h-full relative overflow-hidden",k?"w-[72px]":"w-72"),children:[(0,r.jsx)("button",{onClick:()=>{C(e=>{let t=!e;return localStorage.setItem("sidebarCollapsed",String(t)),t})},className:(0,c.cn)("absolute z-10 p-1.5 rounded-lg text-text-muted hover:bg-surface/50 hover:text-text-main transition-all hidden lg:flex items-center justify-center bg-bg/80 backdrop-blur-md border border-black/5 dark:border-white/5 shadow-sm",k?"top-4 left-1/2 -translate-x-1/2":"top-4 right-4"),title:k?"Expand sidebar":"Collapse sidebar",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:k?"keyboard_double_arrow_right":"keyboard_double_arrow_left"})}),(0,r.jsxs)("div",{className:(0,c.cn)("flex items-center gap-2 transition-all duration-300",k?"px-0 h-0 pt-0 pb-0 opacity-0 overflow-hidden":"px-6 pt-5 pb-2 opacity-100"),children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56] shrink-0"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E] shrink-0"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F] shrink-0"})]}),(0,r.jsxs)("div",{className:(0,c.cn)("py-4 flex flex-col gap-2 transition-all duration-300",k?"px-0 items-center mt-[52px]":"px-6"),children:[(0,r.jsxs)(o(),{href:"/dashboard",className:(0,c.cn)("flex items-center",k?"justify-center":"gap-3"),children:[(0,r.jsx)("img",{src:"/favicon.svg",alt:"iRouter",className:"size-9 rounded shrink-0"}),!k&&(0,r.jsxs)("div",{className:"flex flex-col whitespace-nowrap overflow-hidden opacity-100 transition-opacity duration-300",children:[(0,r.jsx)("h1",{className:"text-lg font-semibold tracking-tight text-text-main",children:m.vQ.name}),(0,r.jsxs)("span",{className:"text-xs text-text-muted",children:["v",m.vQ.version]})]})]}),y&&!k&&(0,r.jsxs)("div",{className:"flex flex-col gap-0.5 whitespace-nowrap overflow-hidden opacity-100 transition-opacity duration-300",children:[(0,r.jsxs)("span",{className:"text-xs font-semibold text-green-600 dark:text-amber-500",children:["↑ New version available: v",y.latestVersion]}),(0,r.jsx)("code",{className:"text-[10px] text-green-600/80 dark:text-amber-400/70 font-mono select-all overflow-hidden text-ellipsis",children:"npm install -g 9router@latest"})]})]}),(0,r.jsxs)("nav",{className:(0,c.cn)("flex-1 py-4 space-y-1 overflow-y-auto custom-scrollbar",k?"px-2":"px-4"),children:[h.map(t=>(0,r.jsxs)(o(),{href:t.href,onClick:e,title:k?t.label:void 0,className:(0,c.cn)("flex items-center py-2.5 rounded-lg transition-all group",k?"px-0 justify-center":"gap-3 px-4",S(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px] shrink-0",S(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),!k&&(0,r.jsx)("span",{className:"text-sm font-medium whitespace-nowrap overflow-hidden text-ellipsis",children:t.label})]},t.href)),(0,r.jsxs)("div",{className:(0,c.cn)("pt-4 mt-2",k?"border-t border-black/5 dark:border-white/5 mx-2":"mx-1"),children:[!k&&(0,r.jsx)("p",{className:"px-3 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"Debug"}),N&&(0,r.jsxs)(o(),{href:"/dashboard/translator",onClick:e,title:k?"Translator":void 0,className:(0,c.cn)("flex items-center py-2.5 rounded-lg transition-all group",k?"px-0 justify-center":"gap-3 px-3",S("/dashboard/translator")?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px] shrink-0",S("/dashboard/translator")?"fill-1":"group-hover:text-primary transition-colors"),children:"translate"}),!k&&(0,r.jsx)("span",{className:"text-sm font-medium whitespace-nowrap overflow-hidden text-ellipsis",children:"Translator"})]}),p.map(t=>(0,r.jsxs)(o(),{href:t.href,onClick:e,title:k?t.label:void 0,className:(0,c.cn)("flex items-center py-2.5 rounded-lg transition-all group",k?"px-0 justify-center":"gap-3 px-3",S(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px] shrink-0",S(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),!k&&(0,r.jsx)("span",{className:"text-sm font-medium whitespace-nowrap overflow-hidden text-ellipsis",children:t.label})]},t.href))]}),(0,r.jsxs)("div",{className:(0,c.cn)("pt-4 mt-2",k?"border-t border-black/5 dark:border-white/5 mx-2":"mx-1"),children:[!k&&(0,r.jsx)("p",{className:"px-3 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"System"}),f.map(t=>(0,r.jsxs)(o(),{href:t.href,onClick:e,title:k?t.label:void 0,className:(0,c.cn)("flex items-center py-2.5 rounded-lg transition-all group",k?"px-0 justify-center":"gap-3 px-3",S(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px] shrink-0",S(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),!k&&(0,r.jsx)("span",{className:"text-sm font-medium whitespace-nowrap overflow-hidden text-ellipsis",children:t.label})]},t.href))]})]}),(0,r.jsxs)("div",{className:(0,c.cn)("p-3 border-t border-black/5 dark:border-white/5",k?"px-2":"p-3"),children:[!k&&(0,r.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-surface/50 mb-2 overflow-hidden transition-all duration-300",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-6 rounded-md bg-blue-500/10 text-blue-500 shrink-0 mt-0.5",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"})}),(0,r.jsx)("div",{className:"flex flex-col",children:(0,r.jsx)("span",{className:"text-xs font-medium text-text-main leading-relaxed",children:"Service is running in terminal. You can close this web page. Shutdown will stop the service."})})]}),(0,r.jsx)(x.default,{variant:"outline",fullWidth:!k,icon:"power_settings_new",onClick:()=>l(!0),className:(0,c.cn)("text-red-500 border-red-200 hover:bg-red-50 hover:border-red-300 transition-all",k?"p-2 w-full flex flex-col items-center justify-center aspect-square shadow-sm [&_span]:!mr-0 [&_span]:!text-[20px]":"shadow-sm"),title:k?"Shutdown":void 0,children:!k&&"Shutdown"})]})]}),(0,r.jsx)(u.ConfirmModal,{isOpen:s,onClose:()=>l(!1),onConfirm:T,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:n}),g&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"text-center p-8",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-16 rounded-full bg-red-500/20 text-red-500 mx-auto mb-4",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"power_off"})}),(0,r.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Server Disconnected"}),(0,r.jsx)("p",{className:"text-text-muted mb-6",children:"The proxy server has been stopped."}),(0,r.jsx)(x.default,{variant:"secondary",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]})})]})}b.propTypes={onClose:n().func}},93308:(e,t,s)=>{s.d(t,{CL:()=>l,QC:()=>n,Xn:()=>a,YZ:()=>r});let r=["en","vi","zh-CN","zh-TW","ja","pt-BR","pt-PT","ko","es","de","fr","he","ar","ru","pl","cs","nl","tr","uk","tl","id","th","hi","bn","ur","ro","sv","it","el","hu","fi","da","no"],a="en",l="locale";function n(e){return"zh"===e||"zh-CN"===e?"zh-CN":"en"===e?"en":"vi"===e?"vi":"zh-TW"===e?"zh-TW":"ja"===e?"ja":"pt-BR"===e?"pt-BR":"pt-PT"===e?"pt-PT":"ko"===e?"ko":"es"===e?"es":"de"===e?"de":"fr"===e?"fr":"he"===e?"he":"ar"===e?"ar":"ru"===e?"ru":"pl"===e?"pl":"cs"===e?"cs":"nl"===e?"nl":"tr"===e?"tr":"uk"===e?"uk":"tl"===e?"tl":"id"===e?"id":"th"===e?"th":"hi"===e?"hi":"bn"===e?"bn":"ur"===e?"ur":"ro"===e?"ro":"sv"===e?"sv":"it"===e?"it":"el"===e?"el":"hu"===e?"hu":"fi"===e?"fi":"da"===e?"da":"no"===e?"no":a}},93927:(e,t,s)=>{s.d(t,{default:()=>z});var r=s(95155),a=s(12115),l=s(73321),n=s(56061),i=s(84588),o=s(14051),d=s.n(o);let c=e=>new Intl.NumberFormat().format(e||0);function m({stats:e}){let t;return(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,r.jsxs)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,r.jsx)("span",{className:"text-2xl font-bold",children:c(e.totalRequests)})]}),(0,r.jsxs)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,r.jsx)("span",{className:"text-2xl font-bold text-primary",children:c(e.totalPromptTokens)})]}),(0,r.jsxs)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,r.jsx)("span",{className:"text-2xl font-bold text-success",children:c(e.totalCompletionTokens)})]}),(0,r.jsxs)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Est. Cost"}),(0,r.jsxs)("span",{className:"text-2xl font-bold text-warning",children:["~",(t=e.totalCost,`$${(t||0).toFixed(2)}`)]}),(0,r.jsx)("span",{className:"text-[10px] text-text-muted",children:"Estimated, not actual billing"})]})]})}m.propTypes={stats:d().object.isRequired};let x=e=>new Intl.NumberFormat().format(e||0),u=e=>`$${(e||0).toFixed(2)}`;function h(e){if(!e)return"Never";let t=Math.floor((Date.now()-new Date(e))/6e4);return t<1?"Just now":t<60?`${t}m ago`:t<1440?`${Math.floor(t/60)}h ago`:new Date(e).toLocaleDateString()}function p({field:e,currentSort:t,currentOrder:s}){return t!==e?(0,r.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,r.jsx)("span",{className:"ml-1",children:"asc"===s?"↑":"↓"})}function f({item:e,viewMode:t,isSummary:s=!1}){return"tokens"===t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:s&&void 0===e.promptTokens?"—":x(e.promptTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:s&&void 0===e.completionTokens?"—":x(e.completionTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:x(e.totalTokens)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:s&&void 0===e.inputCost?"—":u(e.inputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:s&&void 0===e.outputCost?"—":u(e.outputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:u(e.totalCost||e.cost)})]})}function b({title:e,columns:t,groupedData:s,tableType:l,sortBy:n,sortOrder:o,onToggleSort:d,viewMode:c,storageKey:m,renderDetailCells:x,renderSummaryCells:u,emptyMessage:h}){let[g,j]=(0,a.useState)(new Set);(0,a.useEffect)(()=>{try{let e=localStorage.getItem(m);e&&j(new Set(JSON.parse(e)))}catch(e){console.error(`Failed to load ${m}:`,e)}},[m]),(0,a.useEffect)(()=>{try{localStorage.setItem(m,JSON.stringify([...g]))}catch(e){console.error(`Failed to save ${m}:`,e)}},[g,m]);let y=(0,a.useCallback)(e=>{j(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),v=(0,a.useMemo)(()=>"tokens"===c?[{field:"promptTokens",label:"Input Tokens"},{field:"completionTokens",label:"Output Tokens"},{field:"totalTokens",label:"Total Tokens"}]:[{field:"promptTokens",label:"Input Cost"},{field:"completionTokens",label:"Output Cost"},{field:"cost",label:"Total Cost"}],[c]),N=t.length+v.length;return(0,r.jsxs)(i.default,{className:"overflow-hidden",children:[(0,r.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,r.jsx)("h3",{className:"font-semibold",children:e})}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,r.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,r.jsxs)("tr",{children:[t.map(e=>(0,r.jsxs)("th",{className:`px-6 py-3 cursor-pointer hover:bg-bg-subtle/50 ${"right"===e.align?"text-right":""}`,onClick:()=>d(l,e.field),children:[e.label," ",(0,r.jsx)(p,{field:e.field,currentSort:n,currentOrder:o})]},e.field)),v.map(e=>(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>d(l,e.field),children:[e.label," ",(0,r.jsx)(p,{field:e.field,currentSort:n,currentOrder:o})]},e.field))]})}),(0,r.jsxs)("tbody",{className:"divide-y divide-border",children:[s.map(e=>(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>y(e.groupKey),children:[(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${g.has(e.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,r.jsx)("span",{className:`font-medium transition-colors ${e.summary.pending>0?"text-primary":""}`,children:e.groupKey})]})}),u(e),(0,r.jsx)(f,{item:e.summary,viewMode:c,isSummary:!0})]}),g.has(e.groupKey)&&e.items.map(e=>(0,r.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[x(e),(0,r.jsx)(f,{item:e,viewMode:c})]},`detail-${e.key}`))]},e.groupKey)),0===s.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:N,className:"px-6 py-8 text-center text-text-muted",children:h})})]})]})})]})}p.propTypes={field:d().string.isRequired,currentSort:d().string.isRequired,currentOrder:d().string.isRequired},f.propTypes={item:d().object.isRequired,viewMode:d().string.isRequired,isSummary:d().bool},b.propTypes={title:d().string.isRequired,columns:d().arrayOf(d().shape({field:d().string.isRequired,label:d().string.isRequired,align:d().string})).isRequired,groupedData:d().array.isRequired,tableType:d().string.isRequired,sortBy:d().string.isRequired,sortOrder:d().string.isRequired,onToggleSort:d().func.isRequired,viewMode:d().string.isRequired,storageKey:d().string.isRequired,renderDetailCells:d().func.isRequired,renderSummaryCells:d().func.isRequired,emptyMessage:d().string.isRequired};var g=s(81750),j=s(6793);s(53255);var y=s(52679);function v({data:e}){let{label:t,color:s,imageUrl:l,textIcon:n,active:i}=e,[o,d]=(0,a.useState)(!1);return(0,r.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-2.5 rounded-lg border-2 transition-all duration-300 bg-bg",style:{borderColor:i?s:"var(--color-border)",boxShadow:i?`0 0 16px ${s}40`:"none",minWidth:"150px"},children:[(0,r.jsx)(g.h7,{type:"target",position:j.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)(g.h7,{type:"target",position:j.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)(g.h7,{type:"target",position:j.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)(g.h7,{type:"target",position:j.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)("div",{className:"w-8 h-8 rounded-md flex items-center justify-center shrink-0",style:{backgroundColor:`${s}15`},children:o?(0,r.jsx)("span",{className:"text-sm font-bold",style:{color:s},children:n}):(0,r.jsx)("img",{src:l,alt:t,className:"w-6 h-6 rounded-sm object-contain",onError:()=>d(!0)})}),(0,r.jsx)("span",{className:"text-base font-medium truncate",style:{color:i?s:"var(--color-text)"},children:t}),i&&(0,r.jsxs)("span",{className:"relative flex h-2 w-2 shrink-0",children:[(0,r.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:s}}),(0,r.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2",style:{backgroundColor:s}})]})]})}function N({data:e}){return(0,r.jsxs)("div",{className:"flex items-center justify-center px-5 py-3 rounded-xl border-2 border-primary bg-primary/5 shadow-md min-w-[130px]",children:[(0,r.jsx)(g.h7,{type:"source",position:j.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)(g.h7,{type:"source",position:j.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)(g.h7,{type:"source",position:j.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)(g.h7,{type:"source",position:j.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,r.jsx)("img",{src:"/favicon.svg",alt:"iRouter",className:"w-6 h-6 mr-2"}),(0,r.jsx)("span",{className:"text-sm font-bold text-primary",children:"iRouter"}),e.activeCount>0&&(0,r.jsx)("span",{className:"ml-2 px-1.5 py-0.5 rounded-full bg-primary text-white text-xs font-bold",children:e.activeCount})]})}v.propTypes={data:d().object.isRequired},N.propTypes={data:d().object.isRequired};let w={provider:v,router:N};function k({providers:e=[],activeRequests:t=[],lastProvider:s="",errorProvider:l=""}){let n=(0,a.useMemo)(()=>t.map(e=>e.provider?.toLowerCase()).filter(Boolean).sort().join(","),[t]),i=s?.toLowerCase()||"",o=l?.toLowerCase()||"",d=(0,a.useMemo)(()=>new Set(n?n.split(","):[]),[n]),c=(0,a.useMemo)(()=>new Set(i?[i]:[]),[i]),m=(0,a.useMemo)(()=>new Set(o?[o]:[]),[o]),{nodes:x,edges:u}=(0,a.useMemo)(()=>(function(e,t,s,r){let a=e.length,l=Math.max(320,204*a/(2*Math.PI)),n=Math.max(200,.55*l);if(0===a)return{nodes:[{id:"router",type:"router",position:{x:0,y:0},data:{activeCount:0},draggable:!1}],edges:[]};let i=[],o=[];return i.push({id:"router",type:"router",position:{x:-60,y:-22},data:{activeCount:t.size},draggable:!1}),e.forEach((e,d)=>{var c,m;let x,u,h=(c=e.provider,y.Q2[c]||{color:"#6b7280",name:c}),p=t.has(e.provider?.toLowerCase()),f=!p&&s.has(e.provider?.toLowerCase()),b=!p&&r.has(e.provider?.toLowerCase()),g=`provider-${e.provider}`,j={label:(h.name!==e.provider?h.name:null)||e.name||e.provider,color:h.color||"#6b7280",imageUrl:(m=e.provider,`/providers/${m}.png`),textIcon:h.textIcon||(e.provider||"?").slice(0,2).toUpperCase(),active:p},v=-Math.PI/2+2*Math.PI*d/a,N=l*Math.cos(v),w=n*Math.sin(v);Math.abs(v+Math.PI/2)<Math.PI/4||Math.abs(v-3*Math.PI/2)<Math.PI/4?(x="top",u="bottom"):Math.abs(v-Math.PI/2)<Math.PI/4?(x="bottom",u="top"):N>0?(x="right",u="left"):(x="left",u="right"),i.push({id:g,type:"provider",position:{x:N-90,y:w-15},data:j,draggable:!1}),o.push({id:`e-${g}`,source:"router",sourceHandle:x,target:g,targetHandle:u,animated:p,style:(h.color,b?{stroke:"#ef4444",strokeWidth:2.5,opacity:.9}:p?{stroke:"#22c55e",strokeWidth:2.5,opacity:.9}:f?{stroke:"#f59e0b",strokeWidth:2,opacity:.7}:{stroke:"var(--color-border)",strokeWidth:1,opacity:.3})})}),{nodes:i,edges:o}})(e,d,c,m),[e,n,i,o]),h=(0,a.useMemo)(()=>e.map(e=>e.provider).sort().join(","),[e]),p=(0,a.useRef)(null),f=(0,a.useCallback)(e=>{p.current=e,setTimeout(()=>e.fitView({padding:.3}),50)},[]);return(0,r.jsx)("div",{className:"w-full rounded-lg border border-border bg-bg-subtle/30",style:{height:480},children:0===e.length?(0,r.jsx)("div",{className:"h-full flex items-center justify-center text-text-muted text-sm",children:"No providers connected"}):(0,r.jsx)(g.Gc,{nodes:x,edges:u,nodeTypes:w,fitView:!0,fitViewOptions:{padding:.3},onInit:f,proOptions:{hideAttribution:!0},panOnDrag:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1},h)})}k.propTypes={providers:d().arrayOf(d().shape({id:d().string,provider:d().string,name:d().string})),activeRequests:d().arrayOf(d().shape({provider:d().string,model:d().string,account:d().string})),lastProvider:d().string,errorProvider:d().string};var C=s(10124);function S({timestamp:e}){let t,[,s]=(0,a.useState)(0);return(0,a.useEffect)(()=>{let e=setInterval(()=>s(e=>e+1),1e3);return()=>clearInterval(e)},[]),(0,r.jsx)(r.Fragment,{children:(t=Math.floor((Date.now()-new Date(e))/1e3))<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`})}function T({requests:e=[]}){return(0,r.jsxs)(i.default,{className:"flex flex-col overflow-hidden",padding:"sm",style:{height:480},children:[(0,r.jsx)("div",{className:"px-1 py-2 border-b border-border shrink-0",children:(0,r.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:"Recent Requests"})}),e.length?(0,r.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,r.jsxs)("table",{className:"w-full text-xs border-collapse",children:[(0,r.jsx)("thead",{className:"sticky top-0 bg-bg z-10",children:(0,r.jsxs)("tr",{className:"border-b border-border",children:[(0,r.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted w-2"}),(0,r.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted",children:"Model"}),(0,r.jsx)("th",{className:"py-1.5 pl-3 text-left font-semibold text-text-muted",children:"API Key"}),(0,r.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted whitespace-nowrap",children:"In / Out"}),(0,r.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted",children:"When"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border/50",children:e.map((e,t)=>{let s=!e.status||"ok"===e.status||"success"===e.status;return(0,r.jsxs)("tr",{className:"hover:bg-bg-subtle transition-colors",children:[(0,r.jsx)("td",{className:"py-1.5",children:(0,r.jsx)("span",{className:`block w-1.5 h-1.5 rounded-full ${s?"bg-success":"bg-error"}`})}),(0,r.jsx)("td",{className:"py-1.5 font-mono truncate max-w-[120px]",title:e.model,children:e.model}),(0,r.jsx)("td",{className:"py-1.5 pl-3 truncate max-w-[100px] text-secondary",title:e.keyName,children:e.keyName||"—"}),(0,r.jsxs)("td",{className:"py-1.5 text-right whitespace-nowrap",children:[(0,r.jsxs)("span",{className:"text-primary",children:[x(e.promptTokens),"↑"]})," ",(0,r.jsxs)("span",{className:"text-success",children:[x(e.completionTokens),"↓"]})]}),(0,r.jsx)("td",{className:"py-1.5 text-right text-text-muted whitespace-nowrap",children:(0,r.jsx)(S,{timestamp:e.timestamp})})]},t)})})]})}):(0,r.jsx)("div",{className:"flex-1 flex items-center justify-center text-text-muted text-sm",children:"No requests yet."})]})}function M(e,t={},s,r){return Object.entries(e||{}).map(([e,s])=>{let r=(s.promptTokens||0)+(s.completionTokens||0),a=s.cost||0,l=r>0?(s.promptTokens||0)*(a/r):0,n=r>0?(s.completionTokens||0)*(a/r):0;return{...s,key:e,totalTokens:r,totalCost:a,inputCost:l,outputCost:n,pending:t[e]||0}}).sort((e,t)=>{let a=e[s],l=t[s];return("string"==typeof a&&(a=a.toLowerCase()),"string"==typeof l&&(l=l.toLowerCase()),a<l)?"asc"===r?-1:1:a>l?"asc"===r?1:-1:0})}function R(e,t){if(!Array.isArray(e))return[];let s={};return e.forEach(e=>{let r=function(e,t){switch(t){case"rawModel":return e.rawModel||"Unknown Model";case"accountName":return e.accountName||`Account ${e.connectionId?.slice(0,8)}...`||"Unknown Account";case"keyName":return e.keyName||"Unknown Key";case"endpoint":return e.endpoint||"Unknown Endpoint";default:return e[t]||"Unknown"}}(e,t);s[r]||(s[r]={groupKey:r,summary:{requests:0,promptTokens:0,completionTokens:0,totalTokens:0,cost:0,inputCost:0,outputCost:0,lastUsed:null,pending:0},items:[]});let a=s[r].summary;a.requests+=e.requests||0,a.promptTokens+=e.promptTokens||0,a.completionTokens+=e.completionTokens||0,a.totalTokens+=e.totalTokens||0,a.cost+=e.cost||0,a.inputCost+=e.inputCost||0,a.outputCost+=e.outputCost||0,a.pending+=e.pending||0,e.lastUsed&&(!a.lastUsed||new Date(e.lastUsed)>new Date(a.lastUsed))&&(a.lastUsed=e.lastUsed),s[r].items.push(e)}),Object.values(s)}let $=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],E=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"accountName",label:"Account"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],I=[{field:"keyName",label:"API Key Name"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],D=[{field:"endpoint",label:"Endpoint"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],O=[{value:"model",label:"Usage by Model"},{value:"account",label:"Usage by Account"},{value:"apiKey",label:"Usage by API Key"},{value:"endpoint",label:"Usage by Endpoint"}],L=[{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function z(){let e=(0,l.useRouter)(),t=(0,l.useSearchParams)(),s=t.get("sortBy")||"rawModel",i=t.get("sortOrder")||"asc",[o,d]=(0,a.useState)(null),[c,u]=(0,a.useState)(!0),[p,f]=(0,a.useState)(!1),[g,j]=(0,a.useState)("model"),[y,v]=(0,a.useState)([]),[N,w]=(0,a.useState)("7d");(0,a.useEffect)(()=>{fetch("/api/providers").then(e=>e.ok?e.json():null).then(e=>{if(!e?.connections)return;let t=new Set;v(e.connections.filter(e=>!t.has(e.provider)&&(t.add(e.provider),!0)))}).catch(()=>{})},[]),(0,a.useEffect)(()=>{o?f(!0):u(!0),fetch(`/api/usage/stats?period=${N}`).then(e=>e.ok?e.json():null).then(e=>{e&&d(t=>({...t,...e}))}).catch(()=>{}).finally(()=>{u(!1),f(!1)})},[N]),(0,a.useEffect)(()=>{let e=new EventSource("/api/usage/stream");return e.onmessage=e=>{try{let t=JSON.parse(e.data);d(e=>e?{...e,activeRequests:t.activeRequests,recentRequests:t.recentRequests,errorProvider:t.errorProvider,pending:t.pending}:t),u(!1)}catch(e){console.error("[SSE CLIENT] parse error:",e)}},e.onerror=()=>u(!1),()=>e.close()},[]);let S=(0,a.useCallback)((s,r)=>{let a=new URLSearchParams(t.toString());a.get("sortBy")===r?a.set("sortOrder","asc"===a.get("sortOrder")?"desc":"asc"):(a.set("sortBy",r),a.set("sortOrder","asc")),e.replace(`?${a.toString()}`,{scroll:!1})},[t,e]),z=(0,a.useMemo)(()=>{if(!o)return null;switch(g){case"model":{let e=o.pending?.byModel||{};return{columns:$,groupedData:R(M(o.byModel,e,s,i),"rawModel"),storageKey:"usage-stats:expanded-models",emptyMessage:"No usage recorded yet.",renderSummaryCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.summary.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.summary.lastUsed)})]}),renderDetailCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(n.default,{variant:e.pending>0?"primary":"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.lastUsed)})]})}}case"account":{let e={};return o?.pending?.byAccount&&Object.entries(o.byAccount||{}).forEach(([t,s])=>{let r=o.pending.byAccount[s.connectionId];if(r){let a=s.provider?`${s.rawModel} (${s.provider})`:s.rawModel;e[t]=r[a]||0}}),{columns:E,groupedData:R(M(o.byAccount,e,s,i),"accountName"),storageKey:"usage-stats:expanded-accounts",emptyMessage:"No account-specific usage recorded yet.",renderSummaryCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.summary.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.summary.lastUsed)})]}),renderDetailCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.accountName||`Account ${e.connectionId?.slice(0,8)}...`}),(0,r.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(n.default,{variant:e.pending>0?"primary":"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.lastUsed)})]})}}case"apiKey":return{columns:I,groupedData:R(M(o.byApiKey,{},s,i),"keyName"),storageKey:"usage-stats:expanded-apikeys",emptyMessage:"No API key usage recorded yet.",renderSummaryCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.summary.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.summary.lastUsed)})]}),renderDetailCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 font-medium",children:e.keyName}),(0,r.jsx)("td",{className:"px-6 py-3",children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(n.default,{variant:"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.lastUsed)})]})};default:return{columns:D,groupedData:R(M(o.byEndpoint,{},s,i),"endpoint"),storageKey:"usage-stats:expanded-endpoints",emptyMessage:"No endpoint usage recorded yet.",renderSummaryCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.summary.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.summary.lastUsed)})]}),renderDetailCells:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 font-medium font-mono text-sm",children:e.endpoint}),(0,r.jsx)("td",{className:"px-6 py-3",children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(n.default,{variant:"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:x(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:h(e.lastUsed)})]})}}},[o,g,s,i]);if(!o&&!c)return(0,r.jsx)("div",{className:"text-text-muted",children:"Failed to load usage statistics."});let _=(0,r.jsx)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] animate-spin",children:"progress_activity"})});return(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 self-end",children:[(0,r.jsx)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border",children:L.map(e=>(0,r.jsx)("button",{onClick:()=>w(e.value),disabled:p,className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${N===e.value?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:e.label},e.value))}),p&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted animate-spin",children:"progress_activity"})]}),c?_:(0,r.jsx)(m,{stats:o}),c?_:(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] gap-2 items-stretch",children:[(0,r.jsx)(k,{providers:y,activeRequests:o.activeRequests||[],lastProvider:o.recentRequests?.[0]?.provider||"",errorProvider:o.errorProvider||""}),(0,r.jsx)(T,{requests:o.recentRequests||[]})]}),c?_:(0,r.jsx)(C.A,{period:N}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-between",children:(0,r.jsx)("select",{value:g,onChange:e=>j(e.target.value),className:"px-3 py-1.5 rounded-lg border border-border bg-bg-subtle text-sm font-medium text-text focus:outline-none focus:ring-2 focus:ring-primary/50",children:O.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})}),c?_:z&&(0,r.jsx)(b,{title:"",columns:z.columns,groupedData:z.groupedData,tableType:g,sortBy:s,sortOrder:i,onToggleSort:S,storageKey:z.storageKey,renderSummaryCells:z.renderSummaryCells,renderDetailCells:z.renderDetailCells,emptyMessage:z.emptyMessage})]})]})}},94230:(e,t,s)=>{s.d(t,{default:()=>d});var r=s(95155),a=s(12115),l=s(14051),n=s.n(l),i=s(35497),o=s(11059);function d({isOpen:e,provider:t,onSuccess:s,onClose:l}){let[n,c]=(0,a.useState)("loading"),[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(null),[p,f]=(0,a.useState)(""),[b,g]=(0,a.useState)(null),{copied:j,copy:y}=(0,o.C)();(0,a.useEffect)(()=>{e&&t&&(async()=>{try{g(null),c("loading");let e=await fetch(`/api/oauth/kiro/social-authorize?provider=${t}`),s=await e.json();if(!e.ok)throw Error(s.error);h(s),x(s.authUrl),c("input"),window.open(s.authUrl,"_blank")}catch(e){g(e.message),c("error")}})()},[e,t]);let v=async()=>{try{let e;g(null);try{e=new URL(p)}catch(e){throw Error("Invalid callback URL format")}let r=e.searchParams.get("code");e.searchParams.get("state");let a=e.searchParams.get("error");if(a)throw Error(e.searchParams.get("error_description")||a);if(!r)throw Error("No authorization code found in URL");let l=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:r,codeVerifier:u.codeVerifier,provider:t})}),n=await l.json();if(!l.ok)throw Error(n.error);c("success"),s?.()}catch(e){g(e.message),c("error")}},N="google"===t?"Google":"GitHub";return(0,r.jsx)(i.aF,{isOpen:e,title:`Connect Kiro via ${N}`,onClose:l,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===n&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",N," authentication"]})]}),"input"===n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.pd,{value:m,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(i.$n,{variant:"secondary",icon:"auth_url"===j?"check":"content_copy",onClick:()=>y(m,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,r.jsx)(i.pd,{value:p,onChange:e=>f(e.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:v,fullWidth:!0,disabled:!p,children:"Connect"}),(0,r.jsx)(i.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===n&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",N," has been connected."]}),(0,r.jsx)(i.$n,{onClick:l,fullWidth:!0,children:"Done"})]}),"error"===n&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:b}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:()=>c("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(i.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}d.propTypes={isOpen:n().bool.isRequired,provider:n().oneOf(["google","github"]).isRequired,onSuccess:n().func,onClose:n().func.isRequired}},97677:(e,t,s)=>{s.d(t,{default:()=>a});var r=s(95155);function a({text:e,children:t,position:s="top"}){return(0,r.jsxs)("div",{className:"relative inline-flex group",children:[t,(0,r.jsx)("div",{className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[s]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug bg-gray-900 text-white opacity-0 group-hover:opacity-100 transition-opacity duration-150 whitespace-normal`,children:e})]})}},98542:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(95155),a=s(31474);function l({checked:e=!1,onChange:t,label:s,description:n,disabled:i=!1,size:o="md",className:d}){let c={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,r.jsxs)("div",{className:(0,a.cn)("flex items-center gap-3",i&&"opacity-50 cursor-not-allowed",d),children:[(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:i,onClick:()=>{!i&&t&&t(!e)},className:(0,a.cn)("relative inline-flex shrink-0 cursor-pointer rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-1 focus:ring-primary/30",e?"bg-primary":"bg-black/10 dark:bg-white/20",c[o].track,i&&"cursor-not-allowed"),children:(0,r.jsx)("span",{className:(0,a.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",e?c[o].translate:"translate-x-0.5",c[o].thumb,"mt-0.5")})}),(s||n)&&(0,r.jsxs)("div",{className:"flex flex-col",children:[s&&(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:s}),n&&(0,r.jsx)("span",{className:"text-xs text-text-muted",children:n})]})]})}}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1817,1860,1949,2121,2284,2296,2354,2785,2797,2802,2919,2922,3025,3038,3079,3102,3397,3472,3549,3552,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,6780,6819,6919,6988,7241,7429,7442,7445,7508,7520,7758,7824,7851,8167,8207,8246,8453,8489,8573,8648,8814,8948,8974,8975,9027,9069,9088,9141,9157,9199,9321,9461,9749],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1817,1860,1949,2121,2284,2296,2354,2785,2797,2802,2919,2922,3025,3038,3079,3102,3397,3472,3549,3552,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,6780,6819,6919,6988,7241,7429,7442,7445,7508,7520,7758,7824,7851,8167,8207,8246,8453,8489,8573,8648,8814,8948,8974,8975,9027,9069,9088,9134,9141,9157,9199,9321,9461,9749],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{16113:(e,t,s)=>{Promise.resolve().then(s.bind(s,97162))},97162:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>h});var i=s(95155),a=s(12115),r=s(14051),l=s.n(r),o=s(73321),n=s(98500),d=s.n(n),c=s(5772),p=s(35497),m=s(52679),x=s(28777),u=s(11059);function h(){let e=(0,o.useParams)(),t=(0,o.useRouter)(),s=e.id,[r,l]=(0,a.useState)([]),[n,h]=(0,a.useState)(!0),[g,v]=(0,a.useState)(null),[S,A]=(0,a.useState)([]),[$,P]=(0,a.useState)(!1),[T,O]=(0,a.useState)(!1),[I,E]=(0,a.useState)(!1),[R,_]=(0,a.useState)(!1),[q,D]=(0,a.useState)(!1),[U,K]=(0,a.useState)(!1),[M,L]=(0,a.useState)(null),[J,z]=(0,a.useState)({}),[F,W]=(0,a.useState)(!1),[V,Z]=(0,a.useState)({}),[B,G]=(0,a.useState)(""),[Q,H]=(0,a.useState)(null),[X,Y]=(0,a.useState)(!1),[ee,et]=(0,a.useState)([]),[es,ei]=(0,a.useState)("__none__"),[ea,er]=(0,a.useState)(!1),[el,eo]=(0,a.useState)(null),[en,ed]=(0,a.useState)(""),[ec,ep]=(0,a.useState)(!0),[em,ex]=(0,a.useState)([]),[eu,eh]=(0,a.useState)([]),[ey,ef]=(0,a.useState)(!1),[eg,eb]=(0,a.useState)(!1),[ev,ej]=(0,a.useState)(!1),{copied:eN,copy:ek}=(0,u.C)(),ew=g?{id:g.id,name:g.name||("anthropic-compatible"===g.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===g.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===g.type?"AC":"OC",apiType:g.apiType,baseUrl:g.baseUrl,type:g.type}:m.zN[s]||m.fg[s]||m.IS[s],eC=!!m.zN[s]||!!m.IS[s],eS=(0,x.KC)(s),eA=(0,m.wG)(s),e$=(0,m.mq)(s),eP=(0,m.gb)(s),eT=e$||eP,eO=eT?s:eA,eI=eT?g?.prefix||s:eA,eE=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&z(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),eR=(0,a.useCallback)(async()=>{ef(!0);try{let e=await fetch(`/api/providers/${s}/access-policy`,{cache:"no-store"});if(e.ok){let t=await e.json();ep(!1!==t.allowAll),ex(t.whitelistedKeyIds||[]),eh(t.keys||[])}}catch(e){console.log("Error fetching access policy:",e)}finally{ef(!1)}},[s]),e_=async(e,t)=>{eb(!0);try{(await fetch(`/api/providers/${s}/access-policy`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({allowAll:e,whitelistedKeyIds:t})})).ok&&(ep(e),ex(t))}catch(e){console.log("Error saving access policy:",e)}finally{eb(!1)}},eq=(0,a.useCallback)(async()=>{try{let[e,t,i,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),r=await e.json(),o=await t.json(),n=await i.json(),d=a.ok?await a.json():{};if(e.ok){let e=(r.connections||[]).filter(e=>e.provider===s);l(e)}i.ok&&A(n.proxyPools||[]);let c=(d.providerStrategies||{})[s]||{};if(eo(c.fallbackStrategy||null),ed(null!=c.stickyRoundRobinLimit?String(c.stickyRoundRobinLimit):"1"),ej(!!d.requireApiKey),t.ok){let e=(o.nodes||[]).find(e=>e.id===s)||null;if(!e&&eT)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===s)||null))break}v(e)}}catch(e){console.log("Error fetching connections:",e)}finally{h(!1)}},[s,eT]),eD=async e=>{try{let t=await fetch(`/api/provider-nodes/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),i=await t.json();t.ok&&(v(i.node),await eq(),D(!1))}catch(e){console.log("Error updating provider node:",e)}},eU=async(e,t)=>{try{let i=await fetch("/api/settings",{cache:"no-store"}),a=(i.ok?await i.json():{}).providerStrategies||{},r={};e&&(r.fallbackStrategy=e),"round-robin"===e&&""!==t&&(r.stickyRoundRobinLimit=Number(t)||3);let l={...a};0===Object.keys(r).length?delete l[s]:l[s]=r,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}};(0,a.useEffect)(()=>{eq(),eE(),eR()},[eq,eE,eR]);let eK=async(e,t,s=eA)=>{let i=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:i,alias:t})});if(e.ok)await eE();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},eM=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await eE()}catch(e){console.log("Error deleting alias:",e)}},eL=async e=>{if(confirm("Delete this connection?"))try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&l(r.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}},eJ=()=>{eq(),P(!1)},ez=async e=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:s,...e})})).ok&&(await eq(),E(!1))}catch(e){console.log("Error saving connection:",e)}},eF=async e=>{try{(await fetch(`/api/providers/${M.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eq(),_(!1))}catch(e){console.log("Error updating connection:",e)}},eW=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&l(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},eV=async(e,t)=>{let s=[...r];[s[e],s[t]]=[s[t],s[e]],l(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await eq()}},eZ=r.filter(e=>ee.includes(e.id));r.length>0&&(ee.length,r.length),(0,a.useEffect)(()=>{et(e=>e.filter(e=>r.some(t=>t.id===e)))},[r]);let eB=(()=>{if(0===eZ.length)return"";let e=new Set(eZ.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return"All selected currently unbound";let s=S.find(e=>e.id===t);return`All selected currently bound to ${s?.name||t}`}return"Selected connections have mixed proxy bindings"})(),eG=()=>{ea||K(!1)},eQ=async()=>{if(0===ee.length)return;let e="__none__"===es?null:es;er(!0);try{let t=[];for(let s of ee)try{let i=await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:e})});t.push(i.ok)}catch(e){console.log("Error applying bulk proxy pool for",s,e),t.push(!1)}let s=t.filter(e=>!e).length;s>0&&alert(`Updated with ${s} failed request(s).`),await eq(),et([]),ei("__none__"),K(!1)}catch(e){console.log("Error applying bulk proxy pool:",e)}finally{er(!1)}},eH=(0,i.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:r.map((e,t)=>(0,i.jsx)("div",{className:"flex items-stretch",children:(0,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(j,{connection:e,proxyPools:S,isOAuth:eC,isFirst:0===t,isLast:t===r.length-1,onMoveUp:()=>eV(t,t-1),onMoveDown:()=>eV(t,t+1),onToggleActive:t=>eW(e.id,t),onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&l(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{L(e),_(!0)},onDelete:()=>eL(e.id)})})},e.id))}),eX=[{value:"__none__",label:"None"},...S.map(e=>({value:e.id,label:e.name}))],eY=0===ee.length?"Select one or more connections, then click Proxy Action.":eB,e0=ee.length>0&&!ea,e1=(0,i.jsx)(p.aF,{isOpen:U,onClose:eG,title:`Proxy Action (${ee.length} selected)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(p.l6,{label:"Proxy Pool",value:es,onChange:e=>ei(e.target.value),options:eX,placeholder:"None"}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:eY}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Selecting None will unbind selected connections from proxy pool."}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(p.$n,{onClick:eQ,fullWidth:!0,disabled:!e0,children:ea?"Applying...":"Apply"}),(0,i.jsx)(p.$n,{onClick:eG,variant:"ghost",fullWidth:!0,disabled:ea,children:"Cancel"})]})]})}),e5=async e=>{if(!Q){H(e);try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${eO}/${e}`})}),s=await t.json();Z(t=>({...t,[e]:s.ok?"ok":"error"})),G(s.ok?"":s.error||"Model not reachable")}catch{Z(t=>({...t,[e]:"error"})),G("Network error")}finally{H(null)}}};return n?(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(p.Qv,{}),(0,i.jsx)(p.Qv,{})]}):ew?(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsxs)("div",{children:[(0,i.jsxs)(d(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,i.jsxs)("div",{className:"flex items-center gap-4",children:[(0,i.jsx)("div",{className:"rounded-lg flex items-center justify-center",style:{backgroundColor:`${ew.color}15`},children:F?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:ew.color},children:ew.textIcon||ew.id.slice(0,2).toUpperCase()}):(0,i.jsx)(c.default,{src:e$&&ew.apiType?"responses"===ew.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":eP?"/providers/anthropic-m.png":`/providers/${ew.id}.png`,alt:ew.name,width:48,height:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",sizes:"48px",onError:()=>W(!0)})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:ew.name}),(0,i.jsxs)("p",{className:"text-text-muted",children:[r.length," connection",1===r.length?"":"s"]})]})]})]}),ew.deprecated&&(0,i.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02] border border-black/[0.05] dark:border-white/[0.05]",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted mt-0.5 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"text-xs text-text-muted leading-relaxed",children:ew.deprecationNotice})]}),eT&&g&&(0,i.jsxs)(p.Zp,{children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:eP?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:[eP?"Messages API":"responses"===g.apiType?"Responses API":"Chat Completions"," \xb7 ",(g.baseUrl||"").replace(/\/$/,""),"/",eP?"messages":"responses"===g.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(p.$n,{size:"sm",icon:"add",onClick:()=>E(!0),disabled:r.length>0,children:"Add"}),(0,i.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>D(!0),children:"Edit"}),(0,i.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{if(confirm(`Delete this ${eP?"Anthropic":"OpenAI"} Compatible node?`))try{(await fetch(`/api/provider-nodes/${s}`,{method:"DELETE"})).ok&&t.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}},children:"Delete"})]})]}),r.length>0&&(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"Only one connection is allowed per compatible node. Add another node if you need more connections."})]}),(0,i.jsxs)(p.Zp,{children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,i.jsx)(p.lM,{checked:"round-robin"===el,onChange:e=>{let t=e?"round-robin":null,s=e?en||"1":en;e&&!en&&ed("1"),eo(t),eU(t,s)}}),"round-robin"===el&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,i.jsx)("input",{type:"number",min:1,value:en,onChange:e=>{var t;ed(t=e.target.value),eU("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===r.length?(0,i.jsxs)("div",{className:"text-center py-12",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:eC?"lock":"key"})}),(0,i.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No connections yet"}),(0,i.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Add your first connection to get started"}),!eT&&(0,i.jsxs)("div",{className:"flex gap-2 justify-center",children:["iflow"===s&&(0,i.jsx)(p.$n,{icon:"cookie",variant:"secondary",onClick:()=>O(!0),children:"Cookie Auth"}),(0,i.jsx)(p.$n,{icon:"add",onClick:()=>eC?P(!0):E(!0),children:"iflow"===s?"OAuth":"Add Connection"})]})]}):(0,i.jsxs)(i.Fragment,{children:[eH,!eT&&(0,i.jsxs)("div",{className:"flex gap-2 mt-4",children:["iflow"===s&&(0,i.jsx)(p.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>O(!0),title:"Add connection using browser cookie",children:"Cookie"}),(0,i.jsx)(p.$n,{size:"sm",icon:"add",onClick:()=>eC?P(!0):E(!0),children:"Add"})]})]})]}),(0,i.jsxs)(p.Zp,{children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Access Policy"}),(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"Control which API keys can use this provider"})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Allow All"}),(0,i.jsx)(p.lM,{checked:ec,onChange:e=>{ep(e),e?e_(!0,[]):e_(!1,em)},disabled:eg})]})]}),!ev&&(0,i.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded-lg bg-yellow-500/5 border border-yellow-500/20 mb-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-600 dark:text-yellow-400 mt-0.5 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 leading-relaxed",children:'Access Policy requires "Require API Key" to be enabled in Settings. Currently all requests bypass API key checks.'})]}),!ec&&(0,i.jsxs)("div",{className:"mt-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted mb-2 font-medium",children:"Whitelisted API Keys:"}),ey?(0,i.jsxs)("div",{className:"flex items-center gap-2 py-4 justify-center text-text-muted",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base animate-spin",children:"progress_activity"}),(0,i.jsx)("span",{className:"text-sm",children:"Loading keys..."})]}):0===eu.length?(0,i.jsxs)("div",{className:"text-center py-6",children:[(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"No API keys found."}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Create API keys in ",(0,i.jsx)("a",{href:"/dashboard/endpoint",className:"text-primary hover:underline",children:"Endpoint"})," settings first."]})]}):(0,i.jsx)("div",{className:"flex flex-col gap-1",children:eu.map(e=>{let t=em.includes(e.id);return(0,i.jsxs)("label",{className:`flex items-center gap-3 px-3 py-2 rounded-lg border cursor-pointer transition-colors ${t?"border-primary/30 bg-primary/5":"border-border hover:border-border/80 hover:bg-sidebar/50"} ${!e.isActive?"opacity-50":""}`,children:[(0,i.jsx)("input",{type:"checkbox",checked:t,onChange:()=>{let s=t?em.filter(t=>t!==e.id):[...em,e.id];ex(s),e_(!1,s)},disabled:eg||!e.isActive,className:"w-4 h-4 rounded border-border text-primary focus:ring-primary/50 accent-[var(--color-primary)]"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"text-sm font-medium truncate",children:e.name}),!e.isActive&&(0,i.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-red-500/10 text-red-500 font-medium",children:"Disabled"})]}),(0,i.jsx)("code",{className:"text-[11px] text-text-muted font-mono",children:e.keyPreview})]}),t&&(0,i.jsx)("span",{className:"material-symbols-outlined text-primary text-base",children:"verified"})]},e.id)})}),eu.length>0&&0===em.length&&(0,i.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded-lg bg-red-500/5 border border-red-500/20 mt-2",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-red-500 mt-0.5 shrink-0",children:"warning"}),(0,i.jsx)("p",{className:"text-xs text-red-600 dark:text-red-400 leading-relaxed",children:"No keys are whitelisted. All API requests to this provider will be denied."})]})]})]}),(0,i.jsxs)(p.Zp,{children:[(0,i.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,i.jsx)("h2",{className:"text-lg font-semibold",children:ew.passthroughModels?"Model Aliases":"Available Models"})}),!!B&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:B}),(()=>{if(eT)return(0,i.jsx)(b,{providerStorageAlias:eO,providerDisplayAlias:eI,modelAliases:J,copied:eN,onCopy:ek,onSetAlias:eK,onDeleteAlias:eM,connections:r,isAnthropic:eP});if(ew.passthroughModels)return(0,i.jsx)(f,{providerAlias:eA,modelAliases:J,copied:eN,onCopy:ek,onSetAlias:eK,onDeleteAlias:eM});let e=Object.entries(J).filter(([e,t])=>{let s=`${eO}/`;if(!t.startsWith(s))return!1;let i=t.slice(s.length);return!eS.some(e=>e.id===i)&&e===i}).map(([e,t])=>({id:t.slice(`${eO}/`.length),alias:e,fullModel:t}));return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[eS.map(e=>{let t=`${eO}/${e.id}`,a=`${s}/${e.id}`,l=Object.entries(J).find(([,e])=>e===t||e===a)?.[0];return(0,i.jsx)(y,{model:e,fullModel:`${eI}/${e.id}`,alias:l,copied:eN,onCopy:ek,onSetAlias:t=>eK(e.id,t,eO),onDeleteAlias:()=>eM(l),testStatus:V[e.id],onTest:r.length>0?()=>e5(e.id):void 0,isTesting:Q===e.id},e.id)}),e.map(e=>(0,i.jsx)(y,{model:{id:e.id},fullModel:`${eI}/${e.id}`,alias:e.alias,copied:eN,onCopy:ek,onSetAlias:()=>{},onDeleteAlias:()=>eM(e.alias),testStatus:V[e.id],onTest:r.length>0?()=>e5(e.id):void 0,isTesting:Q===e.id,isCustom:!0},e.id)),(0,i.jsxs)("button",{onClick:()=>Y(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})})()]}),e1,"kiro"===s?(0,i.jsx)(p.Mh,{isOpen:$,providerInfo:ew,onSuccess:eJ,onClose:()=>P(!1)}):"cursor"===s?(0,i.jsx)(p.G9,{isOpen:$,onSuccess:eJ,onClose:()=>P(!1)}):(0,i.jsx)(p.LF,{isOpen:$,provider:s,providerInfo:ew,onSuccess:eJ,onClose:()=>P(!1)}),"iflow"===s&&(0,i.jsx)(p.vE,{isOpen:T,onSuccess:()=>{eq(),O(!1)},onClose:()=>O(!1)}),(0,i.jsx)(N,{isOpen:I,provider:s,providerName:ew.name,isCompatible:eT,isAnthropic:eP,proxyPools:S,onSave:ez,onClose:()=>E(!1)}),(0,i.jsx)(k,{isOpen:R,connection:M,proxyPools:S,onSave:eF,onClose:()=>_(!1)}),eT&&(0,i.jsx)(w,{isOpen:q,node:g,onSave:eD,onClose:()=>D(!1),isAnthropic:eP}),!eT&&!ew?.passthroughModels&&(0,i.jsx)(C,{isOpen:X,providerAlias:eO,providerDisplayAlias:eI,onSave:async e=>{await eK(e,e,eO),Y(!1)},onClose:()=>Y(!1)})]}):(0,i.jsxs)("div",{className:"text-center py-20",children:[(0,i.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,i.jsx)(d(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}function y({model:e,fullModel:t,alias:s,copied:a,onCopy:r,testStatus:l,isCustom:o,onDeleteAlias:n,onTest:d,isTesting:c}){let p="ok"===l?"#22c55e":"error"===l?"#ef4444":void 0;return(0,i.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base",style:p?{color:p}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"smart_toy"}),(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),d&&(0,i.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,title:"Test model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,i.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:"Copy model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),o&&(0,i.jsx)("button",{onClick:n,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function f({providerAlias:e,modelAliases:t,copied:s,onCopy:r,onSetAlias:l,onDeleteAlias:o}){let[n,d]=(0,a.useState)(""),[c,m]=(0,a.useState)(!1),x=Object.entries(t).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,s])=>({modelId:s.replace(`${e}/`,""),fullModel:s,alias:t})),u=async()=>{let e;if(!n.trim()||c)return;let s=n.trim(),i=(e=s.split("/"))[e.length-1];if(t[i])return void alert(`Alias "${i}" already exists. Please use a different model or edit existing alias.`);m(!0);try{await l(s,i),d("")}catch(e){console.log("Error adding model:",e)}finally{m(!1)}};return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"OpenRouter supports any model. Add models and create aliases for quick access."}),(0,i.jsxs)("div",{className:"flex items-end gap-2",children:[(0,i.jsxs)("div",{className:"flex-1",children:[(0,i.jsx)("label",{htmlFor:"new-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID (from OpenRouter)"}),(0,i.jsx)("input",{id:"new-model-input",type:"text",value:n,onChange:e=>d(e.target.value),onKeyDown:e=>"Enter"===e.key&&u(),placeholder:"anthropic/claude-3-opus",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,i.jsx)(p.$n,{size:"sm",icon:"add",onClick:u,disabled:!n.trim()||c,children:c?"Adding...":"Add"})]}),x.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:x.map(({modelId:e,fullModel:t,alias:a})=>(0,i.jsx)(g,{modelId:e,fullModel:t,copied:s,onCopy:r,onDeleteAlias:()=>o(a)},t))})]})}function g({modelId:e,fullModel:t,copied:s,onCopy:a,onDeleteAlias:r,onTest:l,testStatus:o,isTesting:n}){let d="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,i.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,i.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:"Copy model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),l&&(0,i.jsx)("button",{onClick:l,disabled:n,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",title:"Test model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:n?{animation:"spin 1s linear infinite"}:void 0,children:n?"progress_activity":"science"})})]})]}),(0,i.jsx)("button",{onClick:r,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function b({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,copied:r,onCopy:l,onSetAlias:o,onDeleteAlias:n,connections:d,isAnthropic:c}){let[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(!1),[y,f]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[N,k]=(0,a.useState)({}),w=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),i=await s.json();k(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{k(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=Object.entries(s).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,s])=>({modelId:s.replace(`${e}/`,""),fullModel:s,alias:t})),S=i=>{let a,r=`${e}/${i}`;if(Object.values(s).includes(r))return null;let l=(a=i.split("/"))[a.length-1];if(!s[l])return l;let o=`${t}-${l}`;return s[o]?null:o},A=async()=>{if(!m.trim()||u)return;let t=m.trim(),s=S(t);if(!s)return void alert("All suggested aliases already exist. Please choose a different model or remove conflicting aliases.");h(!0);try{await o(t,s,e),x("")}catch(e){console.log("Error adding model:",e)}finally{h(!1)}},$=async()=>{if(y)return;let t=d.find(e=>!1!==e.isActive);if(t){f(!0);try{let s=await fetch(`/api/providers/${t.id}/models`),i=await s.json();if(!s.ok)return void alert(i.error||"Failed to import models");let a=i.models||[];if(0===a.length)return void alert("No models returned from /models.");let r=0;for(let t of a){let s=t.id||t.name||t.model;if(!s)continue;let i=S(s);i&&(await o(s,i,e),r+=1)}0===r&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{f(!1)}}},P=d.some(e=>!1!==e.isActive);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",c?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,i.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,i.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,i.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,i.jsx)("input",{id:"new-compatible-model-input",type:"text",value:m,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&A(),placeholder:c?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,i.jsx)(p.$n,{size:"sm",icon:"add",onClick:A,disabled:!m.trim()||u,children:u?"Adding...":"Add"}),(0,i.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"download",onClick:$,disabled:!P||y,children:y?"Importing...":"Import from /models"})]}),!P&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({modelId:e,fullModel:s,alias:a})=>(0,i.jsx)(g,{modelId:e,fullModel:`${t}/${e}`,copied:r,onCopy:l,onDeleteAlias:()=>n(a),onTest:d.length>0?()=>w(e):void 0,testStatus:N[e],isTesting:v===e},s))})]})}function v({until:e}){let[t,s]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let i=Math.floor(t/1e3);if(i<60)s(`${i}s`);else if(i<3600)s(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);s(`${e}h ${t}m`)}};t();let i=setInterval(t,1e3);return()=>clearInterval(i)},[e]),t)?(0,i.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function j({connection:e,proxyPools:t,isOAuth:s,isFirst:r,isLast:l,onMoveUp:o,onMoveDown:n,onToggleActive:d,onUpdateProxy:c,onEdit:m,onDelete:x}){let[u,h]=(0,a.useState)(!1),[y,f]=(0,a.useState)(!1),g=(0,a.useRef)(null),b=new Map((t||[]).map(e=>[e.id,e])),N=e.providerSpecificData?.proxyPoolId||null,k=N?b.get(N):null,w=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!N||w,S=k?`Pool: ${k.name}`:N?`Pool: ${N} (inactive/missing)`:w?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",A="";if(k?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=k?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);A=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{A=t}}let $=k?.noProxy||e.providerSpecificData?.connectionNoProxy||"",P="default";k?.isActive===!0?P="success":(N||w)&&(P="error"),(0,a.useEffect)(()=>{if(!u)return;let e=e=>{g.current&&!g.current.contains(e.target)&&h(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[u]);let T=async e=>{f(!0);try{await c("__none__"===e?null:e)}finally{f(!1),h(!1)}},O=s?e.name||e.email||e.displayName||"OAuth Account":e.name,[I,E]=(0,a.useState)(!1),R=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{E(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=R?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[R]);let _="unavailable"!==e.testStatus||I?e.testStatus:"active";return(0,i.jsxs)("div",{className:`group flex items-center justify-between p-3 rounded-lg hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,i.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,i.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:s?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:O}),(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,i.jsx)(p.Ex,{variant:!1===e.isActive?"default":"active"===_||"success"===_?"success":"error"===_||"expired"===_||"unavailable"===_?"error":"default",size:"sm",dot:!0,children:!1===e.isActive?"disabled":_||"Unknown"}),C&&(0,i.jsx)(p.Ex,{variant:P,size:"sm",children:"Proxy"}),I&&!1!==e.isActive&&(0,i.jsx)(v,{until:R}),e.lastError&&!1!==e.isActive&&(0,i.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]})]}),C&&(0,i.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,i.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:S,children:S}),A&&(0,i.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:A}),$&&(0,i.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:$,children:["no_proxy: ",$]})]})]})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsxs)("div",{className:"flex gap-1",children:[(t||[]).length>0&&(0,i.jsxs)("div",{className:"relative",ref:g,children:[(0,i.jsxs)("button",{onClick:()=>h(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),u&&(0,i.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,i.jsx)("button",{onClick:()=>T("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!N?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,i.jsx)("button",{onClick:()=>T(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${N===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,i.jsxs)("button",{onClick:m,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,i.jsxs)("button",{onClick:x,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,i.jsx)(p.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}function N({isOpen:e,provider:t,providerName:s,isCompatible:r,isAnthropic:l,proxyPools:o,onSave:n,onClose:d}){let c="__none__",[m,x]=(0,a.useState)({name:"",apiKey:"",priority:1,proxyPoolId:c}),[u,h]=(0,a.useState)(!1),[y,f]=(0,a.useState)(null),[g,b]=(0,a.useState)(!1),v=async()=>{h(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:m.apiKey})}),s=await e.json();f(s.valid?"success":"failed")}catch{f("failed")}finally{h(!1)}},j=async()=>{if(t&&m.apiKey){b(!0);try{let e=!1;try{h(!0),f(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:m.apiKey})});e=!!(await s.json()).valid,f(e?"success":"failed")}catch{f("failed")}finally{h(!1)}await n({name:m.name,apiKey:m.apiKey,priority:m.priority,proxyPoolId:m.proxyPoolId===c?null:m.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:void 0})}finally{b(!1)}}};return t?(0,i.jsx)(p.aF,{isOpen:e,title:`Add ${s||t} API Key`,onClose:d,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(p.pd,{label:"Name",value:m.name,onChange:e=>x({...m,name:e.target.value}),placeholder:"Production Key"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(p.pd,{label:"API Key",type:"password",value:m.apiKey,onChange:e=>x({...m,apiKey:e.target.value}),className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(p.$n,{onClick:v,disabled:!m.apiKey||u||g,variant:"secondary",children:u?"Checking...":"Check"})})]}),y&&(0,i.jsx)(p.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),r&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:l?`Validation checks ${s||"Anthropic Compatible"} by verifying the API key.`:`Validation checks ${s||"OpenAI Compatible"} via /models on your base URL.`}),(0,i.jsx)(p.pd,{label:"Priority",type:"number",value:m.priority,onChange:e=>x({...m,priority:Number.parseInt(e.target.value)||1})}),(0,i.jsx)(p.l6,{label:"Proxy Pool",value:m.proxyPoolId,onChange:e=>x({...m,proxyPoolId:e.target.value}),options:[{value:c,label:"None"},...(o||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(o||[]).length&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(p.$n,{onClick:j,fullWidth:!0,disabled:!m.name||!m.apiKey||g,children:g?"Saving...":"Save"}),(0,i.jsx)(p.$n,{onClick:d,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function k({isOpen:e,connection:t,proxyPools:s,onSave:r,onClose:l}){let[o,n]=(0,a.useState)({name:"",priority:1,apiKey:""}),[d,c]=(0,a.useState)(!1),[x,u]=(0,a.useState)(null),[h,y]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),[b,v]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t&&(n({name:t.name||"",priority:t.priority||1,apiKey:""}),u(null),g(null))},[t]);let j=async()=>{if(t?.provider){c(!0),u(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),s=await e.json();u(s.valid?"success":"failed")}catch{u("failed")}finally{c(!1)}}},N=async()=>{if(t?.provider&&o.apiKey){y(!0),g(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:o.apiKey})}),s=await e.json();g(s.valid?"success":"failed")}catch{g("failed")}finally{y(!1)}}},w=async()=>{v(!0);try{let e={name:o.name,priority:o.priority};if(!C&&o.apiKey){e.apiKey=o.apiKey;let s="success"===f;if(!s)try{y(!0),g(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:o.apiKey})});s=!!(await e.json()).valid,g(s?"success":"failed")}catch{g("failed")}finally{y(!1)}s&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null)}await r(e)}finally{v(!1)}};if(!t)return null;let C="oauth"===t.authType,S=(0,m.mq)(t.provider)||(0,m.gb)(t.provider);return(0,i.jsx)(p.aF,{isOpen:e,title:"Edit Connection",onClose:l,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(p.pd,{label:"Name",value:o.name,onChange:e=>n({...o,name:e.target.value}),placeholder:C?"Account name":"Production Key"}),C&&t.email&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,i.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,i.jsx)("p",{className:"font-medium",children:t.email})]}),(0,i.jsx)(p.pd,{label:"Priority",type:"number",value:o.priority,onChange:e=>n({...o,priority:Number.parseInt(e.target.value)||1})}),!C&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(p.pd,{label:"API Key",type:"password",value:o.apiKey,onChange:e=>n({...o,apiKey:e.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(p.$n,{onClick:N,disabled:!o.apiKey||h||b,variant:"secondary",children:h?"Checking...":"Check"})})]}),f&&(0,i.jsx)(p.Ex,{variant:"success"===f?"success":"error",children:"success"===f?"Valid":"Invalid"})]}),!S&&(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)(p.$n,{onClick:j,variant:"secondary",disabled:d,children:d?"Testing...":"Test Connection"}),x&&(0,i.jsx)(p.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Failed"})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(p.$n,{onClick:w,fullWidth:!0,disabled:b,children:b?"Saving...":"Save"}),(0,i.jsx)(p.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function w({isOpen:e,node:t,onSave:s,onClose:r,isAnthropic:l}){let[o,n]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,c]=(0,a.useState)(!1),[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(""),[y,f]=(0,a.useState)(!1),[g,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&n({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(l?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,l]);let v=async()=>{if(o.name.trim()&&o.prefix.trim()&&o.baseUrl.trim()){c(!0);try{let e={name:o.name,prefix:o.prefix,baseUrl:o.baseUrl};l||(e.apiType=o.apiType),await s(e)}finally{c(!1)}}},j=async()=>{f(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:o.baseUrl,apiKey:m,type:l?"anthropic-compatible":"openai-compatible",modelId:u.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{f(!1)}};return t?(0,i.jsx)(p.aF,{isOpen:e,title:`Edit ${l?"Anthropic":"OpenAI"} Compatible`,onClose:r,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(p.pd,{label:"Name",value:o.name,onChange:e=>n({...o,name:e.target.value}),placeholder:`${l?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,i.jsx)(p.pd,{label:"Prefix",value:o.prefix,onChange:e=>n({...o,prefix:e.target.value}),placeholder:l?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!l&&(0,i.jsx)(p.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:o.apiType,onChange:e=>n({...o,apiType:e.target.value})}),(0,i.jsx)(p.pd,{label:"Base URL",value:o.baseUrl,onChange:e=>n({...o,baseUrl:e.target.value}),placeholder:l?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${l?"Anthropic":"OpenAI"}-compatible API.`}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(p.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:e=>x(e.target.value),className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(p.$n,{onClick:j,disabled:!m||y||!o.baseUrl.trim(),variant:"secondary",children:y?"Checking...":"Check"})})]}),(0,i.jsx)(p.pd,{label:"Model ID (optional)",value:u,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),g&&(0,i.jsx)(p.Ex,{variant:"success"===g?"success":"error",children:"success"===g?"Valid":"Invalid"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(p.$n,{onClick:v,fullWidth:!0,disabled:!o.name.trim()||!o.prefix.trim()||!o.baseUrl.trim()||d,children:d?"Saving...":"Save"}),(0,i.jsx)(p.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function C({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:r,onClose:l}){let[o,n]=(0,a.useState)(""),[d,c]=(0,a.useState)(null),[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&(n(""),c(null),x(""))},[e]);let y=async()=>{if(o.trim()){c("testing"),x("");try{let e=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${o.trim()}`})}),s=await e.json();c(s.ok?"ok":"error"),x(s.error||"")}catch(e){c("error"),x(e.message)}}},f=async()=>{if(o.trim()&&!u){h(!0);try{await r(o.trim())}finally{h(!1)}}};return(0,i.jsx)(p.aF,{isOpen:e,onClose:l,title:"Add Custom Model",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("input",{type:"text",value:o,onChange:e=>{n(e.target.value),c(null),x("")},onKeyDown:e=>{"Enter"===e.key&&y()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,i.jsx)(p.$n,{variant:"secondary",icon:"science",loading:"testing"===d,onClick:y,disabled:!o.trim()||"testing"===d,children:"testing"===d?"Testing...":"Test"})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,i.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:o.trim()||"model-id"})]})]}),"ok"===d&&(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===d&&(0,i.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,i.jsx)("span",{children:m||"Model not reachable"})]}),(0,i.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,i.jsx)(p.$n,{onClick:l,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,i.jsx)(p.$n,{onClick:f,fullWidth:!0,size:"sm",disabled:!o.trim()||u,children:u?"Adding...":"Add Model"})]})]})})}y.propTypes={model:l().shape({id:l().string.isRequired}).isRequired,fullModel:l().string.isRequired,alias:l().string,copied:l().string,onCopy:l().func.isRequired,testStatus:l().oneOf(["ok","error"]),isCustom:l().bool,onDeleteAlias:l().func,onTest:l().func,isTesting:l().bool},f.propTypes={providerAlias:l().string.isRequired,modelAliases:l().object.isRequired,copied:l().string,onCopy:l().func.isRequired,onSetAlias:l().func.isRequired,onDeleteAlias:l().func.isRequired},g.propTypes={modelId:l().string.isRequired,fullModel:l().string.isRequired,copied:l().string,onCopy:l().func.isRequired,onDeleteAlias:l().func.isRequired,onTest:l().func,testStatus:l().oneOf(["ok","error"]),isTesting:l().bool},b.propTypes={providerStorageAlias:l().string.isRequired,providerDisplayAlias:l().string.isRequired,modelAliases:l().object.isRequired,copied:l().string,onCopy:l().func.isRequired,onSetAlias:l().func.isRequired,onDeleteAlias:l().func.isRequired,connections:l().arrayOf(l().shape({id:l().string,isActive:l().bool})).isRequired,isAnthropic:l().bool},v.propTypes={until:l().string.isRequired},j.propTypes={connection:l().shape({id:l().string,name:l().string,email:l().string,displayName:l().string,modelLockUntil:l().string,testStatus:l().string,isActive:l().bool,lastError:l().string,priority:l().number,globalPriority:l().number}).isRequired,proxyPools:l().arrayOf(l().shape({id:l().string,name:l().string,proxyUrl:l().string,noProxy:l().string,isActive:l().bool})),isOAuth:l().bool.isRequired,isFirst:l().bool.isRequired,isLast:l().bool.isRequired,onMoveUp:l().func.isRequired,onMoveDown:l().func.isRequired,onToggleActive:l().func.isRequired,onUpdateProxy:l().func,onEdit:l().func.isRequired,onDelete:l().func.isRequired},N.propTypes={isOpen:l().bool.isRequired,provider:l().string,providerName:l().string,isCompatible:l().bool,isAnthropic:l().bool,proxyPools:l().arrayOf(l().shape({id:l().string,name:l().string})),onSave:l().func.isRequired,onClose:l().func.isRequired},k.propTypes={isOpen:l().bool.isRequired,connection:l().shape({id:l().string,name:l().string,email:l().string,priority:l().number,authType:l().string,provider:l().string,providerSpecificData:l().object}),proxyPools:l().arrayOf(l().shape({id:l().string,name:l().string})),onSave:l().func.isRequired,onClose:l().func.isRequired},w.propTypes={isOpen:l().bool.isRequired,node:l().shape({id:l().string,name:l().string,prefix:l().string,apiType:l().string,baseUrl:l().string}),onSave:l().func.isRequired,onClose:l().func.isRequired,isAnthropic:l().bool},C.propTypes={isOpen:l().bool.isRequired,providerAlias:l().string.isRequired,providerDisplayAlias:l().string.isRequired,onSave:l().func.isRequired,onClose:l().func.isRequired}}},e=>{e.O(0,[2574,3862,548,5772,2652,5497,8441,3794,7358],()=>e(e.s=16113)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1817,1860,1949,2121,2284,2296,2354,2785,2797,2802,2919,2922,3025,3038,3079,3102,3397,3472,3549,3552,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,6780,6819,6919,6988,7241,7429,7442,7445,7508,7520,7758,7824,7851,8167,8207,8246,8453,8489,8573,8648,8814,8948,8974,8975,9027,9069,9088,9141,9157,9199,9321,9461,9749],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1817,1860,1949,2121,2284,2296,2354,2785,2797,2802,2919,2922,3025,3038,3079,3102,3397,3472,3549,3552,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,6780,6819,6919,6988,7241,7429,7442,7445,7508,7520,7758,7824,7851,8167,8207,8246,8453,8489,8573,8648,8814,8948,8974,8975,9027,9069,9088,9134,9141,9157,9199,9321,9461,9749],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1817,1860,1949,2121,2284,2296,2354,2785,2797,2802,2919,2922,3025,3038,3079,3102,3397,3472,3549,3552,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,6780,6819,6919,6988,7241,7429,7442,7445,7508,7520,7758,7824,7851,8167,8207,8246,8453,8489,8573,8648,8814,8948,8974,8975,9027,9069,9088,9141,9157,9199,9321,9461,9749],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1817,1860,1949,2121,2284,2296,2354,2785,2797,2802,2919,2922,3025,3038,3079,3102,3397,3472,3549,3552,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,6780,6819,6919,6988,7241,7429,7442,7445,7508,7520,7758,7824,7851,8167,8207,8246,8453,8489,8573,8648,8814,8948,8974,8975,9027,9069,9088,9134,9141,9157,9199,9321,9461,9749],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1817,1860,1949,2121,2284,2296,2354,2785,2797,2802,2919,2922,3025,3038,3079,3102,3397,3472,3549,3552,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,6780,6819,6919,6988,7241,7429,7442,7445,7508,7520,7758,7824,7851,8167,8207,8246,8453,8489,8573,8648,8814,8948,8974,8975,9027,9069,9088,9141,9157,9199,9321,9461,9749],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1817,1860,1949,2121,2284,2296,2354,2785,2797,2802,2919,2922,3025,3038,3079,3102,3397,3472,3549,3552,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,6780,6819,6919,6988,7241,7429,7442,7445,7508,7520,7758,7824,7851,8167,8207,8246,8453,8489,8573,8648,8814,8948,8974,8975,9027,9069,9088,9134,9141,9157,9199,9321,9461,9749],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1817,1860,1949,2121,2284,2296,2354,2785,2797,2802,2919,2922,3025,3038,3079,3102,3397,3472,3549,3552,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,6780,6819,6919,6988,7241,7429,7442,7445,7508,7520,7758,7824,7851,8167,8207,8246,8453,8489,8573,8648,8814,8948,8974,8975,9027,9069,9088,9134,9141,9157,9199,9321,9461,9749],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1817,1860,1949,2121,2284,2296,2354,2785,2797,2802,2919,2922,3025,3038,3079,3102,3397,3472,3549,3552,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,6780,6819,6919,6988,7241,7429,7442,7445,7508,7520,7758,7824,7851,8167,8207,8246,8453,8489,8573,8648,8814,8948,8974,8975,9027,9069,9088,9134,9141,9157,9199,9321,9461,9749],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1817,1860,1949,2121,2284,2296,2354,2785,2797,2802,2919,2922,3025,3038,3079,3102,3397,3472,3549,3552,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,6780,6819,6919,6988,7241,7429,7442,7445,7508,7520,7758,7824,7851,8167,8207,8246,8453,8489,8573,8648,8814,8948,8974,8975,9027,9069,9088,9134,9141,9157,9199,9321,9461,9749],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1817,1860,1949,2121,2284,2296,2354,2785,2797,2802,2919,2922,3025,3038,3079,3102,3397,3472,3549,3552,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,6780,6819,6919,6988,7241,7429,7442,7445,7508,7520,7758,7824,7851,8167,8207,8246,8453,8489,8573,8648,8814,8948,8974,8975,9027,9069,9088,9134,9141,9157,9199,9321,9461,9749],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1817,1860,1949,2121,2284,2296,2354,2785,2797,2802,2919,2922,3025,3038,3079,3102,3397,3472,3549,3552,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,6780,6819,6919,6988,7241,7429,7442,7445,7508,7520,7758,7824,7851,8167,8207,8246,8453,8489,8573,8648,8814,8948,8974,8975,9027,9069,9088,9134,9141,9157,9199,9321,9461,9749],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);