@thangnm.nip/irouter 0.0.2 → 0.0.4

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 (669) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +10 -5
  3. package/app/.next/build-manifest.json +3 -3
  4. package/app/.next/prerender-manifest.json +24 -0
  5. package/app/.next/required-server-files.json +3 -3
  6. package/app/.next/routes-manifest.json +36 -0
  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.js.nft.json +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  11. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  14. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/employees/[keyId]/page.js +2 -0
  17. package/app/.next/server/app/(dashboard)/dashboard/employees/[keyId]/page.js.nft.json +1 -0
  18. package/app/.next/server/app/(dashboard)/dashboard/employees/[keyId]/page_client-reference-manifest.js +1 -0
  19. package/app/.next/server/app/(dashboard)/dashboard/employees/page.js +2 -0
  20. package/app/.next/server/app/(dashboard)/dashboard/employees/page.js.nft.json +1 -0
  21. package/app/.next/server/app/(dashboard)/dashboard/employees/page_client-reference-manifest.js +1 -0
  22. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +4 -2
  23. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  26. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  29. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  32. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  33. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  35. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  36. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  38. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  39. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  41. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  42. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  43. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  44. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  45. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  46. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  47. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  48. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  49. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  50. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  51. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  52. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  53. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  54. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  55. package/app/.next/server/app/_global-error/page.js +3 -3
  56. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  57. package/app/.next/server/app/_global-error.html +1 -1
  58. package/app/.next/server/app/_global-error.rsc +1 -1
  59. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  60. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  61. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  62. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  63. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  64. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  65. package/app/.next/server/app/_not-found/page.js +2 -2
  66. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  67. package/app/.next/server/app/_not-found.html +1 -1
  68. package/app/.next/server/app/_not-found.rsc +5 -5
  69. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +5 -5
  70. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  71. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  72. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  73. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  74. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  75. package/app/.next/server/app/api/auth/login/route.js +1 -1
  76. package/app/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  77. package/app/.next/server/app/api/auth/logout/route.js +1 -1
  78. package/app/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  79. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  80. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  81. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +2 -2
  82. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  83. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +1 -1
  84. package/app/.next/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  85. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
  86. package/app/.next/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  87. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  88. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  89. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
  90. package/app/.next/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  91. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  92. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  93. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  94. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  95. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  96. package/app/.next/server/app/api/cloud/auth/route.js.nft.json +1 -1
  97. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  98. package/app/.next/server/app/api/cloud/credentials/update/route.js.nft.json +1 -1
  99. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  100. package/app/.next/server/app/api/cloud/model/resolve/route.js.nft.json +1 -1
  101. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  102. package/app/.next/server/app/api/cloud/models/alias/route.js.nft.json +1 -1
  103. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  104. package/app/.next/server/app/api/combos/[id]/route.js.nft.json +1 -1
  105. package/app/.next/server/app/api/combos/route.js +1 -1
  106. package/app/.next/server/app/api/combos/route.js.nft.json +1 -1
  107. package/app/.next/server/app/api/employees/[keyId]/stats/route.js +1 -0
  108. package/app/.next/server/app/api/employees/[keyId]/stats/route.js.nft.json +1 -0
  109. package/app/.next/server/app/api/employees/[keyId]/stats/route_client-reference-manifest.js +1 -0
  110. package/app/.next/server/app/api/employees/stats/route.js +1 -0
  111. package/app/.next/server/app/api/employees/stats/route.js.nft.json +1 -0
  112. package/app/.next/server/app/api/employees/stats/route_client-reference-manifest.js +1 -0
  113. package/app/.next/server/app/api/init/route.js +1 -1
  114. package/app/.next/server/app/api/init/route.js.nft.json +1 -1
  115. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  116. package/app/.next/server/app/api/keys/[id]/route.js.nft.json +1 -1
  117. package/app/.next/server/app/api/keys/route.js +1 -1
  118. package/app/.next/server/app/api/keys/route.js.nft.json +1 -1
  119. package/app/.next/server/app/api/locale/route.js +1 -1
  120. package/app/.next/server/app/api/locale/route.js.nft.json +1 -1
  121. package/app/.next/server/app/api/models/alias/route.js +1 -1
  122. package/app/.next/server/app/api/models/alias/route.js.nft.json +1 -1
  123. package/app/.next/server/app/api/models/route.js +1 -1
  124. package/app/.next/server/app/api/models/route.js.nft.json +1 -1
  125. package/app/.next/server/app/api/models/test/route.js +1 -1
  126. package/app/.next/server/app/api/models/test/route.js.nft.json +1 -1
  127. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  128. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  129. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  130. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  131. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  132. package/app/.next/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  133. package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
  134. package/app/.next/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  135. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  136. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  137. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  138. package/app/.next/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  139. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  140. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  141. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  142. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  143. package/app/.next/server/app/api/pricing/route.js +1 -1
  144. package/app/.next/server/app/api/pricing/route.js.nft.json +1 -1
  145. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  146. package/app/.next/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  147. package/app/.next/server/app/api/provider-nodes/route.js +1 -1
  148. package/app/.next/server/app/api/provider-nodes/route.js.nft.json +1 -1
  149. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  150. package/app/.next/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  151. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  152. package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  153. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  154. package/app/.next/server/app/api/providers/[id]/route.js.nft.json +1 -1
  155. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  156. package/app/.next/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  157. package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
  158. package/app/.next/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  159. package/app/.next/server/app/api/providers/client/route.js +1 -1
  160. package/app/.next/server/app/api/providers/client/route.js.nft.json +1 -1
  161. package/app/.next/server/app/api/providers/route.js +1 -1
  162. package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
  163. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  164. package/app/.next/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  165. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  166. package/app/.next/server/app/api/providers/validate/route.js.nft.json +1 -1
  167. package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
  168. package/app/.next/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  169. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  170. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  171. package/app/.next/server/app/api/proxy-pools/route.js +1 -1
  172. package/app/.next/server/app/api/proxy-pools/route.js.nft.json +1 -1
  173. package/app/.next/server/app/api/settings/database/route.js +1 -1
  174. package/app/.next/server/app/api/settings/database/route.js.nft.json +1 -1
  175. package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
  176. package/app/.next/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  177. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  178. package/app/.next/server/app/api/settings/require-login/route.js.nft.json +1 -1
  179. package/app/.next/server/app/api/settings/route.js +1 -1
  180. package/app/.next/server/app/api/settings/route.js.nft.json +1 -1
  181. package/app/.next/server/app/api/shutdown/route.js +1 -1
  182. package/app/.next/server/app/api/shutdown/route.js.nft.json +1 -1
  183. package/app/.next/server/app/api/tags/route.js +1 -1
  184. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  185. package/app/.next/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  186. package/app/.next/server/app/api/translator/console-logs/stream/route.js +2 -2
  187. package/app/.next/server/app/api/translator/load/route.js +1 -1
  188. package/app/.next/server/app/api/translator/load/route.js.nft.json +1 -1
  189. package/app/.next/server/app/api/translator/save/route.js +1 -1
  190. package/app/.next/server/app/api/translator/save/route.js.nft.json +1 -1
  191. package/app/.next/server/app/api/translator/send/route.js +1 -1
  192. package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
  193. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  194. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  195. package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
  196. package/app/.next/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  197. package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
  198. package/app/.next/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  199. package/app/.next/server/app/api/tunnel/status/route.js +1 -1
  200. package/app/.next/server/app/api/tunnel/status/route.js.nft.json +1 -1
  201. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  202. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  203. package/app/.next/server/app/api/usage/chart/route.js +1 -1
  204. package/app/.next/server/app/api/usage/chart/route.js.nft.json +1 -1
  205. package/app/.next/server/app/api/usage/history/route.js +1 -1
  206. package/app/.next/server/app/api/usage/history/route.js.nft.json +1 -1
  207. package/app/.next/server/app/api/usage/logs/route.js +1 -1
  208. package/app/.next/server/app/api/usage/logs/route.js.nft.json +1 -1
  209. package/app/.next/server/app/api/usage/providers/route.js +1 -1
  210. package/app/.next/server/app/api/usage/providers/route.js.nft.json +1 -1
  211. package/app/.next/server/app/api/usage/request-details/[id]/route.js +1 -0
  212. package/app/.next/server/app/api/usage/request-details/[id]/route.js.nft.json +1 -0
  213. package/app/.next/server/app/api/usage/request-details/[id]/route_client-reference-manifest.js +1 -0
  214. package/app/.next/server/app/api/usage/request-details/route.js +1 -1
  215. package/app/.next/server/app/api/usage/request-details/route.js.nft.json +1 -1
  216. package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
  217. package/app/.next/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  218. package/app/.next/server/app/api/usage/stats/route.js +1 -1
  219. package/app/.next/server/app/api/usage/stats/route.js.nft.json +1 -1
  220. package/app/.next/server/app/api/usage/stream/route.js +2 -2
  221. package/app/.next/server/app/api/usage/stream/route.js.nft.json +1 -1
  222. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  223. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  224. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  225. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  226. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  227. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  228. package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
  229. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  230. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  231. package/app/.next/server/app/api/v1/models/route.js +1 -1
  232. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  233. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  234. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  235. package/app/.next/server/app/api/v1/route.js +1 -1
  236. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  237. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  238. package/app/.next/server/app/api/v1beta/models/route.js +1 -1
  239. package/app/.next/server/app/api/v1internal/route.js +1 -1
  240. package/app/.next/server/app/api/v1internal/route.js.nft.json +1 -1
  241. package/app/.next/server/app/api/version/route.js +1 -1
  242. package/app/.next/server/app/callback/page.js +2 -2
  243. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  244. package/app/.next/server/app/callback.html +1 -1
  245. package/app/.next/server/app/callback.rsc +5 -5
  246. package/app/.next/server/app/callback.segments/_full.segment.rsc +5 -5
  247. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  248. package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
  249. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  250. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  251. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  252. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  253. package/app/.next/server/app/dashboard/cli-tools.rsc +7 -7
  254. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  255. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  256. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  257. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  258. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  259. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  260. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  261. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  262. package/app/.next/server/app/dashboard/combos.html +1 -1
  263. package/app/.next/server/app/dashboard/combos.rsc +7 -7
  264. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  265. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  266. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  267. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  268. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  269. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  270. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  271. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  272. package/app/.next/server/app/dashboard/employees.html +1 -0
  273. package/app/.next/server/app/dashboard/employees.meta +17 -0
  274. package/app/.next/server/app/dashboard/employees.rsc +26 -0
  275. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk/dashboard/employees/__PAGE__.segment.rsc +9 -0
  276. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk/dashboard/employees.segment.rsc +5 -0
  277. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +5 -0
  278. package/app/.next/server/app/dashboard/employees.segments/!KGRhc2hib2FyZCk.segment.rsc +6 -0
  279. package/app/.next/server/app/dashboard/employees.segments/_full.segment.rsc +26 -0
  280. package/app/.next/server/app/dashboard/employees.segments/_head.segment.rsc +6 -0
  281. package/app/.next/server/app/dashboard/employees.segments/_index.segment.rsc +8 -0
  282. package/app/.next/server/app/dashboard/employees.segments/_tree.segment.rsc +5 -0
  283. package/app/.next/server/app/dashboard/endpoint.html +1 -1
  284. package/app/.next/server/app/dashboard/endpoint.rsc +7 -7
  285. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  286. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  287. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  288. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  289. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  290. package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  291. package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  292. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  293. package/app/.next/server/app/dashboard/mitm.html +1 -1
  294. package/app/.next/server/app/dashboard/mitm.rsc +7 -7
  295. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  296. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  297. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  298. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  299. package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
  300. package/app/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  301. package/app/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  302. package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  303. package/app/.next/server/app/dashboard/profile.html +1 -1
  304. package/app/.next/server/app/dashboard/profile.rsc +7 -7
  305. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  306. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  307. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  308. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  309. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  310. package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  311. package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  312. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  313. package/app/.next/server/app/dashboard/providers/new.html +1 -1
  314. package/app/.next/server/app/dashboard/providers/new.rsc +7 -7
  315. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  316. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  317. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  318. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  319. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  320. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  321. package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  322. package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  323. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  324. package/app/.next/server/app/dashboard/providers.html +1 -1
  325. package/app/.next/server/app/dashboard/providers.rsc +7 -7
  326. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  327. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  328. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  329. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  330. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  331. package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  332. package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  333. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  334. package/app/.next/server/app/dashboard/proxy-pools.html +1 -1
  335. package/app/.next/server/app/dashboard/proxy-pools.rsc +7 -7
  336. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  337. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  338. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  339. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  340. package/app/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  341. package/app/.next/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  342. package/app/.next/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  343. package/app/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  344. package/app/.next/server/app/dashboard/quota.html +2 -2
  345. package/app/.next/server/app/dashboard/quota.rsc +6 -6
  346. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +1 -1
  347. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  348. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  349. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  350. package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  351. package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  352. package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  353. package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  354. package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
  355. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  356. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  357. package/app/.next/server/app/dashboard/settings/pricing.rsc +5 -5
  358. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  359. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  360. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  361. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  362. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  363. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  364. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  365. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  366. package/app/.next/server/app/dashboard/translator.html +1 -1
  367. package/app/.next/server/app/dashboard/translator.rsc +7 -7
  368. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  369. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  370. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  371. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  372. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  373. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  374. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  375. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  376. package/app/.next/server/app/dashboard/usage.html +1 -1
  377. package/app/.next/server/app/dashboard/usage.rsc +7 -7
  378. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  379. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  380. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  381. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  382. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  383. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  384. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  385. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  386. package/app/.next/server/app/dashboard.html +1 -1
  387. package/app/.next/server/app/dashboard.meta +2 -0
  388. package/app/.next/server/app/dashboard.rsc +8 -9
  389. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  390. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  391. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  392. package/app/.next/server/app/dashboard.segments/_full.segment.rsc +8 -9
  393. package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
  394. package/app/.next/server/app/dashboard.segments/_index.segment.rsc +4 -4
  395. package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  396. package/app/.next/server/app/favicon.ico/route.js +1 -1
  397. package/app/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  398. package/app/.next/server/app/index.html +1 -1
  399. package/app/.next/server/app/index.meta +1 -1
  400. package/app/.next/server/app/index.rsc +6 -6
  401. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  402. package/app/.next/server/app/index.segments/_full.segment.rsc +6 -6
  403. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  404. package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
  405. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  406. package/app/.next/server/app/landing/page.js +2 -2
  407. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  408. package/app/.next/server/app/landing.html +1 -1
  409. package/app/.next/server/app/landing.rsc +5 -5
  410. package/app/.next/server/app/landing.segments/_full.segment.rsc +5 -5
  411. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  412. package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
  413. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  414. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  415. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  416. package/app/.next/server/app/login/page.js +2 -2
  417. package/app/.next/server/app/login/page.js.nft.json +1 -1
  418. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  419. package/app/.next/server/app/login.html +1 -1
  420. package/app/.next/server/app/login.rsc +6 -6
  421. package/app/.next/server/app/login.segments/_full.segment.rsc +6 -6
  422. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  423. package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
  424. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  425. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  426. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  427. package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
  428. package/app/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  429. package/app/.next/server/app/page.js +2 -2
  430. package/app/.next/server/app/page.js.nft.json +1 -1
  431. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  432. package/app/.next/server/app-paths-manifest.json +10 -5
  433. package/app/.next/server/chunks/1424.js +1 -1
  434. package/app/.next/server/chunks/2664.js +1 -1
  435. package/app/.next/server/chunks/{318.js → 3093.js} +3 -3
  436. package/app/.next/server/chunks/336.js +1 -0
  437. package/app/.next/server/chunks/412.js +2 -2
  438. package/app/.next/server/chunks/4989.js +2 -2
  439. package/app/.next/server/chunks/6828.js +1 -0
  440. package/app/.next/server/chunks/8895.js +2 -2
  441. package/app/.next/server/chunks/9718.js +1 -1
  442. package/app/.next/server/middleware-build-manifest.js +1 -1
  443. package/app/.next/server/pages/404.html +1 -1
  444. package/app/.next/server/pages/500.html +1 -1
  445. package/app/.next/static/chunks/{5497-1e3ca6e102213311.js → 5497-95288063cad27087.js} +2 -2
  446. package/app/.next/static/chunks/5909-8229484e56dff5af.js +1 -0
  447. package/app/.next/static/chunks/6902-59c9bd4da89daa6c.js +1 -0
  448. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-b8a81c97c0f303e5.js → page-61e6d1dcc53a6f64.js} +1 -1
  449. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/{page-7a2c4bfc2d094dc8.js → page-eaaa0b2e7a9f2432.js} +1 -1
  450. package/app/.next/static/chunks/app/(dashboard)/dashboard/console-log/{page-9817f7dfd3db200f.js → page-0818a8d1c21dc842.js} +1 -1
  451. package/app/.next/static/chunks/app/(dashboard)/dashboard/employees/[keyId]/page-6d9ae639968fc1dd.js +1 -0
  452. package/app/.next/static/chunks/app/(dashboard)/dashboard/employees/page-ceaf0dc344eec2fe.js +1 -0
  453. package/app/.next/static/chunks/{8093-1d753947a159f3d6.js → app/(dashboard)/dashboard/endpoint/page-88605a2347dee47b.js} +2 -2
  454. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/{page-ef761ecb487fe564.js → page-4b7378e5137f3fd8.js} +1 -1
  455. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-aed1b231bb49a704.js +1 -0
  456. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/{page-26e2348f80c5fb86.js → page-d9fef809999e6003.js} +1 -1
  457. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-d97e0153ce2081b1.js → page-91259a6310563c56.js} +1 -1
  458. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/{page-33a2031d2a33ee5a.js → page-def2087e830977cb.js} +1 -1
  459. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{page-2fdc1cf4d09ba309.js → page-b5a0564904ed5969.js} +1 -1
  460. package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-6213cf39d4b20426.js → page-b62fbf4b69474242.js} +1 -1
  461. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-3057dc573c7b21f0.js → page-e919a2e0bd879140.js} +1 -1
  462. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-a4c18af18bf2985a.js +1 -0
  463. package/app/.next/static/chunks/app/(dashboard)/{layout-3ef047ee09079701.js → layout-ce060c64625acbdc.js} +1 -1
  464. package/app/.next/static/chunks/app/_global-error/page-aed1b231bb49a704.js +1 -0
  465. package/app/.next/static/chunks/app/api/auth/login/route-aed1b231bb49a704.js +1 -0
  466. package/app/.next/static/chunks/app/api/auth/logout/route-aed1b231bb49a704.js +1 -0
  467. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-aed1b231bb49a704.js +1 -0
  468. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-aed1b231bb49a704.js +1 -0
  469. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-aed1b231bb49a704.js +1 -0
  470. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-aed1b231bb49a704.js +1 -0
  471. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-aed1b231bb49a704.js +1 -0
  472. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-aed1b231bb49a704.js +1 -0
  473. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-aed1b231bb49a704.js +1 -0
  474. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-aed1b231bb49a704.js +1 -0
  475. package/app/.next/static/chunks/app/api/cloud/auth/route-aed1b231bb49a704.js +1 -0
  476. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-aed1b231bb49a704.js +1 -0
  477. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-aed1b231bb49a704.js +1 -0
  478. package/app/.next/static/chunks/app/api/cloud/models/alias/route-aed1b231bb49a704.js +1 -0
  479. package/app/.next/static/chunks/app/api/combos/[id]/route-aed1b231bb49a704.js +1 -0
  480. package/app/.next/static/chunks/app/api/combos/route-aed1b231bb49a704.js +1 -0
  481. package/app/.next/static/chunks/app/api/employees/[keyId]/stats/route-aed1b231bb49a704.js +1 -0
  482. package/app/.next/static/chunks/app/api/employees/stats/route-aed1b231bb49a704.js +1 -0
  483. package/app/.next/static/chunks/app/api/init/route-aed1b231bb49a704.js +1 -0
  484. package/app/.next/static/chunks/app/api/keys/[id]/route-aed1b231bb49a704.js +1 -0
  485. package/app/.next/static/chunks/app/api/keys/route-aed1b231bb49a704.js +1 -0
  486. package/app/.next/static/chunks/app/api/locale/route-aed1b231bb49a704.js +1 -0
  487. package/app/.next/static/chunks/app/api/models/alias/route-aed1b231bb49a704.js +1 -0
  488. package/app/.next/static/chunks/app/api/models/route-aed1b231bb49a704.js +1 -0
  489. package/app/.next/static/chunks/app/api/models/test/route-aed1b231bb49a704.js +1 -0
  490. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-aed1b231bb49a704.js +1 -0
  491. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-aed1b231bb49a704.js +1 -0
  492. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-aed1b231bb49a704.js +1 -0
  493. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-aed1b231bb49a704.js +1 -0
  494. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-aed1b231bb49a704.js +1 -0
  495. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-aed1b231bb49a704.js +1 -0
  496. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-aed1b231bb49a704.js +1 -0
  497. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-aed1b231bb49a704.js +1 -0
  498. package/app/.next/static/chunks/app/api/pricing/route-aed1b231bb49a704.js +1 -0
  499. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-aed1b231bb49a704.js +1 -0
  500. package/app/.next/static/chunks/app/api/provider-nodes/route-aed1b231bb49a704.js +1 -0
  501. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-aed1b231bb49a704.js +1 -0
  502. package/app/.next/static/chunks/app/api/providers/[id]/models/route-aed1b231bb49a704.js +1 -0
  503. package/app/.next/static/chunks/app/api/providers/[id]/route-aed1b231bb49a704.js +1 -0
  504. package/app/.next/static/chunks/app/api/providers/[id]/test/route-aed1b231bb49a704.js +1 -0
  505. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-aed1b231bb49a704.js +1 -0
  506. package/app/.next/static/chunks/app/api/providers/client/route-aed1b231bb49a704.js +1 -0
  507. package/app/.next/static/chunks/app/api/providers/route-aed1b231bb49a704.js +1 -0
  508. package/app/.next/static/chunks/app/api/providers/test-batch/route-aed1b231bb49a704.js +1 -0
  509. package/app/.next/static/chunks/app/api/providers/validate/route-aed1b231bb49a704.js +1 -0
  510. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-aed1b231bb49a704.js +1 -0
  511. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-aed1b231bb49a704.js +1 -0
  512. package/app/.next/static/chunks/app/api/proxy-pools/route-aed1b231bb49a704.js +1 -0
  513. package/app/.next/static/chunks/app/api/settings/database/route-aed1b231bb49a704.js +1 -0
  514. package/app/.next/static/chunks/app/api/settings/proxy-test/route-aed1b231bb49a704.js +1 -0
  515. package/app/.next/static/chunks/app/api/settings/require-login/route-aed1b231bb49a704.js +1 -0
  516. package/app/.next/static/chunks/app/api/settings/route-aed1b231bb49a704.js +1 -0
  517. package/app/.next/static/chunks/app/api/shutdown/route-aed1b231bb49a704.js +1 -0
  518. package/app/.next/static/chunks/app/api/tags/route-aed1b231bb49a704.js +1 -0
  519. package/app/.next/static/chunks/app/api/translator/console-logs/route-aed1b231bb49a704.js +1 -0
  520. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-aed1b231bb49a704.js +1 -0
  521. package/app/.next/static/chunks/app/api/translator/load/route-aed1b231bb49a704.js +1 -0
  522. package/app/.next/static/chunks/app/api/translator/save/route-aed1b231bb49a704.js +1 -0
  523. package/app/.next/static/chunks/app/api/translator/send/route-aed1b231bb49a704.js +1 -0
  524. package/app/.next/static/chunks/app/api/translator/translate/route-aed1b231bb49a704.js +1 -0
  525. package/app/.next/static/chunks/app/api/tunnel/disable/route-aed1b231bb49a704.js +1 -0
  526. package/app/.next/static/chunks/app/api/tunnel/enable/route-aed1b231bb49a704.js +1 -0
  527. package/app/.next/static/chunks/app/api/tunnel/status/route-aed1b231bb49a704.js +1 -0
  528. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-aed1b231bb49a704.js +1 -0
  529. package/app/.next/static/chunks/app/api/usage/chart/route-aed1b231bb49a704.js +1 -0
  530. package/app/.next/static/chunks/app/api/usage/history/route-aed1b231bb49a704.js +1 -0
  531. package/app/.next/static/chunks/app/api/usage/logs/route-aed1b231bb49a704.js +1 -0
  532. package/app/.next/static/chunks/app/api/usage/providers/route-aed1b231bb49a704.js +1 -0
  533. package/app/.next/static/chunks/app/api/usage/request-details/[id]/route-aed1b231bb49a704.js +1 -0
  534. package/app/.next/static/chunks/app/api/usage/request-details/route-aed1b231bb49a704.js +1 -0
  535. package/app/.next/static/chunks/app/api/usage/request-logs/route-aed1b231bb49a704.js +1 -0
  536. package/app/.next/static/chunks/app/api/usage/stats/route-aed1b231bb49a704.js +1 -0
  537. package/app/.next/static/chunks/app/api/usage/stream/route-aed1b231bb49a704.js +1 -0
  538. package/app/.next/static/chunks/app/api/v1/api/chat/route-aed1b231bb49a704.js +1 -0
  539. package/app/.next/static/chunks/app/api/v1/chat/completions/route-aed1b231bb49a704.js +1 -0
  540. package/app/.next/static/chunks/app/api/v1/embeddings/route-aed1b231bb49a704.js +1 -0
  541. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-aed1b231bb49a704.js +1 -0
  542. package/app/.next/static/chunks/app/api/v1/messages/route-aed1b231bb49a704.js +1 -0
  543. package/app/.next/static/chunks/app/api/v1/models/route-aed1b231bb49a704.js +1 -0
  544. package/app/.next/static/chunks/app/api/v1/responses/route-aed1b231bb49a704.js +1 -0
  545. package/app/.next/static/chunks/app/api/v1/route-aed1b231bb49a704.js +1 -0
  546. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-aed1b231bb49a704.js +1 -0
  547. package/app/.next/static/chunks/app/api/v1beta/models/route-aed1b231bb49a704.js +1 -0
  548. package/app/.next/static/chunks/app/api/v1internal/route-aed1b231bb49a704.js +1 -0
  549. package/app/.next/static/chunks/app/api/version/route-aed1b231bb49a704.js +1 -0
  550. package/app/.next/static/chunks/app/{layout-7d320cc74dc582e9.js → layout-5f14b5ffaa464c15.js} +1 -1
  551. package/app/.next/static/chunks/app/login/{page-025e378eb5cdb421.js → page-5e162056267a89f6.js} +1 -1
  552. package/app/.next/static/chunks/app/manifest.webmanifest/route-aed1b231bb49a704.js +1 -0
  553. package/app/.next/static/chunks/app/page-aed1b231bb49a704.js +1 -0
  554. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-aed1b231bb49a704.js +1 -0
  555. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-aed1b231bb49a704.js +1 -0
  556. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-aed1b231bb49a704.js +1 -0
  557. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-aed1b231bb49a704.js +1 -0
  558. package/app/.next/static/chunks/webpack-1094c4a28660424b.js +1 -0
  559. package/app/.next/static/css/e83da33dd60e45a9.css +3 -0
  560. package/app/.next/static/kziRUh9x_T6WFTaeglA8u/_buildManifest.js +1 -0
  561. package/app/open-sse/executors/antigravity.js +27 -4
  562. package/app/open-sse/handlers/chatCore/nonStreamingHandler.js +1 -1
  563. package/app/open-sse/handlers/chatCore/requestDetail.js +1 -0
  564. package/app/open-sse/handlers/chatCore/sseToJsonHandler.js +1 -1
  565. package/app/open-sse/handlers/chatCore/streamingHandler.js +5 -5
  566. package/app/open-sse/handlers/chatCore.js +2 -2
  567. package/app/open-sse/handlers/internalChatCore.js +6 -6
  568. package/app/package.json +3 -3
  569. package/app/server.js +1 -1
  570. package/package.json +1 -1
  571. package/app/.next/server/chunks/1386.js +0 -3
  572. package/app/.next/server/chunks/4689.js +0 -1
  573. package/app/.next/static/L6G1Bw3njbM3GTWLVjBSx/_buildManifest.js +0 -1
  574. package/app/.next/static/chunks/123-58257c9badaeaf84.js +0 -1
  575. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-4a59bbf5f1889d13.js +0 -1
  576. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-ab4c1f7ada9eefda.js +0 -1
  577. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-4c59e920e2fecc16.js +0 -1
  578. package/app/.next/static/chunks/app/_global-error/page-b30d6a5358c02312.js +0 -1
  579. package/app/.next/static/chunks/app/api/auth/login/route-b30d6a5358c02312.js +0 -1
  580. package/app/.next/static/chunks/app/api/auth/logout/route-b30d6a5358c02312.js +0 -1
  581. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-b30d6a5358c02312.js +0 -1
  582. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-b30d6a5358c02312.js +0 -1
  583. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-b30d6a5358c02312.js +0 -1
  584. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-b30d6a5358c02312.js +0 -1
  585. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-b30d6a5358c02312.js +0 -1
  586. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-b30d6a5358c02312.js +0 -1
  587. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-b30d6a5358c02312.js +0 -1
  588. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-b30d6a5358c02312.js +0 -1
  589. package/app/.next/static/chunks/app/api/cloud/auth/route-b30d6a5358c02312.js +0 -1
  590. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-b30d6a5358c02312.js +0 -1
  591. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-b30d6a5358c02312.js +0 -1
  592. package/app/.next/static/chunks/app/api/cloud/models/alias/route-b30d6a5358c02312.js +0 -1
  593. package/app/.next/static/chunks/app/api/combos/[id]/route-b30d6a5358c02312.js +0 -1
  594. package/app/.next/static/chunks/app/api/combos/route-b30d6a5358c02312.js +0 -1
  595. package/app/.next/static/chunks/app/api/init/route-b30d6a5358c02312.js +0 -1
  596. package/app/.next/static/chunks/app/api/keys/[id]/route-b30d6a5358c02312.js +0 -1
  597. package/app/.next/static/chunks/app/api/keys/route-b30d6a5358c02312.js +0 -1
  598. package/app/.next/static/chunks/app/api/locale/route-b30d6a5358c02312.js +0 -1
  599. package/app/.next/static/chunks/app/api/models/alias/route-b30d6a5358c02312.js +0 -1
  600. package/app/.next/static/chunks/app/api/models/route-b30d6a5358c02312.js +0 -1
  601. package/app/.next/static/chunks/app/api/models/test/route-b30d6a5358c02312.js +0 -1
  602. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-b30d6a5358c02312.js +0 -1
  603. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-b30d6a5358c02312.js +0 -1
  604. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-b30d6a5358c02312.js +0 -1
  605. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-b30d6a5358c02312.js +0 -1
  606. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-b30d6a5358c02312.js +0 -1
  607. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-b30d6a5358c02312.js +0 -1
  608. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-b30d6a5358c02312.js +0 -1
  609. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-b30d6a5358c02312.js +0 -1
  610. package/app/.next/static/chunks/app/api/pricing/route-b30d6a5358c02312.js +0 -1
  611. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-b30d6a5358c02312.js +0 -1
  612. package/app/.next/static/chunks/app/api/provider-nodes/route-b30d6a5358c02312.js +0 -1
  613. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-b30d6a5358c02312.js +0 -1
  614. package/app/.next/static/chunks/app/api/providers/[id]/models/route-b30d6a5358c02312.js +0 -1
  615. package/app/.next/static/chunks/app/api/providers/[id]/route-b30d6a5358c02312.js +0 -1
  616. package/app/.next/static/chunks/app/api/providers/[id]/test/route-b30d6a5358c02312.js +0 -1
  617. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-b30d6a5358c02312.js +0 -1
  618. package/app/.next/static/chunks/app/api/providers/client/route-b30d6a5358c02312.js +0 -1
  619. package/app/.next/static/chunks/app/api/providers/route-b30d6a5358c02312.js +0 -1
  620. package/app/.next/static/chunks/app/api/providers/test-batch/route-b30d6a5358c02312.js +0 -1
  621. package/app/.next/static/chunks/app/api/providers/validate/route-b30d6a5358c02312.js +0 -1
  622. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-b30d6a5358c02312.js +0 -1
  623. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-b30d6a5358c02312.js +0 -1
  624. package/app/.next/static/chunks/app/api/proxy-pools/route-b30d6a5358c02312.js +0 -1
  625. package/app/.next/static/chunks/app/api/settings/database/route-b30d6a5358c02312.js +0 -1
  626. package/app/.next/static/chunks/app/api/settings/proxy-test/route-b30d6a5358c02312.js +0 -1
  627. package/app/.next/static/chunks/app/api/settings/require-login/route-b30d6a5358c02312.js +0 -1
  628. package/app/.next/static/chunks/app/api/settings/route-b30d6a5358c02312.js +0 -1
  629. package/app/.next/static/chunks/app/api/shutdown/route-b30d6a5358c02312.js +0 -1
  630. package/app/.next/static/chunks/app/api/tags/route-b30d6a5358c02312.js +0 -1
  631. package/app/.next/static/chunks/app/api/translator/console-logs/route-b30d6a5358c02312.js +0 -1
  632. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-b30d6a5358c02312.js +0 -1
  633. package/app/.next/static/chunks/app/api/translator/load/route-b30d6a5358c02312.js +0 -1
  634. package/app/.next/static/chunks/app/api/translator/save/route-b30d6a5358c02312.js +0 -1
  635. package/app/.next/static/chunks/app/api/translator/send/route-b30d6a5358c02312.js +0 -1
  636. package/app/.next/static/chunks/app/api/translator/translate/route-b30d6a5358c02312.js +0 -1
  637. package/app/.next/static/chunks/app/api/tunnel/disable/route-b30d6a5358c02312.js +0 -1
  638. package/app/.next/static/chunks/app/api/tunnel/enable/route-b30d6a5358c02312.js +0 -1
  639. package/app/.next/static/chunks/app/api/tunnel/status/route-b30d6a5358c02312.js +0 -1
  640. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-b30d6a5358c02312.js +0 -1
  641. package/app/.next/static/chunks/app/api/usage/chart/route-b30d6a5358c02312.js +0 -1
  642. package/app/.next/static/chunks/app/api/usage/history/route-b30d6a5358c02312.js +0 -1
  643. package/app/.next/static/chunks/app/api/usage/logs/route-b30d6a5358c02312.js +0 -1
  644. package/app/.next/static/chunks/app/api/usage/providers/route-b30d6a5358c02312.js +0 -1
  645. package/app/.next/static/chunks/app/api/usage/request-details/route-b30d6a5358c02312.js +0 -1
  646. package/app/.next/static/chunks/app/api/usage/request-logs/route-b30d6a5358c02312.js +0 -1
  647. package/app/.next/static/chunks/app/api/usage/stats/route-b30d6a5358c02312.js +0 -1
  648. package/app/.next/static/chunks/app/api/usage/stream/route-b30d6a5358c02312.js +0 -1
  649. package/app/.next/static/chunks/app/api/v1/api/chat/route-b30d6a5358c02312.js +0 -1
  650. package/app/.next/static/chunks/app/api/v1/chat/completions/route-b30d6a5358c02312.js +0 -1
  651. package/app/.next/static/chunks/app/api/v1/embeddings/route-b30d6a5358c02312.js +0 -1
  652. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-b30d6a5358c02312.js +0 -1
  653. package/app/.next/static/chunks/app/api/v1/messages/route-b30d6a5358c02312.js +0 -1
  654. package/app/.next/static/chunks/app/api/v1/models/route-b30d6a5358c02312.js +0 -1
  655. package/app/.next/static/chunks/app/api/v1/responses/route-b30d6a5358c02312.js +0 -1
  656. package/app/.next/static/chunks/app/api/v1/route-b30d6a5358c02312.js +0 -1
  657. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-b30d6a5358c02312.js +0 -1
  658. package/app/.next/static/chunks/app/api/v1beta/models/route-b30d6a5358c02312.js +0 -1
  659. package/app/.next/static/chunks/app/api/v1internal/route-b30d6a5358c02312.js +0 -1
  660. package/app/.next/static/chunks/app/api/version/route-b30d6a5358c02312.js +0 -1
  661. package/app/.next/static/chunks/app/manifest.webmanifest/route-b30d6a5358c02312.js +0 -1
  662. package/app/.next/static/chunks/app/page-b30d6a5358c02312.js +0 -1
  663. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-b30d6a5358c02312.js +0 -1
  664. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-b30d6a5358c02312.js +0 -1
  665. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-b30d6a5358c02312.js +0 -1
  666. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-b30d6a5358c02312.js +0 -1
  667. package/app/.next/static/chunks/webpack-819d2440cd722d0f.js +0 -1
  668. package/app/.next/static/css/c29219c65952419f.css +0 -3
  669. /package/app/.next/static/{L6G1Bw3njbM3GTWLVjBSx → kziRUh9x_T6WFTaeglA8u}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{75228:(e,t,a)=>{"use strict";a.d(t,{default:()=>u});var s=a(95155),l=a(12115),i=a(35497),o=a(3534),r=a(28777),n=a(97397);let c=a(41463).env.NEXT_PUBLIC_CLOUD_URL,d={claude:"/api/cli-tools/claude-settings",codex:"/api/cli-tools/codex-settings",opencode:"/api/cli-tools/opencode-settings",droid:"/api/cli-tools/droid-settings",openclaw:"/api/cli-tools/openclaw-settings"};function u({machineId:e}){let t,a,p,[v,h]=(0,l.useState)([]),[x,f]=(0,l.useState)(!0),[g,j]=(0,l.useState)(null),[w,m]=(0,l.useState)({}),[b,y]=(0,l.useState)(!1),[E,P]=(0,l.useState)(!1),[S,k]=(0,l.useState)(""),[N,_]=(0,l.useState)([]),[C,O]=(0,l.useState)({});(0,l.useEffect)(()=>{U(),I(),M(),A()},[]);let A=async()=>{try{let e=await Promise.all(Object.entries(d).map(async([e,t])=>{try{let a=await fetch(t),s=await a.json();return[e,s]}catch{return[e,null]}}));O(Object.fromEntries(e))}catch(e){console.log("Error fetching tool statuses:",e)}},I=async()=>{try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status")]);if(e.ok){let t=await e.json();y(t.cloudEnabled||!1)}if(t.ok){let e=await t.json();P(e.enabled||!1),k(e.tunnelUrl||"")}}catch(e){console.log("Error loading settings:",e)}},M=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let t=await e.json();_(t.keys||[])}}catch(e){console.log("Error fetching API keys:",e)}},U=async()=>{try{let e=await fetch("/api/providers"),t=await e.json();e.ok&&h(t.connections||[])}catch(e){console.log("Error fetching connections:",e)}finally{f(!1)}},L=()=>v.filter(e=>!1!==e.isActive),$=(0,l.useCallback)((e,t,a)=>{m(s=>s[e]?.[t]===a?s:{...s,[e]:{...s[e],[t]:a}})},[]);if(x)return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(i.Qv,{}),(0,s.jsx)(i.Qv,{}),(0,s.jsx)(i.Qv,{})]});let Q=(t=L(),a=[],p=new Set,t.forEach(e=>{let t=r.Xg[e.provider]||e.provider;(0,r.KC)(e.provider).forEach(s=>{let l=`${t}/${s.id}`;p.has(l)||(p.add(l),a.push({value:l,label:`${t}/${s.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:s.id}))})}),a).length>0,T=Object.entries(o.dM);return(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[!Q&&(0,s.jsx)(i.Zp,{className:"border-yellow-500/50 bg-yellow-500/5",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"No active providers"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Please add and connect providers first to configure CLI tools."})]})]})}),(0,s.jsx)("div",{className:"flex flex-col gap-4",children:T.map(([e,t])=>((e,t)=>{let a={tool:t,isExpanded:g===e,onToggle:()=>j(g===e?null:e),baseUrl:E&&S?S:b&&c?c:window.location.origin,apiKeys:N};switch(e){case"claude":return(0,s.jsx)(n.Tk,{...a,activeProviders:L(),modelMappings:w[e]||{},onModelMappingChange:(t,a)=>$(e,t,a),hasActiveProviders:Q,cloudEnabled:b,initialStatus:C.claude},e);case"codex":return(0,s.jsx)(n.Ah,{...a,activeProviders:L(),cloudEnabled:b,initialStatus:C.codex},e);case"opencode":return(0,s.jsx)(n.qO,{...a,activeProviders:L(),cloudEnabled:b,initialStatus:C.opencode},e);case"droid":return(0,s.jsx)(n.ZM,{...a,activeProviders:L(),hasActiveProviders:Q,cloudEnabled:b,initialStatus:C.droid},e);case"openclaw":return(0,s.jsx)(n.yZ,{...a,activeProviders:L(),hasActiveProviders:Q,cloudEnabled:b,initialStatus:C.openclaw},e);default:return(0,s.jsx)(n.a7,{toolId:e,...a,activeProviders:L(),cloudEnabled:b,tunnelEnabled:E},e)}})(e,t))})]})}},77756:(e,t,a)=>{Promise.resolve().then(a.bind(a,75228))}},e=>{e.O(0,[2574,3862,5772,123,2652,5497,9242,8441,3794,7358],()=>e(e.s=77756)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{75228:(e,t,a)=>{"use strict";a.d(t,{default:()=>u});var s=a(95155),l=a(12115),i=a(35497),o=a(3534),r=a(28777),n=a(97397);let c=a(41463).env.NEXT_PUBLIC_CLOUD_URL,d={claude:"/api/cli-tools/claude-settings",codex:"/api/cli-tools/codex-settings",opencode:"/api/cli-tools/opencode-settings",droid:"/api/cli-tools/droid-settings",openclaw:"/api/cli-tools/openclaw-settings"};function u({machineId:e}){let t,a,p,[v,h]=(0,l.useState)([]),[x,f]=(0,l.useState)(!0),[g,j]=(0,l.useState)(null),[w,m]=(0,l.useState)({}),[b,y]=(0,l.useState)(!1),[E,P]=(0,l.useState)(!1),[S,k]=(0,l.useState)(""),[N,_]=(0,l.useState)([]),[C,O]=(0,l.useState)({});(0,l.useEffect)(()=>{U(),I(),M(),A()},[]);let A=async()=>{try{let e=await Promise.all(Object.entries(d).map(async([e,t])=>{try{let a=await fetch(t),s=await a.json();return[e,s]}catch{return[e,null]}}));O(Object.fromEntries(e))}catch(e){console.log("Error fetching tool statuses:",e)}},I=async()=>{try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status")]);if(e.ok){let t=await e.json();y(t.cloudEnabled||!1)}if(t.ok){let e=await t.json();P(e.enabled||!1),k(e.tunnelUrl||"")}}catch(e){console.log("Error loading settings:",e)}},M=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let t=await e.json();_(t.keys||[])}}catch(e){console.log("Error fetching API keys:",e)}},U=async()=>{try{let e=await fetch("/api/providers"),t=await e.json();e.ok&&h(t.connections||[])}catch(e){console.log("Error fetching connections:",e)}finally{f(!1)}},L=()=>v.filter(e=>!1!==e.isActive),$=(0,l.useCallback)((e,t,a)=>{m(s=>s[e]?.[t]===a?s:{...s,[e]:{...s[e],[t]:a}})},[]);if(x)return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(i.Qv,{}),(0,s.jsx)(i.Qv,{}),(0,s.jsx)(i.Qv,{})]});let Q=(t=L(),a=[],p=new Set,t.forEach(e=>{let t=r.Xg[e.provider]||e.provider;(0,r.KC)(e.provider).forEach(s=>{let l=`${t}/${s.id}`;p.has(l)||(p.add(l),a.push({value:l,label:`${t}/${s.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:s.id}))})}),a).length>0,T=Object.entries(o.dM);return(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[!Q&&(0,s.jsx)(i.Zp,{className:"border-yellow-500/50 bg-yellow-500/5",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"No active providers"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Please add and connect providers first to configure CLI tools."})]})]})}),(0,s.jsx)("div",{className:"flex flex-col gap-4",children:T.map(([e,t])=>((e,t)=>{let a={tool:t,isExpanded:g===e,onToggle:()=>j(g===e?null:e),baseUrl:E&&S?S:b&&c?c:window.location.origin,apiKeys:N};switch(e){case"claude":return(0,s.jsx)(n.Tk,{...a,activeProviders:L(),modelMappings:w[e]||{},onModelMappingChange:(t,a)=>$(e,t,a),hasActiveProviders:Q,cloudEnabled:b,initialStatus:C.claude},e);case"codex":return(0,s.jsx)(n.Ah,{...a,activeProviders:L(),cloudEnabled:b,initialStatus:C.codex},e);case"opencode":return(0,s.jsx)(n.qO,{...a,activeProviders:L(),cloudEnabled:b,initialStatus:C.opencode},e);case"droid":return(0,s.jsx)(n.ZM,{...a,activeProviders:L(),hasActiveProviders:Q,cloudEnabled:b,initialStatus:C.droid},e);case"openclaw":return(0,s.jsx)(n.yZ,{...a,activeProviders:L(),hasActiveProviders:Q,cloudEnabled:b,initialStatus:C.openclaw},e);default:return(0,s.jsx)(n.a7,{toolId:e,...a,activeProviders:L(),cloudEnabled:b,tunnelEnabled:E},e)}})(e,t))})]})}},77756:(e,t,a)=>{Promise.resolve().then(a.bind(a,75228))}},e=>{e.O(0,[2574,3862,5772,6902,2652,5497,9242,8441,3794,7358],()=>e(e.s=77756)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{47295:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>n});var a=s(95155),l=s(12115),o=s(35497),r=s(11059);s(52679);let i=/^[a-zA-Z0-9_.\-]+$/;function n(){let[e,t]=(0,l.useState)([]),[s,i]=(0,l.useState)(!0),[n,c]=(0,l.useState)(!1),[x,h]=(0,l.useState)(null),[p,u]=(0,l.useState)([]),{copied:b,copy:j}=(0,r.C)();(0,l.useEffect)(()=>{f()},[]);let f=async()=>{try{let[e,s]=await Promise.all([fetch("/api/combos"),fetch("/api/providers")]),a=await e.json(),l=await s.json();e.ok&&t(a.combos||[]),s.ok&&u(l.connections||[])}catch(e){console.log("Error fetching data:",e)}finally{i(!1)}},v=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await f(),c(!1);else{let e=await t.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},g=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await f(),h(null);else{let e=await s.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},y=async s=>{if(confirm("Delete this combo?"))try{(await fetch(`/api/combos/${s}`,{method:"DELETE"})).ok&&t(e.filter(e=>e.id!==s))}catch(e){console.log("Error deleting combo:",e)}};return s?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(o.Qv,{}),(0,a.jsx)(o.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold",children:"Combos"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Create model combos with fallback support"})]}),(0,a.jsx)(o.$n,{icon:"add",onClick:()=>c(!0),children:"Create Combo"})]}),0===e.length?(0,a.jsx)(o.Zp,{children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"layers"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No combos yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create model combos with fallback support"}),(0,a.jsx)(o.$n,{icon:"add",onClick:()=>c(!0),children:"Create Combo"})]})}):(0,a.jsx)("div",{className:"flex flex-col gap-4",children:e.map(e=>(0,a.jsx)(d,{combo:e,copied:b,onCopy:j,onEdit:()=>h(e),onDelete:()=>y(e.id)},e.id))}),(0,a.jsx)(m,{isOpen:n,onClose:()=>c(!1),onSave:v,activeProviders:p},"create"),(0,a.jsx)(m,{isOpen:!!x,combo:x,onClose:()=>h(null),onSave:e=>g(x.id,e),activeProviders:p},x?.id||"new")]})}function d({combo:e,copied:t,onCopy:s,onEdit:l,onDelete:r}){return(0,a.jsx)(o.Zp,{padding:"sm",className:"group",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("code",{className:"text-sm font-medium font-mono truncate",children:e.name}),(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),s(e.name,`combo-${e.id}`)},className:"p-0.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors opacity-0 group-hover:opacity-100",title:"Copy combo name",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:t===`combo-${e.id}`?"check":"content_copy"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[0===e.models.length?(0,a.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):e.models.slice(0,3).map((e,t)=>(0,a.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1.5 py-0.5 rounded text-text-muted",children:e},t)),e.models.length>3&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",e.models.length-3," more"]})]})]})]}),(0,a.jsxs)("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[(0,a.jsx)("button",{onClick:l,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:"Edit",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})}),(0,a.jsx)("button",{onClick:r,className:"p-1.5 hover:bg-red-500/10 rounded text-red-500 transition-colors",title:"Delete",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]})})}function c({index:e,model:t,isFirst:s,isLast:o,onEdit:r,onMoveUp:i,onMoveDown:n,onRemove:d}){let[m,x]=(0,l.useState)(!1),[h,p]=(0,l.useState)(t),u=()=>{let e=h.trim();e&&e!==t?r(e):p(t),x(!1)};return(0,a.jsxs)("div",{className:"group flex items-center gap-1.5 px-2 py-1 rounded-md bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:e+1}),m?(0,a.jsx)("input",{autoFocus:!0,value:h,onChange:e=>p(e.target.value),onBlur:u,onKeyDown:e=>{"Enter"===e.key&&u(),"Escape"===e.key&&(p(t),x(!1))},className:"flex-1 min-w-0 px-1.5 py-0.5 text-xs font-mono bg-white dark:bg-black/20 border border-primary/40 rounded outline-none text-text-main"}):(0,a.jsx)("div",{className:"flex-1 min-w-0 px-1.5 py-0.5 text-xs font-mono text-text-main truncate cursor-text hover:bg-black/5 dark:hover:bg-white/5 rounded",onClick:()=>x(!0),title:"Click to edit",children:t}),(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)("button",{onClick:i,disabled:s,className:`p-0.5 rounded ${s?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,a.jsx)("button",{onClick:n,disabled:o,className:`p-0.5 rounded ${o?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,a.jsx)("button",{onClick:d,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function m({isOpen:e,combo:t,onClose:s,onSave:r,activeProviders:n}){let[d,x]=(0,l.useState)(t?.name||""),[h,p]=(0,l.useState)(t?.models||[]),[u,b]=(0,l.useState)(!1),[j,f]=(0,l.useState)(!1),[v,g]=(0,l.useState)(""),[y,N]=(0,l.useState)({}),k=async()=>{try{let e=await fetch("/api/models/alias");if(!e.ok)return;let t=await e.json();N(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}};(0,l.useEffect)(()=>{e&&k()},[e]);let w=e=>e.trim()?i.test(e)?(g(""),!0):(g("Only letters, numbers, -, _ and . allowed"),!1):(g("Name is required"),!1),C=async()=>{w(d)&&(f(!0),await r({name:d.trim(),models:h}),f(!1))},S=!!t;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.aF,{isOpen:e,onClose:s,title:S?"Edit Combo":"Create Combo",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(o.pd,{label:"Combo Name",value:d,onChange:e=>{let t=e.target.value;x(t),t?w(t):g("")},placeholder:"my-combo",error:v}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, -, _ and . allowed"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===h.length?(0,a.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,a.jsx)("div",{className:"flex flex-col gap-1 max-h-[200px] overflow-y-auto",children:h.map((e,t)=>(0,a.jsx)(c,{index:t,model:e,isFirst:0===t,isLast:t===h.length-1,onEdit:e=>{let s=[...h];s[t]=e,p(s)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...h];[t[e-1],t[e]]=[t[e],t[e-1]],p(t)})(t),onMoveDown:()=>(e=>{if(e===h.length-1)return;let t=[...h];[t[e],t[e+1]]=[t[e+1],t[e]],p(t)})(t),onRemove:()=>{p(h.filter((e,s)=>s!==t))}},t))}),(0,a.jsxs)("button",{onClick:()=>b(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-text-muted hover:text-primary hover:border-primary/30 transition-colors flex items-center justify-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(o.$n,{onClick:s,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(o.$n,{onClick:C,fullWidth:!0,size:"sm",disabled:!d.trim()||!!v||j,children:j?"Saving...":S?"Save":"Create"})]})]})}),(0,a.jsx)(o.rq,{isOpen:u,onClose:()=>b(!1),onSelect:e=>{h.includes(e.value)||p([...h,e.value])},activeProviders:n,modelAliases:y,title:"Add Model to Combo"})]})}},61114:(e,t,s)=>{Promise.resolve().then(s.bind(s,47295))}},e=>{e.O(0,[2574,3862,5772,123,2652,5497,8441,3794,7358],()=>e(e.s=61114)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{47295:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>n});var a=s(95155),l=s(12115),o=s(35497),r=s(11059);s(52679);let i=/^[a-zA-Z0-9_.\-]+$/;function n(){let[e,t]=(0,l.useState)([]),[s,i]=(0,l.useState)(!0),[n,c]=(0,l.useState)(!1),[x,h]=(0,l.useState)(null),[p,u]=(0,l.useState)([]),{copied:b,copy:j}=(0,r.C)();(0,l.useEffect)(()=>{f()},[]);let f=async()=>{try{let[e,s]=await Promise.all([fetch("/api/combos"),fetch("/api/providers")]),a=await e.json(),l=await s.json();e.ok&&t(a.combos||[]),s.ok&&u(l.connections||[])}catch(e){console.log("Error fetching data:",e)}finally{i(!1)}},v=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await f(),c(!1);else{let e=await t.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},g=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await f(),h(null);else{let e=await s.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},y=async s=>{if(confirm("Delete this combo?"))try{(await fetch(`/api/combos/${s}`,{method:"DELETE"})).ok&&t(e.filter(e=>e.id!==s))}catch(e){console.log("Error deleting combo:",e)}};return s?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(o.Qv,{}),(0,a.jsx)(o.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold",children:"Combos"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Create model combos with fallback support"})]}),(0,a.jsx)(o.$n,{icon:"add",onClick:()=>c(!0),children:"Create Combo"})]}),0===e.length?(0,a.jsx)(o.Zp,{children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"layers"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No combos yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create model combos with fallback support"}),(0,a.jsx)(o.$n,{icon:"add",onClick:()=>c(!0),children:"Create Combo"})]})}):(0,a.jsx)("div",{className:"flex flex-col gap-4",children:e.map(e=>(0,a.jsx)(d,{combo:e,copied:b,onCopy:j,onEdit:()=>h(e),onDelete:()=>y(e.id)},e.id))}),(0,a.jsx)(m,{isOpen:n,onClose:()=>c(!1),onSave:v,activeProviders:p},"create"),(0,a.jsx)(m,{isOpen:!!x,combo:x,onClose:()=>h(null),onSave:e=>g(x.id,e),activeProviders:p},x?.id||"new")]})}function d({combo:e,copied:t,onCopy:s,onEdit:l,onDelete:r}){return(0,a.jsx)(o.Zp,{padding:"sm",className:"group",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("code",{className:"text-sm font-medium font-mono truncate",children:e.name}),(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),s(e.name,`combo-${e.id}`)},className:"p-0.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors opacity-0 group-hover:opacity-100",title:"Copy combo name",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:t===`combo-${e.id}`?"check":"content_copy"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[0===e.models.length?(0,a.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):e.models.slice(0,3).map((e,t)=>(0,a.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1.5 py-0.5 rounded text-text-muted",children:e},t)),e.models.length>3&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",e.models.length-3," more"]})]})]})]}),(0,a.jsxs)("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[(0,a.jsx)("button",{onClick:l,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:"Edit",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})}),(0,a.jsx)("button",{onClick:r,className:"p-1.5 hover:bg-red-500/10 rounded text-red-500 transition-colors",title:"Delete",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]})})}function c({index:e,model:t,isFirst:s,isLast:o,onEdit:r,onMoveUp:i,onMoveDown:n,onRemove:d}){let[m,x]=(0,l.useState)(!1),[h,p]=(0,l.useState)(t),u=()=>{let e=h.trim();e&&e!==t?r(e):p(t),x(!1)};return(0,a.jsxs)("div",{className:"group flex items-center gap-1.5 px-2 py-1 rounded-md bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:e+1}),m?(0,a.jsx)("input",{autoFocus:!0,value:h,onChange:e=>p(e.target.value),onBlur:u,onKeyDown:e=>{"Enter"===e.key&&u(),"Escape"===e.key&&(p(t),x(!1))},className:"flex-1 min-w-0 px-1.5 py-0.5 text-xs font-mono bg-white dark:bg-black/20 border border-primary/40 rounded outline-none text-text-main"}):(0,a.jsx)("div",{className:"flex-1 min-w-0 px-1.5 py-0.5 text-xs font-mono text-text-main truncate cursor-text hover:bg-black/5 dark:hover:bg-white/5 rounded",onClick:()=>x(!0),title:"Click to edit",children:t}),(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)("button",{onClick:i,disabled:s,className:`p-0.5 rounded ${s?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,a.jsx)("button",{onClick:n,disabled:o,className:`p-0.5 rounded ${o?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,a.jsx)("button",{onClick:d,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function m({isOpen:e,combo:t,onClose:s,onSave:r,activeProviders:n}){let[d,x]=(0,l.useState)(t?.name||""),[h,p]=(0,l.useState)(t?.models||[]),[u,b]=(0,l.useState)(!1),[j,f]=(0,l.useState)(!1),[v,g]=(0,l.useState)(""),[y,N]=(0,l.useState)({}),k=async()=>{try{let e=await fetch("/api/models/alias");if(!e.ok)return;let t=await e.json();N(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}};(0,l.useEffect)(()=>{e&&k()},[e]);let w=e=>e.trim()?i.test(e)?(g(""),!0):(g("Only letters, numbers, -, _ and . allowed"),!1):(g("Name is required"),!1),C=async()=>{w(d)&&(f(!0),await r({name:d.trim(),models:h}),f(!1))},S=!!t;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.aF,{isOpen:e,onClose:s,title:S?"Edit Combo":"Create Combo",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(o.pd,{label:"Combo Name",value:d,onChange:e=>{let t=e.target.value;x(t),t?w(t):g("")},placeholder:"my-combo",error:v}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, -, _ and . allowed"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===h.length?(0,a.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,a.jsx)("div",{className:"flex flex-col gap-1 max-h-[200px] overflow-y-auto",children:h.map((e,t)=>(0,a.jsx)(c,{index:t,model:e,isFirst:0===t,isLast:t===h.length-1,onEdit:e=>{let s=[...h];s[t]=e,p(s)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...h];[t[e-1],t[e]]=[t[e],t[e-1]],p(t)})(t),onMoveDown:()=>(e=>{if(e===h.length-1)return;let t=[...h];[t[e],t[e+1]]=[t[e+1],t[e]],p(t)})(t),onRemove:()=>{p(h.filter((e,s)=>s!==t))}},t))}),(0,a.jsxs)("button",{onClick:()=>b(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-text-muted hover:text-primary hover:border-primary/30 transition-colors flex items-center justify-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(o.$n,{onClick:s,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(o.$n,{onClick:C,fullWidth:!0,size:"sm",disabled:!d.trim()||!!v||j,children:j?"Saving...":S?"Save":"Create"})]})]})}),(0,a.jsx)(o.rq,{isOpen:u,onClose:()=>b(!1),onSelect:e=>{h.includes(e.value)||p([...h,e.value])},activeProviders:n,modelAliases:y,title:"Add Model to Combo"})]})}},61114:(e,t,s)=>{Promise.resolve().then(s.bind(s,47295))}},e=>{e.O(0,[2574,3862,5772,6902,2652,5497,8441,3794,7358],()=>e(e.s=61114)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{44493:(e,t,l)=>{"use strict";l.d(t,{default:()=>o});var s=l(95155),n=l(12115),r=l(35497),a=l(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,t]=(0,n.useState)([]),[l,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),u=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-a.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)(r.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,s.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:u,children:"Clear"})}),(0,s.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,s.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,n;return(0,s.jsx)("div",{children:(n=c[(l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,s.jsx)("span",{className:n,children:e}))},t)})})})]})})}},99685:(e,t,l)=>{Promise.resolve().then(l.bind(l,44493))}},e=>{e.O(0,[2574,3862,5772,123,2652,5497,8441,3794,7358],()=>e(e.s=99685)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{44493:(e,t,l)=>{"use strict";l.d(t,{default:()=>o});var s=l(95155),n=l(12115),r=l(35497),a=l(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,t]=(0,n.useState)([]),[l,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),u=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-a.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)(r.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,s.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:u,children:"Clear"})}),(0,s.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,s.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,n;return(0,s.jsx)("div",{children:(n=c[(l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,s.jsx)("span",{className:n,children:e}))},t)})})})]})})}},99685:(e,t,l)=>{Promise.resolve().then(l.bind(l,44493))}},e=>{e.O(0,[2574,3862,5772,6902,2652,5497,8441,3794,7358],()=>e(e.s=99685)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5184],{29499:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var a=s(95155),l=s(12115),r=s(31474);function n({isOpen:e,onClose:t,title:s,children:i,width:d="md",className:o}){let c={sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[800px]",full:"w-full"};return((0,l.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,l.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e)?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm transition-opacity cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,r.cn)("absolute right-0 top-0 h-full bg-surface shadow-2xl flex flex-col","animate-in slide-in-from-right duration-200","border-l border-black/10 dark:border-white/10",c[d]||c.md,o),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-black/5 dark:border-white/5 flex-shrink-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:s&&(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})}),(0,a.jsx)("button",{type:"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,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-6",children:i})]})]}):null}},50378:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var a=s(95155),l=s(31474),r=s(92542);function n({currentPage:e,pageSize:t,totalItems:s,onPageChange:i,onPageSizeChange:d,className:o}){let c=Math.ceil(s/t),x=s>0?(e-1)*t+1:0,m=Math.min(e*t,s),p=(()=>{let t=[],s=Math.max(1,e-2),a=Math.min(c,s+5-1);a-s+1<5&&(s=Math.max(1,a-5+1));for(let e=s;e<=a;e++)t.push(e);return t})();return(0,a.jsxs)("div",{className:(0,l.cn)("flex flex-col sm:flex-row items-center justify-between gap-4 py-4",o),children:[s>0&&(0,a.jsxs)("div",{className:"text-sm text-text-muted",children:["Showing ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:x})," to"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:m})," of"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:s})," results"]}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[d&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Rows:"}),(0,a.jsx)("select",{value:t,onChange:e=>d(Number(e.target.value)),className:(0,l.cn)("h-9 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","cursor-pointer"),children:[10,20,50].map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]}),c>1&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(r.default,{variant:"outline",size:"sm",onClick:()=>i(e-1),disabled:1===e,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_left"})}),p[0]>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.default,{variant:"ghost",size:"sm",onClick:()=>i(1),className:"w-9 px-0",children:"1"}),p[0]>2&&(0,a.jsx)("span",{className:"text-text-muted px-1",children:"..."})]}),p.map(t=>(0,a.jsx)(r.default,{variant:e===t?"primary":"ghost",size:"sm",onClick:()=>i(t),className:"w-9 px-0",children:t},t)),p[p.length-1]<c&&(0,a.jsxs)(a.Fragment,{children:[p[p.length-1]<c-1&&(0,a.jsx)("span",{className:"text-text-muted px-1",children:"..."}),(0,a.jsx)(r.default,{variant:"ghost",size:"sm",onClick:()=>i(c),className:"w-9 px-0",children:c})]}),(0,a.jsx)(r.default,{variant:"outline",size:"sm",onClick:()=>i(e+1),disabled:e===c,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"})})]})]})]})}},71086:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>O});var a=s(95155),l=s(12115),r=s(73321),n=s(35497),i=s(84588),d=s(56061),o=s(1728),c=s(90639),x=s(28408),m=s(32539),p=s(59656),h=s(58021),u=s(54736);let f=e=>new Intl.NumberFormat().format(e||0),j=e=>`$${(e||0).toFixed(4)}`,g=[{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function b({keyId:e}){let t,[s,r]=(0,l.useState)(null),[n,N]=(0,l.useState)(!0),[v,y]=(0,l.useState)("7d"),[k,w]=(0,l.useState)([]),[S,C]=(0,l.useState)("tokens"),T=(0,l.useCallback)(async()=>{N(!0);try{let[t,s]=await Promise.all([fetch(`/api/employees/${e}/stats?period=${v}`),fetch(`/api/usage/chart?period=${v}&apiKey=${e}`)]);if(t.ok){let e=await t.json();r(e)}if(s.ok){let e=await s.json();w(e)}}catch(e){console.error("Failed to fetch:",e)}finally{N(!1)}},[e,v]);(0,l.useEffect)(()=>{T()},[T]);let{modelRows:D,providerRows:R}=(0,l.useMemo)(()=>s?{modelRows:Object.entries(s.byModel||{}).map(([e,t])=>({name:e,provider:t.provider||"—",requests:t.requests||0,promptTokens:t.promptTokens||0,completionTokens:t.completionTokens||0,cost:t.cost||0})).sort((e,t)=>t.cost-e.cost),providerRows:Object.entries(s.byProvider||{}).map(([e,t])=>({name:e,requests:t.requests||0,promptTokens:t.promptTokens||0,completionTokens:t.completionTokens||0,cost:t.cost||0})).sort((e,t)=>t.cost-e.cost)}:{modelRows:[],providerRows:[]},[s]);if(n)return(0,a.jsx)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] animate-spin",children:"progress_activity"})});if(!s?.employee)return(0,a.jsx)("div",{className:"text-text-muted text-center py-12",children:"Employee not found."});let{employee:q,stats:$}=s;return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(i.default,{className:"p-4 flex items-center gap-4 flex-wrap",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-12 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:"person"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h2",{className:"text-xl font-bold truncate",children:q.name||"Unnamed"}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mt-1 flex-wrap",children:[(0,a.jsx)("code",{className:"text-xs bg-bg-subtle px-2 py-0.5 rounded",children:q.apiKey}),(0,a.jsx)(d.default,{variant:q.isActive?"success":"error",size:"sm",children:q.isActive?"Active":"Inactive"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Created ",q.createdAt?new Date(q.createdAt).toLocaleDateString():"Unknown"]}),$?.lastActive&&(t=(Date.now()-new Date($.lastActive))/6e4,(0,a.jsxs)("span",{className:"text-xs flex items-center gap-1",children:[(0,a.jsx)("span",{className:`inline-block size-1.5 rounded-full ${t<1?"bg-green-500":t<=60?"bg-blue-400":"bg-red-500"} ${t<=60?"animate-pulse":""}`}),(0,a.jsx)("span",{className:"text-text-muted",children:"Last Active:"}),(0,a.jsx)("span",{className:`font-semibold ${t<1?"text-green-500":t<=60?"text-blue-400":"text-red-400"}`,children:(e=>{if(!e)return"Unknown";let t=new Date,s=new Date(e),a=Math.floor((t-s)/1e3),l=Math.floor(a/60),r=Math.floor(l/60),n=Math.floor(r/24);return a<60?"JUST NOW":l<60?`${l} min ago`:r<24?`${r} hour${r>1?"s":""} ago`:1===n?"Yesterday":n<7?`${n} days ago`:s.toLocaleDateString()})($.lastActive)})]}))]})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 self-end",children:(0,a.jsx)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border",children:g.map(e=>(0,a.jsx)("button",{onClick:()=>y(e.value),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${v===e.value?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:e.label},e.value))})}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,a.jsxs)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,a.jsx)("span",{className:"text-2xl font-bold",children:f($.totalRequests)})]}),(0,a.jsxs)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Input Tokens"}),(0,a.jsx)("span",{className:"text-2xl font-bold text-primary",children:f($.totalPromptTokens)})]}),(0,a.jsxs)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,a.jsx)("span",{className:"text-2xl font-bold text-success",children:f($.totalCompletionTokens)})]}),(0,a.jsxs)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Est. Cost"}),(0,a.jsxs)("span",{className:"text-2xl font-bold text-warning",children:["~",j($.totalCost)]})]})]}),k.length>0&&(0,a.jsxs)(i.default,{className:"p-4 flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h3",{className:"font-semibold text-sm text-text-muted uppercase",children:"Usage Trend"}),(0,a.jsxs)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border",children:[(0,a.jsx)("button",{onClick:()=>C("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===S?"bg-primary text-white shadow-sm":"text-text-muted"}`,children:"Tokens"}),(0,a.jsx)("button",{onClick:()=>C("cost"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"cost"===S?"bg-primary text-white shadow-sm":"text-text-muted"}`,children:"Cost"})]})]}),(0,a.jsx)(o.u,{width:"100%",height:220,children:(0,a.jsxs)(c.Q,{data:k,margin:{top:4,right:8,left:0,bottom:0},children:[(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:"empGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"5%",stopColor:"tokens"===S?"#6366f1":"#f59e0b",stopOpacity:.3}),(0,a.jsx)("stop",{offset:"95%",stopColor:"tokens"===S?"#6366f1":"#f59e0b",stopOpacity:0})]})}),(0,a.jsx)(x.d,{strokeDasharray:"3 3",strokeOpacity:.1}),(0,a.jsx)(m.W,{dataKey:"label",tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1}),(0,a.jsx)(p.h,{tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,tickFormatter:"cost"===S?e=>`$${e.toFixed(2)}`:e=>e>=1e3?`${(e/1e3).toFixed(0)}K`:e,width:50}),(0,a.jsx)(h.m,{contentStyle:{backgroundColor:"var(--color-bg)",border:"1px solid var(--color-border)",borderRadius:"8px",fontSize:"12px"},formatter:e=>["cost"===S?`$${e.toFixed(4)}`:f(e),"cost"===S?"Cost":"Tokens"]}),(0,a.jsx)(u.Gk,{type:"monotone",dataKey:S,stroke:"tokens"===S?"#6366f1":"#f59e0b",fill:"url(#empGrad)",strokeWidth:2})]})})]}),D.length>0&&(0,a.jsxs)(i.default,{className:"overflow-hidden",children:[(0,a.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,a.jsx)("h3",{className:"font-semibold text-sm",children:"Usage by Model"})}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,a.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-6 py-3",children:"Model"}),(0,a.jsx)("th",{className:"px-6 py-3",children:"Provider"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right",children:"Requests"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right",children:"Input Tokens"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right",children:"Output Tokens"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right",children:"Cost"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-border",children:D.map(e=>(0,a.jsxs)("tr",{className:"hover:bg-bg-subtle/50 transition-colors",children:[(0,a.jsx)("td",{className:"px-6 py-3 font-medium",children:e.name}),(0,a.jsx)("td",{className:"px-6 py-3 text-text-muted",children:e.provider}),(0,a.jsx)("td",{className:"px-6 py-3 text-right",children:f(e.requests)}),(0,a.jsx)("td",{className:"px-6 py-3 text-right text-primary",children:f(e.promptTokens)}),(0,a.jsx)("td",{className:"px-6 py-3 text-right text-success",children:f(e.completionTokens)}),(0,a.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:j(e.cost)})]},e.name))})]})})]}),R.length>0&&(0,a.jsxs)(i.default,{className:"overflow-hidden",children:[(0,a.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,a.jsx)("h3",{className:"font-semibold text-sm",children:"Usage by Provider"})}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,a.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-6 py-3",children:"Provider"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right",children:"Requests"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right",children:"Input Tokens"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right",children:"Output Tokens"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right",children:"Cost"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-border",children:R.map(e=>(0,a.jsxs)("tr",{className:"hover:bg-bg-subtle/50 transition-colors",children:[(0,a.jsx)("td",{className:"px-6 py-3 font-medium",children:e.name}),(0,a.jsx)("td",{className:"px-6 py-3 text-right",children:f(e.requests)}),(0,a.jsx)("td",{className:"px-6 py-3 text-right text-primary",children:f(e.promptTokens)}),(0,a.jsx)("td",{className:"px-6 py-3 text-right text-success",children:f(e.completionTokens)}),(0,a.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:j(e.cost)})]},e.name))})]})})]})]})}var N=s(92542),v=s(29499),y=s(50378),k=s(31474),w=s(52679);let S=null;async function C(){if(S)return S;try{let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[],s={};for(let e of t)s[e.id]=e.name;S={...w.Q2,...s}}catch{S={...w.Q2}}return S}function T(e,t){if(!e||!t)return e;let s=t[e];if("string"==typeof s)return s;if(s?.name)return s.name;let a=(0,w.zt)(e)||w.Q2[e];return a?.name||e}function D({title:e,children:t,defaultOpen:s=!1,icon:r=null}){let[n,i]=(0,l.useState)(s);return(0,a.jsxs)("div",{className:"border border-black/5 dark:border-white/5 rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(!n),className:"w-full flex items-center justify-between p-3 bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[r&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:r}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,k.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",n?"rotate-90":""),children:"chevron_right"})]}),n&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function R({data:e}){return e&&("object"!=typeof e||0!==Object.keys(e).length)?e._truncated?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("p",{className:"text-xs text-amber-500 font-medium",children:["⚠️ Content truncated (original: ",e._originalSize?.toLocaleString()," chars)"]}),(0,a.jsx)("pre",{className:"text-xs text-text-muted bg-black/[0.02] dark:bg-white/[0.02] p-3 rounded-lg overflow-auto max-h-[300px] custom-scrollbar font-mono whitespace-pre-wrap",children:e._preview||"—"})]}):(0,a.jsx)("pre",{className:"text-xs text-text-muted bg-black/[0.02] dark:bg-white/[0.02] p-3 rounded-lg overflow-auto max-h-[400px] custom-scrollbar font-mono whitespace-pre-wrap",children:"string"==typeof e?e:JSON.stringify(e,null,2)}):(0,a.jsx)("p",{className:"text-text-muted text-sm italic",children:"No data"})}function q(e){return e||0===e?e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`:"—"}let $=e=>new Intl.NumberFormat().format(e||0);function z({keyId:e}){let[t,s]=(0,l.useState)([]),[r,n]=(0,l.useState)({page:1,pageSize:20,totalItems:0,totalPages:0}),[d,o]=(0,l.useState)(!1),[c,x]=(0,l.useState)(null),[m,p]=(0,l.useState)(!1),[h,u]=(0,l.useState)([]),[f,j]=(0,l.useState)(null),[g,b]=(0,l.useState)({provider:"",startDate:"",endDate:""}),w=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/usage/providers"),t=await e.json();u(t.providers||[]);let s=await C();j(s)}catch(e){console.error("Failed to fetch providers:",e)}},[]),S=(0,l.useCallback)(async()=>{o(!0);try{let t=new URLSearchParams({page:r.page.toString(),pageSize:r.pageSize.toString(),apiKeyId:e});g.provider&&t.append("provider",g.provider),g.startDate&&t.append("startDate",g.startDate),g.endDate&&t.append("endDate",g.endDate);let a=await fetch(`/api/usage/request-details?${t}`);if(a.ok){let e=await a.json();s(e.details||[]),n(t=>({...t,...e.pagination}))}}catch(e){console.error("Failed to fetch request details:",e)}finally{o(!1)}},[e,r.page,r.pageSize,g]);(0,l.useEffect)(()=>{w()},[w]),(0,l.useEffect)(()=>{S()},[S]);let[O,P]=(0,l.useState)(!1),F=async e=>{x(e),p(!0),P(!1)};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(i.default,{padding:"md",children:(0,a.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"emp-provider-filter",className:"text-sm font-medium text-text-main",children:"Provider"}),(0,a.jsxs)("select",{id:"emp-provider-filter",value:g.provider,onChange:e=>b({...g,provider:e.target.value}),className:(0,k.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","cursor-pointer min-w-[150px]"),children:[(0,a.jsx)("option",{value:"",children:"All Providers"}),h.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"emp-start-date",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"emp-start-date",type:"datetime-local",value:g.startDate,onChange:e=>b({...g,startDate:e.target.value}),className:(0,k.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"emp-end-date",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"emp-end-date",type:"datetime-local",value:g.endDate,onChange:e=>b({...g,endDate:e.target.value}),className:(0,k.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsx)("div",{className:"flex flex-col gap-2 justify-end",children:(0,a.jsx)(N.default,{variant:"outline",size:"sm",onClick:()=>{b({provider:"",startDate:"",endDate:""})},children:"Clear"})})]})}),(0,a.jsxs)(i.default,{className:"overflow-hidden",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,a.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-6 py-3",children:"Timestamp"}),(0,a.jsx)("th",{className:"px-6 py-3",children:"Model"}),(0,a.jsx)("th",{className:"px-6 py-3",children:"Provider"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right",children:"Input"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right",children:"Output"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right",children:"Cost"}),(0,a.jsx)("th",{className:"px-6 py-3 text-center",children:"Status"}),(0,a.jsx)("th",{className:"px-6 py-3 text-center",children:"Detail"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-border",children:d?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:8,className:"px-6 py-8 text-center text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"})})}):0===t.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:8,className:"px-6 py-8 text-center text-text-muted",children:"No requests found for this employee."})}):t.map((e,t)=>(0,a.jsxs)("tr",{className:"hover:bg-bg-subtle/50 transition-colors",children:[(0,a.jsx)("td",{className:"px-6 py-3 whitespace-nowrap text-text-muted",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"px-6 py-3 font-medium",children:e.model||"—"}),(0,a.jsx)("td",{className:"px-6 py-3 text-text-muted",children:T(e.provider,f)||"—"}),(0,a.jsx)("td",{className:"px-6 py-3 text-right text-primary",children:$(e.tokens?.prompt_tokens||e.promptTokens||0)}),(0,a.jsx)("td",{className:"px-6 py-3 text-right text-success",children:$(e.tokens?.completion_tokens||e.completionTokens||0)}),(0,a.jsxs)("td",{className:"px-6 py-3 text-right text-warning font-medium",children:["$",(e.cost||0).toFixed(4)]}),(0,a.jsx)("td",{className:"px-6 py-3 text-center",children:(0,a.jsx)("span",{className:(0,k.cn)("inline-flex items-center px-2 py-0.5 rounded text-xs font-medium","success"===e.status||"200"===e.status?"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400":"error"===e.status||e.status&&e.status.startsWith?.("4")||e.status?.startsWith?.("5")?"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400":"bg-gray-100 dark:bg-gray-900/30 text-gray-700 dark:text-gray-400"),children:e.status||"—"})}),(0,a.jsx)("td",{className:"px-6 py-3 text-center",children:(0,a.jsx)(N.default,{variant:"ghost",size:"sm",onClick:()=>F(e),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"visibility"})})})]},`${e.id||e.timestamp}-${t}`))})]})}),r.totalPages>1&&(0,a.jsx)("div",{className:"p-4 border-t border-border",children:(0,a.jsx)(y.A,{page:r.page,totalPages:r.totalPages,totalItems:r.totalItems,pageSize:r.pageSize,onPageChange:e=>{n(t=>({...t,page:e}))},onPageSizeChange:e=>{n(t=>({...t,pageSize:e,page:1}))}})})]}),(0,a.jsx)(v.A,{isOpen:m,onClose:()=>{p(!1),x(null)},title:"Request Detail",width:"xl",children:c&&(0,a.jsxs)("div",{className:"space-y-4 p-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"}),(0,a.jsx)("p",{className:"font-medium",children:c.model||"—"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"}),(0,a.jsx)("p",{className:"font-medium",children:T(c.provider,f)||"—"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"}),(0,a.jsx)("p",{className:"font-medium",children:new Date(c.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"}),(0,a.jsx)("p",{className:"font-medium",children:c.status||"—"})]}),c.latency&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"TTFT:"}),(0,a.jsx)("p",{className:"font-medium",children:q(c.latency?.ttft)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Total Latency:"}),(0,a.jsx)("p",{className:"font-medium",children:q(c.latency?.total)})]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 text-sm bg-bg-subtle/50 p-3 rounded-lg",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"}),(0,a.jsx)("p",{className:"font-bold text-primary",children:$(c.tokens?.prompt_tokens||c.promptTokens||0)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"}),(0,a.jsx)("p",{className:"font-bold text-success",children:$(c.tokens?.completion_tokens||c.completionTokens||0)})]})]}),c.request&&Object.keys(c.request).length>0&&(0,a.jsx)(D,{title:"Client Request",icon:"upload",defaultOpen:!0,children:(0,a.jsx)(R,{data:c.request})}),c.providerRequest&&("string"==typeof c.providerRequest?(0,a.jsx)(D,{title:"Provider Request",icon:"send",children:(0,a.jsx)("pre",{className:"text-xs text-text-muted whitespace-pre-wrap",children:c.providerRequest})}):Object.keys(c.providerRequest).length>0&&(0,a.jsx)(D,{title:"Provider Request",icon:"send",children:(0,a.jsx)(R,{data:c.providerRequest})})),c.providerResponse&&("string"==typeof c.providerResponse?(0,a.jsx)(D,{title:"Provider Response",icon:"download",children:(0,a.jsx)("pre",{className:"text-xs text-text-muted whitespace-pre-wrap",children:c.providerResponse})}):Object.keys(c.providerResponse).length>0&&(0,a.jsx)(D,{title:"Provider Response",icon:"download",children:(0,a.jsx)(R,{data:c.providerResponse})})),c.response&&Object.keys(c.response).length>0&&(0,a.jsx)(D,{title:"Client Response",icon:"reply",children:(0,a.jsx)(R,{data:c.response})})]})})]})}function O({params:e}){let t=(0,l.use)(e);return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(n.Qv,{}),children:(0,a.jsx)(P,{keyId:t.keyId})})}function P({keyId:e}){let t=(0,r.useSearchParams)(),s=(0,r.useRouter)(),[i,d]=(0,l.useState)(!1),o=t.get("tab"),c=o&&["overview","requests"].includes(o)?o:"overview";return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("button",{onClick:()=>s.push("/dashboard/employees"),className:"flex items-center gap-2 text-text-muted hover:text-text transition-colors text-sm self-start",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_back"}),"Back to Employees"]}),(0,a.jsx)(n.Iz,{options:[{value:"overview",label:"Overview"},{value:"requests",label:"Request Details"}],value:c,onChange:a=>{if(a===c)return;d(!0);let l=new URLSearchParams(t);l.set("tab",a),s.push(`/dashboard/employees/${e}?${l.toString()}`,{scroll:!1}),setTimeout(()=>d(!1),300)}}),i?(0,a.jsx)(n.Qv,{}):(0,a.jsxs)(a.Fragment,{children:["overview"===c&&(0,a.jsx)(b,{keyId:e}),"requests"===c&&(0,a.jsx)(z,{keyId:e})]})]})}},81107:(e,t,s)=>{Promise.resolve().then(s.bind(s,71086))}},e=>{e.O(0,[2574,3862,5772,6902,2652,5497,8441,3794,7358],()=>e(e.s=81107)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7979],{45296:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>C});var l=s(95155),a=s(12115),r=s(73321),n=s(35497),o=s(84588),i=s(56061),c=s(1728),d=s(48035),x=s(28408),m=s(32539),u=s(59656),p=s(58021),h=s(99443);let b=e=>new Intl.NumberFormat().format(e||0),f=e=>`$${(e||0).toFixed(2)}`,g=[{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function y({field:e,currentSort:t,currentOrder:s}){return t!==e?(0,l.jsx)("span",{className:"ml-1 opacity-20 text-[10px]",children:"↕"}):(0,l.jsx)("span",{className:"ml-1 text-[10px]",children:"asc"===s?"↑":"↓"})}function j(){let e=(0,r.useRouter)(),[t,s]=(0,a.useState)(null),[n,j]=(0,a.useState)(!0),[v,N]=(0,a.useState)("7d"),[k,w]=(0,a.useState)("lastActive"),[C,S]=(0,a.useState)("desc"),[D,$]=(0,a.useState)(""),[T,A]=(0,a.useState)("cost"),L=(0,a.useCallback)(async()=>{j(!0);try{let e=await fetch(`/api/employees/stats?period=${v}`);if(e.ok){let t=await e.json();s(t)}}catch(e){console.error("Failed to fetch employee stats:",e)}finally{j(!1)}},[v]);(0,a.useEffect)(()=>{L()},[L]);let O=e=>{k===e?S("asc"===C?"desc":"asc"):(w(e),S("desc"))},F=(0,a.useMemo)(()=>{if(!t?.employees)return[];let e=[...t.employees];if(D){let t=D.toLowerCase();e=e.filter(e=>e.name?.toLowerCase().includes(t))}return e.sort((e,t)=>{let s=e[k],l=t[k];return("string"==typeof s&&(s=s.toLowerCase()),"string"==typeof l&&(l=l.toLowerCase()),s<l)?"asc"===C?-1:1:s>l?"asc"===C?1:-1:0}),e},[t,k,C,D]),R=(0,a.useMemo)(()=>t?.employees?[...t.employees].filter(e=>"cost"===T?e.totalCost>0:e.totalTokens>0).sort((e,t)=>"cost"===T?t.totalCost-e.totalCost:t.totalTokens-e.totalTokens).slice(0,10).map(e=>({name:e.name?.length>12?e.name.slice(0,12)+"…":e.name,fullName:e.name,value:"cost"===T?e.totalCost:e.totalTokens})):[],[t,T]);if(n)return(0,l.jsx)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px] animate-spin",children:"progress_activity"})});if(!t)return(0,l.jsx)("div",{className:"text-text-muted text-center py-12",children:"Failed to load employee data."});let{summary:E}=t;return(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)("div",{className:"flex items-center gap-2 self-end",children:(0,l.jsx)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border",children:g.map(e=>(0,l.jsx)("button",{onClick:()=>N(e.value),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${v===e.value?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:e.label},e.value))})}),(0,l.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,l.jsxs)(o.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,l.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Employees"}),(0,l.jsx)("span",{className:"text-2xl font-bold",children:b(E.totalEmployees)}),(0,l.jsxs)("span",{className:"text-xs text-text-muted",children:[b(E.activeEmployees)," active"]})]}),(0,l.jsxs)(o.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,l.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,l.jsx)("span",{className:"text-2xl font-bold text-primary",children:b(E.totalRequests)})]}),(0,l.jsxs)(o.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,l.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Cost"}),(0,l.jsxs)("span",{className:"text-2xl font-bold text-warning",children:["~",f(E.totalCost)]})]}),(0,l.jsxs)(o.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,l.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Top Spender"}),(0,l.jsx)("span",{className:"text-2xl font-bold truncate",children:E.topSpender?.name||"—"}),(0,l.jsx)("span",{className:"text-xs text-text-muted",children:E.topSpender?f(E.topSpender.cost):"—"})]})]}),R.length>0&&(0,l.jsxs)(o.default,{className:"p-4 flex flex-col gap-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("h3",{className:"font-semibold text-sm text-text-muted uppercase",children:"Employee Comparison"}),(0,l.jsxs)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border",children:[(0,l.jsx)("button",{onClick:()=>A("cost"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"cost"===T?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Cost"}),(0,l.jsx)("button",{onClick:()=>A("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===T?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"})]})]}),(0,l.jsx)(c.u,{width:"100%",height:250,children:(0,l.jsxs)(d.E,{data:R,margin:{top:4,right:8,left:0,bottom:0},children:[(0,l.jsx)(x.d,{strokeDasharray:"3 3",strokeOpacity:.1}),(0,l.jsx)(m.W,{dataKey:"name",tick:{fontSize:11,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1}),(0,l.jsx)(u.h,{tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,tickFormatter:"cost"===T?e=>`$${e.toFixed(2)}`:e=>e>=1e3?`${(e/1e3).toFixed(0)}K`:e,width:55}),(0,l.jsx)(p.m,{cursor:!1,contentStyle:{backgroundColor:"var(--color-bg)",border:"1px solid var(--color-border)",borderRadius:"8px",fontSize:"12px"},formatter:e=>["cost"===T?`$${e.toFixed(4)}`:b(e),"cost"===T?"Cost":"Tokens"],labelFormatter:(e,t)=>t?.[0]?.payload?.fullName||e}),(0,l.jsx)(h.yP,{dataKey:"value",fill:"cost"===T?"#f59e0b":"#6366f1",radius:[4,4,0,0],maxBarSize:40})]})})]}),(0,l.jsxs)(o.default,{className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"p-4 border-b border-border bg-bg-subtle/50 flex items-center justify-between",children:[(0,l.jsx)("h3",{className:"font-semibold",children:"Employees"}),(0,l.jsx)("input",{type:"text",placeholder:"Search by name...",value:D,onChange:e=>$(e.target.value),className:"px-3 py-1.5 rounded-lg border border-border bg-bg text-sm text-text focus:outline-none focus:ring-2 focus:ring-primary/50 w-48"})]}),(0,l.jsx)("div",{className:"overflow-x-auto",children:(0,l.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,l.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,l.jsxs)("tr",{children:[(0,l.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>O("name"),children:["Name ",(0,l.jsx)(y,{field:"name",currentSort:k,currentOrder:C})]}),(0,l.jsx)("th",{className:"px-6 py-3 text-center",children:"Status"}),(0,l.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>O("totalRequests"),children:["Requests ",(0,l.jsx)(y,{field:"totalRequests",currentSort:k,currentOrder:C})]}),(0,l.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>O("totalTokens"),children:["Tokens ",(0,l.jsx)(y,{field:"totalTokens",currentSort:k,currentOrder:C})]}),(0,l.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>O("totalCost"),children:["Cost ",(0,l.jsx)(y,{field:"totalCost",currentSort:k,currentOrder:C})]}),(0,l.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>O("modelsUsed"),children:["Models ",(0,l.jsx)(y,{field:"modelsUsed",currentSort:k,currentOrder:C})]}),(0,l.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>O("lastActive"),children:["Last Active ",(0,l.jsx)(y,{field:"lastActive",currentSort:k,currentOrder:C})]})]})}),(0,l.jsxs)("tbody",{className:"divide-y divide-border",children:[F.map(t=>(0,l.jsxs)("tr",{className:"hover:bg-bg-subtle/50 transition-colors cursor-pointer",onClick:()=>e.push(`/dashboard/employees/${t.keyId}`),children:[(0,l.jsx)("td",{className:"px-6 py-3 font-medium",children:t.name||"Unnamed"}),(0,l.jsx)("td",{className:"px-6 py-3 text-center",children:(0,l.jsx)(i.default,{variant:t.isActive?"success":"error",size:"sm",children:t.isActive?"Active":"Inactive"})}),(0,l.jsx)("td",{className:"px-6 py-3 text-right",children:b(t.totalRequests)}),(0,l.jsx)("td",{className:"px-6 py-3 text-right",children:b(t.totalTokens)}),(0,l.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:f(t.totalCost)}),(0,l.jsx)("td",{className:"px-6 py-3 text-right",children:t.modelsUsed}),(0,l.jsx)("td",{className:"px-6 py-3 text-right whitespace-nowrap",children:(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 justify-end",children:[t.lastActive&&(0,l.jsx)("span",{className:`inline-block size-1.5 rounded-full ${function(e){if(!e)return"";let t=(Date.now()-new Date(e))/6e4;return t<1?"bg-green-500":t<=60?"bg-blue-400":"bg-red-500"}(t.lastActive)} ${(Date.now()-new Date(t.lastActive))/6e4<10?"animate-pulse":""}`}),(0,l.jsx)("span",{className:`font-semibold ${function(e){if(!e)return"text-text-muted";let t=(Date.now()-new Date(e))/6e4;return t<1?"text-green-500":t<=60?"text-blue-400":"text-red-400"}(t.lastActive)}`,children:function(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()}(t.lastActive)})]})})]},t.keyId)),0===F.length&&(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:7,className:"px-6 py-8 text-center text-text-muted",children:D?"No employees match your search.":"No employees found. Create API keys to see employees here."})})]})]})})]})]})}let v=e=>new Intl.NumberFormat().format(e||0),N=[{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}],k=[{key:"name",label:"Employee",align:"left"},{key:"isActive",label:"Status",align:"center"},{key:"totalRequests",label:"Requests",align:"right"},{key:"totalPromptTokens",label:"Input Tokens",align:"right"},{key:"totalCompletionTokens",label:"Output Tokens",align:"right"},{key:"totalTokens",label:"Total Tokens",align:"right"},{key:"totalCost",label:"Cost",align:"right"},{key:"modelsUsed",label:"Models",align:"right"},{key:"lastActive",label:"Last Active",align:"right"},{key:"apiKey",label:"API Key",align:"center",sortable:!1}];function w(){let e=(0,r.useRouter)(),[t,s]=(0,a.useState)("7d"),[n,c]=(0,a.useState)(null),[d,x]=(0,a.useState)(!0),[m,u]=(0,a.useState)(""),[p,h]=(0,a.useState)("lastActive"),[b,f]=(0,a.useState)("desc"),g=(0,a.useCallback)(async()=>{x(!0);try{let e=await fetch(`/api/employees/stats?period=${t}`);if(e.ok){let t=await e.json();c(t)}}catch(e){console.error("Failed to fetch:",e)}finally{x(!1)}},[t]);(0,a.useEffect)(()=>{g()},[g]);let y=n?.employees||[],j=(0,a.useMemo)(()=>(m?y.filter(e=>e.name?.toLowerCase().includes(m.toLowerCase())):[...y]).sort((e,t)=>{let s=e[p],l=t[p];return("name"===p?(s=(s||"").toLowerCase(),l=(l||"").toLowerCase()):"isActive"===p?(s=+!!s,l=+!!l):"lastActive"===p?(s=s?new Date(s).getTime():0,l=l?new Date(l).getTime():0):(s=s||0,l=l||0),s<l)?"asc"===b?-1:1:s>l?"asc"===b?1:-1:0}),[y,m,p,b]);return d?(0,l.jsx)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px] animate-spin",children:"progress_activity"})}):(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border",children:N.map(e=>(0,l.jsx)("button",{onClick:()=>s(e.value),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${t===e.value?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:e.label},e.value))}),(0,l.jsx)("input",{type:"text",placeholder:"Filter by name...",value:m,onChange:e=>u(e.target.value),className:"px-3 py-1.5 rounded-lg border border-border bg-bg text-sm text-text focus:outline-none focus:ring-2 focus:ring-primary/50 w-48"})]}),(0,l.jsx)(o.default,{className:"overflow-hidden",children:(0,l.jsx)("div",{className:"overflow-x-auto",children:(0,l.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,l.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,l.jsx)("tr",{children:k.map(e=>{let t=!1!==e.sortable,s=p===e.key,a="center"===e.align?"text-center":"right"===e.align?"text-right":"text-left";return(0,l.jsx)("th",{className:`px-6 py-3 ${a} ${t?"cursor-pointer select-none hover:text-text transition-colors":""}`,onClick:()=>{var s;return t&&void((s=e.key)===p?f(e=>"asc"===e?"desc":"asc"):(h(s),f("desc")))},children:(0,l.jsxs)("span",{className:"inline-flex items-center gap-1",children:[e.label,t&&s&&(0,l.jsx)("span",{className:"text-[10px]",children:"asc"===b?"↑":"↓"}),t&&!s&&(0,l.jsx)("span",{className:"opacity-20 text-[10px]",children:"↕"})]})},e.key)})})}),(0,l.jsxs)("tbody",{className:"divide-y divide-border",children:[j.map(t=>{let s;return(0,l.jsxs)("tr",{onClick:()=>e.push(`/dashboard/employees/${t.keyId}`),className:"hover:bg-bg-subtle/50 transition-colors cursor-pointer",children:[(0,l.jsx)("td",{className:"px-6 py-3 font-medium",children:t.name||"Unnamed"}),(0,l.jsx)("td",{className:"px-6 py-3 text-center",children:(0,l.jsx)(i.default,{variant:t.isActive?"success":"error",size:"sm",children:t.isActive?"Active":"Inactive"})}),(0,l.jsx)("td",{className:"px-6 py-3 text-right",children:v(t.totalRequests)}),(0,l.jsx)("td",{className:"px-6 py-3 text-right text-primary",children:v(t.totalPromptTokens)}),(0,l.jsx)("td",{className:"px-6 py-3 text-right text-success",children:v(t.totalCompletionTokens)}),(0,l.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:v(t.totalTokens)}),(0,l.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:(s=t.totalCost,`$${(s||0).toFixed(2)}`)}),(0,l.jsx)("td",{className:"px-6 py-3 text-right",children:t.modelsUsed}),(0,l.jsx)("td",{className:"px-6 py-3 text-right whitespace-nowrap",children:(0,l.jsxs)("span",{className:"inline-flex items-center gap-1",children:[t.lastActive&&(0,l.jsx)("span",{className:`inline-block size-1.5 rounded-full ${function(e){if(!e)return"";let t=(Date.now()-new Date(e))/6e4;return t<1?"bg-green-500":t<=60?"bg-blue-400":"bg-red-500"}(t.lastActive)} ${(Date.now()-new Date(t.lastActive))/6e4<=60?"animate-pulse":""}`}),(0,l.jsx)("span",{className:`font-semibold ${function(e){if(!e)return"text-text-muted";let t=(Date.now()-new Date(e))/6e4;return t<1?"text-green-500":t<=60?"text-blue-400":"text-red-400"}(t.lastActive)}`,children:function(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()}(t.lastActive)})]})}),(0,l.jsx)("td",{className:"px-6 py-3 text-center",children:(0,l.jsx)("code",{className:"text-xs bg-bg-subtle px-2 py-0.5 rounded",children:t.apiKey})})]},t.keyId)}),0===j.length&&(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:10,className:"px-6 py-8 text-center text-text-muted",children:"No employees found."})})]})]})})})]})}function C(){return(0,l.jsx)(a.Suspense,{fallback:(0,l.jsx)(n.Qv,{}),children:(0,l.jsx)(S,{})})}function S(){let e=(0,r.useSearchParams)(),t=(0,r.useRouter)(),[s,o]=(0,a.useState)(!1),i=e.get("tab"),c=i&&["overview","details"].includes(i)?i:"overview";return(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(n.Iz,{options:[{value:"overview",label:"Overview"},{value:"details",label:"Details"}],value:c,onChange:s=>{if(s===c)return;o(!0);let l=new URLSearchParams(e);l.set("tab",s),t.push(`/dashboard/employees?${l.toString()}`,{scroll:!1}),setTimeout(()=>o(!1),300)}}),s?(0,l.jsx)(n.Qv,{}):(0,l.jsxs)(l.Fragment,{children:["overview"===c&&(0,l.jsx)(a.Suspense,{fallback:(0,l.jsx)(n.Qv,{}),children:(0,l.jsx)(j,{})}),"details"===c&&(0,l.jsx)(w,{})]})]})}},70842:(e,t,s)=>{Promise.resolve().then(s.bind(s,45296))}},e=>{e.O(0,[2574,3862,5772,6902,5909,2652,5497,8441,3794,7358],()=>e(e.s=70842)),_N_E=e.O()}]);
@@ -1,3 +1,3 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8093],{68093:(e,t,s)=>{Promise.resolve().then(s.bind(s,95907))},95907:(e,t,s)=>{"use strict";s.d(t,{default:()=>c});var l=s(95155),a=s(12115),r=s(14051),i=s.n(r),n=s(35497),o=s(11059);let d=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}];function c({machineId:e}){let[t,s]=(0,a.useState)([]),[r,i]=(0,a.useState)(!0),[m,x]=(0,a.useState)(!1),[h,u]=(0,a.useState)(""),[p,y]=(0,a.useState)(null),[b,g]=(0,a.useState)(!1),[f,j]=(0,a.useState)(!1),[k,v]=(0,a.useState)(""),[N,w]=(0,a.useState)(""),[C,S]=(0,a.useState)(""),[T,A]=(0,a.useState)(!1),[E,P]=(0,a.useState)(""),[$,_]=(0,a.useState)(null),[I,O]=(0,a.useState)(!1),[U,D]=(0,a.useState)(!1),[K,R]=(0,a.useState)(new Set),{copied:W,copy:q}=(0,o.C)();(0,a.useEffect)(()=>{J(),F()},[]);let F=async()=>{try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status")]);if(e.ok){let t=await e.json();g(t.requireApiKey||!1)}if(t.ok){let e=await t.json();j(e.enabled||!1),v(e.tunnelUrl||""),w(e.publicUrl||""),S(e.shortId||"")}}catch(e){console.log("Error loading settings:",e)}},L=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&g(e)}catch(e){console.log("Error updating requireApiKey:",e)}},J=async()=>{try{let e=await fetch("/api/keys"),t=await e.json();e.ok&&s(t.keys||[])}catch(e){console.log("Error fetching data:",e)}finally{i(!1)}},z=async()=>{D(!1),A(!0),_(null),P("Connecting to server...");let e=[{delay:2e3,msg:"Creating tunnel..."},{delay:5e3,msg:"Starting cloudflared..."},{delay:15e3,msg:"Establishing connections..."},{delay:3e4,msg:"Waiting for tunnel ready..."}].map(({delay:e,msg:t})=>setTimeout(()=>P(t),e));try{let t=new AbortController,s=setTimeout(()=>t.abort(),9e4),l=await fetch("/api/tunnel/enable",{method:"POST",signal:t.signal});clearTimeout(s),e.forEach(clearTimeout);let a=await l.json();l.ok?(j(!0),v(a.tunnelUrl||""),w(a.publicUrl||""),S(a.shortId||""),_({type:"success",message:"Tunnel connected!"})):_({type:"error",message:a.error||"Failed to enable tunnel"})}catch(t){e.forEach(clearTimeout),_({type:"error",message:t?.name==="AbortError"?"Tunnel creation timed out":t.message})}finally{A(!1),P("")}},H=async()=>{A(!0),_(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(j(!1),v(""),w(""),_({type:"success",message:"Tunnel disabled"}),O(!1)):_({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){_({type:"error",message:e.message})}finally{A(!1)}},M=async()=>{if(h.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:h})}),t=await e.json();e.ok&&(y(t.key),await J(),u(""),x(!1))}catch(e){console.log("Error creating key:",e)}},Q=async e=>{if(confirm("Delete this API key?"))try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&(s(t.filter(t=>t.id!==e)),R(t=>{let s=new Set(t);return s.delete(e),s}))}catch(e){console.log("Error deleting key:",e)}},Z=async(e,t)=>{try{(await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&s(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error toggling key:",e)}},[B,G]=(0,a.useState)("/v1");if((0,a.useEffect)(()=>{G(`${window.location.origin}/v1`)},[]),r)return(0,l.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{})]});let V=f&&N?`${N}/v1`:B;return(0,l.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,l.jsxs)(n.Zp,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:"API Endpoint"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:f?"Using Tunnel":"Using Local Server"})]}),(0,l.jsx)("div",{className:"flex items-center gap-2",children:f?(0,l.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"cloud_off",onClick:()=>O(!0),disabled:T,className:"bg-red-500/10! text-red-500! hover:bg-red-500/20! border-red-500/30!",children:"Disable Tunnel"}):(0,l.jsx)(n.$n,{variant:"primary",icon:"cloud_upload",onClick:()=>D(!0),disabled:T,className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600",children:T?(0,l.jsxs)("span",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),E||"Creating tunnel..."]}):"Enable Tunnel"})})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.pd,{value:V,readOnly:!0,className:`flex-1 font-mono text-sm ${f?"animate-border-glow":""}`}),(0,l.jsx)(n.$n,{variant:"secondary",icon:"endpoint_url"===W?"check":"content_copy",onClick:()=>q(V,"endpoint_url"),children:"endpoint_url"===W?"Copied!":"Copy"})]}),$&&(0,l.jsx)("div",{className:`mt-3 p-2 rounded text-sm ${"success"===$.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===$.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:$.message})]}),(0,l.jsxs)(n.Zp,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:"API Keys"}),(0,l.jsx)(n.$n,{icon:"add",onClick:()=>x(!0),children:"Create Key"})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,l.jsx)(n.lM,{checked:b,onChange:()=>L(!b)})]}),0===t.length?(0,l.jsxs)("div",{className:"text-center py-12",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,l.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,l.jsx)(n.$n,{icon:"add",onClick:()=>x(!0),children:"Create Key"})]}):(0,l.jsx)("div",{className:"flex flex-col",children:t.map(e=>{var t;return(0,l.jsxs)("div",{className:`group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===e.isActive?"opacity-60":""}`,children:[(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,l.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,l.jsx)("code",{className:"text-xs text-text-muted font-mono",children:K.has(e.id)?e.key:(t=e.key)?t.length>8?t.slice(0,8)+"...":t:""}),(0,l.jsx)("button",{onClick:()=>{var t;return t=e.id,void R(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all",title:K.has(e.id)?"Hide key":"Show key",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:K.has(e.id)?"visibility_off":"visibility"})}),(0,l.jsx)("button",{onClick:()=>q(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:W===e.id?"check":"content_copy"})})]}),(0,l.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]}),!1===e.isActive&&(0,l.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(n.lM,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?confirm(`Pause API key "${e.name}"?
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099],{68093:(e,t,s)=>{Promise.resolve().then(s.bind(s,95907))},95907:(e,t,s)=>{"use strict";s.d(t,{default:()=>c});var l=s(95155),a=s(12115),r=s(14051),i=s.n(r),n=s(35497),o=s(11059);let d=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}];function c({machineId:e}){let[t,s]=(0,a.useState)([]),[r,i]=(0,a.useState)(!0),[m,x]=(0,a.useState)(!1),[h,u]=(0,a.useState)(""),[p,y]=(0,a.useState)(null),[b,g]=(0,a.useState)(!1),[f,j]=(0,a.useState)(!1),[k,v]=(0,a.useState)(""),[N,w]=(0,a.useState)(""),[C,S]=(0,a.useState)(""),[T,A]=(0,a.useState)(!1),[E,P]=(0,a.useState)(""),[_,$]=(0,a.useState)(null),[I,O]=(0,a.useState)(!1),[U,D]=(0,a.useState)(!1),[K,R]=(0,a.useState)(new Set),{copied:W,copy:q}=(0,o.C)();(0,a.useEffect)(()=>{J(),F()},[]);let F=async()=>{try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status")]);if(e.ok){let t=await e.json();g(t.requireApiKey||!1)}if(t.ok){let e=await t.json();j(e.enabled||!1),v(e.tunnelUrl||""),w(e.publicUrl||""),S(e.shortId||"")}}catch(e){console.log("Error loading settings:",e)}},L=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&g(e)}catch(e){console.log("Error updating requireApiKey:",e)}},J=async()=>{try{let e=await fetch("/api/keys"),t=await e.json();e.ok&&s(t.keys||[])}catch(e){console.log("Error fetching data:",e)}finally{i(!1)}},z=async()=>{D(!1),A(!0),$(null),P("Connecting to server...");let e=[{delay:2e3,msg:"Creating tunnel..."},{delay:5e3,msg:"Starting cloudflared..."},{delay:15e3,msg:"Establishing connections..."},{delay:3e4,msg:"Waiting for tunnel ready..."}].map(({delay:e,msg:t})=>setTimeout(()=>P(t),e));try{let t=new AbortController,s=setTimeout(()=>t.abort(),9e4),l=await fetch("/api/tunnel/enable",{method:"POST",signal:t.signal});clearTimeout(s),e.forEach(clearTimeout);let a=await l.json();l.ok?(j(!0),v(a.tunnelUrl||""),w(a.publicUrl||""),S(a.shortId||""),$({type:"success",message:"Tunnel connected!"})):$({type:"error",message:a.error||"Failed to enable tunnel"})}catch(t){e.forEach(clearTimeout),$({type:"error",message:t?.name==="AbortError"?"Tunnel creation timed out":t.message})}finally{A(!1),P("")}},H=async()=>{A(!0),$(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(j(!1),v(""),w(""),$({type:"success",message:"Tunnel disabled"}),O(!1)):$({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){$({type:"error",message:e.message})}finally{A(!1)}},M=async()=>{if(h.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:h})}),t=await e.json();e.ok&&(y(t.key),await J(),u(""),x(!1))}catch(e){console.log("Error creating key:",e)}},Q=async e=>{if(confirm("Delete this API key?"))try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&(s(t.filter(t=>t.id!==e)),R(t=>{let s=new Set(t);return s.delete(e),s}))}catch(e){console.log("Error deleting key:",e)}},Z=async(e,t)=>{try{(await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&s(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error toggling key:",e)}},[B,G]=(0,a.useState)("/v1");if((0,a.useEffect)(()=>{G(`${window.location.origin}/v1`)},[]),r)return(0,l.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,l.jsx)(n.Qv,{}),(0,l.jsx)(n.Qv,{})]});let V=f&&N?`${N}/v1`:B;return(0,l.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,l.jsxs)(n.Zp,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:"API Endpoint"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:f?"Using Tunnel":"Using Local Server"})]}),(0,l.jsx)("div",{className:"flex items-center gap-2",children:f?(0,l.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"cloud_off",onClick:()=>O(!0),disabled:T,className:"bg-red-500/10! text-red-500! hover:bg-red-500/20! border-red-500/30!",children:"Disable Tunnel"}):(0,l.jsx)(n.$n,{variant:"primary",icon:"cloud_upload",onClick:()=>D(!0),disabled:T,className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600",children:T?(0,l.jsxs)("span",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),E||"Creating tunnel..."]}):"Enable Tunnel"})})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.pd,{value:V,readOnly:!0,className:`flex-1 font-mono text-sm ${f?"animate-border-glow":""}`}),(0,l.jsx)(n.$n,{variant:"secondary",icon:"endpoint_url"===W?"check":"content_copy",onClick:()=>q(V,"endpoint_url"),children:"endpoint_url"===W?"Copied!":"Copy"})]}),_&&(0,l.jsx)("div",{className:`mt-3 p-2 rounded text-sm ${"success"===_.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===_.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:_.message})]}),(0,l.jsxs)(n.Zp,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:"API Keys"}),(0,l.jsx)(n.$n,{icon:"add",onClick:()=>x(!0),children:"Create Key"})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,l.jsx)(n.lM,{checked:b,onChange:()=>L(!b)})]}),0===t.length?(0,l.jsxs)("div",{className:"text-center py-12",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,l.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,l.jsx)(n.$n,{icon:"add",onClick:()=>x(!0),children:"Create Key"})]}):(0,l.jsx)("div",{className:"flex flex-col",children:t.map(e=>{var t;return(0,l.jsxs)("div",{className:`group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===e.isActive?"opacity-60":""}`,children:[(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,l.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,l.jsx)("code",{className:"text-xs text-text-muted font-mono",children:K.has(e.id)?e.key:(t=e.key)?t.length>8?t.slice(0,8)+"...":t:""}),(0,l.jsx)("button",{onClick:()=>{var t;return t=e.id,void R(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all",title:K.has(e.id)?"Hide key":"Show key",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:K.has(e.id)?"visibility_off":"visibility"})}),(0,l.jsx)("button",{onClick:()=>q(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:W===e.id?"check":"content_copy"})})]}),(0,l.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]}),!1===e.isActive&&(0,l.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(n.lM,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?confirm(`Pause API key "${e.name}"?
2
2
 
3
- This key will stop working immediately but can be resumed later.`)&&Z(e.id,t):Z(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,l.jsx)("button",{onClick:()=>Q(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-0 group-hover:opacity-100 transition-all",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,l.jsx)(n.aF,{isOpen:m,title:"Create API Key",onClose:()=>{x(!1),u("")},children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(n.pd,{label:"Key Name",value:h,onChange:e=>u(e.target.value),placeholder:"Production Key"}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.$n,{onClick:M,fullWidth:!0,disabled:!h.trim(),children:"Create"}),(0,l.jsx)(n.$n,{onClick:()=>{x(!1),u("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,l.jsx)(n.aF,{isOpen:!!p,title:"API Key Created",onClose:()=>y(null),children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,l.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,l.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.pd,{value:p||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,l.jsx)(n.$n,{variant:"secondary",icon:"created_key"===W?"check":"content_copy",onClick:()=>q(p,"created_key"),children:"created_key"===W?"Copied!":"Copy"})]}),(0,l.jsx)(n.$n,{onClick:()=>y(null),fullWidth:!0,children:"Done"})]})}),(0,l.jsx)(n.aF,{isOpen:U,title:"Enable Tunnel",onClose:()=>D(!1),children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"cloud_upload"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium mb-1",children:"Cloudflare Tunnel"}),(0,l.jsx)("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"Expose your local 9Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,l.jsx)("div",{className:"grid grid-cols-2 gap-3",children:d.map(e=>(0,l.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:e.icon}),(0,l.jsx)("p",{className:"text-xs font-semibold",children:e.title}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:e.desc})]},e.title))}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.$n,{onClick:z,fullWidth:!0,className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600 text-white!",children:"Start Tunnel"}),(0,l.jsx)(n.$n,{onClick:()=>D(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,l.jsx)(n.aF,{isOpen:I,title:"Disable Tunnel",onClose:()=>!T&&O(!1),children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4",children:(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-red-600 dark:text-red-400",children:"warning"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-1",children:"Warning"}),(0,l.jsx)("p",{className:"text-sm text-red-700 dark:text-red-300",children:"The tunnel will be disconnected. Remote access will stop working."})]})]})}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Are you sure you want to disable the tunnel?"}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.$n,{onClick:H,fullWidth:!0,disabled:T,className:"bg-red-500! hover:bg-red-600! text-white!",children:T?(0,l.jsxs)("span",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Disabling..."]}):"Disable Tunnel"}),(0,l.jsx)(n.$n,{onClick:()=>O(!1),variant:"ghost",fullWidth:!0,disabled:T,children:"Cancel"})]})]})})]})}c.propTypes={machineId:i().string.isRequired}}}]);
3
+ This key will stop working immediately but can be resumed later.`)&&Z(e.id,t):Z(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,l.jsx)("button",{onClick:()=>Q(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-0 group-hover:opacity-100 transition-all",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,l.jsx)(n.aF,{isOpen:m,title:"Create API Key",onClose:()=>{x(!1),u("")},children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(n.pd,{label:"Key Name",value:h,onChange:e=>u(e.target.value),placeholder:"Production Key"}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.$n,{onClick:M,fullWidth:!0,disabled:!h.trim(),children:"Create"}),(0,l.jsx)(n.$n,{onClick:()=>{x(!1),u("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,l.jsx)(n.aF,{isOpen:!!p,title:"API Key Created",onClose:()=>y(null),children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,l.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,l.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.pd,{value:p||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,l.jsx)(n.$n,{variant:"secondary",icon:"created_key"===W?"check":"content_copy",onClick:()=>q(p,"created_key"),children:"created_key"===W?"Copied!":"Copy"})]}),(0,l.jsx)(n.$n,{onClick:()=>y(null),fullWidth:!0,children:"Done"})]})}),(0,l.jsx)(n.aF,{isOpen:U,title:"Enable Tunnel",onClose:()=>D(!1),children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"cloud_upload"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium mb-1",children:"Cloudflare Tunnel"}),(0,l.jsx)("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"Expose your local 9Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,l.jsx)("div",{className:"grid grid-cols-2 gap-3",children:d.map(e=>(0,l.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:e.icon}),(0,l.jsx)("p",{className:"text-xs font-semibold",children:e.title}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:e.desc})]},e.title))}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.$n,{onClick:z,fullWidth:!0,className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600 text-white!",children:"Start Tunnel"}),(0,l.jsx)(n.$n,{onClick:()=>D(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,l.jsx)(n.aF,{isOpen:I,title:"Disable Tunnel",onClose:()=>!T&&O(!1),children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4",children:(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-red-600 dark:text-red-400",children:"warning"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-1",children:"Warning"}),(0,l.jsx)("p",{className:"text-sm text-red-700 dark:text-red-300",children:"The tunnel will be disconnected. Remote access will stop working."})]})]})}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Are you sure you want to disable the tunnel?"}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.$n,{onClick:H,fullWidth:!0,disabled:T,className:"bg-red-500! hover:bg-red-600! text-white!",children:T?(0,l.jsxs)("span",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Disabling..."]}):"Disable Tunnel"}),(0,l.jsx)(n.$n,{onClick:()=>O(!1),variant:"ghost",fullWidth:!0,disabled:T,children:"Cancel"})]})]})})]})}c.propTypes={machineId:i().string.isRequired}}},e=>{e.O(0,[2574,3862,5772,6902,2652,5497,8441,3794,7358],()=>e(e.s=68093)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6607],{23879:(e,s,t)=>{"use strict";t.d(s,{default:()=>d});var a=t(95155),n=t(12115),i=t(3534),l=t(28777),c=t(52679),o=t(97397);function d(){let[e,s]=(0,n.useState)([]),[t,d]=(0,n.useState)([]),[r,u]=(0,n.useState)({}),[h,f]=(0,n.useState)(!1),[p,v]=(0,n.useState)(null),[w,g]=(0,n.useState)({running:!1,certExists:!1,dnsStatus:{},hasCachedPassword:!1});(0,n.useEffect)(()=>{y(),S(),k(),x()},[]);let y=async()=>{try{let e=await fetch("/api/providers");if(e.ok){let t=await e.json();s(t.connections||[])}}catch{}},S=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let s=await e.json();d(s.keys||[])}}catch{}},k=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let s=await e.json();u(s.aliases||{})}}catch{}},x=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();f(s.cloudEnabled||!1)}}catch{}},j=()=>e.filter(e=>!1!==e.isActive),E=Object.entries(i.wn);return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(o.tA,{apiKeys:t,cloudEnabled:h,onStatusChange:g}),(0,a.jsx)("div",{className:"flex flex-col gap-2",children:E.map(([e,s])=>(0,a.jsx)(o.kn,{tool:s,isExpanded:p===e,onToggle:()=>v(p===e?null:e),serverRunning:w.running,dnsActive:w.dnsStatus?.[e]||!1,hasCachedPassword:w.hasCachedPassword||!1,apiKeys:t,activeProviders:j(),hasActiveProviders:j().some(e=>(0,l.KC)(e.provider).length>0||(0,c.mq)(e.provider)||(0,c.gb)(e.provider)),modelAliases:r,cloudEnabled:h,onDnsChange:e=>g(s=>({...s,dnsStatus:e.dnsStatus??s.dnsStatus}))},e))})]})}},49425:(e,s,t)=>{Promise.resolve().then(t.bind(t,23879))}},e=>{e.O(0,[2574,3862,5772,123,2652,5497,9242,8441,3794,7358],()=>e(e.s=49425)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6607],{23879:(e,s,t)=>{"use strict";t.d(s,{default:()=>d});var a=t(95155),n=t(12115),i=t(3534),l=t(28777),c=t(52679),o=t(97397);function d(){let[e,s]=(0,n.useState)([]),[t,d]=(0,n.useState)([]),[r,u]=(0,n.useState)({}),[h,f]=(0,n.useState)(!1),[p,v]=(0,n.useState)(null),[w,g]=(0,n.useState)({running:!1,certExists:!1,dnsStatus:{},hasCachedPassword:!1});(0,n.useEffect)(()=>{y(),S(),k(),x()},[]);let y=async()=>{try{let e=await fetch("/api/providers");if(e.ok){let t=await e.json();s(t.connections||[])}}catch{}},S=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let s=await e.json();d(s.keys||[])}}catch{}},k=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let s=await e.json();u(s.aliases||{})}}catch{}},x=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();f(s.cloudEnabled||!1)}}catch{}},j=()=>e.filter(e=>!1!==e.isActive),E=Object.entries(i.wn);return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(o.tA,{apiKeys:t,cloudEnabled:h,onStatusChange:g}),(0,a.jsx)("div",{className:"flex flex-col gap-2",children:E.map(([e,s])=>(0,a.jsx)(o.kn,{tool:s,isExpanded:p===e,onToggle:()=>v(p===e?null:e),serverRunning:w.running,dnsActive:w.dnsStatus?.[e]||!1,hasCachedPassword:w.hasCachedPassword||!1,apiKeys:t,activeProviders:j(),hasActiveProviders:j().some(e=>(0,l.KC)(e.provider).length>0||(0,c.mq)(e.provider)||(0,c.gb)(e.provider)),modelAliases:r,cloudEnabled:h,onDnsChange:e=>g(s=>({...s,dnsStatus:e.dnsStatus??s.dnsStatus}))},e))})]})}},49425:(e,s,t)=>{Promise.resolve().then(t.bind(t,23879))}},e=>{e.O(0,[2574,3862,5772,6902,2652,5497,9242,8441,3794,7358],()=>e(e.s=49425)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,543,552,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1860,1949,2121,2284,2296,2354,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3549,3562,3568,4286,4412,4422,4444,4896,5018,5079,5107,5177,5211,5226,5466,5685,5745,5922,6106,6268,6337,6529,6580,6740,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],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3471],{64561:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var a=s(95155),r=s(12115),o=s(35497),n=s(1620),l=s(31474),i=s(90620);function d(){let{theme:e,setTheme:t,isDark:s}=(0,n.D)(),[d,c]=(0,r.useState)({fallbackStrategy:"fill-first"}),[x,m]=(0,r.useState)(!0),[p,u]=(0,r.useState)({current:"",new:"",confirm:""}),[h,b]=(0,r.useState)({type:"",message:""}),[y,g]=(0,r.useState)(!1),[f,j]=(0,r.useState)(!1),[N,v]=(0,r.useState)({type:"",message:""}),w=(0,r.useRef)(null),[P,k]=(0,r.useState)({outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:""}),[C,S]=(0,r.useState)({type:"",message:""}),[E,O]=(0,r.useState)(!1),[R,L]=(0,r.useState)(!1);(0,r.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{c(e),k({outboundProxyEnabled:e?.outboundProxyEnabled===!0,outboundProxyUrl:e?.outboundProxyUrl||"",outboundNoProxy:e?.outboundNoProxy||""}),m(!1)}).catch(e=>{console.error("Failed to fetch settings:",e),m(!1)})},[]);let T=async e=>{if(e.preventDefault(),!0===d.outboundProxyEnabled){O(!0),S({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyUrl:P.outboundProxyUrl,outboundNoProxy:P.outboundNoProxy})}),t=await e.json();e.ok?(c(e=>({...e,...t})),S({type:"success",message:"Proxy settings applied"})):S({type:"error",message:t.error||"Failed to update proxy settings"})}catch(e){S({type:"error",message:"An error occurred"})}finally{O(!1)}}},F=async()=>{if(!0!==d.outboundProxyEnabled)return;let e=(P.outboundProxyUrl||"").trim();if(!e)return void S({type:"error",message:"Please enter a Proxy URL to test"});L(!0),S({type:"",message:""});try{let t=await fetch("/api/settings/proxy-test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyUrl:e})}),s=await t.json();t.ok&&s?.ok?S({type:"success",message:`Proxy test OK (${s.status}) in ${s.elapsedMs}ms`}):S({type:"error",message:s?.error||"Proxy test failed"})}catch(e){S({type:"error",message:"An error occurred"})}finally{L(!1)}},U=async e=>{O(!0),S({type:"",message:""});try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyEnabled:e})}),s=await t.json();t.ok?(c(e=>({...e,...s})),k(e=>({...e,outboundProxyEnabled:s?.outboundProxyEnabled===!0})),S({type:"success",message:e?"Proxy enabled":"Proxy disabled"})):S({type:"error",message:s.error||"Failed to update proxy settings"})}catch(e){S({type:"error",message:"An error occurred"})}finally{O(!1)}},A=async e=>{if(e.preventDefault(),p.new!==p.confirm)return void b({type:"error",message:"Passwords do not match"});g(!0),b({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:p.current,newPassword:p.new})}),t=await e.json();e.ok?(b({type:"success",message:"Password updated successfully"}),u({current:"",new:"",confirm:""})):b({type:"error",message:t.error||"Failed to update password"})}catch(e){b({type:"error",message:"An error occurred"})}finally{g(!1)}},q=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fallbackStrategy:e})})).ok&&c(t=>({...t,fallbackStrategy:e}))}catch(e){console.error("Failed to update settings:",e)}},$=async e=>{let t=parseInt(e);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stickyRoundRobinLimit:t})})).ok&&c(e=>({...e,stickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update sticky limit:",e)}},J=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&c(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},D=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({observabilityEnabled:e})})).ok&&c(t=>({...t,observabilityEnabled:e}))}catch(e){console.error("Failed to update observabilityEnabled:",e)}},_=async()=>{try{let e=await fetch("/api/settings");if(!e.ok)return;let t=await e.json();c(t)}catch(e){console.error("Failed to reload settings:",e)}},H=async()=>{j(!0),v({type:"",message:""});try{let e=await fetch("/api/settings/database");if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||"Failed to export database")}let t=await e.json(),s=JSON.stringify(t,null,2),a=new Blob([s],{type:"application/json"}),r=URL.createObjectURL(a),o=document.createElement("a"),n=new Date().toISOString().replace(/[.:]/g,"-");o.href=r,o.download=`9router-backup-${n}.json`,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r),v({type:"success",message:"Database backup downloaded"})}catch(e){v({type:"error",message:e.message||"Failed to export database"})}finally{j(!1)}},M=async e=>{let t=e.target.files?.[0];if(t){j(!0),v({type:"",message:""});try{let e=await t.text(),s=JSON.parse(e),a=await fetch("/api/settings/database",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),r=await a.json().catch(()=>({}));if(!a.ok)throw Error(r.error||"Failed to import database");await _(),v({type:"success",message:"Database imported successfully"})}catch(e){v({type:"error",message:e.message||"Invalid backup file"})}finally{w.current&&(w.current.value=""),j(!1)}}},Z=!0===d.observabilityEnabled;return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"size-12 rounded-lg bg-green-500/10 text-green-500 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-2xl",children:"computer"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"Local Mode"}),(0,a.jsx)("p",{className:"text-text-muted",children:"Running on your machine"})]})]}),(0,a.jsx)("div",{className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{type:"button",onClick:()=>t(s),className:(0,l.cn)("flex items-center gap-1.5 px-3 py-1.5 rounded-md font-medium transition-all",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{className:"capitalize text-sm",children:s})]},s))})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-4 border-t border-border",children:[(0,a.jsx)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-bg border border-border",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Database Location"}),(0,a.jsx)("p",{className:"text-sm text-text-muted font-mono",children:"~/.9router/db.json"})]})}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(o.$n,{variant:"secondary",icon:"download",onClick:H,loading:f,children:"Download Backup"}),(0,a.jsx)(o.$n,{variant:"outline",icon:"upload",onClick:()=>w.current?.click(),disabled:f,children:"Import Backup"}),(0,a.jsx)("input",{ref:w,type:"file",accept:"application/json,.json",className:"hidden",onChange:M})]}),N.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===N.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:N.message})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"shield"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Security"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require login"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,a.jsx)(o.lM,{checked:!0===d.requireLogin,onChange:()=>J(!d.requireLogin),disabled:x})]}),!0===d.requireLogin&&(0,a.jsxs)("form",{onSubmit:A,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[d.hasPassword&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Current Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Enter current password",value:p.current,onChange:e=>u({...p,current:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"New Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Enter new password",value:p.new,onChange:e=>u({...p,new:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Confirm New Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Confirm new password",value:p.confirm,onChange:e=>u({...p,confirm:e.target.value}),required:!0})]})]}),h.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===h.type?"text-red-500":"text-green-500"}`,children:h.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(o.$n,{type:"submit",variant:"primary",loading:y,children:d.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"route"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Cycle through accounts to distribute load"})]}),(0,a.jsx)(o.lM,{checked:"round-robin"===d.fallbackStrategy,onChange:()=>q("round-robin"===d.fallbackStrategy?"fill-first":"round-robin"),disabled:x})]}),"round-robin"===d.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Sticky Limit"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Calls per account before switching"})]}),(0,a.jsx)(o.pd,{type:"number",min:"1",max:"10",value:d.stickyRoundRobinLimit||3,onChange:e=>$(e.target.value),disabled:x,className:"w-20 text-center"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:"round-robin"===d.fallbackStrategy?`Currently distributing requests across all available accounts with ${d.stickyRoundRobinLimit||3} calls per account.`:"Currently using accounts in priority order (Fill First)."})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"wifi"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Network"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Outbound Proxy"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Enable proxy for OAuth + provider outbound requests."})]}),(0,a.jsx)(o.lM,{checked:!0===d.outboundProxyEnabled,onChange:()=>U(!0!==d.outboundProxyEnabled),disabled:x||E})]}),!0===d.outboundProxyEnabled&&(0,a.jsxs)("form",{onSubmit:T,className:"flex flex-col gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium",children:"Proxy URL"}),(0,a.jsx)(o.pd,{placeholder:"http://127.0.0.1:7897",value:P.outboundProxyUrl,onChange:e=>k(t=>({...t,outboundProxyUrl:e.target.value})),disabled:x||E}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Leave empty to inherit existing env proxy (if any)."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)("label",{className:"font-medium",children:"No Proxy"}),(0,a.jsx)(o.pd,{placeholder:"localhost,127.0.0.1",value:P.outboundNoProxy,onChange:e=>k(t=>({...t,outboundNoProxy:e.target.value})),disabled:x||E}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Comma-separated hostnames/domains to bypass the proxy."})]}),(0,a.jsxs)("div",{className:"pt-2 border-t border-border/50 flex items-center gap-2",children:[(0,a.jsx)(o.$n,{type:"button",variant:"secondary",loading:R,disabled:x||E,onClick:F,children:"Test proxy URL"}),(0,a.jsx)(o.$n,{type:"submit",variant:"primary",loading:E,children:"Apply"})]})]}),C.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===C.type?"text-red-500":"text-green-500"} pt-2 border-t border-border/50`,children:C.message})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"monitoring"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Observability"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Enable Observability"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Record request details for inspection in the logs view"})]}),(0,a.jsx)(o.lM,{checked:Z,onChange:D,disabled:x})]})]}),(0,a.jsxs)("div",{className:"text-center text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[i.vQ.name," v",i.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode - All data stored on your machine"})]})]})})}},76722:(e,t,s)=>{Promise.resolve().then(s.bind(s,64561))}},e=>{e.O(0,[2574,3862,5772,123,2652,5497,8441,3794,7358],()=>e(e.s=76722)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3471],{64561:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var a=s(95155),r=s(12115),o=s(35497),n=s(1620),l=s(31474),i=s(90620);function d(){let{theme:e,setTheme:t,isDark:s}=(0,n.D)(),[d,c]=(0,r.useState)({fallbackStrategy:"fill-first"}),[x,m]=(0,r.useState)(!0),[p,u]=(0,r.useState)({current:"",new:"",confirm:""}),[h,b]=(0,r.useState)({type:"",message:""}),[y,g]=(0,r.useState)(!1),[f,j]=(0,r.useState)(!1),[N,v]=(0,r.useState)({type:"",message:""}),w=(0,r.useRef)(null),[P,k]=(0,r.useState)({outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:""}),[C,S]=(0,r.useState)({type:"",message:""}),[E,O]=(0,r.useState)(!1),[R,L]=(0,r.useState)(!1);(0,r.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{c(e),k({outboundProxyEnabled:e?.outboundProxyEnabled===!0,outboundProxyUrl:e?.outboundProxyUrl||"",outboundNoProxy:e?.outboundNoProxy||""}),m(!1)}).catch(e=>{console.error("Failed to fetch settings:",e),m(!1)})},[]);let T=async e=>{if(e.preventDefault(),!0===d.outboundProxyEnabled){O(!0),S({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyUrl:P.outboundProxyUrl,outboundNoProxy:P.outboundNoProxy})}),t=await e.json();e.ok?(c(e=>({...e,...t})),S({type:"success",message:"Proxy settings applied"})):S({type:"error",message:t.error||"Failed to update proxy settings"})}catch(e){S({type:"error",message:"An error occurred"})}finally{O(!1)}}},F=async()=>{if(!0!==d.outboundProxyEnabled)return;let e=(P.outboundProxyUrl||"").trim();if(!e)return void S({type:"error",message:"Please enter a Proxy URL to test"});L(!0),S({type:"",message:""});try{let t=await fetch("/api/settings/proxy-test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyUrl:e})}),s=await t.json();t.ok&&s?.ok?S({type:"success",message:`Proxy test OK (${s.status}) in ${s.elapsedMs}ms`}):S({type:"error",message:s?.error||"Proxy test failed"})}catch(e){S({type:"error",message:"An error occurred"})}finally{L(!1)}},U=async e=>{O(!0),S({type:"",message:""});try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyEnabled:e})}),s=await t.json();t.ok?(c(e=>({...e,...s})),k(e=>({...e,outboundProxyEnabled:s?.outboundProxyEnabled===!0})),S({type:"success",message:e?"Proxy enabled":"Proxy disabled"})):S({type:"error",message:s.error||"Failed to update proxy settings"})}catch(e){S({type:"error",message:"An error occurred"})}finally{O(!1)}},A=async e=>{if(e.preventDefault(),p.new!==p.confirm)return void b({type:"error",message:"Passwords do not match"});g(!0),b({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:p.current,newPassword:p.new})}),t=await e.json();e.ok?(b({type:"success",message:"Password updated successfully"}),u({current:"",new:"",confirm:""})):b({type:"error",message:t.error||"Failed to update password"})}catch(e){b({type:"error",message:"An error occurred"})}finally{g(!1)}},q=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fallbackStrategy:e})})).ok&&c(t=>({...t,fallbackStrategy:e}))}catch(e){console.error("Failed to update settings:",e)}},$=async e=>{let t=parseInt(e);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stickyRoundRobinLimit:t})})).ok&&c(e=>({...e,stickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update sticky limit:",e)}},J=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&c(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},D=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({observabilityEnabled:e})})).ok&&c(t=>({...t,observabilityEnabled:e}))}catch(e){console.error("Failed to update observabilityEnabled:",e)}},_=async()=>{try{let e=await fetch("/api/settings");if(!e.ok)return;let t=await e.json();c(t)}catch(e){console.error("Failed to reload settings:",e)}},H=async()=>{j(!0),v({type:"",message:""});try{let e=await fetch("/api/settings/database");if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||"Failed to export database")}let t=await e.json(),s=JSON.stringify(t,null,2),a=new Blob([s],{type:"application/json"}),r=URL.createObjectURL(a),o=document.createElement("a"),n=new Date().toISOString().replace(/[.:]/g,"-");o.href=r,o.download=`9router-backup-${n}.json`,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r),v({type:"success",message:"Database backup downloaded"})}catch(e){v({type:"error",message:e.message||"Failed to export database"})}finally{j(!1)}},M=async e=>{let t=e.target.files?.[0];if(t){j(!0),v({type:"",message:""});try{let e=await t.text(),s=JSON.parse(e),a=await fetch("/api/settings/database",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),r=await a.json().catch(()=>({}));if(!a.ok)throw Error(r.error||"Failed to import database");await _(),v({type:"success",message:"Database imported successfully"})}catch(e){v({type:"error",message:e.message||"Invalid backup file"})}finally{w.current&&(w.current.value=""),j(!1)}}},Z=!0===d.observabilityEnabled;return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"size-12 rounded-lg bg-green-500/10 text-green-500 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-2xl",children:"computer"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"Local Mode"}),(0,a.jsx)("p",{className:"text-text-muted",children:"Running on your machine"})]})]}),(0,a.jsx)("div",{className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{type:"button",onClick:()=>t(s),className:(0,l.cn)("flex items-center gap-1.5 px-3 py-1.5 rounded-md font-medium transition-all",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{className:"capitalize text-sm",children:s})]},s))})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-4 border-t border-border",children:[(0,a.jsx)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-bg border border-border",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Database Location"}),(0,a.jsx)("p",{className:"text-sm text-text-muted font-mono",children:"~/.9router/db.json"})]})}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(o.$n,{variant:"secondary",icon:"download",onClick:H,loading:f,children:"Download Backup"}),(0,a.jsx)(o.$n,{variant:"outline",icon:"upload",onClick:()=>w.current?.click(),disabled:f,children:"Import Backup"}),(0,a.jsx)("input",{ref:w,type:"file",accept:"application/json,.json",className:"hidden",onChange:M})]}),N.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===N.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:N.message})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"shield"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Security"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require login"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,a.jsx)(o.lM,{checked:!0===d.requireLogin,onChange:()=>J(!d.requireLogin),disabled:x})]}),!0===d.requireLogin&&(0,a.jsxs)("form",{onSubmit:A,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[d.hasPassword&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Current Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Enter current password",value:p.current,onChange:e=>u({...p,current:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"New Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Enter new password",value:p.new,onChange:e=>u({...p,new:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Confirm New Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Confirm new password",value:p.confirm,onChange:e=>u({...p,confirm:e.target.value}),required:!0})]})]}),h.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===h.type?"text-red-500":"text-green-500"}`,children:h.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(o.$n,{type:"submit",variant:"primary",loading:y,children:d.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"route"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Cycle through accounts to distribute load"})]}),(0,a.jsx)(o.lM,{checked:"round-robin"===d.fallbackStrategy,onChange:()=>q("round-robin"===d.fallbackStrategy?"fill-first":"round-robin"),disabled:x})]}),"round-robin"===d.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Sticky Limit"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Calls per account before switching"})]}),(0,a.jsx)(o.pd,{type:"number",min:"1",max:"10",value:d.stickyRoundRobinLimit||3,onChange:e=>$(e.target.value),disabled:x,className:"w-20 text-center"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:"round-robin"===d.fallbackStrategy?`Currently distributing requests across all available accounts with ${d.stickyRoundRobinLimit||3} calls per account.`:"Currently using accounts in priority order (Fill First)."})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"wifi"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Network"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Outbound Proxy"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Enable proxy for OAuth + provider outbound requests."})]}),(0,a.jsx)(o.lM,{checked:!0===d.outboundProxyEnabled,onChange:()=>U(!0!==d.outboundProxyEnabled),disabled:x||E})]}),!0===d.outboundProxyEnabled&&(0,a.jsxs)("form",{onSubmit:T,className:"flex flex-col gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium",children:"Proxy URL"}),(0,a.jsx)(o.pd,{placeholder:"http://127.0.0.1:7897",value:P.outboundProxyUrl,onChange:e=>k(t=>({...t,outboundProxyUrl:e.target.value})),disabled:x||E}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Leave empty to inherit existing env proxy (if any)."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)("label",{className:"font-medium",children:"No Proxy"}),(0,a.jsx)(o.pd,{placeholder:"localhost,127.0.0.1",value:P.outboundNoProxy,onChange:e=>k(t=>({...t,outboundNoProxy:e.target.value})),disabled:x||E}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Comma-separated hostnames/domains to bypass the proxy."})]}),(0,a.jsxs)("div",{className:"pt-2 border-t border-border/50 flex items-center gap-2",children:[(0,a.jsx)(o.$n,{type:"button",variant:"secondary",loading:R,disabled:x||E,onClick:F,children:"Test proxy URL"}),(0,a.jsx)(o.$n,{type:"submit",variant:"primary",loading:E,children:"Apply"})]})]}),C.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===C.type?"text-red-500":"text-green-500"} pt-2 border-t border-border/50`,children:C.message})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"monitoring"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Observability"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Enable Observability"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Record request details for inspection in the logs view"})]}),(0,a.jsx)(o.lM,{checked:Z,onChange:D,disabled:x})]})]}),(0,a.jsxs)("div",{className:"text-center text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[i.vQ.name," v",i.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode - All data stored on your machine"})]})]})})}},76722:(e,t,s)=>{Promise.resolve().then(s.bind(s,64561))}},e=>{e.O(0,[2574,3862,5772,6902,2652,5497,8441,3794,7358],()=>e(e.s=76722)),_N_E=e.O()}]);