@yina-npm/openrouterx 0.4.35 → 0.4.38

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 (815) hide show
  1. package/README.md +77 -0
  2. package/app/.next/BUILD_ID +1 -1
  3. package/app/.next/app-path-routes-manifest.json +4 -2
  4. package/app/.next/build-manifest.json +4 -4
  5. package/app/.next/prerender-manifest.json +3 -3
  6. package/app/.next/required-server-files.json +4 -4
  7. package/app/.next/routes-manifest.json +12 -0
  8. package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page.js +2 -2
  9. package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page.js.nft.json +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/admin/users/page.js +2 -2
  12. package/app/.next/server/app/(dashboard)/dashboard/admin/users/page.js.nft.json +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/admin/users/page_client-reference-manifest.js +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  15. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  18. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  21. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  24. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  27. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/focus-ui/page.js +2 -2
  30. package/app/.next/server/app/(dashboard)/dashboard/focus-ui/page.js.nft.json +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/focus-ui/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +3 -3
  33. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  35. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  36. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  39. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  41. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  42. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  43. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  44. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  45. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  46. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  47. package/app/.next/server/app/(dashboard)/dashboard/network-analysis/page.js +2 -2
  48. package/app/.next/server/app/(dashboard)/dashboard/network-analysis/page.js.nft.json +1 -1
  49. package/app/.next/server/app/(dashboard)/dashboard/network-analysis/page_client-reference-manifest.js +1 -1
  50. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  51. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  52. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  53. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  54. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  55. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  57. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  58. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  59. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  60. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  61. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  62. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  63. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  64. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  65. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  66. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  67. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  68. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  69. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  70. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  71. package/app/.next/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  72. package/app/.next/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  73. package/app/.next/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  74. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  75. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  76. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  77. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  78. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  79. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  80. package/app/.next/server/app/(dashboard)/dashboard/user/page.js +3 -3
  81. package/app/.next/server/app/(dashboard)/dashboard/user/page.js.nft.json +1 -1
  82. package/app/.next/server/app/(dashboard)/dashboard/user/page_client-reference-manifest.js +1 -1
  83. package/app/.next/server/app/_global-error/page.js +3 -3
  84. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  85. package/app/.next/server/app/_global-error.html +1 -1
  86. package/app/.next/server/app/_global-error.rsc +1 -1
  87. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  88. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  89. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  90. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  91. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  92. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  93. package/app/.next/server/app/_not-found/page.js +2 -2
  94. package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
  95. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  96. package/app/.next/server/app/_not-found.html +1 -1
  97. package/app/.next/server/app/_not-found.rsc +5 -6
  98. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +5 -6
  99. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  100. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +5 -5
  101. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  102. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  103. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +3 -4
  104. package/app/.next/server/app/api/auth/login/route.js +1 -1
  105. package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  106. package/app/.next/server/app/api/auth/logout/route.js +1 -1
  107. package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  108. package/app/.next/server/app/api/auth/me/route.js +1 -1
  109. package/app/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
  110. package/app/.next/server/app/api/auth/oidc/callback/route.js +1 -1
  111. package/app/.next/server/app/api/auth/oidc/callback/route_client-reference-manifest.js +1 -1
  112. package/app/.next/server/app/api/auth/oidc/start/route.js +1 -1
  113. package/app/.next/server/app/api/auth/oidc/start/route_client-reference-manifest.js +1 -1
  114. package/app/.next/server/app/api/auth/oidc/test/route.js +1 -1
  115. package/app/.next/server/app/api/auth/oidc/test/route_client-reference-manifest.js +1 -1
  116. package/app/.next/server/app/api/auth/status/route.js +1 -1
  117. package/app/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  118. package/app/.next/server/app/api/cli-tools/all-statuses/route.js +2 -2
  119. package/app/.next/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  120. package/app/.next/server/app/api/cli-tools/all-statuses/route_client-reference-manifest.js +1 -1
  121. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  122. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  123. package/app/.next/server/app/api/cli-tools/antigravity-mitm/inject-auth/route.js +1 -1
  124. package/app/.next/server/app/api/cli-tools/antigravity-mitm/inject-auth/route_client-reference-manifest.js +1 -1
  125. package/app/.next/server/app/api/cli-tools/antigravity-mitm/restart/route.js +1 -1
  126. package/app/.next/server/app/api/cli-tools/antigravity-mitm/restart/route_client-reference-manifest.js +1 -1
  127. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  128. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  129. package/app/.next/server/app/api/cli-tools/antigravity-mitm/test/route.js +1 -1
  130. package/app/.next/server/app/api/cli-tools/antigravity-mitm/test/route_client-reference-manifest.js +1 -1
  131. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
  132. package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  133. package/app/.next/server/app/api/cli-tools/cline-settings/route.js +2 -2
  134. package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
  135. package/app/.next/server/app/api/cli-tools/codex-settings/activate-account/route.js +2 -0
  136. package/app/.next/server/app/api/cli-tools/codex-settings/activate-account/route.js.nft.json +1 -0
  137. package/app/.next/server/app/api/cli-tools/codex-settings/activate-account/route_client-reference-manifest.js +1 -0
  138. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
  139. package/app/.next/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  140. package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  141. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  142. package/app/.next/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +1 -1
  143. package/app/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  144. package/app/.next/server/app/api/cli-tools/cowork-mcp-registry/route_client-reference-manifest.js +1 -1
  145. package/app/.next/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  146. package/app/.next/server/app/api/cli-tools/cowork-mcp-tools/route_client-reference-manifest.js +1 -1
  147. package/app/.next/server/app/api/cli-tools/cowork-settings/route.js +1 -2
  148. package/app/.next/server/app/api/cli-tools/cowork-settings/route_client-reference-manifest.js +1 -1
  149. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
  150. package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  151. package/app/.next/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  152. package/app/.next/server/app/api/cli-tools/hermes-settings/route_client-reference-manifest.js +1 -1
  153. package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  154. package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
  155. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  156. package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  157. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  158. package/app/.next/server/app/api/cli-tools/opencode-settings/route_client-reference-manifest.js +1 -1
  159. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  160. package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
  161. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  162. package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
  163. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  164. package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
  165. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  166. package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
  167. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  168. package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  169. package/app/.next/server/app/api/combos/route.js +1 -1
  170. package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
  171. package/app/.next/server/app/api/health/route.js +1 -1
  172. package/app/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  173. package/app/.next/server/app/api/init/route.js +1 -1
  174. package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  175. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  176. package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  177. package/app/.next/server/app/api/keys/route.js +1 -1
  178. package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
  179. package/app/.next/server/app/api/locale/route.js +1 -1
  180. package/app/.next/server/app/api/locale/route_client-reference-manifest.js +1 -1
  181. package/app/.next/server/app/api/mcp/[plugin]/message/route.js +1 -1
  182. package/app/.next/server/app/api/mcp/[plugin]/message/route_client-reference-manifest.js +1 -1
  183. package/app/.next/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  184. package/app/.next/server/app/api/mcp/[plugin]/sse/route_client-reference-manifest.js +1 -1
  185. package/app/.next/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  186. package/app/.next/server/app/api/media-providers/tts/deepgram/voices/route_client-reference-manifest.js +1 -1
  187. package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  188. package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route_client-reference-manifest.js +1 -1
  189. package/app/.next/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  190. package/app/.next/server/app/api/media-providers/tts/inworld/voices/route_client-reference-manifest.js +1 -1
  191. package/app/.next/server/app/api/media-providers/tts/voices/route.js +1 -1
  192. package/app/.next/server/app/api/media-providers/tts/voices/route_client-reference-manifest.js +1 -1
  193. package/app/.next/server/app/api/models/alias/route.js +1 -1
  194. package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  195. package/app/.next/server/app/api/models/availability/route.js +1 -1
  196. package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
  197. package/app/.next/server/app/api/models/custom/route.js +1 -1
  198. package/app/.next/server/app/api/models/custom/route_client-reference-manifest.js +1 -1
  199. package/app/.next/server/app/api/models/disabled/route.js +1 -1
  200. package/app/.next/server/app/api/models/disabled/route_client-reference-manifest.js +1 -1
  201. package/app/.next/server/app/api/models/route.js +1 -1
  202. package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  203. package/app/.next/server/app/api/models/test/route.js +1 -1
  204. package/app/.next/server/app/api/models/test/route_client-reference-manifest.js +1 -1
  205. package/app/.next/server/app/api/network-analysis/route.js +2 -2
  206. package/app/.next/server/app/api/network-analysis/route_client-reference-manifest.js +1 -1
  207. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
  208. package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  209. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  210. package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  211. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  212. package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  213. package/app/.next/server/app/api/oauth/gitlab/pat/route.js +1 -1
  214. package/app/.next/server/app/api/oauth/gitlab/pat/route_client-reference-manifest.js +1 -1
  215. package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
  216. package/app/.next/server/app/api/oauth/iflow/cookie/route_client-reference-manifest.js +1 -1
  217. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  218. package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  219. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  220. package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  221. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  222. package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  223. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  224. package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  225. package/app/.next/server/app/api/pricing/route.js +1 -1
  226. package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  227. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  228. package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  229. package/app/.next/server/app/api/provider-nodes/route.js +1 -1
  230. package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  231. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  232. package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  233. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  234. package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  235. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  236. package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  237. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  238. package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  239. package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
  240. package/app/.next/server/app/api/providers/[id]/test-models/route_client-reference-manifest.js +1 -1
  241. package/app/.next/server/app/api/providers/client/route.js +1 -1
  242. package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  243. package/app/.next/server/app/api/providers/kilo/free-models/route.js +1 -1
  244. package/app/.next/server/app/api/providers/kilo/free-models/route_client-reference-manifest.js +1 -1
  245. package/app/.next/server/app/api/providers/route.js +1 -1
  246. package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
  247. package/app/.next/server/app/api/providers/suggested-models/route.js +1 -1
  248. package/app/.next/server/app/api/providers/suggested-models/route_client-reference-manifest.js +1 -1
  249. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  250. package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  251. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  252. package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  253. package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
  254. package/app/.next/server/app/api/proxy-pools/[id]/route_client-reference-manifest.js +1 -1
  255. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  256. package/app/.next/server/app/api/proxy-pools/[id]/test/route_client-reference-manifest.js +1 -1
  257. package/app/.next/server/app/api/proxy-pools/route.js +1 -1
  258. package/app/.next/server/app/api/proxy-pools/route_client-reference-manifest.js +1 -1
  259. package/app/.next/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  260. package/app/.next/server/app/api/proxy-pools/vercel-deploy/route_client-reference-manifest.js +1 -1
  261. package/app/.next/server/app/api/settings/database/route.js +1 -1
  262. package/app/.next/server/app/api/settings/database/route_client-reference-manifest.js +1 -1
  263. package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
  264. package/app/.next/server/app/api/settings/proxy-test/route_client-reference-manifest.js +1 -1
  265. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  266. package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
  267. package/app/.next/server/app/api/settings/route.js +1 -1
  268. package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  269. package/app/.next/server/app/api/shutdown/route.js +1 -1
  270. package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  271. package/app/.next/server/app/api/startup-notices/route.js +2 -0
  272. package/app/.next/server/app/api/startup-notices/route.js.nft.json +1 -0
  273. package/app/.next/server/app/api/startup-notices/route_client-reference-manifest.js +1 -0
  274. package/app/.next/server/app/api/tags/route.js +1 -1
  275. package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  276. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  277. package/app/.next/server/app/api/translator/console-logs/route_client-reference-manifest.js +1 -1
  278. package/app/.next/server/app/api/translator/console-logs/stream/route.js +2 -2
  279. package/app/.next/server/app/api/translator/console-logs/stream/route_client-reference-manifest.js +1 -1
  280. package/app/.next/server/app/api/translator/load/route.js +1 -1
  281. package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  282. package/app/.next/server/app/api/translator/save/route.js +1 -1
  283. package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  284. package/app/.next/server/app/api/translator/send/route.js +1 -1
  285. package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  286. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  287. package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  288. package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
  289. package/app/.next/server/app/api/tunnel/disable/route_client-reference-manifest.js +1 -1
  290. package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
  291. package/app/.next/server/app/api/tunnel/enable/route_client-reference-manifest.js +1 -1
  292. package/app/.next/server/app/api/tunnel/status/route.js +1 -1
  293. package/app/.next/server/app/api/tunnel/status/route_client-reference-manifest.js +1 -1
  294. package/app/.next/server/app/api/tunnel/tailscale-check/route.js +1 -1
  295. package/app/.next/server/app/api/tunnel/tailscale-check/route_client-reference-manifest.js +1 -1
  296. package/app/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  297. package/app/.next/server/app/api/tunnel/tailscale-disable/route_client-reference-manifest.js +1 -1
  298. package/app/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  299. package/app/.next/server/app/api/tunnel/tailscale-enable/route_client-reference-manifest.js +1 -1
  300. package/app/.next/server/app/api/tunnel/tailscale-install/route.js +2 -2
  301. package/app/.next/server/app/api/tunnel/tailscale-install/route_client-reference-manifest.js +1 -1
  302. package/app/.next/server/app/api/tunnel/tailscale-login/route.js +1 -1
  303. package/app/.next/server/app/api/tunnel/tailscale-login/route_client-reference-manifest.js +1 -1
  304. package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route.js +2 -2
  305. package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route_client-reference-manifest.js +1 -1
  306. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  307. package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  308. package/app/.next/server/app/api/usage/api-keys/route.js +1 -1
  309. package/app/.next/server/app/api/usage/api-keys/route_client-reference-manifest.js +1 -1
  310. package/app/.next/server/app/api/usage/chart/route.js +1 -1
  311. package/app/.next/server/app/api/usage/chart/route_client-reference-manifest.js +1 -1
  312. package/app/.next/server/app/api/usage/history/route.js +1 -1
  313. package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  314. package/app/.next/server/app/api/usage/logs/route.js +1 -1
  315. package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
  316. package/app/.next/server/app/api/usage/providers/route.js +1 -1
  317. package/app/.next/server/app/api/usage/providers/route_client-reference-manifest.js +1 -1
  318. package/app/.next/server/app/api/usage/request-details/route.js +1 -1
  319. package/app/.next/server/app/api/usage/request-details/route_client-reference-manifest.js +1 -1
  320. package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
  321. package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  322. package/app/.next/server/app/api/usage/stats/route.js +1 -1
  323. package/app/.next/server/app/api/usage/stats/route_client-reference-manifest.js +1 -1
  324. package/app/.next/server/app/api/usage/stream/route.js +2 -2
  325. package/app/.next/server/app/api/usage/stream/route_client-reference-manifest.js +1 -1
  326. package/app/.next/server/app/api/users/[id]/route.js +1 -1
  327. package/app/.next/server/app/api/users/[id]/route_client-reference-manifest.js +1 -1
  328. package/app/.next/server/app/api/users/route.js +1 -1
  329. package/app/.next/server/app/api/users/route_client-reference-manifest.js +1 -1
  330. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  331. package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  332. package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
  333. package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
  334. package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
  335. package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
  336. package/app/.next/server/app/api/v1/audio/voices/route.js +1 -1
  337. package/app/.next/server/app/api/v1/audio/voices/route_client-reference-manifest.js +1 -1
  338. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  339. package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
  340. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  341. package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
  342. package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
  343. package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
  344. package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
  345. package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
  346. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  347. package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
  348. package/app/.next/server/app/api/v1/models/[kind]/route.js +1 -1
  349. package/app/.next/server/app/api/v1/models/[kind]/route_client-reference-manifest.js +1 -1
  350. package/app/.next/server/app/api/v1/models/info/route.js +1 -1
  351. package/app/.next/server/app/api/v1/models/info/route_client-reference-manifest.js +1 -1
  352. package/app/.next/server/app/api/v1/models/route.js +1 -1
  353. package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  354. package/app/.next/server/app/api/v1/responses/compact/route.js +1 -1
  355. package/app/.next/server/app/api/v1/responses/compact/route_client-reference-manifest.js +1 -1
  356. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  357. package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  358. package/app/.next/server/app/api/v1/route.js +1 -1
  359. package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
  360. package/app/.next/server/app/api/v1/search/route.js +1 -1
  361. package/app/.next/server/app/api/v1/search/route_client-reference-manifest.js +1 -1
  362. package/app/.next/server/app/api/v1/web/fetch/route.js +1 -1
  363. package/app/.next/server/app/api/v1/web/fetch/route_client-reference-manifest.js +1 -1
  364. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  365. package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  366. package/app/.next/server/app/api/v1beta/models/route.js +1 -1
  367. package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  368. package/app/.next/server/app/api/version/route.js +1 -1
  369. package/app/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
  370. package/app/.next/server/app/api/version/shutdown/route.js +1 -1
  371. package/app/.next/server/app/api/version/shutdown/route_client-reference-manifest.js +1 -1
  372. package/app/.next/server/app/api/version/update/route.js +1 -1
  373. package/app/.next/server/app/api/version/update/route_client-reference-manifest.js +1 -1
  374. package/app/.next/server/app/callback/page.js +2 -2
  375. package/app/.next/server/app/callback/page.js.nft.json +1 -1
  376. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  377. package/app/.next/server/app/callback.html +1 -1
  378. package/app/.next/server/app/callback.rsc +6 -7
  379. package/app/.next/server/app/callback.segments/_full.segment.rsc +6 -7
  380. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  381. package/app/.next/server/app/callback.segments/_index.segment.rsc +5 -5
  382. package/app/.next/server/app/callback.segments/_tree.segment.rsc +3 -4
  383. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
  384. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  385. package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
  386. package/app/.next/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  387. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  388. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  389. package/app/.next/server/app/dashboard/settings/pricing.rsc +6 -7
  390. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -7
  391. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  392. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
  393. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +3 -4
  394. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  395. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  396. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  397. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  398. package/app/.next/server/app/favicon.ico/route.js +1 -1
  399. package/app/.next/server/app/index.html +1 -1
  400. package/app/.next/server/app/index.rsc +5 -6
  401. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  402. package/app/.next/server/app/index.segments/_full.segment.rsc +5 -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 +5 -5
  405. package/app/.next/server/app/index.segments/_tree.segment.rsc +3 -4
  406. package/app/.next/server/app/landing/page.js +2 -2
  407. package/app/.next/server/app/landing/page.js.nft.json +1 -1
  408. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  409. package/app/.next/server/app/landing.html +1 -1
  410. package/app/.next/server/app/landing.rsc +6 -7
  411. package/app/.next/server/app/landing.segments/_full.segment.rsc +6 -7
  412. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  413. package/app/.next/server/app/landing.segments/_index.segment.rsc +5 -5
  414. package/app/.next/server/app/landing.segments/_tree.segment.rsc +3 -4
  415. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  416. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  417. package/app/.next/server/app/login/page.js +2 -2
  418. package/app/.next/server/app/login/page.js.nft.json +1 -1
  419. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  420. package/app/.next/server/app/login.html +1 -1
  421. package/app/.next/server/app/login.rsc +6 -7
  422. package/app/.next/server/app/login.segments/_full.segment.rsc +6 -7
  423. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  424. package/app/.next/server/app/login.segments/_index.segment.rsc +5 -5
  425. package/app/.next/server/app/login.segments/_tree.segment.rsc +3 -4
  426. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  427. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  428. package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
  429. package/app/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  430. package/app/.next/server/app/page.js +2 -2
  431. package/app/.next/server/app/page.js.nft.json +1 -1
  432. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  433. package/app/.next/server/app-paths-manifest.json +4 -2
  434. package/app/.next/server/chunks/1350.js +2 -1
  435. package/app/.next/server/chunks/2560.js +1 -1
  436. package/app/.next/server/chunks/{9528.js → 2750.js} +2 -3
  437. package/app/.next/server/chunks/3110.js +1 -1
  438. package/app/.next/server/chunks/319.js +3 -3
  439. package/app/.next/server/chunks/3493.js +2 -1
  440. package/app/.next/server/chunks/412.js +1 -1
  441. package/app/.next/server/chunks/4126.js +1 -1
  442. package/app/.next/server/chunks/{9546.js → 4394.js} +1 -1
  443. package/app/.next/server/chunks/4922.js +1 -1
  444. package/app/.next/server/chunks/6393.js +1 -1
  445. package/app/.next/server/chunks/7595.js +1 -1
  446. package/app/.next/server/chunks/7774.js +2 -2
  447. package/app/.next/server/chunks/8520.js +1 -1
  448. package/app/.next/server/chunks/8866.js +1 -0
  449. package/app/.next/server/chunks/{8407.js → 9300.js} +2 -2
  450. package/app/.next/server/chunks/9856.js +1 -0
  451. package/app/.next/server/middleware-build-manifest.js +1 -1
  452. package/app/.next/server/middleware.js +2 -2
  453. package/app/.next/server/next-font-manifest.js +1 -1
  454. package/app/.next/server/next-font-manifest.json +1 -1
  455. package/app/.next/server/pages/404.html +1 -1
  456. package/app/.next/server/pages/500.html +1 -1
  457. package/app/.next/server/server-reference-manifest.js +1 -1
  458. package/app/.next/server/server-reference-manifest.json +1 -1
  459. package/app/.next/static/9qtW6KlzV_D2b828CZp1A/_buildManifest.js +1 -0
  460. package/app/.next/static/chunks/{1321-b764e2be7fc92cc1.js → 1321-634f2d25db77d618.js} +1 -1
  461. package/app/.next/static/chunks/{5769-77fa1ce7edb6f970.js → 4072-91de6609dc7e6753.js} +1 -1
  462. package/app/.next/static/chunks/5095-42d435b0583b2f98.js +2 -0
  463. package/app/.next/static/chunks/5497-4a0f0c365aea0ea7.js +7 -0
  464. package/app/.next/static/chunks/app/(dashboard)/dashboard/admin/keys/page-0d5b57da4abb6962.js +1 -0
  465. package/app/.next/static/chunks/app/(dashboard)/dashboard/admin/users/{page-2aa2cafdedb17bad.js → page-972703d59d2a3986.js} +1 -1
  466. package/app/.next/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-277c4575cca57177.js → page-e1bd21507327d2bc.js} +1 -1
  467. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-1a36c238dc35c08e.js → page-211e322f002d5464.js} +1 -1
  468. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-69469b6440aff8d0.js +1 -0
  469. package/app/.next/static/chunks/app/(dashboard)/dashboard/console-log/{page-d98ac191ef4ff7e6.js → page-55598932923e41ce.js} +1 -1
  470. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-c8f75b084231c080.js +1 -0
  471. package/app/.next/static/chunks/app/(dashboard)/dashboard/focus-ui/{page-90a2c72d1d8122a2.js → page-fb59dea0e48968bf.js} +1 -1
  472. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-73601a7b09338418.js → page-95d31a6372622fcf.js} +2 -2
  473. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-3ab3cbba76b7cbad.js → page-c64dd1d0b2bd9caf.js} +1 -1
  474. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-c0ea5a27a13640b9.js → page-9586c0b67f30a21b.js} +2 -2
  475. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-c7fbf29bdbdabee9.js +1 -0
  476. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/page-7ae37df256035f59.js +1 -0
  477. package/app/.next/static/chunks/app/(dashboard)/dashboard/network-analysis/page-0ad4db60f9d14f60.js +1 -0
  478. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-8fceba7ec6407143.js +1 -0
  479. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-f005d7a30159ce4f.js +1 -0
  480. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-c28344f1dd08e982.js → page-31a6e1cb19ebc4d8.js} +1 -1
  481. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/{page-81f02e4a6ce21347.js → page-0bf3048423ab0128.js} +1 -1
  482. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{page-a2ab26878f90c869.js → page-9d071b63170b7f71.js} +1 -1
  483. package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-67d99d453bfd8665.js → page-7762d83be0982941.js} +2 -2
  484. package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/{page-f30757bcda3daba7.js → page-e089ffa4138753d7.js} +1 -1
  485. package/app/.next/static/chunks/app/(dashboard)/dashboard/skills/page-9202b5ce0650c3ab.js +1 -0
  486. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-1879675a73caf73c.js +1 -0
  487. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/{page-2e9ac7094c9d8bae.js → page-f77dc916ed5a6f99.js} +1 -1
  488. package/app/.next/static/chunks/app/(dashboard)/dashboard/user/page-12765c664b3c1f6d.js +4 -0
  489. package/app/.next/static/chunks/app/(dashboard)/{layout-823fc1c94bc15026.js → layout-00b66bc0e6b38a14.js} +1 -1
  490. package/app/.next/static/chunks/app/_global-error/page-1879675a73caf73c.js +1 -0
  491. package/app/.next/static/chunks/app/_not-found/page-7927650ca4037264.js +1 -0
  492. package/app/.next/static/chunks/app/api/auth/login/route-1879675a73caf73c.js +1 -0
  493. package/app/.next/static/chunks/app/api/auth/logout/route-1879675a73caf73c.js +1 -0
  494. package/app/.next/static/chunks/app/api/auth/me/route-1879675a73caf73c.js +1 -0
  495. package/app/.next/static/chunks/app/api/auth/oidc/callback/route-1879675a73caf73c.js +1 -0
  496. package/app/.next/static/chunks/app/api/auth/oidc/start/route-1879675a73caf73c.js +1 -0
  497. package/app/.next/static/chunks/app/api/auth/oidc/test/route-1879675a73caf73c.js +1 -0
  498. package/app/.next/static/chunks/app/api/auth/status/route-1879675a73caf73c.js +1 -0
  499. package/app/.next/static/chunks/app/api/cli-tools/all-statuses/route-1879675a73caf73c.js +1 -0
  500. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-1879675a73caf73c.js +1 -0
  501. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/inject-auth/route-1879675a73caf73c.js +1 -0
  502. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/restart/route-1879675a73caf73c.js +1 -0
  503. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-1879675a73caf73c.js +1 -0
  504. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/test/route-1879675a73caf73c.js +1 -0
  505. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-1879675a73caf73c.js +1 -0
  506. package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-1879675a73caf73c.js +1 -0
  507. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/activate-account/route-1879675a73caf73c.js +1 -0
  508. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-1879675a73caf73c.js +1 -0
  509. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-1879675a73caf73c.js +1 -0
  510. package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-1879675a73caf73c.js +1 -0
  511. package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-1879675a73caf73c.js +1 -0
  512. package/app/.next/static/chunks/app/api/cli-tools/cowork-settings/route-1879675a73caf73c.js +1 -0
  513. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-1879675a73caf73c.js +1 -0
  514. package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-1879675a73caf73c.js +1 -0
  515. package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-1879675a73caf73c.js +1 -0
  516. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-1879675a73caf73c.js +1 -0
  517. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-1879675a73caf73c.js +1 -0
  518. package/app/.next/static/chunks/app/api/cloud/auth/route-1879675a73caf73c.js +1 -0
  519. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-1879675a73caf73c.js +1 -0
  520. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-1879675a73caf73c.js +1 -0
  521. package/app/.next/static/chunks/app/api/cloud/models/alias/route-1879675a73caf73c.js +1 -0
  522. package/app/.next/static/chunks/app/api/combos/[id]/route-1879675a73caf73c.js +1 -0
  523. package/app/.next/static/chunks/app/api/combos/route-1879675a73caf73c.js +1 -0
  524. package/app/.next/static/chunks/app/api/health/route-1879675a73caf73c.js +1 -0
  525. package/app/.next/static/chunks/app/api/init/route-1879675a73caf73c.js +1 -0
  526. package/app/.next/static/chunks/app/api/keys/[id]/route-1879675a73caf73c.js +1 -0
  527. package/app/.next/static/chunks/app/api/keys/route-1879675a73caf73c.js +1 -0
  528. package/app/.next/static/chunks/app/api/locale/route-1879675a73caf73c.js +1 -0
  529. package/app/.next/static/chunks/app/api/mcp/[plugin]/message/route-1879675a73caf73c.js +1 -0
  530. package/app/.next/static/chunks/app/api/mcp/[plugin]/sse/route-1879675a73caf73c.js +1 -0
  531. package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-1879675a73caf73c.js +1 -0
  532. package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-1879675a73caf73c.js +1 -0
  533. package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-1879675a73caf73c.js +1 -0
  534. package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-1879675a73caf73c.js +1 -0
  535. package/app/.next/static/chunks/app/api/models/alias/route-1879675a73caf73c.js +1 -0
  536. package/app/.next/static/chunks/app/api/models/availability/route-1879675a73caf73c.js +1 -0
  537. package/app/.next/static/chunks/app/api/models/custom/route-1879675a73caf73c.js +1 -0
  538. package/app/.next/static/chunks/app/api/models/disabled/route-1879675a73caf73c.js +1 -0
  539. package/app/.next/static/chunks/app/api/models/route-1879675a73caf73c.js +1 -0
  540. package/app/.next/static/chunks/app/api/models/test/route-1879675a73caf73c.js +1 -0
  541. package/app/.next/static/chunks/app/api/network-analysis/route-1879675a73caf73c.js +1 -0
  542. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-1879675a73caf73c.js +1 -0
  543. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-1879675a73caf73c.js +1 -0
  544. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-1879675a73caf73c.js +1 -0
  545. package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-1879675a73caf73c.js +1 -0
  546. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-1879675a73caf73c.js +1 -0
  547. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-1879675a73caf73c.js +1 -0
  548. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-1879675a73caf73c.js +1 -0
  549. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-1879675a73caf73c.js +1 -0
  550. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-1879675a73caf73c.js +1 -0
  551. package/app/.next/static/chunks/app/api/pricing/route-1879675a73caf73c.js +1 -0
  552. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-1879675a73caf73c.js +1 -0
  553. package/app/.next/static/chunks/app/api/provider-nodes/route-1879675a73caf73c.js +1 -0
  554. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-1879675a73caf73c.js +1 -0
  555. package/app/.next/static/chunks/app/api/providers/[id]/models/route-1879675a73caf73c.js +1 -0
  556. package/app/.next/static/chunks/app/api/providers/[id]/route-1879675a73caf73c.js +1 -0
  557. package/app/.next/static/chunks/app/api/providers/[id]/test/route-1879675a73caf73c.js +1 -0
  558. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-1879675a73caf73c.js +1 -0
  559. package/app/.next/static/chunks/app/api/providers/client/route-1879675a73caf73c.js +1 -0
  560. package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-1879675a73caf73c.js +1 -0
  561. package/app/.next/static/chunks/app/api/providers/route-1879675a73caf73c.js +1 -0
  562. package/app/.next/static/chunks/app/api/providers/suggested-models/route-1879675a73caf73c.js +1 -0
  563. package/app/.next/static/chunks/app/api/providers/test-batch/route-1879675a73caf73c.js +1 -0
  564. package/app/.next/static/chunks/app/api/providers/validate/route-1879675a73caf73c.js +1 -0
  565. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-1879675a73caf73c.js +1 -0
  566. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-1879675a73caf73c.js +1 -0
  567. package/app/.next/static/chunks/app/api/proxy-pools/route-1879675a73caf73c.js +1 -0
  568. package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-1879675a73caf73c.js +1 -0
  569. package/app/.next/static/chunks/app/api/settings/database/route-1879675a73caf73c.js +1 -0
  570. package/app/.next/static/chunks/app/api/settings/proxy-test/route-1879675a73caf73c.js +1 -0
  571. package/app/.next/static/chunks/app/api/settings/require-login/route-1879675a73caf73c.js +1 -0
  572. package/app/.next/static/chunks/app/api/settings/route-1879675a73caf73c.js +1 -0
  573. package/app/.next/static/chunks/app/api/shutdown/route-1879675a73caf73c.js +1 -0
  574. package/app/.next/static/chunks/app/api/startup-notices/route-1879675a73caf73c.js +1 -0
  575. package/app/.next/static/chunks/app/api/tags/route-1879675a73caf73c.js +1 -0
  576. package/app/.next/static/chunks/app/api/translator/console-logs/route-1879675a73caf73c.js +1 -0
  577. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-1879675a73caf73c.js +1 -0
  578. package/app/.next/static/chunks/app/api/translator/load/route-1879675a73caf73c.js +1 -0
  579. package/app/.next/static/chunks/app/api/translator/save/route-1879675a73caf73c.js +1 -0
  580. package/app/.next/static/chunks/app/api/translator/send/route-1879675a73caf73c.js +1 -0
  581. package/app/.next/static/chunks/app/api/translator/translate/route-1879675a73caf73c.js +1 -0
  582. package/app/.next/static/chunks/app/api/tunnel/disable/route-1879675a73caf73c.js +1 -0
  583. package/app/.next/static/chunks/app/api/tunnel/enable/route-1879675a73caf73c.js +1 -0
  584. package/app/.next/static/chunks/app/api/tunnel/status/route-1879675a73caf73c.js +1 -0
  585. package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-1879675a73caf73c.js +1 -0
  586. package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-1879675a73caf73c.js +1 -0
  587. package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-1879675a73caf73c.js +1 -0
  588. package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-1879675a73caf73c.js +1 -0
  589. package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-1879675a73caf73c.js +1 -0
  590. package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-1879675a73caf73c.js +1 -0
  591. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-1879675a73caf73c.js +1 -0
  592. package/app/.next/static/chunks/app/api/usage/api-keys/route-1879675a73caf73c.js +1 -0
  593. package/app/.next/static/chunks/app/api/usage/chart/route-1879675a73caf73c.js +1 -0
  594. package/app/.next/static/chunks/app/api/usage/history/route-1879675a73caf73c.js +1 -0
  595. package/app/.next/static/chunks/app/api/usage/logs/route-1879675a73caf73c.js +1 -0
  596. package/app/.next/static/chunks/app/api/usage/providers/route-1879675a73caf73c.js +1 -0
  597. package/app/.next/static/chunks/app/api/usage/request-details/route-1879675a73caf73c.js +1 -0
  598. package/app/.next/static/chunks/app/api/usage/request-logs/route-1879675a73caf73c.js +1 -0
  599. package/app/.next/static/chunks/app/api/usage/stats/route-1879675a73caf73c.js +1 -0
  600. package/app/.next/static/chunks/app/api/usage/stream/route-1879675a73caf73c.js +1 -0
  601. package/app/.next/static/chunks/app/api/users/[id]/route-1879675a73caf73c.js +1 -0
  602. package/app/.next/static/chunks/app/api/users/route-1879675a73caf73c.js +1 -0
  603. package/app/.next/static/chunks/app/api/v1/api/chat/route-1879675a73caf73c.js +1 -0
  604. package/app/.next/static/chunks/app/api/v1/audio/speech/route-1879675a73caf73c.js +1 -0
  605. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-1879675a73caf73c.js +1 -0
  606. package/app/.next/static/chunks/app/api/v1/audio/voices/route-1879675a73caf73c.js +1 -0
  607. package/app/.next/static/chunks/app/api/v1/chat/completions/route-1879675a73caf73c.js +1 -0
  608. package/app/.next/static/chunks/app/api/v1/embeddings/route-1879675a73caf73c.js +1 -0
  609. package/app/.next/static/chunks/app/api/v1/images/generations/route-1879675a73caf73c.js +1 -0
  610. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-1879675a73caf73c.js +1 -0
  611. package/app/.next/static/chunks/app/api/v1/messages/route-1879675a73caf73c.js +1 -0
  612. package/app/.next/static/chunks/app/api/v1/models/[kind]/route-1879675a73caf73c.js +1 -0
  613. package/app/.next/static/chunks/app/api/v1/models/info/route-1879675a73caf73c.js +1 -0
  614. package/app/.next/static/chunks/app/api/v1/models/route-1879675a73caf73c.js +1 -0
  615. package/app/.next/static/chunks/app/api/v1/responses/compact/route-1879675a73caf73c.js +1 -0
  616. package/app/.next/static/chunks/app/api/v1/responses/route-1879675a73caf73c.js +1 -0
  617. package/app/.next/static/chunks/app/api/v1/route-1879675a73caf73c.js +1 -0
  618. package/app/.next/static/chunks/app/api/v1/search/route-1879675a73caf73c.js +1 -0
  619. package/app/.next/static/chunks/app/api/v1/web/fetch/route-1879675a73caf73c.js +1 -0
  620. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-1879675a73caf73c.js +1 -0
  621. package/app/.next/static/chunks/app/api/v1beta/models/route-1879675a73caf73c.js +1 -0
  622. package/app/.next/static/chunks/app/api/version/route-1879675a73caf73c.js +1 -0
  623. package/app/.next/static/chunks/app/api/version/shutdown/route-1879675a73caf73c.js +1 -0
  624. package/app/.next/static/chunks/app/api/version/update/route-1879675a73caf73c.js +1 -0
  625. package/app/.next/static/chunks/app/callback/{page-0b64ce6d90bfa697.js → page-97a750f0d51c3dbe.js} +1 -1
  626. package/app/.next/static/chunks/app/dashboard/settings/pricing/page-9d24273d41fadd28.js +1 -0
  627. package/app/.next/static/chunks/app/landing/{page-370c3195c36d6e66.js → page-bf42a9c80c1e6776.js} +1 -1
  628. package/app/.next/static/chunks/app/layout-2f20e93bb64f203d.js +1 -0
  629. package/app/.next/static/chunks/app/login/page-ef8d8c379c2ef99b.js +1 -0
  630. package/app/.next/static/chunks/app/manifest.webmanifest/route-1879675a73caf73c.js +1 -0
  631. package/app/.next/static/chunks/app/page-1879675a73caf73c.js +1 -0
  632. package/app/.next/static/chunks/main-app-d5f2701c08554961.js +1 -0
  633. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-1879675a73caf73c.js +1 -0
  634. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-1879675a73caf73c.js +1 -0
  635. package/app/.next/static/chunks/next/dist/client/components/builtin/global-error-8d51a00b6c966622.js +1 -0
  636. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-1879675a73caf73c.js +1 -0
  637. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-1879675a73caf73c.js +1 -0
  638. package/app/.next/static/chunks/{webpack-786de0e184ffd859.js → webpack-b9b0d264958323b9.js} +1 -1
  639. package/app/.next/static/css/f6642f5333f94810.css +1 -0
  640. package/app/.next/static/css/fe3b2b4e527f4e99.css +1 -0
  641. package/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
  642. package/app/package.json +1 -1
  643. package/app/server.js +1 -1
  644. package/hooks/postinstall.js +113 -22
  645. package/package.json +1 -1
  646. package/app/.next/server/chunks/1500.js +0 -1
  647. package/app/.next/server/chunks/702.js +0 -1
  648. package/app/.next/static/chunks/5095-ca2b12905f37ff4d.js +0 -1
  649. package/app/.next/static/chunks/5497-83030cc3d92a3519.js +0 -7
  650. package/app/.next/static/chunks/app/(dashboard)/dashboard/admin/keys/page-c74a5ba01f1699c5.js +0 -1
  651. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-f0bae00ac45dd4b0.js +0 -1
  652. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-d3de2fdaf4bf9b1e.js +0 -1
  653. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-dcb9c64e0d95cee2.js +0 -1
  654. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/page-63735cb68f56f3b8.js +0 -1
  655. package/app/.next/static/chunks/app/(dashboard)/dashboard/network-analysis/page-9c41fc55ad37021e.js +0 -1
  656. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-5a350e79586a5c80.js +0 -1
  657. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-4c8ad9c53c665fe6.js +0 -1
  658. package/app/.next/static/chunks/app/(dashboard)/dashboard/skills/page-6dd35c79bb83388b.js +0 -1
  659. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-1172e1764d69e954.js +0 -1
  660. package/app/.next/static/chunks/app/(dashboard)/dashboard/user/page-86f6c9456e2e37bf.js +0 -4
  661. package/app/.next/static/chunks/app/_global-error/page-1172e1764d69e954.js +0 -1
  662. package/app/.next/static/chunks/app/_not-found/page-8fcd6ba05909a2de.js +0 -1
  663. package/app/.next/static/chunks/app/api/auth/login/route-1172e1764d69e954.js +0 -1
  664. package/app/.next/static/chunks/app/api/auth/logout/route-1172e1764d69e954.js +0 -1
  665. package/app/.next/static/chunks/app/api/auth/me/route-1172e1764d69e954.js +0 -1
  666. package/app/.next/static/chunks/app/api/auth/oidc/callback/route-1172e1764d69e954.js +0 -1
  667. package/app/.next/static/chunks/app/api/auth/oidc/start/route-1172e1764d69e954.js +0 -1
  668. package/app/.next/static/chunks/app/api/auth/oidc/test/route-1172e1764d69e954.js +0 -1
  669. package/app/.next/static/chunks/app/api/auth/status/route-1172e1764d69e954.js +0 -1
  670. package/app/.next/static/chunks/app/api/cli-tools/all-statuses/route-1172e1764d69e954.js +0 -1
  671. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-1172e1764d69e954.js +0 -1
  672. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/inject-auth/route-1172e1764d69e954.js +0 -1
  673. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/restart/route-1172e1764d69e954.js +0 -1
  674. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-1172e1764d69e954.js +0 -1
  675. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/test/route-1172e1764d69e954.js +0 -1
  676. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-1172e1764d69e954.js +0 -1
  677. package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-1172e1764d69e954.js +0 -1
  678. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-1172e1764d69e954.js +0 -1
  679. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-1172e1764d69e954.js +0 -1
  680. package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-1172e1764d69e954.js +0 -1
  681. package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-1172e1764d69e954.js +0 -1
  682. package/app/.next/static/chunks/app/api/cli-tools/cowork-settings/route-1172e1764d69e954.js +0 -1
  683. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-1172e1764d69e954.js +0 -1
  684. package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-1172e1764d69e954.js +0 -1
  685. package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-1172e1764d69e954.js +0 -1
  686. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-1172e1764d69e954.js +0 -1
  687. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-1172e1764d69e954.js +0 -1
  688. package/app/.next/static/chunks/app/api/cloud/auth/route-1172e1764d69e954.js +0 -1
  689. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-1172e1764d69e954.js +0 -1
  690. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-1172e1764d69e954.js +0 -1
  691. package/app/.next/static/chunks/app/api/cloud/models/alias/route-1172e1764d69e954.js +0 -1
  692. package/app/.next/static/chunks/app/api/combos/[id]/route-1172e1764d69e954.js +0 -1
  693. package/app/.next/static/chunks/app/api/combos/route-1172e1764d69e954.js +0 -1
  694. package/app/.next/static/chunks/app/api/health/route-1172e1764d69e954.js +0 -1
  695. package/app/.next/static/chunks/app/api/init/route-1172e1764d69e954.js +0 -1
  696. package/app/.next/static/chunks/app/api/keys/[id]/route-1172e1764d69e954.js +0 -1
  697. package/app/.next/static/chunks/app/api/keys/route-1172e1764d69e954.js +0 -1
  698. package/app/.next/static/chunks/app/api/locale/route-1172e1764d69e954.js +0 -1
  699. package/app/.next/static/chunks/app/api/mcp/[plugin]/message/route-1172e1764d69e954.js +0 -1
  700. package/app/.next/static/chunks/app/api/mcp/[plugin]/sse/route-1172e1764d69e954.js +0 -1
  701. package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-1172e1764d69e954.js +0 -1
  702. package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-1172e1764d69e954.js +0 -1
  703. package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-1172e1764d69e954.js +0 -1
  704. package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-1172e1764d69e954.js +0 -1
  705. package/app/.next/static/chunks/app/api/models/alias/route-1172e1764d69e954.js +0 -1
  706. package/app/.next/static/chunks/app/api/models/availability/route-1172e1764d69e954.js +0 -1
  707. package/app/.next/static/chunks/app/api/models/custom/route-1172e1764d69e954.js +0 -1
  708. package/app/.next/static/chunks/app/api/models/disabled/route-1172e1764d69e954.js +0 -1
  709. package/app/.next/static/chunks/app/api/models/route-1172e1764d69e954.js +0 -1
  710. package/app/.next/static/chunks/app/api/models/test/route-1172e1764d69e954.js +0 -1
  711. package/app/.next/static/chunks/app/api/network-analysis/route-1172e1764d69e954.js +0 -1
  712. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-1172e1764d69e954.js +0 -1
  713. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-1172e1764d69e954.js +0 -1
  714. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-1172e1764d69e954.js +0 -1
  715. package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-1172e1764d69e954.js +0 -1
  716. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-1172e1764d69e954.js +0 -1
  717. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-1172e1764d69e954.js +0 -1
  718. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-1172e1764d69e954.js +0 -1
  719. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-1172e1764d69e954.js +0 -1
  720. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-1172e1764d69e954.js +0 -1
  721. package/app/.next/static/chunks/app/api/pricing/route-1172e1764d69e954.js +0 -1
  722. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-1172e1764d69e954.js +0 -1
  723. package/app/.next/static/chunks/app/api/provider-nodes/route-1172e1764d69e954.js +0 -1
  724. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-1172e1764d69e954.js +0 -1
  725. package/app/.next/static/chunks/app/api/providers/[id]/models/route-1172e1764d69e954.js +0 -1
  726. package/app/.next/static/chunks/app/api/providers/[id]/route-1172e1764d69e954.js +0 -1
  727. package/app/.next/static/chunks/app/api/providers/[id]/test/route-1172e1764d69e954.js +0 -1
  728. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-1172e1764d69e954.js +0 -1
  729. package/app/.next/static/chunks/app/api/providers/client/route-1172e1764d69e954.js +0 -1
  730. package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-1172e1764d69e954.js +0 -1
  731. package/app/.next/static/chunks/app/api/providers/route-1172e1764d69e954.js +0 -1
  732. package/app/.next/static/chunks/app/api/providers/suggested-models/route-1172e1764d69e954.js +0 -1
  733. package/app/.next/static/chunks/app/api/providers/test-batch/route-1172e1764d69e954.js +0 -1
  734. package/app/.next/static/chunks/app/api/providers/validate/route-1172e1764d69e954.js +0 -1
  735. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-1172e1764d69e954.js +0 -1
  736. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-1172e1764d69e954.js +0 -1
  737. package/app/.next/static/chunks/app/api/proxy-pools/route-1172e1764d69e954.js +0 -1
  738. package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-1172e1764d69e954.js +0 -1
  739. package/app/.next/static/chunks/app/api/settings/database/route-1172e1764d69e954.js +0 -1
  740. package/app/.next/static/chunks/app/api/settings/proxy-test/route-1172e1764d69e954.js +0 -1
  741. package/app/.next/static/chunks/app/api/settings/require-login/route-1172e1764d69e954.js +0 -1
  742. package/app/.next/static/chunks/app/api/settings/route-1172e1764d69e954.js +0 -1
  743. package/app/.next/static/chunks/app/api/shutdown/route-1172e1764d69e954.js +0 -1
  744. package/app/.next/static/chunks/app/api/tags/route-1172e1764d69e954.js +0 -1
  745. package/app/.next/static/chunks/app/api/translator/console-logs/route-1172e1764d69e954.js +0 -1
  746. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-1172e1764d69e954.js +0 -1
  747. package/app/.next/static/chunks/app/api/translator/load/route-1172e1764d69e954.js +0 -1
  748. package/app/.next/static/chunks/app/api/translator/save/route-1172e1764d69e954.js +0 -1
  749. package/app/.next/static/chunks/app/api/translator/send/route-1172e1764d69e954.js +0 -1
  750. package/app/.next/static/chunks/app/api/translator/translate/route-1172e1764d69e954.js +0 -1
  751. package/app/.next/static/chunks/app/api/tunnel/disable/route-1172e1764d69e954.js +0 -1
  752. package/app/.next/static/chunks/app/api/tunnel/enable/route-1172e1764d69e954.js +0 -1
  753. package/app/.next/static/chunks/app/api/tunnel/status/route-1172e1764d69e954.js +0 -1
  754. package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-1172e1764d69e954.js +0 -1
  755. package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-1172e1764d69e954.js +0 -1
  756. package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-1172e1764d69e954.js +0 -1
  757. package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-1172e1764d69e954.js +0 -1
  758. package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-1172e1764d69e954.js +0 -1
  759. package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-1172e1764d69e954.js +0 -1
  760. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-1172e1764d69e954.js +0 -1
  761. package/app/.next/static/chunks/app/api/usage/api-keys/route-1172e1764d69e954.js +0 -1
  762. package/app/.next/static/chunks/app/api/usage/chart/route-1172e1764d69e954.js +0 -1
  763. package/app/.next/static/chunks/app/api/usage/history/route-1172e1764d69e954.js +0 -1
  764. package/app/.next/static/chunks/app/api/usage/logs/route-1172e1764d69e954.js +0 -1
  765. package/app/.next/static/chunks/app/api/usage/providers/route-1172e1764d69e954.js +0 -1
  766. package/app/.next/static/chunks/app/api/usage/request-details/route-1172e1764d69e954.js +0 -1
  767. package/app/.next/static/chunks/app/api/usage/request-logs/route-1172e1764d69e954.js +0 -1
  768. package/app/.next/static/chunks/app/api/usage/stats/route-1172e1764d69e954.js +0 -1
  769. package/app/.next/static/chunks/app/api/usage/stream/route-1172e1764d69e954.js +0 -1
  770. package/app/.next/static/chunks/app/api/users/[id]/route-1172e1764d69e954.js +0 -1
  771. package/app/.next/static/chunks/app/api/users/route-1172e1764d69e954.js +0 -1
  772. package/app/.next/static/chunks/app/api/v1/api/chat/route-1172e1764d69e954.js +0 -1
  773. package/app/.next/static/chunks/app/api/v1/audio/speech/route-1172e1764d69e954.js +0 -1
  774. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-1172e1764d69e954.js +0 -1
  775. package/app/.next/static/chunks/app/api/v1/audio/voices/route-1172e1764d69e954.js +0 -1
  776. package/app/.next/static/chunks/app/api/v1/chat/completions/route-1172e1764d69e954.js +0 -1
  777. package/app/.next/static/chunks/app/api/v1/embeddings/route-1172e1764d69e954.js +0 -1
  778. package/app/.next/static/chunks/app/api/v1/images/generations/route-1172e1764d69e954.js +0 -1
  779. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-1172e1764d69e954.js +0 -1
  780. package/app/.next/static/chunks/app/api/v1/messages/route-1172e1764d69e954.js +0 -1
  781. package/app/.next/static/chunks/app/api/v1/models/[kind]/route-1172e1764d69e954.js +0 -1
  782. package/app/.next/static/chunks/app/api/v1/models/info/route-1172e1764d69e954.js +0 -1
  783. package/app/.next/static/chunks/app/api/v1/models/route-1172e1764d69e954.js +0 -1
  784. package/app/.next/static/chunks/app/api/v1/responses/compact/route-1172e1764d69e954.js +0 -1
  785. package/app/.next/static/chunks/app/api/v1/responses/route-1172e1764d69e954.js +0 -1
  786. package/app/.next/static/chunks/app/api/v1/route-1172e1764d69e954.js +0 -1
  787. package/app/.next/static/chunks/app/api/v1/search/route-1172e1764d69e954.js +0 -1
  788. package/app/.next/static/chunks/app/api/v1/web/fetch/route-1172e1764d69e954.js +0 -1
  789. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-1172e1764d69e954.js +0 -1
  790. package/app/.next/static/chunks/app/api/v1beta/models/route-1172e1764d69e954.js +0 -1
  791. package/app/.next/static/chunks/app/api/version/route-1172e1764d69e954.js +0 -1
  792. package/app/.next/static/chunks/app/api/version/shutdown/route-1172e1764d69e954.js +0 -1
  793. package/app/.next/static/chunks/app/api/version/update/route-1172e1764d69e954.js +0 -1
  794. package/app/.next/static/chunks/app/dashboard/settings/pricing/page-0b53c6deac19b9be.js +0 -1
  795. package/app/.next/static/chunks/app/layout-55318fbfdf7dfacb.js +0 -1
  796. package/app/.next/static/chunks/app/login/page-65d3f9612064353f.js +0 -1
  797. package/app/.next/static/chunks/app/manifest.webmanifest/route-1172e1764d69e954.js +0 -1
  798. package/app/.next/static/chunks/app/page-1172e1764d69e954.js +0 -1
  799. package/app/.next/static/chunks/main-app-5fb630e627076bfd.js +0 -1
  800. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-1172e1764d69e954.js +0 -1
  801. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-1172e1764d69e954.js +0 -1
  802. package/app/.next/static/chunks/next/dist/client/components/builtin/global-error-8c0dda4490abacd4.js +0 -1
  803. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-1172e1764d69e954.js +0 -1
  804. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-1172e1764d69e954.js +0 -1
  805. package/app/.next/static/css/16878fc1d2cbb11a.css +0 -1
  806. package/app/.next/static/css/2e1b7d528c228ec3.css +0 -1
  807. package/app/.next/static/foKo1xDQER7YWTSg2B-qB/_buildManifest.js +0 -1
  808. package/app/.next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
  809. package/app/.next/static/media/21350d82a1f187e9-s.woff2 +0 -0
  810. package/app/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
  811. package/app/.next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
  812. package/app/.next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
  813. package/app/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
  814. package/app/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
  815. /package/app/.next/static/{foKo1xDQER7YWTSg2B-qB → 9qtW6KlzV_D2b828CZp1A}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9089],{15615:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>u});var a=t(95155),s=t(12115),i=t(73321),l=t(98500),d=t.n(l),o=t(35497),n=t(90620);let c=Object.values(n.Q2).map(e=>({value:e.id,label:e.name})),p=Object.values(n.MA).map(e=>({value:e.id,label:e.name}));function u(){let e=(0,i.useRouter)(),[r,t]=(0,s.useState)(!1),[l,u]=(0,s.useState)({provider:"",authMethod:"api_key",apiKey:"",displayName:"",isActive:!0}),[h,m]=(0,s.useState)({}),x=(e,r)=>{u(t=>({...t,[e]:r})),h[e]&&m(r=>({...r,[e]:null}))},b=async r=>{let a;if(r.preventDefault(),a={},l.provider||(a.provider="Please select a provider"),"api_key"!==l.authMethod||l.apiKey||(a.apiKey="API Key is required"),m(a),0===Object.keys(a).length){t(!0);try{let r=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(r.ok)e.push("/dashboard/providers");else{let e=await r.json();m({submit:e.error||"Failed to create provider"})}}catch(e){m({submit:"An error occurred. Please try again."})}finally{t(!1)}}},v=n.Q2[l.provider];return(0,a.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsxs)(d(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:"Add New Provider"}),(0,a.jsx)("p",{className:"text-text-muted mt-2",children:"Configure a new AI provider to use with your applications."})]}),(0,a.jsx)(o.Zp,{children:(0,a.jsxs)("form",{onSubmit:b,className:"flex flex-col gap-6",children:[(0,a.jsx)(o.l6,{label:"Provider",options:c,value:l.provider,onChange:e=>x("provider",e.target.value),placeholder:"Select a provider",error:h.provider,required:!0}),v&&(0,a.jsxs)(o.Zp.Section,{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-bg border border-border",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:v.color},children:v.icon})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:v.name}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Selected provider"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("label",{className:"text-sm font-medium",children:["Authentication Method ",(0,a.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,a.jsx)("div",{className:"flex gap-3",children:p.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>x("authMethod",e.value),className:`flex-1 flex items-center justify-center gap-2 p-4 rounded-lg border transition-all ${l.authMethod===e.value?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/50"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"api_key"===e.value?"key":"lock"}),(0,a.jsx)("span",{className:"font-medium",children:e.label})]},e.value))})]}),"api_key"===l.authMethod&&(0,a.jsx)(o.pd,{label:"API Key",type:"password",placeholder:"Enter your API key",value:l.apiKey,onChange:e=>x("apiKey",e.target.value),error:h.apiKey,hint:"Your API key will be encrypted and stored securely.",required:!0}),"oauth2"===l.authMethod&&(0,a.jsxs)(o.Zp.Section,{children:[(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Connect your account using OAuth2 authentication."}),(0,a.jsx)(o.$n,{type:"button",variant:"secondary",icon:"link",children:"Connect with OAuth2"})]}),(0,a.jsx)(o.pd,{label:"Display Name",placeholder:"e.g., Production API, Dev Environment",value:l.displayName,onChange:e=>x("displayName",e.target.value),hint:"Optional. A friendly name to identify this configuration."}),(0,a.jsx)(o.lM,{checked:l.isActive,onChange:e=>x("isActive",e),label:"Active",description:"Enable this provider for use in your applications"}),h.submit&&(0,a.jsx)("div",{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 text-sm",children:h.submit}),(0,a.jsxs)("div",{className:"flex gap-3 pt-4 border-t border-border",children:[(0,a.jsx)(d(),{href:"/dashboard/providers",className:"flex-1",children:(0,a.jsx)(o.$n,{type:"button",variant:"ghost",fullWidth:!0,children:"Cancel"})}),(0,a.jsx)(o.$n,{type:"submit",loading:r,fullWidth:!0,className:"flex-1",children:"Create Provider"})]})]})})]})}},67078:(e,r,t)=>{Promise.resolve().then(t.bind(t,15615))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=67078)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9089],{15615:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>u});var a=t(95155),s=t(12115),i=t(73321),l=t(98500),d=t.n(l),o=t(35497),n=t(90620);let c=Object.values(n.Q2).map(e=>({value:e.id,label:e.name})),p=Object.values(n.MA).map(e=>({value:e.id,label:e.name}));function u(){let e=(0,i.useRouter)(),[r,t]=(0,s.useState)(!1),[l,u]=(0,s.useState)({provider:"",authMethod:"api_key",apiKey:"",displayName:"",isActive:!0}),[h,m]=(0,s.useState)({}),x=(e,r)=>{u(t=>({...t,[e]:r})),h[e]&&m(r=>({...r,[e]:null}))},b=async r=>{let a;if(r.preventDefault(),a={},l.provider||(a.provider="Please select a provider"),"api_key"!==l.authMethod||l.apiKey||(a.apiKey="API Key is required"),m(a),0===Object.keys(a).length){t(!0);try{let r=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(r.ok)e.push("/dashboard/providers");else{let e=await r.json();m({submit:e.error||"Failed to create provider"})}}catch(e){m({submit:"An error occurred. Please try again."})}finally{t(!1)}}},v=n.Q2[l.provider];return(0,a.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsxs)(d(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:"Add New Provider"}),(0,a.jsx)("p",{className:"text-text-muted mt-2",children:"Configure a new AI provider to use with your applications."})]}),(0,a.jsx)(o.Zp,{children:(0,a.jsxs)("form",{onSubmit:b,className:"flex flex-col gap-6",children:[(0,a.jsx)(o.l6,{label:"Provider",options:c,value:l.provider,onChange:e=>x("provider",e.target.value),placeholder:"Select a provider",error:h.provider,required:!0}),v&&(0,a.jsxs)(o.Zp.Section,{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-bg border border-border",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:v.color},children:v.icon})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:v.name}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Selected provider"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("label",{className:"text-sm font-medium",children:["Authentication Method ",(0,a.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,a.jsx)("div",{className:"flex gap-3",children:p.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>x("authMethod",e.value),className:`flex-1 flex items-center justify-center gap-2 p-4 rounded-lg border transition-all ${l.authMethod===e.value?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/50"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"api_key"===e.value?"key":"lock"}),(0,a.jsx)("span",{className:"font-medium",children:e.label})]},e.value))})]}),"api_key"===l.authMethod&&(0,a.jsx)(o.pd,{label:"API Key",type:"password",placeholder:"Enter your API key",value:l.apiKey,onChange:e=>x("apiKey",e.target.value),error:h.apiKey,hint:"Your API key will be encrypted and stored securely.",required:!0}),"oauth2"===l.authMethod&&(0,a.jsxs)(o.Zp.Section,{children:[(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Connect your account using OAuth2 authentication."}),(0,a.jsx)(o.$n,{type:"button",variant:"secondary",icon:"link",children:"Connect with OAuth2"})]}),(0,a.jsx)(o.pd,{label:"Display Name",placeholder:"e.g., Production API, Dev Environment",value:l.displayName,onChange:e=>x("displayName",e.target.value),hint:"Optional. A friendly name to identify this configuration."}),(0,a.jsx)(o.lM,{checked:l.isActive,onChange:e=>x("isActive",e),label:"Active",description:"Enable this provider for use in your applications"}),h.submit&&(0,a.jsx)("div",{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 text-sm",children:h.submit}),(0,a.jsxs)("div",{className:"flex gap-3 pt-4 border-t border-border",children:[(0,a.jsx)(d(),{href:"/dashboard/providers",className:"flex-1",children:(0,a.jsx)(o.$n,{type:"button",variant:"ghost",fullWidth:!0,children:"Cancel"})}),(0,a.jsx)(o.$n,{type:"submit",loading:r,fullWidth:!0,className:"flex-1",children:"Create Provider"})]})]})})]})}},57267:(e,r,t)=>{Promise.resolve().then(t.bind(t,15615))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=57267)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{12572:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>N});var s=a(95155),r=a(12115),l=a(14051),i=a.n(l),n=a(35497),o=a(57250),d=a(90620),c=a(52679),p=a(98500),m=a.n(p),x=a(65921),u=a(38003);let h={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function f(){let[e,t]=(0,r.useState)(null),[a,l]=(0,r.useState)(!0),[i,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null),p=(0,r.useRef)(null),m=(0,x.i)(),u=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let a=await e.json();t(a)}}catch{}finally{l(!1)}},[]);(0,r.useEffect)(()=>{u();let e=setInterval(u,3e4);return()=>clearInterval(e)},[u]),(0,r.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&o(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let f=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(m.success(`Cooldown cleared for ${t}`),await u()):m.error("Failed to clear cooldown")}catch{m.error("Failed to clear cooldown")}finally{c(null)}};if(a)return null;let b=e?.models||[],g=0===(e?.unavailableCount||b.filter(e=>"available"!==e.status).length),v={};return b.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";v[t]||(v[t]=[]),v[t].push(e)}),(0,s.jsx)("div",{className:"relative",ref:p,children:i&&(0,s.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:g?"#22c55e":"#f59e0b"},children:g?"verified":"warning"}),(0,s.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,s.jsx)("button",{onClick:u,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,s.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:g?(0,s.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,s.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(v).map(([e,t])=>(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,s.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=h[e.status]||h.unknown,a=d===`${e.provider}:${e.model}`;return(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,s.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,s.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>f(e.provider,e.model),disabled:a,className:"text-[10px] px-1.5! py-0.5! ml-2",children:a?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}var b=a(68828);let g=[{value:"openai-compatible",label:"OpenAI Compatible"},{value:"anthropic-compatible",label:"Anthropic Compatible"}],v=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function y({isOpen:e,onClose:t,onImported:a,notify:l}){let[i,o]=(0,r.useState)(""),[d,c]=(0,r.useState)(null),[p,m]=(0,r.useState)(!1),[x,u]=(0,r.useState)(""),[h,f]=(0,r.useState)({type:"openai-compatible",apiType:"chat",name:"",prefix:"",baseUrl:"",connectionName:"Imported Key",apiKey:"",modelId:""}),j=()=>{o(""),c(null),m(!1),u(""),f({type:"openai-compatible",apiType:"chat",name:"",prefix:"",baseUrl:"",connectionName:"Imported Key",apiKey:"",modelId:""}),t()},N=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){m(!0);try{let e={name:h.name.trim(),prefix:h.prefix.trim(),baseUrl:h.baseUrl.trim(),type:h.type};"openai-compatible"===h.type&&(e.apiType=h.apiType);let t=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();if(!t.ok)throw Error(s.error||"Failed to create compatible provider");let r=null;if(h.apiKey.trim()){let e=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:s.node.id,apiKey:h.apiKey.trim(),name:h.connectionName.trim()||"Imported Key",testStatus:"unknown"})}),t=await e.json();if(!e.ok)throw Error(t.error||"Compatible provider created, but API key import failed");r=t.connection}l.success("Compatible provider imported from cURL"),a?.({node:s.node,connection:r}),j()}catch(e){l.error(e.message||"Failed to import curl")}finally{m(!1)}}};return(0,s.jsx)(n.aF,{isOpen:e,title:"Import Compatible Provider From cURL",onClose:j,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Paste cURL"}),(0,s.jsx)("textarea",{value:i,onChange:e=>o(e.target.value),placeholder:'curl --request POST --url https://api.example.com/v1/chat/completions --header \'Authorization: Bearer sk-xxx\' --header \'Content-Type: application/json\' --data \'{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}\'',className:"min-h-40 w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Supports full endpoint URLs like `/v1/chat/completions`, `/responses`, or `/v1/messages`."}),(0,s.jsx)(n.$n,{onClick:()=>{try{let e=(0,b.Sq)(i);c(e),u(""),f({type:e.type,apiType:e.apiType||"chat",name:e.defaultName,prefix:e.defaultPrefix,baseUrl:e.baseUrl,connectionName:e.defaultConnectionName,apiKey:e.apiKey,modelId:e.modelId})}catch(e){c(null),u(e.message||"Failed to parse curl")}},variant:"secondary",className:"w-full sm:w-auto",children:"Parse cURL"})]}),x&&(0,s.jsx)("p",{className:"text-sm text-red-500",children:x})]}),d&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)(n.Ex,{variant:"success",children:"Detected"}),(0,s.jsx)(n.Ex,{variant:"default",children:"anthropic-compatible"===h.type?"Anthropic Compatible":"OpenAI Compatible"}),"openai-compatible"===h.type&&(0,s.jsx)(n.Ex,{variant:"default",children:"responses"===h.apiType?"Responses API":"Chat Completions"})]}),(0,s.jsx)(n.l6,{label:"Provider Type",value:h.type,options:g,onChange:e=>f(t=>({...t,type:e.target.value,apiType:"anthropic-compatible"===e.target.value?"chat":t.apiType}))}),"openai-compatible"===h.type&&(0,s.jsx)(n.l6,{label:"API Type",value:h.apiType,options:v,onChange:e=>f(t=>({...t,apiType:e.target.value}))}),(0,s.jsx)(n.pd,{label:"Provider Name",value:h.name,onChange:e=>f(t=>({...t,name:e.target.value})),placeholder:"Compatible Provider"}),(0,s.jsx)(n.pd,{label:"Prefix",value:h.prefix,onChange:e=>f(t=>({...t,prefix:e.target.value})),placeholder:"oc-example"}),(0,s.jsx)(n.pd,{label:"Base URL",value:h.baseUrl,onChange:e=>f(t=>({...t,baseUrl:e.target.value})),placeholder:"https://api.example.com/v1"}),(0,s.jsx)(n.pd,{label:"Connection Name",value:h.connectionName,onChange:e=>f(t=>({...t,connectionName:e.target.value})),placeholder:"Imported Key"}),(0,s.jsx)(n.pd,{label:"API Key",type:"password",value:h.apiKey,onChange:e=>f(t=>({...t,apiKey:e.target.value})),placeholder:"Bearer token from curl"}),(0,s.jsx)(n.pd,{label:"Detected Model",value:h.modelId,onChange:e=>f(t=>({...t,modelId:e.target.value})),placeholder:"Optional"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:N,fullWidth:!0,disabled:!d||!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||p,children:p?"Importing...":"Create Provider"}),(0,s.jsx)(n.$n,{onClick:j,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function j(e,t,a){let r=[];if(e>0&&r.push((0,s.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=a?`${t} Error (${a})`:`${t} Error`;r.push((0,s.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===r.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No connections"}):r}function N(){let e,t,[a,l]=(0,r.useState)([]),[i,o]=(0,r.useState)([]),[p,m]=(0,r.useState)(!0),[h,b]=(0,r.useState)(!1),[g,v]=(0,r.useState)(!1),[j,N]=(0,r.useState)(!1),[A,U]=(0,r.useState)(!1),[S,R]=(0,r.useState)(null),[O,P]=(0,r.useState)(null),E=(0,x.i)(),$=(0,u.C)(e=>e.query),q=(0,u.C)(e=>e.register),_=(0,u.C)(e=>e.unregister);(0,r.useEffect)(()=>(q("Search providers..."),()=>_()),[q,_]);let z=e=>!$.trim()||e.toLowerCase().includes($.trim().toLowerCase());(0,r.useEffect)(()=>{let e=async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),a=await e.json(),s=await t.json();e.ok&&l(a.connections||[]),t.ok&&o(s.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{m(!1)}};fetch("/api/auth/me").then(e=>e.json()).then(e=>{"sub_user"===e.role&&(window.location.href="/dashboard/usage")}).catch(()=>{}),e()},[]);let K=(e,t)=>{let s=a.filter(a=>a.provider===e&&a.authType===t),r=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},l=s.filter(e=>{let t=r(e);return"active"===t||"success"===t}).length,i=s.filter(e=>{let t=r(e);return"error"===t||"expired"===t||"unavailable"===t}),n=i.length,o=s.length,d=o>0&&s.every(e=>!1===e.isActive),c=i.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:l,error:n,total:o,errorCode:c?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let a=Number(e.errorCode);if(Number.isFinite(a)&&a>=400)return String(a);let s=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===s||"403"===s)return"AUTH";if(s&&"ERR"!==s)return s;let r=(e.lastError||"").toLowerCase();return r.includes("runtime")||r.includes("not runnable")||r.includes("not installed")?"RUNTIME":r.includes("invalid api key")||r.includes("token invalid")||r.includes("revoked")||r.includes("unauthorized")?"AUTH":"ERR"}(c):null,errorTime:c?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let a=Math.floor(t/60);if(a<24)return`${a}h ago`;let s=Math.floor(a/24);return`${s}d ago`}(c.lastErrorAt):null,allDisabled:d}},D=async(e,t,s)=>{let r=a.filter(a=>a.provider===e&&a.authType===t);l(a=>a.map(a=>a.provider===e&&a.authType===t?{...a,isActive:s}:a)),await Promise.allSettled(r.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},F=async(e,t=null)=>{if(!S){R("provider"===e?t:e),P(null);try{let a=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),s=await a.json();if(P(s),s.summary){let{passed:e,failed:t,total:a}=s.summary;0===t?E.success(`All ${a} tests passed`):E.warning(`${e}/${a} passed, ${t} failed`)}}catch(e){P({error:"Test request failed"}),E.error("Provider test failed")}finally{R(null)}}},L=i.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>z(e.name)),M=i.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>z(e.name)),J=Object.entries(d.zN).filter(([,e])=>z(e.name)),B=Object.entries(c.IS).filter(([,e])=>z(e.name)),W=Object.entries(c.nJ).filter(([,e])=>z(e.name)),H=(e=Object.entries(d.fg).filter(([,e])=>(e.serviceKinds??["llm"]).includes("llm")&&z(e.name)),t="apikey",[...e].sort(([e,a],[s,r])=>{let l=K(e,t),i=K(s,t),n=+(l.connected>0),o=+(i.connected>0);return n!==o?o-n:(a.name||"").localeCompare(r.name||"")})),Q=!!$.trim(),V=Q||h?H:H.slice(0,20),X=H.length-20;if(p)return(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{})]});let Z=J.length>0||B.length>0||W.length>0||H.length>0||L.length>0||M.length>0;return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[!Z&&(0,s.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,s.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search"})]}),J.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)(f,{}),(0,s.jsxs)("button",{onClick:()=>F("oauth"),disabled:!!S,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"oauth"===S?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===S?" animate-spin":""}`,children:"play_arrow"}),"oauth"===S?"Testing...":"Test All"]})]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:J.map(([e,t])=>(0,s.jsx)(w,{providerId:e,provider:t,stats:K(e,"oauth"),authType:"oauth",onToggle:t=>D(e,"oauth",t)},e))})]}),(B.length>0||W.length>0)&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,s.jsxs)("button",{onClick:()=>F("free"),disabled:!!S,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"free"===S?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===S?" animate-spin":""}`,children:"play_arrow"}),"free"===S?"Testing...":"Test All"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[B.map(([e,t])=>(0,s.jsx)(w,{providerId:e,provider:t,stats:K(e,"oauth"),authType:"free",onToggle:t=>D(e,"oauth",t)},e)),W.map(([e,t])=>(0,s.jsx)(C,{providerId:e,provider:t,stats:K(e,"apikey"),authType:"apikey",onToggle:t=>D(e,"apikey",t)},e))]})]}),H.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Providers"," "]}),(0,s.jsxs)("button",{onClick:()=>F("apikey"),disabled:!!S,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"apikey"===S?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===S?" animate-spin":""}`,children:"play_arrow"}),"apikey"===S?"Testing...":"Test All"]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:V.map(([e,t])=>(0,s.jsx)(C,{providerId:e,provider:t,stats:K(e,"apikey"),authType:"apikey",onToggle:t=>D(e,"apikey",t)},e))}),!Q&&!h&&X>0&&(0,s.jsxs)("button",{onClick:()=>b(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",H.length," providers"]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Compatible Providers"," "]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto",children:[(0,s.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"upload",onClick:()=>U(!0),className:"w-full sm:w-auto",children:"Import cURL"}),(0,s.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>N(!0),className:"w-full sm:w-auto",children:"Add Anthropic Compatible"}),(0,s.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>v(!0),className:"w-full !bg-white !text-black hover:!bg-gray-100 sm:w-auto",children:"Add OpenAI Compatible"})]})]}),0===L.length&&0===M.length?(0,s.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"extension"}),(0,s.jsx)("p",{className:"text-text-muted text-sm",children:"No compatible providers added yet"}),(0,s.jsx)("p",{className:"text-text-muted text-xs mt-1",children:"Use the buttons above to add OpenAI or Anthropic compatible endpoints"})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[...L,...M].map(e=>(0,s.jsx)(C,{providerId:e.id,provider:e,stats:K(e.id,"apikey"),authType:"compatible",onToggle:t=>D(e.id,"apikey",t)},e.id))})]}),(0,s.jsx)(k,{isOpen:g,onClose:()=>v(!1),onCreated:e=>{o(t=>[...t,e]),v(!1)}}),(0,s.jsx)(T,{isOpen:j,onClose:()=>N(!1),onCreated:e=>{o(t=>[...t,e]),N(!1)}}),(0,s.jsx)(y,{isOpen:A,onClose:()=>U(!1),notify:E,onImported:({node:e,connection:t})=>{o(t=>[...t,e]),t&&l(e=>[...e,t]),U(!1)}}),O&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>P(null),children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,s.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,s.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,s.jsx)("button",{onClick:()=>P(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,s.jsx)("div",{className:"p-5",children:(0,s.jsx)(I,{results:O})})]})]})]})}function w({providerId:e,provider:t,stats:a,authType:r,onToggle:l}){let{connected:i,error:d,errorCode:c,errorTime:p,allDisabled:x}=a,u=!!t.noAuth;return(0,s.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,s.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${x?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,s.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,s.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,s.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:x?(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):u?(0,s.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,s.jsxs)(s.Fragment,{children:[j(i,d,c),p&&(0,s.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a.total>0&&(0,s.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!x)},children:(0,s.jsx)(n.lM,{size:"sm",checked:!x,onChange:()=>{},title:x?"Enable provider":"Disable provider"})})})]})})})}function C({providerId:e,provider:t,stats:a,authType:r,onToggle:l}){let{connected:i,error:d,errorCode:p,errorTime:x,allDisabled:u}=a,h=e.startsWith(c.JH),f=e.startsWith(c.DI);return(0,s.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,s.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${u?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,s.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,s.jsx)(o.A,{src:h?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":f?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,s.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:u?(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,s.jsxs)(s.Fragment,{children:[j(i,d,p),h&&(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),f&&(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),x&&(0,s.jsx)("span",{className:"text-text-muted",children:x})]})})]})]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a.total>0&&(0,s.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!u)},children:(0,s.jsx)(n.lM,{size:"sm",checked:!u,onChange:()=>{},title:u?"Enable provider":"Disable provider"})})})]})})})}function k({isOpen:e,onClose:t,onCreated:a}){let[l,i]=(0,r.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[o,d]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),[m,x]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[f,b]=(0,r.useState)(null);(0,r.useEffect)(()=>{i(e=>({...e,baseUrl:"https://api.openai.com/v1"}))},[l.apiType]);let g=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,apiType:l.apiType,baseUrl:l.baseUrl,type:"openai-compatible"})}),t=await e.json();e.ok&&(a(t.node),i({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),p(""),b(null))}catch(e){console.log("Error creating OpenAI Compatible node:",e)}finally{d(!1)}}},v=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"openai-compatible",modelId:m.trim()||void 0})}),t=await e.json();t.normalizedBaseUrl&&i(e=>({...e,baseUrl:t.normalizedBaseUrl,apiType:t.inferredApiType||e.apiType})),b(t)}catch{b({valid:!1,error:"Network error"})}finally{h(!1)}};return(0,s.jsx)(n.aF,{isOpen:e,title:"Add OpenAI Compatible",onClose:t,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"OpenAI Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,s.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,s.jsx)(n.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:l.apiType,onChange:e=>i({...l,apiType:e.target.value})}),(0,s.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.openai.com/v1",hint:"Use the base URL (ending in /v1) for your OpenAI-compatible API."}),(0,s.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value)}),(0,s.jsx)(n.pd,{label:"Model ID (optional)",value:m,onChange:e=>x(e.target.value),placeholder:"e.g. gpt-4, claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,s.jsx)(n.$n,{onClick:v,disabled:!c||u||!l.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:u?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:a}=f;return e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===a&&(0,s.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,s.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,s.jsx)(n.$n,{onClick:g,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,s.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function T({isOpen:e,onClose:t,onCreated:a}){let[l,i]=(0,r.useState)({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),[o,d]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),[m,x]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[f,b]=(0,r.useState)(null);(0,r.useEffect)(()=>{e&&(b(null),p(""),x(""))},[e]);let g=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,baseUrl:l.baseUrl,type:"anthropic-compatible"})}),t=await e.json();e.ok&&(a(t.node),i({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),p(""),b(null))}catch(e){console.log("Error creating Anthropic Compatible node:",e)}finally{d(!1)}}},v=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"anthropic-compatible",modelId:m.trim()||void 0})}),t=await e.json();t.normalizedBaseUrl&&i(e=>({...e,baseUrl:t.normalizedBaseUrl})),b(t)}catch{b({valid:!1,error:"Network error"})}finally{h(!1)}};return(0,s.jsx)(n.aF,{isOpen:e,title:"Add Anthropic Compatible",onClose:t,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"Anthropic Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,s.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"ac-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,s.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.anthropic.com/v1",hint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages."}),(0,s.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value)}),(0,s.jsx)(n.pd,{label:"Model ID (optional)",value:m,onChange:e=>x(e.target.value),placeholder:"e.g. claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,s.jsx)(n.$n,{onClick:v,disabled:!c||u||!l.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:u?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:a}=f;return e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===a&&(0,s.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,s.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,s.jsx)(n.$n,{onClick:g,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,s.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function I({results:e}){if(e.error&&!e.results)return(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,s.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:a}=e,r=e.results||[];return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,s.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[a]||a," Test"]}),(0,s.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,s.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,s.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),r.map((e,t)=>(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,s.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,s.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,s.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,s.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,s.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===r.length&&(0,s.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}y.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onImported:i().func,notify:i().shape({success:i().func.isRequired,error:i().func.isRequired}).isRequired},w.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},C.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},k.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},T.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},I.propTypes={results:i().shape({mode:i().string,results:i().array,summary:i().shape({total:i().number,passed:i().number,failed:i().number}),error:i().string}).isRequired}},16341:(e,t,a)=>{Promise.resolve().then(a.bind(a,12572))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=16341)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{12572:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>N});var s=a(95155),r=a(12115),l=a(14051),i=a.n(l),n=a(35497),o=a(57250),d=a(90620),c=a(52679),p=a(98500),m=a.n(p),x=a(65921),u=a(38003);let h={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function f(){let[e,t]=(0,r.useState)(null),[a,l]=(0,r.useState)(!0),[i,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null),p=(0,r.useRef)(null),m=(0,x.i)(),u=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let a=await e.json();t(a)}}catch{}finally{l(!1)}},[]);(0,r.useEffect)(()=>{u();let e=setInterval(u,3e4);return()=>clearInterval(e)},[u]),(0,r.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&o(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let f=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(m.success(`Cooldown cleared for ${t}`),await u()):m.error("Failed to clear cooldown")}catch{m.error("Failed to clear cooldown")}finally{c(null)}};if(a)return null;let b=e?.models||[],g=0===(e?.unavailableCount||b.filter(e=>"available"!==e.status).length),v={};return b.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";v[t]||(v[t]=[]),v[t].push(e)}),(0,s.jsx)("div",{className:"relative",ref:p,children:i&&(0,s.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:g?"#22c55e":"#f59e0b"},children:g?"verified":"warning"}),(0,s.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,s.jsx)("button",{onClick:u,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,s.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:g?(0,s.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,s.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(v).map(([e,t])=>(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,s.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=h[e.status]||h.unknown,a=d===`${e.provider}:${e.model}`;return(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,s.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,s.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>f(e.provider,e.model),disabled:a,className:"text-[10px] px-1.5! py-0.5! ml-2",children:a?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}var b=a(68828);let g=[{value:"openai-compatible",label:"OpenAI Compatible"},{value:"anthropic-compatible",label:"Anthropic Compatible"}],v=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function y({isOpen:e,onClose:t,onImported:a,notify:l}){let[i,o]=(0,r.useState)(""),[d,c]=(0,r.useState)(null),[p,m]=(0,r.useState)(!1),[x,u]=(0,r.useState)(""),[h,f]=(0,r.useState)({type:"openai-compatible",apiType:"chat",name:"",prefix:"",baseUrl:"",connectionName:"Imported Key",apiKey:"",modelId:""}),j=()=>{o(""),c(null),m(!1),u(""),f({type:"openai-compatible",apiType:"chat",name:"",prefix:"",baseUrl:"",connectionName:"Imported Key",apiKey:"",modelId:""}),t()},N=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){m(!0);try{let e={name:h.name.trim(),prefix:h.prefix.trim(),baseUrl:h.baseUrl.trim(),type:h.type};"openai-compatible"===h.type&&(e.apiType=h.apiType);let t=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();if(!t.ok)throw Error(s.error||"Failed to create compatible provider");let r=null;if(h.apiKey.trim()){let e=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:s.node.id,apiKey:h.apiKey.trim(),name:h.connectionName.trim()||"Imported Key",testStatus:"unknown"})}),t=await e.json();if(!e.ok)throw Error(t.error||"Compatible provider created, but API key import failed");r=t.connection}l.success("Compatible provider imported from cURL"),a?.({node:s.node,connection:r}),j()}catch(e){l.error(e.message||"Failed to import curl")}finally{m(!1)}}};return(0,s.jsx)(n.aF,{isOpen:e,title:"Import Compatible Provider From cURL",onClose:j,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Paste cURL"}),(0,s.jsx)("textarea",{value:i,onChange:e=>o(e.target.value),placeholder:'curl --request POST --url https://api.example.com/v1/chat/completions --header \'Authorization: Bearer sk-xxx\' --header \'Content-Type: application/json\' --data \'{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}\'',className:"min-h-40 w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Supports full endpoint URLs like `/v1/chat/completions`, `/responses`, or `/v1/messages`."}),(0,s.jsx)(n.$n,{onClick:()=>{try{let e=(0,b.Sq)(i);c(e),u(""),f({type:e.type,apiType:e.apiType||"chat",name:e.defaultName,prefix:e.defaultPrefix,baseUrl:e.baseUrl,connectionName:e.defaultConnectionName,apiKey:e.apiKey,modelId:e.modelId})}catch(e){c(null),u(e.message||"Failed to parse curl")}},variant:"secondary",className:"w-full sm:w-auto",children:"Parse cURL"})]}),x&&(0,s.jsx)("p",{className:"text-sm text-red-500",children:x})]}),d&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)(n.Ex,{variant:"success",children:"Detected"}),(0,s.jsx)(n.Ex,{variant:"default",children:"anthropic-compatible"===h.type?"Anthropic Compatible":"OpenAI Compatible"}),"openai-compatible"===h.type&&(0,s.jsx)(n.Ex,{variant:"default",children:"responses"===h.apiType?"Responses API":"Chat Completions"})]}),(0,s.jsx)(n.l6,{label:"Provider Type",value:h.type,options:g,onChange:e=>f(t=>({...t,type:e.target.value,apiType:"anthropic-compatible"===e.target.value?"chat":t.apiType}))}),"openai-compatible"===h.type&&(0,s.jsx)(n.l6,{label:"API Type",value:h.apiType,options:v,onChange:e=>f(t=>({...t,apiType:e.target.value}))}),(0,s.jsx)(n.pd,{label:"Provider Name",value:h.name,onChange:e=>f(t=>({...t,name:e.target.value})),placeholder:"Compatible Provider"}),(0,s.jsx)(n.pd,{label:"Prefix",value:h.prefix,onChange:e=>f(t=>({...t,prefix:e.target.value})),placeholder:"oc-example"}),(0,s.jsx)(n.pd,{label:"Base URL",value:h.baseUrl,onChange:e=>f(t=>({...t,baseUrl:e.target.value})),placeholder:"https://api.example.com/v1"}),(0,s.jsx)(n.pd,{label:"Connection Name",value:h.connectionName,onChange:e=>f(t=>({...t,connectionName:e.target.value})),placeholder:"Imported Key"}),(0,s.jsx)(n.pd,{label:"API Key",type:"password",value:h.apiKey,onChange:e=>f(t=>({...t,apiKey:e.target.value})),placeholder:"Bearer token from curl"}),(0,s.jsx)(n.pd,{label:"Detected Model",value:h.modelId,onChange:e=>f(t=>({...t,modelId:e.target.value})),placeholder:"Optional"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:N,fullWidth:!0,disabled:!d||!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||p,children:p?"Importing...":"Create Provider"}),(0,s.jsx)(n.$n,{onClick:j,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function j(e,t,a){let r=[];if(e>0&&r.push((0,s.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=a?`${t} Error (${a})`:`${t} Error`;r.push((0,s.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===r.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No connections"}):r}function N(){let e,t,[a,l]=(0,r.useState)([]),[i,o]=(0,r.useState)([]),[p,m]=(0,r.useState)(!0),[h,b]=(0,r.useState)(!1),[g,v]=(0,r.useState)(!1),[j,N]=(0,r.useState)(!1),[A,U]=(0,r.useState)(!1),[S,R]=(0,r.useState)(null),[O,P]=(0,r.useState)(null),E=(0,x.i)(),$=(0,u.C)(e=>e.query),q=(0,u.C)(e=>e.register),_=(0,u.C)(e=>e.unregister);(0,r.useEffect)(()=>(q("Search providers..."),()=>_()),[q,_]);let z=e=>!$.trim()||e.toLowerCase().includes($.trim().toLowerCase());(0,r.useEffect)(()=>{let e=async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),a=await e.json(),s=await t.json();e.ok&&l(a.connections||[]),t.ok&&o(s.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{m(!1)}};fetch("/api/auth/me").then(e=>e.json()).then(e=>{"sub_user"===e.role&&(window.location.href="/dashboard/usage")}).catch(()=>{}),e()},[]);let K=(e,t)=>{let s=a.filter(a=>a.provider===e&&a.authType===t),r=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},l=s.filter(e=>{let t=r(e);return"active"===t||"success"===t}).length,i=s.filter(e=>{let t=r(e);return"error"===t||"expired"===t||"unavailable"===t}),n=i.length,o=s.length,d=o>0&&s.every(e=>!1===e.isActive),c=i.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:l,error:n,total:o,errorCode:c?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let a=Number(e.errorCode);if(Number.isFinite(a)&&a>=400)return String(a);let s=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===s||"403"===s)return"AUTH";if(s&&"ERR"!==s)return s;let r=(e.lastError||"").toLowerCase();return r.includes("runtime")||r.includes("not runnable")||r.includes("not installed")?"RUNTIME":r.includes("invalid api key")||r.includes("token invalid")||r.includes("revoked")||r.includes("unauthorized")?"AUTH":"ERR"}(c):null,errorTime:c?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let a=Math.floor(t/60);if(a<24)return`${a}h ago`;let s=Math.floor(a/24);return`${s}d ago`}(c.lastErrorAt):null,allDisabled:d}},D=async(e,t,s)=>{let r=a.filter(a=>a.provider===e&&a.authType===t);l(a=>a.map(a=>a.provider===e&&a.authType===t?{...a,isActive:s}:a)),await Promise.allSettled(r.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},F=async(e,t=null)=>{if(!S){R("provider"===e?t:e),P(null);try{let a=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),s=await a.json();if(P(s),s.summary){let{passed:e,failed:t,total:a}=s.summary;0===t?E.success(`All ${a} tests passed`):E.warning(`${e}/${a} passed, ${t} failed`)}}catch(e){P({error:"Test request failed"}),E.error("Provider test failed")}finally{R(null)}}},L=i.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>z(e.name)),M=i.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>z(e.name)),J=Object.entries(d.zN).filter(([,e])=>z(e.name)),B=Object.entries(c.IS).filter(([,e])=>z(e.name)),W=Object.entries(c.nJ).filter(([,e])=>z(e.name)),H=(e=Object.entries(d.fg).filter(([,e])=>(e.serviceKinds??["llm"]).includes("llm")&&z(e.name)),t="apikey",[...e].sort(([e,a],[s,r])=>{let l=K(e,t),i=K(s,t),n=+(l.connected>0),o=+(i.connected>0);return n!==o?o-n:(a.name||"").localeCompare(r.name||"")})),Q=!!$.trim(),V=Q||h?H:H.slice(0,20),X=H.length-20;if(p)return(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{})]});let Z=J.length>0||B.length>0||W.length>0||H.length>0||L.length>0||M.length>0;return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[!Z&&(0,s.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,s.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search"})]}),J.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)(f,{}),(0,s.jsxs)("button",{onClick:()=>F("oauth"),disabled:!!S,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"oauth"===S?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===S?" animate-spin":""}`,children:"play_arrow"}),"oauth"===S?"Testing...":"Test All"]})]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:J.map(([e,t])=>(0,s.jsx)(w,{providerId:e,provider:t,stats:K(e,"oauth"),authType:"oauth",onToggle:t=>D(e,"oauth",t)},e))})]}),(B.length>0||W.length>0)&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,s.jsxs)("button",{onClick:()=>F("free"),disabled:!!S,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"free"===S?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===S?" animate-spin":""}`,children:"play_arrow"}),"free"===S?"Testing...":"Test All"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[B.map(([e,t])=>(0,s.jsx)(w,{providerId:e,provider:t,stats:K(e,"oauth"),authType:"free",onToggle:t=>D(e,"oauth",t)},e)),W.map(([e,t])=>(0,s.jsx)(C,{providerId:e,provider:t,stats:K(e,"apikey"),authType:"apikey",onToggle:t=>D(e,"apikey",t)},e))]})]}),H.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Providers"," "]}),(0,s.jsxs)("button",{onClick:()=>F("apikey"),disabled:!!S,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"apikey"===S?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===S?" animate-spin":""}`,children:"play_arrow"}),"apikey"===S?"Testing...":"Test All"]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:V.map(([e,t])=>(0,s.jsx)(C,{providerId:e,provider:t,stats:K(e,"apikey"),authType:"apikey",onToggle:t=>D(e,"apikey",t)},e))}),!Q&&!h&&X>0&&(0,s.jsxs)("button",{onClick:()=>b(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",H.length," providers"]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Compatible Providers"," "]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto",children:[(0,s.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"upload",onClick:()=>U(!0),className:"w-full sm:w-auto",children:"Import cURL"}),(0,s.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>N(!0),className:"w-full sm:w-auto",children:"Add Anthropic Compatible"}),(0,s.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>v(!0),className:"w-full !bg-white !text-black hover:!bg-gray-100 sm:w-auto",children:"Add OpenAI Compatible"})]})]}),0===L.length&&0===M.length?(0,s.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"extension"}),(0,s.jsx)("p",{className:"text-text-muted text-sm",children:"No compatible providers added yet"}),(0,s.jsx)("p",{className:"text-text-muted text-xs mt-1",children:"Use the buttons above to add OpenAI or Anthropic compatible endpoints"})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[...L,...M].map(e=>(0,s.jsx)(C,{providerId:e.id,provider:e,stats:K(e.id,"apikey"),authType:"compatible",onToggle:t=>D(e.id,"apikey",t)},e.id))})]}),(0,s.jsx)(k,{isOpen:g,onClose:()=>v(!1),onCreated:e=>{o(t=>[...t,e]),v(!1)}}),(0,s.jsx)(T,{isOpen:j,onClose:()=>N(!1),onCreated:e=>{o(t=>[...t,e]),N(!1)}}),(0,s.jsx)(y,{isOpen:A,onClose:()=>U(!1),notify:E,onImported:({node:e,connection:t})=>{o(t=>[...t,e]),t&&l(e=>[...e,t]),U(!1)}}),O&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>P(null),children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,s.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,s.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,s.jsx)("button",{onClick:()=>P(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,s.jsx)("div",{className:"p-5",children:(0,s.jsx)(I,{results:O})})]})]})]})}function w({providerId:e,provider:t,stats:a,authType:r,onToggle:l}){let{connected:i,error:d,errorCode:c,errorTime:p,allDisabled:x}=a,u=!!t.noAuth;return(0,s.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,s.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${x?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,s.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,s.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,s.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:x?(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):u?(0,s.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,s.jsxs)(s.Fragment,{children:[j(i,d,c),p&&(0,s.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a.total>0&&(0,s.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!x)},children:(0,s.jsx)(n.lM,{size:"sm",checked:!x,onChange:()=>{},title:x?"Enable provider":"Disable provider"})})})]})})})}function C({providerId:e,provider:t,stats:a,authType:r,onToggle:l}){let{connected:i,error:d,errorCode:p,errorTime:x,allDisabled:u}=a,h=e.startsWith(c.JH),f=e.startsWith(c.DI);return(0,s.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,s.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${u?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,s.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,s.jsx)(o.A,{src:h?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":f?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,s.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:u?(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,s.jsxs)(s.Fragment,{children:[j(i,d,p),h&&(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),f&&(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),x&&(0,s.jsx)("span",{className:"text-text-muted",children:x})]})})]})]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a.total>0&&(0,s.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!u)},children:(0,s.jsx)(n.lM,{size:"sm",checked:!u,onChange:()=>{},title:u?"Enable provider":"Disable provider"})})})]})})})}function k({isOpen:e,onClose:t,onCreated:a}){let[l,i]=(0,r.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[o,d]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),[m,x]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[f,b]=(0,r.useState)(null);(0,r.useEffect)(()=>{i(e=>({...e,baseUrl:"https://api.openai.com/v1"}))},[l.apiType]);let g=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,apiType:l.apiType,baseUrl:l.baseUrl,type:"openai-compatible"})}),t=await e.json();e.ok&&(a(t.node),i({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),p(""),b(null))}catch(e){console.log("Error creating OpenAI Compatible node:",e)}finally{d(!1)}}},v=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"openai-compatible",modelId:m.trim()||void 0})}),t=await e.json();t.normalizedBaseUrl&&i(e=>({...e,baseUrl:t.normalizedBaseUrl,apiType:t.inferredApiType||e.apiType})),b(t)}catch{b({valid:!1,error:"Network error"})}finally{h(!1)}};return(0,s.jsx)(n.aF,{isOpen:e,title:"Add OpenAI Compatible",onClose:t,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"OpenAI Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,s.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,s.jsx)(n.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:l.apiType,onChange:e=>i({...l,apiType:e.target.value})}),(0,s.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.openai.com/v1",hint:"Use the base URL (ending in /v1) for your OpenAI-compatible API."}),(0,s.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value)}),(0,s.jsx)(n.pd,{label:"Model ID (optional)",value:m,onChange:e=>x(e.target.value),placeholder:"e.g. gpt-4, claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,s.jsx)(n.$n,{onClick:v,disabled:!c||u||!l.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:u?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:a}=f;return e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===a&&(0,s.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,s.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,s.jsx)(n.$n,{onClick:g,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,s.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function T({isOpen:e,onClose:t,onCreated:a}){let[l,i]=(0,r.useState)({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),[o,d]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),[m,x]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[f,b]=(0,r.useState)(null);(0,r.useEffect)(()=>{e&&(b(null),p(""),x(""))},[e]);let g=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,baseUrl:l.baseUrl,type:"anthropic-compatible"})}),t=await e.json();e.ok&&(a(t.node),i({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),p(""),b(null))}catch(e){console.log("Error creating Anthropic Compatible node:",e)}finally{d(!1)}}},v=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"anthropic-compatible",modelId:m.trim()||void 0})}),t=await e.json();t.normalizedBaseUrl&&i(e=>({...e,baseUrl:t.normalizedBaseUrl})),b(t)}catch{b({valid:!1,error:"Network error"})}finally{h(!1)}};return(0,s.jsx)(n.aF,{isOpen:e,title:"Add Anthropic Compatible",onClose:t,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"Anthropic Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,s.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"ac-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,s.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.anthropic.com/v1",hint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages."}),(0,s.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value)}),(0,s.jsx)(n.pd,{label:"Model ID (optional)",value:m,onChange:e=>x(e.target.value),placeholder:"e.g. claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,s.jsx)(n.$n,{onClick:v,disabled:!c||u||!l.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:u?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:a}=f;return e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===a&&(0,s.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,s.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,s.jsx)(n.$n,{onClick:g,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,s.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function I({results:e}){if(e.error&&!e.results)return(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,s.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:a}=e,r=e.results||[];return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,s.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[a]||a," Test"]}),(0,s.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,s.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,s.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),r.map((e,t)=>(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,s.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,s.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,s.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,s.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,s.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===r.length&&(0,s.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}y.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onImported:i().func,notify:i().shape({success:i().func.isRequired,error:i().func.isRequired}).isRequired},w.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},C.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},k.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},T.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},I.propTypes={results:i().shape({mode:i().string,results:i().array,summary:i().shape({total:i().number,passed:i().number,failed:i().number}),error:i().string}).isRequired}},67096:(e,t,a)=>{Promise.resolve().then(a.bind(a,12572))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=67096)),_N_E=e.O()}]);
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6812],{55385:(e,t,r)=>{Promise.resolve().then(r.bind(r,57076))},57076:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(95155),l=r(12115),a=r(35497),i=r(65921);function o(e={}){return{name:e.name||"",proxyUrl:e.proxyUrl||"",noProxy:e.noProxy||"",isActive:!1!==e.isActive,strictProxy:!0===e.strictProxy}}function n(){let[e,t]=(0,l.useState)([]),[r,n]=(0,l.useState)(!0),[c,d]=(0,l.useState)(!1),[x,p]=(0,l.useState)(!1),[m,h]=(0,l.useState)(!1),[u,y]=(0,l.useState)(null),[f,g]=(0,l.useState)(o()),[v,j]=(0,l.useState)(""),[b,k]=(0,l.useState)({vercelToken:"",projectName:"vercel-relay"}),[N,w]=(0,l.useState)(!1),[$,P]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[A,E]=(0,l.useState)(null),[T,U]=(0,l.useState)([]),[D,I]=(0,l.useState)(!1),[O,z]=(0,l.useState)({current:0,total:0}),[_,F]=(0,l.useState)(!1),V=(0,i.i)(),L=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/proxy-pools?includeUsage=true",{cache:"no-store"}),r=await e.json();e.ok&&t(r.proxyPools||[])}catch(e){console.log("Error fetching proxy pools:",e)}finally{n(!1)}},[]);(0,l.useEffect)(()=>{fetch("/api/auth/me").then(e=>e.json()).then(e=>{"sub_user"===e.role&&(window.location.href="/dashboard/usage")}).catch(()=>{}),L()},[L]);let R=()=>{y(null),g(o())},W=()=>{R(),d(!0)},B=()=>{d(!1),R()},J=async()=>{let e={name:f.name.trim(),proxyUrl:f.proxyUrl.trim(),noProxy:f.noProxy.trim(),isActive:!0===f.isActive,strictProxy:!0===f.strictProxy};if(e.name&&e.proxyUrl){w(!0);try{let t=!!u,r=await fetch(t?`/api/proxy-pools/${u.id}`:"/api/proxy-pools",{method:t?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.ok)await L(),B(),V.success(u?"Proxy pool updated":"Proxy pool created");else{let e=await r.json();V.error(e.error||"Failed to save proxy pool")}}catch(e){console.log("Error saving proxy pool:",e)}finally{w(!1)}}},M=async e=>{if(confirm(`Delete proxy pool "${e.name}"?`))try{let r=await fetch(`/api/proxy-pools/${e.id}`,{method:"DELETE"});if(r.ok){t(t=>t.filter(t=>t.id!==e.id)),V.success("Proxy pool deleted");return}let s=await r.json();409===r.status?V.warning(`Cannot delete: ${s.boundConnectionCount||0} connection(s) are still using this pool.`):V.error(s.error||"Failed to delete proxy pool")}catch(e){console.log("Error deleting proxy pool:",e),V.error("Failed to delete proxy pool")}},q=async e=>{E(e);try{let t=await fetch(`/api/proxy-pools/${e}/test`,{method:"POST"}),r=await t.json();if(!t.ok)return void V.error(r.error||"Failed to test proxy");await L(),V.success(r.ok?"Proxy test passed":"Proxy test failed")}catch(e){console.log("Error testing proxy pool:",e),V.error("Failed to test proxy")}finally{E(null)}},G=async e=>{let r=!e.isActive;t(t=>t.map(t=>t.id===e.id?{...t,isActive:r}:t));try{(await fetch(`/api/proxy-pools/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:r})})).ok||(t(t=>t.map(t=>t.id===e.id?{...t,isActive:e.isActive}:t)),V.error("Failed to update active state"))}catch(r){console.log("Error toggling active:",r),t(t=>t.map(t=>t.id===e.id?{...t,isActive:e.isActive}:t))}},H=e.length>0&&T.length===e.length,Q=()=>U([]),K=async t=>{let r=T.length>0?T:e.map(e=>e.id);if(0!==r.length){F(!0);try{let e=0,s=0;for(let l of r)try{(await fetch(`/api/proxy-pools/${l}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok?e+=1:s+=1}catch{s+=1}await L(),V.success(`${t?"Activated":"Deactivated"} ${e}${s?`, failed ${s}`:""}`)}finally{F(!1)}}},Y=async()=>{if(0!==T.length&&confirm(`Delete ${T.length} proxy pool(s)?`)){F(!0);try{let e=0,t=0,r=0;for(let s of T)try{let l=await fetch(`/api/proxy-pools/${s}`,{method:"DELETE"});l.ok?e+=1:409===l.status?t+=1:r+=1}catch{r+=1}await L(),Q(),V.success(`Deleted ${e}${t?`, ${t} bound`:""}${r?`, ${r} failed`:""}`)}finally{F(!1)}}},Z=async()=>{let t=T.length>0?e.filter(e=>T.includes(e.id)):e;if(0===t.length)return;I(!0),z({current:0,total:t.length});let r=0,s=[],l=0,a=[...t],i=async()=>{for(;a.length>0;){let e=a.shift();if(!e)break;try{let t=await fetch(`/api/proxy-pools/${e.id}/test`,{method:"POST"}),l=await t.json();t.ok&&l.ok?r+=1:s.push(e.id)}catch{s.push(e.id)}finally{z({current:l+=1,total:t.length})}}};if(await Promise.all(Array.from({length:Math.min(10,t.length)},i)),await L(),I(!1),z({current:0,total:0}),s.length>0&&confirm(`Alive: ${r}, Dead: ${s.length}.
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6812],{22248:(e,t,r)=>{Promise.resolve().then(r.bind(r,57076))},57076:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(95155),l=r(12115),a=r(35497),i=r(65921);function o(e={}){return{name:e.name||"",proxyUrl:e.proxyUrl||"",noProxy:e.noProxy||"",isActive:!1!==e.isActive,strictProxy:!0===e.strictProxy}}function n(){let[e,t]=(0,l.useState)([]),[r,n]=(0,l.useState)(!0),[c,d]=(0,l.useState)(!1),[x,p]=(0,l.useState)(!1),[m,h]=(0,l.useState)(!1),[u,y]=(0,l.useState)(null),[f,g]=(0,l.useState)(o()),[v,j]=(0,l.useState)(""),[b,k]=(0,l.useState)({vercelToken:"",projectName:"vercel-relay"}),[N,w]=(0,l.useState)(!1),[$,P]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[A,E]=(0,l.useState)(null),[T,U]=(0,l.useState)([]),[D,I]=(0,l.useState)(!1),[O,z]=(0,l.useState)({current:0,total:0}),[_,F]=(0,l.useState)(!1),V=(0,i.i)(),L=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/proxy-pools?includeUsage=true",{cache:"no-store"}),r=await e.json();e.ok&&t(r.proxyPools||[])}catch(e){console.log("Error fetching proxy pools:",e)}finally{n(!1)}},[]);(0,l.useEffect)(()=>{fetch("/api/auth/me").then(e=>e.json()).then(e=>{"sub_user"===e.role&&(window.location.href="/dashboard/usage")}).catch(()=>{}),L()},[L]);let R=()=>{y(null),g(o())},W=()=>{R(),d(!0)},B=()=>{d(!1),R()},J=async()=>{let e={name:f.name.trim(),proxyUrl:f.proxyUrl.trim(),noProxy:f.noProxy.trim(),isActive:!0===f.isActive,strictProxy:!0===f.strictProxy};if(e.name&&e.proxyUrl){w(!0);try{let t=!!u,r=await fetch(t?`/api/proxy-pools/${u.id}`:"/api/proxy-pools",{method:t?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.ok)await L(),B(),V.success(u?"Proxy pool updated":"Proxy pool created");else{let e=await r.json();V.error(e.error||"Failed to save proxy pool")}}catch(e){console.log("Error saving proxy pool:",e)}finally{w(!1)}}},M=async e=>{if(confirm(`Delete proxy pool "${e.name}"?`))try{let r=await fetch(`/api/proxy-pools/${e.id}`,{method:"DELETE"});if(r.ok){t(t=>t.filter(t=>t.id!==e.id)),V.success("Proxy pool deleted");return}let s=await r.json();409===r.status?V.warning(`Cannot delete: ${s.boundConnectionCount||0} connection(s) are still using this pool.`):V.error(s.error||"Failed to delete proxy pool")}catch(e){console.log("Error deleting proxy pool:",e),V.error("Failed to delete proxy pool")}},q=async e=>{E(e);try{let t=await fetch(`/api/proxy-pools/${e}/test`,{method:"POST"}),r=await t.json();if(!t.ok)return void V.error(r.error||"Failed to test proxy");await L(),V.success(r.ok?"Proxy test passed":"Proxy test failed")}catch(e){console.log("Error testing proxy pool:",e),V.error("Failed to test proxy")}finally{E(null)}},G=async e=>{let r=!e.isActive;t(t=>t.map(t=>t.id===e.id?{...t,isActive:r}:t));try{(await fetch(`/api/proxy-pools/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:r})})).ok||(t(t=>t.map(t=>t.id===e.id?{...t,isActive:e.isActive}:t)),V.error("Failed to update active state"))}catch(r){console.log("Error toggling active:",r),t(t=>t.map(t=>t.id===e.id?{...t,isActive:e.isActive}:t))}},H=e.length>0&&T.length===e.length,Q=()=>U([]),K=async t=>{let r=T.length>0?T:e.map(e=>e.id);if(0!==r.length){F(!0);try{let e=0,s=0;for(let l of r)try{(await fetch(`/api/proxy-pools/${l}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok?e+=1:s+=1}catch{s+=1}await L(),V.success(`${t?"Activated":"Deactivated"} ${e}${s?`, failed ${s}`:""}`)}finally{F(!1)}}},Y=async()=>{if(0!==T.length&&confirm(`Delete ${T.length} proxy pool(s)?`)){F(!0);try{let e=0,t=0,r=0;for(let s of T)try{let l=await fetch(`/api/proxy-pools/${s}`,{method:"DELETE"});l.ok?e+=1:409===l.status?t+=1:r+=1}catch{r+=1}await L(),Q(),V.success(`Deleted ${e}${t?`, ${t} bound`:""}${r?`, ${r} failed`:""}`)}finally{F(!1)}}},Z=async()=>{let t=T.length>0?e.filter(e=>T.includes(e.id)):e;if(0===t.length)return;I(!0),z({current:0,total:t.length});let r=0,s=[],l=0,a=[...t],i=async()=>{for(;a.length>0;){let e=a.shift();if(!e)break;try{let t=await fetch(`/api/proxy-pools/${e.id}/test`,{method:"POST"}),l=await t.json();t.ok&&l.ok?r+=1:s.push(e.id)}catch{s.push(e.id)}finally{z({current:l+=1,total:t.length})}}};if(await Promise.all(Array.from({length:Math.min(10,t.length)},i)),await L(),I(!1),z({current:0,total:0}),s.length>0&&confirm(`Alive: ${r}, Dead: ${s.length}.
2
2
 
3
3
  Disable ${s.length} dead proxies?`)){F(!0);try{for(let e of s)try{await fetch(`/api/proxy-pools/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:!1})})}catch{}await L(),V.success(`Disabled ${s.length} dead proxies`)}finally{F(!1)}}else V.success(`Health check done. Alive: ${r}, Dead: ${s.length}`)};(0,l.useEffect)(()=>{U(t=>t.filter(t=>e.some(e=>e.id===t)))},[e]);let X=()=>{$||p(!1)},ee=()=>{C||h(!1)},et=async()=>{if(b.vercelToken.trim()){S(!0);try{let e=await fetch("/api/proxy-pools/vercel-deploy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),t=await e.json();e.ok?(await L(),ee(),V.success(`Deployed: ${t.deployUrl}`)):V.error(t.error||"Deploy failed")}catch(e){console.log("Error deploying Vercel relay:",e),V.error("Deploy failed")}finally{S(!1)}}},er=async()=>{let t=v.split(/\r?\n/).map(e=>e.trim()).filter(Boolean);if(0===t.length)return void V.warning("Please paste at least one proxy line.");let r=[],s=[];if(t.forEach((e,t)=>{try{let s=(e=>{let t=e.trim();if(!t)return null;if(t.includes("://")){let e=new URL(t),r=e.port?`${e.hostname}:${e.port}`:e.hostname;return{proxyUrl:e.toString(),name:`Imported ${r}`}}let r=t.split(":");if(4===r.length){let[e,t,s,l]=r;if(!e||!t||!s||!l)throw Error("Invalid host:port:user:pass format");return{proxyUrl:new URL(`http://${encodeURIComponent(s)}:${encodeURIComponent(l)}@${e}:${t}`).toString(),name:`Imported ${e}:${t}`}}throw Error("Unsupported format")})(e);s&&r.push({...s,lineNumber:t+1})}catch(e){s.push(`Line ${t+1}: ${e.message}`)}}),s.length>0)return void V.error(`Invalid proxy format:
4
- ${s.join("\n")}`);P(!0);try{let t=new Set(e.map(e=>`${(e.proxyUrl||"").trim()}|||${(e.noProxy||"").trim()}`)),s=0,l=0,a=0;for(let e of r){let r=`${e.proxyUrl}|||`;if(t.has(r)){l+=1;continue}(await fetch("/api/proxy-pools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,proxyUrl:e.proxyUrl,noProxy:"",isActive:!0})})).ok?(s+=1,t.add(r)):a+=1}await L(),p(!1),V.success(`Batch import completed: Created ${s}, Skipped ${l}, Failed ${a}`)}catch(e){console.log("Error batch importing proxies:",e),V.error("Batch import failed")}finally{P(!1)}},es=(0,l.useMemo)(()=>e.filter(e=>!0===e.isActive).length,[e]);return r?(0,s.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:gap-6 sm:px-0",children:[(0,s.jsx)(a.Qv,{}),(0,s.jsx)(a.Qv,{})]}):(0,s.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:gap-6 sm:px-0",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold sm:text-2xl",children:"Proxy Pools"}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Manage reusable per-connection proxies and bind them to provider connections."})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,s.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"cloud_upload",onClick:()=>{k({vercelToken:"",projectName:"vercel-relay"}),h(!0)},children:"Vercel Relay"}),(0,s.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"upload",onClick:()=>{j(""),p(!0)},children:"Batch Import"}),(0,s.jsx)(a.$n,{size:"sm",icon:"add",onClick:W,children:"Add Proxy Pool"})]})]}),(0,s.jsxs)(a.Zp,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[e.length>0&&(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:H,onChange:()=>U(H?[]:e.map(e=>e.id)),className:"size-4 rounded border-black/20 dark:border-white/20"}),H?"Unselect all":"Select all"]}),(0,s.jsxs)(a.Ex,{variant:"default",children:["Total: ",e.length]}),(0,s.jsxs)(a.Ex,{variant:"success",children:["Active: ",es]})]}),(T.length>0||D)&&(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2 rounded-lg border border-primary/30 bg-primary/5 px-3 py-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"checklist"}),(0,s.jsx)("span",{className:"text-xs font-medium text-primary",children:T.length>0?`${T.length} selected`:"All pools"}),(0,s.jsxs)("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[(0,s.jsx)(a.$n,{size:"sm",icon:D?"progress_activity":"health_and_safety",onClick:Z,disabled:D||_||0===e.length,children:D?`Checking ${O.current}/${O.total}`:"Health Check"}),T.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"toggle_on",onClick:()=>K(!0),disabled:_||D,children:"Activate"}),(0,s.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"toggle_off",onClick:()=>K(!1),disabled:_||D,children:"Deactivate"}),(0,s.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:Y,disabled:_||D,children:"Delete"}),(0,s.jsx)(a.$n,{size:"sm",variant:"ghost",onClick:Q,disabled:_||D,children:"Clear"})]})]})]}),0===e.length?(0,s.jsxs)("div",{className:"text-center py-10",children:[(0,s.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No proxy pool entries yet"}),(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create a proxy pool entry, then assign it to connections."}),(0,s.jsx)(a.$n,{icon:"add",onClick:W,children:"Add Proxy Pool"})]}):(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.04] dark:divide-white/[0.05]",children:e.map(e=>{var t;return(0,s.jsxs)("div",{className:"flex flex-col gap-3 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[(0,s.jsx)("input",{type:"checkbox",checked:T.includes(e.id),onChange:()=>{let t;return t=e.id,U(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"mt-1 size-4 shrink-0 rounded border-black/20 dark:border-white/20"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("p",{className:"min-w-0 max-w-full truncate text-sm font-medium sm:max-w-[18rem]",children:e.name}),(0,s.jsx)(a.Ex,{variant:"active"===(t=e.testStatus)?"success":"error"===t?"error":"default",size:"sm",dot:!0,children:e.testStatus||"unknown"}),(0,s.jsx)(a.Ex,{variant:e.isActive?"success":"default",size:"sm",children:e.isActive?"active":"inactive"}),"vercel"===e.type&&(0,s.jsx)(a.Ex,{variant:"default",size:"sm",children:"vercel relay"}),(0,s.jsxs)(a.Ex,{variant:"default",size:"sm",children:[e.boundConnectionCount||0," bound"]})]}),(0,s.jsx)("p",{className:"text-xs text-text-muted truncate mt-1",children:e.proxyUrl}),e.noProxy?(0,s.jsxs)("p",{className:"text-xs text-text-muted truncate",children:["No proxy: ",e.noProxy]}):null,(0,s.jsxs)("p",{className:"text-[11px] text-text-muted mt-1",children:["Last tested: ",function(e){if(!e)return"Never";let t=new Date(e);return Number.isNaN(t.getTime())?"Never":t.toLocaleString()}(e.lastTestedAt),e.lastError?` \xb7 ${e.lastError}`:""]})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,s.jsx)(a.lM,{size:"sm",checked:!0===e.isActive,onChange:()=>G(e),title:e.isActive?"Disable":"Enable"}),(0,s.jsx)("button",{onClick:()=>q(e.id),className:"p-2 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",title:"Test proxy",disabled:A===e.id,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:A===e.id?{animation:"spin 1s linear infinite"}:void 0,children:A===e.id?"progress_activity":"science"})}),(0,s.jsx)("button",{onClick:()=>{y(e),g(o(e)),d(!0)},className:"p-2 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",title:"Edit",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,s.jsx)("button",{onClick:()=>M(e),className:"p-2 rounded hover:bg-red-500/10 text-red-500",title:"Delete",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,s.jsx)(a.aF,{isOpen:x,title:"Batch Import Proxies",onClose:X,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-sm font-medium text-text-main mb-1 block",children:"Paste Proxy List (One per line)"}),(0,s.jsx)("textarea",{value:v,onChange:e=>j(e.target.value),placeholder:"http://user:pass@127.0.0.1:7897\n127.0.0.1:7897:user:pass",className:"w-full min-h-[180px] py-2 px-3 text-sm text-text-main bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none transition-all"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Supported formats: protocol://user:pass@host:port, host:port:user:pass"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,s.jsx)(a.$n,{fullWidth:!0,onClick:er,disabled:!v.trim()||$,children:$?"Importing...":"Import"}),(0,s.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:X,disabled:$,children:"Cancel"})]})]})}),(0,s.jsx)(a.aF,{isOpen:m,title:"Deploy Vercel Relay",onClose:ee,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"rounded-lg bg-blue-500/5 border border-blue-500/10 p-3 flex flex-col gap-1.5",children:[(0,s.jsx)("p",{className:"text-sm text-text-main font-medium",children:"What is Vercel Relay?"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Deploys an edge relay function to Vercel. All AI provider requests will be forwarded through Vercel's edge network, masking your real IP from providers."}),(0,s.jsxs)("ul",{className:"text-xs text-text-muted list-disc pl-4 space-y-0.5",children:[(0,s.jsx)("li",{children:"Your IP is replaced by Vercel's dynamic edge IPs (hundreds of IPs across 20+ global regions)"}),(0,s.jsx)("li",{children:"Vercel serves millions of apps — providers can't block Vercel IPs without affecting legitimate traffic"}),(0,s.jsx)("li",{children:"Free tier: 100GB bandwidth/month, 500K edge invocations"}),(0,s.jsx)("li",{children:"Deploy multiple relays on different accounts for more IP diversity"})]})]}),(0,s.jsx)(a.pd,{label:"Vercel API Token",value:b.vercelToken,onChange:e=>k(t=>({...t,vercelToken:e.target.value})),placeholder:"your-vercel-api-token",hint:(0,s.jsxs)(s.Fragment,{children:["Token is used once for deployment and not stored. ",(0,s.jsx)("a",{href:"https://vercel.com/account/tokens",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Get token →"})]}),type:"password"}),(0,s.jsx)(a.pd,{label:"Project Name",value:b.projectName,onChange:e=>k(t=>({...t,projectName:e.target.value})),placeholder:"my-relay",hint:"Unique name for your Vercel project. Leave empty for auto-generated name."}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,s.jsx)(a.$n,{fullWidth:!0,onClick:et,disabled:!b.vercelToken.trim()||C,children:C?"Deploying... (may take ~1 min)":"Deploy"}),(0,s.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:ee,disabled:C,children:"Cancel"})]})]})}),(0,s.jsx)(a.aF,{isOpen:c,title:u?"Edit Proxy Pool":"Add Proxy Pool",onClose:B,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(a.pd,{label:"Name",value:f.name,onChange:e=>g(t=>({...t,name:e.target.value})),placeholder:"Office Proxy"}),(0,s.jsx)(a.pd,{label:"Proxy URL",value:f.proxyUrl,onChange:e=>g(t=>({...t,proxyUrl:e.target.value})),placeholder:"http://127.0.0.1:7897"}),(0,s.jsx)(a.pd,{label:"No Proxy",value:f.noProxy,onChange:e=>g(t=>({...t,noProxy:e.target.value})),placeholder:"localhost,127.0.0.1,.internal",hint:"Comma-separated hosts/domains to bypass proxy"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border/50 p-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium text-sm",children:"Active"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Inactive pools are ignored by runtime resolution."})]}),(0,s.jsx)(a.lM,{checked:!0===f.isActive,onChange:()=>g(e=>({...e,isActive:!e.isActive})),disabled:N})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border/50 p-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium text-sm",children:"Strict Proxy"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Fail request if proxy is unreachable instead of falling back to direct."})]}),(0,s.jsx)(a.lM,{checked:!0===f.strictProxy,onChange:()=>g(e=>({...e,strictProxy:!e.strictProxy})),disabled:N})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,s.jsx)(a.$n,{fullWidth:!0,onClick:J,disabled:!f.name.trim()||!f.proxyUrl.trim()||N,children:N?"Saving...":"Save"}),(0,s.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:B,disabled:N,children:"Cancel"})]})]})})]})}}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=55385)),_N_E=e.O()}]);
4
+ ${s.join("\n")}`);P(!0);try{let t=new Set(e.map(e=>`${(e.proxyUrl||"").trim()}|||${(e.noProxy||"").trim()}`)),s=0,l=0,a=0;for(let e of r){let r=`${e.proxyUrl}|||`;if(t.has(r)){l+=1;continue}(await fetch("/api/proxy-pools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,proxyUrl:e.proxyUrl,noProxy:"",isActive:!0})})).ok?(s+=1,t.add(r)):a+=1}await L(),p(!1),V.success(`Batch import completed: Created ${s}, Skipped ${l}, Failed ${a}`)}catch(e){console.log("Error batch importing proxies:",e),V.error("Batch import failed")}finally{P(!1)}},es=(0,l.useMemo)(()=>e.filter(e=>!0===e.isActive).length,[e]);return r?(0,s.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:gap-6 sm:px-0",children:[(0,s.jsx)(a.Qv,{}),(0,s.jsx)(a.Qv,{})]}):(0,s.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:gap-6 sm:px-0",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold sm:text-2xl",children:"Proxy Pools"}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Manage reusable per-connection proxies and bind them to provider connections."})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,s.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"cloud_upload",onClick:()=>{k({vercelToken:"",projectName:"vercel-relay"}),h(!0)},children:"Vercel Relay"}),(0,s.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"upload",onClick:()=>{j(""),p(!0)},children:"Batch Import"}),(0,s.jsx)(a.$n,{size:"sm",icon:"add",onClick:W,children:"Add Proxy Pool"})]})]}),(0,s.jsxs)(a.Zp,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[e.length>0&&(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:H,onChange:()=>U(H?[]:e.map(e=>e.id)),className:"size-4 rounded border-black/20 dark:border-white/20"}),H?"Unselect all":"Select all"]}),(0,s.jsxs)(a.Ex,{variant:"default",children:["Total: ",e.length]}),(0,s.jsxs)(a.Ex,{variant:"success",children:["Active: ",es]})]}),(T.length>0||D)&&(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2 rounded-lg border border-primary/30 bg-primary/5 px-3 py-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"checklist"}),(0,s.jsx)("span",{className:"text-xs font-medium text-primary",children:T.length>0?`${T.length} selected`:"All pools"}),(0,s.jsxs)("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[(0,s.jsx)(a.$n,{size:"sm",icon:D?"progress_activity":"health_and_safety",onClick:Z,disabled:D||_||0===e.length,children:D?`Checking ${O.current}/${O.total}`:"Health Check"}),T.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"toggle_on",onClick:()=>K(!0),disabled:_||D,children:"Activate"}),(0,s.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"toggle_off",onClick:()=>K(!1),disabled:_||D,children:"Deactivate"}),(0,s.jsx)(a.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:Y,disabled:_||D,children:"Delete"}),(0,s.jsx)(a.$n,{size:"sm",variant:"ghost",onClick:Q,disabled:_||D,children:"Clear"})]})]})]}),0===e.length?(0,s.jsxs)("div",{className:"text-center py-10",children:[(0,s.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No proxy pool entries yet"}),(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create a proxy pool entry, then assign it to connections."}),(0,s.jsx)(a.$n,{icon:"add",onClick:W,children:"Add Proxy Pool"})]}):(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.04] dark:divide-white/[0.05]",children:e.map(e=>{var t;return(0,s.jsxs)("div",{className:"flex flex-col gap-3 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[(0,s.jsx)("input",{type:"checkbox",checked:T.includes(e.id),onChange:()=>{let t;return t=e.id,U(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"mt-1 size-4 shrink-0 rounded border-black/20 dark:border-white/20"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("p",{className:"min-w-0 max-w-full truncate text-sm font-medium sm:max-w-[18rem]",children:e.name}),(0,s.jsx)(a.Ex,{variant:"active"===(t=e.testStatus)?"success":"error"===t?"error":"default",size:"sm",dot:!0,children:e.testStatus||"unknown"}),(0,s.jsx)(a.Ex,{variant:e.isActive?"success":"default",size:"sm",children:e.isActive?"active":"inactive"}),"vercel"===e.type&&(0,s.jsx)(a.Ex,{variant:"default",size:"sm",children:"vercel relay"}),(0,s.jsxs)(a.Ex,{variant:"default",size:"sm",children:[e.boundConnectionCount||0," bound"]})]}),(0,s.jsx)("p",{className:"text-xs text-text-muted truncate mt-1",children:e.proxyUrl}),e.noProxy?(0,s.jsxs)("p",{className:"text-xs text-text-muted truncate",children:["No proxy: ",e.noProxy]}):null,(0,s.jsxs)("p",{className:"text-[11px] text-text-muted mt-1",children:["Last tested: ",function(e){if(!e)return"Never";let t=new Date(e);return Number.isNaN(t.getTime())?"Never":t.toLocaleString()}(e.lastTestedAt),e.lastError?` \xb7 ${e.lastError}`:""]})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,s.jsx)(a.lM,{size:"sm",checked:!0===e.isActive,onChange:()=>G(e),title:e.isActive?"Disable":"Enable"}),(0,s.jsx)("button",{onClick:()=>q(e.id),className:"p-2 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",title:"Test proxy",disabled:A===e.id,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:A===e.id?{animation:"spin 1s linear infinite"}:void 0,children:A===e.id?"progress_activity":"science"})}),(0,s.jsx)("button",{onClick:()=>{y(e),g(o(e)),d(!0)},className:"p-2 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",title:"Edit",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,s.jsx)("button",{onClick:()=>M(e),className:"p-2 rounded hover:bg-red-500/10 text-red-500",title:"Delete",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,s.jsx)(a.aF,{isOpen:x,title:"Batch Import Proxies",onClose:X,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-sm font-medium text-text-main mb-1 block",children:"Paste Proxy List (One per line)"}),(0,s.jsx)("textarea",{value:v,onChange:e=>j(e.target.value),placeholder:"http://user:pass@127.0.0.1:7897\n127.0.0.1:7897:user:pass",className:"w-full min-h-[180px] py-2 px-3 text-sm text-text-main bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none transition-all"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Supported formats: protocol://user:pass@host:port, host:port:user:pass"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,s.jsx)(a.$n,{fullWidth:!0,onClick:er,disabled:!v.trim()||$,children:$?"Importing...":"Import"}),(0,s.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:X,disabled:$,children:"Cancel"})]})]})}),(0,s.jsx)(a.aF,{isOpen:m,title:"Deploy Vercel Relay",onClose:ee,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"rounded-lg bg-blue-500/5 border border-blue-500/10 p-3 flex flex-col gap-1.5",children:[(0,s.jsx)("p",{className:"text-sm text-text-main font-medium",children:"What is Vercel Relay?"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Deploys an edge relay function to Vercel. All AI provider requests will be forwarded through Vercel's edge network, masking your real IP from providers."}),(0,s.jsxs)("ul",{className:"text-xs text-text-muted list-disc pl-4 space-y-0.5",children:[(0,s.jsx)("li",{children:"Your IP is replaced by Vercel's dynamic edge IPs (hundreds of IPs across 20+ global regions)"}),(0,s.jsx)("li",{children:"Vercel serves millions of apps — providers can't block Vercel IPs without affecting legitimate traffic"}),(0,s.jsx)("li",{children:"Free tier: 100GB bandwidth/month, 500K edge invocations"}),(0,s.jsx)("li",{children:"Deploy multiple relays on different accounts for more IP diversity"})]})]}),(0,s.jsx)(a.pd,{label:"Vercel API Token",value:b.vercelToken,onChange:e=>k(t=>({...t,vercelToken:e.target.value})),placeholder:"your-vercel-api-token",hint:(0,s.jsxs)(s.Fragment,{children:["Token is used once for deployment and not stored. ",(0,s.jsx)("a",{href:"https://vercel.com/account/tokens",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Get token →"})]}),type:"password"}),(0,s.jsx)(a.pd,{label:"Project Name",value:b.projectName,onChange:e=>k(t=>({...t,projectName:e.target.value})),placeholder:"my-relay",hint:"Unique name for your Vercel project. Leave empty for auto-generated name."}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,s.jsx)(a.$n,{fullWidth:!0,onClick:et,disabled:!b.vercelToken.trim()||C,children:C?"Deploying... (may take ~1 min)":"Deploy"}),(0,s.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:ee,disabled:C,children:"Cancel"})]})]})}),(0,s.jsx)(a.aF,{isOpen:c,title:u?"Edit Proxy Pool":"Add Proxy Pool",onClose:B,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(a.pd,{label:"Name",value:f.name,onChange:e=>g(t=>({...t,name:e.target.value})),placeholder:"Office Proxy"}),(0,s.jsx)(a.pd,{label:"Proxy URL",value:f.proxyUrl,onChange:e=>g(t=>({...t,proxyUrl:e.target.value})),placeholder:"http://127.0.0.1:7897"}),(0,s.jsx)(a.pd,{label:"No Proxy",value:f.noProxy,onChange:e=>g(t=>({...t,noProxy:e.target.value})),placeholder:"localhost,127.0.0.1,.internal",hint:"Comma-separated hosts/domains to bypass proxy"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border/50 p-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium text-sm",children:"Active"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Inactive pools are ignored by runtime resolution."})]}),(0,s.jsx)(a.lM,{checked:!0===f.isActive,onChange:()=>g(e=>({...e,isActive:!e.isActive})),disabled:N})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border/50 p-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium text-sm",children:"Strict Proxy"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Fail request if proxy is unreachable instead of falling back to direct."})]}),(0,s.jsx)(a.lM,{checked:!0===f.strictProxy,onChange:()=>g(e=>({...e,strictProxy:!e.strictProxy})),disabled:N})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,s.jsx)(a.$n,{fullWidth:!0,onClick:J,disabled:!f.name.trim()||!f.proxyUrl.trim()||N,children:N?"Saving...":"Save"}),(0,s.jsx)(a.$n,{fullWidth:!0,variant:"ghost",onClick:B,disabled:N,children:"Cancel"})]})]})})]})}}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=22248)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{18042:(e,r,o)=>{"use strict";o.r(r),o.d(r,{default:()=>t});var a=o(95155),n=o(12115),s=o(25086),l=o(75095);function t(){return(0,a.jsx)(n.Suspense,{fallback:(0,a.jsx)(s.CardSkeleton,{}),children:(0,a.jsx)(u,{})})}function u(){let[e,r]=(0,n.useState)({loading:!0,role:null,showQuotaTracker:!0});return((0,n.useEffect)(()=>{let e=!1;return fetch("/api/auth/me",{cache:"no-store"}).then(e=>e.json()).then(o=>{if(!e){if("sub_user"===o.role&&!1===o.showQuotaTracker){window.location.href="/dashboard/user";return}r({loading:!1,role:o.role||null,showQuotaTracker:!1!==o.showQuotaTracker})}}).catch(()=>{e||r({loading:!1,role:null,showQuotaTracker:!0})}),()=>{e=!0}},[]),e.loading)?(0,a.jsx)(s.CardSkeleton,{}):(0,a.jsx)(l.A,{readOnly:"sub_user"===e.role})}},68895:(e,r,o)=>{Promise.resolve().then(o.bind(o,18042))}},e=>{e.O(0,[2574,3862,1051,1321,5497,5095,8441,3794,7358],()=>e(e.s=68895)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{18042:(e,r,o)=>{"use strict";o.r(r),o.d(r,{default:()=>t});var a=o(95155),l=o(12115),s=o(25086),n=o(75095);function t(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(s.CardSkeleton,{}),children:(0,a.jsx)(u,{})})}function u(){let[e,r]=(0,l.useState)({loading:!0,role:null,showQuotaTracker:!0});return((0,l.useEffect)(()=>{let e=!1;return fetch("/api/auth/me",{cache:"no-store"}).then(e=>e.json()).then(o=>{if(!e){if("sub_user"===o.role&&!1===o.showQuotaTracker){window.location.href="/dashboard/user";return}r({loading:!1,role:o.role||null,showQuotaTracker:!1!==o.showQuotaTracker})}}).catch(()=>{e||r({loading:!1,role:null,showQuotaTracker:!0})}),()=>{e=!0}},[]),e.loading)?(0,a.jsx)(s.CardSkeleton,{}):(0,a.jsx)(n.A,{readOnly:"sub_user"===e.role,allowCodexActivation:"sub_user"===e.role})}},61034:(e,r,o)=>{Promise.resolve().then(o.bind(o,18042))}},e=>{e.O(0,[2574,3862,1051,1321,5497,5095,8441,3794,7358],()=>e(e.s=61034)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9516],{24604:(e,t,i)=>{Promise.resolve().then(i.bind(i,64082))},64082:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>b});var s=i(95155),r=i(35497),n=i(11059);let a="decolua/9router",o="master",c="skills",d=`https://github.com/${a}`,l=`https://raw.githubusercontent.com/${a}/refs/heads/${o}/${c}`,m=`https://github.com/${a}/blob/${o}/${c}`,x=[{id:"9router",name:"OpenrouterX (Entry)",description:"Setup + index of all capabilities. Start here — covers base URL, auth, model discovery, and links to every capability skill.",endpoint:null,icon:"hub",isEntry:!0},{id:"9router-chat",name:"Chat",description:"Chat / code-gen via OpenAI or Anthropic format with streaming.",endpoint:"/v1/chat/completions",icon:"chat"},{id:"9router-image",name:"Image Generation",description:"Text-to-image via DALL-E, Imagen, FLUX, MiniMax, SDWebUI…",endpoint:"/v1/images/generations",icon:"image"},{id:"9router-tts",name:"Text-to-Speech",description:"OpenAI / ElevenLabs / Edge / Google / Deepgram voices.",endpoint:"/v1/audio/speech",icon:"record_voice_over"},{id:"9router-stt",name:"Speech-to-Text",description:"Transcribe audio via OpenAI Whisper, Groq, Gemini, Deepgram, AssemblyAI…",endpoint:"/v1/audio/transcriptions",icon:"mic"},{id:"9router-embeddings",name:"Embeddings",description:"Vectors for RAG / semantic search via OpenAI, Gemini, Mistral…",endpoint:"/v1/embeddings",icon:"scatter_plot"},{id:"9router-web-search",name:"Web Search",description:"Tavily / Exa / Brave / Serper / SearXNG / Google PSE / You.com.",endpoint:"/v1/search",icon:"search"},{id:"9router-web-fetch",name:"Web Fetch",description:"URL → markdown / text / HTML via Firecrawl, Jina, Tavily, Exa.",endpoint:"/v1/web/fetch",icon:"language"}];function p(e){return`${l}/${e}/SKILL.md`}function h({value:e,label:t="Copy link"}){let{copied:i,copy:r}=(0,n.C)(2e3);return(0,s.jsxs)("button",{onClick:()=>r(e),className:"px-2 py-1 rounded-md bg-primary text-white text-[11px] font-medium hover:bg-primary/90 transition-colors cursor-pointer shrink-0 inline-flex items-center gap-1",title:e,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:i?"check":"content_copy"}),i?"Copied!":t]})}function u({skill:e}){var t;let i=p(e.id);return(0,s.jsxs)("div",{className:`flex items-start gap-3 p-4 rounded-[14px] border shadow-[var(--shadow-soft)] transition-colors ${e.isEntry?"border-brand-500/40 bg-brand-500/5":"border-border-subtle bg-surface hover:bg-surface-2"}`,children:[(0,s.jsx)("div",{className:`size-9 rounded-lg flex items-center justify-center shrink-0 ${e.isEntry?"bg-primary text-white":"bg-primary/10 text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e.icon})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("h3",{className:"font-semibold text-sm text-text-main",children:e.name}),e.isEntry&&(0,s.jsx)(r.Ex,{variant:"primary",size:"sm",children:"START HERE"}),e.endpoint&&(0,s.jsx)(r.Ex,{variant:"default",size:"sm",children:(0,s.jsx)("code",{className:"text-[10px]",children:e.endpoint})})]}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:e.description}),(0,s.jsxs)("a",{href:(t=e.id,`${m}/${t}/SKILL.md`),target:"_blank",rel:"noreferrer",className:"text-[11px] text-text-muted hover:text-primary mt-1 inline-flex items-center gap-1 break-all",children:[i,(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"})]})]}),(0,s.jsx)(h,{value:i})]})}function b(){return(0,s.jsxs)("div",{className:"max-w-4xl mx-auto space-y-6",children:[(0,s.jsxs)(r.Zp,{padding:"md",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted mb-2",children:"Paste this to your AI:"}),(0,s.jsxs)("div",{className:"px-3 py-2 rounded bg-surface-2 font-mono text-[12px] text-text-main",children:["Read this skill and use it: ",p("9router")]})]}),(0,s.jsx)("div",{className:"space-y-2",children:x.map(e=>(0,s.jsx)(u,{skill:e},e.id))}),(0,s.jsx)(r.Zp,{padding:"md",children:(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"More on GitHub"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Browse source, README, and examples."})]}),(0,s.jsxs)("a",{href:`${d}/tree/master/skills`,target:"_blank",rel:"noreferrer",className:"text-sm text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"open_in_new"}),"View on GitHub"]})]})})]})}}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=24604)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,318,335,342,387,501,516,543,552,675,747,748,907,931,948,992,997,1070,1088,1110,1118,1157,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1907,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4612,4656,4674,4761,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5637,5685,5745,5922,6091,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7473,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8506,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{81772:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>N});var a=s(95155),l=s(12115),n=s(73321),r=s(35497),i=s(84588),d=s(92542),o=s(31474);function c({isOpen:e,onClose:t,title:s,children:n,width:r="md",className:i}){let d={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-[2px] fade-in cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,o.cn)("absolute right-0 top-0 h-full bg-surface flex flex-col","shadow-[var(--shadow-elev)]","slide-in-right","border-l border-border-subtle",d[r]||d.md,i),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle 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-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main 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 custom-scrollbar",children:n})]})]}):null}function x({currentPage:e,pageSize:t,totalItems:s,onPageChange:l,onPageSizeChange:n,className:r}){let i=Math.ceil(s/t),c=s>0?(e-1)*t+1:0,m=Math.min(e*t,s),h=(()=>{let t=[],s=Math.max(1,e-2),a=Math.min(i,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,o.cn)("flex flex-col sm:flex-row items-center justify-between gap-4 py-4",r),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:c})," 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:[n&&(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=>n(Number(e.target.value)),className:(0,o.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"),style:{colorScheme:"auto"},children:[10,20,50].map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]}),i>1&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>l(e-1),disabled:1===e,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_left"})}),h[0]>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.default,{variant:"ghost",size:"sm",onClick:()=>l(1),className:"w-9 px-0",children:"1"}),h[0]>2&&(0,a.jsx)("span",{className:"text-text-muted px-1",children:"..."})]}),h.map(t=>(0,a.jsx)(d.default,{variant:e===t?"primary":"ghost",size:"sm",onClick:()=>l(t),className:"w-9 px-0",children:t},t)),h[h.length-1]<i&&(0,a.jsxs)(a.Fragment,{children:[h[h.length-1]<i-1&&(0,a.jsx)("span",{className:"text-text-muted px-1",children:"..."}),(0,a.jsx)(d.default,{variant:"ghost",size:"sm",onClick:()=>l(i),className:"w-9 px-0",children:i})]}),(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>l(e+1),disabled:e===i,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"})})]})]})]})}var m=s(52679);let h=null,p=null;async function u(){if(h&&p)return{providerNameCache:h,providerNodesCache:p};let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[];for(let e of(p={},t))p[e.id]=e.name;return{providerNameCache:h={...m.Q2,...p},providerNodesCache:p}}function f(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,m.zt)(e)||m.Q2[e];return a?.name||e}function b({title:e,children:t,defaultOpen:s=!1,icon:n=null}){let[r,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(!r),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:[n&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:n}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,o.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",r?"rotate-90":""),children:"chevron_right"})]}),r&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function j(e){let t=e?.prompt_tokens||e?.input_tokens||0,s=e?.cached_tokens||e?.cache_read_input_tokens||0;return t<s?s:t}function g(){let[e,t]=(0,l.useState)([]),[s,n]=(0,l.useState)({page:1,pageSize:20,totalItems:0,totalPages:0}),[r,m]=(0,l.useState)(!1),[h,p]=(0,l.useState)(null),[g,v]=(0,l.useState)(!1),[N,w]=(0,l.useState)([]),[k,y]=(0,l.useState)(null),[S,C]=(0,l.useState)({apiKeyId:"",startDate:"",endDate:""}),D=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/usage/api-keys"),t=await e.json();w(t.apiKeys||[]);let s=await u();y(s.providerNameCache)}catch(e){console.error("Failed to fetch api keys:",e)}},[]),z=(0,l.useCallback)(async()=>{m(!0);try{let e=new URLSearchParams({page:s.page.toString(),pageSize:s.pageSize.toString()});S.apiKeyId&&e.append("apiKeyId",S.apiKeyId),S.startDate&&e.append("startDate",S.startDate),S.endDate&&e.append("endDate",S.endDate);let a=await fetch(`/api/usage/request-details?${e}`),l=await a.json();t(l.details||[]),n(e=>({...e,...l.pagination}))}catch(e){console.error("Failed to fetch request details:",e)}finally{m(!1)}},[s.page,s.pageSize,S]);return(0,l.useEffect)(()=>{D()},[D]),(0,l.useEffect)(()=>{z()},[z]),(0,a.jsxs)("div",{className:"flex min-w-0 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:"apikey-filter",className:"text-sm font-medium text-text-main",children:"API Key"}),(0,a.jsxs)("select",{id:"apikey-filter",value:S.apiKeyId,onChange:e=>C({...S,apiKeyId:e.target.value}),className:(0,o.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","w-full min-w-0 cursor-pointer"),style:{colorScheme:"auto"},children:[(0,a.jsx)("option",{value:"",children:"All Keys"}),N.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"start-date-filter",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"start-date-filter",type:"datetime-local",value:S.startDate,onChange:e=>C({...S,startDate:e.target.value}),className:(0,o.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"end-date-filter",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"end-date-filter",type:"datetime-local",value:S.endDate,onChange:e=>C({...S,endDate:e.target.value}),className:(0,o.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:col-span-2 lg:col-span-1",children:[(0,a.jsx)("span",{className:"hidden text-sm font-medium text-text-main opacity-0 lg:block","aria-hidden":"true",children:"Clear"}),(0,a.jsx)(d.default,{variant:"ghost",onClick:()=>{C({apiKeyId:"",startDate:"",endDate:""})},disabled:!S.apiKeyId&&!S.startDate&&!S.endDate,children:"Clear Filters"})]})]})}),(0,a.jsxs)(i.default,{padding:"none",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[880px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5",children:[(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Timestamp"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Model"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Provider"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Input Tokens"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Output Tokens"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Latency"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Action"})]})}),(0,a.jsx)("tbody",{children:r?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading..."]})})}):0===e.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:"No request details found"})}):e.map((e,t)=>(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 last:border-b-0 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:"whitespace-nowrap p-4 text-sm text-text-main",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"max-w-[260px] truncate p-4 font-mono text-sm text-text-main",children:e.model}),(0,a.jsx)("td",{className:"max-w-[180px] truncate p-4 text-sm text-text-main",children:(0,a.jsx)("span",{className:"font-medium",children:f(e.provider,k)})}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:j(e.tokens).toLocaleString()}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:e.tokens?.completion_tokens?.toLocaleString()||0}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-muted",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("div",{children:["TTFT: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.ttft||0,"ms"]})]}),(0,a.jsxs)("div",{children:["Total: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.total||0,"ms"]})]})]})}),(0,a.jsx)("td",{className:"p-4 text-center",children:(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>{p(e),v(!0)},children:"Detail"})})]},`${e.id}-${t}`))})]})}),!r&&e.length>0&&(0,a.jsx)("div",{className:"border-t border-black/5 dark:border-white/5",children:(0,a.jsx)(x,{currentPage:s.page,pageSize:s.pageSize,totalItems:s.totalItems,onPageChange:e=>{n(t=>({...t,page:e}))},onPageSizeChange:e=>{n(t=>({...t,pageSize:e,page:1}))}})})]}),(0,a.jsx)(c,{isOpen:g,onClose:()=>v(!1),title:"Request Details",width:"lg",children:h&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-4 text-sm sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"ID:"})," ",(0,a.jsx)("span",{className:"break-all font-mono text-text-main",children:h.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:new Date(h.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"})," ",(0,a.jsx)("span",{className:"text-text-main font-medium",children:f(h.provider,k)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:h.model})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"})," ",(0,a.jsx)("span",{className:(0,o.cn)("font-medium","success"===h.status?"text-green-600":"text-red-600"),children:h.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"})," ",(0,a.jsxs)("span",{className:"text-text-main font-mono",children:["TTFT ",h.latency?.ttft||0,"ms / Total ",h.latency?.total||0,"ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:j(h.tokens).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:h.tokens?.completion_tokens?.toLocaleString()||0})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(b,{title:"1. Client Request (Input)",defaultOpen:!0,icon:"input",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(h.request,null,2)})}),h.providerRequest&&(0,a.jsx)(b,{title:"2. Provider Request (Translated)",icon:"translate",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(h.providerRequest,null,2)})}),h.providerResponse&&(0,a.jsx)(b,{title:"3. Provider Response (Raw)",icon:"data_object",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:"object"==typeof h.providerResponse?JSON.stringify(h.providerResponse,null,2):h.providerResponse})}),(0,a.jsxs)(b,{title:"4. Client Response (Final)",defaultOpen:!0,icon:"output",children:[h.response?.thinking&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"font-semibold text-text-main mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"psychology"}),"Thinking Process"]}),(0,a.jsx)("pre",{className:"max-h-[200px] max-w-full overflow-auto rounded-lg border border-amber-200 bg-amber-50 p-3 font-mono text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100 sm:p-4",children:h.response.thinking})]}),(0,a.jsx)("h4",{className:"font-semibold text-text-main mb-2 text-xs uppercase tracking-wide opacity-70",children:"Content"}),(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:h.response?.content||"[No content]"})]})]})]})})]})}let v=[{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function N(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(w,{})})}function w(){let e=(0,n.useSearchParams)(),t=(0,n.useRouter)(),[s,i]=(0,l.useState)(!1),[d,o]=(0,l.useState)("24h"),c=e.get("tab"),x=c&&["overview","logs","details"].includes(c)?c:"overview";return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)(r.Iz,{options:[{value:"overview",label:"Overview"},{value:"details",label:"Details"}],value:x,onChange:s=>{if(s===x)return;i(!0);let a=new URLSearchParams(e);a.set("tab",s),t.push(`/dashboard/usage?${a.toString()}`,{scroll:!1}),setTimeout(()=>i(!1),300)},className:"w-full sm:w-auto"}),"overview"===x&&(0,a.jsx)(r.Iz,{options:v,value:d,onChange:o,size:"sm",className:"w-full sm:w-auto"})]}),s?(0,a.jsx)(r.Qv,{}):(0,a.jsxs)(a.Fragment,{children:["overview"===x&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(r.jK,{period:d,setPeriod:o,hidePeriodSelector:!0})}),"logs"===x&&(0,a.jsx)(r.gM,{}),"details"===x&&(0,a.jsx)(g,{})]})]})}},94828:(e,t,s)=>{Promise.resolve().then(s.bind(s,81772))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=94828)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{81772:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>N});var a=s(95155),l=s(12115),n=s(73321),r=s(35497),i=s(84588),d=s(92542),o=s(31474);function c({isOpen:e,onClose:t,title:s,children:n,width:r="md",className:i}){let d={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-[2px] fade-in cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,o.cn)("absolute right-0 top-0 h-full bg-surface flex flex-col","shadow-[var(--shadow-elev)]","slide-in-right","border-l border-border-subtle",d[r]||d.md,i),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle 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-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main 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 custom-scrollbar",children:n})]})]}):null}function x({currentPage:e,pageSize:t,totalItems:s,onPageChange:l,onPageSizeChange:n,className:r}){let i=Math.ceil(s/t),c=s>0?(e-1)*t+1:0,m=Math.min(e*t,s),h=(()=>{let t=[],s=Math.max(1,e-2),a=Math.min(i,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,o.cn)("flex flex-col sm:flex-row items-center justify-between gap-4 py-4",r),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:c})," 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:[n&&(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=>n(Number(e.target.value)),className:(0,o.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"),style:{colorScheme:"auto"},children:[10,20,50].map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]}),i>1&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>l(e-1),disabled:1===e,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_left"})}),h[0]>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.default,{variant:"ghost",size:"sm",onClick:()=>l(1),className:"w-9 px-0",children:"1"}),h[0]>2&&(0,a.jsx)("span",{className:"text-text-muted px-1",children:"..."})]}),h.map(t=>(0,a.jsx)(d.default,{variant:e===t?"primary":"ghost",size:"sm",onClick:()=>l(t),className:"w-9 px-0",children:t},t)),h[h.length-1]<i&&(0,a.jsxs)(a.Fragment,{children:[h[h.length-1]<i-1&&(0,a.jsx)("span",{className:"text-text-muted px-1",children:"..."}),(0,a.jsx)(d.default,{variant:"ghost",size:"sm",onClick:()=>l(i),className:"w-9 px-0",children:i})]}),(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>l(e+1),disabled:e===i,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"})})]})]})]})}var m=s(52679);let h=null,p=null;async function u(){if(h&&p)return{providerNameCache:h,providerNodesCache:p};let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[];for(let e of(p={},t))p[e.id]=e.name;return{providerNameCache:h={...m.Q2,...p},providerNodesCache:p}}function f(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,m.zt)(e)||m.Q2[e];return a?.name||e}function b({title:e,children:t,defaultOpen:s=!1,icon:n=null}){let[r,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(!r),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:[n&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:n}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,o.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",r?"rotate-90":""),children:"chevron_right"})]}),r&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function j(e){let t=e?.prompt_tokens||e?.input_tokens||0,s=e?.cached_tokens||e?.cache_read_input_tokens||0;return t<s?s:t}function g(){let[e,t]=(0,l.useState)([]),[s,n]=(0,l.useState)({page:1,pageSize:20,totalItems:0,totalPages:0}),[r,m]=(0,l.useState)(!1),[h,p]=(0,l.useState)(null),[g,v]=(0,l.useState)(!1),[N,w]=(0,l.useState)([]),[k,y]=(0,l.useState)(null),[S,C]=(0,l.useState)({apiKeyId:"",startDate:"",endDate:""}),D=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/usage/api-keys"),t=await e.json();w(t.apiKeys||[]);let s=await u();y(s.providerNameCache)}catch(e){console.error("Failed to fetch api keys:",e)}},[]),z=(0,l.useCallback)(async()=>{m(!0);try{let e=new URLSearchParams({page:s.page.toString(),pageSize:s.pageSize.toString()});S.apiKeyId&&e.append("apiKeyId",S.apiKeyId),S.startDate&&e.append("startDate",S.startDate),S.endDate&&e.append("endDate",S.endDate);let a=await fetch(`/api/usage/request-details?${e}`),l=await a.json();t(l.details||[]),n(e=>({...e,...l.pagination}))}catch(e){console.error("Failed to fetch request details:",e)}finally{m(!1)}},[s.page,s.pageSize,S]);return(0,l.useEffect)(()=>{D()},[D]),(0,l.useEffect)(()=>{z()},[z]),(0,a.jsxs)("div",{className:"flex min-w-0 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:"apikey-filter",className:"text-sm font-medium text-text-main",children:"API Key"}),(0,a.jsxs)("select",{id:"apikey-filter",value:S.apiKeyId,onChange:e=>C({...S,apiKeyId:e.target.value}),className:(0,o.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","w-full min-w-0 cursor-pointer"),style:{colorScheme:"auto"},children:[(0,a.jsx)("option",{value:"",children:"All Keys"}),N.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"start-date-filter",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"start-date-filter",type:"datetime-local",value:S.startDate,onChange:e=>C({...S,startDate:e.target.value}),className:(0,o.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"end-date-filter",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"end-date-filter",type:"datetime-local",value:S.endDate,onChange:e=>C({...S,endDate:e.target.value}),className:(0,o.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:col-span-2 lg:col-span-1",children:[(0,a.jsx)("span",{className:"hidden text-sm font-medium text-text-main opacity-0 lg:block","aria-hidden":"true",children:"Clear"}),(0,a.jsx)(d.default,{variant:"ghost",onClick:()=>{C({apiKeyId:"",startDate:"",endDate:""})},disabled:!S.apiKeyId&&!S.startDate&&!S.endDate,children:"Clear Filters"})]})]})}),(0,a.jsxs)(i.default,{padding:"none",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[880px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5",children:[(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Timestamp"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Model"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Provider"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Input Tokens"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Output Tokens"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Latency"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Action"})]})}),(0,a.jsx)("tbody",{children:r?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading..."]})})}):0===e.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:"No request details found"})}):e.map((e,t)=>(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 last:border-b-0 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:"whitespace-nowrap p-4 text-sm text-text-main",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"max-w-[260px] truncate p-4 font-mono text-sm text-text-main",children:e.model}),(0,a.jsx)("td",{className:"max-w-[180px] truncate p-4 text-sm text-text-main",children:(0,a.jsx)("span",{className:"font-medium",children:f(e.provider,k)})}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:j(e.tokens).toLocaleString()}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:e.tokens?.completion_tokens?.toLocaleString()||0}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-muted",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("div",{children:["TTFT: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.ttft||0,"ms"]})]}),(0,a.jsxs)("div",{children:["Total: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.total||0,"ms"]})]})]})}),(0,a.jsx)("td",{className:"p-4 text-center",children:(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>{p(e),v(!0)},children:"Detail"})})]},`${e.id}-${t}`))})]})}),!r&&e.length>0&&(0,a.jsx)("div",{className:"border-t border-black/5 dark:border-white/5",children:(0,a.jsx)(x,{currentPage:s.page,pageSize:s.pageSize,totalItems:s.totalItems,onPageChange:e=>{n(t=>({...t,page:e}))},onPageSizeChange:e=>{n(t=>({...t,pageSize:e,page:1}))}})})]}),(0,a.jsx)(c,{isOpen:g,onClose:()=>v(!1),title:"Request Details",width:"lg",children:h&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-4 text-sm sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"ID:"})," ",(0,a.jsx)("span",{className:"break-all font-mono text-text-main",children:h.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:new Date(h.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"})," ",(0,a.jsx)("span",{className:"text-text-main font-medium",children:f(h.provider,k)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:h.model})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"})," ",(0,a.jsx)("span",{className:(0,o.cn)("font-medium","success"===h.status?"text-green-600":"text-red-600"),children:h.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"})," ",(0,a.jsxs)("span",{className:"text-text-main font-mono",children:["TTFT ",h.latency?.ttft||0,"ms / Total ",h.latency?.total||0,"ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:j(h.tokens).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:h.tokens?.completion_tokens?.toLocaleString()||0})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(b,{title:"1. Client Request (Input)",defaultOpen:!0,icon:"input",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(h.request,null,2)})}),h.providerRequest&&(0,a.jsx)(b,{title:"2. Provider Request (Translated)",icon:"translate",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(h.providerRequest,null,2)})}),h.providerResponse&&(0,a.jsx)(b,{title:"3. Provider Response (Raw)",icon:"data_object",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:"object"==typeof h.providerResponse?JSON.stringify(h.providerResponse,null,2):h.providerResponse})}),(0,a.jsxs)(b,{title:"4. Client Response (Final)",defaultOpen:!0,icon:"output",children:[h.response?.thinking&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"font-semibold text-text-main mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"psychology"}),"Thinking Process"]}),(0,a.jsx)("pre",{className:"max-h-[200px] max-w-full overflow-auto rounded-lg border border-amber-200 bg-amber-50 p-3 font-mono text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100 sm:p-4",children:h.response.thinking})]}),(0,a.jsx)("h4",{className:"font-semibold text-text-main mb-2 text-xs uppercase tracking-wide opacity-70",children:"Content"}),(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:h.response?.content||"[No content]"})]})]})]})})]})}let v=[{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function N(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(w,{})})}function w(){let e=(0,n.useSearchParams)(),t=(0,n.useRouter)(),[s,i]=(0,l.useState)(!1),[d,o]=(0,l.useState)("24h"),c=e.get("tab"),x=c&&["overview","logs","details"].includes(c)?c:"overview";return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)(r.Iz,{options:[{value:"overview",label:"Overview"},{value:"details",label:"Details"}],value:x,onChange:s=>{if(s===x)return;i(!0);let a=new URLSearchParams(e);a.set("tab",s),t.push(`/dashboard/usage?${a.toString()}`,{scroll:!1}),setTimeout(()=>i(!1),300)},className:"w-full sm:w-auto"}),"overview"===x&&(0,a.jsx)(r.Iz,{options:v,value:d,onChange:o,size:"sm",className:"w-full sm:w-auto"})]}),s?(0,a.jsx)(r.Qv,{}):(0,a.jsxs)(a.Fragment,{children:["overview"===x&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(r.jK,{period:d,setPeriod:o,hidePeriodSelector:!0})}),"logs"===x&&(0,a.jsx)(r.gM,{}),"details"===x&&(0,a.jsx)(g,{})]})]})}},86621:(e,t,s)=>{Promise.resolve().then(s.bind(s,81772))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=86621)),_N_E=e.O()}]);
@@ -0,0 +1,4 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6589],{50433:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var a=s(95155),r=s(12115),i=s(98500),n=s.n(i),l=s(35497),o=s(14051),c=s.n(o);function d({model:e,fullModel:t,copied:s,onCopy:i,testStatus:n,onTest:l,isTesting:o,requestSnippet:c,onRunRequest:x}){let[m,p]=(0,r.useState)(!1),[u,h]=(0,r.useState)(!1),[f,y]=(0,r.useState)(""),[b,j]=(0,r.useState)(null),[g,N]=(0,r.useState)(null),v="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0,w=async()=>{if(x&&!u){h(!0);try{let e=await x();y(e?.responseText||""),j(e?.ok===!0),N("number"==typeof e?.latencyMs?e.latencyMs:null)}catch(e){y(e?.message||"Request failed"),j(!1),N(null)}finally{h(!1)}}};return(0,a.jsxs)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",style:v?{color:v}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded break-all",children:t}),e.name&&(0,a.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),l&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:l,disabled:o,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${o?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]}),c&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>p(e=>!e),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity opacity-0 group-hover:opacity-100",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:m?"expand_less":"terminal"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:m?"Hide curl":"Show curl"})]}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(t,`model-${t}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${t}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${t}`?"Copied!":"Copy"})]})]}),c&&m&&(0,a.jsxs)("div",{className:"mt-3 pl-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,a.jsx)("span",{className:"text-[10px] font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("button",{onClick:()=>i(c,`request-${t}`),className:"flex items-center gap-1 text-[10px] text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:s===`request-${t}`?"check":"content_copy"}),s===`request-${t}`?"Copied":"Copy"]}),x&&(0,a.jsxs)("button",{onClick:w,disabled:u,className:"flex items-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-[10px] font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:u?{animation:"spin 1s linear infinite"}:void 0,children:u?"progress_activity":"play_arrow"}),u?"Running...":"Run"]})]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-[11px] font-mono text-text-main overflow-x-auto whitespace-pre wrap-break-word",children:c}),(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,a.jsxs)("span",{className:"text-[10px] font-semibold text-text-muted uppercase tracking-wider",children:["Response ",null!==g&&(0,a.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",g,"ms"]})]}),f&&(0,a.jsxs)("button",{onClick:()=>i(f,`response-${t}`),className:"flex items-center gap-1 text-[10px] text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:s===`response-${t}`?"check":"content_copy"}),s===`response-${t}`?"Copied":"Copy"]})]}),(0,a.jsx)("pre",{className:`bg-sidebar rounded-lg px-3 py-2.5 text-[11px] font-mono overflow-x-auto whitespace-pre wrap-break-word ${!1===b?"text-red-400":"text-text-main"} opacity-80`,children:f||'{\n "message": "Response will appear here after running."\n}'})]})]})]})}d.propTypes={model:c().shape({id:c().string.isRequired,name:c().string}).isRequired,fullModel:c().string.isRequired,copied:c().string,onCopy:c().func.isRequired,testStatus:c().oneOf(["ok","error"]),onTest:c().func,isTesting:c().bool,requestSnippet:c().string,onRunRequest:c().func};var x=s(59877),m=s(11059),p=s(52679),u=s(28777);function h(e){return{model:e,stream:!1,messages:[{role:"user",content:"Hello, please introduce yourself briefly."}]}}function f(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}async function y(e){let t=await e.text();try{return f(JSON.parse(t))}catch{return t||`HTTP ${e.status}`}}function b(){let[e,t]=(0,r.useState)(null),[s,i]=(0,r.useState)([]),[n,o]=(0,r.useState)({totalRequests:0,totalPromptTokens:0,totalCompletionTokens:0,totalCost:0}),[c,b]=(0,r.useState)([]),[g,N]=(0,r.useState)([]),[v,w]=(0,r.useState)([]),[k,S]=(0,r.useState)({}),[C,T]=(0,r.useState)(""),[_,M]=(0,r.useState)(null),[A,R]=(0,r.useState)("http://localhost:20502"),[q,$]=(0,r.useState)(!0),{copied:E,copy:O}=(0,m.C)();if((0,r.useEffect)(()=>{Promise.all([fetch("/api/auth/me").then(e=>e.json()),fetch("/api/keys").then(e=>e.json()),fetch("/api/usage/stats?period=7d").then(e=>e.json()).catch(()=>({totalRequests:0,totalPromptTokens:0,totalCompletionTokens:0,totalCost:0})),fetch("/api/providers").then(e=>e.json()).catch(()=>({connections:[]})),fetch("/api/v1/models").then(e=>e.json()).catch(()=>({data:[]}))]).then(([e,s,a,r,n])=>{if("sub_user"!==e.role){window.location.href="super_admin"===e.role?"/dashboard":"/login";return}t(e),w(e.allowedProviders||[]),i(s.keys||[]),o(a),b((r.connections||[]).filter(e=>!1!==e.isActive)),N((n.data||[]).filter(e=>e?.id&&"string"==typeof e.id))}).catch(()=>{window.location.href="/login"}).finally(()=>{$(!1)})},[]),(0,r.useEffect)(()=>{window.location?.origin&&R(window.location.origin)},[]),q)return(0,a.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,a.jsx)("p",{className:"text-text-muted",children:"Loading..."})});let P=s.filter(t=>t.userId===e?.userId),I=P.find(e=>!1!==e.isActive)?.key||"",D=e?.showQuotaTracker!==!1&&c.some(e=>p.wb.includes(e.provider)&&("oauth"===e.authType||p.jO.includes(e.provider))),H=v.map(e=>{var t;let s,a=p.Q2[e]||{},r=a.alias||e,i=c.find(t=>t.provider===e);return{providerId:e,providerName:a.name||i?.name||e,models:(t=g.filter(e=>e.id.startsWith(`${r}/`)).map(e=>({id:e.root||e.id.slice(r.length+1),fullModel:e.id,name:e.root||e.id.slice(r.length+1)})),s=new Map((0,u.KC)(e).map(e=>e.id).map((e,t)=>[e,t])),[...t].sort((e,t)=>{let a=s.has(e.id)?s.get(e.id):Number.MAX_SAFE_INTEGER,r=s.has(t.id)?s.get(t.id):Number.MAX_SAFE_INTEGER;return a!==r?a-r:e.id.localeCompare(t.id,"en",{numeric:!0})}))}}).filter(e=>e.models.length>0),J=async e=>{if(!_){M(e);try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:e})}),s=await t.json();S(t=>({...t,[e]:s.ok?"ok":"error"})),T(s.ok?"":s.error||"Model not reachable")}catch{S(t=>({...t,[e]:"error"})),T("Network error")}finally{M(null)}}},Z=async e=>{if(!I)return{ok:!1,responseText:f({error:"No active API key assigned to this sub-user."}),latencyMs:0};let t=Date.now(),s=await fetch("/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${I}`},body:JSON.stringify(h(e))});return{ok:s.ok,responseText:await y(s),latencyMs:Date.now()-t}};return(0,a.jsxs)("div",{className:"flex flex-col gap-6 max-w-4xl",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold",children:e?.displayName||e?.username||"Welcome"}),(0,a.jsxs)("p",{className:"text-sm text-text-muted mt-1",children:["Sub-user account \xb7 @",e?.username]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-semibold uppercase text-text-muted mb-3",children:"Usage (Last 7 Days)"}),(0,a.jsx)(x.A,{stats:n})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-semibold uppercase text-text-muted mb-3",children:"My API Keys"}),0===P.length?(0,a.jsxs)(l.Zp,{className:"p-6 text-center",children:[(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"No API keys assigned yet."}),(0,a.jsx)("p",{className:"text-text-muted text-xs mt-1",children:"Contact your administrator to get a key assigned."})]}):(0,a.jsx)("div",{className:"flex flex-col gap-3",children:P.map(e=>(0,a.jsxs)(l.Zp,{className:"p-4 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-9 h-9 rounded-lg bg-surface-alt flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"key"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold text-sm",children:e.name}),(0,a.jsxs)("p",{className:"font-mono text-xs text-text-muted",children:[e.key.slice(0,8),".......",e.key.slice(-4)]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[!1===e.isActive&&(0,a.jsx)(l.Ex,{variant:"error",size:"sm",children:"Inactive"}),e.assignedAt&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Assigned ",new Date(e.assignedAt).toLocaleDateString()]})]})]},e.id))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-semibold uppercase text-text-muted mb-3",children:"Available Models"}),!!C&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:C}),0===H.length?(0,a.jsxs)(l.Zp,{className:"p-6 text-center",children:[(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"No models available for the providers currently enabled for this sub-user."}),(0,a.jsx)("p",{className:"text-text-muted text-xs mt-1",children:"Ask your administrator to enable one or more providers in User Management."})]}):(0,a.jsx)("div",{className:"flex flex-col gap-3",children:H.map(e=>(0,a.jsxs)(l.Zp,{className:"p-4 flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("p",{className:"font-semibold text-sm",children:e.providerName}),(0,a.jsxs)(l.Ex,{variant:"secondary",size:"sm",children:[e.models.length," models"]})]}),(0,a.jsx)("div",{className:"flex flex-col gap-2",children:e.models.map(e=>{let t;return(0,a.jsx)(d,{model:e,fullModel:e.fullModel,copied:E,onCopy:O,testStatus:k[e.fullModel],onTest:()=>J(e.fullModel),isTesting:_===e.fullModel,requestSnippet:(t={...h(e.fullModel)},`curl -X POST ${A}/v1/chat/completions \\
2
+ -H "Content-Type: application/json" \\
3
+ -H "Authorization: Bearer ${I||"YOUR_KEY"}" \\
4
+ -d '${JSON.stringify(t)}'`),onRunRequest:()=>Z(e.fullModel)},e.fullModel)})})]},e.providerId))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-semibold uppercase text-text-muted mb-3",children:"Quick Access"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3",children:[(0,a.jsx)(j,{href:"/dashboard/usage",icon:"analytics",label:"Usage & Logs",desc:"View your request history"}),D&&(0,a.jsx)(j,{href:"/dashboard/quota",icon:"data_usage",label:"Quota Tracker",desc:"View quota for your allowed providers"})]})]})]})}function j({href:e,icon:t,label:s,desc:r}){return(0,a.jsx)(n(),{href:e,children:(0,a.jsxs)(l.Zp,{className:"p-4 flex items-center gap-3 hover:border-primary transition-colors cursor-pointer",children:[(0,a.jsx)("div",{className:"w-9 h-9 rounded-lg bg-primary/10 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:t})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold text-sm",children:s}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:r})]})]})})}},82533:(e,t,s)=>{Promise.resolve().then(s.bind(s,50433))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=82533)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9305],{47137:(e,s,n)=>{Promise.resolve().then(n.bind(n,96748)),Promise.resolve().then(n.bind(n,98572)),Promise.resolve().then(n.bind(n,56319)),Promise.resolve().then(n.bind(n,56061)),Promise.resolve().then(n.bind(n,92542)),Promise.resolve().then(n.bind(n,84588)),Promise.resolve().then(n.bind(n,40197)),Promise.resolve().then(n.bind(n,45455)),Promise.resolve().then(n.bind(n,30815)),Promise.resolve().then(n.bind(n,73579)),Promise.resolve().then(n.bind(n,92173)),Promise.resolve().then(n.bind(n,95088)),Promise.resolve().then(n.bind(n,74891)),Promise.resolve().then(n.bind(n,80752)),Promise.resolve().then(n.bind(n,23936)),Promise.resolve().then(n.bind(n,11910)),Promise.resolve().then(n.bind(n,61500)),Promise.resolve().then(n.bind(n,62899)),Promise.resolve().then(n.bind(n,94230)),Promise.resolve().then(n.bind(n,21931)),Promise.resolve().then(n.bind(n,91450)),Promise.resolve().then(n.bind(n,7648)),Promise.resolve().then(n.bind(n,25086)),Promise.resolve().then(n.bind(n,28815)),Promise.resolve().then(n.bind(n,28058)),Promise.resolve().then(n.bind(n,81127)),Promise.resolve().then(n.bind(n,72908)),Promise.resolve().then(n.bind(n,36548)),Promise.resolve().then(n.bind(n,4823)),Promise.resolve().then(n.bind(n,90882)),Promise.resolve().then(n.bind(n,51825)),Promise.resolve().then(n.bind(n,23615)),Promise.resolve().then(n.bind(n,28067)),Promise.resolve().then(n.bind(n,98)),Promise.resolve().then(n.bind(n,92622)),Promise.resolve().then(n.bind(n,21110)),Promise.resolve().then(n.bind(n,38587)),Promise.resolve().then(n.bind(n,98542)),Promise.resolve().then(n.bind(n,97677)),Promise.resolve().then(n.bind(n,23132)),Promise.resolve().then(n.bind(n,95892))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=47137)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9305],{69590:(e,s,n)=>{Promise.resolve().then(n.bind(n,96748)),Promise.resolve().then(n.bind(n,98572)),Promise.resolve().then(n.bind(n,56319)),Promise.resolve().then(n.bind(n,56061)),Promise.resolve().then(n.bind(n,92542)),Promise.resolve().then(n.bind(n,84588)),Promise.resolve().then(n.bind(n,40197)),Promise.resolve().then(n.bind(n,45455)),Promise.resolve().then(n.bind(n,30815)),Promise.resolve().then(n.bind(n,73579)),Promise.resolve().then(n.bind(n,92173)),Promise.resolve().then(n.bind(n,95088)),Promise.resolve().then(n.bind(n,74891)),Promise.resolve().then(n.bind(n,80752)),Promise.resolve().then(n.bind(n,23936)),Promise.resolve().then(n.bind(n,11910)),Promise.resolve().then(n.bind(n,61500)),Promise.resolve().then(n.bind(n,62899)),Promise.resolve().then(n.bind(n,94230)),Promise.resolve().then(n.bind(n,21931)),Promise.resolve().then(n.bind(n,91450)),Promise.resolve().then(n.bind(n,7648)),Promise.resolve().then(n.bind(n,25086)),Promise.resolve().then(n.bind(n,28815)),Promise.resolve().then(n.bind(n,28058)),Promise.resolve().then(n.bind(n,81127)),Promise.resolve().then(n.bind(n,72908)),Promise.resolve().then(n.bind(n,36548)),Promise.resolve().then(n.bind(n,4823)),Promise.resolve().then(n.bind(n,90882)),Promise.resolve().then(n.bind(n,51825)),Promise.resolve().then(n.bind(n,23615)),Promise.resolve().then(n.bind(n,28067)),Promise.resolve().then(n.bind(n,98)),Promise.resolve().then(n.bind(n,92622)),Promise.resolve().then(n.bind(n,21110)),Promise.resolve().then(n.bind(n,38587)),Promise.resolve().then(n.bind(n,98542)),Promise.resolve().then(n.bind(n,97677)),Promise.resolve().then(n.bind(n,23132)),Promise.resolve().then(n.bind(n,95892))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=69590)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,318,335,342,387,501,516,543,552,675,747,748,907,931,948,992,997,1070,1088,1110,1118,1157,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1907,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4612,4656,4674,4761,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5637,5685,5745,5922,6091,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7473,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8506,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9492],{9541:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=l(95155),n=l(35949),o=function(){return(0,r.jsx)("html",{children:(0,r.jsx)("body",{children:(0,r.jsx)(n.HTTPAccessErrorFallback,{status:404,message:"This page could not be found."})})})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35949:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTTPAccessErrorFallback",{enumerable:!0,get:function(){return o}});let r=l(95155),n=l(37356);function o({status:e,message:t}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("title",{children:`${e}: ${t}`}),(0,r.jsx)("div",{style:n.styles.error,children:(0,r.jsxs)("div",{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,r.jsx)("h1",{className:"next-error-h1",style:n.styles.h1,children:e}),(0,r.jsx)("div",{style:n.styles.desc,children:(0,r.jsx)("h2",{style:n.styles.h2,children:t})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},37356:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"styles",{enumerable:!0,get:function(){return l}});let l={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block"},h1:{display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},h2:{fontSize:14,fontWeight:400,lineHeight:"49px",margin:0}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},96448:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return l(9541)}])}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=96448)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,318,335,342,387,501,516,543,552,675,747,748,907,931,948,992,997,1070,1088,1110,1118,1157,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1907,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4612,4656,4674,4761,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5637,5685,5745,5922,6091,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7473,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8506,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,318,335,342,387,501,516,543,552,675,747,748,907,931,948,992,997,1070,1088,1110,1118,1157,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1907,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4612,4656,4674,4761,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5637,5685,5745,5922,6091,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7473,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8506,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,318,335,342,387,501,516,543,552,675,747,748,907,931,948,992,997,1070,1088,1110,1118,1157,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1907,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4612,4656,4674,4761,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5637,5685,5745,5922,6091,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7473,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8506,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,318,335,342,387,501,516,543,552,675,747,748,907,931,948,992,997,1070,1088,1110,1118,1157,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1907,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4612,4656,4674,4761,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5637,5685,5745,5922,6091,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7473,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8506,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,318,335,342,387,501,516,543,552,675,747,748,907,931,948,992,997,1070,1088,1110,1118,1157,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1907,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4612,4656,4674,4761,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5637,5685,5745,5922,6091,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7473,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8506,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,318,335,342,387,501,516,543,552,675,747,748,907,931,948,992,997,1070,1088,1110,1118,1157,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1907,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4612,4656,4674,4761,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5637,5685,5745,5922,6091,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7473,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8506,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,318,335,342,387,501,516,543,552,675,747,748,907,931,948,992,997,1070,1088,1110,1118,1157,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1907,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4612,4656,4674,4761,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5637,5685,5745,5922,6091,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7473,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8506,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,318,335,342,387,501,516,543,552,675,747,748,907,931,948,992,997,1070,1088,1110,1118,1157,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1907,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4612,4656,4674,4761,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5637,5685,5745,5922,6091,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7473,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8506,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,318,335,342,387,501,516,543,552,675,747,748,907,931,948,992,997,1070,1088,1110,1118,1157,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1907,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4612,4656,4674,4761,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5637,5685,5745,5922,6091,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7473,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8506,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);