@rsalmn/extremerouter 0.8.4 → 0.8.6

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 (1186) hide show
  1. package/README.id.md +130 -0
  2. package/README.md +73 -32
  3. package/README.zh-CN.md +130 -0
  4. package/app/.next-cli-build/BUILD_ID +1 -1
  5. package/app/.next-cli-build/app-path-routes-manifest.json +25 -10
  6. package/app/.next-cli-build/build-manifest.json +2 -2
  7. package/app/.next-cli-build/prerender-manifest.json +3 -3
  8. package/app/.next-cli-build/routes-manifest.json +94 -0
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js +2 -2
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +3 -3
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js +2 -2
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +3 -3
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js +2 -2
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js +2 -2
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +2 -2
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js +2 -2
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +4 -4
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +2 -2
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/smart-routing/page.js +2 -0
  82. package/app/.next-cli-build/server/app/(dashboard)/dashboard/smart-routing/page.js.nft.json +1 -0
  83. package/app/.next-cli-build/server/app/(dashboard)/dashboard/smart-routing/page_client-reference-manifest.js +1 -0
  84. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js +2 -2
  85. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page_client-reference-manifest.js +1 -1
  87. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -2
  88. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  90. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  91. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  93. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  94. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  96. package/app/.next-cli-build/server/app/_global-error/page.js +3 -3
  97. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  99. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  100. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  101. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  102. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  103. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  104. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  105. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  106. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  107. package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
  108. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  110. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  111. package/app/.next-cli-build/server/app/_not-found.rsc +6 -6
  112. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +6 -6
  113. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  114. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +6 -6
  115. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  116. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  117. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  118. package/app/.next-cli-build/server/app/api/alerts/test/route.js +2 -2
  119. package/app/.next-cli-build/server/app/api/alerts/test/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  123. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  125. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  127. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  129. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  131. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  133. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/breaker/route.js +1 -1
  135. package/app/.next-cli-build/server/app/api/breaker/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cache/route.js +1 -1
  137. package/app/.next-cli-build/server/app/api/cache/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +9 -11
  139. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  141. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +5 -2
  145. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +5 -2
  147. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +4 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +5 -2
  151. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  153. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  157. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +7 -4
  159. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +5 -2
  161. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +10 -9
  163. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +5 -2
  165. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +5 -2
  167. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +5 -2
  169. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +5 -2
  171. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/combos/lab/route.js +1 -0
  175. package/app/.next-cli-build/server/app/api/combos/lab/route.js.nft.json +1 -0
  176. package/app/.next-cli-build/server/app/api/combos/lab/route_client-reference-manifest.js +1 -0
  177. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/combos/simulate/route.js +1 -0
  180. package/app/.next-cli-build/server/app/api/combos/simulate/route.js.nft.json +1 -0
  181. package/app/.next-cli-build/server/app/api/combos/simulate/route_client-reference-manifest.js +1 -0
  182. package/app/.next-cli-build/server/app/api/combos/validate-roles/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/combos/validate-roles/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/dashboard/stream/route.js +2 -2
  185. package/app/.next-cli-build/server/app/api/dashboard/stream/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +2 -2
  191. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/health/overview/route.js +1 -0
  193. package/app/.next-cli-build/server/app/api/health/overview/route.js.nft.json +1 -0
  194. package/app/.next-cli-build/server/app/api/health/overview/route_client-reference-manifest.js +1 -0
  195. package/app/.next-cli-build/server/app/api/health/providers/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/health/providers/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  198. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/health/stream/route.js +2 -2
  200. package/app/.next-cli-build/server/app/api/health/stream/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  208. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  212. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  214. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  216. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  222. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  224. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  226. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  228. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  230. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  232. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  234. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/1min/import/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/1min/import/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  244. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/oauth/freebuff/import/route.js +1 -0
  248. package/app/.next-cli-build/server/app/api/oauth/freebuff/import/route.js.nft.json +1 -0
  249. package/app/.next-cli-build/server/app/api/oauth/freebuff/import/route_client-reference-manifest.js +1 -0
  250. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/auto-import/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/auto-import/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/import/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/import/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/quota/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/quota/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/oauth/qwen/import/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/oauth/qwen/import/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/oauth/wp-studio/import/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/oauth/wp-studio/import/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js +2 -2
  277. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  285. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  287. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/providers/[id]/agnes-profile/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/providers/[id]/agnes-profile/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/providers/[id]/felo-profile/route.js +3 -0
  291. package/app/.next-cli-build/server/app/api/providers/[id]/felo-profile/route.js.nft.json +1 -0
  292. package/app/.next-cli-build/server/app/api/providers/[id]/felo-profile/route_client-reference-manifest.js +1 -0
  293. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js +1 -1
  296. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/providers/[id]/inxora-profile/route.js +1 -1
  298. package/app/.next-cli-build/server/app/api/providers/[id]/inxora-profile/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +3 -1
  300. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-api-profile/route.js +1 -1
  302. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-api-profile/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-profile/route.js +1 -1
  304. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-profile/route.js.nft.json +1 -1
  305. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js +1 -1
  306. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  308. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  312. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js +1 -1
  314. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/providers/[id]/zai-profile/route.js +1 -0
  318. package/app/.next-cli-build/server/app/api/providers/[id]/zai-profile/route.js.nft.json +1 -0
  319. package/app/.next-cli-build/server/app/api/providers/[id]/zai-profile/route_client-reference-manifest.js +1 -0
  320. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js +1 -1
  321. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js.nft.json +1 -1
  322. package/app/.next-cli-build/server/app/api/providers/capture/launch/route.js +1 -0
  323. package/app/.next-cli-build/server/app/api/providers/capture/launch/route.js.nft.json +1 -0
  324. package/app/.next-cli-build/server/app/api/providers/capture/launch/route_client-reference-manifest.js +1 -0
  325. package/app/.next-cli-build/server/app/api/providers/capture/route.js +1 -0
  326. package/app/.next-cli-build/server/app/api/providers/capture/route.js.nft.json +1 -0
  327. package/app/.next-cli-build/server/app/api/providers/capture/route_client-reference-manifest.js +1 -0
  328. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  329. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/providers/felo-capture/launch/route.js +1 -0
  331. package/app/.next-cli-build/server/app/api/providers/felo-capture/launch/route.js.nft.json +1 -0
  332. package/app/.next-cli-build/server/app/api/providers/felo-capture/launch/route_client-reference-manifest.js +1 -0
  333. package/app/.next-cli-build/server/app/api/providers/felo-capture/route.js +1 -0
  334. package/app/.next-cli-build/server/app/api/providers/felo-capture/route.js.nft.json +1 -0
  335. package/app/.next-cli-build/server/app/api/providers/felo-capture/route_client-reference-manifest.js +1 -0
  336. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  337. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  338. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  339. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  340. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  341. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  343. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  344. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  345. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  346. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  347. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  349. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  351. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  352. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  353. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  355. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  357. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  358. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  359. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +1 -1
  361. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  362. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  363. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  364. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  365. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  366. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  367. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  368. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  369. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  370. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  371. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  372. package/app/.next-cli-build/server/app/api/smart-routing/active/route.js +1 -0
  373. package/app/.next-cli-build/server/app/api/smart-routing/active/route.js.nft.json +1 -0
  374. package/app/.next-cli-build/server/app/api/smart-routing/active/route_client-reference-manifest.js +1 -0
  375. package/app/.next-cli-build/server/app/api/smart-routing/history/route.js +17 -0
  376. package/app/.next-cli-build/server/app/api/smart-routing/history/route.js.nft.json +1 -0
  377. package/app/.next-cli-build/server/app/api/smart-routing/history/route_client-reference-manifest.js +1 -0
  378. package/app/.next-cli-build/server/app/api/smart-routing/lab/route.js +16 -0
  379. package/app/.next-cli-build/server/app/api/smart-routing/lab/route.js.nft.json +1 -0
  380. package/app/.next-cli-build/server/app/api/smart-routing/lab/route_client-reference-manifest.js +1 -0
  381. package/app/.next-cli-build/server/app/api/smart-routing/stream/route.js +7 -0
  382. package/app/.next-cli-build/server/app/api/smart-routing/stream/route.js.nft.json +1 -0
  383. package/app/.next-cli-build/server/app/api/smart-routing/stream/route_client-reference-manifest.js +1 -0
  384. package/app/.next-cli-build/server/app/api/swarm/active/route.js +1 -1
  385. package/app/.next-cli-build/server/app/api/swarm/active/route.js.nft.json +1 -1
  386. package/app/.next-cli-build/server/app/api/swarm/stream/route.js +4 -2
  387. package/app/.next-cli-build/server/app/api/swarm/stream/route.js.nft.json +1 -1
  388. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  389. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  390. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  391. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  392. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  393. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  394. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  395. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  397. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  398. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  399. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  400. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  401. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  402. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  403. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  404. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  405. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  406. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  407. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  408. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  409. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  410. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  411. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  412. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  413. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  414. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  415. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  416. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  417. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  418. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  419. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  420. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  421. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  422. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  423. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  424. package/app/.next-cli-build/server/app/api/usage/leaderboard/route.js +1 -1
  425. package/app/.next-cli-build/server/app/api/usage/leaderboard/route.js.nft.json +1 -1
  426. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  427. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  428. package/app/.next-cli-build/server/app/api/usage/meta/route.js +1 -1
  429. package/app/.next-cli-build/server/app/api/usage/meta/route.js.nft.json +1 -1
  430. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  431. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  432. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  433. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  434. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  435. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  436. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js +1 -1
  437. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js.nft.json +1 -1
  438. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  439. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  440. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  441. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  442. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  443. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  444. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  445. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  446. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  447. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  448. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  449. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  450. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  451. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  452. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  453. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  454. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  455. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  456. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  457. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  458. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  459. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  460. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  461. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  462. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  463. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  464. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  465. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  466. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  467. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  468. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  469. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  470. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  471. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  472. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  473. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  474. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  475. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  476. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  477. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  478. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  479. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  480. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  481. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  482. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  483. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  484. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  485. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  486. package/app/.next-cli-build/server/app/callback/page.js +2 -2
  487. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  488. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  489. package/app/.next-cli-build/server/app/callback.html +1 -1
  490. package/app/.next-cli-build/server/app/callback.rsc +6 -6
  491. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
  492. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  493. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +6 -6
  494. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  495. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  496. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  497. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
  498. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  499. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  500. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  501. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +7 -7
  502. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +7 -7
  503. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  504. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +6 -6
  505. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  506. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  507. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  508. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  509. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  510. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  511. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  512. package/app/.next-cli-build/server/app/index.html +1 -1
  513. package/app/.next-cli-build/server/app/index.rsc +6 -6
  514. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  515. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +6 -6
  516. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  517. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +6 -6
  518. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  519. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  520. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  521. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  522. package/app/.next-cli-build/server/app/landing.html +1 -1
  523. package/app/.next-cli-build/server/app/landing.rsc +6 -6
  524. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
  525. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  526. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +6 -6
  527. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  528. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  529. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  530. package/app/.next-cli-build/server/app/login/page.js +2 -2
  531. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  532. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  533. package/app/.next-cli-build/server/app/login.html +1 -1
  534. package/app/.next-cli-build/server/app/login.rsc +7 -7
  535. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +7 -7
  536. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  537. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +6 -6
  538. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  539. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  540. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  541. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  542. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  543. package/app/.next-cli-build/server/app/page.js +2 -2
  544. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  545. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  546. package/app/.next-cli-build/server/app-paths-manifest.json +25 -10
  547. package/app/.next-cli-build/server/chunks/1241.js +1 -1
  548. package/app/.next-cli-build/server/chunks/1350.js +5 -2
  549. package/app/.next-cli-build/server/chunks/1429.js +1 -1
  550. package/app/.next-cli-build/server/chunks/1719.js +1 -1
  551. package/app/.next-cli-build/server/chunks/1891.js +10 -0
  552. package/app/.next-cli-build/server/chunks/212.js +1 -1
  553. package/app/.next-cli-build/server/chunks/2409.js +1 -1
  554. package/app/.next-cli-build/server/chunks/3520.js +1 -0
  555. package/app/.next-cli-build/server/chunks/3535.js +1 -1
  556. package/app/.next-cli-build/server/chunks/3593.js +1 -1
  557. package/app/.next-cli-build/server/chunks/3841.js +1 -0
  558. package/app/.next-cli-build/server/chunks/3988.js +1 -0
  559. package/app/.next-cli-build/server/chunks/4046.js +1 -1
  560. package/app/.next-cli-build/server/chunks/4109.js +4 -0
  561. package/app/.next-cli-build/server/chunks/412.js +5 -5
  562. package/app/.next-cli-build/server/chunks/422.js +1 -1
  563. package/app/.next-cli-build/server/chunks/4502.js +16 -0
  564. package/app/.next-cli-build/server/chunks/4739.js +1 -1
  565. package/app/.next-cli-build/server/chunks/4780.js +1 -1
  566. package/app/.next-cli-build/server/chunks/507.js +1 -1
  567. package/app/.next-cli-build/server/chunks/5253.js +17 -0
  568. package/app/.next-cli-build/server/chunks/5258.js +1 -1
  569. package/app/.next-cli-build/server/chunks/5330.js +37 -28
  570. package/app/.next-cli-build/server/chunks/5612.js +1 -1
  571. package/app/.next-cli-build/server/chunks/5615.js +1 -1
  572. package/app/.next-cli-build/server/chunks/5628.js +1 -1
  573. package/app/.next-cli-build/server/chunks/5699.js +1 -1
  574. package/app/.next-cli-build/server/chunks/5961.js +1 -1
  575. package/app/.next-cli-build/server/chunks/6306.js +1 -1
  576. package/app/.next-cli-build/server/chunks/6630.js +1 -1
  577. package/app/.next-cli-build/server/chunks/6777.js +1 -1
  578. package/app/.next-cli-build/server/chunks/6878.js +1 -0
  579. package/app/.next-cli-build/server/chunks/698.js +1 -1
  580. package/app/.next-cli-build/server/chunks/7016.js +3 -0
  581. package/app/.next-cli-build/server/chunks/7410.js +1 -1
  582. package/app/.next-cli-build/server/chunks/7566.js +2 -2
  583. package/app/.next-cli-build/server/chunks/7765.js +13 -0
  584. package/app/.next-cli-build/server/chunks/7965.js +1 -1
  585. package/app/.next-cli-build/server/chunks/8048.js +1 -0
  586. package/app/.next-cli-build/server/chunks/809.js +1 -0
  587. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  588. package/app/.next-cli-build/server/chunks/8266.js +1 -0
  589. package/app/.next-cli-build/server/chunks/8271.js +1 -1
  590. package/app/.next-cli-build/server/chunks/8520.js +1 -1
  591. package/app/.next-cli-build/server/chunks/874.js +2 -2
  592. package/app/.next-cli-build/server/chunks/8802.js +2 -2
  593. package/app/.next-cli-build/server/chunks/885.js +11 -7
  594. package/app/.next-cli-build/server/chunks/8895.js +4 -4
  595. package/app/.next-cli-build/server/chunks/9365.js +9 -0
  596. package/app/.next-cli-build/server/chunks/9703.js +5 -5
  597. package/app/.next-cli-build/server/chunks/9903.js +1 -1
  598. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  599. package/app/.next-cli-build/server/middleware.js +6 -6
  600. package/app/.next-cli-build/server/pages/404.html +1 -1
  601. package/app/.next-cli-build/server/pages/500.html +1 -1
  602. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  603. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  604. package/app/.next-cli-build/static/FP2YsqoRbzETOIHRfld7X/_buildManifest.js +1 -0
  605. package/app/.next-cli-build/static/chunks/1321-a387932dc3179f86.js +1 -0
  606. package/app/.next-cli-build/static/chunks/5497-c6d8b48c8828240a.js +7 -0
  607. package/app/.next-cli-build/static/chunks/705-42ad329bbe0c47df.js +1 -0
  608. package/app/.next-cli-build/static/chunks/9497-d27e455b90c7936e.js +1 -0
  609. package/app/.next-cli-build/static/chunks/981-eead750d8fdba2cb.js +3 -0
  610. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/alerts/{page-c263cd784e69e6f1.js → page-812b19e92ea94f14.js} +1 -1
  611. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-9a0e996c5bc5a169.js +1 -0
  612. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-3c3074cf3f61df46.js → page-0e1d5c3cf52823c3.js} +1 -1
  613. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-f7cdc992cb310077.js → page-3122fd2735ba291c.js} +1 -1
  614. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-a84afe4d66f3439a.js +3 -0
  615. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-959b3ee3c662de33.js → page-9850fafcf9dd605b.js} +1 -1
  616. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-9879594c5128cd91.js +1 -0
  617. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/health/page-1c94a0710d61767e.js +1 -0
  618. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-7d472b122fb182f0.js → page-9e98db59d6b1d05f.js} +1 -1
  619. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-83272baae17d38f1.js → page-026721fa921475e0.js} +1 -1
  620. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-f36e5ac11783fd1e.js → page-ec37860600228def.js} +1 -1
  621. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/{page-4069e1d40a3c70a6.js → page-99c8024bece93467.js} +1 -1
  622. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-e794909abbc7a09a.js → page-825c8673e6351d02.js} +1 -1
  623. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-1d972fd3baee7474.js → page-65072e4024bb73b6.js} +1 -1
  624. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/overview/page-b92bc7ebaa0813b2.js +1 -0
  625. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-d3be818ebce4ade2.js +1 -0
  626. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/playground/page-5ef2d54550eda9da.js +1 -0
  627. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-d208597b457fee58.js +1 -0
  628. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-9eea89b85926cfd8.js +10 -0
  629. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-bcf9d97ab4dc20d9.js → page-aaaaeede554f51a5.js} +1 -1
  630. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-5b11b61863963cad.js → page-1f465a9d64823fe6.js} +1 -1
  631. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-58d8d0fa5523ff95.js → page-70bfba02b4fc414f.js} +1 -1
  632. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-e249d28461673557.js +1 -0
  633. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-a8b151d5ae9004ea.js → page-17bcf4e0db497e3a.js} +1 -1
  634. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/smart-routing/page-5c8e7b3b71579268.js +1 -0
  635. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/swarm/page-6cda956597418bd9.js +1 -0
  636. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/{page-d57c129c03c9cb36.js → page-6e8f34517990d858.js} +1 -1
  637. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-61d162d7a7f88a11.js → page-d9e35b679b85696a.js} +1 -1
  638. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-7ea08e0acef52ce3.js +1 -0
  639. package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-20cc41f2e1307f06.js +1 -0
  640. package/app/.next-cli-build/static/chunks/app/_global-error/page-d93feb6893aee449.js +1 -0
  641. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-d93feb6893aee449.js +1 -0
  642. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-d93feb6893aee449.js +1 -0
  643. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-d93feb6893aee449.js +1 -0
  644. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-d93feb6893aee449.js +1 -0
  645. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-d93feb6893aee449.js +1 -0
  646. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-d93feb6893aee449.js +1 -0
  647. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-d93feb6893aee449.js +1 -0
  648. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-d93feb6893aee449.js +1 -0
  649. package/app/.next-cli-build/static/chunks/app/api/breaker/route-d93feb6893aee449.js +1 -0
  650. package/app/.next-cli-build/static/chunks/app/api/cache/route-d93feb6893aee449.js +1 -0
  651. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-d93feb6893aee449.js +1 -0
  652. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-d93feb6893aee449.js +1 -0
  653. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-d93feb6893aee449.js +1 -0
  654. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-d93feb6893aee449.js +1 -0
  655. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-d93feb6893aee449.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-d93feb6893aee449.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-d93feb6893aee449.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-d93feb6893aee449.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-d93feb6893aee449.js +1 -0
  660. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-d93feb6893aee449.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-d93feb6893aee449.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-d93feb6893aee449.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-d93feb6893aee449.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-d93feb6893aee449.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-d93feb6893aee449.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-d93feb6893aee449.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-d93feb6893aee449.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-d93feb6893aee449.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/combos/lab/route-d93feb6893aee449.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/combos/route-d93feb6893aee449.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/combos/simulate/route-d93feb6893aee449.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/combos/validate-roles/route-d93feb6893aee449.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/dashboard/stream/route-d93feb6893aee449.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-d93feb6893aee449.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-d93feb6893aee449.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-d93feb6893aee449.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/health/overview/route-d93feb6893aee449.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-d93feb6893aee449.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/health/route-d93feb6893aee449.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-d93feb6893aee449.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/init/route-d93feb6893aee449.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-d93feb6893aee449.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/keys/route-d93feb6893aee449.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/locale/route-d93feb6893aee449.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-d93feb6893aee449.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-d93feb6893aee449.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-d93feb6893aee449.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-d93feb6893aee449.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-d93feb6893aee449.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-d93feb6893aee449.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-d93feb6893aee449.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-d93feb6893aee449.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-d93feb6893aee449.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-d93feb6893aee449.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-d93feb6893aee449.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/models/route-d93feb6893aee449.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/models/test/route-d93feb6893aee449.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/oauth/1min/import/route-d93feb6893aee449.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-d93feb6893aee449.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-d93feb6893aee449.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-d93feb6893aee449.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-d93feb6893aee449.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-d93feb6893aee449.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/oauth/freebuff/import/route-d93feb6893aee449.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-d93feb6893aee449.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-d93feb6893aee449.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/auto-import/route-d93feb6893aee449.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/import/route-d93feb6893aee449.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/quota/route-d93feb6893aee449.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-d93feb6893aee449.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-d93feb6893aee449.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-d93feb6893aee449.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-d93feb6893aee449.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-d93feb6893aee449.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-d93feb6893aee449.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/oauth/qwen/import/route-d93feb6893aee449.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/oauth/wp-studio/import/route-d93feb6893aee449.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-d93feb6893aee449.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-d93feb6893aee449.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/pricing/route-d93feb6893aee449.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-d93feb6893aee449.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-d93feb6893aee449.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-d93feb6893aee449.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/agnes-profile/route-d93feb6893aee449.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/felo-profile/route-d93feb6893aee449.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/freebuff-profile/route-d93feb6893aee449.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-d93feb6893aee449.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/inxora-profile/route-d93feb6893aee449.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-d93feb6893aee449.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-api-profile/route-d93feb6893aee449.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-profile/route-d93feb6893aee449.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/qwencloud-profile/route-d93feb6893aee449.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-d93feb6893aee449.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-d93feb6893aee449.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-d93feb6893aee449.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/v0-profile/route-d93feb6893aee449.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-d93feb6893aee449.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zai-profile/route-d93feb6893aee449.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-d93feb6893aee449.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/providers/capture/launch/route-d93feb6893aee449.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/api/providers/capture/route-d93feb6893aee449.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-d93feb6893aee449.js +1 -0
  743. package/app/.next-cli-build/static/chunks/app/api/providers/felo-capture/launch/route-d93feb6893aee449.js +1 -0
  744. package/app/.next-cli-build/static/chunks/app/api/providers/felo-capture/route-d93feb6893aee449.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-d93feb6893aee449.js +1 -0
  746. package/app/.next-cli-build/static/chunks/app/api/providers/route-d93feb6893aee449.js +1 -0
  747. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-d93feb6893aee449.js +1 -0
  748. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-d93feb6893aee449.js +1 -0
  749. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-d93feb6893aee449.js +1 -0
  750. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-d93feb6893aee449.js +1 -0
  751. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-d93feb6893aee449.js +1 -0
  752. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-d93feb6893aee449.js +1 -0
  753. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-d93feb6893aee449.js +1 -0
  754. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-d93feb6893aee449.js +1 -0
  755. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-d93feb6893aee449.js +1 -0
  756. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-d93feb6893aee449.js +1 -0
  757. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-d93feb6893aee449.js +1 -0
  758. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-d93feb6893aee449.js +1 -0
  759. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-d93feb6893aee449.js +1 -0
  760. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-d93feb6893aee449.js +1 -0
  761. package/app/.next-cli-build/static/chunks/app/api/settings/route-d93feb6893aee449.js +1 -0
  762. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-d93feb6893aee449.js +1 -0
  763. package/app/.next-cli-build/static/chunks/app/api/smart-routing/active/route-d93feb6893aee449.js +1 -0
  764. package/app/.next-cli-build/static/chunks/app/api/smart-routing/history/route-d93feb6893aee449.js +1 -0
  765. package/app/.next-cli-build/static/chunks/app/api/smart-routing/lab/route-d93feb6893aee449.js +1 -0
  766. package/app/.next-cli-build/static/chunks/app/api/smart-routing/stream/route-d93feb6893aee449.js +1 -0
  767. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-d93feb6893aee449.js +1 -0
  768. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-d93feb6893aee449.js +1 -0
  769. package/app/.next-cli-build/static/chunks/app/api/tags/route-d93feb6893aee449.js +1 -0
  770. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-d93feb6893aee449.js +1 -0
  771. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-d93feb6893aee449.js +1 -0
  772. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-d93feb6893aee449.js +1 -0
  773. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-d93feb6893aee449.js +1 -0
  774. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-d93feb6893aee449.js +1 -0
  775. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-d93feb6893aee449.js +1 -0
  776. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-d93feb6893aee449.js +1 -0
  777. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-d93feb6893aee449.js +1 -0
  778. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-d93feb6893aee449.js +1 -0
  779. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-d93feb6893aee449.js +1 -0
  780. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-d93feb6893aee449.js +1 -0
  781. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-d93feb6893aee449.js +1 -0
  782. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-d93feb6893aee449.js +1 -0
  783. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-d93feb6893aee449.js +1 -0
  784. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-d93feb6893aee449.js +1 -0
  785. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-d93feb6893aee449.js +1 -0
  786. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-d93feb6893aee449.js +1 -0
  787. package/app/.next-cli-build/static/chunks/app/api/usage/leaderboard/route-d93feb6893aee449.js +1 -0
  788. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-d93feb6893aee449.js +1 -0
  789. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-d93feb6893aee449.js +1 -0
  790. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-d93feb6893aee449.js +1 -0
  791. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-d93feb6893aee449.js +1 -0
  792. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-d93feb6893aee449.js +1 -0
  793. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-d93feb6893aee449.js +1 -0
  794. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-d93feb6893aee449.js +1 -0
  795. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-d93feb6893aee449.js +1 -0
  796. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-d93feb6893aee449.js +1 -0
  797. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-d93feb6893aee449.js +1 -0
  798. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-d93feb6893aee449.js +1 -0
  799. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-d93feb6893aee449.js +1 -0
  800. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-d93feb6893aee449.js +1 -0
  801. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-d93feb6893aee449.js +1 -0
  802. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-d93feb6893aee449.js +1 -0
  803. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-d93feb6893aee449.js +1 -0
  804. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-d93feb6893aee449.js +1 -0
  805. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-d93feb6893aee449.js +1 -0
  806. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-d93feb6893aee449.js +1 -0
  807. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-d93feb6893aee449.js +1 -0
  808. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-d93feb6893aee449.js +1 -0
  809. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-d93feb6893aee449.js +1 -0
  810. package/app/.next-cli-build/static/chunks/app/api/v1/route-d93feb6893aee449.js +1 -0
  811. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-d93feb6893aee449.js +1 -0
  812. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-d93feb6893aee449.js +1 -0
  813. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-d93feb6893aee449.js +1 -0
  814. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-d93feb6893aee449.js +1 -0
  815. package/app/.next-cli-build/static/chunks/app/api/version/route-d93feb6893aee449.js +1 -0
  816. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-d93feb6893aee449.js +1 -0
  817. package/app/.next-cli-build/static/chunks/app/api/version/update/route-d93feb6893aee449.js +1 -0
  818. package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/page-bc142d42a8a549b4.js +1 -0
  819. package/app/.next-cli-build/static/chunks/app/{layout-10bff7b57a2a3c2c.js → layout-0e3fdd66d189006c.js} +1 -1
  820. package/app/.next-cli-build/static/chunks/app/login/{page-32ab5d7c75651107.js → page-4b39978fc147efa3.js} +1 -1
  821. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-d93feb6893aee449.js +1 -0
  822. package/app/.next-cli-build/static/chunks/app/page-d93feb6893aee449.js +1 -0
  823. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-d93feb6893aee449.js +1 -0
  824. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-d93feb6893aee449.js +1 -0
  825. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-d93feb6893aee449.js +1 -0
  826. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-d93feb6893aee449.js +1 -0
  827. package/app/.next-cli-build/static/css/d30ee18d498368cc.css +1 -0
  828. package/app/node_modules/playwright-core/browsers.json +75 -0
  829. package/app/node_modules/playwright-core/index.js +17 -0
  830. package/app/node_modules/playwright-core/index.mjs +28 -0
  831. package/app/node_modules/playwright-core/lib/bootstrap.js +88 -0
  832. package/app/node_modules/playwright-core/lib/coreBundle.js +74830 -0
  833. package/app/node_modules/playwright-core/lib/utilsBundle.js +90764 -0
  834. package/app/node_modules/playwright-core/package.json +34 -0
  835. package/app/package.json +2 -5
  836. package/app/public/providers/ai21.svg +4 -0
  837. package/app/public/providers/aihorde.png +0 -0
  838. package/app/public/providers/aimlapi.svg +4 -0
  839. package/app/public/providers/ainative.svg +4 -0
  840. package/app/public/providers/aion.svg +4 -0
  841. package/app/public/providers/anyapi.svg +4 -0
  842. package/app/public/providers/arcee-ai.svg +4 -0
  843. package/app/public/providers/auriko.svg +4 -0
  844. package/app/public/providers/azure-ai.svg +4 -0
  845. package/app/public/providers/bai.svg +4 -0
  846. package/app/public/providers/baseten.svg +4 -0
  847. package/app/public/providers/bazaarlink.svg +8 -0
  848. package/app/public/providers/bluesminds.svg +4 -0
  849. package/app/public/providers/bytez.svg +4 -0
  850. package/app/public/providers/charm-hyper.svg +4 -0
  851. package/app/public/providers/chat-oripe.svg +4 -0
  852. package/app/public/providers/chatanywhere.svg +4 -0
  853. package/app/public/providers/cheaperinference.svg +4 -0
  854. package/app/public/providers/chenzk.svg +4 -0
  855. package/app/public/providers/clarifai.svg +4 -0
  856. package/app/public/providers/cloudcode-one.svg +4 -0
  857. package/app/public/providers/conol-web.svg +1 -0
  858. package/app/public/providers/crof.svg +4 -0
  859. package/app/public/providers/dahl.png +0 -0
  860. package/app/public/providers/datarobot.svg +4 -0
  861. package/app/public/providers/dgrid.png +0 -0
  862. package/app/public/providers/digitalocean.svg +4 -0
  863. package/app/public/providers/dit.svg +4 -0
  864. package/app/public/providers/docker-model-runner.svg +1 -0
  865. package/app/public/providers/dxnt.svg +4 -0
  866. package/app/public/providers/electronhub.svg +4 -0
  867. package/app/public/providers/empower.svg +4 -0
  868. package/app/public/providers/factory.svg +4 -0
  869. package/app/public/providers/fastrouter.svg +4 -0
  870. package/app/public/providers/felo-web.svg +50 -0
  871. package/app/public/providers/fireworks.svg +3 -0
  872. package/app/public/providers/fishaudio.svg +1 -0
  873. package/app/public/providers/free-ai.svg +4 -0
  874. package/app/public/providers/freeaiapikey.svg +4 -0
  875. package/app/public/providers/freebuff.svg +6 -0
  876. package/app/public/providers/freeinference.svg +4 -0
  877. package/app/public/providers/freemodel-dev.svg +4 -0
  878. package/app/public/providers/freetheai.svg +4 -0
  879. package/app/public/providers/friendliai.svg +4 -0
  880. package/app/public/providers/g4f-gemini.png +0 -0
  881. package/app/public/providers/g4f-groq.png +0 -0
  882. package/app/public/providers/g4f-nvidia.png +0 -0
  883. package/app/public/providers/g4f-ollama.png +0 -0
  884. package/app/public/providers/g4f-pollinations.svg +9 -0
  885. package/app/public/providers/gemini-business.svg +1 -0
  886. package/app/public/providers/getgoapi.svg +4 -0
  887. package/app/public/providers/gitlab.png +0 -0
  888. package/app/public/providers/gitlawb-gmi.svg +4 -0
  889. package/app/public/providers/gitlawb.svg +4 -0
  890. package/app/public/providers/gladia.svg +1 -0
  891. package/app/public/providers/hackclub.png +0 -0
  892. package/app/public/providers/hailuo-web.svg +1 -0
  893. package/app/public/providers/helixmind.svg +4 -0
  894. package/app/public/providers/helyxai.png +0 -0
  895. package/app/public/providers/heroku.svg +4 -0
  896. package/app/public/providers/hyperagent.svg +1 -0
  897. package/app/public/providers/inception.svg +4 -0
  898. package/app/public/providers/inference-net.svg +4 -0
  899. package/app/public/providers/inner-ai.svg +1 -0
  900. package/app/public/providers/kenari.svg +4 -0
  901. package/app/public/providers/kilo-gateway.svg +4 -0
  902. package/app/public/providers/lambda-ai.svg +4 -0
  903. package/app/public/providers/laozhang.svg +4 -0
  904. package/app/public/providers/lemonade.svg +1 -0
  905. package/app/public/providers/liquid.svg +4 -0
  906. package/app/public/providers/literouter.svg +4 -0
  907. package/app/public/providers/llama-cpp.svg +1 -0
  908. package/app/public/providers/llamafile.svg +1 -0
  909. package/app/public/providers/llamagate.svg +4 -0
  910. package/app/public/providers/llm-kiwi.svg +4 -0
  911. package/app/public/providers/llm7.png +0 -0
  912. package/app/public/providers/llmgateway.svg +4 -0
  913. package/app/public/providers/lm-studio.svg +1 -0
  914. package/app/public/providers/maritalk.svg +4 -0
  915. package/app/public/providers/meganova-ai.svg +4 -0
  916. package/app/public/providers/meta-ai.svg +68 -0
  917. package/app/public/providers/meta-llama.svg +4 -0
  918. package/app/public/providers/mimocode.png +0 -0
  919. package/app/public/providers/mixlayer.svg +4 -0
  920. package/app/public/providers/mnn-ai.svg +4 -0
  921. package/app/public/providers/modal.svg +4 -0
  922. package/app/public/providers/modelscope.svg +4 -0
  923. package/app/public/providers/morph.svg +4 -0
  924. package/app/public/providers/naga-ac.svg +4 -0
  925. package/app/public/providers/naga-ai.svg +4 -0
  926. package/app/public/providers/nanogpt.svg +4 -0
  927. package/app/public/providers/nara.svg +4 -0
  928. package/app/public/providers/navy.svg +4 -0
  929. package/app/public/providers/notion-web.svg +1 -0
  930. package/app/public/providers/nous-research.svg +4 -0
  931. package/app/public/providers/nscale.svg +4 -0
  932. package/app/public/providers/nube.svg +4 -0
  933. package/app/public/providers/oci.svg +4 -0
  934. package/app/public/providers/ofoxai.svg +4 -0
  935. package/app/public/providers/ollama-cloud.svg +4 -0
  936. package/app/public/providers/oobabooga.svg +1 -0
  937. package/app/public/providers/openadapter.svg +4 -0
  938. package/app/public/providers/opencode-zen.svg +4 -0
  939. package/app/public/providers/openference-api.svg +4 -0
  940. package/app/public/providers/orcarouter.svg +4 -0
  941. package/app/public/providers/ovhcloud.svg +4 -0
  942. package/app/public/providers/piapi.svg +4 -0
  943. package/app/public/providers/pioneer.svg +4 -0
  944. package/app/public/providers/poixe-ai.svg +4 -0
  945. package/app/public/providers/poolside.svg +4 -0
  946. package/app/public/providers/predibase.svg +4 -0
  947. package/app/public/providers/publicai.svg +4 -0
  948. package/app/public/providers/qiniu.svg +4 -0
  949. package/app/public/providers/regolo.svg +4 -0
  950. package/app/public/providers/reka.svg +4 -0
  951. package/app/public/providers/requesty.svg +4 -0
  952. package/app/public/providers/rev-ai.svg +1 -0
  953. package/app/public/providers/routeway.svg +4 -0
  954. package/app/public/providers/sambanova.svg +4 -0
  955. package/app/public/providers/sap.svg +4 -0
  956. package/app/public/providers/scaleway.svg +4 -0
  957. package/app/public/providers/snowflake.svg +4 -0
  958. package/app/public/providers/soniox.svg +1 -0
  959. package/app/public/providers/speechmatics.svg +1 -0
  960. package/app/public/providers/speka.svg +4 -0
  961. package/app/public/providers/sumopod.svg +4 -0
  962. package/app/public/providers/synthetic.svg +4 -0
  963. package/app/public/providers/tencent-aistudio-web.png +0 -0
  964. package/app/public/providers/thebai.svg +4 -0
  965. package/app/public/providers/theoldllm.png +0 -0
  966. package/app/public/providers/tokenharbor.svg +12 -0
  967. package/app/public/providers/tokenreply.svg +4 -0
  968. package/app/public/providers/triton.svg +1 -0
  969. package/app/public/providers/uncloseai.png +0 -0
  970. package/app/public/providers/unorouter.svg +4 -0
  971. package/app/public/providers/upstage.svg +4 -0
  972. package/app/public/providers/vllm.svg +1 -0
  973. package/app/public/providers/void-ai.svg +4 -0
  974. package/app/public/providers/wafer.svg +4 -0
  975. package/app/public/providers/wandb.svg +4 -0
  976. package/app/public/providers/watsonx.svg +4 -0
  977. package/app/public/providers/writer.svg +4 -0
  978. package/app/public/providers/x5lab.svg +4 -0
  979. package/app/public/providers/xinference.svg +1 -0
  980. package/app/public/providers/yolo-auto.svg +4 -0
  981. package/app/public/providers/{chatglm-cn.svg → zai-web.svg} +3 -3
  982. package/app/public/providers/zerolimitai.svg +4 -0
  983. package/app/public/providers/zylo-api.svg +4 -0
  984. package/package.json +3 -1
  985. package/app/.next-cli-build/server/chunks/2231.js +0 -1
  986. package/app/.next-cli-build/server/chunks/2701.js +0 -10
  987. package/app/.next-cli-build/server/chunks/2742.js +0 -1
  988. package/app/.next-cli-build/server/chunks/6070.js +0 -1
  989. package/app/.next-cli-build/server/chunks/6560.js +0 -1
  990. package/app/.next-cli-build/server/chunks/7187.js +0 -1
  991. package/app/.next-cli-build/server/chunks/7218.js +0 -1
  992. package/app/.next-cli-build/server/chunks/7872.js +0 -1
  993. package/app/.next-cli-build/server/chunks/8955.js +0 -16
  994. package/app/.next-cli-build/server/chunks/9422.js +0 -13
  995. package/app/.next-cli-build/static/JRaGItQgERhBp83cHyRqE/_buildManifest.js +0 -1
  996. package/app/.next-cli-build/static/chunks/1321-a7bfb848c63bdbf7.js +0 -1
  997. package/app/.next-cli-build/static/chunks/5497-6eb58895074fec6d.js +0 -7
  998. package/app/.next-cli-build/static/chunks/705-35d16348285626c8.js +0 -1
  999. package/app/.next-cli-build/static/chunks/8105-49cec265df0de251.js +0 -1
  1000. package/app/.next-cli-build/static/chunks/981-777b2911f938c030.js +0 -3
  1001. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-ecd3a85a40e51c66.js +0 -1
  1002. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-b4a78d784383253c.js +0 -3
  1003. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-5689c88f2746c37a.js +0 -1
  1004. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/health/page-133cf1aa2ce53c87.js +0 -1
  1005. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/overview/page-2dae733c8e1582bf.js +0 -1
  1006. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-7325c65533e4cf60.js +0 -1
  1007. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/playground/page-e7ba910803086460.js +0 -1
  1008. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-0f877a8a2550a1ea.js +0 -1
  1009. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-6b500acebeff856b.js +0 -10
  1010. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-c02ccb0fd35970d1.js +0 -1
  1011. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/swarm/page-594a59006196a03a.js +0 -1
  1012. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-483f01fd35d212f5.js +0 -1
  1013. package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-0a63db83d5e05667.js +0 -1
  1014. package/app/.next-cli-build/static/chunks/app/_global-error/page-158df2528a1edacc.js +0 -1
  1015. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-158df2528a1edacc.js +0 -1
  1016. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-158df2528a1edacc.js +0 -1
  1017. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-158df2528a1edacc.js +0 -1
  1018. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-158df2528a1edacc.js +0 -1
  1019. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-158df2528a1edacc.js +0 -1
  1020. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-158df2528a1edacc.js +0 -1
  1021. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-158df2528a1edacc.js +0 -1
  1022. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-158df2528a1edacc.js +0 -1
  1023. package/app/.next-cli-build/static/chunks/app/api/breaker/route-158df2528a1edacc.js +0 -1
  1024. package/app/.next-cli-build/static/chunks/app/api/cache/route-158df2528a1edacc.js +0 -1
  1025. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-158df2528a1edacc.js +0 -1
  1026. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-158df2528a1edacc.js +0 -1
  1027. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-158df2528a1edacc.js +0 -1
  1028. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-158df2528a1edacc.js +0 -1
  1029. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-158df2528a1edacc.js +0 -1
  1030. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-158df2528a1edacc.js +0 -1
  1031. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-158df2528a1edacc.js +0 -1
  1032. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-158df2528a1edacc.js +0 -1
  1033. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-158df2528a1edacc.js +0 -1
  1034. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-158df2528a1edacc.js +0 -1
  1035. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-158df2528a1edacc.js +0 -1
  1036. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-158df2528a1edacc.js +0 -1
  1037. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-158df2528a1edacc.js +0 -1
  1038. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-158df2528a1edacc.js +0 -1
  1039. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-158df2528a1edacc.js +0 -1
  1040. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-158df2528a1edacc.js +0 -1
  1041. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-158df2528a1edacc.js +0 -1
  1042. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-158df2528a1edacc.js +0 -1
  1043. package/app/.next-cli-build/static/chunks/app/api/combos/route-158df2528a1edacc.js +0 -1
  1044. package/app/.next-cli-build/static/chunks/app/api/combos/validate-roles/route-158df2528a1edacc.js +0 -1
  1045. package/app/.next-cli-build/static/chunks/app/api/dashboard/stream/route-158df2528a1edacc.js +0 -1
  1046. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-158df2528a1edacc.js +0 -1
  1047. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-158df2528a1edacc.js +0 -1
  1048. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-158df2528a1edacc.js +0 -1
  1049. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-158df2528a1edacc.js +0 -1
  1050. package/app/.next-cli-build/static/chunks/app/api/health/route-158df2528a1edacc.js +0 -1
  1051. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-158df2528a1edacc.js +0 -1
  1052. package/app/.next-cli-build/static/chunks/app/api/init/route-158df2528a1edacc.js +0 -1
  1053. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-158df2528a1edacc.js +0 -1
  1054. package/app/.next-cli-build/static/chunks/app/api/keys/route-158df2528a1edacc.js +0 -1
  1055. package/app/.next-cli-build/static/chunks/app/api/locale/route-158df2528a1edacc.js +0 -1
  1056. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-158df2528a1edacc.js +0 -1
  1057. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-158df2528a1edacc.js +0 -1
  1058. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-158df2528a1edacc.js +0 -1
  1059. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-158df2528a1edacc.js +0 -1
  1060. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-158df2528a1edacc.js +0 -1
  1061. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-158df2528a1edacc.js +0 -1
  1062. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-158df2528a1edacc.js +0 -1
  1063. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-158df2528a1edacc.js +0 -1
  1064. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-158df2528a1edacc.js +0 -1
  1065. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-158df2528a1edacc.js +0 -1
  1066. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-158df2528a1edacc.js +0 -1
  1067. package/app/.next-cli-build/static/chunks/app/api/models/route-158df2528a1edacc.js +0 -1
  1068. package/app/.next-cli-build/static/chunks/app/api/models/test/route-158df2528a1edacc.js +0 -1
  1069. package/app/.next-cli-build/static/chunks/app/api/oauth/1min/import/route-158df2528a1edacc.js +0 -1
  1070. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-158df2528a1edacc.js +0 -1
  1071. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-158df2528a1edacc.js +0 -1
  1072. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-158df2528a1edacc.js +0 -1
  1073. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-158df2528a1edacc.js +0 -1
  1074. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-158df2528a1edacc.js +0 -1
  1075. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-158df2528a1edacc.js +0 -1
  1076. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-158df2528a1edacc.js +0 -1
  1077. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/auto-import/route-158df2528a1edacc.js +0 -1
  1078. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/import/route-158df2528a1edacc.js +0 -1
  1079. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/quota/route-158df2528a1edacc.js +0 -1
  1080. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-158df2528a1edacc.js +0 -1
  1081. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-158df2528a1edacc.js +0 -1
  1082. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-158df2528a1edacc.js +0 -1
  1083. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-158df2528a1edacc.js +0 -1
  1084. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-158df2528a1edacc.js +0 -1
  1085. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-158df2528a1edacc.js +0 -1
  1086. package/app/.next-cli-build/static/chunks/app/api/oauth/qwen/import/route-158df2528a1edacc.js +0 -1
  1087. package/app/.next-cli-build/static/chunks/app/api/oauth/wp-studio/import/route-158df2528a1edacc.js +0 -1
  1088. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-158df2528a1edacc.js +0 -1
  1089. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-158df2528a1edacc.js +0 -1
  1090. package/app/.next-cli-build/static/chunks/app/api/pricing/route-158df2528a1edacc.js +0 -1
  1091. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-158df2528a1edacc.js +0 -1
  1092. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-158df2528a1edacc.js +0 -1
  1093. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-158df2528a1edacc.js +0 -1
  1094. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/agnes-profile/route-158df2528a1edacc.js +0 -1
  1095. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/freebuff-profile/route-158df2528a1edacc.js +0 -1
  1096. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-158df2528a1edacc.js +0 -1
  1097. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/inxora-profile/route-158df2528a1edacc.js +0 -1
  1098. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-158df2528a1edacc.js +0 -1
  1099. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-api-profile/route-158df2528a1edacc.js +0 -1
  1100. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-profile/route-158df2528a1edacc.js +0 -1
  1101. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/qwencloud-profile/route-158df2528a1edacc.js +0 -1
  1102. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-158df2528a1edacc.js +0 -1
  1103. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-158df2528a1edacc.js +0 -1
  1104. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-158df2528a1edacc.js +0 -1
  1105. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/v0-profile/route-158df2528a1edacc.js +0 -1
  1106. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-158df2528a1edacc.js +0 -1
  1107. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-158df2528a1edacc.js +0 -1
  1108. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-158df2528a1edacc.js +0 -1
  1109. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-158df2528a1edacc.js +0 -1
  1110. package/app/.next-cli-build/static/chunks/app/api/providers/route-158df2528a1edacc.js +0 -1
  1111. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-158df2528a1edacc.js +0 -1
  1112. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-158df2528a1edacc.js +0 -1
  1113. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-158df2528a1edacc.js +0 -1
  1114. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-158df2528a1edacc.js +0 -1
  1115. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-158df2528a1edacc.js +0 -1
  1116. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-158df2528a1edacc.js +0 -1
  1117. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-158df2528a1edacc.js +0 -1
  1118. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-158df2528a1edacc.js +0 -1
  1119. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-158df2528a1edacc.js +0 -1
  1120. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-158df2528a1edacc.js +0 -1
  1121. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-158df2528a1edacc.js +0 -1
  1122. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-158df2528a1edacc.js +0 -1
  1123. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-158df2528a1edacc.js +0 -1
  1124. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-158df2528a1edacc.js +0 -1
  1125. package/app/.next-cli-build/static/chunks/app/api/settings/route-158df2528a1edacc.js +0 -1
  1126. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-158df2528a1edacc.js +0 -1
  1127. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-158df2528a1edacc.js +0 -1
  1128. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-158df2528a1edacc.js +0 -1
  1129. package/app/.next-cli-build/static/chunks/app/api/tags/route-158df2528a1edacc.js +0 -1
  1130. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-158df2528a1edacc.js +0 -1
  1131. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-158df2528a1edacc.js +0 -1
  1132. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-158df2528a1edacc.js +0 -1
  1133. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-158df2528a1edacc.js +0 -1
  1134. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-158df2528a1edacc.js +0 -1
  1135. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-158df2528a1edacc.js +0 -1
  1136. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-158df2528a1edacc.js +0 -1
  1137. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-158df2528a1edacc.js +0 -1
  1138. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-158df2528a1edacc.js +0 -1
  1139. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-158df2528a1edacc.js +0 -1
  1140. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-158df2528a1edacc.js +0 -1
  1141. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-158df2528a1edacc.js +0 -1
  1142. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-158df2528a1edacc.js +0 -1
  1143. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-158df2528a1edacc.js +0 -1
  1144. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-158df2528a1edacc.js +0 -1
  1145. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-158df2528a1edacc.js +0 -1
  1146. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-158df2528a1edacc.js +0 -1
  1147. package/app/.next-cli-build/static/chunks/app/api/usage/leaderboard/route-158df2528a1edacc.js +0 -1
  1148. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-158df2528a1edacc.js +0 -1
  1149. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-158df2528a1edacc.js +0 -1
  1150. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-158df2528a1edacc.js +0 -1
  1151. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-158df2528a1edacc.js +0 -1
  1152. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-158df2528a1edacc.js +0 -1
  1153. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-158df2528a1edacc.js +0 -1
  1154. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-158df2528a1edacc.js +0 -1
  1155. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-158df2528a1edacc.js +0 -1
  1156. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-158df2528a1edacc.js +0 -1
  1157. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-158df2528a1edacc.js +0 -1
  1158. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-158df2528a1edacc.js +0 -1
  1159. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-158df2528a1edacc.js +0 -1
  1160. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-158df2528a1edacc.js +0 -1
  1161. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-158df2528a1edacc.js +0 -1
  1162. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-158df2528a1edacc.js +0 -1
  1163. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-158df2528a1edacc.js +0 -1
  1164. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-158df2528a1edacc.js +0 -1
  1165. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-158df2528a1edacc.js +0 -1
  1166. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-158df2528a1edacc.js +0 -1
  1167. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-158df2528a1edacc.js +0 -1
  1168. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-158df2528a1edacc.js +0 -1
  1169. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-158df2528a1edacc.js +0 -1
  1170. package/app/.next-cli-build/static/chunks/app/api/v1/route-158df2528a1edacc.js +0 -1
  1171. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-158df2528a1edacc.js +0 -1
  1172. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-158df2528a1edacc.js +0 -1
  1173. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-158df2528a1edacc.js +0 -1
  1174. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-158df2528a1edacc.js +0 -1
  1175. package/app/.next-cli-build/static/chunks/app/api/version/route-158df2528a1edacc.js +0 -1
  1176. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-158df2528a1edacc.js +0 -1
  1177. package/app/.next-cli-build/static/chunks/app/api/version/update/route-158df2528a1edacc.js +0 -1
  1178. package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/page-bb9f307074c5c23a.js +0 -1
  1179. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-158df2528a1edacc.js +0 -1
  1180. package/app/.next-cli-build/static/chunks/app/page-158df2528a1edacc.js +0 -1
  1181. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-158df2528a1edacc.js +0 -1
  1182. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-158df2528a1edacc.js +0 -1
  1183. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-158df2528a1edacc.js +0 -1
  1184. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-158df2528a1edacc.js +0 -1
  1185. package/app/.next-cli-build/static/css/d25230f8c6390408.css +0 -1
  1186. /package/app/.next-cli-build/static/{JRaGItQgERhBp83cHyRqE → FP2YsqoRbzETOIHRfld7X}/_ssgManifest.js +0 -0
@@ -1,3 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[981],{15536:(e,t,s)=>{"use strict";s.d(t,{Cp:()=>r,Hx:()=>n,Iv:()=>d,Nv:()=>x,RL:()=>c,ev:()=>m,fl:()=>i,hT:()=>a,oX:()=>l,t6:()=>o});let a=["zh-CN","zh-TW"],l=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],n=2e3,r=3e5,i=5e3,o=5,c=1e4,d=5e3,m=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],x=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}]},20242:(e,t,s)=>{"use strict";s.d(t,{default:()=>g});var a=s(95155),l=s(12115),n=s(14051),r=s.n(n),i=s(35497),o=s(11059),c=s(15536);async function d(e){if(!e)return!1;try{return(await fetch(`${e}/api/health`,{mode:"cors",cache:"no-store",signal:AbortSignal.timeout(c.Iv)})).ok}catch{return!1}}async function m(...e){let t=e.filter(Boolean).map(d);return!!t.length&&new Promise(e=>{let s=t.length;t.forEach(t=>t.then(t=>{t?e(!0):0==--s&&e(!1)}))})}function x({label:e,url:t,copyId:s,copied:l,onCopy:n,badge:r,actions:o}){return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===r||"TS"===r?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:e}),(0,a.jsx)(i.pd,{value:t,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>n(t,s),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l===s?"check":"content_copy"})}),o]})}function u({status:e,className:t=""}){return(0,a.jsx)("div",{className:`p-2 rounded text-sm ${t} ${"success"===e.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===e.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===e.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:e.message.split(/(https?:\/\/[^\s]+)/g).map((e,t)=>/^https?:\/\//.test(e)?(0,a.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:e},t):e)})}function h({text:e}){return(0,a.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,a.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:e})]})}function p({message:e,action:t}){return(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-xs flex-1",children:e}),t&&(0,a.jsx)("a",{href:t.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:t.href.startsWith("#")?e=>{e.preventDefault(),document.getElementById(t.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:t.label})]})}function g({machineId:e}){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),[f,b]=(0,l.useState)(!1),[j,v]=(0,l.useState)(""),[w,k]=(0,l.useState)(null),[N,C]=(0,l.useState)(null),[S,T]=(0,l.useState)(null),[P,E]=(0,l.useState)(!1),[_,$]=(0,l.useState)(!0),[A,I]=(0,l.useState)(!0),[U,D]=(0,l.useState)(!1),[F,O]=(0,l.useState)(!0),[R,L]=(0,l.useState)(!1),[W,q]=(0,l.useState)(!1),[K,M]=(0,l.useState)(""),[z,H]=(0,l.useState)(""),[J,B]=(0,l.useState)(!1),[G,Q]=(0,l.useState)(""),[X,Y]=(0,l.useState)(null),[Z,V]=(0,l.useState)(!1),[ee,et]=(0,l.useState)(!1),[es,ea]=(0,l.useState)(!1),[el,en]=(0,l.useState)(!1),[er,ei]=(0,l.useState)(""),[eo,ec]=(0,l.useState)(!1),[ed,em]=(0,l.useState)(""),[ex,eu]=(0,l.useState)(null),[eh,ep]=(0,l.useState)(""),[eg,ey]=(0,l.useState)(""),[ef,eb]=(0,l.useState)(null),[ej,ev]=(0,l.useState)(!1),[ew,ek]=(0,l.useState)([]),[eN,eC]=(0,l.useState)(""),[eS,eT]=(0,l.useState)(!1),[eP,eE]=(0,l.useState)(!1),[e_,e$]=(0,l.useState)(!1),eA=(0,l.useRef)(null),eI=(0,l.useRef)(0),eU=(0,l.useRef)(0),eD=(0,l.useRef)(!1),eF=(0,l.useRef)(!1),eO=(0,l.useRef)(!1),eR=(0,l.useRef)(!1),[eL,eW]=(0,l.useState)(!1),[eq,eK]=(0,l.useState)(!1),[eM,ez]=(0,l.useState)(new Set),[eH,eJ]=(0,l.useState)(!1);(0,l.useEffect)(()=>{eJ(!["localhost","127.0.0.1","::1"].includes(window.location.hostname))},[]);let{copied:eB,copy:eG}=(0,o.C)(),eQ=!_||!A,eX=_?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,l.useEffect)(()=>{eA.current&&(eA.current.scrollTop=eA.current.scrollHeight)},[ew]),(0,l.useEffect)(()=>{e2(),eV()},[]),(0,l.useEffect)(()=>{if(!(R||es))return;let e=!R||W,t=!es||el,s=()=>{document.hidden||eZ()};if(document.addEventListener("visibilitychange",s),e&&t)return()=>document.removeEventListener("visibilitychange",s);let a=setInterval(()=>{document.hidden||eZ()},c.fl);return()=>{clearInterval(a),document.removeEventListener("visibilitychange",s)}},[R,es,W,el]),(0,l.useEffect)(()=>{let e=async()=>{if(!document.hidden){if(R&&(K||z)){let e=await m(z,K);eD.current=e,e?(eI.current=0,q(!0),eO.current||(eO.current=!0,eW(!0))):(eI.current+=1,eI.current>=c.t6&&q(!1))}else eD.current=!1;if(es&&er){let e=await d(er);eF.current=e,e?(eU.current=0,en(!0),eR.current||(eR.current=!0,eK(!0))):(eU.current+=1,eU.current>=c.t6&&en(!1))}else eF.current=!1}};if(!(R&&(K||z)||es&&er))return;e();let t=!es||el;if((!R||W)&&t)return;let s=setInterval(e,c.RL);return()=>clearInterval(s)},[R,K,z,es,er,W,el]);let eY=(0,l.useCallback)((e,t,s,a,l,n)=>{t.current?(s.current=0,a(!0),l.current||(l.current=!0,n(!0))):(s.current+=1,s.current>=c.t6&&a(!1))},[]),eZ=async()=>{try{let e=await fetch("/api/tunnel/status",{cache:"no-store"});if(!e.ok)return;let t=await e.json(),s=t.tunnel?.settingsEnabled??t.tunnel?.enabled??!1,a=t.tunnel?.tunnelUrl||"";M(a),H(t.tunnel?.publicUrl||""),L(s),eY(null,eD,eI,q,eO,eW);let l=t.tailscale?.settingsEnabled??t.tailscale?.enabled??!1,n=t.tailscale?.tunnelUrl||"";ei(n),ea(l),eY(null,eF,eU,en,eR,eK)}catch{}},eV=async()=>{O(!0);try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status",{cache:"no-store"})]);if(e.ok){let t=await e.json();E(t.requireApiKey||!1),$(!1!==t.requireLogin),I(t.hasPassword||!1),D(t.tunnelDashboardAccess||!1)}if(t.ok){let e=await t.json(),s=e.tunnel?.settingsEnabled??e.tunnel?.enabled??!1,a=e.tunnel?.tunnelUrl||"";M(a),H(e.tunnel?.publicUrl||""),L(s),eY(null,eD,eI,q,eO,eW);let l=e.tailscale?.settingsEnabled??e.tailscale?.enabled??!1,n=e.tailscale?.tunnelUrl||"";ei(n),ea(l),eY(null,eF,eU,en,eR,eK)}}catch(e){console.log("Error loading settings:",e)}finally{O(!1)}},e0=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:e})})).ok&&D(e)}catch(e){console.log("Error updating tunnelDashboardAccess:",e)}},e1=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&E(e)}catch(e){console.log("Error updating requireApiKey:",e)}},e2=async()=>{try{let e=await fetch("/api/keys"),t=await e.json();e.ok&&s(t.keys||[])}catch(e){console.log("Error fetching data:",e)}finally{r(!1)}},e5=async(...e)=>{B(!0),Q("Waiting for tunnel ready...");let t=e.filter(Boolean).map(e=>`${e}/api/health`),s=Date.now();for(;Date.now()-s<c.Cp;){if(await new Promise(e=>setTimeout(e,c.Hx)),await Promise.any(t.map(async e=>{if((await fetch(e,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return L(!0),B(!1),Q(""),!0;if((Date.now()-s)%1e4<c.Hx)try{let e=await fetch("/api/tunnel/status");if(e.ok){let t=await e.json();if(!t.tunnel?.enabled)return Y({type:"error",message:"Tunnel process stopped unexpectedly."}),B(!1),Q(""),!1}}catch{}}return Y({type:"error",message:"Tunnel created but not reachable. Please try again."}),B(!1),Q(""),!1},e4=async()=>{V(!1),B(!0),Y(null),Q("Creating tunnel...");let e=!0;(async()=>{for(;e;){try{let t=await fetch("/api/tunnel/status");if(t.ok){let s=await t.json();s.download?.downloading?Q(`Downloading cloudflared... ${s.download.progress}%`):e&&Q("Creating tunnel...")}}catch{}await new Promise(e=>setTimeout(e,1e3))}})();try{let t=await fetch("/api/tunnel/enable",{method:"POST"});e=!1;let s=await t.json();if(!t.ok)return void Y({type:"error",message:s.error||"Failed to enable tunnel"});let a=s.tunnelUrl;if(!a)return void Y({type:"error",message:"No tunnel URL returned"});M(a),H(s.publicUrl||""),await e5(s.publicUrl,a)}catch(e){Y({type:"error",message:e.message})}finally{e=!1,B(!1),Q("")}},e3=async()=>{B(!0),Y(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(L(!1),M(""),et(!1),Y({type:"success",message:"Tunnel disabled"})):Y({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){Y({type:"error",message:e.message})}finally{B(!1)}},e8=async()=>{eb(null);try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok){let t=await e.json();return eb(t.installed),t}}catch{}return eb(!1),{installed:!1}},e6=async()=>{ev(!0),eu(null),ek([]);try{let e=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:eN})});eC("");let t=e.body.getReader(),s=new TextDecoder,a="";for(;;){let{done:e,value:l}=await t.read();if(e)break;let n=(a+=s.decode(l,{stream:!0})).split("\n\n");for(let e of(a=n.pop()||"",n)){let t=e.split("\n"),s="progress",a=null;for(let e of t)if(e.startsWith("event: ")&&(s=e.slice(7).trim()),e.startsWith("data: "))try{a=JSON.parse(e.slice(6))}catch{}if(a)if("progress"===s)ek(e=>[...e.slice(-50),a.message]);else if("done"===s){eb(!0),ev(!1),eE(!1),tt();return}else"error"===s&&eu({type:"error",message:a.error||"Install failed"})}}}catch(e){eu({type:"error",message:e.message})}finally{ev(!1)}},e9=async e=>{em("Waiting for Tailscale ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<c.Cp;){await new Promise(e=>setTimeout(e,c.Hx));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return!0}catch{}}return!1},e7=(e,t)=>{ep(e),ey(t)},te=()=>{ep(""),ey("")},tt=async()=>{eE(!1),eT(!0),ec(!0),eu(null),em("Connecting..."),te();try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){ei(t.tunnelUrl||"");let e=await e9(t.tunnelUrl);ea(!0),eu(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.needsLogin&&t.authUrl){e7(t.authUrl,"Open Login Page"),em('Login required — click "Open Login Page" to continue');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok&&(await e.json()).loggedIn){te(),em("Starting funnel...");let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){ei(t.tunnelUrl||"");let e=await e9(t.tunnelUrl);ea(!0),eu(e?null:{type:"warning",message:"Connected but not reachable yet."})}else t.funnelNotEnabled&&t.enableUrl?await ts(t.enableUrl):eu({type:"error",message:t.error||"Failed to start funnel"});return}}catch{}}te(),eu({type:"error",message:"Login timed out. Please try again."});return}if(t.funnelNotEnabled&&t.enableUrl)return void await ts(t.enableUrl);eu({type:"error",message:t.error||"Failed to connect"})}catch(e){eu({type:"error",message:e.message})}finally{ec(!1),eT(!1),em(""),te()}},ts=async e=>{e7(e,"Open Funnel Settings"),em('Click "Open Funnel Settings" to enable Funnel...');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){te(),ei(t.tunnelUrl||"");let e=await e9(t.tunnelUrl);ea(!0),eu(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.funnelNotEnabled)continue;if(t.error){te(),eu({type:"error",message:t.error});return}}catch{}}te(),eu({type:"error",message:"Timed out waiting for Funnel to be enabled."})},ta=async()=>{ec(!0),eu(null);try{let e=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),t=await e.json();e.ok?(ea(!1),ei(""),e$(!1),eu({type:"success",message:"Tailscale disabled"})):eu({type:"error",message:t.error||"Failed to disable Tailscale"})}catch(e){eu({type:"error",message:e.message})}finally{ec(!1)}},tl=async()=>{eu(null),ek([]);let e=await e8();e?.installed&&e?.hasCachedPassword?tt():eE(!0)},tn=async()=>{if(j.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:j})}),t=await e.json();e.ok&&(k(t.key),await e2(),v(""),b(!1))}catch(e){console.log("Error creating key:",e)}},tr=async e=>{C({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{C(null);try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&(s(t.filter(t=>t.id!==e)),ez(t=>{let s=new Set(t);return s.delete(e),s}))}catch(e){console.log("Error deleting key:",e)}}})},ti=async(e,t)=>{try{(await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&s(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error toggling key:",e)}},[to,tc]=(0,l.useState)("/v1");return((0,l.useEffect)(()=>{tc(`${window.location.origin}/v1`)},[]),n)?(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(i.Qv,{}),(0,a.jsx)(i.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsx)(i.zY,{title:"Endpoint",description:"Gateway URL, public exposure, and API keys",icon:"api",actions:(0,a.jsx)(i.$n,{size:"sm",icon:"add",onClick:()=>b(!0),children:"New Key"})}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(x,{label:"Local",url:to,copyId:"local_url",copied:eB,onCopy:eG}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${R?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),R&&!J&&W?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${z||K}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>eG(`${z||K}/v1`,"tunnel_url"),className:"p-2 hover:hover:bg-surface-3 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===eB?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>et(!0),className:"p-2 hover:bg-danger/10 text-danger transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!R||J||W?J?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),G||"Creating tunnel..."]}),(0,a.jsx)("button",{onClick:()=>{B(!1),Q("")},className:"p-2 hover:bg-danger/10 text-danger transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):X?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-danger",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),X.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>V(!0),children:"Enable"})]}):F?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,a.jsx)("button",{onClick:()=>O(!1),className:"p-2 hover:bg-danger/10 text-danger transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{eQ?Y({type:"error",message:`Security required: ${eX}`}):P?V(!0):Y({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-warning",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),eL?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,a.jsx)("button",{onClick:()=>et(!0),className:"p-2 hover:bg-danger/10 text-danger transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${es?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),es&&!eo&&el?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${er}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>eG(`${er}/v1`,"ts_url"),className:"p-2 hover:hover:bg-surface-3 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===eB?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>e$(!0),className:"p-2 hover:bg-danger/10 text-danger transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!es||eo||el?eo||eS?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ed||"Connecting..."]}),eh&&(0,a.jsx)(i.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(eh,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:eg||"Open"}),(0,a.jsx)("button",{onClick:()=>{ec(!1),eT(!1),em(""),te()},className:"p-2 hover:bg-danger/10 text-danger transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):ex?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-danger",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),ex.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:tl,children:"Enable"})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{eQ?eu({type:"error",message:`Security required: ${eX}`}):tl()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-warning",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),eq?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,a.jsx)("button",{onClick:()=>e$(!0),className:"p-2 hover:bg-danger/10 text-danger transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),eQ&&!R&&!es&&(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(p,{message:eX,action:{label:"Open settings",href:"/dashboard/profile"}})}),(R||es)&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!P&&(0,a.jsx)(p,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!_||!A)&&(0,a.jsx)(p,{message:_?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:_?"Change password":"Enable",href:"/dashboard/profile"}})]}),(R||es)&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,a.jsx)(i.lM,{checked:U,onChange:()=>e0(!U)}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,a.jsx)(h,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,a.jsxs)(i.Zp,{id:"require-api-key",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>b(!0),children:"Create Key"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,a.jsx)(i.lM,{checked:P,onChange:()=>e1(!P)})]}),eH&&!P&&(0,a.jsx)("div",{className:"mb-4 -mt-2",children:(0,a.jsx)(p,{message:"Endpoint is exposed without an API key."})}),0===t.length?(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>b(!0),children:"Create Key"})]}):(0,a.jsx)("div",{className:"flex flex-col",children:t.map(e=>{var t;return(0,a.jsxs)("div",{className:`group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono",children:eM.has(e.id)?e.key:(t=e.key)&&!(t.length<=10)?t.slice(0,6)+"•".repeat(t.length-10)+t.slice(-4):t||""}),(0,a.jsx)("button",{onClick:()=>{var t;return t=e.id,void ez(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"p-1 hover:hover:bg-surface-3 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",title:eM.has(e.id)?"Hide key":"Show key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eM.has(e.id)?"visibility_off":"visibility"})}),(0,a.jsx)("button",{onClick:()=>eG(e.key,e.id),className:"p-1 hover:hover:bg-surface-3 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eB===e.id?"check":"content_copy"})})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]}),!1===e.isActive&&(0,a.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[Array.isArray(e.allowedModels)&&e.allowedModels.length>0&&(0,a.jsxs)("span",{className:"hidden sm:inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-semibold text-primary",title:`Restricted to ${e.allowedModels.length} models`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"lock"}),e.allowedModels.length]}),(0,a.jsx)(i.lM,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?C({title:"Pause API Key",message:`Pause API key "${e.name}"?
2
-
3
- This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{C(null),ti(e.id,t)}}):ti(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,a.jsx)("button",{onClick:()=>T(e),className:"p-2 hover:bg-surface-2 text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",title:"Model access control",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tune"})}),(0,a.jsx)("button",{onClick:()=>tr(e.id),className:"p-2 hover:bg-danger/10 text-danger opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,a.jsx)(i.aF,{isOpen:f,title:"Create API Key",onClose:()=>{b(!1),v("")},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(i.pd,{label:"Key Name",value:j,onChange:e=>v(e.target.value),placeholder:"Production Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:tn,fullWidth:!0,disabled:!j.trim(),children:"Create"}),(0,a.jsx)(i.$n,{onClick:()=>{b(!1),v("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:!!w,title:"API Key Created",onClose:()=>k(null),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,a.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.pd,{value:w||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)(i.$n,{variant:"secondary",icon:"created_key"===eB?"check":"content_copy",onClick:()=>eG(w,"created_key"),children:"created_key"===eB?"Copied!":"Copy"})]}),(0,a.jsx)(i.$n,{onClick:()=>k(null),fullWidth:!0,children:"Done"})]})}),(0,a.jsx)(i.aF,{isOpen:Z,title:"Enable Tunnel",onClose:()=>V(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local ExtremeRouter to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",children:c.oX.map(e=>(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:e.icon}),(0,a.jsx)("p",{className:"text-xs font-semibold",children:e.title}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e.desc})]},e.title))}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:e4,fullWidth:!0,children:"Start Tunnel"}),(0,a.jsx)(i.$n,{onClick:()=>V(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:ee,title:"Disable Tunnel",onClose:()=>!J&&et(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:e3,fullWidth:!0,disabled:J,variant:"danger",children:J?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>et(!1),variant:"ghost",fullWidth:!0,disabled:J,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:eP,title:"Tailscale Funnel",onClose:()=>{ej||(eE(!1),eC(""),eu(null))},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[null===ef&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===ef&&!ej&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:e6,fullWidth:!0,children:"Install Tailscale"}),(0,a.jsx)(i.$n,{onClick:()=>eE(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ej&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),ew.length>0&&(0,a.jsx)("div",{ref:eA,className:"bg-surface-2 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:ew.map((e,t)=>(0,a.jsx)("div",{children:e},t))})]}),!0===ef&&!ej&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:()=>tt(),fullWidth:!0,children:"Connect"}),(0,a.jsx)(i.$n,{onClick:()=>eE(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ex&&(0,a.jsx)(u,{status:ex})]})}),(0,a.jsx)(i.aF,{isOpen:e_,title:"Disable Tailscale",onClose:()=>!eo&&e$(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:ta,fullWidth:!0,disabled:eo,variant:"danger",children:eo?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>e$(!1),variant:"ghost",fullWidth:!0,disabled:eo,children:"Cancel"})]})]})}),(0,a.jsx)(y,{apiKey:S,onClose:()=>T(null),onSaved:async()=>{await e2(),T(null)}}),(0,a.jsx)(i.uo,{isOpen:!!N,onClose:()=>C(null),onConfirm:N?.onConfirm,title:N?.title||"Confirm",message:N?.message,variant:"danger"})]})}function y({apiKey:e,onClose:t,onSaved:s}){let[n,r]=(0,l.useState)(()=>Array.isArray(e?.allowedModels)?[...e.allowedModels]:[]),[o,c]=(0,l.useState)(""),[d,m]=(0,l.useState)(!1);if((0,l.useEffect)(()=>{e&&(r(Array.isArray(e.allowedModels)?[...e.allowedModels]:[]),c(""))},[e]),!e)return null;let x=()=>{let e=o.trim();e&&(r(t=>t.includes(e)?t:[...t,e]),c(""))},u=async()=>{m(!0);try{await fetch(`/api/keys/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({allowedModels:n.length>0?n:null})}),await s()}catch(e){console.log("Failed to save model access:",e)}finally{m(!1)}};return(0,a.jsx)(i.aF,{isOpen:!!e,onClose:t,title:`Model Access — ${e.name||"Key"}`,footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.$n,{variant:"ghost",onClick:t,disabled:d,children:"Cancel"}),(0,a.jsx)(i.$n,{onClick:u,loading:d,children:"Save"})]}),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Restrict which models this API key can access. Leave empty to allow all models. Supports exact model IDs (e.g. ",(0,a.jsx)("code",{className:"font-mono text-xs",children:"glm/glm-5"}),") or provider prefixes (e.g. ",(0,a.jsx)("code",{className:"font-mono text-xs",children:"glm/"})," to allow all GLM models)."]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),x())},placeholder:"e.g. glm/glm-5 or glm/",className:"flex-1 rounded border border-border bg-surface-2 px-3 py-2 text-sm text-text-main placeholder:text-text-muted/70 focus:outline-none focus:ring-2 focus:ring-primary/30"}),(0,a.jsx)(i.$n,{size:"sm",variant:"secondary",icon:"add",onClick:x,children:"Add"})]}),n.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-primary/30 bg-primary/5 px-2.5 py-1 text-xs font-mono text-primary",children:[e,(0,a.jsx)("button",{onClick:()=>r(t=>t.filter(t=>t!==e)),className:"text-primary/60 hover:text-danger transition-colors","aria-label":`Remove ${e}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))}):(0,a.jsx)("div",{className:"rounded-lg border border-dashed border-border p-4 text-center text-sm text-text-muted",children:"No restrictions — this key can access all models"}),n.length>0&&(0,a.jsx)("button",{onClick:()=>r([]),className:"self-start text-xs text-danger hover:underline",children:"Clear all restrictions"})]})})}g.propTypes={machineId:r().string.isRequired}},90981:(e,t,s)=>{Promise.resolve().then(s.bind(s,20242))}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4465],{86508:(e,t,r)=>{Promise.resolve().then(r.bind(r,88512))},88512:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var a=r(95155),s=r(12115),l=r(35497),i=r(28777),n=r(88105);let d="basic-chat.sessions",o="basic-chat.activeSessionId",c="basic-chat.activeProviderId",m="basic-chat.draft";function u(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function x(e){if("string"==typeof e)return e;if(null==e)return"";if(Array.isArray(e))return e.map(x).filter(Boolean).join(" ");if("object"==typeof e){if("string"==typeof e.message)return e.message;if("string"==typeof e.error)return e.error;try{return JSON.stringify(e)}catch{}}return String(e)}function p(e=""){let t=x(e).replace(/\s+/g," ").trim();return t?t.length>52?`${t.slice(0,52).trimEnd()}…`:t:"New chat"}async function f(e){return await new Promise((t,r)=>{let a=new FileReader;a.onload=()=>t(String(a.result||"")),a.onerror=()=>r(a.error||Error("Failed to read file")),a.readAsDataURL(e)})}function h(e){return e?.name||function(e=""){return String(e).replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()||"Unknown"}(e?.provider||e?.id||"provider")}function g(){let[e,t]=(0,s.useState)([]),[r,g]=(0,s.useState)(!0),[b,v]=(0,s.useState)(""),[y,N]=(0,s.useState)(()=>{try{let e=function(e,t){try{return JSON.parse(e)}catch{return t}}(globalThis.localStorage.getItem(d),[]);return Array.isArray(e)?e.map(e=>({...e,messages:Array.isArray(e.messages)?e.messages:[]})):[]}catch{return[]}}),[w,j]=(0,s.useState)(()=>globalThis.localStorage.getItem(o)||""),[S,I]=(0,s.useState)(()=>globalThis.localStorage.getItem(c)||""),[A,k]=(0,s.useState)(""),[D,O]=(0,s.useState)(()=>globalThis.localStorage.getItem(m)||""),[$,C]=(0,s.useState)([]),[_,M]=(0,s.useState)(!1),[E,T]=(0,s.useState)(""),[U,R]=(0,s.useState)(""),[z,q]=(0,s.useState)(!1),[P,J]=(0,s.useState)(!1),[B,F]=(0,s.useState)(!1),K=(0,s.useRef)(null),L=(0,s.useRef)(null),W=(0,s.useRef)(!1),H=(0,s.useRef)(null),Y=(0,s.useRef)(null);(0,s.useEffect)(()=>{q(!0)},[]),(0,s.useEffect)(()=>{let e=!1;return async function(){g(!0),v("");try{let r=await fetch("/api/providers",{cache:"no-store"}),a=await r.json().catch(()=>({})),s=Array.isArray(a.connections)?a.connections.filter(e=>e?.isActive!==!1):[];if(0===s.length){e||(t([]),v("No providers connected yet."));return}let l=new Map;for(let e of s){let t=e.provider||e.id,r=h(e),a=(0,n.mq)(t)?"openai-compatible":(0,n.gb)(t)?"anthropic-compatible":t;l.has(t)||l.set(t,{providerId:t,providerName:r,providerType:a,connections:[],models:[]});let s=l.get(t);s.providerName=s.providerName||r,s.providerType=s.providerType||a,s.connections.push(e);let d=(0,i.KC)(t).map(t=>t?.id?{id:`${e.provider}/${t.id}`,requestModel:`${e.provider}/${t.id}`,name:t.name||t.id,providerId:e.provider,providerName:h(e),source:"static"}:null).filter(Boolean);s.models.push(...d)}for(let e of(await Promise.all(s.map(async e=>{try{let t=await fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)return{connection:e,models:[]};let a=(Array.isArray(r?.models)?r.models:Array.isArray(r?.data)?r.data:Array.isArray(r?.results)?r.results:Array.isArray(r)?r:[]).map(t=>(function(e,t){let r="string"==typeof e?e:e?.id||e?.name||e?.model||"";if(!r)return null;let a="string"==typeof e?e:e?.name||e?.displayName||r,s=r;return((0,n.mq)(t.provider)||(0,n.gb)(t.provider))&&!r.includes("/")&&(s=`${t.provider}/${r}`),{id:s,requestModel:s,name:a,providerId:t.provider,providerName:h(t),source:"live"}})(t,e)).filter(Boolean);return{connection:e,models:a}}catch{return{connection:e,models:[]}}})))){let t=e.connection.provider||e.connection.id,r=l.get(t);r&&r.models.push(...e.models)}let d=Array.from(l.values()).map(e=>({...e,models:(function(e){let t=new Map;for(let r of e)r?.id&&(t.has(r.id)||t.set(r.id,r));return Array.from(t.values())})(e.models).sort((e,t)=>e.name.localeCompare(t.name))})).filter(e=>e.models.length>0).sort((e,t)=>e.providerName.localeCompare(t.providerName));e||(t(d),0===d.length&&v("Providers connected but no models available."))}catch(r){e||(v(x(r?.message)||"Failed to load providers/models."),t([]))}finally{e||g(!1)}}(),()=>{e=!0}},[]),(0,s.useEffect)(()=>{let e=e=>{H.current&&!H.current.contains(e.target)&&J(!1),Y.current&&!Y.current.contains(e.target)&&F(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let G=(0,s.useMemo)(()=>{let t=new Map;for(let r of e)for(let e of r.models)t.set(e.id,{...e,providerId:r.providerId,providerName:r.providerName});return t},[e]),Q=(0,s.useMemo)(()=>e.find(e=>e.providerId===S)||e[0]||null,[e,S]),V=(0,s.useMemo)(()=>{if(A&&G.has(A))return G.get(A);if(w){let e=y.find(e=>e.id===w);if(e?.modelId&&G.has(e.modelId))return G.get(e.modelId)}return Q?.models?.[0]||null},[A,G,Q,y,w]),X=(0,s.useMemo)(()=>y.find(e=>e.id===w)||null,[y,w]),Z=X?.messages||[],ee=(0,s.useMemo)(()=>[...y].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()),[y]),et=!_&&!!V&&(D.trim().length>0||$.length>0);(0,s.useEffect)(()=>{if(z)try{globalThis.localStorage.setItem(d,JSON.stringify(y)),globalThis.localStorage.setItem(o,w),globalThis.localStorage.setItem(c,S),globalThis.localStorage.setItem(m,D)}catch{}},[z,y,w,S,D]),(0,s.useEffect)(()=>{if(!z||r||W.current||0===e.length)return;let t=e.find(e=>e.providerId===S)||e[0],a=A&&G.has(A)?G.get(A):t.models[0];if(y.length>0){let e=y.find(e=>e.id===w)||y[0],r=e?.modelId&&G.has(e.modelId)?G.get(e.modelId):a;W.current=!0,j(e.id),I(r?.providerId||t.providerId),k(r?.id||a.id);return}let s={id:u(),title:"New chat",providerId:t.providerId,providerName:t.providerName,modelId:a.id,modelName:a.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]};W.current=!0,N([s]),j(s.id),I(t.providerId),k(a.id)},[z,r,e,G,y,w,S,A]);let er=(e,t)=>{N(r=>r.map(r=>r.id===e?t({...r,messages:Array.isArray(r.messages)?r.messages.map(e=>({...e})):[]}):r))},ea=e=>e?{id:u(),title:"New chat",providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,es=async e=>{let t=Array.from(e.target.files||[]);if(0===t.length)return;let r=t.filter(e=>e.type.startsWith("image/"));if(0===r.length){e.target.value="";return}let a=await Promise.all(r.map(async e=>({id:u(),name:e.name,type:e.type,size:e.size,dataUrl:await f(e)})));C(e=>[...e,...a]),e.target.value=""},el=async()=>{let e=V||Q?.models?.[0]||null;if(!e)return;let t=D.trim();if(!t&&0===$.length)return;let r=w,a=y.find(e=>e.id===r);if(!a){if(!(a=ea(e)))return;r=a.id,N(e=>[a,...e]),j(r)}let s={id:u(),role:"user",content:t,attachments:$.map(e=>({id:e.id,name:e.name,type:e.type,dataUrl:e.dataUrl})),createdAt:new Date().toISOString()},l=u(),i={id:l,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},n=[...a.messages||[],s,i];N(a=>a.map(a=>a.id===r?{...a,providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,messages:n,updatedAt:new Date().toISOString(),title:"New chat"===a.title?p(t):a.title}:a)),O(""),C([]),M(!0),T(l),R(""),L.current?.abort(),L.current=new AbortController;let d=n.filter(e=>"assistant"!==e.role||e.id!==l).map(e=>({role:e.role,content:"user"===e.role?function(e){let t=x(e.content).trim(),r=Array.isArray(e.attachments)?e.attachments:[];if(0===r.length)return t;let a=[];for(let e of(t&&a.push({type:"text",text:t}),r))e?.dataUrl&&a.push({type:"image_url",image_url:{url:e.dataUrl}});return a.length>0?a:t}(e):e.content}));try{var o;let a,s=await fetch("/api/dashboard/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:e.requestModel||e.id,messages:d,stream:!0}),signal:L.current.signal});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(x(e.error||e.message||`Request failed (${s.status})`))}let i=s.body?.getReader();if(!i){let e=await s.json().catch(()=>({})),t=x(e?.choices?.[0]?.message?.content||e?.output_text||e?.error||e?.message||"");er(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:t,status:"done"}:e),updatedAt:new Date().toISOString()}));return}let n=new TextDecoder,c="",m="";for(;;){let{value:e,done:t}=await i.read();if(t)break;let a=(c+=n.decode(e,{stream:!0})).split(/\r?\n/);for(let e of(c=a.pop()||"",a)){let t=e.trim();if(!t.startsWith("data:"))continue;let a=t.slice(5).trim();if(a&&"[DONE]"!==a)try{let e=JSON.parse(a),t=function(e){if(!e||"object"!=typeof e)return"";let t=e.choices?.[0];return[(t?.delta||{}).content,t?.message?.content,e.output_text,e.text].map(x).filter(Boolean)[0]||""}(e);if(!t)continue;m+=t,R(m),er(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:m,status:"streaming"}:e),updatedAt:new Date().toISOString()}))}catch{}}}er(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:m||e.content,status:"done"}:e),updatedAt:new Date().toISOString()})),o=r,a=p(t),er(o,e=>({...e,title:"New chat"===e.title?a:e.title,updatedAt:new Date().toISOString()}))}catch(e){if("AbortError"!==e.name){let t=x(e?.message||e);er(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:e.content||`Error: ${t}`,status:"error"}:e),updatedAt:new Date().toISOString()})),v(t||"Failed to send message.")}}finally{M(!1),T(""),R(""),L.current=null}},ei=V?`${V.name}`:"Select model",en=V?V.requestModel:"Choose from connected providers";return(0,a.jsx)("div",{className:"relative flex-1 flex flex-col h-full min-h-0 min-w-0 bg-bg text-text-main overflow-hidden",children:(0,a.jsxs)("div",{className:"relative mx-auto flex flex-1 h-full min-h-0 w-full max-w-4xl flex-col",children:[(0,a.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3 lg:px-6",children:[(0,a.jsxs)("div",{ref:H,className:"relative",children:[(0,a.jsx)("button",{type:"button",onClick:()=>J(e=>!e),className:"flex items-center gap-3 rounded-2xl border border-border-subtle bg-surface-2 px-4 py-3 text-left transition hover:bg-surface-3",children:(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-semibold text-text-main",children:ei}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"expand_more"})]}),(0,a.jsx)("p",{className:"truncate text-xs text-text-muted",children:en})]})}),P?(0,a.jsxs)("div",{className:"absolute left-0 top-[calc(100%+10px)] z-30 w-[min(520px,calc(100vw-2rem))] overflow-hidden rounded-[20px] border border-border-subtle bg-surface shadow-2xl shadow-black/40",children:[(0,a.jsxs)("div",{className:"border-b border-border-subtle px-4 py-3",children:[(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-text-subtle",children:"Models"}),(0,a.jsx)("p",{className:"text-sm text-text-main",children:"Only from connected providers"})]}),(0,a.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-2 custom-scrollbar",children:e.map(e=>(0,a.jsxs)("div",{className:"mb-2 rounded-[16px] border border-border-subtle bg-surface-3 p-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-2 py-2",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:e.providerName}),(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:e.models.length})]}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:e.models.map(e=>{let t=e.id===A;return(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{let t=G.get(e);if(!t)return;let r=y.find(e=>e.id===w);if(r&&r.messages.length>0){let e=ea(t);if(!e)return;N(t=>[e,...t]),j(e.id)}else if(r)N(e=>e.map(e=>e.id===r.id?{...e,providerId:t.providerId,providerName:t.providerName,modelId:t.id,modelName:t.name}:e)),j(r.id);else{let e=ea(t);if(!e)return;N(t=>[e,...t]),j(e.id)}I(t.providerId),k(t.id),J(!1)})(e.id),className:`rounded-[14px] border px-3 py-3 text-left transition ${t?"border-primary/40 bg-primary/15":"border-border-subtle bg-surface-2 hover:bg-surface-3"}`,children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:e.name}),(0,a.jsx)("p",{className:"truncate text-[11px] text-text-subtle",children:e.requestModel})]}),t?(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"check_circle"}):null]})},e.id)})})]},e.providerId))})]}):null]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>F(e=>!e),className:"rounded-2xl border border-border-subtle bg-surface-2 px-4 py-3 text-sm text-text-main transition hover:bg-surface-3",children:"History"}),(0,a.jsx)(l.$n,{variant:"ghost",size:"sm",icon:"delete",onClick:()=>{if(!w)return;let e=y.filter(e=>e.id!==w),t=e[0]||null;N(e),t?(j(t.id),I(t.providerId),k(t.modelId)):(j(""),I(""),k(""))},disabled:!w||0===y.length,children:"Clear"})]})]}),B?(0,a.jsxs)("div",{ref:Y,className:"absolute right-4 top-[72px] z-20 w-[min(360px,calc(100vw-2rem))] rounded-[20px] border border-border-subtle bg-surface p-2 shadow-2xl shadow-black/40 lg:right-6",children:[(0,a.jsx)("div",{className:"px-3 py-2",children:(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-text-subtle",children:"Recent chats"})}),(0,a.jsx)("div",{className:"max-h-[48vh] space-y-2 overflow-y-auto p-1 custom-scrollbar",children:0===ee.length?(0,a.jsx)("div",{className:"rounded-[16px] border border-dashed border-border-subtle bg-surface-2 p-4 text-sm text-text-muted",children:"No conversations yet."}):ee.map(e=>{let t=e.id===w,r=[...e.messages||[]].reverse().find(e=>"user"===e.role)||e.messages?.[0];return(0,a.jsx)("button",{type:"button",onClick:()=>{var t;let r;return t=e.id,void((r=y.find(e=>e.id===t))&&(j(t),I(r.providerId||S),k(r.modelId||A),F(!1)))},className:`w-full rounded-[16px] border px-3 py-3 text-left transition ${t?"border-primary/40 bg-primary/15":"border-border-subtle bg-surface-2 hover:bg-surface-3"}`,children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:e.title}),(0,a.jsx)("p",{className:"mt-1 truncate text-xs text-text-muted",children:x(r?.content)||"Empty chat"})]}),(0,a.jsx)("span",{className:"text-[10px] text-text-subtle shrink-0",children:function(e){if(!e)return"Now";let t=new Date(e).getTime();if(Number.isNaN(t))return"Now";let r=Math.max(1,Math.round((Date.now()-t)/6e4));if(r<60)return`${r}m`;let a=Math.round(r/60);return a<24?`${a}h`:`${Math.round(a/24)}d`}(e.updatedAt)})]})},e.id)})})]}):null,b?(0,a.jsx)("div",{className:"mt-4 rounded-[18px] border border-danger/20 bg-danger/10 px-4 py-3 text-danger",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"error"}),(0,a.jsx)("p",{className:"text-sm leading-6",children:b})]})}):null,(0,a.jsxs)("div",{className:"flex flex-1 flex-col min-h-0",children:[(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 custom-scrollbar",children:[0===Z.length?(0,a.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center px-4 text-center",children:(0,a.jsxs)("div",{className:"max-w-xl space-y-4",children:[(0,a.jsx)("div",{className:"mx-auto flex size-16 items-center justify-center rounded-[20px] border border-border-subtle bg-surface-2 text-text-main",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[30px]",children:"chat"})}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h2",{className:"text-2xl font-semibold text-text-main",children:"Start a conversation"}),(0,a.jsx)("p",{className:"text-sm leading-6 text-text-muted",children:"Simple chat interface to interact with any AI model from connected providers. Select a model and start chatting!"})]})]})}):null,(0,a.jsx)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4",children:Z.map(e=>{let t="user"===e.role,r="assistant"===e.role,s=r&&e.id===E&&"streaming"===e.status,l=x(e.content)||(r?U:"");return(0,a.jsx)("div",{className:`flex w-full ${t?"justify-end":"justify-start"} mb-6`,children:(0,a.jsxs)("div",{className:`max-w-[min(88%,42rem)] ${t?"rounded-3xl bg-surface-2 px-5 py-3.5 text-text-main":"text-text-main"}`,children:[(0,a.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,a.jsx)("span",{className:"text-xs font-semibold",children:t?"You":V?.name||"Assistant"})}),e.attachments?.length?(0,a.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 sm:grid-cols-3 mt-2",children:e.attachments.map(e=>(0,a.jsx)("a",{href:e.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-[18px] border border-border-subtle bg-surface-3",children:(0,a.jsx)("img",{src:e.dataUrl,alt:e.name,className:"h-28 w-full object-cover"})},e.id))}):null,(0,a.jsxs)("div",{className:"whitespace-pre-wrap break-words text-[15px] leading-7",children:[l,r&&s&&!U?(0,a.jsx)("span",{className:"inline-block animate-pulse",children:"▋"}):null]})]})},e.id)})})]}),(0,a.jsxs)("div",{className:"shrink-0 pt-2",children:[$.length>0?(0,a.jsx)("div",{className:"mx-auto mb-3 flex w-full max-w-3xl flex-wrap gap-2 px-4",children:$.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-border-subtle bg-surface-2 px-3 py-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-main max-w-[12rem] truncate",children:e.name}),(0,a.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void C(e=>e.filter(e=>e.id!==t))},className:"text-text-muted hover:text-text-main","aria-label":"Remove attachment",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]},e.id))}):null,(0,a.jsx)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-2",children:(0,a.jsxs)("div",{className:"rounded-[26px] bg-surface-2 px-3 pt-3 pb-2 shadow-[0_0_15px_rgba(0,0,0,0.10)] ring-1 ring-border-subtle",children:[(0,a.jsx)("textarea",{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),et&&el())},placeholder:"Message AI",rows:1,className:"w-full resize-none bg-transparent px-2 text-[15px] leading-6 text-text-main outline-none placeholder:text-text-subtle custom-scrollbar max-h-[25vh] overflow-y-auto"}),(0,a.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>K.current?.click(),disabled:!V||r,className:"p-2 text-text-muted hover:text-text-main transition rounded-full hover:bg-surface-2",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"attach_file"})}),(0,a.jsx)("input",{ref:K,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:es}),(0,a.jsx)("span",{className:"text-xs font-medium text-text-subtle truncate max-w-[120px]",children:V?V.name:"No model"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[_?(0,a.jsx)("button",{type:"button",onClick:()=>{L.current?.abort()},className:"p-2 text-text-main bg-surface-3 hover:bg-surface-3 transition rounded-full h-8 w-8 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop"})}):null,(0,a.jsx)("button",{onClick:el,disabled:!et,className:`h-8 w-8 rounded-full flex items-center justify-center transition ${et?"bg-primary text-white hover:opacity-90":"bg-surface-3 text-text-subtle cursor-not-allowed"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})})]})]})]})})]}),(0,a.jsx)("p",{className:"mx-auto mt-2 max-w-3xl px-4 pb-4 text-center text-[11px] text-text-subtle",children:"Model list is filtered from connected providers."})]})]})})}}},e=>{e.O(0,[27,8105,705,1321,5497,8441,3794,7358],()=>e(e.s=86508)),_N_E=e.O()}]);
@@ -1,3 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{57410:(e,t,a)=>{Promise.resolve().then(a.bind(a,85330))},85330:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>R});var s=a(95155),l=a(12115),r=a(73321),n=a(35497),o=a(11059);let i=/^[a-zA-Z0-9_.\-]+$/,d=[{value:"fallback",label:"Fallback",desc:"Try models in order, next on failure",icon:"layers"},{value:"round-robin",label:"Round Robin",desc:"Rotate models across requests",icon:"cached"},{value:"fusion",label:"Fusion",desc:"Parallel panel + judge synthesis",icon:"hub"},{value:"swarm",label:"Swarm",desc:"Hierarchical Manager→Staff→Workers",icon:"account_tree"},{value:"cascade",label:"Cascade",desc:"Escalate cheap→capable on low confidence",icon:"trending_up"}],c={fallback:{icon:"layers",color:"#3B82F6",badge:"info"},"round-robin":{icon:"cached",color:"#10B981",badge:"success"},fusion:{icon:"hub",color:"#8B5CF6",badge:"primary"},swarm:{icon:"account_tree",color:"#F59E0B",badge:"warning"},cascade:{icon:"trending_up",color:"#06B6D4",badge:"cyan"}};function m(e){return c[e]||c.fallback}function x(e){let t=d.find(t=>t.value===e);return t?.label||"Fallback"}let u=[{value:"all",label:"All"},{value:"fallback",label:"Fallback"},{value:"round-robin",label:"Round Robin"},{value:"fusion",label:"Fusion"},{value:"swarm",label:"Swarm"},{value:"cascade",label:"Cascade"}],p=[{value:"name",label:"Name"},{value:"models-desc",label:"Most Models"},{value:"models-asc",label:"Fewest Models"}];function b({combos:e,comboStrategies:t,activeProviders:a,onViewCombos:l,onCreate:r}){let o=e.length,i=function(e){let t=new Set;for(let a of e)for(let e of a.models||[])t.add(e);return t.size}(e),d=function(e,t){let a={fallback:0,"round-robin":0,fusion:0,swarm:0,cascade:0},s=new Set(["fallback","round-robin","fusion","swarm","cascade"]);for(let l of e){let e=t[l.name]?.fallbackStrategy||"fallback",r=s.has(e)?e:"fallback";a[r]=(a[r]||0)+1}return a}(e,t),c=Object.values(d).filter(e=>e>0).length,u=o>0?Math.round(e.reduce((e,t)=>e+(t.models?.length||0),0)/o*10)/10:0,p=Math.max(...Object.values(d),1);return(0,s.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[{label:"Total Combos",value:o,icon:"layers",color:"#3B82F6"},{label:"Unique Models",value:i,icon:"model_training",color:"#10B981"},{label:"Strategies Used",value:c,icon:"account_tree",color:"#8B5CF6"},{label:"Avg Models/Combo",value:u,icon:"analytics",color:"#F59E0B"}].map(e=>(0,s.jsx)(n.Zp,{padding:"sm",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e.color}15`},children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:e.color},children:e.icon})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-mono text-lg font-bold text-text-main",children:e.value}),(0,s.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:e.label})]})]})},e.label))}),(0,s.jsxs)(n.Zp,{children:[(0,s.jsxs)("div",{className:"mb-3",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Strategy Distribution"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"How combos are distributed across routing strategies"})]}),(0,s.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(d).map(([e,t])=>{let a=m(e),l=o>0?Math.round(t/o*100):0;return(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("div",{className:"flex w-28 items-center gap-1.5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:{color:a.color},children:a.icon}),(0,s.jsx)("span",{className:"text-xs font-medium text-text-main",children:x(e)})]}),(0,s.jsx)("div",{className:"flex-1 overflow-hidden rounded-full bg-surface-2",children:(0,s.jsx)("div",{className:"h-2.5 rounded-full transition-all",style:{width:`${t/p*100}%`,backgroundColor:a.color}})}),(0,s.jsxs)("span",{className:"w-16 text-right font-mono text-xs text-text-muted",children:[t," (",l,"%)"]})]},e)})})]}),(0,s.jsxs)(n.Zp,{children:[(0,s.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Combo Health"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Overview of each combo's status"})]}),(0,s.jsx)(n.$n,{size:"sm",variant:"ghost",icon:"list_alt",onClick:l,children:"View All"})]}),0===e.length?(0,s.jsxs)("div",{className:"py-6 text-center text-sm text-text-muted",children:["No combos yet. ",(0,s.jsx)("button",{onClick:r,className:"text-primary hover:underline",children:"Create one →"})]}):(0,s.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>{let l=t[e.name]?.fallbackStrategy||"fallback",r=m(l),o=(e.models||[]).filter(e=>{let t=e.split("/")[0];return a.some(e=>e.provider===t&&!1!==e.isActive)}).length,i=(e.models||[]).length,d=i>0?Math.round(o/i*100):0;return(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle px-3 py-2 hover:bg-sidebar/30",children:[(0,s.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded",style:{backgroundColor:`${r.color}15`},children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[15px]",style:{color:r.color},children:r.icon})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("code",{className:"truncate font-mono text-xs font-medium",children:e.name}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,s.jsx)(n.Ex,{variant:r.badge,size:"sm",children:x(l)}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:[i," models"]})]})]}),(0,s.jsxs)("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[(0,s.jsx)("div",{className:"w-20 overflow-hidden rounded-full bg-surface-2",children:(0,s.jsx)("div",{className:`h-1.5 rounded-full ${d>=80?"bg-success":d>=50?"bg-warning":"bg-danger"}`,style:{width:`${d}%`}})}),(0,s.jsxs)("span",{className:"w-8 text-right font-mono text-[10px] text-text-muted",children:[o,"/",i]})]})]},e.id)})})]})]})}var h=a(88105);let g=[{value:"auto",label:"Auto (provider default)"},{value:"off",label:"Off"},{value:"effort",label:"Effort (OpenAI-style)"},{value:"extended",label:"Extended (Claude-style)"}],f=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"max",label:"Max"}],v=[{key:"manager",label:"Manager",icon:"psychology"},{key:"staff",label:"Staff",icon:"badge"},{key:"audit",label:"Audit",icon:"fact_check"},{key:"worker",label:"Worker",icon:"group"}],y=[{key:"panel",label:"Panel",icon:"dashboard"},{key:"judge",label:"Judge",icon:"gavel"}],j=e=>"unlimited"===e||e===1/0||"Infinity"===e;function N(e){let t=h.Q2[e]?.capabilities;return!t||!1!==t.toolUse&&!1!==t.fileAccess}function k(e){if(!e||"string"!=typeof e)return null;let t=e.indexOf("/");return t>=0?e.slice(0,t):e}function w(e,t){if(e){let t=k(e);return{blocked:!!t&&!N(t),provider:t}}let a=k(t&&t.length>0?t[0]:null);return{blocked:!!a&&!N(a),provider:a}}function C(e){return e.filter(e=>N(e.provider))}function S({combo:e,modelCaps:t={},activeProviders:a=[],copied:r,onCopy:o,onEdit:i,onDelete:c,strategy:u={},onSetStrategy:p}){let[b,h]=(0,l.useState)(!1),[N,k]=(0,l.useState)(!1),[M,$]=(0,l.useState)(null),F=Array.isArray(e?.models)?e.models:[],E=u.fallbackStrategy||"fallback",A=u.judgeModel||"",O="fusion"===E,T="swarm"===E,P=u.managerModel||"",z=u.staffModel||"",_=u.auditModel||"",D=m(E),R=(e=>{let t=e?.budgets?.maxEstimatedCostUsd;if(j(t))return 1/0;let a=Number(t);return Number.isFinite(a)&&a>0?a:5})(u),U=j(u?.budgets?.maxEstimatedCostUsd),B=u?.budgets?.enabled===!0,W=B&&u?.budgets?.maxEstimatedCostUsd!=null&&!U&&Number(u.budgets.maxEstimatedCostUsd)>0,J=e=>{let t=Number(e);Number.isFinite(t)&&!(t<=0)&&p({budgets:{...u.budgets||{},enabled:!0,maxEstimatedCostUsd:t}})},q=u.thinking||{},H=q.type||"auto",L="auto"!==H&&"off"!==H,[I,Z]=(0,l.useState)([]),G=e=>p({thinking:{...q,...e}}),V=(e,t)=>{let a={...q.roles||{}};null===t?delete a[e]:a[e]={...a[e]||{},...t},G({roles:a})},Q=F.map(e=>({model:e,caps:t[e]||{}})),K=Q.some(e=>{let t=e.caps.thinkingFormat;return!!e.caps.reasoning&&("openai"===t||"effort"===t||"deepseek"===t||!t)}),Y=Q.some(e=>{let t=e.caps.thinkingFormat;return!!e.caps.reasoning&&("claude-adaptive"===t||"claude"===t||"extended"===t)}),X=Q.some(e=>!!e.caps.thinkingMaxEffort),ee=Q.filter(e=>!e.caps.reasoning&&void 0!==e.caps.reasoning),et="effort"===H?Q.filter(e=>!0===e.caps.reasoning&&e.caps.thinkingFormat&&"openai"!==e.caps.thinkingFormat&&"effort"!==e.caps.thinkingFormat&&"deepseek"!==e.caps.thinkingFormat):"extended"===H?Q.filter(e=>!0===e.caps.reasoning&&e.caps.thinkingFormat&&"claude-adaptive"!==e.caps.thinkingFormat&&"claude"!==e.caps.thinkingFormat&&"extended"!==e.caps.thinkingFormat):[];return(0,s.jsxs)(n.Zp,{padding:"sm",className:"group transition-all hover:border-primary/20",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("button",{className:"flex min-w-0 flex-1 items-start gap-3 text-left sm:items-center",onClick:()=>h(!b),children:[(0,s.jsx)("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${D.color}15`},children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:D.color},children:D.icon})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("code",{className:"truncate font-mono text-sm font-medium",children:e.name}),(0,s.jsx)(n.Ex,{variant:D.badge,size:"sm",children:x(E)}),L&&(0,s.jsxs)(n.Ex,{variant:"cyan",size:"sm",className:"flex items-center gap-0.5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:"psychology"}),"effort"===H?q.effort||"on":H]}),B&&(0,s.jsxs)(n.Ex,{variant:"warning",size:"sm",className:"flex items-center gap-0.5",title:`Max cost budget: $${R.toFixed(2)} per request`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:"savings"}),"$",R.toFixed(2)]}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:[F.length," models"]})]}),(0,s.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===F.length?(0,s.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):F.slice(0,3).map((e,a)=>(0,s.jsxs)("code",{className:"inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-text-muted dark:bg-white/5",children:[(0,s.jsx)("span",{className:"truncate max-w-[120px]",children:e}),t[e]&&(0,s.jsx)(n.nh,{caps:t[e],size:11})]},a)),F.length>3&&(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",F.length-3," more"]})]})]}),(0,s.jsx)("span",{className:`shrink-0 text-text-muted transition-transform ${b?"rotate-180":""}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"expand_more"})})]}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,s.jsx)("div",{className:"w-full sm:w-[180px]",children:(0,s.jsx)(n.l6,{options:d,value:E,onChange:e=>p({fallbackStrategy:e.target.value}),selectClassName:"py-1.5 text-xs"})}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-1 sm:flex",children:[(0,s.jsxs)("button",{onClick:t=>{t.stopPropagation(),o(e.name,`combo-${e.id}`)},className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Copy combo name",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:r===`combo-${e.id}`?"check":"content_copy"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Copy"})]}),(0,s.jsxs)("button",{onClick:i,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Edit",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:c,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 transition-colors hover:bg-red-500/10",title:"Delete",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]})]})]}),b&&(0,s.jsxs)("div",{className:"mt-3 border-t border-border-subtle pt-3",children:[(0,s.jsxs)("div",{className:"mb-3",children:[(0,s.jsxs)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted mb-1.5",children:["Models (",F.length,")"]}),(0,s.jsx)("div",{className:"flex flex-col gap-1",children:F.map((e,a)=>(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded px-2 py-1 bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,s.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-4 text-center",children:a+1}),(0,s.jsx)("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-text-main",children:e}),t[e]&&(0,s.jsx)(n.nh,{caps:t[e],size:11})]},a))})]}),O&&(0,s.jsxs)("div",{className:"mb-3",children:[(0,s.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted mb-1.5",children:"Fusion Judge"}),(()=>{let{blocked:e,provider:t}=w(A,F);return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("button",{onClick:()=>k(!0),className:`inline-flex max-w-full items-center gap-1 rounded border border-dashed px-2 py-1 font-mono text-xs hover:bg-primary/5 ${e?"border-red-400 text-red-500 hover:border-red-500":"border-primary/40 text-primary hover:border-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"gavel"}),(0,s.jsx)("span",{className:"truncate",children:A||`Auto — ${F[0]||"first model"}`})]}),A&&(0,s.jsx)("button",{onClick:()=>p({judgeModel:""}),className:"p-1 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10",title:"Reset to Auto",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),e&&(0,s.jsx)("p",{className:"text-[10px] text-red-500",children:A?"⚠ Web cookie providers cannot serve as Judge (no tool use / file access)":`⚠ Auto-fallback to "${t}" (first combo model) — web cookie cannot serve as Judge`})]})})()]}),T&&(0,s.jsxs)("div",{className:"mb-3",children:[(0,s.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted mb-1.5",children:"Swarm Roles"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[[{key:"manager",label:"Manager",icon:"psychology",value:P,placeholder:`Auto — ${F[0]||"first"}`},{key:"staff",label:"Staff",icon:"badge",value:z,placeholder:"Same as Manager"},{key:"audit",label:"Audit",icon:"fact_check",value:_,placeholder:"Same as Staff"}].map(e=>{let{blocked:t,provider:a}=w(e.value,F);return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs font-medium text-text-muted w-16",children:e.label}),(0,s.jsxs)("button",{onClick:()=>$(e.key),className:`inline-flex max-w-full items-center gap-1 rounded border border-dashed px-2 py-0.5 font-mono text-[11px] hover:bg-primary/5 ${t?"border-red-400 text-red-500 hover:border-red-500":"border-primary/40 text-primary hover:border-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:e.icon}),(0,s.jsx)("span",{className:"truncate",children:e.value||e.placeholder})]}),e.value&&(0,s.jsx)("button",{onClick:()=>p({[`${e.key}Model`]:""}),className:"p-0.5 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10",title:`Reset ${e.label}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]}),t&&(0,s.jsx)("p",{className:"text-[10px] text-red-500 pl-[76px]",children:e.value?`⚠ Web cookie providers cannot serve as ${e.label} (no tool use / file access)`:`⚠ Auto-fallback to "${a}" (first combo model) — web cookie cannot serve as ${e.label}`})]},e.key)}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted",children:[(0,s.jsx)("span",{className:"font-medium",children:"Workers"}),(0,s.jsxs)("span",{children:["= combo models (",F.length,")"]}),(0,s.jsx)("span",{className:"text-text-subtle",children:"\xb7"}),(0,s.jsx)("a",{href:"/dashboard/swarm",className:"text-primary hover:underline",children:"Telemetry →"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,s.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:u.autoScale?.enabled===!0,onChange:e=>p({autoScale:{...u.autoScale||{},enabled:e.target.checked}}),className:"rounded border-border accent-primary"}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"Auto-scale"})]}),u.autoScale?.enabled&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"Min:"}),(0,s.jsx)("input",{type:"number",min:1,max:u.autoScale?.maxWorkers||8,value:u.autoScale?.minWorkers??1,onChange:e=>p({autoScale:{...u.autoScale||{},minWorkers:Number(e.target.value)||1}}),className:"w-10 rounded border border-border bg-background px-1 py-0.5 text-[10px] font-mono text-center focus:outline-none focus:border-primary"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"Max:"}),(0,s.jsx)("input",{type:"number",min:1,max:8,value:u.autoScale?.maxWorkers??F.length,onChange:e=>p({autoScale:{...u.autoScale||{},maxWorkers:Number(e.target.value)||1}}),className:"w-10 rounded border border-border bg-background px-1 py-0.5 text-[10px] font-mono text-center focus:outline-none focus:border-primary"})]})]})]})]})]}),(0,s.jsxs)("div",{className:"mt-3 border-t border-border-subtle pt-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Thinking"}),(0,s.jsx)("button",{onClick:()=>Z(I.length>0?[]:(O?y:T?v:[]).map(e=>e.key)),className:"text-[10px] text-primary hover:underline",children:I.length>0?"Hide roles":`Role overrides${L?" ("+Object.keys(q.roles||{}).length+")":""}`})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("label",{className:"text-[10px] text-text-muted",children:"Mode:"}),(0,s.jsx)("select",{value:H,onChange:e=>G({type:e.target.value}),className:"rounded border border-border bg-background px-1.5 py-0.5 text-[11px] font-mono focus:outline-none focus:border-primary",children:g.map(e=>{let t="auto"===e.value||"off"===e.value||"effort"===e.value&&K||"extended"===e.value&&Y;return(0,s.jsxs)("option",{value:e.value,disabled:!t,className:t?"":"text-text-muted",children:[e.label,t?"":" (not supported)"]},e.value)})})]}),et.length>0&&(0,s.jsxs)("div",{className:"flex items-center gap-1 text-amber-600 dark:text-amber-400",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsxs)("span",{className:"text-[10px]",children:[H," not supported by ",et.map(e=>e.model.split("/").pop()).join(", ")]})]}),ee.length>0&&"auto"!==H&&"off"!==H&&(0,s.jsxs)("div",{className:"flex items-center gap-1 text-amber-600 dark:text-amber-400",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsxs)("span",{className:"text-[10px]",children:["Thinking capability unknown for ",ee.map(e=>e.model.split("/").pop()).join(", ")]})]}),"effort"===H&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("label",{className:"text-[10px] text-text-muted",children:"Effort:"}),(0,s.jsx)("select",{value:q.effort||"high",onChange:e=>G({effort:e.target.value}),className:"rounded border border-border bg-background px-1.5 py-0.5 text-[11px] font-mono focus:outline-none focus:border-primary",children:f.map(e=>{let t="max"!==e.value||X;return(0,s.jsxs)("option",{value:e.value,disabled:!t,className:t?"":"text-text-muted",children:[e.label,t?"":" (not supported)"]},e.value)})})]}),"extended"===H&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("label",{className:"text-[10px] text-text-muted",children:"Budget:"}),(0,s.jsx)("input",{type:"number",min:1024,max:128e3,step:1024,value:q.budgetTokens||4096,onChange:e=>G({budgetTokens:Number(e.target.value)||4096}),className:"w-20 rounded border border-border bg-background px-1.5 py-0.5 text-[11px] font-mono focus:outline-none focus:border-primary"})]})]}),I.length>0&&L&&(0,s.jsxs)("div",{className:"mt-2 flex flex-col gap-1.5 pl-1",children:[(0,s.jsx)("p",{className:"text-[10px] text-text-muted",children:"Per-role overrides (leave as parent to inherit global)"}),(O?y:T?v:[]).map(e=>{let t,a=(t=e.key,q?.roles?.[t]);return(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px] text-text-muted",children:e.icon}),(0,s.jsx)("span",{className:"text-[11px] font-medium text-text-muted w-12",children:e.label}),(0,s.jsxs)("select",{value:a?.type||"inherit",onChange:t=>V(e.key,"inherit"===t.target.value?null:{type:t.target.value}),className:"rounded border border-border bg-background px-1 py-0.5 text-[10px] font-mono focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"inherit",children:"Inherit"}),(0,s.jsx)("option",{value:"off",children:"Off"}),(0,s.jsxs)("option",{value:"effort",disabled:!K,className:K?"":"text-text-muted",children:["Effort",K?"":" (not supported)"]}),(0,s.jsxs)("option",{value:"extended",disabled:!Y,className:Y?"":"text-text-muted",children:["Extended",Y?"":" (not supported)"]})]}),a?.type==="effort"&&(0,s.jsx)("select",{value:a.effort||"high",onChange:t=>V(e.key,{type:"effort",effort:t.target.value}),className:"rounded border border-border bg-background px-1 py-0.5 text-[10px] font-mono focus:outline-none focus:border-primary",children:f.map(e=>{let t="max"!==e.value||X;return(0,s.jsxs)("option",{value:e.value,disabled:!t,className:t?"":"text-text-muted",children:[e.label,t?"":" (not supported)"]},e.value)})}),a?.type==="extended"&&(0,s.jsx)("input",{type:"number",min:1024,max:128e3,step:1024,value:a.budgetTokens||4096,onChange:t=>V(e.key,{type:"extended",budgetTokens:Number(t.target.value)||4096}),className:"w-16 rounded border border-border bg-background px-1 py-0.5 text-[10px] font-mono focus:outline-none focus:border-primary"}),a&&(0,s.jsx)("button",{onClick:()=>V(e.key,null),className:"p-0.5 rounded text-text-muted hover:text-red-500",title:"Reset to inherit",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e.key)})]})]}),(0,s.jsxs)("div",{className:"text-xs text-text-muted bg-black/[0.02] dark:bg-white/[0.02] rounded px-2 py-1.5",children:[(0,s.jsxs)("span",{className:"font-medium",children:[x(E),":"]})," ",d.find(e=>e.value===E)?.desc]}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg border border-warning/20 bg-warning/[0.04] px-3 py-2",children:[(0,s.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:B,onChange:e=>{var t;return t=e.target.checked,void p({budgets:{...u.budgets||{},enabled:t}})},className:"rounded border accent-primary","aria-label":"Enable cost budget limit"}),(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-warning",children:"savings"}),(0,s.jsx)("span",{className:"text-[11px] font-semibold text-text-main",children:"Budget Limit"})]}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:B?"enabled":"off (no limit)"}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-[12px] font-medium text-text-muted",children:"$"}),(0,s.jsx)("input",{type:"number",min:.01,step:.5,value:U?"":R,onChange:e=>J(e.target.value),disabled:!B||U,"aria-label":"Max cost budget in USD per request",className:"w-20 rounded border border-border bg-background px-1.5 py-0.5 text-[11px] font-mono text-right focus:outline-none focus:border-primary disabled:opacity-60"}),(0,s.jsx)("button",{type:"button",onClick:U?()=>J(5):()=>{p({budgets:{...u.budgets||{},enabled:!0,maxEstimatedCostUsd:"unlimited"}})},disabled:!B,className:`rounded border px-2 py-0.5 text-[11px] font-medium ${U?"border-primary bg-primary/10 text-primary":"border-border text-text-muted hover:text-text-main"} disabled:opacity-40 disabled:cursor-not-allowed`,children:U?"Unlimited":"∞"})]}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"per request"}),(0,s.jsx)("span",{className:`text-[10px] ${W||U?"text-primary":"text-text-muted"}`,children:U?"Unlimited":W?`Custom $${Number(R).toFixed(2)}`:"Default $5.00"})]})]}),(0,s.jsx)(n.rq,{isOpen:N,onClose:()=>k(!1),onSelect:e=>{p({judgeModel:e?.value||""}),k(!1)},activeProviders:C(a),title:"Select Judge Model",addedModelValues:A?[A]:[],closeOnSelect:!0}),M&&(0,s.jsx)(n.rq,{isOpen:!0,onClose:()=>$(null),onSelect:e=>{p({[`${M}Model`]:e?.value||""}),$(null)},activeProviders:C(a),title:`Select ${"manager"===M?"Manager":"staff"===M?"Staff":"Audit"} Model`,addedModelValues:"manager"===M?P?[P]:[]:"staff"===M?z?[z]:[]:_?[_]:[],closeOnSelect:!0})]})}function M({combos:e,modelCaps:t,activeProviders:a,comboStrategies:r,copied:o,copy:i,onEdit:d,onDelete:c,onSetStrategy:m,onCreate:x}){let[b,h]=(0,l.useState)(""),[g,f]=(0,l.useState)("all"),[v,y]=(0,l.useState)("name"),j=(0,l.useMemo)(()=>{var t;let a;return t=function(e,t,a,s){let l=e;if("all"!==a&&(l=l.filter(e=>(s[e.name]?.fallbackStrategy||"fallback")===a)),t.trim()){let e=t.trim().toLowerCase();l=l.filter(t=>t.name.toLowerCase().includes(e)||(t.models||[]).some(t=>t.toLowerCase().includes(e)))}return l}(e,b,g,r),a=[...t],"models-desc"===v?a.sort((e,t)=>(t.models?.length||0)-(e.models?.length||0)):"models-asc"===v?a.sort((e,t)=>(e.models?.length||0)-(t.models?.length||0)):a.sort((e,t)=>e.name.localeCompare(t.name)),a},[e,b,g,v,r]);return 0===e.length?(0,s.jsx)(n.pp,{icon:"layers",title:"No combos yet",description:"Create model combos with fallback, round-robin, fusion, or swarm strategies",actionText:"Create Combo",onAction:x}):(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)(n.pd,{placeholder:"Search combos or models...",value:b,onChange:e=>h(e.target.value),className:"sm:max-w-xs"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:u.map(e=>(0,s.jsx)("button",{onClick:()=>f(e.value),className:`rounded-full px-2.5 py-1 text-xs font-medium transition-colors ${g===e.value?"bg-primary/15 text-primary ring-1 ring-primary/20":"bg-surface-2 text-text-muted hover:text-text-main"}`,children:e.label},e.value))}),(0,s.jsx)("select",{value:v,onChange:e=>y(e.target.value),className:"appearance-none rounded-lg border border-border bg-surface-2 py-1.5 pl-3 pr-8 text-xs text-text-main [-webkit-appearance:none] [-moz-appearance:none] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30",children:p.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))})]})]}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:j.length===e.length?`${e.length} combo${1!==e.length?"s":""}`:`${j.length} of ${e.length} combos`}),0===j.length?(0,s.jsx)(n.Zp,{children:(0,s.jsxs)("div",{className:"py-8 text-center text-sm text-text-muted",children:['No combos match "',b,'" ',"all"!==g&&`with ${g} strategy`]})}):(0,s.jsx)("div",{className:"flex flex-col gap-3",children:j.map(e=>(0,s.jsx)(S,{combo:e,modelCaps:t,activeProviders:a,copied:o,onCopy:i,onEdit:()=>d(e),onDelete:()=>c(e.id),strategy:r[e.name]||{},onSetStrategy:t=>m(e.name,t)},e.id))})]})}let $=[{id:"always-on",name:"Always-On (5-Layer Fallback)",description:"Zero-downtime coding with 5 layers of fallback. Mix of subscription, cheap, and free tiers — if any model fails, the next picks up automatically.",icon:"shield",category:"reliability",strategy:"fallback",models:["claude-opus-4-7","gpt-5.4","glm-5.1","MiniMax-M2.7","claude-sonnet-4.5"],preferredProviders:{"claude-opus-4-7":"cc","gpt-5.4":"cx","glm-5.1":"glm","MiniMax-M2.7":"minimax","claude-sonnet-4.5":"kr"}},{id:"max-reasoning-swarm",name:"Max Reasoning Swarm",description:"Deep multi-agent analysis for complex coding tasks. Manager decomposes the problem, workers solve subtasks in parallel, audit reviews the result. Manager thinks at max effort.",icon:"psychology",category:"reasoning",strategy:"swarm",models:["claude-opus-4-7","gpt-5.4","glm-5.1","claude-sonnet-4.5"],preferredProviders:{"claude-opus-4-7":"cc","gpt-5.4":"cx","glm-5.1":"glm","claude-sonnet-4.5":"kr"},strategyConfig:{fallbackStrategy:"swarm",managerModel:"claude-opus-4-7",auditModel:"claude-sonnet-4.5",thinking:{type:"effort",effort:"high",roles:{manager:{type:"effort",effort:"max"},worker:{type:"effort",effort:"medium"},audit:{type:"effort",effort:"high"}}},autoScale:{enabled:!0,minWorkers:2,maxWorkers:4}}},{id:"flash-fusion",name:"Flash Fusion",description:"Two fast models answer in parallel, a judge picks the best result. Low latency with a quality check — great for everyday coding questions.",icon:"bolt",category:"balanced",strategy:"fusion",models:["gpt-5.4","MiniMax-M2.7"],preferredProviders:{"gpt-5.4":"cx","MiniMax-M2.7":"minimax"},strategyConfig:{fallbackStrategy:"fusion",thinking:{type:"effort",effort:"medium"}}},{id:"penny-pincher",name:"Penny-Pincher",description:"Ultra-low-cost daily driver built from cheap and free tiers. Thinking disabled to keep tokens minimal. Use for simple tasks where cost matters most.",icon:"savings",category:"budget",strategy:"fallback",models:["MiniMax-M2.7","glm-5.1","gpt-5.4"],preferredProviders:{"MiniMax-M2.7":"minimax","glm-5.1":"glm","gpt-5.4":"kr"},strategyConfig:{fallbackStrategy:"fallback",thinking:{type:"off"}}},{id:"bug-hunter",name:"Bug Hunter",description:"Three models independently diagnose the same bug, a strong judge picks the most likely root cause. High-precision debugging with thinking on.",icon:"bug_report",category:"debugging",strategy:"fusion",models:["gpt-5.4","glm-5.1","MiniMax-M2.7"],preferredProviders:{"gpt-5.4":"cx","glm-5.1":"glm","MiniMax-M2.7":"minimax"},strategyConfig:{fallbackStrategy:"fusion",thinking:{type:"effort",effort:"high"}}}];function F({combos:e,connections:t,modelIndex:a={},onApply:r}){let[o,i]=(0,l.useState)(null),d=new Set(t?.filter(e=>!1!==e.isActive).map(e=>e.provider)||[]),c=new Set((e||[]).map(e=>e.name)),u=e=>(e.models||[]).map(t=>{let s=t.indexOf("/"),l=s>0,r=l?t.slice(s+1):t,n=(l?t.slice(0,s):"")||(e.preferredProviders||{})[r]||"",o=n?(0,h.rs)(n):"",i=(a[r]||[]).map(e=>(0,h.rs)(e)).filter(e=>d.has(e));if(o&&i.includes(o)){let e=(0,h.wG)(o);return{ref:t,modelName:r,provider:o,providerAlias:e,full:`${e}/${r}`,available:!0}}if(i.length>0){let e=(0,h.wG)(i[0]);return{ref:t,modelName:r,provider:i[0],providerAlias:e,full:`${e}/${r}`,available:!0,resolvedFrom:n}}return{ref:t,modelName:r,provider:o||n,full:l?t:r,available:!1}}),p=async e=>{i(e.id);try{let t=u(e),a=t.filter(e=>e.available).map(e=>e.full),s=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,models:a,kind:null})});if(!s.ok){let e=await s.json();alert(e.error||"Failed to create combo from template");return}let l=await fetch("/api/settings").then(e=>e.json()).catch(()=>({})),n=e.strategyConfig?{...e.strategyConfig}:{fallbackStrategy:e.strategy},o=Object.fromEntries(t.map(e=>[e.modelName,e.full]));for(let e of["managerModel","staffModel","auditModel","judgeModel"]){let t=n[e];if(!t)continue;let a=t.indexOf("/"),s=a>0?t.slice(a+1):t;o[s]&&(n[e]=o[s])}let i={...l?.comboStrategies||{},[e.name]:n},d=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:i})});if(!d.ok){let e=await d.json().catch(()=>({}));alert(e.error||"Failed to apply template strategy");return}r&&r()}catch(e){alert("Failed to apply template: "+(e?.message||String(e)))}finally{i(null)}};return 0===$.length?(0,s.jsx)(n.pp,{icon:"dashboard_customize",title:"No templates available",description:"Combo templates will appear here when added."}):(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"mb-1",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"Combo Templates"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"One-click prebuilt combos. Provider availability is checked automatically."})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:$.map(e=>{let t=u(e),a=t.filter(e=>e.available).length,l=t.length,r=c.has(e.name),i=m(e.strategy),d=a===l;return(0,s.jsxs)(n.Zp,{padding:"sm",className:"flex flex-col gap-3 hover:border-primary/20 transition-all",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,s.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${i.color}15`},children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:i.color},children:e.icon||i.icon})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-text-main",children:e.name}),(0,s.jsx)(n.Ex,{variant:i.badge,size:"sm",children:x(e.strategy)})]})]}),r&&(0,s.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Created"})]}),(0,s.jsx)("p",{className:"text-xs text-text-muted leading-relaxed",children:e.description}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[t.slice(0,4).map((e,t)=>(0,s.jsxs)("code",{className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 font-mono text-[10px] ${e.available?"bg-black/5 text-text-muted dark:bg-white/5":"bg-red-500/10 text-red-500"}`,title:e.available?`Resolved to ${e.provider}`:`No connected provider has ${e.modelName}`,children:[(0,s.jsx)("span",{className:e.available?"text-success":"text-red-500",children:e.available?"✓":"✗"}),(0,s.jsx)("span",{className:"truncate max-w-[110px]",children:e.modelName}),e.available&&(0,s.jsx)("span",{className:"rounded bg-black/10 px-0.5 text-[9px] dark:bg-white/10",children:e.provider})]},t)),t.length>4&&(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",t.length-4," more"]})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:t.map(e=>{let t=e.resolvedFrom?(0,h.rs)(e.resolvedFrom):"",a=e.available?`${e.provider}${e.resolvedFrom&&t!==e.provider?` (via ${e.resolvedFrom})`:""}`:`${e.provider||"?"} (missing)`,l=e.available;return(0,s.jsxs)("span",{className:`inline-flex items-center gap-0.5 rounded-full px-1.5 py-0.5 text-[10px] font-medium ${l?"bg-success/10 text-success":"bg-surface-2 text-text-muted"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:l?"check_circle":"radio_button_unchecked"}),a]},e.ref)})}),(0,s.jsx)("div",{className:"mt-auto pt-1",children:(0,s.jsx)(n.$n,{size:"sm",fullWidth:!0,variant:r?"secondary":"primary",icon:o===e.id?"progress_activity":"add",disabled:r||o===e.id||!d,onClick:()=>p(e),children:o===e.id?"Creating...":r?"Already Created":d?"Apply Template":`Apply (${a}/${l} ready)`})})]},e.id)})})]})}var E=a(44923),A=a(87256),O=a(5020),T=a(39768);function P({id:e,index:t,model:a,isFirst:r,isLast:o,modelCaps:i,onEdit:d,onMoveUp:c,onMoveDown:m,onRemove:x}){let{attributes:u,listeners:p,setNodeRef:b,transform:h,isDragging:g}=(0,A.gl)({id:e}),f={transform:T.Ks.Transform.toString(h),opacity:g?.5:1,zIndex:g?999:void 0},[v,y]=(0,l.useState)(!1),[j,N]=(0,l.useState)(a),k=()=>{let e=j.trim();e&&e!==a?d(e):N(a),y(!1)};return(0,s.jsxs)("div",{ref:b,style:f,className:`group flex min-w-0 items-center gap-2 rounded-lg border px-2.5 py-1.5 transition-all ${g?"border-primary/40 bg-panel shadow-md ring-1 ring-primary/20":"border-transparent bg-panel hover:border-border-subtle"}`,children:[(0,s.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center rounded bg-primary/10 text-[10px] font-bold text-primary",children:t+1}),(0,s.jsx)("button",{...u,...p,type:"button",className:"cursor-grab touch-none shrink-0 p-0.5 rounded text-text-muted/50 hover:text-text-main active:cursor-grabbing",title:"Drag to reorder",children:(0,s.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,s.jsx)("circle",{cx:"9",cy:"4",r:"1.5"}),(0,s.jsx)("circle",{cx:"15",cy:"4",r:"1.5"}),(0,s.jsx)("circle",{cx:"9",cy:"12",r:"1.5"}),(0,s.jsx)("circle",{cx:"15",cy:"12",r:"1.5"}),(0,s.jsx)("circle",{cx:"9",cy:"20",r:"1.5"}),(0,s.jsx)("circle",{cx:"15",cy:"20",r:"1.5"})]})}),v?(0,s.jsx)("input",{autoFocus:!0,value:j,onChange:e=>N(e.target.value),onBlur:k,onKeyDown:e=>{"Enter"===e.key&&k(),"Escape"===e.key&&(N(a),y(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-panel px-1.5 py-0.5 font-mono text-xs text-text-main outline-none"}):(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 cursor-text rounded px-1 py-0.5 hover:bg-black/[0.03] dark:hover:bg-white/[0.03]",onClick:()=>y(!0),title:"Click to edit",children:[(0,s.jsx)("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-text-main",children:a}),i?.[a]&&(0,s.jsx)(n.nh,{caps:i[a],size:11})]}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,s.jsx)("button",{onClick:c,disabled:r,className:`rounded p-1 transition-colors ${r?"cursor-not-allowed text-text-muted/20":"text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5"}`,title:"Move up",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"arrow_upward"})}),(0,s.jsx)("button",{onClick:m,disabled:o,className:`rounded p-1 transition-colors ${o?"cursor-not-allowed text-text-muted/20":"text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5"}`,title:"Move down",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"arrow_downward"})})]}),(0,s.jsx)("button",{onClick:x,className:"shrink-0 rounded p-1 text-text-muted opacity-0 transition-all hover:bg-danger/10 hover:text-danger group-hover:opacity-100",title:"Remove model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}function z({isOpen:e,combo:t,onClose:a,onSave:r,activeProviders:o,modelCaps:c={},kindFilter:m=null}){let[x,u]=(0,l.useState)(t?.name||""),[p,b]=(0,l.useState)(t?.models||[]),[h,g]=(0,l.useState)(!1),[f,v]=(0,l.useState)(!1),[y,j]=(0,l.useState)(""),[N,k]=(0,l.useState)({}),[w,C]=(0,l.useState)(e);(0,l.useEffect)(()=>{e&&!w&&(u(t?.name||""),b(Array.isArray(t?.models)?[...t.models]:[]),j(""),g(!1)),C(e)},[e,w,t]);let S=(0,E.FR)((0,E.MS)(E.AN,{activationConstraint:{distance:5}}),(0,E.MS)(E.uN,{coordinateGetter:A.JR})),M=p.map((e,t)=>({uid:`item-${t}`,model:e}));(0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let e=await fetch("/api/models/alias");if(!t&&e.ok){let t=await e.json();k(t.aliases||{})}}catch{}})(),()=>{t=!0}},[e]);let $=e=>e.trim()?i.test(e)?(j(""),!0):(j("Only letters, numbers, -, _ and . allowed"),!1):(j("Name is required"),!1),F=async()=>{$(x)&&(v(!0),await r({name:x.trim(),models:p}),v(!1))},T=!!t;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.aF,{isOpen:e,onClose:a,title:T?"Edit Combo":"Create Combo",size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.pd,{label:"Combo Name",value:x,onChange:e=>{let t=e.target.value;u(t),t?$(t):j("")},placeholder:"my-combo",error:y}),(0,s.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,s.jsx)("p",{className:"text-[10px] text-text-muted",children:"Use this name as the model in your client:"}),x.trim()&&(0,s.jsx)("code",{className:"rounded bg-primary/10 px-1.5 py-0.5 font-mono text-[10px] text-primary",children:x.trim()})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Models"}),p.length>0&&(0,s.jsxs)(n.Ex,{variant:"info",size:"sm",children:[p.length," model",1!==p.length?"s":""]})]}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"Drag to reorder priority"})]}),0===p.length?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 border border-dashed border-border rounded-lg bg-surface-2/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-2xl mb-2",children:"layers"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Add models to build your combo"}),(0,s.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>g(!0),children:"Add First Model"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(E.Mp,{sensors:S,collisionDetection:E.fp,onDragEnd:e=>{let{active:t,over:a}=e;if(a&&t.id!==a.id){let e=M.findIndex(e=>e.uid===t.id),s=M.findIndex(e=>e.uid===a.id);-1!==e&&-1!==s&&b(t=>(0,A.be)(t,e,s))}},modifiers:[O.FN,O.gj],children:(0,s.jsx)(A.gB,{items:M.map(e=>e.uid),strategy:A._G,children:(0,s.jsx)("div",{className:"flex max-h-[45vh] min-w-0 flex-col gap-1 overflow-y-auto rounded-lg bg-surface-2/30 p-1.5",children:M.map(({uid:e,model:t},a)=>(0,s.jsx)(P,{id:e,index:a,model:t,modelCaps:c,isFirst:0===a,isLast:a===M.length-1,onEdit:e=>{let t=[...p];t[a]=e,b(t)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...p];[t[e-1],t[e]]=[t[e],t[e-1]],b(t)})(a),onMoveDown:()=>(e=>{if(e===p.length-1)return;let t=[...p];[t[e],t[e+1]]=[t[e+1],t[e]],b(t)})(a),onRemove:()=>{b(e=>e.filter((e,t)=>t!==a))}},e))})})}),(0,s.jsxs)("button",{onClick:()=>g(!0),className:"w-full mt-2 py-2 border border-dashed border-primary/30 rounded-lg text-xs text-primary font-medium hover:border-primary hover:bg-primary/5 transition-colors flex items-center justify-center gap-1.5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]})]}),p.length>=2&&(0,s.jsxs)("div",{className:"rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"lightbulb"}),(0,s.jsx)("span",{className:"text-xs font-medium text-text-main",children:"Strategy Tips"})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-2",children:d.map(e=>(0,s.jsxs)("div",{className:"flex items-start gap-1.5 text-[11px] text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px] mt-0.5 text-primary/60",children:e.icon}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"font-medium text-text-main",children:e.label})," — ",e.desc]})]},e.value))}),(0,s.jsx)("p",{className:"mt-1.5 text-[10px] text-text-muted",children:"Set strategy after creating the combo from the Combos tab."})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,s.jsx)(n.$n,{onClick:a,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,s.jsx)(n.$n,{onClick:F,fullWidth:!0,size:"sm",icon:T?"save":"add",disabled:!x.trim()||!!y||f,children:f?"Saving...":T?"Save Changes":"Create Combo"})]})]})}),(0,s.jsx)(n.rq,{isOpen:h,onClose:()=>g(!1),onSelect:e=>{b(t=>t.includes(e.value)?t:[...t,e.value])},onDeselect:e=>{b(t=>t.filter(t=>t!==e.value))},activeProviders:o,modelAliases:N,title:"Add Model to Combo",kindFilter:m,addedModelValues:p,closeOnSelect:!1})]})}let _=[{value:"overview",label:"Overview"},{value:"combos",label:"Combos"},{value:"templates",label:"Templates"}];function D(){let e=(0,r.useRouter)(),t=(0,r.useSearchParams)().get("tab")||"overview",[a,i]=(0,l.useState)([]),[d,c]=(0,l.useState)(!0),[m,x]=(0,l.useState)(!1),[u,p]=(0,l.useState)(null),[h,g]=(0,l.useState)([]),[f,v]=(0,l.useState)({}),[y,j]=(0,l.useState)({}),[N,k]=(0,l.useState)({}),[w,C]=(0,l.useState)(null),{copied:S,copy:$}=(0,o.C)(),E=(0,l.useCallback)(async()=>{try{let[e,t,a,s]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/settings"),fetch("/api/models")]),l=await e.json(),r=await t.json(),n=a.ok?await a.json():{};if(e.ok&&i((l.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),t.ok&&g(r.connections||[]),s.ok){let e=await s.json(),t={},a={};for(let s of e.models||[]){s.caps&&(t[s.fullModel]=s.caps);let e=(s.fullModel||"").split("/").slice(1).join("/");e&&s.provider&&(a[e]||(a[e]=[]),a[e].includes(s.provider)||a[e].push(s.provider))}j(t),k(a)}v(n.comboStrategies||{})}catch(e){console.log("Error fetching data:",e)}finally{c(!1)}},[]);(0,l.useEffect)(()=>{E()},[E]);let A=t=>e.push(`/dashboard/combos?tab=${t}`),O=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await E(),x(!1);else{let e=await t.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},T=async(e,t)=>{try{let a=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(a.ok)await E(),p(null);else{let e=await a.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},P=async(e,t)=>{try{let s=f[e]||{},l={...s,...t},r=l.fallbackStrategy,n=new Set(["fallbackStrategy","thinking","autoScale","budgets",...{fusion:["judgeModel","fusionTuning"],swarm:["managerModel","staffModel","auditModel","workerCount","swarmTuning","enableTelemetry"],cascade:["cascade"],fallback:[],"round-robin":[]}[r]||[]]),o={};for(let[e,t]of Object.entries(l))n.has(e)&&(o[e]=t);let i=Object.keys(s).some(e=>"fallbackStrategy"!==e&&null!=s[e]&&""!==s[e]),d=Object.keys(o).some(e=>"fallbackStrategy"!==e),c="fallback"===o.fallbackStrategy&&i&&!d;if(!c&&("swarm"===o.fallbackStrategy||"fusion"===o.fallbackStrategy)){let t=a.find(t=>t.name===e),s=t?.models||[];try{let e=await fetch("/api/combos/validate-roles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({strategy:o.fallbackStrategy,managerModel:o.managerModel,staffModel:o.staffModel,auditModel:o.auditModel,judgeModel:o.judgeModel,panel:s})});if(e.ok){let t=await e.json();if(!t.valid&&Array.isArray(t.violations)&&t.violations.length>0){let e=t.violations.map(e=>`${e.role}: ${e.reason}`).join("\n");alert(`Cannot save strategy — invalid role models:
2
-
3
- ${e}`);return}}}catch{}}await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:{[e]:c?null:o}})}),v(t=>{let a={...t};return c?delete a[e]:a[e]=o,a})}catch(e){console.log("Error updating combo strategy:",e)}};return d?(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{})]}):(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[(0,s.jsx)(n.zY,{title:"Combos",description:"Group models under one name, then pick a strategy per combo",icon:"layers",actions:(0,s.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>x(!0),className:"whitespace-nowrap",children:"Create Combo"})}),(0,s.jsx)(n.Iz,{options:_,value:t,onChange:A}),"overview"===t&&(0,s.jsx)(b,{combos:a,comboStrategies:f,activeProviders:h,onViewCombos:()=>A("combos"),onCreate:()=>x(!0)}),"combos"===t&&(0,s.jsx)(M,{combos:a,modelCaps:y,activeProviders:h,comboStrategies:f,copied:S,copy:$,onEdit:p,onDelete:e=>{C({title:"Delete Combo",message:"Delete this combo?",onConfirm:async()=>{C(null);try{let t=await fetch(`/api/combos/${e}`,{method:"DELETE"});if(t.ok)i(t=>t.filter(t=>t.id!==e));else{let e=await t.json().catch(()=>({}));alert(e.error||`Failed to delete combo (${t.status})`)}}catch(e){console.log("Error deleting combo:",e),alert("Failed to delete combo — network error")}}})},onSetStrategy:P,onCreate:()=>x(!0)}),"templates"===t&&(0,s.jsx)(F,{combos:a,connections:h,modelIndex:N,onApply:E}),(0,s.jsx)(z,{isOpen:m,onClose:()=>x(!1),onSave:O,activeProviders:h,modelCaps:y},"create"),(0,s.jsx)(z,{isOpen:!!u,combo:u,onClose:()=>p(null),onSave:e=>T(u.id,e),activeProviders:h,modelCaps:y},u?.id||"new"),(0,s.jsx)(n.uo,{isOpen:!!w,onClose:()=>C(null),onConfirm:w?.onConfirm,title:w?.title||"Confirm",message:w?.message,variant:"danger"})]})}function R(){return(0,s.jsx)(l.Suspense,{fallback:(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)("div",{className:"h-32 animate-pulse rounded-lg bg-sidebar"}),(0,s.jsx)("div",{className:"h-32 animate-pulse rounded-lg bg-sidebar"})]}),children:(0,s.jsx)(D,{})})}}},e=>{e.O(0,[27,7055,8105,705,1321,5497,8441,3794,7358],()=>e(e.s=57410)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099],{},_=>{_.O(0,[27,8105,705,1321,5497,981,8441,3794,7358],()=>_(_.s=90981)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8192],{31474:(e,t,s)=>{"use strict";function r(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}s.d(t,{cn:()=>r})},37466:(e,t,s)=>{"use strict";s.d(t,{default:()=>o});var r=s(95155),a=s(12115),n=s(56061),i=s(99312),l=s(31474),c=s(88105);function d(e){return null==e?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(2)}s`}function o(){let[e,t]=(0,a.useState)([]),[s,o]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=new EventSource("/api/health/stream");return e.onopen=()=>o(!0),e.onerror=()=>o(!1),e.onmessage=e=>{try{let s=JSON.parse(e.data);"snapshot"===s.type&&Array.isArray(s.providers)?t(s.providers):s.provider&&t(e=>{let t=e.findIndex(e=>e.provider===s.provider);if(t>=0){let r=[...e];return r[t]=s,r}return[...e,s]})}catch{}},()=>e.close()},[]),(0,r.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:(0,l.cn)("size-2 rounded-full",s?"bg-success animate-pulse":"bg-danger")}),s?"Live":"Reconnecting…"]}),e.length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-success"})," Healthy"]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-warning"})," Degraded"]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-danger"})," Unhealthy"]})]})]}),0===e.length?(0,r.jsx)(i.default,{icon:"monitor_heart",title:"No health data yet",description:"Provider health metrics will appear here once requests flow through the gateway. Send a request to any provider to start collecting samples."}):(0,r.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>{var t;let s,a=function(e,t){if(0===t)return{label:"Unknown",variant:"default",color:"text-text-subtle",bar:"bg-text-subtle"};let s=e??0;return s>=.95?{label:"Healthy",variant:"success",color:"text-success",bar:"bg-success"}:s>=.8?{label:"Degraded",variant:"warning",color:"text-warning",bar:"bg-warning"}:{label:"Unhealthy",variant:"error",color:"text-danger",bar:"bg-danger"}}(e.successRate,e.total),i=null!=e.successRate?Math.round(100*e.successRate):null;return(0,r.jsxs)("div",{className:"rounded-panel border border-border-subtle bg-panel p-4 shadow-[var(--shadow-soft)]",children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,r.jsx)("h3",{className:"truncate font-mono text-sm font-semibold text-text-main",children:(t=e.provider,s=c.Q2[t],s?.name?s.name:t.replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase()))}),(0,r.jsx)(n.default,{variant:a.variant,dot:!0,size:"sm",children:a.label})]}),null!=i&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"mb-1 flex items-center justify-between text-xs text-text-muted",children:[(0,r.jsx)("span",{children:"Success rate"}),(0,r.jsxs)("span",{className:(0,l.cn)("font-mono font-semibold",a.color),children:[i,"%"]})]}),(0,r.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-surface-2",children:(0,r.jsx)("div",{className:(0,l.cn)("h-full rounded-full transition-all",a.bar),style:{width:`${i}%`}})})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[(0,r.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,r.jsx)("div",{className:"text-text-subtle",children:"Requests"}),(0,r.jsx)("div",{className:"font-mono font-semibold text-text-main",children:e.total})]}),(0,r.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,r.jsx)("div",{className:"text-text-subtle",children:"Failures"}),(0,r.jsx)("div",{className:(0,l.cn)("font-mono font-semibold",e.failures>0?"text-danger":"text-text-main"),children:e.failures})]}),(0,r.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,r.jsx)("div",{className:"text-text-subtle",children:"Avg latency"}),(0,r.jsx)("div",{className:"font-mono font-semibold text-text-main",children:d(e.avgLatencyMs)})]}),(0,r.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,r.jsx)("div",{className:"text-text-subtle",children:"p95 latency"}),(0,r.jsx)("div",{className:"font-mono font-semibold text-text-main",children:d(e.p95LatencyMs)})]})]}),e.lastError&&(0,r.jsxs)("div",{className:"mt-3 flex items-center gap-1.5 text-xs text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[13px] text-danger",children:"error"}),"Last error: ",(0,r.jsx)("span",{className:"font-mono",children:e.lastError})," \xb7 ",function(e){if(!e)return"—";let t=Date.now()-e;return t<5e3?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:new Date(e).toLocaleTimeString()}(e.lastErrorAt)]})]},e.provider)})})]})}},40208:(e,t,s)=>{"use strict";s.d(t,{default:()=>d});var r=s(95155),a=s(12115),n=s(92542),i=s(56061),l=s(99312);let c={closed:{label:"Closed",variant:"success"},halfOpen:{label:"Half-open (probing)",variant:"warning"},open:{label:"Open",variant:"error"}};function d(){let[e,t]=(0,a.useState)([]),s=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/breaker");if(!e.ok)return;let s=await e.json();t(s.breakers||[])}catch{}},[]);(0,a.useEffect)(()=>{s();let e=setInterval(s,3e3);return()=>clearInterval(e)},[s]);let d=async e=>{try{await fetch("/api/breaker",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,key:e})})}catch{}s()},o=async()=>{for(let t of e)try{await fetch("/api/breaker",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,key:t.provider})})}catch{}s()};return(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"Circuit Breakers"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(n.default,{size:"sm",variant:"ghost",icon:"refresh",onClick:s,children:"Refresh"}),e.length>0&&(0,r.jsx)(n.default,{size:"sm",variant:"danger",icon:"bolt",onClick:o,children:"Reset all"})]})]}),0===e.length?(0,r.jsx)(l.default,{icon:"bolt",title:"No opened circuit breakers",description:"Breakers trip when a provider repeatedly fails and recover automatically after cooldown. Opened breakers will appear here so you can inspect or force-close them."}):(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>{var t;let s=c[e.state]||c.closed;return(0,r.jsxs)("div",{className:"rounded-panel border border-border-subtle bg-panel p-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"truncate font-mono text-xs font-semibold text-text-main",children:String((t=e.provider)||"").split(":")[0]||t}),(0,r.jsx)("div",{className:"truncate text-[11px] text-text-subtle",children:e.provider})]}),(0,r.jsx)(i.default,{variant:s.variant,dot:!0,size:"sm",children:s.label})]}),(0,r.jsxs)("div",{className:"mt-2 flex items-center justify-between text-xs text-text-muted",children:[(0,r.jsxs)("span",{children:["Failures: ",(0,r.jsx)("span",{className:"font-mono",children:e.failures})]}),"open"===e.state&&(0,r.jsxs)("span",{children:["Cooldown: ",(0,r.jsx)("span",{className:"font-mono",children:function(e){if(null==e)return"—";let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let s=Math.floor(t/60);return`${s}m ${t%60}s`}(e.cooldownRemainingMs)})]})]}),(0,r.jsx)(n.default,{size:"sm",variant:"secondary",icon:"replay",className:"mt-3 w-full",onClick:()=>d(e.provider),children:"Close breaker"})]},e.provider)})})]})}},54642:e=>{var t;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="//"),(t={}).endianness=function(){return"LE"},t.hostname=function(){return"u">typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"u">typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"},e.exports=t},54960:(e,t,s)=>{"use strict";s.d(t,{default:()=>n});var r=s(95155),a=s(31474);function n({title:e,description:t,icon:s,iconNode:i,actions:l,breadcrumbs:c,className:d}){return(0,r.jsxs)("div",{className:(0,a.cn)("mb-6",d),children:[c?.length>0&&(0,r.jsx)("nav",{className:"mb-2 flex items-center gap-1.5 text-xs text-text-muted",children:c.map((e,t)=>(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[t>0&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px] opacity-60",children:"chevron_right"}),e.href?(0,r.jsx)("a",{href:e.href,className:"transition-colors hover:text-primary",children:e.label}):(0,r.jsx)("span",{className:"font-medium text-text-main",children:e.label})]},t))}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[i?(0,r.jsx)("div",{className:"mt-0.5 shrink-0",children:i}):s&&(0,r.jsx)("div",{className:"mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-brand bg-primary/10 text-primary ring-1 ring-primary/15",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:s})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h1",{className:"truncate text-xl font-semibold tracking-tight text-text-main",children:e}),t&&(0,r.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:t})]})]}),l&&(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:l})]})]})}},56061:(e,t,s)=>{"use strict";s.d(t,{default:()=>c});var r=s(95155),a=s(31474);let n={default:"bg-surface-2 text-text-muted ring-1 ring-border-subtle",primary:"bg-primary/12 text-primary ring-1 ring-primary/20",success:"bg-success/12 text-success ring-1 ring-success/20",warning:"bg-warning/12 text-warning ring-1 ring-warning/20",error:"bg-danger/12 text-danger ring-1 ring-danger/20",info:"bg-info/12 text-info ring-1 ring-info/20",cyan:"bg-cyan/12 text-cyan ring-1 ring-cyan/20"},i={default:"bg-text-subtle",primary:"bg-primary",success:"bg-success",warning:"bg-warning",error:"bg-danger",info:"bg-info",cyan:"bg-cyan"},l={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-xs",lg:"px-3 py-1.5 text-sm"};function c({children:e,variant:t="default",size:s="md",dot:d=!1,icon:o,className:m}){return(0,r.jsxs)("span",{className:(0,a.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold leading-none",n[t],l[s],m),children:[d&&(0,r.jsx)("span",{className:(0,a.cn)("size-1.5 rounded-full",i[t])}),o&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:o}),e]})}},89994:(e,t,s)=>{Promise.resolve().then(s.bind(s,40208)),Promise.resolve().then(s.bind(s,37466)),Promise.resolve().then(s.bind(s,54960))},92542:(e,t,s)=>{"use strict";s.d(t,{default:()=>l});var r=s(95155),a=s(31474);let n={primary:"bg-primary hover:bg-primary-hover text-white shadow-[0_0_0_1px_rgba(255,255,255,0.08)_inset,0_10px_30px_-18px_rgba(139,92,246,0.75)] disabled:bg-surface-3 disabled:text-text-muted",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-primary/45",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",danger:"bg-danger hover:brightness-110 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-success hover:brightness-110 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},i={sm:"h-7 px-3 text-xs rounded-brand",md:"h-9 px-4 text-sm rounded-brand",lg:"h-10 px-5 text-sm rounded-brand"};function l({children:e,variant:t="primary",size:s="md",icon:c,iconRight:d,disabled:o=!1,loading:m=!1,fullWidth:x=!1,className:u,...f}){return(0,r.jsxs)("button",{className:(0,a.cn)("inline-flex items-center justify-center gap-2 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg",n[t],i[s],x&&"w-full",u),disabled:o||m,...f,children:[m?(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[16px]",children:"progress_activity"}):c?(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:c}):null,e,d&&!m&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:d})]})}},99312:(e,t,s)=>{"use strict";s.d(t,{default:()=>i});var r=s(95155),a=s(31474),n=s(92542);function i({icon:e="inbox",title:t="No items found",description:s="There's nothing here yet.",action:l,actionText:c,onAction:d,className:o}){return(0,r.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center justify-center rounded-panel border border-dashed border-border p-12 text-center",o),children:[(0,r.jsx)("div",{className:"mb-4 flex size-12 items-center justify-center rounded-full bg-surface-2 text-text-muted ring-1 ring-border-subtle",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:e})}),(0,r.jsx)("h3",{className:"mb-1.5 text-sm font-semibold text-text-main",children:t}),(0,r.jsx)("p",{className:"mb-6 max-w-sm text-xs text-text-muted",children:s}),l||c&&d&&(0,r.jsx)(n.default,{variant:"outline",size:"sm",onClick:d,children:c})]})}}},e=>{e.O(0,[8105,8441,3794,7358],()=>e(e.s=89994)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3645],{41190:(e,t,s)=>{Promise.resolve().then(s.bind(s,54645))},54645:(e,t,s)=>{"use strict";s.d(t,{default:()=>F});var a=s(95155),r=s(12115),l=s(35497),n=s(14051),i=s.n(n);let c=e=>{let t=Number(e||0);return t>=1e9?`${(t/1e9).toFixed(1)}B`:t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toLocaleString()},o=[{key:"rtk",label:"RTK",icon:"compress",color:"text-primary"},{key:"headroom",label:"Headroom",icon:"air",color:"text-info"},{key:"pxpipe",label:"Pxpipe",icon:"image_search",color:"text-secondary"},{key:"cache",label:"Cache",icon:"cached",color:"text-success"},{key:"caveman",label:"Caveman",icon:"short_text",color:"text-warning"},{key:"ponytail",label:"Ponytail",icon:"notes",color:"text-accent"}];function d({breakdown:e}){let t=o.map(t=>({...t,value:e?.[t.key]||0})).filter(e=>e.value>0);return 0===t.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No per-mechanism data yet."}):(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-1",children:t.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[11px] font-medium",title:`${e.label}: ${e.value.toLocaleString()} tokens saved`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[12px] ${e.color}`,children:e.icon}),(0,a.jsx)("span",{className:"text-text-muted",children:e.label}),(0,a.jsx)("span",{className:"font-semibold text-text-main",children:c(e.value)})]},e.key))})}let x=[{key:"tokensSaved",icon:"savings",color:"success",label:"Tokens Saved",sub:"All token savers",expandable:!0},{key:"requestsRouted",icon:"route",color:"primary",label:"Requests Routed",sub:"Lifetime"},{key:"cacheTokens",icon:"cached",color:"info",label:"Cache Tokens",sub:"From cache reads"}];function m({data:e}){let[t,s]=(0,r.useState)(!1);if(!e)return null;let l={tokensSaved:e.tokensSavedLifetime,requestsRouted:e.totalRequestsLifetime,cacheTokens:e.totalCachedTokens};return(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:x.map(r=>{let n=r.expandable&&t;return(0,a.jsxs)("div",{className:`flex flex-col gap-2 rounded-panel border bg-panel p-5 shadow-[var(--shadow-soft)] ${r.expandable?"cursor-pointer transition-colors hover:border-primary/30":"border-border-subtle"} ${n?"border-primary/30":"border-border-subtle"}`,onClick:r.expandable?()=>s(e=>!e):void 0,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:`flex size-10 items-center justify-center rounded-brand ring-1 ${{success:"bg-success/10 text-success ring-success/20",primary:"bg-primary/10 text-primary ring-primary/20",info:"bg-info/10 text-info ring-info/20"}[r.color]}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:r.icon})}),(0,a.jsx)("div",{className:"min-w-0 flex-1",children:(0,a.jsx)("span",{className:"text-2xl font-bold text-text-main",children:c(l[r.key])})}),r.expandable&&(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${n?"rotate-180":""}`,children:"expand_more"})]}),(0,a.jsx)("div",{className:"text-sm font-medium text-text-main",children:r.label}),(0,a.jsx)("div",{className:"text-xs text-text-muted",children:r.sub}),n&&"tokensSaved"===r.key&&(0,a.jsxs)("div",{className:"mt-2 border-t border-border-subtle pt-2",children:[(0,a.jsx)("p",{className:"mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"Breakdown by mechanism"}),(0,a.jsx)(d,{breakdown:e.tokensSavedByMechanism}),e.semanticCacheHits>0&&(0,a.jsxs)("p",{className:"mt-2 text-[11px] text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px] align-middle text-success",children:"bolt"})," ",e.semanticCacheHits.toLocaleString()," cache hits served from Semantic Cache"]})]})]},r.key)})})}m.propTypes={data:i().object};var p=s(84588);function u(e){return 0===e?"$0.00":e>=1e3?`$${(e/1e3).toFixed(1)}K`:e>=1?`$${e.toFixed(2)}`:`$${e.toFixed(4)}`}let h=[{key:"rtk",label:"RTK",icon:"compress",color:"#3B82F6"},{key:"headroom",label:"Headroom",icon:"expand_less",color:"#10B981"},{key:"pxpipe",label:"Pxpipe",icon:"image_search",color:"#8B5CF6"},{key:"cache",label:"Cache",icon:"cached",color:"#F59E0B"},{key:"caveman",label:"Caveman",icon:"short_text",color:"#EF4444"},{key:"ponytail",label:"Ponytail",icon:"code",color:"#EC4899"}];function b({data:e}){let[t,s]=(0,r.useState)(!1),l=e?.costSavedLifetime||0,n=e?.costSavedByMechanism||{},i=e?.tokensSavedLifetime||0,c=e?.totalCost||0;return(0,a.jsxs)(p.default,{padding:"md",className:"relative overflow-hidden",children:[(0,a.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-br from-emerald-500/5 to-transparent"}),(0,a.jsxs)("div",{className:"relative flex items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"flex size-14 items-center justify-center rounded-2xl bg-emerald-500/10",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] text-emerald-500",children:"payments"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:"Total Dollar Savings"}),(0,a.jsx)("p",{className:"text-3xl font-bold text-emerald-500",children:u(l)}),(0,a.jsxs)("p",{className:"mt-0.5 text-xs text-text-muted",children:[i.toLocaleString()," tokens saved across all mechanisms"]})]})]}),(0,a.jsxs)("div",{className:"hidden flex-col items-end gap-1 sm:flex",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-surface-2 px-3 py-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Without ER:"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-red-500 line-through opacity-70",children:u(c+l)})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-emerald-500/10 px-3 py-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-emerald-600 dark:text-emerald-400",children:"With ER:"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-emerald-500",children:u(c)})]})]})]}),(0,a.jsxs)("button",{onClick:()=>s(e=>!e),className:"relative mt-3 flex w-full items-center justify-between rounded-lg bg-surface-2/50 px-3 py-2 text-left transition-colors hover:bg-surface-2",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-muted",children:"Savings by mechanism"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted transition-transform",style:{transform:t?"rotate(180deg)":"none"},children:"expand_more"})]}),t&&(0,a.jsx)("div",{className:"relative mt-2 grid grid-cols-2 gap-2 sm:grid-cols-3",children:h.map(e=>{let t=n[e.key]||0,s=l>0?t/l*100:0;return(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border-subtle px-2.5 py-2",children:[(0,a.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded-md",style:{backgroundColor:`${e.color}15`},children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:{color:e.color},children:e.icon})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"truncate text-xs font-medium text-text-primary",children:e.label}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[u(t)," ",(0,a.jsxs)("span",{className:"opacity-50",children:["(",s.toFixed(0),"%)"]})]})]})]},e.key)})})]})}var f=s(98500),y=s.n(f),g=s(57250),j=s(8247);function v(e){return null==e?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}let N=[{value:"24h",label:"24h"},{value:"7d",label:"7d"},{value:"30d",label:"30d"}],k=[{key:"requests",label:"Requests",sortable:!0},{key:"totalTokens",label:"Tokens",sortable:!0},{key:"avgTtft",label:"TTFT",sortable:!0},{key:"p95Latency",label:"P95",sortable:!0},{key:"successRate",label:"Success",sortable:!0},{key:"cost",label:"Cost",sortable:!0}];function w(){let[e,t]=(0,r.useState)([]),[s,l]=(0,r.useState)(!0),[n,i]=(0,r.useState)("7d"),[c,o]=(0,r.useState)("requests"),[d,x]=(0,r.useState)("desc");(0,r.useEffect)(()=>{let e=!1;return l(!0),fetch(`/api/usage/leaderboard?period=${n}`).then(e=>e.json()).then(s=>{e||s.error||t(s.leaderboard||[])}).catch(()=>{}).finally(()=>{e||l(!1)}),()=>{e=!0}},[n]);let m=(0,r.useMemo)(()=>{let t=[...e];return t.sort((e,t)=>{let s=e[c]??-1,a=t[c]??-1;return"desc"===d?a-s:s-a}),t},[e,c,d]);return(0,a.jsx)(p.default,{title:"Provider Leaderboard",subtitle:"Performance ranking by requests, latency, and cost",icon:"leaderboard",padding:"none",action:(0,a.jsx)("div",{className:"flex items-center gap-1",children:N.map(e=>(0,a.jsx)("button",{onClick:()=>i(e.value),className:`rounded-md px-2 py-1 text-xs font-medium transition-colors ${n===e.value?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2"}`,children:e.label},e.value))}),children:s?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),(0,a.jsx)("span",{className:"text-sm",children:"Loading leaderboard..."})]}):0===m.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[40px] opacity-20",children:"leaderboard"}),(0,a.jsx)("span",{className:"text-sm",children:"No usage data for this period"})]}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[640px] text-left",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-border bg-surface-2/50",children:[(0,a.jsx)("th",{className:"px-3 py-2 text-[10px] font-medium uppercase tracking-wide text-text-muted",children:"Provider"}),k.map(e=>(0,a.jsxs)("th",{onClick:()=>{var t;return e.sortable&&void(c===(t=e.key)?x(e=>"desc"===e?"asc":"desc"):(o(t),x("desc")))},className:`px-3 py-2 text-[10px] font-medium uppercase tracking-wide ${e.sortable?"cursor-pointer select-none hover:text-text-primary":""} ${c===e.key?"text-primary":"text-text-muted"}`,children:[e.label,c===e.key&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-0.5 inline text-[12px] align-middle",children:"desc"===d?"arrow_downward":"arrow_upward"})]},e.key))]})}),(0,a.jsx)("tbody",{children:m.map((e,t)=>{var s,r;let l=e.successRate>=95?"text-emerald-500":e.successRate>=80?"text-amber-500":"text-red-500";return(0,a.jsxs)("tr",{className:"border-b border-border-subtle transition-colors hover:bg-surface-2/30",children:[(0,a.jsx)("td",{className:"px-3 py-2.5",children:(0,a.jsxs)(y(),{href:`/dashboard/providers/${e.provider}`,className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[10px] font-mono text-text-muted w-4",children:t+1}),(0,a.jsx)("div",{className:"flex size-6 shrink-0 items-center justify-center rounded",children:(0,a.jsx)(g.A,{src:(0,j.k)(e.provider),alt:e.provider,size:24,className:"object-contain rounded",fallbackText:e.provider?.slice(0,2).toUpperCase(),fallbackColor:e.color})}),(0,a.jsx)("span",{className:"truncate text-xs font-medium text-text-primary",children:e.displayName})]})}),(0,a.jsx)("td",{className:"px-3 py-2.5 text-xs tabular-nums text-text-primary",children:e.requests.toLocaleString()}),(0,a.jsx)("td",{className:"px-3 py-2.5 text-xs tabular-nums text-text-muted",children:(s=e.totalTokens)>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:String(s)}),(0,a.jsx)("td",{className:"px-3 py-2.5 text-xs tabular-nums text-text-muted",children:v(e.avgTtft)}),(0,a.jsx)("td",{className:"px-3 py-2.5 text-xs tabular-nums text-text-muted",children:v(e.p95Latency)}),(0,a.jsxs)("td",{className:`px-3 py-2.5 text-xs font-medium tabular-nums ${l}`,children:[e.successRate.toFixed(1),"%"]}),(0,a.jsx)("td",{className:"px-3 py-2.5 text-xs tabular-nums text-text-muted",children:null==(r=e.cost)||0===r?"$0.00":r<.01?`$${r.toFixed(4)}`:`$${r.toFixed(2)}`})]},e.provider)})})]})})})}let $=[{key:"rtkEnabled",name:"RTK Token Saver",icon:"compress"},{key:"headroomEnabled",name:"Headroom",icon:"cloud_compress"},{key:"pxpipeEnabled",name:"Pxpipe",icon:"image_search"},{key:"semanticCacheEnabled",name:"Semantic Cache",icon:"cached"},{key:"cavemanEnabled",name:"Caveman Mode",icon:"cottage"},{key:"ponytailEnabled",name:"Ponytail",icon:"cut"}];function S({settings:e}){return e?(0,a.jsx)("div",{className:"flex flex-wrap gap-3",children:$.map(t=>{let s=!!e[t.key];return(0,a.jsxs)("div",{className:`flex items-center gap-2 rounded-brand border px-3 py-2 transition-colors ${s?"border-success/30 bg-success/5":"border-border-subtle bg-surface-2"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${s?"text-success":"text-text-muted"}`,children:t.icon}),(0,a.jsx)("span",{className:"text-sm font-medium text-text-main",children:t.name}),(0,a.jsx)(l.Ex,{variant:s?"success":"default",size:"sm",dot:!0,children:s?"Active":"Off"})]},t.key)})}):null}S.propTypes={settings:i().object};let C=e=>{let t=Number(e||0);return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toLocaleString()};function T({providers:e}){return e&&0!==e.length?(0,a.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:e.map(e=>{let t=e.color||"#6b7280",s=t.length>7?t:t+"15";return(0,a.jsxs)(y(),{href:`/dashboard/providers/${e.id}`,className:"group flex items-center gap-3 rounded-brand border border-border-subtle bg-panel px-3 py-2.5 shadow-[var(--shadow-soft)] transition-all hover:border-primary/35 hover:bg-panel-elev hover:shadow-[var(--shadow-warm)]",children:[(0,a.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:s},children:(0,a.jsx)(g.A,{src:(0,j.k)(e.id),alt:e.name,size:24,className:"object-contain rounded max-w-[24px] max-h-[24px]",fallbackText:(e.name||e.id).slice(0,2).toUpperCase(),fallbackColor:t})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("h3",{className:"truncate text-sm font-semibold text-text-main",children:e.name}),(0,a.jsx)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:e.requests>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"font-medium",children:[C(e.requests)," requests"]}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsxs)("span",{children:[C(e.tokens)," tokens"]})]}):e.connected?(0,a.jsxs)("span",{className:"flex items-center gap-1 text-success",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-success"}),"Connected"]}):(0,a.jsx)("span",{children:"No usage yet"})})]})]},e.id)})}):(0,a.jsx)(l.pp,{icon:"redeem",title:"No free providers used yet",description:"Connect a free provider (Kiro, OpenCode, etc.) and start routing requests to see usage here."})}function F(){let[e,t]=(0,r.useState)(null),[s,n]=(0,r.useState)(!0);return((0,r.useEffect)(()=>{fetch("/api/usage/meta").then(e=>e.json()).then(e=>{e.error||t(e)}).catch(()=>{}).finally(()=>n(!1))},[]),s)?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(l.zY,{title:"Overview",description:"Gateway summary, savings, and free-tier usage",icon:"dashboard"}),(0,a.jsx)(l.Qv,{}),(0,a.jsx)(l.Qv,{})]}):(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsx)(l.zY,{title:"Overview",description:"Gateway summary, savings, and free-tier usage",icon:"dashboard"}),(0,a.jsx)(m,{data:e}),(0,a.jsx)(b,{data:e}),(0,a.jsx)(l.Zp,{title:"Token Savers",subtitle:"Input compression and output optimization",icon:"savings",padding:"sm",children:(0,a.jsx)(S,{settings:e?.tokenSaverSettings})}),(0,a.jsx)(l.Zp,{title:"Free Providers Used",subtitle:"Providers with no API cost routing through your gateway",icon:"redeem",padding:"sm",children:(0,a.jsx)(T,{providers:e?.freeProviders||[]})}),(0,a.jsx)(w,{})]})}T.propTypes={providers:i().arrayOf(i().shape({id:i().string,name:i().string,icon:i().string,color:i().string,requests:i().number,tokens:i().number}))}}},e=>{e.O(0,[27,8105,705,1321,5497,8441,3794,7358],()=>e(e.s=41190)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{},_=>{_.O(0,[27,8105,705,1321,5497,981,8441,3794,7358],()=>_(_.s=90981)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1287],{45518:(e,t,s)=>{Promise.resolve().then(s.bind(s,65784))},65784:(e,t,s)=>{"use strict";s.d(t,{default:()=>$});var a=s(95155),r=s(12115),n=s(35497),l=s(14051),i=s.n(l),o=s(57250),c=s(8247),d=s(28777);function m({value:e,onChange:t,models:s,compact:l=!1,modelAliases:i={},activeProviders:u=[]}){let[x,p]=(0,r.useState)(!1),g="string"==typeof e?e:null==e?"":String(e),h=(()=>{if(!g)return null;let e=s?.find(e=>e.id===g);return e?.provider||g.split("/")[0]})(),f=(()=>{if(!g)return"Select a model...";if(i?.[g])return i[g];if(h){let e=(0,d.u0)(h,g);if(e&&e!==g)return e}return g})();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>p(!0),className:l?"flex h-8 items-center gap-1.5 rounded-lg border border-border-subtle bg-surface-2 px-2 text-xs text-text-main hover:border-primary/40":"flex h-9 w-full items-center gap-2 rounded-lg border border-border-subtle bg-surface-2 px-3 text-sm text-text-main hover:border-primary/40",title:f,children:[h&&(0,a.jsx)(o.A,{src:(0,c.k)(h),alt:h,size:l?16:18,fallbackText:(h||"?").slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:`truncate ${e?"font-medium":"text-text-muted"}`,children:f}),(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[16px] text-text-muted",children:"expand_more"})]}),(0,a.jsx)(n.rq,{isOpen:x,onClose:()=>p(!1),onSelect:e=>{t("string"==typeof e?e:e?.value||e?.name||e?.id||""),p(!1)},selectedModel:g,activeProviders:u,title:"Select Model",modelAliases:i})]})}m.propTypes={value:i().string,onChange:i().func.isRequired,models:i().arrayOf(i().shape({id:i().string,provider:i().string})),compact:i().bool,modelAliases:i().object,activeProviders:i().array};var u=s(53593);let x=["low","medium","high","max"];function p({params:e,onChange:t,selectedModel:s=""}){let[n,l]=(0,r.useState)(!0),{getCaps:i}=(0,u.y)(),o=(s,a)=>t({...e,[s]:a}),c=i?.(s),d=!!c?.reasoning,m=!!(e.systemPrompt&&e.systemPrompt.trim());return(0,a.jsxs)("div",{className:"rounded-brand border border-border-subtle bg-panel p-3",children:[(0,a.jsxs)("button",{onClick:()=>l(!n),className:"mb-3 flex w-full items-center justify-between",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2 text-sm font-semibold text-text-main",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"tune"}),"Parameters",m&&(0,a.jsx)("span",{className:"rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:"system"})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${n?"rotate-90":""}`,children:"chevron_right"})]}),n&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:"System Prompt"}),(0,a.jsx)("textarea",{value:e.systemPrompt||"",onChange:e=>o("systemPrompt",e.target.value),placeholder:"You are a helpful assistant...",rows:3,className:"custom-scrollbar w-full resize-none rounded-lg border border-border-subtle bg-surface-2 px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:border-primary focus:outline-none"})]}),d&&(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Thinking Level"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:x.map(t=>{let s=(e.reasoningEffort||"medium")===t;return"max"!==t||c?.thinkingMaxEffort?(0,a.jsx)("button",{onClick:()=>o("reasoningEffort",s?"":t),className:`rounded-lg px-2.5 py-1 text-xs font-medium capitalize transition-colors ${s?"bg-primary text-white":"bg-surface-2 text-text-muted hover:bg-surface-3"}`,children:t},t):null})}),(0,a.jsx)("p",{className:"mt-1 text-[10px] text-text-muted",children:"Reasoning effort. Tap active level to clear."})]}),(0,a.jsx)(g,{label:"Temperature",value:e.temperature??.7,min:0,max:2,step:.05,onChange:e=>o("temperature",e)}),(0,a.jsx)(g,{label:"Top P",value:e.topP??1,min:0,max:1,step:.05,onChange:e=>o("topP",e)}),(0,a.jsx)(g,{label:"Frequency Penalty",value:e.frequencyPenalty??0,min:0,max:2,step:.1,onChange:e=>o("frequencyPenalty",e)}),(0,a.jsx)(g,{label:"Presence Penalty",value:e.presencePenalty??0,min:0,max:2,step:.1,onChange:e=>o("presencePenalty",e)}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Max Tokens"}),(0,a.jsx)("input",{type:"number",min:"1",max:"128000",value:e.maxTokens??4096,onChange:e=>o("maxTokens",parseInt(e.target.value)||4096),className:"w-full rounded-lg border border-border-subtle bg-surface-2 px-3 py-1.5 text-sm text-text-main focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Top K"}),(0,a.jsx)("input",{type:"number",min:"1",max:"1000",placeholder:"unset",value:e.topK??"",onChange:e=>o("topK",""===e.target.value?null:parseInt(e.target.value)),className:"w-full rounded-lg border border-border-subtle bg-surface-2 px-3 py-1.5 text-sm text-text-main placeholder:text-text-muted focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Seed"}),(0,a.jsx)("input",{type:"number",placeholder:"unset",value:e.seed??"",onChange:e=>o("seed",""===e.target.value?null:parseInt(e.target.value)),className:"w-full rounded-lg border border-border-subtle bg-surface-2 px-3 py-1.5 text-sm text-text-main placeholder:text-text-muted focus:border-primary focus:outline-none"})]})]})]})}function g({label:e,value:t,min:s,max:r,step:n,onChange:l}){return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,a.jsx)("label",{className:"text-xs font-medium text-text-muted",children:e}),(0,a.jsx)("span",{className:"text-xs font-mono text-text-main",children:Number(t).toFixed(2)})]}),(0,a.jsx)("input",{type:"range",min:s,max:r,step:n,value:t,onChange:e=>l(parseFloat(e.target.value)),className:"w-full accent-primary"})]})}p.propTypes={params:i().shape({systemPrompt:i().string,reasoningEffort:i().string,temperature:i().number,maxTokens:i().number,topP:i().number,frequencyPenalty:i().number,presencePenalty:i().number,topK:i().number,seed:i().number}).isRequired,onChange:i().func.isRequired,selectedModel:i().string},g.propTypes={label:i().string.isRequired,value:i().number.isRequired,min:i().number.isRequired,max:i().number.isRequired,step:i().number.isRequired,onChange:i().func.isRequired};var h=s(62630);function f(e){return null==e?"—":e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function b(e){return null==e?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function y({stats:e,mode:t="single"}){var s;if("compare"===t)return(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 rounded-brand border border-border-subtle bg-surface-2 px-3 py-2 text-xs",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-primary",children:"compare_arrows"}),(0,a.jsxs)("span",{className:"font-medium text-text-main",children:[e.models||0," models compared"]})]}),(0,a.jsx)("span",{className:"text-text-muted",children:"\xb7"}),(0,a.jsxs)("span",{className:"text-text-muted",children:["Total: ",b(e.compareLatencyMs)]})]});let r=null==(s=function(e){if(!e?.model||!e.inputTokens&&!e.outputTokens)return null;let t=e.model,s=t.indexOf("/"),a=s>0?t.slice(0,s):null,r=s>0?t.slice(s+1):t,n=(0,h.PS)(a,r);if(!n)return null;let l={prompt_tokens:e.inputTokens||0,completion_tokens:e.outputTokens||0,cached_tokens:e.cachedTokens||0,reasoning_tokens:e.reasoningTokens||0};return(0,h.uy)(l,n)}(e))||0===s?null:s<.01?`$${s.toFixed(4)}`:(0,h.BD)(s);return(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 rounded-brand border border-border-subtle bg-surface-2 px-3 py-2 text-xs",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-success",children:"arrow_upward"}),(0,a.jsx)("span",{className:"text-text-muted",children:"In:"}),(0,a.jsx)("span",{className:"font-mono font-medium text-text-main",children:f(e.inputTokens)})]}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-info",children:"arrow_downward"}),(0,a.jsx)("span",{className:"text-text-muted",children:"Out:"}),(0,a.jsx)("span",{className:"font-mono font-medium text-text-main",children:f(e.outputTokens)})]}),(0,a.jsx)("span",{className:"text-text-muted",children:"\xb7"}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"timer"}),(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"}),(0,a.jsx)("span",{className:"font-mono font-medium text-text-main",children:b(e.latencyMs)})]}),r&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"\xb7"}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-warning",children:"payments"}),(0,a.jsx)("span",{className:"text-text-muted",children:"Cost:"}),(0,a.jsx)("span",{className:"font-mono font-medium text-warning",children:r})]})]}),e.model&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"\xb7"}),(0,a.jsx)("span",{className:"font-mono text-text-muted",children:e.model})]})]})}function j({sessions:e,currentSession:t,onNew:s,onLoad:l,onDelete:i}){let[o,c]=(0,r.useState)(""),[,d]=(0,r.useState)(0);(0,r.useEffect)(()=>{let e=setInterval(()=>d(e=>e+1),6e4);return()=>clearInterval(e)},[]);let m=(0,r.useMemo)(()=>{let t=o.trim().toLowerCase();return t?e.filter(e=>(e.title||"").toLowerCase().includes(t)):e},[e,o]);return(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-brand border border-border-subtle bg-panel p-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wide text-text-muted",children:"History"}),(0,a.jsx)(n.$n,{size:"sm",variant:"ghost",icon:"add",onClick:s,title:"New chat","aria-label":"New chat"})]}),e.length>0&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5 rounded-lg border border-border-subtle bg-surface-2 px-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"search"}),(0,a.jsx)("input",{value:o,onChange:e=>c(e.target.value),placeholder:"Search...",className:"w-full bg-transparent py-1 text-xs text-text-main placeholder:text-text-muted focus:outline-none"})]}),0===e.length?(0,a.jsx)("p",{className:"py-4 text-center text-xs text-text-muted",children:"No saved conversations"}):0===m.length?(0,a.jsx)("p",{className:"py-4 text-center text-xs text-text-muted",children:"No matches"}):(0,a.jsx)("div",{className:"custom-scrollbar flex max-h-[70vh] flex-col gap-1 overflow-y-auto",children:m.map(e=>(0,a.jsxs)("div",{className:`group flex items-center gap-2 rounded-lg px-2 py-1.5 transition-colors ${t===e.id?"bg-primary/10":"hover:bg-surface-2"}`,children:[(0,a.jsxs)("button",{onClick:()=>l(e),className:"flex min-w-0 flex-1 flex-col items-start",children:[(0,a.jsx)("span",{className:"w-full truncate text-xs font-medium text-text-main",children:e.title}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:function(e){if(!e)return"";let t=Math.floor((Date.now()-e)/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);return s<24?`${s}h ago`:new Date(e).toLocaleDateString()}(e.updatedAt||e.createdAt)})]}),(0,a.jsx)("button",{onClick:()=>i(e.id),className:"rounded p-1 text-text-muted opacity-0 hover:text-danger group-hover:opacity-100",title:"Delete","aria-label":`Delete ${e.title}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]},e.id))})]})}y.propTypes={stats:i().object,mode:i().string},j.propTypes={sessions:i().array,currentSession:i().string,onNew:i().func.isRequired,onLoad:i().func.isRequired,onDelete:i().func.isRequired};var v=s(9233),N=s(91992);let w=void 0!==window.document,k=!1,C={FORBID_TAGS:["style","form","input","textarea","button","select","svg"],FORBID_ATTR:["style"],ALLOW_UNKNOWN_PROTOCOLS:!1};function S({content:e,role:t,error:s=!1}){let n=!s&&"assistant"===t,l=(0,r.useMemo)(()=>{if(!n||!e)return"";try{var t;let s=v.xI.parse(e);return t="string"==typeof s?s:String(s),"string"==typeof t&&t?w?(!k&&w&&(k=!0,N.A.addHook("afterSanitizeAttributes",e=>{for(let t of("A"===e.tagName&&(e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer")),["src","href","xlink:href","action","formaction"])){let s=e.getAttribute(t);s&&/^\s*data:/i.test(s)&&!/^\s*data:image\/(?:png|jpe?g|gif|webp);/i.test(s)&&e.removeAttribute(t)}})),N.A.sanitize(t,C)):t:""}catch{return""}},[e,n]);return n&&l?(0,a.jsx)("div",{className:"prose-chat whitespace-pre-wrap break-words",dangerouslySetInnerHTML:{__html:l}}):(0,a.jsx)("p",{className:"whitespace-pre-wrap break-words",children:e})}function T({messages:e,onSend:t,streaming:s}){let l=(0,r.useRef)(null);return((0,r.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[e]),0===e.length)?(0,a.jsx)("div",{className:"flex min-h-[300px] flex-1 items-center justify-center",children:(0,a.jsx)(n.pp,{icon:"science",title:"Start a conversation",description:"Pick a model above, type a message below, and press Enter. Switch to Compare mode to test multiple models side-by-side."})}):(0,a.jsx)("div",{ref:l,className:"custom-scrollbar flex max-h-[60vh] min-h-[200px] flex-1 flex-col gap-3 overflow-y-auto rounded-brand border border-border-subtle bg-panel p-4",children:e.map(e=>(0,a.jsx)(P,{msg:e},e.id))})}function P({msg:e}){let t="user"===e.role,s=e.error;return(0,a.jsx)("div",{className:`flex ${t?"justify-end":"justify-start"}`,children:(0,a.jsxs)("div",{className:`max-w-[80%] rounded-2xl px-4 py-2.5 text-sm ${t?"bg-primary text-white":s?"bg-danger/10 text-danger border border-danger/20":"bg-surface-2 text-text-main"}`,children:[e.model&&!t&&(0,a.jsx)("div",{className:"mb-1 text-[10px] font-medium text-text-muted",children:e.model}),e.reasoning&&(0,a.jsxs)("details",{className:"mb-1.5 rounded bg-black/5 px-2 py-1 dark:bg-white/5",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-[10px] font-medium text-text-muted",children:"Reasoning"}),(0,a.jsx)("p",{className:"mt-1 whitespace-pre-wrap break-words text-xs italic text-text-muted",children:e.reasoning})]}),t&&e.attachments&&e.attachments.length>0&&(0,a.jsx)("div",{className:"mb-1.5 flex flex-wrap gap-1.5",children:e.attachments.map(e=>(0,a.jsx)("img",{src:e.dataUrl,alt:e.name,className:"h-20 w-20 rounded-lg border border-white/20 object-cover"},e.id))}),(0,a.jsxs)("div",{className:"break-words",children:[(0,a.jsx)(S,{content:e.content,role:e.role,error:s}),e.streaming&&(0,a.jsx)("span",{className:"ml-0.5 inline-block size-3 animate-pulse rounded-full bg-primary/50 align-middle"})]})]})})}async function A(e,{onChunk:t}={}){if(!e?.body?.getReader)return null;let s=e.body.getReader(),a=new TextDecoder,r="",n=null;for(;;){let{value:e,done:l}=await s.read();if(l)break;let i=(r+=a.decode(e,{stream:!0})).split(/\r?\n/);for(let e of(r=i.pop()||"",i)){let s=e.trim();if(!s.startsWith("data:"))continue;let a=s.slice(5).trim();if(a&&"[DONE]"!==a)try{let e=function(e){let t=e?.choices?.[0],s=t?.delta||{};return{content:"string"==typeof s.content?s.content:null,reasoning:"string"==typeof s.reasoning_content?s.reasoning_content:null,toolCalls:Array.isArray(s.tool_calls)&&s.tool_calls.length>0?s.tool_calls:null,finishReason:t?.finish_reason??null,usage:e?.usage??null}}(JSON.parse(a));e.usage&&(n=e.usage),t?.(e)}catch{}}}return n}v.xI.setOptions({gfm:!0,breaks:!0,async:!1}),S.propTypes={content:i().string,role:i().string,error:i().bool},T.propTypes={messages:i().arrayOf(i().shape({id:i().string,role:i().string,content:i().string,reasoning:i().string,model:i().string,streaming:i().bool,error:i().bool,attachments:i().array})),onSend:i().func,streaming:i().bool};let _="extremerouter.playground.sessions";function R(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function O(e){try{return localStorage.setItem(_,JSON.stringify(e)),"saved"}catch{try{return localStorage.setItem(_,JSON.stringify(e.map(e=>({...e,messages:(e.messages||[]).map(e=>"user"!==e.role?e:{...e,displayAttachments:Array.isArray(e.displayAttachments)?e.displayAttachments.map(e=>({id:e.id,name:e.name,stripped:!0})):void 0,content:Array.isArray(e.content)?e.content.map(e=>e&&"image_url"===e.type?{type:"image_url",image_url:{url:""}}:e):e.content})})))),"stripped"}catch{return"failed"}}}function $(){let[e,t]=(0,r.useState)(!0),[s,l]=(0,r.useState)([]),[i,o]=(0,r.useState)([]),[c,d]=(0,r.useState)({}),[u,x]=(0,r.useState)([]),[g,h]=(0,r.useState)(null),[f,b]=(0,r.useState)([]),[v,N]=(0,r.useState)({}),[w,k]=(0,r.useState)("single"),[C,P]=(0,r.useState)([""]),[$,z]=(0,r.useState)({systemPrompt:"",temperature:.7,maxTokens:4096,topP:1,frequencyPenalty:0,presencePenalty:0,topK:null,seed:null,reasoningEffort:""}),[D,E]=(0,r.useState)({}),I=(0,r.useRef)(null),M=(0,r.useRef)({}),[F,L]=(0,r.useState)(null),K=(0,r.useRef)(!1),[B,H]=(0,r.useState)(null),U=(0,r.useRef)(null),W=(0,r.useCallback)(e=>{H(e),U.current&&clearTimeout(U.current),U.current=setTimeout(()=>H(null),3e3)},[]),[J,Y]=(0,r.useState)(!1),[Z,G]=(0,r.useState)(null),[Q,V]=(0,r.useState)(null),{streamChat:X,abortAll:ee,streaming:et}=function({onDelta:e,onComplete:t,onError:s}){let a=(0,r.useRef)({}),[n,l]=(0,r.useState)(0);(0,r.useEffect)(()=>{let e=a.current;return()=>{Object.values(e).forEach(e=>e?.abort?.())}},[]);let i=(0,r.useCallback)(async(r,{body:n,apiKey:i})=>{let o=new AbortController;a.current[r]=o,l(e=>e+1);try{let a={"Content-Type":"application/json",Accept:"text/event-stream"};i&&(a.Authorization=`Bearer ${i}`);let l=await fetch("/api/v1/chat/completions",{method:"POST",headers:a,body:JSON.stringify({...n,stream:!0}),signal:o.signal});if(!l.ok){let e=await l.json().catch(()=>({error:{message:`HTTP ${l.status}`}}));s(r,e.error?.message||`HTTP ${l.status}`,l.status);return}let c=await A(l,{onChunk:t=>e(r,t)});t(r,{usage:c,ok:!0})}catch(e){e?.name!=="AbortError"&&s(r,e?.message||"Network error",0)}finally{delete a.current[r],l(e=>Math.max(0,e-1))}},[e,t,s]);return{streamChat:i,abort:(0,r.useCallback)(e=>{a.current[e]?.abort?.()},[]),abortAll:(0,r.useCallback)(()=>{Object.values(a.current).forEach(e=>e?.abort?.())},[]),streaming:n>0}}({onDelta:(0,r.useCallback)((e,t)=>{let s=M.current[e];if(!s)return;let a=(e,t,s)=>s?(e||"")+s:e;"single"===s.mode?b(e=>e.map(e=>e.id!==s.assistantId?e:{...e,content:a(e.content,"content",t.content),reasoning:a(e.reasoning,"reasoning",t.reasoning)})):N(s=>{let r=s[e]||{content:"",reasoning:"",streaming:!0,error:null};return{...s,[e]:{...r,content:a(r.content,"content",t.content),reasoning:a(r.reasoning,"reasoning",t.reasoning)}}})},[]),onComplete:(0,r.useCallback)((e,{usage:t})=>{let s=M.current[e];s&&("single"===s.mode?(b(e=>e.map(e=>e.id===s.assistantId?{...e,streaming:!1}:e)),E({model:s.modelId,inputTokens:t?.prompt_tokens||0,outputTokens:t?.completion_tokens||0,latencyMs:Date.now()-s.startTime})):N(s=>({...s,[e]:{...s[e],streaming:!1,usage:t}})),delete M.current[e])},[]),onError:(0,r.useCallback)((e,t)=>{let s,a=M.current[e];if(!a)return;let r=((s=(s=(s=(s=(s="string"==typeof t?t:String(t??"")).replace(/https?:\/\/[^\s"'<>]+/g,"[url]")).replace(/(Bearer\s+)[A-Za-z0-9._\-]{16,}/gi,"$1[token]")).replace(/(signature=)[A-Za-z0-9%+/=]{16,}/gi,"$1[sig]")).replace(/\{[\s\S]{80,}\}/g,"[provider json]")).length>300&&(s=s.slice(0,297)+"..."),s.trim());"single"===a.mode?b(e=>e.map(e=>e.id===a.assistantId?{...e,content:`❌ Error: ${r}`,streaming:!1,error:!0}:e)):N(t=>({...t,[e]:{...t[e],content:`❌ ${r}`,streaming:!1,error:!0}})),delete M.current[e]},[])}),es=(0,r.useCallback)(async()=>{G(null);try{let[e,t,s]=await Promise.all([fetch("/api/providers"),fetch("/api/models/alias"),fetch("/api/v1/models")]),a=await e.json();o((a.connections||[]).filter(e=>!1!==e.isActive));let r=await t.json();d(r.aliases||{});let n=((await s.json()).data||[]).map(e=>({id:e.id,name:e.id,provider:e.owned_by||e.id.split("/")[0]}));l(n),n.length>0&&P(e=>e[0]?e:[n[0].id])}catch(e){G(e?.message||"Failed to load models")}},[]);(0,r.useEffect)(()=>{(async()=>{x(function(){try{let e=localStorage.getItem(_);return e?JSON.parse(e):[]}catch{return[]}}());try{let e=await fetch("/api/keys"),t=await e.json(),s=(t.keys||t||[]).find?.(e=>!1!==e.isActive);s?.key&&(I.current=s.key)}catch{}try{let e=await fetch("/api/settings"),t=await e.json(),s=!0===t.requireApiKey;Y(s&&!I.current)}catch{Y(!1)}await es(),t(!1)})()},[es]),(0,r.useEffect)(()=>{"single"===w&&(K.current=!1)},[w]);let ea=(0,r.useCallback)(()=>{f.length>0&&g&&el(g,f),L(null),b([]),h(null),E({}),N({})},[f,g]),er=(0,r.useCallback)(e=>{f.length>0&&g&&el(g,f),b(e.messages||[]),h(e.id),e.model&&P([e.model]),e.params&&z(e.params),E({}),N({})},[f,g]),en=(0,r.useCallback)(e=>{let t=u.filter(t=>t.id!==e);x(t),O(t),g===e&&(h(null),b([]))},[u,g]),el=(0,r.useCallback)((e,t)=>{let s=u.map(s=>s.id===e?{...s,messages:t.slice(-60),updatedAt:Date.now()}:s).slice(0,100);x(s),O(s)},[u]),ei=(0,r.useCallback)(()=>{if(0===f.length)return;let e=g||R(),t={id:e,title:f.find(e=>"user"===e.role)?.content?.slice(0,40)||"New Chat",messages:f.slice(-60),model:C[0],params:$,createdAt:Date.now(),updatedAt:Date.now()},s=(u.find(t=>t.id===e)?u.map(s=>s.id===e?{...s,...t}:s):[t,...u]).slice(0,100);x(s);let a=O(s);h(e),W(a)},[f,g,u,C,$,W]),eo=(0,r.useCallback)((e,t=[])=>{let s=t.length>0,a={role:"user",content:s?[{type:"text",text:e},...t.map(e=>({type:"image_url",image_url:{url:e.dataUrl}}))]:e,id:R(),displayText:e,displayAttachments:s?t:void 0},r=[...f];$.systemPrompt&&r.unshift({role:"system",content:$.systemPrompt});let n=[...r.slice(-50),a],l={temperature:$.temperature,max_tokens:$.maxTokens,top_p:$.topP};return $.frequencyPenalty&&(l.frequency_penalty=$.frequencyPenalty),$.presencePenalty&&(l.presence_penalty=$.presencePenalty),$.topK&&(l.top_k=$.topK),null!=$.seed&&(l.seed=$.seed),$.reasoningEffort&&(l.reasoning_effort=$.reasoningEffort),{userMsg:a,baseMessages:n,requestParams:l}},[f,$]),ec=(0,r.useCallback)(async(e,t=[])=>{let{userMsg:s,baseMessages:a,requestParams:r}=eo(e,t),n=I.current,l=Date.now();if("single"===w){let e=C[0];if(!e)return;let t=R();b([...a.filter(e=>"system"!==e.role).map(e=>"user"===e.role?{...e,content:e.displayText??e.content,attachments:e.displayAttachments}:e),{role:"assistant",content:"",reasoning:"",id:t,model:e,streaming:!0}]),M.current.single={mode:"single",assistantId:t,modelId:e,startTime:l},await X("single",{body:{model:e,messages:a,...r},apiKey:n})}else{let e=C.filter(Boolean);if(0===e.length)return;N({}),e.forEach(e=>{M.current[e]={mode:"compare",modelId:e,startTime:l}}),await Promise.allSettled(e.map(e=>X(e,{body:{model:e,messages:a,...r},apiKey:n}))),E({compareLatencyMs:Date.now()-l,models:e.length})}},[w,C,eo,X]),ed=(0,r.useCallback)(async(e,t=[])=>{if((e.trim()||0!==t.length)&&!et){if("compare"===w&&!K.current&&C.filter(Boolean).length>1)return void L({text:e,attachments:t});await ec(e,t)}},[w,et,C,ec]),em=(0,r.useCallback)(()=>{K.current=!0,F&&(ec(F.text,F.attachments),L(null))},[F,ec]),eu=(0,r.useCallback)(()=>{ee(),M.current={},b(e=>e.map(e=>e.streaming?{...e,streaming:!1}:e)),N(e=>{let t={};for(let[s,a]of Object.entries(e))t[s]={...a,streaming:!1};return t})},[ee]);return e?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(n.zY,{title:"Playground",description:"Test models, compare outputs, tune parameters",icon:"science"}),(0,a.jsx)(n.Qv,{})]}):(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,a.jsx)(n.zY,{title:"Playground",description:"Test models, compare outputs, tune parameters",icon:"science",actions:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Iz,{options:[{value:"single",label:"Chat"},{value:"compare",label:"Compare"}],value:w,onChange:k,size:"sm"}),(0,a.jsx)(n.$n,{size:"sm",variant:"ghost",icon:et?"stop":"save",onClick:et?eu:ei,disabled:!et&&0===f.length,children:et?"Stop":"Save"}),(0,a.jsx)(n.$n,{size:"sm",variant:"ghost",icon:"history",className:"lg:hidden","aria-label":"Open history",onClick:()=>V("history")}),(0,a.jsx)(n.$n,{size:"sm",variant:"ghost",icon:"tune",className:"lg:hidden","aria-label":"Open parameters",onClick:()=>V("params")}),B&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",role:"status","aria-live":"polite",children:["saved"===B&&"Saved","stripped"===B&&"Saved — images removed to fit storage","failed"===B&&"Save failed"]})]})}),(J||Z)&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[J&&(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-brand border border-warning/30 bg-warning/5 px-3 py-2 text-xs text-warning",children:[(0,a.jsxs)("span",{children:[(0,a.jsx)("b",{children:"API key required."})," The gateway requires an API key for requests, but no active key was found — sends will fail with a 401."]}),(0,a.jsx)("a",{href:"/dashboard/endpoint",className:"shrink-0 font-semibold underline hover:text-warning/80",children:"Create an API key →"})]}),Z&&(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-brand border border-danger/30 bg-danger/5 px-3 py-2 text-xs text-danger",children:[(0,a.jsxs)("span",{className:"truncate",children:["Failed to load models: ",Z]}),(0,a.jsx)(n.$n,{size:"sm",variant:"outline",icon:"refresh",onClick:es,children:"Retry"})]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 gap-4",children:[(0,a.jsx)("div",{className:"hidden w-56 shrink-0 lg:block",children:(0,a.jsx)(j,{sessions:u,currentSession:g,onNew:ea,onLoad:er,onDelete:en})}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:["single"===w?(0,a.jsx)(m,{models:s,value:C[0],onChange:e=>P([e]),activeProviders:i,modelAliases:c}):(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[C.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(m,{models:s,value:e,onChange:e=>{let s=[...C];s[t]=e,P(s)},compact:!0,activeProviders:i,modelAliases:c}),C.length>2&&(0,a.jsx)("button",{onClick:()=>P(C.filter((e,s)=>s!==t)),className:"rounded-lg p-1.5 text-text-muted hover:bg-surface-2 hover:text-danger",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},t)),C.length<4&&(0,a.jsxs)("button",{onClick:()=>P([...C,""]),className:"flex items-center gap-1 rounded-lg border border-dashed border-border px-3 py-1.5 text-xs text-text-muted hover:border-primary/40 hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"add"}),"Add Model"]})]}),"single"===w?(0,a.jsx)(T,{messages:f,onSend:ed,streaming:et,stats:D}):(0,a.jsx)("div",{className:"flex min-w-0 gap-3",children:C.filter(Boolean).map(e=>{let t=v[e];return(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col rounded-brand border border-border-subtle bg-panel",children:[(0,a.jsx)("div",{className:"border-b border-border-subtle px-3 py-2",children:(0,a.jsx)("span",{className:"truncate text-xs font-medium text-text-main",children:e})}),(0,a.jsxs)("div",{className:"custom-scrollbar max-h-[60vh] min-h-[200px] overflow-y-auto p-3",children:[t?.reasoning&&(0,a.jsxs)("details",{className:"mb-2 rounded bg-black/5 px-2 py-1 dark:bg-white/5",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-[10px] font-medium text-text-muted",children:"Reasoning"}),(0,a.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-xs italic text-text-muted",children:t.reasoning})]}),t?.content?(0,a.jsxs)("div",{className:`text-sm ${t.error?"text-danger":"text-text-main"}`,children:[t.error?(0,a.jsx)("p",{className:"whitespace-pre-wrap break-words",children:t.content}):(0,a.jsx)(S,{content:t.content,role:"assistant"}),t.streaming&&(0,a.jsx)("span",{className:"ml-0.5 inline-block size-3 animate-pulse rounded-full bg-primary/50 align-middle"})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:et?"Waiting...":"Send a message to compare"})]})]},e)})}),(0,a.jsx)(q,{onSend:ed,streaming:et,onStop:eu}),Object.keys(D).length>0&&(0,a.jsx)(y,{stats:D,mode:w})]}),(0,a.jsx)("div",{className:"hidden w-60 shrink-0 xl:block",children:(0,a.jsx)(p,{params:$,onChange:z,selectedModel:C[0]})})]}),(0,a.jsx)(n.uo,{isOpen:!!F,onClose:()=>L(null),onConfirm:em,title:"Send to multiple models at once?",message:F?`Compare mode sends this exact prompt to ${C.filter(Boolean).length} models simultaneously. One request becomes ${C.filter(Boolean).length} upstream calls (~${C.filter(Boolean).length}\xd7 the tokens of a single request), billed by each provider.`:"",confirmText:"Compare all",cancelText:"Cancel",variant:"secondary"}),(0,a.jsx)(n.aF,{isOpen:"history"===Q,onClose:()=>V(null),title:"History",size:"lg",children:(0,a.jsx)("div",{className:"max-h-[70vh] overflow-y-auto",children:(0,a.jsx)(j,{sessions:u,currentSession:g,onNew:ea,onLoad:e=>{er(e),V(null)},onDelete:en})})}),(0,a.jsx)(n.aF,{isOpen:"params"===Q,onClose:()=>V(null),title:"Parameters",size:"lg",children:(0,a.jsx)(p,{params:$,onChange:z,selectedModel:C[0]})})]})}function q({onSend:e,streaming:t,onStop:s}){let[n,l]=(0,r.useState)(""),[i,o]=(0,r.useState)([]),c=(0,r.useRef)(null),d=e=>{if(!e||!e.type.startsWith("image/")||e.size>5242880)return;let t=new FileReader;t.onload=()=>{o(s=>[...s,{id:R(),dataUrl:t.result,name:e.name}])},t.readAsDataURL(e)},m=()=>{(n.trim()||0!==i.length)&&!t&&(e(n,i),l(""),o([]),c.current&&(c.current.style.height="auto"))},u=(n.trim()||i.length>0)&&!t;return(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-brand border border-border-subtle bg-panel p-2",children:[i.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(e=>(0,a.jsxs)("div",{className:"group relative",children:[(0,a.jsx)("img",{src:e.dataUrl,alt:e.name,className:"h-16 w-16 rounded-lg border border-border-subtle object-cover"}),(0,a.jsx)("button",{onClick:()=>o(t=>t.filter(t=>t.id!==e.id)),className:"absolute -right-1.5 -top-1.5 flex size-5 items-center justify-center rounded-full bg-danger text-white opacity-0 transition-opacity group-hover:opacity-100",title:"Remove",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},e.id))}),(0,a.jsxs)("div",{className:"flex items-end gap-2",children:[(0,a.jsx)("textarea",{ref:c,value:n,onChange:e=>{l(e.target.value),e.target.style.height="auto",e.target.style.height=Math.min(e.target.scrollHeight,120)+"px"},onPaste:e=>{let t=e.clipboardData?.items;if(!t)return;let s=!1;for(let e of t)e.type.startsWith("image/")&&(s=!0,d(e.getAsFile()));s&&e.preventDefault()},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),m())},placeholder:"Send a message... (Enter to send, Shift+Enter for newline, paste images)",rows:1,className:"custom-scrollbar max-h-[120px] flex-1 resize-none bg-transparent px-2 py-1.5 text-sm text-text-main placeholder:text-text-muted focus:outline-none"}),t?(0,a.jsx)("button",{onClick:s,className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-danger/15 text-danger hover:bg-danger/25",title:"Stop","aria-label":"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"stop"})}):(0,a.jsx)("button",{onClick:m,disabled:!u,className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary text-white hover:bg-primary-hover disabled:opacity-40",title:"Send","aria-label":"Send",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"send"})})]})]})}}},e=>{e.O(0,[27,1992,8105,705,1321,5497,8441,3794,7358],()=>e(e.s=45518)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3471],{3658:(e,t,s)=>{Promise.resolve().then(s.bind(s,64561))},64561:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var a=s(95155),r=s(12115),o=s(35497),i=s(81127),l=s(21931),n=s(1620),d=s(31474),c=s(90620),m=s(93308),x=s(38202);function p(){let{theme:e,setTheme:t,isDark:s}=(0,n.D)(),[p,u]=(0,r.useState)("en"),[h,b]=(0,r.useState)(!1),[g,y]=(0,r.useState)(!1),[f,j]=(0,r.useState)(!1),[w,N]=(0,r.useState)({fallbackStrategy:"fill-first"}),[v,C]=(0,r.useState)(!0),[k,S]=(0,r.useState)({current:"",new:"",confirm:""}),[P,O]=(0,r.useState)({type:"",message:""}),[I,L]=(0,r.useState)(!1),[R,D]=(0,r.useState)(!1),[U,T]=(0,r.useState)({type:"",message:""}),[A,M]=(0,r.useState)({open:!1,mode:"",password:""}),$=(0,r.useRef)(null),[E,F]=(0,r.useState)({authMode:"password",oidcIssuerUrl:"",oidcClientId:"",oidcScopes:"openid profile email",oidcLoginLabel:"Sign in with OIDC"}),[q,J]=(0,r.useState)(""),[_,H]=(0,r.useState)({type:"",message:""}),[K,Z]=(0,r.useState)(!1),[z,B]=(0,r.useState)(!1),[W,Q]=(0,r.useState)({type:"",message:""}),[Y,G]=(0,r.useState)("/api/auth/oidc/callback"),[V,X]=(0,r.useState)(!1),ee=(0,r.useRef)(null),[et,es]=(0,r.useState)({outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:""}),[ea,er]=(0,r.useState)({type:"",message:""}),[eo,ei]=(0,r.useState)(!1),[el,en]=(0,r.useState)(!1);(0,r.useEffect)(()=>{u(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${m.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,m.QC)(t)}())},[h]),(0,r.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{N(e),F({authMode:e?.authMode||"password",oidcIssuerUrl:e?.oidcIssuerUrl||"",oidcClientId:e?.oidcClientId||"",oidcScopes:e?.oidcScopes||"openid profile email",oidcLoginLabel:e?.oidcLoginLabel||"Sign in with OIDC"}),J(""),(e?.authMode==="oidc"||e?.authMode==="both")&&X(!0),es({outboundProxyEnabled:e?.outboundProxyEnabled===!0,outboundProxyUrl:e?.outboundProxyUrl||"",outboundNoProxy:e?.outboundNoProxy||""}),C(!1)}).catch(e=>{console.error("Failed to fetch settings:",e),C(!1)})},[]),(0,r.useEffect)(()=>{G(`${window.location.origin}/api/auth/oidc/callback`)},[]);let ed=async e=>{if(e.preventDefault(),!0===w.outboundProxyEnabled){ei(!0),er({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyUrl:et.outboundProxyUrl,outboundNoProxy:et.outboundNoProxy})}),t=await e.json();e.ok?(N(e=>({...e,...t})),er({type:"success",message:"Proxy settings applied"})):er({type:"error",message:t.error||"Failed to update proxy settings"})}catch(e){er({type:"error",message:"An error occurred"})}finally{ei(!1)}}},ec=async()=>{if(!0!==w.outboundProxyEnabled)return;let e=(et.outboundProxyUrl||"").trim();if(!e)return void er({type:"error",message:"Please enter a Proxy URL to test"});en(!0),er({type:"",message:""});try{let t=await fetch("/api/settings/proxy-test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyUrl:e})}),s=await t.json();t.ok&&s?.ok?er({type:"success",message:`Proxy test OK (${s.status}) in ${s.elapsedMs}ms`}):er({type:"error",message:s?.error||"Proxy test failed"})}catch(e){er({type:"error",message:"An error occurred"})}finally{en(!1)}},em=async e=>{ei(!0),er({type:"",message:""});try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyEnabled:e})}),s=await t.json();t.ok?(N(e=>({...e,...s})),es(e=>({...e,outboundProxyEnabled:s?.outboundProxyEnabled===!0})),er({type:"success",message:e?"Proxy enabled":"Proxy disabled"})):er({type:"error",message:s.error||"Failed to update proxy settings"})}catch(e){er({type:"error",message:"An error occurred"})}finally{ei(!1)}},ex=async e=>{if(e.preventDefault(),k.new!==k.confirm)return void O({type:"error",message:"Passwords do not match"});L(!0),O({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:k.current,newPassword:k.new})}),t=await e.json();e.ok?(O({type:"success",message:"Password updated successfully"}),S({current:"",new:"",confirm:""})):O({type:"error",message:t.error||"Failed to update password"})}catch(e){O({type:"error",message:"An error occurred"})}finally{L(!1)}},ep=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fallbackStrategy:e})})).ok&&N(t=>({...t,fallbackStrategy:e}))}catch(e){console.error("Failed to update settings:",e)}},eu=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategy:e})})).ok&&N(t=>({...t,comboStrategy:e}))}catch(e){console.error("Failed to update combo strategy:",e)}},eh=async e=>{let t=parseInt(e);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stickyRoundRobinLimit:t})})).ok&&N(e=>({...e,stickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update sticky limit:",e)}},eb=async e=>{let t=parseInt(e);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStickyRoundRobinLimit:t})})).ok&&N(e=>({...e,comboStickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update combo sticky limit:",e)}},eg=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&N(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},ey=(e,t)=>{F(s=>({...s,[e]:t}))},ef=async(e=E.authMode||"password")=>{let t=E.oidcIssuerUrl.trim(),s=E.oidcClientId.trim(),a=E.oidcScopes.trim(),r=E.oidcLoginLabel.trim(),o=q.trim();if("password"!==e&&(!t||!s||!o)&&!w.oidcConfigured)return void H({type:"error",message:"Issuer URL, client ID, and client secret are required to enable OIDC."});Z(!0),H({type:"",message:""}),Q({type:"",message:""});try{let i={authMode:e,oidcIssuerUrl:t,oidcClientId:s,oidcScopes:a||"openid profile email",oidcLoginLabel:r||"Sign in with OIDC"};o&&(i.oidcClientSecret=o);let l=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),n=await l.json();l.ok?(N(e=>({...e,...n})),F({authMode:n?.authMode||e,oidcIssuerUrl:n?.oidcIssuerUrl||t,oidcClientId:n?.oidcClientId||s,oidcScopes:n?.oidcScopes||a||"openid profile email",oidcLoginLabel:n?.oidcLoginLabel||r||"Sign in with OIDC"}),J(""),H({type:"success",message:"oidc"===e?"OIDC login enabled":"both"===e?"Password and OIDC login enabled":"OIDC settings saved"})):H({type:"error",message:n.error||"Failed to save OIDC settings"})}catch(e){H({type:"error",message:"An error occurred"})}finally{Z(!1)}},ej=async()=>{let e=E.oidcIssuerUrl.trim(),t=E.oidcClientId.trim(),s=E.oidcScopes.trim(),a=q.trim();if(!e||!t)return void Q({type:"error",message:"Issuer URL and client ID are required to test the connection."});B(!0),H({type:"",message:""}),Q({type:"",message:""});try{let r=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({authMode:E.authMode||w.authMode||"password",oidcIssuerUrl:e,oidcClientId:t,oidcScopes:s||"openid profile email",oidcLoginLabel:E.oidcLoginLabel.trim()||"Sign in with OIDC",...a?{oidcClientSecret:a}:{}})}),o=await r.json().catch(()=>({}));if(!r.ok)return void Q({type:"error",message:o.error||"Failed to save OIDC settings before testing"});let i=await fetch("/api/auth/oidc/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issuerUrl:o.oidcIssuerUrl||e,clientId:o.oidcClientId||t,scopes:o.oidcScopes||s||"openid profile email"})}),l=await i.json().catch(()=>({}));if(i.ok&&l?.ok){let e=l.clientSecretTested?!0===l.clientSecretValid?`Connection OK. Discovery loaded from ${l.issuerUrl}. Client secret validated too.`:`Connection OK. Discovery loaded from ${l.issuerUrl}. Client secret was not checked.`:`Connection OK. Discovery loaded from ${l.issuerUrl}.`;Q({type:"success",message:e})}else Q({type:"error",message:l.error||"OIDC connection test failed"})}catch(e){Q({type:"error",message:"An error occurred"})}finally{B(!1)}},ew=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enableObservability:e})})).ok&&N(t=>({...t,enableObservability:e}))}catch(e){console.error("Failed to update enableObservability:",e)}},eN=async()=>{try{let e=await fetch("/api/settings");if(!e.ok)return;let t=await e.json();N(t)}catch(e){console.error("Failed to reload settings:",e)}},ev=async e=>{D(!0),T({type:"",message:""});try{let t=await fetch("/api/settings/database",{headers:{"x-9r-password":e}});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||"Failed to export database")}let s=await t.json(),a=JSON.stringify(s,null,2),r=new Blob([a],{type:"application/json"}),o=URL.createObjectURL(r),i=document.createElement("a"),l=new Date().toISOString().replace(/[.:]/g,"-");i.href=o,i.download=`extremerouter-backup-${l}.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o),T({type:"success",message:"Database backup downloaded"})}catch(e){T({type:"error",message:e.message||"Failed to export database"})}finally{D(!1)}},eC=async e=>{let t=$.current;if(t){D(!0);try{let s=await t.text(),a=JSON.parse(s),r=await fetch("/api/settings/database",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...a,password:e})}),o=await r.json().catch(()=>({}));if(!r.ok)throw Error(o.error||"Failed to import database");await eN(),T({type:"success",message:"Database imported successfully"})}catch(e){T({type:"error",message:e.message||"Invalid backup file"})}finally{$.current=null,D(!1)}}},ek=async()=>{let{mode:e,password:t}=A;M({open:!1,mode:"",password:""}),"export"===e?await ev(t):"import"===e&&await eC(t)},eS=!0===w.enableObservability,eP=async()=>{j(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch(e){}j(!1),y(!1)},eO=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&window.location.assign("/login")}catch(e){console.error("Failed to logout:",e)}};return(0,a.jsxs)("div",{className:"mx-auto max-w-3xl",children:[(0,a.jsx)(o.zY,{title:"Settings",description:"Security, routing, network, and account preferences",icon:"settings"}),(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"size-10 sm:size-12 rounded-lg bg-green-500/10 text-green-500 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-xl sm:text-2xl",children:"computer"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg sm:text-xl font-semibold",children:"Local Mode"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Running on your machine"})]})]}),(0,a.jsx)("div",{className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5 w-full sm:w-auto",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{type:"button",onClick:()=>t(s),className:(0,d.cn)("flex items-center justify-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-1.5 rounded-md font-medium transition-all flex-1 sm:flex-initial",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{className:"capitalize text-xs sm:text-sm",children:s})]},s))})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-4 border-t border-border",children:[(0,a.jsx)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-3 rounded-lg bg-bg border border-border gap-2",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Database Location"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted font-mono break-all",children:"~/.extremerouter/db/data.sqlite"})]})}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)(o.$n,{variant:"secondary",icon:"download",onClick:()=>M({open:!0,mode:"export",password:""}),loading:R,className:"w-full sm:w-auto",children:"Download Backup"}),(0,a.jsx)(o.$n,{variant:"outline",icon:"upload",onClick:()=>ee.current?.click(),disabled:R,className:"w-full sm:w-auto",children:"Import Backup"}),(0,a.jsx)("input",{ref:ee,type:"file",accept:"application/json,.json",className:"hidden",onChange:e=>{let t=e.target.files?.[0];ee.current&&(ee.current.value=""),t&&($.current=t,T({type:"",message:""}),M({open:!0,mode:"import",password:""}))}})]}),U.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===U.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:U.message})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg bg-blue-500/10 text-blue-500 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"language"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Language"})]}),(0,a.jsxs)("button",{onClick:()=>b(!0),className:"flex items-center justify-between w-full p-3 rounded-lg bg-bg border border-border hover:border-primary/50 transition-colors","data-i18n-skip":"true",children:[(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Display language"}),(0,a.jsx)("span",{className:"text-2xl",children:x.h[p]||"\uD83C\uDF10"})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"shield"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Security"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Require login"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,a.jsx)(o.lM,{checked:!0===w.requireLogin,onChange:()=>eg(!w.requireLogin),disabled:v})]}),!0===w.requireLogin&&(0,a.jsxs)("form",{onSubmit:ex,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[w.hasPassword&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"Current Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Enter current password",value:k.current,onChange:e=>S({...k,current:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"New Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Enter new password",value:k.new,onChange:e=>S({...k,new:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"Confirm New Password"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Confirm new password",value:k.confirm,onChange:e=>S({...k,confirm:e.target.value}),required:!0})]})]}),P.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===P.type?"text-red-500":"text-green-500"}`,children:P.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(o.$n,{type:"submit",variant:"primary",loading:I,className:"w-full sm:w-auto",children:w.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>X(e=>!e),className:"w-full flex items-center gap-3 text-left",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-indigo-500/10 text-indigo-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"lock_open"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"OIDC Dashboard Login"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"oidc"===w.authMode?"OIDC active":"both"===w.authMode?"Password + OIDC active":"Optional SSO via Authentik/Keycloak/Google"})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted shrink-0",children:V?"expand_less":"expand_more"})]}),V&&(0,a.jsxs)("div",{className:"flex flex-col gap-4 mt-4",children:[(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Use Authentik or any OIDC provider to sign in to the dashboard. You can enable password-only, OIDC-only, or both for the dashboard; model API access still uses API keys."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Auth Mode"}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:[{value:"password",title:"Password only",desc:"Keep the legacy password login."},{value:"oidc",title:"OIDC only",desc:"Require OIDC for dashboard access."},{value:"both",title:"Both",desc:"Allow either password or OIDC."}].map(e=>{let t=E.authMode===e.value;return(0,a.jsxs)("button",{type:"button",onClick:()=>ey("authMode",e.value),className:(0,d.cn)("text-left rounded-lg border p-3 transition-colors",t?"border-primary bg-primary/5":"border-border bg-bg hover:bg-black/5 dark:hover:bg-white/5"),disabled:v||K,children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:e.title}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted mt-1",children:e.desc})]},e.value)})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Issuer URL"}),(0,a.jsx)(o.pd,{placeholder:"https://auth.example.com/application/o/extremerouter/",value:E.oidcIssuerUrl,onChange:e=>ey("oidcIssuerUrl",e.target.value),disabled:v||K})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Client ID"}),(0,a.jsx)(o.pd,{placeholder:"extremerouter-dashboard",value:E.oidcClientId,onChange:e=>ey("oidcClientId",e.target.value),disabled:v||K})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Client Secret"}),(0,a.jsx)(o.pd,{type:"password",placeholder:"Leave blank to keep existing secret",value:q,onChange:e=>J(e.target.value),disabled:v||K}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"This value is write-only after saving."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Scopes"}),(0,a.jsx)(o.pd,{placeholder:"openid profile email",value:E.oidcScopes,onChange:e=>ey("oidcScopes",e.target.value),disabled:v||K})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Login Button Label"}),(0,a.jsx)(o.pd,{placeholder:"Sign in with OIDC",value:E.oidcLoginLabel,onChange:e=>ey("oidcLoginLabel",e.target.value),disabled:v||K})]})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-bg p-3 text-xs sm:text-sm text-text-muted",children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-1",children:"Redirect URI"}),(0,a.jsx)("code",{className:"block break-all font-mono",children:Y})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)(o.$n,{type:"button",variant:"primary",loading:K,onClick:()=>ef(),className:"w-full sm:w-auto",children:"Save auth mode"}),(0,a.jsx)(o.$n,{type:"button",variant:"outline",loading:z,onClick:ej,className:"w-full sm:w-auto",children:"Test connection"})]}),W.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===W.type?"text-red-500":"text-green-500"}`,children:W.message}),_.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===_.type?"text-red-500":"text-green-500"}`,children:_.message}),"oidc"===w.authMode&&(0,a.jsx)("p",{className:"text-xs sm:text-sm text-amber-600 dark:text-amber-400",children:"OIDC login is currently active. Password login is disabled until you switch back."}),"both"===w.authMode&&(0,a.jsx)("p",{className:"text-xs sm:text-sm text-amber-600 dark:text-amber-400",children:"Password and OIDC login are both active."})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"route"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Cycle through accounts to distribute load"})]}),(0,a.jsx)(o.lM,{checked:"round-robin"===w.fallbackStrategy,onChange:()=>ep("round-robin"===w.fallbackStrategy?"fill-first":"round-robin"),disabled:v})]}),"round-robin"===w.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Sticky Limit"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Calls per account before switching"})]}),(0,a.jsx)(o.pd,{type:"number",min:"1",max:"10",value:w.stickyRoundRobinLimit||3,onChange:e=>eh(e.target.value),disabled:v,className:"w-16 sm:w-20 text-center shrink-0"})]}),(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-4 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Combo Round Robin"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Cycle through providers in combos instead of always starting with first"})]}),(0,a.jsx)(o.lM,{checked:"round-robin"===w.comboStrategy,onChange:()=>eu("round-robin"===w.comboStrategy?"fallback":"round-robin"),disabled:v})]}),"round-robin"===w.comboStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Combo Sticky Limit"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Calls per combo model before switching"})]}),(0,a.jsx)(o.pd,{type:"number",min:"1",max:"100",value:w.comboStickyRoundRobinLimit||1,onChange:e=>eb(e.target.value),disabled:v,className:"w-20 text-center"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:["round-robin"===w.fallbackStrategy?`Currently distributing requests across all available accounts with ${w.stickyRoundRobinLimit||3} calls per account.`:"Currently using accounts in priority order (Fill First).","round-robin"===w.comboStrategy?` Combos rotate after ${w.comboStickyRoundRobinLimit||1} call${1===(w.comboStickyRoundRobinLimit||1)?"":"s"} per model.`:" Combos always start with their first model."]})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"wifi"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Network"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Outbound Proxy"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Enable proxy for OAuth + provider outbound requests."})]}),(0,a.jsx)(o.lM,{checked:!0===w.outboundProxyEnabled,onChange:()=>em(!0!==w.outboundProxyEnabled),disabled:v||eo})]}),!0===w.outboundProxyEnabled&&(0,a.jsxs)("form",{onSubmit:ed,className:"flex flex-col gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Proxy URL"}),(0,a.jsx)(o.pd,{placeholder:"http://127.0.0.1:7897",value:et.outboundProxyUrl,onChange:e=>es(t=>({...t,outboundProxyUrl:e.target.value})),disabled:v||eo}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Leave empty to inherit existing env proxy (if any)."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"No Proxy"}),(0,a.jsx)(o.pd,{placeholder:"localhost,127.0.0.1",value:et.outboundNoProxy,onChange:e=>es(t=>({...t,outboundNoProxy:e.target.value})),disabled:v||eo}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Comma-separated hostnames/domains to bypass the proxy."})]}),(0,a.jsxs)("div",{className:"pt-2 border-t border-border/50 flex flex-col sm:flex-row items-stretch sm:items-center gap-2",children:[(0,a.jsx)(o.$n,{type:"button",variant:"secondary",loading:el,disabled:v||eo,onClick:ec,className:"w-full sm:w-auto",children:"Test proxy URL"}),(0,a.jsx)(o.$n,{type:"submit",variant:"primary",loading:eo,className:"w-full sm:w-auto",children:"Apply"})]})]}),ea.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===ea.type?"text-red-500":"text-green-500"} pt-2 border-t border-border/50`,children:ea.message})]})]}),(0,a.jsxs)(o.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"monitoring"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Observability"})]}),(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Enable Observability"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Record request details for inspection in the logs view"})]}),(0,a.jsx)(o.lM,{checked:eS,onChange:ew,disabled:v})]})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)(o.$n,{variant:"outline",fullWidth:!0,icon:"power_settings_new",onClick:()=>y(!0),className:"text-red-500 border-red-200 hover:bg-red-50 hover:border-red-300",children:"Shutdown"}),(0,a.jsx)(o.$n,{variant:"outline",fullWidth:!0,icon:"logout",onClick:eO,children:"Logout"})]}),(0,a.jsxs)("div",{className:"text-center text-xs sm:text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[c.vQ.name," v",c.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode - All data stored on your machine"})]})]}),(0,a.jsx)(l.default,{hideTrigger:!0,isOpen:h,onClose:e=>{b(!1),u(e)}}),(0,a.jsx)(i.ConfirmModal,{isOpen:g,onClose:()=>y(!1),onConfirm:eP,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:f}),(0,a.jsxs)(i.default,{isOpen:A.open,onClose:()=>M({open:!1,mode:"",password:""}),title:"Confirm Password",size:"sm",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.$n,{variant:"ghost",onClick:()=>M({open:!1,mode:"",password:""}),disabled:R,children:"Cancel"}),(0,a.jsx)(o.$n,{variant:"primary",onClick:ek,loading:R,disabled:!A.password,children:"Confirm"})]}),children:[(0,a.jsxs)("p",{className:"text-text-muted mb-3 text-sm",children:["Enter your current password to ","export"===A.mode?"export":"import"," the database."]}),(0,a.jsx)(o.pd,{type:"password",value:A.password,onChange:e=>M(t=>({...t,password:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&A.password&&ek()},placeholder:"Current password",autoFocus:!0})]})]})}}},e=>{e.O(0,[27,8105,705,1321,5497,8441,3794,7358],()=>e(e.s=3658)),_N_E=e.O()}]);