switchboard-router 0.5.21 → 0.6.1

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 (1238) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +17 -7
  3. package/app/.next-cli-build/build-manifest.json +3 -3
  4. package/app/.next-cli-build/prerender-manifest.json +3 -435
  5. package/app/.next-cli-build/required-server-files.json +9 -2
  6. package/app/.next-cli-build/routes-manifest.json +92 -13
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js +2 -2
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +11 -24
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page.js +2 -2
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +3 -3
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +16 -16
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +4 -4
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js +2 -2
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +2 -2
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +4 -4
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page.js +2 -2
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page_client-reference-manifest.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -2
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  82. package/app/.next-cli-build/server/app/_global-error/page.js +2 -2
  83. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  85. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  86. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  87. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  88. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  89. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  90. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  91. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  92. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  93. package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
  94. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  96. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  97. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  98. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  99. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  100. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  101. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  102. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  103. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  104. package/app/.next-cli-build/server/app/api/agent-library/catalog/route.js +1 -1
  105. package/app/.next-cli-build/server/app/api/agent-library/catalog/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/agent-library/doctor/route.js +1 -1
  107. package/app/.next-cli-build/server/app/api/agent-library/doctor/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/agent-library/export/route.js +1 -1
  109. package/app/.next-cli-build/server/app/api/agent-library/export/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/agent-library/mcp/route.js +1 -1
  111. package/app/.next-cli-build/server/app/api/agent-library/mcp/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/agent-library/route.js +1 -1
  113. package/app/.next-cli-build/server/app/api/agent-library/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/agent-library/skills/route.js +1 -1
  115. package/app/.next-cli-build/server/app/api/agent-library/skills/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/agent-library/sync/route.js +1 -1
  117. package/app/.next-cli-build/server/app/api/agent-library/sync/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/agent-library/updates/route.js +1 -0
  119. package/app/.next-cli-build/server/app/api/agent-library/updates/route.js.nft.json +1 -0
  120. package/app/.next-cli-build/server/app/api/agent-library/updates/route_client-reference-manifest.js +1 -0
  121. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js +5 -11
  124. package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +13 -38
  126. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  128. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  132. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +5 -2
  134. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +2 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  138. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  140. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +5 -9
  144. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +5 -2
  146. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js +9 -10
  148. package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js +9 -6
  150. package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +8 -10
  152. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +6 -2
  154. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +5 -2
  156. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -2
  158. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  160. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +5 -2
  162. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  166. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  172. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  180. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +2 -2
  184. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +5 -5
  186. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/route.js +1 -0
  198. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/route.js.nft.json +1 -0
  199. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/route_client-reference-manifest.js +1 -0
  200. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/strategy/route.js +1 -0
  201. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/strategy/route.js.nft.json +1 -0
  202. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/strategy/route_client-reference-manifest.js +1 -0
  203. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/route.js +1 -0
  204. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/route.js.nft.json +1 -0
  205. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/route_client-reference-manifest.js +1 -0
  206. package/app/.next-cli-build/server/app/api/mgmt/v1/health/route.js +1 -0
  207. package/app/.next-cli-build/server/app/api/mgmt/v1/health/route.js.nft.json +1 -0
  208. package/app/.next-cli-build/server/app/api/mgmt/v1/health/route_client-reference-manifest.js +1 -0
  209. package/app/.next-cli-build/server/app/api/mgmt/v1/providers/route.js +1 -0
  210. package/app/.next-cli-build/server/app/api/mgmt/v1/providers/route.js.nft.json +1 -0
  211. package/app/.next-cli-build/server/app/api/mgmt/v1/providers/route_client-reference-manifest.js +1 -0
  212. package/app/.next-cli-build/server/app/api/mgmt/v1/routing/route.js +1 -0
  213. package/app/.next-cli-build/server/app/api/mgmt/v1/routing/route.js.nft.json +1 -0
  214. package/app/.next-cli-build/server/app/api/mgmt/v1/routing/route_client-reference-manifest.js +1 -0
  215. package/app/.next-cli-build/server/app/api/mgmt/v1/usage/route.js +1 -0
  216. package/app/.next-cli-build/server/app/api/mgmt/v1/usage/route.js.nft.json +1 -0
  217. package/app/.next-cli-build/server/app/api/mgmt/v1/usage/route_client-reference-manifest.js +1 -0
  218. package/app/.next-cli-build/server/app/api/mgmt/v1/version/route.js +1 -0
  219. package/app/.next-cli-build/server/app/api/mgmt/v1/version/route.js.nft.json +1 -0
  220. package/app/.next-cli-build/server/app/api/mgmt/v1/version/route_client-reference-manifest.js +1 -0
  221. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  222. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  224. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  226. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  228. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  230. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  232. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  240. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  244. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  262. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  264. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  266. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/batch/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/batch/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/cache/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/cache/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/prepare/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/prepare/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route.js +1 -1
  274. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  276. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  278. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  280. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  282. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  284. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  286. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  288. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  292. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/routing/feedback/route.js +1 -0
  296. package/app/.next-cli-build/server/app/api/routing/feedback/route.js.nft.json +1 -0
  297. package/app/.next-cli-build/server/app/api/routing/feedback/route_client-reference-manifest.js +1 -0
  298. package/app/.next-cli-build/server/app/api/routing/insights/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/routing/insights/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/routing/learn/route.js +1 -1
  301. package/app/.next-cli-build/server/app/api/routing/learn/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/routing/stats/route.js +1 -0
  303. package/app/.next-cli-build/server/app/api/routing/stats/route.js.nft.json +1 -0
  304. package/app/.next-cli-build/server/app/api/routing/stats/route_client-reference-manifest.js +1 -0
  305. package/app/.next-cli-build/server/app/api/routing/versions/promote/route.js +1 -1
  306. package/app/.next-cli-build/server/app/api/routing/versions/promote/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/routing/versions/rollback/route.js +1 -1
  308. package/app/.next-cli-build/server/app/api/routing/versions/rollback/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  312. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  314. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/skills/[id]/route.js +1 -1
  318. package/app/.next-cli-build/server/app/api/skills/[id]/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  320. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/token-saver/vault-stats/route.js +1 -0
  322. package/app/.next-cli-build/server/app/api/token-saver/vault-stats/route.js.nft.json +1 -0
  323. package/app/.next-cli-build/server/app/api/token-saver/vault-stats/route_client-reference-manifest.js +1 -0
  324. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  325. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  326. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  327. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  328. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  329. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  331. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  332. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  333. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  334. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  335. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  336. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  337. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  338. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  339. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  340. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  341. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  343. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  344. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  345. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  346. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  347. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  349. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  351. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  352. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  353. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  355. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  357. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  358. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  359. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  361. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  362. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  363. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  364. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  365. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  366. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  367. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  368. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
  369. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  370. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  371. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  372. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  373. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  374. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  375. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  376. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  377. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  378. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  379. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  380. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  381. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  382. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  383. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  384. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  385. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  386. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  387. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  388. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  390. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  391. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  392. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  393. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  394. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  395. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  397. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  398. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  399. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  400. package/app/.next-cli-build/server/app/callback/page.js +2 -2
  401. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  402. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  403. package/app/.next-cli-build/server/app/callback.html +1 -1
  404. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  405. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  406. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  407. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  408. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  409. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
  410. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  411. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
  412. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  413. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  414. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  415. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  416. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  417. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  418. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  419. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  420. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  421. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  422. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  423. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  424. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  425. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  426. package/app/.next-cli-build/server/app/index.html +1 -1
  427. package/app/.next-cli-build/server/app/index.rsc +4 -4
  428. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  429. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  430. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  431. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  432. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  433. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  434. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  435. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  436. package/app/.next-cli-build/server/app/landing.html +1 -1
  437. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  438. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  439. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  440. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  441. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  442. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  443. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  444. package/app/.next-cli-build/server/app/login/page.js +2 -2
  445. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  446. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  447. package/app/.next-cli-build/server/app/login.html +1 -1
  448. package/app/.next-cli-build/server/app/login.rsc +4 -4
  449. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  450. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  451. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  452. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  453. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  454. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  455. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  456. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  457. package/app/.next-cli-build/server/app/page.js +2 -2
  458. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  459. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  460. package/app/.next-cli-build/server/app-paths-manifest.json +17 -7
  461. package/app/.next-cli-build/server/chunks/1062.js +64 -0
  462. package/app/.next-cli-build/server/chunks/1064.js +104 -0
  463. package/app/.next-cli-build/server/chunks/1294.js +49 -0
  464. package/app/.next-cli-build/server/chunks/159.js +1 -0
  465. package/app/.next-cli-build/server/chunks/1808.js +1 -0
  466. package/app/.next-cli-build/server/chunks/194.js +1 -0
  467. package/app/.next-cli-build/server/chunks/1998.js +1 -1
  468. package/app/.next-cli-build/server/chunks/241.js +1 -1
  469. package/app/.next-cli-build/server/chunks/2712.js +3 -0
  470. package/app/.next-cli-build/server/chunks/{9528.js → 2750.js} +2 -3
  471. package/app/.next-cli-build/server/chunks/2925.js +1 -0
  472. package/app/.next-cli-build/server/chunks/3072.js +2 -0
  473. package/app/.next-cli-build/server/chunks/3075.js +1 -0
  474. package/app/.next-cli-build/server/chunks/319.js +3 -3
  475. package/app/.next-cli-build/server/chunks/3535.js +1 -1
  476. package/app/.next-cli-build/server/chunks/3546.js +1 -1
  477. package/app/.next-cli-build/server/chunks/3593.js +2 -2
  478. package/app/.next-cli-build/server/chunks/3675.js +1 -0
  479. package/app/.next-cli-build/server/chunks/369.js +70 -0
  480. package/app/.next-cli-build/server/chunks/3904.js +1 -0
  481. package/app/.next-cli-build/server/chunks/3986.js +49 -14
  482. package/app/.next-cli-build/server/chunks/4126.js +5 -0
  483. package/app/.next-cli-build/server/chunks/{2422.js → 4176.js} +1 -1
  484. package/app/.next-cli-build/server/chunks/4192.js +1 -0
  485. package/app/.next-cli-build/server/chunks/4194.js +1 -1
  486. package/app/.next-cli-build/server/chunks/440.js +26 -0
  487. package/app/.next-cli-build/server/chunks/4646.js +1 -0
  488. package/app/.next-cli-build/server/chunks/4739.js +2 -2
  489. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  490. package/app/.next-cli-build/server/chunks/4776.js +33 -0
  491. package/app/.next-cli-build/server/chunks/4780.js +2 -2
  492. package/app/.next-cli-build/server/chunks/4803.js +9 -0
  493. package/app/.next-cli-build/server/chunks/4904.js +10 -0
  494. package/app/.next-cli-build/server/chunks/507.js +1 -1
  495. package/app/.next-cli-build/server/chunks/5115.js +67 -0
  496. package/app/.next-cli-build/server/chunks/5139.js +1 -0
  497. package/app/.next-cli-build/server/chunks/5258.js +2 -2
  498. package/app/.next-cli-build/server/chunks/5350.js +1 -0
  499. package/app/.next-cli-build/server/chunks/5615.js +3 -3
  500. package/app/.next-cli-build/server/chunks/5821.js +1 -0
  501. package/app/.next-cli-build/server/chunks/5920.js +17 -0
  502. package/app/.next-cli-build/server/chunks/6103.js +1 -0
  503. package/app/.next-cli-build/server/chunks/615.js +1 -1
  504. package/app/.next-cli-build/server/chunks/6182.js +3 -3
  505. package/app/.next-cli-build/server/chunks/6252.js +9 -0
  506. package/app/.next-cli-build/server/chunks/6448.js +109 -0
  507. package/app/.next-cli-build/server/chunks/{4206.js → 6470.js} +1 -1
  508. package/app/.next-cli-build/server/chunks/6492.js +1 -0
  509. package/app/.next-cli-build/server/chunks/6844.js +1 -1
  510. package/app/.next-cli-build/server/chunks/698.js +1 -1
  511. package/app/.next-cli-build/server/chunks/7141.js +1 -0
  512. package/app/.next-cli-build/server/chunks/7155.js +1 -0
  513. package/app/.next-cli-build/server/chunks/7250.js +1 -0
  514. package/app/.next-cli-build/server/chunks/7335.js +1 -0
  515. package/app/.next-cli-build/server/chunks/7662.js +1 -0
  516. package/app/.next-cli-build/server/chunks/7753.js +1 -0
  517. package/app/.next-cli-build/server/chunks/7828.js +1 -0
  518. package/app/.next-cli-build/server/chunks/7965.js +2 -2
  519. package/app/.next-cli-build/server/chunks/8062.js +9 -0
  520. package/app/.next-cli-build/server/chunks/8117.js +1 -0
  521. package/app/.next-cli-build/server/chunks/8129.js +1 -0
  522. package/app/.next-cli-build/server/chunks/8400.js +153 -0
  523. package/app/.next-cli-build/server/chunks/8469.js +9 -0
  524. package/app/.next-cli-build/server/chunks/8520.js +1 -1
  525. package/app/.next-cli-build/server/chunks/869.js +1 -0
  526. package/app/.next-cli-build/server/chunks/8775.js +1 -1
  527. package/app/.next-cli-build/server/chunks/8998.js +486 -0
  528. package/app/.next-cli-build/server/chunks/9046.js +1 -0
  529. package/app/.next-cli-build/server/chunks/9062.js +104 -0
  530. package/app/.next-cli-build/server/chunks/9261.js +88 -0
  531. package/app/.next-cli-build/server/chunks/9291.js +1 -0
  532. package/app/.next-cli-build/server/chunks/9397.js +1 -0
  533. package/app/.next-cli-build/server/chunks/9489.js +8 -0
  534. package/app/.next-cli-build/server/chunks/9508.js +45 -0
  535. package/app/.next-cli-build/server/chunks/9696.js +3 -3
  536. package/app/.next-cli-build/server/chunks/995.js +1 -0
  537. package/app/.next-cli-build/server/chunks/static/media/catalog.e7ada387.json +1710 -0
  538. package/app/.next-cli-build/server/instrumentation.js +1 -0
  539. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  540. package/app/.next-cli-build/server/middleware.js +11 -11
  541. package/app/.next-cli-build/server/pages/404.html +1 -1
  542. package/app/.next-cli-build/server/pages/500.html +1 -1
  543. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  544. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  545. package/app/.next-cli-build/server/webpack-runtime.js +1 -1
  546. package/app/.next-cli-build/static/TXnbOJZ6FVNX0p7oT_f3I/_buildManifest.js +1 -0
  547. package/app/.next-cli-build/static/chunks/1321-e3e6d10c0bafafeb.js +1 -0
  548. package/app/.next-cli-build/static/chunks/136-b76ff55769d5ecb1.js +1 -0
  549. package/app/.next-cli-build/static/chunks/2280-61262f8359f37a85.js +64 -0
  550. package/app/.next-cli-build/static/chunks/2493-6241eb181f2ecb6e.js +67 -0
  551. package/app/.next-cli-build/static/chunks/5497-aa5f62602eba33e9.js +7 -0
  552. package/app/.next-cli-build/static/chunks/7592-bbf465c7acd2478e.js +1 -0
  553. package/app/.next-cli-build/static/chunks/782-3676be0287313117.js +3 -0
  554. package/app/.next-cli-build/static/chunks/8500-287dd3e5d372ba6f.js +1 -0
  555. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/agent-library/page-d720efb4c9d427e6.js +1 -0
  556. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-04509a38b9fd3dcf.js +1 -0
  557. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-fa35870caaeabe20.js +1 -0
  558. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-88244cb193592f8f.js → page-aa9c65a5e73a3f5d.js} +1 -1
  559. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-a8d77d24b4c71915.js +1 -0
  560. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/routing/page-95f09ae849f539d6.js +1 -0
  561. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-6678759c536b4008.js +1 -0
  562. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-59e92d48daea1aed.js +3 -0
  563. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-183cf5498e6d3e42.js +59 -0
  564. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-b67e7e3b9acaf1cc.js +1 -0
  565. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-a4bad553cba810e7.js +4 -0
  566. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/{page-36448aa4e37c7802.js → page-0568602ac2385103.js} +1 -1
  567. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-f6e3507247a819e5.js +1 -0
  568. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-755ed32651028f99.js → page-08fe6612a31239da.js} +1 -1
  569. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-27ae229b00137a0b.js +1 -0
  570. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-a1ab95a02951c91d.js +1 -0
  571. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-0d7fcdbff356b2ab.js +10 -0
  572. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/page-608cdc11e7047159.js +1 -0
  573. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-ad84a479883e6cc3.js +1 -0
  574. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-f312c1076859630e.js +1 -0
  575. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/[id]/page-90277b8688f387c1.js +1 -0
  576. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-77bb7400c2be9752.js → page-33e127c15efc66a5.js} +1 -1
  577. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-0f74a450b98fa125.js +1 -0
  578. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/page-ad2eda4b48c9319b.js +1 -0
  579. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-025d20cc7b091120.js +1 -0
  580. package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-b06b9aec5dcdf486.js +1 -0
  581. package/app/.next-cli-build/static/chunks/app/_global-error/page-554d472d679429b3.js +1 -0
  582. package/app/.next-cli-build/static/chunks/app/api/agent-library/catalog/route-554d472d679429b3.js +1 -0
  583. package/app/.next-cli-build/static/chunks/app/api/agent-library/doctor/route-554d472d679429b3.js +1 -0
  584. package/app/.next-cli-build/static/chunks/app/api/agent-library/export/route-554d472d679429b3.js +1 -0
  585. package/app/.next-cli-build/static/chunks/app/api/agent-library/mcp/route-554d472d679429b3.js +1 -0
  586. package/app/.next-cli-build/static/chunks/app/api/agent-library/route-554d472d679429b3.js +1 -0
  587. package/app/.next-cli-build/static/chunks/app/api/agent-library/skills/route-554d472d679429b3.js +1 -0
  588. package/app/.next-cli-build/static/chunks/app/api/agent-library/sync/route-554d472d679429b3.js +1 -0
  589. package/app/.next-cli-build/static/chunks/app/api/agent-library/updates/route-554d472d679429b3.js +1 -0
  590. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-554d472d679429b3.js +1 -0
  591. package/app/.next-cli-build/static/chunks/app/api/cli-tools/aider-settings/route-554d472d679429b3.js +1 -0
  592. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-554d472d679429b3.js +1 -0
  593. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-554d472d679429b3.js +1 -0
  594. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-554d472d679429b3.js +1 -0
  595. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-554d472d679429b3.js +1 -0
  596. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-554d472d679429b3.js +1 -0
  597. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-554d472d679429b3.js +1 -0
  598. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-554d472d679429b3.js +1 -0
  599. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-554d472d679429b3.js +1 -0
  600. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-554d472d679429b3.js +1 -0
  601. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-554d472d679429b3.js +1 -0
  602. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-554d472d679429b3.js +1 -0
  603. package/app/.next-cli-build/static/chunks/app/api/cli-tools/gemini-cli-settings/route-554d472d679429b3.js +1 -0
  604. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-settings/route-554d472d679429b3.js +1 -0
  605. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-554d472d679429b3.js +1 -0
  606. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-554d472d679429b3.js +1 -0
  607. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-554d472d679429b3.js +1 -0
  608. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-554d472d679429b3.js +1 -0
  609. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-554d472d679429b3.js +1 -0
  610. package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-554d472d679429b3.js +1 -0
  611. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-554d472d679429b3.js +1 -0
  612. package/app/.next-cli-build/static/chunks/app/api/combos/route-554d472d679429b3.js +1 -0
  613. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-554d472d679429b3.js +1 -0
  614. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-554d472d679429b3.js +1 -0
  615. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-554d472d679429b3.js +1 -0
  616. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-554d472d679429b3.js +1 -0
  617. package/app/.next-cli-build/static/chunks/app/api/health/route-554d472d679429b3.js +1 -0
  618. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-554d472d679429b3.js +1 -0
  619. package/app/.next-cli-build/static/chunks/app/api/keys/route-554d472d679429b3.js +1 -0
  620. package/app/.next-cli-build/static/chunks/app/api/locale/route-554d472d679429b3.js +1 -0
  621. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-554d472d679429b3.js +1 -0
  622. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-554d472d679429b3.js +1 -0
  623. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-554d472d679429b3.js +1 -0
  624. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-554d472d679429b3.js +1 -0
  625. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-554d472d679429b3.js +1 -0
  626. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-554d472d679429b3.js +1 -0
  627. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-554d472d679429b3.js +1 -0
  628. package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/combos/[id]/route-554d472d679429b3.js +1 -0
  629. package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/combos/[id]/strategy/route-554d472d679429b3.js +1 -0
  630. package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/combos/route-554d472d679429b3.js +1 -0
  631. package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/health/route-554d472d679429b3.js +1 -0
  632. package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/providers/route-554d472d679429b3.js +1 -0
  633. package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/routing/route-554d472d679429b3.js +1 -0
  634. package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/usage/route-554d472d679429b3.js +1 -0
  635. package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/version/route-554d472d679429b3.js +1 -0
  636. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-554d472d679429b3.js +1 -0
  637. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-554d472d679429b3.js +1 -0
  638. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-554d472d679429b3.js +1 -0
  639. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-554d472d679429b3.js +1 -0
  640. package/app/.next-cli-build/static/chunks/app/api/models/route-554d472d679429b3.js +1 -0
  641. package/app/.next-cli-build/static/chunks/app/api/models/test/route-554d472d679429b3.js +1 -0
  642. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-554d472d679429b3.js +1 -0
  643. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-554d472d679429b3.js +1 -0
  644. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-554d472d679429b3.js +1 -0
  645. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-554d472d679429b3.js +1 -0
  646. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-554d472d679429b3.js +1 -0
  647. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-554d472d679429b3.js +1 -0
  648. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-554d472d679429b3.js +1 -0
  649. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-554d472d679429b3.js +1 -0
  650. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-554d472d679429b3.js +1 -0
  651. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-554d472d679429b3.js +1 -0
  652. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-554d472d679429b3.js +1 -0
  653. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-554d472d679429b3.js +1 -0
  654. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-554d472d679429b3.js +1 -0
  655. package/app/.next-cli-build/static/chunks/app/api/pricing/route-554d472d679429b3.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-554d472d679429b3.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-554d472d679429b3.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-554d472d679429b3.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/batch/route-554d472d679429b3.js +1 -0
  660. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/cache/route-554d472d679429b3.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/prepare/route-554d472d679429b3.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/remove-unavailable/route-554d472d679429b3.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-554d472d679429b3.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-554d472d679429b3.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-554d472d679429b3.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-554d472d679429b3.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-554d472d679429b3.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-554d472d679429b3.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/providers/route-554d472d679429b3.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-554d472d679429b3.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-554d472d679429b3.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-554d472d679429b3.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/routing/feedback/route-554d472d679429b3.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/routing/insights/route-554d472d679429b3.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/routing/learn/route-554d472d679429b3.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/routing/stats/route-554d472d679429b3.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/routing/versions/promote/route-554d472d679429b3.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/routing/versions/rollback/route-554d472d679429b3.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-554d472d679429b3.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-554d472d679429b3.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/settings/route-554d472d679429b3.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-554d472d679429b3.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/skills/[id]/route-554d472d679429b3.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/tags/route-554d472d679429b3.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/token-saver/vault-stats/route-554d472d679429b3.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-554d472d679429b3.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-554d472d679429b3.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-554d472d679429b3.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-554d472d679429b3.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-554d472d679429b3.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-554d472d679429b3.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-554d472d679429b3.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-554d472d679429b3.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-554d472d679429b3.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-554d472d679429b3.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-554d472d679429b3.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-554d472d679429b3.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-554d472d679429b3.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-554d472d679429b3.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-554d472d679429b3.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-554d472d679429b3.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-554d472d679429b3.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-554d472d679429b3.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-554d472d679429b3.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-554d472d679429b3.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-554d472d679429b3.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-554d472d679429b3.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-554d472d679429b3.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-554d472d679429b3.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-554d472d679429b3.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-554d472d679429b3.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-554d472d679429b3.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-554d472d679429b3.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-554d472d679429b3.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-554d472d679429b3.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/v1/route-554d472d679429b3.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-554d472d679429b3.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-554d472d679429b3.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-554d472d679429b3.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-554d472d679429b3.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/version/route-554d472d679429b3.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-554d472d679429b3.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/version/update/route-554d472d679429b3.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/callback/page-5c1d863ff86ddc6e.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/page-4cfc7195d2a8bf0e.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/landing/page-9e06d57d9b215fd7.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/login/page-554d472d679429b3.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-554d472d679429b3.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/page-554d472d679429b3.js +1 -0
  730. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-554d472d679429b3.js +1 -0
  731. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-554d472d679429b3.js +1 -0
  732. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-554d472d679429b3.js +1 -0
  733. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-554d472d679429b3.js +1 -0
  734. package/app/.next-cli-build/static/chunks/webpack-57b54315eb9fa808.js +1 -0
  735. package/app/.next-cli-build/static/css/92a5708a6b29ef8c.css +1 -0
  736. package/app/.next-cli-build/static/media/catalog.e7ada387.json +1710 -0
  737. package/app/custom-server.js +5 -5
  738. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/container.js +26 -18
  739. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/css-syntax-error.js +47 -14
  740. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/fromJSON.js +23 -9
  741. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/input.js +61 -33
  742. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/lazy-result.js +50 -37
  743. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/map-generator.js +26 -9
  744. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/no-work-result.js +57 -55
  745. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/node.js +110 -35
  746. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/parser.js +46 -38
  747. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/previous-map.js +30 -11
  748. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/processor.js +7 -7
  749. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/result.js +5 -5
  750. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/stringifier.js +41 -20
  751. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/tokenize.js +6 -2
  752. package/app/node_modules/{next/node_modules/postcss → postcss}/package.json +48 -48
  753. package/app/open-sse/package.json +4 -0
  754. package/app/open-sse/providers/generated/catalog.json +1710 -0
  755. package/app/package.json +22 -10
  756. package/app/public/i18n/literals/zh-CN.json +8 -0
  757. package/app/server.js +1 -1
  758. package/app/src/lib/db/adapters/betterSqliteAdapter.js +2 -3
  759. package/app/src/lib/db/adapters/bunSqliteAdapter.js +0 -2
  760. package/app/src/lib/db/adapters/nodeSqliteAdapter.js +0 -2
  761. package/app/src/lib/db/adapters/sqljsAdapter.js +23 -4
  762. package/app/src/lib/db/migrate.js +15 -4
  763. package/app/src/lib/updater/updater.js +67 -9
  764. package/app/src/shared/utils/apiKey.js +3 -7
  765. package/cli.js +205 -180
  766. package/hooks/sqliteRuntime.js +1 -7
  767. package/package.json +2 -2
  768. package/src/cli/api/client.js +3 -20
  769. package/src/cli/menus/settings.js +3 -62
  770. package/src/cli/tray/tray.js +18 -26
  771. package/src/shared/dataDir.js +61 -0
  772. package/src/shared/disableMitm.js +102 -0
  773. package/src/shared/openBrowser.js +43 -0
  774. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +0 -2
  775. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +0 -1
  776. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +0 -1
  777. package/app/.next-cli-build/server/app/api/init/route.js +0 -1
  778. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +0 -1
  779. package/app/.next-cli-build/server/app/api/init/route_client-reference-manifest.js +0 -1
  780. package/app/.next-cli-build/server/app/dashboard/agent-library.html +0 -1
  781. package/app/.next-cli-build/server/app/dashboard/agent-library.meta +0 -17
  782. package/app/.next-cli-build/server/app/dashboard/agent-library.rsc +0 -30
  783. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/!KGRhc2hib2FyZCk/dashboard/agent-library/__PAGE__.segment.rsc +0 -9
  784. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/!KGRhc2hib2FyZCk/dashboard/agent-library.segment.rsc +0 -5
  785. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  786. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  787. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/_full.segment.rsc +0 -30
  788. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/_head.segment.rsc +0 -6
  789. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/_index.segment.rsc +0 -8
  790. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/_tree.segment.rsc +0 -8
  791. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +0 -1
  792. package/app/.next-cli-build/server/app/dashboard/basic-chat.meta +0 -17
  793. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +0 -27
  794. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +0 -6
  795. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +0 -5
  796. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  797. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  798. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +0 -27
  799. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +0 -6
  800. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +0 -8
  801. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +0 -8
  802. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +0 -1
  803. package/app/.next-cli-build/server/app/dashboard/cli-tools.meta +0 -17
  804. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +0 -28
  805. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +0 -6
  806. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +0 -5
  807. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  808. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  809. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +0 -28
  810. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +0 -6
  811. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +0 -8
  812. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +0 -8
  813. package/app/.next-cli-build/server/app/dashboard/combos/routing.html +0 -1
  814. package/app/.next-cli-build/server/app/dashboard/combos/routing.meta +0 -18
  815. package/app/.next-cli-build/server/app/dashboard/combos/routing.rsc +0 -30
  816. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/!KGRhc2hib2FyZCk/dashboard/combos/routing/__PAGE__.segment.rsc +0 -9
  817. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/!KGRhc2hib2FyZCk/dashboard/combos/routing.segment.rsc +0 -5
  818. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +0 -5
  819. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  820. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  821. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/_full.segment.rsc +0 -30
  822. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/_head.segment.rsc +0 -6
  823. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/_index.segment.rsc +0 -8
  824. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/_tree.segment.rsc +0 -8
  825. package/app/.next-cli-build/server/app/dashboard/combos.html +0 -1
  826. package/app/.next-cli-build/server/app/dashboard/combos.meta +0 -17
  827. package/app/.next-cli-build/server/app/dashboard/combos.rsc +0 -28
  828. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +0 -6
  829. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +0 -5
  830. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  831. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  832. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +0 -28
  833. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +0 -6
  834. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +0 -8
  835. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +0 -8
  836. package/app/.next-cli-build/server/app/dashboard/endpoint.html +0 -1
  837. package/app/.next-cli-build/server/app/dashboard/endpoint.meta +0 -17
  838. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +0 -28
  839. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +0 -6
  840. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +0 -5
  841. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  842. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  843. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +0 -28
  844. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +0 -6
  845. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +0 -8
  846. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +0 -8
  847. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +0 -1
  848. package/app/.next-cli-build/server/app/dashboard/media-providers/web.meta +0 -18
  849. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +0 -30
  850. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +0 -9
  851. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +0 -5
  852. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +0 -5
  853. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  854. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  855. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +0 -30
  856. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +0 -6
  857. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +0 -8
  858. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +0 -8
  859. package/app/.next-cli-build/server/app/dashboard/media-providers.html +0 -1
  860. package/app/.next-cli-build/server/app/dashboard/media-providers.meta +0 -17
  861. package/app/.next-cli-build/server/app/dashboard/media-providers.rsc +0 -30
  862. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/__PAGE__.segment.rsc +0 -9
  863. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +0 -5
  864. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  865. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  866. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/_full.segment.rsc +0 -30
  867. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/_head.segment.rsc +0 -6
  868. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/_index.segment.rsc +0 -8
  869. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/_tree.segment.rsc +0 -8
  870. package/app/.next-cli-build/server/app/dashboard/mitm.html +0 -1
  871. package/app/.next-cli-build/server/app/dashboard/mitm.meta +0 -17
  872. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +0 -27
  873. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +0 -6
  874. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +0 -5
  875. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  876. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  877. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +0 -27
  878. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +0 -6
  879. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +0 -8
  880. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +0 -8
  881. package/app/.next-cli-build/server/app/dashboard/profile.html +0 -1
  882. package/app/.next-cli-build/server/app/dashboard/profile.meta +0 -17
  883. package/app/.next-cli-build/server/app/dashboard/profile.rsc +0 -28
  884. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +0 -6
  885. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +0 -5
  886. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  887. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  888. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +0 -28
  889. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +0 -6
  890. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +0 -8
  891. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +0 -8
  892. package/app/.next-cli-build/server/app/dashboard/providers/new.html +0 -1
  893. package/app/.next-cli-build/server/app/dashboard/providers/new.meta +0 -18
  894. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +0 -30
  895. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +0 -9
  896. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +0 -5
  897. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +0 -5
  898. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  899. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  900. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +0 -30
  901. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +0 -6
  902. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +0 -8
  903. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +0 -8
  904. package/app/.next-cli-build/server/app/dashboard/providers.html +0 -1
  905. package/app/.next-cli-build/server/app/dashboard/providers.meta +0 -17
  906. package/app/.next-cli-build/server/app/dashboard/providers.rsc +0 -28
  907. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +0 -6
  908. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +0 -5
  909. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  910. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  911. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +0 -28
  912. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +0 -6
  913. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +0 -8
  914. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +0 -8
  915. package/app/.next-cli-build/server/app/dashboard/quota.html +0 -2
  916. package/app/.next-cli-build/server/app/dashboard/quota.meta +0 -17
  917. package/app/.next-cli-build/server/app/dashboard/quota.rsc +0 -28
  918. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +0 -7
  919. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +0 -5
  920. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  921. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  922. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +0 -28
  923. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +0 -6
  924. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +0 -8
  925. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +0 -8
  926. package/app/.next-cli-build/server/app/dashboard/skills.html +0 -1
  927. package/app/.next-cli-build/server/app/dashboard/skills.meta +0 -17
  928. package/app/.next-cli-build/server/app/dashboard/skills.rsc +0 -30
  929. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +0 -9
  930. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +0 -5
  931. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  932. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  933. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +0 -30
  934. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +0 -6
  935. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +0 -8
  936. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +0 -8
  937. package/app/.next-cli-build/server/app/dashboard/token-saver.html +0 -1
  938. package/app/.next-cli-build/server/app/dashboard/token-saver.meta +0 -17
  939. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +0 -27
  940. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +0 -6
  941. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +0 -5
  942. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  943. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  944. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +0 -27
  945. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +0 -6
  946. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +0 -8
  947. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +0 -8
  948. package/app/.next-cli-build/server/app/dashboard/translator.html +0 -1
  949. package/app/.next-cli-build/server/app/dashboard/translator.meta +0 -17
  950. package/app/.next-cli-build/server/app/dashboard/translator.rsc +0 -30
  951. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +0 -9
  952. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +0 -5
  953. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  954. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  955. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +0 -30
  956. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +0 -6
  957. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +0 -8
  958. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +0 -8
  959. package/app/.next-cli-build/server/app/dashboard/usage.html +0 -1
  960. package/app/.next-cli-build/server/app/dashboard/usage.meta +0 -17
  961. package/app/.next-cli-build/server/app/dashboard/usage.rsc +0 -30
  962. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +0 -9
  963. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +0 -5
  964. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  965. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  966. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +0 -30
  967. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +0 -6
  968. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +0 -8
  969. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +0 -8
  970. package/app/.next-cli-build/server/app/dashboard.html +0 -1
  971. package/app/.next-cli-build/server/app/dashboard.meta +0 -16
  972. package/app/.next-cli-build/server/app/dashboard.rsc +0 -28
  973. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +0 -6
  974. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  975. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -7
  976. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +0 -28
  977. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +0 -6
  978. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +0 -8
  979. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +0 -8
  980. package/app/.next-cli-build/server/chunks/1051.js +0 -1
  981. package/app/.next-cli-build/server/chunks/1220.js +0 -3
  982. package/app/.next-cli-build/server/chunks/1241.js +0 -1
  983. package/app/.next-cli-build/server/chunks/1814.js +0 -17
  984. package/app/.next-cli-build/server/chunks/2117.js +0 -1
  985. package/app/.next-cli-build/server/chunks/2280.js +0 -1
  986. package/app/.next-cli-build/server/chunks/2548.js +0 -67
  987. package/app/.next-cli-build/server/chunks/2701.js +0 -10
  988. package/app/.next-cli-build/server/chunks/2768.js +0 -79
  989. package/app/.next-cli-build/server/chunks/3943.js +0 -1
  990. package/app/.next-cli-build/server/chunks/4632.js +0 -1
  991. package/app/.next-cli-build/server/chunks/4827.js +0 -1
  992. package/app/.next-cli-build/server/chunks/5330.js +0 -161
  993. package/app/.next-cli-build/server/chunks/5612.js +0 -1
  994. package/app/.next-cli-build/server/chunks/5655.js +0 -1
  995. package/app/.next-cli-build/server/chunks/5699.js +0 -1
  996. package/app/.next-cli-build/server/chunks/5961.js +0 -28
  997. package/app/.next-cli-build/server/chunks/6040.js +0 -1
  998. package/app/.next-cli-build/server/chunks/6059.js +0 -1
  999. package/app/.next-cli-build/server/chunks/6070.js +0 -1
  1000. package/app/.next-cli-build/server/chunks/6150.js +0 -64
  1001. package/app/.next-cli-build/server/chunks/6306.js +0 -1
  1002. package/app/.next-cli-build/server/chunks/6763.js +0 -1
  1003. package/app/.next-cli-build/server/chunks/6777.js +0 -1
  1004. package/app/.next-cli-build/server/chunks/6922.js +0 -1
  1005. package/app/.next-cli-build/server/chunks/7651.js +0 -1
  1006. package/app/.next-cli-build/server/chunks/8164.js +0 -67
  1007. package/app/.next-cli-build/server/chunks/8238.js +0 -1
  1008. package/app/.next-cli-build/server/chunks/8860.js +0 -32
  1009. package/app/.next-cli-build/server/chunks/8895.js +0 -67
  1010. package/app/.next-cli-build/server/chunks/8910.js +0 -8
  1011. package/app/.next-cli-build/server/chunks/8920.js +0 -1
  1012. package/app/.next-cli-build/server/chunks/9830.js +0 -73
  1013. package/app/.next-cli-build/static/HFerqnfiKkxdqoMVxOfPW/_buildManifest.js +0 -1
  1014. package/app/.next-cli-build/static/chunks/1321-39ad919b1616c75c.js +0 -1
  1015. package/app/.next-cli-build/static/chunks/1610-cd46c6c47a9aa99a.js +0 -1
  1016. package/app/.next-cli-build/static/chunks/1655-0df56bb46fc3a442.js +0 -73
  1017. package/app/.next-cli-build/static/chunks/2562-ceb69ca00b47af6e.js +0 -64
  1018. package/app/.next-cli-build/static/chunks/5242-bb1a1a7ec3bfb62f.js +0 -1
  1019. package/app/.next-cli-build/static/chunks/5497-1ebc533b1f404c9f.js +0 -7
  1020. package/app/.next-cli-build/static/chunks/5772-901f1092d831ec37.js +0 -3
  1021. package/app/.next-cli-build/static/chunks/705-012db20bb6a5da8b.js +0 -1
  1022. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/agent-library/page-b6f9c90a614bfb03.js +0 -1
  1023. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-af2d913820faedae.js +0 -1
  1024. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-a777baf9c2aa43b4.js +0 -1
  1025. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-3f5fa0d8e152056f.js +0 -1
  1026. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/routing/page-ff92eef8e57d1447.js +0 -1
  1027. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-73628e93426ae624.js +0 -1
  1028. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-a8d8d0f4bfbcfbae.js +0 -3
  1029. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-a915efd975f6af81.js +0 -59
  1030. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-9cad271042843781.js +0 -1
  1031. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-8bff15a89ffc3746.js +0 -4
  1032. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-4d2b06f4c8d1b384.js +0 -1
  1033. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-afeae41f2e9445ec.js +0 -1
  1034. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-ff7973275ee57a96.js +0 -1
  1035. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-5e44267c26a7e42d.js +0 -10
  1036. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/page-3afd6ee04180298c.js +0 -1
  1037. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-4957f02eb9879798.js +0 -1
  1038. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-14da9269a25bd090.js +0 -1
  1039. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/[id]/page-95e55b6593bcf3f7.js +0 -1
  1040. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-54d1bd253432bc6f.js +0 -1
  1041. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/page-ef0b203963c2c25e.js +0 -1
  1042. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-59db0b586ad5ab45.js +0 -1
  1043. package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-58013e7e99d17d70.js +0 -1
  1044. package/app/.next-cli-build/static/chunks/app/_global-error/page-4ff27935cdf818b5.js +0 -1
  1045. package/app/.next-cli-build/static/chunks/app/api/agent-library/catalog/route-4ff27935cdf818b5.js +0 -1
  1046. package/app/.next-cli-build/static/chunks/app/api/agent-library/doctor/route-4ff27935cdf818b5.js +0 -1
  1047. package/app/.next-cli-build/static/chunks/app/api/agent-library/export/route-4ff27935cdf818b5.js +0 -1
  1048. package/app/.next-cli-build/static/chunks/app/api/agent-library/mcp/route-4ff27935cdf818b5.js +0 -1
  1049. package/app/.next-cli-build/static/chunks/app/api/agent-library/route-4ff27935cdf818b5.js +0 -1
  1050. package/app/.next-cli-build/static/chunks/app/api/agent-library/skills/route-4ff27935cdf818b5.js +0 -1
  1051. package/app/.next-cli-build/static/chunks/app/api/agent-library/sync/route-4ff27935cdf818b5.js +0 -1
  1052. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-4ff27935cdf818b5.js +0 -1
  1053. package/app/.next-cli-build/static/chunks/app/api/cli-tools/aider-settings/route-4ff27935cdf818b5.js +0 -1
  1054. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-4ff27935cdf818b5.js +0 -1
  1055. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-4ff27935cdf818b5.js +0 -1
  1056. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-4ff27935cdf818b5.js +0 -1
  1057. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-4ff27935cdf818b5.js +0 -1
  1058. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-4ff27935cdf818b5.js +0 -1
  1059. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-4ff27935cdf818b5.js +0 -1
  1060. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-4ff27935cdf818b5.js +0 -1
  1061. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-4ff27935cdf818b5.js +0 -1
  1062. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-4ff27935cdf818b5.js +0 -1
  1063. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-4ff27935cdf818b5.js +0 -1
  1064. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-4ff27935cdf818b5.js +0 -1
  1065. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-4ff27935cdf818b5.js +0 -1
  1066. package/app/.next-cli-build/static/chunks/app/api/cli-tools/gemini-cli-settings/route-4ff27935cdf818b5.js +0 -1
  1067. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-settings/route-4ff27935cdf818b5.js +0 -1
  1068. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-4ff27935cdf818b5.js +0 -1
  1069. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-4ff27935cdf818b5.js +0 -1
  1070. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-4ff27935cdf818b5.js +0 -1
  1071. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-4ff27935cdf818b5.js +0 -1
  1072. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-4ff27935cdf818b5.js +0 -1
  1073. package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-4ff27935cdf818b5.js +0 -1
  1074. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-4ff27935cdf818b5.js +0 -1
  1075. package/app/.next-cli-build/static/chunks/app/api/combos/route-4ff27935cdf818b5.js +0 -1
  1076. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-4ff27935cdf818b5.js +0 -1
  1077. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-4ff27935cdf818b5.js +0 -1
  1078. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-4ff27935cdf818b5.js +0 -1
  1079. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-4ff27935cdf818b5.js +0 -1
  1080. package/app/.next-cli-build/static/chunks/app/api/health/route-4ff27935cdf818b5.js +0 -1
  1081. package/app/.next-cli-build/static/chunks/app/api/init/route-4ff27935cdf818b5.js +0 -1
  1082. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-4ff27935cdf818b5.js +0 -1
  1083. package/app/.next-cli-build/static/chunks/app/api/keys/route-4ff27935cdf818b5.js +0 -1
  1084. package/app/.next-cli-build/static/chunks/app/api/locale/route-4ff27935cdf818b5.js +0 -1
  1085. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-4ff27935cdf818b5.js +0 -1
  1086. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-4ff27935cdf818b5.js +0 -1
  1087. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-4ff27935cdf818b5.js +0 -1
  1088. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-4ff27935cdf818b5.js +0 -1
  1089. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-4ff27935cdf818b5.js +0 -1
  1090. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-4ff27935cdf818b5.js +0 -1
  1091. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-4ff27935cdf818b5.js +0 -1
  1092. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-4ff27935cdf818b5.js +0 -1
  1093. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-4ff27935cdf818b5.js +0 -1
  1094. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-4ff27935cdf818b5.js +0 -1
  1095. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-4ff27935cdf818b5.js +0 -1
  1096. package/app/.next-cli-build/static/chunks/app/api/models/route-4ff27935cdf818b5.js +0 -1
  1097. package/app/.next-cli-build/static/chunks/app/api/models/test/route-4ff27935cdf818b5.js +0 -1
  1098. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-4ff27935cdf818b5.js +0 -1
  1099. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-4ff27935cdf818b5.js +0 -1
  1100. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-4ff27935cdf818b5.js +0 -1
  1101. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-4ff27935cdf818b5.js +0 -1
  1102. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-4ff27935cdf818b5.js +0 -1
  1103. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-4ff27935cdf818b5.js +0 -1
  1104. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-4ff27935cdf818b5.js +0 -1
  1105. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-4ff27935cdf818b5.js +0 -1
  1106. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-4ff27935cdf818b5.js +0 -1
  1107. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-4ff27935cdf818b5.js +0 -1
  1108. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-4ff27935cdf818b5.js +0 -1
  1109. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-4ff27935cdf818b5.js +0 -1
  1110. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-4ff27935cdf818b5.js +0 -1
  1111. package/app/.next-cli-build/static/chunks/app/api/pricing/route-4ff27935cdf818b5.js +0 -1
  1112. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-4ff27935cdf818b5.js +0 -1
  1113. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-4ff27935cdf818b5.js +0 -1
  1114. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-4ff27935cdf818b5.js +0 -1
  1115. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/batch/route-4ff27935cdf818b5.js +0 -1
  1116. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/cache/route-4ff27935cdf818b5.js +0 -1
  1117. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/prepare/route-4ff27935cdf818b5.js +0 -1
  1118. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/remove-unavailable/route-4ff27935cdf818b5.js +0 -1
  1119. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-4ff27935cdf818b5.js +0 -1
  1120. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-4ff27935cdf818b5.js +0 -1
  1121. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-4ff27935cdf818b5.js +0 -1
  1122. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-4ff27935cdf818b5.js +0 -1
  1123. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-4ff27935cdf818b5.js +0 -1
  1124. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-4ff27935cdf818b5.js +0 -1
  1125. package/app/.next-cli-build/static/chunks/app/api/providers/route-4ff27935cdf818b5.js +0 -1
  1126. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-4ff27935cdf818b5.js +0 -1
  1127. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-4ff27935cdf818b5.js +0 -1
  1128. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-4ff27935cdf818b5.js +0 -1
  1129. package/app/.next-cli-build/static/chunks/app/api/routing/insights/route-4ff27935cdf818b5.js +0 -1
  1130. package/app/.next-cli-build/static/chunks/app/api/routing/learn/route-4ff27935cdf818b5.js +0 -1
  1131. package/app/.next-cli-build/static/chunks/app/api/routing/versions/promote/route-4ff27935cdf818b5.js +0 -1
  1132. package/app/.next-cli-build/static/chunks/app/api/routing/versions/rollback/route-4ff27935cdf818b5.js +0 -1
  1133. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-4ff27935cdf818b5.js +0 -1
  1134. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-4ff27935cdf818b5.js +0 -1
  1135. package/app/.next-cli-build/static/chunks/app/api/settings/route-4ff27935cdf818b5.js +0 -1
  1136. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-4ff27935cdf818b5.js +0 -1
  1137. package/app/.next-cli-build/static/chunks/app/api/skills/[id]/route-4ff27935cdf818b5.js +0 -1
  1138. package/app/.next-cli-build/static/chunks/app/api/tags/route-4ff27935cdf818b5.js +0 -1
  1139. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-4ff27935cdf818b5.js +0 -1
  1140. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-4ff27935cdf818b5.js +0 -1
  1141. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-4ff27935cdf818b5.js +0 -1
  1142. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-4ff27935cdf818b5.js +0 -1
  1143. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-4ff27935cdf818b5.js +0 -1
  1144. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-4ff27935cdf818b5.js +0 -1
  1145. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-4ff27935cdf818b5.js +0 -1
  1146. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-4ff27935cdf818b5.js +0 -1
  1147. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-4ff27935cdf818b5.js +0 -1
  1148. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-4ff27935cdf818b5.js +0 -1
  1149. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-4ff27935cdf818b5.js +0 -1
  1150. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-4ff27935cdf818b5.js +0 -1
  1151. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-4ff27935cdf818b5.js +0 -1
  1152. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-4ff27935cdf818b5.js +0 -1
  1153. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-4ff27935cdf818b5.js +0 -1
  1154. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-4ff27935cdf818b5.js +0 -1
  1155. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-4ff27935cdf818b5.js +0 -1
  1156. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-4ff27935cdf818b5.js +0 -1
  1157. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-4ff27935cdf818b5.js +0 -1
  1158. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-4ff27935cdf818b5.js +0 -1
  1159. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-4ff27935cdf818b5.js +0 -1
  1160. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-4ff27935cdf818b5.js +0 -1
  1161. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-4ff27935cdf818b5.js +0 -1
  1162. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-4ff27935cdf818b5.js +0 -1
  1163. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-4ff27935cdf818b5.js +0 -1
  1164. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-4ff27935cdf818b5.js +0 -1
  1165. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-4ff27935cdf818b5.js +0 -1
  1166. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-4ff27935cdf818b5.js +0 -1
  1167. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-4ff27935cdf818b5.js +0 -1
  1168. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-4ff27935cdf818b5.js +0 -1
  1169. package/app/.next-cli-build/static/chunks/app/api/v1/route-4ff27935cdf818b5.js +0 -1
  1170. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-4ff27935cdf818b5.js +0 -1
  1171. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-4ff27935cdf818b5.js +0 -1
  1172. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-4ff27935cdf818b5.js +0 -1
  1173. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-4ff27935cdf818b5.js +0 -1
  1174. package/app/.next-cli-build/static/chunks/app/api/version/route-4ff27935cdf818b5.js +0 -1
  1175. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-4ff27935cdf818b5.js +0 -1
  1176. package/app/.next-cli-build/static/chunks/app/api/version/update/route-4ff27935cdf818b5.js +0 -1
  1177. package/app/.next-cli-build/static/chunks/app/callback/page-64f2a90493720740.js +0 -1
  1178. package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/page-2c2051aa3be879d6.js +0 -1
  1179. package/app/.next-cli-build/static/chunks/app/landing/page-8c76c0ea58e06a53.js +0 -1
  1180. package/app/.next-cli-build/static/chunks/app/login/page-4ff27935cdf818b5.js +0 -1
  1181. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-4ff27935cdf818b5.js +0 -1
  1182. package/app/.next-cli-build/static/chunks/app/page-4ff27935cdf818b5.js +0 -1
  1183. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-4ff27935cdf818b5.js +0 -1
  1184. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-4ff27935cdf818b5.js +0 -1
  1185. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-4ff27935cdf818b5.js +0 -1
  1186. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-4ff27935cdf818b5.js +0 -1
  1187. package/app/.next-cli-build/static/chunks/webpack-868e94e9a2c8d9a9.js +0 -1
  1188. package/app/.next-cli-build/static/css/20c5585d3269ee43.css +0 -1
  1189. package/app/cli/.build-home/.switchboard/auth/machine-id-salt +0 -1
  1190. package/app/cli/.build-home/.switchboard/db/data.sqlite +0 -0
  1191. package/app/cli/.build-home/.switchboard/machine-id +0 -1
  1192. package/app/public/i18n/literals/ar.json +0 -195
  1193. package/app/public/i18n/literals/bn.json +0 -195
  1194. package/app/public/i18n/literals/cs.json +0 -195
  1195. package/app/public/i18n/literals/da.json +0 -195
  1196. package/app/public/i18n/literals/de.json +0 -195
  1197. package/app/public/i18n/literals/el.json +0 -195
  1198. package/app/public/i18n/literals/es.json +0 -195
  1199. package/app/public/i18n/literals/fa.json +0 -195
  1200. package/app/public/i18n/literals/fi.json +0 -195
  1201. package/app/public/i18n/literals/fr.json +0 -195
  1202. package/app/public/i18n/literals/he.json +0 -195
  1203. package/app/public/i18n/literals/hi.json +0 -195
  1204. package/app/public/i18n/literals/hu.json +0 -195
  1205. package/app/public/i18n/literals/id.json +0 -195
  1206. package/app/public/i18n/literals/it.json +0 -195
  1207. package/app/public/i18n/literals/ja.json +0 -195
  1208. package/app/public/i18n/literals/ko.json +0 -195
  1209. package/app/public/i18n/literals/nl.json +0 -195
  1210. package/app/public/i18n/literals/no.json +0 -195
  1211. package/app/public/i18n/literals/pl.json +0 -195
  1212. package/app/public/i18n/literals/pt-BR.json +0 -195
  1213. package/app/public/i18n/literals/pt-PT.json +0 -195
  1214. package/app/public/i18n/literals/ro.json +0 -195
  1215. package/app/public/i18n/literals/ru.json +0 -195
  1216. package/app/public/i18n/literals/sv.json +0 -195
  1217. package/app/public/i18n/literals/th.json +0 -195
  1218. package/app/public/i18n/literals/tl.json +0 -195
  1219. package/app/public/i18n/literals/tr.json +0 -195
  1220. package/app/public/i18n/literals/uk.json +0 -195
  1221. package/app/public/i18n/literals/ur.json +0 -195
  1222. package/app/public/i18n/literals/vi.json +0 -195
  1223. package/app/public/i18n/literals/zh-TW.json +0 -195
  1224. package/app/.next-cli-build/static/{HFerqnfiKkxdqoMVxOfPW → TXnbOJZ6FVNX0p7oT_f3I}/_ssgManifest.js +0 -0
  1225. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/at-rule.js +0 -0
  1226. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/comment.js +0 -0
  1227. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/declaration.js +4 -4
  1228. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/document.js +0 -0
  1229. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/list.js +0 -0
  1230. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/parse.js +1 -1
  1231. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/postcss.js +12 -12
  1232. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/root.js +0 -0
  1233. package/app/node_modules/{next/node_modules/postcss → postcss}/lib/rule.js +6 -6
  1234. /package/app/node_modules/{next/node_modules/postcss → postcss}/lib/stringify.js +0 -0
  1235. /package/app/node_modules/{next/node_modules/postcss → postcss}/lib/symbols.js +0 -0
  1236. /package/app/node_modules/{next/node_modules/postcss → postcss}/lib/terminal-highlight.js +0 -0
  1237. /package/app/node_modules/{next/node_modules/postcss → postcss}/lib/warn-once.js +0 -0
  1238. /package/app/node_modules/{next/node_modules/postcss → postcss}/lib/warning.js +0 -0
@@ -0,0 +1,10 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{7687:(e,t,s)=>{Promise.resolve().then(s.bind(s,55796))},55796:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>W});var i=s(95155),a=s(12115),n=s(73321),l=s(98500),r=s.n(l),o=s(5772),d=s(35497),c=s(88105),m=s(28777),p=s(16600),u=s(47224);let x=["none","low","medium","high"],h=["none","thinking"],f=["none","low","medium","high","max"],g={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":f,"claude-budget":["none","low","medium","high","xhigh","max"],"gemini-level":["minimal","low","medium","high"],"gemini-budget":x,zai:h,qwen:x,kimi:f,deepseek:["none","high","max"],minimax:h,hunyuan:x,step:x},y=[{pattern:"*codex*",levels:["low","medium","high","xhigh"]}];function b(e,t){let s=(0,p.nl)(e,t);if(!s.reasoning)return null;let i=y.find(e=>(0,u.gH)(e.pattern,t)),a=i?.levels||g[s.thinkingFormat]||x;return!1===s.thinkingCanDisable&&(a=a.filter(e=>"none"!==e)),a}var v=s(11059),j=s(929),w=s(73006);let k=new Map;async function N(e){if(!e?.url||!e?.type||e.requiresAuth)return[];let t=k.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let i=(await s.json()).data??[];return k.set(e.url,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}function C({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:i=[],type:a="llm",includeLegacyAliases:n=!0}){let l=new Set(i.map(e=>e.id)),r=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(a&&e!==a||l.has(t.id))continue;let i=`${s}/${t.id}`;r.has(i)||(r.add(i),o.push({id:t.id,name:t.name||t.id,fullModel:i,source:"custom",type:e}))}if(!n)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||l.has(t)||r.has(s)||(r.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:a||"llm"}))}return o}function S(e,t={}){let s=t.kind||t.type;if(s&&"string"==typeof s){let e=s.toLowerCase();return"chat"===e||"text"===e||"language"===e?"llm":e}let i=String(e||"").toLowerCase();return/embed/.test(i)?"embedding":/(^|[-_/])(tts|speech)([-_/]|$)/.test(i)?"tts":/(whisper|transcri|speech-to-text|(^|[-_/])stt([-_/]|$))/.test(i)?"stt":/(imagine-video|video-gen|(^|[-_/])video([-_/]|$))/.test(i)&&!/revision/.test(i)?"video":/(imagine-image|dall-e|stable-diffusion|sdxl|flux|midjourney|image-gen)/.test(i)||/(^|[-_/])image([-_/]|$)/.test(i)&&!/(vision|vl|multimodal)/.test(i)?"image":"llm"}function $(e,t){let s=String(e||"").trim();if(!s)return"";if(s=s.replace(/^models\//,""),t){let e=`${t}/`;s.startsWith(e)&&(s=s.slice(e.length))}return(s=s.replace(/^(openai|anthropic|google|x-ai|xai|meta-llama|mistralai)\//i,"")).trim()}var A=s(14051),T=s.n(A);function O({model:e,fullModel:t,alias:s,copied:a,onCopy:n,testStatus:l,isCustom:r,isFree:o,onDeleteAlias:c,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h,latencyMs:f}){let g=h?`${t}(${h})`:t,y="ok"===l?"#22c55e":"error"===l?"#ef4444":void 0;return(0,i.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:y?{color:y}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,i.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:g}),(0,i.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,i.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),Number.isFinite(f)&&(0,i.jsxs)("span",{className:"shrink-0 text-[9px] text-text-muted/70 tabular-nums",children:[Math.round(f),"ms"]}),(0,i.jsx)(d.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:()=>n(g,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:a===`model-${e.id}`?"Copied!":"Copy"})]}),r?(0,i.jsx)("button",{onClick:c,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,i.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}O.propTypes={model:T().shape({id:T().string.isRequired}).isRequired,fullModel:T().string.isRequired,alias:T().string,copied:T().string,onCopy:T().func.isRequired,testStatus:T().oneOf(["ok","error"]),isCustom:T().bool,isFree:T().bool,onDeleteAlias:T().func,onTest:T().func,isTesting:T().bool,onDisable:T().func,caps:T().object,thinkingSuffix:T().string,latencyMs:T().number};var E=s(78559);function I({modelId:e,fullModel:t,copied:s,onCopy:a,onDeleteAlias:n,onTest:l,testStatus:r,isTesting:o}){let d="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,i.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),l&&(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:l,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,i.jsx)("button",{onClick:n,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function R({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:n,copied:l,onCopy:r,onDeleteAlias:o,onAddCustomModel:c,onDeleteCustomModel:m,onRefreshModels:p,connections:u,isAnthropic:x}){let[h,f]=(0,a.useState)(""),[g,y]=(0,a.useState)(!1),[b,v]=(0,a.useState)(!1),[j,w]=(0,a.useState)(""),[k,N]=(0,a.useState)(null),[S,$]=(0,a.useState)({}),A=async t=>{if(!k){N(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),i=await s.json();$(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{$(e=>({...e,[t]:"error"}))}finally{N(null)}}},T=C({customModels:n,modelAliases:s,providerAlias:e,type:"llm"}),O=async()=>{if(!h.trim()||g)return;let e=h.trim();if(T.some(t=>t.id===e))return void(0,E.s)("Model already exists for this provider.");y(!0);try{await c(e),f("")}catch(e){(0,E.s)("Error adding model:",e)}finally{y(!1)}},D=async()=>{if(b)return;let t=u.find(e=>!1!==e.isActive);if(t){v(!0),w("");try{let s=await fetch(`/api/providers/${t.id}/models`),i=await s.json().catch(()=>({}));if(!s.ok)return void(0,E.s)(i.error||"Failed to import models");let a=i.models||[];if(0===a.length)return void(0,E.s)("No models returned from /models.");let n=new Set(T.map(e=>e.id)),l=[],r=new Set;for(let t of a){let s=String(t.id||t.name||t.model||"").trim();!s||n.has(s)||r.has(s)||(r.add(s),l.push({providerAlias:e,id:s,type:"llm",name:t.display_name||t.displayName||t.name||s}))}if(0===l.length)return void w("All models already in list");let o=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:l})}),d=await o.json().catch(()=>({}));if(!o.ok){let e=0;for(let t of l)await c(t.id),e+=1;w(e?`Imported ${e} model(s)`:"No new models were added");return}w(`Imported ${d.added??l.length} model(s)`),"function"==typeof p?await p():window.dispatchEvent(new CustomEvent("customModelChanged"))}catch(e){(0,E.s)("Error importing models:",e),(0,E.s)(e?.message||"Import failed")}finally{v(!1)}}},M=u.some(e=>!1!==e.isActive);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",x?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,i.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,i.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,i.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,i.jsx)("input",{id:"new-compatible-model-input",type:"text",value:h,onChange:e=>f(e.target.value),onKeyDown:e=>"Enter"===e.key&&O(),placeholder:x?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,i.jsx)(d.$n,{size:"sm",icon:"add",onClick:O,disabled:!h.trim()||g,children:g?"Adding...":"Add"}),(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"cloud_download",onClick:D,disabled:!M||b,children:b?"Importing...":"Import models"})]}),!M&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),j&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:j}),T.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:T.map(({id:s,alias:a,source:n})=>(0,i.jsx)(I,{modelId:s,fullModel:`${t}/${s}`,copied:l,onCopy:r,onDeleteAlias:()=>"custom"===n?m(s):o(a),onTest:u.length>0?()=>A(s):void 0,testStatus:S[s],isTesting:k===s},`${n}-${e}/${s}`))})]})}T().string.isRequired,T().string.isRequired,T().string,T().func.isRequired,T().func.isRequired,T().func,T().oneOf(["ok","error"]),T().bool,T().string.isRequired,T().object.isRequired,T().arrayOf(T().object),T().string,T().func.isRequired,T().func.isRequired,T().func.isRequired,T().func.isRequired,R.propTypes={providerStorageAlias:T().string.isRequired,providerDisplayAlias:T().string.isRequired,modelAliases:T().object.isRequired,customModels:T().arrayOf(T().object),copied:T().string,onCopy:T().func.isRequired,onDeleteAlias:T().func.isRequired,onAddCustomModel:T().func.isRequired,onDeleteCustomModel:T().func.isRequired,onRefreshModels:T().func,connections:T().arrayOf(T().shape({id:T().string,isActive:T().bool})).isRequired,isAnthropic:T().bool};var D=s(70217);function M({until:e}){let[t,s]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let i=Math.floor(t/1e3);if(i<60)s(`${i}s`);else if(i<3600)s(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);s(`${e}h ${t}m`)}};t();let i=setInterval(t,1e3);return()=>clearInterval(i)},[e]),t)?(0,i.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function P({connection:e,isOAuth:t,isFirst:s,isLast:n,onMoveUp:l,onMoveDown:r,onToggleActive:o,onEdit:c,onDelete:m,oneByOneStatus:p=null,autoPing:u=null}){let x=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,h=x?`Proxy: ${e.providerSpecificData?.connectionProxyUrl}`:"",f=u?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",g="";if(e.providerSpecificData?.connectionProxyUrl){let t=e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);g=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{g=t}}let y=e.providerSpecificData?.connectionNoProxy||"",b=x?"success":"default",v=e.authType||(t?"oauth":"apikey"),j="oauth"===v,w="cookie"===v,k=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(j?"OAuth Account":w?"Cookie Account":"API Key"),N=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[C,S]=(0,a.useState)(!1),$=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{S(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=$?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[e,$]);let A="unavailable"!==e.testStatus||C?e.testStatus:"active",T=()=>p?"queued"===p.state?"queued":"testing"===p.state?"testing":"success"===p.state?"success":"failed"===p.state?p.error?`failed: ${p.error}`:"failed":null:null;return(0,i.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,i.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,i.jsx)("button",{onClick:l,disabled:s,className:`p-0.5 rounded ${s?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,i.jsx)("button",{onClick:r,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:w?"cookie":j?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:k}),N&&(0,i.jsx)("p",{className:"text-xs text-text-muted truncate",children:N}),(0,i.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,i.jsx)(d.Ex,{variant:(0,D.g)(e.isActive,A),size:"sm",dot:!0,children:!1===e.isActive?"disabled":A||"Unknown"}),(0,i.jsx)(d.Ex,{variant:"default",size:"sm",children:j?"OAuth":w?"Cookie":"API Key"}),x&&(0,i.jsx)(d.Ex,{variant:b,size:"sm",children:"Proxy"}),C&&!1!==e.isActive&&(0,i.jsx)(M,{until:$}),e.lastError&&!1!==e.isActive&&(0,i.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),T()&&(0,i.jsx)(d.Ex,{variant:p?"success"===p.state?"success":"failed"===p.state?"error":"testing"===p.state?"primary":"default":"default",size:"sm",children:T()})]}),x&&(0,i.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,i.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:h,children:h}),g&&(0,i.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:g}),y&&(0,i.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:y,children:["no_proxy: ",y]})]})]})]}),(0,i.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,i.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[u&&(0,i.jsx)(d.m_,{text:f,children:(0,i.jsxs)("button",{onClick:()=>u.onToggle(!u.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${u.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,i.jsxs)("button",{onClick:c,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,i.jsxs)("button",{onClick:m,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,i.jsx)(d.lM,{size:"sm",checked:e.isActive??!0,onChange:o,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}M.propTypes={until:T().string.isRequired},P.propTypes={connection:T().shape({id:T().string,name:T().string,email:T().string,displayName:T().string,modelLockUntil:T().string,testStatus:T().string,isActive:T().bool,lastError:T().string,priority:T().number,globalPriority:T().number}).isRequired,isOAuth:T().bool.isRequired,isFirst:T().bool.isRequired,isLast:T().bool.isRequired,onMoveUp:T().func.isRequired,onMoveDown:T().func.isRequired,onToggleActive:T().func.isRequired,onEdit:T().func.isRequired,onDelete:T().func.isRequired,oneByOneStatus:T().shape({state:T().string,error:T().string}),autoPing:T().shape({on:T().bool,onToggle:T().func,provider:T().string})};let z=`name1|sk-key1
2
+ name2|sk-key2
3
+ sk-key-only-auto-named`;function U({isOpen:e,provider:t,providerName:s,isCompatible:n,isAnthropic:l,authType:r,authHint:o,website:m,error:p,onSave:u,onBulkDone:x,onClose:h}){let f="ollama-local"===t,g="cookie"===r,y="xai"===t&&!g,b=g?"Cookie Value":"API Key",v="azure"===t,j="cloudflare-ai"===t,w=c.Q2?.[t]?.regions||null,k=c.Q2?.[t]?.defaultRegion||w?.[0]?.id||"",[N,C]=(0,a.useState)({name:"",apiKey:"",defaultModel:"",priority:1,ollamaHostUrl:""}),[S,$]=(0,a.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[A,T]=(0,a.useState)({accountId:""}),[O,E]=(0,a.useState)(k),[I,R]=(0,a.useState)(!1),[D,M]=(0,a.useState)(null),[P,q]=(0,a.useState)(!1),[_,F]=(0,a.useState)("single"),[L,J]=(0,a.useState)(""),[K,B]=(0,a.useState)(null),W=N.name.trim().length>0,H=N.apiKey.trim().length>0,V=()=>f&&N.ollamaHostUrl.trim()?{baseUrl:N.ollamaHostUrl.trim()}:v?{azureEndpoint:S.azureEndpoint,apiVersion:S.apiVersion,deployment:S.deployment,organization:S.organization}:j?{accountId:A.accountId}:w&&O?{region:O}:void 0,G=async()=>{let e=N.apiKey.trim();if(e){R(!0);try{let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e,providerSpecificData:V()})}),i=await s.json();M(i.valid?"success":"failed")}catch{M("failed")}finally{R(!1)}}},Q=async()=>{if(!t)return;let e=N.name.trim(),s=N.apiKey.trim();if((f||s)&&(f||e)&&(!n||N.defaultModel.trim())){q(!0);try{let i=!1;try{R(!0),M(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:s,providerSpecificData:V()})});i=!!(await e.json()).valid,M(i?"success":"failed")}catch{M("failed")}finally{R(!1)}await u({name:e||(f?"Ollama Local":""),apiKey:s,defaultModel:n?N.defaultModel.trim():void 0,priority:N.priority,testStatus:i?"active":"unknown",providerSpecificData:V()})}finally{q(!1)}}},Z=async()=>{let e=L.split("\n").map(e=>e.trim()).filter(Boolean);if(!e.length)return;q(!0),B(null);let s=0,i=0;for(let a=0;a<e.length;a++){let n=e[a].split("|"),l=n.length>=2?n.slice(1).join("|").trim():n[0].trim();if(!l){i++;continue}let r=n.length>=2&&n[0].trim()||"Key",o=`${r} ${a+1}`;try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:l,name:o,priority:1,testStatus:"unknown"})})).ok?s++:i++}catch{i++}}q(!1),B({success:s,failed:i}),s>0&&x&&x()};return t?(0,i.jsx)(d.aF,{isOpen:e,title:`Add ${s||t} ${b}`,onClose:h,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.$n,{size:"sm",variant:"single"===_?"primary":"ghost",onClick:()=>{F("single"),B(null)},children:"Single"}),(0,i.jsx)(d.$n,{size:"sm",variant:"bulk"===_?"primary":"ghost",onClick:()=>{F("bulk"),B(null)},children:"Bulk Add"})]}),"bulk"===_&&(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,i.jsx)("code",{children:"name|apiKey"})," or just ",(0,i.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}),(0,i.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:z,value:L,onChange:e=>J(e.target.value)}),K&&(0,i.jsxs)("div",{className:`text-sm font-medium ${K.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",K.success," added",K.failed>0?`, ✗ ${K.failed} failed`:""]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.$n,{onClick:Z,fullWidth:!0,disabled:P||!L.trim(),children:P?"Adding...":"Add All Keys"}),(0,i.jsx)(d.$n,{onClick:h,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===_&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.pd,{label:"Name",value:N.name,onChange:e=>C({...N,name:e.target.value}),placeholder:f?"Ollama Local":"Production Key"}),f&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.pd,{label:"Ollama Host URL",value:N.ollamaHostUrl,onChange:e=>C({...N,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(d.$n,{onClick:G,disabled:I||P,variant:"secondary",children:I?"Checking...":"Check"})})]}),!f&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.pd,{label:b,type:g?"text":"password",autoComplete:"off",value:N.apiKey,onChange:e=>C({...N,apiKey:e.target.value}),placeholder:g?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":y?"xai-...":"",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(d.$n,{onClick:G,disabled:!N.apiKey||I||P,variant:"secondary",children:I?"Checking...":"Check"})})]}),y&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),g&&o&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:[o,m&&(0,i.jsxs)(i.Fragment,{children:[" ",(0,i.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",m.replace(/^https?:\/\//,"")]})]})]}),w&&(0,i.jsx)(d.l6,{label:"Region",value:O,onChange:e=>E(e.target.value),options:w.map(e=>({value:e.id,label:e.label}))}),n&&(0,i.jsx)(d.pd,{label:"Default Model",value:N.defaultModel,onChange:e=>C({...N,defaultModel:e.target.value}),placeholder:l?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),f&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,i.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,i.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),D&&(0,i.jsx)(d.Ex,{variant:"success"===D?"success":"error",children:"success"===D?"Valid":"Invalid"}),p&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:p}),n&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),j&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,i.jsx)(d.pd,{label:"Account ID",value:A.accountId,onChange:e=>T({...A,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,i.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),v&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(d.pd,{label:"Azure Endpoint",value:S.azureEndpoint,onChange:e=>$({...S,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,i.jsx)(d.pd,{label:"Deployment Name",value:S.deployment,onChange:e=>$({...S,deployment:e.target.value}),placeholder:"gpt-4"}),(0,i.jsx)(d.pd,{label:"API Version",value:S.apiVersion,onChange:e=>$({...S,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,i.jsx)(d.pd,{label:"Organization",value:S.organization,onChange:e=>$({...S,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,i.jsx)(d.pd,{label:"Priority",type:"number",min:1,value:N.priority,onChange:e=>C({...N,priority:Number.parseInt(e.target.value)||1})}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.$n,{onClick:Q,fullWidth:!0,disabled:P||!f&&(!W||!H)||n&&!N.defaultModel.trim()||v&&(!S.azureEndpoint||!S.deployment||!S.organization)||j&&!A.accountId,children:P?"Saving...":"Save"}),(0,i.jsx)(d.$n,{onClick:h,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function q({isOpen:e,node:t,onSave:s,onClose:n,isAnthropic:l}){let[r,o]=(0,a.useState)({name:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,m]=(0,a.useState)(!1),[p,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null),v=function(e){try{return["http:","https:"].includes(new URL(e).protocol)}catch{return!1}}(r.baseUrl.trim());(0,a.useEffect)(()=>{t&&(o({name:t.name||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(l?"https://api.anthropic.com/v1":"https://api.openai.com/v1")}),b(null),u(""),h(""))},[t,l]);let j=async()=>{if(r.name.trim()&&v){m(!0);try{let e={name:r.name.trim(),baseUrl:r.baseUrl.trim()};l||(e.apiType=r.apiType),await s(e)}finally{m(!1)}}},w=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:r.baseUrl,apiKey:p,type:l?"anthropic-compatible":"openai-compatible",modelId:x.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}};return t?(0,i.jsx)(d.aF,{isOpen:e,title:`Edit ${l?"Anthropic":"OpenAI"} Compatible`,onClose:n,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(d.pd,{label:"Name",value:r.name,onChange:e=>o({...r,name:e.target.value}),placeholder:`${l?"Anthropic":"OpenAI"} Compatible`,hint:"Friendly label for this provider."}),!l&&(0,i.jsx)(d.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:r.apiType,onChange:e=>o({...r,apiType:e.target.value})}),(0,i.jsx)(d.pd,{label:"Base URL",value:r.baseUrl,onChange:e=>o({...r,baseUrl:e.target.value}),placeholder:l?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Base URL ending in /v1 for your ${l?"Anthropic":"OpenAI"}-compatible API.`}),t.prefix?(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Model IDs use prefix ",(0,i.jsx)("code",{className:"bg-sidebar px-1 rounded font-mono",children:t.prefix})," ","(auto-assigned; stable so combos keep working)."]}):null,(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.pd,{label:"API Key (for Check)",type:"password",autoComplete:"off",value:p,onChange:e=>u(e.target.value),className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(d.$n,{onClick:w,disabled:!p||f||!v,variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,i.jsx)(d.pd,{label:"Model ID (optional)",value:x,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If the provider has no /models endpoint, test with a model ID."}),y&&(0,i.jsx)(d.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.$n,{onClick:j,fullWidth:!0,disabled:!r.name.trim()||!v||c,children:c?"Saving...":"Save"}),(0,i.jsx)(d.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function _({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:n,onClose:l}){let[r,o]=(0,a.useState)(""),[c,m]=(0,a.useState)(null),[p,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&(o(""),m(null),u(""))},[e]);let f=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},g=async()=>{let e=f(r.trim());if(e){m("testing"),u("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),i=await s.json();m(i.ok?"ok":"error"),u(i.error||"")}catch(e){m("error"),u(e.message)}}},y=async()=>{let e=f(r.trim());if(e&&!x){h(!0);try{await n(e)}finally{h(!1)}}};return(0,i.jsx)(d.aF,{isOpen:e,onClose:l,title:"Add Custom Model",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("input",{type:"text",value:r,onChange:e=>{o(e.target.value),m(null),u("")},onKeyDown:e=>{"Enter"===e.key&&g()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,i.jsx)(d.$n,{variant:"secondary",icon:"science",loading:"testing"===c,onClick:g,disabled:!r.trim()||"testing"===c,children:"testing"===c?"Testing...":"Test"})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,i.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:f(r.trim())||"model-id"})]})]}),"ok"===c&&(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===c&&(0,i.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,i.jsx)("span",{children:p||"Model not reachable"})]}),(0,i.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,i.jsx)(d.$n,{onClick:l,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,i.jsx)(d.$n,{onClick:y,fullWidth:!0,size:"sm",disabled:!r.trim()||x,children:x?"Adding...":"Add Model"})]})]})})}U.propTypes={isOpen:T().bool.isRequired,provider:T().string,providerName:T().string,isCompatible:T().bool,isAnthropic:T().bool,authType:T().string,authHint:T().string,website:T().string,error:T().string,onSave:T().func.isRequired,onBulkDone:T().func,onClose:T().func.isRequired},q.propTypes={isOpen:T().bool.isRequired,node:T().shape({id:T().string,name:T().string,prefix:T().string,apiType:T().string,baseUrl:T().string}),onSave:T().func.isRequired,onClose:T().func.isRequired,isAnthropic:T().bool},_.propTypes={isOpen:T().bool.isRequired,providerAlias:T().string.isRequired,providerDisplayAlias:T().string.isRequired,onSave:T().func.isRequired,onClose:T().func.isRequired};let F=`[
4
+ {
5
+ "accessToken": "eyJhbGc...",
6
+ "refreshToken": "rt_...",
7
+ "idToken": "eyJhbGc...",
8
+ "email": "user@example.com"
9
+ }
10
+ ]`;function L({isOpen:e,onClose:t,onSuccess:s}){let[n,l]=(0,a.useState)(""),[r,o]=(0,a.useState)(!1),[c,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(null),x=()=>{r||(l(""),m(""),u(null),t())},h=async()=>{var e;let t;m(""),u(null);let i=n.trim();if(!i)return;try{t=JSON.parse(i)}catch(e){m(`${(0,w.Tl)("Invalid JSON")}: ${e.message}`);return}let a=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!a||0===a.length)return void m((0,w.Tl)("No accounts found in input"));o(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:a})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);u(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,w.Tl)("Request failed"))}finally{o(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(d.aF,{isOpen:e,title:(0,w.Tl)("Bulk Add Codex Accounts"),onClose:x,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,w.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,i.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:F,value:n,onChange:e=>l(e.target.value),disabled:r}),c&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,w.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,w.Tl)("failed")}`:""]}),f.length>0&&(0,i.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,i.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.$n,{onClick:h,fullWidth:!0,disabled:r||!n.trim(),children:r?(0,w.Tl)("Importing..."):(0,w.Tl)("Import All")}),(0,i.jsx)(d.$n,{onClick:x,variant:"ghost",fullWidth:!0,disabled:r,children:(0,w.Tl)("Close")})]})]})})}L.propTypes={isOpen:T().bool.isRequired,onClose:T().func.isRequired,onSuccess:T().func};function J({connectionId:e,providerAlias:t,models:s,onComplete:n,onLatencyMap:l,onClose:r}){let[o,c]=(0,a.useState)(4),[m,p]=(0,a.useState)(50),[u,x]=(0,a.useState)(Math.round(20)),[h,f]=(0,a.useState)(!1),[g,y]=(0,a.useState)(null),[b,v]=(0,a.useState)(null),[j,w]=(0,a.useState)(""),[k,N]=(0,a.useState)(""),C=(0,a.useRef)(!1),S=(0,a.useRef)(null),$=s?.length||0,A=(0,a.useMemo)(()=>`max concurrency 16 \xb7 batch 200 \xb7 timeout ${60}s`,[]);async function T(){if(h||!e||0===$)return;C.current=!1,f(!0),w(""),v(null),N("Preparing…");let i={concurrency:Math.max(1,Math.min(16,Number(o)||4)),batchSize:Math.max(1,Math.min(200,Number(m)||50)),timeoutMs:Math.max(1e3,Math.min(6e4,1e3*(Number(u)||20)))},a={};try{let r=await fetch(`/api/providers/${e}/model-probes/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:s,providerAlias:t,concurrency:i.concurrency,batchSize:i.batchSize,timeoutMs:i.timeoutMs})}),o=await r.json().catch(()=>({}));if(!r.ok)return void w(o.error||"Prepare failed");let d=o.eligible||[],c=o.stats?.skippedDead||0,m=o.stats?.duplicates||0;if(y({done:0,total:d.length,ok:0,dead:0,retryable:0,skippedDead:c,skippedDup:m}),0===d.length){let e={ok:0,dead:0,retryable:0,tested:0,skippedDead:c,skippedDup:m,removed:0};v(e),N("Nothing to test (all skipped as known-unavailable or empty)."),n?.(e);return}let p=0,u=0,x=0,h=0;for(let s=0;s<d.length&&!C.current;s+=i.batchSize){let n=d.slice(s,s+i.batchSize);N(`Probing ${h+1}–${Math.min(h+n.length,d.length)} of ${d.length}…`),S.current=new AbortController;let l=await fetch(`/api/providers/${e}/model-probes/batch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:S.current.signal,body:JSON.stringify({models:n,providerAlias:t,concurrency:i.concurrency,batchSize:i.batchSize,timeoutMs:i.timeoutMs,warmup:0===s})}),r=await l.json().catch(()=>({}));if(r.providerError){w(r.error||"Provider authentication failed");break}if(!l.ok){w(r.error||"Batch failed");break}for(let e of r.results||[])"ok"===e.probeStatus?(p+=1,e.modelId&&Number.isFinite(e.latencyMs)&&(a[e.modelId]=e.latencyMs),e.canonicalId&&Number.isFinite(e.latencyMs)&&(a[e.canonicalId]=e.latencyMs)):"dead"===e.probeStatus?u+=1:x+=1;h+=(r.results||[]).length,y({done:h,total:d.length,ok:p,dead:u,retryable:x,skippedDead:c,skippedDup:m})}l?.(a);let f={ok:p,dead:u,retryable:x,tested:h,skippedDead:c,skippedDup:m,cancelled:C.current};v(f),N(C.current?"Cancelled (partial results saved).":"Done."),n?.(f)}catch(e){e?.name==="AbortError"?N("Cancelled."):w(e?.message||"Verify failed")}finally{f(!1),S.current=null}}async function O(){if(!e)return;N("Removing unavailable custom models…");let s=await fetch(`/api/providers/${e}/model-probes/remove-unavailable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:t,kind:"llm"})}),i=await s.json().catch(()=>({}));s.ok?(N(`Removed ${i.removed||0} unavailable custom model(s).`),n?.({...b||{},removed:i.removed||0})):w(i.error||"Remove failed")}async function E(){if(!e)return;let t=await fetch(`/api/providers/${e}/model-probes/cache`,{method:"DELETE"}),s=await t.json().catch(()=>({}));t.ok?(N(`Cleared probe cache (${s.cleared||0} rows). Next verify will re-test everything.`),v(null),y(null)):w(s.error||"Clear cache failed")}let I=g?.total?Math.min(100,Math.round(g.done/g.total*100)):0;return(0,i.jsxs)("div",{className:"mb-4 rounded-lg border border-border bg-sidebar/40 p-3 space-y-3",children:[(0,i.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Verify models"}),(0,i.jsxs)("p",{className:"text-[11px] text-text-muted mt-0.5",children:["Batch-ping availability and latency. Known-dead models are skipped until you clear the cache. Caps: ",A,"."]})]}),r&&(0,i.jsx)("button",{type:"button",onClick:r,className:"p-1 text-text-muted hover:text-text-main rounded",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,i.jsxs)("div",{className:"flex flex-wrap gap-3 items-end",children:[(0,i.jsxs)("label",{className:"text-xs text-text-muted",children:["Concurrency",(0,i.jsx)("input",{type:"number",min:1,max:16,value:o,disabled:h,onChange:e=>c(e.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,i.jsxs)("label",{className:"text-xs text-text-muted",children:["Batch size",(0,i.jsx)("input",{type:"number",min:1,max:200,value:m,disabled:h,onChange:e=>p(e.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,i.jsxs)("label",{className:"text-xs text-text-muted",children:["Timeout (s)",(0,i.jsx)("input",{type:"number",min:1,max:60,value:u,disabled:h,onChange:e=>x(e.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[h?(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"stop",onClick:function(){C.current=!0,S.current?.abort()},children:"Cancel"}):(0,i.jsx)(d.$n,{size:"sm",icon:"science",onClick:T,disabled:!e||0===$,children:"Start"}),(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete_sweep",onClick:E,disabled:h,children:"Clear cache"})]})]}),g&&(0,i.jsxs)("div",{className:"space-y-1",children:[(0,i.jsx)("div",{className:"h-1.5 w-full rounded-full bg-border overflow-hidden",children:(0,i.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${I}%`}})}),(0,i.jsxs)("p",{className:"text-[11px] text-text-muted",children:[g.done,"/",g.total," tested \xb7 ok ",g.ok," \xb7 dead ",g.dead," \xb7 retry ",g.retryable,g.skippedDead?` \xb7 skipped dead ${g.skippedDead}`:"",g.skippedDup?` \xb7 dupes ${g.skippedDup}`:""]})]}),k&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:k}),j&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:j}),b&&(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[(0,i.jsxs)("span",{className:"text-xs text-text-main",children:["Summary: ",b.ok," ok \xb7 ",b.dead," unavailable \xb7 ",b.retryable," retry later",b.skippedDead?` \xb7 ${b.skippedDead} skipped (known dead)`:"",b.cancelled?" \xb7 cancelled":""]}),b.dead>0&&(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:O,disabled:h,children:"Remove unavailable custom"})]})]})}function K(e,t=""){let s=String(e||"").trim();if(!s)return"";s=(s=s.replace(/\s+/g,"")).replace(/^models\//i,"");let i=String(t||"").trim();return i&&s.toLowerCase().startsWith(`${i.toLowerCase()}/`)&&(s=s.slice(i.length+1)),(s=s.replace(/\/{2,}/g,"/").replace(/^\/+|\/+$/g,"")).toLowerCase()}J.propTypes={connectionId:T().string,providerAlias:T().string,models:T().arrayOf(T().object),onComplete:T().func,onLatencyMap:T().func,onClose:T().func};let B={claude:"claudeAutoPing",codex:"codexAutoPing"};function W(){let e,t,s,l,p=(0,n.useParams)(),u=(0,n.useRouter)(),x=p.id,{getCaps:h}=(0,j.y)(),[f,g]=(0,a.useState)([]),[y,k]=(0,a.useState)([]),[A,T]=(0,a.useState)(!0),[I,D]=(0,a.useState)(null),[M,z]=(0,a.useState)(!1),[F,W]=(0,a.useState)(!1),[H,V]=(0,a.useState)(!1),[G,Q]=(0,a.useState)(""),[Z,X]=(0,a.useState)(!1),[Y,ee]=(0,a.useState)(!1),[et,es]=(0,a.useState)(!1),[ei,ea]=(0,a.useState)(null),[en,el]=(0,a.useState)({}),[er,eo]=(0,a.useState)([]),[ed,ec]=(0,a.useState)(!1),[em,ep]=(0,a.useState)({}),[eu,ex]=(0,a.useState)(""),[eh,ef]=(0,a.useState)(()=>new Set),[eg,ey]=(0,a.useState)(!1),[eb,ev]=(0,a.useState)(null),[ej,ew]=(0,a.useState)(""),[ek,eN]=(0,a.useState)("auto"),[eC,eS]=(0,a.useState)({enabled:!1,connections:{}}),[e$,eA]=(0,a.useState)([]),[eT,eO]=(0,a.useState)([]),[eE,eI]=(0,a.useState)([]),[eR,eD]=(0,a.useState)([]),[eM,eP]=(0,a.useState)(null),[ez,eU]=(0,a.useState)(!1),[eq,e_]=(0,a.useState)(!1),[eF,eL]=(0,a.useState)(!1),[eJ,eK]=(0,a.useState)(null),[eB,eW]=(0,a.useState)({}),[eH,eV]=(0,a.useState)(null),eG=(0,a.useRef)(!1),[eQ,eZ]=(0,a.useState)(!1),[eX,eY]=(0,a.useState)(""),[e0,e1]=(0,a.useState)(!1),[e2,e5]=(0,a.useState)({}),{copied:e3,copy:e4}=(0,v.C)(),e7="ag_risk_confirmed",e6=()=>{z(!0)},e8=()=>{"antigravity"===x&&"true"!==window.localStorage.getItem(e7)?eU(!0):ti?e6():(Q(""),V(!0))},e9=()=>{Q(""),V(!0)},te=()=>{ti?e8():e9()},tt=I?{id:I.id,name:I.name||("anthropic-compatible"===I.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===I.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===I.type?"AC":"OC",apiType:I.apiType,baseUrl:I.baseUrl,type:I.type}:c.zN[x]||c.fg[x]||c.IS[x]||c.nJ[x]||c.br[x],ts=tt?.authModes||[],ti=!!c.zN[x]||!!c.IS[x]||ts.includes("oauth"),ta=!!c.fg[x]||ts.includes("apikey"),tn=!!c.IS[x]?.noAuth,tl=(0,m.KC)(x),tr=(()=>{let e=new Map(tl.map(e=>[e.id,e]));for(let t of eT)t?.id&&e.set(t.id,{...e.get(t.id),...t});return[...e.values()]})(),to=(0,c.wG)(x),td=(0,c.mq)(x),tc=(0,c.gb)(x),tm=td||tc,tp=!tm&&ti&&ta,tu="xai"===x?"Grok Build OAuth":"OAuth",tx="xai"===x?"xAI API Key":"API Key",th=e=>{if(!ek||"auto"===ek)return null;let t=b(x,e);return t&&t.includes(ek)?ek:null},tf=(()=>{let e=new Set;for(let t of tr){let s=b(x,t.id);s&&s.forEach(t=>{"none"!==t&&e.add(t)})}return e.size?["auto",...e]:null})(),tg=tm?x:to,ty=tm?I?.prefix||x:to,tb=(0,a.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tg)}`,{cache:"no-store"}),t=await e.json();e.ok&&eD(t.ids||[])}catch(e){(0,E.s)("Error fetching disabled models:",e)}},[tg]),tv=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tg,ids:[e]})})).ok&&await tb()}catch(e){(0,E.s)("Error disabling model:",e)}},tj=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tg)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tb()}catch(e){(0,E.s)("Error enabling model:",e)}},tw=async e=>{e.length&&eP({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eP(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tg,ids:e})})).ok&&await tb()}catch(e){(0,E.s)("Error disabling all models:",e)}}})},tk=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tg)}`,{method:"DELETE"})).ok&&await tb()}catch(e){(0,E.s)("Error enabling all models:",e)}},tN=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&el(t.aliases||{})}catch(e){(0,E.s)("Error fetching aliases:",e)}},[]),tC=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&eo(t.models||[])}catch(e){(0,E.s)("Error fetching custom models:",e)}},[]);(0,a.useEffect)(()=>{"kilocode"===x&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eI(e.models)}).catch(()=>{})},[x]);let tS=(0,a.useCallback)(async()=>{try{let[e,t,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),a=await t.json(),n=s.ok?await s.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===x);g(e)}let l=(n.providerStrategies||{})[x]||{};ev(l.fallbackStrategy||null),ew(null!=l.stickyRoundRobinLimit?String(l.stickyRoundRobinLimit):"1");let r=(n.providerThinking||{})[x]||{};eN(r.mode||"auto");let o=B[x],d=o&&n[o]||{};if(eS({enabled:!0===d.enabled,connections:d.connections||{}}),t.ok){let e=(a.nodes||[]).find(e=>e.id===x)||null;if(!e&&tm)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===x)||null))break}D(e)}}catch(e){(0,E.s)("Error fetching connections:",e)}finally{T(!1)}},[x,tm]),t$=async e=>{try{let t=await fetch(`/api/provider-nodes/${x}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(D(s.node),await tS(),es(!1))}catch(e){(0,E.s)("Error updating provider node:",e)}},tA=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),i=(s.ok?await s.json():{}).providerStrategies||{},a={};e&&(a.fallbackStrategy=e),"round-robin"===e&&""!==t&&(a.stickyRoundRobinLimit=Number(t)||3);let n={...i};0===Object.keys(a).length?delete n[x]:n[x]=a,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:n})})}catch(e){(0,E.s)("Error saving provider strategy:",e)}},tT=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[x]={mode:e}:delete s[x],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){(0,E.s)("Error saving thinking config:",e)}},tO=async e=>{let t=B[x];if(t){eS(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){(0,E.s)("Error saving auto-ping config:",e)}}};(0,a.useEffect)(()=>{tS(),tN(),tC(),tb()},[tS,tN,tC,tb]),(0,a.useEffect)(()=>{if(tm)return;let e=f.find(e=>!1!==e.isActive);if(!e)return void eO([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(e=>e.json().catch(()=>({}))).then(e=>{!t&&Array.isArray(e.models)&&e.models.length>0&&eO(e.models)}).catch(()=>{}),()=>{t=!0}},[f,tm]),(0,a.useEffect)(()=>{let e=(c.zN[x]||c.fg[x]||c.IS[x]||c.nJ[x])?.modelsFetcher;e&&N(e).then(eA)},[x]);let tE=async(e,t,s=to)=>{let i=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:i,alias:t})});if(e.ok)await tN();else{let t=await e.json();(0,E.s)(t.error||"Failed to set alias")}}catch(e){(0,E.s)("Error setting alias:",e)}},tI=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tN()}catch(e){(0,E.s)("Error deleting alias:",e)}},tR=async(e,t="llm",s=tg)=>{try{let i=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t})});if(i.ok)await tC(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await i.json();(0,E.s)(e.error||"Failed to add custom model")}}catch(e){(0,E.s)("Error adding custom model:",e)}},tD=async(e,t="llm",s=tg)=>{try{let i=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${i}`,{method:"DELETE"})).ok&&(await tC(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){(0,E.s)("Error deleting custom model:",e)}},tM=async()=>{if(eQ)return;let e=f.find(e=>y.includes(e.id)&&!1!==e.isActive)||f.find(e=>!1!==e.isActive);if(!e)return void(0,E.s)((0,w.Tl)("Add an active connection first"));eZ(!0),eY("");try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json().catch(()=>({}));if(!t.ok)return void(0,E.s)(s.error||(0,w.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void(0,E.s)(s.warning||(0,w.Tl)("No models returned"));let a=new Set(tr.map(e=>e.id)),n=[],l=[],r=new Set;for(let e of i){let t=function(e,t){if(null==e)return null;if("string"==typeof e){let s=$(e,t);return s?{id:s,name:s,type:S(s)}:null}let s=e.id||e.name||e.model||e.slug;if(!s)return null;let i=$(s,t);if(!i)return null;let a=e.display_name||e.displayName||e.name||e.title||i;return{id:i,name:String(a),type:S(i,e)}}(e,tg);if(!t)continue;let{id:s,name:i,type:o}=t,d=`${o}|${s}`;if(r.has(d))continue;if(r.add(d),a.has(s)){eR.includes(s)&&l.push(s);continue}if(er.some(e=>e.providerAlias===tg&&e.id===s&&(e.kind||e.type||"llm")===o))continue;let c=`${tg}/${s}`;Object.values(en).includes(c)||n.push({providerAlias:tg,id:s,type:o,name:i})}let o=0;if(l.length>0)try{for(let e of l)(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tg)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&(o+=1);await tb()}catch{}let d=0;if(n.length>0){let e=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:n})}),t=await e.json().catch(()=>({}));if(!e.ok)return void(0,E.s)(t.error||(0,w.Tl)("Failed to save models"));d=t.added??n.length,await tC(),window.dispatchEvent(new CustomEvent("customModelChanged"))}let c=n.filter(e=>"llm"!==e.type).length,m=[];if(d>0&&m.push(`${d} new`),o>0&&m.push(`${o} re-enabled`),0===m.length)eY((0,w.Tl)("All models already in list"));else{let e=`Imported ${m.join(" \xb7 ")} (${i.length} from provider)`;c>0&&(e+=" \xb7 non-chat types stored for media pages"),s.warning&&(e+=` \xb7 ${s.warning}`),eY(e)}}catch(e){(0,E.s)("Error importing models:",e),(0,E.s)((0,w.Tl)("Error fetching models")+": "+(e?.message||e))}finally{eZ(!1)}},tP=async()=>{if(eq||0===f.length)return;let e=Object.fromEntries(f.map(e=>[e.id,{state:"queued",error:null}]));eG.current=!1,e_(!0),eL(!1),eK(null),eW(e),eV({total:f.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<f.length;e+=1){if(eG.current){eV({total:f.length,completed:e,passed:t,failed:s,stopped:!0});break}let i=f[e];eK(i.id),eW(e=>({...e,[i.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${i.id}/test`,{method:"POST"}),a=await e.json(),n=!!a.valid;n?t+=1:s+=1,eW(e=>({...e,[i.id]:{state:n?"success":"failed",error:n?null:a.error||null}}))}catch(e){s+=1,eW(t=>({...t,[i.id]:{state:"failed",error:e.message||"Test failed"}}))}eV({total:f.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<f.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eK(null),e_(!1),eL(!1),eG.current=!1}},tz=async e=>{let t=f.find(t=>t.id===e),s=t?.name?.trim()||t?.email?.trim()||e;eP({title:"Delete Connection",message:`Delete connection “${s}”?`,onConfirm:async()=>{eP(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&g(t=>t.filter(t=>t.id!==e))}catch(e){(0,E.s)("Error deleting connection:",e)}}})},tU=()=>{tS(),z(!1)},tq=async e=>{Q("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:x,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tS(),V(!1);return}Q(s?.error||"Failed to save connection")}catch(e){(0,E.s)("Error saving connection:",e),Q("Failed to save connection")}},t_=async e=>{try{(await fetch(`/api/providers/${ei.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tS(),ee(!1))}catch(e){(0,E.s)("Error updating connection:",e)}},tF=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&g(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){(0,E.s)("Error updating connection status:",e)}},tL=async(e,t)=>{let s=[...f];[s[e],s[t]]=[s[t],s[e]],g(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){(0,E.s)("Error swapping priority:",e),await tS()}},tJ=f.length>0&&y.length===f.length,tK=(0,i.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:f.map((e,t)=>(0,i.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,i.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,i.jsx)("input",{type:"checkbox",checked:y.includes(e.id),onChange:()=>{var t;return t=e.id,void k(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(P,{connection:e,isOAuth:ti,isFirst:0===t,isLast:t===f.length-1,onMoveUp:()=>tL(t,t-1),onMoveDown:()=>tL(t,t+1),onToggleActive:t=>tF(e.id,t),autoPing:B[x]&&"oauth"===e.authType?{on:!0===eC.connections[e.id],onToggle:t=>{var s;return s=e.id,void tO({...eC,connections:{...eC.connections,[s]:t}})},provider:x}:null,onEdit:()=>{ea(e),ee(!0)},onDelete:()=>tz(e.id),oneByOneStatus:eB[e.id]||null})})]},e.id))}),tB=async e=>{if(!eh.has(e)){ef(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tg}/${e}`})}),s=await t.json();ep(t=>({...t,[e]:s.ok?"ok":"error"})),ex(s.ok?"":s.error||"Model not reachable")}catch{ep(t=>({...t,[e]:"error"})),ex("Network error")}finally{ef(t=>{let s=new Set(t);return s.delete(e),s})}}};return A?(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(d.Qv,{}),(0,i.jsx)(d.Qv,{})]}):tt?(0,i.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)(r(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,i.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${tt.color}15`},children:ed?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:tt.color},children:tt.textIcon||tt.id.slice(0,2).toUpperCase()}):(0,i.jsx)(o.default,{src:td&&tt.apiType?"responses"===tt.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tc?"/providers/anthropic-m.png":`/providers/${tt.id}.png`,alt:tt.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>ec(!0)})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,i.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:tt.name}),(tt.notice?.apiKeyUrl||tt.notice?.signupUrl||tt.website)&&(0,i.jsxs)("a",{href:tt.notice?.apiKeyUrl||tt.notice?.signupUrl||tt.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),tt.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[f.length," connection",1===f.length?"":"s"]})]})]})]}),tt.deprecated&&(0,i.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,i.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:tt.deprecationNotice})]}),tt.notice?.text&&!tt.deprecated&&(0,i.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:tt.notice.text}),tt.notice.apiKeyUrl&&(0,i.jsx)("a",{href:tt.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),tm&&I&&(0,i.jsx)(d.Zp,{children:(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:tc?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tc?"Messages API":"responses"===I.apiType?"Responses API":"Chat Completions"," \xb7 ",(I.baseUrl||"").replace(/\/$/,""),"/",tc?"messages":"responses"===I.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>{Q(""),V(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>es(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eP({title:"Delete Compatible Node",message:`Delete this ${tc?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eP(null);try{(await fetch(`/api/provider-nodes/${x}`,{method:"DELETE"})).ok&&u.push("/dashboard/providers")}catch(e){(0,E.s)("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tn?(0,i.jsx)(d.gw,{providerId:x}):(0,i.jsxs)(d.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[f.length>0&&(0,i.jsxs)(i.Fragment,{children:[y.length>0&&(0,i.jsxs)(d.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=y.length;0!==e&&eP({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eP(null);let e=0,t=[...y];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){(0,E.s)("Error deleting connection:",t),e+=1}g(e=>e.filter(e=>!t.includes(e.id))),k([]),e>0&&(0,E.s)(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",y.length,")"]}),(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tP,disabled:eq,children:eq?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eq&&(0,i.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eq&&(eG.current=!0,eL(!0))},disabled:eF,children:eF?"Stopping...":"Stop"})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,i.jsx)(d.lM,{checked:"round-robin"===eb,onChange:e=>{let t=e?"round-robin":null,s=e?ej||"1":ej;e&&!ej&&ew("1"),ev(t),tA(t,s)}}),"round-robin"===eb&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,i.jsx)("input",{type:"number",min:1,value:ej,onChange:e=>{var t;ew(t=e.target.value),tA("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===f.length?(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:ti?"lock":"key"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tp&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tu," or ",tx,"."]})]})]}),(0,i.jsx)("div",{className:"flex gap-2",children:tp?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e8,children:tu}),(0,i.jsx)(d.$n,{size:"sm",icon:"key",onClick:e9,children:tx})]}):(0,i.jsxs)(i.Fragment,{children:[!tm&&"iflow"===x&&(0,i.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>W(!0),children:"Cookie"}),"codex"===x&&(0,i.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>X(!0),children:(0,w.Tl)("Bulk Add")}),(0,i.jsx)(d.$n,{size:"sm",icon:"add",onClick:te,children:tm?"Add API Key":"iflow"===x?"OAuth":"Add Connection"})]})})]}):(0,i.jsxs)(i.Fragment,{children:[eH&&(0,i.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,i.jsxs)("span",{children:["Total: ",eH.total]}),(0,i.jsxs)("span",{children:["Completed: ",eH.completed]}),(0,i.jsxs)("span",{children:["Passed: ",eH.passed]}),(0,i.jsxs)("span",{children:["Failed: ",eH.failed]}),eH.stopped&&(0,i.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eq&&eJ&&(0,i.jsxs)("span",{children:["Running: ",f.find(e=>e.id===eJ)?.name||eJ]})]})}),f.length>0&&(0,i.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,i.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,i.jsx)("input",{type:"checkbox",checked:tJ,onChange:()=>{tJ?k([]):k(f.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),tK,!tm&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===x&&(0,i.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>W(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===x&&(0,i.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>X(!0),title:(0,w.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,w.Tl)("Bulk Add")}),tp?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e8,className:"w-full sm:w-auto",children:tu}),(0,i.jsx)(d.$n,{size:"sm",icon:"key",onClick:e9,className:"w-full sm:w-auto",children:tx})]}):(0,i.jsx)(d.$n,{size:"sm",icon:"add",onClick:te,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,i.jsxs)(d.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tf&&(0,i.jsx)("select",{value:ek,onChange:e=>{var t;eN(t=e.target.value),tT(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tf.map(e=>(0,i.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tm&&(e=[...tr,...eE.filter(e=>!tr.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eR.includes(e)),t=f.some(e=>!1!==e.isActive),(0,i.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:eQ?"progress_activity":"cloud_download",onClick:tM,disabled:eQ||!t,title:t?"Import models from the active connection":"Add an active connection to import models",children:eQ?"Importing...":"Import models"}),t&&(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"science",onClick:()=>e1(e=>!e),children:e0?"Hide verify":"Verify models"}),eR.length>0&&(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tk,children:"Active All"}),e.length>0&&(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tw(e),children:"Disable All"})]}))]}),!!eu&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eu}),eX&&(0,i.jsx)("p",{className:"text-xs text-text-muted mb-3",children:eX}),e0&&(s=f.find(e=>y.includes(e.id)&&!1!==e.isActive)||f.find(e=>!1!==e.isActive),l=[...C({customModels:er,modelAliases:en,providerAlias:tg,builtInModels:tr,type:"llm"}).map(e=>({id:e.id,name:e.name||e.id,kind:"llm"})),...tr.filter(e=>{let t=(0,m.CP)(e);return(!t||"llm"===t)&&!eR.includes(e.id)}).map(e=>({id:e.id,name:e.name||e.id,kind:"llm"}))],(0,i.jsx)(J,{connectionId:s?.id,providerAlias:tg,models:l,onClose:()=>e1(!1),onLatencyMap:e=>e5(t=>({...t,...e})),onComplete:async e=>{e?.removed>0&&await tC()}})),(()=>{let e,t,s;if(tm)return(0,i.jsx)(R,{providerStorageAlias:tg,providerDisplayAlias:ty,modelAliases:en,customModels:er,copied:e3,onCopy:e4,onSetAlias:tE,onDeleteAlias:tI,onAddCustomModel:e=>tR(e,"llm",tg),onDeleteCustomModel:e=>tD(e,"llm",tg),onRefreshModels:tC,connections:f,isAnthropic:tc});let a=[...tr,...eE.filter(e=>!tr.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),n=new Set(eR),l=a.filter(e=>!n.has(e.id)),r=a.filter(e=>n.has(e.id)),o=C({customModels:er,modelAliases:en,providerAlias:tg,builtInModels:tr,type:"llm"});return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o.map(e=>(0,i.jsx)(O,{model:{id:e.id,name:e.name},fullModel:`${ty}/${e.id}`,alias:e.alias,copied:e3,onCopy:e4,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tD(e.id,"llm",tg):tI(e.alias)},testStatus:em[e.id],onTest:f.length>0||tn?()=>tB(e.id):void 0,isTesting:eh.has(e.id),isCustom:!0,isFree:!1,caps:h(`${x}/${e.id}`),thinkingSuffix:th(e.id),latencyMs:e2[e.id]??e2[K(e.id,tg)]},`${e.source}-${e.fullModel}`)),l.map(e=>{let t=`${tg}/${e.id}`,s=`${x}/${e.id}`,a=Object.entries(en).find(([,e])=>e===t||e===s)?.[0];return(0,i.jsx)(O,{model:e,fullModel:`${ty}/${e.id}`,alias:a,copied:e3,onSetAlias:t=>tE(e.id,t,tg),onCopy:e4,onDeleteAlias:()=>tI(a),testStatus:em[e.id],onTest:f.length>0||tn?()=>tB(e.id):void 0,isTesting:eh.has(e.id),isFree:e.isFree,onDisable:()=>tv(e.id),caps:h(`${x}/${e.id}`),thinkingSuffix:th(e.id),latencyMs:e2[e.id]??e2[K(e.id,tg)]},e.id)}),(0,i.jsxs)("button",{onClick:()=>ey(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),e$.length>0&&(e=new Set([...Object.values(en),...o.map(e=>e.fullModel)]),t=new Set(tr.map(e=>e.id)),0===(s=e$.filter(s=>!e.has(`${tg}/${s.id}`)&&!t.has(s.id))).length?null:(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,i.jsxs)("button",{onClick:async()=>{await tR(e.id,"llm",tg)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),r.length>0&&(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",r.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(e=>(0,i.jsxs)("button",{onClick:()=>tj(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),"kiro"===x?(0,i.jsx)(d.Mh,{isOpen:M,providerInfo:tt,onSuccess:tU,onClose:()=>z(!1)}):"cursor"===x?(0,i.jsx)(d.G9,{isOpen:M,onSuccess:tU,onClose:()=>z(!1)}):"gitlab"===x?(0,i.jsx)(d.vj,{isOpen:M,providerInfo:tt,onSuccess:tU,onClose:()=>z(!1)}):(0,i.jsx)(d.LF,{isOpen:M,provider:x,providerInfo:tt,onSuccess:tU,onClose:()=>z(!1)}),"iflow"===x&&(0,i.jsx)(d.vE,{isOpen:F,onSuccess:()=>{tS(),W(!1)},onClose:()=>W(!1)}),(0,i.jsx)(U,{isOpen:H,provider:x,providerName:tt.name,isCompatible:tm,isAnthropic:tc,authType:tt?.authType,authHint:tt?.authHint,website:tt?.website,error:G,onSave:tq,onBulkDone:tS,onClose:()=>{Q(""),V(!1)}}),(0,i.jsx)(d.wI,{isOpen:Y,connection:ei,onSave:t_,onClose:()=>ee(!1)}),tm&&(0,i.jsx)(q,{isOpen:et,node:I,onSave:t$,onClose:()=>es(!1),isAnthropic:tc}),!tm&&(0,i.jsx)(_,{isOpen:eg,providerAlias:tg,providerDisplayAlias:ty,onSave:async e=>{await tR(e,"llm",tg),ey(!1)},onClose:()=>ey(!1)}),"codex"===x&&(0,i.jsx)(L,{isOpen:Z,onClose:()=>X(!1),onSuccess:tS}),(0,i.jsx)(d.uo,{isOpen:ez,onClose:()=>eU(!1),onConfirm:()=>{(window.localStorage.setItem(e7,"true"),eU(!1),ti)?e6():e9()},title:"Risk Notice",message:tt?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,i.jsx)(d.uo,{isOpen:!!eM,onClose:()=>eP(null),onConfirm:eM?.onConfirm,title:eM?.title||"Confirm",message:eM?.message,variant:"danger"})]}):(0,i.jsxs)("div",{className:"text-center py-20",children:[(0,i.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,i.jsx)(r(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},70217:(e,t,s)=>{"use strict";function i(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>i})}},e=>{e.O(0,[2574,3862,782,8500,2280,1321,7592,5497,8441,3794,7358],()=>e(e.s=7687)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9089],{15615:(e,r,a)=>{"use strict";a.r(r),a.d(r,{default:()=>m});var t=a(95155),s=a(12115),i=a(73321),l=a(98500),d=a.n(l),o=a(35497),n=a(90620);let c=Object.values(n.Q2).map(e=>({value:e.id,label:e.name})),p=Object.values(n.MA).map(e=>({value:e.id,label:e.name}));function m(){let e=(0,i.useRouter)(),[r,a]=(0,s.useState)(!1),[l,m]=(0,s.useState)({provider:"",authMethod:"api_key",apiKey:"",displayName:"",isActive:!0}),[u,h]=(0,s.useState)({}),x=(e,r)=>{m(a=>({...a,[e]:r})),u[e]&&h(r=>({...r,[e]:null}))},b=async r=>{let t;if(r.preventDefault(),t={},l.provider||(t.provider="Please select a provider"),"api_key"!==l.authMethod||l.apiKey.trim()||(t.apiKey="API Key is required"),h(t),0===Object.keys(t).length){a(!0);try{let r=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...l,apiKey:l.apiKey.trim()})});if(r.ok)e.push("/dashboard/providers");else{let e=await r.json();h({submit:e.error||"Failed to create provider"})}}catch(e){h({submit:"An error occurred. Please try again."})}finally{a(!1)}}},v=n.Q2[l.provider];return(0,t.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsxs)(d(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,t.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:"Add New Provider"}),(0,t.jsx)("p",{className:"text-text-muted mt-2",children:"Configure a new AI provider to use with your applications."})]}),(0,t.jsx)(o.Zp,{children:(0,t.jsxs)("form",{onSubmit:b,className:"flex flex-col gap-6",children:[(0,t.jsx)(o.l6,{label:"Provider",options:c,value:l.provider,onChange:e=>x("provider",e.target.value),placeholder:"Select a provider",error:u.provider,required:!0}),v&&(0,t.jsxs)(o.Zp.Section,{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-bg border border-border",children:(0,t.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:v.color},children:v.icon})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:v.name}),(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Selected provider"})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("label",{className:"text-sm font-medium",children:["Authentication Method ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("div",{className:"flex gap-3",children:p.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>x("authMethod",e.value),className:`flex-1 flex items-center justify-center gap-2 p-4 rounded-lg border transition-all ${l.authMethod===e.value?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/50"}`,children:[(0,t.jsx)("span",{className:"material-symbols-outlined",children:"api_key"===e.value?"key":"lock"}),(0,t.jsx)("span",{className:"font-medium",children:e.label})]},e.value))})]}),"api_key"===l.authMethod&&(0,t.jsx)(o.pd,{label:"API Key",type:"password",autoComplete:"off",placeholder:"Enter your API key",value:l.apiKey,onChange:e=>x("apiKey",e.target.value),error:u.apiKey,hint:"Your API key will be encrypted and stored securely.",required:!0}),(0,t.jsx)(o.pd,{label:"Display Name",placeholder:"e.g., Production API, Dev Environment",value:l.displayName,onChange:e=>x("displayName",e.target.value),hint:"Optional. A friendly name to identify this configuration."}),(0,t.jsx)(o.lM,{checked:l.isActive,onChange:e=>x("isActive",e),label:"Active",description:"Enable this provider for use in your applications"}),u.submit&&(0,t.jsx)("div",{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 text-sm",children:u.submit}),(0,t.jsxs)("div",{className:"flex gap-3 pt-4 border-t border-border",children:[(0,t.jsx)(d(),{href:"/dashboard/providers",className:"flex-1",children:(0,t.jsx)(o.$n,{type:"button",variant:"ghost",fullWidth:!0,children:"Cancel"})}),(0,t.jsx)(o.$n,{type:"submit",loading:r,fullWidth:!0,className:"flex-1",children:"Create Provider"})]})]})})]})}},80800:(e,r,a)=>{Promise.resolve().then(a.bind(a,15615))}},e=>{e.O(0,[2574,3862,782,8500,2280,1321,7592,5497,8441,3794,7358],()=>e(e.s=80800)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{18964:(e,t,s)=>{"use strict";s.d(t,{default:()=>N});var r=s(95155),a=s(12115),l=s(14051),i=s.n(l),n=s(35497),o=s(57250),d=s(65921),c=s(90620),m=s(88105),p=s(98500),x=s.n(p),u=s(38003);let h={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function f(){let[e,t]=(0,a.useState)(null),[s,l]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!1),[c,m]=(0,a.useState)(null),p=(0,a.useRef)(null),x=(0,d.i)(),u=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let s=await e.json();t(s)}}catch{}finally{l(!1)}},[]);(0,a.useEffect)(()=>{u();let e=setInterval(u,3e4);return()=>clearInterval(e)},[u]),(0,a.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&o(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let f=async(e,t)=>{m(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(x.success(`Cooldown cleared for ${t}`),await u()):x.error("Failed to clear cooldown")}catch{x.error("Failed to clear cooldown")}finally{m(null)}};if(s)return null;let g=e?.models||[],b=0===(e?.unavailableCount||g.filter(e=>"available"!==e.status).length),y={};return g.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";y[t]||(y[t]=[]),y[t].push(e)}),(0,r.jsx)("div",{className:"relative",ref:p,children:i&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:b?"#22c55e":"#f59e0b"},children:b?"verified":"warning"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,r.jsx)("button",{onClick:u,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,r.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:b?(0,r.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,r.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(y).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=h[e.status]||h.unknown,s=c===`${e.provider}:${e.model}`;return(0,r.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,r.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,r.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>f(e.provider,e.model),disabled:s,className:"text-[10px] px-1.5! py-0.5! ml-2",children:s?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}var g=s(78559);let b={openai:{title:"Add OpenAI Compatible",type:"openai-compatible",defaultBaseUrl:"https://api.openai.com/v1",namePlaceholder:"My LiteLLM / OpenRouter / vLLM",baseUrlHint:"Base URL ending in /v1 for your OpenAI-compatible API.",modelIdPlaceholder:"e.g. gpt-4, claude-3-opus",errorLabel:"OpenAI Compatible",hasApiType:!0},anthropic:{title:"Add Anthropic Compatible",type:"anthropic-compatible",defaultBaseUrl:"https://api.anthropic.com/v1",namePlaceholder:"My Claude proxy",baseUrlHint:"Base URL ending in /v1. /messages is appended automatically.",modelIdPlaceholder:"e.g. claude-3-opus",errorLabel:"Anthropic Compatible",hasApiType:!1}},y=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function v({variant:e,isOpen:t,onClose:s,onCreated:l}){let i=b[e],o=()=>({name:"",...i.hasApiType?{apiType:"chat"}:{},baseUrl:i.defaultBaseUrl}),[d,c]=(0,a.useState)(o),[m,p]=(0,a.useState)(!1),[x,u]=(0,a.useState)(""),[h,f]=(0,a.useState)(""),[j,N]=(0,a.useState)(""),[w,k]=(0,a.useState)(!1),[C,T]=(0,a.useState)(null),A=function(e){try{return["http:","https:"].includes(new URL(e).protocol)}catch{return!1}}(d.baseUrl.trim());(0,a.useEffect)(()=>{t&&(c(o()),u(""),f(""),N(""),T(null))},[t,e]),(0,a.useEffect)(()=>{i.hasApiType&&t&&c(e=>({...e,baseUrl:i.defaultBaseUrl}))},[d.apiType]);let I=async()=>{if(!d.name.trim()||!A)return void u("Enter a valid http:// or https:// base URL");p(!0),u("");try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.name.trim(),...i.hasApiType?{apiType:d.apiType}:{},baseUrl:d.baseUrl.trim(),type:i.type})}),t=await e.json();e.ok?(l(t.node),c(o()),f(""),T(null)):u(t.error||"Failed to create provider")}catch(e){(0,g.s)(`Error creating ${i.errorLabel} node:`,e),u("Network error")}finally{p(!1)}},E=async()=>{k(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:d.baseUrl,apiKey:h,type:i.type,modelId:j.trim()||void 0})}),t=await e.json();T(t)}catch{T({valid:!1,error:"Network error"})}finally{k(!1)}};return(0,r.jsx)(n.aF,{isOpen:t,title:i.title,onClose:s,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:d.name,onChange:e=>c({...d,name:e.target.value}),placeholder:i.namePlaceholder,hint:"Friendly label (e.g. Work LiteLLM)."}),i.hasApiType&&(0,r.jsx)(n.l6,{label:"API Type",options:y,value:d.apiType,onChange:e=>c({...d,apiType:e.target.value})}),(0,r.jsx)(n.pd,{label:"Base URL",value:d.baseUrl,onChange:e=>c({...d,baseUrl:e.target.value}),placeholder:i.defaultBaseUrl,hint:i.baseUrlHint}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",autoComplete:"off",value:h,onChange:e=>f(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:j,onChange:e=>N(e.target.value),placeholder:i.modelIdPlaceholder,hint:"If the provider has no /models endpoint, enter a model ID to test chat/completions."}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,r.jsx)(n.$n,{onClick:E,disabled:!h||w||!A,variant:"secondary",className:"w-full sm:w-auto",children:w?"Checking...":"Check"}),(()=>{if(!C)return null;let{valid:e,error:t,method:s}=C;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),x?(0,r.jsx)("p",{className:"text-sm text-red-500",children:x}):null,(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,r.jsx)(n.$n,{onClick:I,fullWidth:!0,disabled:!d.name.trim()||!A||m,children:m?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function j(e,t,s){let a=[];if(e>0&&a.push((0,r.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=s?`${t} Error (${s})`:`${t} Error`;a.push((0,r.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,r.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function N({initialData:e}){let[t,s]=(0,a.useState)(e?.connections||[]),[l,i]=(0,a.useState)(e?.nodes||[]),[o,p]=(0,a.useState)(!e),[x,h]=(0,a.useState)(!1),[g,b]=(0,a.useState)(!1),[y,j]=(0,a.useState)(!1),[T,A]=(0,a.useState)(!1),[I,E]=(0,a.useState)(null),[$,R]=(0,a.useState)(null),O=(0,d.i)(),S=(0,u.C)(e=>e.query),P=(0,u.C)(e=>e.register),U=(0,u.C)(e=>e.unregister);(0,a.useEffect)(()=>(P("Search providers..."),()=>U()),[P,U]);let _=e=>!S.trim()||e.toLowerCase().includes(S.trim().toLowerCase()),z=(e,t)=>[...e].sort(([e,s],[r,a])=>{let l=s.priority??999,i=a.priority??999;if(l!==i)return l-i;let n=M(e,t),o=M(r,t),d=+(n.connected>0),c=+(o.connected>0);return d!==c?c-d:(s.name||"").localeCompare(a.name||"")}),L=(0,a.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]);if(!e.ok||!t.ok)throw Error("Failed to fetch provider data");let r=await e.json(),a=await t.json();e.ok&&s(r.connections||[]),t.ok&&i(a.nodes||[])}catch(e){O.error("Failed to fetch provider data")}finally{p(!1)}},[O]);(0,a.useEffect)(()=>{e?.connections?p(!1):L()},[e,L]);let M=(e,s)=>{let r=Array.isArray(s)?s:[s],a=t.filter(t=>t.provider===e&&r.includes(t.authType)),l=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},i=a.filter(e=>{let t=l(e);return"active"===t||"success"===t}).length,n=a.filter(e=>{let t=l(e);return"error"===t||"expired"===t||"unavailable"===t}),o=n.length,d=a.length,c=d>0&&a.every(e=>!1===e.isActive),m=n.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:i,error:o,total:d,errorCode:m?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let r=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===r||"403"===r)return"AUTH";if(r&&"ERR"!==r)return r;let a=(e.lastError||"").toLowerCase();return a.includes("runtime")||a.includes("not runnable")||a.includes("not installed")?"RUNTIME":a.includes("invalid api key")||a.includes("token invalid")||a.includes("revoked")||a.includes("unauthorized")?"AUTH":"ERR"}(m):null,errorTime:m?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let r=Math.floor(s/24);return`${r}d ago`}(m.lastErrorAt):null,allDisabled:c}},q=async(e,r,a)=>{let l=Array.isArray(r)?r:[r],i=t=>t.provider===e&&l.includes(t.authType),n=t.filter(i);s(e=>e.map(e=>i(e)?{...e,isActive:a}:e)),await Promise.allSettled(n.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:a})})))},F=async(e,t=null)=>{if(!I){E("provider"===e?t:e),R(null);try{let s=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),r=await s.json();if(R(r),r.summary){let{passed:e,failed:t,total:s}=r.summary;0===t?O.success(`All ${s} tests passed`):O.warning(`${e}/${s} passed, ${t} failed`)}}catch(e){R({error:"Test request failed"}),O.error("Provider test failed")}finally{E(null)}}},D=l.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>_(e.name)),B=l.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>_(e.name)),K=z(Object.entries(c.zN).filter(([,e])=>!e.hidden&&_(e.name)),"oauth"),H=Object.entries(m.IS).filter(([,e])=>!e.hidden&&_(e.name)).sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),J=z(Object.entries(m.nJ).filter(([,e])=>!e.hidden&&_(e.name)&&(e.serviceKinds??["llm"]).includes("llm")),"freeTier").sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),W=Object.entries(c.fg).filter(([,e])=>!e.hidden&&(e.serviceKinds??["llm"]).includes("llm")&&_(e.name)).sort(([e,t],[s,r])=>{let a=M(e,"apikey").total>0?0:1,l=M(s,"apikey").total>0?0:1;return a!==l?a-l:(t.name||"").localeCompare(r.name||"")}),Q=!!S.trim(),X=Q||x?W:W.slice(0,20),Z=W.length-20;if(o)return(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(n.Qv,{}),(0,r.jsx)(n.Qv,{})]});let V=!S.trim()||K.length>0||H.length>0||J.length>0||W.length>0||D.length>0||B.length>0;return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[!V&&(0,r.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,r.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search"})]}),K.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,r.jsx)(f,{}),(0,r.jsxs)("button",{onClick:()=>F("oauth"),disabled:!!I,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"oauth"===I?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===I?" animate-spin":""}`,children:"play_arrow"}),"oauth"===I?"Testing...":"Test All"]})]})]}),(0,r.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:K.map(([e,t])=>(0,r.jsx)(w,{providerId:e,provider:t,stats:M(e,"oauth"),authType:"oauth",onToggle:t=>q(e,"oauth",t)},e))})]}),(H.length>0||J.length>0)&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,r.jsxs)("button",{onClick:()=>F("free"),disabled:!!I,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"free"===I?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===I?" animate-spin":""}`,children:"play_arrow"}),"free"===I?"Testing...":"Test All"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[H.map(([e,t])=>{let s="kiro"===e?["oauth","apikey","api_key"]:"oauth";return(0,r.jsx)(w,{providerId:e,provider:t,stats:M(e,s),authType:"free",onToggle:t=>q(e,s,t)},e)}),J.map(([e,t])=>(0,r.jsx)(k,{providerId:e,provider:t,stats:M(e,"apikey"),authType:"apikey",onToggle:t=>q(e,"apikey",t)},e))]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"API Key Providers"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Built-in providers plus your own OpenAI- or Anthropic-compatible endpoints."})]}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>A(e=>!e),className:"w-full sm:w-auto",children:"Add custom provider"}),T&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"fixed inset-0 z-40 cursor-default","aria-label":"Close menu",onClick:()=>A(!1)}),(0,r.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 w-64 rounded-xl border border-border bg-surface p-1 shadow-xl",children:[(0,r.jsxs)("button",{type:"button",className:"flex w-full items-start gap-2 rounded-lg px-3 py-2.5 text-left text-sm transition-colors hover:bg-bg",onClick:()=>{A(!1),b(!0)},children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary mt-0.5",children:"api"}),(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"block font-medium",children:"OpenAI compatible"}),(0,r.jsx)("span",{className:"block text-xs text-text-muted",children:"Any OpenAI-style base URL + API key"})]})]}),(0,r.jsxs)("button",{type:"button",className:"flex w-full items-start gap-2 rounded-lg px-3 py-2.5 text-left text-sm transition-colors hover:bg-bg",onClick:()=>{A(!1),j(!0)},children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary mt-0.5",children:"psychology"}),(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"block font-medium",children:"Anthropic compatible"}),(0,r.jsx)("span",{className:"block text-xs text-text-muted",children:"Messages API base URL + API key"})]})]})]})]})]}),W.length>0&&(0,r.jsxs)("button",{onClick:()=>F("apikey"),disabled:!!I,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"apikey"===I?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===I?" animate-spin":""}`,children:"play_arrow"}),"apikey"===I?"Testing...":"Test All"]})]})]}),(D.length>0||B.length>0)&&(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted",children:"Your custom providers"}),(0,r.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:[...D,...B].map(e=>(0,r.jsx)(k,{providerId:e.id,provider:e,stats:M(e.id,"apikey"),authType:"compatible",onToggle:t=>q(e.id,"apikey",t)},e.id))})]}),0===D.length&&0===B.length&&0===W.length&&(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 border border-dashed border-border rounded-xl text-text-muted text-sm",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[28px]",children:"extension"}),(0,r.jsx)("p",{children:"No API key providers yet."}),(0,r.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>b(!0),children:"Add custom provider"})]}),X.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(D.length>0||B.length>0)&&(0,r.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted",children:"Built-in providers"}),(0,r.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:X.map(([e,t])=>(0,r.jsx)(k,{providerId:e,provider:t,stats:M(e,"apikey"),authType:"apikey",onToggle:t=>q(e,"apikey",t)},e))})]}),!Q&&!x&&Z>0&&(0,r.jsxs)("button",{onClick:()=>h(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",W.length," providers"]})]}),(0,r.jsx)(v,{variant:"openai",isOpen:g,onClose:()=>b(!1),onCreated:e=>{i(t=>[...t,e]),b(!1)}}),(0,r.jsx)(v,{variant:"anthropic",isOpen:y,onClose:()=>j(!1),onCreated:e=>{i(t=>[...t,e]),j(!1)}}),$&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>R(null),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,r.jsx)("button",{onClick:()=>R(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,r.jsx)("div",{className:"p-5",children:(0,r.jsx)(C,{results:$})})]})]})]})}function w({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:c,errorTime:m,allDisabled:p}=s,u=!!t.noAuth;return(0,r.jsx)(x(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${p?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:p?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):u?(0,r.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,r.jsxs)(r.Fragment,{children:[j(i,d,c),m&&(0,r.jsx)("span",{className:"text-text-muted",children:m})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!p)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!p,onChange:()=>{},title:p?"Enable provider":"Disable provider"})})})]})})})}function k({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:c,errorTime:p,allDisabled:u}=s,h=e.startsWith(m.JH),f=e.startsWith(m.DI);return(0,r.jsx)(x(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${u?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:h?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":f?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:u?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,r.jsxs)(r.Fragment,{children:[j(i,d,c),h&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),f&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),p&&(0,r.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!u)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!u,onChange:()=>{},title:u?"Enable provider":"Disable provider"})})})]})})})}function C({results:e}){if(e.error&&!e.results)return(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,r.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:s}=e,a=e.results||[];return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,r.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[s]||s," Test"]}),(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,r.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,r.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,r.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,r.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,r.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,r.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,r.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===a.length&&(0,r.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}v.propTypes={variant:i().oneOf(["openai","anthropic"]).isRequired,isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},w.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},k.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},C.propTypes={results:i().shape({mode:i().string,results:i().array,summary:i().shape({total:i().number,passed:i().number,failed:i().number}),error:i().string}).isRequired}},93979:(e,t,s)=>{Promise.resolve().then(s.bind(s,18964))}},e=>{e.O(0,[2574,3862,782,8500,2280,1321,7592,5497,8441,3794,7358],()=>e(e.s=93979)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{17002:(e,t,r)=>{Promise.resolve().then(r.bind(r,75095)),Promise.resolve().then(r.bind(r,25086))},75095:(e,t,r)=>{"use strict";r.d(t,{default:()=>O});var a=r(95155),s=r(12115),i=r(57250),l=r(97650);let n="quotaCacheData",o="quotaAutoRefresh",d=[10,20,50,100],c=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],u=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function x(e){return e.name?.trim()||e.email?.trim()||e.displayName?.trim()||null}function m(e,t){let r=t[e.id]?.quotas?.[0];return r&&"number"==typeof r.remaining?r.remaining:1/0}function h(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function b(e,t){let r=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>r.has(e)))}async function p(e,t){return await e(t)}function g(){try{let e=window.localStorage.getItem(n);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function f(e,t){try{let r=g();r[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(n,JSON.stringify(r))}catch(e){console.error("Error writing quota cache:",e)}}function y(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function v({quotas:e=[],compact:t=!1,sortMode:r="default",showSortLabel:i=!1}){let[l,n]=(0,s.useState)(1),o=(0,s.useMemo)(()=>e.map((e,t)=>({...e,index:t,remaining:e?.remaining!==void 0?Math.max(0,Math.round(e.remaining)):e?.remainingPercentage!==void 0?Math.round(e.remainingPercentage):y(e?.used,e?.total)})),[e]),d=(0,s.useMemo)(()=>"remaining-asc"===r?[...o].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?[...o].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):o,[o,r]),c=Math.max(1,Math.ceil(d.length/10));if((0,s.useEffect)(()=>{n(1)},[r,e]),(0,s.useEffect)(()=>{n(e=>Math.min(e,c))},[c]),!e||0===e.length)return null;let u=d.slice((l-1)*10,10*l),x=0===d.length?0:(l-1)*10+1,m=Math.min(10*l,d.length),h=t?"py-1 px-1.5":"py-2 px-3",b=t?"text-[11px]":"text-sm",p=t?"text-[11px]":"text-sm",g=t?"text-[10px] leading-tight":"text-xs";return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"text-[10px] text-text-muted",children:[d.length," quota",d.length>1?"s":""]}),i&&(0,a.jsx)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1 text-[10px] text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"Sorted by account remaining"})]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsx)("table",{className:"w-full table-fixed text-left",children:(0,a.jsx)("tbody",{children:u.map(e=>{var r;let s=(r=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:r>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},i=function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,r=new Date,a=t-r;if(a<=0)return"-";let s=Math.ceil(a/6e4);if(s<60)return`${s}m`;let i=Math.floor(s/60),l=s%60;if(i<24)return`${i}h ${l}m`;let n=Math.floor(i/24);return`${n}d ${i%24}h ${l}m`}catch(e){return"-"}}(e.resetAt),l=function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(a);s.setDate(s.getDate()+1);let i="";i=t>=a&&t<s?"Today":t>=s&&t<new Date(s.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let l=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${i}, ${l}`}catch{return null}}(e.resetAt),n=!1!==e.recurring?`in ${i}`:`expires in ${i}`;return(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:`${h} w-[30%]`,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,a.jsx)("span",{className:"text-[10px] shrink-0",children:s.emoji}),(0,a.jsx)("span",{className:`${b} font-medium text-text-primary truncate`,children:e.name})]})}),(0,a.jsx)("td",{className:`${h} w-[45%]`,children:(0,a.jsxs)("div",{className:t?"space-y-1":"space-y-1.5",children:[(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${s.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,a.jsx)("div",{className:`h-full transition-all duration-300 ${s.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,a.jsxs)("div",{className:`flex items-center justify-between ${t?"text-[10px]":"text-xs"}`,children:[(0,a.jsxs)("span",{className:"text-text-muted",children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞"]}),(0,a.jsxs)("span",{className:`font-medium ${s.text}`,children:[e.remaining,"%"]})]})]})}),(0,a.jsx)("td",{className:`${h} w-[25%]`,children:"-"!==i||l?t?(0,a.jsx)("div",{className:`${p} text-text-primary font-medium truncate`,title:l||"",children:"-"!==i?n:l}):(0,a.jsxs)("div",{className:"space-y-0.5",children:["-"!==i&&(0,a.jsx)("div",{className:`${p} text-text-primary font-medium`,children:n}),l&&(0,a.jsx)("div",{className:`${g} text-text-muted`,children:l})]}):(0,a.jsx)("div",{className:`${p} text-text-muted italic`,children:"N/A"})})]},`${e.name}-${e.index}`)})})})}),c>1&&(0,a.jsxs)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{children:["Showing ",x,"-",m," of ",d.length]}),(0,a.jsxs)("span",{children:["Page ",l," / ",c]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>n(e=>Math.max(1,e-1)),disabled:1===l,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Prev"}),(0,a.jsx)("button",{type:"button",onClick:()=>n(e=>Math.min(c,e+1)),disabled:l===c,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Next"})]})]})]})}var j=r(98542),k=r(97677),w=r(84588),N=r(35497),C=r(88105),S=r(11059),A=r(78559),$=r(77251);let E={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"},q={claude:"claudeAutoPing",codex:"codexAutoPing"},P={claude:"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",codex:"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota."};function D(e){return e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null}function T(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}function M(e){if(!e)return"N/A";let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"N/A"}function O(){let{copied:e,copy:t}=(0,S.C)(),[r,O]=(0,s.useState)([]),[I,_]=(0,s.useState)({}),[F,z]=(0,s.useState)({}),[L,R]=(0,s.useState)({}),[U,J]=(0,s.useState)(!0),[K,G]=(0,s.useState)({claude:{},codex:{}}),[H,B]=(0,s.useState)(null),[V,W]=(0,s.useState)(!1),[Y,Q]=(0,s.useState)(!1),[X,Z]=(0,s.useState)(60),[ee,et]=(0,s.useState)(!0),[er,ea]=(0,s.useState)(null),[es,ei]=(0,s.useState)(null),[el,en]=(0,s.useState)(null),[eo,ed]=(0,s.useState)(null),[ec,eu]=(0,s.useState)(null),[ex,em]=(0,s.useState)(!1),[eh,eb]=(0,s.useState)(null),[ep,eg]=(0,s.useState)("all"),[ef,ey]=(0,s.useState)([]),[ev,ej]=(0,s.useState)("all"),[ek,ew]=(0,s.useState)("default"),[eN,eC]=(0,s.useState)(!1),[eS,eA]=(0,s.useState)(!1),[e$,eE]=(0,s.useState)(!1),[eq,eP]=(0,s.useState)(1),[eD,eT]=(0,s.useState)(20),[eM,eO]=(0,s.useState)(String(20)),[eI,e_]=(0,s.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eF,ez]=(0,s.useState)({eligibleConnections:0,providerFilteredConnections:0}),eL=(0,s.useRef)(null),eR=(0,s.useRef)(null),eU=(0,s.useRef)(0),eJ=(0,s.useCallback)(async(e=eq)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(eD),accountStatus:ev,sort:"priority"});"all"!==ep&&a.set("provider",ep);let s=await fetch(`/api/providers/client?${a.toString()}`);if(!s.ok)throw Error("Failed to fetch connections");let i=await s.json(),l=i.connections||[],n=(t=i.pagination,t||{page:1,pageSize:eD,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(i.totals,l.length);return O(l),ey(i.providerOptions||[]),e_(n),ez(o),eP((r=i.pagination,r?.page||e)),l}catch(e){return(0,A.s)("Error fetching connections:",e),O([]),ey([]),e_({page:1,pageSize:eD,total:0,totalPages:1}),ez({eligibleConnections:0,providerFilteredConnections:0}),[]}},[ev,eq,eD,ep]),eK=(0,s.useCallback)(async(e,t)=>{z(t=>({...t,[e]:!0})),R(t=>({...t,[e]:null}));try{let r=await fetch(`/api/usage/${e}`);if(!r.ok){let a=(await r.json().catch(()=>({}))).error||r.statusText;if(404===r.status)return void(0,A.s)(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===r.status){(0,A.s)(`[ProviderLimits] Auth error for ${t}:`,a);let r={quotas:[],message:a};_(t=>({...t,[e]:r})),f(e,r);return}throw Error(`HTTP ${r.status}: ${a}`)}let a=await r.json(),s={quotas:function(e,t){if(!t||"object"!=typeof t)return[];let r=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:t.remaining,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"qoder":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{("organization"!==e||t&&0!==(Number(t.total)||0))&&r.push({name:"user"===e?"Personal":"organization"===e?"Organization":e,used:t.used||0,total:t.total||0,unit:t.unit,resetAt:t.resetAt||null})});break;case"claude":t.message?r.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codebuddy-cn":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,recurring:!1!==t.recurring})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let a=(0,l.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));r.sort((t,r)=>{let a=t.modelKey||t.name,s=r.modelKey||r.name;return(e.get(a)??999)-(e.get(s)??999)})}return r}(t,a),plan:a.plan||null,message:a.message||null,raw:a};_(t=>({...t,[e]:s})),f(e,s)}catch(r){(0,A.s)(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),R(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{z(t=>({...t,[e]:!1}))}},[]),eG=(0,s.useCallback)(async(e,t)=>{await eK(e,t),B(new Date)},[eK]),eH=(0,s.useCallback)(async(e,t)=>{if("codex"===t&&!el){en(e),R(t=>({...t,[e]:null}));try{let r=await fetch(`/api/usage/${e}/codex-reset-credits`,{method:"POST"}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.message||a.error||a.code||"Failed to reset Codex limit");await eK(e,t),B(new Date)}catch(t){R(r=>({...r,[e]:t.message||"Failed to reset Codex limit"}))}finally{en(null)}}},[eK,el]),eB=(0,s.useCallback)(async e=>{eu({connection:e,loading:!0,error:null,data:null});try{let t=await fetch(`/api/usage/${e.id}/codex-reset-credits`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error(r.error||r.message||"Failed to load Codex reset credits");let a=Array.isArray(r.credits)?[...r.credits]:[];a.sort((e,t)=>{let r=e.expiresAt?new Date(e.expiresAt).getTime():1/0,a=t.expiresAt?new Date(t.expiresAt).getTime():1/0;return r-a}),eu({connection:e,loading:!1,error:null,data:{...r,credits:a}})}catch(t){eu({connection:e,loading:!1,error:t.message||"Failed to load Codex reset credits",data:null})}},[]),eV=(0,s.useCallback)(async e=>{let t=x(r.find(t=>t.id===e)||{})||e;if(await (0,$.l)({message:`Delete connection “${t}”?`,confirmText:"Continue"})){ea(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){_(t=>{let r={...t};return delete r[e],r}),z(t=>{let r={...t};return delete r[e],r}),R(t=>{let r={...t};return delete r[e],r});try{let t=g();t[e]&&(delete t[e],window.localStorage.setItem(n,JSON.stringify(t)))}catch(e){(0,A.s)("Error deleting cache entry:",e)}await p(eJ,eq)}}catch(e){(0,A.s)("Error deleting connection:",e)}finally{ea(null)}}},[r,eJ,eq]),eW=(0,s.useCallback)(async(e,t)=>{ei(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(_(e=>({...e})),await p(eJ,eq))}catch(e){(0,A.s)("Error updating connection status:",e)}finally{ei(null)}},[eJ,eq]),eY=(0,s.useCallback)(async e=>{if(!eh?.id)return;let t=eh.id,r=eh.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eJ(),em(!1),eb(null),C.wb.includes(r)&&await eK(t,r))}catch(e){(0,A.s)("Error saving connection:",e)}},[eh,eJ,eK]),eQ=(0,s.useCallback)(async(e=!1)=>{if(Y)return;Q(!0),Z(60);let t=eU.current+=1,r=Math.round(3);try{let a=await eJ(eq);z(h(a)),R(e=>b(e,a)),_(e=>b(e,a)),await Promise.all(a.filter(a=>e||"claude"!==a.provider||t%r==0).map(e=>eK(e.id,e.provider))),B(new Date)}catch(e){(0,A.s)("Error refreshing all providers:",e)}finally{Q(!1)}},[Y,eJ,eK,eq]);(0,s.useEffect)(()=>{(async()=>{et(!0);let e=await eJ(eq);et(!1),z(h(e)),R(t=>b(t,e)),_(t=>b(t,e)),await Promise.all(e.map(e=>eK(e.id,e.provider))),B(new Date)})()},[eJ,eK,eq]),(0,s.useEffect)(()=>{let e=window.localStorage.getItem(o);J(null===e||"true"===e),W(!0)},[]),(0,s.useEffect)(()=>{V&&window.localStorage.setItem(o,String(U))},[U,V]),(0,s.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>G({claude:e?.claudeAutoPing?.connections||{},codex:e?.codexAutoPing?.connections||{}})).catch(()=>{})},[]);let eX=(0,s.useCallback)(async(e,t,r)=>{let a=q[t];if(!a)return;let s={...K[t]||{},[e]:r};G({...K,[t]:s});try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[a]||{},connections:s};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[a]:t})})}catch{G(K)}},[K]);(0,s.useEffect)(()=>{if(!V||!U){eL.current&&(clearInterval(eL.current),eL.current=null),eR.current&&(clearInterval(eR.current),eR.current=null);return}return eL.current=setInterval(()=>{eQ()},6e4),eR.current=setInterval(()=>{Z(e=>e<=1?60:e-1)},1e3),()=>{eL.current&&clearInterval(eL.current),eR.current&&clearInterval(eR.current)}},[U,eQ,V]),(0,s.useEffect)(()=>{let e=()=>{document.hidden?(eL.current&&(clearInterval(eL.current),eL.current=null),eR.current&&(clearInterval(eR.current),eR.current=null)):U&&V&&(eL.current=setInterval(()=>eQ(),6e4),eR.current=setInterval(()=>{Z(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[U,eQ,V]);let eZ=(0,s.useMemo)(()=>(function(e,t,r,a,s){if("codex"===a&&"default"!==s)return[...e].sort((e,r)=>{let a=m(e,t),i=m(r,t),l="remaining-asc"===s?a-i:i-a;return 0!==l?l:(x(e)||"").localeCompare(x(r)||"")});if(!r)return e;let i=e=>{let r=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return r.length>0?Math.min(...r):1/0};return[...e].sort((e,t)=>{let r=i(e)-i(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(x(e)||"").localeCompare(x(t)||"")})})(r,I,eN,ep,ek),[r,I,eN,ep,ek]),e0=e=>{let t=I[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=y(e.used,e.total))},e1=(0,s.useCallback)(async(e,t)=>{if(e.length&&!e$){eE(!0);try{await Promise.all(e.map(e=>fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}))),await p(eJ,eq)}catch(e){(0,A.s)("Error bulk toggling connections:",e)}finally{eE(!1)}}},[e$,eJ,eq]),e5="all"===ep?"All providers":ep,e2=eF.eligibleConnections>0,e3=eZ.length>0,e8=eF.eligibleConnections?eF.providerFilteredConnections?{icon:"filter_alt_off",title:"No Accounts On This Page",description:"Try moving to another page or refreshing the current filters."}:{icon:"filter_alt_off",title:"No Accounts Match Current Filters",description:"all"===ep?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===ev?"turned off":"active"===ev?"active":"matching"} accounts found for ${ep}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},e4=function(e){var t;let{start:r,end:a}=(t=e).total?{start:(t.page-1)*t.pageSize+1,end:Math.min(t.page*t.pageSize,t.total)}:{start:0,end:0};return`Showing ${r}-${a} of ${e.total}`}(eI),e6=!d.includes(eD);return ee||e2?ee||e3?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eA(e=>!e),className:"flex h-8 items-center justify-between gap-1 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-haspopup":"menu","aria-expanded":eS,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===ep?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(i.A,{src:`/providers/${ep}.png`,alt:ep,size:18,className:"size-[18px] rounded object-contain",fallbackText:ep.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:e5})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eS&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>eA(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-2 w-64 overflow-hidden rounded-2xl border border-black/10 bg-surface/95 p-1.5 shadow-xl shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-72",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==ep&&eP(1),eg("all"),eA(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===ep?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===ep&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]}),(0,a.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,a.jsx)("div",{className:"max-h-72 overflow-y-auto pr-1",children:ef.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{ep!==e&&eP(1),eg(e),eA(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${ep===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(i.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium capitalize",children:e}),ep===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:ev,onChange:e=>{let t=e.target.value;ev!==t&&eP(1),ej(t)},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter accounts by status",children:c.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===ep&&(0,a.jsx)("select",{value:ek,onChange:e=>ew(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Sort Codex quotas by remaining",children:u.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsxs)("button",{type:"button",onClick:()=>eC(e=>!e),"aria-pressed":eN,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${eN?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{e1(eZ.filter(e=>(e.isActive??!0)&&e0(e)).map(e=>e.id),!1)},disabled:e$,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10 disabled:opacity-50",title:"Disable connections with depleted quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn off Empty"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{e1(eZ.filter(e=>!(e.isActive??!0)&&!e0(e)).map(e=>e.id),!0)},disabled:e$,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-emerald-500/30 px-2 text-xs text-emerald-500 transition-colors hover:bg-emerald-500/10 disabled:opacity-50",title:"Enable connections that still have quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn on Available"})]}),(0,a.jsxs)("button",{onClick:()=>J(e=>!e),className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:U?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${U?"text-primary":"text-text-muted"}`,children:U?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),U&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",X,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>eQ(!0),disabled:Y,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5 disabled:opacity-50",title:"Refresh all",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${Y?"animate-spin":""}`,children:"refresh"})})]})}),eN&&(0,a.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Expiring-first currently reorders accounts inside the current page. Cross-page ordering still follows backend pagination."}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:eZ.map(r=>{let s,l,n,o=I[r.id],d=F[r.id],c=L[r.id],u=!1===r.isActive,m="codex"===r.provider,h=Number.isFinite(l="number"==typeof(s=o?.raw?.resetCredits?.availableCount)?s:Number(s))?Math.max(0,l):0,b=el===r.id,p=er===r.id||es===r.id||b;return(0,a.jsxs)(w.default,{padding:"none",className:`min-w-0 ${u?"opacity-60":""}`,children:[(0,a.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,a.jsx)(i.A,{src:`/providers/${r.provider}.png`,alt:r.provider,size:32,className:"object-contain",fallbackText:r.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary capitalize truncate",children:r.provider}),x(r)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:x(r)}):null,D(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:D(r)}):null,"kiro"===r.provider&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[(0,a.jsx)("span",{className:"rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:(n=r.providerSpecificData?.authMethod)&&E[n]?E[n]:"api_key"===r.authType?"API Key":"OAuth"}),T(r)&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:T(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${u?"bg-surface-2 text-text-muted":"active"===r.testStatus||"success"===r.testStatus?"bg-green-500/10 text-green-600 dark:text-green-400":"error"===r.testStatus||"expired"===r.testStatus||"unavailable"===r.testStatus?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-surface-2 text-text-muted"}`,children:u?"disabled":r.testStatus||"unknown"}),r.providerSpecificData?.profileArn&&(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.providerSpecificData.profileArn,r.id),title:r.providerSpecificData.profileArn,className:"inline-flex max-w-full items-center gap-1 rounded-full border border-border-subtle px-2 py-0.5 text-[10px] text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:e===r.id?"check":"content_copy"}),(0,a.jsx)("code",{className:"truncate font-mono",children:r.providerSpecificData.profileArn})]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(k.default,{text:h>0?`Use one Codex reset credit. Available: ${h}`:"No Codex reset credits available",children:(0,a.jsxs)("button",{type:"button",onClick:()=>ed({connection:r,resetCreditCount:h}),disabled:h<=0||d||p,"aria-label":h>0?`Use one Codex reset credit. ${h} available.`:"No Codex reset credits available",className:`flex h-8 min-w-10 items-center justify-center gap-1 rounded-lg border px-2 text-[11px] font-medium tabular-nums transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/60 disabled:cursor-not-allowed disabled:opacity-60 ${h>0?"border-primary/30 bg-primary/5 text-primary hover:bg-primary/10":"border-black/10 bg-black/[0.02] text-text-muted dark:border-white/10 dark:bg-white/[0.03]"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[15px] ${b?"animate-spin":""}`,children:b?"progress_activity":"restart_alt"}),(0,a.jsx)("span",{children:h})]})}),(0,a.jsx)(k.default,{text:"View Codex reset credit expiry",children:(0,a.jsx)("button",{type:"button",onClick:()=>eB(r),disabled:d||p,"aria-label":"View Codex reset credit expiry",className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-muted transition-colors hover:bg-black/5 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10 dark:hover:bg-white/5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[17px]",children:"schedule"})})})]}),q[r.provider]&&"oauth"===r.authType&&(0,a.jsx)(k.default,{text:P[r.provider],children:(0,a.jsx)("button",{type:"button",onClick:()=>eX(r.id,r.provider,K[r.provider]?.[r.id]!==!0),"aria-label":"Toggle auto-ping",className:`flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${K[r.provider]?.[r.id]===!0?"text-primary":"text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})}),(0,a.jsx)(k.default,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>eG(r.id,r.provider),disabled:d||p,"aria-label":"Refresh quota",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${d?"animate-spin":""}`,children:"refresh"})})}),(0,a.jsx)(k.default,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{eb(r),em(!0)},disabled:p,"aria-label":"Edit connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})})}),(0,a.jsx)(k.default,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>eV(r.id),disabled:p,"aria-label":"Delete connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${er===r.id?"animate-pulse":""}`,children:"delete"})})}),(0,a.jsx)("div",{className:"inline-flex items-center pl-0.5",title:r.isActive??!0?"Disable connection":"Enable connection",children:(0,a.jsx)(j.default,{size:"sm",checked:r.isActive??!0,disabled:p,onChange:e=>eW(r.id,e)})})]})]})}),(0,a.jsx)("div",{className:"px-2 py-1.5",children:d?(0,a.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):c?(0,a.jsxs)("div",{className:"text-center py-5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:c})]}):o?.message?(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:o.message})}):(0,a.jsx)(v,{quotas:o?.quotas,compact:!0,sortMode:"default",showSortLabel:"codex"===r.provider&&"default"!==ek})})]},r.id)})}),(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:e4}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:e6?"custom":String(eD),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(eP(1),eT(r),eO(String(r)))},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Accounts per page",children:[d.map(e=>(0,a.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,a.jsx)("option",{value:"custom",children:"Custom"})]}),(0,a.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:eM,onChange:e=>eO(e.target.value),onBlur:()=>{let e=Number.parseInt(eM,10);if(!Number.isFinite(e))return void eO(String(eD));let t=Math.min(500,Math.max(1,e));eP(1),eT(t),eO(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eM,10);if(!Number.isFinite(t))return void eO(String(eD));let r=Math.min(500,Math.max(1,t));eP(1),eT(r),eO(String(r))},className:"h-8 w-20 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Custom accounts per page",placeholder:"Custom"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",eI.page," / ",eI.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>eP(1),disabled:eI.page<=1||ee||Y,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"First Page"}),(0,a.jsx)("button",{type:"button",onClick:()=>eP(e=>Math.max(1,e-1)),disabled:eI.page<=1||ee||Y,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Previous accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eP(e=>Math.min(eI.totalPages,e+1)),disabled:eI.page>=eI.totalPages||ee||Y,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Next accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eP(eI.totalPages),disabled:eI.page>=eI.totalPages||ee||Y,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Last Page"})]})]})}),(0,a.jsx)(N.uo,{isOpen:!!eo,onClose:()=>{el||ed(null)},onConfirm:async()=>{let e=eo?.connection;e&&(await eH(e.id,e.provider),ed(null))},title:"Reset Codex limit?",message:`Use 1 Codex reset credit for ${x(eo?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${eo?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!el}),ec&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"w-full max-w-2xl overflow-hidden rounded-2xl border border-black/15 bg-white shadow-2xl ring-1 ring-black/10 dark:border-white/15 dark:bg-neutral-950 dark:ring-white/10",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 border-b border-black/10 bg-black/[0.03] px-4 py-3 dark:border-white/10 dark:bg-white/[0.04]",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-text-primary",children:"Codex Reset Credit Expiry"}),(0,a.jsx)("p",{className:"mt-0.5 truncate text-xs text-text-muted",children:x(ec.connection)||"Codex account"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>eu(null),className:"flex h-8 w-8 items-center justify-center rounded-lg text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5","aria-label":"Close reset credit expiry modal",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,a.jsx)("div",{className:"max-h-[70vh] overflow-auto bg-white p-4 dark:bg-neutral-950",children:ec.loading?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading reset credits..."]}):ec.error?(0,a.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300",children:ec.error}):ec.data?.credits?.length?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("span",{children:[ec.data.credits.length," reset credit",1===ec.data.credits.length?"":"s"]}),(0,a.jsxs)("span",{children:[ec.data.availableCount??0," available"]})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,a.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,a.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Granted At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Expires At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,a.jsx)("tbody",{children:ec.data.credits.map((e,t)=>(0,a.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.status||"unknown"})}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-muted",children:M(e.grantedAt)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:M(e.expiresAt)}),(0,a.jsx)("td",{className:"px-3 py-2 font-medium text-text-primary",children:function(e){if(!e)return"N/A";let t=new Date(e).getTime()-Date.now();if(!Number.isFinite(t))return"N/A";if(t<=0)return"Expired";let r=Math.ceil(t/36e5),a=Math.floor(r/24),s=r%24;return a>0?`${a}d ${s}h`:`${s}h`}(e.expiresAt)})]},`${e.status}-${e.expiresAt||t}`))})]})})]}):(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-8 text-center text-sm text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"No reset credit details returned for this account."})})]})}),(0,a.jsx)(N.wI,{isOpen:ex,connection:eh,onSave:eY,onClose:()=>{em(!1),eb(null)}})]}):(0,a.jsx)(w.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:e8.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:e8.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:e8.description})]})}):(0,a.jsx)(w.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})})}}},e=>{e.O(0,[2574,3862,782,8500,2280,1321,7592,5497,8441,3794,7358],()=>e(e.s=17002)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2838],{23262:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var a=s(95155),i=s(12115),n=s(98500),r=s.n(n),l=s(73321),o=s(35497),d=s(11059),c=s(46453),m=s(23241);function x(){let e=(0,l.useParams)(),t="string"==typeof e?.id?e.id:"",s=c.J3.find(e=>e.id===t),[n,x]=(0,i.useState)(""),[p,h]=(0,i.useState)({}),[u,f]=(0,i.useState)(""),[b,j]=(0,i.useState)(!0),[y,N]=(0,i.useState)(""),{copied:g,copy:k}=(0,d.C)(2e3),w=(0,c.Rz)(t);(0,i.useEffect)(()=>{N(`${window.location.origin}${w}`)},[w]),(0,i.useEffect)(()=>{if(!t)return;let e=!1;return j(!0),f(""),x(""),fetch(w).then(async e=>{if(!e.ok)throw Error((await e.json().catch(()=>({}))).error||`HTTP ${e.status}`);return e.text()}).then(t=>{if(e)return;let{html:s,meta:a}=(0,m.L6)(t);h(a),x(s)}).catch(t=>{e||f(t.message||"Failed to load skill")}).finally(()=>{e||j(!1)}),()=>{e=!0}},[t,w]);let v=s?.name||p.name||t,_=s?.description||p.description||"";return(0,a.jsxs)("div",{className:"max-w-3xl mx-auto space-y-4 pb-10",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)(r(),{href:"/dashboard/skills",className:"text-xs text-text-muted hover:text-primary inline-flex items-center gap-1 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"arrow_back"}),"All skills"]}),(0,a.jsx)("h1",{className:"text-[20px] font-semibold text-text-main tracking-tight",children:v}),_?(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1 leading-relaxed",children:_}):null]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 shrink-0",children:[(0,a.jsxs)(o.$n,{size:"sm",variant:"secondary",onClick:()=>k(y||w),title:y||w,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:g?"check":"content_copy"}),g?"Copied!":"Copy raw URL"]}),(0,a.jsxs)("a",{href:w,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 px-2.5 py-1.5 rounded-md border border-border text-xs text-text-main hover:border-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"open_in_new"}),"Raw markdown"]})]})]}),(y||w)&&!b&&!u?(0,a.jsxs)("div",{className:"rounded-lg border border-border-subtle bg-surface-2 px-3 py-2",children:[(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-text-subtle font-semibold mb-0.5",children:"Agent fetch URL"}),(0,a.jsx)("code",{className:"text-[12px] font-mono text-text-main break-all",children:y||w})]}):null,(0,a.jsxs)(o.Zp,{padding:"lg",className:"overflow-hidden",children:[b&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2 py-8 justify-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}),"Loading skill…"]}),u&&(0,a.jsxs)("div",{className:"text-sm text-red-400 py-4",children:[(0,a.jsx)("p",{className:"font-medium",children:"Could not load skill"}),(0,a.jsx)("p",{className:"text-xs mt-1 opacity-80",children:u}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Expected file: ",(0,a.jsxs)("code",{className:"font-mono",children:["skills/",t,"/SKILL.md"]})]})]}),b||u||!n?null:(0,a.jsx)("article",{className:"skill-md",dangerouslySetInnerHTML:{__html:n}})]})]})}},46453:(e,t,s)=>{"use strict";s.d(t,{EV:()=>n,J3:()=>a,Rz:()=>i});let a=[{id:"switchboard",name:"Switchboard (Entry)",description:"Setup, model discovery, combos & Auto routing. Start here — one /v1 endpoint, multi-provider gateway.",endpoint:"/v1",icon:"hub",isEntry:!0},{id:"switchboard-chat",name:"Chat",description:"Chat / code-gen via OpenAI, Anthropic, or Responses formats — streaming, tools, combo as model.",endpoint:"/v1/chat/completions",icon:"chat"}];function i(e){return`/api/skills/${e}`}function n(e){return`/dashboard/skills/${e}`}},98745:(e,t,s)=>{Promise.resolve().then(s.bind(s,23262))}},e=>{e.O(0,[2574,3862,782,8500,2280,1321,7592,5497,8441,3794,7358],()=>e(e.s=98745)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9516],{36072:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var n=s(95155),i=s(12115),r=s(35497),a=s(11059),l=s(46453);function o(e,t){return t?/^https?:\/\//i.test(t)?t:`${e||""}${t.startsWith("/")?t:`/${t}`}`:""}function d({value:e,label:t="Copy link"}){let{copied:s,copy:i}=(0,a.C)(2e3);return(0,n.jsxs)("button",{type:"button",onClick:()=>i(e),className:"px-2 py-1 rounded-md bg-primary text-on-primary text-[11px] font-medium hover:bg-primary/90 transition-colors cursor-pointer shrink-0 inline-flex items-center gap-1",title:e,children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:s?"check":"content_copy"}),s?"Copied!":t]})}function c({skill:e,origin:t}){let s=(0,l.Rz)(e.id),i=(0,l.EV)(e.id),a=o(t,s),x=o(t,i);return(0,n.jsxs)("div",{className:`flex items-start gap-3 p-4 rounded-[14px] border shadow-[var(--shadow-soft)] transition-colors ${e.isEntry?"border-brand-500/40 bg-brand-500/5":"border-border-subtle bg-surface hover:bg-surface-2"}`,children:[(0,n.jsx)("div",{className:`size-9 rounded-lg flex items-center justify-center shrink-0 ${e.isEntry?"bg-primary text-on-primary":"bg-primary/10 text-primary"}`,children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e.icon})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,n.jsx)("h3",{className:"font-semibold text-sm text-text-main",children:e.name}),e.isEntry&&(0,n.jsx)(r.Ex,{variant:"primary",size:"sm",children:"START HERE"}),e.endpoint&&(0,n.jsx)(r.Ex,{variant:"default",size:"sm",children:(0,n.jsx)("code",{className:"text-[10px]",children:e.endpoint})})]}),(0,n.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:e.description}),(0,n.jsxs)("div",{className:"mt-2 flex flex-col gap-1",children:[(0,n.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-[12px] text-primary hover:underline inline-flex items-center gap-1 w-fit",children:["Open skill docs",(0,n.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]}),(0,n.jsx)("code",{className:"text-[11px] font-mono text-text-subtle break-all",title:"Paste this URL to an AI agent",children:a||s})]})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1.5 shrink-0 items-end",children:[(0,n.jsx)(d,{value:a||s,label:"Copy agent URL"}),(0,n.jsxs)("a",{href:x||i,target:"_blank",rel:"noopener noreferrer",className:"px-2 py-1 rounded-md border border-border text-[11px] text-text-main hover:border-primary inline-flex items-center gap-1 transition-colors",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"}),"Open"]})]})]})}function x(){let e=function(){let[e,t]=(0,i.useState)("");return(0,i.useEffect)(()=>{t(window.location.origin)},[]),e}(),t=o(e,(0,l.Rz)("switchboard"));return(0,n.jsxs)("div",{className:"max-w-4xl mx-auto space-y-6",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)("h1",{className:"text-[17px] font-semibold text-text-main",children:"Skills"}),(0,n.jsx)("p",{className:"text-xs font-mono text-text-subtle",children:"agent skill links \xb7 not Media providers"})]}),(0,n.jsxs)(r.Zp,{padding:"md",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted mb-2",children:"Paste this to your AI:"}),(0,n.jsxs)("div",{className:"px-3 py-2 rounded bg-surface-2 font-mono text-[12px] text-text-main break-all",children:["Read this skill and use it: ",t||(0,l.Rz)("switchboard")]})]}),(0,n.jsx)("div",{className:"space-y-2",children:l.J3.map(t=>(0,n.jsx)(c,{skill:t,origin:e},t.id))}),(0,n.jsx)(r.Zp,{padding:"md",children:(0,n.jsxs)("p",{className:"text-xs text-text-muted leading-relaxed",children:[(0,n.jsx)("strong",{className:"text-text-main",children:"Open"})," opens a readable docs page in a new tab. ",(0,n.jsx)("strong",{className:"text-text-main",children:"Copy agent URL"})," copies"," ",(0,n.jsx)("code",{className:"text-[11px]",children:"/api/skills/<id>"})," for AI agents to fetch the raw markdown."]})})]})}},46453:(e,t,s)=>{"use strict";s.d(t,{EV:()=>r,J3:()=>n,Rz:()=>i});let n=[{id:"switchboard",name:"Switchboard (Entry)",description:"Setup, model discovery, combos & Auto routing. Start here — one /v1 endpoint, multi-provider gateway.",endpoint:"/v1",icon:"hub",isEntry:!0},{id:"switchboard-chat",name:"Chat",description:"Chat / code-gen via OpenAI, Anthropic, or Responses formats — streaming, tools, combo as model.",endpoint:"/v1/chat/completions",icon:"chat"}];function i(e){return`/api/skills/${e}`}function r(e){return`/dashboard/skills/${e}`}},49137:(e,t,s)=>{Promise.resolve().then(s.bind(s,36072))}},e=>{e.O(0,[2574,3862,1610,2562,1321,705,5497,8441,3794,7358],()=>e(e.s=49137)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9516],{36072:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var n=s(95155),i=s(12115),r=s(35497),a=s(11059),l=s(46453);function o(e,t){return t?/^https?:\/\//i.test(t)?t:`${e||""}${t.startsWith("/")?t:`/${t}`}`:""}function d({value:e,label:t="Copy link"}){let{copied:s,copy:i}=(0,a.C)(2e3);return(0,n.jsxs)("button",{type:"button",onClick:()=>i(e),className:"px-2 py-1 rounded-md bg-primary text-on-primary text-[11px] font-medium hover:bg-primary/90 transition-colors cursor-pointer shrink-0 inline-flex items-center gap-1",title:e,children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:s?"check":"content_copy"}),s?"Copied!":t]})}function c({skill:e,origin:t}){let s=(0,l.Rz)(e.id),i=(0,l.EV)(e.id),a=o(t,s),x=o(t,i);return(0,n.jsxs)("div",{className:`flex items-start gap-3 p-4 rounded-[14px] border shadow-[var(--shadow-soft)] transition-colors ${e.isEntry?"border-brand-500/40 bg-brand-500/5":"border-border-subtle bg-surface hover:bg-surface-2"}`,children:[(0,n.jsx)("div",{className:`size-9 rounded-lg flex items-center justify-center shrink-0 ${e.isEntry?"bg-primary text-on-primary":"bg-primary/10 text-primary"}`,children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e.icon})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,n.jsx)("h3",{className:"font-semibold text-sm text-text-main",children:e.name}),e.isEntry&&(0,n.jsx)(r.Ex,{variant:"primary",size:"sm",children:"START HERE"}),e.endpoint&&(0,n.jsx)(r.Ex,{variant:"default",size:"sm",children:(0,n.jsx)("code",{className:"text-[10px]",children:e.endpoint})})]}),(0,n.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:e.description}),(0,n.jsxs)("div",{className:"mt-2 flex flex-col gap-1",children:[(0,n.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-[12px] text-primary hover:underline inline-flex items-center gap-1 w-fit",children:["Open skill docs",(0,n.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]}),(0,n.jsx)("code",{className:"text-[11px] font-mono text-text-subtle break-all",title:"Paste this URL to an AI agent",children:a||s})]})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1.5 shrink-0 items-end",children:[(0,n.jsx)(d,{value:a||s,label:"Copy agent URL"}),(0,n.jsxs)("a",{href:x||i,target:"_blank",rel:"noopener noreferrer",className:"px-2 py-1 rounded-md border border-border text-[11px] text-text-main hover:border-primary inline-flex items-center gap-1 transition-colors",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"}),"Open"]})]})]})}function x(){let e=function(){let[e,t]=(0,i.useState)("");return(0,i.useEffect)(()=>{t(window.location.origin)},[]),e}(),t=o(e,(0,l.Rz)("switchboard"));return(0,n.jsxs)("div",{className:"max-w-4xl mx-auto space-y-6",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)("h1",{className:"text-[17px] font-semibold text-text-main",children:"Skills"}),(0,n.jsx)("p",{className:"text-xs font-mono text-text-subtle",children:"agent skill links \xb7 not Media providers"})]}),(0,n.jsxs)(r.Zp,{padding:"md",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted mb-2",children:"Paste this to your AI:"}),(0,n.jsxs)("div",{className:"px-3 py-2 rounded bg-surface-2 font-mono text-[12px] text-text-main break-all",children:["Read this skill and use it: ",t||(0,l.Rz)("switchboard")]})]}),(0,n.jsx)("div",{className:"space-y-2",children:l.J3.map(t=>(0,n.jsx)(c,{skill:t,origin:e},t.id))}),(0,n.jsx)(r.Zp,{padding:"md",children:(0,n.jsxs)("p",{className:"text-xs text-text-muted leading-relaxed",children:[(0,n.jsx)("strong",{className:"text-text-main",children:"Open"})," opens a readable docs page in a new tab. ",(0,n.jsx)("strong",{className:"text-text-main",children:"Copy agent URL"})," copies"," ",(0,n.jsx)("code",{className:"text-[11px]",children:"/api/skills/<id>"})," for AI agents to fetch the raw markdown."]})})]})}},46453:(e,t,s)=>{"use strict";s.d(t,{EV:()=>r,J3:()=>n,Rz:()=>i});let n=[{id:"switchboard",name:"Switchboard (Entry)",description:"Setup, model discovery, combos & Auto routing. Start here — one /v1 endpoint, multi-provider gateway.",endpoint:"/v1",icon:"hub",isEntry:!0},{id:"switchboard-chat",name:"Chat",description:"Chat / code-gen via OpenAI, Anthropic, or Responses formats — streaming, tools, combo as model.",endpoint:"/v1/chat/completions",icon:"chat"}];function i(e){return`/api/skills/${e}`}function r(e){return`/dashboard/skills/${e}`}},49137:(e,t,s)=>{Promise.resolve().then(s.bind(s,36072))}},e=>{e.O(0,[2574,3862,782,8500,2280,1321,7592,5497,8441,3794,7358],()=>e(e.s=49137)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9839],{46357:(e,t,a)=>{Promise.resolve().then(a.bind(a,70323))},70323:(e,t,a)=>{"use strict";a.d(t,{default:()=>x});var s=a(95155),r=a(12115),l=a(35497),n=a(11059),i=a(73006);let o=["zh-CN"],d=[{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}],c=[{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"}];var m=a(78559);function x(){let e,[t,a]=(0,r.useState)(!0),[x,h]=(0,r.useState)(!1),[p,u]=(0,r.useState)(8),[f,b]=(0,r.useState)({entries:0,hits:0,bytesSaved:0}),j=(0,r.useRef)({}),[y,v]=(0,r.useState)(!1),[g,N]=(0,r.useState)("http://localhost:8787"),[k,w]=(0,r.useState)({installed:!1,running:!1,python:null,loading:!0}),[C,S]=(0,r.useState)(!1),[E,L]=(0,r.useState)(!1),[B,U]=(0,r.useState)(""),[T,_]=(0,r.useState)(!1),[M,$]=(0,r.useState)("full"),[H,P]=(0,r.useState)(!1),[O,F]=(0,r.useState)("full"),[R,z]=(0,r.useState)("en"),{copied:D,copy:K}=(0,n.C)();(0,r.useEffect)(()=>(z((0,i.kk)()),(0,i.oQ)(()=>z((0,i.kk)()))),[]);let I=o.includes(R),A=I?d:d.filter(e=>!e.wenyan);(0,r.useEffect)(()=>{let e=d.find(e=>e.id===M);e?.wenyan&&!I&&($("ultra"),W({cavemanLevel:"ultra"}))},[I,M]);let W=async e=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){(0,m.s)("Error updating setting:",e)}},G=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&a(e)}catch(e){(0,m.s)("Error updating rtkEnabled:",e)}},J=async()=>{let e=g.trim()||"http://localhost:8787";N(e),await W({headroomUrl:e}),Z()},Y=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/token-saver/vault-stats",{headers:{"Cache-Control":"no-store"}});e.ok&&b(await e.json())}catch{}},[]),Z=(0,r.useCallback)(async()=>{w(e=>({...e,loading:!0}));try{let e=await fetch("/api/headroom/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();w({...t,loading:!1})}catch{w({installed:!1,running:!1,python:null,loading:!1})}},[]),q=(0,r.useCallback)(async()=>{U(""),L(!0);try{let e=await fetch("/api/headroom/start",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Failed to start proxy");await Z()}catch(e){U(e.message)}finally{L(!1)}},[Z]),Q=(0,r.useCallback)(async()=>{L(!0);try{await fetch("/api/headroom/stop",{method:"POST"}),await Z()}finally{L(!1)}},[Z]);(0,r.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/settings");if(e.ok){let t=await e.json();a(!1!==t.rtkEnabled),j.current=t.tokenSaver&&"object"==typeof t.tokenSaver?t.tokenSaver:{},h(!!t.tokenSaver?.vault),u(t.tokenSaver?.vaultThresholdKB??8),v(!!t.headroomEnabled),N(t.headroomUrl||"http://localhost:8787"),_(!!t.cavemanEnabled),$(t.cavemanLevel||"full"),P(!!t.ponytailEnabled),F(t.ponytailLevel||"full"),Z()}}catch{}})()},[Z]),(0,r.useEffect)(()=>{Y()},[Y]);let V=!!k.running,X=k.loading?"Checking…":V?"Running":!1===k.localUrl||k.installed?!1!==k.localUrl?"Stopped":"External":"Not installed",ee=!1!==k.localUrl,et=!!k.canStart,ea=ee&&!!k.managedPid;return(0,s.jsxs)("div",{className:"space-y-6 p-6",children:[(0,s.jsxs)(l.Zp,{id:"rtk",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,s.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,s.jsx)(l.lM,{checked:t,onChange:()=>G(!t)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-4 border-b border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress context"," ",(0,s.jsx)("a",{href:"https://github.com/chopratejas/headroom",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Headroom)"})]}),(0,s.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${V?"bg-success/15 text-success":"bg-warning/15 text-warning"}`,children:X}),(0,s.jsx)("button",{type:"button",onClick:()=>S(!0),className:"text-xs text-primary underline hover:opacity-80",children:V?"Manage":"Setup"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Compress prompts via /v1/compress before routing to the model"})]}),(0,s.jsx)(l.lM,{checked:y&&V,disabled:!V,onChange:()=>{var e;let t;return e=!y,void(N(t=g.trim()||"http://localhost:8787"),v(e),W({headroomEnabled:e,headroomUrl:t}))}})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,s.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[T&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:A.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;$(t=e.id),W({cavemanLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${M===e.id?"bg-primary text-on-primary border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:d.find(e=>e.id===M)?.desc})]}),(0,s.jsx)(l.lM,{checked:T,onChange:()=>{var e;_(e=!T),W({cavemanEnabled:e})}})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Lazy senior dev"," ",(0,s.jsx)("a",{href:"https://github.com/DietrichGebert/ponytail",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Ponytail)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Bias the model toward minimal code: YAGNI, reuse stdlib, deletion over addition"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[H&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:c.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;F(t=e.id),W({ponytailLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${O===e.id?"bg-primary text-on-primary border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:c.find(e=>e.id===O)?.desc})]}),(0,s.jsx)(l.lM,{checked:H,onChange:()=>{var e;P(e=!H),W({ponytailEnabled:e})}})]})]})]}),(0,s.jsxs)(l.Zp,{id:"vault",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary",children:"inventory_2"}),"Conversation Vault"]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"font-medium",children:"Externalize large tool results"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Store full results outside the conversation and search them when needed"})]}),(0,s.jsx)(l.lM,{checked:x,onChange:()=>{var e;let t;return e=!x,t={...j.current,vault:e},void(j.current=t,h(e),W({tokenSaver:t}))}})]}),(0,s.jsx)("div",{className:"py-4 border-b border-border",children:(0,s.jsx)(l.pd,{label:"Externalize tool results larger than (KB)",type:"number",min:7,step:1,value:p,onChange:e=>u(e.target.value),onBlur:()=>{let e=Math.max(7,Number.parseInt(p,10)||8),t={...j.current,vaultThresholdKB:e};j.current=t,u(e),W({tokenSaver:t})},className:"max-w-xs"})}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex items-center gap-6 text-sm",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Entries stored"}),(0,s.jsx)("p",{className:"font-mono font-medium",children:f.entries})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Search hits"}),(0,s.jsx)("p",{className:"font-mono font-medium",children:f.hits})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Bytes saved"}),(0,s.jsx)("p",{className:"font-mono font-medium",children:!Number.isFinite(e=Number(f.bytesSaved))||e<=0?"0 B":e<1024?`${Math.round(e)} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`})]})]}),(0,s.jsx)("button",{type:"button",onClick:Y,className:"text-xs text-primary underline hover:opacity-80",children:"Refresh"})]})]}),(0,s.jsx)(l.aF,{isOpen:C,title:V?"Headroom":"Setup Headroom",onClose:()=>S(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsx)("span",{className:V?"text-success":"text-warning",children:X})]}),V&&(0,s.jsx)("a",{href:"/api/headroom/proxy/dashboard",target:"_blank",rel:"noreferrer",className:"w-full rounded border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Headroom Dashboard"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Proxy URL"}),(0,s.jsx)(l.pd,{value:g,onChange:e=>N(e.target.value),onBlur:J,placeholder:"http://localhost:8787",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a local proxy for Start/Stop, or an external Docker sidecar like http://headroom:8787."})]}),ea?(0,s.jsx)(l.$n,{onClick:Q,variant:"ghost",fullWidth:!0,disabled:E,children:E?"Stopping…":"Stop Headroom"}):V?(0,s.jsx)("p",{className:"text-sm text-success",children:"Headroom proxy is reachable. You can enable the token saver."}):et?(0,s.jsx)(l.$n,{onClick:q,fullWidth:!0,disabled:E,children:E?"Starting…":"Start Headroom"}):ee?k.python?(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Install then click Start:"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("pre",{className:"flex-1 rounded bg-black/5 dark:bg-white/5 p-2 text-xs font-mono overflow-x-auto",children:'pip install "headroom-ai[proxy]"'}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>K('pip install "headroom-ai[proxy]"'),children:D?"Copied":"Copy"})]})]}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Python ≥ 3.10 required for local managed mode. Install Python first, or use an external proxy URL."}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Start Headroom separately at the configured URL, then recheck."}),B&&(0,s.jsx)("p",{className:"text-sm text-warning",children:B}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.$n,{onClick:()=>Z(),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(l.$n,{onClick:()=>S(!1),fullWidth:!0,children:"Done"})]})]})})]})}}},e=>{e.O(0,[2574,3862,782,8500,2280,1321,7592,5497,8441,3794,7358],()=>e(e.s=46357)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3528],{5214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=n(17828)},17828:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,n(64054).createAsyncLocalStorage)()},21957:(e,t,n)=>{"use strict";function r({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return r}}),n(95155),n(47650),n(5214),n(2451),n(53887)},41112:(e,t,n)=>{"use strict";function r({reason:e,children:t}){return t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),n(1980)},51473:(e,t,n)=>{Promise.resolve().then(n.bind(n,69472))},64054:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={bindSnapshot:function(){return i},createAsyncLocalStorage:function(){return l},createSnapshot:function(){return d}};for(var r in n)Object.defineProperty(t,r,{enumerable:!0,get:n[r]});let a=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class s{disable(){throw a}getStore(){}run(){throw a}exit(){throw a}enterWith(){throw a}static bind(e){return e}}let o="u">typeof globalThis&&globalThis.AsyncLocalStorage;function l(){return o?new o:new s}function i(e){return o?o.bind(e):s.bind(e)}function d(){return o?o.snapshot():function(e,...t){return e(...t)}}},68635:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let r=n(95155),a=n(12115),s=n(41112);function o(e){return{default:e&&"default"in e?e.default:e}}n(21957);let l={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},i=function(e){let t={...l,...e},n=(0,a.lazy)(()=>t.loader().then(o)),i=t.loading;function d(e){let o=i?(0,r.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,d=l?a.Suspense:a.Fragment,c=t.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(d,{...l?{fallback:o}:{},children:c})}return d.displayName="LoadableComponent",d}},69472:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>f});var r=n(95155),a=n(12115),s=n(35497),o=n(11059),l=n(75707),i=n.n(l),d=n(78559);let c=i()(()=>n.e(8202).then(n.bind(n,28202)),{loadableGenerated:{webpack:()=>[28202]},ssr:!1}),u=[{id:1,label:"Client Request",file:"1_req_client.json",lang:"json",desc:"Raw request from client"},{id:2,label:"Source Body",file:"2_req_source.json",lang:"json",desc:"After initial conversion"},{id:3,label:"OpenAI Intermediate",file:"3_req_openai.json",lang:"json",desc:"source → openai"},{id:4,label:"Target Request",file:"4_req_target.json",lang:"json",desc:"openai → target + URL + headers"},{id:5,label:"Provider Response",file:"5_res_provider.txt",lang:"text",desc:"Raw SSE from provider"},{id:6,label:"OpenAI Response",file:"6_res_openai.txt",lang:"text",desc:"target → openai (response)"},{id:7,label:"Client Response",file:"7_res_client.txt",lang:"text",desc:"Final response to client"}],p={minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0};function f(){let[e,t]=(0,a.useState)({}),[n,l]=(0,a.useState)({1:!0}),[i,f]=(0,a.useState)({}),[x,g]=(0,a.useState)(null),h=(e,t)=>f(n=>({...n,[e]:t})),b=(e,n)=>t(t=>({...t,[e]:n})),y=e=>l(t=>{let n={};return u.forEach(e=>{n[e.id]=!1}),n[e]=!0,n}),j=async e=>{let t=u.find(t=>t.id===e);h(`load-${e}`,!0);try{let n=await fetch(`/api/translator/load?file=${t.file}`),r=await n.json();r.success?(b(e,r.content),1===e&&await _(r.content)):(0,d.s)(r.error||"File not found")}catch(e){(0,d.s)(e.message)}h(`load-${e}`,!1)},_=async e=>{try{let t="string"==typeof e?JSON.parse(e):e,n=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:1,body:t})}),r=await n.json();r.success&&g(r.result)}catch{}},v=(e,t)=>fetch("/api/translator/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,content:t})}).catch(()=>{}),O=async()=>{h("toOpenAI",!0);try{let t=e[1],n=JSON.parse(t);v("1_req_client.json",t),v("2_req_source.json",JSON.stringify({timestamp:new Date().toISOString(),headers:{},body:n.body||n},null,2));let r=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:2,body:n})}),a=await r.json();if(!a.success)return void(0,d.s)(a.error);let s=JSON.stringify(a.result.body,null,2);b(3,s),y(3)}catch(e){(0,d.s)(e.message)}h("toOpenAI",!1)},S=async()=>{h("toTarget",!0);try{let t=e[3],n=JSON.parse(t);v("3_req_openai.json",t);let r=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:3,body:{...n,provider:x?.provider,model:x?.model}})}),a=await r.json();if(!a.success)return void(0,d.s)(a.error);let s={...a.result,provider:x?.provider,model:x?.model};b(4,JSON.stringify(s,null,2)),y(4)}catch(e){(0,d.s)(e.message)}h("toTarget",!1)},w=async()=>{h("send",!0);try{let t=e[4],n=JSON.parse(t);v("4_req_target.json",t);let r=n.provider||x?.provider,a=n.model||x?.model;if(!r||!a)return void(0,d.s)("Missing provider or model. Please run step 1 first to detect them.");let s=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,model:a,body:n.body||n})});if(!s.ok){let e=await s.json().catch(()=>({error:s.statusText}));(0,d.s)(e.error||"Send failed");return}let o=s.body.getReader(),l=new TextDecoder,i="";for(;;){let{done:e,value:t}=await o.read();if(e)break;i+=l.decode(t,{stream:!0})}b(5,i),y(5),await fetch("/api/translator/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:"5_res_provider.txt",content:i})})}catch(e){(0,d.s)(e.message)}finally{h("send",!1)}},{copy:N}=(0,o.C)(),P=async t=>{e[t]&&N(e[t],`translator-step-${t}`)};return(0,r.jsxs)("div",{className:"p-8 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Translator Debug"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Replay request flow — matches log files"})]}),x&&(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap justify-end",children:[(0,r.jsx)(m,{label:"src",value:x.sourceFormat,color:"blue"}),(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,r.jsx)(m,{label:"dst",value:x.targetFormat,color:"orange"}),(0,r.jsx)(m,{label:"provider",value:x.provider,color:"green"}),(0,r.jsx)(m,{label:"model",value:x.model,color:"purple"})]})]}),u.map(t=>{var a;let o=1===(a=t.id)?(0,r.jsx)(s.$n,{size:"sm",icon:"arrow_forward",loading:i.toOpenAI,onClick:O,children:"→ OpenAI"}):3===a?(0,r.jsx)(s.$n,{size:"sm",icon:"arrow_forward",loading:i.toTarget,onClick:S,children:"→ Target"}):4===a?(0,r.jsx)(s.$n,{size:"sm",icon:"send",loading:i.send,onClick:w,children:"Send"}):null,d=!!n[t.id],u=e[t.id]||"";return(0,r.jsx)(s.Zp,{children:(0,r.jsxs)("div",{className:"p-4 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("button",{onClick:()=>{let e;return e=t.id,l(t=>({...t,[e]:!t[e]}))},className:"flex items-center gap-2 flex-1 text-left group",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px] text-text-muted group-hover:text-primary transition-colors",children:d?"expand_more":"chevron_right"}),(0,r.jsx)("span",{className:"text-xs font-mono text-text-muted/60 w-4",children:t.id}),(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:t.label}),(0,r.jsx)("span",{className:"text-xs text-text-muted/60 font-mono",children:t.file}),u&&(0,r.jsxs)("span",{className:"text-xs text-green-500",children:["(",u.length," chars)"]})]}),!d&&(0,r.jsxs)("div",{className:"flex gap-1 shrink-0",children:[(0,r.jsx)(s.$n,{size:"sm",variant:"ghost",icon:"folder_open",loading:i[`load-${t.id}`],onClick:()=>j(t.id)}),o]})]}),d&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,r.jsx)(c,{height:"400px",defaultLanguage:"text"===t.lang?"plaintext":"json",value:u,onChange:e=>{b(t.id,e||""),1===t.id&&_(e||"")},theme:"vs-dark",options:p})}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,r.jsx)(s.$n,{size:"sm",variant:"outline",icon:"folder_open",loading:i[`load-${t.id}`],onClick:()=>j(t.id),children:"Load"}),(0,r.jsx)(s.$n,{size:"sm",variant:"outline",icon:"data_object",onClick:()=>(t=>{try{let n=JSON.parse(e[t]);b(t,JSON.stringify(n,null,2))}catch{}})(t.id),children:"Format"}),(0,r.jsx)(s.$n,{size:"sm",variant:"outline",icon:"content_copy",onClick:()=>P(t.id),children:"Copy"}),o]})]})]})},t.id)})]})}function m({label:e,value:t,color:n}){return(0,r.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-mono ${{blue:"bg-blue-500/10 text-blue-500",orange:"bg-orange-500/10 text-orange-500",green:"bg-green-500/10 text-green-500",purple:"bg-purple-500/10 text-purple-500"}[n]}`,children:[(0,r.jsxs)("span",{className:"text-text-muted/70 font-sans text-[10px]",children:[e,":"]}),t]})}},75707:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let r=n(73623)._(n(68635));function a(e,t){let n={};"function"==typeof e&&(n.loader=e);let a={...n,...t};return(0,r.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{e.O(0,[2574,3862,782,8500,2280,1321,7592,5497,8441,3794,7358],()=>e(e.s=51473)),_N_E=e.O()}]);